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

Slam ability problem

Status
Not open for further replies.
Level 2
Joined
Jun 27, 2016
Messages
13
Hi
I tried to make an abilitiy, that targets enemy unit and every second creates dummy, who casts stomp and same goes with thunderclap.

  • Events
  • Unit - A unit start casting ability
  • Conditions
  • (Ability being cast) equals to Curse
  • Actions
  • For each (Integer A) from 1 to 5, do (Actions)
    • Loop - Actions
    • Set TargetUnitAbility = (Position of (Target unit of ability being cast))
    • Jednostka - Create 1 dummy for (Owner of (Triggering unit)) at TargetUnitAbility facing default
    • Jednostka - Add DummyULTStomp to (Last created unit)
    • Jednostka - Order (Last created unit) to Orc - Tauren Chief - War Stomp
    • Jednostka - Add a 1.50 second expiration timer to (Last created unit)
    • Custom script: call RemoveLocation(udg_TargetUnitAbility)
    • Wait 0.50 seconds
    • Set TargetUnitAbility = (Position of (Target unit of ability being cast))
    • Jednostka - Create 1 dummy for (Owner of (Triggering unit)) at TargetUnitAbility default
    • Jednostka - Add DummyULTClap to (Last created unit)
    • Jednostka - Order (Last created unit) to Human - Mountain King: Thunderclap
    • Jednostka - Add a 1.50 second expiration timer to (Last created unit)
    • Custom script: call RemoveLocation(udg_TargetUnitAbility)
    • Wait 0.50 seconds
The problem is that it works only one time, instead of 10. What is wrong?

And btw is there any easy way to scale custom model of effect? The one I downloaded from here is way too big and exceeds range of ability.
 
Last edited:
Level 22
Joined
Aug 27, 2013
Messages
3,973
Here's how I do it.
Create a dummy, give it the stun ability.
Use periodic timer and count for every 1 second.
Create one more dummy as special effect.
Order the previous dummy to stun nearby enemy units and also damage them from the trigger.
Check if the target is dead or if the timer has expired, then end the spell.
  • Slam
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Curse (Neutral Hostile)
    • Actions
      • -------- Increase Index for MUI purpose --------
      • Set Max_Index = (Max_Index + 1)
      • -------- Input the necessary values --------
      • Set Caster[Max_Index] = (Triggering unit)
      • Set Target[Max_Index] = (Target unit of ability being cast)
      • -------- Reset counter --------
      • Set Counter[Max_Index] = 0
      • -------- Create our stunner dummy --------
      • Set TempPoint = (Position of Target[Max_Index])
      • Unit - Create 1 Stunner for (Owner of Caster[Max_Index]) at TempPoint facing Default building facing degrees
      • Set Dummy[Max_Index] = (Last created unit)
      • -------- Give it the stun ability --------
      • Unit - Add Stun to Dummy[Max_Index]
      • -------- Continue to loop --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Max_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on Slam Loop <gen>
        • Else - Actions
      • -------- Remove Leak --------
      • Custom script: call RemoveLocation(udg_TempPoint)
  • Slam Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Cur_Index) from 1 to Max_Index, do (Actions)
        • Loop - Actions
          • -------- To check the Interval between damage - In this case, it's 1 second --------
          • Set Counter2[Cur_Index] = (Counter2[Cur_Index] + 0.03)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Counter2[Cur_Index] Greater than or equal to 1.00
            • Then - Actions
              • -------- Create a dummy for your scaled special effect --------
              • Set TempPoint = (Position of Target[Cur_Index])
              • Unit - Create 1 Dummy Effect for (Owner of Caster[Cur_Index]) at TempPoint facing Default building facing degrees
              • -------- Kill it right away because we only need its animation --------
              • Unit - Kill (Last created unit)
              • -------- Pick every units in area, damage and stun them so it will work just like War Stomp --------
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within 350.00 of TempPoint) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is alive) Equal to True
                      • ((Picked unit) belongs to an enemy of (Owner of Caster[Cur_Index])) Equal to True
                      • ((Picked unit) is A structure) Equal to False
                    • Then - Actions
                      • Unit - Cause Caster[Cur_Index] to damage (Picked unit), dealing 100.00 damage of attack type Spells and damage type Normal
                      • Unit - Order Dummy[Cur_Index] to Human Mountain King - Storm Bolt (Picked unit)
                    • Else - Actions
              • -------- Count how many times this has been done - It will stop when it has done this 10 times --------
              • Set Counter[Cur_Index] = (Counter[Cur_Index] + 1)
              • -------- Reset the previous counter for interval --------
              • Set Counter2[Cur_Index] = 0.00
              • -------- Check when to end the spell --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • Counter[Cur_Index] Equal to 10
                      • (Target[Cur_Index] is dead) Equal to True
                • Then - Actions
                  • -------- the stunner dummy is no longer used so we can just remove it --------
                  • Unit - Kill Dummy[Cur_Index]
                  • -------- De-Index for MUI purpose --------
                  • Set Caster[Cur_Index] = Caster[Max_Index]
                  • Set Caster[Max_Index] = No unit
                  • Set Target[Cur_Index] = Target[Max_Index]
                  • Set Target[Max_Index] = No unit
                  • Set Dummy[Cur_Index] = Dummy[Max_Index]
                  • Set Dummy[Max_Index] = No unit
                  • Set Counter[Cur_Index] = Counter[Max_Index]
                  • Set Counter[Max_Index] = 0
                  • -------- Turn the trigger off --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Max_Index Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
              • -------- Remove the leak --------
              • Custom script: call RemoveLocation(udg_TempPoint)
            • Else - Actions
Here's the test map - Link
 
Status
Not open for further replies.
Top