#include "nw_i0_plot" // * Applies an XP and GP penalty // * to the player respawning void ApplyPenalty(object oDead) { int nXP = GetXP(oDead); int nPenalty = 50 * 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; SetXP(oDead, nNewXP); int nGoldToTake = FloatToInt(0.50 * GetGold(oDead)); // * a cap of 10 000gp taken from you if (nGoldToTake > 200000) { nGoldToTake = 200000; } AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE)); DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE)); DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE)); } #include "asg_i_dbplayer" void main() { object oRespawner = GetLastRespawnButtonPresser(); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner); RemoveEffects(oRespawner); effect e1 = EffectVisualEffect(VFX_FNF_PWKILL); effect e2 = EffectVisualEffect(VFX_FNF_DISPEL_DISJUNCTION); effect e3 = EffectVisualEffect(VFX_FNF_WORD); effect e4 = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1); effect e5 = EffectVisualEffect(VFX_FNF_SCREEN_SHAKE); string sDestTag = "trinity_respawn"; string sArea = GetTag(GetArea(oRespawner)); ApplyPenalty(oRespawner); object oSpawnPoint = GetWaypointByTag(sDestTag); AssignCommand(oRespawner,JumpToLocation(GetLocation(oSpawnPoint))); PlayerDatabase("W",oRespawner); SetCutsceneMode(oRespawner,TRUE); AssignCommand(oRespawner,ActionPlayAnimation(ANIMATION_LOOPING_DEAD_FRONT,1.0,16.0)); DelayCommand(12.0,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,e1,GetLocation( oRespawner))); DelayCommand(13.0,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,e2,GetLocation( oRespawner))); DelayCommand(14.0,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,e3,GetLocation( oRespawner))); DelayCommand(15.0,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,e4,GetLocation( oRespawner))); DelayCommand(16.0,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,e5,GetLocation( oRespawner))); DelayCommand(18.0,SetCutsceneMode(oRespawner,FALSE)); }