//////// #include "NW_I0_GENERIC" #include "jw_privates_inc" #include "prc_inc_spells" void main() { // * if petrified, jump out if (PRCGetHasEffect(EFFECT_TYPE_PETRIFY, OBJECT_SELF) == TRUE) { return; } // * If dead, exit directly. if (GetIsDead(OBJECT_SELF) == TRUE) { return; } ExecuteScript("prc_npc_conv", OBJECT_SELF); int nMatch = GetListenPatternNumber(); object oShouter = GetLastSpeaker(); object oIntruder; if (nMatch == -1 && GetCommandable(OBJECT_SELF)) { ClearAllActions(); BeginConversation(); } if ((nMatch==123)&&(GetIsObjectValid(oShouter))&&(GetObjectSeen(oShouter))&&(GetIsEnemy(oShouter))&&(d4()==1)) { SetVictim(oShouter); return; } if ((nMatch==123)&&(GetIsObjectValid(oShouter))&&(GetObjectSeen(oShouter))&&(GetIsFriend(oShouter))&&(!GetIsDead(oShouter))) { SetNeedsHealing(oShouter); return; } // Make it follow spellcasters if(nMatch != -1 && GetIsObjectValid(oShouter) && GetIsPC(oShouter) && GetIsEnemy(oShouter)) { SetTarget(oShouter); return; } if(nMatch != -1 && GetIsObjectValid(oShouter) && !GetIsPC(oShouter) && GetIsFriend(oShouter)) { if (nMatch == 5) { oIntruder = GetLastHostileActor(oShouter); if ((GetObjectSeen(oIntruder))&&(GetLevelByClass(CLASS_TYPE_COMMONER)>=1)) { TalentFlee(oIntruder); } else { if (!GetIsObjectValid(oIntruder)) { oIntruder=GetTarget(oShouter); if(!GetIsObjectValid(oIntruder)) { oIntruder = OBJECT_INVALID; } else { SetTarget(oIntruder); } } if ((!GetIsFighting(OBJECT_SELF))&&(GetIsObjectValid(oIntruder))) { if (GetObjectSeen(oIntruder)) { if (!GetPlotFlag(OBJECT_SELF)) { SetIsTemporaryEnemy(oIntruder, OBJECT_SELF,TRUE,180.0); } DetermineCombatRound(); } else { ActionMoveToObject(oIntruder,TRUE,3.0); } } } } } if(GetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT)) { SignalEvent(OBJECT_SELF, EventUserDefined(1004)); } }