1) Modified OnSpawn Global Code
2) I don't know if other people have this problem, but in my module, when
ever someone died, they didn't loose the XP or Gold, like the GUI Said. I
Re-created the script so that it works in multiplayer. If you want it to
actually work.
3) Put this script into the "on player respawn" global script (module
properties, then goto scripts) Now when a player dies, they respawn like
normal, (wherever they died at) and it takes the 50 exp per level, and 10%
gold.
4) ---GRRR on the "Too Many Words W/O Spaces!"
NWScript:
#include "nw_i0_plot"
void main()
{
object oDead = GetLastRespawnButtonPresser();
int nXP = GetXP(oDead);
int nPenalty = 50 * GetHitDice(oDead);
int nHD = GetHitDice(oDead);
int nMin = ((nHD * (nHD - 1)) / 2) * 1000;
int nNewXP = nXP - nPenalty;
if (nNewXP < nMin)
nNewXP = nMin;
SetXP(oDead, nNewXP);
int nGoldToTake = FloatToInt(0.10 * GetGold(oDead));
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));
ApplyEffectToObject (DURATION_TYPE_INSTANT, EffectResurrection() ,oDead);
ApplyEffectToObject (DURATION_TYPE_INSTANT, EffectHeal (GetMaxHitPoints(oDead)) , oDead);
RemoveEffects (oDead);
}
|