Jump to content

Fix Shaman w/m horse Attack Bug


Recommended Posts

Hi guys,

 

I guy reported to me a weird bug about shamans w/m which are skipping collision when they are too fast to attack.

On default source files it is still an unresolved bug which appear when the shaman's attack speed is more than 145/150.

 

here a video which show how it is not getting the damage text for each hit on the stone.

 

 

here the FIX.

 

Spoiler

 

ActorInstance.h 


//search:

protected:
        void __RunNextCombo();
        void __ClearCombo();
        void __OnEndCombo();

        void __ProcessDataAttackSuccess(const NRaceData::TAttackData & c_rAttackData, CActorInstance & rVictim, const D3DXVECTOR3 & c_rv3Position, UINT uiSkill = 0, BOOL isSendPacket = TRUE);
        void __ProcessMotionEventAttackSuccess(DWORD dwMotionKey, BYTE byEventIndex, CActorInstance & rVictim);
        void __ProcessMotionAttackSuccess(DWORD dwMotionKey, CActorInstance & rVictim);


//add under

#ifdef __ENABLE_SHAMAN_ATTACK_FIX__
        float __GetInvisibleTimeAdjust(const UINT uiSkill, const NRaceData::TAttackData& c_rAttackData);
#endif


ActorInstanceBattle.cpp

 

//search : 

void CActorInstance::__ProcessDataAttackSuccess(const NRaceData::TAttackData & c_rAttackData, CActorInstance & rVictim, const D3DXVECTOR3 & c_rv3Position, UINT uiSkill, BOOL isSendPacket)
{
    if (NRaceData::HIT_TYPE_NONE == c_rAttackData.iHittingType)
        return;

    InsertDelay(c_rAttackData.fStiffenTime);

    if (__CanPushDestActor(rVictim) && c_rAttackData.fExternalForce > 0.0f)
    {
        __PushCircle(rVictim);

        // VICTIM_COLLISION_TEST
        const D3DXVECTOR3& kVictimPos = rVictim.GetPosition();
        rVictim.m_PhysicsObject.IncreaseExternalForce(kVictimPos, c_rAttackData.fExternalForce); //*nForceRatio/100.0f);

        // VICTIM_COLLISION_TEST_END
    }

    // Invisible Time
    if (IS_PARTY_HUNTING_RACE(rVictim.GetRace()))
    {
        if (uiSkill) // ÆÄƼ »ç³É ¸ó½ºÅÍ¶óµµ ½ºÅ³ÀÌ¸é ¹«Àû½Ã°£ Àû¿ë
            rVictim.m_fInvisibleTime = CTimer::Instance().GetCurrentSecond() + c_rAttackData.fInvisibleTime;

        if (m_isMain) // #0000794: [M2KR] Æú¸®¸ðÇÁ - ¹ë·±½Ì ¹®Á¦ ŸÀÎ °ø°Ý¿¡ ÀÇÇÑ ¹«Àû ŸÀÓÀº °í·ÁÇÏÁö ¾Ê°í ÀڽŠ°ø°Ý¿¡ ÀÇÇѰ͸¸ üũÇÑ´Ù
            rVictim.m_fInvisibleTime = CTimer::Instance().GetCurrentSecond() + c_rAttackData.fInvisibleTime;
    }
    else // ÆÄƼ »ç³É ¸ó½ºÅÍ°¡ ¾Æ´Ò °æ¿ì¸¸ Àû¿ë
    {
        rVictim.m_fInvisibleTime = CTimer::Instance().GetCurrentSecond() + c_rAttackData.fInvisibleTime;
    }

//make it like this: (take a look where __ENABLE_SHAMAN_ATTACK_FIX__ is used)

void CActorInstance::__ProcessDataAttackSuccess(const NRaceData::TAttackData & c_rAttackData, CActorInstance & rVictim, const D3DXVECTOR3 & c_rv3Position, UINT uiSkill, BOOL isSendPacket)
{
    if (NRaceData::HIT_TYPE_NONE == c_rAttackData.iHittingType)
        return;

    InsertDelay(c_rAttackData.fStiffenTime);

    if (__CanPushDestActor(rVictim) && c_rAttackData.fExternalForce > 0.0f)
    {
        __PushCircle(rVictim);

        // VICTIM_COLLISION_TEST
        const D3DXVECTOR3& kVictimPos = rVictim.GetPosition();
        rVictim.m_PhysicsObject.IncreaseExternalForce(kVictimPos, c_rAttackData.fExternalForce); //*nForceRatio/100.0f);

        // VICTIM_COLLISION_TEST_END
    }

#ifdef __ENABLE_SHAMAN_ATTACK_FIX__
    // Invisible Time
    if (IS_PARTY_HUNTING_RACE(rVictim.GetRace()))
    {
        if (uiSkill) // ÆÄƼ »ç³É ¸ó½ºÅÍ¶óµµ ½ºÅ³ÀÌ¸é ¹«Àû½Ã°£ Àû¿ë
            rVictim.m_fInvisibleTime = CTimer::Instance().GetCurrentSecond() + (c_rAttackData.fInvisibleTime - __GetInvisibleTimeAdjust(uiSkill, c_rAttackData));

        if (m_isMain) // #0000794: [M2KR] Æú¸®¸ðÇÁ - ¹ë·±½Ì ¹®Á¦ ŸÀÎ °ø°Ý¿¡ ÀÇÇÑ ¹«Àû ŸÀÓÀº °í·ÁÇÏÁö ¾Ê°í ÀڽŠ°ø°Ý¿¡ ÀÇÇѰ͸¸ üũÇÑ´Ù
            rVictim.m_fInvisibleTime = CTimer::Instance().GetCurrentSecond() + (c_rAttackData.fInvisibleTime - __GetInvisibleTimeAdjust(uiSkill, c_rAttackData));
    }
    else // ÆÄƼ »ç³É ¸ó½ºÅÍ°¡ ¾Æ´Ò °æ¿ì¸¸ Àû¿ë
    {
        rVictim.m_fInvisibleTime = CTimer::Instance().GetCurrentSecond() + (c_rAttackData.fInvisibleTime - __GetInvisibleTimeAdjust(uiSkill, c_rAttackData));
    }
#else
    // Invisible Time
    if (IS_PARTY_HUNTING_RACE(rVictim.GetRace()))
    {
        if (uiSkill) // ÆÄƼ »ç³É ¸ó½ºÅÍ¶óµµ ½ºÅ³ÀÌ¸é ¹«Àû½Ã°£ Àû¿ë
            rVictim.m_fInvisibleTime = CTimer::Instance().GetCurrentSecond() + c_rAttackData.fInvisibleTime;

        if (m_isMain) // #0000794: [M2KR] Æú¸®¸ðÇÁ - ¹ë·±½Ì ¹®Á¦ ŸÀÎ °ø°Ý¿¡ ÀÇÇÑ ¹«Àû ŸÀÓÀº °í·ÁÇÏÁö ¾Ê°í ÀڽŠ°ø°Ý¿¡ ÀÇÇѰ͸¸ üũÇÑ´Ù
            rVictim.m_fInvisibleTime = CTimer::Instance().GetCurrentSecond() + c_rAttackData.fInvisibleTime;
    }
    else // ÆÄƼ »ç³É ¸ó½ºÅÍ°¡ ¾Æ´Ò °æ¿ì¸¸ Àû¿ë
    {
        rVictim.m_fInvisibleTime = CTimer::Instance().GetCurrentSecond() + c_rAttackData.fInvisibleTime;
    }
#endif

    // Stiffen Time
    rVictim.InsertDelay(c_rAttackData.fStiffenTime);

//at the end of the file paste:

#ifdef __ENABLE_SHAMAN_ATTACK_FIX__
float CActorInstance::__GetInvisibleTimeAdjust(const UINT uiSkill, const NRaceData::TAttackData& c_rAttackData) {

    static const int shamanw = 3, shamanm = 7;

    if ((GetRace() != shamanw && GetRace() != shamanm) ||
        uiSkill != 0 ||
        m_fAtkSpd < 1.3)
        return 0.0f;

    const auto scale = (m_fAtkSpd - 1.3) / 1.3;
    const auto inv = c_rAttackData.fInvisibleTime * 0.5;
    return inv * scale;
}
#endif

 

 

 

ATTENTION:
Since the problem is the InvisibleTime on Attack.msa which it is too high, we could think to reduce it without need to edit nothing in our source (and it may be more efficient), but honestly i preferred to make a function which calculating the "adjustment" of the invisible time using the speed attack to don't risk to get the reversed problem (2 damage on 1 hit when the attack speed is low)

feel free to use one of the two options.

 

 

  • Love 23

My youtube channel  on which you can see my works here

Link to post
  • 2 weeks later...

spacer.png

 

Hello, thanks for sharing, this problem is quite for a while and didn't found any fix for this!

Again, thanks a lot! I am now adding it to the server. Edit: Works perfectly fine! 

Edited by dv2axonn
Tested
  • Good 1

mel gibson poker GIF

Link to post
  • 3 weeks later...
  • 8 months later...
18 hours ago, Ulthar said:

for me its not working. Build was success, and no errors ofc.

but my shaman attack is the same.

can you help me @Ikarus_?

check well the define arrives everywhere.
try adding this at the beginning of "EterBase/Stdafx.h"

#include "../UserInterface/Locale_inc.h"

 

My youtube channel  on which you can see my works here

Link to post
  • VIP
Posted (edited)
59 minutes ago, Ikarus_ said:

check well the define arrives everywhere.
try adding this at the beginning of "EterBase/Stdafx.h"


#include "../UserInterface/Locale_inc.h"

thanks for aswer!
I added it, but nohing happened
checked everyhing, but didnt find any strange looking part, so i dont know what is the problem :S
Any idea?:/

https://gyazo.com/ecaeba5a7edff6c891feaec775e9ec4e

Edited by Ulthar
Link to post
  • VIP
Posted (edited)

EVERYONE

Who have the same problem like me:

in the this function:

void CActorInstance::__ProcessDataAttackSuccess(const NRaceData::TAttackData & c_rAttackData, CActorInstance & rVictim, const D3DXVECTOR3 & c_rv3Position, UINT uiSkill, BOOL isSendPacket)

Delete the #else part!

like this:

spacer.png

Edited by Ulthar
Link to post
On 4/16/2021 at 8:19 PM, Ulthar said:

EVERYONE

Who have the same problem like me:

in the this function:

void CActorInstance::__ProcessDataAttackSuccess(const NRaceData::TAttackData & c_rAttackData, CActorInstance & rVictim, const D3DXVECTOR3 & c_rv3Position, UINT uiSkill, BOOL isSendPacket)

Delete the #else part!

like this:

spacer.png

The #else part is the original one inserted between #else and #endif to make it work as it was before apply the fix in case of for some reason you need to disable the fix.
Honestly i don't think it make any difference since it was disabled by the fact the macro __ENABLE_SHAMAN_ATTACK_FIX__ was defined.

In short i don't think the fact you removed the #else is the reason why now it is working for you. You can check it by adding again the removed part and test if the fix is still working.

My youtube channel  on which you can see my works here

Link to post
  • VIP
1 minute ago, Ikarus_ said:

The #else part is the original one inserted between #else and #endif to make it work as it was before apply the fix in case of for some reason you need to disable the fix.
Honestly i don't think it make any difference since it was disabled by the fact the macro __ENABLE_SHAMAN_ATTACK_FIX__ was defined.

In short i don't think the fact you removed the #else is the reason why now it is working for you. You can check it by adding again the removed part and test if the fix is still working.

i only edited this part, which is removed the #else. and its working for me :D im not a coder, but its working. so im happy with that. :D

Thanks for the whole post!

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



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