Jump to content

Recommended Posts

Hello everyone, I am really sorry for disturbing.

So I am facing some issues with "multidmg" option , for you to see the dmg you do to multiple players and monsters, which I really like, maybe because I'm autistic so the more numbers I see the cooler it is

This is the result I am looking for :

.gif

And I do have that "result" but is not one that I am looking for

Which is the following:

In PythonNetworkStreamPhaseGame this :

bool CPythonNetworkStream::SendAttackPacket(UINT uMotAttack, DWORD dwVIDVictim)
{
    if (!__CanActMainInstance())
        return true;
    SendTargetPacket(dwVIDVictim); // multidmg
    if (!__IsPlayerAttacking()) // multidmg
        return true; // multidmg
  
    TPacketCGAttack kPacketAtk;

    kPacketAtk.header = HEADER_CG_ATTACK;
    kPacketAtk.bType = uMotAttack;
    kPacketAtk.dwVictimVID = dwVIDVictim;

    if (!SendSpecial(sizeof(kPacketAtk), &kPacketAtk))
    {
        Tracen("Send Battle Attack Packet Error");
        return false;
    }

    return true;
}

And this :

bool CPythonNetworkStream::RecvDamageInfoPacket()
{
    TPacketGCDamageInfo DamageInfoPacket;

    if (!Recv(sizeof(TPacketGCDamageInfo), &DamageInfoPacket))
    {
        Tracen("Recv Target Packet Error");
        return false;
    }

    CInstanceBase* pInstTarget = CPythonCharacterManager::Instance().GetInstancePtr(DamageInfoPacket.dwVID);
    bool bSelf = (pInstTarget == CPythonCharacterManager::Instance().GetMainInstancePtr());
    bool bTarget = (pInstTarget == m_pInstTarget);
    if (!bTarget) // multi dmg
        bTarget = pInstTarget->IsPC();  // multi dmg
    if (pInstTarget)
    {
        if (DamageInfoPacket.damage >= 0)
            pInstTarget->AddDamageEffect(DamageInfoPacket.damage, DamageInfoPacket.flag, bSelf, bTarget);
        else
            TraceError("Damage is equal or below 0.");
    }

    return true;
}

 Functions. The problem is that when I have a target selected example hitting with auto attack a metin2 stone or just normal attack but right clicked on the metin2 stone to be selected to see its remaning health. As soon as mobs spawn and I hit them the health bar dissapears.

Killing other targets or attacking other targets makes the health bar on top flicker pretty much , going crazy from target to target as the health updates which is really frustrating. For the health bar of the selected target to switch when you attack any other one.

Someone told me to look serverside at the void CHARACTER::SendDamagePacket function 
It looked something like this :

void CHARACTER::SendDamagePacket (LPCHARACTER pAttacker, int Damage, BYTE DamageFlag)
{
    if (IsPC() == true || (pAttacker->IsPC() == true && pAttacker->GetTarget() == this))
    {

I changed it into this :

void CHARACTER::SendDamagePacket (LPCHARACTER pAttacker, int Damage, BYTE DamageFlag)
{
        if (IsPC() == true || (pAttacker->IsPC()) // removed selected
        {

I am using TMP4. However this did not work, at least for me, surprisingly someone that uses Owasp's serverfiles from 2021 this simple change made it work, but looking at the source code we have the same functions clientside in PythonNetworkStreamPhaseGame as well as in void char_battle void CHARACTER::SendDamagePacket

Yet it does not work for me, Any ideas why is that. Thank you once again. Best regards

Link to comment
https://metin2.dev/topic/34071-help-with-multi-damage/
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



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.