int write_mobile_espec(mob_vnum mvnum, struct char_data *mob, FILE *fd) { if (GET_ATTACK(mob) != 0) fprintf(fd, "BareHandAttack: %d\n", GET_ATTACK(mob)); if (GET_STR(mob) != 0) fprintf(fd, "Str: %d\n", GET_STR(mob)); if (GET_ADD(mob) != 0) fprintf(fd, "StrAdd: %d\n", GET_ADD(mob)); if (GET_DEX(mob) != 0) fprintf(fd, "Dex: %d\n", GET_DEX(mob)); if (GET_INT(mob) != 0) fprintf(fd, "Int: %d\n", GET_INT(mob)); if (GET_WIS(mob) != 0) fprintf(fd, "Wis: %d\n", GET_WIS(mob)); if (GET_CON(mob) != 0) fprintf(fd, "Con: %d\n", GET_CON(mob)); if (GET_CHA(mob) != 0) fprintf(fd, "Cha: %d\n", GET_CHA(mob)); if(GET_CLASS(mob) != CLASS_NPC_OTHER) fprintf(fd, "Class: %d\n", GET_CLASS(mob)); if(GET_RACE(mob) != RACE_NPC_OTHER) fprintf(fd, "Race: %d\n", GET_RACE(mob)); if(GET_MOB_WEIGHT(mob)) fprintf(fd, "Weight: %d\n", GET_MOB_WEIGHT(mob)); fprintf(fd, "Size: %d\n", GET_MOB_SIZE(mob)); fputs("E\n", fd); return TRUE; }
/* specjalne sprawdzanie affectow z zaklec*/ bool check_hold(CHAR_DATA *ch, CHAR_DATA *victim, int type, int spell) { sh_int sn; if( type < 0 || type > MAX_SPELL_INFO ) return FALSE; sn = si_spell_info[type][spell].sn; //zeby nie wrzucac holda na wardancerow i berserkierow if( IS_AFFECTED( victim, AFF_FREE_ACTION )) return TRUE; if( check_affect( ch, victim, type, spell) ) return TRUE; if( sn == gsn_holdevil ) return !IS_EVIL(victim); else if( sn == gsn_holdperson ) return !IS_SET(race_table[GET_RACE(victim)].type, PERSON); else if ( sn == gsn_holdmonster ) return !IS_SET(race_table[GET_RACE(victim)].type, MONSTER); else if ( sn == gsn_holdplant ) return !IS_SET(race_table[GET_RACE(victim)].type, PLANT); else if ( sn == gsn_holdanimal ) return !IS_SET(race_table[GET_RACE(victim)].type, ANIMAL); else return !is_undead(victim); return FALSE; }
int mag_savingthrow(struct char_data * ch, int type) { int save; /* negative apply_saving_throw values make saving throws better! */ if (!ch) { return 0; } if (IS_NPC(ch)) { save = class_saving_throws[(int) CLASS_WARRIOR][type] - (GET_LEVEL(ch) / 3); save += mob_race_saving_throws[(int) GET_RACE(ch)][type]; } else { save = class_saving_throws[(int) GET_CLASS(ch)][type] - (GET_LEVEL(ch) / 4); save += race_saving_throws[(int) GET_RACE(ch)][type]; } save += GET_SAVE(ch, type); /* throwing a 0 is always a failure */ if (MAX(1, save) < number(0, 20)) return TRUE; else return FALSE; }
void ChangeMobRace(struct char_data *ch, char *arg, int type) { int update,row=2,i,a=0,column; char buf[255]; if(type != ENTER_CHECK) if(!*arg || (*arg == '\n')) { ch->specials.medit = MOB_MAIN_MENU; UpdateMobMenu(ch); return; } update = atoi(arg); update--; if(type != ENTER_CHECK) { switch(ch->specials.medit) { case CHANGE_MOB_RACE: if(update < 0 || update > MAX_RACE) return; else { GET_RACE(ch->specials.mobedit) = update; ch->specials.medit = MOB_MAIN_MENU; UpdateMobMenu(ch); return; } } } sprintf(buf, VT_HOMECLR); send_to_char(buf, ch); sprintf(buf, "Mobile race: %s", RaceName[GET_RACE(ch->specials.mobedit)]); send_to_char(buf, ch); for(i = 0; i < MAX_RACE; i++) { a++; if(a==1) column=5; else if(a==2) column = 30; else if(a==3) column = 55; sprintf(buf, VT_CURSPOS, row + 1, column); if(a==3) { row++; a=0; } send_to_char(buf, ch); sprintf(buf, "%-2d %s", i + 1, RaceName[i]); send_to_char(buf, ch); } sprintf(buf, VT_CURSPOS, 21, 1); send_to_char(buf, ch); send_to_char("Select the race number to set to, <C/R> to return to main menu.\n\r--> ",ch); }
/* * Class and/or race specific mobile combat behavior. */ void mobCombatAction(struct char_data *mob) { /* First do class specific spells */ if(!(*mob_class_action[(int)GET_CLASS(mob)].func)(mob, NULL, 0, NULL) && !(*mob_race_action[(int)GET_RACE(mob)].func)(mob, NULL, 0, NULL)) { spec_OffensiveAction(mob, NULL, 0, NULL); } }
/* walk even though they could fly at will. */ void affect_total(struct char_data *ch) { struct affected_type *af; int i,j; char buff[200]; for(i=0; i<MAX_WEAR; i++) { if (ch->equipment[i]) for(j=0; j<MAX_OBJ_AFFECT; j++) affect_modify(ch, ch->equipment[i]->affected[j].location, (int)ch->equipment[i]->affected[j].modifier, ch->equipment[i]->obj_flags.bitvector, FALSE); } for(af = ch->affected; af; af=af->next) if(af->type != SPELL_FLY) affect_modify(ch, af->location, (int) af->modifier, af->bitvector, FALSE); ch->tmpabilities = ch->abilities; for(i=0; i<MAX_WEAR; i++) { if (ch->equipment[i]) for(j=0; j<MAX_OBJ_AFFECT; j++) affect_modify(ch, ch->equipment[i]->affected[j].location, (int) ch->equipment[i]->affected[j].modifier, ch->equipment[i]->obj_flags.bitvector, TRUE); } for(af = ch->affected; af; af=af->next) if(af->type != SPELL_FLY) affect_modify(ch, af->location, (int)af->modifier, af->bitvector, TRUE); /* Make certain values are between 0..25, not < 0 and not > 25! */ i = ((!IS_PC(ch)) ? 25 :18); /* f**k polies */ GET_DEX(ch) = MAX(3,MIN(GET_DEX(ch), i)); GET_INT(ch) = MAX(3,MIN(GET_INT(ch), i)); GET_WIS(ch) = MAX(3,MIN(GET_WIS(ch), i)); GET_CON(ch) = MAX(3,MIN(GET_CON(ch), i)); GET_STR(ch) = MAX(3,GET_STR(ch)); if (!IS_PC(ch)) { GET_STR(ch) = MIN(GET_STR(ch), i); } else if(GET_RACE(ch) != RACE_OGRE) { if (GET_STR(ch) > 18) { GET_ADD(ch) = 100; GET_STR(ch) = 18; } } else { /* warning: I am counting on ChangeStrength() */ /* to be working for this to be safe :) */ GET_STR(ch) = MIN(22,GET_STR(ch)); } }
bool spec_ogre_member( CHAR_DATA *ch ) { CHAR_DATA * vch, *victim = NULL; int count = 0; char *message; if ( !IS_AWAKE( ch ) || IS_AFFECTED( ch, AFF_CALM ) || ch->in_room == NULL || IS_AFFECTED( ch, AFF_CHARM ) || ch->fighting != NULL ) return FALSE; /* find an troll to beat up */ for ( vch = ch->in_room->people; vch != NULL; vch = vch->next_in_room ) { if ( !IS_NPC( vch ) || ch == vch ) continue; if ( !str_cmp( race_table[ GET_RACE(vch) ].name, "troll" ) && ch->level > vch->level - 2 && !is_safe( ch, vch, TRUE ) ) { if ( number_range( 0, count ) == 0 ) victim = vch; count++; } } if ( victim == NULL ) return FALSE; /* say something, then raise hell */ switch ( number_range( 0, 6 ) ) { default: message = NULL; break; case 0: message = "$n wrzeszczy 'Szuka³em ciê, ¶mieciu!'"; break; case 1: message = "$n atakuje $C z szaleñczym wrzaskiem."; break; case 2: message = "$n mówi 'Co taki ¶mierdz±cy, trollowaty pomiot jak ty tu w ogóle robi?'"; break; case 3: message = "$n wy³amuje palce a¿ trzeszcz± i mówi 'My¶lisz, ¿e masz szczê¶cie?'"; break; case 4: message = "$n mówi 'Nie widzê tu stra¿ników którzy mogliby ciê ochroniæ tym razem!'"; break; case 5: message = "$n mówi 'Czas do³±czyæ do swoich durnych braci w za¶wiatach.'"; break; case 6: message = "$n mówi 'I niech gra muzyka...'"; break; } if ( message != NULL ) act( message, ch, NULL, victim, TO_ALL ); multi_hit( ch, victim, TYPE_UNDEFINED ); return TRUE; }
int KyussSon( struct char_data *pChar, int nCmd, const char *szArg, struct char_data *pMob, int nType ) { struct char_data *pTar; struct room_data *pRoom; if( pMob == NULL ) { mudlog( LOG_SYSERR, "pMob == NULL in KyussSon( carceri.c )" ); return FALSE; } if( nType == EVENT_TICK ) { UpdateList( (CharElem **)&pMob->act_ptr ); if( ( pRoom = real_roomp( pMob->in_room ) ) != NULL ) { struct char_data *pNext; for( pTar = pRoom->people; pTar; pTar = pNext ) { pNext = pTar->next_in_room; if( CAN_SEE( pTar, pMob ) && !IsInList( (CharElem *)pMob->act_ptr, pTar ) && ( ( IS_PC( pTar ) && !IS_SET( pTar->specials.act, PLR_NOHASSLE ) ) || ( IS_NPC( pTar ) && ( ( pTar->specials.zone != pMob->specials.zone && !strchr( zone_table[ pTar->specials.zone ].races, GET_RACE( pTar ) ) ) || IS_SET( pTar->specials.act, ACT_ANNOYING ) ) ) ) ) { if( !saves_spell( pTar, SAVING_PARA ) ) { act( "Quando vedi $N, sei preso da un incontrollabile panico!", TRUE, pTar, 0, pMob, TO_CHAR ); do_flee( pTar, "", 0 ); } else { InsertInList( (CharElem **)&pMob->act_ptr, pTar, ( SECS_PER_MUD_HOUR * 48 ) / PULSE_MOBILE ); } } } } else mudlog( LOG_SYSERR, "pMob in invalid room in KyussSon( carceri.c )" ); } else if( nType == EVENT_DEATH ) FreeList( (CharElem **)&pMob->act_ptr ); return FALSE; }
/** * Выставление чару расовых способностей. */ void set_race_feats(CHAR_DATA *ch) { std::vector<int> feat_list = PlayerRace::GetRaceFeatures((int)GET_KIN(ch),(int)GET_RACE(ch)); for (std::vector<int>::iterator i = feat_list.begin(), iend = feat_list.end(); i != iend; ++i) { if (can_get_feat(ch, *i)) { SET_FEAT(ch, *i); } } }
void medit_disp_class_menu(struct descriptor_data *d) { int c; CLS(CH); for (c = 0; c < NUM_MOB_CLASSES; c++) { send_to_char(CH, "%2d) %-20s\r\n", c + 1, npc_classes[c]); } sprinttype(GET_RACE(MOB), npc_classes, buf1); send_to_char(CH, "Mob class: %s%s%s\r\n" "Enter mob class, 0 to quit: ", CCCYN(CH, C_CMP), buf1, CCNRM(CH, C_CMP)); }
int calcHitMulti(CharData *ch) { int multi = 100; if (GET_RACE(ch) == RACE_TROLL) multi += 200; /* Trolls regenerate VERY fast. */ if (GET_RACE(ch) == RACE_STROLL) multi += 300; if(IS_AFFECTED(ch, AFF_PLAGUE)) multi -= 50; if (IS_AFFECTED(ch, AFF_POISON) || IS_AFFECTED(ch, AFF_DISEASE)) multi -= 75; if( ROOM_FLAGGED( ch->in_room, ROOM_HEALTH_REGEN )) multi += 50; /* Position calculations */ switch (GET_POS(ch)) { case POS_MEDITATING: case POS_SLEEPING: multi += 120; break; case POS_RESTING: multi += 60; break; } // During the day, vampires have a difficult time regenerating mana if(!IS_NPC(ch) && ((GET_COND(ch, HUNGER) == 0 && !IS_VAMPIRE(ch)) || (GET_COND(ch, THIRST) == 0))) { multi = 25; return multi; } // Don't let a player's regeneration completely stagnate... multi = MAX(multi, 25); return multi; }
int is_tell_ok(Character *ch, Character *vict) { if( ch->IsPurged() ) return FALSE; else if( vict->IsPurged() ) ch->send(NOPERSON); else if(GET_RACE(vict) != GET_RACE(ch) && GET_LEVEL(ch) < LVL_IMMORT && GET_LEVEL(vict) < LVL_IMMORT && !IS_NPC(ch)) ch->send(NOPERSON); else if (ch == vict) ch->send("You try to tell yourself something.\r\n"); else if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOTELL)) ch->send("You can't tell other people while you have notell on.\r\n"); else if ( AFF_FLAGGED(ch, AFF_SILENCE) && GET_LEVEL(ch) <= LVL_IMMORT ) ch->send("You try to speak, but nothing comes out!\r\n"); /*else if(ch->in_room == ch->StartRoom() && GET_LEVEL(ch) < LVL_IMMORT && GET_LEVEL(vict) < LVL_IMMORT && GET_LEVEL(ch) > 5) ch->send("Your attempt to communicate into the Pattern fails.\r\n");*/ // else if(vict->in_room == vict->StartRoom() && GET_LEVEL(vict) < LVL_IMMORT && GET_LEVEL(ch) < LVL_IMMORT) // ch->send("Your attempt to communicate outside of the Pattern fails.\r\n"); else if (ROOM_FLAGGED(ch->in_room, ROOM_SOUNDPROOF)) ch->send("The walls seem to absorb your words.\r\n"); else if (!IS_NPC(vict) && !vict->desc) /* linkless */ Act("$E's linkless at the moment.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP); else if (PRF_FLAGGED(ch, PRF_TELL_MUTE)) ch->send("You are mute to tells. You need an immortal to remove this.\r\n"); else if (PRF_FLAGGED(vict, PRF_TELL_MUTE)) Act("$E's is mute to tells... Try again later.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP); else if (PLR_FLAGGED(vict, PLR_WRITING)) Act("$E's writing a message right now; try again later.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP); else if ((!IS_NPC(vict) && PRF_FLAGGED(vict, PRF_NOTELL)) || ROOM_FLAGGED(vict->in_room, ROOM_SOUNDPROOF) || vict->IsIgnoring(GET_NAME(ch))) Act("$E can't hear you.", FALSE, ch, 0, vict, TO_CHAR | TO_SLEEP); else return TRUE; return FALSE; }
bool check_sp_armor(CHAR_DATA *ch, CHAR_DATA *victim, int type, int spell) { /* tylko dla personow */ if(!IS_SET(race_table[GET_RACE(ch)].type, PERSON)) return TRUE; if( !get_eq_char(ch,WEAR_HEAD) || !get_eq_char(ch,WEAR_BODY) || !get_eq_char(ch,WEAR_LEGS) || !get_eq_char(ch,WEAR_ARMS) || !get_eq_char(ch,WEAR_HANDS) || !get_eq_char(ch,WEAR_FEET)) return FALSE; return TRUE; }
/***************************************************************************** Chiunque veda il Verme della Morte, viene addormentato dal suo sguardo ipnotico, a meno con non azzecchi un tiro salvezza contro paralisi. *****************************************************************************/ int VermeDellaMorte( struct char_data *pChar, int nCmd, const char *szArg, struct char_data *pMob, int nType ) { if( nType == EVENT_TICK && AWAKE( pMob ) ) { struct room_data *pRoom; if( ( pRoom = real_roomp( pMob->in_room ) ) != NULL ) { struct char_data *pNext, *pTar; for( pTar = pRoom->people; pTar; pTar = pNext ) { pNext = pTar->next_in_room; if( CAN_SEE( pTar, pMob ) && ( ( IS_PC( pTar ) && !IS_SET( pTar->specials.act, PLR_NOHASSLE ) ) || ( IS_NPC( pTar ) && ( ( pTar->specials.zone != pMob->specials.zone && !strchr( zone_table[ pTar->specials.zone ].races, GET_RACE( pTar ) ) ) || IS_SET( pTar->specials.act, ACT_ANNOYING ) ) ) ) && GET_POS( pTar ) > POSITION_SLEEPING && !IsImmune( pTar, IMM_SLEEP ) ) { if( IsSusc( pTar, IMM_SLEEP ) || ( !saves_spell( pTar, SAVING_PARA ) && ( !IsResist( pTar, IMM_SLEEP ) || !saves_spell( pTar, SAVING_PARA ) ) ) ) { act( "$N ti guarda fisso. La tua vista si sdoppia.", FALSE, pTar, 0, pMob, TO_CHAR ); act( "$n cade a terra addormentat$b.", TRUE, pTar, 0, 0, TO_ROOM ); if( pTar->specials.fighting ) stop_fighting( pTar ); GET_POS( pTar ) = POSITION_SLEEPING; } } } } else mudlog( LOG_SYSERR, "pMob in invalid room in VermeDellaMorte( carceri.c )" ); } return FALSE; }
void calculate_height_weight(struct creature *ch) { struct race *race = race_by_idnum(GET_RACE(ch)); int sex = ch->player.sex; if (sex == SEX_NEUTRAL) sex = (random_binary()) ? SEX_MALE:SEX_FEMALE; ch->player.weight = number(race->weight_min[sex], race->weight_max[sex]) + GET_STR(ch); ch->player.height = number(race->height_min[sex], race->height_max[sex]); if (race->weight_add[sex]) ch->player.height += ch->player.weight / race->weight_add[sex]; }
int calcMoveBonus(CharData *ch) { int bonus = 0; if (affected_by_spell(ch, SKILL_ADRENALINE)) bonus += GET_LEVEL(ch); if(GET_RACE(ch) == RACE_STROLL) bonus += 20 + GET_LEVEL(ch)/2; if( GET_DEX(ch) > 18 ) bonus += (GET_DEX(ch) - 18)*3; if(affected_by_spell(ch, SPELL_REGENERATE)) bonus += spell_level(ch, SPELL_REGENERATE)/3 + GET_MAX_MOVE(ch)/6; return bonus; }
int calcManaMulti(CharData *ch) { int multi = 100; if(ROOM_FLAGGED(ch->in_room, ROOM_MANA_REGEN)) multi += 50; if(IS_AFFECTED(ch, AFF_WRAITHFORM)) multi += 25; if((GET_CLASS(ch) == CLASS_SHADOW_DANCER) && (IS_DARK(ch->in_room) || IS_AFFECTED(ch, AFF_SHADOW_SPHERE))) multi += 50; if(IS_AFFECTED(ch, AFF_POISON)) multi -= 100; if(!IS_NPC(ch)) { if( !IS_NPC(ch) && ROOM_FLAGGED(ch->in_room, ROOM_SUFFER) && ( GET_LEVEL(ch) < LVL_IMMORT )) multi -= 90; else if (!GET_COND(ch, THIRST) && IS_AMARA(ch)) multi -= 90; else if (IS_IZARTI(ch) && IS_EVIL(ch)) multi -= 90; else if (IS_DEMON(ch) && IS_GOOD(ch)) multi -= 90; } if(GET_RACE(ch) == RACE_STROLL) multi += 100; /* Position calculations */ switch (GET_POS(ch)) { case POS_MEDITATING: case POS_SLEEPING: multi += 120; break; case POS_RESTING: multi += 60; break; } multi += (int)GET_SKILL(ch, SKILL_DEVOTION); // Don't let a player's regeneration completely stagnate... multi = MAX(multi, 25); return multi; }
int calc_loadroom(struct char_data *ch) { if (IS_IMMORTAL(ch)) return (immort_start_room); else if (PLR_FLAGGED(ch, PLR_FROZEN)) return (frozen_start_room); else if (GET_LEVEL(ch) < 15) {switch(GET_RACE(ch)) { case CLASS_SEVERANE: return START_ROOM; break; case CLASS_POLANE: return 5000; break; case CLASS_KRIVICHI: return START_ROOM; break; case CLASS_VATICHI: return 5000; break; case CLASS_VELANE: return START_ROOM; break; case CLASS_DREVLANE: return 5000; break; } } return (mortal_start_room); }
int ok_damage_shopkeeper(struct char_data * ch, struct char_data * victim) { char buf[200]; int index; if (IS_NPC(victim) && (mob_index[GET_MOB_RNUM(victim)].func == shop_keeper)) for (index = 0; index < top_shop; index++) if ((GET_MOB_RNUM(victim) == SHOP_KEEPER(index)) && !SHOP_KILL_CHARS(index)) { do_action(victim, GET_NAME(ch), cmd_slap, 0); sprintf(buf, "%s %s", GET_NAME(ch), MSG_CANT_KILL_KEEPER); do_tell(victim, buf, cmd_tell, 0); if (GET_RACE(ch)==RACE_KENDER) do_gen_comm(victim, "Stinkin' Kender scum!", 0, SCMD_SHOUT); return (FALSE); } return (TRUE); }
void racial_ability_modifiers(struct char_data *ch) { switch (GET_RACE(ch)) { case RACE_HUMAN: break; case RACE_ELF: ch->real_abils.dex += 1; ch->real_abils.con -= 1; break; case RACE_GNOME: ch->real_abils.intel += 1; ch->real_abils.wis -= 1; break; case RACE_DWARF: ch->real_abils.con += 1; ch->real_abils.cha -= 1; break; default: break; } }
void set_height_and_weight_by_race(struct char_data *ch) { int race, sex, mod; race = GET_RACE(ch); sex = GET_SEX(ch); if (sex < SEX_NEUTRAL || sex >= NUM_SEX) { log("Invalid gender in set_height_and_weight_by_race: %d", sex); sex = SEX_NEUTRAL; } if (race <= RACE_UNDEFINED || race >= NUM_RACES) { log("Invalid gender in set_height_and_weight_by_race: %d", GET_SEX(ch)); race = RACE_UNDEFINED + 1; /* first defined race */ } mod = dice(2, hw_info[race].heightdie); GET_HEIGHT(ch) = hw_info[race].height[sex] + mod; mod *= hw_info[race].weightfac; mod /= 100; GET_WEIGHT(ch) = hw_info[race].weight[sex] + mod; }
int Hates( struct char_data *ch, struct char_data *v) { struct char_list *i; if (IS_AFFECTED(ch, AFF_PARALYSIS)) return(FALSE); if (ch == v) return(FALSE); if (IS_SET(ch->hatefield, HATE_CHAR)) { if (ch->hates.clist) { for (i = ch->hates.clist; i; i = i->next) { if (i->op_ch) { if ((i->op_ch == v) && (!strcmp(i->name, GET_NAME(v)))) return(TRUE); } else { if (!strcmp(i->name, GET_NAME(v))) return(TRUE); } } } } if (IS_SET(ch->hatefield, HATE_RACE)) { if (ch->hates.race != -1) { if (ch->hates.race == GET_RACE(v)) { char buf[256]; sprintf(buf, "Odi %d", GET_RACE(v)); send_to_char(buf, ch); return(TRUE); } } } if (IS_SET(ch->hatefield, HATE_SEX)) { if (ch->hates.sex == GET_SEX(v)) return(TRUE); } if (IS_SET(ch->hatefield, HATE_GOOD)) { if (ch->hates.good < GET_ALIGNMENT(v)) return(TRUE); } if (IS_SET(ch->hatefield, HATE_EVIL)) { if (ch->hates.evil > GET_ALIGNMENT(v)) return(TRUE); } if (IS_SET(ch->hatefield, HATE_CLASS)) { if (HasClass(v, ch->hates.iClass)) { return(TRUE); } } if (IS_SET(ch->hatefield, HATE_VNUM)) { if (ch->hates.vnum == mob_index[v->nr].iVNum) return(TRUE); } return(FALSE); }
void race_affects(struct char_data *ch) { int race; struct affected_type af; extern void affect_join(struct char_data *c, struct affected_type *a, bool ad, bool avg, bool mod, bool avgmod); race = GET_RACE(ch); switch(race) { case RACE_HYLAR: case RACE_DAEWAR: case RACE_NEIDAR: af.type = SPELL_INFRAVISION; af.duration = -1; af.modifier = 0; af.location = APPLY_NONE; af.bitvector = AFF_INFRAVISION; affect_join(ch, &af, FALSE, FALSE, FALSE, FALSE); if ( GET_SKILL(ch, SKILL_NATURAL_HARDINESS) < 60 ) { SET_SKILL(ch, SKILL_NATURAL_HARDINESS, 60); } break; case RACE_SILVANESTI: case RACE_QUALINESTI: case RACE_KAGONESTI: case RACE_HALFELVEN: case RACE_GNOME: af.type = SPELL_INFRAVISION; af.duration = -1; af.modifier = 0; af.location = APPLY_NONE; af.bitvector = AFF_INFRAVISION; affect_join(ch, &af, FALSE, FALSE, FALSE, FALSE); break; case RACE_MINOTAUR: if ( GET_SKILL(ch, SKILL_GORE) < 60 ) { SET_SKILL(ch, SKILL_GORE, 60); } // GET_AC(ch) -= 12; break; case RACE_KENDER: af.type = SPELL_INFRAVISION; af.duration = -1; af.modifier = 0; af.location = APPLY_NONE; af.bitvector = AFF_INFRAVISION; affect_join(ch, &af, FALSE, FALSE, FALSE, FALSE); if ( GET_SKILL(ch, SKILL_HIDE) < 60 ) { SET_SKILL(ch, SKILL_HIDE, 60); } if ( GET_SKILL(ch, SKILL_SNEAK) < 60 ) { SET_SKILL(ch, SKILL_SNEAK, 60); } if ( GET_SKILL(ch, SKILL_PICK_LOCK) < 60 ) { SET_SKILL(ch, SKILL_PICK_LOCK, 60); } if ( GET_SKILL(ch, SKILL_STEAL) < 60 ) { SET_SKILL(ch, SKILL_STEAL, 60); } break; default: break; } }
/* do_simple_move assumes * 1. That there is no master and no followers. * 2. That the direction exists. * * Returns : * 1 : If succes. * 0 : If fail */ int do_simple_move(struct char_data *ch, int dir, int need_specials_check) { room_rnum was_in; struct char_data *i; /* * Check for special routines (North is 1 in command list, but 0 here) Note * -- only check if following; this avoids 'double spec-proc' bug */ if (need_specials_check && special(ch, dir + 1, "")) { return (0); } /* charmed? */ if (AFF_FLAGGED(ch, AFF_CHARM) && ch->master && ch->in_room == ch->master->in_room) { send_to_char("The thought of leaving your master makes you weep.\r\n", ch); act("$n bursts into tears.", FALSE, ch, 0, 0, TO_ROOM); return (0); } /* if this room or the one we're going to needs a boat, check for one */ if ((SECT(ch->in_room) == SECT_WATER_NOSWIM) || (SECT(EXIT(ch, dir)->to_room) == SECT_WATER_NOSWIM)) { if (!has_boat(ch)) { send_to_char("You need a boat to go there.\r\n", ch); return (0); } } if((IS_CARRYING_W(ch) > (CAN_CARRY_W(ch) * 2) && GET_LEVEL(ch) < LVL_GOD && !IS_NPC(ch))) { send_to_char("You are to heavy to move! Drop something!\r\n", ch); return (0); } if(IS_NPC_FISH(ch)) { if(SECT(EXIT(ch, dir)->to_room) != SECT_BRIDGE && SECT(EXIT(ch, dir)->to_room) != SECT_WATER_SWIM && SECT(EXIT(ch, dir)->to_room) != SECT_WATER_NOSWIM) { // sprintf(buf, "%s %d", dirs[dir], SECT(EXIT(ch, dir)->to_room)); // mobsay(ch, buf); return FALSE; } if(GET_MOB_VNUM(ch) < 1500 && ROOM_FLAGGED(EXIT(ch, dir)->to_room, ROOM_SALT_FISH)) { return FALSE; } } if (SECT(EXIT(ch, dir)->to_room) != SECT_FOREST) { if (IS_NPC_WOLF(ch) || IS_NPC_CRAB(ch) || IS_NPC_SKELETON(ch)) { return (0); } } /* move points needed is avg. move loss for src and destination sect type */ if (ROOM_FLAGGED(EXIT(ch, dir)->to_room, ROOM_TUNNEL) && num_pc_in_room(&(world[EXIT(ch, dir)->to_room])) > 1) { send_to_char("There isn't enough room there for more than one person!\r\n", ch); return (0); } /* Mortals and low level gods cannot enter greater god rooms. */ if (ROOM_FLAGGED(EXIT(ch, dir)->to_room, ROOM_GODROOM) && GET_LEVEL(ch) < LVL_GRGOD) { send_to_char("You aren't godly enough to use that room!\r\n", ch); return (0); } /* Now we know we're allow to go into the room. */ if(AFF_FLAGGED(ch, AFF_FISHING) || GET_FISHON(ch)) { REMOVE_BIT(AFF_FLAGS(ch), AFF_FISHING); GET_FISHON(ch) = 0; GET_REELIN(ch) = 0; send_to_char("You stop fishing.\r\n", ch); act("$n stops fishing.", FALSE, ch, 0, 0, TO_ROOM); } if (!AFF_FLAGGED(ch, AFF_SNEAK) && !AFF_FLAGGED(ch, AFF_INVISIBLE)) { if(IS_NPC(ch)) { switch(GET_RACE(ch)) { case RACE_NPC_MAMMAL: case RACE_NPC_HIGHHUMAN: case RACE_NPC_GOBLIN: case RACE_NPC_PIG: case RACE_NPC_WOLF: case RACE_NPC_CHICKEN: sprintf(buf2, "$n walks %s.", dirs[dir]); break; case RACE_NPC_AVIAN: sprintf(buf2, "$n flits %s.", dirs[dir]); break; case RACE_NPC_SHEEP: case RACE_NPC_GOAT: sprintf(buf2, "$n walks %s.", dirs[dir]); break; case RACE_NPC_SKELETON: sprintf(buf2, "$n shambles %s.", dirs[dir]); break; case RACE_NPC_COW: sprintf(buf2, "$n walks %s.", dirs[dir]); break; case RACE_NPC_CRAB: sprintf(buf2, "$n scurries %s.", dirs[dir]); break; case RACE_NPC_FISH: sprintf(buf2, "$n swims %s.", dirs[dir]); break; case RACE_NPC_INSECT: sprintf(buf2, "$n buzzes %s.", dirs[dir]); break; default: sprintf(buf2, "$n leaves %s.", dirs[dir]); break; } } else { sprintf(buf2, "$n leaves %s.", dirs[dir]); } if(SECT(ch->in_room) == SECT_WATER_SWIM && !IS_NPC_FISH(ch)) { sprintf(buf2, "$n splashes through the water, heading %s.", dirs[dir]); } act(buf2, FALSE, ch, 0, 0, TO_ROOM); } was_in = ch->in_room; char_from_room(ch); char_to_room(ch, world[was_in].dir_option[dir]->to_room); if (!AFF_FLAGGED(ch, AFF_SNEAK)) { if(!AFF_FLAGGED(ch, AFF_INVISIBLE)) { act("$n has arrived.", FALSE, ch, 0, 0, TO_ROOM); } } if (ch->desc != NULL) look_at_room(ch, 0); if(IS_NPC_CRAB(ch) || IS_NPC_LIVESTOCK(ch)) { for (i = world[ch->in_room].people; i; i = i->next_in_room) { if(IS_NPC_WOLF(i) && IS_NPC_CRAB(ch)) { sprintf(buf, "%s sees %s and tries to run!\r\n", GET_NAME(ch), GET_NAME(i)); send_to_room(buf, ch->in_room); if(!number(0, 2)) { do_flee(ch, NULL, 0, 0); } if(i->in_room == ch->in_room && !number(0, 2)) { hit(i, ch, TYPE_UNDEFINED); } } if((IS_NPC_SKELETON(i) || IS_NPC_WOLF(i)) && IS_NPC_LIVESTOCK(ch)) { if(ch->master) { sprintf(buf, "%s sees %s and %s in absolute terror!\r\n", GET_NAME(ch), GET_NAME(i), livestock_afraid_vocals[(int)GET_RACE(ch)]); send_to_room(buf, ch->in_room); if(!number(0, 2)) { do_flee(ch, NULL, 0, 0); } if(i->in_room == ch->in_room && !number(0, 2)) { hit(i, ch, TYPE_UNDEFINED); } } } } return (1); } if (ROOM_FLAGGED(ch->in_room, ROOM_DEATH) && GET_LEVEL(ch) < LVL_IMMORT) { log_death_trap(ch); death_cry(ch); extract_char(ch); return (0); } return (1); }
void mobNormalAction(struct char_data *mob) { if(!(*mob_class_action[(int)GET_CLASS(mob)].func)(mob, NULL, 0, NULL)) (*mob_race_action[(int)GET_RACE(mob)].func)(mob, NULL, 0, NULL); }
void make_breath(struct char_data *ch) { loss_breath(ch, breath[SECT(ch->in_room)][(GET_RACE(ch) > RACE_GORAK ? (GET_RACE(ch)-RACE_DUNEDAIN) : GET_RACE(ch))] ); }
int ok_pick(struct char_data *ch, obj_vnum keynum, int pickproof, int scmd) { int percent, skill_lvl; if (scmd != SCMD_PICK) return (1); percent = rand_number(1, 101); skill_lvl = GET_SKILL(ch, SKILL_PICK_LOCK) + dex_app_skill[GET_DEX(ch)].p_locks + race_app_skill[GET_RACE(ch)].p_locks; if (keynum == NOTHING) send_to_char(ch, "Odd - you can't seem to find a keyhole.\r\n"); else if (pickproof) send_to_char(ch, "It resists your attempts to pick it.\r\n"); else if (percent > skill_lvl) send_to_char(ch, "You failed to pick the lock.\r\n"); else return (1); return (0); }
void medit_parse(struct descriptor_data *d, char *arg) { int number; int mob_number; // the RNUM switch(d->edit_mode) { case MEDIT_CONFIRM_EDIT: /* if player hits 'Y' then edit mob */ switch (*arg) { case 'y': case 'Y': medit_disp_menu(d); break; case 'n': case 'N': STATE(d) = CON_PLAYING; /* free up the editing mob */ if (d->edit_mob) Mem->DeleteCh(d->edit_mob); d->edit_mob = NULL; d->edit_number = 0; PLR_FLAGS(d->character).RemoveBit(PLR_EDITING); break; default: send_to_char("That's not a valid choice!\r\n", CH); send_to_char("Do you wish to edit it?\r\n", CH); break; } break; /* end of MEDIT_CONFIRM_EDIT */ case MEDIT_CONFIRM_SAVESTRING: switch(*arg) { case 'y': case 'Y': // first write to the internal tables if (!from_ip_zone(d->edit_number)) { sprintf(buf,"%s wrote new mob #%ld", GET_CHAR_NAME(d->character), d->edit_number); mudlog(buf, d->character, LOG_WIZLOG, TRUE); } mob_number = real_mobile(d->edit_number); if (mob_number > 0) { // first we go through the entire list of mobs to find out // which are pointing to this prototype; if it is, it gets // replaced struct char_data *i, *temp; int c; for (i = character_list; i; i = i->next) { if (mob_number == i->nr) { // alloc a temp mobile temp = Mem->GetCh(); *temp = *i; *i = *d->edit_mob; /* copy game-time dependent vars over */ i->in_room = temp->in_room; i->nr = mob_number; i->affected = temp->affected; i->carrying = temp->carrying; i->cyberware = temp->cyberware; i->bioware = temp->bioware; // any eq worn for (c = 0; c < NUM_WEARS; ++c) i->equipment[c] = temp->equipment[c]; i->next_in_room = temp->next_in_room; i->next = temp->next; i->next_fighting = temp->next_fighting; i->followers = temp->followers; i->master = temp->master; i->char_specials.fighting = temp->char_specials.fighting; i->char_specials.hunting = temp->char_specials.hunting; i->mob_specials.last_direction = temp->mob_specials.last_direction; i->mob_specials.memory = temp->mob_specials.memory; i->mob_specials.wait_state = temp->mob_specials.wait_state; Mem->ClearCh(temp); } // end if statement } // end for loop // now you can free the old prototype and put in the new one if (mob_proto[mob_number].player.physical_text.keywords) delete [] mob_proto[mob_number].player.physical_text.keywords; if (mob_proto[mob_number].player.title) delete [] mob_proto[mob_number].player.title; if (mob_proto[mob_number].player.physical_text.name) delete [] mob_proto[mob_number].player.physical_text.name; if (mob_proto[mob_number].player.physical_text.room_desc) delete [] mob_proto[mob_number].player.physical_text.room_desc; if (mob_proto[mob_number].player.physical_text.look_desc) delete [] mob_proto[mob_number].player.physical_text.look_desc; if (mob_proto[mob_number].mob_specials.arrive) delete [] mob_proto[mob_number].mob_specials.arrive; if (mob_proto[mob_number].mob_specials.leave) delete [] mob_proto[mob_number].mob_specials.leave; mob_proto[mob_number] = *d->edit_mob; mob_proto[mob_number].nr = mob_number; } else { // if not, we need to make a new spot in the list int counter; int found = FALSE; struct char_data *new_mob_proto; struct index_data *new_mob_index; struct char_data *temp_mob; // two because you are adding one and you need one over new_mob_index = new struct index_data[top_of_mobt + 2]; new_mob_proto = new struct char_data[top_of_mobt + 2]; // count through the tables for (counter = 0; counter < top_of_mobt + 1; counter++) { /* if we haven't found it */ if (!found) { /* check if current virtual is bigger than our virtual */ if (MOB_VNUM_RNUM(counter) > d->edit_number) { /* eureka. insert now */ /*---------*/ new_mob_index[counter].vnum = d->edit_number; new_mob_index[counter].number = 0; new_mob_index[counter].func = NULL; /*---------*/ new_mob_proto[counter] = *(d->edit_mob); new_mob_proto[counter].in_room = NOWHERE; /* it is now safe (and necessary!) to assign real number to * the edit_mob, which has been -1 all this time */ d->edit_mob->nr = counter; /* and assign to prototype as well */ new_mob_proto[counter].nr = counter; found = TRUE; /* insert the other proto at this point */ new_mob_index[counter + 1] = mob_index[counter]; new_mob_proto[counter + 1] = mob_proto[counter]; new_mob_proto[counter + 1].nr = counter + 1; } else { /* just copy from old to new, no num change */ new_mob_proto[counter] = mob_proto[counter]; new_mob_index[counter] = mob_index[counter]; } } else { // if !found else /* we HAVE already found it.. therefore copy to mobile + 1 */ new_mob_index[counter + 1] = mob_index[counter]; new_mob_proto[counter + 1] = mob_proto[counter]; new_mob_proto[counter + 1].nr = counter + 1; } } // for loop through list /* if we STILL haven't found it, means the mobile was > than all * the other mobs.. so insert at end */ if (!found) { new_mob_index[top_of_mobt + 1].vnum = d->edit_number; new_mob_index[top_of_mobt + 1].number = 0; new_mob_index[top_of_mobt + 1].func = NULL; clear_char(new_mob_proto + top_of_mobt + 1); new_mob_proto[top_of_mobt + 1] = *(d->edit_mob); new_mob_proto[top_of_mobt + 1].in_room = NOWHERE; new_mob_proto[top_of_mobt + 1].nr = top_of_mobt + 1; /* it is now safe (and necessary!) to assign real number to * the edit_mob, which has been -1 all this time */ d->edit_mob->nr = top_of_mobt + 1; } top_of_mobt++; /* we also have to renumber all the mobiles currently * * existing in the world. This is because when I start * * extracting mobiles, bad things will happen! */ for (temp_mob = character_list; temp_mob; temp_mob = temp_mob->next) if (GET_MOB_RNUM (temp_mob) >= d->edit_mob->nr) GET_MOB_RNUM (temp_mob)++; /* free and replace old tables */ delete [] mob_proto; delete [] mob_index; mob_proto = new_mob_proto; mob_index = new_mob_index; /* RENUMBER ZONE TABLES HERE, only * * because I ADDED a mobile! * * This code shamelessly ripped off from db.c */ int zone, cmd_no; for (zone = 0; zone <= top_of_zone_table; zone++) for (cmd_no = 0; cmd_no < zone_table[zone].num_cmds; cmd_no++) { switch (ZCMD.command) { case 'M': ZCMD.arg1 = (ZCMD.arg1 >= d->edit_mob->nr ? ZCMD.arg1 + 1 : ZCMD.arg1); break; } } } // finally done putting the mobile into memory send_to_char("Writing mobile to disk...", CH); write_mobs_to_disk(d->character->player_specials->saved.zonenum); // again, here we don't delete it cause we don't want to end up // deleting the strings from the prototypes if (d->edit_mob) Mem->ClearCh(d->edit_mob); d->edit_mob = NULL; STATE(d) = CON_PLAYING; PLR_FLAGS(d->character).RemoveBit(PLR_EDITING); send_to_char("Done.\r\n", d->character); break; case 'n': case 'N': send_to_char("Mobile not saved, aborting.\r\n", d->character); STATE(d) = CON_PLAYING; // complete nuke if (d->edit_mob) Mem->DeleteCh(d->edit_mob); d->edit_mob = NULL; d->edit_number = 0; d->edit_zone = 0; PLR_FLAGS(d->character).RemoveBit(PLR_EDITING); break; default: send_to_char("Invalid choice!\r\n", d->character); send_to_char("Do you wish to save this mobile internally?\r\n", d->character); break; } break; case MEDIT_MAIN_MENU: switch (*arg) { case 'q': case 'Q': d->edit_mode = MEDIT_CONFIRM_SAVESTRING; medit_parse(d, "y"); break; case 'x': case 'X': d->edit_mode = MEDIT_CONFIRM_SAVESTRING; medit_parse(d, "n"); break; case '1': send_to_char("Enter keywords:", CH); d->edit_mode = MEDIT_EDIT_NAMELIST; break; case '2': send_to_char("Enter name:", CH); d->edit_mode = MEDIT_SHORT_DESCR; break; case '3': send_to_char("Enter room description:", CH); d->edit_mode = MEDIT_REG_DESCR; d->str = new (char *); if (!d->str) { mudlog("Malloc failed!", NULL, LOG_SYSLOG, TRUE); shutdown(); } *(d->str) = NULL; d->max_str = MAX_REG_DESC_LENGTH; d->mail_to = 0; break; case '4': // go to modify.cc send_to_char("Enter look description:\r\n", CH); d->edit_mode = MEDIT_LONG_DESCR; d->str = new (char *); if (!d->str) { mudlog("Malloc failed!", NULL, LOG_SYSLOG, TRUE); shutdown(); } *(d->str) = NULL; d->max_str = MAX_MESSAGE_LENGTH; d->mail_to = 0; break; case '5': medit_disp_mobflags_menu(d); d->edit_mode = MEDIT_MOB_FLAGS; break; case '6': medit_disp_affected_menu(d); d->edit_mode = MEDIT_AFF_FLAGS; break; case '8': send_to_char("Enter average nuyen: ", CH); d->edit_mode = MEDIT_NUYEN; break; case '9': send_to_char("Enter bonus karma points: ", CH); d->edit_mode = MEDIT_EXPERIENCE; break; case 'a': medit_disp_att_menu(d); d->edit_mode = MEDIT_ATTRIBUTES; break; case 'b': send_to_char("Enter level: ", CH); d->edit_mode = MEDIT_LEVEL; break; case 'c': send_to_char("Enter ballistic armor points: ", CH); d->edit_mode = MEDIT_BALLISTIC; break; case 'd': send_to_char("Enter impact armor points: ", CH); d->edit_mode = MEDIT_IMPACT; break; case 'e': send_to_char("Enter max physical points: ", CH); d->edit_mode = MEDIT_PHYSICAL; break; case 'f': send_to_char("Enter max mental points: ", CH); d->edit_mode = MEDIT_MENTAL; break; case 'g': medit_disp_pos_menu(d); send_to_char("Enter position: ", CH); d->edit_mode = MEDIT_POSITION; break; case 'h': medit_disp_pos_menu(d); send_to_char("Enter default position: ", CH); d->edit_mode = MEDIT_DEFAULT_POSITION; break; case 'i': medit_disp_gender_menu(d); d->edit_mode = MEDIT_GENDER; break; case 'j': send_to_char("Enter weight (in kilograms): ", CH); d->edit_mode = MEDIT_WEIGHT; break; case 'k': send_to_char("Enter height (in centimeters): ", CH); d->edit_mode = MEDIT_HEIGHT; break; case 'l': medit_disp_class_menu(d); d->edit_mode = MEDIT_CLASS; break; case 'm': medit_disp_attack_menu(d); d->edit_mode = MEDIT_ATTACK_TYPE; break; case 'n': medit_disp_skill_menu(d); d->edit_mode = MEDIT_SKILLS; break; case 'o': send_to_char("Enter arrive text: ", CH); d->edit_mode = MEDIT_ARRIVE_MSG; break; case 'p': send_to_char("Enter leave text: ", CH); d->edit_mode = MEDIT_LEAVE_MSG; break; default: medit_disp_menu(d); break; } break; case MEDIT_EDIT_NAMELIST: if (MOB->player.physical_text.keywords) delete [] MOB->player.physical_text.keywords; MOB->player.physical_text.keywords = str_dup(arg); medit_disp_menu(d); break; case MEDIT_SHORT_DESCR: if (MOB->player.physical_text.name) delete [] MOB->player.physical_text.name; MOB->player.physical_text.name = str_dup(arg); medit_disp_menu(d); break; case MEDIT_ARRIVE_MSG: if (MOB->mob_specials.arrive) delete [] MOB->mob_specials.arrive; MOB->mob_specials.arrive = str_dup(arg); medit_disp_menu(d); break; case MEDIT_LEAVE_MSG: if (MOB->mob_specials.leave) delete [] MOB->mob_specials.leave; MOB->mob_specials.leave = str_dup(arg); medit_disp_menu(d); break; case MEDIT_REG_DESCR: // you should not come here break; case MEDIT_LONG_DESCR: // you should not come here break; case MEDIT_MOB_FLAGS: number = atoi(arg); if ((number < 0) || (number > MOB_MAX)) medit_disp_mobflags_menu(d); else { if (number == 0) // 0 = quit medit_disp_menu(d); else { MOB_FLAGS(MOB).ToggleBit(number-1); medit_disp_mobflags_menu(d); } } break; case MEDIT_AFF_FLAGS: number = atoi(arg); if ((number < 0) || (number > AFF_MAX)) medit_disp_affected_menu(d); else { if (number == 0) // 0 = quit medit_disp_menu(d); else { AFF_FLAGS(MOB).ToggleBit(number - 1); medit_disp_affected_menu(d); } } break; case MEDIT_NUYEN: number = atoi(arg); if ((number < 0) || (number > 999999)) { send_to_char("Value must range between 0 and 999999.\r\n", CH); send_to_char("Enter average nuyen: ", CH); } else { GET_NUYEN(MOB) = number; send_to_char("Enter average credstick value: ", CH); d->edit_mode = MEDIT_CREDSTICK; } break; case MEDIT_CREDSTICK: number = atoi(arg); if ((number < 0) || (number > 999999)) { send_to_char("Value must range between 0 and 999999.\r\n", CH); send_to_char("Enter average credstick value: ", CH); } else { GET_BANK(MOB) = number; medit_disp_menu(d); } break; case MEDIT_EXPERIENCE: number = atoi(arg); if ((number < 0) || (number > 7500)) { send_to_char("Value must range between 0 and 7500.\r\n", CH); send_to_char("Enter bonus karma points: ", CH); } else { int karma; if (number > (karma=calc_karma(NULL, MOB))) { send_to_char("Bonus karma may not be higher than actual karma. Lowering.\r\n", CH); number = karma; } GET_KARMA(MOB) = number; medit_disp_menu(d); } break; case MEDIT_SKILLS: switch (*arg) { case '0': medit_disp_menu(d); break; case '1': medit_disp_skills(d); send_to_char("Enter a skill (0 to quit): ", CH); d->edit_mode = MEDIT_SKILL1; break; case '2': medit_disp_skills(d); send_to_char("Enter a skill (0 to quit): ", CH); d->edit_mode = MEDIT_SKILL2; break; case '3': medit_disp_skills(d); send_to_char("Enter a skill (0 to quit): ", CH); d->edit_mode = MEDIT_SKILL3; break; case '4': medit_disp_skills(d); send_to_char("Enter a skill (0 to quit): ", CH); d->edit_mode = MEDIT_SKILL4; break; case '5': medit_disp_skills(d); send_to_char("Enter a skill (0 to quit): ", CH); d->edit_mode = MEDIT_SKILL5; break; default: medit_disp_skill_menu(d); break; } break; // end of MEDIT_SKILLS case MEDIT_SKILL1: number = atoi(arg); if ((number < 0) || (number > MAX_SKILLS)) { medit_disp_skills(d); send_to_char(CH, "Value must range between 1 and %d.\r\n", MAX_SKILLS); send_to_char("Enter a skill (0 to quit): ", CH); } else if (number == 0) { // 0 = quit medit_disp_skill_menu(d); d->edit_mode = MEDIT_SKILLS; } else { SET_SKILL(MOB, MOB->mob_specials.mob_skills[0], 0) MOB->mob_specials.mob_skills[0] = number; // to adjust it send_to_char("Enter skill level (0 to quit): ", CH); d->edit_mode = MEDIT_SKILL1_VAL; } break; case MEDIT_SKILL2: number = atoi(arg); if ((number < 0) || (number > MAX_SKILLS)) { medit_disp_skills(d); send_to_char(CH, "Value must range between 1 and %d.\r\n", MAX_SKILLS); send_to_char("Enter a skill (0 to quit): ", CH); } else if (number == 0) { // 0 = quit medit_disp_skill_menu(d); d->edit_mode = MEDIT_SKILLS; } else { SET_SKILL(MOB, MOB->mob_specials.mob_skills[0], 0) MOB->mob_specials.mob_skills[0] = number; // to adjust it send_to_char("Enter skill level (0 to quit): ", CH); d->edit_mode = MEDIT_SKILL2_VAL; } break; case MEDIT_SKILL3: number = atoi(arg); if ((number < 0) || (number > MAX_SKILLS)) { medit_disp_skills(d); send_to_char(CH, "Value must range between 1 and %d.\r\n", MAX_SKILLS); send_to_char("Enter a skill (0 to quit): ", CH); } else if (number == 0) { // 0 = quit medit_disp_skill_menu(d); d->edit_mode = MEDIT_SKILLS; } else { SET_SKILL(MOB, MOB->mob_specials.mob_skills[0], 0) MOB->mob_specials.mob_skills[0] = number; // to adjust it send_to_char("Enter skill level (0 to quit): ", CH); d->edit_mode = MEDIT_SKILL3_VAL; } break; case MEDIT_SKILL4: number = atoi(arg); if ((number < 0) || (number > MAX_SKILLS)) { medit_disp_skills(d); send_to_char(CH, "Value must range between 1 and %d.\r\n", MAX_SKILLS); send_to_char("Enter a skill (0 to quit): ", CH); } else if (number == 0) { // 0 = quit medit_disp_skill_menu(d); d->edit_mode = MEDIT_SKILLS; } else { SET_SKILL(MOB, MOB->mob_specials.mob_skills[0], 0) MOB->mob_specials.mob_skills[0] = number; // to adjust it send_to_char("Enter skill level (0 to quit): ", CH); d->edit_mode = MEDIT_SKILL4_VAL; } break; case MEDIT_SKILL5: number = atoi(arg); if ((number < 0) || (number > MAX_SKILLS)) { medit_disp_skills(d); send_to_char(CH, "Value must range between 1 and %d.\r\n", MAX_SKILLS); send_to_char("Enter a skill (0 to quit): ", CH); } else if (number == 0) { // 0 = quit medit_disp_skill_menu(d); d->edit_mode = MEDIT_SKILLS; } else { SET_SKILL(MOB, MOB->mob_specials.mob_skills[0], 0) MOB->mob_specials.mob_skills[0] = number; // to adjust it send_to_char("Enter skill level (0 to quit): ", CH); d->edit_mode = MEDIT_SKILL5_VAL; } break; case MEDIT_SKILL1_VAL: number = atoi(arg); if ((number < 0) || (number > 50)) { send_to_char("Skill level must be between 1 and 50.\r\n", CH); send_to_char("Enter skill level: ", CH); } else if (number == 0) { MOB->mob_specials.mob_skills[0] = 0; MOB->mob_specials.mob_skills[1] = 0; d->edit_mode = MEDIT_SKILLS; medit_disp_skill_menu(d); } else { MOB->mob_specials.mob_skills[1] = number; GET_SKILL(MOB, MOB->mob_specials.mob_skills[0]) = MOB->mob_specials.mob_skills[1]; SET_SKILL(MOB, MOB->mob_specials.mob_skills[0], MOB->mob_specials.mob_skills[1]); d->edit_mode = MEDIT_SKILLS; medit_disp_skill_menu(d); } break; case MEDIT_SKILL2_VAL: number = atoi(arg); if ((number < 0) || (number > 50)) { send_to_char("Skill level must be between 1 and 50.\r\n", CH); send_to_char("Enter skill level: ", CH); } else if (number == 0) { MOB->mob_specials.mob_skills[2] = 0; MOB->mob_specials.mob_skills[3] = 0; d->edit_mode = MEDIT_SKILLS; medit_disp_skill_menu(d); } else { MOB->mob_specials.mob_skills[3] = number; GET_SKILL(MOB, MOB->mob_specials.mob_skills[2]) = MOB->mob_specials.mob_skills[3]; SET_SKILL(MOB, MOB->mob_specials.mob_skills[2], MOB->mob_specials.mob_skills[3]); d->edit_mode = MEDIT_SKILLS; medit_disp_skill_menu(d); } break; case MEDIT_SKILL3_VAL: number = atoi(arg); if ((number < 0) || (number > 50)) { send_to_char("Skill level must be between 1 and 50.\r\n", CH); send_to_char("Enter skill level: ", CH); } else if (number == 0) { MOB->mob_specials.mob_skills[4] = 0; MOB->mob_specials.mob_skills[5] = 0; d->edit_mode = MEDIT_SKILLS; medit_disp_skill_menu(d); } else { MOB->mob_specials.mob_skills[5] = number; GET_SKILL(MOB, MOB->mob_specials.mob_skills[4]) = MOB->mob_specials.mob_skills[5]; SET_SKILL(MOB, MOB->mob_specials.mob_skills[4], MOB->mob_specials.mob_skills[5]); d->edit_mode = MEDIT_SKILLS; medit_disp_skill_menu(d); } break; case MEDIT_SKILL4_VAL: number = atoi(arg); if ((number < 0) || (number > 50)) { send_to_char("Skill level must be between 1 and 50.\r\n", CH); send_to_char("Enter skill level: ", CH); } else if (number == 0) { MOB->mob_specials.mob_skills[6] = 0; MOB->mob_specials.mob_skills[7] = 0; d->edit_mode = MEDIT_SKILLS; medit_disp_skill_menu(d); } else { MOB->mob_specials.mob_skills[7] = number; GET_SKILL(MOB, MOB->mob_specials.mob_skills[6]) = MOB->mob_specials.mob_skills[7]; SET_SKILL(MOB, MOB->mob_specials.mob_skills[6], MOB->mob_specials.mob_skills[7]); d->edit_mode = MEDIT_SKILLS; medit_disp_skill_menu(d); } break; case MEDIT_SKILL5_VAL: number = atoi(arg); if ((number < 0) || (number > 50)) { send_to_char("Skill level must be between 1 and 50.\r\n", CH); send_to_char("Enter skill level: ", CH); } else if (number == 0) { MOB->mob_specials.mob_skills[8] = 0; MOB->mob_specials.mob_skills[9] = 0; d->edit_mode = MEDIT_SKILLS; medit_disp_skill_menu(d); } else { MOB->mob_specials.mob_skills[9] = number; GET_SKILL(MOB, MOB->mob_specials.mob_skills[8]) = MOB->mob_specials.mob_skills[9]; SET_SKILL(MOB, MOB->mob_specials.mob_skills[8], MOB->mob_specials.mob_skills[9]); d->edit_mode = MEDIT_SKILLS; medit_disp_skill_menu(d); } break; case MEDIT_ATTRIBUTES: switch (*arg) { case '1': send_to_char("Enter body attribute: ", CH); d->edit_mode = MEDIT_BOD; break; case '2': send_to_char("Enter quickness attribute: ", CH); d->edit_mode = MEDIT_QUI; break; case '3': send_to_char("Enter strength attribute: ", CH); d->edit_mode = MEDIT_STR; break; case '4': send_to_char("Enter charisma attribute: ", CH); d->edit_mode = MEDIT_CHA; break; case '5': send_to_char("Enter intelligence attribute: ", CH); d->edit_mode = MEDIT_INT; break; case '6': send_to_char("Enter willpower attribute: ", CH); d->edit_mode = MEDIT_WIL; break; case '7': send_to_char("Enter magic attribute: ", CH); d->edit_mode = MEDIT_MAG; break; case 'q': case 'Q': // back to main menu medit_disp_menu(d); break; default: medit_disp_att_menu(d); break; } break; case MEDIT_BOD: number = atoi(arg); if ((number < 1) || (number > 50)) { send_to_char("Value must range between 1 and 50.\r\n", CH); send_to_char("Enter body attribute: ", CH); } else { GET_REAL_BOD(MOB) = number; MOB->real_abils.bod_index = number * 100; medit_disp_att_menu(d); } break; case MEDIT_QUI: number = atoi(arg); if ((number < 1) || (number > 50)) { send_to_char("Value must range between 1 and 50.\r\n", CH); send_to_char("Enter quickness attribute: ", CH); } else { GET_REAL_QUI(MOB) = number; GET_REAL_REA(MOB) = (number + GET_REAL_INT(MOB)) >> 1; medit_disp_att_menu(d); } break; case MEDIT_STR: number = atoi(arg); if ((number < 1) || (number > 50)) { send_to_char("Value must range between 1 and 50.\r\n", CH); send_to_char("Enter strength attribute: ", CH); } else { GET_REAL_STR(MOB) = number; medit_disp_att_menu(d); } break; case MEDIT_CHA: number = atoi(arg); if ((number < 1) || (number > 50)) { send_to_char("Value must range between 1 and 50.\r\n", CH); send_to_char("Enter charisma attribute: ", CH); } else { GET_REAL_CHA(MOB) = number; medit_disp_att_menu(d); } break; case MEDIT_INT: number = atoi(arg); if ((number < 1) || (number > 50)) { send_to_char("Value must range between 1 and 50.\r\n", CH); send_to_char("Enter intelligence attribute: ", CH); } else { GET_REAL_INT(MOB) = number; GET_REAL_REA(MOB) = (number + GET_REAL_QUI(MOB)) >> 1; medit_disp_att_menu(d); } break; case MEDIT_WIL: number = atoi(arg); if ((number < 1) || (number > 50)) { send_to_char("Value must range between 1 and 50.\r\n", CH); send_to_char("Enter willpower attribute: ", CH); } else { GET_REAL_WIL(MOB) = number; medit_disp_att_menu(d); } break; case MEDIT_MAG: number = atoi(arg); if ((number < 0) || (number > 50)) { send_to_char("Value must range between 0 and 50.\r\n", CH); send_to_char("Enter magic attribute: ", CH); } else { MOB->real_abils.mag = number * 100; medit_disp_att_menu(d); } break; case MEDIT_LEVEL: number = atoi(arg); if (number < 0) { send_to_char("Invalid choice.\r\n", CH); send_to_char("Enter level: ", CH); } else { GET_LEVEL(MOB) = number; medit_disp_menu(d); } break; case MEDIT_BALLISTIC: number = atoi(arg); if (number < 0) { send_to_char("Value must be greater than 0.\r\n", CH); send_to_char("Enter ballistic armor points: ", CH); } else { GET_BALLISTIC(MOB) = number; medit_disp_menu(d); } break; case MEDIT_IMPACT: number = atoi(arg); if (number < 0) { send_to_char("Value must be greater than 0.\r\n", CH); send_to_char("Enter impact armor points: ", CH); } else { GET_IMPACT(MOB) = number; medit_disp_menu(d); } break; case MEDIT_PHYSICAL: number = atoi(arg); if ((number < 0) || (number > 10)) { send_to_char("Value must range between 0 and 10.\r\n", CH); send_to_char("Enter max physical points: ", CH); } else { GET_MAX_PHYSICAL(MOB) = number * 100; GET_PHYSICAL(MOB) = number * 100; medit_disp_menu(d); } break; case MEDIT_MENTAL: number = atoi(arg); if ((number < 0) || (number > 10)) { send_to_char("Value must range between 0 and 10.\r\n", CH); send_to_char("Enter max mental points: ", CH); } else { GET_MAX_MENTAL(MOB) = number * 100; GET_MENTAL(MOB) = number * 100; medit_disp_menu(d); } break; case MEDIT_WEIGHT: number = atoi(arg); if (number < 0) { send_to_char("Value must be greater than 0.\r\n", CH); send_to_char("Enter weight (in kilograms): ", CH); } else { GET_WEIGHT(MOB) = number; medit_disp_menu(d); } break; case MEDIT_HEIGHT: number = atoi(arg); if (number < 0) { send_to_char("Value must be greater than 0.\r\n", CH); send_to_char("Enter height (in centimeters): ", CH); } else { GET_HEIGHT(MOB) = number; medit_disp_menu(d); } break; case MEDIT_CLASS: number = atoi(arg); if ((number < 1) || (number > NUM_MOB_CLASSES)) medit_disp_class_menu(d); else { GET_RACE(MOB) = (number - 1); medit_disp_menu(d); } break; case MEDIT_POSITION: number = atoi(arg); if ((number < POS_MORTALLYW) || (number > POS_STANDING)) { send_to_char("Invalid choice.\r\nEnter position: ", CH); medit_disp_pos_menu(d); } else { GET_POS(MOB) = number; medit_disp_menu(d); } break; case MEDIT_DEFAULT_POSITION: number = atoi(arg); if ((number < POS_MORTALLYW) || (number > POS_STANDING)) { send_to_char("Invalid choice.\r\nEnter default position: ", CH); medit_disp_pos_menu(d); } else { GET_DEFAULT_POS(MOB) = number; medit_disp_menu(d); } break; case MEDIT_GENDER: number = atoi(arg); if ((number < 0) || (number > 3)) { send_to_char("Invalid choice.\r\n", CH); medit_disp_gender_menu(d); } else if (number != 0) // 0 = quit GET_SEX(MOB) = (number - 1); medit_disp_menu(d); break; case MEDIT_ATTACK_TYPE: number = atoi(arg); if ((number < 0) || (number > NUM_ATTACK_TYPES)) { send_to_char("Invalid choice.\r\n", CH); medit_disp_attack_menu(d); } else if (number != 0) // 0 = quit MOB->mob_specials.attack_type = number-1 + TYPE_HIT; medit_disp_menu(d); break; } }
void medit_disp_menu(struct descriptor_data *d) { int base = calc_karma(NULL, MOB); CLS(CH); send_to_char(CH, "Mob number: %s%d%s\r\n", CCCYN(CH, C_CMP), d->edit_number, CCNRM(CH, C_CMP)); send_to_char(CH, "1) Keywords: %s%s%s\r\n", CCCYN(CH, C_CMP), MOB->player.physical_text.keywords, CCNRM(CH, C_CMP)); send_to_char(CH, "2) Name: %s%s%s\r\n", CCCYN(CH, C_CMP), MOB->player.physical_text.name, CCNRM(CH, C_CMP)); send_to_char(CH, "3) Room description:\r\n%s%s%s\r\n", CCCYN(CH, C_CMP), MOB->player.physical_text.room_desc,CCNRM(CH, C_CMP)); send_to_char(CH, "4) Look description:\r\n%s\r\n", MOB->player.physical_text.look_desc); MOB_FLAGS(MOB).PrintBits(buf1, MAX_STRING_LENGTH, action_bits, MOB_MAX); send_to_char(CH, "5) Mob Flags: %s%s%s\r\n", CCCYN(CH, C_CMP), buf1, CCNRM(CH, C_CMP)); MOB->char_specials.saved.affected_by.PrintBits(buf1, MAX_STRING_LENGTH, affected_bits, AFF_MAX); send_to_char(CH, "6) Affected Flags: %s%s%s\r\n", CCCYN(CH, C_CMP), buf1, CCNRM(CH, C_CMP)); send_to_char(CH, "8) Avg. nuyen: %s%6d%s Avg. credstick value: %s%6d%s\r\n", CCCYN(CH, C_CMP), GET_NUYEN(MOB), CCNRM(CH, C_CMP), CCCYN(CH, C_CMP), GET_BANK(MOB), CCNRM(CH, C_CMP)); send_to_char(CH, "9) Bonus karma points: %s%d%s (Total karma points: %s%d%s)\r\n", CCCYN(CH, C_CMP), GET_KARMA(MOB), CCNRM(CH, C_CMP), CCCYN(CH, C_CMP), base, CCNRM(CH, C_CMP)); send_to_char(CH, "a) Attributes: B(%s%d%s), Q(%s%d%s), S(%s%d%s), C(%s%d%s), " "I(%s%d%s), W(%s%d%s), M(%s%d%s), R(%s%d%s)\r\n", CCCYN(CH, C_CMP), GET_REAL_BOD(MOB), CCNRM(CH, C_CMP), CCCYN(CH, C_CMP), GET_REAL_QUI(MOB), CCNRM(CH, C_CMP), CCCYN(CH, C_CMP), GET_REAL_STR(MOB), CCNRM(CH, C_CMP), CCCYN(CH, C_CMP), GET_REAL_CHA(MOB), CCNRM(CH, C_CMP), CCCYN(CH, C_CMP), GET_REAL_INT(MOB), CCNRM(CH, C_CMP), CCCYN(CH, C_CMP), GET_REAL_WIL(MOB), CCNRM(CH, C_CMP), CCCYN(CH, C_CMP), MOB->real_abils.mag / 100, CCNRM(CH, C_CMP), CCCYN(CH, C_CMP), GET_REAL_REA(MOB), CCNRM(CH, C_CMP)); send_to_char(CH, "b) Level: %s%d%s\r\n", CCCYN(CH, C_CMP), GET_LEVEL(MOB), CCNRM(CH, C_CMP)); send_to_char(CH, "c) Ballistic: %s%d%s, ", CCCYN(CH, C_CMP), GET_BALLISTIC(MOB), CCNRM(CH, C_CMP)); send_to_char(CH, "d) Impact: %s%d%s\r\n", CCCYN(CH, C_CMP), GET_IMPACT(MOB), CCNRM(CH, C_CMP)); send_to_char(CH, "e) Max physical points: %s%d%s, f) Max mental points: %s%d%s\r\n", CCCYN(CH, C_CMP), (int)(GET_MAX_PHYSICAL(MOB) / 100), CCNRM(CH, C_CMP), CCCYN(CH, C_CMP), (int)(GET_MAX_MENTAL(MOB) / 100), CCNRM(CH, C_CMP)); sprinttype(GET_POS(MOB), position_types, buf1); send_to_char(CH, "g) Position: %s%s%s, ", CCCYN(CH, C_CMP), buf1, CCNRM(CH, C_CMP)); sprinttype(GET_DEFAULT_POS(MOB), position_types, buf1); send_to_char(CH, "h) Default Position: %s%s%s\r\n", CCCYN(CH, C_CMP), buf1, CCNRM(CH, C_CMP)); sprinttype(GET_SEX(MOB), genders, buf1); // strcpy(buf1, genders[GET_SEX(d->edit_mob)]); send_to_char(CH, "i) Gender: %s%s%s, ", CCCYN(CH, C_CMP), buf1, CCNRM(CH, C_CMP)); send_to_char(CH, "j) Weight: %s%d%s, ", CCCYN(CH, C_CMP), GET_WEIGHT(MOB), CCNRM(CH, C_CMP)); send_to_char(CH, "k) Height: %s%d%s\r\n", CCCYN(CH, C_CMP), GET_HEIGHT(MOB), CCNRM(CH, C_CMP)); sprinttype(GET_RACE(MOB), npc_classes, buf1); send_to_char(CH, "l) Mob class: %s%s%s\r\n", CCCYN(CH, C_CMP), buf1, CCNRM(CH, C_CMP)); // gotta subtract TYPE_HIT to make it work properly sprinttype(!(MOB->mob_specials.attack_type) ? 0 : (MOB->mob_specials.attack_type - TYPE_HIT), attack_types, buf1); send_to_char(CH, "m) Attack Type: %s%s%s\r\n", CCCYN(CH, C_CMP), buf1, CCNRM(CH, C_CMP)); send_to_char("n) Skill menu.\r\n", CH); send_to_char(CH, "o) Arrive text: ^c%s^n, p) Leave text: ^c%s^n\r\n", MOB->mob_specials.arrive, MOB->mob_specials.leave); send_to_char("q) Quit and save\r\n", CH); send_to_char("x) Exit and abort\r\n", CH); send_to_char("Enter your choice:\r\n", CH); d->edit_mode = MEDIT_MAIN_MENU; }
int Fears( struct char_data *ch, struct char_data *v) { struct char_list *i; if( IS_AFFECTED( ch, AFF_PARALYSIS ) ) return( FALSE ); if( !IS_SET( ch->specials.act, ACT_AFRAID ) ) return( FALSE ); if( IS_SET( ch->fearfield, FEAR_CHAR ) ) { if( ch->fears.clist ) { for( i = ch->fears.clist; i; i = i->next ) { if( i ) { if( i->op_ch ) { if( i->name[0] != '\0' ) { if( i->op_ch == v && strcmp( i->name, GET_NAME( v ) ) == 0 ) return TRUE; } else { /* lets see if this clears the problem */ mudlog( LOG_ERROR, "NULL name in ch->fears.clist" ); RemFeared(ch, i->op_ch); } } else { if (i->name[0] != '\0') { if (!strcmp(i->name, GET_NAME(v))) return(TRUE); } } } } } } if (IS_SET(ch->fearfield, FEAR_RACE)) { if (ch->fears.race != -1) { if (ch->fears.race == GET_RACE(v)) return(TRUE); } } if (IS_SET(ch->fearfield, FEAR_SEX)) { if (ch->fears.sex == GET_SEX(v)) return(TRUE); } if (IS_SET(ch->fearfield, FEAR_GOOD)) { if (ch->fears.good < GET_ALIGNMENT(v)) return(TRUE); } if (IS_SET(ch->fearfield, FEAR_EVIL)) { if (ch->fears.evil > GET_ALIGNMENT(v)) return(TRUE); } if (IS_SET(ch->fearfield, FEAR_CLASS)) { if (HasClass(v, ch->hates.iClass)) { return(TRUE); } } if (IS_SET(ch->fearfield, FEAR_VNUM)) { if (ch->fears.vnum == mob_index[v->nr].iVNum) return(TRUE); } return(FALSE); }