Battledale_PRC8/_removed/nw_c2_default4.nss
Jaysyn904 7b9e44ebbb Initial upload
Initial upload.  PRC8 has been added.  Module compiles, PRC's default AI & treasure scripts have been integrated.  Started work on top hak for SLA / Ability / Scripting modifications.
2024-03-11 23:44:08 -04:00

90 lines
2.3 KiB
Plaintext

////////
#include "NW_I0_GENERIC"
void main()
{
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));
}
}