Moderator
M
Moderator
19th Jun 2011
Maker:
Approved. You should add improting instructions into the map.
Maker:
Approved. You should add improting instructions into the map.
Phoenix Wave

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Phoenix Wave

Actions


-------- ------------------------------------------------------------------------ --------


-------- Searching for a free instance number --------


-------- ------------------------------------------------------------------------ --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




PWHas[PWLastRecycled] Equal to True



Then - Actions




Set PWMax = (PWMax + 1)




Set PWIndex = PWMax



Else - Actions




Set PWIndex = PWLastRecycled




Set PWLastRecycled = PWRecycledList[PWLastRecycled]


-------- ------------------------------------------------------------------------ --------


-------- Setting spell variables --------


-------- ------------------------------------------------------------------------ --------


Set PWCaster[PWIndex] = (Triggering unit)


Set PWTargetPoint[PWIndex] = (Target point of ability being cast)


Set PWCasterPoint[PWIndex] = (Position of PWCaster[PWIndex])


Set PWMaxDistance[PWIndex] = (700.00 + (100.00 x (Real((Level of Phoenix Wave for PWCaster[PWIndex])))))


Set PWDistance[PWIndex] = 0.00


Set PWDamage[PWIndex] = (50.00 x (Real((Level of Phoenix Wave for PWCaster[PWIndex]))))


Set PWHas[PWIndex] = True


Set PWCount = (PWCount + 1)


Unit - Create 1 Phoenix Dummy for (Triggering player) at PWCasterPoint[PWIndex] facing (Angle from PWCasterPoint[PWIndex] to PWTargetPoint[PWIndex]) degrees


Set PWAngle[PWIndex] = (Angle from PWCasterPoint[PWIndex] to PWTargetPoint[PWIndex])


Set PWPhoenix[PWIndex] = (Last created unit)


Custom script: set udg_PWDMGGroup[udg_PWIndex] = CreateGroup()


-------- ------------------------------------------------------------------------ --------


-------- If the spell is not used, turning on the loop trigger --------


-------- ------------------------------------------------------------------------ --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Phoenix Wave Loop <gen> is on) Equal to False



Then - Actions




Trigger - Turn on Phoenix Wave Loop <gen>



Else - Actions


-------- ------------------------------------------------------------------------ --------


-------- If all the flames removed, turning the trigger on again --------


-------- ------------------------------------------------------------------------ --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Flame Removal Effect <gen> is on) Equal to False



Then - Actions




Trigger - Turn on Flame Removal Effect <gen>



Else - Actions
Phoenix Wave Loop

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


For each (Integer PWInteger) from 0 to PWMax, do (Actions)



Loop - Actions




-------- ------------------------------------------------------------------------ --------




-------- Checking if the instance is in use --------




-------- ------------------------------------------------------------------------ --------




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






PWHas[PWInteger] Equal to True





Then - Actions






-------- ------------------------------------------------------------------------ --------






-------- Checking if the spell is done --------






-------- ------------------------------------------------------------------------ --------






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








PWDistance[PWInteger] Less than PWMaxDistance[PWInteger]







Then - Actions








Set PWDistance[PWInteger] = (PWDistance[PWInteger] + 40.00)








Set TempLoc = (PWCasterPoint[PWInteger] offset by PWDistance[PWInteger] towards PWAngle[PWInteger] degrees)








Unit - Move PWPhoenix[PWInteger] instantly to TempLoc








Set TempInt = (Level of Phoenix Wave for PWCaster[PWInteger])








Custom script: set bj_wantDestroyGroup = true








Unit Group - Pick every unit in (Units within 150.00 of TempLoc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and (((((Matching unit) is alive) Equal to True) and (((Matching unit) is in PWDMGGroup[PWInteger]) Equal to Fa and do (Actions)









Loop - Actions










Unit Group - Add (Picked unit) to PWDMGGroup[PWInteger]










Unit - Cause PWCaster[PWInteger] to damage (Picked unit), dealing PWDamage[PWInteger] damage of attack type Pierce and damage type Normal










Unit - Create 1 Dummy for (Owner of PWCaster[PWInteger]) at TempLoc facing Default building facing degrees










Set TempUnit = (Last created unit)










Unit - Add Flames to TempUnit










Unit - Set level of Flames for TempUnit to TempInt










Unit - Add a 2.00 second Generic expiration timer to TempUnit










Unit - Order TempUnit to Neutral Alchemist - Acid Bomb (Picked unit)








-------- ------------------------------------------------------------------------ --------








-------- The flame effects, no it creates at each 120 distance --------








-------- ------------------------------------------------------------------------ --------








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










(PWDistance[PWInteger] mod 120.00) Equal to 0.00









Then - Actions










Unit - Create 1 Flames for (Owner of PWCaster[PWInteger]) at TempLoc facing PWAngle[PWInteger] degrees










Unit - Add Flames Damage to (Last created unit)










Unit - Set level of Flames Damage for (Last created unit) to TempInt










Unit - Add a 2.50 second Generic expiration timer to (Last created unit)









Else - Actions








Custom script: call RemoveLocation (udg_TempLoc)







Else - Actions








-------- ------------------------------------------------------------------------ --------








-------- Removing leaks, reducing spell counter and setting new free instance number --------








-------- ------------------------------------------------------------------------ --------








Unit - Explode PWPhoenix[PWInteger]








Custom script: call DestroyGroup (udg_PWDMGGroup[udg_PWInteger])








Custom script: call RemoveLocation (udg_PWTargetPoint[udg_PWInteger])








Custom script: call RemoveLocation (udg_PWCasterPoint[udg_PWInteger])








Set PWCount = (PWCount - 1)








Set PWHas[PWInteger] = False








Set PWRecycledList[PWInteger] = PWLastRecycled








Set PWLastRecycled = PWInteger








-------- ------------------------------------------------------------------------ --------








-------- Turning the trigger off if the spell counter is 0 --------








-------- ------------------------------------------------------------------------ --------








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










PWCount Equal to 0









Then - Actions










Set PWRecycledList[PWInteger] = 0










Set PWLastRecycled = 0










Set PWMax = 0










Trigger - Turn off (This trigger)









Else - Actions





Else - Actions
Flame Removal Effect

Events


Unit - A unit Dies

Conditions


(Unit-type of (Triggering unit)) Equal to Flames

Actions


Set TempLoc = (Position of (Triggering unit))


Special Effect - Create a special effect at TempLoc using Abilities\Weapons\RedDragonBreath\RedDragonMissile.mdl


Special Effect - Destroy (Last created special effect)


Custom script: call RemoveLocation (udg_TempLoc)


Set TempGroup = (Units of type Flames)


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Number of units in TempGroup) Equal to 0



Then - Actions




Trigger - Turn off (This trigger)



Else - Actions


Custom script: call DestroyGroup (udg_TempGroup)