Changed folder name.
Changed folder name.
This commit is contained in:
52
_module/nss/relevelthepc.nss
Normal file
52
_module/nss/relevelthepc.nss
Normal file
@@ -0,0 +1,52 @@
|
||||
//Created By Guile 4/24/08
|
||||
//This script will take 50 gp & XP / level and then allow them to relevel.
|
||||
|
||||
//Note Palemaster & Red Dragon Disciples should never be allowed to
|
||||
//Complete relevel their character due to a bug which allows them to keep stats!
|
||||
//The conversation this is attached to prevents them from choosing the option.
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC;
|
||||
oPC = GetPCSpeaker();
|
||||
|
||||
int nCCXP;
|
||||
nCCXP = GetXP(oPC);
|
||||
|
||||
SetLocalInt(oPC, "pc_exact_xp", nCCXP);
|
||||
GetLocalInt(oPC, "pc_exact_xp");
|
||||
|
||||
int nLvl;
|
||||
nLvl = GetHitDice(oPC);
|
||||
|
||||
|
||||
int bXP;
|
||||
bXP = nLvl * 50;
|
||||
|
||||
int vXP;
|
||||
vXP = nCCXP - bXP;
|
||||
|
||||
int bGold;
|
||||
bGold = nLvl * 50;
|
||||
|
||||
int aGold;
|
||||
aGold = GetGold(oPC);
|
||||
|
||||
if(aGold >= bGold)
|
||||
{
|
||||
TakeGoldFromCreature(bGold, oPC);
|
||||
|
||||
SetXP(oPC, 0);
|
||||
SetXP(oPC, vXP);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
TakeGoldFromCreature(bGold, oPC);
|
||||
|
||||
string sMsg;
|
||||
sMsg = "You didn't have enough gold to relevel, so you lost gold anyway!";
|
||||
SendMessageToPC(oPC, sMsg);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user