Chaosy
Tutorial Reviewer
- Joined
- Jun 9, 2011
- Messages
- 13,288
Interesting, I am actually surprised over the fact that this did not exist already.
Stormhammer:
On Attack: After 3 seconds an Lightning form the sky will hit the Target and deal 50 Spelldamage.
Creation-Trigger
Setup all P-Variables you need.
DelayA-Action Trigger: Runs after the Delay Expired.
Stormhammer attack
Events
Unit - A unit is Attacked
Conditions
(Level of Stormhammer for (Attacking unit)) != 0
Actions
-------- Delay in Seconds --------
Set DelayA___P_Delay = 3.00
-------- Units --------
Set DelayA___P_Source = (Attacking unit)
Set DelayA___P_Target = (Attacked unit)
-------- Effect beeing Called --------
Set DelayA___P_Trigger = stormhammer <gen>
-------- Grafical Indikator --------
Spezialeffekt - Create a special effect attached to the chest of P_Target using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
Set DelayA___P_Grafic = (Last created special effect)
-------- Create/Start DelayA --------
Trigger - Run DelayA_CONS_CREATE (ignoring conditions)
The DelayA__Action.. Variable are used here.
stormhammer
Events
Conditions
(DelayA__Action_Target is alive)
Actions
Spezialeffekt - Create a special effect attached to the origin of DelayA__Action_Target using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
Spezialeffekt - Destroy (Last created special effect)
Unit - Cause DelayA__Action_Source to damage DelayA__Action_Target, dealing 50.00 damage of attack type Spell and damage type Magic
Reteleport:
Enchants a target after 6 seconds it is teleported to the position it was Enchanted.
Reteleport cast
Events
Unit - A unit casts a spell
Conditions
(Ability being cast) = Reteleport
Actions
Set DelayA___P_Delay = 6.00
Set DelayA___P_Source = (Triggering unit)
Set DelayA___P_Target = (Target unit of ability being cast)
Set DelayA___P_Loc = (Position of P_Target)
Spezialeffekt - Create a special effect at DelayA___P_Loc using Abilities\Spells\Human\MassTeleport\MassTeleportTo.mdl
Set DelayA___P_Grafic = (Last created special effect)
Set DelayA___P_Trigger = Reteleport <gen>
Trigger - Run DelayA_CONS_CREATE (ignoring conditions)
Reteleport
Events
Conditions
(DelayA__Action_Target is alive)
Actions
-------- Eye Candy --------
Set loc = (Position of DelayA__Action_Target)
Spezialeffekt - Create a special effect at loc using Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
Spezialeffekt - Destroy (Last created special effect)
Custom script: call RemoveLocation(udg_loc)
-------- Teleport Back --------
Unit - Move DelayA__Action_Target instantly to DelayA__Action_Loc
Trap
This Creates Periodic Traps which will have a delay and then will deal dps for a short time.
Demo Create Traps
Events
Time - Elapsed game time is 1.00 seconds
Conditions
Actions
-------- ------------ --------
-------- Trap Fire --------
-------- Every 8 seconds will a Fire spawn which will deal 50 DpS for 4 seconds to Units in an 180 AoE. --------
-------- Trap Intervall --------
Set DelayA___P_Reload_Dur = 8.00
Set DelayA___P_Reloads = DelayA_CONSTANT_UNLIMITED_RELOADS
Set DelayA___P_Loc = (Center of Trap <gen>)
-------- Trap First Delay --------
Set DelayA___P_Freq_Delay = 0.20
-------- Trap Action --------
Set DelayA___P_Freq_Trigger = Trap DPS <gen>
-------- Trap 's Free Info; Here: AoE & DPA --------
Set DelayA___P_Freq_Data = 180
Set DelayA___P_Freq_Real = 10.00
-------- Intervall of Action --------
Set DelayA___P_Freq_Reload_Dur = 0.20
Set DelayA___P_Freq_Reloads = 19
-------- -> Results in 20 (19 Reloads + 1 instantly) Executions of the Action. In this Case 10 * 20 Dmg --------
-------- Grafic Stuff --------
Set DelayA___P_Freq_Grafic_TargetType = DelayA_CONSTANT_GRAFIC_Point
Set DelayA___P_Freq_Grafic_Path = Abilities\Spells\Other\ImmolationRed\ImmolationRedTarget.mdl
Trigger - Run DelayA_CONS_CREATE (ignoring conditions)
-------- ------------ --------
-------- ------------ --------
-------- Trap Lightning --------
-------- Every 5 seconds will a Lightning Strike the Loc dealing 140 Dmg over 0.9 seconds. --------
-------- Trap Intervall --------
Set DelayA___P_Loc = (Center of Trap 2 <gen>)
Set DelayA___P_Reload_Dur = 5.00
Set DelayA___P_Reloads = DelayA_CONSTANT_UNLIMITED_RELOADS
-------- Trap Effect --------
Set DelayA___P_Freq_Trigger = Trap DPS <gen>
Set DelayA___P_Freq_Real = 20.00
Set DelayA___P_Freq_Data = 100
Set DelayA___P_Freq_Reload_Dur = 0.15
Set DelayA___P_Freq_Reloads = 6
Set DelayA___P_Freq_Grafic_TargetType = DelayA_CONSTANT_GRAFIC_Point
Set DelayA___P_Freq_Grafic_Path = Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
Trigger - Run DelayA_CONS_CREATE (ignoring conditions)
Trap DPS
Events
Conditions
Actions
Custom script: set bj_wantDestroyGroup=true
Einheitengruppe - Pick every unit in (Units within (Real(DelayA__Action_Data)) of DelayA__Event_Loc matching (((Matching unit) is alive) equal True)) and do (Actions)
Schleifen - Aktionen
Unit - Set life of (Picked unit) to ((Leben of (Picked unit)) - DelayA__Action_Real)
Custom Variable start

Events


Unit - A unit is Attacked

Bedingungen


((Triggering unit) is a Hero)


(Number of items carried by (Triggering unit)) Smaller as (Size of inventory for (Triggering unit))

Aktionen


Hero - Create Ring of Regeneration and give it to (Triggering unit)


Set DelayA___P_Delay = 5.00


Set DelayA___P_Trigger = Custom Variable Action <gen>


Set DelayA___P_OnTerminate = Custom Variable Clear <gen>


Trigger - Run DelayA_CONS_CREATE (ignoring conditions)


-------- Attaching the Item to the Delayed Action --------


Set Item[DelayA_Index_Entered] = (Last created item)
Custom Variable Action

Events

Conditions

Actions


Item - Remove Item[DelayA_Index]
Custom Variable Clear

Events

Conditions

Actions


Set Item[DelayA_Index] = No Item
Delayed Action loop

Events

Conditions

Actions


-------- For Easy Copy; You can Remove this comment and the next Line if you want. --------


Set DelayA_Loop = 0


Set DelayA_Index = 0


For each (Integer DelayA_Loop) from 1 to DelayA_Count, do (Actions)



Schleifen - Aktionen




Set DelayA_Index = DelayA_Link_Next[DelayA_Index]




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





If - Conditios






Or - Any (Conditions) are true







Bedingungen








DelayA_Paused[DelayA_Index] Equal False








DelayA_Terminate[DelayA_Index] Equal True





Then - Actions






Set DelayA_Remainig_Dur[DelayA_Index] = (DelayA_Remainig_Dur[DelayA_Index] - DelayA_CONS_Intervall)






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







If - Conditios








Or - Any (Conditions) are true









Bedingungen










DelayA_Remainig_Dur[DelayA_Index] smaller Equal 0.00










DelayA_Terminate[DelayA_Index] Equal True







Then - Actions








-------- Skip Actions ; If Termiation is set. --------








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









If - Conditios










DelayA_Terminate[DelayA_Index] Equal False









Then - Actions










-------- Creates another Delayed Action if enabled; Based on the Freq Variables. --------










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











If - Conditios












DelayA_Freq_Has[DelayA_Index] Equal True











Then - Actions












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













If - Conditios














DelayA_Freq_Intervall[DelayA_Index] smaller Equal 0













Then - Actions














Set DelayA_Freq_Intervall[DelayA_Index] = DelayA_Freq_Intervall_Reload[DelayA_Index]














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















If - Conditios
















DelayA_Has_Loc[DelayA_Index] Equal True
















DelayA_Freq_Grafic_Targetype[DelayA_Index] Equal DelayA_CONS_GRAFIC_POINT















Then - Actions
















Set DelayA___P_Loc = (Point(DelayA_X[DelayA_Index], DelayA_Y[DelayA_Index]))
















Spezialeffekt - Create a special effect at DelayA___P_Loc using DelayA_Freq_Grafic_Path[DelayA_Index]
















Set DelayA___P_Grafic = (Last created special effect)















Else - Actions
















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

















If - Conditios


















DelayA_Freq_Grafic_Targetype[DelayA_Index] Equal DelayA_CONS_GRAFIC_TARGET

















Then - Actions


















Spezialeffekt - Create a special effect attached to the DelayA_Freq_Attachment[DelayA_Index] of DelayA_Targets[DelayA_Index] using DelayA_Freq_Grafic_Path[DelayA_Index]


















Set DelayA___P_Grafic = (Last created special effect)

















Else - Actions


















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



















If - Conditios




















DelayA_Freq_Grafic_Targetype[DelayA_Index] Equal DelayA_CONS_GRAFIC_SOURCE



















Then - Actions




















Spezialeffekt - Create a special effect attached to the DelayA_Freq_Attachment[DelayA_Index] of DelayA_Sources[DelayA_Index] using DelayA_Freq_Grafic_Path[DelayA_Index]




















Set DelayA___P_Grafic = (Last created special effect)



















Else - Actions














Set DelayA___P_Data = DelayA_Freq_Data[DelayA_Index]














Set DelayA___P_Real = DelayA_Freq_Data_Real[DelayA_Index]














Set DelayA___P_Reload_Dur = DelayA_Freq_Reload_Dur[DelayA_Index]














Set DelayA___P_Reloads = DelayA_Freq_Reloads[DelayA_Index]














Set DelayA___P_Source = DelayA_Sources[DelayA_Index]














Set DelayA___P_Target = DelayA_Targets[DelayA_Index]














Set DelayA___P_Trigger = DelayA_Freq_Trigger[DelayA_Index]














Set DelayA___P_Delay = DelayA_Freq_Duration[DelayA_Index]














Set DelayA___P_OnTerminate = DelayA_Freq_OnTerminate[DelayA_Index]














Trigger - Run DelayA_CONS_CREATE (ignoring conditions)














Trigger - Run DelayA_Freq_OnStart[DelayA_Index] (ignoring conditions)













Else - Actions














Set DelayA_Freq_Intervall[DelayA_Index] = (DelayA_Freq_Intervall[DelayA_Index] - 1)











Else - Actions










-------- Skip Event-Actions; if No Trigger is set --------










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











If - Conditios












DelayA_Trigger[DelayA_Index] UnEqual NO_TRIGGER











Then - Actions












-------- Filll the DE-Action Vari --------












-------- Start the Action Trigger --------












Set DelayA__Action_Data = DelayA_Data[DelayA_Index]












Set DelayA__Action_Real = DelayA_Data2[DelayA_Index]












Set DelayA__Action_Terminate_This = False












Set DelayA__Action_Source = DelayA_Sources[DelayA_Index]












Set DelayA__Action_Target = DelayA_Targets[DelayA_Index]












Set DelayA__Action_Grafic = DelayA_Grafic[DelayA_Index]












Set DelayA__Action_Left_Reloads = DelayA_ReLoads[DelayA_Index]












Custom script: set udg_DelayA__Action_Has_Reloads = not ( udg_DelayA_ReLoads[udg_DelayA_Index] == 0)












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













If - Conditios














DelayA_Has_Loc[DelayA_Index] Equal True













Then - Actions














-------- Handle Event Loc --------














Set DelayA__Action_Loc = (Point(DelayA_X[DelayA_Index], DelayA_Y[DelayA_Index]))














Trigger - Run DelayA_Trigger[DelayA_Index] (checking conditions)














Custom script: call RemoveLocation(udg_DelayA__Action_Loc)














Custom script: set udg_DelayA__Action_Loc=null













Else - Actions














Trigger - Run DelayA_Trigger[DelayA_Index] (checking conditions)












Custom script: if udg_DelayA__Action_Loc_New != null then












Set DelayA_X[DelayA_Index] = (X of DelayA__Action_Loc_New)












Set DelayA_Y[DelayA_Index] = (Y of DelayA__Action_Loc_New)












Set DelayA_Has_Loc[DelayA_Index] = True












Custom script: call RemoveLocation(udg_DelayA__Action_Loc_New)












Custom script: set udg_DelayA__Action_Loc_New=null












Custom script: endif











Else - Actions












Set DelayA__Action_Terminate_This = False









Else - Actions








-------- Termination? --------








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









If - Conditios










Or - Any (Conditions) are true











Bedingungen












DelayA_ReLoads[DelayA_Index] Equal 0












DelayA__Action_Terminate_This Equal True












DelayA_Terminate[DelayA_Index] Equal True









Then - Actions










-------- Clearing and Custom Variable Termination --------










Spezialeffekt - Destroy DelayA_Grafic[DelayA_Index]










Trigger - Run DelayA_OnTerminate[DelayA_Index] (ignoring conditions)










Set DelayA_Freq_Has[DelayA_Index] = False










-------- Change Pointers & Reading Array --------










Set DelayA_Link_Next[DelayA_Link_Previous[DelayA_Index]] = DelayA_Link_Next[DelayA_Index]










Set DelayA_Link_Previous[DelayA_Link_Next[DelayA_Index]] = DelayA_Link_Previous[DelayA_Index]










Set DelayA_Pointer_Unused[DelayA_Pointer_Unused_Last] = DelayA_Index










Set DelayA_Pointer_Unused_Last = (DelayA_Pointer_Unused_Last + 1)










Set DelayA_Count = (DelayA_Count - 1)










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











If - Conditios












DelayA_Count Equal 0











Then - Actions












Trigger - Turn off (This trigger)











Else - Actions









Else - Actions










Set DelayA_Remainig_Dur[DelayA_Index] = DelayA_ReLoad_Dur[DelayA_Index]










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











If - Conditios












DelayA_ReLoads[DelayA_Index] Greater as 0











Then - Actions












Set DelayA_ReLoads[DelayA_Index] = (DelayA_ReLoads[DelayA_Index] - 1)











Else - Actions







Else - Actions





Else - Actions
Delayed Action add

Events

Conditions

Actions


Set DelayA_Count = (DelayA_Count + 1)


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



If - Conditios




DelayA_Pointer_Unused_Last UnEqual 0



Then - Actions




Set DelayA_Pointer_Unused_Last = (DelayA_Pointer_Unused_Last - 1)




Set DelayA_Index_Entered = DelayA_Pointer_Unused[DelayA_Pointer_Unused_Last]



Else - Actions




Set DelayA_Pointer_Last_Row = (DelayA_Pointer_Last_Row + 1)




Set DelayA_Index_Entered = DelayA_Pointer_Last_Row


Set DelayA_Link_Next[DelayA_Index_Entered] = 0


Set DelayA_Link_Next[DelayA_Link_Previous[0]] = DelayA_Index_Entered


Set DelayA_Link_Previous[DelayA_Index_Entered] = DelayA_Link_Previous[0]


Set DelayA_Link_Previous[0] = DelayA_Index_Entered


-------- Save P_Data into DA_System Array --------


Set DelayA_Terminate[DelayA_Index_Entered] = False


Set DelayA_Paused[DelayA_Index_Entered] = False


Set DelayA_Remainig_Dur[DelayA_Index_Entered] = DelayA___P_Delay


Set DelayA_Sources[DelayA_Index_Entered] = DelayA___P_Source


Set DelayA_Targets[DelayA_Index_Entered] = DelayA___P_Target


Set DelayA_Trigger[DelayA_Index_Entered] = DelayA___P_Trigger


Set DelayA_OnTerminate[DelayA_Index_Entered] = DelayA___P_OnTerminate


Set DelayA_Data[DelayA_Index_Entered] = DelayA___P_Data


Set DelayA_Data2[DelayA_Index_Entered] = DelayA___P_Real


Set DelayA_ReLoad_Dur[DelayA_Index_Entered] = DelayA___P_Reload_Dur


Set DelayA_ReLoads[DelayA_Index_Entered] = DelayA___P_Reloads


Set DelayA_Grafic[DelayA_Index_Entered] = DelayA___P_Grafic


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



If - Conditios




Or - Any (Conditions) are true





Bedingungen






DelayA___P_Freq_Trigger UnEqual NO_TRIGGER






DelayA___P_Freq_Grafic_Path UnEqual <Leerer String>



Then - Actions




Set DelayA_Freq_Has[DelayA_Index_Entered] = True




Set DelayA_Freq_Attachment[DelayA_Index_Entered] = DelayA___P_Freq_Grafic_Attach




Set DelayA_Freq_Data[DelayA_Index_Entered] = DelayA___P_Freq_Data




Set DelayA_Freq_Data_Real[DelayA_Index_Entered] = DelayA___P_Freq_Real




Set DelayA_Freq_Duration[DelayA_Index_Entered] = DelayA___P_Freq_Delay




Set DelayA_Freq_Grafic_Targetype[DelayA_Index_Entered] = DelayA___P_Freq_Grafic_Target




Set DelayA_Freq_Grafic_Path[DelayA_Index_Entered] = DelayA___P_Freq_Grafic_Path




Set DelayA_Freq_Intervall[DelayA_Index_Entered] = DelayA___P_Freq_Intervall




Set DelayA_Freq_Intervall_Reload[DelayA_Index_Entered] = DelayA___P_Freq_Intervall




Set DelayA_Freq_OnStart[DelayA_Index_Entered] = DelayA___P_Freq_OnStart




Set DelayA_Freq_Reload_Dur[DelayA_Index_Entered] = DelayA___P_Freq_Reload_Dur




Set DelayA_Freq_Reloads[DelayA_Index_Entered] = DelayA___P_Freq_Reloads




Set DelayA_Freq_OnTerminate[DelayA_Index_Entered] = DelayA___P_Freq_OnTerminate




Set DelayA_Freq_Trigger[DelayA_Index_Entered] = DelayA___P_Freq_Trigger



Else - Actions




Set DelayA_Freq_Has[DelayA_Index_Entered] = False


-------- Save Loc if used --------


Custom script: if udg_DelayA___P_Loc != null then


Set DelayA_X[DelayA_Index_Entered] = (X of DelayA___P_Loc)


Set DelayA_Y[DelayA_Index_Entered] = (Y of DelayA___P_Loc)


Set DelayA_Has_Loc[DelayA_Index_Entered] = True


Custom script: else


Set DelayA_Has_Loc[DelayA_Index_Entered] = False


Custom script: endif


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


Trigger - Turn on Delayed Action loop <gen>


-------- Clean Parameters --------


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



If - Conditios




DelayA_CONS_CLEAR_PARAMETER Equal True



Then - Actions




Custom script: call RemoveLocation(udg_DelayA___P_Loc)




Custom script: set udg_DelayA___P_Loc=null




Set DelayA___P_Data = 0




Custom script: set udg_DelayA___P_Grafic = null




Set DelayA___P_Delay = 0.00




Set DelayA___P_Real = 0.00




Set DelayA___P_Reload_Dur = 0.00




Set DelayA___P_Reloads = 0




Set DelayA___P_Source = Keine Einheit




Set DelayA___P_Target = Keine Einheit




Set DelayA___P_Trigger = NO_TRIGGER




Set DelayA___P_OnTerminate = NO_TRIGGER




Set DelayA___P_Freq_Delay = 0.00




Set DelayA___P_Freq_Grafic_Target = 0




Set DelayA___P_Freq_Grafic_Attach = <Leerer String>




Set DelayA___P_Freq_Grafic_Path = <Leerer String>




Set DelayA___P_Freq_Data = 0




Set DelayA___P_Freq_Delay = 0.00




Set DelayA___P_Freq_OnStart = NO_TRIGGER




Set DelayA___P_Freq_Real = 0.00




Set DelayA___P_Freq_Intervall = 0




Set DelayA___P_Freq_Reload_Dur = 0.00




Set DelayA___P_Freq_Reloads = 0




Set DelayA___P_Freq_OnTerminate = NO_TRIGGER




Set DelayA___P_Freq_Trigger = NO_TRIGGER



Else - Actions
Delayed Action init

Events


Map initialization

Conditions

Actions


-------- Constant Intervall should not be Changed anywhere Else. --------


-------- Depending on usage you can Increase this value or decrease --------


-------- Higher Values make it more Incorrect but leighter on CPU --------


Set DelayA_CONS_Intervall = 0.05


Trigger - Add to Delayed Action loop <gen> the event (Time - Every DelayA_CONS_Intervall seconds of game time)


-------- This says if you want that the parameter values are nulled after usage --------


-------- can be changed before you call the "Delayed Effect add" Trigger --------


Set DelayA_CONS_CLEAR_PARAMETER = True


-------- Constants --------


Set DelayA_CONS_UNLIMITED_RELOADS = -1


Set DelayA_CONS_GRAFIC_POINT = 1


Set DelayA_CONS_GRAFIC_SOURCE = 2


Set DelayA_CONS_GRAFIC_TARGET = 3


Set DelayA_CONS_CREATE = Delayed Action add <gen>


-------- Some Copy Paste values --------


Set DelayA__Action_Has_Reloads = False
DA Terminate PSource

Events

Conditions

Actions


Set DelayA_Index = 0


For each (Integer A) from 1 to DelayA_Count, do (Actions)



Schleifen - Aktionen




Set DelayA_Index = DelayA_Link_Next[DelayA_Index]




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





If - Conditions






DelayA_Sources[DelayA_Index] Equal DelayA___P_Source





Then - Actions






Set DelayA_Terminate[DelayA_Index] = True





Else - Actions
Credits
Maker
zv27