From 4a17224a652d2f87fdebdf7e572b7ce4da327336 Mon Sep 17 00:00:00 2001 From: QAston Date: Thu, 23 Jul 2009 18:32:32 +0200 Subject: *Creature eventAI cancast power check - by smellbee. --HG-- branch : trunk --- src/game/CreatureEventAI.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/game/CreatureEventAI.cpp') diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp index b9b3d5bb488..6e8ac6a4909 100644 --- a/src/game/CreatureEventAI.cpp +++ b/src/game/CreatureEventAI.cpp @@ -30,6 +30,7 @@ #include "GridNotifiers.h" #include "GridNotifiersImpl.h" #include "InstanceData.h" +#include "SpellMgr.h" bool CreatureEventAIHolder::UpdateRepeatTimer( Creature* creature, uint32 repeatMin, uint32 repeatMax ) { @@ -1297,7 +1298,7 @@ bool CreatureEventAI::CanCast(Unit* Target, SpellEntry const *Spell, bool Trigge return false; //Check for power - if (!Triggered && me->GetPower((Powers)Spell->powerType) < Spell->manaCost) + if (!Triggered && me->GetPower((Powers)Spell->powerType) < CalculatePowerCost(Spell, me, GetSpellSchoolMask(Spell))) return false; SpellRangeEntry const *TempRange = NULL; -- cgit v1.2.3