is this possible?

Posted by Kik on Wed 15 Oct 2003 07:26 PM — 2 posts, 11,873 views.

#0
we have embrace code for vampires running so they can embrace other players..but we needed somethin for hunters.. is it possible to create a skill called stake, and have it slay 5% of the time it hits? i know how to make skills/spells do some weird things, but didnt know if this one was possible..

Kik
USA #1
Sure. All you have to do is get a random number (using number_percent or something similar) and then just compare that against the chance you want (here, 5). If the random number is <= 5, then kill the target, only if target is a vampire.

There are a few ways you can kill the target. One, perhaps a little cheap, is to damage the target for 100,000 points of damage of an irresistable type (i.e. target can't be immune to it.) Another, perhaps better way would be to look at the damage code, and see what happens to a player when they go below 0 HP. I think the raw_kill function is called. So you'd just call that and kill the player that way.

Better yet, just look at how the slay function works, and then copy/paste/adjust.