Moderator
M
Moderator
15:42, 28th Jun 2011
Maker:
Approved.
Maker:
Approved.
Cutting Glaive Loop

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


For each (Integer CG_Index3) from 1 to CG_Index2, do (Actions)



Loop - Actions




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




-------- Setting Position of Dummy --------




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




Set CG_Point1 = (Position of CG_Dummy[CG_Index3])




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




-------- Setting Position Where it Should Move Next --------




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




Set CG_Point2 = (CG_Point1 offset by CG_Speed towards CG_Angle[CG_Index3] degrees)




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




-------- Now We Move the Dummy --------




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




Unit - Move CG_Dummy[CG_Index3] instantly to CG_Point2




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




-------- Subtracting Distance equal to Speed, if Distance Expires WE Damage the Units --------




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




Set CG_Distance[CG_Index3] = (CG_Distance[CG_Index3] - CG_Speed)




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





If - Conditions






CG_Distance[CG_Index3] Less than or equal to 10.00





Then - Actions






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






-------- Damage and Effects are Apllied Here --------






-------- Dummy 2 Is a FanofKnives Effect, i Create With Dummy Because If i Create It As Effect and Destroy It After it Creation if Wont Show --------






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






Unit - Create 1 Dummy 2 for Neutral Passive at CG_Point1 facing Default building facing degrees






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






Custom script: set bj_wantDestroyGroup = true






Unit Group - Pick every unit in (Units within CG_AoE1 of CG_Point1 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of CG_Caster[CG_Index3])) Equal to True)))) and do (Actions)







Loop - Actions








Unit - Cause CG_Caster[CG_Index3] to damage (Picked unit), dealing CG_Damage[CG_Index3] damage of attack type Spells and damage type Normal








Special Effect - Create a special effect attached to the chest of (Picked unit) using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl








Special Effect - Destroy (Last created special effect)






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






-------- Setting Location of Searched Target, if the Glaive will Reach that Location but No Target Will be There it Will Explode --------






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






Set CG_UnitGroup[CG_Index3] = (Units within CG_AoE2 of CG_Point1 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of CG_Caster[CG_Index3])) Equal to True))))






Set CG_Target[CG_Index3] = (Random unit from CG_UnitGroup[CG_Index3])






Set CG_Point3 = (Position of CG_Target[CG_Index3])






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






-------- Setting New Angle --------






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






Set CG_Angle[CG_Index3] = (Angle from CG_Point1 to CG_Point3)






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






-------- Setting New Distance --------






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






Set CG_Distance[CG_Index3] = (Distance between CG_Point1 and CG_Point3)






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






-------- Clearing leak --------






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






Custom script: call RemoveLocation(udg_CG_Point3)






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






-------- If we use jumps we subtract one --------






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






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







If - Conditions








CG_Check Equal to True







Then - Actions








Set CG_Jumps[CG_Index3] = (CG_Jumps[CG_Index3] - 1)







Else - Actions






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






-------- If the Glaive will Reach His Distance but No Target Will be There It Will Explde --------






-------- Or --------






-------- If the Distance will Become To Big It Will Explode, in Here I Add 250 More Range, so The to Explode Dummy Must be Far Then 750 + 250 == 1000 Range --------






-------- Or --------






-------- If Only One Unit Left. To Prevent Glaive of Damaging Him All the Time --------






-------- Or --------






-------- If Jumps Expired, If This Option Was Selected --------






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






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







If - Conditions








Or - Any (Conditions) are true









Conditions










(Number of units in CG_UnitGroup[CG_Index3]) Equal to 1










CG_Distance[CG_Index3] Greater than or equal to (CG_AoE2 + 250.00)










(CG_Target[CG_Index3] is dead) Equal to True










(CG_Check Equal to True) and (CG_Jumps[CG_Index3] Equal to 0)







Then - Actions








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








-------- Clearing Leaks, Turning This Trigger Off --------








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








Unit - Explode CG_Dummy[CG_Index3]








Set CG_Index = (CG_Index - 1)








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









If - Conditions










CG_Index Equal to 0









Then - Actions










Set CG_Index2 = 0










Trigger - Turn off (This trigger)









Else - Actions







Else - Actions






Custom script: call DestroyGroup(udg_CG_UnitGroup[udg_CG_Index3])





Else - Actions




Custom script: call RemoveLocation(udg_CG_Point1)




Custom script: call RemoveLocation(udg_CG_Point2)
Changelog:
-19.03.11 15:11 - created;
-19.03.11 15:47
removed the unneeded Unit Group variable;
-19.03.11 04:15
the AoE variable have been divided into two;
deleted custom script: call DestroyGroup...;
-19.03.11 21:55
if one unit left spell will be turned off;
added an FanofKnifes effect;
-20.03.11 09:48
removed repeating custom scripts, which clears leaks, they where twice running;
-20.03.11 11:33
added option where you can chose if you want to chose the jumps and how much;
-21.03.11 18:43
removed arrays from point variables;
-29.06.11 23:45
removed unneeded custom scirpts that where running three times;
some changes in OE;
-18.07.11 10:30
placed the script of destroying group into the right place.