diff options
| author | Shauren <shauren.trinity@gmail.com> | 2015-03-08 13:31:57 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2015-03-08 13:31:57 +0100 |
| commit | 0ba2e0d5ee416a2daf89d53877984fb0cf27ca9b (patch) | |
| tree | 0cb086bb038bf7d3164b9c25dab9ecd1bf93cad6 /src/server/game/AI/ScriptedAI | |
| parent | 9ffeb58d094ddba9bffb33a79b33ade9af9f5c00 (diff) | |
Core/Spells: Implemented multiple spell power costs
Diffstat (limited to 'src/server/game/AI/ScriptedAI')
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 15 | ||||
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedCreature.h | 2 |
2 files changed, 3 insertions, 14 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index a03c4039e91..c53b532658d 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -182,7 +182,7 @@ Creature* ScriptedAI::DoSpawnCreature(uint32 entry, float offsetX, float offsetY return me->SummonCreature(entry, me->GetPositionX() + offsetX, me->GetPositionY() + offsetY, me->GetPositionZ() + offsetZ, angle, TempSummonType(type), despawntime); } -SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effects) +SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mechanic, SelectTargetType targets, float rangeMin, float rangeMax, SelectEffect effect) { //No target so we can't cast if (!target) @@ -215,7 +215,7 @@ SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mec continue; //Check the type of spell if we are looking for a specific spell type - if (effects && !(SpellSummary[me->m_spells[i]].Effects & (1 << (effects-1)))) + if (effect && !(SpellSummary[me->m_spells[i]].Effects & (1 << (effect-1)))) continue; //Check for school if specified @@ -226,17 +226,6 @@ SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mec if (mechanic && tempSpell->Mechanic != mechanic) continue; - //Make sure that the spell uses the requested amount of power - if (powerCostMin && tempSpell->ManaCost < powerCostMin) - continue; - - if (powerCostMax && tempSpell->ManaCost > powerCostMax) - continue; - - //Continue if we don't have the mana to actually cast this spell - if (tempSpell->ManaCost > (uint32)me->GetPower(Powers(tempSpell->PowerType))) - continue; - //Check if the spell meets our range requirements if (rangeMin && me->GetSpellMinRangeForTarget(target, tempSpell) < rangeMin) continue; diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index 5763f3a47da..74d0654dff2 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -250,7 +250,7 @@ struct ScriptedAI : public CreatureAI bool HealthAbovePct(uint32 pct) const { return me->HealthAbovePct(pct); } //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); + SpellInfo const* SelectSpell(Unit* target, uint32 school, uint32 mechanic, SelectTargetType targets, float rangeMin, float rangeMax, SelectEffect effect); void SetEquipmentSlots(bool loadDefault, int32 mainHand = EQUIP_NO_CHANGE, int32 offHand = EQUIP_NO_CHANGE, int32 ranged = EQUIP_NO_CHANGE); |
