• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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