• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

need help on a spell (its stacking ability)

Status
Not open for further replies.
Level 15
Joined
Jul 9, 2008
Messages
1,552
Spell 1.
i have this spell called rocket the hero shoots a rocket at a target point the rocket will shoot out in a strait line any unit hit by the rocket will take damage and a small slow. the spell has a low cool down and when hit a second time the rocket will deal extra damage and will slow the unit by more stacks up to 5 times. i have done all the triggering for the rocket but not the stacks i also havent done the slow effect yet because im unsure what is needed for the stack of the slows.

  • Rocket On
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Rocket
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in WB) Equal to 0
        • Then - Actions
          • Trigger - Turn on Rocket Loop <gen>
        • Else - Actions
      • Set WB_times = (WB_times + 1)
      • Set WB_Hero[WB_times] = (Casting unit)
      • Set WB_Point[1] = (Position of WB_Hero[WB_times])
      • Set WB_Point[2] = (Target point of ability being cast)
      • Set WB_Distance[WB_times] = 0.00
      • Set Reached_D[WB_times] = 2500.00
      • Set WB_Speed[WB_times] = 25.00
      • Set WB_Damage[WB_times] = ((Real((Level of Rocket for WB_Hero[WB_times]))) x 40.00)
      • Set WB_angel[WB_times] = (Angle from WB_Point[1] to WB_Point[2])
      • Unit - Create 1 rocket for (Owner of WB_Hero[WB_times]) at WB_Point[1] facing WB_angel[WB_times] degrees
      • Set WB_rocket[WB_times] = (Last created unit)
      • Custom script: call RemoveLocation(udg_WB_Point[1])
      • Custom script: call RemoveLocation(udg_WB_Point[2])
      • Set WB_X[WB_times] = (Position of WB_Hero[WB_times])
      • Unit Group - Add WB_Hero[WB_times] to WB
  • Rocket Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer WB_Loop) from 1 to WB_times, do (Actions)
        • Loop - Actions
          • Set WB_Distance[WB_Loop] = (WB_Distance[WB_Loop] + WB_Speed[WB_Loop])
          • Set XWB[1] = (WB_X[WB_Loop] offset by WB_Distance[WB_Loop] towards WB_angel[WB_Loop] degrees)
          • Unit - Move WB_rocket[WB_Loop] instantly to XWB[1]
          • Set WB_Group[WB_Loop] = (Units within 100.00 of XWB[1] matching ((((Matching unit) belongs to an enemy of (Owner of WB_Hero[WB_times])) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) is A structure) Equal to False))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in WB_Group[WB_Loop]) Greater than 0
            • Then - Actions
              • Unit Group - Pick every unit in WB_Group[WB_Loop] and do (Actions)
                • Loop - Actions
                  • Unit - Cause WB_Hero[WB_Loop] to damage (Picked unit), dealing WB_Damage[WB_Loop] damage of attack type Spells and damage type Normal
                  • Unit - Create 1 dummy for (Owner of WB_Hero[WB_Loop]) at XWB[1] facing Default building facing degrees
                  • Unit - Add Acid Bomb to (Last created unit)
                  • Unit - Set level of Acid Bomb for (Last created unit) to ((Level of Rocket for WB_Hero[WB_Loop]) + 0)
                  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                  • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
                  • Custom script: call RemoveLocation(udg_WB_X[udg_WB_Loop])
                  • Unit Group - Remove WB_Hero[WB_Loop] from WB
                  • Unit - Kill WB_rocket[WB_Loop]
                  • Set WB_Hero[WB_Loop] = No unit
                  • Set WB_Distance[WB_Loop] = 0.00
                  • Set WB_angel[WB_Loop] = 0.00
                  • Set WB_Speed[WB_Loop] = 0.00
                  • Set Reached_D[WB_Loop] = 0.00
                  • Set WB_Damage[WB_Loop] = 0.00
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in WB) Equal to 0
                    • Then - Actions
                      • Set WB_times = 0
                      • Trigger - Turn off Rocket Loop <gen>
                    • Else - Actions
            • Else - Actions
          • Custom script: call DestroyGroup(udg_WB_Group[udg_WB_Loop])
          • Custom script: call RemoveLocation(udg_XWB[1])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • WB_Distance[WB_Loop] Greater than or equal to Reached_D[WB_Loop]
            • Then - Actions
              • Custom script: call RemoveLocation(udg_WB_X[udg_WB_Loop])
              • Unit Group - Pick every unit in Freezed[WB_Loop] and do (Actions)
                • Loop - Actions
                  • Unit Group - Remove (Picked unit) from Freezed[WB_Loop]
              • Unit Group - Remove WB_Hero[WB_Loop] from WB
              • Unit - Kill WB_rocket[WB_Loop]
              • Set WB_Hero[WB_Loop] = No unit
              • Set WB_Distance[WB_Loop] = 0.00
              • Set WB_angel[WB_Loop] = 0.00
              • Set WB_Speed[WB_Loop] = 0.00
              • Set Reached_D[WB_Loop] = 0.00
              • Set WB_Damage[WB_Loop] = 0.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in WB) Equal to 0
                • Then - Actions
                  • Set WB_times = 0
                  • Trigger - Turn off Rocket Loop <gen>
                • Else - Actions
            • Else - Actions
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
You store how many times the unit has been slowed. When you're about to slow a unit check the stored number and increase it by one. Set the level of the slowing ability accordingly to increase the effect. One could make it so that being hit refreshes the slow time so one would not have to keep track on individual expiration times of each slow, only the last. When a unit becomes unslowed, set the stack number to zero.
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
You store how many times the unit has been slowed. When you're about to slow a unit check the stored number and increase it by one. Set the level of the slowing ability accordingly to increase the effect. One could make it so that being hit refreshes the slow time so one would not have to keep track on individual expiration times of each slow, only the last. When a unit becomes unslowed, set the stack number to zero.

not sure what your saying i store how many times its been slowed in a integer does using the same ability but a stronger one just over right the first one? how would i make a integer for each unit what has been hit and to know what unit has been hit already
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
not sure what your saying i store how many times its been slowed in a integer does using the same ability but a stronger one just over right the first one? how would i make a integer for each unit what has been hit and to know what unit has been hit already

You could use a hashtable for this. Before applying the debuff, load the value stored in a hashtable and adjust the ability level accordingly. If it is zero then it doesn't have the buff cast on it.

I'm not sure if higher ability value overrides a lower one, I would guess that yes it does. You can always remove the previous buff with a trigger.
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
Slow ability:
Lev 1 - 5%
Lev 2 - 10%
Lev 3 - 15%
Lev 4 - 20%
Lev 5 - 25%

- save integer 1 to a hashtable then cast the spell (that's level 1)...
- in the timer loop load the integer then add 1 and cast (level 2), then save again, then cast again (level 3), and so on...

that wont work the rocket may hit defferent units

e.g rocket hits unit 1 slowing lvl 1 rocket hits unit 1 slowing lvl then rocket hits unit 2 again slowing lvl 2
 
Status
Not open for further replies.
Top