warpten090 Simple Item Drop System

This bundle is marked as lacking. It fails to meet the standard requirements and may only have minor use.
- This system allows you to add loot for each unit-type !
- Useful for RPG map.




- Open World Editor - File - Preferences... - General Tab - Tick the Automatically create unknown variables while pasting trigger data
- Copy the 3 trigger need for the system to run

- YOU'RE DONE !

  • basic item setup
    • Events
    • Conditions
    • Actions
      • Set Variable Set allowMoreThanOneItemPerDrop = "false"
      • Set Variable Set itemcount = "2"
      • Set Variable Set itemgroup[1] = gg_item_kybl_0001
      • Set Variable Set itemgroup[2] = gg_item_ratf_0000
      • -------- Set percent to drop highestt first --------
      • -------- Percent you should use: 1 ; 2 ; 4 ; 5 ; 8 ; 10 ;16 ; 25 ; 33 ; 50 ; 100 --------
      • Set Variable Set percentgroup[1] = "50"
      • Set Variable Set percentgroup[2] = "33"
  • basic item tier 2 setup
    • Events
    • Conditions
    • Actions
      • Set Variable Set itemcount = "3"
      • Set Variable Set itemgroup[1] = gg_item_tkno_0005
      • Set Variable Set itemgroup[2] = gg_item_modt_0004
      • Set Variable Set itemgroup[3] = gg_item_ckng_0003
      • -------- Set percent to drop highestt first --------
      • -------- Percent you should use: 1 ; 2 ; 4 ; 5 ; 8 ; 10 ;16 ; 25 ; 33 ; 50 ; 100 --------
      • Set Variable Set percentgroup[1] = "50"
      • Set Variable Set percentgroup[2] = "33"
      • Set Variable Set percentgroup[3] = "16"
  • defeat creep
    • Events
      • Unit - A unit owned by Player 13 (Maroon) . Dies
    • Conditions
    • Actions
      • Set Variable Set tempInt = "1"
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of (Triggering unit)) Equal to 1
        • Then - Actions
          • Trigger - Run basic_item_setup <gen> (ignoring conditions)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of (Triggering unit)) Equal to 2
            • Then - Actions
              • Trigger - Run basic_item_tier_2_setup <gen> (ignoring conditions)
            • Else - Actions
      • Unit - Remove (Triggering unit) from the game
      • For each (Integer A) from tempInt to itemcount , do (Actions)
        • Loop - Actions
          • Set Variable Set random = (Random integer number between 1 and (100 / percentgroup[(Integer A)]))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • random Equal to (100 / percentgroup[(Integer A)])
            • Then - Actions
              • Item - Create (Item-type of itemgroup[(Integer A)]) at (Position of (Triggering unit))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • allowMoreThanOneItemPerDrop Equal to True
                • Then - Actions
                • Else - Actions
                  • Custom script: exitwhen true
            • Else - Actions


warpten090

v1 Initial Release
v2 Added Percent Drop From 51-99
Some of the system requires jass new gen pack library and some does not support percent drop
If u want 0% drop, you set it to -1. Maybe WE auto clear array with 0 value (fixed at v2.1a)
Unit type with item drop % from 51-99 has to be zoned out, don't stand near the other unit type ( fixed at v2.1 )

Value of Unit​

At Resource section

Print Damage​

https://www.hiveworkshop.com/threads/actiondetection-system.151176/post-3633163
Contents

simple unit value system (Map)

warpten090 Simple Item Drop System 2 (Map)

Reviews
Antares
That's not true. A user would have to still do a lot of editing of your functions to make your system work in the way he or she wants to and you give no directions as to what has to be edited where. You need to clearly indicate the parts of your...
- Open World Editor - File - Preferences... - General Tab - Tick the Automatically create unknown variables while pasting trigger data
  • Copy the 3 trigger need for the system to run
  • YOU'RE DONE !
That's not true. A user would have to still do a lot of editing of your functions to make your system work in the way he or she wants to and you give no directions as to what has to be edited where. You need to clearly indicate the parts of your triggers that should be customized, which parts are not to be touched, and which parts are just part of your test map.

The way you're handling the random item roll is unnecessarily complicated and restrictive. You can simply do
  • (Random percentage) Less than or equal to percentChance
in your condition and have the user set the drop chance to any value between 0 and 100, instead of restricting them to divisors of 100.

You can set up a trigger array during map initialization and them call the correct trigger for the creep level with
  • Trigger - Run itemSetupTriggers[(Level of (Triggering unit))] (ignoring conditions)
This will avoid having to create a bunch of nested If-statements in your defeat creep function.

You're removing the dying unit from the game, which I don't know why.

You're leaking a location every time a unit dies. Read here on how to remove memory leaks.

Even with all of this fixed, your system is quite restrictive, for example not allowing for "choose one out of N" item drops, and there are just better, similar systems available. Because of that, I'll put it to lacking. While I don't want to discourage you, the World Editor Help Forum might be the better section to get feedback on your triggers and improve.

Lacking
 
The way you're handling the random item roll is unnecessarily complicated and restrictive. You can simply do
  • if.gif
    (Random percentage) Less than or equal to percentChance

Math.Random of World Editor is not like in Visual Studio. The result of math.random is not the percent but only random number. what if computer generate small number and item always drop.


Maybe you should read Why I do this section and try v2.1.
 
Last edited:
Math.Random of World Editor is not like in Visual Studio. The result of math.random is not the percent but only random number. what if computer generate small number and item always drop.
  • (Random percentage)
returns a random number between 0 and 100. You can also just use the default random real number function and specify the bounds yourself.

Maybe you should read Why I do this section and try v2.1.
Sorry, but your code is a complete mess. You need multiple nested If-Then-Else blocks to do simple mathematical operations, and, unlike with your previous version, I don't even know what you're trying to do. There's no way this system can get approved in a state like this.
 
Top