/* This function controls the change to maxmove, maxmana, and maxhp for each * class every time they gain a level. */ void advance_level(struct char_data *ch) { int add_hp, add_mana = 0, add_move = 0, i; add_hp = con_app[GET_CON(ch)].hitp; switch (GET_CLASS(ch)) { case CLASS_ADEPT: add_hp += rand_number(3, 8); add_mana = rand_number(GET_LEVEL(ch), (int)(1.5 * GET_LEVEL(ch))); add_mana = MIN(add_mana, 10); add_move = rand_number(0, 2); break; case CLASS_MEDIC: add_hp += rand_number(5, 10); add_mana = rand_number(GET_LEVEL(ch), (int)(1.5 * GET_LEVEL(ch))); add_mana = MIN(add_mana, 10); add_move = rand_number(0, 2); break; case CLASS_BANDIT: add_hp += rand_number(7, 13); add_mana = 0; add_move = rand_number(1, 3); break; case CLASS_SOLDIER: add_hp += rand_number(10, 15); add_mana = 0; add_move = rand_number(1, 3); break; } ch->points.max_hit += MAX(1, add_hp); ch->points.max_move += MAX(1, add_move); if (GET_LEVEL(ch) > 1) ch->points.max_mana += add_mana; if (IS_ADEPT(ch) || IS_MEDIC(ch)) GET_PRACTICES(ch) += MAX(2, wis_app[GET_WIS(ch)].bonus); else GET_PRACTICES(ch) += MIN(2, MAX(1, wis_app[GET_WIS(ch)].bonus)); if (GET_LEVEL(ch) >= LVL_IMMORT) { for (i = 0; i < 3; i++) GET_COND(ch, i) = (char) -1; SET_BIT_AR(PRF_FLAGS(ch), PRF_HOLYLIGHT); } snoop_check(ch); save_char(ch); }
/* invalid_class is used by handler.c to determine if a piece of equipment is * usable by a particular class, based on the ITEM_ANTI_{class} bitvectors. */ int invalid_class(struct char_data *ch, struct obj_data *obj) { if (OBJ_FLAGGED(obj, ITEM_ANTI_ADEPT) && IS_ADEPT(ch)) return TRUE; if (OBJ_FLAGGED(obj, ITEM_ANTI_MEDIC) && IS_MEDIC(ch)) return TRUE; if (OBJ_FLAGGED(obj, ITEM_ANTI_SOLDIER) && IS_SOLDIER(ch)) return TRUE; if (OBJ_FLAGGED(obj, ITEM_ANTI_BANDIT) && IS_BANDIT(ch)) return TRUE; return FALSE; }
const char *char_data::get_whoname( ) { char buf[MSL] = {'\0'}; short s1, s2, s3, s4, s5; const char *output; if ( IS_NPC(this) ) return ""; if ( IS_IMMORTAL(this) ) { if ( strcmp(pcdata->who_name,"off") ) return pcdata->who_name; switch ( get_level() ) { case MAX_LEVEL - 0: return "@@l~* CREATOR *~@@N "; case MAX_LEVEL - 1: return "@@B-* SUPREME *-@@N "; case MAX_LEVEL - 2: return "@@a-=MAJOR GOD=-@@N "; case MAX_LEVEL - 3: return "@@a--MINOR GOD--@@N "; case MAX_LEVEL - 4: return "@@c - IMMORTAL -@@N "; } } if ( IS_ADEPT(this) ) { if ( strcmp(pcdata->who_name,"off") ) return pcdata->who_name; switch ( get_level("adept") ) { case 1: return "@@W Mystic @@N"; case 2: return "@@a Templar @@N"; case 3: return "@@l Illusionist @@N"; case 4: return "@@e Crusader @@N"; case 5: return "@@d Warlock @@N"; case 6: return "@@a Paladin @@N"; case 7: return "@@r Ranger @@N"; case 8: return "@@c Gladiator @@N"; case 9: return "@@l Shogun @@N"; case 10: return "@@e Shamen @@N"; case 11: return "@@r Druid @@N"; case 12: return "@@b Conjurer @@N"; case 13: return "@@l Elementalist @@N"; case 14: return "@@m Runemaster @@N"; case 15: return "@@d Shadowmaster @@N"; case 16: return "@@b Beastmaster @@N"; case 17: return "@@R Warlord @@N"; case 18: return "@@e Dragonlord @@N"; case 19: return "@@d Demonlord @@N"; case 20: return "@@m Realm Lord @@N"; } } if ( IS_REMORT(this) ) { s1 = get_level("sor"); s2 = get_level("mon"); s3 = get_level("ass"); s4 = get_level("kni"); s5 = get_level("nec"); snprintf( buf, MSL, "@@m%2d %2d %2d %2d %2d@@N", s1 <= 0 ? 0 : s1, s2 <= 0 ? 0 : s2, s3 <= 0 ? 0 : s3, s4 <= 0 ? 0 : s4, s5 <= 0 ? 0 : s5 ); output = str_dup( buf ); return output; } else { s1 = get_level("mag"); s2 = get_level("cle"); s3 = get_level("thi"); s4 = get_level("war"); s5 = get_level("psi"); snprintf( buf, MSL, "@@b%2d %2d %2d %2d %2d@@N", s1 <= 0 ? 0 : s1, s2 <= 0 ? 0 : s2, s3 <= 0 ? 0 : s3, s4 <= 0 ? 0 : s4, s5 <= 0 ? 0 : s5 ); output = str_dup( buf ); return output; } return ""; }