1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. The poll for our 11th Music Contest is up! Help us choose the most awesome cinematic tracks by casting a vote!
    Dismiss Notice
  3. Melee Mapping contest #3 - Poll is up! Vote for the best 4v4 melee maps!
    Dismiss Notice
  4. The 30th edition of the Modeling Contest is finally up! The Portable Buildings need your attention, so come along and have a blast!
    Dismiss Notice
  5. The Aftermath has been revealed for the 19th Terraining Contest! Be sure to check out the Results and see what came out of it.
    Dismiss Notice

[GUI] Split Shot v1.01

Submitted by MortAr
This bundle is marked as substandard. It may contain bugs, not perform optimally or otherwise be in violation of the submission rules.
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

Triggers

  • 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)



Changelog

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
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...
  1. 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!
     
  2. MortAr

    MortAr

    Joined:
    Feb 25, 2009
    Messages:
    1,771
    Resources:
    7
    Icons:
    6
    Packs:
    1
    Resources:
    7
    Comment, rate, report bugs/errors via comments or via PM/VM.
    Thank you.
     
  3. Etzer

    Etzer

    Joined:
    Feb 18, 2009
    Messages:
    1,256
    Resources:
    0
    Resources:
    0
    Please add the Triggers to description.
     
  4. MortAr

    MortAr

    Joined:
    Feb 25, 2009
    Messages:
    1,771
    Resources:
    7
    Icons:
    6
    Packs:
    1
    Resources:
    7
    Yea, added the triggers, sorry I forgot them in the first place.
     
  5. Etzer

    Etzer

    Joined:
    Feb 18, 2009
    Messages:
    1,256
    Resources:
    0
    Resources:
    0
    Looks good, but you forgot to remove ArrowGroup. (Call Remove Group)
     
  6. VoidLordXtreme

    VoidLordXtreme

    Joined:
    Mar 30, 2009
    Messages:
    250
    Resources:
    0
    Resources:
    0
    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.
     
  7. krisserz

    krisserz

    Joined:
    Feb 28, 2009
    Messages:
    1,948
    Resources:
    2
    Spells:
    2
    Resources:
    2
    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...
     
  8. 88WaRCraFT3

    88WaRCraFT3

    Joined:
    Jun 9, 2009
    Messages:
    1,139
    Resources:
    1
    Spells:
    1
    Resources:
    1
    This trigger can be like
    • 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>

    This trigger
    • 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.
     
  9. MortAr

    MortAr

    Joined:
    Feb 25, 2009
    Messages:
    1,771
    Resources:
    7
    Icons:
    6
    Packs:
    1
    Resources:
    7
    You are right for the group, its a global and if its destroyed it will malfunction the whole spell. Im happy you like it.

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

    No, you are really wrong here, sir.
     
  10. krisserz

    krisserz

    Joined:
    Feb 28, 2009
    Messages:
    1,948
    Resources:
    2
    Spells:
    2
    Resources:
    2
    So keep the angle inside the loop but the rest is not needed here.
     
  11. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,193
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    Do the "turn off" check only after removing a unit from the group.

    Only load the timer, then check whether it is > 0 or not. Then load the other values, set the unit group and the new position if it is greater.
     
  12. Kala

    Kala

    Joined:
    Jun 20, 2009
    Messages:
    817
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Cool spell =)
     
  13. Guishiu

    Guishiu

    Joined:
    Apr 7, 2008
    Messages:
    160
    Resources:
    3
    Spells:
    3
    Resources:
    3
    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
     
  14. Doom_AngeaL

    Doom_AngeaL

    Joined:
    Apr 17, 2010
    Messages:
    112
    Resources:
    0
    Resources:
    0
    Looks nice altogether. I'll use this in my map I'm working on, for a ranger-type hero. But I see a leak.
    • Set Targets = (Random 1 units from (Units within 50.00 of ArrowMovePos))
     
  15. MortAr

    MortAr

    Joined:
    Feb 25, 2009
    Messages:
    1,771
    Resources:
    7
    Icons:
    6
    Packs:
    1
    Resources:
    7
    If you want you can fix it by yourself, I'm way too busy IRL to update the spell.
     
  16. Doom_AngeaL

    Doom_AngeaL

    Joined:
    Apr 17, 2010
    Messages:
    112
    Resources:
    0
    Resources:
    0
    Touche; I can't trig for my life anywho, just presenting the case( Didn't know if you noticed or someone else told you yet.)
     
  17. SilverLeaf

    SilverLeaf

    Joined:
    Jun 7, 2010
    Messages:
    34
    Resources:
    0
    Resources:
    0
    *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
     
  18. Hornacken

    Hornacken

    Joined:
    May 25, 2010
    Messages:
    1
    Resources:
    0
    Resources:
    0
    the arrows only fligh to the left side of the point where the ability is beiing cast
     
  19. IronForge

    IronForge

    Joined:
    Jun 7, 2008
    Messages:
    414
    Resources:
    1
    Maps:
    1
    Resources:
    1
    yes, of course. You could change it yourself to fire in whatever angle you want. 0 is straight ahead. I set it to -15 to 15