Added NPC to re-level or delete character

Modified npc pickup script to ignore quest item spawns.
This commit is contained in:
EpicValor
2023-12-14 23:02:17 -06:00
parent b59db83a72
commit d79d5b5ed3
29 changed files with 6453 additions and 33 deletions

View File

@@ -0,0 +1,14 @@
void main()
{
object oTarget = GetPCSpeaker();
int nLevels = 5;
int nOrigXP = GetXP(oTarget);
int nOrigHD = GetHitDice(oTarget);
int nTargetHD = nOrigHD - nLevels;
SetXP(oTarget, ((nTargetHD * (nTargetHD - 1)) / 2) * 1000);
// Schedule the OnLevelDown virtual event to be run right away
SetLocalInt(oTarget, "PRC_OnLevelDown_OldLevel", nOrigHD);
DelayCommand(0.0f, ExecuteScript("prc_onleveldown", oTarget));
SetXP(oTarget, nOrigXP);
TakeGoldFromCreature (25000, oTarget);
}