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

25 lines
963 B
Plaintext

// vamp_ck_dr2
int StartingConditional()
{
object oPC=GetPCSpeaker();
object oTarg=GetLocalObject(oPC,"oTarget");
int nXP=GetLocalInt(oPC,"nVampireXP");
int nLevel=1+(nXP/5000);
int nMinHP;
int nEffect;
effect eEffect;
nMinHP=nLevel*3;
eEffect=GetFirstEffect(oTarg);
while(GetEffectType(eEffect)!=EFFECT_TYPE_INVALIDEFFECT)
{ // check effect
nEffect=GetEffectType(eEffect);
if (nEffect==EFFECT_TYPE_DAZED||nEffect==EFFECT_TYPE_DOMINATED) return FALSE;
else if (nEffect==EFFECT_TYPE_PARALYZE||nEffect==EFFECT_TYPE_SLEEP) return FALSE;
else if (nEffect==EFFECT_TYPE_STUNNED||nEffect==EFFECT_TYPE_CHARMED) return FALSE;
eEffect=GetNextEffect(oTarg);
} // check effect
if (GetCurrentHitPoints(oTarg)<=nMinHP) return FALSE;
SendMessageToPC(oPC,"You can only feed on targets who are disabled by a spell or ability, or are at "+IntToString(nMinHP)+" hit points.");
return TRUE;
}