//::////////////////////////////////////////////// //:: Name: OnPlayerRespawn //:: FileName: js_onplayerspawn //::////////////////////////////////////////////// /* Very simple, it heals the PC and sets an int back to call the PC alive */ //::////////////////////////////////////////////// //:: Created By: SPBTooL //:: Created By: Jer Wolfe //:: Created On: Aug 04, 2002 //::////////////////////////////////////////////// #include "js_include" void main() { object oPC = GetLastRespawnButtonPresser(); int iDamageToHeal = (GetMaxHitPoints(oPC) / 2); object oSpawnPoint = GetWaypointByTag("NW_DEATH_TEMPLE"); AssignCommand(oPC,JumpToLocation(GetLocation(oSpawnPoint))); // Heal and remove bad effects ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPC); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(iDamageToHeal), oPC); RemoveBadEffects(oPC); // Set the int to mark the PC alive SetLocalInt(oPC, "PCHealth", PC_HEALTH_ALIVE); }