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

Item Drop Setup

Status
Not open for further replies.
Level 6
Joined
Apr 1, 2009
Messages
201
I have not tested this yet I just needed some feedback on what needs to be changed and if the drop percentages are correct. I've tested a similar system and it works fine. But you kill a certain unit and they have a chance to drop certain items. Example is footman, 1% of crown of kings, 25% of claws of attack, 75% chance nothing. Just be warned I am terrible at math and this is just an example that I will build off of. I hope this is in the right section also. (There can also be half values like 25.5% or 1.3%)

  • Example
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Set DyingUnit = (Position of (Triggering unit))
      • Set DropNumber = (Random real number between 0.00 and 100.00)
      • -------- ------ --------
      • -------- 1% Chance --------
      • -------- ------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DropNumber Greater than 0.00
          • DropNumber Less than or equal to 1.00
        • Then - Actions
          • Item - Create Crown of Kings +5 at DyingUnit
          • Custom script: call RemoveLocation(udg_DyingUnit)
        • Else - Actions
      • -------- ------ --------
      • -------- 25% Chance --------
      • -------- ------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DropNumber Greater than 1.00
          • DropNumber Less than or equal to 25.00
        • Then - Actions
          • Item - Create Claws of Attack +15 at DyingUnit
          • Custom script: call RemoveLocation(udg_DyingUnit)
        • Else - Actions
      • -------- ------ --------
      • -------- 75% --------
      • -------- ------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DropNumber Greater than 25.00
          • DropNumber Less than or equal to 100.00
        • Then - Actions
          • Custom script: call RemoveLocation(udg_DyingUnit)
        • Else - Actions
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Chances are nearly correct. You should use 1.01 ~ 25.00 and 25.01 to 100.00. Using integers is a bit better.

The problem comes when you have several units (lets say, 30) and a Trigger for each unit to drop several items. That's a lot of coding, triggers, and stuff, and it can be a lot easier.

There's a Drop system made by Adiktuz in Spell section that's pretty easy to use.
 
Level 6
Joined
Apr 1, 2009
Messages
201
Thank you for correcting the chances. I honestly don't mind making 40-50 triggers for that many units. How would I do something like 25.7% chance? That's why I used real. Would it be 1-25.7 or 1-25.07 or would it be something else?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Why? You just place the number of drops the unit has, and set the chance for each one of them. It's way better, easier, faster and smoother, and efficient than creating 1 trigger with long If/Then/Else chains and Real comparisons to check the itemdrop chance :p
 
Status
Not open for further replies.
Top