//////////////////////////////// //// XP System for ZC ////////// //// v.23 ////////// /////////////////////////////////////////////////////////////////////////// /// Creator: ZoriaRPG ///////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// /// ASSISTANCE BY: ////// CONTRIBUTORS: ////// TESTING: ////// /// anikom15 ////// MoscowModder ////// ////// /// Avataro ////// ////// ////// /// MoscowModder ////// ////// ////// /////////////////////////////////////////////////////////////////////////// //import std.zh //import stdExtra.zh //Not a dependency at this time. //immport sdtZoria.zh //Not a dependency at this time. 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; 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; global script active{ void run(){ int Level = 0; int LevelNext = 0; Game->MCounter[CR_LEVEL] = 20; Game->MCounter[CR_XP] = 250000; while true{ XP(); Waitframe(); } } } void XP() { while ( LevelNext = 0 && Screen->NumNPCs() = 0 ) { //Run if there are no enemeies on the screen if ( Game->Counter[CR_XP] > 0 && Game->Counter[CR_XP] < 100 ){ Game->Counter[CR_LVL] = 0; } } while ( LevelNext = 1 && Screen->NumNPCs() = 0 ) { if ( Game->Counter[CR_XP] >= 100 && Game->Counter[CR_XP] < 150 ){ Game->Counter[CR_LVL] = 1; //Game->Counter[CR_LVL]++; Level1(); } } while ( LevelNext = 2 && Screen->NumNPCs() = 0 ) { if ( Game->Counter[CR_XP] >= 150 && Game->Counter[CR_XP] < 225 ){ Game->Counter[CR_LVL] = 2; Level2(); } } while ( LevelNext = 3 && Screen->NumNPCs() = 0 ) { if ( Game->Counter[CR_XP] >= 225 && Game->Counter[CR_XP] < 338 ){ Game->Counter[CR_LVL] = 3; Level3(); } } while ( LevelNext = 4 && Screen->NumNPCs() = 0 ) { if ( Game->Counter[CR_XP] >= 338 && Game->Counter[CR_XP] < 507 ){ Game->Counter[CR_LVL] = 4; Level4(); } } while ( LevelNext = 5 && Screen->NumNPCs() = 0 ) { if ( Game->Counter[CR_XP] >= 507 && Game->Counter[CR_XP] < 760 ){ Game->Counter[CR_LVL] = 5; Level5(); } } while ( LevelNext = 6 && Screen->NumNPCs() = 0 ) { if ( XGame->Counter[CR_XP] >= 760 && Game->Counter[CR_XP] < 1140 ){ Game->Counter[CR_LVL] = 6; Level6(); } } while ( LevelNext = 7 && Screen->NumNPCs() = 0 ) { if ( Game->Counter[CR_XP] >= 1140 && Game->Counter[CR_XP] < 1710 ){ Game->Counter[CR_LVL] = 7; Level7(); } } while ( LevelNext = 8 && Screen->NumNPCs() = 0 ) { if ( Game->Counter[CR_XP] >= 1710 && Game->Counter[CR_XP] < 2565 ){ Game->Counter[CR_LVL] = 8; Level8(); } } while ( LevelNext = 9 && Screen->NumNPCs() = 0 ) { if ( Game->Counter[CR_XP] >= 2565 && Game->Counter[CR_XP] < 3848 ){ Game->Counter[CR_LVL] = 9; Level9(); } } while ( LevelNext = 10 && Screen->NumNPCs() = 0 ) { if ( Game->Counter[CR_XP] >= 3848 && Game->Counter[CR_XP] < 5772 ){ Game->Counter[CR_LVL] = 10; Level10(); } } while ( LevelNext = 11 && Screen->NumNPCs() = 0 ) { if ( Game->Counter[CR_XP] >= 5772 && Game->Counter[CR_XP] < 8658 ){ Game->Counter[CR_LVL] = 11; Level11(); } } while ( LevelNext = 12 && Screen->NumNPCs() = 0 ) { if ( Game->Counter[CR_XP] >= 8658 && Game->Counter[CR_XP] < 12987 ){ Game->Counter[CR_LVL] = 12; Level12(); } } while ( LevelNext = 13 && Screen->NumNPCs() = 0 ) { if ( Game->Counter[CR_XP] >= 12987 && Game->Counter[CR_XP] < 19481 ){ Game->Counter[CR_LVL] = 13; Level13(); } } while ( LevelNext = 14 && Screen->NumNPCs() = 0 ) { if ( Game->Counter[CR_XP] >= 19481 && Game->Counter[CR_XP] < 29222 ){ Game->Counter[CR_LVL] = 14; Level14(); } } while ( LevelNext = 15 && Screen->NumNPCs() = 0 ) { if ( Game->Counter[CR_XP] >= 29222 && Game->Counter[CR_XP] < 43833 ){ Game->Counter[CR_LVL] = 15; Level15(); } } while ( LevelNext = 16 && Screen->NumNPCs() = 0 ) { if ( Game->Counter[CR_XP] >= 43833 && Game->Counter[CR_XP] < 65750 ){ Game->Counter[CR_LVL] = 16; Level16(); } } while ( LevelNext = 17 && Screen->NumNPCs() = 0 ) { if ( Game->Counter[CR_XP] >= 65750 && Game->Counter[CR_XP] < 98625 ){ Game->Counter[CR_LVL] = 17; Level17(); } } while ( LevelNext = 18 && Screen->NumNPCs() = 0 ) { if ( Game->Counter[CR_XP] >= 98625 && Game->Counter[CR_XP] < 147938 ){ Game->Counter[CR_LVL] = 18; Level18(); } } while ( LevelNext = 19 && Screen->NumNPCs() = 0 ) { if ( Game->Counter[CR_XP] >= 147938 && Game->Counter[CR_XP] < 221907 ){ Game->Counter[CR_LVL] = 19; Level19(); } } while ( LevelNext = 20 && Screen->NumNPCs() = 0 ) { 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() { 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? } ///int rollStat() { /// int r = Rand(1, 6); //specific value of 1-6 set at random; /// if ( r == 1 ) { /// int stat = Game->Counter[CR_STAT_BODY]; /// } /// if ( r == 2 ) { /// int stat = Game->Counter[CR_STAT_MIND]; /// } /// if ( r == 3 ) { /// int stat = Game->Counter[CR_STAT_LUCK]; /// } /// if ( r == 4 ) { /// int stat = Game->Counter[CR_STAT_MYST]; /// } /// if ( r == 5 ) { /// int stat = Game->Counter[CR_STAT_INFL; /// } /// if ( r == 6 ) { /// int stat = Game->Counter[CR_STAT_MUSC]; /// } /// return stat; ///} int rollStat() { int r = Rand(1, 6); //specific value of 1-6 set at random; if ( r == 1 ) { int stat = CR_STAT_BODY; } if ( r == 2 ) { int stat = CR_STAT_MIND; } if ( r == 3 ) { int stat = CR_STAT_LUCK; } if ( r == 4 ) { int stat = CR_STAT_MYST; } if ( r == 5 ) { int stat = CR_STAT_INFL; } if ( r == 6 ) { int stat = CR_STAT_MUSC; } return stat; } void increaseStat() { int stat = rollStat(); int n = rollDie(6); Game->Counter[stat] =+ n; } int rollDie(int type){ int n = Rand(1, type); return n; } int roll1d4() int n = Rand(1, 4); return n; } int roll1d6() int n = Rand(1, 6); return n; } int roll4d6(){ int a = Rand(1, 6); int b = Rand(1, 6); int c = Rand(1, 6); int d = Rand(1, 6); int t = ( a + b + c + d ) return t; } int roll1d8() int n = Rand(1, 8); return n; } int roll1d10() int n = Rand(1, 10); return n; } int roll1d12() int n = Rand(1, 12); return n; } int roll1d20() int n = Rand(1, 20); return n; } int roll1d50() int n = Rand(1, 50); return n; } int roll1d100() int n = Rand(1, 100); return n; } } void getBodyStat(){ } void getMindStat(){ } void getLuckStat(){ } void getMystStat(){ } void getInflStat(){ } void getMuscStat(){ } int getBodyStat(){ int stat = CR_STAT_BODY; return stat; } int getMindStat(){ int stat = CR_STAT_MIND; return stat; } int getLuckStat(){ int stat = CR_STAT_LUCK; return stat; } int getMystStat(){ int stat = CR_STAT_MYST; return stat; } int getInflStat(){ int stat = CR_STAT_INFL; return stat; } int getMuscStat(){ int stat = CR_STAT_MUSC; return stat; } // Using Stats // heavy weapon script particles // discover present slot of item // set int of slot of item for bools // when trying to use the item // if CT_MUSC < x // set other slot to 'hand' until item is changed. // // Use Body to affect HP: // Use Body to set HP at level increases. Use to set HP regen rate. // Use MUSC to set-augment weapon damage, via roll1dX rands. // Use MUSC for ability to move objects. // bracelets increase Musc, as well as activating triggers. // Bracelet / gauntlet takes up a slot. Any combination of two rings, or one ring and one bracelet at one time. // Use Luck to set jinx durations. // Use Myst to set spell damage. // Require Myst of certain value to use some spells. // Ue Mind for Lore skills. // Use Mind for raw (untrained) examination checks. // Create LWeapon that deals damage based on dX rolls. // Is there any way to use MUSC and random damage on swords? // Possibly replace rhe power of the LW_SWORD generated with a sword with a different value? // INF should set the strings used on FFC scripts when conversing. // A higher INF would open up more lines of dialogue.