diff options
| author | QAston <none@none> | 2010-07-25 16:23:57 +0200 |
|---|---|---|
| committer | QAston <none@none> | 2010-07-25 16:23:57 +0200 |
| commit | fce1f5b014c1e2e3b0b85062898f56837111f66a (patch) | |
| tree | caf3bf48f82d5fc4f19c418d1cb0b57d07439b32 /src/server/game/Spells/SpellScript.h | |
| parent | 997b9e6b226ab0eca2636b040a2d05a2f1804ef0 (diff) | |
*Extend API of SpellScript by Dest and Damage/Heal setters and getters.
*Make some SpellScript function names shorter.
--HG--
branch : trunk
Diffstat (limited to 'src/server/game/Spells/SpellScript.h')
| -rw-r--r-- | src/server/game/Spells/SpellScript.h | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index b7a83748b75..76fe4b5f401 100644 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -29,6 +29,7 @@ class Creature; class GameObject; class Player; class Item; +class WorldLocation; typedef void(SpellScript::*EffectHandlerFnType)(SpellEffIndex); @@ -120,23 +121,38 @@ class SpellScript : public _SpellScript // example EffectHandlers += EffectHandlerFn(class::function, EffectIndexSpecifier, EffectNameSpecifier); HookList<EffectHandler> EffectHandlers; + // // methods allowing interaction with Spell object + // + // methods useable during all spell handling phases Unit * GetCaster(); Unit * GetOriginalCaster(); SpellEntry const * GetSpellInfo(); - // functions useable only during spell hit on target phase + // methods useable after spell targets are set + // returns: destination of the spell if exists, otherwise NULL + WorldLocation * GetDest(); + + // methods useable only during spell hit on target phase: // returns: target of current effect if it was Unit otherwise NULL - Unit * GetEffectUnitTarget(); + Unit * GetHitUnit(); // returns: target of current effect if it was Creature otherwise NULL - Creature * GetEffectCreatureTarget(); + Creature * GetHitCreature(); // returns: target of current effect if it was Player otherwise NULL - Player * GetEffectPlayerTarget(); + Player * GetHitPlayer(); // returns: target of current effect if it was Item otherwise NULL - Item * GetEffectItemTarget(); + Item * GetHitItem(); // returns: target of current effect if it was GameObject otherwise NULL - GameObject * GetEffectGOTarget(); + GameObject * GetHitGObj(); + // setter/getter for for damage done by spell to target of spell hit + int32 GetHitDamage(); + void SetHitDamage(int32 damage); + // setter/getter for for heal done by spell to target of spell hit + int32 GetHitHeal(); + void SetHitHeal(int32 heal); + + // method avalible only in EffectHandler method int32 GetEffectValue(); }; // SpellScript interface |
