// gen_xp_inc
///////////////////////////////////////////////////////////////////////////////
// Created By Genisys / Guile 5/5/08
// Updated & Fixed on 10/18/2011 (Found some gross errors! - Sorry Everyone)
///////////////////////////////////////////////////////////////////////////////
//IMPORTANT////////////////////////////////////////////////////////////////////
/*
This is an include not an actual script (It has prototype functions in it!)
Function which you can use in any script!! Just.....
Be sure you place #include "setxp_inc" at the top of
any script you wish to utilize any function within this script.
///////////////////////////////////////////////////////////////////////////////
There are function below in green which are example of how you would
utilize each function.
I used oTarget instead of oPC, but you can use Take1Level(oPC); if you wish,
as you must define what oTarget is in your script, though oTarget can be
anything like oSpeaker, oPC, oNPC, oWhatever. =)
NOTE: I have tested releveling Palemaster & Red Dragon Disciples with this
script and they did not retain thier AC or Ability Bonuses from the class.
you should double check this yourself to verify it.
*/
//////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// ** WARNING ** DO NOT TOUCH ANYTHING BELOW THIS LINE!!! ////////////////////
/////////////////////////////////////////////////////////////////////////////
//Required include for Legendary Levels & Functions (DO NOT TOUCH!!)
#include "gen_xps_config"
#include "nw_i0_plot"
#include "gen_death_config"
//////////////////////////////////////////////////////////////////////////
//Use These For Reference
//Tell us what the BASE XP Needed to obtain nLevel (up to level 100)
int GetBaseXPByLevel(int nLevel);
//Tell us if the Target is at least nLevel or Higher
int GetHasLevel(object oTarget, int nLevel);
//Is stored in a Variable on the Target by another function!
void ReturnOriginalXP(object oTarget);
//Set the PC to nLevel exactly
void SetLevel(object oTarget, int nLevelToSet);
//Take X Levels
void TakeLevels(object oTarget, int nLevelsToTake);
//Give X Levels
void GiveLevels(object oTarget, int nLevelsToGive);
//Relevel oTarget nLevels.
void RelevelTarget(object oTarget, int nLevels);
// Take All XP & Give it back the PC (- Penalty)
void Relevel(object oTarget);
//Strictly for Respawn Scripts
void ApplyRespawnPenalty(object oTarget);
//----------------------------------------------------------------------
void Relevel1(object oPC); //For making my other scripts work only!
void Give1Level(object oPC);
void Relevel5(object oPC);
void Relevel10(object oPC);
void Take1Level(object oPC);
//======================================================================
// NEW Addon...
//Give the PC The Standard Gold Based Upon nLevel (for which level?)
void GiveStandardGold(object oPC, int nLevel);
//////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
///////////###################################################//////////////
//******** ##WARNING:## DO NOT TOUCH ANYTHING BELOW THIS LINE!!!!********//
///////////###################################################////////////
/////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
// DEFINE ALL PROTOTYPES
/////////////////////////////////////////////////////////////////////////
//this prototype will return the BASE XP Needed for the level..
int GetBaseXPByLevel(int nLevel)
{
int nXP = 0;
switch (nLevel)
{
case 1: {nXP = 0; } break; // This will set them at level 1!
case 2: {nXP = 1000;} break; // This will set them at level 2!
case 3: {nXP = 3000;} break;
case 4: {nXP = 6000;} break;
case 5: {nXP = 10000;} break;
case 6: {nXP = 15000;} break;
case 7: {nXP = 21000;} break;
case 8: {nXP = 28000;} break;
case 9: {nXP = 36000;} break;
case 10: {nXP = 45000;} break;
case 11: {nXP = 55000;} break;
case 12: {nXP = 66000;} break;
case 13: {nXP = 78000;} break;
case 14: {nXP = 91000;} break;
case 15: {nXP = 105000;} break;
case 16: {nXP = 120000;} break;
case 17: {nXP = 136000;} break;
case 18: {nXP = 153000;} break;
case 19: {nXP = 171000;} break;
case 20: {nXP = 190000;} break;
case 21: {nXP = 210000;} break;
case 22: {nXP = 231000;} break;
case 23: {nXP = 263000;} break;
case 24: {nXP = 276000;} break;
case 25: {nXP = 300000;} break;
case 26: {nXP = 325000;} break;
case 27: {nXP = 351000;} break;
case 28: {nXP = 378000;} break;
case 29: {nXP = 406000;} break;
case 30: {nXP = 435000;} break;
case 31: {nXP = 465000;} break;
case 32: {nXP = 496000;} break;
case 33: {nXP = 528000;} break;
case 34: {nXP = 561000;} break;
case 35: {nXP = 595000;} break;
case 36: {nXP = 630000;} break;
case 37: {nXP = 666000;} break;
case 38: {nXP = 703000;} break;
case 39: {nXP = 741000;} break;
case 40: {nXP = 780000;} break; // Set to level 40
case 41: {nXP = XP_REQ_LVL41;} break; // Continuing on with God Levels
case 42: {nXP = XP_REQ_LVL42;} break;
case 43: {nXP = XP_REQ_LVL43;} break;
case 44: {nXP = XP_REQ_LVL44;} break;
case 45: {nXP = XP_REQ_LVL45;} break;
case 46: {nXP = XP_REQ_LVL46;} break;
case 47: {nXP = XP_REQ_LVL47;} break;
case 48: {nXP = XP_REQ_LVL48;} break;
case 49: {nXP = XP_REQ_LVL49;} break;
case 50: {nXP = XP_REQ_LVL50;} break;
case 51: {nXP = XP_REQ_LVL51;} break;
case 52: {nXP = XP_REQ_LVL52;} break;
case 53: {nXP = XP_REQ_LVL53;} break;
case 54: {nXP = XP_REQ_LVL54;} break;
case 55: {nXP = XP_REQ_LVL55;} break;
case 56: {nXP = XP_REQ_LVL56;} break;
case 57: {nXP = XP_REQ_LVL57;} break;
case 58: {nXP = XP_REQ_LVL58;} break;
case 59: {nXP = XP_REQ_LVL59;} break;
case 60: {nXP = XP_REQ_LVL60;} break;
case 61: {nXP = XP_REQ_LVL61;} break;
case 62: {nXP = XP_REQ_LVL62;} break;
case 63: {nXP = XP_REQ_LVL63;} break;
case 64: {nXP = XP_REQ_LVL64;} break;
case 65: {nXP = XP_REQ_LVL65;} break;
case 66: {nXP = XP_REQ_LVL66;} break;
case 67: {nXP = XP_REQ_LVL67;} break;
case 68: {nXP = XP_REQ_LVL68;} break;
case 69: {nXP = XP_REQ_LVL69;} break;
case 70: {nXP = XP_REQ_LVL70;} break;
case 71: {nXP = XP_REQ_LVL71;} break;
case 72: {nXP = XP_REQ_LVL72;} break;
case 73: {nXP = XP_REQ_LVL73;} break;
case 74: {nXP = XP_REQ_LVL74;} break;
case 75: {nXP = XP_REQ_LVL75;} break;
case 76: {nXP = XP_REQ_LVL76;} break;
case 77: {nXP = XP_REQ_LVL77;} break;
case 78: {nXP = XP_REQ_LVL78;} break;
case 79: {nXP = XP_REQ_LVL79;} break;
case 80: {nXP = XP_REQ_LVL80;} break;
case 81: {nXP = XP_REQ_LVL81;} break;
case 82: {nXP = XP_REQ_LVL82;} break;
case 83: {nXP = XP_REQ_LVL83;} break;
case 84: {nXP = XP_REQ_LVL84;} break;
case 85: {nXP = XP_REQ_LVL85;} break;
case 86: {nXP = XP_REQ_LVL86;} break;
case 87: {nXP = XP_REQ_LVL87;} break;
case 88: {nXP = XP_REQ_LVL88;} break;
case 89: {nXP = XP_REQ_LVL89;} break;
case 90: {nXP = XP_REQ_LVL90;} break;
case 91: {nXP = XP_REQ_LVL91;} break;
case 92: {nXP = XP_REQ_LVL92;} break;
case 93: {nXP = XP_REQ_LVL93;} break;
case 94: {nXP = XP_REQ_LVL94;} break;
case 95: {nXP = XP_REQ_LVL95;} break;
case 96: {nXP = XP_REQ_LVL96;} break;
case 97: {nXP = XP_REQ_LVL97;} break;
case 98: {nXP = XP_REQ_LVL98;} break;
case 99: {nXP = XP_REQ_LVL99;} break;
case 100: {nXP = XP_REQ_LVL100;} break;
}
return nXP;
}
////////////////////////////////////////////////////////////////////////////////
int GetHasLevel(object oTarget, int nLevel)
{
int i = FALSE;
int nCXP = GetXP(oTarget);
int nCLvl = GetLevelByXP(oTarget);
if(nCLvl >= nLevel)
{ i = TRUE; }
return i;
}
////////////////////////////////////////////////////////////////////////
//Set the Target Back to their Original XP (For Relevel Purposes)
// NOT A Function For USAGE!!!
//Created this for a delay function...
void ReturnOriginalXP(object oTarget)
{
//How much XP the Target had BEFORE any changes...
int nXP = GetLocalInt(oTarget, "pc_exact_xp");
//Return the original XP to the Target..
DelayCommand(0.3, SetXP(oTarget, nXP));
}
////////////////////////////////////////////////////////////////////////////////
//Set oTarget to exactly nLevelToSet
void SetLevel(object oTarget, int nLevelToSet)
{
int nXP = GetBaseXPByLevel(nLevelToSet);
SetXP(oTarget, nXP);
}
/////////////////////////////////////////////////////////////////////////
// TakeLevels(object oTarget, int nHD, int nLevelsToTake)
// This function was rewritten for better Control..
// oTarget = The Target to lose Levels..
// nHD = The Current HitDice of the Target (NOT ACTUAL LEVELS!)
// nLevelsToTake = The # of levels you want to take from the PC..
void TakeLevels(object oTarget, int nLevelsToTake)
{
//Major Variables
int nCXP = GetXP(oTarget);
int nHD = GetHitDice(oTarget);
int nCLvl = GetLevelByXP(oTarget);
int nCheck = nCLvl - nLevelsToTake;
int n2Adj = nHD - 1; //If we are taking at least 1 level..
int nAdj, nXP;
if(USING_LL_OR_GL_SYSTEMS == TRUE) //Works (but) doesn't work for releveling!
{
if(nCheck >= 1)
{
nAdj = nCLvl - nLevelsToTake;
nXP = GetBaseXPByLevel(nAdj);
SetXP(oTarget, nXP);
}
//Otherwise it would put them below level 1
else
{
SendMessageToPC(oTarget, "You cannot lose that many levels.");
}
}
else if(nCheck>=1)
{
nAdj = nCLvl - nLevelsToTake;
if(nAdj>=1)
{
nXP = GetBaseXPByLevel(nAdj);
SetXP(oTarget, nXP);
}
else
{
SetXP(oTarget, 0);
}
}
else
{
SendMessageToPC(oTarget, "You cannot lose that many levels, sorry.");
}
////////////////////////////////////////////////////////////////////////////////
} //End Prototype
//////////////////////////////////////////////////////////////////////////
// GiveLevels(object oTarget, int nHD, int nLevelsToGive)
//The Function Gives the Target X Levels
// where nLevelsToGive = The # of Levels you want to give the Target
// NOTE: This script will NOT cause XP LOSS, it will give
// Exactly the amount of XP Needed for X Levels More Than Current HD (Level)
void GiveLevels(object oTarget, int nLevelsToGive)
{
if(nLevelsToGive == 0)
{
SendMessageToPC(oTarget, "ERROR - 0 Levels are to be given!!!");
return;
}
//Major Variables
int nCXP = GetXP(oTarget);
int nHD = GetHitDice(oTarget);
int nCLvl = GetLevelByXP(oTarget);
int nCheck = nCLvl - 1; //obviously we are giving them at least 1 level!
int nAdj;
int nXP;
if(USING_LL_OR_GL_SYSTEMS == TRUE)
{
nAdj = nCLvl + nLevelsToGive;
if(nAdj<100)
{
nXP = GetBaseXPByLevel(nAdj);
SetXP(oTarget, nXP);
}
else
{
SendMessageToPC(oTarget, "You cannot gain any more XP!");
return;
}
}
else if(nCheck >= 41)
{
SendMessageToPC(oTarget, "You cannot gain that many levels!");
return;
}
else
{
nAdj = nCLvl + nLevelsToGive;
if(nAdj >40) //Capped for Non GL/LL Systems...
{ nAdj = 40; }
nXP = GetBaseXPByLevel(nAdj);
SetXP(oTarget, nXP);
}
////////////////////////////////////////////////////////////////////////////////
} //End Prototype
/////////////////////////////////////////////////////////////////////////////
// RelevelTarget(object oTarget, int nInt)
// The Function RelevelTarget(oTarget, nINt) will take nInt levels from the
// Target and give back thier orginal XP. This script does not cause xp loss
// whatsoever. I have THOROUGHLY Tested this and found it 100% Good!
void RelevelTarget(object oTarget, int nLevels)
{
//If the PC has indeed taken a god level!
object oGT = GetItemPossessedBy(oTarget, "god_token");
//God Level Characters cannot relevel!
if(oGT != OBJECT_INVALID)
{
SendMessageToPC(oTarget, "You can no longer relevel!");
return;
}
int nXP = GetXP(oTarget);
//Set how much XP They have First ALWAYS!!
SetLocalInt(oTarget, "pc_exact_xp", nXP);
//NOTE Releveling a target requires that you use HD and never Level By XP!
//Otherwise the target may not actually lose levels if they have a lot of XP.
int nHD = GetHitDice(oTarget);
int nAdj = nHD - nLevels;
int nSet = GetBaseXPByLevel(nAdj);
SetXP(oTarget, nSet);
//Delay In Case of Lag!
DelayCommand(0.7, ReturnOriginalXP(oTarget));
DelayCommand(0.8, SetLocalInt(oTarget, "pc_exact_xp", 0));
}
/////////////////////////////////////////////////////////////////////////////
// Relevel(object oTarget)
//This function below Relevel(oTarget), will relevel a Creature minus
//50 Gold & XP / Level (They must have the cost of gold or nothing happens!
//This function can go in almost any script!(Define oTarget in that script!)
//Can go in OnClick / OnUsed / OnEnter (whichever event you wish to use it in)
//Example: Relevel(oPC); (That's all you need to relevel the PC!)
void Relevel(object oTarget)
{
object oPC = oTarget;
//If the PC has indeed taken a god level!
object oGT = GetItemPossessedBy(oTarget, "god_token");
int nCLvl = GetLevelByXP(oTarget);
int nHD = GetHitDice(oPC);
//God Level Characters cannot relevel!
if(oGT != OBJECT_INVALID)
{
SendMessageToPC(oTarget, "You can no longer relevel!");
return;
}
//Calculate Penalty
int nGold = nCLvl * RLVL_GOLD_PENALTY;
int nXP = nCLvl * RLVL_XP_PENALTY;
int nCXP = GetXP(oTarget);
int nCalc = nCXP - nXP; //Current - Penalty
// Only need to calculate gold to take
// (xp will always be taken if they have enough gold!)
if(GetGold(oTarget)>nGold)
{
AssignCommand(oPC, TakeGoldFromCreature(nGold, oTarget, TRUE));
//Set them to 0 XP First..
SetXP(oTarget, 0);
//Delay Giving XP Back!
DelayCommand(0.5, SetXP(oTarget, nCalc));
}
else
{
SendMessageToPC(oTarget, "You do not have enough gold to relevel!");
}
//End Prototype
}
////////////////////////////////////////////////////////////////////////////////
// ApplyRespawnPenalty(object oTarget)
//This function penalizes a the person repsawning it goes in the (see below)
//Example of Function: ApplyRespawnPenalty(oPC); (onplayerrespawn) event.
//They cannot lose a level with this function.
//They lose 20% of the excessive XP over the XP required for thier current level.
//They lose 10% of thier gold.
//Note This is a good script if your using Legendary Levels
'>
void ApplyRespawnPenalty(object oTarget)
{
int nCurrentXP = GetXP(oTarget);
int nCLvl;
if(GetXP(oTarget)>= XP_REQ_LVL41 && USING_LL_OR_GL_SYSTEMS)
{
//They MUST Be level 40 to use this check!
if(GetHitDice(oTarget)==40)
{
//Tell us their level based upon their XP...
nCLvl = GetLevelByXP(oTarget);
}
else
nCLvl = GetHitDice(oTarget);
}
else
{
nCLvl = GetHitDice(oTarget);
}
int nXP = GetBaseXPByLevel(nCLvl); //Get the XP Needed for the PC's Current Level.
int nCXP = nCurrentXP;
//Subtract thier minimum XP needed for the level
int nAXP = nCXP - nXP; //How much XP they have to lose (without level loss)
int nCalc = nCLvl * RESPAWN_XP_PENALTY; //Calculated Penalty
int nAdjXP = nCXP - nCalc; //Apply the Respawn Penalty to their Current XP...
//Prevent Level Loss!
if(nCalc > nAXP) //If Penalty is greater than Extra XP
{
SetXP(oTarget, nXP); //Set them at the minimum for their current level!
}
else
{
SetXP(oTarget, nAdjXP); //Otherwise apply the normal penalty (It won't cause level loss)
}
//Calculate Gold Penalty (Get the PC's Level by XP!)
int nGold = RESPAWN_GOLD_PENALTY * GetLevelByXP(oTarget);
//Apply The Gold Penalty
AssignCommand(oTarget, TakeGoldFromCreature(nGold, oTarget, TRUE));
}
///////////////////////////////////////////////////////////
// For making old scripts work after importing this fix!
void Relevel1(object oPC)
{
RelevelTarget(oPC, 1);
}
void Relevel5(object oPC)
{
RelevelTarget(oPC, 5);
}
void Relevel10(object oPC)
{
RelevelTarget(oPC, 10);
}
void Give1Level(object oPC)
{
GiveLevels(oPC, 1); // Give X Levels
}
void Take1Level(object oPC)
{
TakeLevels(oPC, 1); // Take X Levels
}
////////////////////////////////////////////////////////////////////////////////
//Give the PC The Standard Gold Based Upon nLevel (for which level?)
void GiveStandardGold(object oPC, int nLevel)
{
int nGold;
switch(nLevel)
{
case 1: nGold = 300; break;
case 2: nGold = 900; break;
case 3: nGold = 2700; break;
case 4: nGold = 5400; break;
case 5: nGold = 9000; break;
case 6: nGold = 13000; break;
case 7: nGold = 19000; break;
case 8: nGold = 27000; break;
case 9: nGold = 36000; break;
case 10: nGold = 49000; break;
case 11: nGold = 66000; break;
case 12: nGold = 88000; break;
case 13: nGold = 110000; break;
case 14: nGold = 150000; break;
case 15: nGold = 200000; break;
case 16: nGold = 260000; break;
case 17: nGold = 340000; break;
case 18: nGold = 440000; break;
case 19: nGold = 580000; break;
case 20: nGold = 760000; break;
case 21: nGold = 940000; break;
case 22: nGold = 1120000; break;
case 23: nGold = 1300000; break;
case 24: nGold = 1480000; break;
case 25: nGold = 1660000; break;
case 26: nGold = 1840000; break;
case 27: nGold = 2020000; break;
case 28: nGold = 2200000; break;
case 29: nGold = 2380000; break;
case 30: nGold = 2560000; break;
case 31: nGold = 2740000; break;
case 32: nGold = 2920000; break;
case 33: nGold = 3100000; break;
case 34: nGold = 3280000; break;
case 35: nGold = 3460000; break;
case 36: nGold = 3640000; break;
case 37: nGold = 3820000; break;
case 38: nGold = 4000000; break;
case 39: nGold = 4180000; break;
case 40: nGold = 4360000; break;
}
//Give the standar gold award.
GiveGoldToCreature(oPC, nGold);
}
==========================================
// gen_gl_const_inc
//Taken from Higher Ground's LL and Modified for this system..
//NOTE: You can safely set the amount of XP to anything you like.
//The system checks these constants for reference..
// Experience Requirements for Legendary Levels
// Adjust as desired. These were set by increasing the additional amount required for the
// previous level by 25%. Level 40 required 39000 experience points, so Level 41 was set
// to require 39000 x 1.25 = 48800 experience points. This will be ALOT on some worlds,
// and not enough on others, so adjust to suit your needs.
const int BASE_XP_LVL_40 = 780000; //780000
const int XP_REQ_LVL41 = 821000; //48800
const int XP_REQ_LVL42 = 863000; //60900
const int XP_REQ_LVL43 = 900000; //76200
const int XP_REQ_LVL44 = 1000000; //95200
const int XP_REQ_LVL45 = 1100000; //119000
const int XP_REQ_LVL46 = 1200000; //148800
const int XP_REQ_LVL47 = 1300000; //186000
const int XP_REQ_LVL48 = 1400000; //232500
const int XP_REQ_LVL49 = 1600000; //290600
const int XP_REQ_LVL50 = 1800000; //363200
const int XP_REQ_LVL51 = 2200000; //454000
const int XP_REQ_LVL52 = 2400000; //567500
const int XP_REQ_LVL53 = 2600000; //709400
const int XP_REQ_LVL54 = 2800000; //886800
const int XP_REQ_LVL55 = 3000000; //1108400
const int XP_REQ_LVL56 = 3200000; //1385600
const int XP_REQ_LVL57 = 3400000; //1731900
const int XP_REQ_LVL58 = 3600000; //2164900
const int XP_REQ_LVL59 = 3800000; //2706200
const int XP_REQ_LVL60 = 4000000; //3382700
//Extend the Levels!
'>
const int XP_REQ_LVL61 = 4200000;
const int XP_REQ_LVL62 = 4400000;
const int XP_REQ_LVL63 = 4600000;
const int XP_REQ_LVL64 = 4800000;
const int XP_REQ_LVL65 = 5000000;
const int XP_REQ_LVL66 = 5200000;
const int XP_REQ_LVL67 = 5400000;
const int XP_REQ_LVL68 = 5600000;
const int XP_REQ_LVL69 = 5800000;
const int XP_REQ_LVL70 = 6000000;
const int XP_REQ_LVL71 = 6200000;
const int XP_REQ_LVL72 = 6400000;
const int XP_REQ_LVL73 = 6600000;
const int XP_REQ_LVL74 = 6800000;
const int XP_REQ_LVL75 = 7000000;
const int XP_REQ_LVL76 = 7200000;
const int XP_REQ_LVL77 = 7400000;
const int XP_REQ_LVL78 = 7600000;
const int XP_REQ_LVL79 = 7800000;
const int XP_REQ_LVL80 = 8000000;
const int XP_REQ_LVL81 = 8200000;
const int XP_REQ_LVL82 = 8400000;
const int XP_REQ_LVL83 = 8600000;
const int XP_REQ_LVL84 = 8800000;
const int XP_REQ_LVL85 = 9000000;
const int XP_REQ_LVL86 = 9200000;
const int XP_REQ_LVL87 = 9400000;
const int XP_REQ_LVL88 = 9600000;
const int XP_REQ_LVL89 = 9800000;
const int XP_REQ_LVL90 = 10000000;
const int XP_REQ_LVL91 = 10200000;
const int XP_REQ_LVL92 = 10400000;
const int XP_REQ_LVL93 = 10600000;
const int XP_REQ_LVL94 = 10800000;
const int XP_REQ_LVL95 = 11000000;
const int XP_REQ_LVL96 = 11200000;
const int XP_REQ_LVL97 = 11400000;
const int XP_REQ_LVL98 = 11600000;
const int XP_REQ_LVL99 = 11800000;
const int XP_REQ_LVL100 = 12000000;
================================================
// gen_xps_config
////////////////////////////////////////////////////////////////////////////////
// Created By: Genisys / Guile
// Created On: 5/8/12
// © Copyright 2012
////////////////////////////////////////////////////////////////////////////////
/*
This is the include script for configuring the XP System
This script belongs to "The Genisys XP System"
NOTE: This system is 100% Custom and DOES NOT Follow Standard XP System!
This System is more for quality rather & modules with HIGH CR on Creatures..
Any reproduction or use of this script without express written consent
from the author (Genisys) is strictly prohibited!
*/
////////////////////////////////////////////////////////////////////////////////
// All XP System Settings
////////////////////////////////////////////////////////////////////////////////
//Required Inlcude
//NOTE: This also include Higher Ground's Legendary Level System Constants...
//YOU SHOULD COPY YOUR Constants from the HGLL System to this include script!
//As only default XP is used in the following include script!
#include "gen_gl_const_inc"
//#####################################################################
//WARNING: DO NOT SET ANY FLOAT BELOW TO "0.0" OR THE SYSTEM WILL FAIL!
//#####################################################################
///////////////////////////////
//Main Settings..
// BASE XP (Main Setting!)
//Set this to the BASE XP multiplied by the Creatures CR
//e.g. if the creatures CR is 10.0 & you set this to 20.0 Base XP = 200.0
//NOTE: the Base XP is then effected by OTHER settings below!
//By default 20 XP / CR (e.g. @ 60 CR, BASE XP = 1200)
//OBVIOUSLY this is NOT a standard bioware XP System (it's 100% Custom Controlled!)
const float GXPS_BASE_XP_PER_CR = 20.0;
// MODIFYING Base XP
/*
This function is a little more complex, but not hard to understand, basically...
For every 1 Lvl Difference from the CR of the creature, the Base XP will
be Increased or Decreased based upon the Modifier Below.
EXAMPLE: If set to 0.1 (default) +/- 10% Base XP Per Level Difference
SO, if CR is 20 and The PC/Party Level is 10 the Base XP will be 100% more
or 2 X The Base XP (without considering any penalties!)
I Recommend you use between 0.05 (5%) & 0.3 (30%) DO NOT USE 0.0 (0%!)
EXAMPLE USE: @ 0.1 (10%) if Creature CR 30 vs Player Lvl 25 (10% X 5 = +50% XP)
Likewise: Level 30 Player vs CR 23 Monster = 10% * 7 (-70% XP)
IDEALLY: This system scales better than standard XP, if you want to use close
to the Bioware Default, then set this to 0.2 (20%) up to 4 levels difference
before NO XP is rewarded (other than minimum + Extra From Dice (11-23)
OBVIOUSLY a PC would rarely challenge a creature 8 CR Higher than their Level
However: a Level 40 or Higher Players may challenge very HIGH CR Monsters
(So to prevent execessive XP, the Max XP Setting below is used to CAP XP)
*/
const float GXPS_BASE_XP_MOD = 0.1; //Default (0.1) +/- 10% / Level Difference
//Set this to to the Random Dice to Use for Base XP Modifications (for randomness)
//USE 4/6/8/10/12/20/100 ONLY! (e.g. d4/36/etc)
//e.g. by default (10) d10 random XP (1-10) is added to the Base XP
//This gives more randomness to XP rather than just even numbers..
const int GXPS_RANDOM_DICE = 10; //Default (10) = + 1d10 XP added to the Base XP
//Set this to how many dice you want to use (e.g. if above set to 10 (d10(x) is
//used, where X = what you set below, so if set to 2, d10(2) or 2d10 is used..
const int GXPS_DICE_NUMBER = 1; //Default (1) = 1 Extra Dice added to XP/Gold..
//Set this to the Minimum XP to be given NO MATTER WHAT! ( + Random XP!!!)
//DO NOT Set this to 0! (Use 1 - 500)
const int GXPS_MIN_XP = 10; //Minimume XP Given (10 By Default)
//Set this to the Maximum XP to be awarded to any ONE PC...
//DO NOT Set this to below or euqal to the above Minimum XP!
//Use Between (100 - 10000) (I wouldn't advice 10,000 Max XP though...)
//(Obviously a level 200 XR Creature will give A LOT of XP =)
const int GXPS_MAX_XP = 1200; //Maximum XP Given = 1200 By Default
//Set this to TRUE if you wish to Divide XP by the # of Members In The Area
//Using this & the Party Member Bonus gives finer control of WHY & HOW XP is
//awarded to parties Though it's best to just leave this off unless you want to
//apply a penalty for partying, otherwise you will need raise the Party Bonus (a lot)
//Though if you raise party bonus much, then gold reward will be high
//you would definitely want to divide gold too!
const int GXPS_DIVIDE_XP = FALSE; //By Default (FALSE), this is NOT Active
////////////////////////////////
//Subrace Settings
//Set this to FALSE if you are NOT using the Genisys Subrace System
const int GXPS_USE_GEN_SUBS = TRUE; //By Default (TRUE) I use this system..
//Set this to FALSE if you DO NOT wish to apply an ECL Penalty
const int GXPS_USE_ECL_PENALTY = TRUE; //By Default (TRUE), use the penalty..
////////////////////////////////
//Gold Settings
//NOTE: GOLD IS NOT CAPPED, & it's figured AFTER all other adjustments!
//the beauty of this is high CR / Lvl Bosses give much more gold. (Good!)
//Set this to FALSE if you DO NOT want to give Gold as a reward...
const int GXPS_GIVE_GOLD = TRUE; //By Default (TRUE), Give Gold
//Set this to what % of the XP you want to award Gold
//EXAMPLES (If set to 1.0 then 1 GP / 1 XP is rewarded)
// (if set to 0.5 then 1 GP / 2 XP is rewarded)
// (if set to 3.0 then 3 GP / 1 XP is rewarded)
// NOTE: This is CAPPED by the Max XP given (Set this with careful calculations!)
const float GXPS_GOLD_MODIFIER = 1.0; //By Default (1.0) 1 GP / 1 XP is given
//Set this to TRUE if you wish to Divide GOLD by the # of Members In The Area
const int GXPS_DIVIDE_GOLD = FALSE; //By Default (FALSE), Gold IS NOT Divided
////////////////////////////////
//True Level System
//Set this to TRUE if you want to use the PC(s) Actual Level Based Upon XP
//NOTE: By default the PC can exploit the system if they "Hold" XP (not leveling up)
const int GXPS_USE_TRUE_LVL = FALSE; //By Default (FALSE) Hit Dice Is Used Instead
//Set this to TRUE if you are Using Higher Ground's Legendary Level System
//This is only used if the Use True Level Function Above is Active..
const int GXPS_USE_HGLL = FALSE; //By Default (FALSE) HGLL is NOT Used!
//Set this to TRUE if you are using The Genisys God Level System
//This is only use IF you are NOT using the HGLL & True Lvl Is Used Above
const int GXPS_USE_TGGLS = FALSE; //By Default (FALSE) TGGLS is NOT used.
/////////////////////////////////////////////////////////////////////////////////
//CRITICAL SETTING!
//Set this to TRUE if you are using the God Level System!
const int USING_LL_OR_GL_SYSTEMS = TRUE;
//////////////////////////////////
//Summons & Associates Penalties
// Set this to FALSE if you DO NOT wish to use a Penalty for Summons
const int GXPS_SUMM_PENALTY = TRUE; //Default (TRUE), Use A Summons Penalty
// Set this to the Percent Amount you want the penalty to be (from base XP)
// 0.01 - 0.99 Are the Accepable Number Range To USE (DO NOT USE 1.0 or Greater!)
const float GXPS_SUM_PEN_MOD = 0.1; //Default (0.1), 10% penalty to XP Per Summons
//////////////////////////////////
//Killer Bonus to XP
//Set this to FALSE if you DO NOT wish to use a Killer Bonus to XP
const int GXPS_USE_KB = TRUE; // Default (TRUE) is Use A Killer Bonus for XP
//Set this float to the % bonus to be given (1.0 = 100% or 2X XP)
//0.1 = 10% Bonus / etc.. (There MUST be at least 2 Members In The Party)
//Solo Players DO NOT get this bonus! (They DO NOT get more of a Gold Bonus!)
const float GXPS_KILLER_BONUS = 0.05; //Default (0.05) is +5% For Killing
//////////////////////////////////
//Party Member Bonuses To XP
//Set this to FALSE if you DO NOT wish to use Party Member Bonuses To XP
const int GXPS_USE_PMB = TRUE; // Default (TRUE) is Use Party Member Bonuses
//Set this to the % Modifier given for Each Party Member
//NOTE: 1.0 = 100% (or 2 X the XP Given) / 2.0 = 200% (or 3 X the XP Given)
// 0.5 = 50% the XP Given / 0.01 = 1% Bonus Per Party member
const float GXPS_PM_BONUS = 0.05; //Default (0.05)= +5% / Party Member
//Set this to the MAX # of Party Members used for Calculating the above
//Party Member Bonus to XP, any extra members will not effect the PMBM
//By ALL Default Settings up to 25% Bonus Is Rewarded (w/ 5 Members Present)
const int GXPS_PMB_MAX = 5; //Default (5) = Up To 5 Members Give a Bonus to XP
////////////////////////////////
//Party Distance
//Set this to FALSE if you DO NOT wish to use Party Distance Penalties
//NOTE: This will indeed reduce lag, as the GetDistance functions is CPU Intensive!
const int GXPS_USE_PDP = TRUE; //Default (TRUE), Use Party Distance Penalty
//Set this to the Maximum Distance Allowed between the Killer & Party Members
//Any member who is too far will NOT get any XP (set this to 200.0 to turn off
// 25.0 = 25 Meters (5 tiles) by default
const float GXPS_MAX_PD = 50.0; //25.0 = 25 Meters or (5 Tiles) by defaul
//Set this to the Penalty Applied to XP for any Member NOT within the
//specified Distance Above (Use 0.1 "1%" to 1.0 "100%" ONLY!)
//if set to 1.0 the PC will recieve NO REWARD if beyond the distance!
const float GXPS_PD_PENALTY = 0.5; //Default (0.5) = 50% or 1/2 XP...
///////////////////////////////
//Party Level Difference
//Set this to FALSE if you DO NOT wish to use the Party Level Difference Restriction
const int GXPS_USE_PLDP = TRUE; //Use Party Level Difference Penalty
//Set this to the MAX Party level Difference Between the Highest & Lowest Level Members
const int GXPS_MAX_PLD = 5; //Default (5) = Max of 5 Levels Difference
//Set this to what % of a Penalty you want to use / Level Of Difference
//E.G. (if set to 0.3, then 30% penalty applied to XP / Level Difference)
//or (If set to 0.05 (5% Penalty / Level Difference)
//NOTE: This will NEVER exceed 100% (scripts prevent it)
//ALSO NOTE THAT: The Minimum XP is ALWAYS REWARDED, even if the PC is 40+ Levels Higher
const float GXPS_PLD_PENALTY = 0.25; //Default (0.25) = 25% Penalty / Level
///////////////////////////////////////
//Favored class Penalty
//NOTE: This system DOES NOT Take Subraces into account!
//A Favored class is a requirement by Races to Play A class
//If they are Multi-class, then each class must be within 1 Level of
//the Favored class, or they get a 20% Penalty to XP
//Set this to FALSE if you DO NOT WANT to use the Favored class Penalty
//THIS WILL COMPLETELY REMOVE THE PENALTY FROM XP GIVEN TO THE PC!
//Meaning they will instead get higher XP (+20%) to remove the penalty..
const int GXPS_DISABLE_BASE_FAV_class_PENALTY = TRUE;
//Set this to FALSE if you DO NOT Wish to apply A Custom Penalty
//This is Calculated with the Above Settings as well (If Turned OFF / FALSE)
//So if you Disabled the Above Setting, then this system
//will give the base 20% Penalty + whatever you set below
//Otherwise if you turn off the Base Penalty then just this penalty is used
const int GXPS_USE_FCP = FALSE; //Default (TRUE) = Use Custom Penalty
//Set this to the Maximum level Difference of the Favored class from the
//Highest / Lowest Level the Player Has in any their Favored class...
//Bioware / D&D Default = 1 Level Difference Allowed from Favored class
const int GXPS_FCL_MAX = 3; //Default (3) = 3 level Difference Allowed Only
//Set this to the Penalty you wish to impose (apply) on the Total XP Awarded
//to palyers NOT having equal levels as their other classes to their Preferred class
const float GXPS_FCP_MOD = 0.2; //Default (0.2) = 20% Penalty (Bioware Default)
////////////////////////////////////////
//Messages
//Set this to TRUE if you want to float the XP Reward over the PC's head
const int GXPS_FLOAT_XP_MSG = TRUE; //Default (FALSE) = DO NOT Float the Msg
//Set this to TRUE if you want to float the Gold Reward over the PC's Head
const int GXPS_FLOAT_GOLD_MSG = TRUE; //Default (FALSE) = DO NOT Float the Msg
//Set this to FALSE if you DO NOT want to send the PC the message about
//how XP is calculated (this is sent to the combat log)
const int GPXS_SEND_XP_MSG = TRUE; //Default (TRUE) Send XP Calculation Message
////////////////////////////////////////////////////////////////////////////////
//End Settings
//################################################
//WARNING DO NOT TOUCH THIS PRIVATE FUNCTION!!!!
//################################################
int GetLevelByXP(object oTarget)
{
int i = 1; //No matter what return level 1!
int nXP = GetXP(oTarget);
if(nXP >= XP_REQ_LVL100 && USING_LL_OR_GL_SYSTEMS) { i = 100; }
else if(nXP >= XP_REQ_LVL99 && USING_LL_OR_GL_SYSTEMS) { i = 99; }
else if(nXP >= XP_REQ_LVL98 && USING_LL_OR_GL_SYSTEMS) { i = 98; }
else if(nXP >= XP_REQ_LVL97 && USING_LL_OR_GL_SYSTEMS) { i = 97; }
else if(nXP >= XP_REQ_LVL96 && USING_LL_OR_GL_SYSTEMS) { i = 96; }
else if(nXP >= XP_REQ_LVL95 && USING_LL_OR_GL_SYSTEMS) { i = 95; }
else if(nXP >= XP_REQ_LVL94 && USING_LL_OR_GL_SYSTEMS) { i = 94; }
else if(nXP >= XP_REQ_LVL93 && USING_LL_OR_GL_SYSTEMS) { i = 93; }
else if(nXP >= XP_REQ_LVL92 && USING_LL_OR_GL_SYSTEMS) { i = 92; }
else if(nXP >= XP_REQ_LVL91 && USING_LL_OR_GL_SYSTEMS) { i = 91; }
else if(nXP >= XP_REQ_LVL90 && USING_LL_OR_GL_SYSTEMS) { i = 90; }
else if(nXP >= XP_REQ_LVL89 && USING_LL_OR_GL_SYSTEMS) { i = 89; }
else if(nXP >= XP_REQ_LVL88 && USING_LL_OR_GL_SYSTEMS) { i = 88; }
else if(nXP >= XP_REQ_LVL87 && USING_LL_OR_GL_SYSTEMS) { i = 87; }
else if(nXP >= XP_REQ_LVL86 && USING_LL_OR_GL_SYSTEMS) { i = 86; }
else if(nXP >= XP_REQ_LVL85 && USING_LL_OR_GL_SYSTEMS) { i = 85; }
else if(nXP >= XP_REQ_LVL84 && USING_LL_OR_GL_SYSTEMS) { i = 84; }
else if(nXP >= XP_REQ_LVL83 && USING_LL_OR_GL_SYSTEMS) { i = 83; }
else if(nXP >= XP_REQ_LVL82 && USING_LL_OR_GL_SYSTEMS) { i = 82; }
else if(nXP >= XP_REQ_LVL81 && USING_LL_OR_GL_SYSTEMS) { i = 81; }
else if(nXP >= XP_REQ_LVL70 && USING_LL_OR_GL_SYSTEMS) { i = 80; }
else if(nXP >= XP_REQ_LVL79 && USING_LL_OR_GL_SYSTEMS) { i = 79; }
else if(nXP >= XP_REQ_LVL78 && USING_LL_OR_GL_SYSTEMS) { i = 78; }
else if(nXP >= XP_REQ_LVL77 && USING_LL_OR_GL_SYSTEMS) { i = 77; }
else if(nXP >= XP_REQ_LVL76 && USING_LL_OR_GL_SYSTEMS) { i = 76; }
else if(nXP >= XP_REQ_LVL75 && USING_LL_OR_GL_SYSTEMS) { i = 75; }
else if(nXP >= XP_REQ_LVL74 && USING_LL_OR_GL_SYSTEMS) { i = 74; }
else if(nXP >= XP_REQ_LVL73 && USING_LL_OR_GL_SYSTEMS) { i = 73; }
else if(nXP >= XP_REQ_LVL72 && USING_LL_OR_GL_SYSTEMS) { i = 72; }
else if(nXP >= XP_REQ_LVL71 && USING_LL_OR_GL_SYSTEMS) { i = 71; }
else if(nXP >= XP_REQ_LVL70 && USING_LL_OR_GL_SYSTEMS) { i = 70; }
else if(nXP >= XP_REQ_LVL69 && USING_LL_OR_GL_SYSTEMS) { i = 69; }
else if(nXP >= XP_REQ_LVL68 && USING_LL_OR_GL_SYSTEMS) { i = 68; }
else if(nXP >= XP_REQ_LVL67 && USING_LL_OR_GL_SYSTEMS) { i = 67; }
else if(nXP >= XP_REQ_LVL66 && USING_LL_OR_GL_SYSTEMS) { i = 66; }
else if(nXP >= XP_REQ_LVL65 && USING_LL_OR_GL_SYSTEMS) { i = 65; }
else if(nXP >= XP_REQ_LVL64 && USING_LL_OR_GL_SYSTEMS) { i = 64; }
else if(nXP >= XP_REQ_LVL63 && USING_LL_OR_GL_SYSTEMS) { i = 63; }
else if(nXP >= XP_REQ_LVL62 && USING_LL_OR_GL_SYSTEMS) { i = 62; }
else if(nXP >= XP_REQ_LVL61 && USING_LL_OR_GL_SYSTEMS) { i = 61; }
else if(nXP >= XP_REQ_LVL60 && USING_LL_OR_GL_SYSTEMS) { i = 60; }
else if(nXP >= XP_REQ_LVL59 && USING_LL_OR_GL_SYSTEMS) { i = 59; }
else if(nXP >= XP_REQ_LVL58 && USING_LL_OR_GL_SYSTEMS) { i = 58; }
else if(nXP >= XP_REQ_LVL57 && USING_LL_OR_GL_SYSTEMS) { i = 57; }
else if(nXP >= XP_REQ_LVL56 && USING_LL_OR_GL_SYSTEMS) { i = 56; }
else if(nXP >= XP_REQ_LVL55 && USING_LL_OR_GL_SYSTEMS) { i = 55; }
else if(nXP >= XP_REQ_LVL54 && USING_LL_OR_GL_SYSTEMS) { i = 54; }
else if(nXP >= XP_REQ_LVL53 && USING_LL_OR_GL_SYSTEMS) { i = 53; }
else if(nXP >= XP_REQ_LVL52 && USING_LL_OR_GL_SYSTEMS) { i = 52; }
else if(nXP >= XP_REQ_LVL51 && USING_LL_OR_GL_SYSTEMS) { i = 51; }
else if(nXP >= XP_REQ_LVL50 && USING_LL_OR_GL_SYSTEMS) { i = 50; }
else if(nXP >= XP_REQ_LVL49 && USING_LL_OR_GL_SYSTEMS) { i = 49; }
else if(nXP >= XP_REQ_LVL48 && USING_LL_OR_GL_SYSTEMS) { i = 48; }
else if(nXP >= XP_REQ_LVL47 && USING_LL_OR_GL_SYSTEMS) { i = 47; }
else if(nXP >= XP_REQ_LVL46 && USING_LL_OR_GL_SYSTEMS) { i = 46; }
else if(nXP >= XP_REQ_LVL45 && USING_LL_OR_GL_SYSTEMS) { i = 45; }
else if(nXP >= XP_REQ_LVL44 && USING_LL_OR_GL_SYSTEMS) { i = 44; }
else if(nXP >= XP_REQ_LVL43 && USING_LL_OR_GL_SYSTEMS) { i = 43; }
else if(nXP >= XP_REQ_LVL42 && USING_LL_OR_GL_SYSTEMS) { i = 42; }
else if(nXP >= XP_REQ_LVL41 && USING_LL_OR_GL_SYSTEMS) { i = 41; }
else 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;
/////////////////////////////////////////////////////
}//End Prototype
////////////////////////////////////////////////////