Added NPC to re-level or delete character
Modified npc pickup script to ignore quest item spawns.
This commit is contained in:
14
_module/nss/leveltake5.nss
Normal file
14
_module/nss/leveltake5.nss
Normal 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);
|
||||
}
|
Reference in New Issue
Block a user