Not answered Weapon effect refresh

Member
Oct
Threads
3
27
1
4
3
HubMoney
378
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
 
Metin2Hub Bot
M2Hub Bot
Feb
Threads
65
2,003
2
842
113
HubMoney
1,212
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

View attachment 881

View attachment 882

Hello dear user,

Your post will be under surveillance by bots for the next few hours.

Forum description : Metin2 private server, Metin2 download, Metin2 support, Metin2 Forum, Metin2 Pvp Servers, Errors, Bugs, Requests, Metin2 Pvp Forum, Everything About Metin2.
 
Top