diff options
author | Xanadu <none@none> | 2010-03-15 02:59:21 +0100 |
---|---|---|
committer | Xanadu <none@none> | 2010-03-15 02:59:21 +0100 |
commit | 8cc3d2ad7f01cf5a707f72fbd6e7d79cb7c02f53 (patch) | |
tree | 2a5383c953e8773f68e1680959c48d28883975ea /src | |
parent | 1845a9588d78e669f8d9b10661f4addc39b6a6ea (diff) |
Fixed Drain Soul and Shadowburn Soul Shard on target death. Closes issue 1058.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/SpellAuraEffects.cpp | 12 | ||||
-rw-r--r-- | src/game/Unit.cpp | 8 |
2 files changed, 12 insertions, 8 deletions
diff --git a/src/game/SpellAuraEffects.cpp b/src/game/SpellAuraEffects.cpp index 51e6a7fe4f6..fbd0289103d 100644 --- a/src/game/SpellAuraEffects.cpp +++ b/src/game/SpellAuraEffects.cpp @@ -5988,13 +5988,12 @@ void AuraEffect::HandleChannelDeathItem(AuraApplication const * aurApp, uint8 mo { Unit * caster = GetCaster(); - if(!caster || caster->GetTypeId() != TYPEID_PLAYER)// || m_removeMode!=AURA_REMOVE_BY_DEATH) + if(!caster || caster->GetTypeId() != TYPEID_PLAYER) return; - //we cannot check removemode = death - //talent will remove the caster's aura->interrupt channel->remove victim aura - if(target->GetHealth() > 0) + if(target->getDeathState() != JUST_DIED) return; + // Item amount if (GetAmount() <= 0) return; @@ -6002,11 +6001,12 @@ void AuraEffect::HandleChannelDeathItem(AuraApplication const * aurApp, uint8 mo if(GetSpellProto()->EffectItemType[m_effIndex] == 0) return; - // Soul Shard only from non-grey units + // Soul Shard only from units that grant XP or honor if( GetSpellProto()->EffectItemType[m_effIndex] == 6265 && - (target->getLevel() <= Trinity::XP::GetGrayLevel(caster->getLevel()) || + (!caster->ToPlayer()->isHonorOrXPTarget(target) || target->GetTypeId() == TYPEID_UNIT && !target->ToCreature()->isTappedBy(caster->ToPlayer())) ) return; + //Adding items uint32 noSpaceForCount = 0; uint32 count = m_amount; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 8aed67a0f9d..ba4f49f6691 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -11976,6 +11976,11 @@ void Unit::SetHover(bool on) void Unit::setDeathState(DeathState s) { + // death state needs to be updated before RemoveAllAurasOnDeath() calls HandleChannelDeathItem(..) so that + // it can be used to check creation of death items (such as soul shards). + DeathState oldDeathState = m_deathState; + m_deathState = s; + if (s != ALIVE && s != JUST_ALIVED) { CombatStop(); @@ -12012,13 +12017,12 @@ void Unit::setDeathState(DeathState s) else if (s == JUST_ALIVED) RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); // clear skinnable for creature and player (at battleground) - if (m_deathState != ALIVE && s == ALIVE) + if (oldDeathState != ALIVE && s == ALIVE) { //_ApplyAllAuraMods(); // Reset display id on resurection - needed by corpse explosion to cleanup after display change SetDisplayId(GetNativeDisplayId()); } - m_deathState = s; } /*######################################## |