#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.35 * 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)); } void main() { // WriteTimestampedLogEntry("Entering Module onPlayerRespawn: xx_cb_respawn"); object oRespawner = GetLastRespawnButtonPresser(); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner); RemoveEffects(oRespawner); string sDestTag = "trinity_respawn"; ApplyPenalty(oRespawner); object oSpawnPoint = GetWaypointByTag(sDestTag); AssignCommand(oRespawner,JumpToLocation(GetLocation(oSpawnPoint))); SetLocalInt(oRespawner,"BypassLocation",1); SetCampaignLocation("PlayerData","Location",GetLocation(oSpawnPoint),oRespawner); // WriteTimestampedLogEntry("Exiting Module onPlayerRespawn: xx_cb_respawn"); object oRespawner2 = GetLastRespawnButtonPresser(); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner); RemoveEffects(oRespawner2); string sArea = GetTag(GetArea(oRespawner2)); if (sArea == "EVILARENA" || sArea == "GOODARENA") { sDestTag = "wp_pvp_respawn"; } AssignCommand(oRespawner,JumpToLocation(GetLocation(oSpawnPoint))); }