Fixed XP exploit
Fixed XP exploit. Full compile. Updated release archive.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
void main()
|
||||
{
|
||||
ExecuteScript("prc_levelup", OBJECT_SELF);
|
||||
ExecuteScript("nw_o0_levelup", OBJECT_SELF);
|
||||
ExecuteScript("ht5_mod_levelup", OBJECT_SELF);
|
||||
}
|
36
_module/nss/ht5_mod_levelup.nss
Normal file
36
_module/nss/ht5_mod_levelup.nss
Normal file
@@ -0,0 +1,36 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: ht5_mod_levelup.nss
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
#include "nw_i0_henchman"
|
||||
#include "nw_i0_generic"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCLevellingUp();
|
||||
|
||||
int nHD = GetHitDice(oPC);
|
||||
|
||||
if (GetIsObjectValid(oPC) == TRUE)
|
||||
{
|
||||
object oHench = GetHenchman(oPC);
|
||||
if (GetIsObjectValid(oHench) == TRUE)
|
||||
{
|
||||
if (GetCanLevelUp(oPC, oHench) == TRUE)
|
||||
{
|
||||
object oNew = DoLevelUp(oPC, oHench);
|
||||
if (GetIsObjectValid(oNew) == TRUE)
|
||||
{
|
||||
DelayCommand(1.0,AssignCommand(oNew, EquipAppropriateWeapons(oPC)));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (nHD > 1)
|
||||
{
|
||||
int nMin = ((nHD * (nHD - 1)) / 2) * 1000;
|
||||
SetXP(oPC, nMin);
|
||||
}
|
||||
}
|
||||
}
|
15
_module/nss/isnewplayer.nss
Normal file
15
_module/nss/isnewplayer.nss
Normal file
@@ -0,0 +1,15 @@
|
||||
int StartingConditional()
|
||||
{
|
||||
object oPC = GetPCSpeaker(); // Gets the player who initiated the conversation
|
||||
|
||||
int nXP = GetXP(oPC); // Get the player's current experience points
|
||||
int nLevel = GetHitDice(oPC); // Get the player's level (Hit Dice)
|
||||
|
||||
// Return TRUE if the player has less than 1500 XP or is under 1st level
|
||||
if (nXP < 1500 || nLevel < 1)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE; // Otherwise, return FALSE
|
||||
}
|
Reference in New Issue
Block a user