• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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