Skip to content

Commit

Permalink
[s0260] Implement SMSG_SPELLINSTAKILLLOG
Browse files Browse the repository at this point in the history
Signed-off-by: DasBlub <dasblub@gmail.com>

(based on commit 05d6809)

Signed-off-by: DasBlub <dasblub@gmail.com>
  • Loading branch information
Opterman authored and DasBlub committed Sep 30, 2010
1 parent fe0d0c8 commit 8c6e1b0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
19 changes: 13 additions & 6 deletions src/game/SpellEffects.cpp
Expand Up @@ -250,15 +250,15 @@ void Spell::EffectResurrectNew(SpellEffectIndex eff_idx)

void Spell::EffectInstaKill(SpellEffectIndex /*eff_idx*/)
{
if( !unitTarget || !unitTarget->isAlive() )
if (!unitTarget || !unitTarget->isAlive())
return;

// Demonic Sacrifice
if(m_spellInfo->Id==18788 && unitTarget->GetTypeId()==TYPEID_UNIT)
if (m_spellInfo->Id==18788 && unitTarget->GetTypeId()==TYPEID_UNIT)
{
uint32 entry = unitTarget->GetEntry();
uint32 spellID;
switch(entry)
switch (entry)
{
case 416: spellID=18789; break; //imp
case 417: spellID=18792; break; //fellhunter
Expand All @@ -273,11 +273,18 @@ void Spell::EffectInstaKill(SpellEffectIndex /*eff_idx*/)
m_caster->CastSpell(m_caster, spellID, true);
}

if(m_caster == unitTarget) // prevent interrupt message
if (m_caster == unitTarget) // prevent interrupt message
finish();

uint32 health = unitTarget->GetHealth();
m_caster->DealDamage(unitTarget, health, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
WorldObject* caster = GetCastingObject(); // we need the original casting object

WorldPacket data(SMSG_SPELLINSTAKILLLOG, (8+8+4));
data << (caster && caster->GetTypeId() != TYPEID_GAMEOBJECT ? m_caster->GetObjectGuid() : ObjectGuid()); // Caster GUID
data << unitTarget->GetObjectGuid(); // Victim GUID
data << uint32(m_spellInfo->Id);
m_caster->SendMessageToSet(&data, true);

m_caster->DealDamage(unitTarget, unitTarget->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}

void Spell::EffectEnvironmentalDMG(SpellEffectIndex eff_idx)
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "0259"
#define REVISION_NR "0260"
#endif // __REVISION_NR_H__

0 comments on commit 8c6e1b0

Please sign in to comment.