/************************************************************ /************************************************************ * file: spec_pro.c , Special module. Pa | * MEDIEVIA CyberSpace * Usage: Procedures handling special procedures for object/ | * Copyright (C) 1992, 1996 INTENSE Software(tm) and Mik * Copyright (C) 1990, 1991 - see 'license.doc' for complete | * Al * | ************************************************************* * Copyright (C) 1992, 1993 Michael Chastain, Michael Quan, | /************************************************************ * Performance optimization and bug fixes by MERC Industries | * This program belongs to INTENSE Software, and contains trad * You can use our stuff in any way you like whatsoever so l | * INTENSE Software. The program and its contents are not to * copyright notice remains intact. If you like it please d | * to or used by any person who has not received prior authori * to mec@garnet.berkeley.edu. | * INTENSE Software. Any such disclosure or use may subject t * | * to civil and criminal penalties by law. * This is free software and you are benefitting. We hope t | ************************************************************* * share your changes too. What goes around, comes around. | ************************************************************ < #include #include #include #include #include #include #include #include > #include > #include > #include > #include #include "structs.h" #include "structs.h" #include "mob.h" #include "mob.h" #include "obj.h" #include "obj.h" #include "utils.h" #include "utils.h" #include "interp.h" #include "interp.h" #include "handler.h" #include "handler.h" #include "db.h" #include "db.h" #include "spells.h" #include "spells.h" #include "limits.h" #include "limits.h" /* external vars */ /* external vars */ | extern char *GET_REAL_NAME(struct char_data *ch); extern struct room_data *world; | struct index_data *mob_index; > extern int number_of_players(); > extern unsigned long int connect_count; > extern int number_of_rooms; > extern int number_of_zones; > extern struct zone_data *zone_table; > extern char global_color; > extern struct room_data *world[MAX_ROOM]; /* array of rooms > extern char NODEATHTRAP; extern struct descriptor_data *descriptor_list; extern struct descriptor_data *descriptor_list; extern struct index_data *obj_index; extern struct index_data *obj_index; extern struct time_info_data time_info; extern struct time_info_data time_info; | extern put_obj_in_store(struct obj_data *obj, struct char_dat | extern bool in_a_shop(struct char_data *ch); > extern char *fread_paper(FILE *fl); > extern int top_of_world; > extern int top_of_zone_table; /* extern procedures */ /* extern procedures */ | bool put_in_formation(struct char_data *leader, struct char_d void hit(struct char_data *ch, struct char_data *victim, int void hit(struct char_data *ch, struct char_data *victim, int void gain_exp(struct char_data *ch, int gain); | void gain_exp(struct char_data *ch, int gain, struct char_dat | extern bool is_formed(struct char_data *ch); void cast_burning_hands( byte level, struct char_data *ch, ch void cast_burning_hands( byte level, struct char_data *ch, ch struct char_data *victim, struct obj_data *tar_obj ); struct char_data *victim, struct obj_data *tar_obj ); void cast_chill_touch( byte level, struct char_data *ch, char void cast_chill_touch( byte level, struct char_data *ch, char struct char_data *victim, struct obj_data *tar_obj ); struct char_data *victim, struct obj_data *tar_obj ); void cast_colour_spray( byte level, struct char_data *ch, cha void cast_colour_spray( byte level, struct char_data *ch, cha struct char_data *victim, struct obj_data *tar_obj ); struct char_data *victim, struct obj_data *tar_obj ); void cast_energy_drain( byte level, struct char_data *ch, cha void cast_energy_drain( byte level, struct char_data *ch, cha struct char_data *victim, struct obj_data *tar_obj ); struct char_data *victim, struct obj_data *tar_obj ); void cast_fireball( byte level, struct char_data *ch, char *a void cast_fireball( byte level, struct char_data *ch, char *a struct char_data *victim, struct obj_data *tar_obj ); struct char_data *victim, struct obj_data *tar_obj ); void cast_magic_missile( byte level, struct char_data *ch, ch void cast_magic_missile( byte level, struct char_data *ch, ch struct char_data *victim, struct obj_data *tar_obj ); struct char_data *victim, struct obj_data *tar_obj ); void cast_blindness( byte level, struct char_data *ch, char * void cast_blindness( byte level, struct char_data *ch, char * struct char_data *tar_ch, struct obj_data *tar_obj ); struct char_data *tar_ch, struct obj_data *tar_obj ); void cast_curse( byte level, struct char_data *ch, char *arg, void cast_curse( byte level, struct char_data *ch, char *arg, struct char_data *tar_ch, struct obj_data *tar_obj ); struct char_data *tar_ch, struct obj_data *tar_obj ); void cast_sleep( byte level, struct char_data *ch, char *arg, void cast_sleep( byte level, struct char_data *ch, char *arg, struct char_data *tar_ch, struct obj_data *tar_obj ); struct char_data *tar_ch, struct obj_data *tar_obj ); void cast_armor( byte level, struct char_data *ch, char *arg, void cast_armor( byte level, struct char_data *ch, char *arg, struct char_data *tar_ch, struct obj_data *tar_obj ); struct char_data *tar_ch, struct obj_data *tar_obj ); void cast_bless( byte level, struct char_data *ch, char *arg, void cast_bless( byte level, struct char_data *ch, char *arg, struct char_data *tar_ch, struct obj_data *tar_obj ); struct char_data *tar_ch, struct obj_data *tar_obj ); void cast_cure_light( byte level, struct char_data *ch, char void cast_cure_light( byte level, struct char_data *ch, char struct char_data *tar_ch, struct obj_data *tar_obj ); struct char_data *tar_ch, struct obj_data *tar_obj ); /* Dragon breath .. */ /* Dragon breath .. */ void cast_fire_breath( byte level, struct char_data *ch, char void cast_fire_breath( byte level, struct char_data *ch, char struct char_data *tar_ch, struct obj_data *tar_obj ); struct char_data *tar_ch, struct obj_data *tar_obj ); void cast_frost_breath( byte level, struct char_data *ch, cha void cast_frost_breath( byte level, struct char_data *ch, cha struct char_data *tar_ch, struct obj_data *tar_obj ); struct char_data *tar_ch, struct obj_data *tar_obj ); void cast_acid_breath( byte level, struct char_data *ch, char void cast_acid_breath( byte level, struct char_data *ch, char struct char_data *tar_ch, struct obj_data *tar_obj ); struct char_data *tar_ch, struct obj_data *tar_obj ); void cast_gas_breath( byte level, struct char_data *ch, char void cast_gas_breath( byte level, struct char_data *ch, char struct char_data *tar_ch, struct obj_data *tar_obj ); struct char_data *tar_ch, struct obj_data *tar_obj ); void cast_lightning_breath( byte level, struct char_data *ch, void cast_lightning_breath( byte level, struct char_data *ch, int type, struct char_data *tar_ch, int type, struct char_data *tar_ch, struct obj_data *tar_obj ); struct obj_data *tar_obj ); /* Data declarations */ /* Data declarations */ struct social_type struct social_type { { char *cmd; char *cmd; int next_line; int next_line; }; }; /* ********************************************************** /* ********************************************************** * Special procedures for rooms * Special procedures for rooms ************************************************************* ************************************************************* > void do_push(struct char_data *ch, char *argument, int cmd) > { > int new_class, iWear; > if(IS_NPC(ch))return; > if(cmd==1000){ > if(!argument||!argument[0]){ > ch->p->querycommand=0; > return; > } > if(ch->specials.eggs<1000){ > send_to_char(" > You must help fight the WAR! Vryce will make you reborn into > player only if you have collected 1000 eggs from the catacomb > ch->p->querycommand=0; > return; > > } > switch(argument[0]){ > case 'M': > case 'm': > if(GET_CLASS(ch)==CLASS_MAGIC_USER|| > IS_SET(ch->player.multi_class,MULTI_C > send_to_char("You have done that already! > return; > } > new_class=CLASS_MAGIC_USER; > break; > case 'C': > case 'c': > if(GET_CLASS(ch)==CLASS_CLERIC|| > IS_SET(ch->player.multi_class,MULTI_C > send_to_char("You have done that already! > return; > } > new_class=CLASS_CLERIC; > break; > case 'W': > case 'w': > if(GET_CLASS(ch)==CLASS_WARRIOR|| > IS_SET(ch->player.multi_class,MULTI_C > send_to_char("You have done that already! > return; > } > new_class=CLASS_WARRIOR; > break; > case 'T': > case 't': > if(GET_CLASS(ch)==CLASS_THIEF|| > IS_SET(ch->player.multi_class,MULTI_C > send_to_char("You have done that already! > return; > } > new_class=CLASS_THIEF; > break; > default: > send_to_char("Huh? Try again.\n\r",ch); > return; > break; > } > ch->specials.eggs-=1000; > switch(GET_CLASS(ch)){ > case CLASS_MAGIC_USER: > SET_BIT(ch->player.multi_class,MULTI_CLASS_MA > break; > case CLASS_CLERIC: > SET_BIT(ch->player.multi_class,MULTI_CLASS_CL > break; > case CLASS_WARRIOR: > SET_BIT(ch->player.multi_class,MULTI_CLASS_WA > break; > case CLASS_THIEF: > SET_BIT(ch->player.multi_class,MULTI_CLASS_TH > break; > } > for(iWear = 0; iWear < MAX_WEAR ; iWear++) > if(ch->equipment[iWear]) > obj_to_char(unequip_char(ch,iWear), c > > GET_CLASS(ch)=new_class; > GET_LEVEL(ch)=1; > GET_EXP(ch)=1; > set_title(ch); > ch->points.max_hit=25; > ch->points.max_mana=150; > ch->points.max_move=150; > GET_HIT(ch)=25; > GET_MANA(ch)=150; > GET_MOVE(ch)=150; > ch->specials.practices+=25; > send_to_room(" > The room is filled with a blinding light for 3 full breaths.. > yourself flung as if in a hurricane...your sense of balance f > you're falling...THWOOP! You blink to clear your eyes. > ",ch->in_room); > if(GET_CLASS(ch)==CLASS_THIEF){ > ch->skills[ SKILL_SNEAK ].learned = 10; > ch->skills[ SKILL_HIDE ].learned = 5; > ch->skills[ SKILL_STEAL ].learned = 15; > ch->skills[ SKILL_BACKSTAB ].learned = 10; > ch->skills[ SKILL_PICK_LOCK ].learned = 10; > } > ch->p->querycommand=0; > return; > } > if(ch->in_room!=6151){ > send_to_char("You cannot do that here.\n\r",ch); > return; > } > if(GET_LEVEL(ch)!=31){ > send_to_char("You are ZAPPED by the button!\n\r",ch); > return; > } > if(get_total_level(ch)>=124)return; > send_to_room("A powerful voice roars across the mountain. > You ... are ... *NOT* ... ... for godhood! You are n > not OLD enough! Not complete! Go back.. Go back...... Go ba > Learn what there is to be learned from the mortal realm...lea > great and small...learn all skills..learn all classes..be eve > Come back to me, Mortal when you are Ready! > ",6151); > strcpy(ch->p->queryprompt,"Pick a class you have not mast > ([M]age [C]leric [W]arrior [T]hief) or ENTER to abort> "); > ch->p->querycommand=1000; > ch->p->queryfunc=do_push; > return; > } > > > > > > int horneg_mage_room(struct char_data *ch, int cmd, char *arg > { > struct char_data *mob=NULL; > char gotit=0; > > > mob = get_char_room("horneg", ch->in_room); > if (ch==mob) > return(FALSE); > if (mob) > { > if(GET_LEVEL(ch)>31)return(FALSE); > if(mob->specials.fighting)return(FALSE); > if(ch->equipment[WEAR_NECK_1]) > if(ch->equipment[WEAR_NECK_1]->item_number==10009 > gotit=1; > if(ch->equipment[WEAR_NECK_2]) > if(ch->equipment[WEAR_NECK_2]->item_number==10009 > gotit=1; > if(!gotit) > { > act("$n says, 'You are NOT Protected!' $n makes $ > char_from_room(ch); > char_to_room(ch, 10003); > do_look(ch, "", 15); > return(TRUE); > } > } > return(FALSE); > } > > int horneg_sarcophogus_room(struct char_data *ch, int cmd, ch > { > struct char_data *mob=NULL; > int r_num; > struct obj_data *sarcophagus=NULL, *corpse=NULL; > > if(cmd==222 > && ( isname("sarcophagus",arg) > || isname("large",arg) > || isname("stone",arg) > ) > ){ > sarcophagus=get_obj_in_list("sarcophagus",world[ch->in_r > if(!sarcophagus) > return(FALSE); > else > corpse = get_obj_in_list("corpse",sarcophagus->contai > if(!corpse) > return(FALSE); > mob = get_char_room_vis(ch, "ghost"); > if (!mob) { > act("A large veil of mist swirls up from the sarcopho > send_to_char("A large veil of mist swirls up from the > r_num = real_mobile(10014); > mob = read_mobile(r_num, REAL); > char_to_room(mob, ch->in_room); > do_emote(mob,"looks at you with fire in her eyes!",0) > do_say(mob,"You have defiled my sanctuary, now You Mu > do_close(mob,"wall",0); > hit(mob,ch,0); > return(FALSE); > } > } > return(FALSE); > } > > int convention(struct char_data *ch, int cmd, char *arg) > { > int room; > if(cmd!=28)return(FALSE); > > send_to_char("You feel dizzy and disoriented!\n\r",ch); > send_to_char("Your whole being begins fading in and out.\ > send_to_char("Past dreams confront you from all angles.\n > send_to_char("You pass out.\n\r",ch); > send_to_char("You wake up feeling groggy, remembering wha > act("$n steps into the portal and vanishes.\n\r",TRUE,ch, > if(world[ch->in_room]->number==25)room=204; > else room=25; > char_from_room(ch); > char_to_room(ch,room); > do_look(ch,"",9); > return(TRUE); > } > char *how_good(int percent) char *how_good(int percent) { { if (percent == 0) if (percent == 0) return ( " (not learned)"); return ( " (not learned)"); if (percent <= 10) if (percent <= 10) return ( " (awful)"); return ( " (awful)"); if (percent <= 20) if (percent <= 20) return ( " (bad)"); return ( " (bad)"); if (percent <= 40) if (percent <= 40) return ( " (poor)"); return ( " (poor)"); if (percent <= 55) if (percent <= 55) return ( " (average)"); return ( " (average)"); if (percent <= 70) if (percent <= 70) return ( " (fair)"); return ( " (fair)"); if (percent <= 80) if (percent <= 80) return ( " (good)"); return ( " (good)"); if (percent <= 85) if (percent <= 85) return ( " (very good)"); return ( " (very good)"); return ( " (Superb)"); return ( " (Superb)"); } } int guild(struct char_data *ch, int cmd, char *arg) | /* Gives a random Mobile the Crystal, for Tear Fountain Quest > void load_dragon_crystal(void) > { > int random, r_num,tries; > struct char_data *mob=NULL; > struct obj_data *obj=NULL; > tries=0; > r_num=real_object(1399); > if(r_num<0){ > log_hd("###Some idiot removed object 1399 for > return; > } > while(tries<1500){ > tries++; > random=number(100,top_of_world-1); > if(world[random]&&world[random]->zone<196) > for(mob=world[random]->people;mob;mob=mob->next_in_ro > if(mob > && IS_NPC(mob) > && !in_a_shop(mob) > && !(mob->specials.death_timer) /* not a corp > && (!world[mob->in_room]->level_restriction) > ){ > obj=read_object(r_num,0); > obj_to_char(obj,mob); > return; > } > } > log_hd("## gave up loading a dragon crystal after 1500 tr > } > > > int mythago_wood(struct char_data *ch, int cmd, char *arg) > { > int room; > > if ( (GET_LEVEL(ch) >=32) && IS_AFFECTED(ch,AFF_INVISIBLE > return(FALSE); > > send_to_char("A tree falls down and thumps you on the hea > send_to_char("Your whole being begins fade in and out.\n\ > send_to_char("Past dreams confronts you from all angles.\ > send_to_char("You pass out.\n\r",ch); > send_to_char("As you wake up, feeling groggy, you remembe > act("You notice $n was here a second ago and is now, Mmmm > char_from_room(ch); > do{ > room=number(5,100); > } while(room == 79 || room == 82); > /* }while(room>=2900&&room<=2999); */ > > /* skip these rooms because they were deleted them from the c > re-used in trellor. People were transporting from medievi > */ > if(room==79) > return(FALSE); > if(room==82) > return(FALSE); > > char_to_room(ch,room); > return(TRUE); > } > > int swamp_bog(struct char_data *ch, int cmd, char *arg) > { > int n; > > n=1050-(GET_WEIGHT(ch)+IS_CARRYING_W(ch))*2; > if(cmd<1||cmd>6)return(FALSE); > if(IS_AFFECTED(ch,AFF_FLYING)){ > send_to_char("You FLY just above the bog so you don't > return(FALSE); > } > if(number(0,n)<100){ > send_to_char("You try to free your feet from the bog > send_to_char("Perhaps you are TOO HEAVY! (hint)\n\r", > act("$n tries to move but is stuck in the bog mud.",T > return(TRUE); > } > return(FALSE); > > } > int river_tree(struct char_data *ch, int cmd, char *arg) > { > int gotohere=2838; > > if ( (GET_LEVEL(ch) >=32) && IS_AFFECTED(ch, AFF_INVISIBL > return(FALSE); > > while(gotohere==2838){ > gotohere=number(2800,2885); > } > send_to_char("The Old Man Willow tree GRABS YOU, in a ste > send_to_char("As you struggle to break free, it pulls you > send_to_char("You are mysteriously transported into the m > > act("The Old Man Willow tree GRABS $n, in a steel like gr > act("As $n struggles to break free, it pulls $n down its > act("$n is gone.",TRUE,ch,0,0,TO_ROOM); > char_from_room(ch); > char_to_room(ch, gotohere); > do_look(ch,"",15); > return(TRUE); > } > > int tear_fountain(struct char_data *ch, int cmd, char *arg) > { > struct obj_data *obj=NULL; > int a; > > if(cmd!=70)return(FALSE); > > for(obj=ch->carrying;obj;obj=obj->next_content) > if(obj->item_number==1399)break; > if(!obj){ > send_to_char("\n\rthe Dragon growls, 'YOU DO NOT HAVE > send_to_char("'YOU THINK I AM A FOOL MORTAL!'\n\r",ch > send_to_char("'BE GONE! BEFORE I LOOSE MY TEMPER!'\n\ > send_to_char("\n\r\n\rZZZZZAAAAaaaaaPPPP!!\n\rYou are > GET_HIT(ch)=10; > return(TRUE); > } > extract_obj(obj); > act("The Ground TREMBLES beneath your feet!",TRUE,ch,0,0, > act("The Dragon shouts, 'You have FOUND IT!'",TRUE,ch,0,0 > act("The Ground TREMBLES beneath your feet!",TRUE,ch,0,0, > act("The Dragon shouts, 'You have FOUND IT!'",TRUE,ch,0,0 > if(ch->specials.practices > 175) > { > sprintf(log_buf,"As a Reward I give you this orb! > act(log_buf,TRUE,ch,0,0,TO_ROOM); > act(log_buf,TRUE,ch,0,0,TO_CHAR); > obj_to_char(read_object(1411,REAL),ch); > sprintf(log_buf,"## %s Offered a Dragon Crystal for a > GET_NAME(ch)); > log_hd(log_buf); > } > else > { > a=number(20,75); > sprintf(log_buf,"As a Reward I give you %d Practi > act(log_buf,TRUE,ch,0,0,TO_ROOM); > act(log_buf,TRUE,ch,0,0,TO_CHAR); > do_gossip(ch, > "I FOUND THE DRAGON CRYSTAL AND HAVE > ch->specials.practices+=a; > sprintf(log_buf,"## %s Offered a Dragon Crystal for % > GET_NAME(ch),a); > log_hd(log_buf); > } > load_dragon_crystal(); > return(TRUE); > } > > int death_trap(struct char_data *ch, int cmd, char *arg) > { > /*int to_room;*/ > if(IS_HOVERING(ch) || IS_DEAD(ch) || NODEATHTRAP) > return(FALSE); > > if(GET_LEVEL(ch)>31) > return(FALSE); > send_to_char("[DEATH TRAP!] YOU ARE DEAD!\n\r",ch); > /* > if(GET_CONTINENT(ch) == TRELLOR) > to_room=230; > else > to_room=3628; > char_from_room(ch); > char_to_room(ch,to_room); > */ > raw_kill(ch,NULL); > return(1); > } > > > int Spirited_Heights_DT(struct char_data *ch, int cmd, char * > /* > Hanna tells you, 'My request is corpses in room 5164 (deathtr > moved to room 2982 with no notice of the transfer.'. > */ { { > int in_room; > > if(IS_HOVERING(ch) || IS_DEAD(ch) ) > return(FALSE); > > in_room = ch->in_room; > if ( (GET_LEVEL(ch) >=31) ) > return(FALSE); > send_to_char("Your limp body hangs impaled on the stalagmite, > send_to_char("After a few hours, the weezing finally stops.\n > send_to_char("YOU ARE DEAD!\n\r",ch); > /* > char_from_room(ch); > char_to_room(ch,2982); > */ > raw_kill(ch,NULL); > return(1); > } > > > int river_current(struct char_data *ch, int cmd, char *arg) > { > int room; > int toroom=0; > int iWear; > > if(IS_NPC(ch))return(0); > if (GET_LEVEL(ch) > 31) return(0); > if(ch->specials.fighting)return(0); > if(IS_AFFECTED(ch,AFF_FLYING))return(0); > for(iWear=0;iWear < MAX_WEAR; iWear++) > if(ch->equipment[iWear]) > if(ch->equipment[iWear]->obj_flags.type_flag==ITEM_FL > if(number(0,10)<10)return(0); > room=world[ch->in_room]->number; > > if(room==734) toroom=6216; > else if(room==6216) toroom=6220; > else if(room==6220) toroom=6215; > else if(room==6215) toroom=6219; > else if(room==6219) toroom=6218; > else if(room==6218) toroom=6217; > else if(room==6217) toroom=6221; > else if(room==6221) toroom=6222; > else if(room==6222) toroom=6223; > else if(room==6223) toroom=6225; > else if(room==6225) toroom=6224; > else if(room==6224) toroom=735; > else if((room>=706)&&(room<=725)) > toroom=room+1; > else if(room==726) toroom=729; > else if((room>=729)&&(room<=742)) > toroom=room+1; > else if(room==743) toroom=749; > else if((room>=749)&&(room<758)) toroom=room+1; > else if(room==758)toroom=764; > else if((room>=764)&&(room<=773))toroom=room+1; > > char_from_room(ch); > char_to_room(ch,toroom); > > send_to_char("\n\r**THE RIVER CURRENT PULLED YOU DOWNSTRE > act("The current pulls $n next to you.", FALSE, ch,0,0,TO > do_look(ch, "", 15); > return(1); > } char buf[MAX_STRING_LENGTH]; | int guild(struct char_data *ch, int cmd, char *arg) int nnumber, number, i, percent; | { > char prac_buf[16000]; > int mednumber,nnumber, number, i, percent; extern char *spells[]; extern char *spells[]; extern struct spell_info_type spell_info[MAX_SPL_LIST]; extern struct spell_info_type spell_info[MAX_SPL_LIST]; extern struct int_app_type int_app[26]; extern struct int_app_type int_app[26]; > static char *medt_skills[] = { > "throw", > "scan", > "meditate", > "trap", > "track", > "\n" > }; > static char *medw_skills[] = { > "charge", > "meditate", > "\n" > }; > static char *nw_skills[] = { static char *nw_skills[] = { "secondattack", "secondattack", "disarm", "disarm", "thirdattack", "thirdattack", "parry", "parry", "\n" "\n" }; }; static char *nt_skills[] = { static char *nt_skills[] = { "trip", "trip", "dodge", "dodge", "dual", "dual", "disarm", "disarm", "\n" "\n" }; }; static char *w_skills[] = { static char *w_skills[] = { "kick", /* No. 50 */ "kick", /* No. 50 */ "bash", "bash", "rescue", "rescue", "\n" "\n" }; }; static char *t_skills[] = { static char *t_skills[] = { "sneak", /* No. 45 */ "sneak", /* No. 45 */ "hide", "hide", "steal", "steal", "backstab", "backstab", "pick", "pick", "\n" "\n" }; }; #if 0 #if 0 static char *ex_skills[] = { static char *ex_skills[] = { "recall", "recall", "/n" "/n" }; }; #endif #endif > if(GET_LEVEL(ch)>=35)ch->specials.practices=100; > if ((cmd != 164) && (cmd != 170)) return(FALSE); if ((cmd != 164) && (cmd != 170)) return(FALSE); for(; *arg==' '; arg++); for(; *arg==' '; arg++); switch (GET_CLASS(ch)) { switch (GET_CLASS(ch)) { case CLASS_MAGIC_USER :{ case CLASS_MAGIC_USER :{ if (!*arg) { if (!*arg) { sprintf(buf,"You have got %d practice sessions left.\n\ | sprintf(prac_buf, "You have got %d practice sessions le ch->specials.practices); | sprintf(prac_buf, "%sGuild practicing now costs from 1 send_to_char(buf, ch); | sprintf(prac_buf, "%sYou can practice any of these spel send_to_char("You can practice any of these spells:\n\r | for(i=0; *spells[i] != '\n'; i++) for(i=0; *spells[i] != '\n'; i++) if (spell_info[i+1].spell_pointer && | if (spell_info[i+1].spell_pointer && (spell_info[i+1].min_level_magic <= GET_LEVEL(ch))) { | (spell_info[i+1].min_level_magic <= GET_LEVEL(ch sprintf(buf," %20s",spells[i]); | sprintf(prac_buf, "%s%s[%s%20s%s][%s%14s%s][%s%4d% send_to_char(buf, ch); | prac_buf, sprintf(buf,"%14s",how_good(ch->skills[i+1].learned)); | BLU(ch), NRM(ch), send_to_char(buf, ch); | spells[i], sprintf(buf," %4d",use_mana(ch,i+1)); | BLU(ch), NRM(ch), send_to_char(buf, ch); | how_good(ch->skills[i+1].learned), send_to_char("\n\r", ch); | BLU(ch), NRM(ch), } | use_mana(ch, i+1), > BLU(ch)); > } > page_string(ch->desc, prac_buf, 1); return(TRUE); return(TRUE); } } number = old_search_block(arg,0,strlen(arg),spells,FALSE) number = old_search_block(arg,0,strlen(arg),spells,FALSE) if(number == -1) { if(number == -1) { send_to_char("You do not know of this spell...\n\r", ch send_to_char("You do not know of this spell...\n\r", ch return(TRUE); return(TRUE); } } if (GET_LEVEL(ch) < spell_info[number].min_level_magic) { if (GET_LEVEL(ch) < spell_info[number].min_level_magic) { send_to_char("You do not know of this spell...\n\r", ch send_to_char("You do not know of this spell...\n\r", ch return(TRUE); return(TRUE); } } if (ch->specials.practices <= 0) { if (ch->specials.practices <= 0) { send_to_char("You do not seem to be able to practice no send_to_char("You do not seem to be able to practice no return(TRUE); return(TRUE); } } if (ch->skills[number].learned >= 95) { if (ch->skills[number].learned >= 95) { send_to_char("You are already learned in this area.\n\r send_to_char("You are already learned in this area.\n\r return(TRUE); return(TRUE); } } send_to_char("You Practice for a while...\n\r", ch); send_to_char("You Practice for a while...\n\r", ch); ch->specials.practices--; | if(ch->specials.practices>3) | ch->specials.practices-=dice(1,3); > else > if(ch->specials.practices)ch->specials.practices--; > percent = ch->skills[number].learned+MAX(25,int_app[GET_I percent = ch->skills[number].learned+MAX(25,int_app[GET_I ch->skills[number].learned = MIN(95, percent); ch->skills[number].learned = MIN(95, percent); if (ch->skills[number].learned >= 95) { if (ch->skills[number].learned >= 95) { send_to_char("You are now learned in this area.\n\r", c send_to_char("You are now learned in this area.\n\r", c return(TRUE); return(TRUE); } } } break; } break; case CLASS_THIEF: { case CLASS_THIEF: { if (!*arg) { if (!*arg) { sprintf(buf,"You have got %d practice sessions left.\n\ | sprintf(prac_buf,"You have got %d practice sessions lef ch->specials.practices); | ch->specials.practices); send_to_char(buf, ch); | sprintf(prac_buf, "%sYou can practice any of these skil send_to_char("You can practise any of these skills:\n\r | prac_buf); for(i=0; *t_skills[i] != '\n';i++) { for(i=0; *t_skills[i] != '\n';i++) { send_to_char(t_skills[i], ch); | sprintf(prac_buf, "%s%s[%s%20s%s][%s%14s%s]\n\r", send_to_char(how_good(ch->skills[i+45].learned), ch); | prac_buf, send_to_char("\n\r", ch); | BLU(ch), NRM(ch), > t_skills[i], > BLU(ch), NRM(ch), > how_good(ch->skills[i+45].learned), > BLU(ch)); } } for(i=0; *nt_skills[i] != '\n';i++) { for(i=0; *nt_skills[i] != '\n';i++) { send_to_char(nt_skills[i], ch); | sprintf(prac_buf, "%s%s[%s%20s%s][%s%14s%s]\n\r", send_to_char(how_good(ch->skills[i+SKILL_TRIP].learned), | prac_buf, send_to_char("\n\r", ch); | BLU(ch), NRM(ch), > nt_skills[i], > BLU(ch), NRM(ch), > how_good(ch->skills[i+SKILL_TRIP].learned), > BLU(ch)); } } > for(i=0; *medt_skills[i] != '\n';i++) { > sprintf(prac_buf, "%s%s[%s%20s%s][%s%14s%s]\n\r", > prac_buf, > BLU(ch), NRM(ch), > medt_skills[i], > BLU(ch), NRM(ch), > how_good(ch->skills[i+SKILL_THROW].learned), > BLU(ch)); > } > page_string(ch->desc, prac_buf, 1); return(TRUE); return(TRUE); } } number = search_block(arg,t_skills,FALSE); number = search_block(arg,t_skills,FALSE); nnumber = search_block(arg,nt_skills, FALSE); nnumber = search_block(arg,nt_skills, FALSE); | mednumber = search_block(arg,medt_skills, FALSE); if((number == -1) && (nnumber == -1)) { | if((number == -1) && (nnumber == -1) && (mednumber == -1) send_to_char("You do not know of this skill...\n\r", ch send_to_char("You do not know of this skill...\n\r", ch return(TRUE); return(TRUE); } } if (ch->specials.practices <= 0) { if (ch->specials.practices <= 0) { send_to_char("You do not seem to be able to practice no send_to_char("You do not seem to be able to practice no return(TRUE); return(TRUE); } } if (nnumber == -1) | if (nnumber == -1 && mednumber == -1) { | { if (ch->skills[number+SKILL_SNEAK].learned >= 90) { | if (ch->skills[number+SKILL_SNEAK].learned >= 90) { send_to_char("You are already learned in this area.\n\r | send_to_char("You are already learned in this area. return(TRUE); | return(TRUE); } | } send_to_char("You Practice for a while...\n\r", ch); | send_to_char("You Practice for a while...\n\r", ch); ch->specials.practices--; | if(ch->specials.practices>3) | ch->specials.practices-=dice(1,3); percent = ch->skills[number+SKILL_SNEAK].learned + | else MIN(int_app[GET_INT(ch)].learn, 12); | if(ch->specials.practices)ch->specials.practices-- ch->skills[number+SKILL_SNEAK].learned = MIN(90, percent) | percent = ch->skills[number+SKILL_SNEAK].learned + | MIN(int_app[GET_INT(ch)].learn, 12); if (ch->skills[number+SKILL_SNEAK].learned >= 90) { | ch->skills[number+SKILL_SNEAK].learned = MIN(90, perce send_to_char("You are now learned in this area.\n\r", c | if (ch->skills[number+SKILL_SNEAK].learned >= 90) { return(TRUE); | send_to_char("You are now learned in this area.\n\r } | return(TRUE); } else | } > } else if(number == -1 && mednumber == -1) { { if (ch->skills[nnumber+SKILL_TRIP].learned >= 90) { if (ch->skills[nnumber+SKILL_TRIP].learned >= 90) { send_to_char("You are already learned in this area. send_to_char("You are already learned in this area. return(TRUE); return(TRUE); } } send_to_char("You Practice for a while...\n\r", ch); send_to_char("You Practice for a while...\n\r", ch); ch->specials.practices--; | if(ch->specials.practices>3) | ch->specials.practices-=dice(1,3); > else > if(ch->specials.practices)ch->specials.practices-- percent = ch->skills[nnumber+SKILL_TRIP].learned + percent = ch->skills[nnumber+SKILL_TRIP].learned + MIN(int_app[GET_INT(ch)].learn, 12); | MIN(int_app[GET_INT(ch)].learn, 12); ch->skills[nnumber+SKILL_TRIP].learned = MIN(90, perc ch->skills[nnumber+SKILL_TRIP].learned = MIN(90, perc < if (ch->skills[nnumber+SKILL_TRIP].learned >= 90) { if (ch->skills[nnumber+SKILL_TRIP].learned >= 90) { send_to_char("You are now learned in this area.\n\r send_to_char("You are now learned in this area.\n\r return(TRUE); return(TRUE); > } > } else if(number == -1 && nnumber == -1) > { > if (ch->skills[mednumber+SKILL_THROW].learned >= 90) > send_to_char("You are already learned in this area. > return(TRUE); > } > send_to_char("You Practice for a while...\n\r", ch); > if(ch->specials.practices>3) > ch->specials.practices-=dice(1,3); > else > if(ch->specials.practices)ch->specials.practices-- > percent = ch->skills[mednumber+SKILL_THROW].learned + > MIN(int_app[GET_INT(ch)].learn, 12); > ch->skills[mednumber+SKILL_THROW].learned = MIN(90, p > if (ch->skills[mednumber+SKILL_THROW].learned >= 90) > send_to_char("You are now learned in this area.\n\r > return(TRUE); > } } } } < } break; } break; case CLASS_CLERIC :{ case CLASS_CLERIC :{ if (!*arg) { if (!*arg) { sprintf(buf,"You have got %d practice sessions left.\n\ | sprintf(prac_buf, "You have got %d practice sessions le ch->specials.practices); | sprintf(prac_buf, "%sGuild practicing now costs from 1 send_to_char(buf, ch); | sprintf(prac_buf, "%sYou can practice any of these spel send_to_char("You can practise any of these spells:\n\r < for(i=0; *spells[i] != '\n'; i++) for(i=0; *spells[i] != '\n'; i++) if (spell_info[i+1].spell_pointer && | if (spell_info[i+1].spell_pointer && (spell_info[i+1].min_level_cleric <= GET_LEVEL(ch))) | (spell_info[i+1].min_level_cleric <= GET_LEVEL(c sprintf(buf," %20s ",spells[i]); | sprintf(prac_buf, "%s%s[%s%20s%s][%s%14s%s][%s%4d% send_to_char(buf, ch); | prac_buf, sprintf(buf,"%14s",how_good(ch->skills[i+1].learned)); | BLU(ch), NRM(ch), send_to_char(buf, ch); | spells[i], sprintf(buf," %4d",use_mana(ch,i+1)); | BLU(ch), NRM(ch), send_to_char(buf, ch); | how_good(ch->skills[i+1].learned), send_to_char("\n\r", ch); | BLU(ch), NRM(ch), } | use_mana(ch, i+1), > BLU(ch)); > } > page_string(ch->desc, prac_buf, 1); return(TRUE); return(TRUE); } } > number = old_search_block(arg,0,strlen(arg),spells,FALSE) number = old_search_block(arg,0,strlen(arg),spells,FALSE) if(number == -1) { if(number == -1) { send_to_char("You do not know of this spell...\n\r", ch send_to_char("You do not know of this spell...\n\r", ch return(TRUE); return(TRUE); } } if (GET_LEVEL(ch) < spell_info[number].min_level_cleric) if (GET_LEVEL(ch) < spell_info[number].min_level_cleric) send_to_char("You do not know of this spell...\n\r", ch send_to_char("You do not know of this spell...\n\r", ch return(TRUE); return(TRUE); } } if (ch->specials.practices <= 0) { if (ch->specials.practices <= 0) { send_to_char("You do not seem to be able to practice no send_to_char("You do not seem to be able to practice no return(TRUE); return(TRUE); } } if (ch->skills[number].learned >= 95) { if (ch->skills[number].learned >= 95) { send_to_char("You are already learned in this area.\n\r send_to_char("You are already learned in this area.\n\r return(TRUE); return(TRUE); } } send_to_char("You Practice for a while...\n\r", ch); send_to_char("You Practice for a while...\n\r", ch); ch->specials.practices--; | if(ch->specials.practices>3) > ch->specials.practices-=dice(1,3); > else > if(ch->specials.practices)ch->specials.practices--; > percent = ch->skills[number].learned+MAX(25,int_app[GET_I percent = ch->skills[number].learned+MAX(25,int_app[GET_I ch->skills[number].learned = MIN(95, percent); ch->skills[number].learned = MIN(95, percent); if (ch->skills[number].learned >= 95) { if (ch->skills[number].learned >= 95) { send_to_char("You are now learned in this area.\n\r", c send_to_char("You are now learned in this area.\n\r", c return(TRUE); return(TRUE); } } } break; } break; case CLASS_WARRIOR: { case CLASS_WARRIOR: { if (!*arg) { if (!*arg) { sprintf(buf,"You have got %d practice sessions left.\n\ | sprintf(prac_buf,"You have got %d practice sessions lef ch->specials.practices); ch->specials.practices); send_to_char(buf, ch); | sprintf(prac_buf,"%sYou can practice any of these skill send_to_char("You can practise any of these skills:\n\r < for(i=0; *w_skills[i] != '\n';i++) { for(i=0; *w_skills[i] != '\n';i++) { send_to_char(w_skills[i], ch); | sprintf(prac_buf, "%s%s[%s%20s%s][%s%14s%s]\n\r", send_to_char(how_good(ch->skills[i+SKILL_KICK].learned), | prac_buf, send_to_char("\n\r", ch); | BLU(ch), NRM(ch), > w_skills[i], > BLU(ch), NRM(ch), > how_good(ch->skills[i+SKILL_KICK].learned), > BLU(ch)); } } for(i=0; *nw_skills[i] != '\n';i++) { for(i=0; *nw_skills[i] != '\n';i++) { send_to_char(nw_skills[i],ch); | sprintf(prac_buf, "%s%s[%s%20s%s][%s%14s%s]\n\r", send_to_char(how_good(ch->skills[i+SKILL_SECOND_ATTACK].l | prac_buf, send_to_char("\n\r", ch); | BLU(ch), NRM(ch), > nw_skills[i], > BLU(ch), NRM(ch), > how_good(ch->skills[i+SKILL_SECOND_ATTACK].learne > BLU(ch)); > } > for(i=0; *medw_skills[i] != '\n';i++) { > sprintf(prac_buf, "%s%s[%s%20s%s][%s%14s%s]\n\r", > prac_buf, > BLU(ch), NRM(ch), > medw_skills[i], > BLU(ch), NRM(ch), > how_good(ch->skills[i+SKILL_CHARGE].learned), > BLU(ch)); } } > page_string(ch->desc, prac_buf, 1); return(TRUE); return(TRUE); } } number = search_block(arg, w_skills, FALSE); number = search_block(arg, w_skills, FALSE); nnumber = search_block(arg, nw_skills, FALSE); nnumber = search_block(arg, nw_skills, FALSE); | mednumber = search_block(arg, medw_skills, FALSE); if((number == -1) && (nnumber == -1)) { | if((number == -1) && (nnumber == -1 && (mednumber == -1)) send_to_char("You do not have ability to practise this | send_to_char("You do not have ability to practice this return(TRUE); return(TRUE); } } if (ch->specials.practices <= 0) { if (ch->specials.practices <= 0) { send_to_char("You do not seem to be able to practice no send_to_char("You do not seem to be able to practice no return(TRUE); return(TRUE); } } if (nnumber == -1) | if (nnumber == -1 && mednumber == -1) { { if (ch->skills[number+SKILL_KICK].learned >= 85) { if (ch->skills[number+SKILL_KICK].learned >= 85) { send_to_char("You are already learned in this area.\n\r send_to_char("You are already learned in this area.\n\r return(TRUE); return(TRUE); } } send_to_char("You Practice for a while...\n\r", ch); send_to_char("You Practice for a while...\n\r", ch); ch->specials.practices--; | if(ch->specials.practices>3) > ch->specials.practices-=dice(1,3); > else > if(ch->specials.practices)ch->specials.practices--; > percent = ch->skills[number+SKILL_KICK].learned + percent = ch->skills[number+SKILL_KICK].learned + MIN(12, int_app[GET_INT(ch)].learn); MIN(12, int_app[GET_INT(ch)].learn); ch->skills[number+SKILL_KICK].learned = MIN(85, percent); ch->skills[number+SKILL_KICK].learned = MIN(85, percent); if (ch->skills[number+SKILL_KICK].learned >= 85) { if (ch->skills[number+SKILL_KICK].learned >= 85) { send_to_char("You are now learned in this area.\n\r", c send_to_char("You are now learned in this area.\n\r", c return(TRUE); return(TRUE); } } } else | } else if((number == -1) && (mednumber == -1)) { { if (ch->skills[nnumber+SKILL_SECOND_ATTACK].learned > if (ch->skills[nnumber+SKILL_SECOND_ATTACK].learned > send_to_char("You are already learned in this area. send_to_char("You are already learned in this area. return(TRUE); return(TRUE); } } send_to_char("You Practice for a while...\n\r", ch); send_to_char("You Practice for a while...\n\r", ch); ch->specials.practices--; | if(ch->specials.practices>3) | ch->specials.practices-=dice(1,3); > else > if(ch->specials.practices)ch->specials.practices- percent = ch->skills[nnumber+SKILL_SECOND_ATTACK].lea percent = ch->skills[nnumber+SKILL_SECOND_ATTACK].lea MIN(12, int_app[GET_INT(ch)].learn); | MIN(12, int_app[GET_INT(ch)].learn); ch->skills[nnumber+SKILL_SECOND_ATTACK].learned = MIN ch->skills[nnumber+SKILL_SECOND_ATTACK].learned = MIN < if (ch->skills[nnumber+SKILL_SECOND_ATTACK].learned > if (ch->skills[nnumber+SKILL_SECOND_ATTACK].learned > send_to_char("You are now learned in this area.\n\r send_to_char("You are now learned in this area.\n\r return(TRUE); return(TRUE); } | } > }else if((number==-1)&&(nnumber==-1)) > { > if (ch->skills[mednumber+SKILL_CHARGE].learned >= 85) > send_to_char("You are already learned in this area. > return(TRUE); > } > send_to_char("You Practice for a while...\n\r", ch); > if(ch->specials.practices>3) > ch->specials.practices-=dice(1,3); > else > if(ch->specials.practices)ch->specials.practices- > percent = ch->skills[mednumber+SKILL_CHARGE].learned > MIN(12, int_app[GET_INT(ch)].learn); > ch->skills[mednumber+SKILL_CHARGE].learned = MIN(85, > if (ch->skills[mednumber+SKILL_CHARGE].learned >= 85) > send_to_char("You are now learned in this area.\n\r > return(TRUE); > } } } > } break; } break; } } return (TRUE); return (TRUE); } } int train(struct char_data *ch, int cmd, char *arg) int train(struct char_data *ch, int cmd, char *arg) { { char buf[256]; | char buf[MAX_STRING_LENGTH]; sbyte *pAbility = NULL; sbyte *pAbility = NULL; sbyte *pTmpAbility = NULL; sbyte *pTmpAbility = NULL; int cost = 5; | int cost = 35; /* /* * Check for right command. * Check for right command. * Strip white space on arg. * Strip white space on arg. */ */ if ( cmd != 165 ) if ( cmd != 165 ) return FALSE; return FALSE; while ( *arg == ' ' ) while ( *arg == ' ' ) arg++; arg++; if ( *arg == '\0' ) if ( *arg == '\0' ) { { sprintf( buf, "You have %d practice sessions left.\n\ sprintf( buf, "You have %d practice sessions left.\n\ ch->specials.practices ); ch->specials.practices ); send_to_char( buf, ch ); send_to_char( buf, ch ); > send_to_char("Training costs you 35 Practice points e > send_to_char("The following costs 20 practice points > send_to_char("WARRIOR str sta, MAGE int, CLERIC wis, arg = "foo"; arg = "foo"; } } if ( !str_cmp( arg, "str" ) ) if ( !str_cmp( arg, "str" ) ) { { if ( GET_CLASS(ch) == CLASS_WARRIOR ) if ( GET_CLASS(ch) == CLASS_WARRIOR ) cost = 3; | cost = 20; pAbility = &ch->abilities.str; pAbility = &ch->abilities.str; pTmpAbility = &ch->tmpabilities.str; pTmpAbility = &ch->tmpabilities.str; } } else if ( !str_cmp( arg, "int" ) ) else if ( !str_cmp( arg, "int" ) ) { { if ( GET_CLASS(ch) == CLASS_MAGIC_USER ) if ( GET_CLASS(ch) == CLASS_MAGIC_USER ) cost = 3; | cost = 20; pAbility = &ch->abilities.intel; pAbility = &ch->abilities.intel; pTmpAbility = &ch->tmpabilities.intel; pTmpAbility = &ch->tmpabilities.intel; } } else if ( !str_cmp( arg, "wis" ) ) else if ( !str_cmp( arg, "wis" ) ) { { if ( GET_CLASS(ch) == CLASS_CLERIC ) if ( GET_CLASS(ch) == CLASS_CLERIC ) cost = 3; | cost = 20; pAbility = &ch->abilities.wis; pAbility = &ch->abilities.wis; pTmpAbility = &ch->tmpabilities.wis; pTmpAbility = &ch->tmpabilities.wis; } } else if ( !str_cmp( arg, "con" ) ) else if ( !str_cmp( arg, "con" ) ) { { pAbility = &ch->abilities.con; pAbility = &ch->abilities.con; pTmpAbility = &ch->tmpabilities.con; pTmpAbility = &ch->tmpabilities.con; } } else if ( !str_cmp( arg, "dex" ) ) else if ( !str_cmp( arg, "dex" ) ) { { if ( GET_CLASS(ch) == CLASS_THIEF ) if ( GET_CLASS(ch) == CLASS_THIEF ) cost = 3; | cost = 20; pAbility = &ch->abilities.dex; pAbility = &ch->abilities.dex; pTmpAbility = &ch->tmpabilities.dex; pTmpAbility = &ch->tmpabilities.dex; } } > else if ( !str_cmp( arg, "sta" ) ) > { > if ( GET_CLASS(ch) == CLASS_WARRIOR ) > cost = 20; > if ( GET_CLASS(ch) == CLASS_THIEF ) > cost = 20; > pAbility = &ch->abilities.sta; > pTmpAbility = &ch->tmpabilities.sta; > } > else else { { send_to_char( "You can train in: str int wis con dex. | send_to_char( "You can train in: str int wis con dex return TRUE; return TRUE; } } if ( cost > ch->specials.practices ) if ( cost > ch->specials.practices ) { { send_to_char( "You don't have enough practices.\n\r", send_to_char( "You don't have enough practices.\n\r", return TRUE; return TRUE; } } if ( *pAbility >= 18 || *pTmpAbility >= 18 ) if ( *pAbility >= 18 || *pTmpAbility >= 18 ) { { send_to_char( "That ability is already at maximum.\n\ send_to_char( "That ability is already at maximum.\n\ return TRUE; return TRUE; } } ch->specials.practices -= cost; | if(ch->specials.practices>=cost) > ch->specials.practices -= cost; > else{ > send_to_char("Sorry not enough practices points left. > return TRUE; > } *pAbility += 1; *pAbility += 1; *pTmpAbility += 1; *pTmpAbility += 1; send_to_char( "Your ability increases!\n\r", ch ); send_to_char( "Your ability increases!\n\r", ch ); return TRUE; return TRUE; } } < < < int mayor(struct char_data *ch, int cmd, char *arg) < { < static char open_path[] = < "W3a3003b33000c111d0d111Oe333333Oe22c222112212111a1S."; < < static char close_path[] = < "W3a3003b33000c111d0d111CE333333CE22c222112212111a1S."; < < static char *path; < static int index; < static bool move = FALSE; < < void do_move(struct char_data *ch, char *argument, int cmd) < void do_open(struct char_data *ch, char *argument, int cmd) < void do_lock(struct char_data *ch, char *argument, int cmd) < void do_unlock(struct char_data *ch, char *argument, int cm < void do_close(struct char_data *ch, char *argument, int cmd < < < if (!move) { < if (time_info.hours == 6) { < move = TRUE; < path = open_path; < index = 0; < } else if (time_info.hours == 20) { < move = TRUE; < path = close_path; < index = 0; < } < } < < if (cmd || !move || (GET_POS(ch) < POSITION_SLEEPING) || < (GET_POS(ch) == POSITION_FIGHTING)) < return FALSE; < < switch (path[index]) { < case '0' : < case '1' : < case '2' : < case '3' : < do_move(ch,"",path[index]-'0'+1); < break; < < case 'W' : < GET_POS(ch) = POSITION_STANDING; < act("$n awakens and groans loudly.", < FALSE,ch,0,0,TO_ROOM); < break; < < case 'S' : < GET_POS(ch) = POSITION_SLEEPING; < act("$n lies down and instantly falls asleep.", < FALSE,ch,0,0,TO_ROOM); < break; < < case 'a' : < act("$n says 'Hello Honey!'",FALSE,ch,0,0,TO_ROOM); < act("$n smirks.",FALSE,ch,0,0,TO_ROOM); < break; < < case 'b' : < act("$n says 'What a view! I must get something done ab < FALSE,ch,0,0,TO_ROOM); < break; < < case 'c' : < act( < "$n says 'Vandals! Youngsters nowadays have no respect < FALSE,ch,0,0,TO_ROOM); < break; < < case 'd' : < act("$n says 'Good day, citizens!'", FALSE, ch, 0,0,TO_ < break; < < case 'e' : < act("$n says 'I hereby declare the bazaar open!'",FALSE < break; < < case 'E' : < act("$n says 'I hereby declare Midgaard closed!'",FALSE < break; < < case 'O' : < do_unlock(ch, "gate", 0); < do_open(ch, "gate", 0); < break; < < case 'C' : < do_close(ch, "gate", 0); < do_lock(ch, "gate", 0); < break; < < case '.' : < move = FALSE; < break; < < } < < index++; < return FALSE; < } < < /* ********************************************************** /* ********************************************************** * General special procedures for mobiles * General special procedures for mobiles ************************************************************* ************************************************************* /* SOCIAL GENERAL PROCEDURES /* SOCIAL GENERAL PROCEDURES If first letter of the command is '!' this will mean that the If first letter of the command is '!' this will mean that the command will be executed immediately. command will be executed immediately. "G",n : Sets next line to n "G",n : Sets next line to n "g",n : Sets next line relative to n, fx. line+=n "g",n : Sets next line relative to n, fx. line+=n "m",n : move to , is 0,1,2,3,4 or 5 "m",n : move to , is 0,1,2,3,4 or 5 "w",n : Wake up and set standing (if possible) "w",n : Wake up and set standing (if possible) "c",n : Look for a person named in the room "c",n : Look for a person named in the room "o",n : Look for an object named in the room "o",n : Look for an object named in the room "r",n : Test if the npc in room number ? "r",n : Test if the npc in room number ? "s",n : Go to sleep, return false if can't go sleep "s",n : Go to sleep, return false if can't go sleep "e",n : echo to the room, can use $o/$p/$N dependi "e",n : echo to the room, can use $o/$p/$N dependi contents of the **thing contents of the **thing "E",n : Send to person pointed to by thing "E",n : Send to person pointed to by thing "B",n : Send to room, except to thing "B",n : Send to room, except to thing "?",n : in [1..99]. A random chance of % succ "?",n : in [1..99]. A random chance of % succ Will as usual advance one line upon sucess, and Will as usual advance one line upon sucess, and relative n lines upon failure. relative n lines upon failure. "O",n : Open if in sight. "O",n : Open if in sight. "C",n : Close if in sight. "C",n : Close if in sight. "L",n : Lock if in sight. "L",n : Lock if in sight. "U",n : Unlock if in sight. */ "U",n : Unlock if in sight. */ /* Execute a social command. /* Execute a social command. void exec_social(struct char_data *npc, char *cmd, int next_l void exec_social(struct char_data *npc, char *cmd, int next_l int *cur_line, void **thing) int *cur_line, void **thing) { { bool ok; bool ok; void do_move(struct char_data *ch, char *argument, int cmd) void do_move(struct char_data *ch, char *argument, int cmd) void do_open(struct char_data *ch, char *argument, int cmd) void do_open(struct char_data *ch, char *argument, int cmd) void do_lock(struct char_data *ch, char *argument, int cmd) void do_lock(struct char_data *ch, char *argument, int cmd) void do_unlock(struct char_data *ch, char *argument, int cm void do_unlock(struct char_data *ch, char *argument, int cm void do_close(struct char_data *ch, char *argument, int cmd void do_close(struct char_data *ch, char *argument, int cmd if (GET_POS(npc) == POSITION_FIGHTING) if (GET_POS(npc) == POSITION_FIGHTING) return; return; ok = TRUE; ok = TRUE; switch (*cmd) { switch (*cmd) { case 'G' : case 'G' : *cur_line = next_line; *cur_line = next_line; return; return; case 'g' : case 'g' : *cur_line += next_line; *cur_line += next_line; return; return; case 'e' : case 'e' : act(cmd+1, FALSE, npc, *thing, *thing, TO_ROOM); act(cmd+1, FALSE, npc, *thing, *thing, TO_ROOM); break; break; case 'E' : case 'E' : act(cmd+1, FALSE, npc, 0, *thing, TO_VICT); act(cmd+1, FALSE, npc, 0, *thing, TO_VICT); break; break; case 'B' : case 'B' : act(cmd+1, FALSE, npc, 0, *thing, TO_NOTVICT); act(cmd+1, FALSE, npc, 0, *thing, TO_NOTVICT); break; break; case 'm' : case 'm' : do_move(npc, "", *(cmd+1)-'0'+1); do_move(npc, "", *(cmd+1)-'0'+1); break; break; case 'w' : case 'w' : if (GET_POS(npc) != POSITION_SLEEPING) if (GET_POS(npc) != POSITION_SLEEPING) ok = FALSE; ok = FALSE; else else GET_POS(npc) = POSITION_STANDING; GET_POS(npc) = POSITION_STANDING; break; break; case 's' : case 's' : if (GET_POS(npc) <= POSITION_SLEEPING) if (GET_POS(npc) <= POSITION_SLEEPING) ok = FALSE; ok = FALSE; else else GET_POS(npc) = POSITION_SLEEPING; GET_POS(npc) = POSITION_SLEEPING; break; break; case 'c' : /* Find char in room */ case 'c' : /* Find char in room */ *thing = get_char_room_vis(npc, cmd+1); *thing = get_char_room_vis(npc, cmd+1); ok = (*thing != 0); ok = (*thing != 0); break; break; case 'o' : /* Find object in room */ case 'o' : /* Find object in room */ *thing = get_obj_in_list_vis(npc, cmd+1, world[npc->in_ | *thing = get_obj_in_list_vis(npc, cmd+1, world[npc->in_ ok = (*thing != 0); ok = (*thing != 0); break; break; case 'r' : /* Test if in a certain room */ case 'r' : /* Test if in a certain room */ ok = (npc->in_room == atoi(cmd+1)); ok = (npc->in_room == atoi(cmd+1)); break; break; case 'O' : /* Open something */ case 'O' : /* Open something */ do_open(npc, cmd+1, 0); do_open(npc, cmd+1, 0); break; break; case 'C' : /* Close something */ case 'C' : /* Close something */ do_close(npc, cmd+1, 0); do_close(npc, cmd+1, 0); break; break; case 'L' : /* Lock something */ case 'L' : /* Lock something */ do_lock(npc, cmd+1, 0); do_lock(npc, cmd+1, 0); break; break; case 'U' : /* UnLock something */ case 'U' : /* UnLock something */ do_unlock(npc, cmd+1, 0); do_unlock(npc, cmd+1, 0); break; break; case '?' : /* Test a random number */ case '?' : /* Test a random number */ if (atoi(cmd+1) <= number(1,100)) if (atoi(cmd+1) <= number(1,100)) ok = FALSE; ok = FALSE; break; break; default: default: break; break; } /* End Switch */ } /* End Switch */ if (ok) if (ok) (*cur_line)++; (*cur_line)++; else else (*cur_line) += next_line; (*cur_line) += next_line; } } void npc_steal(struct char_data *ch,struct char_data *victim) void npc_steal(struct char_data *ch,struct char_data *victim) { { int gold; int gold; if(IS_NPC(victim)) return; | if(IS_NPC(victim) || (GET_LEVEL(victim)>31)) return; if(GET_LEVEL(victim)>20) return; < if (AWAKE(victim) && (number(0,GET_LEVEL(ch)) == 0)) { if (AWAKE(victim) && (number(0,GET_LEVEL(ch)) == 0)) { act("You discover that $n has $s hands in your wallet act("You discover that $n has $s hands in your wallet FALSE,ch,0,victim,TO_VICT); FALSE,ch,0,victim,TO_VICT); act("$n tries to steal gold from $N.",TRUE, ch, 0, vi act("$n tries to steal gold from $N.",TRUE, ch, 0, vi } else { } else { /* Steal some gold coins */ /* Steal some gold coins */ gold = (int) ((GET_GOLD(victim)*number(1,10))/100); gold = (int) ((GET_GOLD(victim)*number(1,10))/100); if (gold > 0) { if (gold > 0) { GET_GOLD(ch) += gold; GET_GOLD(ch) += gold; GET_GOLD(victim) -= gold; GET_GOLD(victim) -= gold; } } } } } } int snake(struct char_data *ch, int cmd, char *arg) int snake(struct char_data *ch, int cmd, char *arg) { { void cast_poison( byte level, struct char_data *ch, char void cast_poison( byte level, struct char_data *ch, char struct char_data *tar_ch, struct obj_data *tar_obj ); struct char_data *tar_ch, struct obj_data *tar_obj ); if(cmd) return FALSE; if(cmd) return FALSE; if(GET_POS(ch)!=POSITION_FIGHTING) return FALSE; if(GET_POS(ch)!=POSITION_FIGHTING) return FALSE; if ( ch->specials.fighting && if ( ch->specials.fighting && (ch->specials.fighting->in_room == ch->in_room) && (ch->specials.fighting->in_room == ch->in_room) && number(0 , 99) < 2 * GET_LEVEL(ch) ) | number(0 , 99) < 3 * GET_LEVEL(ch) ) { { act("You bite $N!", 1, ch, 0, ch->specials.fighti act("You bite $N!", 1, ch, 0, ch->specials.fighti act("$n bites $N!", 1, ch, 0, ch->specials.fighti act("$n bites $N!", 1, ch, 0, ch->specials.fighti act("$n bites you!", 1, ch, 0, ch->specials.fight act("$n bites you!", 1, ch, 0, ch->specials.fight cast_poison( GET_LEVEL(ch), ch, "", SPELL_TYPE_SP cast_poison( GET_LEVEL(ch), ch, "", SPELL_TYPE_SP ch->specials.fighting, 0); ch->specials.fighting, 0); return TRUE; return TRUE; } } return FALSE; return FALSE; } } int thief(struct char_data *ch, int cmd, char *arg) int thief(struct char_data *ch, int cmd, char *arg) { { struct char_data *cons; | struct char_data *cons=NULL; if(cmd) return FALSE; if(cmd) return FALSE; if(GET_POS(ch)!=POSITION_STANDING)return FALSE; if(GET_POS(ch)!=POSITION_STANDING)return FALSE; for(cons = world[ch->in_room].people; cons; cons = cons-> | for(cons = world[ch->in_room]->people; cons; cons = cons- if((!IS_NPC(cons)) && (GET_LEVEL(cons)<32) && (number if((!IS_NPC(cons)) && (GET_LEVEL(cons)<32) && (number npc_steal(ch,cons); npc_steal(ch,cons); return TRUE; return TRUE; } } int magic_user(struct char_data *ch, int cmd, char *arg) | > int red_dragon(struct char_data *ch, int cmd, char *arg) { { struct char_data *vict; | struct char_data *vict=NULL; if(cmd) return FALSE; | if (cmd) return FALSE; if(GET_POS(ch)!=POSITION_FIGHTING) return FALSE; if(GET_POS(ch)!=POSITION_FIGHTING) return FALSE; if(!ch->specials.fighting) return FALSE; if(!ch->specials.fighting) return FALSE; < /* Find a dude to do evil things upon ! */ /* Find a dude to do evil things upon ! */ for (vict = world[ch->in_room].people; vict; vict = vict- | for (vict = world[ch->in_room]->people; vict; vict = vict if (vict->specials.fighting==ch && number(0,2)==0) | if (vict->specials.fighting==ch ){ break; | act("$n breathes a cone of fire, enveloping you.",1 > cast_fire_breath(GET_LEVEL(ch), ch, "", SPELL_TYPE_ > } if (!vict) | if (!vict){ return FALSE; | act("$n's fiery breath scorches the area.", > 1, ch, 0, 0, TO_NOTVICT); > cast_fire_breath(GET_LEVEL(ch), ch, "", SPELL_TYPE_SP > ch->specials.fighting, 0); > } > return TRUE; > } if( vict!=ch->specials.fighting && GET_LEVEL(ch)>13 && nu | int white_dragon(struct char_data *ch, int cmd, char *arg) { | { act("$n utters the words 'dilan oso'.", 1, ch, 0, 0, | struct char_data *vict=NULL; cast_sleep(GET_LEVEL(ch), ch, "", SPELL_TYPE_SPELL, v < return TRUE; < } < if( (GET_LEVEL(ch)>12) && (number(0,6)==0) ) | return FALSE; { < act("$n utters the words 'gharia miwi'.", 1, ch, 0, 0 < cast_curse(GET_LEVEL(ch), ch, "", SPELL_TYPE_SPELL, v < return TRUE; < } < if( (GET_LEVEL(ch)>7) && (number(0,5)==0) ) | if(cmd) return FALSE; { < act("$n utters the words 'koholian dia'.", 1, ch, 0, < cast_blindness(GET_LEVEL(ch), ch, "", SPELL_TYPE_SPEL < return TRUE; < } < if( (GET_LEVEL(ch)>12) && (number(0,8)==0) && IS_EVIL(ch) | if(GET_POS(ch)!=POSITION_FIGHTING) return FALSE; { | act("$n utters the words 'ib er dranker'.", 1, ch, 0, | if(!ch->specials.fighting) return FALSE; cast_energy_drain(GET_LEVEL(ch), ch, "", SPELL_TYPE_S < return TRUE; < } < < switch (GET_LEVEL(ch)) { < case 1: < case 2: < case 3: < case 4: < act("$n utters the words 'hahili duvini'.", 1, ch < cast_magic_missile( < GET_LEVEL(ch), ch, "", SPELL_TYPE_SPELL, vict < break; < case 5: < case 6: < case 7: < case 8: < act("$n utters the words 'grynt oef'.", 1, ch, 0, < cast_burning_hands( < GET_LEVEL(ch), ch, "", SPELL_TYPE_SPELL, vict < break; < case 9: < case 10: < act("$n utters the words 'sjulk divi'.", 1, ch, 0 < cast_lightning_bolt( < GET_LEVEL(ch), ch, "", SPELL_TYPE_SPELL, vict < break; < case 11: < case 12: < case 13: < case 14: < act("$n utters the words 'nasson hof'.", 1, ch, 0 < cast_colour_spray( < GET_LEVEL(ch), ch, "", SPELL_TYPE_SPELL, vict < break; < default: < act("$n utters the words 'tuborg'.", 1, ch, 0, 0, < cast_fireball( < GET_LEVEL(ch), ch, "", SPELL_TYPE_SPELL, vict < break; < } < return TRUE; < } < < int Thalos_citizen(struct char_data *ch, int cmd, char *arg) < { < void do_say(struct char_data *ch, char *argument, int cmd); < struct char_data *vict; < < if (!AWAKE(ch)) < return FALSE; < < for (vict = world[ch->in_room].people; vict; vict = vict->n < if (vict->specials.fighting==ch && number(0,1)==0) < break; < < if (!vict) < return FALSE; < < switch (number(0,20)) < { < case 0 : do_say(ch, "Thalos must be the safest city arou < return TRUE; < case 1 : do_say(ch, "Don't you just love these lamia pet < do_say(ch, "They must be god's gift to man.", 0); < return TRUE; < case 2 : do_say(ch, "Hello, neighbor. How's the weather < return TRUE; < case 3 : do_say(ch, "Thalos is built to last. Don't you < return TRUE; < case 4 : do_say(ch, "Our lamia pets will do anything.", < do_say(ch, "Make our beds, serv our meals, wash the dis < return TRUE; < case 5 : do_say(ch, "Have you seen the cute little behol < do_say(ch, "the temple. He's so cuuuute!", 0); < return TRUE; < case 6 : do_say(ch, "Oh, don't worry about the old man a < do_say(ch, "guild house. He's insane.", 0); < return TRUE; < case 7 : do_say(ch, "That's a mighty big weapon you have < do_say(ch, "Off to hunt a bear?", 0); < return TRUE; < default : return FALSE; < } < } < < int baby_troll(struct char_data *ch, int cmd, char *arg) < { < struct char_data *vict; < < void do_say(struct char_data *ch, char *argument, int cmd); < < if (cmd) return FALSE; < if (!AWAKE(ch)) < return FALSE; < < if (!ch->specials.fighting) { < < for (vict = world[ch->in_room].people; vict; vict = vict- < if (number(0,1)==0) < break; < < if (!vict) < return FALSE; < < switch (number(0,15)) < { < case 1 : < act( "The baby troll says, 'Wana play?'",TRUE, vict, < break; < case 2 : < act("The baby troll says, 'Come sit down and play wit < TRUE, vict, 0, 0, TO_ROOM); < break; < case 3 : < act("The baby troll throws something greasy and grime < TRUE, vict, 0, 0, TO_ROOM); < act("The baby troll throws something greasy and grime < TRUE,vict,0,0,TO_CHAR); < break; < default: < return FALSE; < } < } < < return FALSE; < } < < int Fanatic_Hector(struct char_data *ch, int cmd, char *arg) < { < struct char_data *vict; < < void do_say(struct char_data *ch, char *argument, int cmd); < void do_emote(struct char_data *ch, char *argument, int cmd < < if (cmd || !AWAKE(ch)) < return FALSE; < < if (ch->specials.fighting) < return TRUE; < < for (vict = world[ch->in_room].people; vict; vict = vict->n < if (number(0,1)==0) < break; < < if (!vict) < return FALSE; < < switch (number(0,15)) < { < case 1 : do_say(ch, "The end of the world is comming! B < return TRUE; < case 2 : do_say(ch, "To arms! To arms! Darkness is her < return TRUE; < case 3 : do_emote(ch, < "waves his right fist covered in golden silk at you." < return TRUE; < case 4 : do_emote(ch, "spits on the banner of Thalos wit < return TRUE; < default: < return FALSE; < } < } < < int Executioner(struct char_data *ch, int cmd, char *arg) < { < struct char_data *tch; < struct char_data *mob; < char buf[MAX_INPUT_LENGTH]; < char *strName; < < if (cmd || !AWAKE(ch)) < return FALSE; < < for ( tch = world[ch->in_room].people; tch; tch = tch->ne < { < if ( IS_SET(tch->specials.affected_by, AFF_KILLER) ) < strName = "KILLER"; < else if ( IS_SET(tch->specials.affected_by, AFF_THIEF < strName = "THIEF"; < else < continue; < < sprintf( buf, < "%s is a %s! PROTECT THE INNOCENT! MORE BLOOOOD < GET_NAME(tch), < strName ); < do_shout( ch, buf, 0 ); < hit( ch, tch, TYPE_UNDEFINED ); < mob = read_mobile( real_mobile(3060), REAL ); < char_to_room( mob, ch->in_room ); < mob = read_mobile( real_mobile(3060), REAL ); < char_to_room( mob, ch->in_room ); < break; < } < < return FALSE; < } < < < < int red_dragon(struct char_data *ch, int cmd, char *arg) < { < struct char_data *vict; < < return FALSE; < < if (cmd) return FALSE; < < if(GET_POS(ch)!=POSITION_FIGHTING) return FALSE; < < if(!ch->specials.fighting) return FALSE; < < /* Find a dude to do evil things upon ! */ < < for (vict = world[ch->in_room].people; vict; vict = vict- < if (vict->specials.fighting==ch && number(0,1)==0){ < act("$n breathes fire.",1, ch, 0, 0, TO_ROOM); < cast_fire_breath(GET_LEVEL(ch), ch, "", SPELL_TYPE_ < } < < if (!vict) < if (number(0,1) == 0){ < act("$n breathes fire.",1, ch, 0, 0, TO_ROOM); < cast_fire_breath(GET_LEVEL(ch), ch, "", SPELL_TYPE_SP < ch->specials.fighting, 0); < } < < return TRUE; < } < < int white_dragon(struct char_data *ch, int cmd, char *arg) < { < struct char_data *vict; < < return FALSE; < < if(cmd) return FALSE; < < if(GET_POS(ch)!=POSITION_FIGHTING) return FALSE; < < if(!ch->specials.fighting) return FALSE; < /* Find a dude to do evil things upon ! */ /* Find a dude to do evil things upon ! */ for (vict = world[ch->in_room].people; vict; vict = vict- | for (vict = world[ch->in_room]->people; vict; vict = vict if (vict->specials.fighting==ch && number(0,1 if (vict->specials.fighting==ch && number(0,1 act("$n breathes frost.",1, ch, 0, 0, TO_ROOM); act("$n breathes frost.",1, ch, 0, 0, TO_ROOM); cast_frost_breath(GET_LEVEL(ch), ch, "", SPELL_TYPE cast_frost_breath(GET_LEVEL(ch), ch, "", SPELL_TYPE } } if (!vict) if (!vict) if (number(0,1) == 0){ if (number(0,1) == 0){ act("$n breathes frost.",1, ch, 0, 0, TO_ROOM); act("$n breathes frost.",1, ch, 0, 0, TO_ROOM); cast_frost_breath(GET_LEVEL(ch), ch, "", SPELL_TYPE_S cast_frost_breath(GET_LEVEL(ch), ch, "", SPELL_TYPE_S ch->specials.fighting, 0); ch->specials.fighting, 0); } } return TRUE; return TRUE; } } int black_dragon(struct char_data *ch, int cmd, char *arg) int black_dragon(struct char_data *ch, int cmd, char *arg) { { struct char_data *vict; struct char_data *vict; return FALSE; return FALSE; if(cmd) return FALSE; if(cmd) return FALSE; if(GET_POS(ch)!=POSITION_FIGHTING) return FALSE; if(GET_POS(ch)!=POSITION_FIGHTING) return FALSE; if(!ch->specials.fighting) return FALSE; if(!ch->specials.fighting) return FALSE; /* Find a dude to do evil things upon ! */ /* Find a dude to do evil things upon ! */ for (vict = world[ch->in_room].people; vict; vict = vict- | for (vict = world[ch->in_room]->people; vict; vict = vict if (vict->specials.fighting==ch && number(0,2)==0) if (vict->specials.fighting==ch && number(0,2)==0) break; break; if (!vict) if (!vict) if (number(0,1) == 0) if (number(0,1) == 0) { { vict = ch->specials.fighting; vict = ch->specials.fighting; if (vict == NULL) if (vict == NULL) return FALSE; return FALSE; } } else else return FALSE; return FALSE; act("$n breathes acid.",1, ch, 0, 0, TO_ROOM); act("$n breathes acid.",1, ch, 0, 0, TO_ROOM); cast_acid_breath(GET_LEVEL(ch), ch, "", SPELL_TYPE_SPELL, cast_acid_breath(GET_LEVEL(ch), ch, "", SPELL_TYPE_SPELL, return TRUE; return TRUE; } } int blue_dragon(struct char_data *ch, int cmd, char *arg) int blue_dragon(struct char_data *ch, int cmd, char *arg) { { struct char_data *vict; struct char_data *vict; return FALSE; return FALSE; if(cmd) return FALSE; if(cmd) return FALSE; if(GET_POS(ch)!=POSITION_FIGHTING) return FALSE; if(GET_POS(ch)!=POSITION_FIGHTING) return FALSE; if(!ch->specials.fighting) return FALSE; if(!ch->specials.fighting) return FALSE; /* Find a dude to do evil things upon ! */ /* Find a dude to do evil things upon ! */ for (vict = world[ch->in_room].people; vict; vict = vict- | for (vict = world[ch->in_room]->people; vict; vict = vict if (vict->specials.fighting==ch && number(0,2)==0) if (vict->specials.fighting==ch && number(0,2)==0) break; break; if (!vict) if (!vict) if (number(0,1) == 0) if (number(0,1) == 0) { { vict = ch->specials.fighting; vict = ch->specials.fighting; if (vict == NULL) if (vict == NULL) return FALSE; return FALSE; } } else else return FALSE; return FALSE; act("$n breathes lightning.",1, ch, 0, 0, TO_ROOM); act("$n breathes lightning.",1, ch, 0, 0, TO_ROOM); cast_lightning_breath(GET_LEVEL(ch), ch, "", SPELL_TYPE_S cast_lightning_breath(GET_LEVEL(ch), ch, "", SPELL_TYPE_S return TRUE; return TRUE; } } int green_dragon(struct char_data *ch, int cmd, char *arg) int green_dragon(struct char_data *ch, int cmd, char *arg) { { return FALSE; return FALSE; if ( cmd ) return FALSE; if ( cmd ) return FALSE; if(GET_POS(ch)!=POSITION_FIGHTING) return FALSE; if(GET_POS(ch)!=POSITION_FIGHTING) return FALSE; if(!ch->specials.fighting) return FALSE; if(!ch->specials.fighting) return FALSE; if(number(0,1)==0) return FALSE; if(number(0,1)==0) return FALSE; act("$n breathes gas.",1, ch, 0, 0, TO_ROOM); act("$n breathes gas.",1, ch, 0, 0, TO_ROOM); cast_gas_breath(GET_LEVEL(ch), ch, "", SPELL_TYPE_SPELL, cast_gas_breath(GET_LEVEL(ch), ch, "", SPELL_TYPE_SPELL, return TRUE; return TRUE; } } int brass_dragon(struct char_data *ch, int cmd, char *arg) int brass_dragon(struct char_data *ch, int cmd, char *arg) { { struct char_data *vict; struct char_data *vict; return FALSE; return FALSE; if ( cmd == 4 && ch->in_room == real_room(5065) ) | if ( cmd == 4 && ch->in_room == 5065 ) { { act( "The brass dragon says '$n isn't invited'", act( "The brass dragon says '$n isn't invited'", FALSE, ch, 0, 0, TO_ROOM ); FALSE, ch, 0, 0, TO_ROOM ); send_to_char( "The brass dragon says 'you're not invi send_to_char( "The brass dragon says 'you're not invi return TRUE; return TRUE; } } if ( cmd ) if ( cmd ) return FALSE; return FALSE; if(GET_POS(ch)!=POSITION_FIGHTING) return FALSE; if(GET_POS(ch)!=POSITION_FIGHTING) return FALSE; if (!ch->specials.fighting) return FALSE; if (!ch->specials.fighting) return FALSE; if (number(0,1)==0) if (number(0,1)==0) { { act("$n breathes gas.",1,ch, 0, 0, TO_ROOM); act("$n breathes gas.",1,ch, 0, 0, TO_ROOM); cast_gas_breath(GET_LEVEL(ch), ch, "", SPELL_TYPE_SPE cast_gas_breath(GET_LEVEL(ch), ch, "", SPELL_TYPE_SPE return TRUE; return TRUE; } } for (vict = world[ch->in_room].people; vict; vict = vict- | for (vict = world[ch->in_room]->people; vict; vict = vict if (vict->specials.fighting==ch && number(0,1)==0) if (vict->specials.fighting==ch && number(0,1)==0) break; break; if (!vict) if (!vict) if (number(0,1) == 0) if (number(0,1) == 0) { { vict = ch->specials.fighting; vict = ch->specials.fighting; if (vict == NULL) if (vict == NULL) return FALSE; return FALSE; } } else else return FALSE; return FALSE; act("$n breathes lightning.",1, ch, 0, 0, TO_ROOM); act("$n breathes lightning.",1, ch, 0, 0, TO_ROOM); cast_lightning_breath(GET_LEVEL(ch), ch, "", SPELL_TYPE_S cast_lightning_breath(GET_LEVEL(ch), ch, "", SPELL_TYPE_S return TRUE; return TRUE; } } > int block_way_suites(struct char_data *ch, int cmd, char *arg > { > int room, to_room; > struct char_data *k=NULL; > char flag,people; > flag=0;people=0; > if(cmd!=1&&cmd!=2&&cmd!=3&&cmd!=4&&cmd!=5&&cmd!=6) > return FALSE; > room=ch->in_room; > if(!world[room]->dir_option[cmd-1])return FALSE; > to_room=world[room]->dir_option[cmd-1]->to_room; > if(world[to_room]->level_restriction==1){ > for (k = world[to_room]->people; k; k = k->next_in_ro > if (IS_MOB(k))continue; > people++; > if(k==ch->master) > flag=1; > } > if(!people||flag)return FALSE; > > act( "That suite is taken, sorry.", > FALSE, ch, 0, k, TO_CHAR ); > return TRUE; > } > return FALSE; > > } /* ********************************************************** /* ********************************************************** * Special procedures for mobiles * Special procedures for mobiles ************************************************************* ************************************************************* > /* blocks way to any room level restrcited to 1*/ > int block_way(struct char_data *ch, int cmd, char *arg) > { > int room, to_room; > struct char_data *k=NULL; > > if (cmd>6 || cmd<1) > return FALSE; > room=ch->in_room; > if(!world[room]->dir_option[cmd-1])return FALSE; > to_room=world[room]->dir_option[cmd-1]->to_room; > if(world[to_room]->level_restriction==1){ > for (k = world[room]->people; k; k = k->next_in_room) > if ( IS_MOB(k) ) > if (mob_index[k->nr].func) > break; > if(!k)return FALSE; > > if(!IS_NPC(k)&&GET_LEVEL(k)>33){ > act( "$N bows before $n and allows $m to pass.", > FALSE, k, 0, ch, TO_ROOM ); > act( "$N bows before you, allowing you to pass.", > FALSE, k, 0, ch, TO_CHAR ); > return FALSE; > } > act( "$N shoves $n back, and blocks $s way.", > FALSE, ch, 0, k, TO_ROOM ); > act( "$N shoves you back, and blocks your way.", > FALSE, ch, 0, k, TO_CHAR ); > return TRUE; > } > return FALSE; > } int guild_guard(struct char_data *ch, int cmd, char *arg) int guild_guard(struct char_data *ch, int cmd, char *arg) { { if (cmd>6 || cmd<1) if (cmd>6 || cmd<1) return FALSE; return FALSE; if ( ( GET_CLASS(ch) != CLASS_MAGIC_USER if ( ( GET_CLASS(ch) != CLASS_MAGIC_USER && ch->in_room == real_room(3017) && cmd == 3 ) | && ch->in_room == 3017 && cmd == 3 ) || ( GET_CLASS(ch) != CLASS_CLERIC || ( GET_CLASS(ch) != CLASS_CLERIC && ch->in_room == real_room(3004) && cmd == 1 ) | && ch->in_room == 3004 && cmd == 1 ) || ( GET_CLASS(ch) != CLASS_THIEF || ( GET_CLASS(ch) != CLASS_THIEF && ch->in_room == real_room(3027) && cmd == 2 ) | && ch->in_room == 3027 && cmd == 2 ) || ( GET_CLASS(ch) != CLASS_WARRIOR || ( GET_CLASS(ch) != CLASS_WARRIOR && ch->in_room == real_room(3021) && cmd == 2 ) | && ch->in_room == 3021 && cmd == 2 ) ) ) { { act( "The guard humiliates $n, and blocks $s way.", act( "The guard humiliates $n, and blocks $s way.", FALSE, ch, 0, 0, TO_ROOM ); FALSE, ch, 0, 0, TO_ROOM ); send_to_char( send_to_char( "The guard humiliates you, and blocks your way.\n "The guard humiliates you, and blocks your way.\n return TRUE; return TRUE; } } return FALSE; return FALSE; } } int puff(struct char_data *ch, int cmd, char *arg) int puff(struct char_data *ch, int cmd, char *arg) { { void do_say(struct char_data *ch, char *argument, int cmd void do_say(struct char_data *ch, char *argument, int cmd if (cmd) if (cmd) return(0); return(0); switch (number(0, 12)) | switch (number(0, 160)) { { case 5: case 5: do_say(ch, "My god! It's full of stars!", 0); | do_say(ch, "Hey buddie, gotta bone?", 0); return(1); return(1); case 2: case 2: do_say(ch, "How'd all those fish get up here?", 0 | do_say(ch, "Hey man, been to Daddy O's today?", 0 return(1); return(1); case 8: case 8: do_say(ch, "I'm a very female dragon.", 0); | do_say(ch, "Any of you guys seen any cute female return(1); return(1); case 9: case 9: do_say(ch, "I've got a peaceful, easy feeling.", | do_say(ch, "Like WOOF!, man.", 0); > return(1); > case 10: > do_emote(ch, "scratches his ear.",0); > return(1); > case 11: > do_emote(ch, "chases his tail.",0); > return(1); > case 12: > do_emote(ch, "looks at you.",0); return(1); return(1); > case 13: > do_emote(ch, "piddles on the ground.",0); > return(1); > default: default: return(0); return(0); } } } } | int fido(struct char_data *ch, int cmd, char *arg) | int prisoner(struct char_data *ch, int cmd, char *arg) { { > void do_say(struct char_data *ch, char *argument, int cmd struct obj_data *i, *temp, *next_obj; | if (cmd) > return(0); if (cmd || !AWAKE(ch)) | switch (number(0, 60)) return(FALSE); | { > case 5: > do_say(ch, "Please take my life and free me from > return(1); > case 2: > do_emote(ch, "struggles to get free but only caus > return(1); > case 8: > do_emote(ch, "looks at you with pleading eyes.",0 > return(1); > case 9: > do_emote(ch, "tries to pick the lock on the shack > return(1); > case 10: > do_emote(ch, "sighs sadly.",0); > return(1); > case 11: > do_emote(ch, "begins to cry uncontrolably.",0); > return(1); > case 12: > do_say(ch, "If I could only kill Gith for what he > return(1); > case 13: > do_emote(ch, "mumbles to herself quietly.",0); > return(1); for (i = world[ch->in_room].contents; i; i = i->next_cont | default: if (GET_ITEM_TYPE(i)==ITEM_CONTAINER && i->obj_flags. | return(0); act("$n savagely devours a corpse.", FALSE, ch, 0 < for(temp = i->contains; temp; temp=next_obj) < { < next_obj = temp->next_content; < obj_from_obj(temp); < obj_to_room(temp,ch->in_room); < } < extract_obj(i); < return(TRUE); < } < } } return(FALSE); < } } > int towncrier(struct char_data *ch, int cmd, char *arg) > { > char buf[MAX_STRING_LENGTH]; > > void do_say(struct char_data *ch, char *argument, int cmd > > if (cmd) > return(0); > > if(GET_POS(ch) == POSITION_FIGHTING){ > if(number(0,10)) > do_say(ch,"I declare that I die entirely too often > return(1); > } > > switch (number(0, 20)) > { > case 1: > sprintf(buf, "I declare that Medievia now has %d > do_say(ch, buf, 0); > return(1); > case 2: > do_say(ch, "Hear Ye! Hear Ye! Be it known that o > return(1); > case 3: > sprintf(buf, "Let it be proclaimed throughout the > do_say(ch, buf, 0); > return(1); > case 4: > sprintf(buf, "Hear Ye! Hear Ye! Be it known tha > do_say(ch,buf,0); > return(1); > case 5: > case 6: > case 7: > sprintf(buf, "Its %d o'clock and all's well...", > ((time_info.hours % 12 == 0) ? 12 : ((time_info.h > do_say(ch,buf,0); > return(1); > default: > return(0); > } > } > int janitor(struct char_data *ch, int cmd, char *arg) int janitor(struct char_data *ch, int cmd, char *arg) { { struct obj_data *i; | struct obj_data *i=NULL; if (cmd || !AWAKE(ch)) if (cmd || !AWAKE(ch)) return(FALSE); return(FALSE); for (i = world[ch->in_room].contents; i; i = i->next_cont | for (i = world[ch->in_room]->contents; i; i = i->next_con if (IS_SET(i->obj_flags.wear_flags, ITEM_TAKE) && if (IS_SET(i->obj_flags.wear_flags, ITEM_TAKE) && ((i->obj_flags.type_flag == ITEM_DRINKCON) || ((i->obj_flags.type_flag == ITEM_DRINKCON) || (i->obj_flags.cost <= 10))) { (i->obj_flags.cost <= 10))) { act("$n picks up some trash.", FALSE, ch, 0, 0, T act("$n picks up some trash.", FALSE, ch, 0, 0, T obj_from_room(i); obj_from_room(i); obj_to_char(i, ch); obj_to_char(i, ch); return(TRUE); return(TRUE); } } } } return(FALSE); return(FALSE); } } int cityguard(struct char_data *ch, int cmd, char *arg) int cityguard(struct char_data *ch, int cmd, char *arg) { { struct char_data *tch, *evil; | struct char_data *tch=NULL, *evil=NULL; > struct char_data *next_tch=NULL; int max_evil; int max_evil; char buf[100]; | char buf[MAX_STRING_LENGTH]; if (cmd || !AWAKE(ch) || (GET_POS(ch) == POSITION_FIGHTIN if (cmd || !AWAKE(ch) || (GET_POS(ch) == POSITION_FIGHTIN return (FALSE); return (FALSE); max_evil = 300; max_evil = 300; evil = 0; evil = 0; for (tch=world[ch->in_room].people; tch; tch = tch->next_ | for (tch=world[ch->in_room]->people; tch; tch = next_tch) > next_tch=tch->next_in_room; if(IS_SET(tch->specials.affected_by, AFF_KILLER)) { if(IS_SET(tch->specials.affected_by, AFF_KILLER)) { sprintf(buf, sprintf(buf, "%s is a KILLER! PROTECT THE INNOCENT! BANZAI!!! CHARGE!!! "%s is a KILLER! PROTECT THE INNOCENT! BANZAI!!! CHARGE!!! GET_NAME(tch)); GET_NAME(tch)); do_shout(ch, buf, 0); < hit(ch, tch, TYPE_UNDEFINED); hit(ch, tch, TYPE_UNDEFINED); return (TRUE); return (TRUE); } else } else if (IS_SET(tch->specials.affected_by, AFF_THIEF)) { if (IS_SET(tch->specials.affected_by, AFF_THIEF)) { sprintf(buf, sprintf(buf, "%s is a THIEF! PROTECT THE INNOCENT! BANZAI!!! CHARGE!!! A "%s is a THIEF! PROTECT THE INNOCENT! BANZAI!!! CHARGE!!! A GET_NAME(tch)); GET_NAME(tch)); do_shout(ch, buf, 0); < hit(ch, tch, TYPE_UNDEFINED); hit(ch, tch, TYPE_UNDEFINED); return (TRUE); return (TRUE); } } if (tch->specials.fighting) { if (tch->specials.fighting) { if ((GET_ALIGNMENT(tch) < max_evil) && if ((GET_ALIGNMENT(tch) < max_evil) && (IS_NPC(tch) || IS_NPC(tch->specials.fighting))) { | (GET_LEVEL(tch) > 6) && > (IS_NPC(tch) || IS_NPC(tch->specials.fighting max_evil = GET_ALIGNMENT(tch); max_evil = GET_ALIGNMENT(tch); evil = tch; evil = tch; } } } } } } if (evil && !IS_EVIL(evil->specials.fighting)) if (evil && !IS_EVIL(evil->specials.fighting)) { { act( act( "$n screams 'PROTECT THE INNOCENT! BANZAI!!! CHARGE!!! ARAR "$n screams 'PROTECT THE INNOCENT! BANZAI!!! CHARGE!!! ARAR FALSE, ch, 0, 0, TO_ROOM); FALSE, ch, 0, 0, TO_ROOM); hit(ch, evil, TYPE_UNDEFINED); hit(ch, evil, TYPE_UNDEFINED); return(TRUE); return(TRUE); } } return(FALSE); return(FALSE); } } | int raven(struct char_data *ch, int cmd, char *arg) < int adept(struct char_data *ch, int cmd, char *arg) < { { struct char_data *tch; | void do_say(struct char_data *ch, char *argument, int cmd void do_say(struct char_data *ch, char *argument, int cmd); | if (cmd) > return(0); if (cmd || !AWAKE(ch)) | switch (number(0, 15)) return(FALSE); < < for (tch = world[ch->in_room].people; tch; tch = tch->next_ < if(!IS_NPC(tch) && number (0,2) == 1 && CAN_SEE(ch,tch)) < break; < < if (!tch) < return FALSE; < < switch (number (0,10)) < { { case 3 : | case 3: act("$n utters the words 'garf'.", 1, ch, 0, 0, TO_ROOM | do_say(ch, "Nevermore", 0); cast_cure_light(GET_LEVEL(ch), ch, "", SPELL_TYPE_SPELL | return(1); return (1); < case 7 : < act("$n utters the words 'nahk'.", 1, ch, 0, 0, TO_ROOM < cast_bless(GET_LEVEL(ch), ch, "", SPELL_TYPE_SPELL, tch < return (1); < case 6 : < act("$n utters the words 'tehctah'.", 1, ch, 0, 0, TO_R < cast_armor(GET_LEVEL(ch), ch, "", SPELL_TYPE_SPELL, tch < return (1); < case 4 : < do_say(ch,"Finish school. Don't drop out.", 0); < return (1); < case 5 : < do_say(ch,"Move it. Others want to go to this school." < return (1); < default: < return (0); < } < } < < < int mud_school_adept(struct char_data *ch, int cmd, char *arg < { < struct char_data *tch; < < void do_say(struct char_data *ch, char *argument, int cmd); < < if (cmd) < return (0); < < if (!AWAKE(ch)) < return (0); < < for (tch = world[ch->in_room].people; tch; tch = tch->next_ < if(!IS_NPC(tch) && number (0,2) == 1 && CAN_SEE(ch,tch)) < break; < if (!tch) | default: return (0); | return(0); < switch (number(0,20)) < { < case 15 : < do_say(ch,"What are you staring at?", 0); < return(1); < case 18 : < do_say(ch,"Hi, I'm your friend.", 0); < return(1); < case 3 : < do_say(ch,"Isn't this a fine school?", 0); < return(1); < case 12 : < do_say(ch,"Finish school. Dont drop out.", 0); < return(1); < case 5 : < do_say(ch,"Move it. Others want to go to this school." < return(1); < case 6 : < do_say(ch,"Be careful, don't get killed by those monste < return(1); < case 7 : < do_say(ch,"Don't forget to wear your clothes, young stu < return(1); < case 8 : < do_say(ch,"What are you doing just STANDING there?!?!!? < do_say(ch,"GET going!", 0); < return(1); < case 9 : < do_say(ch,"Hello....Hello, are you listening to me?", 0 < return(1); < default: < return(0); < } } < } < < < < int MERCling(struct char_data *ch, int cmd, char *arg) < { < void do_shout(struct char_data *ch, char *argument, i < < if (cmd) < return(0); < < switch (number(0, 12)) < { < case 0: < do_shout(ch, "Happy Birthday to Hatchet! Happy Birthda < return(1); < case 1: < do_shout(ch, "Happy Birthday to Kahn! Happy Birthday t < return(1); < case 2: < do_shout(ch, "Happy Birthday to Hatchet! Happy Birthda < return(1); < case 3: < do_shout(ch, "Happy Birthday to Kahn! Happy Birthday t < return(1); < default: < return(0); < } < } } /************************************************************ /************************************************************ * Special procedures for shops * Special procedures for shops ************************************************************* ************************************************************* int pet_shops(struct char_data *ch, int cmd, char *arg) int pet_shops(struct char_data *ch, int cmd, char *arg) { { char buf[MAX_STRING_LENGTH], pet_name[256]; | char buf[MAX_STRING_LENGTH], pet_name[MAX_STRING_LENGTH]; int pet_room; int pet_room; struct char_data *pet; | struct char_data *pet=NULL; pet_room = ch->in_room+1; | pet_room = 100; if (cmd==59) { /* List */ if (cmd==59) { /* List */ send_to_char("Available pets are:\n\r", ch); send_to_char("Available pets are:\n\r", ch); for(pet = world[pet_room].people; pet; pet = pet->nex | for(pet = world[pet_room]->people; pet; pet = pet->ne sprintf(buf, "%8d - %s\n\r", sprintf(buf, "%8d - %s\n\r", 3*GET_EXP(pet), pet->player.short_descr); 3*GET_EXP(pet), pet->player.short_descr); send_to_char(buf, ch); send_to_char(buf, ch); } } return(TRUE); return(TRUE); } else if (cmd==56) { /* Buy */ } else if (cmd==56) { /* Buy */ | if(is_formed(ch)&&ch->master!=ch){ > send_to_char("You must be your own leader.\n\r",c > return(TRUE); > } arg = one_argument(arg, buf); arg = one_argument(arg, buf); arg = one_argument(arg, pet_name); arg = one_argument(arg, pet_name); /* Pet_Name is for later use when I feel like it */ /* Pet_Name is for later use when I feel like it */ if (!(pet = get_char_room(buf, pet_room))) { if (!(pet = get_char_room(buf, pet_room))) { send_to_char("There is no such pet!\n\r", ch); send_to_char("There is no such pet!\n\r", ch); return(TRUE); return(TRUE); } } if (GET_GOLD(ch) < (GET_EXP(pet)*3)) { if (GET_GOLD(ch) < (GET_EXP(pet)*3)) { send_to_char("You don't have enough gold!\n\r", c send_to_char("You don't have enough gold!\n\r", c return(TRUE); return(TRUE); } } GET_GOLD(ch) -= GET_EXP(pet)*3; GET_GOLD(ch) -= GET_EXP(pet)*3; /* /* * Should be some code here to defend against weird m * Should be some code here to defend against weird m * getting loaded into the pet shop back room. -- Fu * getting loaded into the pet shop back room. -- Fu */ */ pet = read_mobile(pet->nr, REAL); pet = read_mobile(pet->nr, REAL); GET_EXP(pet) = 0; GET_EXP(pet) = 0; SET_BIT(pet->specials.affected_by, AFF_CHARM); SET_BIT(pet->specials.affected_by, AFF_CHARM); if (*pet_name) { if (*pet_name) { sprintf(buf,"%s %s", pet->player.name, pet_name); sprintf(buf,"%s %s", pet->player.name, pet_name); free(pet->player.name); | pet->player.name = my_free(pet->player.name); pet->player.name = str_dup(buf); pet->player.name = str_dup(buf); sprintf( buf, sprintf( buf, "%sA small sign on a chain around the neck says 'My N "%sA small sign on a chain around the neck says 'My N pet->player.description, pet_name); pet->player.description, pet_name); free(pet->player.description); | pet->player.description = my_free(pet->player.des pet->player.description = str_dup(buf); pet->player.description = str_dup(buf); } } char_to_room(pet, ch->in_room); char_to_room(pet, ch->in_room); add_follower(pet, ch); | put_in_formation(ch->master,pet); /* Be certain that pet's can't get/carry/use/weild/we /* Be certain that pet's can't get/carry/use/weild/we IS_CARRYING_W(pet) = 1000; IS_CARRYING_W(pet) = 1000; IS_CARRYING_N(pet) = 100; IS_CARRYING_N(pet) = 100; send_to_char("May you enjoy your pet.\n\r", ch); send_to_char("May you enjoy your pet.\n\r", ch); act("$n bought $N as a pet.",FALSE,ch,0,pet,TO_ROOM); act("$n bought $N as a pet.",FALSE,ch,0,pet,TO_ROOM); return(TRUE); return(TRUE); } } /* All commands except list and buy */ /* All commands except list and buy */ return(FALSE); return(FALSE); } } /* Idea of the LockSmith is functionally similar to the Pet S | int magic_cloud(struct char_data *ch, int cmd, char *arg) /* The problem here is that each key must somehow be associat | { /* with a certain player. My idea is that the players name wi | /* appear as the another Extra description keyword, prefixed | switch(cmd){ /* by the words 'item_for_' and followed by the player name. | case 1: /* The (keys) must all be stored in a room which is (virtuall | send_to_char("The section of the cloud you are st /* adjacent to the room of the lock smith. | \rfrom the cloud body. You find yourself being whisked away a > \rYou watch the land of Medievia scroll underneath you as you > \rLabrynth. The clouds slows down and places you gently down > \r", ch); > act("$n steps on a section of the cloud and is wh > TRUE,ch,0,0,TO_ROOM); > char_from_room(ch); > char_to_room(ch, 300); > act("A magical cloud sweeps down and $n steps off > return(TRUE); > break; > case 2: > send_to_char("The section of the cloud you are st > \rfrom the cloud body. You find yourself being whisked away a > \rYou watch the land of Medievia scroll underneath you as you > \rCrossroads. The clouds slows down and places you gently dow > \r", ch); > act("$n steps on a section of the cloud and is wh > TRUE,ch,0,0,TO_ROOM); > char_from_room(ch); > char_to_room(ch, 909); > act("A magical cloud sweeps down and $n steps off > TRUE,ch,0,0,TO_ROOM); > return(TRUE); > break; > case 3: > send_to_char("The section of the cloud you are st > \rfrom the cloud body. You find yourself being whisked away a > \rYou watch the land of Medievia scroll underneath you as you > \rGraveyard. The clouds slows down and places you gently down > \r", ch); > act("$n steps on a section of the cloud and is wh > TRUE,ch,0,0,TO_ROOM); > char_from_room(ch); > char_to_room(ch, 1007); > act("A magical cloud sweeps down and $n steps off > TRUE,ch,0,0,TO_ROOM); > return(TRUE); > break; > case 4: > send_to_char("The section of the cloud you are st > \rfrom the cloud body. You find yourself being whisked away a > \rYou watch the land of Medievia scroll underneath you as you > \rCastle Square. The clouds slows down and places you gently > \r", ch); > act("$n steps on a section of the cloud and is wh > TRUE,ch,0,0,TO_ROOM); > char_from_room(ch); > char_to_room(ch, 1); > act("A magical cloud sweeps down and $n steps off > TRUE,ch,0,0,TO_ROOM); > return(TRUE); > break; > case 5: > send_to_char("The section of the cloud you are st > \rfrom the cloud body. You find yourself being whisked away a > \rYou watch the land of Medievia scroll underneath you as you > \rTemple. The clouds slows down and places you gently down on > \r", > ch); > act("$n steps on a section of the cloud and is wh > TRUE,ch,0,0,TO_ROOM); > char_from_room(ch); > char_to_room(ch, 929); > act("A magical cloud sweeps down and $n steps off > TRUE,ch,0,0,TO_ROOM); > return(TRUE); > break; > case 6: > send_to_char("The section of the cloud you are st > \rfrom the cloud body. You find yourself being whisked away a > \rYou watch the land of Medievia scroll underneath you as you > \rTear! The clouds slows down and places you gently down on y > \r", > ch); > act("$n steps on a section of the cloud and is wh > TRUE,ch,0,0,TO_ROOM); > char_from_room(ch); > char_to_room(ch, 2600); > act("A magical cloud sweeps down and $n steps off > TRUE,ch,0,0,TO_ROOM); > return(TRUE); > break; > default: > return(FALSE); > break; > } > > } > > > int atm_machines_helper(struct char_data *ch, int cmd, char * > { > unsigned int deposit=0; > unsigned int balance=0; > unsigned int withdrawal=0; > FILE *fh; > char buf[MAX_STRING_LENGTH]; > unsigned int numdone=0; > > if((fh=med_open(filename, "r"))!=NULL){ > numdone=fread(&balance,sizeof(unsigned int), > med_close(fh); > } > one_argument(arg, buf); > > if (cmd==102) { /* balance */ > sprintf(buf, "Your balance is %d Gold coins\n > send_to_char(buf, ch); > return(TRUE); > } else if (cmd==101) { /* Withdrawal */ > > withdrawal=(unsigned int)atoi(arg); > if(withdrawal>balance){ > send_to_char("Insufficient funds.\n\r", ch); > return FALSE; > } > balance-=withdrawal; > GET_GOLD(ch)+=withdrawal; > if((fh=med_open(filename, "w"))!=NULL){ > numdone=fwrite(&balance, sizeof(unsig > med_close(fh); > if(numdone<1) > send_to_char("Transmission error to b > } > if(balance<=0)unlink(filename); > send_to_char("Transaction completed.\n\r", ch > sprintf(log_buf,"[%d]-Withdrawn, leaving a ba > send_to_char(log_buf,ch); > sprintf(log_buf,"%s withdrawals %d, for a bal > log_hd(log_buf); > act("$n withdraws some money.",FALSE,ch,0,0,T > return(TRUE); > } else if(cmd==100) { /* deposit */ > if(GET_LEVEL(ch)<2){ > send_to_char("You must be level 2+ to use our > return(TRUE); > } > deposit=(unsigned int)atoi(buf); > if(GET_GOLD(ch)<0)GET_GOLD(ch)=0; > if(deposit>GET_GOLD(ch)){ > send_to_char("You realize you don't have that > return(TRUE); > } > if((balance+deposit)>1000000000){ > send_to_char("SORRY 1,000,000,000 GOLD TOTAL > return(TRUE); > } > GET_GOLD(ch)-=deposit; > balance+=(deposit-(int)(deposit*.036)); > if((fh=med_open(filename, "w"))!=NULL){ > numdone=fwrite(&balance, sizeof(unsig > med_close(fh); > if(numdone<1) > send_to_char("Transmission error to b > } > sprintf(log_buf,"Transaction completed for a > send_to_char(log_buf, ch); > sprintf(log_buf,"[%d]-Deposited, leaving a ba > send_to_char(log_buf,ch); > sprintf(log_buf,"%s deposits %d, for a balanc > log_hd(log_buf); > act("$n deposits some money.",FALSE,ch,0,0,TO > return(TRUE); > } > /* All commands except list and buy */ > return(FALSE); > } /* ********************************************************** | * Special procedures for objects | int atm_machines(struct char_data *ch, int cmd, char *arg) ************************************************************* | { > char filename[MAX_STRING_LENGTH]; > char name[MAX_STRING_LENGTH],clan[MAX_INPUT_LENGTH], *arg2; > > if(IS_NPC(ch)) > { > send_to_char("We do not serve monsters!",ch); > return(FALSE); > } > if(cmd!=102&&cmd!=101&&cmd!=100) > return(FALSE); > arg2=one_argument(arg,clan); > if(!str_cmp("clan",clan)){ > if(!ch->specials.clan) > return(FALSE); > sprintf(filename,"../clan/clan_%d.atm",ch->specials.c > return(atm_machines_helper(ch,cmd,arg2,filename)) > } > strcpy(name,GET_NAME(ch)); > sprintf(filename,"%s/%c/%s.atm", SAVE_DIR, LOWER(name[0]) > return(atm_machines_helper(ch,cmd,arg,filename)); > } > > > int thief_guild(struct char_data *ch, int cmd, char *arg) > { > > char buf[MAX_STRING_LENGTH]; > int mednumber,nnumber, number, i, percent; > extern struct int_app_type int_app[26]; > > static char *medt_skills[] = { > "throw", > "scan", > "meditate", > "trap", > "\n" > }; > > static char *nt_skills[] = { > "trip", > "dodge", > "dual", > "disarm", > "\n" > }; > > static char *t_skills[] = { > "sneak", /* No. 45 */ > "hide", > "steal", > "backstab", > "pick", > "\n" > }; > > if(GET_LEVEL(ch)>=35)ch->specials.practices=100; > > if ((cmd != 164) && (cmd != 170)) return(FALSE); > > for(; *arg==' '; arg++); > > if( (GET_CLASS(ch)!=CLASS_THIEF) > && (!IS_SET(ch->player.multi_class,MULTI_CLASS_THIEF)) > ) > { > send_to_char("You watch the lesson but can't comprehend a > return(TRUE); > } > > if (!*arg) > { > sprintf(buf,"You have %d practice sessions left.\n\r" > ch->specials.practices); > send_to_char(buf, ch); > send_to_char("You can practice any of these skills:\n > for(i=0; *t_skills[i] != '\n';i++) > { > send_to_char(t_skills[i], ch); > send_to_char(how_good(ch->skills[i+45].learne > send_to_char("\n\r", ch); > } > for(i=0; *nt_skills[i] != '\n';i++) > { > send_to_char(nt_skills[i], ch); > send_to_char(how_good(ch->skills[i+SKILL_TRIP > send_to_char("\n\r", ch); > } > for(i=0; *medt_skills[i] != '\n';i++) > { > send_to_char(medt_skills[i], ch); > send_to_char(how_good(ch->skills[i+SKILL_THRO > send_to_char("\n\r", ch); > } > return(TRUE); > } > number = search_block(arg,t_skills,FALSE); > nnumber = search_block(arg,nt_skills, FALSE); > mednumber = search_block(arg,medt_skills, FALSE); > if((number == -1) && (nnumber == -1) && (mednumber == -1)) > { > send_to_char("You do not know of this skill...\n\r", > return(TRUE); > } > if (ch->specials.practices <= 0) > { > send_to_char("You do not seem to be able to practice > return(TRUE); > } > > if (nnumber == -1 && mednumber == -1) > { > if (ch->skills[number+SKILL_SNEAK].learned >= 90) > { > send_to_char("You are already learned in this > return(TRUE); > } > send_to_char("You Practice for a while...\n\r", ch); > if(ch->specials.practices>3) > ch->specials.practices-=dice(1,3); > else > if(ch->specials.practices)ch->specials.practi > percent = ch->skills[number+SKILL_SNEAK].learned + > MIN(int_app[GET_INT(ch)].learn, 12); > ch->skills[number+SKILL_SNEAK].learned = MIN(90, perc > if (ch->skills[number+SKILL_SNEAK].learned >= 90) > { > send_to_char("You are now learned in this are > return(TRUE); > } > } > else if(number == -1 && mednumber == -1) > { > if (ch->skills[nnumber+SKILL_TRIP].learned >= 90) > { > send_to_char("You are already learned in this > return(TRUE); > } > send_to_char("You Practice for a while...\n\r", ch); > if(ch->specials.practices>3) > ch->specials.practices-=dice(1,3); > else > if(ch->specials.practices)ch->specials.practi > percent = ch->skills[nnumber+SKILL_TRIP].learned + > MIN(int_app[GET_INT(ch)].lear > ch->skills[nnumber+SKILL_TRIP].learned = MIN(90, perc > if (ch->skills[nnumber+SKILL_TRIP].learned >= 90) > { > send_to_char("You are now learned in this are > return(TRUE); > } > } > else if(number == -1 && nnumber == -1) > { > if (ch->skills[mednumber+SKILL_THROW].learned >= 90) > { > send_to_char("You are already learned in this > return(TRUE); > } > send_to_char("You Practice for a while...\n\r", ch); > if(ch->specials.practices>3) > ch->specials.practices-=dice(1,3); > else > if(ch->specials.practices)ch->specials.practi > percent = ch->skills[mednumber+SKILL_THROW].learned + > MIN(int_app[GET_INT(ch)].learn, 12); > ch->skills[mednumber+SKILL_THROW].learned = MIN(90, p > if (ch->skills[mednumber+SKILL_THROW].learned >= 90) > { > send_to_char("You are now learned in this are > return(TRUE); > } > } > return (TRUE); > } > > > int mage_guild(struct char_data *ch, int cmd, char *arg) > { > > char buf[MAX_STRING_LENGTH]; > int number, i, percent; > > extern char *spells[]; > extern struct spell_info_type spell_info[MAX_SPL_LIST]; > extern struct int_app_type int_app[26]; > > > if(GET_LEVEL(ch)>=35)ch->specials.practices=100; > > if ((cmd != 164) && (cmd != 170)) return(FALSE); > > for(; *arg==' '; arg++); > > if( (GET_CLASS(ch)!=CLASS_MAGIC_USER) > && (!IS_SET(ch->player.multi_class,MULTI_CLASS_MAGIC_ > ) > { > send_to_char("You could watch the lesson but wouldn't > return(TRUE); > } > > if (!*arg) > { > sprintf(buf,"You have %d practice sessions left.\n\r" > ch->specials.practices); > send_to_char(buf, ch); > send_to_char("Guild Practicing between 1 and 3(Die Roll) > send_to_char("You can practice any of these spells:\n\r", > for(i=0; *spells[i] != '\n'; i++) > if (spell_info[i+1].spell_pointer > && (spell_info[i+1].min_level_magic <= GET_LE > { > sprintf(buf," %20s",spells[i]); > send_to_char(buf, ch); > sprintf(buf,"%14s",how_good(ch->skills[i+1].l > send_to_char(buf, ch); > sprintf(buf," %4d",use_mana(ch,i+1)); > send_to_char(buf, ch); > send_to_char("\n\r", ch); > } > return(TRUE); > } > > number = old_search_block(arg,0,strlen(arg),spells,FALSE); > if(number == -1) { > send_to_char("You do not know of this spell...\n\r", ch > return(TRUE); > } > if (GET_LEVEL(ch) < spell_info[number].min_level_magic) { > send_to_char("You do not know of this spell...\n\r", ch > return(TRUE); > } > if (ch->specials.practices <= 0) { > send_to_char("You do not seem to be able to practice no > return(TRUE); > } > if (ch->skills[number].learned >= 95) { > send_to_char("You are already learned in this area.\n\r > return(TRUE); > } > > send_to_char("You Practice for a while...\n\r", ch); > if(ch->specials.practices>3) > ch->specials.practices-=dice(1,3); > else > if(ch->specials.practices)ch->specials.practices--; > > percent = ch->skills[number].learned+MAX(25,int_app[GET_INT(c > ch->skills[number].learned = MIN(95, percent); > > if (ch->skills[number].learned >= 95) { > send_to_char("You are now learned in this area.\n\r", c > return(TRUE); > } > return (TRUE); > } > > > int warrior_guild(struct char_data *ch, int cmd, char *arg) > { > > char buf[MAX_STRING_LENGTH]; > int mednumber,nnumber, number, i, percent; > extern struct int_app_type int_app[26]; > > static char *medw_skills[] = { > "charge", > "meditate", > "\n" > }; > > static char *nw_skills[] = { > "secondattack", > "disarm", > "thirdattack", > "parry", > "\n" > }; > > static char *w_skills[] = { > "kick", /* No. 50 */ > "bash", > "rescue", > "\n" > }; > > if(GET_LEVEL(ch)>=35)ch->specials.practices=100; > > if ((cmd != 164) && (cmd != 170)) return(FALSE); > > for(; *arg==' '; arg++); > > if( (GET_CLASS(ch)!=CLASS_WARRIOR) > && (!IS_SET(ch->player.multi_class,MULTI_CLASS_WARRIOR)) > ) > { > send_to_char("You watch the lesson but don't comprehend a > return(TRUE); > } > > if (!*arg) > { > sprintf(buf,"You have %d practice sessions left.\n\r" > ch->specials.practices); > send_to_char(buf, ch); > send_to_char("You can practice any of these skills:\n > for(i=0; *w_skills[i] != '\n';i++) > { > send_to_char(w_skills[i], ch); > send_to_char(how_good(ch->skills[i+SKILL_KICK > send_to_char("\n\r", ch); > } > for(i=0; *nw_skills[i] != '\n';i++) > { > send_to_char(nw_skills[i],ch); > send_to_char(how_good(ch->skills[i+SKILL_SECO > send_to_char("\n\r", ch); > } > for(i=0; *medw_skills[i] != '\n';i++) > { > send_to_char(medw_skills[i],ch); > send_to_char(how_good(ch->skills[i+SKILL_CHAR > send_to_char("\n\r", ch); > } > return(TRUE); > } > number = search_block(arg, w_skills, FALSE); > nnumber = search_block(arg, nw_skills, FALSE); > mednumber = search_block(arg, medw_skills, FALSE); > if((number == -1) && (nnumber == -1 && (mednumber == -1))) { > send_to_char("You cannot practice this skill!\n\r", ch) > return(TRUE); > } > if (ch->specials.practices <= 0) > { > send_to_char("You do not seem to be able to practice > return(TRUE); > } > if (nnumber == -1 && mednumber == -1) > { > if (ch->skills[number+SKILL_KICK].learned >= 85) > { > send_to_char("You are already learned in this > return(TRUE); > } > send_to_char("You Practice for a while...\n\r", ch); > if(ch->specials.practices>3) > ch->specials.practices-=dice(1,3); > else > if(ch->specials.practices)ch->specials.practi > > percent = ch->skills[number+SKILL_KICK].learned + > MIN(12, int_app[GET_INT(ch)].learn); > ch->skills[number+SKILL_KICK].learned = MIN(85, percent); > > if (ch->skills[number+SKILL_KICK].learned >= 85) > { > send_to_char("You are now learned in this are > return(TRUE); > } > } > else if((number == -1) && (mednumber == -1)) > { > if (ch->skills[nnumber+SKILL_SECOND_ATTACK].learned > > { > send_to_char("You are already learned in this > return(TRUE); > } > send_to_char("You Practice for a while...\n\r", ch); > if(ch->specials.practices>3) > ch->specials.practices-=dice(1,3); > else > if(ch->specials.practices)ch->specials.practices- > percent = ch->skills[nnumber+SKILL_SECOND_ATTACK].lea > MIN(12, int_app[GET_INT(ch)].learn); > ch->skills[nnumber+SKILL_SECOND_ATTACK].learned = MIN > if (ch->skills[nnumber+SKILL_SECOND_ATTACK].learned > > { > send_to_char("You are now learned in this are > return(TRUE); > } > } > else if((number==-1)&&(nnumber==-1)) > { > if (ch->skills[mednumber+SKILL_CHARGE].learned >= 85) > { > send_to_char("You are already learned in this > return(TRUE); > } > send_to_char("You Practice for a while...\n\r", ch); > if(ch->specials.practices>3) > ch->specials.practices-=dice(1,3); > else > if(ch->specials.practices)ch->specials.practices- > percent = ch->skills[mednumber+SKILL_CHARGE].learned > MIN(12, int_app[GET_INT(ch)].learn); > ch->skills[mednumber+SKILL_CHARGE].learned = MIN(85, > if (ch->skills[mednumber+SKILL_CHARGE].learned >= 85) > { > send_to_char("You are now learned in this are > return(TRUE); > } > } > > return (TRUE); > } > > > int cleric_guild(struct char_data *ch, int cmd, char *arg) > { > > char buf[MAX_STRING_LENGTH]; > int number, i, percent; > > extern char *spells[]; > extern struct spell_info_type spell_info[MAX_SPL_LIST]; > extern struct int_app_type int_app[26]; > > if(GET_LEVEL(ch)>=35)ch->specials.practices=100; > > if ((cmd != 164) && (cmd != 170)) return(FALSE); > > for(; *arg==' '; arg++); > > if( (GET_CLASS(ch)!=CLASS_CLERIC) > && (!IS_SET(ch->player.multi_class,MULTI_CLASS_CLERIC)) > ) > { > send_to_char("You watch the lesson but don't comprehend a > return(TRUE); > } > > if (!*arg) > { > sprintf(buf,"You have got %d practice sessions left.\n\r" > send_to_char(buf, ch); > send_to_char("You can practice any of these spells:\n\r", > for(i=0; *spells[i] != '\n'; i++) > if (spell_info[i+1].spell_pointer && > (spell_info[i+1].min_level_cleric <= > { > sprintf(buf," %20s ",spells[i]); > send_to_char(buf, ch); > sprintf(buf,"%14s",how_good(ch->skill > send_to_char(buf, ch); > sprintf(buf," %4d",use_mana(ch,i+1)); > send_to_char(buf, ch); > send_to_char("\n\r", ch); > } > return(TRUE); > } > > number = old_search_block(arg,0,strlen(arg),spells,FALSE); > if(number == -1) { > send_to_char("You do not know of this spell...\n\r", ch > return(TRUE); > } > if (GET_LEVEL(ch) < spell_info[number].min_level_cleric) { > send_to_char("You do not know of this spell...\n\r", ch > return(TRUE); > } > if (ch->specials.practices <= 0) { > send_to_char("You do not seem to be able to practice no > return(TRUE); > } > if (ch->skills[number].learned >= 95) { > send_to_char("You are already learned in this area.\n\r > return(TRUE); > } > send_to_char("You Practice for a while...\n\r", ch); > if(ch->specials.practices>3) > ch->specials.practices-=dice(1,3); > else > if(ch->specials.practices)ch->specials.practices--; > > > percent = ch->skills[number].learned+MAX(25,int_app[GET_INT(c > ch->skills[number].learned = MIN(95, percent); > > if (ch->skills[number].learned >= 95) { > send_to_char("You are now learned in this area.\n\r", c > return(TRUE); > } > return (TRUE); > } > > void ravine(struct char_data *ch, int to_room) > { > int dam, weight, spin; > > char *action[] = { > "careen into", > "bounce off", > "land on", > "smack into", > "ricochet off", > "slide into" > }; > char *hard_place[] = { > "boulder", > "root", > "sapling", > "sharp rock", > "branch", > "patch of thorns" > }; > char *body_part[] = { > "back", > "leg", > "kneecap", > "shin", > "head", > "elbow" > }; > char *wound[] = { > "break", > "bruise", > "crack", > "shatter", > "fracture", > "scrape" > }; > > /* invis gods arent' affected. Let visible ones be affected > * find the room you land in. > */ > if ( (GET_LEVEL(ch) >=32) && IS_AFFECTED(ch,AFF_INVISIBLE) ) > return; > > act( "$n loses $s balance and slides down a steep ravine towa > char_from_room(ch); > char_to_room(ch, to_room); > global_color=32; > send_to_char("You lose your balance and slide down a steep ra > global_color=0; > > if( !IS_NPC(ch) && (GET_LEVEL(ch) > 31) ) > { > act( "$n dives gracefully into the river from the slo > global_color=34; > send_to_char("You slide down the slope but regain con > global_color=0; > return; > } > > while(GET_HIT(ch) > 0) > { > if (number(1,100) < ((GET_DEX(ch) - 12)*4) ) > { > sprintf(log_buf, "<%dhp %dm %dmv>\n\r", > GET_HIT(ch), GET_MANA(ch), GET_MOVE(ch)); > send_to_char(log_buf,ch); > spin=number(2,6); > global_color=34; > sprintf(log_buf,"Nimbly regaining control, yo > send_to_char(log_buf,ch); > sprintf(log_buf,"$n flips %d times in the air > act( log_buf, FALSE, ch, NULL, NULL, TO_ROOM) > global_color=0; > sprintf(log_buf, "<%dhp %dm %dmv>\n\r", > GET_HIT(ch), GET_MANA(ch), GET_MOVE(c > send_to_char(log_buf,ch); > return; > } > else > { > sprintf(log_buf, "<%dhp %dm %dmv>\n\r", > GET_HIT(ch), GET_MANA(ch), GET_MOVE(ch)); > send_to_char(log_buf,ch); > global_color=31; > sprintf(log_buf,"You %s a %s and %s your %s.\ > action[number(0,5)], hard_place[numbe > wound[number(0,5)], body_part[number( > send_to_char(log_buf,ch); > global_color=0; > weight = IS_CARRYING_W(ch) + GET_WEIGHT(ch); > dam = (int)(number((int)(weight/3),weight)); > dam /= 10; > GET_HIT(ch) -= dam; > } > } > > sprintf(log_buf, "<%dhp %dm %dmv>\n\r", > GET_HIT(ch), GET_MANA(ch), GET_MOVE(ch)); > send_to_char(log_buf,ch); > global_color=31; > send_to_char("You limply bounce off a rock and splash into th > act( "$n's limp body bounces off a rock and splashes into the > global_color=0; > sprintf(log_buf, "<%dhp %dm %dmv>\n\r", > GET_HIT(ch), GET_MANA(ch), GET_MOVE(ch)); > send_to_char(log_buf,ch); > raw_kill(ch,ch); > } > > > int belt_quest(struct char_data *ch, int cmd, char *arg) > { > void ravine(struct char_data *ch, int to_room); > > ravine(ch,3350); > return(FALSE); > } > > int moongate(struct char_data *ch, int cmd, char *arg) > { > if(cmd!=28)return(FALSE); > > send_to_char("You step into the swirling silver portal... > send_to_char("Your vision blackens for a moment. When it > send_to_char("drifting through an endless gray mist. A b > send_to_char("distance rushes towards you, engulfing your > send_to_char("Your vision returns, and you find yourself > act("$n steps into the silvery moongate; $s body shimmers > char_from_room(ch); > char_to_room(ch,475); > act("A pillar of flame erupts before the altar. As is fa > do_look(ch,"",9); > return(TRUE); > } > > int feeders(struct char_data *ch, int cmd, char *arg) > { > if((cmd != 2) || (IS_NPC(ch)))return(FALSE); > act("$n leaves east through the narrow tunnel. You see a > send_to_char("You feel dizzy and disoriented!\n\r",ch); > send_to_char("Your whole being begins to fade in and out. > send_to_char("You pass out.\n\r",ch); > send_to_char("You wake up feeling groggy, peering about y > act("$n moves east, farther into the narrow tunnel.\n\r", > if(world[ch->in_room]->number==15053){ > char_from_room(ch); > char_to_room(ch,15021); > do_look(ch,"",9); > } > if(world[ch->in_room]->number==15051){ > char_from_room(ch); > char_to_room(ch,15031); > do_look(ch,"",9); > } > act("$n appears in the corner of the cavern with a bright > return(TRUE); > } > > int illusionary_room(struct char_data *ch, int cmd, char *arg > { > if((world[ch->in_room]->number==6324)&&(cmd==2)){ > act("$n enters the workshop. A faint scream seems to e > char_from_room(ch); > char_to_room(ch, 6331); > do_look(ch,"",9); > send_to_char("Just as your foot is about to touch the f > send_to_char("everything in the room is slightly transp > send_to_char("you pass straight through the floor and f > send_to_char("With a loud *SMACK*, you land in frigid, > act("$n has a look of total disbelief and horror as $e > char_from_room(ch); > char_to_room(ch,2096); > act("A loud scream echos throughout the chamber. $n fa > act("above and lands painfully in the icy waters.\n\r", > GET_HIT(ch)-=dice(5,12); > if(GET_HIT(ch)<1){ > send_to_char("You land in a pool of frigid water. A s > send_to_char("of the lake pierces your eye, impaling > raw_kill(ch,0); > return(TRUE); > } > else{ > do_look(ch,"",9); > return(TRUE); > } > } > else if((world[ch->in_room]->number==6330)&&(cmd==3)){ > act("$n enters the workshop. A faint scream seems to e > char_from_room(ch); > char_to_room(ch, 6331); > do_look(ch,"",9); > send_to_char("Just as your foot is about to touch the f > send_to_char("everything in the room is slightly transp > send_to_char("you pass straight through the floor and f > send_to_char("With a loud *SMACK*, you land in frigid, > act("$n has a look of total disbelief and horror as $e > char_from_room(ch); > char_to_room(ch,2096); > act("A loud scream echos throughout the chamber. $n fa > act("above and lands painfully in the icy waters.\n\r", > GET_HIT(ch)-=dice(5,12); > if(GET_HIT(ch)<1){ > send_to_char("You land in a pool of frigid water. A s > send_to_char("of the lake pierces your eye, impaling > raw_kill(ch,0); > act("$n floats face down in the water...\n\r",TRUE,ch > return(TRUE); > } > else{ > do_look(ch,"",9); > return(TRUE); > } > } > else > return(FALSE); > } > > int pit_traps(struct char_data *ch, int cmd, char *arg) > { > if(world[ch->in_room]->number==15067 && !IS_NPC(ch)){ > if(number(1,20) > GET_DEX(ch)){ > act("$n lets out a brief scream as $e disappears beneat > char_from_room(ch); > send_to_char("You slip on the oil, loosing your footing > send_to_char("Darkness engulfs you as you fall downward > char_to_room(ch, 1159); > GET_HIT(ch) -= dice(3,10); > if(GET_HIT(ch) < 1){ > send_to_char("You land hard on the cold stone floor, > raw_kill(ch,0); > act("$n falls from a dark hole in the ceiling, landin > act("You hear a loud *crunch* as $s neck hits a protr > return(TRUE); > } > else{ > send_to_char("You land painfully on the stone floor, > act("$n falls from a dark hole in the ceiling, landin > do_look(ch,"",9); > return(TRUE); > } > } > } > else if(world[ch->in_room]->number==15060 && !IS_NPC(ch)){ > if(number(1,20) > GET_DEX(ch)){ > act("$n lets out a brief scream as $e disappears beneat > char_from_room(ch); > send_to_char("You slip on the oil, loosing your footing > send_to_char("Darkness engulfs you as you fall downward > char_to_room(ch, 1152); > GET_HIT(ch) -= dice(3,10); > if(GET_HIT(ch) < 1){ > send_to_char("You land hard on the cold stone floor, > raw_kill(ch,0); > act("$n falls from a dark hole in the ceiling, landin > act("You hear a loud *crunch* as $s neck hits a protr > return(TRUE); > } > else{ > send_to_char("You land painfully on the stone floor, > act("$n falls from a dark hole in the ceiling, landin > do_look(ch,"",9); > return(TRUE); > } > } > } > else if(world[ch->in_room]->number==973 && !IS_NPC(ch)){ > if(number(1,20) > GET_DEX(ch)){ > act("$n lets out a brief scream as $e disappears beneat > char_from_room(ch); > send_to_char("You slip on the oil, loosing your footing > send_to_char("Darkness engulfs you as you fall downward > char_to_room(ch, 2066); > GET_HIT(ch) -= dice(3,10); > if(GET_HIT(ch) < 1){ > send_to_char("You feel your legs exit the shoot and y > send_to_char("rock shatters your face and skull just > raw_kill(ch,0); > act("$n slides out of a dark hole in the cavern wall, > act("$n floats motionless, face down, in the water.\n > return(TRUE); > } > else{ > send_to_char("You slam into the walls of the shoot pa > send_to_char("landing in a pool of icy waters.\n\r",c > act("$n slides out of a dark hole in the cavern wall, > do_look(ch,"",9); > return(TRUE); > } > } > } > else if((world[ch->in_room]->number==3053 || > world[ch->in_room]->number==3054 || > world[ch->in_room]->number==3058 || > world[ch->in_room]->number==3061) && !IS_NPC(ch)){ > if(number(1,500) < IS_CARRYING_W(ch)){ > act("The floor crumbles under $n's feet and $e falls sc > char_from_room(ch); > send_to_char("The floor under your feet crumbles and fa > send_to_char("Deserately you grab for something to hold > send_to_char("You plummet into the blackness of the pit > send_to_char("hard rocks miles below.\n\r",ch); > char_to_room(ch, 3302); > if(GET_LEVEL(ch)<32){ > act("$n falls from the darkness above, slamming into > raw_kill(ch,0); > return(TRUE); > } > else{ > act("$n slowly floats down to the rocky cavern floor. > return(TRUE); > } > } > } > return(FALSE); > } > > int silver_shrine(struct char_data *ch, int cmd, char *arg) > { > int room; > if(cmd!=28)return(FALSE); > > send_to_char("The room around you slowly dematerializes.\ > send_to_char("You float through a silvery, misty void for > send_to_char("The mist clears and you find yourself in a > act("$n steps into the portal and vanishes.\n\r",TRUE,ch, > if(world[ch->in_room]->number==813)room=3596; > else room=813; > char_from_room(ch); > char_to_room(ch,room); > do_look(ch,"",9); > return(TRUE); > } > > int waterfall(struct char_data *ch, int cmd, char *arg) > { > if((world[ch->in_room]->number==774)&&(cmd==6)){ > act("$n allows $mself to be pulled over the waterfall's > act("helpless screams of terror as $e nears the bottom. > send_to_char("You are thrown powerfully over the waterf > char_from_room(ch); > char_to_room(ch, 775); > if(GET_LEVEL(ch)>31){ > send_to_char("You float harmlessly to the ground belo > do_look(ch, "", 9); > act("$n floats down from the top of the falls.\n\r",T > return(TRUE); > } > else if(number(1,4)<2){ > act("$n screams helplessly as $e falls from the top o > act("Landing on an unforgiving rock, $s body splits i > act("the powerful impact. $n has died a gruesome dea > send_to_char("You land on an unforgiving rock below, > send_to_char("You die instantly.\n\r", ch); > raw_kill(ch,0); > return(TRUE); > } > else{ > act("$n screams helplessly as $e falls from the top o > GET_HIT(ch) -= dice(100,3); > if(GET_HIT(ch)<0){ > act("Landing on an unforgiving rock, $s body splits > act("the powerful impact. $n has died a gruesome d > send_to_char("You land on an unforgiving rock below > send_to_char("You die instantly.\n\r", ch); > raw_kill(ch,0); > return(TRUE); > } > else{ > act("$e lands in the water with a loud *SMACK* and > act("surface. A moment later, $e comes back up, ga > send_to_char("You land painfully in the water and a > send_to_char("You slam against the river floor and > do_look(ch,"",9); > return(TRUE); > } > } > } > else > return(FALSE); > }