- Joined
- Jan 19, 2009
- Messages
- 27
Hey everyone, I'm trying to make lightning shield - like ability, but I need it do deal damage only to enemies, so I had to use triggers... However, each time I cast it ingame, the game crashes. I realised that the problem is in second trigger. Here are triggers
Lightning Shield Cast
Lightning Shield Cast
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Lightning Shield
-
Actions
- Set LSUnit[(Player number of (Owner of (Triggering unit)))] = (Target unit of ability being cast)
- Unit Group - Add LSUnit[(Player number of (Owner of (Triggering unit)))] to LSGroup
- Hashtable - Create a hashtable
- Set LSHash = (Last created hashtable)
- Hashtable - Save (Player number of (Owner of (Triggering unit))) as 0 of (Key (Target unit of ability being cast)) in LSHash
- Wait until ((LSUnit[(Player number of (Owner of (Triggering unit)))] has buff Lightning Shield) Equal to True), checking every 0.10 seconds
- Unit Group - Remove LSUnit[(Player number of (Owner of (Triggering unit)))] from LSGroup
-
Events
- Time - Every 1.00 seconds of game time
-
Conditions
- (Number of units in LSGroup) Greater than 0
-
Actions
-
Unit Group - Pick every unit in LSGroup and do (Actions)
-
Loop - Actions
- Set Integer = (Key (Load 0 of (Key (Picked unit)) in LSHash))
- Set Point = (Position of (Picked unit))
- Set TempUnitGroup = (Units within 160.00 of Point 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 (Player(Integer))) Equal to True))))
- Custom script: call RemoveLocation(udg_Point)
-
Unit Group - Pick every unit in TempUnitGroup and do (Actions)
-
Loop - Actions
- Unit - Cause Hero[Integer] to damage (Picked unit), dealing (20.00 + (AbilityPower[Integer] x 0.33)) damage of attack type Spells and damage type Lightning
-
Loop - Actions
- Set Integer = 0
-
Loop - Actions
-
Unit Group - Pick every unit in LSGroup and do (Actions)