Initial upload
Initial upload. PRC8 has been added. Module compiles, PRC's default AI & treasure scripts have been integrated. Started work on top hak for SLA / Ability / Scripting modifications.
This commit is contained in:
60
_module/nss/jw_xp_penalty.nss
Normal file
60
_module/nss/jw_xp_penalty.nss
Normal file
@@ -0,0 +1,60 @@
|
||||
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));
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user