const int CR_XP = 12; const int CR_LVL = 13; const int CR_STAT_BODY = 31; const int CR_STAT_MIND = 30; const int CR_STAT_LUCK = 29; const int CR_STAT_MYST = 28; const int CR_STAT_INFL = 27; const int CR_STAT_MUSC = 26; int Level = 0; int LevelNext = 0; const int L1String = 101; const int L1String = 102; const int L1String = 103; const int L1String = 104; const int L1String = 105; const int L1String = 106; const int L1String = 107; const int L1String = 108; const int L1String = 109; const int L1String = 110; const int L1String = 111; const int L1String = 112; const int L1String = 113; const int L1String = 114; const int L1String = 115; const int L1String = 116; const int L1String = 117; const int L1String = 118; const int L1String = 119; const int L1String = 120; while true{ XP(); Waitframe(); } void XP() { //if there are no eenemeies on the screen{ while ( LevelNext = 0 ) { if ( Game->Counter[CR_XP] > 0 && Game->Counter[CR_XP] < 100 ){ Game->Counter[CR_LVL] = 0; } } while ( LevelNext = 1 ) { if ( Game->Counter[CR_XP] >= 100 && Game->Counter[CR_XP] < 150 ){ Game->Counter[CR_LVL] = 1; //Game->Counter[CR_LVL]++; Level1(); } } while ( LevelNext = 2 ) { if ( Game->Counter[CR_XP] >= 150 && Game->Counter[CR_XP] < 225 ){ Game->Counter[CR_LVL] = 2; Level2(); } } while ( LevelNext = 3 ) { if ( Game->Counter[CR_XP] >= 225 && Game->Counter[CR_XP] < 338 ){ Game->Counter[CR_LVL] = 3; Level3(); } } while ( LevelNext = 4 ) { if ( Game->Counter[CR_XP] >= 338 && Game->Counter[CR_XP] < 507 ){ Game->Counter[CR_LVL] = 4; Level4(); } } while ( LevelNext = 5 ) { if ( Game->Counter[CR_XP] >= 507 && Game->Counter[CR_XP] < 760 ){ Game->Counter[CR_LVL] = 5; Level5(); } } while ( LevelNext = 6 ) { if ( XGame->Counter[CR_XP] >= 760 && Game->Counter[CR_XP] < 1140 ){ Game->Counter[CR_LVL] = 6; Level6(); } } while ( LevelNext = 7 ) { if ( Game->Counter[CR_XP] >= 1140 && Game->Counter[CR_XP] < 1710 ){ Game->Counter[CR_LVL] = 7; Level7(); } } while ( LevelNext = 8 ) { if ( Game->Counter[CR_XP] >= 1710 && Game->Counter[CR_XP] < 2565 ){ Game->Counter[CR_LVL] = 8; Level8(); } } while ( LevelNext = 9 ) { if ( Game->Counter[CR_XP] >= 2565 && Game->Counter[CR_XP] < 3848 ){ Game->Counter[CR_LVL] = 9; Level9(); } } while ( LevelNext = 10 ) { if ( Game->Counter[CR_XP] >= 3848 && Game->Counter[CR_XP] < 5772 ){ Game->Counter[CR_LVL] = 10; Level10(); } } while ( LevelNext = 11 ) { if ( Game->Counter[CR_XP] >= 5772 && Game->Counter[CR_XP] < 8658 ){ Game->Counter[CR_LVL] = 11; Level11(); } } while ( LevelNext = 12 ) { if ( Game->Counter[CR_XP] >= 8658 && Game->Counter[CR_XP] < 12987 ){ Game->Counter[CR_LVL] = 12; Level12(); } } while ( LevelNext = 13 ) { if ( Game->Counter[CR_XP] >= 12987 && Game->Counter[CR_XP] < 19481 ){ Game->Counter[CR_LVL] = 13; Level13(); } } while ( LevelNext = 14 ) { if ( Game->Counter[CR_XP] >= 19481 && Game->Counter[CR_XP] < 29222 ){ Game->Counter[CR_LVL] = 14; Level14(); } } while ( LevelNext = 15 ) { if ( Game->Counter[CR_XP] >= 29222 && Game->Counter[CR_XP] < 43833 ){ Game->Counter[CR_LVL] = 15; Level15(); } } while ( LevelNext = 16 ) { if ( Game->Counter[CR_XP] >= 43833 && Game->Counter[CR_XP] < 65750 ){ Game->Counter[CR_LVL] = 16; Level16(); } } while ( LevelNext = 17 ) { if ( Game->Counter[CR_XP] >= 65750 && Game->Counter[CR_XP] < 98625 ){ Game->Counter[CR_LVL] = 17; Level17(); } } while ( LevelNext = 18 ) { if ( Game->Counter[CR_XP] >= 98625 && Game->Counter[CR_XP] < 147938 ){ Game->Counter[CR_LVL] = 18; Level18(); } } while ( LevelNext = 19 ) { if ( Game->Counter[CR_XP] >= 147938 && Game->Counter[CR_XP] < 221907 ){ Game->Counter[CR_LVL] = 19; Level19(); } } while ( LevelNext = 20 ) { if ( Game->Counter[CR_XP] >= 221907 ){ Game->Counter[CR_LVL] = 20; Level20(); } } } //////////////////////// /// XP TABLE /////////// //////////////////////// /// 0 = 0 //////// /// 100 = 1 //////// /// 150 = 2 //////// /// 225 = 3 //////// /// 338 = 4 //////// /// 507 = 5 //////// /// 760 = 6 //////// /// 1140 = 7 //////// /// 1710 = 8 //////// /// 2565 = 9 //////// /// 3848 = 10 //////// /// 5772 = 11 //////// /// 8658 = 12 //////// /// 12987 = 13 //////// /// 19481 = 14 //////// /// 29222 = 15 //////// /// 43833 = 16 //////// /// 65750 = 17 //////// /// 98625 = 18 //////// /// 147938 = 19 //////// /// 221907 = 20 //////// ////////////////////////////////////////// //// XP Algorithm //// //// C = Current Base //// //// H = Half Current Base //// //// N = Amount Needed for Next Level //// //// C + H = N //// //// Thus C (100) + H (50) = N (150) //// ////////////////////////////////////////// void Level1(int hpx, int mpx) { Screen->Message[L1String]; //This should show on-screen one time, when gaining the level, and not remain forever. Link->MP += 32; //Increases MP - This should happen one time, when gaining this level, and be permanent. Link->MaxMP += 32; //Increases Max MP - This should happen one time, and be permanent. Link->MP += 16; //Increases HP - This should happen one time, when gaining this level, and be permanent. Link->MaxMP += 16; //Increases Max HP - This should happen one time, when gaining this level, and be permanent. //Use Rands for MP/HP increases witht he hpx and mpx variables. increaseStat(); //This should happen one time, when gaining this level, and be permanent. Game->Generic[GEN_CANSLASH] = 1; //This should occur when gaining this level, and be permanent. int LevelNext = 2; //Sets flag to maintain permanency, and to restrict infinite increases. /// Concerns: Will the screen message stay up forever? /// Will HP/MP increases infinitely cascade? /// Will items given, or set to true, remain on gaining next level? } void rollStat(int r, int stat, int n) { r = Rand(6); //specific value of 1-6 set at random; if ( r == 1 ) { stat = Game->Counter[CR_STAT_BODY]; } if ( r == 2 ) { stat = Game->Counter[CR_STAT_MIND]; } if ( r == 3 ) { stat = Game->Counter[CR_STAT_LUCK]; } if ( r == 4 ) { stat = Game->Counter[CR_STAT_MYST]; } if ( r == 5 ) { stat = Game->Counter[CR_STAT_INFL; } if ( r == 6 ) { stat = Game->Counter[CR_STAT_MUSC]; } v = roll1d6(n); } void increaseStat(int stat, int v){ rollstat(); Game->Counter[stat] =+ v; } void roll1d4(int n) n = Rand(1, 4); } void roll1d6(int n) { n = Rand(1, 6); } void roll1d8(int n) { n = Rand(1, 8); } void roll1d10(int n) { n = Rand(1, 10); } void roll1d12(int n) { n = Rand(1, 12); } void roll1d20(int n) { n = Rand(1, 20); } void roll1d50(int n) { n = Rand(1, 50); } void roll1d100(int n) { n = Rand(1, 100); } }