1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  5. Dismiss Notice
  6. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Spell Steal v1.2

Submitted by Almia
This bundle is marked as approved. It works and satisfies the submission rules.
Due to some popular demands(which i am included too.)created this spell for those who wanted this.
Credits to the IceFrog Team for the idea of the spell.
Note:
This spell replaces the same spell,hence,its just like reseting its cooldown.
triggers
[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]​

Changelogs.
v1.1
-Added a new trigger where you can configure the spells,
-Changed name of some variables
v1.2
-Added a register trigger for the abilities

Keywords:
Steal
Contents

Spell Steal v1.2 (Map)

Reviews
Moderator
05:42, 26th Aug 2012 Magtheridon96: The code's fine, but it would be nice if you were to cache things like (Last created floating text) into variables so that you don't have to repeat the call over and over again.
  1. 05:42, 26th Aug 2012
    Magtheridon96:

    The code's fine, but it would be nice if you were to cache things like (Last created floating text) into variables so that you don't have to repeat the call over and over again.
     
  2. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,843
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    Reserved~
    Also i found out that this is easy to make!
    Check it out!

    edit
    This spell is pain in the object editor!
     
  3. CoLd Bon3

    CoLd Bon3

    Joined:
    Aug 8, 2010
    Messages:
    948
    Resources:
    4
    Spells:
    4
    Resources:
    4
    WOW! This is neat! Amazing job there, Radamantus!
     
  4. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,843
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    Thank You :D
     
  5. baassee

    baassee

    Joined:
    Nov 14, 2008
    Messages:
    3,220
    Resources:
    17
    Spells:
    14
    Tutorials:
    3
    Resources:
    17
    Noooooooooessss replace most arrays with non-arrayed variables. Arrays takes too much space to be worth it.

    Why you use customscript for LoadInteger only but not when you save all the other variables into the hashtable? Don't know what their native name is? :)
     
  6. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,843
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    Its okay for the arrays.
    Its okay to use Custom Script and that hashtable action.
    Nobody cares.
     
    Last edited by a moderator: Aug 26, 2012
  7. baassee

    baassee

    Joined:
    Nov 14, 2008
    Messages:
    3,220
    Resources:
    17
    Spells:
    14
    Tutorials:
    3
    Resources:
    17
    No it isn't sorry to disappointed ya.

    And you still didn't answer the question - why you use custom script to avoid the hashtable BJ only with integers? Why not do it on all Hashtable related while you're at it.
     
  8. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,843
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    I just got confused with integers and abilities thats why,
    Also there is no script for these
    LoadAbility
     
  9. baassee

    baassee

    Joined:
    Nov 14, 2008
    Messages:
    3,220
    Resources:
    17
    Spells:
    14
    Tutorials:
    3
    Resources:
    17
    • Hashtable - Save SS_Casted as (Key Boolean) of SS_RegisteredKey in SS_Hash
    • 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


    And there's a few more concerning if condition and variables.
     
  10. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,843
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    ahh the one SS_Casted right?
    I made so that the text Default String wont appear
    while the true is to dont spam the warning
     
  11. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    Abilities arent actual legit objects you know.
    They're integers.
     
  12. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,843
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    I dont get it,what do you mean by meaningful names and run a trigger?
    Do you mean not using custom script?
     
  13. defskull

    defskull

    Joined:
    Mar 27, 2008
    Messages:
    7,979
    Resources:
    17
    Spells:
    17
    Resources:
    17
    TempAbility -> OriginalAbility
    TempAbility2 -> StolenAbility

    Users would not understand what the heck is TempAbility1/2.
    When they read variable name Original/Stolen - Ability, they would understand it a bit (compared to TempAbility1/2)

    Run a trigger, is you do the saving inside another trigger (fires off by running trigger action).
    You're making the user of your trigger to be harder to configure your trigger.

    Look at some of my system (Signature), it uses this method, saving the values in another trigger (Item Weight (setup save) / Item Durability (setup save) / Frictional Knockback (event save) / etc)

    You can learn something from it, apparently it is called as "encapsulation", one of programming-style.
     
  14. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,843
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    oh thank you!
     
  15. doomhammer99

    doomhammer99

    Joined:
    Dec 5, 2011
    Messages:
    319
    Resources:
    5
    Models:
    1
    Spells:
    3
    Tutorials:
    1
    Resources:
    5
    Nice Radamantus..You've done a great job....
     
  16. ~DARK~

    ~DARK~

    Joined:
    Sep 2, 2012
    Messages:
    308
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I Love Your Spells They Are Nice
     
  17. FRENGERS

    FRENGERS

    Joined:
    Aug 4, 2012
    Messages:
    971
    Resources:
    4
    Icons:
    3
    Maps:
    1
    Resources:
    4
    Holy shet babe @.@
     
  18. doomhammer99

    doomhammer99

    Joined:
    Dec 5, 2011
    Messages:
    319
    Resources:
    5
    Models:
    1
    Spells:
    3
    Tutorials:
    1
    Resources:
    5
    • Lightning Dash Cast

    [EVENT]Events[/Event]
     
  19. Lolznessmann

    Lolznessmann

    Joined:
    Apr 23, 2017
    Messages:
    4
    Resources:
    0
    Resources:
    0
    Ok so silly question but how do i import this spell? I get the error(s) that
    Line 142: Expected a variable name
    set udg_SS_OriginalAbility = 'AOww'
    Same for lines 144,148,150,154,156,160,162,166,168
    And for Line 184: Expected a name
    call SaveInteger(udg_SS_Hash,udg_SS_OriginalAbility,1,udg_SS_StolenAbility

    Thx in advance