• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[Trigger] Losing control of unit for a short period of time?

Status
Not open for further replies.
Level 6
Joined
Apr 23, 2009
Messages
94
  • Events
    • Time - Every 3.00 seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in (Units within 350.00 of FEARTRAP matching (((Owner of (Matching unit)) is an enemy of Player 1 (Red)) Equal to True)) and do (Actions)
      • Loop - Actions
        • Set loc = (Position of (Picked unit))
        • Unit - Order (Picked unit) to Move To (loc offset by (-300.00, (Facing of (Picked unit))))
I'm trying to make it so that when the unit gets "Feared" you can't control it for about 3 seconds, and maybe adding a buff on the Feared units if possible.
I don't know.
 
Level 7
Joined
Dec 3, 2008
Messages
189
  • Events
    • Time - Every 3.00 seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in (Units within 350.00 of FEARTRAP matching (((Owner of (Matching unit)) is an enemy of Player 1 (Red)) Equal to True)) and do (Actions)
      • Loop - Actions
        • Set loc = (Position of (Picked unit))
        • Unit - Order (Picked unit) to Move To (loc offset by (-300.00, (Facing of (Picked unit))))
I'm trying to make it so that when the unit gets "Feared" you can't control it for about 3 seconds, and maybe adding a buff on the Feared units if possible.
I don't know.

So why you don't only switch Unit-Owner from Player X to Neutral Player or Player 12 or whatever?
 
Level 5
Joined
Apr 21, 2006
Messages
82
Ah i have used an AoE fear spell in my map i used it like this way:

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Howl of Terror
  • Actions
    • Set HowlofTerrorPoint = (Position of (Casting Unit))
    • Region - Center HowlofTerrorGroup on HowlofTerrorPoint
    • Comment - HowlofTerrorGroup is a rather huge region used for ordering the units.
    • Unit - Create 1 Dummy (Modified Silence) for (Owner of (Casting Unit)) at HowlofTerrorPoint facing Default building degrees
    • Set Dummy = (Last created unit)
    • Unit - Set level of Disable for Dummy to (Level of Howl of Terror For (Casting unit))
    • Comment - Disable ability is made from silence, the AoE needs to be same with the Howl of Terror's AoE so it won't disable unnecessary units (It disables melee/ranged/spells/specials)
    • Unit - Order Dumym to Neutral Dark Ranger - Silence HowlofTerrorPoint
    • Unit - Remove Dummy from the game
    • Set HoTGroup = (Units within 525.00 of HowlofTerrorPoint matching (((Matching unit ) has buff Fear) Equal to True))
  • Comment - The buff is from the Howl of Terror or from the silence and the range should not be less than the max AoE on the spells.
    • Trigger - Run Fleeing in Terror <gen> (Checking conditions)
  • Countdown Timer - Start HowlOfTerrorTimer as a Reapeating timer that will expire in 2 seconds.
    • Custom Script: call RemoveLocation(udg_HowlofTerrorPoint)

  • Events
    • Time - HowlOfTerrorTimer expires
  • Actions
    • Unit Group - Pick every unit in HoTGroup and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Picked unit) has buff Fear) Equal to True
          • Then - Actions
            • Set HowlofTerrorPoint = (Random point in HowlofTerrorGroup)
            • Unit - Order (Picked unit) to Move To HowlofTerrorPoint
            • Custom script: call RemoveLocation(udg_HowlofTerrorPoint)
          • Else - Actions
            • Custom script: call DestroyGroup(udg_HoTGroup)
            • Countdown Timer - Pause HowlOfTerrorTimer
That has been working pretty fine with me. it orders every 2 seconds the unit to go somewhere in the region.
And i think changing to Neutral Hostile wouldn't be that bad idea? you just need to detect into a variable what unit belongs to what player and then when the buff is worn off it changes the ownership back to real owner.

Note: i use this trigger on my campaign so i made it only for single player, computers won't do much than run away with their unit when they cannot do anything else, but move.
 
Level 5
Joined
Apr 21, 2006
Messages
82
hey guys how do you put your trigger image in a reply?
(TRIGGER)
Events
Unit - Unit is attacked
Conditions
((Attacking unit) is equal to A Hero) Equal to True
Actions
Trigger - This is Trigger
(/TRIGGER)

you simply write them in a TRIGGER tag. Change the "(" with "[" and ")" with "]" so it becomes "[ TRIGGER ]" (without the spaces).

  • Events
    • Unit - Unit is attacked
  • Conditions
    • ((Attacking unit) is equal to A Hero) Equal to True
  • Actions
    • Trigger - This is Trigger
 
Status
Not open for further replies.
Top