Nether Ambush trigger help.

Father_Yetti

New Member
Reaction score
46
I have a Nether Revenant Hero in my game. His ult is Called Nether Ambush and it is suppose to spawn 3 replicas of him that last for 10 seconds each. They have the locust ability so you can't control them and I want them to attack the same units that the casting Hero targets. If he attacks no units that's fine they can attack at will, however, I want them to attack the targets the casting Hero chooses when he does. If they could follow him this would be nice too. I wasn't sure how many commands you can give and which ones overide others.

Nether Ambush Cast:
Trigger:
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Nether Ambush (Nether Revenant)
    • Actions
      • Set Nether_Caster = (Triggering unit)
      • Countdown Timer - Start Nether_Timer as a One-shot timer that will expire in 10.00 seconds
      • Set Nether_Timer = (Last started timer)
      • Trigger - Turn on Nether Timmer Expires <gen>
      • Trigger - Turn on Nether Attack Command <gen>
      • Trigger - Turn on Nether Ambush Trigger <gen>
      • Wait 10.00 seconds
      • Trigger - Turn off Nether Ambush Trigger <gen>


Nether Ambush Trigger:
Trigger:
  • Events
    • Time - Every 6.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Set Nether_CasterLoc = (Position of Nether_Caster)
          • Set TempPoint5 = (NetherStrike_CasterLoc offset by 200.00 towards ((120.00 x (Real((Integer A))))
          • Set NetherAmbush_Group = (Units within 400.00 of TempPoint5 matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) belongs to an enemy of (Owner of Nether_Caster)) Equal to True) and (((Matching unit) is alive) Equal to True))))
          • Unit Group - Pick every unit in NetherAmbush_Group and do (Actions)
            • Loop - Actions
              • Unit - Create 1 Nether Revenant (Dummy) for (Owner of Nether_Caster) at TempPoint5 facing Default building facing degrees
              • Set NetherDummy_Group = (Last created unit group)
              • Hero - Set (Last created unit) Hero-level to (Level of Nether_Caster), Show level-up graphics
              • Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
              • Unit - Order (Last created unit) to Attack (Picked unit)
          • Special Effect - Create a special effect at TempPoint5 using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at TempPoint5 using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation(udg_TempPoint5)
          • Custom script: call RemoveLocation(udg_Nether_CasterLoc)
          • Custom script: call DestroyGroup(udg_NetherAmbush_Group)


Nether Timmer Expires:
Trigger:
  • Events
    • Time - Nether_Timer expires
    • Conditions
    • Actions
      • Trigger - Turn off Nether Attack Command <gen>
      • Unit Group - Pick every unit in NetherDummy_Group and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game


Nether Attack Command:
Trigger:
  • Events
    • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to Nether_Caster
    • Actions
      • Set Nether_TargetUnit = (Attacked unit)
      • Unit Group - Pick every unit in NetherDummy_Group and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack Nether_TargetUnit


I have tried this like 5 different ways and I don't even think I am approaching it right or have gotten close. Its embarrasing I really don't quite know how to do this.
 

BarzahdX

Active Member
Reaction score
18
From the sounds of things, you want 3 units to follow you around, be unattackable, focus fire your target, and attack whoever if your main isn't doing anything.

You get all that and more if you use the "Locust Swarm" ability, give it a shot, and tell me how it goes.. If it doesn't work properly, I have a good idea for some triggering that should work.. Two ideas, actually, depending on how you want it to operate.
 

Dinowc

don't expect anything, prepare for everything
Reaction score
223
your loop in Nether Ambush trigger isn't kinda good...it wont create 3 replicas, it will create 1 replica for each picked unit
you made the triggers so unnecessary complicated...
 

Komaqtion

You can change this now in User CP.
Reaction score
469
@BarzahdX
But then they'll not attack his main target would they?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
I haven't tried is out but i think this should work, at least for making the revenants and ordering them to attack the main target:
Code:
Nether Ambush
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Nether Ambush
    Actions
        Set Caster = (Triggering unit)
        Trigger - Run Revenants <gen> (checking conditions)
        Trigger - Turn on Revenants Attacking <gen>
        Trigger - Turn on Caster Stops <gen>
        Wait 10.00 seconds
        Trigger - Turn off Revenants Attacking <gen>
        Trigger - Turn off Caster Stops <gen>
Code:
Revenants
    Events
    Conditions
    Actions
        Set Caster_Loc = (Position of Caster)
        Set Hero_Level = (Hero level of Caster)
        For each (Integer A) from 1 to 3, do (Actions)
            Loop - Actions
                Set Temp_Point = (Caster_Loc offset by 200.00 towards ((Real((Integer A))) x 120.00) degrees)
                Unit - Create 1 Revenant for (Owner of Caster) at Temp_Point facing Default building facing degrees
                Set Revenant_Dummy[(Integer A)] = (Last created unit)
                Hero - Set Revenant_Dummy[(Integer A)] Hero-level to Hero_Level, Hide level-up graphics
                Unit - Add a 10.00 second Generic expiration timer to Revenant_Dummy[(Integer A)]
        Trigger - Turn on (This trigger)
        Custom script:   call RemoveLocation(udg_Temp_Point)
        Custom script:   call RemoveLocation(udg_Caster Loc)
Code:
Revenants Attacking
    Events
        Unit - A unit Is attacked
    Conditions
        (Attacking unit) Equal to Caster
    Actions
        Set Main_Target = (Attacked unit)
        For each (Integer A) from 1 to 3, do (Actions)
            Loop - Actions
                Unit - Order Revenant_Dummy[(Integer A)] to Attack Main_Target
Code:
Caster Stops
    Events
        Unit - A unit Is issued an order with no target
    Conditions
        (Triggering unit) Equal to Caster
    Actions
        Custom Script. call bj_wantDestroyGroup=true // Sorry don't know if this is the right code.
        For each (Integer A) from 1 to 3, do (Actions)
            Loop - Actions
                Set Dummy_Loc = (Position of Revenant_Dummy[(Integer A)])
                Set Random_Group = (Units within 512.00 of Dummy_Loc matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is alive) Equal to True)))
                Unit Group - Pick every unit in (Random 1 units from Random_Group) and do (Actions)
                    Loop - Actions
                        Set Random_Target = (Picked unit)
                        Unit - Order Revenant_Dummy[(Integer A)] to Attack Random_Target
        Custom script:   call RemoveLocation(udg_Dummy_Loc)
 

BarzahdX

Active Member
Reaction score
18
From my experiences, they do attack your target. Try setting the "Swarm Maximum" or something like that to 100, or whatever the cap may be.

NOTE: Technically, with 3 units, the maximum would only have to be 3, but better safe than sorry.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
But i thought he wanted the Revenant to attack and stuff so it looks more real.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top