- Joined
- Feb 8, 2015
- Messages
- 93
Hello Hive!
Once more I need help with a trigger - a rather extensive one this time.
The trigger comes in 2 parts (3 really, but 1 of them should be fixable once I get the rest working):
The first part of the trigger creates 4 "Spire of Enmity" units around the position of a Boss Unit. For this I use a loop with "Integer A" - and there are 4 units spawned around the Boss alright, so that part might be fine.
This should also create 4 lightning effects between the Boss and each pillar - but they all stack on top of one another.
The second part is a trigger that moves the Spires (and Lightning effects) in circles around the Boss. However, this actually places all the Spires right on top of each other, but they do move alright.
I cannot for the life of me see where I went wrong, can anyone here spot where the problem is?
Help much appreciated
Really lost in this trigger.
I added in comments to explain the trigger's actions. If any additional clarification is needed, just ask me.
Once more I need help with a trigger - a rather extensive one this time.
The trigger comes in 2 parts (3 really, but 1 of them should be fixable once I get the rest working):
The first part of the trigger creates 4 "Spire of Enmity" units around the position of a Boss Unit. For this I use a loop with "Integer A" - and there are 4 units spawned around the Boss alright, so that part might be fine.
This should also create 4 lightning effects between the Boss and each pillar - but they all stack on top of one another.
The second part is a trigger that moves the Spires (and Lightning effects) in circles around the Boss. However, this actually places all the Spires right on top of each other, but they do move alright.
I cannot for the life of me see where I went wrong, can anyone here spot where the problem is?
Help much appreciated
-
Spires of Enmity Initiate
-
Events
-
Conditions
-
Actions
-
-------- Saves the location of the BossU (who should be at the center of the Arena, BP = Boss point) --------
-
Set SoE_BP = (Position of BossU)
-
-------- Sets four locations, and creates the four pillars around the Boss (using a loop of 1-4) --------
-
For each (Integer A) from 1 to 4, do (Actions)
-
Loop - Actions
-
-------- Calculates the angle (first south, then clockwise towards east) for the offset point. The formula is (360 - IntegerA x 90) --------
-
Set SoE_Angle = (360.00 - (90.00 x (Real((Integer A)))))
-
-------- Sets a offset point towards the angle (Boss' location + 700 range towards _Angle) --------
-
Set SoE_Loc[(Integer A)] = (SoE_BP offset by 700.00 towards SoE_Angle degrees)
-
-------- Creates a Spire of Enmity at the location --------
-
Unit - Create 1 Spire of Enmity for Player 12 (Brown) at SoE_Loc[(Integer A)] facing Default building facing degrees
-
-------- Saves the newly created spire as SoE_SpireU[Integer A] - meaning the first created is [1], the second [2] and so on... --------
-
Set SoE_SpireU[(Integer A)] = (Last created unit)
-
-------- Creates a lightning effect between the Boss' location (Tempp1) and each Spire (one at a time) --------
-
Lightning - Create a Finger of Death lightning effect from source SoE_BP to target SoE_Loc[(Integer A)]
-
-------- Saves the lightning effect with the index [Integer A] - it is moved in the MoveLoop Trigger --------
-
Set SoE_L[(Integer A)] = (Last created lightning effect)
-
-------- Removes the location used (The [bj_forLoopAIndex] makes it so that [1], [2], [3], and [4] are destroyed) --------
-
Custom script: call RemoveLocation(udg_SoE_Loc[bj_forLoopAIndex])
-
-
-
-------- Turns on the MoveLoop trigger and the LaunchLoop triggers (the launchloop is only activated on Hard/Suicide mode) --------
-
Trigger - Turn on Spires of Enmity MoveLoop <gen>
-
-------- Cleans up this trigger by removing the location variable Tempp1 --------
-
Custom script: call RemoveLocation(udg_SoE_Tempp1)
-
-
-
Spires of Enmity MoveLoop
-
Events
-
Time - Every 0.05 seconds of game time
-
-
Conditions
-
Actions
-
-------- ------------------------------------------------------ --------
-
-------- Sets a new location for the Spires to be moved to - This is done much like in "Initiate", but the angle is calculated differently --------
-
-------- ------------------------------------------------------ --------
-
-------- Saves the location of the BossU (who should be at the center of the Arena) --------
-
Set SoE_BP = (Position of BossU)
-
-------- Sets four locations, and moves the four pillars around the Boss (using a loop of 1-4) --------
-
-------- Note that I use Tempi here instead of IntegerA, because the Lightning custom script cannot be too long! --------
-
For each (Integer SoE_i) from 1 to 4, do (Actions)
-
Loop - Actions
-
-------- Calculates the angle for the new Spire locaton (calculates current angle between Boss and spire, and retracts a bit --------
-
Set SoE_Angle = ((Angle from SoE_BP to SoE_Loc[SoE_i]) - 2.00)
-
-------- Sets a new offset point towards the angle (Boss' location + 700 range towards _Angle) --------
-
Set SoE_Loc[SoE_i] = (SoE_BP offset by 700.00 towards SoE_Angle degrees)
-
-------- Moves the looping Spire to the new location --------
-
Custom script: call SetUnitX(udg_SoE_SpireU[udg_SoE_i], GetLocationX(udg_SoE_Loc[udg_SoE_i]))
-
Custom script: call SetUnitY(udg_SoE_SpireU[udg_SoE_i], GetLocationY(udg_SoE_Loc[udg_SoE_i]))
-
-------- Moves the corresponding lightning effect --------
-
Custom script: call MoveLightningEx(udg_SoE_L[udg_SoE_i], true , GetLocationX(udg_SoE_Loc[udg_SoE_i]), GetLocationY(udg_SoE_Loc[udg_SoE_i]), GetLocationZ(udg_SoE_Loc[udg_SoE_i]) + 120, GetLocationX(udg_SoE_BP), GetLocationY(udg_SoE_BP), GetLocationZ(udg_SoE_BP) + 200)
-
-------- Removes the location used (The [bj_forLoopAIndex] makes it so that [1], [2], [3], and [4] are destroyed) --------
-
Custom script: call RemoveLocation(udg_SoE_Loc[udg_SoE_i])
-
-
-
-------- ------------------------------------------------------ --------
-
-------- Deals the Lightning Effects damage by setting points down a line --------
-
-------- ------------------------------------------------------ --------
-
-------- Sets the distance between each "Damage point" - similar to "Deathclock" from Phase 4 --------
-
Set SoE_Ldist = 46.60
-
-------- Sets the damage dealt by the Lightning (Note that this runs every 0.05 seconds, so the damage might seem very small) --------
-
Set SoE_LDamage = 2.50
-
-------- Loops through all 4 Spires --------
-
For each (Integer A) from 1 to 4, do (Actions)
-
Loop - Actions
-
-------- NOTE: The loop through the 4 Spries uses "IntegerA" while the loop to create the Damage Points uses "IntegerB" --------
-
-------- Gets the location of the Spires, using simply the location of the units (The units are stored in the SpireU unit array in "Initate") --------
-
Set SoE_Loc[(Integer A)] = (Position of SoE_SpireU[(Integer A)])
-
-------- Calculates the angle from the SpireLoc[IntegerA] to the BP --------
-
Set SoE_LAngle = (Angle from SoE_Loc[(Integer A)] to SoE_BP)
-
-------- Runs a loop to place the "Damage Points" and deal damage around them (Note that 15 x 46.6 circa equals 700 range) --------
-
For each (Integer B) from 1 to 15, do (Actions)
-
Loop - Actions
-
-------- Sets an offset point from the BossPosition (_BP) which is LDist x IntegerA towards the angle from SpireLoc to BP --------
-
Set SoE_LTempp = (SoE_Loc[(Integer A)] offset by (SoE_DistProj x (Real((Integer B)))) towards SoE_LAngle degrees)
-
-------- Sets a Unit group around the Lightning - this will only hit the Player Characters --------
-
Set SoE_Lug = (Units within 50.00 of SoE_LTempp matching ((((Matching unit) is alive) Equal to True) and (((Unit-type of (Matching unit)) Equal to Dragonknight) or ((Unit-type of (Matching unit)) Equal to Cleric))))
-
-------- Deals the damage to the Units in the group --------
-
Unit Group - Pick every unit in SoE_Lug and do (Actions)
-
Loop - Actions
-
-------- Saves the picked unit in a variable --------
-
Set SoE_LPicked = (Picked unit)
-
-------- Saves the location of the picked unit (for effects) --------
-
Set SoE_LPickedLoc = (Position of SoE_LPicked)
-
-------- Creates a dummy at the location, this is an "immolation" effect --------
-
Unit - Create 1 Dummy Immolation Effect for Neutral Passive at SoE_LPickedLoc facing Default building facing degrees
-
-------- Adds a short expiration to the dummy --------
-
Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
-
-------- Deals the damage to the picked unit --------
-
Unit - Cause SoE_Tempu to damage SoE_LPicked, dealing SoE_LDamage damage of attack type Magic and damage type Fire
-
-------- Destroys the point variable we used to the picked unit's location --------
-
Custom script: call RemoveLocation(udg_SoE_LPickedLoc)
-
-
-
-------- Destroys the Unit group and the temporary points --------
-
Custom script: call DestroyGroup(udg_SoE_Lug)
-
Custom script: call RemoveLocation(udg_SoE_LTempp)
-
Custom script: call RemoveLocation(udg_SoE_Loc[bj_forLoopAIndex])
-
-
-
-
-
-
I added in comments to explain the trigger's actions. If any additional clarification is needed, just ask me.