Jump to content

Sanii Shining System Without Python w/ Weapon Costumes


Recommended Posts

  • Bronze

M2 Download Center

This is the hidden content, please
( Internal )

Hello since i was looking for this system and it was "hard" to find it because Sanii's page is gone,

i had to put it together taking bits of code from here and there.

It is full with all the fixes and working with armor and weapon costumes.

giphy.gif

With this system you can assign an .mse file to a Vnum via 1 single .txt file

It is a nice system so everyone should be able to use it. 

Only thing left is to adapt it for Sash's/Wing's if someone want's to do that i can post it here.

Have fun.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 266
  • kekw 7
  • Eyes 4
  • Angry 3
  • Not Good 3
  • Cry 1
  • Think 3
  • Confused 4
  • Scream 2
  • Lmao 5
  • Good 113
  • Love 17
  • Love 164
Link to comment
Share on other sites

  • Bronze
48 minutes ago, MrQuin said:

His original one had no problem, TF are you talking about xD

Read the post again i never said the original one had a problem it was just hard to find the system and the one i found was incomplete so i had do sanii's fixes and decided to post all together for ease of acess for everyone and i've heard of people trying to sell this so now it should not be a problem xd

Edited by zMyth
Link to comment
Share on other sites

8 hours ago, zMyth said:

M2 Download Center

This is the hidden content, please
( Internal )

Hello since i was looking for this system and it was "hard" to find it because Sanii's page is gone,

i had to put it together taking bits of code from here and there.

It is full with all the fixes and working with armor and weapon costumes.

giphy.gif

With this system you can assign an .mse file to a Vnum via 1 single .txt file

It is a nice system so everyone should be able to use it. 

Only thing left is to adapt it for Sash's/Wing's if someone want's to do that i can post it here.

Have fun.

  Reveal hidden contents

Dl - 

This is the hidden content, please

VT - 
This is the hidden content, please

 

I have the original system. And he had a very serious problem that was ... if you have to use the hide costume the effects would not hide. In this you have the correction of that?

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 8
  • Eyes 2
  • Not Good 2
  • Scream 1
  • Good 4
  • Love 7
Link to comment
Share on other sites

  • Bronze
On 4/25/2021 at 8:29 PM, Creo said:

i was looking for solution for original code

i have problem with dagger/fan weapons, when i go on mount it only shows one weapons, and second problem is when i wear animation weapon and unwear it shows weapon animation and original weapon.. someone?

With this that problem is not hapenning only if u did something wrong

Link to comment
Share on other sites

  • 2 weeks later...
On 5/4/2021 at 7:07 PM, Artvr3 said:

mchHPOO.png

If your weapon ShiningEffect dont work just check bracket (red color on screenshot)

 

On 4/26/2021 at 11:44 PM, zMyth said:

With this that problem is not hapenning only if u did something wrong

it looks like that

https://metin2.download/picture/r8YLJr92yRRkobgMnFhriIY8x698cxga/.png

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 6
  • Angry 2
  • Sad 1
  • Lmao 1
  • Good 4
  • Love 3
  • Love 2
Link to comment
Share on other sites

    

@Creo
my previous message was for the user @eeevil123 bcs I have some problem with that bracket.

You should check the files  InstanceBase.h and just double check all.

#ifdef ENABLE_SHINING_SYSTEM
		//2-Dimensions for Left & Right sided effects
		DWORD					m_weaponShiningEffects[2][CItemData::ITEM_SHINING_MAX_COUNT];
		DWORD					m_armorShiningEffects[CItemData::ITEM_SHINING_MAX_COUNT];
#endif


Also core function is in instanceBase.cpp  you should focus on this file to find the problem

					//Check for double sided weapons or fan which is attached on both sides when mounted.
#ifdef ENABLE_WOLFMAN
					bool twoSidedWeapon = bSubType == CItemData::WEAPON_DAGGER || (IsMountingHorse() && bSubType == CItemData::WEAPON_FAN) || bSubType == CItemData::WEAPON_CLAW;
#else
					bool twoSidedWeapon = bSubType == CItemData::WEAPON_DAGGER || (IsMountingHorse() && bSubType == CItemData::WEAPON_FAN);
#endif
					if (twoSidedWeapon)
					{
						__AttachWeaponShiningEffect(i, shiningTable.szShinings[i], "PART_WEAPON_LEFT");
					}
					__AttachWeaponShiningEffect(i, shiningTable.szShinings[i], "PART_WEAPON");


I use the same system and works perfectly fine after a few changes because I had to adjust it to my files

https://metin2.download/picture/3MY406p4yQ8bdK65bxFO0LDM3F41dE7H/.gifv
 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 7
  • Not Good 1
  • Think 1
  • Good 4
  • Love 4
  • Love 1
Link to comment
Share on other sites

On 4/26/2021 at 10:44 PM, eeevil123 said:

the effects on the weapons are not seen 😕

I have a problem the effects on the weapons are not seen and the effects on the armor yes

spacer.png

 

Same problem. The effect doesnt show and the sysser are empty. Maybe the configuration is wrong. If / When i discover what happen i will update the topic.

 

FIX: The system is incomplete and there are bugs made on purpose, here I leave the resolution:

 

 

Locale_inc.h

ADD:

#define ENABLE_SHINING_SYSTEM

 

PythonApplication.cpp

Find: if (!rkItemMgr.Loa******ngTable(szShiningTable))

and replace with:

if (!rkItemMgr.LoadShiningTable(szShiningTable))

 

And at InstanceBase.cpp

Add the bracket (red color on screenshot)

mchHPOO.png

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
  • Not Good 1
  • Love 1
Link to comment
Share on other sites

  • 1 month later...

 

Would it be possible to adapt this system for use with an item? For example, create a new item with type 35+ and subtype 1 (armor) 2 (weapon)? I was thinking of not writing the item ID to the file, but the ID of the item that equips you with the effect with the subtype. For an example, take a look at Tamashii's effect system.

Link to comment
Share on other sites

  • 3 weeks later...

I found another bug, but I think last.. (deep tested)

InstanceBase.cpp

bool removeRefineEffect = true;

This doesn't work on armor.. Any solution? Trying solved this, but I failed in it.. I think problem is SetArmor..

Here if anyone want check it // + for others, everything here is fixed except this little thing.

Spoiler
void CInstanceBase::__GetShiningEffect(CItemData* pItem)
{
    bool removeRefineEffect = true;
 
    CItemData::TItemShiningTable shiningTable = pItem->GetItemShiningTable();
 
    if (pItem->GetType() == CItemData::ITEM_TYPE_WEAPON || (pItem->GetType() == CItemData::ITEM_TYPE_COSTUME && pItem->GetSubType() == CItemData::COSTUME_WEAPON))
    {
        BYTE bSubType = pItem->GetType() == CItemData::ITEM_TYPE_COSTUME && pItem->GetSubType() == CItemData::COSTUME_WEAPON ? pItem->GetValue(3) : pItem->GetSubType();
 
        __ClearWeaponShiningEffect();
 
        if (shiningTable.Any() && removeRefineEffect)
        {
            __ClearWeaponRefineEffect();
        }
 
        for (int i = 0; i < CItemData::ITEM_SHINING_MAX_COUNT; i++)
        {
            if (strcmp(shiningTable.szShinings[i], ""))
            {
                if (bSubType == CItemData::WEAPON_BOW)
                {
                    __AttachWeaponShiningEffect(i, shiningTable.szShinings[i], "PART_WEAPON_LEFT");
                }
                else
                {
                    bool twoSidedWeapon = bSubType == CItemData::WEAPON_DAGGER || (IsMountingHorse() && bSubType == CItemData::WEAPON_FAN);
 
                    if (twoSidedWeapon)
                    {
                        __AttachWeaponShiningEffect(i, shiningTable.szShinings[i], "PART_WEAPON_LEFT");
                    }
 
                    __AttachWeaponShiningEffect(i, shiningTable.szShinings[i], "PART_WEAPON");
                }
            }
        }
    }
 
    if ((pItem->GetType() == CItemData::ITEM_TYPE_ARMOR && pItem->GetSubType() == CItemData::ARMOR_BODY) || (pItem->GetType() == CItemData::ITEM_TYPE_COSTUME && pItem->GetSubType() == CItemData::COSTUME_BODY))
    {
        __ClearArmorShiningEffect();
 
        if (shiningTable.Any() && removeRefineEffect)
        {
            __ClearArmorRefineEffect();
        }
 
        for (int i = 0; i < CItemData::ITEM_SHINING_MAX_COUNT; i++)
        {
            if (strcmp(shiningTable.szShinings[i], ""))
            {
                __AttachArmorShiningEffect(i, shiningTable.szShinings[i]);
            }
        }
    }
}
 
void CInstanceBase::__AttachWeaponShiningEffect(int effectIndex, const char* effectFileName, const char* boneName)
{
    if (IsAffect(AFFECT_INVISIBILITY))
    {
        return;
    }
 
    if (effectIndex >= CItemData::ITEM_SHINING_MAX_COUNT)
    {
        return;
    }
 
    CEffectManager::Instance().RegisterEffect(effectFileName, false, false);
 
    if (!strcmp(boneName, "PART_WEAPON"))
    {
        const char* c_szRightBoneName;
 
        m_GraphicThingInstance.GetAttachingBoneName(CRaceData::PART_WEAPON, &c_szRightBoneName);
 
        if (strcmp(c_szRightBoneName, ""))
        {
            m_weaponShiningEffects[0][effectIndex] = m_GraphicThingInstance.AttachEffectByName(0, c_szRightBoneName, effectFileName);
        }
    }
    else if (!strcmp(boneName, "PART_WEAPON_LEFT"))
    {
        const char* c_szLeftBoneName;
 
        m_GraphicThingInstance.GetAttachingBoneName(CRaceData::PART_WEAPON_LEFT, &c_szLeftBoneName);
 
        if (strcmp(c_szLeftBoneName, ""))
        {
            m_weaponShiningEffects[1][effectIndex] = m_GraphicThingInstance.AttachEffectByName(0, c_szLeftBoneName, effectFileName);
        }
    }
    else
    {
        Tracef("Invalid partname for getting attaching bone name. %s - %s", effectFileName, boneName);
    }
}
 
void CInstanceBase::__AttachArmorShiningEffect(int effectIndex, const char* effectFileName, const char* boneName)
{
    if (IsAffect(AFFECT_INVISIBILITY))
    {
        return;
    }
 
    if (effectIndex >= CItemData::ITEM_SHINING_MAX_COUNT)
    {
        return;
    }
 
    if (!strcmp(boneName, ""))
    {
        Tracef("Empty bone name for attaching armor shining. Effect Index: %i, EffectFileName: %s", effectIndex, effectFileName);
        return;
    }
 
    CEffectManager::Instance().RegisterEffect(effectFileName, false, false);
    m_armorShiningEffects[effectIndex] = m_GraphicThingInstance.AttachEffectByName(0, boneName, effectFileName);
}
 
void CInstanceBase::__ClearWeaponShiningEffect(bool detaching)
{
    if (detaching)
    {
        for (int i = 0; i < CItemData::ITEM_SHINING_MAX_COUNT; i++)
        {
            if (m_weaponShiningEffects[0][i])
            {
                __DetachEffect(m_weaponShiningEffects[0][i]);
            }
            if (m_weaponShiningEffects[1][i])
            {
                __DetachEffect(m_weaponShiningEffects[1][i]);
            }
        }
    }
 
    memset(&m_weaponShiningEffects, 0, sizeof(m_weaponShiningEffects));
}
 
void CInstanceBase::__ClearArmorShiningEffect(bool detaching)
{
    if (detaching)
    {
        for (int i = 0; i < CItemData::ITEM_SHINING_MAX_COUNT; i++)
        {
            if (m_armorShiningEffects[i])
            {
                __DetachEffect(m_armorShiningEffects[i]);
            }
        }
    }
 
    memset(&m_armorShiningEffects, 0, sizeof(m_armorShiningEffects));
}

 

Spoiler
bool CInstanceBase::SetWeapon(DWORD eWeapon)
{
    if (IsPoly())
        return false;
 
    if (__IsShapeAnimalWear())
        return false;
 
    if (__IsChangableWeapon(eWeapon) == false)
        eWeapon = 0;
 
    m_GraphicThingInstance.AttachWeapon(eWeapon);
    m_awPart[CRaceData::PART_WEAPON] = eWeapon;
 
    //Weapon Effect
    CItemData * pItemData;
    if (CItemManager::Instance().GetItemDataPointer(eWeapon, &pItemData))
    {
        if (pItemData->GetType() == CItemData::ITEM_TYPE_COSTUME)
        {
            __ClearWeaponRefineEffect();
            __ClearWeaponShiningEffect();
        }
 
        __GetRefinedEffect(pItemData);
        __GetShiningEffect(pItemData);
    }
    else
    {
        __ClearWeaponRefineEffect();
        __ClearWeaponShiningEffect();
    }
 
    return true;
}
 
void CInstanceBase::SetArmor(DWORD dwArmor)
{
    DWORD dwShape;
    if (__ArmorVnumToShape(dwArmor, &dwShape))
    {
        CItemData * pItemData;
        if (CItemManager::Instance().GetItemDataPointer(dwArmor, &pItemData))
        {
            float fSpecularPower=pItemData->GetSpecularPowerf();
            SetShape(dwShape, fSpecularPower);
            __GetRefinedEffect(pItemData);
            __GetShiningEffect(pItemData);
            return;
        }
        else
        {
            __ClearArmorRefineEffect();
            __ClearArmorShiningEffect();
        }
    }
 
    SetShape(dwArmor);
}

 

 

Edited by Cunoo
  • Metin2 Dev 1
Link to comment
Share on other sites

  • 4 weeks later...
  • Silver
On 7/12/2021 at 7:47 PM, qUakke said:

 

Hi, the system isn't working  on COSTUME_WEAPON, only on armor, weapons, costumes, but on COSTUME_WEAPON there are no effects

Can someone help me ?

You need to change the type etc of an item to the costume item.

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...
  • Bronze

For acce:

You have to do

Instancebase.h

Add this two line:

Search this :        void    __ClearArmorShiningEffect(bool detaching = true);

Add after:

		void	__ClearAcceShiningEffect(bool detaching = true);
		void	__AttachAcceShiningEffect(int effectIndex, const char* effectFileName, const char* boneName = "Bip01");

after that search this one :         DWORD                    m_armorShiningEffects[CItemData::ITEM_SHINING_MAX_COUNT];

add after this:

		DWORD					m_acceShiningEffects[CItemData::ITEM_SHINING_MAX_COUNT];

In InstanceBase.cpp

Search this in     ClearAcceEffect(); in void SetAcce

add after this

#ifdef ENABLE_SHINING_SYSTEM
	__ClearAcceShiningEffect();
#endif

search this     CItemData * pItemData = NULL;
    CItemManager::Instance().GetItemDataPointer(dwAcce, &pItemData); in void SetAcce

#ifdef ENABLE_SHINING_SYSTEM
	if (pItemData)
		__GetShiningEffect(pItemData);
#endif

Replace the whole void __GetShiningEffect with this it will fix costume weapon effect too.

void CInstanceBase::__GetShiningEffect(CItemData* pItem)
{
	bool removeRefineEffect = true;

	CItemData::TItemShiningTable shiningTable = pItem->GetItemShiningTable();

	if (pItem->GetType() == CItemData::ITEM_TYPE_WEAPON)
	{
		__ClearWeaponShiningEffect();
		if (removeRefineEffect)
		{
			__ClearWeaponRefineEffect();
		}

		for (int i = 0; i < CItemData::ITEM_SHINING_MAX_COUNT; i++)
		{
			if (strcmp(shiningTable.szShinings[i], ""))
			{
				bool twoSidedWeapon = pItem->GetSubType() == CItemData::WEAPON_DAGGER || (IsMountingHorse() && pItem->GetSubType() == CItemData::WEAPON_FAN);
				if (twoSidedWeapon)
				{
					__AttachWeaponShiningEffect(i, shiningTable.szShinings[i], "PART_WEAPON_LEFT");
				}

				if (pItem->GetSubType() == CItemData::WEAPON_BOW)
					__AttachWeaponShiningEffect(i, shiningTable.szShinings[i], "PART_WEAPON_LEFT");
				else
					__AttachWeaponShiningEffect(i, shiningTable.szShinings[i], "PART_WEAPON");
			}
		}
	}
#ifdef ENABLE_COSTUME_SYSTEM
	else if (pItem->GetType() == CItemData::ITEM_TYPE_COSTUME)
	{
#ifdef ENABLE_ACCE_COSTUME_SYSTEM
		if (pItem->GetSubType() == CItemData::COSTUME_ACCE)
		{
			for (int i = 0; i < CItemData::ITEM_SHINING_MAX_COUNT; i++)
			{
				if (strcmp(shiningTable.szShinings[i], ""))
				{
					__AttachAcceShiningEffect(i, shiningTable.szShinings[i], "Bip01");
				}
			}
		}
#endif
		else if (pItem->GetSubType() == CItemData::COSTUME_BODY)
		{
			if (removeRefineEffect)
			{
				__ClearArmorRefineEffect();
			}

			for (int i = 0; i < CItemData::ITEM_SHINING_MAX_COUNT; i++)
			{
				if (strcmp(shiningTable.szShinings[i], ""))
				{
					__AttachArmorShiningEffect(i, shiningTable.szShinings[i]);
				}
			}
		}
#ifdef ENABLE_WEAPON_COSTUME_SYSTEM
		else if (pItem->GetSubType() == CItemData::COSTUME_WEAPON)
		{
			__ClearWeaponShiningEffect();
			if (removeRefineEffect)
			{
				__ClearWeaponRefineEffect();
			}

			for (int i = 0; i < CItemData::ITEM_SHINING_MAX_COUNT; i++)
			{
				if (strcmp(shiningTable.szShinings[i], ""))
				{
					bool twoSidedWeapon = pItem->GetValue(3) == CItemData::WEAPON_DAGGER || (IsMountingHorse() && pItem->GetValue(3) == CItemData::WEAPON_FAN);
					if (twoSidedWeapon)
					{
						__AttachWeaponShiningEffect(i, shiningTable.szShinings[i], "PART_WEAPON_LEFT");
					}

					if (pItem->GetValue(3) == CItemData::WEAPON_BOW)
						__AttachWeaponShiningEffect(i, shiningTable.szShinings[i], "PART_WEAPON_LEFT");
					else
						__AttachWeaponShiningEffect(i, shiningTable.szShinings[i], "PART_WEAPON");
				}
			}
		}
#endif
	}
#endif
	else
	{
		if (removeRefineEffect)
		{
			__ClearArmorRefineEffect();
		}

		for (int i = 0; i < CItemData::ITEM_SHINING_MAX_COUNT; i++)
		{
			if (strcmp(shiningTable.szShinings[i], ""))
			{
				__AttachArmorShiningEffect(i, shiningTable.szShinings[i]);
			}
		}
	}
}

paste this to end of the file:

#ifdef ENABLE_SHINING_SYSTEM
#ifdef ENABLE_ACCE_COSTUME_SYSTEM
void CInstanceBase::__AttachAcceShiningEffect(int effectIndex, const char* effectFileName, const char* boneName)
{
	if (IsAffect(AFFECT_INVISIBILITY))
	{
		return;
	}

	if (effectIndex >= CItemData::ITEM_SHINING_MAX_COUNT)
	{
		return;
	}

	if (!strcmp(boneName, ""))
	{
		Tracef("Empty bone name for attaching armor shining. Effect Index: %i, EffectFileName: %s", effectIndex, effectFileName);
		return;
	}

	CEffectManager::Instance().RegisterEffect(effectFileName, false, false);
	m_acceShiningEffects[effectIndex] = m_GraphicThingInstance.AttachEffectByName(0, boneName, effectFileName);
}
#ifdef ENABLE_ACCE_COSTUME_SYSTEM
void CInstanceBase::__ClearAcceShiningEffect(bool detaching)
{
	for (int i = 0; i < CItemData::ITEM_SHINING_MAX_COUNT; i++)
	{
		if (detaching)
		{
			__DetachEffect(m_acceShiningEffects[i]);
		}

		m_acceShiningEffects[i] = 0;
	}
}
#endif
#endif

 

Take care about #defines may I use different. Enjoy it. Cheers.

  • Metin2 Dev 1

giphy.gif

Best regards, Arlinamid

Link to comment
Share on other sites

  • 5 months later...
  • 1 month later...

For item scale sash System:

Instancebase.h
 

Quote

 

Search:
        void    __AttachWeaponShiningEffect(int effectIndex, const char* effectFileName, const char* boneName = "Bip01");
        void    __AttachArmorShiningEffect(int effectIndex, const char* effectFileName, const char* boneName = "Bip01");


Add after:
        void    __ClearSashShiningEffect(bool detaching = true);
        void    __AttachSashShiningEffect(int effectIndex, const char* effectFileName, const char* boneName = "Bip01");

Search:
        m_armorShiningEffects[CItemData::ITEM_SHINING_MAX_COUNT];

Add after:
        DWORD                    m_sashShiningEffects[CItemData::ITEM_SHINING_MAX_COUNT];

 

Instancebase.cpp
 

Quote

 

Search:
void CInstanceBase::SetSash(DWORD dwSash)

In this:
    ClearSashEffect();

Add after:
#ifdef ENABLE_SHINING_SYSTEM
    __ClearSashShiningEffect();
#endif

Search:
    CItemData* pItemData;
    if (!CItemManager::Instance().GetItemDataPointer(dwSash, &pItemData))

Add after: (BEFORE RETURN!)
#ifdef ENABLE_SHINING_SYSTEM
        if (pItemData)
            __GetShiningEffect(pItemData);
#endif

Search:
void CInstanceBase::__GetShiningEffect(CItemData* pItem)

In this:
            }
        }
    }
#endif

Add before:
#ifdef ENABLE_SASH_SYSTEM
    if (pItem->GetSubType() == CItemData::COSTUME_SASH)
    {
        for (int i = 0; i < CItemData::ITEM_SHINING_MAX_COUNT; i++)
        {
            if (strcmp(shiningTable.szShinings[i], ""))
            {
                __AttachSashShiningEffect(i, shiningTable.szShinings[i], "Bip01");
            }
        }
    }
#endif

Search:
void CInstanceBase::__ClearArmorShiningEffect(bool detaching)

Add the last endif before:
 

#ifdef ENABLE_SHINING_SYSTEM
#ifdef ENABLE_SASH_SYSTEM
void CInstanceBase::__AttachSashShiningEffect(int effectIndex, const char* effectFileName, const char* boneName)
{
    if (IsAffect(AFFECT_INVISIBILITY))
    {
        return;
    }

    if (effectIndex >= CItemData::ITEM_SHINING_MAX_COUNT)
    {
        return;
    }

    if (!strcmp(boneName, ""))
    {
        Tracef("Empty bone name for attaching armor shining. Effect Index: %i, EffectFileName: %s", effectIndex, effectFileName);
        return;
    }

    CEffectManager::Instance().RegisterEffect(effectFileName, false, false);
    m_sashShiningEffects[effectIndex] = m_GraphicThingInstance.AttachEffectByName(0, boneName, effectFileName);
}
#ifdef ENABLE_SASH_SYSTEM
void CInstanceBase::__ClearSashShiningEffect(bool detaching)
{
    for (int i = 0; i < CItemData::ITEM_SHINING_MAX_COUNT; i++)
    {
        if (detaching)
        {
            __DetachEffect(m_sashShiningEffects[i]);
        }

        m_sashShiningEffects[i] = 0;
    }
}
#endif
#endif

 

 

Edited by bancsiandris1
Link to comment
Share on other sites

Announcements



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