Aschbourne_PRC8/_module/nss/vamp_coffin.nss
GetOffMyYarn 69879d6957 Areas and Fixes
Added CCOH and missing areas
Changed some areas to be craftable,
Fixed some on death issues,
Fixed the Gaurd
2024-08-30 11:38:44 -04:00

62 lines
2.6 KiB
Plaintext

// Script to Pick up coffin
// main script code
void main()
{
// Who is picking it up
object oPC = GetLastUsedBy();
PrintString("vamp_coffin: called by "+GetName(oPC));
// If vampire
if (GetSubRace(oPC) == "Vampire")
{
// Get tag or coffin and cd-key of vampire
string sCoffin = GetTag(OBJECT_SELF);
string sname = GetPCPublicCDKey(oPC);
PrintString("vamp_coffin: I am looking for TAG[" + sCoffin + "] NAME["+sname+"]");
// If tag and key match
if (sname == sCoffin)
{
PrintString("vamp_coffin: TAG[" + sCoffin + "] and NAME["+sname+"] match! Picking up coffin.");
// Put token to inventory and destroy coffin
SendMessageToPC(oPC,"You pick up your coffin. If you die with it in your possession, you will be permanently dead, however, don't leave your coffin alone [log off] or it could be destroyed.");
CreateItemOnObject("vampirecoffintok", GetLastUsedBy(), 1);
DestroyObject(OBJECT_SELF, 0.1f);
// We need to keep track of the fact that the Vampire has their
// coffin so we can tell whether or not to give them a new
// on when they log in again.
PrintString("vamp_coffin: Coffin in Inventory was ["+IntToString(GetLocalInt(oPC,"iCoffinInInventory"))+"].");
SetLocalInt(oPC,"iCoffinInInventory",TRUE);
PrintString("vamp_coffin: Coffin in Inventory is now ["+IntToString(GetLocalInt(oPC,"iCoffinInInventory"))+"].");
//vamp_coffin_returnToSelf(oPC); // handled on rest now
}
//If sname is "" ---> Player is playing single player. Pick up coffin
else if (sname == "")
{
// Put token to inventory and destroy coffin
SendMessageToPC(oPC,"You pick up your coffin.");
CreateItemOnObject("vampirecoffintok", GetLastUsedBy(), 1);
DestroyObject(OBJECT_SELF, 0.1f);
PrintString("vamp_coffin: Coffin in Inventory was ["+IntToString(GetLocalInt(oPC,"CoffinInInventory"))+"].");
SetLocalInt(oPC,"CoffinInInventory",TRUE);
PrintString("vamp_coffin: Coffin in Inventory is now ["+IntToString(GetLocalInt(oPC,"CoffinInInventory"))+"].");
//vamp_coffin_returnToSelf(oPC); // handled on rest now
}
else
{
PrintString("vamp_coffin: TAG[" + sCoffin + "] and NAME["+sname+"] do NOT match.");
SendMessageToPC(oPC,"This is not your coffin, you cannot pick it up.");
}
}
else
{
SendMessageToPC(oPC,"You can not use this... you are not a Vampire.");
}
}