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

Drop many item with single trigger ? GUI version pls

Status
Not open for further replies.
Level 2
Joined
Apr 7, 2010
Messages
21
how to drop an item on dying unit with a chance ?.
a dying unit is a an enemy so all enemy will drop an item when the unit is died/killed

example :
the first item is claw of attack
second item is mask of death
third is boots of speed
fourth is glove of haste
fifth is ank of reincarnation

when killing an enemy it will randomly drop an item maybe will drop claw of attack or mask of death or any item that has been determined and with 10% to drop the item.

Note : if you could please make it that dying unit ( enemy ) only be able drop 1 item. So from all item that we determined for the enemy to drop item when die will only drop 1 item , the item that drop is random ( maybe will drop claw of attack or mask of death or any item that has been determined )
if it using a variable please give me the "Variable Type" key not just the "Varibale Name" so i wont confuse to how to create that variable. ( Give me Full trigger THX )
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
It can be done in GUI, but there's a reaaaallly easy system made by Adiktuz in JASS but I can teach you how to use it, since it's the one i'm using.
 
Level 2
Joined
Apr 7, 2010
Messages
21
It can be done in GUI, but there's a reaaaallly easy system made by Adiktuz in JASS but I can teach you how to use it, since it's the one i'm using.

could you show me ?

here you go, type kill to kill the unit and one item wil be droped

EDIT found a small bug :p fixed it

the map you give me hmm its a little different to what i want. cause with that trigger that mean i must set all the existing enemy unit in the map 1 by 1 to set the item will drop from the unit.
 
Level 8
Joined
Jul 3, 2011
Messages
251
When a unit dies, refer to killing unit and killed unit, you can use an integer variable and set it to a random number between 1-10 (10% chance) if it is 1, then set another integer to a random number 1-max inv slots the killed unit has, set the item-type to a variable, remove it then add that item-type to the killing unit.

Item type variable, is of course an item-type variable and the 2 integers are, you guessed it, integers.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
This is Adiktuz System: http://www.hiveworkshop.com/forums/...prev=search=adiktuz%20item%20drop&d=list&r=20

Now, lets say that unit 'A' is a Wolf, then you say:

- Unit 'A' will drop a maximum of 2 items.
- Unit 'A' can drop item 'I000' with a 12%.
- Unit 'A' can drop item 'I001' with a 15%.
- Unit 'A' can drop item 'I012' with a 100%.

Any time a wolf dies, the system will randomly check the list of items the unit has available for dropping.

Here you don't have to add EVERY unit in your map, but every UNIT TYPE... You can have 100 Wolves, but they are all wolves, so, it's just one unit type, and the same drop list will work for all of them.

But if you have 19 units of different kinds... you'll have to set the list for each one of them individually, the same way.


- Unit 'B' will drop a maximum of 2 items.
- Unit 'B' can drop item 'I000' with a 24%.
- Unit 'B' can drop item 'I001' with a 2%.
- Unit 'B' can drop item 'I012' with a 100%.


- Unit 'C' will drop a maximum of 4 items.
- Unit 'C' can drop item 'I000' with a 64%.
- Unit 'C' can drop item 'I001' with a 14%.
- Unit 'C' can drop item 'I012' with a 33%.

etc..
 
Level 2
Joined
Apr 7, 2010
Messages
21
This is Adiktuz System: http://www.hiveworkshop.com/forums/...prev=search=adiktuz%20item%20drop&d=list&r=20

Now, lets say that unit 'A' is a Wolf, then you say:

- Unit 'A' will drop a maximum of 2 items.
- Unit 'A' can drop item 'I000' with a 12%.
- Unit 'A' can drop item 'I001' with a 15%.
- Unit 'A' can drop item 'I012' with a 100%.

Any time a wolf dies, the system will randomly check the list of items the unit has available for dropping.

Here you don't have to add EVERY unit in your map, but every UNIT TYPE... You can have 100 Wolves, but they are all wolves, so, it's just one unit type, and the same drop list will work for all of them.

But if you have 19 units of different kinds... you'll have to set the list for each one of them individually, the same way.


- Unit 'B' will drop a maximum of 2 items.
- Unit 'B' can drop item 'I000' with a 24%.
- Unit 'B' can drop item 'I001' with a 2%.
- Unit 'B' can drop item 'I012' with a 100%.


- Unit 'C' will drop a maximum of 4 items.
- Unit 'C' can drop item 'I000' with a 64%.
- Unit 'C' can drop item 'I001' with a 14%.
- Unit 'C' can drop item 'I012' with a 33%.

etc..

iam sorry but i dont quite understand. Could you give me the steps and the trigger in GUI version. I dont understand if it a Jass trigger
 
Level 13
Joined
Oct 25, 2009
Messages
995
Do you mean like this?
  • Dropping Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to (Your Dying Unit)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to 25 < Mean 25% chance
        • Then - Actions
          • Item - Create (Your Item Here) at (Position of (Your Dying Unit))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to 65 < mean 65% chance
        • Then - Actions
          • Item - Create (Your Item Here) at (Position of (Your Dying Unit))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to 20 < mean 20% chance
        • Then - Actions
          • Item - Create (Your Item Here) at (Position of (Your Dying Unit))
        • Else - Actions
Remember remove the location leaks.
 
Level 2
Joined
Apr 7, 2010
Messages
21
Do you mean like this?
  • Dropping Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to (Your Dying Unit)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to 25 < Mean 25% chance
        • Then - Actions
          • Item - Create (Your Item Here) at (Position of (Your Dying Unit))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to 65 < mean 65% chance
        • Then - Actions
          • Item - Create (Your Item Here) at (Position of (Your Dying Unit))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to 20 < mean 20% chance
        • Then - Actions
          • Item - Create (Your Item Here) at (Position of (Your Dying Unit))
        • Else - Actions
Remember remove the location leaks.

where is leaking ??? how about the dying unit is neutral hostile do you know how to make it ??? or should i change the unit type is attacking unit or targeted unit because i want that all enemies have a chance to dropping item not just a spesific unit???
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Will ALL your creeps in your map have the same drop list?

If NO, then:

HOW many different creep types, or 'Drop lists' you need?
 
Level 13
Joined
Oct 25, 2009
Messages
995
where is leaking ??? how about the dying unit is neutral hostile do you know how to make it ??? or should i change the unit type is attacking unit or targeted unit because i want that all enemies have a chance to dropping item not just a spesific unit???

Yes,Unit type mean ALL UNITS of this type will drop the items,you don't need change the triggering unit,u just need choose your enemy unit and set variable of point to
  • Set Point = (Position of (Your Dying Unit))
  • Custom Script: call RemoveLocation(udg_Point) << Use this action after created item
Or you mean you want make all unit of that player drop?
 
Level 2
Joined
Apr 7, 2010
Messages
21
Yes,Unit type mean ALL UNITS of this type will drop the items,you don't need change the triggering unit,u just need choose your enemy unit and set variable of point to
  • Set Point = (Position of (Your Dying Unit))
  • Custom Script: call RemoveLocation(udg_Point) << Use this action after created item
Or you mean you want make all unit of that player drop?

yeah i mean example the enemy is neutral hostile or player 12 ( player 12 that used to spawn the enemies ) so all enemy ( neutral hostile or player 12 that used to spawn the enemies ) die they will have a chance like 10% to drop item. The Drop list has 5 items so from that 5 items it will randomly drop 1 of the 5 item. So.. it wont limited just by a selected enemy that able to drop an item but all enemies ( neutral hostile or player 12 that used to spawn the enemies ) will have a chance to drop items.


Note : or maybe you can make each item has a different drop chance ?


Will ALL your creeps in your map have the same drop list?

If NO, then:

HOW many different creep types, or 'Drop lists' you need?

all enemy example ( neutral hostile or player 12 that use to spawn an enemies ) and there is a 5 item in the drop list so it will has a 10% chance to randomly drop 1 of those 5 item in the drop list

Note : or maybe you can make each item has a different drop chance ?
 
Level 8
Joined
Dec 9, 2009
Messages
397
You guys are making this a lot harder than it has to be, you just need 1 trigger per type of unit

Trigger would be
Event
Unit dies
Condition
Owner of unit = computer
Unit = type of unit this trigger is for
Actions
Random number between 1-100
if random number less than or = to 10 (Chance to drop an item)
then
set temploc = loc of dying unit
set IntegerVariable = random number between 1-6 (number of items able to drop)
if
integerVariable = 1
then
Create item 1 at temploc
else
if integervariable = 2
then
Create item 2 at temploc
and so on.
 
Level 2
Joined
Apr 7, 2010
Messages
21
You guys are making this a lot harder than it has to be, you just need 1 trigger per type of unit

Trigger would be
Event
Unit dies
Condition
Owner of unit = computer
Unit = type of unit this trigger is for
Actions
Random number between 1-100
if random number less than or = to 10 (Chance to drop an item)
then
set temploc = loc of dying unit
set IntegerVariable = random number between 1-6 (number of items able to drop)
if
integerVariable = 1
then
Create item 1 at temploc
else
if integervariable = 2
then
Create item 2 at temploc
and so on.


* sorry but could you make it more like a trigger ???
* what the "variable Type" that use for temploc ???
* the trigger you make is leakless right ??
* "set IntegerVariable = random number between 1-6 (number of items able to drop)" << this trigger is use to make the total item that able to drop right ??
* the trigger you make is able to make the enemy drop 1 of 6 item randomly right ?
* integervariable = the variable type is integer right ?
* the trigger you gave me is enable to make all enemy example all type of enemy that in category neutral hostile type or player 12 ( that usually use to spawn enemy in x hero ) to able to drop item right ???
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Editing to answer last post...

1) It's a trigger, exactly like you see it, only that it's not inside [ Trigger] things.
2) Temp_Loc = Point Type Variable (GUI calls 'locations' 'points')
3) It will be leakless as long as you remove Point handles. Use 'Custom Script: call RemoveLocation(udg_YourPointTypeVariableName)' at the end of the trigger.
4) That variable just randomly select the item the creep is going to drop.
5) Yeah, it's Integer. Integer allows the manipulation of any kind of whole number (without decimals).
6) Yeah... that trigger will work for any creep owned by the player you set in the conditions.

BTW: There's a LOT easier way to do this, and I would suggest you to do it:

1) Create a 'Item Type' variable called 'Item'. Check is as an 'Array' with size 1 (default).
2) In the trigger 'Map Initialization' set the variable values like this

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set ItemQ = 6
      • Set Items[1] = Claws of Attack +15
      • Set Items[2] = Crown of Kings +5
      • Set Items[3] = Kelen's Dagger of Escape
      • Set Items[4] = Mask of Death
      • Set Items[5] = Orb of Frost
      • Set Items[6] = Ring of Protection +5
Now, the following trigger is the drop.

  • Drops
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering player) Equal to Player 12 (Brown)
      • (Random integer number between 1 and 100) Less than or equal to 10
    • Actions
      • Set Point = (Position of (Triggering unit))
      • Item - Create Items[(Random integer number between 1 and ItemQ)] at Point
      • Custom script: call RemoveLocation(udg_Point)
When using Generic Unit Events, you can always use 'Triggering Player' to call '(Owner of (Triggering Unit)).

If your creeps are owned by Neutral Hostile, just change the condition
  • Conditions
    • (Triggering player) Equal to Player 12 (Brown)
For
  • Conditions
    • (Triggering player) Equal to Neutral Hostile
If you use multiple hostile creeps, then create a 'Or - Multiple Conditions' and add Both to that 'Or' block.

If you want to increase or reduce the chance, change the '10' at the end of the condition to whatever you want. Higher number, higher chance.
  • Conditions
    • (Random integer number between 1 and 100) Less than or equal to 10

If you want to add more items, just do it in the Map Initialization setting more items in the array. Item[7] item [8] item [9] etc. But always remember to set the 'ItemQ' value to the higher value of the Item array. If it's Item[28] then set ItemQ to 28.
 
Last edited:
Level 2
Joined
Apr 7, 2010
Messages
21
Editing to answer last post...

1) It's a trigger, exactly like you see it, only that it's not inside [ Trigger] things.
2) Temp_Loc = Point Type Variable (GUI calls 'locations' 'points')
3) It will be leakless as long as you remove Point handles. Use 'Custom Script: call RemoveLocation(udg_YourPointTypeVariableName)' at the end of the trigger.
4) That variable just randomly select the item the creep is going to drop.
5) Yeah, it's Integer. Integer allows the manipulation of any kind of whole number (without decimals).
6) Yeah... that trigger will work for any creep owned by the player you set in the conditions.

BTW: There's a LOT easier way to do this, and I would suggest you to do it:

1) Create a 'Item Type' variable called 'Item'. Check is as an 'Array' with size 1 (default).
2) In the trigger 'Map Initialization' set the variable values like this

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set ItemQ = 6
      • Set Items[1] = Claws of Attack +15
      • Set Items[2] = Crown of Kings +5
      • Set Items[3] = Kelen's Dagger of Escape
      • Set Items[4] = Mask of Death
      • Set Items[5] = Orb of Frost
      • Set Items[6] = Ring of Protection +5
Now, the following trigger is the drop.

  • Drops
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering player) Equal to Player 12 (Brown)
      • (Random integer number between 1 and 100) Less than or equal to 10
    • Actions
      • Set Point = (Position of (Triggering unit))
      • Item - Create Items[(Random integer number between 1 and ItemQ)] at Point
      • Custom script: call RemoveLocation(udg_Point)
When using Generic Unit Events, you can always use 'Triggering Player' to call '(Owner of (Triggering Unit)).

If your creeps are owned by Neutral Hostile, just change the condition
  • Conditions
    • (Triggering player) Equal to Player 12 (Brown)
For
  • Conditions
    • (Triggering player) Equal to Neutral Hostile
If you use multiple hostile creeps, then create a 'Or - Multiple Conditions' and add Both to that 'Or' block.

If you want to increase or reduce the chance, change the '10' at the end of the condition to whatever you want. Higher number, higher chance.
  • Conditions
    • (Random integer number between 1 and 100) Less than or equal to 10

If you want to add more items, just do it in the Map Initialization setting more items in the array. Item[7] item [8] item [9] etc. But always remember to set the 'ItemQ' value to the higher value of the Item array. If it's Item[28] then set ItemQ to 28.



Set ItemQ = 6 << how to make this part ?? because if i make that part it will become like this "
  • Set itemQ[index] = value
" << i cant delete the "[index]" that on the itemQ side and the "Value" Part i cant set to "6"

Set Items[1] = Claws of Attack +15 << this part : a "variable type" for that trigger is "Item with array size 1" or "item type with array size 1" ???
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Actually, I forgot to say that ItemQ was an Integer Variable (Not Array).

thedarkgodzz, you need to have a better understanding of variables and variable types. Each variable has the ability to store a different type of data. This is a table found in http://world-editor-tutorials.thehelper.net/variables.php that explains variables.

As you can see in the list, Integer stores whole numbers, and the WC3 game data that works with whole numbers, like Level. You may have notice that having 1.427 level is impossible. It's 1 or 2.

Real - stores decimal numbers, like HP (You can have 200,25 hp) or DAMAGE (47,48 dmg) . Whenever you see something Equal to a whole number, it's for sure a Integer. If it has decimals, it's a Real, for sure.

If the variable has '[index]' it's because it's marked as an array (to use several values of the same type, on the same trigger simultaneously).

  • Integer Stores a whole number, and does not accept deciaml points.
  • Real Stores a floating point number, or a number with decimal points.
  • String Stores a group of characters, or line of text.
  • Ability Stores a type of ability, like Windwalk or Bloodlust.
  • Boolean Stores a true or false statement.
  • Buff Stores an type of buff, like slow or poision.
  • Camera Object Stores a pre-placed camera object on your map.
  • Destructable Stores a particular destructable, either pre-placed or created.
  • Destructable Type Stores a type of destructable.
  • Defeat Condition Can store the last defeat condition that you created.
  • Dialog Can store the last dialog box that you created.
  • Dialog Button Can store the last dialog button that you created.
  • Floating Text Can store the last floating text that you created.
  • Game Cache Can store the last came cache that you created.
  • Game Speed Stores a game speed value, either the current speed or another value.
  • Item Stores a particular item that already exists in the map.
  • Item Class Stores the class of an item.
  • Item Type Stores the type of an item.
  • Leaderboard Can store the last leaderboard you created.
  • Multiboard Can store the last multiboard you created.
  • Order Stores a unit order, like Attack or Hide.
  • Player References a particular player.
  • Player Color Stores a player color value, like red.
  • Player Group Stores a group of players to be used again.
  • Point Stores a X,Y coordinate on the map.
  • Quest Stores the last quest you created.
  • Quest Requirement Stores the last quest requirement you created.
  • Race Stores a race, like Human or Night Elf.
  • Region References a particular region on the map.
  • Sound References a sound that you have used or imported, in the sound manager.
  • Special Effect Stores the last special effect you created.
  • Tech Type Stores a type of research or upgrade.
  • Terrain Deformation Stores the last terrain deformation you created.
  • Timer Used for creating timers. Every timer has a timer variable.
  • Timer Window Stores the last timer window you created.
  • Trigger References a particular trigger in your map.
  • Unit Stores a particular, single unit on your map.
  • Unit Group Stores a group of units.
  • Unit Type Stores a particular type of unit, like Footman or Sorceress.
  • Visibility Modifier Stores the last visibiliy modifier you created.
  • Weather Effect Stores the last weather effect you created.

Set ItemQ = 6 << how to make this part ?? because if i make that part it will become like this "
Set itemQ[index] = value
" << i cant delete the "[index]" that on the itemQ side and the "Value" Part i cant set to "6"

Uncheck the 'Array' on the variable config.

Set Items[1] = Claws of Attack +15 << this part : a "variable type" for that trigger is "Item with array size 1" or "item type with array size 1" ???
I said ITEM-TYPE variable, not 'ITEM' variable.
 
Level 8
Joined
Dec 9, 2009
Messages
397
Spartipilo, your trigger is basically the same thing, your just splitting it into 2 triggers and adding more variables.

My method is simple and you just copy/paste the first trigger to make 2nd trigger, change killed unit and items dropped your done with a 2nd, copy and paste again for a 3rd.

My method is easier if you want items to have a different chance to drop,
you could change

If random number <= 90
then
set temppoint = loc of dying unit
set tempint = random number between 1-100
if
tempint <= 10
creat item Claws at temppoint
else
if
tempint >= 11
tempint <= 20
then
create boots at temppoint
else
if
tempoint >21
tempoint <=50
then
create helm at temppoint
else (we know number is over 50 so we don't have to check it)
create healing potion at temppoint
remove temppoint


It's simple and can be edited easily for more enemies/different % chances.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Yeah it's simple and easy to modify :) So far, I think both systems work. It's up to thedarkgodzz to pick one. It's just my preference to work with variables. I'm kinda hating If/then/else xD
 
Level 2
Joined
Apr 7, 2010
Messages
21
  • Drops
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering player) Equal to Player 12 (Brown)
      • (Random integer number between 1 and 100) Less than or equal to 10
    • Actions
      • Set Point = (Position of (Triggering unit))
      • Item - Create Items[(Random integer number between 1 and ItemQ)] at Point
      • Custom script: call RemoveLocation(udg_Point)
The trigger above can i change it to like this below ???
Note : oh sorry2 The trigger i think that not work is actually worked. The thing that caused it unworkable is because some of the trigger part i set it wrong.

  • Drop2
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Set Chance = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Chance Less than or equal to 50
        • Then - Actions
          • Set Point = (Position of (Triggering unit))
          • Item - Create Items[(Random integer number between 1 and ItemQ)] at Point
          • Custom script: call RemoveLocation(udg_Point)
        • Else - Actions
 
Last edited:
Level 8
Joined
Dec 9, 2009
Messages
397
No I don't think it's leaking, only thing that could is your loc, and your clearing it, but your not setting your itemQ variable to a random number, and you don't need the chance variable.

Integer comparison - Math - Random number.
  • Conditions
    • (Random integer number between 1 and 100) Less than or equal to (<=) 10
 
Level 2
Joined
Apr 7, 2010
Messages
21
No I don't think it's leaking, only thing that could is your loc, and your clearing it, but your not setting your itemQ variable to a random number, and you don't need the chance variable.

Integer comparison - Math - Random number.
  • Conditions
    • (Random integer number between 1 and 100) Less than or equal to (<=) 10



oh sorry2 The trigger i think that not work is actually worked. The thing that caused it unworkable is because some of the trigger part i set it wrong.
 
Status
Not open for further replies.
Top