ID:145352
 
Code:
mob/monster/spider
name = "Spider"
icon = 'monsters.dmi'
icon_state = "spider"
drops = list(/obj/thing =100,/obj/thing2 =99)

mob/var/drops = list()

mob
proc/monsterdrop(mob/M)
for(var/obj/a in M.drops)
if(prob(M.drops[a]))
new a (M.loc)
break

mob
proc
deathcheck()
src.monsterdrop(src)
src.dead = 1


Problem description: I dont know what the problem is. .. I want it to go through my monsters list of items available to drop and drop it if the probability is right. But it wont even get past the for(var/obj/a in M.drops) part. And I have no idea what the problem is. Can anyone help?

The problem is that there are no objects in the list - only types. Doing for(var/a in M.drops) will fix that.
In response to Hazman
Hazman wrote:
The problem is that there are no objects in the list - only types. Doing for(var/a in M.drops) will fix that.

It also wouldn't hurt to make it mob.drops a /list type. ;)

Hiead
In response to Hiead
Oops, didn't notice that bit.
In response to Hiead
Hiead wrote:
Hazman wrote:
The problem is that there are no objects in the list - only types. Doing for(var/a in M.drops) will fix that.

It also wouldn't hurt to make it mob.drops a /list type. ;)

Hiead

Worked great thanks for the help.. Also how would I make it a /list type?