24 lines
877 B
Plaintext
24 lines
877 B
Plaintext
|
////////////////////////////////////////////////////////////////////////////////
|
||
|
// 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
|
||
|
}
|