aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQAston <qaston@gmail.com>2011-09-12 00:19:10 +0200
committerQAston <qaston@gmail.com>2011-09-12 00:20:37 +0200
commitec7da6f911b1597a7eac64f6a2b15734eccfc403 (patch)
tree70c8177166c23d2615b3fbf11dfe9885a2a51144 /src
parentdad5b0bb3c1cc0d68c4e8e24a82bc0a851236d1d (diff)
Core/ScriptedAI: remove ScriptedAI::CanCast function which is not functioning properly (compare that func with Spell::CheckCast to see how it should work) and is unused. Closes #2275.
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.cpp21
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedCreature.h3
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp3
3 files changed, 1 insertions, 26 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
index ebca71df079..8443c4b1bfb 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp
@@ -269,27 +269,6 @@ SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mec
return apSpell[urand(0, spellCount - 1)];
}
-bool ScriptedAI::CanCast(Unit* target, SpellInfo const* spell, bool triggered /*= false*/)
-{
- //No target so we can't cast
- if (!target || !spell)
- return false;
-
- //Silenced so we can't cast
- if (!triggered && me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
- return false;
-
- //Check for power
- if (!triggered && me->GetPower(Powers(spell->PowerType)) < spell->ManaCost)
- return false;
-
- //Unit is out of range of this spell
- if (me->IsInRange(target, float(me->GetSpellMinRangeForTarget(target, spell)), float(me->GetSpellMaxRangeForTarget(target, spell))))
- return false;
-
- return true;
-}
-
void ScriptedAI::DoResetThreat()
{
if (!me->CanHaveThreatList() || me->getThreatManager().isThreatListEmpty())
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
index 277edb7a337..92c6565be9f 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h
+++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h
@@ -160,9 +160,6 @@ struct ScriptedAI : public CreatureAI
//Returns spells that meet the specified criteria from the creatures spell list
SpellInfo const* SelectSpell(Unit* target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect);
- //Checks if you can cast the specified spell
- bool CanCast(Unit* target, SpellInfo const* spell, bool triggered = false);
-
void SetEquipmentSlots(bool loadDefault, int32 mainHand = EQUIP_NO_CHANGE, int32 offHand = EQUIP_NO_CHANGE, int32 ranged = EQUIP_NO_CHANGE);
//Generally used to control if MoveChase() is to be used or not in AttackStart(). Some creatures does not chase victims
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
index 1e061c38c08..a577f2becf3 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
@@ -1505,8 +1505,7 @@ class npc_captain_grondel : public CreatureScript
switch (eventId)
{
case EVENT_GRONDEL_CHARGE_CHECK:
- if (CanCast(me->getVictim(), sSpellMgr->GetSpellInfo(SPELL_CHARGE)))
- DoCastVictim(SPELL_CHARGE);
+ DoCastVictim(SPELL_CHARGE);
Events.ScheduleEvent(EVENT_GRONDEL_CHARGE_CHECK, 500);
break;
case EVENT_GRONDEL_MORTAL_STRIKE: