Trigger Help - Boss dies, send unit to certain area and drop certain item

keeper77

New Member
Reaction score
3
Well, I have been trying many methods of creating a trigger for this event.

-A boss dies
-Send all units to certain region (player different (ex: red goes to x1, blue goes to x2, etc))
-Create a Random Number for the item drop (also differing with player (ex: the random integer isn't the same for everyone)

I currently have a trigger set in mind, however it is extremely long, and I was just wondering if there was a simpler way to accomplish this task. If you can help it, however, please try to limit custom script, as I am not too good in that area. However, if custom script is required, then go for it. Thank you :D
 

Moridin

Snow Leopard
Reaction score
144
Quite simple using a for loop.

Variables:
Random[] -> Is an Integer array with 12/13 size.
Region[] -> Is a Region array with 12/13 size.

Trigger:

Trigger:
  • Boss Death
    • Events
      • Unit - A unit dies
    • Conditions
      • (Triggering unit) Equal to Boss
    • Actions
      • For Integer A from 1 to 12 do (multiple actions)
        • Loop - Actions
          • Unit Group - Pick (All units owned by (Player[Integer A])) and do Unit - Move (Picked unit) instantly to Region[Integer A]
          • Set Random[Integer A] = Random number from 1 to <Whatever>


Notes:
* You will need to set the 12 seperate regions into the Region[] array.
* The <Whatever> indicates the dice roll. EX: 1 to 6 means he rolls a 6 sided dice.
 

Tru_Power22

You can change this now in User CP.
Reaction score
144
Initializes the regions to make the rest of the code shorter.

Trigger:
  • Region Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Lewt_Region[1] = Player one&#039;s loot region
      • Set Lewt_Region[2] = Player two&#039;s loot region
      • Set Lewt_Region[3] = Player three&#039;s loot region
      • Set Lewt_Region[4] = etc.
      • Set Lewt_Region[5] = etc.
      • Set Lewt_Region[6] = etc.
      • Set Lewt_Region[7] = etc.
      • Set Lewt_Region[8] = etc.
      • Set Lewt_Region[9] = etc.
      • Set Lewt_Region[10] = etc.
      • Set Lewt_Region[11] = etc.
      • Set Lewt_Region[12] = etc.


When you kill the boss.

Trigger:
  • Bossdies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to The Dying boss
    • Actions
      • Set TempPoint = (Position of (Dying unit))
      • Set TempGroup = (Units within 1000.00 of TempPoint matching (((Matching unit) is A Hero) Equal to True))
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set TempPoint = (Center of Lewt_Region[(Player number of (Owner of (Picked unit)))])
          • Unit - Move (Picked unit) instantly to TempPoint
          • Custom script: call RemoveLocation (udg_TempPoint)
          • Set Item_Drop[(Player number of (Owner of (Picked unit)))] = (Random integer number between 1 and whatever.)


Then you can create items for the heroes based on the number that was picked.

Moridin's trigger is simpler but, his leaks 12 points and 12 unit groups. Not to mention calls a loop than can have any number of units in it, from a loop that been done 12 times. It's inefficient.
 
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