ID:147215
 
Ok I need to ask this question today to. I would like to know how to write a procedure where if a mob was attacked by a certain spell or monster, how would I make it so that a poison proc would be called and drain the HP of the mob every second for about 30 seconds when it disappears?
Well, wording wise here it is:
You simply create a new procedure, you might not want to make it mob based, just to make it look pretty. Then you'll want to check if it IS a mob. Next off to giving it an argument, mob/M perferably. You should make an "ifpoisoned" variable, FALSE/0 if not; TRUE/1 if so. So if he's poisoned, then you just loop every second and damage him by whatever damage. After that, you want to check if he's dead or not. Finally, spawn 30 seconds and remove his ifpoisoned down to 0.

Now programming wise:
mob/var/ifpoisoned

proc/Poison(mob/M)
if(ismob(M))
var/i=29
while(i)
i--
sleep(10)
M.Health-=5//How much health removed.
M.CheckIfDead()//You might want to supply your own procedure.

That should give you the general idea.
In response to JohnReaper
Hmm..yeah im pretty sure I've got it now. Thanks for the help John.