On Sun, 22 Aug 1999 19:27:23 -0700 "Daniel A. Koepke" <dkoepke@CALIFORNIA.COM> writes: > Today, Phillip A Ames spake to the list: > > > Since all the levels for each of the classes need the same EXP to > > level, I made level_exp's declaration void level_exp(int level) > and > > this is how I'm calling it from do_advance... > > Err, level_exp shouldn't be a 'void' since it's returning an > integer. At > least, that's how you're using it. > > > while(level_exp((GET_CLASS_LEV(ch, classnum) + 1) - GET_EXP(ch)) > < 0) > > Why are you subtrating their experience points from their class level?! > That's your problem. > > -dak OK, I changed level_exp to int level_exp(int level), and rewrote advance_xp void advance_xp(struct char_data * ch, int gain, int classnum, int newlevel) { int nextlev = (GET_CLASS_LEV(ch, classnum) + 1); sprintf(buf, "advance_xp called, %d gain, %d classnum", gain, classnum); log(buf); log("%d nextlev", nextlev); log("%d before gain", GET_EXP(ch)); GET_EXP(ch) += gain; log("XP after gain - %d", GET_EXP(ch)); if (GET_EXP(ch) < 0) GET_EXP(ch) = 0; while(((level_exp(nextlev) - GET_EXP(ch)) < 0) && ((GET_CLASS_LEV(ch, classnum) + 1) < newlevel)){ log("level_exp(nextlev) - GET_EXP(ch)) = %d", (level_exp(nextlev) - GET_EXP(ch))); advance_level(ch, classnum); nextlev++; nextlev = (GET_CLASS_LEV(ch, classnum) + 1); log("new nextlevel - %d", nextlev); } } And this is how its being called from do_advance... advance_xp(victim, (level_exp(newlevel) - GET_EXP(victim)), GET_ADVANCE_CLASS(victim), newlevel); And this is what comes up in my logs... Aug 23 09:20:55 :: [**LEVEL**] Grathol advanced to level 0 in Helm Aug 23 09:20:55 :: [**NEW PLAYER**] Grathol [127.0.0.1] . Aug 23 09:20:56 :: Grathol entering game with no equipment. Aug 23 09:21:38 :: [**SET**] Grathol's advance set to 1(Helm) by Gowron Aug 23 09:22:01 :: (GC) Gowron has advanced Grathol to level 5 (from 1) Aug 23 09:22:01 :: advance_xp called, 49999 gain, 1 classnum Aug 23 09:22:01 :: 2 nextlev Aug 23 09:22:01 :: 1 before gain Aug 23 09:22:01 :: XP after gain - 50000 Aug 23 09:22:01 :: level_exp(nextlev) - GET_EXP(ch)) = -20000 Aug 23 09:22:01 :: [**LEVEL**] Grathol advanced to level 2 in Helm Aug 23 09:22:01 :: new nextlevel - 3 Aug 23 09:22:01 :: level_exp(nextlev) - GET_EXP(ch)) = -10000 Aug 23 09:22:01 :: [**LEVEL**] Grathol advanced to level 3 in Helm Aug 23 09:22:01 :: new nextlevel - 4 And these are the XP requirements for the first 10 levels /* Exp required for normal mortals is below */ switch (level) { case 0: return 10000; case 1: return 20000; case 2: return 30000; case 3: return 40000; case 4: return 50000; case 5: return 50000; case 6: return 50000; case 7: return 50000; case 8: return 50000; case 9: return 75000; case 10: return 75000; ... Any ideas? I'm stumped. Phillip Ames | Implementor of Apocalypse MUD kirk47@juno.com | telnet://startrek.circlemud.net:1701 ICQ: 8778335 | AOL IM: Grathol http://members.xoom.com/Gowron/index.html ___________________________________________________________________ Get the Internet just the way you want it. Free software, free e-mail, and free Internet access for a month! Try Juno Web: http://dl.www.juno.com/dynoget/tagj. +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST