• 🏆 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!

Burning Arrow

This is the spell I made to check, if I still remember how to trigger. I haven`t been using WE for a long time, so there may be some little things, but I hope there aren`t any.

Burning Arrow
The hero shoots a burning arrow that flies a great distance towards the targeted point, dealing damage to all units in a line that it hits. Additionally, the arrow's intense heat ignites the ground below it as it travels, creating secondary explosions for extra damage and burning units over time.

Level 1 - Range -750, Arrow Damage - 75
Level 2 - Range -1000, Arrow Damage - 100
Level 3 - Range -1250, Arrow Damage - 125
The spell:
- fully MUI
- contains Readme and full documentation
- uses hashtables

Hashtable

  • Hashtable
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- ---------------- --------
      • -------- We create a hashtable --------
      • -------- ---------------- --------
      • Hashtable - Create a hashtable
      • -------- ---------------- --------
      • -------- And now we set it to a variable, to know which one to use --------
      • -------- ---------------- --------
      • Set BA_Hashtable = (Last created hashtable)
BA Init
  • BA Init
  • BA Init
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Burning Arrow
    • Actions
      • -------- ---------------- --------
      • -------- We incarase the number of run triggers, to keep running loop trigger --------
      • -------- ---------------- --------
      • Set BA_To_Finish = (BA_To_Finish + 1)
      • -------- We set a position of caster, to don`t leak in setting with polar offset --------
      • Set BA_Startpt = (Position of (Triggering unit))
      • -------- We set a target point of ability, to count the angle, where the arrow will be created --------
      • Set BA_Targetpt = (Target point of ability being cast)
      • -------- We set the level of ability, for further setting levels of flamestrikes for dummies --------
      • Set BA_Flame_Lvl = (Level of Burning Arrow for (Triggering unit))
      • -------- Now we set the distance --------
      • -------- (how far the arrow will fly) --------
      • Set BA_Distance = (500 + (250 x (Level of Burning Arrow for (Triggering unit))))
      • -------- We set what will be the instant damage of arrow --------
      • Set BA_Damage = (50.00 + (25.00 x (Real((Level of Burning Arrow for (Triggering unit))))))
      • -------- We set the angle, In which way the arrow will fly --------
      • Set BA_Arrow_Angle = (Angle from BA_Startpt to BA_Targetpt)
      • -------- We set the point, where the arrow will be created --------
      • Set BA_Creatept = (BA_Startpt offset by 75.00 towards BA_Arrow_Angle degrees)
      • -------- ---------------- --------
      • -------- We create the arrow --------
      • -------- ---------------- --------
      • Unit - Create 1 Dummy ( Arrow ) for (Owner of (Triggering unit)) at BA_Creatept facing BA_Arrow_Angle degrees
      • -------- We turn collision off for the arrow, to don`t let it block on units --------
      • Unit - Turn collision for (Last created unit) Off
      • -------- ---------------- --------
      • -------- We clean the leaks, cause we won`t need these locations no longer --------
      • -------- ---------------- --------
      • Custom script: call RemoveLocation (udg_BA_Startpt)
      • Custom script: call RemoveLocation (udg_BA_Targetpt)
      • Custom script: call RemoveLocation (udg_BA_Creatept)
      • -------- ---------------- --------
      • -------- Now we store the data to hashtables --------
      • -------- ---------------- --------
      • -------- Here we store the damage to hashtable --------
      • Hashtable - Save BA_Damage as 0 of (Key (Last created unit)) in BA_Hashtable
      • -------- This data is our "counter" --------
      • -------- (More about a "counter" in README) --------
      • Hashtable - Save 0 as 1 of (Key (Last created unit)) in BA_Hashtable
      • -------- We store a distance to the hashtable --------
      • Hashtable - Save (BA_Distance / 25) as 2 of (Key (Last created unit)) in BA_Hashtable
      • -------- We store the level of "Burning Arrow" to hashtable --------
      • Hashtable - Save BA_Flame_Lvl as 3 of (Key (Last created unit)) in BA_Hashtable
      • -------- We store the angle, to make arrow move in only one way --------
      • Hashtable - Save BA_Arrow_Angle as 4 of (Key (Last created unit)) in BA_Hashtable
      • -------- Here we set the counter of flamestrikes --------
      • -------- (distance between them) --------
      • -------- (More about this "counter" in README too) --------
      • Hashtable - Save 0 as 5 of (Key (Last created unit)) in BA_Hashtable
      • -------- ---------------- --------
      • -------- We add the arrow to the group --------
      • -------- (In loop trigger it will make arrow move) --------
      • -------- ---------------- --------
      • Unit Group - Add (Last created unit) to BA_Arrows
      • -------- ---------------- --------
      • -------- Here we "check" if the loop trigger is already running, because if is, there is no need to turn it on again --------
      • -------- ---------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in BA_Arrows) Equal to 1
        • Then - Actions
          • Trigger - Turn on BA Loop <gen>
        • Else - Actions
      • -------- ---------------- --------
      • -------- End of this trigger, now look at the loop trigger --------
      • -------- ---------------- --------
BA Loop
  • BA Loop
    • Event
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • -------- ---------------- --------
      • -------- We pick all the arrows to move them --------
      • -------- ---------------- --------
      • Unit Group - Pick every unit in BA_Arrows and do (Actions)
        • Loop - Actions
          • -------- ---------------- --------
          • -------- Here we check if our counter is greater than max distance --------
          • -------- ---------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 1 of (Key (Picked unit)) from BA_Hashtable) Less than or equal to (Load 2 of (Key (Picked unit)) from BA_Hashtable)
            • Then - Actions
              • -------- ---------------- --------
              • -------- We incarase our counter, to make the spell finish somewhen --------
              • -------- ---------------- --------
              • Hashtable - Save ((Load 1 of (Key (Picked unit)) from BA_Hashtable) + 1) as 1 of (Key (Picked unit)) in BA_Hashtable
              • -------- ---------------- --------
              • -------- We load the damage, which will be dealed to units within AoE of arrow to make life easier --------
              • -------- ---------------- --------
              • Set BA_Dealdmg = (Load 0 of (Key (Picked unit)) from BA_Hashtable)
              • -------- We set currently picked arrow to a variable to make life easier --------
              • Set BA_Arrow = (Picked unit)
              • -------- We set the position of the arrow, to don`t leak in polar projection --------
              • Set BA_Arrowpt = (Position of BA_Arrow)
              • -------- We set the point, the arrow will be moved in --------
              • Set BA_Movept = (BA_Arrowpt offset by 25.00 towards (Load 4 of (Key (Picked unit)) from BA_Hashtable) degrees)
              • -------- We move the arrow --------
              • Unit - Move BA_Arrow instantly to BA_Movept
              • -------- ---------------- --------
              • -------- Now we will damage the units "touched" by our arrow --------
              • -------- ---------------- --------
              • -------- We set the units which are very close to arrow to a variable to don`t leak --------
              • Set BA_Victims = (Units within 50.00 of BA_Movept matching ((((Matching unit) belongs to an enemy of (Owner of BA_Arrow)) Equal to True) and (((Matching unit) is alive) Equal to True)))
              • Unit Group - Pick every unit in BA_Victims and do (Actions)
                • Loop - Actions
                  • -------- ---------------- --------
                  • -------- We damage these units --------
                  • -------- ---------------- --------
                  • Unit - Cause BA_Arrow to damage (Picked unit), dealing BA_Dealdmg damage of attack type Spells and damage type Normal
                  • -------- We add nice SFX --------
                  • Special Effect - Create a special effect attached to the chest of (Picked unit) using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
                  • -------- We remove special effect, to don`t leak --------
                  • Special Effect - Destroy (Last created special effect)
              • -------- We remove leaking group --------
              • Custom script: call DestroyGroup (udg_BA_Victims)
              • -------- ---------------- --------
              • -------- Now flamestrikes --------
              • -------- ---------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Coditions
                  • (Load 5 of (Key (Picked unit)) from BA_Hashtable) Equal to 5
                • Then - Actions
                  • -------- If our counter value is as big as we wanted, we set it to 0 to make it start again --------
                  • Hashtable - Save 0 as 5 of (Key (Picked unit)) in BA_Hashtable
                  • -------- We create dummy unit, which will cast the flamestrike --------
                  • Unit - Create 1 Dummy ( Unit ) for (Owner of BA_Arrow) at BA_Arrowpt facing Default building facing degrees
                  • -------- We make it die --------
                  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                  • -------- We add a flamestrike to dummy -------
                  • -------- ( If you have already dummy unit on your map, you can simply just change summy unit I used to yours, and it will work ) --------
                  • Unit - Add Flame ( DUMMY ) to (Last created unit)
                  • -------- We set the level of flamestrike to tlevel of burning arrow for caster --------
                  • Unit - Set level of Flame ( DUMMY ) for (Last created unit) to (Load 3 of (Key (Picked unit)) from BA_Hashtable)
                  • -------- We order dummy to cast flamestrike --------
                  • Unit - Order (Last created unit) to Human Blood Mage - Flame Strike BA_Movept
                • Else - Actions
                  • -------- If the counter value is not big enaugh, we incarase it --------
                  • Hashtable - Save ((Load 5 of (Key (Picked unit)) from BA_Hashtable) + 1) as 5 of (Key (Picked unit)) in BA_Hashtable
                • Albo - Akcje
                  • -------- If the counter value is not big enaugh, we incarase it --------
                  • Hashtable - Save ((Load 5 of (Key (Picked unit)) from BA_Hashtable) + 1) as 5 of (Key (Picked unit)) in BA_Hashtable
              • -------- ---------------- --------
              • -------- We clean location, because we won`t need them again --------
              • -------- ---------------- --------
              • Custom script: call RemoveLocation (udg_BA_Arrowpt)
              • Custom script: call RemoveLocation (udg_BA_Movept)
            • Else - Actions
              • -------- ---------------- --------
              • -------- If the arrow has reached the max distance, we clear the hashtable, to remove the data, we won`t need agtain --------
              • -------- ---------------- --------
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in BA_Hashtable
              • -------- We remove the arrow from moving group --------
              • Unit Group - Remove (Picked unit) from BA_Arrows
              • -------- We kill it :( --------
              • Unit - Kill (Picked unit)
              • -------- And we decrase the number, which will turn off the trigger, if there are no arrows flying --------
              • Set BA_To_Finish = (BA_To_Finish - 1)
      • -------- ---------------- --------
      • -------- And this is what we do now --------
      • -------- If there are no arrows on the map now, we turn loop trigger off, to stop using memory, when it`s not needed --------
      • -------- ---------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Condition
          • BA_To_Finish Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions

If you find any bug/have any idea how to improve, than post it here.

30.12.2009 - changed BA_Distance, so it can be now normal Wc3 value, and the distance for loop is counted when storing it to hashtable

2.01.2010 - Updated spell description (Thank you Damage), and small README polishing done.

5.01.2010 - More language and documentation polishing, now the hashtable trigger starts after 0.00 seconds, to make the map have only one "Map Initialization" trigger.

14.01.2010 - Small comments updates, and code in description is now fixed. Also little balancing with flamestrikes done.

27.01.2010 - Removed food costs from dummy units and polished the terrain of test map a little.

31.01.2010 - Flamestrikes no longer damage caster and allies.
2nd update - changed
  • Set BA_Distance = (500 + (250 x (Level of Burning Arrow for (Triggering unit))))
  • Set BA_Damage = (50.00 + (25.00 x (Real((Level of Burning Arrow for (Triggering unit))))))
to
  • Set BA_Distance = (500 + (250 x BA_Flame_Lvl))
  • Set BA_Damage = (50.00 + (25.00 x (Real(BA_Flame_Lvl))))
(I forgot I`ve stored it to variable ;p)


Keywords:
fire, burn, arrow, pyro, flame, strike, lulz, mui, hashtable, spell, move, leaks, rpg, arena, fly, archer, knockback, shot, fast, speed, quick
Contents

Burning Arrow (Map)

Reviews
13:56, 27th Dec 2009 TriggerHappy: Review for Spell Coding was fine as far as I could see, leakless and MUI. Status Feel free to message me here if you have any issues with my review or if you have updated your resource and...

Moderator

M

Moderator

13:56, 27th Dec 2009
TriggerHappy:

Review for Spell

Coding was fine as far as I could see, leakless and MUI.

Status

Feel free to message me here if you have any issues with
my review or if you have updated your resource and want it reviewed again.

Approved
 
Level 18
Joined
Feb 28, 2009
Messages
1,970
If someone could post me the triggers, I would be thankful.
(I have other language ver of WE, so my triggers suck, and I was wondering if someone could post me english version of them)

HMPH wtf happened to screenie...

EDIT: Yay now it works
 
Level 9
Joined
Aug 2, 2008
Messages
219

[trigger]
Hashtable
Events
Map initialization
Conditions
Actions
-------- ---------------- --------
-------- We create a hashtable --------
-------- ---------------- --------
Hashtable - Create a hashtable
-------- ---------------- --------
-------- And now we set it to a variable, to know which one to use --------
-------- ---------------- --------
Set BA_Hashtable = (Last created hashtable)
[/trigger]
[trigger]
BA Init
Events
Unit - A unit Starts the effect of an ability (Bad)
Conditions
(Ability being cast) Equal to Burning Arrow
Actions
-------- ---------------- --------
-------- We incarase the number of run triggers, to keep running loop trigger --------
Set BA_To_Finish = (BA_To_Finish + 1)
-------- We set a position of caster, to don`t leak in setting with polar offset --------
Set BA_Startpt = (Position of (Triggering unit))
-------- We set a target point of ability, to count the angle, where the arrow will be created --------
Set BA_Targetpt = (Target point of ability being cast)
-------- We set the level of ability, for further setting levels of flamestrikes for dummies --------
Set BA_Flame_Lvl = (Level of Burning Arrow for (Triggering unit))
-------- Now we set the distance --------
-------- (how far the arrow will fly) --------
-------- (TO SET THIS RIGHT READ "README"!!) --------
Set BA_Distance = (20 + (10 x (Level of Burning Arrow for (Triggering unit))))
-------- We set what will be the instant damage of arrow --------
Set BA_Damage = (50.00 + (25.00 x (Real((Level of Burning Arrow for (Triggering unit))))))
-------- We set the angle, In which way the arrow will fly --------
Set BA_Arrow_Angle = (Angle from BA_Startpt to BA_Targetpt)
-------- We set the point, where the arrow will be created --------
Set BA_Creatept = (BA_Startpt offset by 75.00 towards BA_Arrow_Angle degrees)
-------- ---------------- --------
-------- We create the arrow --------
-------- ---------------- --------
Unit - Create 1 Dummy ( Arrow ) for (Owner of (Triggering unit)) at BA_Creatept facing BA_Arrow_Angle degrees
-------- We turn collision off for the arrow, to don`t let it block on units --------
Unit - Turn collision for (Last created unit) Off
-------- ---------------- --------
-------- We clean the leaks, cause we won`t need these locations no longer --------
-------- ---------------- --------
Custom script: call RemoveLocation (udg_BA_Startpt)
Custom script: call RemoveLocation (udg_BA_Targetpt)
Custom script: call RemoveLocation (udg_BA_Creatept)
-------- ---------------- --------
-------- Now we store the data to hashtables --------
-------- ---------------- --------
-------- Here we store the damage to hashtable --------
Hashtable - Save BA_Damage as 0 of (Key (Last created unit)) in BA_Hashtable
-------- This data is our "counter" --------
-------- (More about a "counter" in README) --------
Hashtable - Save 0 as 1 of (Key (Last created unit)) in BA_Hashtable
-------- We store a distance to the hashtable --------
Hashtable - Save BA_Distance as 2 of (Key (Last created unit)) in BA_Hashtable
-------- We store the level of "Burning Arrow" to hashtable --------
Hashtable - Save BA_Flame_Lvl as 3 of (Key (Last created unit)) in BA_Hashtable
-------- We store the angle, to make arrow move in only one way --------
Hashtable - Save BA_Arrow_Angle as 4 of (Key (Last created unit)) in BA_Hashtable
-------- Here we set the counter of flamestrikes --------
-------- (More about this "counter" in README too) --------
Hashtable - Save 0 as 5 of (Key (Last created unit)) in BA_Hashtable
-------- ---------------- --------
-------- We add the arrow to the group --------
-------- (In loop trigger it will make arrow move) --------
-------- ---------------- --------
Unit Group - Add (Last created unit) to BA_Arrows
-------- ---------------- --------
-------- Here we "check" if the loop trigger is already running, because if is, there is no need to turn it on again --------
-------- ---------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in BA_Arrows) Equal to 1
Then - Actions
Trigger - Turn on BA Loop <gen>
Else - Actions
-------- ---------------- --------
-------- End of this trigger, now look at the loop trigger --------
-------- ---------------- --------
[/trigger]
[trigger]
BA Loop
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
-------- ---------------- --------
-------- We pick all the arrows to move them --------
-------- ---------------- --------
Unit Group - Pick every unit in BA_Arrows and do (Actions)
Loop - Actions
-------- ---------------- --------
-------- Here we check if our counter is greater than max distance --------
-------- ---------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Load 1 of (Key (Picked unit)) from BA_Hashtable) Less than or equal to (Load 2 of (Key (Picked unit)) from BA_Hashtable)
Then - Actions
-------- ---------------- --------
-------- We incarase our counter, to make the spell finish somewhen --------
-------- ---------------- --------
Hashtable - Save ((Load 1 of (Key (Picked unit)) from BA_Hashtable) + 1) as 1 of (Key (Picked unit)) in BA_Hashtable
-------- ---------------- --------
-------- We load the damage, which will be dealed to units within AoE of arrow to make life easier --------
-------- ---------------- --------
Set BA_Dealdmg = (Load 0 of (Key (Picked unit)) from BA_Hashtable)
-------- We set currently picked arrow to a variable to make life easier --------
Set BA_Arrow = (Picked unit)
-------- We set the position of the arrow, to don`t leak in polar projection --------
Set BA_Arrowpt = (Position of BA_Arrow)
-------- We set the point, the arrow will be moved in --------
Set BA_Movept = (BA_Arrowpt offset by 25.00 towards (Load 4 of (Key (Picked unit)) from BA_Hashtable) degrees)
-------- We move the arrow --------
Unit - Move BA_Arrow instantly to BA_Movept
-------- ---------------- --------
-------- Now we will damage the units "touched" by our arrow --------
-------- ---------------- --------
-------- We set the units which are very close to arrow to a variable to don`t leak --------
Set BA_Victims = (Units within 50.00 of BA_Movept matching ((((Matching unit) belongs to an enemy of (Owner of BA_Arrow)) Equal to True) and (((Matching unit) is alive) Equal to True)))
Unit Group - Pick every unit in BA_Victims and do (Actions)
Loop - Actions
-------- ---------------- --------
-------- We damage these units --------
-------- ---------------- --------
Unit - Cause BA_Arrow to damage (Picked unit), dealing BA_Dealdmg damage of attack type Spells and damage type Normal
-------- We add nice SFX --------
Special Effect - Create a special effect attached to the chest of (Picked unit) using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
-------- We remove special effect, to don`t leak --------
Special Effect - Destroy (Last created special effect)
-------- We remove leaking group --------
Custom script: call DestroyGroup (udg_BA_Victims)
-------- ---------------- --------
-------- Now flamestrikes --------
-------- ---------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Load 5 of (Key (Picked unit)) from BA_Hashtable) Equal to 5
Then - Actions
-------- If our counter value is as big as we wanted, we set it to 0 to make it start again --------
Hashtable - Save 0 as 5 of (Key (Picked unit)) in BA_Hashtable
-------- We create dummy unit, which will cast the flamestrike --------
Unit - Create 1 Dummy ( Unit ) for (Owner of BA_Arrow) at BA_Arrowpt facing Default building facing degrees
-------- We make it die --------
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
-------- We add a flamestrike to dummy --------
Unit - Add Flame ( DUMMY ) to (Last created unit)
-------- We set the level of flamestrike to tlevel of burning arrow for caster --------
Unit - Set level of Flame ( DUMMY ) for (Last created unit) to (Load 3 of (Key (Picked unit)) from BA_Hashtable)
-------- We order dummy to cast flamestrike --------
Unit - Order (Last created unit) to Human Blood Mage - Flame Strike BA_Movept
Else - Actions
-------- If the counter value is not big enaugh, we incarase it --------
Hashtable - Save ((Load 5 of (Key (Picked unit)) from BA_Hashtable) + 1) as 5 of (Key (Picked unit)) in BA_Hashtable
-------- ---------------- --------
-------- We clean location, because we won`t need them again --------
-------- ---------------- --------
Custom script: call RemoveLocation (udg_BA_Arrowpt)
Custom script: call RemoveLocation (udg_BA_Movept)
Else - Actions
-------- ---------------- --------
-------- If the arrow has reached the max distance, we clear the hashtable, to remove the data, we won`t need agtain --------
-------- ---------------- --------
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in BA_Hashtable
-------- We remove the arrow from moving group --------
Unit Group - Remove (Picked unit) from BA_Arrows
-------- We kill it :( --------
Unit - Kill (Picked unit)
-------- And we decrase the number, which will turn off the trigger, if there are no arrows flying --------
Set BA_To_Finish = (BA_To_Finish - 1)
-------- ---------------- --------
-------- And this is what we do now --------
-------- If there are no arrows on the map now, we turn loop trigger off, to stop using memory, when it`s not needed --------
-------- ---------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
BA_To_Finish Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
[/trigger]


Here you are.
 
Level 14
Joined
Aug 31, 2009
Messages
774
Huh, what do you mean?
(yea, I know, that I`m not good in writing descriptions ;p)
What I mean is,
"The hero shoots a burning arrow, which will fly a big distance in the directed location. It will deal damage in line to all units, which it will touch. Additionally the arrow is burning in very big temperature, so it will burn the ground every 125. The fire explosion will deal small instant damage and will burn closest units over time."

Is really bad English (eg. "is burning in very big temperature"), but I could suggest a re-write, such as:

"The hero shoots a burning arrow that flies a great distance towards the targeted point, dealing damage to all units in a line that it hits. Additionally, the arrow's intense heat ignites the ground below it as it travels, creating secondary explosions for extra damage and burning units over time."

The spell itself though is really good, and I learned a bit about Hashtables from your documentation.
 
Level 14
Joined
Aug 31, 2009
Messages
774
Yeah, I tend to avoid all the mumbo jumbo stuff that simple adds flavour to a spell description.
I mean, some of the spells of my heroes I've created in the past simply say "Deals X damage to a single target" without saying, for example, "Fires a piercing arrow at a target that deals X damage".

Sometimes it's nice to be concise, but you have to avoid giving the player information that he quite simply will not understand/need. Eg. Knowing that a fire is created every 125 distance is meaningless as many players won't actually know what 125 distance actually is.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
A simple spell, yet it can be useful :)
Good description and readme, easy to implement, well... the effects may lack a bit, but I wouldn't know ho to improve them as well.

This is the spell I made to check, if I still remember how to trigger. I haven`t been using WE for a long time, so there may be some little things, but I hope there aren`t any.
Yup, you still remember it all right :D
 
Level 18
Joined
Feb 28, 2009
Messages
1,970
ap0calypse said:
Yup, you still remember it all right :D
^^ Thank you ;]
ap0calypse said:
the effects may lack a bit, but I wouldn't know ho to improve them as well.
Yeah, I think the dealay between explosion could be a little bit shorter, but I don`t have any influence on it. It`s the sfx data.
Thx for comment :D
(Damn, my day rep limit must reset)
 
Level 4
Joined
Mar 21, 2014
Messages
79
i have some trouble with the arrow point creation in this spell... the arrow is created a little bit left or right of the hero, and not where it should. i checked the triggers and tried to correct it with offsets towards angles (+/- 90°) but it didnt help really.

Also, i compared the trigger code with Elune's Arrow, which works absolutely perfect (with the same hero, and the same trigger codes / actions). So in the current version both spells have exactly the same actions (no difference in the code, see below). But only Elune's Arrow is created at the right position, and Burning arrow not.

I don't know how to correct it... can you (or anyone else) help me with this? In my map Tyrande has both spells.

I copied the two triggers here:



  • BA Init
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Burning Arrow (Tyrande, Q)
    • Actions
      • -------- ---------------- --------
      • -------- We incarase the number of run triggers, to keep running loop trigger --------
      • -------- ---------------- --------
      • Set BA_To_Finish = (BA_To_Finish + 1)
      • -------- We set the level of ability, for further setting levels of flamestrikes for dummies --------
      • Set BA_Flame_Lvl = (Level of (Ability being cast) for (Triggering unit))
      • -------- Now we set the distance --------
      • -------- (how far the arrow will fly) --------
      • Set BA_Distance = (700 + (40 x BA_Flame_Lvl))
      • -------- We set what will be the instant damage of arrow --------
      • Set BA_Damage = (70.00 + (10.00 x (Real(BA_Flame_Lvl))))
      • -------- We set a position of caster, to don`t leak in setting with polar offset --------
      • Set BA_Startpt = (Position of (Casting unit))
      • -------- We set a target point of ability, to count the angle, where the arrow will be created --------
      • Set BA_Targetpt = (Target point of ability being cast)
      • -------- We set the angle, In which way the arrow will fly --------
      • Set BA_Arrow_Angle = (Angle from BA_Startpt to BA_Targetpt)
      • -------- We set the point, where the arrow will be created --------
      • Set BA_Creatept = (BA_Startpt offset by 39.00 towards (BA_Arrow_Angle + 90.00) degrees)
      • Set BA_Creatept = (BA_Startpt offset by 15.00 towards BA_Arrow_Angle degrees)
      • -------- ---------------- --------
      • -------- Here I tried to put it to the left or right first, and then a bit towards arrow_angle --------
      • -------- We create the arrow --------
      • -------- ---------------- --------
      • Unit - Create 1 Dummy ( Arrow, Burning Arrow) for (Owner of (Casting unit)) at BA_Startpt facing (Angle from BA_Startpt to BA_Targetpt) degrees
      • -------- Here I tried it with BA_Startpt (like in Elune's Arrow) and also with BA_Creatept (with different corrections) --------
      • -------- We turn collision off for the arrow, to don`t let it block on units --------
      • Unit - Turn collision for (Last created unit) Off
      • -------- ---------------- --------
      • -------- We clean the leaks, cause we won`t need these locations no longer --------
      • -------- ---------------- --------
      • Custom script: call RemoveLocation (udg_BA_Startpt)
      • Custom script: call RemoveLocation (udg_BA_Targetpt)
      • Custom script: call RemoveLocation (udg_BA_Creatept)
      • -------- ---------------- --------
      • -------- Now we store the data to hashtables --------
      • -------- ---------------- --------
      • -------- Here we store the damage to hashtable --------
      • Hashtable - Save BA_Damage as 0 of (Key (Last created unit)) in BA_Hashtable
      • -------- This data is our "counter" --------
      • -------- (More about a "counter" in README) --------
      • Hashtable - Save 0 as 1 of (Key (Last created unit)) in BA_Hashtable
      • -------- We store a distance to the hashtable --------
      • Hashtable - Save (BA_Distance / 25) as 2 of (Key (Last created unit)) in BA_Hashtable
      • -------- We store the level of "Burning Arrow" to hashtable --------
      • Hashtable - Save BA_Flame_Lvl as 3 of (Key (Last created unit)) in BA_Hashtable
      • -------- We store the angle, to make arrow move in only one way --------
      • Hashtable - Save BA_Arrow_Angle as 4 of (Key (Last created unit)) in BA_Hashtable
      • -------- Here we set the counter of flamestrikes --------
      • -------- (distance between them) --------
      • -------- (More about this "counter" in README too) --------
      • Hashtable - Save 0 as 5 of (Key (Last created unit)) in BA_Hashtable
      • -------- ---------------- --------
      • -------- We add the arrow to the group --------
      • -------- (In loop trigger it will make arrow move) --------
      • -------- ---------------- --------
      • Unit Group - Add (Last created unit) to BA_Arrows
      • -------- ---------------- --------
      • -------- Here we "check" if the loop trigger is already running, because if is, there is no need to turn it on again --------
      • -------- ---------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in BA_Arrows) Equal to 1
        • Then - Actions
          • Trigger - Turn on BA Loop <gen>
        • Else - Actions
      • -------- ---------------- --------
      • -------- End of this trigger, now look at the loop trigger --------
      • -------- ---------------- --------


I experienced the problem already with the original code lines, that's why I tried to do something with it.



  • BA Init
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Burning Arrow
    • Actions
      • -------- ---------------- --------
      • -------- We incarase the number of run triggers, to keep running loop trigger --------
      • -------- ---------------- --------
      • Set BA_To_Finish = (BA_To_Finish + 1)
      • -------- We set a position of caster, to don`t leak in setting with polar offset --------
      • Set BA_Startpt = (Position of (Triggering unit))
      • -------- We set a target point of ability, to count the angle, where the arrow will be created --------
      • Set BA_Targetpt = (Target point of ability being cast)
      • -------- We set the level of ability, for further setting levels of flamestrikes for dummies --------
      • Set BA_Flame_Lvl = (Level of Burning Arrow for (Triggering unit))
      • -------- Now we set the distance --------
      • -------- (how far the arrow will fly) --------
      • Set BA_Distance = (500 + (250 x BA_Flame_Lvl))
      • -------- We set what will be the instant damage of arrow --------
      • Set BA_Damage = (50.00 + (25.00 x (Real(BA_Flame_Lvl))))
      • -------- We set the angle, In which way the arrow will fly --------
      • Set BA_Arrow_Angle = (Angle from BA_Startpt to BA_Targetpt)
      • -------- We set the point, where the arrow will be created --------
      • Set BA_Creatept = (BA_Startpt offset by 75.00 towards BA_Arrow_Angle degrees)
      • -------- ---------------- --------
      • -------- We create the arrow --------
      • -------- ---------------- --------
      • Unit - Create 1 Dummy ( Arrow ) for (Owner of (Triggering unit)) at BA_Creatept facing BA_Arrow_Angle degrees
      • -------- We turn collision off for the arrow, to don`t let it block on units --------
      • Unit - Turn collision for (Last created unit) Off
      • -------- ---------------- --------
      • -------- We clean the leaks, cause we won`t need these locations no longer --------
      • -------- ---------------- --------
      • Custom script: call RemoveLocation (udg_BA_Startpt)
      • Custom script: call RemoveLocation (udg_BA_Targetpt)
      • Custom script: call RemoveLocation (udg_BA_Creatept)
      • -------- ---------------- --------
      • -------- Now we store the data to hashtables --------
      • -------- ---------------- --------
      • -------- Here we store the damage to hashtable --------
      • Hashtable - Save BA_Damage as 0 of (Key (Last created unit)) in BA_Hashtable
      • -------- This data is our "counter" --------
      • -------- (More about a "counter" in README) --------
      • Hashtable - Save 0 as 1 of (Key (Last created unit)) in BA_Hashtable
      • -------- We store a distance to the hashtable --------
      • Hashtable - Save (BA_Distance / 25) as 2 of (Key (Last created unit)) in BA_Hashtable
      • -------- We store the level of "Burning Arrow" to hashtable --------
      • Hashtable - Save BA_Flame_Lvl as 3 of (Key (Last created unit)) in BA_Hashtable
      • -------- We store the angle, to make arrow move in only one way --------
      • Hashtable - Save BA_Arrow_Angle as 4 of (Key (Last created unit)) in BA_Hashtable
      • -------- Here we set the counter of flamestrikes --------
      • -------- (distance between them) --------
      • -------- (More about this "counter" in README too) --------
      • Hashtable - Save 0 as 5 of (Key (Last created unit)) in BA_Hashtable
      • -------- ---------------- --------
      • -------- We add the arrow to the group --------
      • -------- (In loop trigger it will make arrow move) --------
      • -------- ---------------- --------
      • Unit Group - Add (Last created unit) to BA_Arrows
      • -------- ---------------- --------
      • -------- Here we "check" if the loop trigger is already running, because if is, there is no need to turn it on again --------
      • -------- ---------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in BA_Arrows) Equal to 1
        • Then - Actions
          • Trigger - Turn on BA Loop <gen>
        • Else - Actions
      • -------- ---------------- --------
      • -------- End of this trigger, now look at the loop trigger --------
      • -------- ---------------- --------



  • BA Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • -------- ---------------- --------
      • -------- We pick all the arrows to move them --------
      • -------- ---------------- --------
      • Unit Group - Pick every unit in BA_Arrows and do (Actions)
        • Loop - Actions
          • -------- ---------------- --------
          • -------- Here we check if our counter is greater than max distance --------
          • -------- ---------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 1 of (Key (Picked unit)) from BA_Hashtable) Less than or equal to (Load 2 of (Key (Picked unit)) from BA_Hashtable)
            • Then - Actions
              • -------- ---------------- --------
              • -------- We incarase our counter, to make the spell finish somewhen --------
              • -------- ---------------- --------
              • Hashtable - Save ((Load 1 of (Key (Picked unit)) from BA_Hashtable) + 1) as 1 of (Key (Picked unit)) in BA_Hashtable
              • -------- ---------------- --------
              • -------- We load the damage, which will be dealed to units within AoE of arrow to make life easier --------
              • -------- ---------------- --------
              • Set BA_Dealdmg = (Load 0 of (Key (Picked unit)) from BA_Hashtable)
              • -------- We set currently picked arrow to a variable to make life easier --------
              • Set BA_Arrow = (Picked unit)
              • -------- We set the position of the arrow, to don`t leak in polar projection --------
              • Set BA_Arrowpt = (Position of BA_Arrow)
              • -------- We set the point, the arrow will be moved in --------
              • Set BA_Movept = (BA_Arrowpt offset by 25.00 towards (Load 4 of (Key (Picked unit)) from BA_Hashtable) degrees)
              • -------- We move the arrow --------
              • Unit - Move BA_Arrow instantly to BA_Movept
              • -------- ---------------- --------
              • -------- Now we will damage the units "touched" by our arrow --------
              • -------- ---------------- --------
              • -------- We set the units which are very close to arrow to a variable to don`t leak --------
              • Set BA_Victims = (Units within 90.00 of BA_Movept matching ((((Matching unit) belongs to an enemy of (Owner of BA_Arrow)) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is A structure) Equal to False))))
              • Unit Group - Pick every unit in BA_Victims and do (Actions)
                • Loop - Actions
                  • -------- ---------------- --------
                  • -------- We damage these units --------
                  • -------- ---------------- --------
                  • Unit - Cause BA_Arrow to damage (Picked unit), dealing BA_Dealdmg damage of attack type Spells and damage type Unknown
                  • -------- We add nice SFX --------
                  • Special Effect - Create a special effect attached to the chest of (Picked unit) using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
                  • -------- We remove special effect, to don`t leak --------
                  • Special Effect - Destroy (Last created special effect)
              • -------- We remove leaking group --------
              • Custom script: call DestroyGroup (udg_BA_Victims)
              • -------- ---------------- --------
              • -------- Now flamestrikes --------
              • -------- ---------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load 5 of (Key (Picked unit)) from BA_Hashtable) Equal to 5
                • Then - Actions
                  • -------- If our counter value is as big as we wanted, we set it to 0 to make it start again --------
                  • Hashtable - Save 0 as 5 of (Key (Picked unit)) in BA_Hashtable
                  • -------- We create dummy unit, which will cast the flamestrike --------
                  • Unit - Create 1 Dummy ( Unit, Burning Arrow) for (Owner of BA_Arrow) at BA_Arrowpt facing Default building facing degrees
                  • -------- We make it die --------
                  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                  • -------- We add a flamestrike to dummy --------
                  • -------- ( If you have already dummy unit on your map, you can simply just change summy unit I used to yours, and it will work ) --------
                  • Unit - Add Flame ( DUMMY, Burning Arrow ) to (Last created unit)
                  • -------- We set the level of flamestrike to tlevel of burning arrow for caster --------
                  • Unit - Set level of Flame ( DUMMY, Burning Arrow ) for (Last created unit) to (Load 3 of (Key (Picked unit)) from BA_Hashtable)
                  • -------- We order dummy to cast flamestrike --------
                  • Unit - Order (Last created unit) to Human Blood Mage - Flame Strike BA_Movept
                • Else - Actions
                  • -------- If the counter value is not big enaugh, we incarase it --------
                  • Hashtable - Save ((Load 5 of (Key (Picked unit)) from BA_Hashtable) + 1) as 5 of (Key (Picked unit)) in BA_Hashtable
              • -------- ---------------- --------
              • -------- We clean location, because we won`t need them again --------
              • -------- ---------------- --------
              • Custom script: call RemoveLocation (udg_BA_Arrowpt)
              • Custom script: call RemoveLocation (udg_BA_Movept)
            • Else - Actions
              • -------- ---------------- --------
              • -------- If the arrow has reached the max distance, we clear the hashtable, to remove the data, we won`t need agtain --------
              • -------- ---------------- --------
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in BA_Hashtable
              • -------- We remove the arrow from moving group --------
              • Unit Group - Remove (Picked unit) from BA_Arrows
              • -------- We kill it :( --------
              • Unit - Kill (Picked unit)
              • -------- And we decrase the number, which will turn off the trigger, if there are no arrows flying --------
              • Set BA_To_Finish = (BA_To_Finish - 1)
      • -------- ---------------- --------
      • -------- And this is what we do now --------
      • -------- If there are no arrows on the map now, we turn loop trigger off, to stop using memory, when it`s not needed --------
      • -------- ---------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BA_To_Finish Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions







  • Elune Arrow
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Elune's Arrow (Tyrande, W)
    • Actions
      • Set Arrow_Counts = (Arrow_Counts + 1)
      • Set Arrow_CountMaxSize = 8191
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Arrow_Counts Greater than Arrow_CountMaxSize
        • Then - Actions
          • Set Arrow_Counts = 1
        • Else - Actions
      • Set Arrow_Caster[Arrow_Counts] = (Casting unit)
      • -------- ---------------- --------
      • Set Arrow_CasterLoc = (Position of Arrow_Caster[Arrow_Counts])
      • Set Arrow_TargetPoint = (Target point of ability being cast)
      • Set Arrow_Angle = (Angle from Arrow_CasterLoc to Arrow_TargetPoint)
      • -------- ---------------- --------
      • -------- This would correspond to create the arrow at BA_Startpt: --------
      • Unit - Create 1 Elunes Arrow (Arrow) for (Owner of Arrow_Caster[Arrow_Counts]) at Arrow_CasterLoc facing Arrow_Angle degrees
      • -------- ---------------- --------
      • Unit - Set the custom value of (Last created unit) to Arrow_Counts
      • Unit Group - Add (Last created unit) to Arrow_StartGroup
      • Set Arrow_Distance[Arrow_Counts] = 2300.00
      • Set Arrow_DistanceTravel[Arrow_Counts] = 0.00
      • Set Arrow_StunDuration[Arrow_Counts] = 1
      • Set Arrow_DistanceCount[Arrow_Counts] = 0.00
      • Trigger - Turn on Elune Arrow Move <gen>
      • Custom script: call RemoveLocation (udg_Arrow_CasterLoc)
      • Custom script: call RemoveLocation (udg_Arrow_TargetPoint)


  • Elune Arrow Move
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Arrow_StartGroup and do (Actions)
        • Loop - Actions
          • Set Arrow_CusValue = (Custom value of (Picked unit))
          • Set Arrow_DummyLoc = (Position of (Picked unit))
          • Set Arrow_Movement = (Arrow_DummyLoc offset by 20.00 towards (Facing of (Picked unit)) degrees)
          • Unit - Move (Picked unit) instantly to Arrow_Movement
          • Set Arrow_DistanceTravel[Arrow_CusValue] = (Arrow_DistanceTravel[Arrow_CusValue] + 18.00)
          • Set Arrow_DistanceCount[Arrow_CusValue] = (Arrow_DistanceCount[Arrow_CusValue] + 18.00)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Arrow_DistanceCount[Arrow_CusValue] Greater than or equal to 225.00
            • Then - Actions
              • Set Arrow_StunDuration[Arrow_CusValue] = (Arrow_StunDuration[Arrow_CusValue] + 1)
              • Set Arrow_DistanceCount[Arrow_CusValue] = 0.00
            • Else - Actions
          • Set Arrow_UnitGroup = (Units within 65.00 of Arrow_Movement matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of Arrow_Caster[Arrow_CusValue])) Equal to True))))
          • Set Arrow_RandomUnit = (Random 1 units from Arrow_UnitGroup)
          • Unit Group - Pick every unit in Arrow_RandomUnit and do (Actions)
            • Loop - Actions
              • Unit - Cause Arrow_Caster[Arrow_CusValue] to damage (Picked unit), dealing (200.00 + (30.00 x (Real((Level of Elune's Arrow (Tyrande, W) for Arrow_Caster[Arrow_CusValue]))))) damage of attack type Spells and damage type Unknown
              • Unit - Create 1 Dummy (Elunes Arrow, Wisp) for (Owner of Arrow_Caster[Arrow_CusValue]) at Arrow_Movement facing Default building facing degrees
              • Unit - Add Elunes Arrow (Stun) to (Last created unit)
              • Unit - Set level of Elunes Arrow (Stun) for (Last created unit) to Arrow_StunDuration[Arrow_CusValue]
              • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
              • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • Arrow_DistanceTravel[Arrow_CusValue] Greater than or equal to Arrow_Distance[Arrow_CusValue]
                  • (Number of units in Arrow_UnitGroup) Greater than 0
            • Then - Actions
              • Unit - Kill (Picked unit)
              • Unit Group - Remove (Picked unit) from Arrow_StartGroup
            • Else - Actions
          • Custom script: call RemoveLocation (udg_Arrow_DummyLoc)
          • Custom script: call RemoveLocation (udg_Arrow_Movement)
          • Custom script: call DestroyGroup (udg_Arrow_UnitGroup)
          • Custom script: call DestroyGroup (udg_Arrow_RandomUnit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Arrow_StartGroup) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions

 
Last edited:
Level 4
Joined
Mar 21, 2014
Messages
79
I figured it out!

Your script is fine, but the units in the object editor need to be changed.

Change the "Movement - Type" to "Fly" and not "Foot" (for both Units)
Also, change the "Movement - Height Minimum " for the arrow to 50.
 
Top