Fixed XP exploit

Fixed XP exploit.  Full compile.  Updated release archive.
This commit is contained in:
Jaysyn904
2024-10-05 22:02:39 -04:00
parent d20776a96c
commit d5e54b1f5d
28 changed files with 196 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
void main()
{
ExecuteScript("prc_levelup", OBJECT_SELF);
ExecuteScript("nw_o0_levelup", OBJECT_SELF);
ExecuteScript("ht5_mod_levelup", OBJECT_SELF);
}

View 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);
}
}
}

View 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
}