- Joined
- Feb 26, 2005
- Messages
- 210
I have a spell that takes up four triggers. It works 100% correctly but I know if I use JASS I could probably make it just one trigger.
The spell is called "Cry of the Undead". It animates all dead units in an area around the Hero but if the caster stops channleing for any reason the animated units are destroyed. Here are the triggers:
The spell is called "Cry of the Undead". It animates all dead units in an area around the Hero but if the caster stops channleing for any reason the animated units are destroyed. Here are the triggers:
-
Cry of the Undead
-
Events
- Unit - A unit Begins channeling an ability
-
Conditions
- (Ability being cast) Equal to Cry of the Undead
-
Actions
- Set L = (Position of (Casting unit))
- Unit - Create 1 DoorMan for (Owner of (Casting unit)) at L facing Default building facing degrees
- Unit - Add Animate Dead * to (Last created unit)
- Unit - Set level of Animate Dead * for (Last created unit) to (Level of (Ability being cast) for (Casting unit))
- Unit - Set the custom value of (Last created unit) to V
- Set V = (V + 1)
- Set Summoner[(Custom value of (Last created unit))] = (Casting unit)
- Custom script: call RemoveLocation(udg_L)
-
Events
-
Summon Deadling
-
Events
- Time - Every 1.00 seconds of game time
- Conditions
-
Actions
- Set G = (Units in (Entire map) matching ((Unit-type of (Matching unit)) Equal to DoorMan))
-
Unit Group - Pick every unit in G and do (Actions)
-
Loop - Actions
- Unit - Order (Picked unit) to Undead Death Knight - Animate Dead
-
Loop - Actions
- Custom script: call DestroyGroup(udg_G)
-
Events
-
Deadling Summoned
-
Events
- Unit - A unit Spawns a summoned unit
-
Conditions
- ((Summoned unit) has buff Deadel) Equal to True
-
Actions
- Unit - Remove classification of A sapper from (Summoned unit)
- Unit - Set the custom value of (Summoned unit) to V
- Set V = (V + 1)
- Set Summoner[(Custom value of (Summoned unit))] = Summoner[(Custom value of (Summoning unit))]
-
Events
-
Stop Channleing
-
Events
- Unit - A unit Stops casting an ability
-
Conditions
- (Ability being cast) Equal to Cry of the Undead
-
Actions
- Set G = (Units owned by (Owner of (Casting unit)) matching (((Unit-type of (Matching unit)) Equal to DoorMan) or (((Matching unit) has buff Deadel) Equal to True)))
- Unit Group - Pick every unit in G and do (Custom script: call KillSummonedUnit(GetEnumUnit(), GetSpellAbilityUnit()))
- Custom script: call DestroyGroup(udg_G)
-
Events
JASS:
function KillSummonedUnit takes unit summoned, unit summoner returns nothing
if udg_Summoner[GetUnitUserData(summoned)] == summoner then
call KillUnit(summoned)
endif
endfunction
Last edited: