Random hero

saickododge

New Member
Reaction score
2
Ok, I have an altar with 11 heroes. Sometimes its hard to choose, so (as many other games has) I want to have the last slot in the altar to pick a Random hero of the 11 heroes there are. Can someone please help me with this? Thank you!
 

foodflare

You can change this now in User CP.
Reaction score
32
make it sell a dummy unit with the tooltips set so that it says its random,set all your heroes to a unit-type array at map initialization and have a trigger go

Code:
Random Hero
    Events
        Unit - A unit Sells a unit
    Conditions
        (Unit-type of (Sold unit)) Equal to RHDummy
    Actions
        Set Temp_Point = (*your hero placement location*)
        Unit - Create 1 Hero_Types[(Random integer number between 1 and 11)] for (Owner of (Sold unit)) at Temp_Point facing Default building facing degrees
        Custom script:   call RemoveLocation (udg_Temp_Point)
        Unit - Remove (Sold unit) from the game
Hero_Types = Unit-type array
Temp_Point = point to not have leaks
RHDummy = the dummy unit sold so that it creates your random heroes
 

adeoin

Member
Reaction score
11
u can do this...
JASS:
Event-Elasped Game time is x seconds
Condition- None
Action- Add Unit type (your hero here) to variable random_choose


2nd trigger.
JASS:
 Event- A unit sells a unit
 Condition- Unit Being Sold = Random
 Action- Pick 1 Random Unit From Variable  random_choose and do create picked unit for owner of buying unit at region blah.
Remove Buying unit from game.


this should work, it was hand written so look for something similar. i dont have We with me right now.
 
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