void ApplyPenalty(object oDead, int nPenalty) { int nGoldToTake; int nXP = GetXP(oDead); int nPenalty = nPenalty * GetHitDice(oDead); int nHD = GetHitDice(oDead); // * You can not lose a level with this respawning int nMin = ((nHD * (nHD - 1)) / 2) * 1000; int nNewXP = nXP - nPenalty; if (nNewXP < nMin) { nNewXP = nMin; } if (nHD==1) { nNewXP = (nXP-10); } if (nNewXP < (nXP/10*9)) { nNewXP = (nXP/10*9); } if (nNewXP < 1) { nNewXP = 1; } SetXP(oDead, nNewXP); if (nHD>3) { nGoldToTake = FloatToInt(0.10 * GetGold(oDead)); } else { nGoldToTake = FloatToInt(0.05 * GetGold(oDead)); } // * a cap of 10 000gp taken from you if (nGoldToTake > 10000) { nGoldToTake = 10000; } //AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE)); //DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE)); //DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE)); }