*Send SMSG_SPELLINSTAKILLLOG on SPELL_EFFECT_INSTAKILL(1), thanks to Zor for base packet info.
--HG-- branch : trunk
This commit is contained in:
@@ -725,34 +725,8 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||
}
|
||||
|
||||
Kill(pVictim, durabilityLoss);
|
||||
|
||||
//Hook for OnPVPKill Event
|
||||
if (this->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (pVictim->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Player *killer = this->ToPlayer();
|
||||
Player *killed = pVictim->ToPlayer();
|
||||
sScriptMgr.OnPVPKill(killer, killed);
|
||||
}
|
||||
else if (pVictim->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
Player *killer = this->ToPlayer();
|
||||
Creature *killed = pVictim->ToCreature();
|
||||
sScriptMgr.OnCreatureKill(killer, killed);
|
||||
}
|
||||
}
|
||||
else if (this->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
if (pVictim->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Creature *killer = this->ToCreature();
|
||||
Player *killed = pVictim->ToPlayer();
|
||||
sScriptMgr.OnPlayerKilledByCreature(killer, killed);
|
||||
}
|
||||
}
|
||||
}
|
||||
else // if (health <= damage)
|
||||
else // if (health > damage)
|
||||
{
|
||||
sLog.outStaticDebug("DealDamageAlive");
|
||||
|
||||
@@ -15295,6 +15269,32 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
|
||||
else if (GetTypeId() == TYPEID_PLAYER && pVictim != this)
|
||||
pVictim->ToPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER, 1, this->ToPlayer()->GetTeam());
|
||||
}
|
||||
|
||||
//Hook for OnPVPKill Event
|
||||
if (this->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (pVictim->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Player *killer = this->ToPlayer();
|
||||
Player *killed = pVictim->ToPlayer();
|
||||
sScriptMgr.OnPVPKill(killer, killed);
|
||||
}
|
||||
else if (pVictim->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
Player *killer = this->ToPlayer();
|
||||
Creature *killed = pVictim->ToCreature();
|
||||
sScriptMgr.OnCreatureKill(killer, killed);
|
||||
}
|
||||
}
|
||||
else if (this->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
if (pVictim->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Creature *killer = this->ToCreature();
|
||||
Player *killed = pVictim->ToPlayer();
|
||||
sScriptMgr.OnPlayerKilledByCreature(killer, killed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::SetControlled(bool apply, UnitState state)
|
||||
|
||||
Reference in New Issue
Block a user