Jump to content
iCoredump

[HowTo] Add new armor effects to the binary

Recommended Posts

Hi everyone,
 
In this thread I will show you how to add new armor effects to the binary.
 
 
Open InstanceBase.cpp and search for this:
	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 (refine < 7)	//ÇöÀç Á¦·Ãµµ 7 ÀÌ»ó¸¸ ÀÌÆåÆ®°¡ ÀÖ½À´Ï´Ù.
			return 0;

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

Replace with this:

	case CItemData::ITEM_TYPE_ARMOR:
		__ClearArmorRefineEffect();

		// °©¿Ê Ưȭ ÀÌÆåÆ®
		if (pItem->GetSubType() == CItemData::ARMOR_BODY)
		{
			DWORD vnum = pItem->GetIndex();
			// color armors [blue shining] - DEFAULT
			if (vnum >= 12010 && vnum <= 12019 || //Blaustahlpanzer
				vnum >= 12020 && vnum <= 12029 || //Blauer Drachenanzug
				vnum >= 12030 && vnum <= 12039 || //Auraplattenpanzer
				vnum >= 12040 && vnum <= 12049)   //Kleidung des Drachen
			{
				__AttachEffect(EFFECT_REFINED + EFFECT_BODYARMOR_SPECIAL); //effect 19 bubble
				__AttachEffect(EFFECT_REFINED + EFFECT_BODYARMOR_SPECIAL2); //effect 20 blue shining
			}
//Beginning NEW ARMOR - [New Effect] - NEW ARMOR
			if (vnum == Item-ID? ||
				vnum == Item-ID? ||
				vnum == Item-ID? ||
				vnum == Item-ID? ||
				vnum == Item-ID? ||
				vnum == Item-ID? ||
				vnum == Item-ID? ||
				vnum == Item-ID?)
			{
				__AttachEffect(EFFECT_REFINED + EFFECT_BODYARMOR_NEW_SPECIAL1); //effect 19 NEW EFFECT
				__AttachEffect(EFFECT_REFINED + EFFECT_BODYARMOR_NEW_SPECIAL2); //effect 21 NEW EFFECT
				__AttachEffect(EFFECT_REFINED + EFFECT_BODYARMOR_REFINED9); //effect 18 sparkle 9 effect
			}			
//End NEW ARMOR - [New Effect] - NEW ARMOR
		}
		if (refine < 7)	//ÇöÀç Á¦·Ãµµ 7 ÀÌ»ó¸¸ ÀÌÆåÆ®°¡ ÀÖ½À´Ï´Ù.
			return 0;

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

Open InstanceBase.h and search for this:

EFFECT_BODYARMOR_SPECIAL,
EFFECT_BODYARMOR_SPECIAL2,
 
Add the new lines with the new effects name and go over with the mouse to see the position of the effect in the enum. 
Example:
EFFECT_BODYARMOR_SPECIAL = 19
EFFECT_BODYARMOR_SPECIAL2 = 20
EFFECT_BODYARMOR_NEW_SPECIAL1 = 21
EFFECT_BODYARMOR_NEW_SPECIAL2 = 22

Open the playersettingmodule.py and add the new effects 

chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+19, "Bip01", "D:/ymir work/pc/common/effect/armor/armor-4-2-1.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+20, "Bip01", "D:/ymir work/pc/common/effect/armor/armor-4-2-2.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+21, "Bip01", "D:/ymir work/pc/common/effect/armor/armor-effect-new1.mse")
chrmgr.RegisterEffect(chrmgr.EFFECT_REFINED+22, "Bip01", "D:/ymir work/pc/common/effect/armor/armor-effect-new2.mse")

After you did it pack the root.epk/eix and compile the binary.

 

  • Love 25

Share this post


Link to post

Thanks for your feedback Shichirojii, Mehti and I hope the other people on metin2dev can use too. ;)

  • Love 2

Share this post


Link to post

I just wanted to know wich files that is xd

I never dealt with this type of thing before, but i want to learn.

Share this post


Link to post

Yes. Therefor is the function search in files... xD

 

Just search a part of the function described at top with notepad++ and the file name will be showed ;)

  • Love 1

Share this post


Link to post

It is possible write this on 34k for diff?

Share this post


Link to post

You would have to make a jump to an unused function and overwrite that one with the if from above then jump back. Cause you cant insert lines by dif.. just change them

  • Love 2

Share this post


Link to post

You would have to make a jump to an unused function and overwrite that one with the if from above then jump back. Cause you cant insert lines by dif.. just change them

thank you..;)

Share this post


Link to post

Wats this InstanceBase.cpp and how i can open it? 

Thanks

UP 

Who can change shining in source for me ? Or who can give me a source 34083 binary?

I would be very grateful.

Please white on skype : vad1m.yankovsk1y

Share this post


Link to post

 

Wats this InstanceBase.cpp and how i can open it? 

Thanks

UP 

Who can change shining in source for me ? Or who can give me a source 34083 binary?

I would be very grateful.

Please white on skype : vad1m.yankovsk1y

 

Source ~37k+ but mainly 40k+

Share this post


Link to post

if you edit this, for weapons works, but when u unequip the weapon, the shine continues.

 

 

Share this post


Link to post

how can i do this in a weapon ?

	case CItemData::ITEM_TYPE_WEAPON:
		__ClearWeaponRefineEffect();		
		if (refine < 7)	//ÇöÀç Á¦·Ãµµ 7 ÀÌ»ó¸¸ ÀÌÆåÆ®°¡ ÀÖ½À´Ï´Ù.
			return 0;
		switch(pItem->GetSubType())
		{
		case CItemData::WEAPON_DAGGER:
			m_swordRefineEffectRight = EFFECT_REFINED+EFFECT_SMALLSWORD_REFINED7+refine-7;
			m_swordRefineEffectLeft = EFFECT_REFINED+EFFECT_SMALLSWORD_REFINED7_LEFT+refine-7;
			break;
		case CItemData::WEAPON_FAN:
			m_swordRefineEffectRight = EFFECT_REFINED+EFFECT_FANBELL_REFINED7+refine-7;
			break;
		case CItemData::WEAPON_ARROW:
		case CItemData::WEAPON_BELL:
			m_swordRefineEffectRight = EFFECT_REFINED+EFFECT_SMALLSWORD_REFINED7+refine-7;
			break;
		case CItemData::WEAPON_BOW:
			m_swordRefineEffectRight = EFFECT_REFINED+EFFECT_BOW_REFINED7+refine-7;
			break;
		default:
			m_swordRefineEffectRight = EFFECT_REFINED+EFFECT_SWORD_REFINED7+refine-7;
		}
		if (m_swordRefineEffectRight)
			m_swordRefineEffectRight = __AttachEffect(m_swordRefineEffectRight);
		if (m_swordRefineEffectLeft)
			m_swordRefineEffectLeft = __AttachEffect(m_swordRefineEffectLeft);
		break;

????

Share this post


Link to post

This work perfect but in costumes not work the shinings, can try fix put shinings on costumes please? thanks!.

Share this post


Link to post

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.

×
×
  • 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.