(Message circle:91) Received: from QUCDN.QueensU.CA by spinach.mscc.huji.ac.il (AIX 3.2/UCB 5.64/4.03) id AA135589; Wed, 11 Sep 1996 23:54:18 +0300 Received: from cspo.queensu.ca by QUCDN.QueensU.CA (IBM VM SMTP V2R2) with TCP; Wed, 11 Sep 96 17:01:54 EDT Received: by cspo.queensu.ca (SMI-8.6/SMI-SVR4) id QAA19402; Wed, 11 Sep 1996 16:48:32 -0500 Received: from mystech.com by cspo.queensu.ca (SMI-8.6/SMI-SVR4) Received: (from mail@localhost) by mystech.com (8.7.4/8.7.3) id QAA11748 for <circle@cspo.queensu.ca>; Wed, 11 Sep 1996 16:50:20 -0400 Received: from unknown(42.3.0.4) by bastion.mystech.com via smap (V1.3) Received: from warlab2 ([42.1.20.185]) by fc (4.1/SMI-4.1) Message-Id: <323725E9.953C1F7@mystech.com> Date: Wed, 11 Sep 1996 16:49:45 -0400 From: "Derek L. Karnes" <dkarnes@mystech.com> Organization: Mystech Associates, Inc. X-Mailer: Mozilla 2.01 (X11; I; Linux 1.2.13 i586) Mime-Version: 1.0 To: circle@cspo.queensu.ca Subject: Re: [Code] do_advance References: <Pine.BSI.3.95.960910075606.1506B-100000@global.california.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-circle@cspo.queensu.ca Precedence: bulk A friend of mine wrote: -- I just noticed this problem today; possibly you already encountered it. When advancing someone to a level lower than his current level, he gets put to that level except his stats like H,V, and M are his stats at level 1. He'll be level 19 (for example) with these level 1 values. This is because do_advance() makes a call to do_start() for when someone is advanced a level that is lower than their current level. It then assigns the newlevel to the victim's current level. Also, do_start() rerolls the guy's ability scores. -- Here's my 5 minute hack to fix it: -- ACMD(do_advance) { struct char_data *victim; char *name = arg, *level = buf2; int newlevel, oldlevel; int str, intel, wis, dex, con, cha, add; void do_start(struct char_data *ch); void gain_exp(struct char_data * ch, int gain); two_arguments(argument, name, level); if (*name) { if (!(victim = get_char_vis(ch, name))) { send_to_char("That player is not here.\r\n", ch); return; } } else { send_to_char("Advance who?\r\n", ch); return; } if (GET_LEVEL(ch) <= GET_LEVEL(victim)) { send_to_char("Maybe that's not such a great idea.\r\n", ch); return; } if (IS_NPC(victim)) { send_to_char("NO! Not on NPC's.\r\n", ch); return; } if (!*level || (newlevel = atoi(level)) <= 0) { send_to_char("That's not a level!\r\n", ch); return; } if (newlevel > LVL_IMPL) { sprintf(buf, "%d is the highest possible level.\r\n", LVL_IMPL); send_to_char(buf, ch); return; } if (newlevel > GET_LEVEL(ch)) { send_to_char("Yeah, right.\r\n", ch); return; } if (newlevel == GET_LEVEL(victim)) { send_to_char("They are already at that level.\r\n", ch); return; } oldlevel = GET_LEVEL(victim); if (newlevel < GET_LEVEL(victim)) { /* store the char's stats, advance him from 1 to new level then reset his old stats. */ str = victim->real_abils.str; add = victim->real_abils.str_add; dex = victim->real_abils.dex; intel = victim->real_abils.intel ; con = victim->real_abils.con; cha = victim->real_abils.cha; wis = victim->real_abils.wis; send_to_char("You are momentarily enveloped by darkness!\r\n" "You lose all your levels, but then\r\n", victim); do_start(victim); sprintf(buf," %s %d", GET_NAME(victim), newlevel); do_advance(ch, buf, 0, 0); victim->real_abils.str_add = add; victim->real_abils.intel = intel; victim->real_abils.wis = wis; victim->real_abils.dex = dex; victim->real_abils.str = str; victim->real_abils.con = con; victim->real_abils.cha = cha; } else { act("$n makes some strange gestures.\r\n" "A strange feeling comes upon you,\r\n" "Like a giant hand, light comes down\r\n" "from above, grabbing your body, that\r\n" "begins to pulse with colored lights\r\n" "from inside.\r\n\r\n" "Your head seems to be filled with demons\r\n" "from another plane as your body dissolves\r\n" "to the elements of time and space itself.\r\n" "Suddenly a silent explosion of light\r\n" "snaps you back to reality.\r\n\r\n" "You feel slightly different.", FALSE, ch, 0, victim, TO_VICT); } send_to_char(OK, ch); sprintf(buf, "(GC) %s has advanced %s to level %d (from %d)", GET_NAME(ch), GET_NAME(victim), newlevel, oldlevel); log(buf); gain_exp_regardless(victim, (titles[(int) GET_CLASS(victim)][newlevel].exp) - GET_EXP(victim)); save_char(victim, NOWHERE); } -- \ | / \ /---------------------\ / -- dkarnes@mystech.com -- / \---------------------/ \ / | \ +-----------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://cspo.queensu.ca/~fletcher/Circle/list_faq.html | +-----------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/18/00 PST