bool spec_executioner( CHAR_DATA *ch ) { char buf[MAX_STRING_LENGTH]; CHAR_DATA *victim; CHAR_DATA *v_next; char *crime; if ( !IS_AWAKE(ch) || ch->fighting != NULL ) return FALSE; crime = ""; for ( victim = ch->in_room->people; victim != NULL; victim = v_next ) { v_next = victim->next_in_room; if ( !IS_NPC(victim) && IS_SET(victim->act, PLR_KILLER) ) { crime = "KILLER"; break; } if ( !IS_NPC(victim) && IS_SET(victim->act, PLR_THIEF) ) { crime = "THIEF"; break; } } if ( victim == NULL ) return FALSE; sprintf( buf, "%s is a %s! PROTECT THE INNOCENT! MORE BLOOOOD!!!", victim->name, crime ); do_shout( ch, buf ); multi_hit( ch, victim, TYPE_UNDEFINED ); char_to_room( create_mobile( get_mob_index(MOB_VNUM_CITYGUARD) ), ch->in_room ); char_to_room( create_mobile( get_mob_index(MOB_VNUM_CITYGUARD) ), ch->in_room ); return TRUE; }
bool spec_guard( CHAR_DATA *ch ) { char buf[MAX_STRING_LENGTH]; CHAR_DATA *victim; CHAR_DATA *v_next; CHAR_DATA *ech; char *crime; int max_evil; if ( !IS_AWAKE(ch) || ch->fighting != NULL ) return FALSE; max_evil = 300; ech = NULL; crime = ""; for ( victim = ch->in_room->people; victim != NULL; victim = v_next ) { v_next = victim->next_in_room; if ( !IS_NPC(victim) && IS_SET(victim->act, PLR_KILLER) ) { crime = "KILLER"; break; } if ( !IS_NPC(victim) && IS_SET(victim->act, PLR_THIEF) ) { crime = "THIEF"; break; } if ( victim->fighting != NULL && victim->fighting != ch && victim->alignment < max_evil ) { max_evil = victim->alignment; ech = victim; } } if ( victim != NULL ) { sprintf( buf, "%s is a %s! PROTECT THE INNOCENT!! BANZAI!!", victim->name, crime ); do_shout( ch, buf ); multi_hit( ch, victim, TYPE_UNDEFINED ); return TRUE; } if ( ech != NULL ) { act( "$n screams 'PROTECT THE INNOCENT!! BANZAI!!", ch, NULL, NULL, TO_ROOM ); multi_hit( ch, ech, TYPE_UNDEFINED ); return TRUE; } return FALSE; }
void ccp_shout(int cn,int co,char *text) { #ifdef REAL_CCP struct ccp_mem *mem=get_ccp_mem(cn); if (mem->lastshout>globs->ticker+TICKS*10) return; if (strstr(text,ch[cn].name)) { do_shout(cn,"I'm just a robot, stop shouting my name!"); mem->lastshout=globs->ticker; } #endif }
bool spec_guardian(CHAR_DATA * ch) { char buf[MAX_STRING_LENGTH]; CHAR_DATA *victim; CHAR_DATA *v_next; CHAR_DATA *ech; char *crime; int max_evil; if (!IS_AWAKE(ch) || ch->fighting) return FALSE; max_evil = 300; ech = NULL; crime = ""; for (victim = ch->in_room->first_person; victim; victim = v_next) { v_next = victim->next_in_room; if (victim->fighting && who_fighting(victim) != ch && victim->alignment < max_evil) { max_evil = victim->alignment; ech = victim; } } if (victim && IS_SET(ch->in_room->room_flags, ROOM_SAFE)) { sprintf(buf, "%s is a %s! As well as a COWARD!", victim->name, crime); do_yell(ch, buf); return TRUE; } if (victim) { sprintf(buf, "%s is a %s! PROTECT THE INNOCENT!!", victim->name, crime); do_shout(ch, buf); multi_hit(ch, victim, TYPE_UNDEFINED); return TRUE; } if (ech) { act(AT_YELL, "$n screams 'PROTECT THE INNOCENT!!", ch, NULL, NULL, TO_ROOM); multi_hit(ch, ech, TYPE_UNDEFINED); return TRUE; } return FALSE; }
int cmd_shout (string str) { mapping languages ; string *roomnames, p_language, ostr ; object ob, *users, *rooms; int i, p_chance, flag, success, loop, shoutblock; string nstr, how, what ; if (!str) { notify_fail("Shout what?\n"); return 0; } /* if (TP->query_level() < 2) { write("Sorry - due to abuse, you cannot shout until you reach\n"+ "level 2. If you REALLY need help, use the 'wizcall' command.\n"); return 1; } */ if (TP->query("shoutblock")) { write("Sorry - your shoublock is on.\n"); return 1; } nstr = str; #ifdef LANGUAGES // Fetch the languages X speaks. languages=previous_object()->query("languages"); if (!languages) languages = LANGUAGE_D->get_mapping() ; // filter out which language to use flag = 0 ; ostr = str; if ( sscanf (str, "in %s %s", how, what)==2) { p_language = lower_case(how) ; str = what ; } else { how = previous_object()->query("default_language") ; if (!how) how="common" ; p_language = lower_case(how) ; } if (languages[lower_case(how)] > 0 ) { flag=1 ; p_language=lower_case(how); p_chance=languages[p_language]; } if (flag==0) { p_language = "common"; p_chance = languages[p_language]; how = "common"; str = ostr; } // Now we want to determine success or not, in speaking the language success=0; if ( random (100) < p_chance ) success=1; if ( ! success ) write ("You stumble out some words, "+ "unfamiliar with the tongue.\n"); // Now fetch the garbled versions of the string // from the language daemon. g_string=(string)LANGUAGE_D->garble_string(str, p_language); g_lang=(string)LANGUAGE_D->transform_string(str, p_language); ostr = "in " + capitalize(p_language) + ": " + str; str = ostr; #endif #ifndef LANGUAGES ostr =": " + str; str = ostr; #endif write(iwrap("You shout "+str)); ob = environment(this_player()); if (!ob) { notify_fail("Your shouts go unheard in the void.\n"); return 0; } do_shout (environment(previous_object()),nstr, p_language, success) ; users = users(); rooms = ({});