[GUI] Split Shot v1.01

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Its been a while since my last uploaded spell so I decided to make a new one and upload it here again.

This one was made for q request, but I decided it to upload it for everyone.

Split Shot - the Ranger splits up to 3/6/9 arrows in a direction and lauches them. When an arrow comes within an enemy, it will explode, dealing up to 100/200/300 damage.

Things that can be configurated are:
  • Damage
  • Number of Arrows
  • Life Time
  • Range
  • Speed
  • Point of Moving
  • Angle
  • Targets
  • Pathability
  • Arrow Model


  • Hashtable
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- ----------------------------------------------------------------------------------- --------
      • -------- Creating the hashtables used for the spell --------
      • -------- Note: without this trigger the spell will never work. --------
      • -------- ----------------------------------------------------------------------------------- --------
      • Hashtable - Create a hashtable
      • Set SpellHashtable = (Last created hashtable)
  • SplitShot Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Split Shot
    • Actions
      • -------- ----------------------------------------------------------------------------------- --------
      • -------- Starting the loop for the spell. The level of the ability determines the number of arrows --------
      • -------- ----------------------------------------------------------------------------------- --------
      • For each (Integer Loop_Int) from 1 to ((Level of Split Shot for (Triggering unit)) x 3), do (Actions)
        • Loop - Actions
          • Set CastPos = (Position of (Triggering unit))
          • -------- ----------------------------------------------------------------------------------- --------
          • -------- All the configurations needed before 1 arrow is created --------
          • -------- ----------------------------------------------------------------------------------- --------
          • Set ArrowDamage = 100.00
          • Set ArrowRange = 600.00
          • Set ArrowSpeed = (ArrowRange x 0.03)
          • Set ArrowLifeTime = 1.50
          • Set AbilityLevel = (Level of (Ability being cast) for (Triggering unit))
          • Set ArrowAngle = ((Facing of (Triggering unit)) + (Random real number between 1.00 and 30.00))
          • Set ArrowFullDamage = (ArrowDamage x (Real(AbilityLevel)))
          • -------- ----------------------------------------------------------------------------------- --------
          • -------- Creating an arrow --------
          • -------- ----------------------------------------------------------------------------------- --------
          • Unit - Create 1 Arrow for (Owner of (Triggering unit)) at CastPos facing (Target point of ability being cast)
          • Set ArrowLoop = (Last created unit)
          • -------- ----------------------------------------------------------------------------------- --------
          • -------- All the settings are saved for the UNIT into our hashtable --------
          • -------- ----------------------------------------------------------------------------------- --------
          • Hashtable - Save ArrowAngle as (Key angle) of (Key (Last created unit)) in SpellHashtable
          • Hashtable - Save ArrowFullDamage as (Key damage) of (Key (Last created unit)) in SpellHashtable
          • Hashtable - Save ArrowRange as (Key range) of (Key (Last created unit)) in SpellHashtable
          • Hashtable - Save ArrowSpeed as (Key speed) of (Key (Last created unit)) in SpellHashtable
          • Hashtable - Save ArrowLifeTime as (Key time) of (Key (Last created unit)) in SpellHashtable
          • -------- ----------------------------------------------------------------------------------- --------
          • -------- Finally we are read to run the loop trigger. --------
          • -------- ----------------------------------------------------------------------------------- --------
          • Unit Group - Add ArrowLoop to ArrowGroup
          • Custom script: call RemoveLocation (udg_CastPos)
      • Trigger - Turn on SplitShot Loop <gen>
  • SplitShot 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
          • (Number of units in ArrowGroup) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
      • Unit Group - Pick every unit in ArrowGroup and do (Actions)
        • Loop - Actions
          • Set ArrowAngle = (Load (Key angle) of (Key (Picked unit)) from SpellHashtable)
          • Set ArrowRange = (Load (Key range) of (Key (Picked unit)) from SpellHashtable)
          • Set ArrowSpeed = (Load (Key speed) of (Key (Picked unit)) from SpellHashtable)
          • Set ArrowFullDamage = (Load (Key damage) of (Key (Picked unit)) from SpellHashtable)
          • Set ArrowLifeTime = (Load (Key time) of (Key (Picked unit)) from SpellHashtable)
          • Set ArrowLoop = (Picked unit)
          • Set ArrowPos = (Position of ArrowLoop)
          • Set ArrowMovePos = (ArrowPos offset by ArrowSpeed towards ArrowAngle degrees)
          • Set Targets = (Random 1 units from (Units within 50.00 of ArrowMovePos))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ArrowLifeTime Greater than 0.00
            • Then - Actions
              • Hashtable - Save (ArrowLifeTime - 0.03) as (Key time) of (Key (Picked unit)) in SpellHashtable
              • Unit - Move ArrowLoop instantly to ArrowMovePos, facing ArrowAngle degrees
              • Unit Group - Pick every unit in Targets and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is A structure) Equal to False
                      • ((Picked unit) belongs to an ally of (Owner of ArrowLoop)) Equal to False
                      • ((Picked unit) is alive) Equal to True
                    • Then - Actions
                      • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\SearingArrow\SearingArrowMissile.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Unit - Cause ArrowLoop to damage (Picked unit), dealing ArrowFullDamage damage of attack type Pierce and damage type Normal
                      • Unit - Remove ArrowLoop from the game
                    • Else - Actions
            • Else - Actions
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in SpellHashtable
              • Unit - Remove ArrowLoop from the game
              • Special Effect - Create a special effect at ArrowMovePos using Abilities\Weapons\SearingArrow\SearingArrowMissile.mdl
              • Special Effect - Destroy (Last created special effect)
          • Custom script: call DestroyGroup (udg_Targets)
          • Custom script: call RemoveLocation (udg_ArrowMovePos)
          • Custom script: call RemoveLocation (udg_ArrowPos)



Version: 1.00
- first release
Version: 1.01
- fixed a leak in the loop trigger
- arrows spawn with different facing


PS: I haven't filtered out mechanical nor immune units, but that can be changed at any time.

Feel free to edit and use as long as you give credits

MortAr-

Keywords:
Arrow, Split, Shot, Arrows, Damage, Ranger
Contents

SplitShot v1.00 (Map)

Reviews
12th Dec 2015 IcemanBo: Too long time as NeedsFix. Rejected. 20:09, 5th Apr 2010 The_Reborn_Devil: You still got a leak in there MortAr- :D Set Targets = (Random 1 units from (Units within 50.00 of ArrowMovePos)) ^^ Leaks Other than...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long time as NeedsFix. Rejected.

20:09, 5th Apr 2010
The_Reborn_Devil:
You still got a leak in there MortAr- :D

  • Set Targets = (Random 1 units from (Units within 50.00 of ArrowMovePos))
^^ Leaks

Other than that it looks ok.


Status: Rejected until updated
Rating: N/A

PM me or another mod once you've updated the spell to get it reviewed again. Have a nice day!
 
Level 10
Joined
Mar 30, 2009
Messages
255
i think its not needed to remove ArrowGroup since it would make the spell not MUI (i think)

if the group is removed the spell will not work anymore. its one global group so it wont leak.

the triggering looks very nice and its performs awesome ingame
i have to rate it a 5/5 good job

i might use it someday... i will give credits ofc.
 
Level 18
Joined
Feb 28, 2009
Messages
1,971
I don`t understand why you set all the arrow data (damage, range, etc.) inside for each...
You should put them before it and then only save data in for each...
That`s just useless counting of same thing again and again...
 
Level 12
Joined
Jun 9, 2009
Messages
1,131
  • Unit - A unit Starts the effect of an ability
    • Conditions
    • (Ability being cast) Equal to Split Shot
    • Actions
    • -------- ----------------------------------------------------------------------------------- --------
    • -------- Starting the loop for the spell. The level of the ability determines the number of arrows --------
    • -------- ----------------------------------------------------------------------------------- --------
    • For each (Integer Loop_Int) from 1 to ((Level of Split Shot for (Triggering unit)) x 3), do (Actions)
    • Loop - Actions
    • Set CastPos = (Position of (Triggering unit))
    • -------- ----------------------------------------------------------------------------------- --------
    • -------- All the configurations needed before 1 arrow is created --------
    • -------- ----------------------------------------------------------------------------------- --------
    • Set ArrowDamage = 100.00
    • Set ArrowRange = 600.00
    • Set ArrowSpeed = (ArrowRange x 0.03)
    • Set ArrowLifeTime = 1.50
    • Set AbilityLevel = (Level of (Ability being cast) for (Triggering unit))
    • Set ArrowAngle = ((Facing of (Triggering unit)) + (Random real number between 1.00 and 30.00))
    • Set ArrowFullDamage = (ArrowDamage x (Real(AbilityLevel)))
    • -------- ----------------------------------------------------------------------------------- --------
    • -------- Creating an arrow --------
    • -------- ----------------------------------------------------------------------------------- --------
    • Unit - Create 1 Arrow for (Owner of (Triggering unit)) at (CastPos offset by 50.00 towards ArrowAngle degrees) facing ArrowAngle degrees
    • Set ArrowLoop = (Last created unit)
    • -------- ----------------------------------------------------------------------------------- --------
    • -------- All the settings are saved for the UNIT into our hashtable --------
    • -------- ----------------------------------------------------------------------------------- --------
    • Hashtable - Save ArrowAngle as (Key angle) of (Key (Last created unit)) in SpellHashtable
    • Hashtable - Save ArrowFullDamage as (Key damage) of (Key (Last created unit)) in SpellHashtable
    • Hashtable - Save ArrowRange as (Key range) of (Key (Last created unit)) in SpellHashtable
    • Hashtable - Save ArrowSpeed as (Key speed) of (Key (Last created unit)) in SpellHashtable
    • Hashtable - Save ArrowLifeTime as (Key time) of (Key (Last created unit)) in SpellHashtable
    • -------- ----------------------------------------------------------------------------------- --------
    • -------- Finally we are read to run the loop trigger. --------
    • -------- ----------------------------------------------------------------------------------- --------
    • Unit Group - Add ArrowLoop to ArrowGroup
    • Custom script: call RemoveLocation (udg_CastPos)
    • Trigger - Turn on SplitShot Loop <gen>
  • SplitShot Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Split Shot
    • Actions
      • -------- ----------------------------------------------------------------------------------- --------
      • -------- Starting the loop for the spell. The level of the ability determines the number of arrows --------
      • -------- ----------------------------------------------------------------------------------- --------
      • For each (Integer Loop_Int) from 1 to ((Level of Split Shot for (Triggering unit)) x 3), do (Actions)
        • Loop - Actions
          • Set CastPos = (Position of (Triggering unit))
          • Set TargPos = (Target point of ability being cast)
          • -------- ----------------------------------------------------------------------------------- --------
          • -------- All the configurations needed before 1 arrow is created --------
          • -------- ----------------------------------------------------------------------------------- --------
          • Set ArrowDamage = 100.00
          • Set ArrowRange = 1200.00
          • Set ArrowSpeed = (ArrowRange x 0.03)
          • Set ArrowLifeTime = 1.50
          • Set AbilityLevel = (Level of (Ability being cast) for (Triggering unit))
          • Set Angle = (Angle from CastPos to TargPos)
          • Set ArrowAngle = (Angle + (Random real number between 0.00 and 15.00))
          • Set ArrowFullDamage = (ArrowDamage x (Real(AbilityLevel)))
          • -------- ----------------------------------------------------------------------------------- --------
          • -------- Creating an arrow --------
          • -------- ----------------------------------------------------------------------------------- --------
          • Unit - Create 1 Arrow for (Owner of (Triggering unit)) at (CastPos offset by 50.00 towards ArrowAngle degrees) facing Angle degrees
          • Set ArrowLoop = (Last created unit)
          • -------- ----------------------------------------------------------------------------------- --------
          • -------- All the settings are saved for the UNIT into our hashtable --------
          • -------- ----------------------------------------------------------------------------------- --------
          • Hashtable - Save ArrowAngle as (Key angle) of (Key (Last created unit)) in SpellHashtable
          • Hashtable - Save ArrowFullDamage as (Key damage) of (Key (Last created unit)) in SpellHashtable
          • Hashtable - Save ArrowRange as (Key range) of (Key (Last created unit)) in SpellHashtable
          • Hashtable - Save ArrowSpeed as (Key speed) of (Key (Last created unit)) in SpellHashtable
          • Hashtable - Save ArrowLifeTime as (Key time) of (Key (Last created unit)) in SpellHashtable
          • -------- ----------------------------------------------------------------------------------- --------
          • -------- Finally we are read to run the loop trigger. --------
          • -------- ----------------------------------------------------------------------------------- --------
          • Unit Group - Add ArrowLoop to ArrowGroup
          • Custom script: call RemoveLocation (udg_CastPos)
          • Custom script: call RemoveLocation (udg_TargPos)
      • Trigger - Turn on SplitShot Loop <gen>
But i'm not realy sure, try it.
 
Level 19
Joined
Feb 25, 2009
Messages
2,006
I don`t understand why you set all the arrow data (damage, range, etc.) inside for each...
You should put them before it and then only save data in for each...
That`s just useless counting of same thing again and again...

You are right for the group, its a global and if its destroyed it will malfunction the whole spell. Im happy you like it.

I don`t understand why you set all the arrow data (damage, range, etc.) inside for each...
You should put them before it and then only save data in for each...
That`s just useless counting of same thing again and again...

If you put the settngs outside the loop, all arrows will have the same angle.

  • Unit - A unit Starts the effect of an ability
    • Conditions
    • (Ability being cast) Equal to Split Shot
    • Actions
    • -------- ----------------------------------------------------------------------------------- --------
    • -------- Starting the loop for the spell. The level of the ability determines the number of arrows --------
    • -------- ----------------------------------------------------------------------------------- --------
    • For each (Integer Loop_Int) from 1 to ((Level of Split Shot for (Triggering unit)) x 3), do (Actions)
    • Loop - Actions
    • Set CastPos = (Position of (Triggering unit))
    • -------- ----------------------------------------------------------------------------------- --------
    • -------- All the configurations needed before 1 arrow is created --------
    • -------- ----------------------------------------------------------------------------------- --------
    • Set ArrowDamage = 100.00
    • Set ArrowRange = 600.00
    • Set ArrowSpeed = (ArrowRange x 0.03)
    • Set ArrowLifeTime = 1.50
    • Set AbilityLevel = (Level of (Ability being cast) for (Triggering unit))
    • Set ArrowAngle = ((Facing of (Triggering unit)) + (Random real number between 1.00 and 30.00))
    • Set ArrowFullDamage = (ArrowDamage x (Real(AbilityLevel)))
    • -------- ----------------------------------------------------------------------------------- --------
    • -------- Creating an arrow --------
    • -------- ----------------------------------------------------------------------------------- --------
    • Unit - Create 1 Arrow for (Owner of (Triggering unit)) at (CastPos offset by 50.00 towards ArrowAngle degrees) facing ArrowAngle degrees
    • Set ArrowLoop = (Last created unit)
    • -------- ----------------------------------------------------------------------------------- --------
    • -------- All the settings are saved for the UNIT into our hashtable --------
    • -------- ----------------------------------------------------------------------------------- --------
    • Hashtable - Save ArrowAngle as (Key angle) of (Key (Last created unit)) in SpellHashtable
    • Hashtable - Save ArrowFullDamage as (Key damage) of (Key (Last created unit)) in SpellHashtable
    • Hashtable - Save ArrowRange as (Key range) of (Key (Last created unit)) in SpellHashtable
    • Hashtable - Save ArrowSpeed as (Key speed) of (Key (Last created unit)) in SpellHashtable
    • Hashtable - Save ArrowLifeTime as (Key time) of (Key (Last created unit)) in SpellHashtable
    • -------- ----------------------------------------------------------------------------------- --------
    • -------- Finally we are read to run the loop trigger. --------
    • -------- ----------------------------------------------------------------------------------- --------
    • Unit Group - Add ArrowLoop to ArrowGroup
    • Custom script: call RemoveLocation (udg_CastPos)
    • Trigger - Turn on SplitShot Loop <gen>
  • SplitShot Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Split Shot
    • Actions
      • -------- ----------------------------------------------------------------------------------- --------
      • -------- Starting the loop for the spell. The level of the ability determines the number of arrows --------
      • -------- ----------------------------------------------------------------------------------- --------
      • For each (Integer Loop_Int) from 1 to ((Level of Split Shot for (Triggering unit)) x 3), do (Actions)
        • Loop - Actions
          • Set CastPos = (Position of (Triggering unit))
          • Set TargPos = (Target point of ability being cast)
          • -------- ----------------------------------------------------------------------------------- --------
          • -------- All the configurations needed before 1 arrow is created --------
          • -------- ----------------------------------------------------------------------------------- --------
          • Set ArrowDamage = 100.00
          • Set ArrowRange = 1200.00
          • Set ArrowSpeed = (ArrowRange x 0.03)
          • Set ArrowLifeTime = 1.50
          • Set AbilityLevel = (Level of (Ability being cast) for (Triggering unit))
          • Set Angle = (Angle from CastPos to TargPos)
          • Set ArrowAngle = (Angle + (Random real number between 0.00 and 15.00))
          • Set ArrowFullDamage = (ArrowDamage x (Real(AbilityLevel)))
          • -------- ----------------------------------------------------------------------------------- --------
          • -------- Creating an arrow --------
          • -------- ----------------------------------------------------------------------------------- --------
          • Unit - Create 1 Arrow for (Owner of (Triggering unit)) at (CastPos offset by 50.00 towards ArrowAngle degrees) facing Angle degrees
          • Set ArrowLoop = (Last created unit)
          • -------- ----------------------------------------------------------------------------------- --------
          • -------- All the settings are saved for the UNIT into our hashtable --------
          • -------- ----------------------------------------------------------------------------------- --------
          • Hashtable - Save ArrowAngle as (Key angle) of (Key (Last created unit)) in SpellHashtable
          • Hashtable - Save ArrowFullDamage as (Key damage) of (Key (Last created unit)) in SpellHashtable
          • Hashtable - Save ArrowRange as (Key range) of (Key (Last created unit)) in SpellHashtable
          • Hashtable - Save ArrowSpeed as (Key speed) of (Key (Last created unit)) in SpellHashtable
          • Hashtable - Save ArrowLifeTime as (Key time) of (Key (Last created unit)) in SpellHashtable
          • -------- ----------------------------------------------------------------------------------- --------
          • -------- Finally we are read to run the loop trigger. --------
          • -------- ----------------------------------------------------------------------------------- --------
          • Unit Group - Add ArrowLoop to ArrowGroup
          • Custom script: call RemoveLocation (udg_CastPos)
          • Custom script: call RemoveLocation (udg_TargPos)
      • Trigger - Turn on SplitShot Loop <gen>
But i'm not realy sure, try it.

No, you are really wrong here, sir.
 
Level 8
Joined
Apr 7, 2008
Messages
176
You know what would be nice that I haven't seen yet, this spell but it triggers when the unit attacks.

It would be like multi-shot but instead of the attacker being able to target 50 guys at once in all directions (something I always thought was stupid) the shooter would just launch mulitiple projectiles in the direction of attack. I suppose if I just took your trigger here and linked it to Critical Strike with a 100% chance and 0% multiplier it could do this?

=D
 
Level 3
Joined
Jun 7, 2010
Messages
34
*cough*
(Line: 1) (Word: 4) Unit Group Leak
(Random 1 units from (Units within 50.00 of ArrowMovePos))
(Random 1 units from ^Leak
(Suggested Fix) Set MyUnitGroup = (Units within 50.00 of ArrowMovePos))
(Suggested Fix) (Random 1 units from MyUnitGroup ArrowMovePos))
(Suggested Fix) Custom script: call DestroyGroup(udg_MyUnitGroup)

Scan Complete
Location leaks: 0
Special Effect leaks: 0
Lightning leaks: 0
Unit Group leaks: 1
Player Group leaks: 0

Summary
Total Leaks: 1
Unremoved Variables: 0
Scan duration: 0 seconds
Total Lines Scanned: 1
Total Words Scanned: 9
*cough*
Someone didnt use leakcheck
 
Level 2
Joined
Jun 3, 2013
Messages
13
Hi nice spell also I want to use it in my map but I have a question why does
Set Targets = (Random 1 units from (Units within 50.00 of ArrowMovePos)) it leaks?
Please tell me how to fix that:D
 
This is a good idea, but there is an issue with flying height. The arrows zoom up and over terrain like a flying unit. It's not realistic and can easily be fixed. This spell seems a bit hurried and not well thought out. I am surprised no one else has done it since it is a dota classic. It could be fine tuned to be really sweet, but right now it's just so so.
 
Top