Amon_PRC8/_module/nss/js_onplayerspawn.nss
Jaysyn904 c5cffc37af Initial Commit
Initial Commit [v1.01]
2025-04-03 19:00:46 -04:00

32 lines
1004 B
Plaintext

//:://////////////////////////////////////////////
//:: 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);
}