- Joined
- Apr 12, 2011
- Messages
- 124
Got a trigger which i do not know how to make the Lightning effects get a lifespan(duration). I want them to last for 0.7 seconds but it doesn't seem to exist a premade option to do so.
I was wondering if anyone knew if you could do it in custom script and how.
(I got a feeling it can only be done in jass.)
Trigger:
Cast and Lightning
im new and have no experience what so ever, trial and error, that's how i learn. Tell me if i made anything fataly wrong (except Lightning, i know they will bug)

I was wondering if anyone knew if you could do it in custom script and how.
(I got a feeling it can only be done in jass.)
Trigger:
Cast and Lightning
-
Spell Effect
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-


(Ability being cast) Equal to Thunderstorm
-
-

Actions
-


Set LightningCount = 0
-


Set WS_Caster = (Casting unit)
-


Set WS_Point[1] = (Position of WS_Caster)
-


Set WS_Real = 0.00
-


For each (Integer WS_Integer) from 1 to 15, do (Actions)
-



Loop - Actions
-




Set WS_Point[3] = (WS_Point[1] offset by 500.00 towards WS_Real degrees)
-




Lightning - Create a Chain Lightning - Primary lightning effect from source WS_Point[1] to target WS_Point[3]
-




Set LightningCount = (LightningCount + 1)
-




Set WS_Lightning[LightningCount] = (Last created lightning effect)
-




Set WS_Point[2] = (WS_Point[1] offset by 300.00 towards WS_Real degrees)
-




Unit - Create 1 Dummy for (Owner of WS_Caster) at WS_Point[1] facing Default building facing degrees
-




Unit - Add Thunderstorm Dummy to (Last created unit)
-




Unit - Set level of Thunderstorm Dummy for (Last created unit) to (Level of Thunderstorm for WS_Caster)
-




Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm WS_Point[2]
-




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




Set WS_Real = (WS_Real + (360.00 / 15.00))
-




Custom script: call RemoveLocation(udg_WS_Point[2])
-




Custom script: call RemoveLocation(udg_WS_Point[3])
-
-
-


Set WS_Unitgroup = (Units within 500.00 of WS_Point[1] matching (((Matching unit) belongs to an enemy of (Owner of WS_Caster)) Equal to True))
-


Unit Group - Pick every unit in WS_Unitgroup and do (Actions)
-



Loop - Actions
-




Unit - Create 1 Dummy for (Owner of WS_Caster) at WS_Point[1] facing Default building facing degrees
-




Unit - Add Purge to (Last created unit)
-




Unit - Set level of Purge for (Last created unit) to (Level of Thunderstorm for WS_Caster)
-




Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
-




Unit - Order (Last created unit) to Orc Shaman - Purge (Picked unit)
-




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


Countdown Timer - Start Lightning as a One-shot timer that will expire in 0.70 seconds
-


Custom script: call DestroyGroup(udg_WS_Unitgroup)
-


Custom script: call RemoveLocation(udg_WS_Point[1])
-
-
-
Destroy Lightning
-

Events
-


Time - Lightning expires
-
-

Conditions
-

Actions
-


-------- im pretty sure this will leak if they cast with less than 0.7 sec in between --------
-



Lightning - Destroy WS_Lightning[LightningCount]
-
-


Custom script: call DestroyLightning(udg_WS_Lightning[1])
-


Custom script: call DestroyLightning(udg_WS_Lightning[2])
-


Custom script: call DestroyLightning(udg_WS_Lightning[3])
-


Custom script: call DestroyLightning(udg_WS_Lightning[4])
-


Custom script: call DestroyLightning(udg_WS_Lightning[5])
-


Custom script: call DestroyLightning(udg_WS_Lightning[6])
-


Custom script: call DestroyLightning(udg_WS_Lightning[7])
-


Custom script: call DestroyLightning(udg_WS_Lightning[8])
-


Custom script: call DestroyLightning(udg_WS_Lightning[9])
-


Custom script: call DestroyLightning(udg_WS_Lightning[10])
-


Custom script: call DestroyLightning(udg_WS_Lightning[11])
-


Custom script: call DestroyLightning(udg_WS_Lightning[12])
-


Custom script: call DestroyLightning(udg_WS_Lightning[13])
-


Custom script: call DestroyLightning(udg_WS_Lightning[14])
-


Custom script: call DestroyLightning(udg_WS_Lightning[15])
-
-
-
Damage Ticks
-

Events
-


Time - Every 1.00 seconds of game time
-
-

Conditions
-

Actions
-


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



If - Conditions
-




(Level of Thunderstorm for WS_Caster) Equal to 1
-
-



Then - Actions
-




Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Shock) Equal to True)) and do (Unit - Cause WS_Caster to damage (Picked unit), dealing 10.00 damage of attack type Spells and damage type Normal)
-




Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Shock) Equal to True)) and do (Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Orc\LightningShield\LightningShieldBuff.mdl)
-
-



Else - Actions
-
-


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



If - Conditions
-




(Level of Thunderstorm for WS_Caster) Equal to 2
-
-



Then - Actions
-




Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Shock) Equal to True)) and do (Unit - Cause WS_Caster to damage (Picked unit), dealing 15.00 damage of attack type Spells and damage type Normal)
-




Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Shock) Equal to True)) and do (Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Orc\LightningShield\LightningShieldBuff.mdl)
-
-



Else - Actions
-
-


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



If - Conditions
-




(Level of Thunderstorm for WS_Caster) Equal to 3
-
-



Then - Actions
-




Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Shock) Equal to True)) and do (Unit - Cause WS_Caster to damage (Picked unit), dealing 20.00 damage of attack type Spells and damage type Normal)
-




Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Shock) Equal to True)) and do (Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Orc\LightningShield\LightningShieldBuff.mdl)
-
-



Else - Actions
-
-
-
im new and have no experience what so ever, trial and error, that's how i learn. Tell me if i made anything fataly wrong (except Lightning, i know they will bug)

Last edited:






