//Name: Conversation XP and GP taker by lvl
//
//What it does: Takes a certain amount of Gold and Experience based on the PC's
level.
//
//Notes: Just put this on the Actions Taken script for the piece of dialog you
want the PC to lose gold and experience to. Thanks to the people who //helped me
make my first script!
//
//Here is the script:
//:://////////////////// ///////////////////////////
//:: Title: Take exp and gold depending on lvl in conversation
//:: Created By: dohdohburd (with help)
//:: Created On: July 31, 2002
//:://////////////////// ///////////////////////////
void main()
{
object oPC = GetPCSpeaker();
int nXP = GetXP(oPC);
int nPenalty = 50 * GetHitDice(oPC);
int nHD = GetHitDice(oPC);
int nMin = ((nHD * (nHD - 1)) / 2) * 1000;
int nNewXP = nXP - nPenalty;
if (nNewXP < nMin)
nNewXP = nMin;
SetXP(oPC, nNewXP);
int nGoldToTake = FloatToInt(0.10 * GetGold(oPC));
if (nGoldToTake > 10000)
{
nGoldToTake = 10000;
}
AssignCommand(oPC, TakeGoldFromCreature(nGoldToTake, oPC, TRUE));
DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oPC, FALSE));
DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oPC, FALSE));
}