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

[Trigger] Spell problem

Status
Not open for further replies.
Level 7
Joined
Feb 18, 2007
Messages
216
So here's my noobish poison nova trigger:
  • PoisonNova
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Poison Nova
    • Actions
      • Unit - Create 1 PoisonNovaDummy for Player 1 (Red) at (Position of (Casting unit)) facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Breath Of Fire ((Position of (Casting unit)) offset by 50.00 towards 0.00 degrees)
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Create 1 PoisonNovaDummy for Player 1 (Red) at (Position of (Casting unit)) facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Breath Of Fire ((Position of (Casting unit)) offset by 50.00 towards 45.00 degrees)
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Create 1 PoisonNovaDummy for Player 1 (Red) at (Position of (Casting unit)) facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Breath Of Fire ((Position of (Casting unit)) offset by 50.00 towards 90.00 degrees)
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Create 1 PoisonNovaDummy for Player 1 (Red) at (Position of (Casting unit)) facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Breath Of Fire ((Position of (Casting unit)) offset by 50.00 towards 135.00 degrees)
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Create 1 PoisonNovaDummy for Player 1 (Red) at (Position of (Casting unit)) facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Breath Of Fire ((Position of (Casting unit)) offset by 50.00 towards 180.00 degrees)
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Create 1 PoisonNovaDummy for Player 1 (Red) at (Position of (Casting unit)) facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Breath Of Fire ((Position of (Casting unit)) offset by 50.00 towards 225.00 degrees)
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Create 1 PoisonNovaDummy for Player 1 (Red) at (Position of (Casting unit)) facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Breath Of Fire ((Position of (Casting unit)) offset by 50.00 towards 270.00 degrees)
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Create 1 PoisonNovaDummy for Player 1 (Red) at (Position of (Casting unit)) facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Breath Of Fire ((Position of (Casting unit)) offset by 50.00 towards 315.00 degrees)
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
So my problem is that poison bolt are launched as you can see in pic, to random destinations. I want the spell to launch them to every 45 degrees so it makes nova ring. Any idea what's the problem? PoisonNovaProblem.JPGI know i should use loop but i'm not sure how... And i know this is at wrong place.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
For the loop --

  • PoisonNova
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Poison Nova
    • Actions
      • Set loc = (Position of (Triggering unit))
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Unit - Create 1 PoisonNovaDummy for (Owner of (Triggering unit)) at loc facing 0.00 degrees
          • Set loc2 = (loc offset by 50.00 towards ((Real((Integer A))) x 45.00) degrees)
          • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Breath Of Fire loc2
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation( udg_loc2 )
      • Custom script: call RemoveLocation( udg_loc )
There's an unleakified version that should work (using a loop, too), assuming loc and loc2 are Point variables. It also fixes the Player issue you left, and the issue with Begins Casting an ability
 
Status
Not open for further replies.
Top