Jump to content

Item giving armor shining


Recommended Posts

Hi, I can't figure out how to add shining effect to an item when equiped. I was trying to do it like this in InstanceBase.cpp but it doesn't work.

	case CItemData::ITEM_TYPE_RING:

		__ClearArmorRefineEffect();

			DWORD vnum = pItem->GetIndex();

			if (vnum == 70065)
			{
				__AttachEffect(EFFECT_REFINED + EFFECT_BODYARMOR_SPECIAL5);
			}

		break;

Item has type 33 and subtype 0 in DB. I want it to give my character shining like armors do:

fmEfmzl.png

Thanks for help.

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

If i understand you

there is 3 way if that equipped item if it item use (I think the type is 18 quest type -  item)

use cmd code in quest cmd(buff12) you need to add the effect before that search on google how to add effect metin2 python part

the lua part is just code (cmd(xxx)) the xxx is the name of variable that actually call that effect

if you need it just armor you can see video in you tube how add effect (binary) metin2

the second 

you can make event like die event(when die begin) and make it like (when equipped begin)

third

you can make it as timer (this is the point that I didn't understand you need armor or all thing can equip?)

and put function check that if he equip or quary that call the player item and check if he equip

(Im have little information so if there is another and easier way let take this as try from me to help some one)

 

Link to comment
Share on other sites

I was wondering if I could add such an effect in the binary, like i did for armors and costumes:

	case CItemData::ITEM_TYPE_ARMOR:
		__ClearArmorRefineEffect();

		if (pItem->GetSubType() == CItemData::ARMOR_BODY)
		{
			DWORD vnum = pItem->GetIndex();

			if (12010 <= vnum && vnum <= 12049)
			{
				__AttachEffect(EFFECT_REFINED+EFFECT_BODYARMOR_SPECIAL);
				__AttachEffect(EFFECT_REFINED+EFFECT_BODYARMOR_SPECIAL2);
			}
			if (vnum == 20009 || vnum == 20509 || vnum == 20759 || vnum == 20259)
			{
				__AttachEffect(EFFECT_REFINED+EFFECT_BODYARMOR_REFINED9);
				__AttachEffect(EFFECT_REFINED+EFFECT_BODYARMOR_PL);
			}
		}

		if (refine < 7)
			return 0;

		if (pItem->GetSubType() == CItemData::ARMOR_BODY)
		{
			m_armorRefineEffect = EFFECT_REFINED+EFFECT_BODYARMOR_REFINED7+refine-7;
			__AttachEffect(m_armorRefineEffect);
		}
		break;

	case CItemData::ITEM_TYPE_COSTUME:

		__ClearArmorRefineEffect();

		if (pItem->GetSubType() == CItemData::COSTUME_BODY)
		{
			DWORD vnum = pItem->GetIndex();

			if (vnum == 41351 || vnum == 41352)
			{
				__AttachEffect(EFFECT_REFINED + EFFECT_BODYARMOR_SPECIAL5);
			}

			if (vnum == 41353 || vnum == 41354)
			{
				__AttachEffect(EFFECT_REFINED + EFFECT_BODYARMOR_SPECIAL6);
			}
		}
		break;
	}

and I would like to know how could I do it with ITEM_TYPE_RING or is it even possible to do this in the binary?

Link to comment
Share on other sites

  • Honorable Member

 

go to game/src/char_item.cp and search for: else if (true == CItemVnumHelper::IsLovePendant(dwVnum))

after put something like:

if (item->GetVnum() == YOURITEMID)
{
 this->EffectPacket(ARMOR_RING); 
}

Then search for: bool CHARACTER::UnequipItem(LPITEM item)

to this function put this:

if (item->GetVnum() == YOURITEMID)
{
 this->EffectPacket(ARMOR_RING); 
}

 

go to common/length.h and search for: 

SE_EQUIP_LOVE_PENDANT,

then put this under:

ARMOR_RING,

Now you can compile your game.

 

open UserInterface/PythonNetworkStreamPhaseGameItem.cpp in your client source and search for: 

case SE_EQUIP_LOVE_PENDANT:

after put these:

case ARMOR_RING:
			CInstanceBase::ArmorRing();
			break;

Go to InstanceBase.h and search for: void OnUntargeted();

Add under:

void	ArmorRing();

Search for: m_armorRefineEffect;

Add under:

bool					ringeffect;

Now go to InstanceBase.cpp and at the beginning declare it: bool ringeffect = false;

now search for: void CInstanceBase::__ClearArmorRefineEffect()

After this function put this:

void CInstanceBase::ArmorRing()
{
  if (!ringeffect)
  {
	__AttachEffect(EFFECT_REFINED + EFFECT_BODYARMOR_SPECIAL5);
    ringeffect = true;
  }
  else
  {
    __DetachEffect(EFFECT_REFINED + EFFECT_BODYARMOR_SPECIAL5);
    ringeffect = false;
  }
}

Now compile it.

I couldn't test it, cause I'm working now but I think it's gonna work.

WRnRW3H.gif

Link to comment
Share on other sites

Dnia 16.08.2017 o 15:12, Distraught napisał:

 

go to game/src/char_item.cp and search for: else if (true == CItemVnumHelper::IsLovePendant(dwVnum))

after put something like:


if (item->GetVnum() == YOURITEMID)
{
 this->EffectPacket(ARMOR_RING); 
}

Then search for: bool CHARACTER::UnequipItem(LPITEM item)

to this function put this:


if (item->GetVnum() == YOURITEMID)
{
 this->EffectPacket(ARMOR_RING); 
}

 

go to common/length.h and search for: 


SE_EQUIP_LOVE_PENDANT,

then put this under:

ARMOR_RING,

Now you can compile your game.

 

open UserInterface/PythonNetworkStreamPhaseGameItem.cpp in your client source and search for: 


case SE_EQUIP_LOVE_PENDANT:

after put these:


case ARMOR_RING:
			CInstanceBase::ArmorRing();
			break;

Go to InstanceBase.h and search for: void OnUntargeted();

Add under:


void	ArmorRing();

Search for: m_armorRefineEffect;

Add under:


bool					ringeffect;

Now go to InstanceBase.cpp and at the beginning declare it: bool ringeffect = false;

now search for: void CInstanceBase::__ClearArmorRefineEffect()

After this function put this:


void CInstanceBase::ArmorRing()
{
  if (!ringeffect)
  {
	__AttachEffect(EFFECT_REFINED + EFFECT_BODYARMOR_SPECIAL5);
    ringeffect = true;
  }
  else
  {
    __DetachEffect(EFFECT_REFINED + EFFECT_BODYARMOR_SPECIAL5);
    ringeffect = false;
  }
}

Now compile it.

I couldn't test it, cause I'm working now but I think it's gonna work.

Error    1    error C3867: 'CInstanceBase::ArmorRing': function call missing argument list; use '&CInstanceBase::ArmorRing' to create a pointer to member    D:\serwer - pliki\src\client\UserInterface\PythonNetworkStreamPhaseGameItem.cpp    862    1    UserInterface
 

Link to comment
Share on other sites

  • 2 weeks later...
  • Honorable Member

in the pythinnetworkstreamphasegamitem.cpp

modify case ARMOR_RING like this:

case ARMOR_RING:
			CInstanceBase * pInstance = CPythonCharacterManager::Instance().GetInstancePtr(kSpecialEffect.vid);
			pInstance->CInstanceBase::ArmorRing();
			break;

may it gonna work

WRnRW3H.gif

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 60

      Inbuild GR2 Animation

    2. 2

      wait() function bug

    3. 0

      Remove Party Role Bonuses

    4. 1

      Fix CBar3D

    5. 2

      set_quest_state not working

    6. 1

      Fix CBar3D

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.