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

[Spell] Item Drop/Loot System

Status
Not open for further replies.
Level 9
Joined
Jun 4, 2007
Messages
206
Hello, I've been trying to make ways of creating an item drop table with % chances, I searched the Spells Section for a system but the only ones I found didn't match what i needed or were in vJass (wich i have little to no clue to implement on my map).

So what I wanted to ask is if anyone can please link me to a system or teach me how to do a item drop without repeating "if" actions (a real system), here are some of the details:

- Every creep may drop different items but according to its level (my map will use level req items), ex: a lvl 5 troll may drop lvl 1-5 items, but a lvl 40 ogre will only drop lvl 30-40 items(no low level items on high level monsters)
-There must be a chance for the item type to drop, like 11% for a normal item type, 3% for a magic item type and 1% for a unique item type, for a total chance of 15% drop per kill

It's much like the diablo 2 way of dropping items, there is a chance and part of this chance is a magic/rare item, and the items become stronger depending on the monsters.

Thankss
 
an easy way to make a chance system is like this

JASS:
function chance takes nothing returns nothing
    local integer i = GetRandomInt( 1, 100)
    if i < 16 then 
        call CreateItem( items[i], unitX, unitY )
    endif
endfunction

function setItems takes nothing returns nothing
    // this is item table 1
    set items[1] = //rare item
    set items[2] = //magic item
    set items[3] = //magic item
    set items[4] = //magic item
    set items[5] = //normal item
    set items[6] = //normal item
    set items[7] = //normal item
    set items[8] = //normal item
    set items[9] = //normal item
    set items[10] = //normal item
    set items[11] = //normal item
    set items[12] = //normal item
    set items[13] = //normal item
    set items[14] = //normal item
    set items[15] = //normal item
endfunction

heres the equivalent in gui without setting the items in an array

  • Actions
    • Set i = (Random integer number between 1 and 100)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • i Less than 16
      • Then - Actions
        • Item - Create items[i] at (Position of (Triggering unit))
      • Else - Actions
now make an item arrays w normal rare and magic items in them. then were i have the comments just pick a random integer and drop the item that corresponds to tht item in the item array
 
Last edited:
Status
Not open for further replies.
Top