Date sent: Wed, 16 Jul 1997 18:42:51 -0200 To: "Liner/Nosferatu" From: Rick Rogers (by way of Rick Rogers ) Subject: RCL 5: More spec examples Well unless there are any questions, from now on I'll just be throwing out spec examples. If you have any requests, let me know. This spec will be a spec for a room. Details follow. -------------- /* Here is a spec to transport mortals from a particular room to Market Square. It was originally written as an object spec, but I've changed it to room for this example. */ #define MRKT_SQUARE 3014 #define RANGER_ROOM 1265 int rangers_room (int room, CHAR *ch, int cmd, char *arg) { CHAR *vict=0,*next_vict; if(!ch) return FALSE; if(GET_LEVEL(ch)next_in_room; /* We loop over the characters in the room */ if(IS_MORTAL(vict) { act("$n falls through!",FALSE,vict,0,0,TO_ROOM); act("You fall through!",FALSE,vict,0,0,TO_CHAR); char_from_room(vict); char_to_room(vict, real_room(MRKT_SQUARE)); do_look(vict,"",0); act("$n falls from the heavens.",0,vict,0,0,TO_ROOM); /* The IS_MORTAL function checks to make sure the victim is a player under the IMM level. The functions char_from_room and char_to_room are pretty self explanatory. However, note we use the real_room function to find the current real room number of market square. This is impt to remember. Then we make the victim look at his new surroundings out of politeness, and tell other players at market square that the player has arrived. */ } /* if mortal check */ } /* for loop */ return TRUE; /* We return true since the open command was successful and we want the mud to stop processing it. */ } /* if cmd_open check */ return FALSE; } void assign_immortal(void) { assign_room(RANGER_ROOM, ranger_room); } ----------------- The End Rick (Ranger)