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

[Trigger] Multi-sliding spell

Status
Not open for further replies.
Level 12
Joined
Jun 28, 2008
Messages
688
Well here's the jist of what I want to happen: When my hero casts the spell, he will become invulnerable and paused for 6 seconds, during which he moves to several randomized points between 100 and 250 units away from him. As he moves, he will damage enemy units he passes by.

Heres my Initialization trigger:

  • FWInit
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fatal Winds
    • Actions
      • Set FWCaster = (Casting unit)
      • Set FWPos = (Position of FWCaster)
      • Set FWPoint = (FWPos offset by (Random real number between 100.00 and 250.00) towards (Random angle) degrees)
      • Set FWDistance = (Distance between FWPos and FWPoint)
      • Set FWAngle = (Angle from FWPos to FWPoint)
      • Set FWN = 0.00
      • Wait 0.20 seconds
      • Unit - Create 1 FWEffect for (Owner of FWCaster) at FWPos facing Default building facing (270.0) degrees
      • Set FWNulledUnit = (Last created unit)
      • Unit - Add a 6.00 second Generic expiration timer to (Last created unit)
      • Unit - Make FWCaster face FWAngle over 0.00 seconds
      • Unit - Pause FWCaster
      • Unit - Make FWCaster Invulnerable
      • Animation - Play FWCaster's (walk + 2) animation
      • Trigger - Turn on FWEffect <gen>
      • Trigger - Turn on FWEffect2 <gen>
      • Wait 6.00 seconds
      • Trigger - Turn off FWEffect <gen>
      • Trigger - Turn off FWEffect2 <gen>
      • Unit - Unpause FWCaster
      • Unit - Make FWCaster Vulnerable
      • Animation - Reset FWCaster's animation
This trigger activates 2 triggers; one that moves the hero and damages enemies, and one that burns enemies' mana (optional).

  • FWEffect
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set FWN = (FWN + 50.00)
      • Set FWPos = (Position of FWCaster)
      • Set FWMove = (FWPos offset by 50.00 towards FWAngle degrees)
      • Unit - Move FWCaster instantly to FWMove
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Fatal Winds for FWCaster) Equal to 1
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 200.00 of FWMove matching (((Matching unit) Not equal to FWCaster) and ((((Matching unit) is A structure) Not equal to True) and (((Owner of (Matching unit)) is an ally of (Owner of FWCaster)) Not equal to True)))) and do (Unit - Cause FWCaster to damage (Picked unit), dealing 100.00 damage of attack type Chaos and damage type Normal)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Fatal Winds for FWCaster) Equal to 2
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 200.00 of FWMove matching (((Matching unit) Not equal to FWCaster) and ((((Matching unit) is A structure) Not equal to True) and (((Owner of (Matching unit)) is an ally of (Owner of FWCaster)) Not equal to True)))) and do (Unit - Cause FWCaster to damage (Picked unit), dealing 180.00 damage of attack type Chaos and damage type Normal)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Fatal Winds for FWCaster) Equal to 3
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 200.00 of FWMove matching (((Matching unit) Not equal to FWCaster) and ((((Matching unit) is A structure) Not equal to True) and (((Owner of (Matching unit)) is an ally of (Owner of FWCaster)) Not equal to True)))) and do (Unit - Cause FWCaster to damage (Picked unit), dealing 260.00 damage of attack type Chaos and damage type Normal)
        • Else - Actions
          • Do nothing
      • Special Effect - Create a special effect attached to the chest of FWCaster using Abilities\Weapons\GryphonRiderMissile\GryphonRiderMissileTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_FWMove)
      • Custom script: call RemoveLocation(udg_FWPos)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FWN Greater than or equal to FWDistance
        • Then - Actions
          • Set FWPoint = (FWPos offset by (Random real number between 100.00 and 250.00) towards (Random angle) degrees)
          • Set FWDistance = (Distance between FWPos and FWPoint)
          • Set FWAngle = (Angle from FWPos to FWPoint)
          • Set FWN = 0.00
          • Unit - Make FWCaster face FWAngle over 0.00 seconds
        • Else - Actions
          • Do nothing
  • FWEffect2
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Fatal Winds for FWCaster) Equal to 1
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 700.00 of (Position of FWNulledUnit) matching (((Owner of (Matching unit)) is an ally of (Owner of FWNulledUnit)) Not equal to True)) and do (Actions)
            • Loop - Actions
              • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - 20.00)
              • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\GryphonRiderMissile\GryphonRiderMissileTarget.mdl
              • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Fatal Winds for FWCaster) Equal to 2
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 700.00 of (Position of FWNulledUnit) matching (((Owner of (Matching unit)) is an ally of (Owner of FWNulledUnit)) Not equal to True)) and do (Actions)
            • Loop - Actions
              • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - 50.00)
              • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\GryphonRiderMissile\GryphonRiderMissileTarget.mdl
              • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Fatal Winds for FWCaster) Equal to 3
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 700.00 of (Position of FWNulledUnit) matching (((Owner of (Matching unit)) is an ally of (Owner of FWNulledUnit)) Not equal to True)) and do (Actions)
            • Loop - Actions
              • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - 80.00)
              • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\GryphonRiderMissile\GryphonRiderMissileTarget.mdl
              • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Do nothing
The problem is fixed, the trigger works fine now.
 
Last edited:
Level 15
Joined
Dec 18, 2007
Messages
1,098
Ok, in your second trigger, that is where all the fault should lie. First, the invulnerable and paused bug. You set the FWCaster to null, so if you refer to it in your first trigger, it will unpause no unit and make no unit vulnerable. So I suggest you cut and paste the unpause and make vulnerable, together with the turn off trigger thing to the if then else part of the trigger.
Next, the movement problem. I have no idea why it is so but I have encountered it somewhere. I will get back to you ASAP about that.
Next, your first trigger leaks locations so please do fix it.
 
Status
Not open for further replies.
Top