Rage

hopy

Active Member
Reaction score
64
I wanted to make an ability that would make a unit go beserk, be uncontrolable and attack random units in sight ... so far it is kinda failing...

Trigger:
  • Anger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Anger [Mediator]
    • Actions
      • Set An_Unit = (Target unit of ability being cast)
      • Set An_Point = (Position of An_Unit)
      • Unit - Create 1 Dummy Unit for (Owner of An_Unit) at An_Point facing Default building facing degrees
      • Unit - Add Anger [Dummy] to (Last created unit)
      • Unit - Set level of Anger [Dummy] for (Last created unit) to (Level of Anger [Mediator] for (Triggering unit))
      • Unit - Order (Last created unit) to Orc Shaman - Bloodlust An_Unit
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Set An_Unit_Group = (Units within 300.00 of An_Point matching ((((Unit-type of (Matching unit)) Not equal to Dummy Unit [Anti Magic Field]) and ((Unit-type of (Matching unit)) Not equal to Dummy Unit)) and (((Unit-type of (Matching unit)) Not equal to Dummy Unit [Veng]) and ((Ow
      • Set Tr_Unit_Group = (Random 1 units from An_Unit_Group)
      • Unit Group - Pick every unit in Tr_Unit_Group and do (Actions)
        • Loop - Actions
          • Unit - Order An_Unit to Attack (Picked unit)
      • Custom script: call DestroyGroup (udg_Tr_Unit_Group)
      • For each (Integer A) from 1 to (4 + (Level of Anger [Mediator] for (Triggering unit))), do (Actions)
        • Loop - Actions
          • Wait 1.50 game-time seconds
          • Set An_Point = (Position of An_Unit)
          • Set An_Unit_Group = (Units within 300.00 of An_Point matching ((((Unit-type of (Matching unit)) Not equal to Dummy Unit [Anti Magic Field]) and ((Unit-type of (Matching unit)) Not equal to Dummy Unit)) and (((Unit-type of (Matching unit)) Not equal to Dummy Unit [Veng]) and ((Ow
          • Set Tr_Unit_Group = (Random 1 units from An_Unit_Group)
          • Unit Group - Pick every unit in Tr_Unit_Group and do (Actions)
            • Loop - Actions
              • Unit - Order An_Unit to Attack (Picked unit)
          • Custom script: call DestroyGroup (udg_Tr_Unit_Group)
      • Custom script: call RemoveLocation (udg_An_Point)
      • Custom script: call DestroyGroup (udg_An_Unit_Group)


An_Unit is a Unit variable
An_Point is a Point Variable
An_Unit_Group and Tr_Unit_Group are Unit group variable
Anger [dummy] is a an ability based on Bloodlust with 5 levels and 9+3xlvl duration or so

I also have a different trigger that removes the unit from selection all the time to prevent the player from giving orders ...

The problem here is the debuff disapears and the target unit only attacks a random unit once and afther that just acts normaly.

Can someone tell me why this happens or if there's a better way of getting this ability working.
 

nandosman

New Member
Reaction score
4
mmm i made this spell from the begining and it works fine for me...

Trigger:
  • Anger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Anger
    • Actions
      • Set Angry_Unit = (Target unit of ability being cast)
      • Set Angry_Loc = (Position of Angry_Unit)
      • Unit - Create 1 Dummy for (Owner of Angry_Unit) at Angry_Loc facing Default building facing degrees
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Anger (Dummy) to (Last created unit)
      • Unit - Set level of Anger (Dummy) for (Last created unit) to (Level of Anger for (Triggering unit))
      • Unit - Order (Last created unit) to Orc Shaman - Bloodlust Angry_Unit
      • For each (Integer A) from 1 to (((Level of Anger for (Triggering unit)) + 1) x 5), do (Actions)
        • Loop - Actions
          • Set Angry_Group = (Units within 700.00 of Angry_Loc matching ((((Matching unit) is A structure) Not equal to True) and (((Matching unit) Not equal to Angry_Unit) and ((Unit-type of (Matching unit)) Not equal to Dummy))))
          • Unit Group - Pick every unit in Angry_Group and do (Actions)
            • Loop - Actions
              • Set Random_Unit = (Random 1 units from Angry_Group)
              • Unit Group - Pick every unit in Random_Unit and do (Unit - Order Angry_Unit to Attack (Picked unit))
              • Custom script: call DestroyGroup( udg_Random_Unit )
          • Custom script: call DestroyGroup( udg_Angry_Group )
          • Wait 1.00 seconds
      • Custom script: call RemoveLocation( udg_Angry_Loc )
      • Unit - Order Angry_Unit to Stop


Here, take the test map i used
 

Attachments

  • BERSERK.w3x
    15.1 KB · Views: 104
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