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

Status
Not open for further replies.
Level 4
Joined
Jan 3, 2012
Messages
60
Hey Guys

Im looking for an item drop system that allows you to create a loot table for summoned units and sets the chance of items dropping. Couldn't find a system like that here that doesn't require JPNG. I don't have very much knowledge about hashtable, but i imaigne that such a system would be running on hashtables. Anyone have any sugestions?
 
Level 7
Joined
Aug 5, 2010
Messages
147
Create an Item-Type Variable Array, when the map starts set variable arrays to whatever items you want.

Example from my own map.

  • Items
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set Items[1] = Life Crystal
      • Set Items[2] = Long Range Rifle
      • Set Items[3] = Blight Skull
      • Set Items[4] = Captured Mirror Image
      • Set Items[5] = Contained Disease Cloud
      • Set Items[6] = Fire
      • Set Items[7] = Flamethrower
      • Set Items[8] = Magi Staff
      • Set Items[9] = Pulse Rifle
      • Set Items[10] = Sheeps Spellbook
Make an integer variable for drop chance and another for deciding what item to drop.

  • Item Drops
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Water Elemental (Level 1)
          • (Unit-type of (Triggering unit)) Equal to Water Elemental (Level 2)
          • (Unit-type of (Triggering unit)) Equal to Water Elemental (Level 3)
    • Actions
      • Set DropChance[1] = (Random integer number between 1 and 100)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DropChance[1] Less than or equal to 10
        • Then - Actions
          • Set RandomItem = (Random integer number between 1 and 10)
          • Item - Create Items[RandomItem] at (Position of (Triggering unit))
        • Else - Actions
The above triggers makes it so whenever a water elemental dies it has a 10% chance to drop a random item

And their you have it No JNGP or hashtables
 
Status
Not open for further replies.
Top