• 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.

[Trigger] Bunch of triggers which don't work :)

Status
Not open for further replies.
Level 8
Joined
Sep 24, 2007
Messages
300
Well, I have some triggers that are bugged and I don't know where is the problem, so I am asking you guys here. :]


1. These are 2 triggers for 1v1 arena fight. It goes like this: Hero from Team 2 enters his region and then hero from Team 1 enters his own region. Ofc trigger must check if they belong to the right force and the number of heroes in region. BUT...nothing happens.

Trigger for TEam 2:
  • PvP begin ORC
    • Events
      • Unit - A unit enters orcPvP <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Entering unit) is A Hero) Equal to True
          • (Player number of (Owner of (Entering unit))) Greater than or equal to 6
        • Then - Actions
          • Set PvPheroes[2] = (Number of units in (Units in orcPvP <gen>))
        • Else - Actions
Trigger for team 1:
  • PvP begin HU
    • Events
      • Unit - A unit enters humanPvP <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Entering unit) is A Hero) Equal to True
          • (Player number of (Owner of (Entering unit))) Less than or equal to 5
        • Then - Actions
          • Set PvPheroes[1] = (Number of units in (Units in humanPvP <gen>))
        • Else - Actions
      • Unit Group - Pick every unit in (Units in PvParena <gen>) and do (Actions)
        • Loop - Actions
          • Set PvPheroes[3] = (Number of units in (Units in PvParena <gen>))
      • Wait 1.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (PvPheroes[1] Equal to 1) and ((PvPheroes[2] Equal to 1) and (PvPheroes[3] Equal to 0))
        • Then - Actions
          • Unit Group - Pick every unit in (Units in humanPvP <gen>) and do (Actions)
            • Loop - Actions
              • Unit - Move (Picked unit) instantly to (Position of Snowy Tree Wall 0429 <gen>)
              • Camera - Pan camera for (Owner of (Picked unit)) to (Position of Snowy Tree Wall 0429 <gen>) over 0.00 seconds
              • Unit - Make (Picked unit) Vulnerable
              • Unit - Pause (Picked unit)
          • Unit Group - Pick every unit in (Units in orcPvP <gen>) and do (Actions)
            • Loop - Actions
              • Unit - Move (Picked unit) instantly to (Position of Snowy Tree Wall 0430 <gen>)
              • Camera - Pan camera for (Owner of (Picked unit)) to (Position of Snowy Tree Wall 0430 <gen>) over 0.00 seconds
              • Unit - Make (Picked unit) Vulnerable
              • Unit - Pause (Picked unit)
          • Game - Display to (All players) the text: Orc and Human heroe...
          • Wait 2.00 seconds
          • Game - Display to (All players) the text: Battle begins in: 3
          • Sound - Play BattleNetTick <gen>
          • Wait 1.00 seconds
          • Game - Display to (All players) the text: Battle begins in: 2
          • Sound - Play BattleNetTick <gen>
          • Wait 1.00 seconds
          • Game - Display to (All players) the text: Battle begins in: 1
          • Sound - Play BattleNetTick <gen>
          • Wait 1.00 seconds
          • Sound - Play O05Cenarius03 <gen>
          • Unit Group - Pick every unit in (Units in PvParena <gen>) and do (Actions)
            • Loop - Actions
              • Unit - Unpause (Picked unit)
          • Wait 55.00 seconds
          • Game - Display to (All players) the text: Battle ends in: 5
          • Sound - Play BattleNetTick <gen>
          • Wait 1.00 seconds
          • Game - Display to (All players) the text: Battle ends in: 4
          • Sound - Play BattleNetTick <gen>
          • Wait 1.00 seconds
          • Game - Display to (All players) the text: Battle ends in: 3
          • Sound - Play BattleNetTick <gen>
          • Wait 1.00 seconds
          • Game - Display to (All players) the text: Battle ends in: 2
          • Sound - Play BattleNetTick <gen>
          • Wait 1.00 seconds
          • Game - Display to (All players) the text: Battle ends in: 1
          • Sound - Play BattleNetTick <gen>
          • Wait 1.00 seconds
          • Game - Display to (All players) the text: Battle ends in: 0
          • Sound - Play BattleNetTick <gen>
          • Unit Group - Pick every unit in (Units in PvParena <gen>) and do (Actions)
            • Loop - Actions
              • Unit - Move (Picked unit) instantly to (Position of Fountain 0075 <gen>)
        • Else - Actions

2. This trigger is made to prevent teamkilling. But for some reason, Human units (Player 12) stop the attack against enemies from 6-10 but they attack player 11. (forces are freom 1-5+12 and 6-11).

  • Prevent Team kill and denying
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player number of (Owner of (Attacked unit))) Less than or equal to 5
          • (Player number of (Owner of (Attacking unit))) Less than or equal to 5
        • Then - Actions
          • Unit - Order (Attacking unit) to Stop
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player number of (Owner of (Attacking unit))) Greater than or equal to 6
          • (Player number of (Owner of (Attacked unit))) Greater than or equal to 6
          • (Player number of (Owner of (Attacked unit))) Not equal to 12
          • (Player number of (Owner of (Attacking unit))) Not equal to 12
          • (Player number of (Owner of (Attacked unit))) Not equal to 11
        • Then - Actions
          • Unit - Order (Attacking unit) to Stop
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player number of (Owner of (Attacked unit))) Equal to 12
          • (Player number of (Owner of (Attacking unit))) Less than or equal to 5
        • Then - Actions
          • Special Effect - Create a special effect attached to the Attach Point - Overhead of (Entering unit) using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosDone.mdl
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player number of (Owner of (Attacked unit))) Equal to 11
          • (Player number of (Owner of (Attacking unit))) Greater than or equal to 6
          • (Player number of (Owner of (Attacked unit))) Not equal to 12
        • Then - Actions
          • Special Effect - Create a special effect attached to the Attach Point - Overhead of (Entering unit) using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosDone.mdl
        • Else - Actions
That's all for now, but I get new bugs every day from tests so ... :)
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
Do you have dummy units in any of the 3 area's? Also, that trigger will only activate when someone from the orcs enters before someone from the humans. Add the part after the first If/Then/Else command in the human trigger to the orc trigger, so it'll check whenever either of the teams send in a hero.

For the second trigger, change the conditions to:
  • If - Conditions
    • OR - Conditions
      • (Player number of (Owner of (Attacking unit))) Less than or equal to 6
      • (Player number of (Owner of (Attacking unit))) Equal to 12
    • OR - Conditions
      • (Player number of (Owner of (Attacked unit))) Less than or equal to 6
      • (Player number of (Owner of (Attacked unit))) Equal to 12
  • If - Conditions
    • AND - Conditions
      • (Player number of (Owner of (Attacking unit))) Greater than or equal to 6
      • (Player number of (Owner of (Attacking unit))) Not equal to 12
    • AND - Conditions
      • (Player number of (Owner of (Attacked unit))) Greater than or equal to 6
      • (Player number of (Owner of (Attacked unit))) Not equal to 12
 
Level 8
Joined
Sep 24, 2007
Messages
300
1. Yes, orc hero must enter before human, that's what I already tested, but it doesn't work. There is also no dummy units in the region.
2. Will try

Also, few other bugs that appeared:


1. Simple trigger that swaps units after the spell is casted (event: unit starts casting ability). It is connected to Wait action but I don't know how. -.- Units just don't swap.

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Ability being cast) Equal to Swap
    • Then - Actions
      • Wait 1.00 seconds
      • Set swapLOCcaster = (Position of (Casting unit))
      • Wait 0.30 seconds
      • Unit - Move (Casting unit) instantly to (Position of (Target unit of ability being cast))
      • Unit - Move (Target unit of ability being cast) instantly to swapLOCcaster
    • Else - Actions
2. Another simple spell trigger that changes the color into your computer team color after you hex your ally (it can be used as a cover from enemies). Color is not changed.

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Ability being cast) Equal to Transformation
    • Then - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Transformation for (Casting unit)) Equal to 1
          • (Player number of (Owner of (Casting unit))) Less than or equal to 5
        • Then - Actions
          • Unit - Change color of (Target unit of ability being cast) to Brown
          • Wait 3.00 seconds
          • Unit - Change color of (Target unit of ability being cast) to (Color of (Owner of (Target unit of ability being cast)))
        • Else - Actions
          • Unit - Change color of (Target unit of ability being cast) to Dark Green
          • Wait 3.00 seconds
          • Unit - Change color of (Target unit of ability being cast) to (Color of (Owner of (Target unit of ability being cast)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Transformation for (Casting unit)) Equal to 2
          • (Player number of (Owner of (Casting unit))) Less than or equal to 5
        • Then - Actions
          • Unit - Change color of (Target unit of ability being cast) to Brown
          • Wait 4.00 seconds
          • Unit - Change color of (Target unit of ability being cast) to (Color of (Owner of (Target unit of ability being cast)))
        • Else - Actions
          • Unit - Change color of (Target unit of ability being cast) to Dark Green
          • Wait 4.00 seconds
          • Unit - Change color of (Target unit of ability being cast) to (Color of (Owner of (Target unit of ability being cast)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Transformation for (Casting unit)) Equal to 3
          • (Player number of (Owner of (Casting unit))) Less than or equal to 5
        • Then - Actions
          • Unit - Change color of (Target unit of ability being cast) to Brown
          • Wait 5.00 seconds
          • Unit - Change color of (Target unit of ability being cast) to (Color of (Owner of (Target unit of ability being cast)))
        • Else - Actions
          • Unit - Change color of (Target unit of ability being cast) to Dark Green
          • Wait 5.00 seconds
          • Unit - Change color of (Target unit of ability being cast) to (Color of (Owner of (Target unit of ability being cast)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Transformation for (Casting unit)) Equal to 4
          • (Player number of (Owner of (Casting unit))) Less than or equal to 5
        • Then - Actions
          • Unit - Change color of (Target unit of ability being cast) to Brown
          • Wait 6.00 seconds
          • Unit - Change color of (Target unit of ability being cast) to (Color of (Owner of (Target unit of ability being cast)))
        • Else - Actions
          • Unit - Change color of (Target unit of ability being cast) to Dark Green
          • Wait 6.00 seconds
          • Unit - Change color of (Target unit of ability being cast) to (Color of (Owner of (Target unit of ability being cast)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Transformation for (Casting unit)) Equal to 5
          • (Player number of (Owner of (Casting unit))) Less than or equal to 5
        • Then - Actions
          • Unit - Change color of (Target unit of ability being cast) to Brown
          • Wait 7.00 seconds
          • Unit - Change color of (Target unit of ability being cast) to (Color of (Owner of (Target unit of ability being cast)))
        • Else - Actions
          • Unit - Change color of (Target unit of ability being cast) to Dark Green
          • Wait 7.00 seconds
          • Unit - Change color of (Target unit of ability being cast) to (Color of (Owner of (Target unit of ability being cast)))
    • Else - Actions
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
For both triggers:

Add a Game message that says 'Works so far'. Place it at different parts in the trigger and see at which part if doesn't appear. Then you know where the mistake is made.

I'd like to see the Events and Conditions. Do remember that the event should be 'A unit begins casting an ability' and the condition should be 'ability being cast equal to YOU ABILITY'
 
Level 8
Joined
Sep 24, 2007
Messages
300
ok I will try that messege trick

and about the even and condition-ofc...

but, I think the problem could be in "Targeted unit of ability being cast"

Maybe trigger can't define the target (for some reason) how could I bypass that? Add a buff to spell and then check with event: Unit has Buff etc??
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
All the ability events works as intent, though, Begins casting/Starts channeling applies when the ability is clicked/ordered etc. Starts the effect of an ability usually comes ~0.5 seconds later, right before all buffs/mana drain/cooldown etc is made. Finish/Ends casting an ability is usually ~3.3 seconds after the 'begins casting' event, but the player can force it to be executed faster by another order. The threshold lies around 2.1 though.
However, it appears that some spells do not trigger all the events. But generally 'starts the effect of an ability' mostly does.

It is indeed true that the "Targeted unit of ability being cast" is screwing the trigger up as it is a global variable and erased when a trigger recycles in the queue (waits, timers) "Casting unit" is also erased like this, but both of them will work fine as long as there are no waits. At this point, always use Triggering unit instead of casting unit, since triggering unit will not be affected by waits.


Also, Else-ifs would be much faster than checking the rest of the ifs when it already achieved it's task. But this is not even required. You can replace this trigger with a few lines of code using a formula :]

  • Transformation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Transformation
    • Actions
      • Custom script: local unit udg_TargetUnit
      • Set TargetUnit = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player number of (Owner of (Triggering unit))) Less than 6
        • Then - Actions
          • Unit - Change color of TargetUnit to Brown
        • Else - Actions
          • Unit - Change color of TargetUnit to Dark Green
      • Wait (Real(((Level of Transformation for (Triggering unit)) + 2))) seconds
      • Unit - Change color of TargetUnit to (Color of (Owner of TargetUnit))
      • Custom script: set udg_TargetUnit = null
It should do the same thing. The custom script allows us to make the target unit of ability being cast stored as a local, since the editor thinks that the 'UnitTarget' variable is local in this trigger.

~Eccho~
 
Level 8
Joined
Sep 24, 2007
Messages
300
You were right, casting unit and targeted units are really erased after wait action. I fixed that now and it's working.

Still can't find the bug in PvP and Transformation though. I added a text action in transformation but it's not shown. I will have to experiment a little.

I will also have to try different ways for casting spells. Looks like thinkgs are not so defined and you have to experiment a little.

edit: all spells work now, looks like the bug was really in units which were not stored in memory... thank you all guys :)
 
Last edited:
Level 8
Joined
Sep 24, 2007
Messages
300
I won't start new topic, so here is another one: Event is Unit finishes casting ability

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Ability being cast) Equal to Astro Fan
    • Then - Actions
      • For each (Integer A) from 1 to (5 x (Level of Astro Fan for (Casting unit))), do (Actions)
        • Loop - Actions
          • Unit - Create 1 AstroDummy for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing (270.0) degrees
          • Unit - Set level of AstroFan (unit) for (Last created unit) to (Level of Astro Fan for (Casting unit))
          • Unit - Order (Last created unit) to Neutral - Breath Of Frost ((Position of (Casting unit)) offset by 300.00 towards ((Angle from (Position of (Casting unit)) to (Target point of ability being cast)) + (((Real((Integer A))) - 5.00) x 5.00)) degrees)
          • Unit - Order (Last created unit) to Neutral - Breath Of Frost ((Position of (Casting unit)) offset by 300.00 towards ((Angle from (Position of (Casting unit)) to (Target point of ability being cast)) + (((Real((Integer A))) - 5.00) x 5.00)) degrees)
          • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
    • Else - Actions


Well, dummies cast ability from position of casting unit to position of ability's targeting point. But sometimes in-game, dummies cast their ability in completely different direction (180° fail) or lower angle fail.

So basicaly: Instead of casting in the direction of targeted point, it casts in different direction. What's wrong?
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Meh Avator, it could be, that you have a ability which you are channeling. In that case Finishing channeling an ability would be the best event (ends casting an ability works too). And, the event itself does not affect any of the actions. It would rather determine whether the trigger is executed properly or not.
 
Level 8
Joined
Sep 24, 2007
Messages
300
Event is ok, ability WORKS but not properly.

On level 5, 25 dummies are created and they cast, but that's not the problem. Problem is the DIRECTION in which they cast. As I said, sometimes they do it in completely wrong direction.

The problem is, that I didn't do this spell by myself. What exactly means (((Real((Integer A))) - 5.00) x 5.00)) degrees) can someone explain me?
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
That means, that for each index in the loop. (you know It loops the actions and set IntegerA to IntegerA+1 after each loop. So basically, for each loop it calculates the new angle of where the dummy should cast towards. And for each loop, it adds ('Integer A index' - 5degrees) * 5 degrees.

Another question: Why is the order done twice?

Issues:

<>Warcraft has its own way to determine angles. Normally we say that an angle is 0 - 360 degrees, but in wc3 it goes from 0 - 180 and then (-180) back to 0. So, it would make a big jump for some angles, and the order would be cast 180 degrees wrong. (I know my explanation is blurry now but I hope you get something out of it).

Edit: Basically, the spell is creating a parabola of castings, with the target point as middle point. Something like this; (I know its ugly^^)
214xcn9.jpg

But since the angles of wc3 is not matching the terms, the cast will sometime be done backwards.

<>The code leaks massively, and is not that efficient. I can give it a try to solve it.

Edit 2: Here you go. I hope it works.
  • Astro Fan Test
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Breath of Fire
    • Actions
      • Set temppoint[0] = (Position of (Triggering unit))
      • Set temppoint[1] = (Target point of ability being cast)
      • Set angle = (Angle from temppoint[0] to temppoint[1])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • angle Less than 0.00
        • Then - Actions
          • Set angle = (angle + 360.00)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • angle Greater than or equal to 360.00
            • Then - Actions
              • Set angle = (angle - 360.00)
            • Else - Actions
      • Custom script: call RemoveLocation( udg_temppoint[1] )
      • For each (Integer A) from 1 to (5 x (Level of Breath of Fire for (Triggering unit))), do (Actions)
        • Loop - Actions
          • Unit - Create 1 Chicken for (Owner of (Triggering unit)) at temppoint[0] facing Default building facing degrees
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Set temppoint[1] = (temppoint[0] offset by 300.00 towards (angle + (((Real((Integer A))) - 5.00) x 5.00)) degrees)
          • Unit - Set level of Breath of Fire (Neutral Hostile) for (Last created unit) to (Level of Breath of Fire for (Triggering unit))
          • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Breath Of Fire temppoint[1]
          • Custom script: call RemoveLocation( udg_temppoint[1] )
      • Custom script: call RemoveLocation( udg_temppoint[0] )
 
Level 8
Joined
Sep 24, 2007
Messages
300
man thank you, I will try this as soon as possible

also, I have no idea why it's used twice

and after your explanation, I think I can understand what is wrong

since action is adding +5° for each integer, there becomes a problem when degrees go above 180 and it becomes a mess. I hope I understood well.

and about the w3 angle system, is it like this?

................90


180...........................0
-180.........................-0


..............-90
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
yeah, thats precisely how it is. However you can use any angles when facing something. But when calculating the angle between points, it will always return a value like the ones I said: Resulting to a value which doesn't match in some occasions.
 
Level 8
Joined
Sep 24, 2007
Messages
300
Not working, problem seems deeper and more mathematical.

The first thing to know is, how does w3 calculate things like this: 90°+ 180°=260°

How does it convert 260° into it's angle system? Because that's the actual problem here.

It obviously doesn't convert 260° into -90° but into something different. So you have to convert instead of it. Like: If angle number>180, then do (angle-180)*-1

So in our case:

260>180, so do 260-180=90 * (-1)


Some feedback on my "solutions" now plz. :)
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Well, this is how it is. (90+180 is 270 btw :)

If you use the action AngleBetweenPoints it will always return a value between -180 and 180°. Why? I dont know...but if we look at the jass code of the action it looks like this:
JASS:
function AngleBetweenPoints takes location locA, location locB returns real
    return bj_RADTODEG * Atan2(GetLocationY(locB) - GetLocationY(locA), GetLocationX(locB) - GetLocationX(locA))
endfunction

and bj_RADTODEG = 180.0/bj_PI
(bj_PI as in 3.14...)
Now, Atan2 returns the angle in radians:
native Atan2 takes real y, real x returns real
Where y = y2 - y1, x = x2 - x1
...

And wikipedia can help us with Atan2. It says alot more if you want to read and try to understand yourself (I don't get everything anyways, it's basically math...)
atan2 - Wikipedia, the free encyclopedia

he diagram below shows values of atan2 at selected points on the unit circle. The values are shown in blue inside the circle. The four points (1,0), (0,1), (-1,0), and (0,-1) are labeled outside the circle.
Atan2_circle.png

And, since the values here only can be between -1 and 1 converting it to a circle of 360° will give us the values -180 and 180. (in radians -2*PI and 2*PI).

This means that the angle is changing based on where you stand on the map.

[ERASED PART (gone)]

I made a debug message to display the angle. It shows that the angle is the same no matter what direction it is cast. Why? I asked our master PurplePoot which happend to figure out why... on less than a minute -.-'.

You have a broken point. That is why your angle is the same. The reason is: (Darn you Avator, you were partly right). Target point of ability being cast does NOT work with 'Finish casting an ability'. Neither does 'Stops casting an ability'. So yeah you better use 'Starts the effect of an ability' instead. And shoop da whoop, that works perfectly, except that the spell is cast 180 degrees of the wrong direction.

No need for angle checking conditions (as I was wrong anyways: It should not be angle + 360, it should be angle + 180. Anyway as told, we dont need these). Atan2 gives either positive or negative angles determined which point you are adding first. So... this trigger works just great!

  • Astro Fan test
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Breath of Fire
    • Actions
      • Set PointA = (Position of (Triggering unit))
      • Set PointB = (Target point of ability being cast)
      • Set angle = (Angle from PointA to PointB)
      • Custom script: call RemoveLocation( udg_PointB )
      • Game - Display to (All players) the text: (String(angle))
      • Game - Display to (All players) the text: (String(((angle / 180.00) x 3.14)))
      • For each (Integer A) from 1 to (5 x (Level of Breath of Fire for (Triggering unit))), do (Actions)
        • Loop - Actions
          • Unit - Create 1 Vulture for (Owner of (Triggering unit)) at PointA facing Default building facing degrees
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Unit - Set level of Breath of Fire (Neutral Hostile) for (Last created unit) to (Level of Breath of Fire (Neutral Hostile) for (Triggering unit))
          • Set PointB = (PointA offset by 300.00 towards (angle + (((Real((Integer A))) - 5.00) x 5.00)) degrees)
          • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Breath Of Fire PointB
          • Custom script: call RemoveLocation( udg_PointB )
      • Custom script: call RemoveLocation( udg_PointA )
(dont mind the game messages though)

You would perhaps take notice, that it doesn't fire precisely at the requested angle. The reason is: towards (angle + (((Real((Integer A))) - 5.00) x 5.00)) degrees)
If you shoot, as example towards east. It will give you the angle 0. The For loop calculates the target for the multiply dummy units to cast... but its not exact.
Let say like I said, east, and the level of the spell is 1.
it will create 5 units which will fire at the angles: -20, -15, -10, -5 and 0. You see how its not centered. Otherwise it works very well.
 
Status
Not open for further replies.
Top