Sonic Missile v1.0

This bundle is marked as approved. It works and satisfies the submission rules.
Shoots a missile at the target dealing damage and healing caster. The more distance it travels more damage will deal

Triggers

  • Sonic Missile Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to SM_Ability
    • Actions
      • Set SM_Index = (SM_Index + 1)
      • Set SM_Caster[SM_Index] = (Triggering unit)
      • Set SM_Target[SM_Index] = (Target unit of ability being cast)
      • Set SM_Level[SM_Index] = (Level of SM_Ability for SM_Caster[SM_Index])
      • Set tempPoints[1] = (Position of SM_Caster[SM_Index])
      • Set tempPoints[2] = (Position of SM_Target[SM_Index])
      • Set SM_Angle[SM_Index] = (Angle from tempPoints[1] to tempPoints[2])
      • Set SM_OwnerofUnit = (Triggering player)
      • Set SM_Damage[SM_Index] = SM_InitialDamage[SM_Level[SM_Index]]
      • Unit - Create 1 SM_SM_Type for SM_OwnerofUnit at tempPoints[1] facing SM_Angle[SM_Index] degrees
      • Set SM_SM[SM_Index] = (Last created unit)
      • Custom script: call RemoveLocation (udg_tempPoints[1])
      • Custom script: call RemoveLocation (udg_tempPoints[2])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SM_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on Sonic Missile Loop <gen>
        • Else - Actions


  • Sonic Missile Loop
    • Events
    • Conditions
    • Actions
      • For each (Integer tempInt) from 1 to SM_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (SM_Target[tempInt] is alive) Equal to True
            • Then - Actions
              • Set tempPoints[1] = (Position of SM_SM[tempInt])
              • Set tempPoints[2] = (Position of SM_Target[tempInt])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between tempPoints[1] and tempPoints[2]) Greater than SM_DistanceTraveled
                • Then - Actions
                  • Set SM_Angle[tempInt] = (Angle from tempPoints[1] to tempPoints[2])
                  • Set tempPoints[3] = (tempPoints[1] offset by SM_DistanceTraveled towards SM_Angle[tempInt] degrees)
                  • Unit - Move SM_SM[tempInt] instantly to tempPoints[3], facing SM_Angle[tempInt] degrees
                  • Set SM_Damage[tempInt] = (SM_Damage[tempInt] + SM_DamagePer20DBonus)
                  • Set SM_HealAmount[tempInt] = (SM_Damage[tempInt] x SM_HealFactor)
                  • Custom script: call RemoveLocation (udg_tempPoints[3])
                • Else - Actions
                  • Unit - Kill SM_SM[tempInt]
                  • Unit - Cause SM_Caster[tempInt] to damage SM_Target[tempInt], dealing SM_Damage[tempInt] damage of attack type Spells and damage type Magic
                  • Unit - Set life of SM_Caster[tempInt] to ((Life of SM_Caster[tempInt]) + SM_HealAmount[tempInt])
                  • Set SM_Caster[tempInt] = SM_Caster[SM_Index]
                  • Set SM_Damage[tempInt] = SM_Damage[SM_Index]
                  • Set SM_HealAmount[tempInt] = SM_HealAmount[SM_Index]
                  • Set SM_SM[tempInt] = SM_SM[SM_Index]
                  • Set SM_Target[tempInt] = SM_Target[SM_Index]
                  • Set SM_Angle[tempInt] = SM_Angle[SM_Index]
                  • Set SM_Caster[SM_Index] = No unit
                  • Set SM_SM[SM_Index] = No unit
                  • Set SM_Target[SM_Index] = No unit
                  • Set SM_Index = (SM_Index - 1)
                  • Set tempInt = (tempInt - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SM_Index Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
              • Custom script: call RemoveLocation (udg_tempPoints[1])
              • Custom script: call RemoveLocation (udg_tempPoints[2])
            • Else - Actions
              • Unit - Kill SM_SM[tempInt]
              • Set SM_Caster[tempInt] = SM_Caster[SM_Index]
              • Set SM_Damage[tempInt] = SM_Damage[SM_Index]
              • Set SM_HealAmount[tempInt] = SM_HealAmount[SM_Index]
              • Set SM_SM[tempInt] = SM_SM[SM_Index]
              • Set SM_Target[tempInt] = SM_Target[SM_Index]
              • Set SM_Angle[tempInt] = SM_Angle[SM_Index]
              • Set SM_Caster[SM_Index] = No unit
              • Set SM_SM[SM_Index] = No unit
              • Set SM_Target[SM_Index] = No unit
              • Set SM_Index = (SM_Index - 1)
              • Set tempInt = (tempInt - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SM_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions


  • Sonic Missile Variables
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set SM_Ability = Sonic Missile
      • Set SM_SM_Type = Sonic Missile
      • Set SM_DistanceTraveled = 20.00
      • Set SM_HealFactor = 0.25
      • Set SM_InitialDamage[1] = 30.00
      • Set SM_InitialDamage[2] = 60.00
      • Set SM_InitialDamage[3] = 90.00
      • Set SM_InitialDamage[4] = 120.00
      • Set SM_InitialDamage[5] = 150.00
      • Set SM_InitialDamage[6] = 180.00
      • Set SM_DamagePer20DBonus = 10.00
      • Set LoopInterval = 0.05
      • Trigger - Add to Sonic Missile Loop <gen> the event (Time - Every LoopInterval seconds of game time)





Idea: Me :p
Help with triggers/coding: CakeMaster


Keywords:
Missile, Sonic, Sonic Missile
Contents

Sonic Missile (Map)

Reviews
16:11, 20th Sep 2014 TriggerHappy: The spell works and the script looks fine. Though, for the interval I think 0.03 looks a lot better than 0.05.

Moderator

M

Moderator

16:11, 20th Sep 2014
TriggerHappy:

The spell works and the script looks fine.

Though, for the interval I think 0.03 looks a lot better than 0.05.
 
Level 29
Joined
Oct 24, 2012
Messages
6,545
Level 8
Joined
Nov 9, 2011
Messages
322
Max array size is 8191 not 8176.

@mogulkhan1Axe
You should take a look at the variable editor section in my tutorial http://www.hiveworkshop.com/forums/...now-when-using-triggers-gui-233242/#Section 1. (this link will bring you directly to that section. It has info on why variables should be 1 and what need to be higher and the reason for that.

Thanks for the reply as always !

Kb9H4YL.png


look at this how it should be i mean AKA.GywGod133 already said that only array size 1 is needed
 

Kazeon

Hosted Project: EC
Level 33
Joined
Oct 12, 2011
Messages
3,445
  • SM_DistanceTraveled should be SM_AoE or SM_HitRadius
  • Unit facing smoothing factor seems better for homing missile: Increase/decrease missile's facing per tick. Not instantly order the missile to face it's target.

    • Set SM_Level[SM_Index] = (Level of SM_Ability for SM_Caster[SM_Index])
    Remove that variable, you are only using it for once.
    • Set SM_Damage[SM_Index] = SM_InitialDamage[SM_Level[SM_Index]]
  • Optional:
    • (SM_Target[tempInt] is alive) Equal to True
    It seems weird if the missile gets removed instantly after the target has died. At least, let them arrive at target's location first. Check wc3 native abilities for example.
 
Level 8
Joined
Nov 9, 2011
Messages
322
  • SM_DistanceTraveled should be SM_AoE or SM_HitRadius
  • Unit facing smoothing factor seems better for homing missile: Increase/decrease missile's facing per tick. Not instantly order the missile to face it's target.

    • Set SM_Level[SM_Index] = (Level of SM_Ability for SM_Caster[SM_Index])
    Remove that variable, you are only using it for once.
    • Set SM_Damage[SM_Index] = SM_InitialDamage[SM_Level[SM_Index]]
  • Optional:
    • (SM_Target[tempInt] is alive) Equal to True
    It seems weird if the missile gets removed instantly after the target has died. At least, let them arrive at target's location first. Check wc3 native abilities for example.

edit:yea i didnt rly know how to name the variable
edit1:i dont know how to do that
edit2:i intend to do the slow someday or something similar so i left the level(arrayed)
edit3:so what
 
Top