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

Change Unit chance

Status
Not open for further replies.
Level 5
Joined
Jun 21, 2011
Messages
119
Hellow The Hiveworkshop i need help with a trigger, spell and unit.

Main idea of the action is cast Cannibalizme by Ghoul and give him 1 : 10 chance to change him into another unit, for example Abomination.

Som1 could help?:ogre_love:
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
  • Cannibalism
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Cannibalism
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 10) Equal to 1
        • Then - Actions
          • Set Temp_Point = (Position of (Triggering unit))
          • Unit - Replace (Triggering unit) with a Abomination using The old unit's relative life and mana
          • Custom script: call RemoveLocation(udg_Temp_Point)
        • Else - Actions
@Spinnaker: thanks for correcting me, I didn't read properly. But why don't you type carefully? What is "ghul" and "cats"?
 
Last edited:
Level 33
Joined
Mar 27, 2008
Messages
8,035
For enumerating numbers, you should use Less than or equal to, like 5% chance like this

  • (Random integer number between 1 and 100) Less than or equal to 5
This trigger will pick random number between 1 to 5 (making it 5%)

If you use Equal to in this case, it will only become 1% of the time because it only picks number 5 out of 100.

Less than or equal to, next time for random chances, okay.

But if it's 1 to 10, it's okay to use Equal to 1 because 1 from 10 looks like 10% as we can divide it 1/10 = 0.1 = 10%

Careful use of Math and Computer Programming.
 
Status
Not open for further replies.
Top