When a monster is killed by the player in my game, I'd like the monster to have the chance of dropping an item from a predefined list (unique to that monster).
I don't seem to be having much luck, and any advice/suggestions would be greatly appreciated.
I'm trying to use the code given here as a guide... http://www.byond.com/forum/?post=173044#comment839477 but using the code...
mob/var/list/loot = new list(/obj/items/health_potion = 65)
results in two errors:
mobs.dm:5:error: list: undefined var
mobs.dm:5:error: =: expected a constant expression
What I'd like to do is have a list (loot) that all monsters have, and then add items to that list that are appropriate for each monster. Then, when that monster dies, I'd like my death() to choose a random item from that monster's loot list to drop.
Thanks for any help.