diff options
Diffstat (limited to 'src/server/game/Spells/SpellInfo.cpp')
| -rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index ae361883ed7..5e0c70e855e 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -26,6 +26,7 @@ #include "Battleground.h" #include "Vehicle.h" #include "Pet.h" +#include "InstanceScript.h" uint32 GetTargetFlagMask(SpellTargetObjectTypes objType) { @@ -2021,6 +2022,13 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta if (HasEffect(caster->GetMap()->GetDifficultyID(), SPELL_EFFECT_SELF_RESURRECT) || HasEffect(caster->GetMap()->GetDifficultyID(), SPELL_EFFECT_RESURRECT) || HasEffect(caster->GetMap()->GetDifficultyID(), SPELL_EFFECT_RESURRECT_NEW)) return SPELL_FAILED_TARGET_CANNOT_BE_RESURRECTED; + if (HasAttribute(SPELL_ATTR8_BATTLE_RESURRECTION)) + if (Map* map = caster->GetMap()) + if (InstanceMap* iMap = map->ToInstanceMap()) + if (InstanceScript* instance = iMap->GetInstanceScript()) + if (instance->GetCombatResurrectionCharges() == 0 && instance->IsEncounterInProgress()) + return SPELL_FAILED_TARGET_CANNOT_BE_RESURRECTED; + return SPELL_CAST_OK; } |
