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

23 lines
693 B
Plaintext

// whs2_oper_evil - OnPerception check for evil - hostile towards Good PCs and NPCs
// Deva Winblood
#include "NW_I0_GENERIC"
void main()
{
object oPercep=GetLastPerceived();
int bSeen=GetLastPerceptionSeen();
int bHeard=GetLastPerceptionHeard();
int bVanished=GetLastPerceptionVanished();
int nAGE=GetAlignmentGoodEvil(oPercep);
if (GetIsObjectValid(oPercep)&&bSeen&&nAGE==ALIGNMENT_GOOD&&!GetIsInCombat(OBJECT_SELF))
{ // enemy
SetIsTemporaryEnemy(oPercep,OBJECT_SELF);
DetermineCombatRound();
} // enemy
else if (GetIsObjectValid(oPercep)&&GetIsEnemy(oPercep)&&!GetIsInCombat(OBJECT_SELF))
{ // engage
DetermineCombatRound();
} // engage
}