• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Kamikaze Sheep

This is the spell I made for Freeze87 request.

Kamikaze Sheep
The hero summons a sheep in front of him which will follow targeted unit untill it reaches the target or untill the timer expires. The sheep will last for 6 seconds.If the sheep reaches target unit it explodes. Explosion deals damage to all units in a small range.
The spell:
- fully MUI
- contains Readme and full documentation
- uses hashtables

  • Hash
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- ======================= --------
      • -------- We create a hshtable --------
      • -------- ======================= --------
      • Hashtable - Create a hashtable
      • -------- ======================= --------
      • -------- We store it to a variable --------
      • -------- ======================= --------
      • Set ES_Hash = (Last created hashtable)
  • Sheep Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Kamikaze Sheep
    • Actions
      • -------- ======================= --------
      • -------- Don`t change anything here. There`s no really need to do so --------
      • -------- ======================= --------
      • Set ES_Counter = (ES_Counter + 1)
      • Set ES_Cast = (Triggering unit)
      • Set ES_Targ = (Target unit of ability being cast)
      • Set ES_Point[1] = (Position of ES_Cast)
      • Set ES_Point[2] = (ES_Point[1] offset by 125.00 towards (Facing of ES_Cast) degrees)
      • -------- ======================= --------
      • -------- Now editables --------
      • -------- ======================= --------
      • -------- This is the damage that will be dealt on explosion --------
      • Set ES_Damage = (75.00 + (25.00 x (Real((Level of Kamikaze Sheep for ES_Cast)))))
      • -------- That is the AoE of explosion --------
      • Set ES_AoE = (250.00 + (50.00 x (Real((Level of Kamikaze Sheep for ES_Cast)))))
      • -------- This is the number which from the counting begins --------
      • Set ES_MaxTimer = 6
      • -------- If true the explosion kills ALL destructables within AoE --------
      • Set ES_KillDestructables = True
      • -------- If true there is created floating text --------
      • Set ES_CreateText = True
      • -------- Here you set the text that will appear if the counter goes to 0 --------
      • Set ES_0Text = BUM!
      • -------- If true the sheep will automatically die if the target is dead --------
      • Set ES_KillIfDead = True
      • -------- If true the owner of the sheep will be able to see the target unit even if it`s invisible --------
      • Set ES_DetectInvis = True
      • -------- ======================= --------
      • -------- Here we create the detector if DetectInvis is true --------
      • -------- ======================= --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ES_DetectInvis Equal to True
        • Then - Actions
          • Set ES_Point[4] = (Position of ES_Targ)
          • Unit - Create 1 Detecting Dummy for (Owner of ES_Cast) at ES_Point[4] facing Default building facing degrees
          • Custom script: call RemoveLocation (udg_ES_Point[4])
          • Unit - Order (Last created unit) to Attack ES_Targ
          • -------- I didn`t want to create more unit variables so I used already existing one --------
          • Set ES_Sheep = (Last created unit)
        • Else - Actions
      • -------- ======================= --------
      • -------- Leak Cleaning --------
      • -------- ======================= --------
      • Custom script: call RemoveLocation (udg_ES_Point[1])
      • -------- ======================= --------
      • -------- We create the Sheep --------
      • -------- ======================= --------
      • Unit - Create 1 Sheep for (Owner of ES_Cast) at ES_Point[2] facing Default building facing degrees
      • -------- ======================= --------
      • -------- Leak Cleaning --------
      • -------- ======================= --------
      • Custom script: call RemoveLocation (udg_ES_Point[2])
      • -------- ======================= --------
      • -------- We add sheep to group which will move it for us --------
      • -------- ======================= --------
      • Unit Group - Add (Last created unit) to ES_Sheeps
      • -------- ======================= --------
      • -------- Storing data to hashtable --------
      • -------- ======================= --------
      • Hashtable - Save Handle OfES_Targ as 1 of (Key (Last created unit)) in ES_Hash
      • Hashtable - Save ES_MaxTimer as 2 of (Key (Last created unit)) in ES_Hash
      • Hashtable - Save 0 as 3 of (Key (Last created unit)) in ES_Hash
      • Hashtable - Save ES_AoE as 4 of (Key (Last created unit)) in ES_Hash
      • Hashtable - Save ES_Damage as 5 of (Key (Last created unit)) in ES_Hash
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ES_DetectInvis Equal to True
        • Then - Actions
          • Hashtable - Save Handle OfES_Sheep as 6 of (Key (Last created unit)) in ES_Hash
        • Else - Actions
      • Hashtable - Save Handle OfES_Cast as 7 of (Key (Last created unit)) in ES_Hash
      • Hashtable - Save ES_KillDestructables as 8 of (Key (Last created unit)) in ES_Hash
      • Hashtable - Save ES_CreateText as 9 of (Key (Last created unit)) in ES_Hash
      • Hashtable - Save ES_0Text as 10 of (Key (Last created unit)) in ES_Hash
      • Hashtable - Save ES_KillIfDead as 11 of (Key (Last created unit)) in ES_Hash
      • Hashtable - Save ES_DetectInvis as 12 of (Key (Last created unit)) in ES_Hash
      • -------- ======================= --------
      • -------- We check if loop is already running coz there`s no need to turn it on if it`s already done --------
      • -------- ======================= --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ES_Counter Less than or equal to 1
        • Then - Actions
          • Trigger - Turn on Sheep Loop <gen>
        • Else - Actions
Keywords:
sheep, boom, kamikaze, explosion, fire, pyro, run, strike, red, text, meee, kaboom, destruction, destroy, burn, yay
Contents

Kamikaze Sheep (Map)

Reviews
19:37, 22nd Mar 2010 The_Reborn_Devil: The triggering looks ok and there were no leaks. It's a very simple spell though. Status: Approved Rating: Lacking If you feel my review is incorrect please don't hesitate to contact me through PM/VM...

Moderator

M

Moderator

19:37, 22nd Mar 2010
The_Reborn_Devil:
The triggering looks ok and there were no leaks. It's a very simple spell though.


Status: Approved
Rating: Lacking

If you feel my review is incorrect please don't hesitate to contact me through PM/VM or Chat. Have a nice day!
 
  • Hash
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- ======================= --------
      • -------- We create a hshtable --------
      • -------- ======================= --------
      • Hashtable - Create a hashtable
      • -------- ======================= --------
      • -------- We store it to a variable --------
      • -------- ======================= --------
      • Set ES_Hash = (Last created hashtable)
  • Sheep Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Kamikaze Sheep
    • Actions
      • -------- ======================= --------
      • -------- Don`t change anything here. There`s no really need to do so --------
      • -------- ======================= --------
      • Set ES_Counter = (ES_Counter + 1)
      • Set ES_Cast = (Triggering unit)
      • Set ES_Targ = (Target unit of ability being cast)
      • Set ES_Point[1] = (Position of ES_Cast)
      • Set ES_Point[2] = (ES_Point[1] offset by 125.00 towards (Facing of ES_Cast) degrees)
      • -------- ======================= --------
      • -------- Now editables --------
      • -------- ======================= --------
      • -------- This is the damage that will be dealt on explosion --------
      • Set ES_Damage = (75.00 + (25.00 x (Real((Level of Kamikaze Sheep for ES_Cast)))))
      • -------- That is the AoE of explosion --------
      • Set ES_AoE = (250.00 + (50.00 x (Real((Level of Kamikaze Sheep for ES_Cast)))))
      • -------- This is the number which from the counting begins --------
      • Set ES_MaxTimer = 6
      • -------- If true the explosion kills ALL destructables within AoE --------
      • Set ES_KillDestructables = True
      • -------- If true there is created floating text --------
      • Set ES_CreateText = True
      • -------- Here you set the text that will appear if the counter goes to 0 --------
      • Set ES_0Text = BUM!
      • -------- If true the sheep will automatically die if the target is dead --------
      • Set ES_KillIfDead = True
      • -------- If true the owner of the sheep will be able to see the target unit even if it`s invisible --------
      • Set ES_DetectInvis = True
      • -------- ======================= --------
      • -------- Here we create the detector if DetectInvis is true --------
      • -------- ======================= --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ES_DetectInvis Equal to True
        • Then - Actions
          • Set ES_Point[4] = (Position of ES_Targ)
          • Unit - Create 1 Detecting Dummy for (Owner of ES_Cast) at ES_Point[4] facing Default building facing degrees
          • Custom script: call RemoveLocation (udg_ES_Point[4])
          • Unit - Order (Last created unit) to Attack ES_Targ
          • -------- I didn`t want to create more unit variables so I used already existing one --------
          • Set ES_Sheep = (Last created unit)
        • Else - Actions
      • -------- ======================= --------
      • -------- Leak Cleaning --------
      • -------- ======================= --------
      • Custom script: call RemoveLocation (udg_ES_Point[1])
      • -------- ======================= --------
      • -------- We create the Sheep --------
      • -------- ======================= --------
      • Unit - Create 1 Sheep for (Owner of ES_Cast) at ES_Point[2] facing Default building facing degrees
      • -------- ======================= --------
      • -------- Leak Cleaning --------
      • -------- ======================= --------
      • Custom script: call RemoveLocation (udg_ES_Point[2])
      • -------- ======================= --------
      • -------- We add sheep to group which will move it for us --------
      • -------- ======================= --------
      • Unit Group - Add (Last created unit) to ES_Sheeps
      • -------- ======================= --------
      • -------- Storing data to hashtable --------
      • -------- ======================= --------
      • Hashtable - Save Handle OfES_Targ as 1 of (Key (Last created unit)) in ES_Hash
      • Hashtable - Save ES_MaxTimer as 2 of (Key (Last created unit)) in ES_Hash
      • Hashtable - Save 0 as 3 of (Key (Last created unit)) in ES_Hash
      • Hashtable - Save ES_AoE as 4 of (Key (Last created unit)) in ES_Hash
      • Hashtable - Save ES_Damage as 5 of (Key (Last created unit)) in ES_Hash
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ES_DetectInvis Equal to True
        • Then - Actions
          • Hashtable - Save Handle OfES_Sheep as 6 of (Key (Last created unit)) in ES_Hash
        • Else - Actions
      • Hashtable - Save Handle OfES_Cast as 7 of (Key (Last created unit)) in ES_Hash
      • Hashtable - Save ES_KillDestructables as 8 of (Key (Last created unit)) in ES_Hash
      • Hashtable - Save ES_CreateText as 9 of (Key (Last created unit)) in ES_Hash
      • Hashtable - Save ES_0Text as 10 of (Key (Last created unit)) in ES_Hash
      • Hashtable - Save ES_KillIfDead as 11 of (Key (Last created unit)) in ES_Hash
      • Hashtable - Save ES_DetectInvis as 12 of (Key (Last created unit)) in ES_Hash
      • -------- ======================= --------
      • -------- We check if loop is already running coz there`s no need to turn it on if it`s already done --------
      • -------- ======================= --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ES_Counter Less than or equal to 1
        • Then - Actions
          • Trigger - Turn on Sheep Loop <gen>
        • Else - Actions
  • Sheep Loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • -------- ======================= --------
      • -------- Loop Actions --------
      • -------- ======================= --------
      • Unit Group - Pick every unit in ES_Sheeps and do (Actions)
        • Loop - Actions
          • -------- ======================= --------
          • -------- We store some data to variables to make life easier --------
          • -------- ======================= --------
          • Set ES_Targ = (Load 1 of (Key (Picked unit)) in ES_Hash)
          • Set ES_Cast = (Load 7 of (Key (Picked unit)) in ES_Hash)
          • Set ES_Sheep = (Picked unit)
          • Set ES_Point[3] = (Position of ES_Targ)
          • Set ES_Point[6] = (Position of ES_Sheep)
          • Set ES_Damage = (Load 5 of (Key (Picked unit)) from ES_Hash)
          • -------- ======================= --------
          • -------- Now we check if the target is dead. If yes we kill sheep if not we get another target for it. --------
          • -------- ======================= --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 11 of (Key (Picked unit)) from ES_Hash) Equal to True
              • (ES_Targ is dead) Equal to True
            • Then - Actions
              • Hashtable - Save -1 as 2 of (Key (Picked unit)) in ES_Hash
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 11 of (Key (Picked unit)) from ES_Hash) Equal to False
                  • (ES_Targ is dead) Equal to True
                • Then - Actions
                  • Set ES_Units = (Units within (Load 4 of (Key (Picked unit)) from ES_Hash) of ES_Point[6] matching (((Matching unit) belongs to an enemy of (Owner of ES_Sheep)) Equal to True))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in ES_Units) Greater than or equal to 1
                    • Then - Actions
                      • Hashtable - Save Handle Of(Random unit from ES_Units) as 1 of (Key (Last created unit)) in ES_Hash
                    • Else - Actions
                      • -------- Instead of cnping the sheep kill actions we 'return' proper value, which will run kill sheep actions --------
                      • Hashtable - Save -1 as 2 of (Key (Picked unit)) in ES_Hash
                  • Custom script: call DestroyGroup (udg_ES_Units)
                • Else - Actions
          • -------- ======================= --------
          • -------- We order sheep to attack to don`t make it stop --------
          • -------- ======================= --------
          • Unit - Order ES_Sheep to Attack ES_Targ
          • -------- ======================= --------
          • -------- Here we move the 'detector' to target pos to see it if it`s invisible. Ofc if DetectInvis is true --------
          • -------- ======================= --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 12 of (Key (Picked unit)) from ES_Hash) Equal to True
            • Then - Actions
              • Unit - Move (Load 6 of (Key (Picked unit)) in ES_Hash) instantly to ES_Point[3]
            • Else - Actions
          • -------- ======================= --------
          • -------- Here we do countings. One will check if it`s time to create floating text. Second if it`s time to kill the sheep --------
          • -------- ======================= --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 3 of (Key (Picked unit)) from ES_Hash) Equal to 20
            • Then - Actions
              • -------- If you want and if it`s time for it we create the floating text --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 9 of (Key (Picked unit)) from ES_Hash) Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Load 2 of (Key (Picked unit)) from ES_Hash) Not equal to 0
                    • Then - Actions
                      • Floating Text - Create floating text that reads (String((Load 2 of (Key (Picked unit)) from ES_Hash))) at ES_Point[6] with Z offset 0.00, using font size 10.00, color (100.00%, 5.00%, 5.00%), and 0.00% transparency
                    • Else - Actions
                      • Floating Text - Create floating text that reads (Load 10 of (Key (Picked unit)) from ES_Hash) at ES_Point[6] with Z offset 0.00, using font size 10.00, color (100.00%, 5.00%, 5.00%), and 0.00% transparency
                  • Floating Text - Change (Last created floating text): Disable permanence
                  • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                  • 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 3.00 seconds
                • Else - Actions
              • -------- Here we do countings --------
              • Hashtable - Save ((Load 2 of (Key (Picked unit)) from ES_Hash) - 1) as 2 of (Key (Picked unit)) in ES_Hash
              • Hashtable - Save 0 as 3 of (Key (Picked unit)) in ES_Hash
            • Else - Actions
              • -------- If not we do other counting --------
              • Hashtable - Save ((Load 3 of (Key (Picked unit)) from ES_Hash) + 1) as 3 of (Key (Picked unit)) in ES_Hash
          • -------- ======================= --------
          • -------- Here we kill the sheep and all actions when the sheep is dead --------
          • -------- ======================= --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Load 2 of (Key (Picked unit)) from ES_Hash) Less than 0) or ((Distance between ES_Point[6] and ES_Point[3]) Less than or equal to 100.00)
            • Then - Actions
              • -------- We damage units --------
              • Set ES_Units = (Units within (Load 4 of (Key (Picked unit)) from ES_Hash) of ES_Point[6] matching (((Matching unit) belongs to an enemy of (Owner of ES_Sheep)) Equal to True))
              • Unit Group - Pick every unit in ES_Units and do (Actions)
                • Loop - Actions
                  • Unit - Cause ES_Cast to damage (Picked unit), dealing ES_Damage damage of attack type Spells and damage type Normal
              • Custom script: call DestroyGroup (udg_ES_Units)
              • -------- If you want we destroy destructables --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 8 of (Key (Picked unit)) from ES_Hash) Equal to True
                • Then - Actions
                  • Destructible - Pick every destructible within (Load 4 of (Key (Picked unit)) from ES_Hash) of ES_Point[6] and do (Actions)
                    • Loop - Actions
                      • Destructible - Kill (Picked destructible)
                • Else - Actions
              • -------- We create some nice special effects --------
              • Special Effect - Create a special effect at ES_Point[6] using Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
              • Special Effect - Destroy (Last created special effect)
              • Special Effect - Create a special effect at ES_Point[6] using Abilities\Spells\Other\Volcano\VolcanoDeath.mdl
              • Special Effect - Destroy (Last created special effect)
              • -------- We remove detector from game --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 12 of (Key (Picked unit)) from ES_Hash) Equal to True
                • Then - Actions
                  • Unit - Remove (Load 6 of (Key (Picked unit)) in ES_Hash) from the game
                • Else - Actions
              • -------- These are the damaging flames --------
              • Unit - Create 1 Dummy ( UNIT ) for (Owner of ES_Sheep) at ES_Point[6] facing Default building facing degrees
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Unit - Add Flames ( DUMMY ) to (Last created unit)
              • Unit - Set level of Flames ( DUMMY ) for (Last created unit) to (Level of Kamikaze Sheep for ES_Cast)
              • Unit - Order (Last created unit) to Human Blood Mage - Flame Strike ES_Point[6]
              • -------- Final cleaning --------
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in ES_Hash
              • Unit Group - Remove ES_Sheep from ES_Sheeps
              • Unit - Kill ES_Sheep
              • Unit - Remove ES_Sheep from the game
              • Set ES_Counter = (ES_Counter - 1)
            • Else - Actions
          • -------- ======================= --------
          • -------- Leaks cleaning --------
          • -------- ======================= --------
          • Custom script: call RemoveLocation (udg_ES_Point[6])
          • Custom script: call RemoveLocation (udg_ES_Point[3])
      • -------- ======================= --------
      • -------- If there are no more sheeps we turn this trigger off --------
      • -------- ======================= --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ES_Counter Less than or equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
Edit: Unfortunately, it's a bit too easy to be approved, but I guess the sheep will pay off the attention and the hashtables will give this a chance, since we mostly have indexing systems around.
It's useful. :)
 
Level 9
Joined
Oct 31, 2009
Messages
121
Add the Hidden tags to the triggers posted, please?

EDIT: Thank you.
Well, tested the spell. If the sheep slides the way to it's target and it is invulnerable, then it should have a Locust ability instead of Invulnerable (Neutral), or if it should be destroyable, then it should have a Ward flag at the Classification.
And, create the Hashtable at the Map init trigger.
 
Level 18
Joined
Feb 28, 2009
Messages
1,970
Edit: Unfortunately, it's a bit too easy to be approved, but I guess the sheep will pay off the attention and the hashtables will give this a chance, since we mostly have indexing systems around.
It's useful. :)
YEah, agreed ^^
Umm, well I may improve it a little bit soon when I`ll get any idea what to do.
Oh, I`ve got one ;p
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Move this

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ES_Counter Less than or equal to 0
    • Then - Actions
      • Trigger - Turn off (This trigger)
    • Else - Actions
directly after this

  • Set ES_Counter = (ES_Counter - 1)
The check will run fewer times. The counter can't be zero if it isn't subtracted from.
 
Level 18
Joined
Feb 28, 2009
Messages
1,970
I have an Idea:
You could add another spell - Detonate (unit, not hero ability), which would allow to explode the sheep before time.
Good idea ;] I`ll add this soon.

EDIT: Done.

Krisserz i must ask you, whay sheep move so slow when its move speed is 500? :D In my map heroes have much lesser MS and sheep cant catch them. :D But spell is still very good :D
I`m fixing it.
 
Last edited:
Top