ID:270679
 
How i make a monster drop something when it dies?
Pharaoh Atem wrote:
How i make a monster drop something when it dies?

Just create a new object in the spot where it died.

This would require the use of new and possibly other procs.

A quick demo search would also do nicely in finding something in this area.
In response to Crzylme
Crzylme wrote:
Pharaoh Atem wrote:
How i make a monster drop something when it dies?

Just create a new object in the spot where it died.

This would require the use of new and possibly other procs.

A quick demo search would also do nicely in finding something in this area.

I know, but this code dont works.
    proc           //Some new procs
Death(mob/M) //Named deathcheck, and when I put M in the coding for this proc, it will mean the mob (not src, but other mob)
if(src.type == /mob/Player) //If the mobs type is that of /mob/PC
PCDeath() //Then do the PCDeathCheck on it
else //Otherwise...
if(src.HP <= 0) //if its HP is less than or equal to 0.
if(src.Exp_Give >= M.ExpNeed)
M.Bonus2 = src.Exp_Give - M.ExpNeed
M.Bonus = M.Bonus2
M.Exp += src.Exp_Give
M.LevelUp()
else
M.Exp += src.Exp_Give
s_damage(M,src.Exp_Give,"#ffffff")
M.gold += src.gold_give
M.LevelUp()
M.CreateName()
M.Custom += 1
M.overlays = null
M.overlays += HpMeter
M.check()
src.cansummon = 1
src.Deadis = 1
src.icon = 'skull.dmi'
spawn(10)
src.density = 0
spawn(10)
src.icon_state = "delete"
spawn(28)
if(src.name == "Heatman EX")
new/obj/WarpCard(src.loc)
new/obj/WarpCard2(src.loc)
del(src)
PCDeath(mob/M)
if(src.HP <= 0)
var/mob/XM
for(XM in world)
if(XM.receive_level_messages == 1)
XM << "[src] died."
if(src.Athlink == 1)
src.loc = locate(178, 818, 1)
if(src.Tenebra == 1)
src.loc = locate(372, 826, 1)
if(src.Tenebra == 0 && src.Athlink == 0)
src.loc = locate(22,59,1) //Move it to the starting point
src.HP = MaxHP //Refill the PC's HP
src.overlays = null
src.overlays += HpMeter
src.check()
src.CreateName()
//lol
M.PK ++
In response to Pharaoh Atem
I think I know what you want. You want when a monster dies, you get an item? Well Cryzlme is right, a demo search would solve your problem. But the code isn't to hard.

usr.contents+=new/obj/whateveruwantsname


Put this at the monster's death proc.
In response to DarkD3vil666
DarkD3vil666 wrote:
I think I know what you want. You want when a monster dies, you get an item? Well Cryzlme is right, a demo search would solve your problem. But the code isn't to hard.

usr.contents+=new/obj/whateveruwantsname

Put this at the monster's death proc.
Man, i want it to appear on the ground
In response to Pharaoh Atem
The most simple way is, create a 'droplist', add the objects to it a monster would drop, set a probability to it, then rbowse through the list on death and drop it if the probability wins.
for(var/obj/O in src)
O.Move(src.loc)