|
Energy Drain Spell [by Chris Rehbein] |
|
|
|
Posted Wednesday, August 12th @ 11:26:55 PM, by George Greer in the Skills dept.
Added Mar 15, 1997. Click the link below to read it or download it.
From: Chris Rehbein <lint@jhu.edu>
Subject: A new energy drain spell
Hey, how's it going.. I've been browsing the mailing list for quite some
time, and I've decided it's time to make a definite contribution. I decided
to implement a new energy drain spell, one which adheres to the AD&D spell.
In essence, if a player casts the spell, and the victim fails a saving
throw, the victim loses a level. Also, since this is a powerful spell, a
way to balance it would be to give a 5% chance of the caster to lose a
constitution point (when his/her constitution reduces to zero, he/she dies).
Here goes.
-----<cut here>-----
/* in magic.c in the spell affects section */
case SPELL_ENERGY_DRAIN:
if (mag_savingthrow(victim, savetype)) {
act("&1$N's will resists your drain!&0", FALSE, ch, 0, victim, TO_CHAR);
return;
}
GET_LEVEL(victim) -= 1;
if (GET_LEVEL(victim) <= 0)
GET_LEVEL(victim) = 1;
GET_MAX_HIT(victim) -= dice(1, 8);
if (GET_MAX_HIT(victim) <= 0)
GET_MAX_HIT(victim) = 1;
to_room = "&1$n has been drained of a level!&0";
to_vict = "&1You have been drained of a level!&0";
if (number(0, 100) <= 5) {
GET_CON(ch) -= 1;
send_to_char("&1The gods have failed you! You have lost a
constitution point!&0\r\n", ch);
if (GET_CON(ch) <= 0) {
send_to_char("&1You have died from lack of constitution!&0\r\n", ch);
die(ch);
}
}
break;
-----<cut here>-----
There it is. It hasn't fully been tested, since my saving throws are a
little wacked out, but it should do the trick. If anyone knows of a better
way to implement the loss of a level, please share. This is pretty much my
first real, original change, so no doubt it is messy and possibly even a tad
bit buggy.
- Enjoy!
<< Economy Code (for MercMuds) [by Maniac] | Reply | View as text | Flattened | Elevator Special [by Chris Warren] >> |
|
Related Links |
|
|
|
CircleMUD Snippets |
|
|
Note: Not all of these snippets will work perfectly with
your version of code, so be prepared to fix one
or two bugs that may arise, and please let me know
what you needed to do to fix it. Sending a corrected
version is always welcome.
|
Finally, if you wish to use any of the snippets from this
page, you are more than welcome, just mention the
authors in your credits. If you wish to release any
of these snippets to the public on another site,
contact me FIRST.
|
|
|
|
|
|
|