• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to..

Status
Not open for further replies.
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

Well you should explain a bit more about your random system you want use.
But in many cases you store all heroes into a variable and use the random int check:

JASS:
function x takes nothing returns nothing
    local integer i = GetRandomInt(1,100)
    
    if i == 1 then
        // first champ
    elseif i == 2 then
        // second champ
    elseif i == 3 then
        // third chamo
    elseif
    // and so on
endfunction
[I don't know the GUI way anymore]

Well and item drops on neutral units when they die or when? You can use item tables for it.

Greetings and Peace
Dr. Boom
 
Level 11
Joined
Nov 15, 2007
Messages
800
to make neutrals drop items select a neutral in the editor and press enter then go to item table

Won't work for units that are created via triggers or respawn.

The common GUI method is to use a bunch of if/then/else checks when a unit dies, but itempools are easy to learn and a lot less time consuming to use.
 
Level 4
Joined
Aug 5, 2011
Messages
99
add something like this on init
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set random_heroes[1] = Paladin
      • Set random_heroes[2] = Archmage
      • Set random_heroes[3] = Mountain King
      • Set random_heroes[4] = Blood Mage
      • Set numberOfHeroes = 4
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Trigger - Add to random <gen> the event (Player - (Player((Integer A))) types a chat message containing -random as An exact match)
and this to get the hero
  • random
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) Current gold) Greater than or equal to 500
        • Then - Actions
          • Unit - Create 1 random_heroes[(Random integer number between 1 and numberOfHeroes)] for (Triggering player) at (Center of (Playable map area)) facing Default building facing degrees
  • Player - Add -500 to (Triggering player) Current gold
    • Else - Actions
 
Status
Not open for further replies.
Top