• 🎉 Hey there! I've just launched my brand new server voting platform — Metin2 P Servers 🚀

Not answered Weapon effect refresh

Member
Oct
Threads
3
27
1
4
3

AD: Mt2009 - Mobile & PC - 30 January 2026 CHECK THE PRESENTATION!

Hello fellas 😊

I'm kinda stuck within the Element Spell | Refine_element system.

The problem is, that when i change weapon, where element spell is added the element effect is not shown. However, when you log on with weapon weared or take on/off armor/costume weapon/costume armor or use costume mount. Then the effect apears.

I personally think, that it is problem on the client side in instancebase.cpp, however I'm able to figure out, where the problem really is.

The effect is call in:

C++:
    //Weapon Effect
    CItemData * pItemData;
    if (CItemManager::Instance().GetItemDataPointer(eWeapon, &pItemData))
    {
        __GetRefinedEffect(pItemData);
    }
    else
    {
        __ClearWeaponRefineEffect();
#ifdef ENABLE_REFINE_ELEMENT
        ClearElementEffect();
#endif
    }
    return true;
}


UINT CInstanceBase::__GetRefinedEffect(CItemData* pItem)
{
#ifdef ENABLE_SIMPLE_REFINED_EFFECT_CHECK
    DWORD refine = pItem->GetRefine();
#else
    DWORD refine = max(pItem->GetRefine() + pItem->GetSocketCount(),CItemData::ITEM_SOCKET_MAX_NUM) - CItemData::ITEM_SOCKET_MAX_NUM;
#endif
    switch (pItem->GetType())
    {
    case CItemData::ITEM_TYPE_WEAPON:
    {
        __ClearWeaponRefineEffect();
#ifdef ENABLE_REFINE_ELEMENT
        AttachElementEffect(pItem);
#endif


void CInstanceBase::AttachElementEffect(const CItemData* pItem)
{
    ClearElementEffect();

    if (GetElementEffect() != 0)
    {
        switch (pItem->GetSubType())
        {
            case CItemData::WEAPON_DAGGER:
                m_swordElementEffectRight = EFFECT_ELEMENTS_WEAPON + EFFECT_ELEMENTS_SMALLSWORD + GetElementEffect();
                m_swordElementEffectLeft = EFFECT_ELEMENTS_WEAPON + EFFECT_ELEMENTS_SMALLSWORD_LEFT + GetElementEffect();
                break;

            case CItemData::WEAPON_FAN:
                m_swordElementEffectRight = EFFECT_ELEMENTS_WEAPON + EFFECT_ELEMENTS_FANBELL + GetElementEffect();
                break;

            case CItemData::WEAPON_ARROW:
            case CItemData::WEAPON_BELL:
                m_swordElementEffectRight = EFFECT_ELEMENTS_WEAPON + EFFECT_ELEMENTS_SMALLSWORD + GetElementEffect();
                break;

            case CItemData::WEAPON_BOW:
                m_swordElementEffectRight = EFFECT_ELEMENTS_WEAPON + EFFECT_ELEMENTS_BOW + GetElementEffect();
                break;

#    ifdef ENABLE_WOLFMAN_CHARACTER
            case CItemData::WEAPON_CLAW:
                m_swordElementEffectRight = EFFECT_ELEMENTS_WEAPON + EFFECT_ELEMENTS_CLAW + GetElementEffect();
                m_swordElementEffectLeft = EFFECT_ELEMENTS_WEAPON + EFFECT_ELEMENTS_CLAW_LEFT + GetElementEffect();
                break;
#    endif
            default:
                m_swordElementEffectRight = EFFECT_ELEMENTS_WEAPON + EFFECT_ELEMENTS_SWORD + GetElementEffect();
        }

        if (m_swordElementEffectRight)
            m_swordElementEffectRight = __AttachEffect(m_swordElementEffectRight);
        if (m_swordElementEffectLeft)
            m_swordElementEffectLeft = __AttachEffect(m_swordElementEffectLeft);
    }
}
#endif

When changing weapon

wear costume armor
 
Discord Banner

🔥 Join us on Discord! - Active chat & direct support

We invite you to join the largest Metin2 community on Discord!

Join Now!
Member Count: 
Discord Robot
HUB Bot
Announcement
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock