1. Head to the 33rd Modeling Contest Poll and drink to your heart's desire.
    Dismiss Notice
  2. Choose your means of doom in the 17th Mini Mapping Contest Poll.
    Dismiss Notice
  3. A slave to two rhythms, the 22nd Terraining Contest is here.
    Dismiss Notice
  4. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  5. The die is cast - the 6th Melee Mapping Contest results have been announced. Onward to the Hive Cup!
    Dismiss Notice
  6. The glory of the 20th Icon Contest is yours for the taking!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Drop many item with single trigger ? GUI version pls

Discussion in 'World Editor Help Zone' started by thedarkgodzz, Oct 11, 2011.

  1. thedarkgodzz

    thedarkgodzz

    Joined:
    Apr 7, 2010
    Messages:
    21
    Resources:
    0
    Resources:
    0
    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 )
     
  2. Chaosy

    Chaosy

    Tutorial Reviewer

    Joined:
    Jun 9, 2011
    Messages:
    11,058
    Resources:
    18
    Icons:
    1
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    18
    here you go, type kill to kill the unit and one item wil be droped

    EDIT found a small bug :p fixed it
     

    Attached Files:

  3. Spartipilo

    Spartipilo

    Joined:
    Jul 14, 2011
    Messages:
    3,190
    Resources:
    0
    Resources:
    0
    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.
     
  4. thedarkgodzz

    thedarkgodzz

    Joined:
    Apr 7, 2010
    Messages:
    21
    Resources:
    0
    Resources:
    0
    could you show me ?

    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.
     
  5. Chaosy

    Chaosy

    Tutorial Reviewer

    Joined:
    Jun 9, 2011
    Messages:
    11,058
    Resources:
    18
    Icons:
    1
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    18
    thats not needed. if you want to select all unit in map use
    • Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
      • Loop - Actions
      • actions here
     
  6. thedarkgodzz

    thedarkgodzz

    Joined:
    Apr 7, 2010
    Messages:
    21
    Resources:
    0
    Resources:
    0
    so how i set that enemy drop the item that i set to the enemy ?
     
  7. Zaio

    Zaio

    Joined:
    Jul 3, 2011
    Messages:
    247
    Resources:
    1
    Spells:
    1
    Resources:
    1
    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.
     
  8. Spartipilo

    Spartipilo

    Joined:
    Jul 14, 2011
    Messages:
    3,190
    Resources:
    0
    Resources:
    0
    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..
     
  9. thedarkgodzz

    thedarkgodzz

    Joined:
    Apr 7, 2010
    Messages:
    21
    Resources:
    0
    Resources:
    0
    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
     
  10. GangSpear

    GangSpear

    Joined:
    Oct 25, 2009
    Messages:
    971
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Do you mean like this?
    Trigger
    • 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.
     
  11. thedarkgodzz

    thedarkgodzz

    Joined:
    Apr 7, 2010
    Messages:
    21
    Resources:
    0
    Resources:
    0
    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???
     
  12. Spartipilo

    Spartipilo

    Joined:
    Jul 14, 2011
    Messages:
    3,190
    Resources:
    0
    Resources:
    0
    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?
     
  13. GangSpear

    GangSpear

    Joined:
    Oct 25, 2009
    Messages:
    971
    Resources:
    1
    Spells:
    1
    Resources:
    1
    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
    trigger
    • 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?
     
  14. thedarkgodzz

    thedarkgodzz

    Joined:
    Apr 7, 2010
    Messages:
    21
    Resources:
    0
    Resources:
    0
    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 ?


    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 ?
     
  15. GangSpear

    GangSpear

    Joined:
    Oct 25, 2009
    Messages:
    971
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Yes,my trigger is for each item has different drop chance.
     
  16. Ultimatony

    Ultimatony

    Joined:
    Dec 9, 2009
    Messages:
    397
    Resources:
    0
    Resources:
    0
    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.
     
  17. thedarkgodzz

    thedarkgodzz

    Joined:
    Apr 7, 2010
    Messages:
    21
    Resources:
    0
    Resources:
    0

    * 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 ???
     
  18. Spartipilo

    Spartipilo

    Joined:
    Jul 14, 2011
    Messages:
    3,190
    Resources:
    0
    Resources:
    0
    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: Oct 13, 2011
  19. thedarkgodzz

    thedarkgodzz

    Joined:
    Apr 7, 2010
    Messages:
    21
    Resources:
    0
    Resources:
    0


    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" ???
     
  20. GangSpear

    GangSpear

    Joined:
    Oct 25, 2009
    Messages:
    971
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Integer Array,next time see tutorial before posting.