diff options
| author | Shauren <shauren.trinity@gmail.com> | 2021-05-13 00:38:09 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2025-11-17 18:22:43 +0100 |
| commit | 4997e316d9e4bf529e131d45528fff404d99b836 (patch) | |
| tree | 633bf20758ce902a91b4000f8694e7f271c85cd6 /src/server/game/Spells/SpellScript.h | |
| parent | 5e691c0d5f5fdc9f45d5c06525f6c0334ff0818e (diff) | |
Core/Spells: Expose number of targets selected for each spell effect to scripts to allow implementing spells that do something depending on number of targets hit
(cherry picked from commit 1a7779a6e6464d9bc5b367e02820213edd60f704)
Diffstat (limited to 'src/server/game/Spells/SpellScript.h')
| -rw-r--r-- | src/server/game/Spells/SpellScript.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index 6b399c3a59e..9c8e61a9b00 100644 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -194,9 +194,6 @@ enum SpellScriptHookType #define HOOK_SPELL_HIT_START SPELL_SCRIPT_HOOK_EFFECT_HIT #define HOOK_SPELL_HIT_END SPELL_SCRIPT_HOOK_AFTER_HIT + 1 -#define HOOK_SPELL_START SPELL_SCRIPT_HOOK_EFFECT -#define HOOK_SPELL_END SPELL_SCRIPT_HOOK_CHECK_CAST + 1 -#define HOOK_SPELL_COUNT HOOK_SPELL_END - HOOK_SPELL_START class TC_GAME_API SpellScript : public _SpellScript { @@ -343,6 +340,7 @@ class TC_GAME_API SpellScript : public _SpellScript void _PrepareScriptCall(SpellScriptHookType hookType); void _FinishScriptCall(); bool IsInCheckCastHook() const; + bool IsAfterTargetSelectionPhase() const; bool IsInTargetHook() const; bool IsInModifiableHook() const; bool IsInHitPhase() const; @@ -469,6 +467,11 @@ class TC_GAME_API SpellScript : public _SpellScript // returns: Item which was selected as an explicit spell target or NULL if there's no target Item* GetExplTargetItem() const; + // methods usable only after spell targets have been fully selected + int64 GetUnitTargetCountForEffect(SpellEffIndex effect) const; + int64 GetGameObjectTargetCountForEffect(SpellEffIndex effect) const; + int64 GetItemTargetCountForEffect(SpellEffIndex effect) const; + // methods useable only during spell hit on target, or during spell launch on target: // returns: target of current effect if it was Unit otherwise NULL Unit* GetHitUnit() const; |
