Random Loot

Newbie07

New Member
Reaction score
0
Can someone kindly help me?I want to set loot for hostile creep for my map. And I want to drop to have percentage rate rate.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
If you're doing this for preplaced units, just double-click on them and create a new item table. The rest should be simple enough.

If you have to do this for spawned creeps, make an event that detects a creep's death, then create an If/Then/Else block. Add a condition to check for a random integer between 1 and 100, and if so, drop the item(s).
 

Newbie07

New Member
Reaction score
0
If I put it in item table when they respawn they dont drop anything.

Im confused in inputting the random integer. I read some of tut in this forum but they dont tell how to make the integer and setting the Variable=Random Integer
Im not pro yet..
 

Juggernaut

I don't know what to change it to
Reaction score
33
In the If/ then / else.
In the conditions of this, meaning " IF "
Press the conditions button and select Integer comparison.
Then search for random integer. click on it, and select random integer between 1 and 100.
Based on the chance you want. set Less than or equal to X (X = the chance you want for it to proc)

After this, on the "THEN" block add what should happen, in this case the items spawning.
 

BcBoy

Active Member
Reaction score
6
I've actually had a random dropsystem that worked pretty good. Could'nt find any leaks in it and it were pretty random. Gonna see if i can find it somewhere.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
If I put it in item table when they respawn they dont drop anything.

Im confused in inputting the random integer. I read some of tut in this forum but they dont tell how to make the integer and setting the Variable=Random Integer
Im not pro yet..
Trigger:
  • Item Drop
    • Events
      • Unit - A unit Dies
    • Conditions
      • Unit-type of (Triggering unit) Equal to Gnoll
    • Actions
      • Set Integer = (Random number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer Less than or equal to 50
        • Then - Actions
          • Set TempPoint = (Position of (Triggering unit))
          • Item - Create DropItem[(Random number between 1 and 5)] at TempPoint
          • Custom script: call RemoveLocation(udg_TempPoint)
      • Else - Actions

In order of clickance:
Unit - Generic Unit Event; look for Dies.
Unit-type Comparison; Click on Footman and look for your unit-type.
Set Variable; You should have an integer variable created. Look for Math - Random number.
If/Then/Else (Multiple Conditions)
Integer Comparison
Set Variable; This is for clearing memory leaks. You should have a point variable created. Look for Unit - Position of Unit.
Item - Create
Custom script; This removes the location from memory once you're done with it.
 

Newbie07

New Member
Reaction score
0
I have read that already..my problem i how to make the integer.What should I put in the Variable part?X=? = (Random number between 1 and 100).

The call RemoveLocation(udg_TempPoint) creates syntax error
 

Baterasis

New Member
Reaction score
4
Once you get a hold of those variables, and if you intend to use items of different qualities, you could use my trigger.

Every item you want to include in the random item pool should be made Artifacts and their levels should be ranging from 0 (common items, consumables, junk) to 3 (epics and quality stuff).

What this trigger does is giving a 20% chance (2 in 10) on each killed creep to drop an item, and if successful, will make another check to see if an item of higher level will drop. If any level check above 0 is unsuccessful, an item from the previous level will drop instead.

Trigger:
  • Item Random Drop
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Dying unit)) Equal to Neutral Hostile
    • Actions
      • Set RandomItemMax = 10
      • Set RandomItemMin = 2
      • Set RandomItem = (Random integer number between 1 and RandomItemMax)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RandomItem Less than or equal to RandomItemMin
        • Then - Actions
          • Set RandomItem = (Random integer number between 1 and (RandomItemMax - 1))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RandomItem Less than or equal to RandomItemMin
            • Then - Actions
              • Set RandomItem = (Random integer number between 1 and (RandomItemMax - 2))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • RandomItem Less than or equal to RandomItemMin
                • Then - Actions
                  • Set RandomItem = (Random integer number between 1 and (RandomItemMax - 3))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • RandomItem Less than or equal to RandomItemMin
                    • Then - Actions
                      • Set TempPoint = (Position of (Dying unit))
                      • Item - Create (Random level 3 Artifact item-type) at TempPoint
                      • Custom script: call RemoveLocation( udg_TempPoint )
                    • Else - Actions
                      • Set TempPoint = (Position of (Dying unit))
                      • Item - Create (Random level 2 Artifact item-type) at TempPoint
                      • Custom script: call RemoveLocation( udg_TempPoint )
                • Else - Actions
                  • Set TempPoint = (Position of (Dying unit))
                  • Item - Create (Random level 1 Artifact item-type) at TempPoint
                  • Custom script: call RemoveLocation( udg_TempPoint )
            • Else - Actions
              • Set TempPoint = (Position of (Dying unit))
              • Item - Create (Random level 0 Artifact item-type) at TempPoint
              • Custom script: call RemoveLocation( udg_TempPoint )
        • Else - Actions
          • Do nothing
    • <div class="bbCodeBlock bbCodeBlock--screenLimited bbCodeBlock--code"><div class="bbCodeBlock-title">Trigger:</div><div class="wc3trigger"><ul class="wc3" id="wc3_2">
    • </ul>
    • </div></div>
 

vypur85

Hibernate
Reaction score
803
I have read that already..my problem i how to make the integer.

To make the integer, go to 'Variable Editor' in the trigger window. Alternatively, you can simply press CTRL+B. The symbol is a X sign. Press 'New Variable' and create an integer variable type. Name it 'Integer'.


What should I put in the Variable part?X=? = (Random number between 1 and 100).
Set Variable.

The call RemoveLocation(udg_TempPoint) creates syntax error
You have to create a variable type point first, with the exact name and casing, 'TempPoint'.


I believe KaerfNomekop has already a good explanation though. This is just an extension of his explanation.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top