do_reweave.txt
snippets · 2.3 KB · 2010-03-30
Reweave 1.0 by Rashin of TGH2: Project X (a reweave command).
Download « Back to the snippets list
Reweave 1.0 by... Rashin of TGH2: Project X |
http://tgh2.solfice.com <- Website |
telnet://tgh.solfice.com:8500 <- Mud |
langton_designs@hotmail.com <- Email |
========================================================'
All I ask for this snippet is that you email me any fixes,
enhancements, or ideas.
Directions:
The reweave code adds a down-side to getting killed. It makes players
wait in a room untill fully healed, at which time they will be able
to type 'reweave' and re-enter the main mud area.
1. Ok, so make a new room with no exits and unable to get out of.
2. define the following in merc.h, near say ROOM_VNUM_ALTAR
+#define ROOM_VNUM_DEATH //room your players, and corpse will go to when they die.
+#define ROOM_VNUM_AES //room your non-newbie-type players will go to when they leave the death room
+#define ROOM_VNUM_ACADEMY //room your newbie-type players will do to
3. add the defines to interp.c and interp.h for the do_reweave command.
4. add the following code to the bottom of act_move.c
void do_reweave (CHAR_DATA * ch, char *argument)
{
ROOM_INDEX_DATA* reroom;
if (ch->in_room->vnum != ROOM_VNUM_DEATH)
{
send_to_char ("But you're not dead!\n\r", ch);
return;
}
if (ch->hit < ch->max_hit && ch->mana < ch->max_mana && ch->move < ch->max_move)
{
send_to_char ("You're to weak to reweave.\n\r", ch);
return;
}
if (ch->level < 50)
reroom = get_room_index (ROOM_VNUM_ACADEMY);
else
reroom = get_room_index (ROOM_VNUM_AES);
send_to_char ("You are reweaved back into the pattern.\n\r", ch);
act ("$n is weaved back into the pattern.", ch, NULL, NULL, TO_ROOM);
char_from_room (ch);
char_to_room (ch, reroom);
act ("$n is weaved back into the pattern.", ch, NULL, NULL, TO_ROOM);
do_function (ch, &do_look, "auto");
return;
}
5. find the code similar in the extract_char function of handler.c and replace it with this...
if (!fPull)
{
char_to_room (ch, get_room_index (ROOM_VNUM_DEATH));
return;
}
I think that's it... if not, improvise? :)
so make clean, make, etc, dont bug me about it chronicly crashin your mud@!