HoS_PRC8/_mod/_module/nss/vamp_coffin_use.nss
Jaysyn904 04165202c0 Initial upload
Initial upload
2024-11-25 19:36:07 -05:00

31 lines
843 B
Plaintext

// vamp_coffin_use
void main()
{
object oMe=OBJECT_SELF;
object oVampire=GetLocalObject(oMe,"oVampire");
object oPC=GetLastUsedBy();
int nCHP;
int nMHP;
int nDif;
effect eEffect;
if (oVampire==oPC)
{
SendMessageToPC(oPC,"The healing powers of your coffin flow through you.");
nCHP=GetCurrentHitPoints(oPC);
nMHP=GetMaxHitPoints(oPC);
nDif=nMHP-nCHP;
if (nDif>0)
{ // heal
eEffect=EffectHeal(nDif);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eEffect,oPC,1.0);
} // heal
}
else
{
SendMessageToPC(oPC,"This coffin is cold to the touch and feels evil. It would be best if it were destroyed.");
}
AssignCommand(oPC,ClearAllActions());
SetLocalObject(oPC,"oTarget",oMe);
AssignCommand(oPC,ActionStartConversation(oPC,"coffin_move",TRUE,FALSE));
}