HoS_PRC8/_mod/_module/nss/vamp_it_coffin.nss

26 lines
950 B
Plaintext
Raw Permalink Normal View History

2024-11-25 19:36:07 -05:00
void main()
{
object oPC=GetItemActivator();
object oItem=GetItemActivated();
location lLoc=GetItemActivatedTargetLocation();
object oCoffin;
oCoffin=CreateObject(OBJECT_TYPE_PLACEABLE,"vampirecoffin",lLoc);
if (GetIsObjectValid(oCoffin)&&!GetIsObjectValid(GetLocalObject(oItem,"oOwner")))
{ // placed
SetLocalObject(oPC,"oCoffin",oCoffin);
SetLocalObject(oCoffin,"oVampire",oPC);
SetLocalInt(oPC,"nCoffinPlaced",TRUE);
DestroyObject(oItem);
SetName(oCoffin,GetName(oPC)+"'s Coffin");
} // placed
else if (GetIsObjectValid(oCoffin))
{ // place someone elses coffin
oPC=GetLocalObject(oItem,"oOwner");
SetLocalObject(oPC,"oCoffin",oCoffin);
SetLocalObject(oCoffin,"oVampire",oPC);
SetLocalInt(oPC,"nCoffinPlaced",TRUE);
DestroyObject(oItem);
SetName(oCoffin,GetName(oPC)+"'s Coffin");
} // place someone elses coffin
}