ID:143169
 
Code:
mob
proc
Death()
if (src.hp <= 0)
if (!src.npc)
if (src.name == "Jiroubo" || src.name == "Tayuya" || src.name == "Sakon")
src.Frozen = 1
world<<"[src] was killed by [src.Killer]"
src.density = 0
src.layer = TURF_LAYER-100
for(var/mob/M in world) // If there is a player around 10 spaces...
if (M.name == src.Killer)// It sets it to its target
M<<"[src] is dead..."
M.quest4+=1
src.loc = src.savedloc
sleep (150)
src.Frozen = 0
src.density = 1
src.layer = TURF_LAYER+10000
else
src.savedloc = src.loc
src.loc = locate (90,96,1)
world << "<font color = white>[src.name] was killed by [src.Killer]!"
src.hp = src.maxhp
for(var/mob/M in world) // If there is a player around 10 spaces...
if (M.name == src.Killer)// It sets it to its target
M.Yen += src.bounty/2
M.bounty += src.Yen/2
src.Yen -= src.bounty*2
else
src.Frozen = 1
world<<"[src] was killed by [src.Killer]"
src.density = 0
src.layer = TURF_LAYER-100
sleep (150)
src.Frozen = 0
src.density = 1
src.layer = TURF_LAYER+10000
else
return


Problem description:What I pretend from this is: If Jiroubo, Tayuya and Sakon are not npc's and they are killed they freeze, go invisible and lost their density, and...(this is the part that dont works) Now, the guy that kills those mobs (Tayuya, Sakon and Jiroubo aka Sound4) should get an adding to the quest 4 var (to complete the quest) and receive a message about the death of the npc, well it doesnt work. Here is one of those mobs

mob/enemy/ANBU/Jiroubo
name = "Jiroubo"
icon = 'npcs.dmi'
icon_state = "Jiroubo"
hp = 100000
quest = 1
tai = 100000
npc = 1
New()
. = ..()
spawn()
Walk()
Bump(mob/M) //when badguy bumps into someone, thing it bumps into is M
if(M.quest4 == 0) //M is a client
MonsterAttack(M) //goes to monsterattack send M
Cmon dudes help me...
 mob
proc
Death(mob/Killer)
if (src.hp <= 0)
if (!src.npc)
if (src.name =="Jiroubo" || src.name == "Tayuya" || src.name == "Sakon")
src.Frozen = 1
if(Killer)world<<"[src] was killed by [src.Killer]"
Killer<<"[src] is dead..."
Killer.quest4+=1
src.density = 0
src.layer = TURF_LAYER-100

src.loc = src.savedloc
sleep (150)
src.Frozen = 0
src.density = 1
src.layer = TURF_LAYER+10000
else
src.savedloc = src.loc
src.loc = locate (90,96,1)
world << "<font color = white>[src.name] was killed by [Killer]!"
src.hp = src.maxhp
if(Killer)
Killer.Yen += src.bounty/2
Killer.bounty += src.Yen/2
src.Yen -= src.bounty*2
else
src.Frozen = 1
world<<"[src] was killed by [Killer]"
src.density = 0
src.layer = TURF_LAYER-100
sleep (150)
src.Frozen = 0
src.density = 1
src.layer = TURF_LAYER+10000
else
return


now when there are calls to Death() say you have usr is the guy attacking and Death() is being called to the opponent.

you would put usr inside of death, Death(usr) etc. Depends though on how the proc is called. Im sure this is a WOTS rip though because of the Frozen var and the general lack of understanding of procs.. Anyway, thats why people were hesitant to help. You can have as many proc parameters as you want, and that lets you send mob references, lists, variables etc to code to use later on.
In response to Masterdan
It is not a WOTS Rip... I mean... I did all the codings and some iconning, however the base icons are ripped from WOTS (if I were able to do it...)
Anyway... when I use the Death Proch I make it this way:


if (M.hp <= 0)
M.Killer == usr (or owner if its an obj)
M.Deaht()

Thats how I use the Death Proc.

PS: Congratz on your game... ;)
In response to Cybork
And I understand procs, well... the basics, thats why my game uses the least procs I can (I dont use a proc for the Handsealings XP) But in this case I used this proc since the begining (there are 154 jutsus and throwing weapons with this proc)

Well, I just want to get credit for not having a ripped source and said that it was my game... =/ And I think that what you just done (dont take it the bad way) by telling my game was a rip coz of the "lack" understanding of procs and the Frozen var...

PS:Sorry for my spelling but I am Portuguese and I still cant spell english very well :P)

Cybork
In response to Cybork
Well, I'm not an expert on this really, but I suggest you define the Killer as a text, instead of a reference. If you're asking for the mob in the world and comparing its text name to a reference variable, one would assume some problems would occur. Or you could do it vice versa and when checking for mob in the world in the death proc, instead of using M.name just use M.

I recommend the second one if you plan on modifying the variables of the killer.
In response to SS10trunks
Did SoC start out as a WotS rip? Because it uses Frozen pretty regularly.