- Joined
- Oct 12, 2011
- Messages
- 3,449
I've decided to always post my spells here 1-3 days before I submit it into resources section. I hope anybody can help me to find anything's wrong with the triggers/codes. I say thank you very much for any kind of help. 

-
Configuration
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
-------- main ability than will run the trigger --------
-
Set EP_ConfAbility = Earth Pressure
-
-------- type of attack of the dealt damage. look at this trigger comment for the complete list --------
-
Set EP_ConfAttackType = 6
-
-------- multipler amount of stun duration reduction based on distance between position of unit and the center of explosion. "0" for constant duration --------
-
Set EP_ConfStunRangeFactor = 0.15
-
-------- amount of damage reduction caused by distance between the victim with the center of explosion. set to "0" for a constant damage --------
-
Set EP_ConfDamageRangeFactor = 0.15
-
-------- dummy unit for the missile --------
-
Set EP_ConfDummy = Missile
-
-------- delay per created sfx when the missile hasn't hit anything. set to "0" to continously create sfx --------
-
Set EP_ConfCrackSfxDelay = 0.10
-
-------- timer for dummy after it hits a target. set this a little bigger than duration of impact sfx duration --------
-
Set EP_ConfMissileTimer = 2.00
-
-------- maximum range for dummy to acquire a target --------
-
Set EP_ConfHitRadius = 100.00
-
-------- higher height multiplier the more units knocked higher. this multiplier makes differences maximum knock height (based on distance from the center of explotion and position of unit) become higher --------
-
Set EP_ConfKBHeightMultiplier = 1.50
-
-------- higher knock speed multiplier makes the unit knocked faster --------
-
Set EP_ConfKBSpeedMultiplier = 1.00
-
-------- sfx for knocked unit if it stays on the ground when knocked --------
-
Set EP_ConfKBSfx = Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
-
-------- attachment point of target where the knockback sfx will be created --------
-
Set EP_ConfKBSfxPoint = origin
-
-------- sfx that will be created along the path --------
-
Set EP_ConfCrackSfx = Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
-
-------- sfx created when the missile hits a target --------
-
Set EP_ConfImpactSfx = Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
-
-------- buff for the stun ability --------
-
Set EP_ConfStunBuff = Stunned (Earth Pressure)
-
-------- a dummy unit that will be used for stunning units. required for stun system --------
-
Set EP_ConfStunner = Stunner
-
-------- set this to stun ability for stunner unit --------
-
Set EP_ConfStunAbility = Stun
-
-------- AoE of the ability for level 1 --------
-
Set EP_ConfAoE[1] = 400.00
-
-------- AoE of the ability for level 2 --------
-
Set EP_ConfAoE[2] = 400.00
-
-------- AoE of the ability for level 3 --------
-
Set EP_ConfAoE[3] = 400.00
-
-------- AoE of the ability for level 4 --------
-
Set EP_ConfAoE[4] = 400.00
-
-------- damage dealt to all enemies within the AoE for the ability for level 1 --------
-
Set EP_ConfDamage[1] = 100.00
-
-------- damage dealt to all enemies within the AoE for the ability for level 2 --------
-
Set EP_ConfDamage[2] = 150.00
-
-------- damage dealt to all enemies within the AoE for the ability for level 3 --------
-
Set EP_ConfDamage[3] = 200.00
-
-------- damage dealt to all enemies within the AoE for the ability for level 4 --------
-
Set EP_ConfDamage[4] = 250.00
-
-------- duration of the stun (level 1) --------
-
Set EP_ConfDuration[1] = 3.00
-
-------- duration of the stun (level 2) --------
-
Set EP_ConfDuration[2] = 3.50
-
-------- duration of the stun (level 3) --------
-
Set EP_ConfDuration[3] = 4.00
-
-------- duration of the stun (level 4) --------
-
Set EP_ConfDuration[4] = 4.50
-
-------- speed for the main dummy unit (ability level 1) --------
-
Set EP_ConfMissileSpeed[1] = 15.00
-
-------- speed for the main dummy unit (ability level 2) --------
-
Set EP_ConfMissileSpeed[2] = 15.00
-
-------- speed for the main dummy unit (ability level 3) --------
-
Set EP_ConfMissileSpeed[3] = 15.00
-
-------- speed for the main dummy unit (ability level 4) --------
-
Set EP_ConfMissileSpeed[4] = 15.00
-
-------- percentage of the sfx's size when created. 100 = 100% = 1.00, 200 = 200% = 2.00 (ability level 1) --------
-
Set EP_ConfImpactSfxSize[1] = 200.00
-
-------- percentage of the sfx's size when created. 100 = 100% = 1.00, 200 = 200% = 2.00 (ability level 2) --------
-
Set EP_ConfImpactSfxSize[2] = 200.00
-
-------- percentage of the sfx's size when created. 100 = 100% = 1.00, 200 = 200% = 2.00 (ability level 3) --------
-
Set EP_ConfImpactSfxSize[3] = 200.00
-
-------- percentage of the sfx's size when created. 100 = 100% = 1.00, 200 = 200% = 2.00 (ability level 4) --------
-
Set EP_ConfImpactSfxSize[4] = 200.00
-
-------- maximum distance for main dummy before it explodes (ability level 1) --------
-
Set EP_ConfDistanceMax[1] = 1500.00
-
-------- maximum distance for main dummy before it explodes (ability level 2) --------
-
Set EP_ConfDistanceMax[2] = 1500.00
-
-------- maximum distance for main dummy before it explodes (ability level 3) --------
-
Set EP_ConfDistanceMax[3] = 1500.00
-
-------- maximum distance for main dummy before it explodes (ability level 4) --------
-
Set EP_ConfDistanceMax[4] = 1500.00
-
-
-
EP Cast
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to EP_ConfAbility
-
-
Actions
-
Set EP_IndexMax = (EP_IndexMax + 1)
-
Set EP_Caster[EP_IndexMax] = (Triggering unit)
-
Set EP_Point[1] = (Position of EP_Caster[EP_IndexMax])
-
Set EP_Point[2] = (Target point of ability being cast)
-
Set EP_Angle[EP_IndexMax] = (Angle from EP_Point[1] to EP_Point[2])
-
Set EP_DistanceCurrent[EP_IndexMax] = 0.00
-
Set EP_Level = (Level of EP_ConfAbility for EP_Caster[EP_IndexMax])
-
Set EP_AoE[EP_IndexMax] = EP_ConfAoE[EP_Level]
-
Set EP_Damage[EP_IndexMax] = EP_ConfDamage[EP_Level]
-
Set EP_Duration[EP_IndexMax] = EP_ConfDuration[EP_Level]
-
Set EP_ExplodeSize[EP_IndexMax] = EP_ConfImpactSfxSize[EP_Level]
-
Set EP_MissileSpeed[EP_IndexMax] = EP_ConfMissileSpeed[EP_Level]
-
Set EP_DistanceMax[EP_IndexMax] = EP_ConfDistanceMax[EP_Level]
-
Unit - Create 1 EP_ConfDummy for (Owner of EP_Caster[EP_IndexMax]) at EP_Point[1] facing EP_Angle[EP_IndexMax] degrees
-
Set EP_Missile[EP_IndexMax] = (Last created unit)
-
Set EP_SfxTimer[EP_IndexMax] = EP_ConfCrackSfxDelay
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
EP_IndexMax Equal to 1
-
-
Then - Actions
-
Trigger - Turn on EP Loop <gen>
-
-
Else - Actions
-
-
Custom script: call RemoveLocation(udg_EP_Point[1])
-
Custom script: call RemoveLocation(udg_EP_Point[2])
-
-
-
EP Loop
-
Events
-
Time - Every 0.03 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer EP_Loop) from 1 to EP_IndexMax, do (Actions)
-
Loop - Actions
-
Custom script: set udg_EP_X = GetUnitX(udg_EP_Missile[udg_EP_Loop]) + udg_EP_MissileSpeed[udg_EP_Loop] * Cos(udg_EP_Angle[udg_EP_Loop] * bj_DEGTORAD)
-
Custom script: set udg_EP_Y = GetUnitY(udg_EP_Missile[udg_EP_Loop]) + udg_EP_MissileSpeed[udg_EP_Loop] * Sin(udg_EP_Angle[udg_EP_Loop] * bj_DEGTORAD)
-
Custom script: call SetUnitX(udg_EP_Missile[udg_EP_Loop], udg_EP_X)
-
Custom script: call SetUnitY(udg_EP_Missile[udg_EP_Loop], udg_EP_Y)
-
Set EP_Point[3] = (Point(EP_X, EP_Y))
-
Set EP_DistanceCurrent[EP_Loop] = (EP_DistanceCurrent[EP_Loop] + EP_MissileSpeed[EP_Loop])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
EP_SfxTimer[EP_Loop] Greater than 0.00
-
-
Then - Actions
-
Set EP_SfxTimer[EP_Loop] = (EP_SfxTimer[EP_Loop] - 0.03)
-
-
Else - Actions
-
Set EP_SfxTimer[EP_Loop] = EP_ConfCrackSfxDelay
-
Special Effect - Create a special effect at EP_Point[3] using EP_ConfCrackSfx
-
Special Effect - Destroy (Last created special effect)
-
-
-
Set EP_DetectGroup = (Units within EP_ConfHitRadius of EP_Point[3] matching ((((Matching unit) belongs to an enemy of (Owner of EP_Caster[EP_Loop])) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((((Matching unit) is A structure) Equal to True) or (((Matchin
-
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 EP_DetectGroup) Greater than 0
-
EP_DistanceCurrent[EP_Loop] Greater than or equal to EP_DistanceMax[EP_Loop]
-
-
-
-
Then - Actions
-
Animation - Change EP_Missile[EP_Loop]'s size to (EP_ExplodeSize[EP_Loop]%, EP_ExplodeSize[EP_Loop]%, EP_ExplodeSize[EP_Loop]%) of its original size
-
Special Effect - Create a special effect attached to the chest of EP_Missile[EP_Loop] using EP_ConfImpactSfx
-
Special Effect - Destroy (Last created special effect)
-
Unit - Add a EP_ConfMissileTimer second Generic expiration timer to EP_Missile[EP_Loop]
-
Set EP_DamageGroup = (Units within EP_AoE[EP_Loop] of EP_Point[3])
-
Unit Group - Pick every unit in EP_DamageGroup and do (Actions)
-
Loop - Actions
-
Set EP_Target = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(EP_Target is alive) Equal to True
-
(EP_Target belongs to an enemy of (Owner of EP_Caster[EP_Loop])) Equal to True
-
(EP_Target is in KB_Group) Equal to False
-
Or - Any (Conditions) are true
-
Conditions
-
(EP_Target is A ground unit) Equal to True
-
(EP_Target is A structure) Equal to True
-
-
-
-
Then - Actions
-
Set EP_Point[4] = (Position of EP_Target)
-
Set EP_Range = (Distance between EP_Point[3] and EP_Point[4])
-
Set EP_DealtDamage = (EP_Damage[EP_Loop] - (EP_Damage[EP_Loop] x ((EP_Range / EP_AoE[EP_Loop]) x EP_ConfDamageRangeFactor)))
-
Custom script: call UnitDamageTargetBJ( udg_EP_Caster[udg_EP_Loop], udg_EP_Target, udg_EP_DealtDamage, ConvertAttackType(udg_EP_ConfAttackType), DAMAGE_TYPE_NORMAL )
-
Custom script: if UnitAddAbility(udg_EP_Target,'Amrf') and UnitRemoveAbility(udg_EP_Target,'Amrf') then
-
Custom script: endif
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(EP_Target is A structure) Equal to False
-
(EP_Target is Mechanical) Equal to False
-
-
Then - Actions
-
Set KB_IndexMax = (KB_IndexMax + 1)
-
Set KB_Unit[KB_IndexMax] = EP_Target
-
Set KB_DistanceCurrent[KB_IndexMax] = 0.00
-
Set KB_DistanceMax[KB_IndexMax] = EP_Range
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
KB_DistanceMax[KB_IndexMax] Less than 25.00
-
-
Then - Actions
-
Set KB_DistanceMax[KB_IndexMax] = 25.00
-
-
Else - Actions
-
-
Set KB_MaxHeight[KB_IndexMax] = ((EP_AoE[EP_Loop] - KB_DistanceMax[KB_IndexMax]) x EP_ConfKBHeightMultiplier)
-
Set KB_Angle[KB_IndexMax] = (Angle from EP_Point[3] to EP_Point[4])
-
Set KB_Speed[KB_IndexMax] = (((3.00 x KB_DistanceMax[KB_IndexMax]) - 200.00) / 100.00)
-
Set KB_Speed[KB_IndexMax] = (KB_Speed[KB_IndexMax] x EP_ConfKBSpeedMultiplier)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
KB_Speed[KB_IndexMax] Less than 1.00
-
-
Then - Actions
-
Set KB_Speed[KB_IndexMax] = 1.00
-
-
Else - Actions
-
-
Unit - Turn collision for KB_Unit[KB_IndexMax] Off
-
Unit Group - Add EP_Target to KB_Group
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
KB_IndexMax Equal to 1
-
-
Then - Actions
-
Trigger - Turn on KB Loop <gen>
-
-
Else - Actions
-
-
Set ST_IndexMax = (ST_IndexMax + 1)
-
Set ST_Unit[ST_IndexMax] = EP_Target
-
Set ST_Duration[ST_IndexMax] = (EP_Duration[EP_Loop] - (EP_Duration[EP_Loop] x ((EP_Range / EP_AoE[EP_Loop]) x EP_ConfStunRangeFactor)))
-
Unit - Remove EP_ConfStunBuff buff from ST_Unit[ST_IndexMax]
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ST_IndexMax Equal to 1
-
-
Then - Actions
-
Unit - Create 1 EP_ConfStunner for Neutral Hostile at EP_Point[4] facing (Random angle) degrees
-
Set ST_Stunner = (Last created unit)
-
Unit - Add EP_ConfStunAbility to ST_Stunner
-
Trigger - Turn on ST Loop <gen>
-
-
Else - Actions
-
-
-
Else - Actions
-
-
Custom script: call RemoveLocation(udg_EP_Point[4])
-
-
Else - Actions
-
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
EP_Loop Not equal to EP_IndexMax
-
-
Then - Actions
-
Set EP_Angle[EP_Loop] = EP_Angle[EP_IndexMax]
-
Set EP_AoE[EP_Loop] = EP_AoE[EP_IndexMax]
-
Set EP_Caster[EP_Loop] = EP_Caster[EP_IndexMax]
-
Set EP_Damage[EP_Loop] = EP_Damage[EP_IndexMax]
-
Set EP_DistanceCurrent[EP_Loop] = EP_DistanceCurrent[EP_IndexMax]
-
Set EP_DistanceMax[EP_Loop] = EP_DistanceMax[EP_IndexMax]
-
Set EP_Duration[EP_Loop] = EP_Duration[EP_IndexMax]
-
Set EP_ExplodeSize[EP_Loop] = EP_ExplodeSize[EP_IndexMax]
-
Set EP_Missile[EP_Loop] = EP_Missile[EP_IndexMax]
-
Set EP_MissileSpeed[EP_Loop] = EP_MissileSpeed[EP_IndexMax]
-
Set EP_SfxTimer[EP_Loop] = EP_SfxTimer[EP_IndexMax]
-
-
Else - Actions
-
-
Set EP_Caster[EP_IndexMax] = No unit
-
Set EP_Missile[EP_IndexMax] = No unit
-
Set EP_IndexMax = (EP_IndexMax - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
EP_IndexMax Equal to 0
-
-
Then - Actions
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
Set EP_Loop = (EP_Loop - 1)
-
-
-
Custom script: call DestroyGroup(udg_EP_DamageGroup)
-
-
Else - Actions
-
-
Custom script: call DestroyGroup(udg_EP_DetectGroup)
-
Custom script: call RemoveLocation(udg_EP_Point[3])
-
-
-
-
-
KB Loop
-
Events
-
Time - Every 0.03 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer KB_Loop) from 1 to KB_IndexMax, do (Actions)
-
Loop - Actions
-
Custom script: set udg_KB_X = GetUnitX(udg_KB_Unit[udg_KB_Loop]) + udg_KB_Speed[udg_KB_Loop] * Cos(udg_KB_Angle[udg_KB_Loop] * bj_DEGTORAD)
-
Custom script: set udg_KB_Y = GetUnitY(udg_KB_Unit[udg_KB_Loop]) + udg_KB_Speed[udg_KB_Loop] * Sin(udg_KB_Angle[udg_KB_Loop] * bj_DEGTORAD)
-
Custom script: call SetUnitX(udg_KB_Unit[udg_KB_Loop], udg_KB_X)
-
Custom script: call SetUnitY(udg_KB_Unit[udg_KB_Loop], udg_KB_Y)
-
Unit - Order KB_Unit[KB_Loop] to Stop
-
Set KB_DistanceCurrent[KB_Loop] = (KB_DistanceCurrent[KB_Loop] + KB_Speed[KB_Loop])
-
Set KB_FlyHeight = (((4.00 x KB_MaxHeight[KB_Loop]) / KB_DistanceMax[KB_Loop]) x ((KB_DistanceMax[KB_Loop] - KB_DistanceCurrent[KB_Loop]) x (KB_DistanceCurrent[KB_Loop] / KB_DistanceMax[KB_Loop])))
-
Animation - Change KB_Unit[KB_Loop] flying height to KB_FlyHeight at 0.00
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
KB_FlyHeight Less than or equal to 5.00
-
-
Then - Actions
-
Special Effect - Create a special effect attached to the EP_ConfKBSfxPoint of KB_Unit[KB_Loop] using EP_ConfKBSfx
-
Special Effect - Destroy (Last created special effect)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
KB_DistanceCurrent[KB_Loop] Greater than or equal to KB_DistanceMax[KB_Loop]
-
-
Then - Actions
-
Unit - Turn collision for KB_Unit[KB_Loop] On
-
Unit Group - Remove KB_Unit[KB_Loop] from KB_Group
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
EP_Loop Not equal to EP_IndexMax
-
-
Then - Actions
-
Set KB_Angle[KB_Loop] = KB_Angle[KB_IndexMax]
-
Set KB_DistanceCurrent[KB_Loop] = KB_DistanceCurrent[KB_IndexMax]
-
Set KB_DistanceMax[KB_Loop] = KB_DistanceMax[KB_IndexMax]
-
Set KB_MaxHeight[KB_Loop] = KB_MaxHeight[KB_IndexMax]
-
Set KB_Unit[KB_Loop] = KB_Unit[KB_IndexMax]
-
Set KB_Speed[KB_Loop] = KB_Speed[KB_IndexMax]
-
-
Else - Actions
-
-
Set KB_Unit[KB_IndexMax] = No unit
-
Set KB_IndexMax = (KB_IndexMax - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
KB_IndexMax Equal to 0
-
-
Then - Actions
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
Set KB_Loop = (KB_Loop - 1)
-
-
-
-
Else - Actions
-
-
-
-
-
-
ST Loop
-
Events
-
Time - Every 0.03 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer ST_Loop) from 1 to ST_IndexMax, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(ST_Unit[ST_Loop] has buff EP_ConfStunBuff) Equal to False
-
-
Then - Actions
-
Unit - Order ST_Stunner to Human Mountain King - Storm Bolt ST_Unit[ST_Loop]
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ST_Duration[ST_Loop] Greater than 0.00
-
-
Then - Actions
-
Set ST_Duration[ST_Loop] = (ST_Duration[ST_Loop] - 0.03)
-
-
Else - Actions
-
Unit - Remove EP_ConfStunBuff buff from ST_Unit[ST_Loop]
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ST_Loop Not equal to ST_IndexMax
-
-
Then - Actions
-
Set ST_Duration[ST_Loop] = ST_Duration[ST_IndexMax]
-
Set ST_Unit[ST_Loop] = ST_Unit[ST_IndexMax]
-
-
Else - Actions
-
-
Set ST_Unit[ST_IndexMax] = No unit
-
Set ST_IndexMax = (ST_IndexMax - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
ST_IndexMax Equal to 0
-
-
Then - Actions
-
Unit - Remove ST_Stunner from the game
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
Set ST_Loop = (ST_Loop - 1)
-
-
-
-
-
-
-
-
Attachments
Last edited by a moderator: