[trigger=Init]SS Init
Events
Map initialization
Conditions
Actions
Custom script: set udg_SS_Hash = InitHashtable()
-------- Configuration --------
-------- Determines the unwanted abilities --------
Set SS_IllegalAbilities[1] = Spell Steal
Set SS_IllegalAbilities[2] = Metamorphosis
-------- Determines the color of the stolen spell --------
Set SS_Color = |cff34ff34
-------- Determines how long does the stolen spell last --------
Set SS_Duration[1] = 60.00
Set SS_Duration[2] = 80.00
Set SS_Duration[3] = 100.00
-------- Determines the number when it will starts warning if the stolen spell is about to lose --------
Set SS_Warning = 20.00
-------- SFX when stealing spell --------
Set SS_SFX = Abilities\Spells\Undead\DeathPact\DeathPactTarget.mdl
[/trigger][trigger=Index]SS Abilities
Events
Map initialization
Conditions
Actions
-------- Abilities --------
-------- Bladestorm --------
Custom script: set udg_SS_OriginalAbility = 'AOww'
-------- Stolen version --------
Custom script: set udg_SS_StolenAbility = 'A005'
-------- Saving --------
Trigger - Run SS Ability Register <gen> (ignoring conditions)
-------- Shockwave --------
Custom script: set udg_SS_OriginalAbility = 'AOsh'
-------- Stolen version --------
Custom script: set udg_SS_StolenAbility = 'A003'
-------- Saving --------
Trigger - Run SS Ability Register <gen> (ignoring conditions)
-------- Mirror Image --------
Custom script: set udg_SS_OriginalAbility = 'AOmi'
-------- Stolen version --------
Custom script: set udg_SS_StolenAbility = 'A004'
-------- Saving --------
Trigger - Run SS Ability Register <gen> (ignoring conditions)
-------- War Stomp --------
Custom script: set udg_SS_OriginalAbility = 'AOws'
-------- Stolen version --------
Custom script: set udg_SS_StolenAbility = 'A002'
-------- Saving --------
Trigger - Run SS Ability Register <gen> (ignoring conditions)
-------- Bladestorm --------
Custom script: set udg_SS_OriginalAbility = 'AOwk'
-------- Stolen version --------
Custom script: set udg_SS_StolenAbility = 'A001'
-------- Saving --------
Trigger - Run SS Ability Register <gen> (ignoring conditions)
[/trigger][trigger=AbilityRegister]SS Ability Register
Events
Conditions
Actions
-------- Saving --------
Custom script: call SaveInteger(udg_SS_Hash,udg_SS_OriginalAbility,1,udg_SS_StolenAbility)
[/trigger][trigger=Register]SS Register
Events
Unit - A unit Starts the effect of an ability
Conditions
And - All (Conditions) are true
Conditions
(Ability being cast) Not equal to SS_IllegalAbilities[1]
(Ability being cast) Not equal to SS_IllegalAbilities[2]
Actions
Set SS_RegisterAbility = (Ability being cast)
Set SS_RegisterLevel = (Level of SS_RegisterAbility for SS_Registered)
Set SS_Registered = (Triggering unit)
Set SS_Casted = True
Custom script: set udg_SS_RegisteredKey = GetHandleId(udg_SS_Registered)
Hashtable - Save SS_Casted as (Key Boolean) of SS_RegisteredKey in SS_Hash
-------- Saving Spell --------
Custom script: call SaveInteger(udg_SS_Hash,udg_SS_RegisteredKey,2,udg_SS_RegisterAbility)
Custom script: call SaveInteger(udg_SS_Hash,udg_SS_RegisteredKey,3,udg_SS_RegisterLevel)
[/trigger][trigger=Cast]SS Cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Spell Steal
Actions
-------- Variables --------
Set SS_Caster = (Triggering unit)
Set SS_Target = (Target unit of ability being cast)
Custom script: set udg_SS_Key[1] = GetHandleId(udg_SS_Caster)
Custom script: set udg_SS_Key[2] = GetHandleId(udg_SS_Target)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Load (Key Boolean) of SS_Key[2] from SS_Hash) Equal to True
Then - Actions
-------- Removing Current Spell --------
Custom script: call UnitRemoveAbility(udg_SS_Caster,LoadInteger(udg_SS_Hash,udg_SS_Key[1],4))
Hashtable - Clear all child hashtables of child SS_Key[1] in SS_Hash
Unit Group - Remove SS_Caster from SS_LoopGroup
-------- Adding Ability --------
Custom script: set udg_SS_Ability[1] = LoadInteger(udg_SS_Hash,udg_SS_Key[2],2)
Custom script: set udg_SS_Ability[2] = LoadInteger(udg_SS_Hash,udg_SS_Ability[1],1)
Custom script: call UnitAddAbility(udg_SS_Caster,udg_SS_Ability[2])
-------- Setting Level --------
Set SS_StolenSpellLevel = (Load 3 of SS_Key[2] from SS_Hash)
Unit - Set level of SS_Ability[2] for SS_Caster to SS_StolenSpellLevel
Set SS_Current = 0.00
Set SS_SSLevel = (Level of Spell Steal for SS_Caster)
-------- Saving Variables --------
Custom script: call SaveInteger(udg_SS_Hash,udg_SS_Key[1],4,udg_SS_Ability[2])
Hashtable - Save SS_Current as 5 of SS_Key[1] in SS_Hash
Hashtable - Save SS_SSLevel as 6 of SS_Key[1] in SS_Hash
Hashtable - Save True as (Key On) of SS_Key[1] in SS_Hash
-------- Starting Loop --------
Unit Group - Add SS_Caster to SS_LoopGroup
Trigger - Turn on SS Loop <gen>
-------- Others --------
-------- Floating Text --------
Floating Text - Create floating text that reads (SS_Color + (Name of SS_Ability[1])) above SS_Caster with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the fading age of (Last created floating text) to 3.00 seconds
Floating Text - Change the lifespan of (Last created floating text) to 4.00 seconds
Floating Text - Create floating text that reads (SS_Color + (Name of SS_Ability[1])) above SS_Target with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the fading age of (Last created floating text) to 3.00 seconds
Floating Text - Change the lifespan of (Last created floating text) to 4.00 seconds
Else - Actions
-------- SFX --------
Special Effect - Create a special effect attached to the chest of SS_Caster using SS_SFX
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect attached to the chest of SS_Target using SS_SFX
Special Effect - Destroy (Last created special effect)
[/trigger][trigger=Loop]SS Loop
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(SS_LoopGroup is empty) Not equal to True
Then - Actions
Unit Group - Pick every unit in SS_LoopGroup and do (Actions)
Loop - Actions
Set SS_Picked = (Picked unit)
Custom script: set udg_SS_Key[3] = GetHandleId(udg_SS_Picked)
-------- Load --------
Set SS_Current = (Load 5 of SS_Key[3] from SS_Hash)
Set SS_SSLevel = (Load 6 of SS_Key[3] from SS_Hash)
-------- Checking --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SS_Current Less than SS_Duration[SS_SSLevel]
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Load (Key On) of SS_Key[3] from SS_Hash) Equal to True
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SS_Current Greater than (SS_Duration[SS_SSLevel] - SS_Warning)
Then - Actions
Set SS_Player = (Player group((Owner of SS_Picked)))
Game - Display to SS_Player the text: (|cffffcc00 + 20 seconds until your stolen spell will be removed)
Custom script: call DestroyForce(udg_SS_Player)
Hashtable - Save False as (Key On) of SS_Key[3] in SS_Hash
Else - Actions
Else - Actions
Hashtable - Save (SS_Current + 0.03) as 5 of SS_Key[3] in SS_Hash
Else - Actions
Custom script: call UnitRemoveAbility(udg_SS_Picked,LoadInteger(udg_SS_Hash,udg_SS_Key[3],4))
Hashtable - Clear all child hashtables of child SS_Key[3] in SS_Hash
Unit Group - Remove SS_Picked from SS_LoopGroup
Else - Actions
Trigger - Turn off (This trigger)
[/trigger]