58 lines
1.6 KiB
Plaintext
Raw Permalink Normal View History

///Module Dying Script
//Bleeding at -1.0hp/6 sec
//Pad O'Lion
//2002 June 29
// This scrip is used in OnPlayerDying event in Module Properties. It
// is called if the players hit points drop to 0 to -9. It sets the
// PlayerState as dying and puts a death amulet on a player to prevent
// them from logging out and back in to get around death effects. (Note
// that players can get around this in Local Vault environments).
#include "rpo_inc"
void main()
{
object oPlayer=GetLastPlayerDying();
if (GetTag(GetArea(oPlayer))=="jw_pvp_area")
{
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDeath(),oPlayer);
return;
}
// Sets up Heartbeat tracking if anyone enters OnPlayerDying
object oModule = GetModule();
if(BLEEDSYSTEM)
SetLocalInt(oModule, "PWS_EverybodyAlive", FALSE);
int iCurrentHitPoints = GetCurrentHitPoints(oPlayer);
if (iCurrentHitPoints == 0 && BLEEDSYSTEM)
{
// They're just disabled
//SetLocalInt(oPlayer, "PlayerState", PWS_PLAYER_STATE_DISABLED);
// Even if disabled, let them bleed
SetLocalInt(oPlayer, "PlayerState", PWS_PLAYER_STATE_DYING);
}
else if(BLEEDSYSTEM)
{
// They're dying
SetLocalInt(oPlayer, "PlayerState", PWS_PLAYER_STATE_DYING);
}
if (GetLocalInt(oPlayer, "GRD_ATTACK"))
{
//PrintString("Player " + GetName(oPlayer) + " dying: Going to imprison to 'WP_GRD_PRISON'");
//Imprison(oPlayer, GetLastAttacker(oPlayer), "GuardPrison");
//SetLocalInt(oPlayer, "GRD_ATTACK", FALSE);
//SetLocalInt(oPlayer, "PC_IN_PRISON", TRUE);
}
else
CreateItemOnObject("deathamulet", oPlayer);
}