HoS_PRC8/_mod/_module/nss/pl_hb_secretd.nss

24 lines
877 B
Plaintext
Raw Permalink Normal View History

2024-11-25 19:36:07 -05:00
////////////////////////////////////////////////////////////////////////////////
// pl_hb_secretd - See if despawn
// By Deva B. Winblood. December 11th, 2008
////////////////////////////////////////////////////////////////////////////////
void main()
{
object oMe=OBJECT_SELF;
object oPC=GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,PLAYER_CHAR_IS_PC,oMe,1);
int bDestroy=FALSE;
int bDestroy2=FALSE;
object oDest=GetLocalObject(oMe,"oDest");
if (!GetIsObjectValid(oPC)) bDestroy=TRUE;
else if (GetDistanceBetween(oPC,oMe)>10.0) bDestroy=TRUE;
oPC=GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,PLAYER_CHAR_IS_PC,oDest,1);
if (!GetIsObjectValid(oPC)) bDestroy2=TRUE;
else if (GetDistanceBetween(oPC,oDest)>10.0) bDestroy2=TRUE;
if (bDestroy&&bDestroy2)
{ // destroy
DestroyObject(oMe);
DestroyObject(oDest);
} // destroy
}