Lightning Shield with Triggers

dyablohunter

New Member
Reaction score
2
Simple question. Tricky answer.
I want a spell/ability like lightning shield but... I want it to only be able to damage enemy units within 200 yd of the unit that has lightning shield on it.
I know it's only possible with triggers but so far my triggers didnt work:
Code:
Lightning Shield Ally lvl 1
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Lightning Shield [Shaman]
        ((Casting unit) belongs to an ally of Player 1 (Red)) Equal to True
        (Level of Lightning Shield [Shaman] for (Casting unit)) Equal to 1
    Actions
        Set LightningShieldAlly = (Position of (Casting unit))
        Trigger - Run Ally Lightning Shield 75 dmg <gen> (checking conditions)
        Wait 15.00 game-time seconds
        Trigger - Turn off Ally Lightning Shield 75 dmg <gen>

The actual damaging:

Code:
Ally Lightning Shield 75 dmg
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in (Units within 200.00 of LightningShieldAlly matching (((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True)) and do (Actions)
            Loop - Actions
                Unit - Cause Intercept Dummy 1 0092 <gen> to damage (Picked unit), dealing 75.00 damage of attack type Spells and damage type Lightning


Can anybody help?
 
Reaction score
456
You could just use normal Lightning Shield spell, and remove "friend" from the "Stats - Targets Allowed" field.
 

darkRae

Ueki Fan (Ueki is watching you)
Reaction score
173
You're damaging units that are within 200.00 of Position of the Caster.
1) Shouldn't it be (Target of Ability Being Cast) ?
2) The position is fixed. What about if the unit moves?
3) That is definitely not MUI.
 

Frozenwind

System maker
Reaction score
99
  1. Make sure your spell is lvl1,
  2. add some "Game - Display Text to Force", like that you know wether your trigger actually runs.
    Place it:
    • be4 the wait
    • after the wait
    • in your periodic trigger outside loop
    • in your periodic trigger inside loop
Can't find a problem except for that it's totally non-MUI/MPI

frozenwind.
 

dyablohunter

New Member
Reaction score
2
You're damaging units that are within 200.00 of Position of the Caster.
1) Shouldn't it be (Target of Ability Being Cast) ?
2) The position is fixed. What about if the unit moves?
3) That is definitely not MUI.

The target of the spell never takes any damage from the actual spell, that is how it works. So that doesn't work.. if it were that simple I wouldn't have posted this problem.

**********************
So not MUI?

Ok, I am waiting for a JASS trigger or two than.. from the experts..
 

Frozenwind

System maker
Reaction score
99
frozenwind said:
1. Make sure your spell is lvl1,
2. add some "Game - Display Text to Force", like that you know wether your trigger actually runs.
Place it:
A. be4 the wait
B. after the wait
C. in your periodic trigger outside loop
D. in your periodic trigger inside loop
Do step2, I think it's your condition that doesn't return true, so place those "Display Text's" so you know where the problem is.

frozenwind.
 

vypur85

Hibernate
Reaction score
803
Code:
Lightning Shield Ally lvl 1
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Lightning Shield [Shaman]
        [B]((Casting unit) belongs to an ally of Player 1 (Red)) Equal to True
        (Level of Lightning Shield [Shaman] for (Casting unit)) Equal to 1[/B]
    Actions
        Set LightningShieldAlly = (Position of (Casting unit))
        [COLOR="Red"]Trigger - Run Ally Lightning Shield 75 dmg <gen> (checking conditions)[/COLOR]
        Wait 15.00 game-time seconds
        Trigger - Turn off Ally Lightning Shield 75 dmg <gen>
For the bolded text, i dont think those are very much necessary. For the red text, its supposed to be 'turn on trigger'. 'Run trigger' will only run the trigger ONCE. As for the rest, im not too sure how to answer because they are either preset units or you could have done them intentionally with specific purpose. Hope it helps :).
 

dyablohunter

New Member
Reaction score
2
I can't believe it was that simple... it was the "turn on" thingy. I was using "run trigger", It works like a charm now. thank you vypur85
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top