//This is the include script (save it under the name below)
//NOTE: Be sure to build your module (scripts only) after saving these scripts!
// gen_levelbyxp
int GetLevelByXP(object oPC)
{
int nXP = GetXP(oPC);
int i = 1;;
if(nXP >= 780000) { i = 40; }
else if(nXP >= 741000) { i = 39; }
else if(nXP >= 703000) { i = 38; }
else if(nXP >= 666000) { i = 37; }
else if(nXP >= 630000) { i = 36; }
else if(nXP >= 595000) { i = 35; }
else if(nXP >= 561000) { i = 34; }
else if(nXP >= 528000) { i = 33; }
else if(nXP >= 496000) { i = 32; }
else if(nXP >= 465000) { i = 31; }
else if(nXP >= 435000) { i = 30; }
else if(nXP >= 406000) { i = 29; }
else if(nXP >= 378000) { i = 28; }
else if(nXP >= 351000) { i = 27; }
else if(nXP >= 325000) { i = 26; }
else if(nXP >= 300000) { i = 25; }
else if(nXP >= 276000) { i = 24; }
else if(nXP >= 263000) { i = 23; }
else if(nXP >= 231000) { i = 22; }
else if(nXP >= 210000) { i = 21; }
else if(nXP >= 190000) { i = 20; }
else if(nXP >= 171000) { i = 19; }
else if(nXP >= 153000) { i = 18; }
else if(nXP >= 136000) { i = 17; }
else if(nXP >= 120000) { i = 16; }
else if(nXP >= 105000) { i = 15; }
else if(nXP >= 91000) { i = 14; }
else if(nXP >= 78000) { i = 13; }
else if(nXP >= 66000) { i = 12; }
else if(nXP >= 55000) { i = 11; }
else if(nXP >= 45000) { i = 10; }
else if(nXP >= 36000) { i = 9; }
else if(nXP >= 28000) { i = 8; }
else if(nXP >= 21000) { i = 7; }
else if(nXP >= 15000) { i = 6; }
else if(nXP >= 10000) { i = 5; }
else if(nXP >= 6000) { i = 4; }
else if(nXP >= 3000) { i = 3; }
else if(nXP >= 1000) { i = 2; }
else { i = 1; }
return i;
}
-----------------------
#include "gen_levelbyxp"
void main()
{
object oPC = GetEnteringObject();
int nLvl = GetLevelByXP(oPC);
SetLocalInt(oPC, "ENTERING_LVL", nLvl); //Not Persistent....
}
---------------------------------
//Starting Conditional....
#include "gen_levelbyxp"
int StartingConditional()
{
int iReturn = FALSE;
int iPass = TRUE;
int iLevel = GetLocalInt(oPC, "ENTERING_LVL");
int nAdj += 1; //Add + 1 to the level they had OnModEnter...
//If the PC's level is greater than or equal to 1 Level higher than the level they had on enter...
//(meaning they gained enough XP for a level...)
if (GetLevelByXP>= nAdj)
iPass = FALSE;
if(GetLocalInt(GetPCSpeaker(), "DariusTalk") < 1)
iReturn = TRUE;
if(iReturn && iPass)
return TRUE;
else
return FALSE;
}
Try those and let me know how it works... :happy:
Modifié par _Guile, 18 avril 2012 - 03:56 .