void free_game( GAME_BOARD_DATA * board ) { if ( !board ) return; #ifdef IMC if ( board->type == TYPE_IMC ) { imc_send_chess( board->player1 ? board->player1 : NULL, board->player2, "stop" ); STRFREE( board->player2 ); } #endif if ( board->player1 ) { if ( CHAR_DATA * ch = get_char_world( supermob, board->player1 ) ) // Added for bugfix - Findecano 23/11/07 { ch_printf( ch, "The game has been stopped at %d total moves.\r\n", board->turn ); ch->pcdata->game_board = NULL; } } if ( board->player2 ) { if ( CHAR_DATA * ch = get_char_world( supermob, board->player2 ) ) // Added for bugfix - Findecano 23/11/07 { ch_printf( ch, "The game has been stopped at %d total moves.\r\n", board->turn ); ch->pcdata->game_board = NULL; } } STRFREE( board->player1 ); STRFREE( board->player2 ); DISPOSE( board ); }
/* * Displays MOBprogram triggers of a mobile * * Syntax: mpstat [name] */ void do_mpstat(CHAR_DATA * ch, char *argument) { char arg[MAX_STRING_LENGTH]; MPROG_LIST *mprg; CHAR_DATA *victim; int i; one_argument(argument, arg); if (arg[0] == '\0') { send_to_char("Mpstat whom?\n\r", ch); return; } if ((victim = get_char_world(ch, arg)) == NULL) { send_to_char("No such creature.\n\r", ch); return; } if (!IS_NPC(victim)) { send_to_char("That is not a mobile.\n\r", ch); return; } if ((victim = get_char_world(ch, arg)) == NULL) { send_to_char("No such creature visible.\n\r", ch); return; } sprintf(arg, "Mobile #%-6d [%s]\n\r", victim->pIndexData->vnum, victim->short_descr); send_to_char(arg, ch); sprintf(arg, "Delay %-6d [%s]\n\r", victim->mprog_delay, victim->mprog_target == NULL ? "No target" : victim->mprog_target->name); send_to_char(arg, ch); if (!victim->pIndexData->mprog_flags) { send_to_char("[No programs set]\n\r", ch); return; } for (i = 0, mprg = victim->pIndexData->mprogs; mprg != NULL; mprg = mprg->next) { sprintf(arg, "[%2d] Trigger [%-8s] Program [%4d] Phrase [%s]\n\r", ++i, mprog_type_to_name(mprg->trig_type), mprg->vnum, mprg->trig_phrase); send_to_char(arg, ch); } return; }
void Character::spell_summon (int sn, int lvl, void *vo) { Character *victim; if ((victim = get_char_world (target_name)) == NULL || victim == this || victim->in_room == NULL || IS_SET (victim->in_room->room_flags, ROOM_SAFE) || IS_SET (victim->in_room->room_flags, ROOM_PRIVATE) || IS_SET (victim->in_room->room_flags, ROOM_SOLITARY) || IS_SET (victim->in_room->room_flags, ROOM_NO_RECALL) || victim->level >= lvl + 3 || victim->fighting != NULL || victim->in_room->area != in_room->area || (victim->is_npc () && victim->saves_spell (lvl))) { send_to_char ("You failed.\r\n"); return; } victim->act ("$n disappears suddenly.", NULL, NULL, TO_ROOM); victim->char_from_room(); victim->char_to_room(in_room); victim->act ("$n arrives suddenly.", NULL, NULL, TO_ROOM); act ("$N has summoned you!", NULL, victim, TO_VICT); victim->do_look ("auto"); return; }
bool remove_member(long id, char *name) { CHAR_DATA *ch = 0; KINGDOM_DATA *kingdom; char buf[MAX_STRING_LENGTH]; char *str; if(!name || name[0] == '\0' || (kingdom = get_kingdom(id)) == &kingdom_default) return FALSE; if((ch = get_char_world(char_list, name)) != 0 && !IS_NPC(ch)) { ch->pcdata->kingdom_invite = 0; ch->pcdata->kingdom = 0; sprintf(buf, "You have left the %s Kingdom.", kingdom->name); send_to_char(buf, ch); free_string(ch->pcdata->krank); ch->pcdata->krank = str_dup(""); } if((str = str_sep(kingdom->members, name)) == 0) return FALSE; free_string(kingdom->members); kingdom->members = str; kingdom_message(0, "%s has left the %s Kingdom.", name, kingdom->name); write_kingdoms(); return TRUE; }
/* File read/write code redone using standard Smaug I/O routines - Samson 9-12-98 */ void do_finger( CHAR_DATA *ch, char *argument ) { CHAR_DATA *victim; if( IS_NPC(ch) ) { send_to_char( "Mobs can't use the finger command.\n\r", ch ); return; } if ( argument[0] == '\0' ) { send_to_char("Finger whom?\n\r", ch ); return; } victim = get_char_world(ch, argument); if ( ( victim == NULL ) || (!victim) ) { read_finger( ch, argument ); return; } if ( IS_IMMORTAL(victim) && !IS_IMMORTAL(ch) ) { send_to_char( "Cannot finger an immortal.\n\r", ch ); return; } /* if ( ( ch->top_level < victim->top_level && ch->top_level < LEVEL_INFINITE ) && IS_IMMORTAL(ch) ) { send_to_char( "Cannot finger an immortal above your own level.\n\r", ch ); return; } */ if ( IS_NPC( victim ) ) { read_finger( ch, argument ); return; } if ( !can_see( ch, victim ) ) { send_to_char("They aren't here.\n\r", ch ); return; } send_to_char("&w Finger Info\n\r", ch); send_to_char(" -----------\n\r", ch); ch_printf(ch, "&wName : &G%-20s &wAge: &G%d\n\r", victim->name, victim->pcage ); ch_printf(ch, "&wSex : &G%-20s\n\r", victim->sex == SEX_MALE ? "Male" : victim->sex == SEX_FEMALE ? "Female" : "Neutral" ); ch_printf(ch, "&wTitle: &G%s\n\r", victim->pcdata->title ); ch_printf(ch, "&wHomepage: &G%s\n\r", victim->pcdata->homepage ? victim->pcdata->homepage : "None" ); // ch_printf(ch, "&wClan: &G%s\n\r", victim->pcdata->clan ? victim->pcdata->clan->name : "Unclanned" ); ch_printf(ch, "&wLast on: &G%s\n\r", (char *) ctime( &ch->logon ) ); return; }
void do_prename(CHAR_DATA *ch, char *argument) { CHAR_DATA *vict; OBJ_DATA *obj; char arg1[MIL]; argument = one_argument(argument, arg1); if ((vict = get_char_world(ch, arg1)) == NULL || IS_NPC(vict)) { send_to_char("No player by that name.\n\r", ch); return; } if (!*argument) { send_to_char("Rename them to what? syntax: prename originalname newname\n\r", ch); return; } free_string(vict->pcdata->switchname); free_string(vict->name); vict->pcdata->switchname = str_dup(argument); vict->name = str_dup(argument); for (obj = vict->carrying; obj; obj = obj->next_content) { if (!str_cmp(obj->questowner, arg1)) { free_string(obj->questowner); obj->questowner = str_dup(argument); } } sprintf(log_buf, "../player/%s", arg1); unlink(log_buf); sprintf(arg1, "You have been renamed to %s.\n\r", argument); send_to_char(arg1, vict); save_char_obj(vict); return; }
void do_approve( CHAR_DATA *ch, char *argument ) { CHAR_DATA *ach; char buf[MAX_STRING_LENGTH]; ach = get_char_world( ch, argument ); if ( ach == NULL || IS_NPC( ach ) ) { send_to_char( "No such character to approve.\n\r", ch ); return; } if ( !IS_SET( ach->act, PLR_REVIEWING ) ) { send_to_char( "That character is not being reviewed.\n\r", ch ); return; } REMOVE_BIT( ach->act, PLR_REJECTED ); REMOVE_BIT( ach->act, PLR_UNAPPROVED ); sprintf( buf, "rm -f %s%s", REJECTED_DIR, capitalize( ach->name ) ); system( buf ); sprintf( buf, "rm -f %s%s", UNAPPROVED_DIR, capitalize( ach->name ) ); system( buf ); save_char_obj( ach ); do_quit( ach, "" ); send_to_char( "Character approved.\n\r", ch ); return; }
void do_tell( CHAR_DATA *ch, const char *argument ) { CHAR_DATA *victim; char arg [ MAX_INPUT_LENGTH ]; int position; if ( IS_AFFECTED( ch, AFF_MUTE ) || IS_SET( ch->in_room->room_flags, ROOM_CONE_OF_SILENCE ) ) { send_to_char( "You can't seem to break the silence.\n\r", ch ); return; } one_argument( argument, arg ); /* * Can tell to PC's anywhere, but NPC's only in same room. * -- Furey */ if ( !( victim = get_char_world( ch, arg ) ) || ( IS_NPC( victim ) && victim->in_room != ch->in_room ) ) { send_to_char( "They aren't here.\n\r", ch ); return; } if ( ( !IS_NPC( ch ) && ( IS_SET( ch->act, PLR_SILENCE ) || IS_SET( ch->act, PLR_NO_TELL ) ) ) || IS_SET( victim->in_room->room_flags, ROOM_CONE_OF_SILENCE ) ) { send_to_char( "Your message didn't get through.\n\r", ch ); return; } argument = one_argument( argument, arg ); if ( arg[0] == '\0' || argument[0] == '\0' ) { send_to_char( "Tell whom what?\n\r", ch ); return; } if ( !IS_IMMORTAL( ch ) && !IS_AWAKE( victim ) ) { act( "$E can't hear you.", ch, 0, victim, TO_CHAR ); return; } act( "You tell $N '$t'", ch, argument, victim, TO_CHAR ); position = victim->position; victim->position = POS_STANDING; act( "$n tells you '$t'", ch, argument, victim, TO_VICT ); victim->position = position; victim->reply = ch; if ( IS_SET( victim->act, PLR_AFK ) ) act( "Just so you know, $E is AFK.", ch, NULL, victim, TO_CHAR ); return; }
void spell_portal( int sn, int level, CHAR_DATA *ch, void *vo,int target) { CHAR_DATA *victim; OBJ_DATA *portal, *stone; if ( ( victim = get_char_world( ch, target_name ) ) == NULL || victim == ch || victim->in_room == NULL || !can_see_room(ch,victim->in_room) || IS_SET(victim->in_room->room_flags, ROOM_SAFE) || IS_SET(victim->in_room->room_flags, ROOM_PRIVATE) || IS_SET(victim->in_room->room_flags, ROOM_SOLITARY) || IS_SET(victim->in_room->room_flags, ROOM_DRAGONPIT) || IS_SET(ch->in_room->room_flags, ROOM_DRAGONPIT) || IS_SET(victim->in_room->room_flags, ROOM_NO_RECALL) || IS_SET(victim->in_room->area->area_flags, AREA_PROTO ) || IS_SET(ch->in_room->room_flags, ROOM_NO_RECALL) || victim->level >= level + 3 || (!IS_NPC(victim) && victim->level >= LEVEL_HERO) || (IS_NPC(victim) && IS_SET(victim->imm_flags,IMM_SUMMON)) || (IS_NPC(victim) && saves_spell( level, victim,DAM_NONE) ) || (is_clan(victim) && !is_same_clan(ch,victim))) { send_to_char( "You failed.\n\r", ch ); return; } if (!IS_IMP(ch)) { if (IS_IMMORTAL(ch)) { send_to_char("\n\r{rIMMs can use {RGOTO{r so there is no reason to be opening {RPORTAL{r.{x\n\r",ch); return; } } stone = get_eq_char(ch,WEAR_HOLD); if (!IS_IMMORTAL(ch) && (stone == NULL || stone->item_type != ITEM_WARP_STONE)) { send_to_char("You lack the proper component for this spell.\n\r",ch); return; } if (stone != NULL && stone->item_type == ITEM_WARP_STONE) { act("You draw upon the power of $p.",ch,stone,NULL,TO_CHAR); //act("It flares brightly and vanishes!",ch,stone,NULL,TO_CHAR); //extract_obj(stone); } portal = create_object(get_obj_index(OBJ_VNUM_PORTAL),0); portal->timer = 2 + level / 25; portal->value[3] = victim->in_room->vnum; obj_to_room(portal,ch->in_room); act("$p rises up from the ground.",ch,portal,NULL,TO_ROOM); act("$p rises up before you.",ch,portal,NULL,TO_CHAR); }
void do_answer (CHAR_DATA * ch, char *argy) { char to[20]; char *t; char msg[1024]; CHAR_DATA *toc = NULL; int p; DEFINE_COMMAND ("answer", do_answer, POSITION_DEAD, MAX_LEVEL, LOG_NORMAL, "This command answers a mortal's question as 'An Admin'.") for (t = argy; *t != ' '; t++) if ((argy - t) > 18) { send_to_char ("Answer who?\n\r", ch); return; } argy = one_argy (argy, to); if ((toc = get_char_world (ch, to)) == NULL) { send_to_char ("Couldn't find that player.\n\r", ch); return; } sprintf (msg, "$B$7Admin Info: %s", argy); p = toc->position; toc->position = POSITION_STANDING; act (msg, toc, NULL, toc, TO_CHAR); toc->position = p; sprintf (msg, "$B$5To %s: %s\x1B[37;0m", NAME (toc), argy); p = ch->position; ch->position = POSITION_STANDING; act (msg, ch, NULL, ch, TO_CHAR); ch->position = p; return; }
void do_fixhead( CHAR_DATA *ch, char *argument ) { char arg1[MSL]; CHAR_DATA *victim; argument = one_argument( argument, arg1 ); victim = get_char_world(ch, arg1); if ( arg1[0] == '\0' ) { send_to_char("Syntax: fixhead <player name>\n\r",ch); return; } if (victim == NULL) { send_to_char("They must be playing.\n\r", ch); return; } if (IS_NPC(victim)) { send_to_char("Not on NPC's\n\r", ch); return; } if ( !IS_HEAD(victim,LOST_HEAD) ) return stcf(ch,"They're not a head!\n\r"); REMOVE_BIT(victim->loc_hp[0],LOST_HEAD); REMOVE_BIT(victim->affected_by,AFF_POLYMORPH); if ( victim->morph ) free_string(victim->morph); stcf(ch,"%s has been fixed.\n\r",victim->name); stcf(victim,"You have been fixed!\n\r"); }
void do_sforce (CHAR_DATA * ch, char *argy) { char person[100]; DESCRIPTOR_DATA *d; CHAR_DATA *vict; DEFINE_COMMAND ("sforce", do_sforce, POSITION_DEAD, MAX_LEVEL, LOG_ALWAYS, "This command forces a character to do something, yet redirects output to your console instead of the character's.") person[0] = '\0'; argy = one_argy (argy, person); if (person[0] == '\0') { send_to_char ("Reminder: DON'T use this command if you don't know what you're doing! :)\n\r", ch); return; } if ((vict = get_char_world (ch, person)) == NULL || IS_MOB (vict)) { send_to_char ("Target sforce not found.\n\r", ch); return; } d = vict->desc; vict->desc = ch->desc; interpret (vict, argy); if (vict->data_type == 50) return; vict->desc = d; return; }
void do_fryballs( CHAR_DATA *ch, char *argument ) { CHAR_DATA *victim; if ( !argument[0] ) return stcf(ch,"Who should fry balls?\n\r"); if ( !(victim = get_char_world(ch,argument)) ) return stcf(ch,"They're not here!\n\r"); if ( IS_NPC(victim) ) return stcf(ch,"Not on NPC's.\n\r"); if ( !IS_SET(victim->extra, EXTRA_FRYBALLS) ) { SET_BIT(victim->extra, EXTRA_FRYBALLS); stcf(ch,"%s is now frying balls.\n\r",victim->name); } else { REMOVE_BIT(victim->extra, EXTRA_FRYBALLS); stcf(ch,"%s is no longer frying balls.\n\r",victim->name); } }
void do_swoop( CHAR_DATA *ch, char *argument ) { char arg[MAX_INPUT_LENGTH]; ROOM_INDEX_DATA *location; CHAR_DATA *victim; one_argument (argument, arg); if (IS_NPC(ch)) return; if (!IS_CLASS(ch, CLASS_ANGEL)) { send_to_char("Huh?\n\r", ch ); return; } if (ch->pcdata->powers[ANGEL_JUSTICE] < 1) { send_to_char("You haven't learned to fly yet.\n\r",ch); return; } if (!IS_SET(ch->pcdata->powers[ANGEL_POWERS], ANGEL_WINGS)) { send_to_char("Where are your wings?\n\r",ch); return; } if ((victim = get_char_world(ch, arg)) == NULL) { send_to_char("Swoop down on whom?\n\r", ch ); return; } if (IS_SET(victim->in_room->room_flags, ROOM_ASTRAL)) { stc( "You can't find it's room.\n\r",ch); return; } if (IS_IMMUNE(victim, IMM_TRAVEL) && !IS_NPC(victim)) { send_to_char("I don't think they want you to do that.\n\r",ch); return; } if (IS_SET(ch->in_room->room_flags, ROOM_ASTRAL)) { stc( "Your room is not connected to the astral plane.\n\r",ch); return; } location = victim->in_room; if (ch->move < 500) { send_to_char("You don't have the move to fly that far.\n\r", ch ); return; } act("You fly up into the sky.", ch, NULL, NULL, TO_CHAR); act("$n flies into the sky.", ch, NULL, NULL, TO_ROOM); ch->move -= 500; char_from_room(ch); char_to_room(ch, location); do_look(ch, "auto"); act("You swoop down upon $N.", ch, NULL, victim, TO_CHAR); act("$n swoops down from the sky.", ch, NULL, NULL, TO_ROOM); return; }
/* Imm command to toggle an abit on a character or to list the abits already on a character */ void do_abit( CHAR_DATA * ch, char *argument ) { BIT_DATA *bit; char buf[MAX_STRING_LENGTH]; CHAR_DATA *victim; argument = one_argument( argument, buf ); if( ( victim = get_char_world( ch, buf ) ) == NULL ) { send_to_char( "They are not in the game.\r\n", ch ); return; } argument = one_argument( argument, buf ); if( !buf || buf[0] == '\0' ) { if( !victim->first_abit ) { send_to_char( "They have no abits set on them.\r\n", ch ); return; } send_to_char( "ABITS:\r\n", ch ); for( bit = victim->first_abit; bit; bit = bit->next ) { sprintf( buf, "%4.4d: <%30.30s&w>\r\n", bit->number, bit->desc ); send_to_char( buf, ch ); } } else { int abit; abit = atoi( buf ); if( abit < 0 || abit > MAX_xBITS ) { send_to_char( "That is an invalid abit number.\r\n", ch ); return; } if( get_abit( victim, abit ) != NULL ) { remove_abit( victim, abit ); sprintf( buf, "Removed abit %d from %s.\r\n", abit, victim->name ); send_to_char( buf, ch ); } else { set_abit( victim, abit ); sprintf( buf, "Added abit %d to %s.\r\n", abit, victim->name ); send_to_char( buf, ch ); } } }
void do_denounce(CHAR_DATA *ch, char * argument ) { char arg[MSL], arg2[MSL]; CHAR_DATA *victim; if(IS_NPC(ch ) ) return; if(!str_cmp(argument, "organization" ) ) { denounce_org(ch, FALSE); return; } argument = one_argument(argument, arg ); argument = one_argument(argument, arg2 ); if(!str_cmp(arg, "follower" ) ) { if(ch->pcdata->rank <= RANK_PRIEST ) { do_function(ch, &do_denounce, NULL ); return; } if(!IS_IMMORTAL(ch) ) { if( ( victim = get_char_room(ch, NULL, arg2 ) ) == NULL ) { send_to_char("They aren't here.\n\r",ch); return; } } else { if( ( victim = get_char_world(ch, arg2 ) ) == NULL ) { send_to_char("They aren't here.\n\r", ch); return; } } if(IS_NPC(victim) ) { send_to_char("Not on NPC's.\n\r",ch); return; } if(!IS_SAME_ORGANIZATION(ch, victim) && ch->pcdata->rank != RANK_GOD ) { send_to_char("They aren't in your organization!\n\r",ch); return; } if(ch->pcdata->rank <= victim->pcdata->rank ) { send_to_char("You cannot denounce their organization.\n\r",ch); return; } send_to_char("You denounce thier organization!\n\r",ch); denounce_org(victim, TRUE); return; } if(ch->pcdata->rank <= RANK_PRIEST ) send_to_char("To denounce a followers organization, use the syntax: 'denounce follower <name>'\n\r",ch); send_to_char("To denounce your faith, please type use the syntax: 'denounce organization'\n\r", ch); return; }
void do_noclan( CHAR_DATA *ch, char *argument ) { char arg[MAX_INPUT_LENGTH],buf[MAX_STRING_LENGTH]; CHAR_DATA *victim; one_argument( argument, arg ); if ( arg[0] == '\0' ) { send_to_char( "Noclan whom?\n\r", ch ); return; } if ( ( victim = get_char_world( ch, arg ) ) == NULL ) { send_to_char( "They aren't here.\n\r", ch ); return; } if ( IS_NPC(victim) ) { send_to_char( "Not on NPC's.\n\r", ch ); return; } if ( get_trust( victim ) >= get_trust( ch ) ) { send_to_char( "You failed.\n\r", ch ); return; } if ( IS_SET(victim->act, PLR_NOCLAN) ) { REMOVE_BIT(victim->act, PLR_NOCLAN); send_to_char( "NOCLAN removed.\n\r", ch ); sprintf(buf,"$N allows %s to join pkill clans.",victim->name); wiznet(buf,ch,NULL,WIZ_PENALTIES,WIZ_SECURE,0); } else { SET_BIT(victim->act, PLR_NOCLAN); if(ch->clan) { victim->clan = 0; victim->rank = 0; } send_to_char( "NOCLAN set.\n\r", ch ); sprintf(buf,"$N forbids %s to join pkill clans.",victim->name); wiznet(buf,ch,NULL,WIZ_PENALTIES,WIZ_SECURE,0); } save_char_obj( victim ); return; }
/* * Lets the mobile transfer people. The 'all' argument transfers * everyone in the current room to the specified location * * Syntax: mob transfer [target|'all'] [location] */ void do_mptransfer(CHAR_DATA * ch, char *argument) { char arg1[MAX_INPUT_LENGTH]; char arg2[MAX_INPUT_LENGTH]; char buf[MAX_STRING_LENGTH]; ROOM_INDEX_DATA *location; CHAR_DATA *victim; argument = one_argument(argument, arg1); argument = one_argument(argument, arg2); if (arg1[0] == '\0') { bug("Mptransfer - Bad syntax from vnum %d.", IS_NPC(ch) ? ch->pIndexData->vnum : 0); return; } if (!str_cmp(arg1, "all")) { CHAR_DATA *victim_next; for (victim = ch->in_room->people; victim != NULL; victim = victim_next) { victim_next = victim->next_in_room; if (!IS_NPC(victim)) { sprintf(buf, "%s %s", victim->name, arg2); do_mptransfer(ch, buf); } } return; } /* * Thanks to Grodyn for the optional location parameter. */ if (arg2[0] == '\0') { location = ch->in_room; } else { if ((location = find_location(ch, arg2)) == NULL) { bug("Mptransfer - No such location from vnum %d.", IS_NPC(ch) ? ch->pIndexData->vnum : 0); return; } if (room_is_private(location)) return; } if ((victim = get_char_world(ch, arg1)) == NULL) return; if (victim->in_room == NULL) return; if (victim->fighting != NULL) stop_fighting(victim, TRUE); char_from_room(victim); char_to_room(victim, location); do_look(victim, "auto"); return; }
void trivia_update(void) { CHAR_DATA *ch = 0; char buf[MAX_STRING_LENGTH]; HINT *hint; if(!trivia[1]) return; trivia[1] -= 5; if(trivia[1] <= 0) { if(!trivia_winner) { sprintf(buf, "Info-> The trivia has ended with no one guessing the correct answer.\n\r"); } else { sprintf(buf, "Info-> %s has guessed the correct trivia answer and is awarded %li quest points!\n\r", trivia_winner, trivia_reward); if(winner && !IS_NPC(winner)) winner->pcdata->quest += trivia_reward; } do_echo(char_list, buf); if(!trivia_winner || IS_IMMORTAL(winner)) { if((ch = get_char_world(char_list, trivia_char)) != 0) { sprintf(buf, "You get your %li quest points back.\n\r", trivia_reward); send_to_char(buf, ch); ch->pcdata->quest += trivia_reward; buf[0] = '\0'; } } sprintf(buf + strlen(buf), "Info-> The question was [%s]\n\r" "Info-> The answer was [%s]\n\r" "Info-> Creator of the trivia was [%s]\n\r" "Info-> You had [%li] minutes, there is %li seconds left, and there were [%li] guesses.\n\r", trivia_question, trivia_answer, trivia_char, trivia[0], trivia_timeleft, guesses); for(hint = hint_list; hint; hint = hint->next) sprintf(buf + strlen(buf), "Info-> Hint: %s.\n\r", hint->hint); if(char_list) do_echo(char_list, buf); write_trivia(); trivia[1] = 0; winner = 0; return; } }
/* * Lets the mobile to remember a target. The target can be referred to * with $q and $Q codes in MOBprograms. See also "mob forget". * * Syntax: mob remember [victim] */ void do_mpremember(CHAR_DATA * ch, char *argument) { char arg[MAX_INPUT_LENGTH]; one_argument(argument, arg); if (arg[0] != '\0') ch->mprog_target = get_char_world(ch, arg); else bug("MpRemember: missing argument from vnum %d.", IS_NPC(ch) ? ch->pIndexData->vnum : 0); }
void do_initiate(CHAR_DATA *ch, char *argument ) { char arg[MSL], arg2[MSL], arg3[MSL]; CHAR_DATA *victim; if(IS_NPC(ch ) ) return; argument = one_argument(argument, arg ); argument = one_argument(argument, arg2 ); argument = one_argument(argument, arg3 ); if(!HAS_ORGANIZATION(ch) ) { send_to_char("But you aren't organized!\n\r",ch); return; } if(ch->pcdata->rank < RANK_PRIEST ) { send_to_char("You can't initiate people!\n\r",ch); return; } if(arg[0] == '\0' ) { send_to_char("Syntax: Initiate <person>\n\r",ch); return; } if(ch->pcdata->rank < RANK_PRIEST ) { send_to_char("You can't initiate people!\n\r",ch); return; } if(!IS_IMMORTAL(ch) ) { if( ( victim = get_char_room(ch, NULL, arg ) ) == NULL ) { send_to_char("They aren't here.\n\r",ch); return; } } else { if( ( victim = get_char_world(ch, arg ) ) == NULL ) { send_to_char("They aren't here.\n\r", ch); return; } } if(IS_NPC(victim) ) { send_to_char("Not on NPC's.\n\r",ch); return; } if(arg2[0] == '\0' ) { if( HAS_ORGANIZATION(victim) ) { send_to_char("They are already in an organization!\n\r",ch); return; } printf_to_char(ch, "They have been initiated.\n\r" ); join_org(victim, ch->pcdata->organization ); } return; }
/* syntax : teleport <target> * ex : teleport satan */ void do_teleport (CHAR_DATA *ch, char *argument) { char arg[MAX_INPUT_LENGTH]; ROOM_INDEX_DATA *location; CHAR_DATA *victim; one_argument (argument, arg); if (IS_NPC(ch)) return; if (!IS_CLASS(ch, CLASS_MAGE)) { send_to_char("Huh?\n\r", ch ); return; } if (ch->pcdata->powers[PINVOKE] < 1) /* 1 is just a test */ { send_to_char("You don't have that invoke yet.\n\r",ch); return; } if ((victim = get_char_world(ch, arg)) == NULL) { send_to_char("Teleport to whom?\n\r", ch ); return; } if (IS_SET(victim->in_room->room_flags, ROOM_ASTRAL)) { stc( "You can't find it's room.\n\r",ch); return; } if (IS_IMMUNE(victim, IMM_TRAVEL) && !IS_NPC(victim)) { send_to_char("I don't think they want you to do that.\n\r",ch); return; } if (IS_SET(ch->in_room->room_flags, ROOM_ASTRAL)) { stc( "Your room is not connected to the astral plane.\n\r",ch); return; } location = victim->in_room; if (ch->mana < 250) { send_to_char("You don't have the mana to cast teleport.\n\r", ch ); return; } act("You utter a single powerword.", ch, NULL, NULL, TO_CHAR); act("$n utters a strange sounding word and disappers.", ch, NULL, NULL, TO_ROOM); ch->mana -= 250; char_from_room(ch); char_to_room(ch, location); do_look(ch, "auto"); act("You materialize.", ch, NULL, NULL, TO_CHAR); act("$n suddenly appear from out of nowhere.", ch, NULL, NULL, TO_ROOM); return; }
void do_consent( CHAR_DATA *ch, char *argument ) { char buf[200]; CHAR_DATA *victim; if( IS_NPC(ch) ) return; if( !argument || argument[0] == '\0' ) { if( ch->pcdata->consent == NULL ) { send_to_char("Nobody has your consent.\n\r", ch ); return; } for( victim = char_list; victim; victim = victim->next ) { if( IS_NPC(victim) ) continue; if( HAS_CONSENT(ch,victim) ) { sprintf(buf,"%s has your consent.\n\r", victim->pcdata->consent->name ); send_to_char(buf,ch); } } return; } if( (victim = get_char_world(ch,argument)) == NULL ) { send_to_char("You don't see them anywhere.\n\r", ch ); return; } if( IS_NPC(victim) ) { send_to_char("NPCs don't care about your consent.\n\r", ch ); return; } victim->pcdata->consent = ch; sprintf(buf,"%s has your consent.\n\r", victim->name ); send_to_char(buf,ch); sprintf(buf,"%s gives you %s consent.\n\r", ch->name, ch->sex == SEX_MALE ? "his" : ch->sex == SEX_FEMALE ? "her" : "its" ); send_to_char(buf,victim); return; }
void do_track( CHAR_DATA* ch, const char* argument) { CHAR_DATA *vict; char arg[MAX_INPUT_LENGTH]; int dir, maxdist; if( !IS_NPC( ch ) && ch->pcdata->learned[gsn_track] <= 0 ) { send_to_char( "You do not know of this skill yet.\r\n", ch ); return; } one_argument( argument, arg ); if( arg[0] == '\0' ) { send_to_char( "Whom are you trying to track?\r\n", ch ); return; } WAIT_STATE( ch, skill_table[gsn_track]->beats ); if( !( vict = get_char_world( ch, arg ) ) ) { send_to_char( "You can't find a trail of anyone like that.\r\n", ch ); return; } maxdist = 100 + ch->level * 30; if( !IS_NPC( ch ) ) maxdist = ( maxdist * LEARNED( ch, gsn_track ) ) / 100; dir = find_first_step( ch->in_room, vict->in_room, maxdist ); switch ( dir ) { case BFS_ERROR: send_to_char( "Hmm... something seems to be wrong.\r\n", ch ); break; case BFS_ALREADY_THERE: send_to_char( "You're already in the same room!\r\n", ch ); break; case BFS_NO_PATH: send_to_char( "You can't sense a trail from here.\r\n", ch ); learn_from_failure( ch, gsn_track ); break; default: ch_printf( ch, "You sense a trail %s from here...\r\n", dir_name[dir] ); learn_from_success( ch, gsn_track ); break; } }
void do_spousetalk (CHAR_DATA * ch, char *argument) { char buf[MAX_STRING_LENGTH]; CHAR_DATA *victim; if(!argument || argument[0] == '\0') { send_to_char ("What would you like to send to your spouse?\n\r", ch); return; } if ( ch->position == POS_SLEEPING) { send_to_char ("In your dreams or what?\n\r", ch); return; } if ( ch->position == POS_FIGHTING) { send_to_char("You should finish what your doing first!\n\r", ch); return; } if ( IS_NPC( ch ) ) { send_to_char( "your a mob....thats just wrong!\n\r", ch ); return; } if (!ch->pcdata->spouse) { send_to_char ("But you are not married!\n\r", ch); return; } if ((victim = get_char_world (ch, ch->pcdata->spouse)) == NULL) { sprintf (buf, "%s is not connected.\n\r", ch->pcdata->spouse); send_to_char (buf, ch); return; } sprintf(buf, "&G[&PSpouse&G] &Pto %s: &W%s\n\r", victim->name, argument); send_to_char(buf, ch); sprintf(buf, "&G[&PSpouse&G] &P%s Spouse talks: &W%s\n\r", ch->name, argument); send_to_char(buf, victim); }
void do_psycho(CHAR_DATA *ch, char *argument) { char buf[MAX_STRING_LENGTH]; CHAR_DATA *victim; if(argument[0] == '\0') { send_to_char("Syntax: psycho <character>\n\r", ch); return; } if( (victim = get_char_world(ch, argument)) == NULL) { send_to_char("That player is not online.\n\r", ch); return; } if(IS_NPC(victim)) { send_to_char("Not on NPC's.\n\r", ch); return; } if( (victim == ch) && (ch->level != MAX_LEVEL) ) { send_to_char("You can not make yourself a Psycho!\n\r", ch); return; } if(IS_SET(victim->affected_by2, PLR_PSYCHO)) { xprintf(buf, "%s is no longer Psycho!\n\r", victim->name); send_to_char(buf, ch); REMOVE_BIT(victim->affected_by2, PLR_PSYCHO); send_to_char("You now feel mentally stable!\n\r", victim); } else { xprintf(buf, "%s is now a Psycho!\n\r", victim->name); send_to_char(buf, ch); SET_BIT(victim->affected_by2, PLR_PSYCHO); send_to_char("You feel mentally unstable\n\r", victim); } return; }
void do_tell( CHAR_DATA *ch, char *argument ) { char arg[MAX_INPUT_LENGTH]; CHAR_DATA *victim; int position; if ( !IS_NPC(ch) && IS_SET(ch->act, PLR_SILENCE) ) { send_to_char( "Your message didn't get through.\n\r", ch ); return; } argument = one_argument( argument, arg ); if ( arg[0] == '\0' || argument[0] == '\0' ) { send_to_char( "Tell whom what?\n\r", ch ); return; } /* * Can tell to PC's anywhere, but NPC's only in same room. * -- Furey */ if ( ( victim = get_char_world( ch, arg ) ) == NULL || ( IS_NPC(victim) && victim->in_room != ch->in_room ) ) { send_to_char( "They aren't here.\n\r", ch ); return; } if ( !IS_IMMORTAL(ch) && !IS_AWAKE(victim) ) { act( "$E can't hear you.", ch, 0, victim, TO_CHAR ); return; } act( "You tell $N '$t'.", ch, argument, victim, TO_CHAR ); position = victim->position; victim->position = POS_STANDING; act( "$n tells you '$t'.", ch, argument, victim, TO_VICT ); victim->position = position; victim->reply = ch; return; }
void do_beep (CHAR_DATA * ch, char *argy) { CHAR_DATA *vict; char beep_string[500]; DEFINE_COMMAND ("beep", do_beep, POSITION_DEAD, IMM_LEVEL, LOG_NORMAL, "This command sends a beep from one immort to a player/other immort.") if ((vict = get_char_world (ch, argy)) == NULL) { send_to_char ("Player not found.\n\r", ch); return; } if (IS_MOB (vict)) return; sprintf (beep_string, "%c%c%c%c%cBeep sent from %s to %s!\n\r", 7, 7, 7, 7, 7, NAME (ch), NAME (vict)); send_to_char (beep_string, vict); send_to_char (beep_string, ch); return; }
void do_exempt(CHAR_DATA *ch, char *argument) { CHAR_DATA *victim; if(argument[0] == '\0') { send_to_char("Syntax: exempt <char>\n\r", ch); return; } if((victim = get_char_world(ch, argument)) == NULL) { send_to_char("They must be online to exempt them.\n\r", ch); return; } if(IS_NPC(victim)) { send_to_char("You can not exempt mobs.\n\r", ch); return; } if ( IS_SET(victim->pcdata->act2, ACT_EXEMPT) ) { REMOVE_BIT( victim->pcdata->act2, ACT_EXEMPT); send_to_char("You now have the possibility of being deleted.\n\r", victim); send_to_char("They now have the possiblity of being deleted.\n\r", ch); return; } else { SET_BIT(victim->pcdata->act2, ACT_EXEMPT); send_to_char("You have been exempt from deletion.\n\r", victim); send_to_char("They have been exempt from deletion.\n\r", ch); return; } return; }
void do_reject( CHAR_DATA *ch, char *argument ) { CHAR_DATA *ach; char buf[MAX_STRING_LENGTH]; ach = get_char_world( ch, argument ); if ( ach == NULL || IS_NPC( ach ) ) { send_to_char( "No such character to reject.\n\r", ch ); return; } if ( !IS_SET( ach->act, PLR_REVIEWING ) ) { send_to_char( "That character is not being reviewed.\n\r", ch ); return; } SET_BIT( ach->act, PLR_REJECTED ); REMOVE_BIT( ach->act, PLR_UNAPPROVED ); sprintf( buf, "rm -f %s%s", PLAYER_DIR, capitalize( ach->name ) ); system( buf ); sprintf( buf, "rm -f %s%s", UNAPPROVED_DIR, capitalize( ach->name ) ); system( buf ); free_string( ach->pcdata->rejected, MEM_PCDATA ); if ( ch->pnote && ch->pnote->text ) ach->pcdata->rejected = str_dup( ch->pnote->text ); else ach->pcdata->rejected = str_dup( "No specific reject message.\n\r" ); save_char_obj( ach ); do_quit( ach, "" ); send_to_char( "Character rejected.\n\r", ch ); return; }