ID:1100321
 
Keywords: drop, rpg, system
(See the best response by NNAAAAHH.)
Code:


Problem description:

How would you make a drop system? No not the Get/Drop but actual drop system were when you kill a/ NPC it goes through there Droplist? and picks an item within it to drop before the person who killed it?
In response to Trainingaccount16
That would spawn all the items available in the list if the player is 'lucky'. You would want to use the pick() proc for this. Assigning the chance to each one, then having only that item drop. With the example given in your link:

mob/var/obj/loot = pick(
65; /obj/Weapon/Sword, // 65% chance
30; /obj/Weapon/BiggerSword, // 30% chance
)

mob/proc/Die()
if(src.loot) // If the mob has a loot item...
var/obj/O = new src.loot(src.loc) // Make the item and drop it at the mob's location
del(src) // Kill the mob, or whatever custom procedure you have
So to add this with monsters I would do this for example:

mob/Enemy
Team = "Enemy"
icon = 'Base.dmi'
Testing_Enemy
Level = 1
Give_Exp = 50
Strength=1
loot=list(add items here)
In response to ImmeasurableHate
Best response
For my example, you define 'loot' as a obj type, then use pick() with probabilities defined for each loot type for that mob, then spawn in the obj, if any, upon death.

To define it for specific mobs, simply use pick on their loot variable, sort of like what you have here.

mob/Enemy/Testing_Enemy/loot=pick([prob]; [path type],[prob2]; [path type2], [ect])

Which will only result in the enemy only dropping ONE item on death. You COULD use the list and for() route, but you'd be dropping multiple rare items on occasion.
In response to NNAAAAHH
Thanks you really helped me here!
In response to NNAAAAHH
Though O is undefined what would I do to make it defined with out making it a certain item?

EDIT: Errors I get:
Codes\Enemy.dm:10:error: prob: extra args
Codes\Enemy.dm:9:error: : expected a constant expression
Codes\Procedures.dm:68:warning: O: variable defined but not used

In response to ImmeasurableHate
The O variable defined but not used warning is fixed by either using O to assign variables to the obj or by removing "var/obj/O =" from that snippet. For the two errors, I'd have to see the code you're using, but the 'expected a constant expression' is likely from defining the variable that way, you might have to set the item in New(). Not sure where you're calling prob() for the first error with my example, I used pick, so you might want to switch that.