Jump to content

Fix Shaman w/m horse Attack Bug


Recommended Posts

  • Developer

Hi guys,

 

A 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

This is the hidden content, please
.

 

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.

 

 

Edited by Ikarus_
  • Metin2 Dev 115
  • Eyes 3
  • Facepalm 1
  • Dislove 1
  • Angry 1
  • Think 1
  • Confused 3
  • Lmao 1
  • Good 28
  • Love 6
  • Love 78

My youtube channel  on which you can see my works here

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
  • 8 months later...
  • Developer
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 comment
Share on other sites

  • Premium
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://metin2.download/picture/wth9W3oB0qHg9pope5yNLpQEn52tlne3/.gif

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 2
  • Good 1
  • Love 2

Ulthar

Link to comment
Share on other sites

  • Premium

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 Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
  • Love 1

Ulthar

Link to comment
Share on other sites

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

Edited by Metin2 Dev
Core X - External 2 Internal

My youtube channel  on which you can see my works here

Link to comment
Share on other sites

  • Premium
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!

Ulthar

Link to comment
Share on other sites

  • 5 months later...
On 4/19/2021 at 5:37 PM, Ulthar said:

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!

You have to be kidding me. The part after else was not used anyway. Why do you people have to boast so hard with trash? That s there as a failsafe but it is not being used by the game.

Edited by narcisxb
Link to comment
Share on other sites

  • Premium
11 hours ago, narcisxb said:

You have to be kidding me. The part after else was not used anyway. Why do you people have to boast so hard with trash? That s there as a failsafe but it is not being used by the game because of the macro definiton above.

Did you read this part? : "im not a coder, but its working."

Ulthar

Link to comment
Share on other sites

  • 2 weeks later...
  • 11 months later...
On 10/5/2021 at 2:55 PM, narcisxb said:

Whatever, good for you.

because you didn't define the   __ENABLE_SHAMAN_ATTACK_FIX__ .

On 10/4/2021 at 12:20 PM, Ulthar said:

Did you read this part? : "im not a coder, but its working."

You didn`t difine the __ENABLE_SHAMAN_ATTACK_FIX__

Link to comment
Share on other sites

  • 1 year later...
On 2021. 04. 16. at 20:19, Ulthar said:

MINDENKINEK

, akinek hasonló problémája van, mint nekem:

ebben a funkcióban:

void CActorInstance::__ProcessDataAttackSuccess(const NRaceData::TAttackData & c_rAttackData, CActorInstance & rVictim, const D3DXVECTOR3 & c_rv3Position, UINT uiSkill, BOOL isSend the #Packet)

rész törlése!

mint ez:

spacer.png

 

Thank you, your solution helped!

  • Metin2 Dev 1
  • Confused 1
  • Good 1
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.