*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)
|
||||
|
||||
@@ -293,7 +293,13 @@ void Spell::EffectInstaKill(SpellEffIndex /*effIndex*/)
|
||||
if (m_caster == unitTarget) // prevent interrupt message
|
||||
finish();
|
||||
|
||||
m_caster->DealDamage(unitTarget, unitTarget->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
WorldPacket data(SMSG_SPELLINSTAKILLLOG, 8+8+4);
|
||||
data << uint64(m_caster->GetGUID());
|
||||
data << uint64(unitTarget->GetGUID());
|
||||
data << uint32(m_spellInfo->Id);
|
||||
m_caster->SendMessageToSet(&data, true);
|
||||
|
||||
m_caster->DealDamage(unitTarget, unitTarget->GetHealth(), NULL, NODAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
}
|
||||
|
||||
void Spell::EffectEnvirinmentalDMG(SpellEffIndex effIndex)
|
||||
@@ -1268,7 +1274,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
|
||||
if (!unitTarget && unitTarget->GetEntry() != 26452 && unitTarget->HealthAbovePct(95))
|
||||
return;
|
||||
|
||||
m_caster->DealDamage(unitTarget, unitTarget->CountPctFromMaxHealth(93));
|
||||
m_caster->DealDamage(unitTarget, unitTarget->CountPctFromMaxHealth(93));
|
||||
return;
|
||||
}
|
||||
case 49357: // Brewfest Mount Transformation
|
||||
|
||||
Reference in New Issue
Block a user