Making neutral creeps drop items based on my preference

Level 2
Joined
Jun 29, 2025
Messages
7
Hi guys. Its my second time only posting asking for help in this forum and hopefully it finds you well. You see, I want the neutral creep to drop items based on my preference. Say for example, the game is Dota-like with recipe item A + recipe item B = Item C. Suppose my opponent got item A already. If he gets item B, I would be in trouble as his hero will get stronger. And the rule of the game is to only get items by killing neutral creeps and not buying items to make recipe items like in Dota. So my question is, how do I control what item will he get and as well as me if I were to farm with neutral creeps assuming if I wish his hero gets weaker by having neutral creep dropping crappy(useless) items whilst I get the right item for myself to make my hero stronger? The goal of this question is to make him weaker while I become stronger (of course). Do I need triggers? If so, what are they?
 
Hi I wrote some triggers for you:

First Trigger Does Not Have Randomness as a Factor, which means the item that drops will always be the same in the sequence.

  • ItemCreation
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Dying unit)) Equal to Neutral Hostile
      • (Owner of (Killing unit)) Equal to Player 1 (Red)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BooleanRed1 Equal to False
        • Then - Actions
          • Item - Create Claws of Attack +15 at (Position of (Dying unit))
          • Set VariableSet BooleanRed1 = True
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BooleanRed2 Equal to False
            • Then - Actions
              • Item - Create Crown of Kings +5 at (Position of (Dying unit))
              • Set VariableSet BooleanRed2 = True
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BooleanRed3 Equal to False
                • Then - Actions
                  • Item - Create Inferno Stone at (Position of (Dying unit))
                  • Set VariableSet BooleanRed3 = True
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • BooleanRed4 Equal to False
                    • Then - Actions
                      • Item - Create Kelen's Dagger of Escape at (Position of (Dying unit))
                      • Set VariableSet BooleanRed4 = True
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • BooleanRed5 Equal to False
                        • Then - Actions
                          • Item - Create Mask of Death at (Position of (Dying unit))
                          • Set VariableSet BooleanRed5 = True
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • BooleanRed6 Equal to False
                            • Then - Actions
                              • Item - Create Orb of Frost at (Position of (Dying unit))
                              • Set VariableSet BooleanRed6 = True
                              • Trigger - Turn off (This trigger)
                            • Else - Actions

Alternatively I made a second trigger (two together) that allows for the items that are dropped are random but once they are dropped once, they won't be dropped anymore:

  • RandomItems Copy
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Dying unit)) Equal to Neutral Hostile
      • (Owner of (Killing unit)) Equal to Player 1 (Red)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BooleanRed1 Equal to True
          • BooleanRed2 Equal to True
          • BooleanRed3 Equal to True
          • BooleanRed4 Equal to True
          • BooleanRed5 Equal to True
          • BooleanRed6 Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Trigger - Run RandomItems2 <gen> (checking conditions)

  • RandomItems2
    • Events
    • Conditions
    • Actions
      • Set VariableSet Integer = (Random integer number between 1 and 6)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer Equal to 1
          • BooleanRed1 Equal to False
        • Then - Actions
          • Item - Create Claws of Attack +15 at (Position of (Dying unit))
          • Set VariableSet BooleanRed1 = True
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer Equal to 1
              • BooleanRed1 Equal to True
            • Then - Actions
              • Trigger - Run RandomItems2 <gen> (checking conditions)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Integer Equal to 2
                  • BooleanRed2 Equal to False
                • Then - Actions
                  • Item - Create Crown of Kings +5 at (Position of (Dying unit))
                  • Set VariableSet BooleanRed2 = True
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Integer Equal to 2
                      • BooleanRed2 Equal to True
                    • Then - Actions
                      • Trigger - Run RandomItems2 <gen> (checking conditions)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Integer Equal to 3
                          • BooleanRed3 Equal to False
                        • Then - Actions
                          • Item - Create Inferno Stone at (Position of (Dying unit))
                          • Set VariableSet BooleanRed3 = True
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Integer Equal to 3
                              • BooleanRed3 Equal to True
                            • Then - Actions
                              • Trigger - Run RandomItems2 <gen> (checking conditions)
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • Integer Equal to 4
                                  • BooleanRed4 Equal to False
                                • Then - Actions
                                  • Item - Create Kelen's Dagger of Escape at (Position of (Dying unit))
                                  • Set VariableSet BooleanRed4 = True
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • Integer Equal to 4
                                      • BooleanRed4 Equal to True
                                    • Then - Actions
                                      • Trigger - Run RandomItems2 <gen> (checking conditions)
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • Integer Equal to 5
                                          • BooleanRed5 Equal to False
                                        • Then - Actions
                                          • Item - Create Mask of Death at (Position of (Dying unit))
                                          • Set VariableSet BooleanRed5 = True
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • Integer Equal to 5
                                              • BooleanRed5 Equal to True
                                            • Then - Actions
                                              • Trigger - Run RandomItems2 <gen> (checking conditions)
                                            • Else - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • Integer Equal to 6
                                                  • BooleanRed6 Equal to False
                                                • Then - Actions
                                                  • Item - Create Orb of Frost at (Position of (Dying unit))
                                                  • Set VariableSet BooleanRed6 = True
                                                • Else - Actions
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • Integer Equal to 6
                                                      • BooleanRed6 Equal to True
                                                    • Then - Actions
                                                      • Trigger - Run RandomItems2 <gen> (checking conditions)
                                                    • Else - Actions

Both of the triggers are based on the assumption that there are 6 items total that players need. If you need to change it you can add or delete if/then triggers. Also I made it so that only player 1 is the one affected. If you want all players to have their own set of "journey" to getting the item collection you can recreate the triggers but you need the Booleans to be unique for that player. Or if you want a shared "journey" then you must delete the condition:

  • (Owner of (Killing unit)) Equal to Player 1 (Red)
I've attached a map for yourself. If you want to see different versions just disable one trigger over the other. Good luck, lmk if you have questions! :grin:
 

Attachments

Thank you so much. Although this thing is hard to digest, I'll try my very best to implement because to begin with, my demands are alot. xD
No problem feel free to ask any questions.

Also if you want certain unit types to drop unique items such as Ogres only to drop Hammer and Trolls to drop a Claws of Attack that is also possible, if you want to go that route.

Here is a less complicated method to achieve that:

  • Easy Version
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Dying unit)) Equal to Neutral Hostile
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Dying unit)) Equal to Ogre Mauler
        • Then - Actions
          • Item - Create Maul of Strength at (Position of (Dying unit))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Dying unit)) Equal to Forest Troll Shadow Priest
            • Then - Actions
              • Item - Create Claws of Attack +15 at (Position of (Dying unit))
            • Else - Actions
I suggest Unit-Type instead of Unit Condition because that will be more suitable for a map full of creeps (instead of having to select each specific unit, that could die).
 
Last edited:
well i like to do random item drop so i made a bit more clean trigger for that,

frist we set how many items that can drop and then we set what the item is
  • Set Items Variables
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Set VariableSet ItemDropChance = 5
      • Set VariableSet ItemType[1] = Tome of Agility
      • Set VariableSet ItemType[2] = Tome of Intelligence
      • Set VariableSet ItemType[3] = Tome of Strength
      • Set VariableSet ItemType[4] = Tome of Knowledge
      • Set VariableSet ItemType[5] = Potion of Greater Healing
and then we drop it when the crep dies we can also set to a player if you like and we set to % to drop

  • Creep Item Drop
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
      • (Random integer number between 1 and 6) Equal to 1
    • Actions
      • Set VariableSet Creep_Item_Point = (Position of (Triggering unit))
      • Item - Create ItemType[(Random integer number between 1 and ItemDropChance)] at Creep_Item_Point
      • Custom script: call RemoveLocation( udg_Creep_Item_Point )
 
Back
Top