aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellInfo.cpp
diff options
context:
space:
mode:
authorOvalord <1Don7H4v3@m41L.com>2016-04-14 22:43:21 +0200
committerShauren <shauren.trinity@gmail.com>2016-04-24 12:46:26 +0200
commit948146f3ee890b85af50944176877c7d44c0c120 (patch)
treee1d6c39d49d595de1420901db5e02319f78aa2ac /src/server/game/Spells/SpellInfo.cpp
parentbc106abb07dc0afc69c2a9238267081464c05254 (diff)
Core/Instances: Updated and enabled encounter packets and implemented combat resurrection limit
Closes #16966
Diffstat (limited to 'src/server/game/Spells/SpellInfo.cpp')
-rw-r--r--src/server/game/Spells/SpellInfo.cpp8
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;
}