Jump to content
Maintenance ×
×
×
  • Create New...
  • 0

Item giving armor shining


mateo7788

Question

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.

Link to comment
Share on other sites

  • Answers 6
  • Created
  • Last Reply

Top Posters For This Question

6 answers to this question

Recommended Posts

  • 0

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

  • 0

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

  • 0
  • 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

  • 0
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

  • 0
  • 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Activity

    1. 0

      erorrs after update granny to 2.9

    2. 0

      Navicat Premium 16.1.1 x64

    3. 5

      problem Dargon Soul Changre Attribute

    4. 5

      problem Dargon Soul Changre Attribute

    5. 41

      Global Chat

    6. 5

      problem Dargon Soul Changre Attribute

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.