Jump to content

How To 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 21

My youtube channel  on which you can see my works here

Link to post
  • 2 weeks later...
  • 3 weeks later...

I'm had next weird problem with ninja, when I mount horse and using bow attack speed is lower than without horse, did you know something about this bug?

  • See 1
Link to post
  • ASIKOO changed the title to How To Fix Shaman w/m horse Attack Bug

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


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