Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ is this possible?
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Kik
(18 posts) Bio
|
| Date
| Wed 15 Oct 2003 07:26 PM (UTC) |
| Message
| 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 | | Top |
|
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #1 on Wed 15 Oct 2003 07:53 PM (UTC) |
| Message
| 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. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
11,359 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top