• 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.

[Solved] Help tin Trigger

Status
Not open for further replies.
Level 6
Joined
Aug 10, 2010
Messages
77
Guys is possible to create this?.....

If Hero by player 1 kill for example golem....Reward cahnce will be: 25%-Fire item
25%-Ice item 25%-Plant Item 25%-Thunder Item. this is just example....
Or If unit enters region.Player 1 recieve reward:50% chance to legendary item 50%-receive nothing... This is just example :) ... I really need this in my maps... can someone help me? :) ...
 
Last edited:

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
1,993
if( random integer between 1 and 100 = 1) then do actions....
..ifelse( random integer between 1 and 100 <= 24) then do actions...
....ifelse( random integer between 1 and 100 <= 25) then do actions...
......if( random integer between 1 and 2 = 1) then do actions...(1st 25%)
........ifelse( random integer between 1 and 2 = 2) then do actions...(2nd 25%)
......else run this trigger again (or not)
 
Last edited:
Level 23
Joined
Apr 16, 2012
Messages
4,041
you should save the random integer to some variable so the value stays consistant, because if you generate new number every if block, you may generate 54 in the first one but 14 in the second one and while you really would get 54 so the third if block would run, in reality in this case nothing would run because there is nothing for <= 25
 

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
1,993
you should save the random integer to some variable so the value stays consistant*, because if you generate new number every if block, you may generate 54 in the first one but 14 in the second one and while you really would get 54 so the third if block would run, in reality in this case nothing would run because there is nothing for <= 25
*Constant. Yes, true
 
Status
Not open for further replies.
Top