Jump to content

[8542] missing combatlog event PARTY_KILL


Guest darkEvil

Recommended Posts

Mangos version:

0.12 rev8348

How it SHOULD work:

If you or someone in your group (not raid) kills a unit, the event PARTY_KILL should be fired.

How it DOES work:

The event isn't fired at all. Just UNIT_DIED is fired, but with it you can't determine the player who made the killing-blow.

It would be very nice, if this event could be implemented so that killing-blow addons can work properly.

Examples:

http://www.wowwiki.com/COMBAT_LOG_EVENT_UNFILTERED#Special_Events_2

http://www.wowinterface.com/forums/showthread.php?t=18062 (fired even in pve)

http://code.google.com/p/wow-raid-log-analysis/wiki/NewCombatLogSample (official log)

http://paste2.org/p/425706 (MaNGOS log)

Patch

See post below.

Link to comment
Share on other sites

This is my suggestion to fix this:

@@ -599,10 +599,14 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
        DEBUG_LOG("DealDamage: victim just died");

        // find player: owner of controlled `this` or `this` itself maybe
        Player *player = GetCharmerOrOwnerPlayerOrPlayerItself();

+        WorldPacket data(SMSG_PARTYKILLLOG, (8+8)); //send event PARTY_KILL
+        data << uint64(this->GetGUID()); //player with killing blow
+        data << uint64(pVictim->GetGUID()); //victim
+
        if(pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->GetLootRecipient())
            player = ((Creature*)pVictim)->GetLootRecipient();
        // Reward player, his pets, and group/raid members
        // call kill spell proc event (before real die and combat stop to triggering auras removed at death/combat stop)
        if(player && player!=pVictim)

Is this correct? Can anyone test and give feedback?

Link to comment
Share on other sites

You should first check if player is in group, then broadcast packet to the group (may be in limited range?).

Something like that:

if(GetTypeId() == TYPEID_PLAYER)
{
   if(Group *group = ((Player*)this)->GetGroup())
   {
       WorldPacket data(SMSG_PARTYKILLLOG, (8+8)); //send event PARTY_KILL
       data << uint64(GetGUID()); //player with killing blow
       data << uint64(pVictim->GetGUID()); //victim
       group->BroadcastPacket(&data); // there's some more arguments available...
   }
}

Link to comment
Share on other sites

balrok actually managed to get it working

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index b0c97f6..cf6e23b 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -607,8 +607,18 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
        // Reward player, his pets, and group/raid members
        // call kill spell proc event (before real die and combat stop to triggering auras removed at death/combat stop)
        if(player && player!=pVictim)
+        {
+            WorldPacket data(SMSG_PARTYKILLLOG, (8+8)); //send event PARTY_KILL
+            data << uint64(player->GetGUID()); //player with killing blow
+            data << uint64(pVictim->GetGUID()); //victim
+            if (Group *group =  player->GetGroup())
+                group->BroadcastPacket(&data, group->GetMemberGroup(player->GetGUID()));
+            else
+                player->SendDirectMessage(&data);
+
            if(player->RewardPlayerAndGroupAtKill(pVictim))
                player->ProcDamageAndSpell(pVictim,PROC_FLAG_KILL_XP_GIVER,PROC_FLAG_NONE);
+        }

        DEBUG_LOG("DealDamageAttackStop");

@@ -1455,9 +1465,6 @@ uint32 Unit::SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage
            return 0;
        }

-        // Deal damage done
-        damage = DealDamage(pVictim, damage, &cleanDamage, SPELL_DIRECT_DAMAGE, GetSpellSchoolMask(spellInfo), spellInfo, true);
-
        // Send damage log
        sLog.outDetail("SpellNonMeleeDamageLog: %u (TypeId: %u) attacked %u (TypeId: %u) for %u dmg inflicted by %u,absorb is %u,resist is %u",
            GetGUIDLow(), GetTypeId(), pVictim->GetGUIDLow(), pVictim->GetTypeId(), damage, spellID, absorb,resist);
@@ -1465,6 +1472,9 @@ uint32 Unit::SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage
        // Actual log sent to client
        SendSpellNonMeleeDamageLog(pVictim, spellID, damage, GetSpellSchoolMask(spellInfo), absorb, resist, false, 0, crit);

+        // Deal damage done
+        damage = DealDamage(pVictim, damage, &cleanDamage, SPELL_DIRECT_DAMAGE, GetSpellSchoolMask(spellInfo), spellInfo, true);
+
        // Procflags
        uint32 procAttacker = PROC_FLAG_HIT_SPELL;
        uint32 procVictim   = (PROC_FLAG_STRUCK_SPELL|PROC_FLAG_TAKE_DAMAGE);

PARTY_KILL is send to you and your party (not raid).

It is send after the killing-blow and before UNIT_DIED.

9/16 23:00:38.921 PARTY_KILL,0x000000000011DFA3,"Kla",0x10514,0xF13000420700E4B1,"Mörderischer Schlammling",0xa48

9/16 23:00:39.031 UNIT_DIED,0x0000000000000000,nil,0x80000000,0xF13000420700E4B1,"Mörderischer Schlammling",0xa48

Link to comment
Share on other sites

  • 2 months later...
×
×
  • Create New...

Important Information

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. Privacy Policy Terms of Use