60 lines
1.8 KiB
Plaintext
60 lines
1.8 KiB
Plaintext
|
//::///////////////////////////////////////////////
|
||
|
//:: Name x2_def_heartbeat
|
||
|
//:: Copyright (c) 2001 Bioware Corp.
|
||
|
//:://////////////////////////////////////////////
|
||
|
/*
|
||
|
Default Heartbeat script
|
||
|
*/
|
||
|
//:://////////////////////////////////////////////
|
||
|
//:: Created By: Keith Warner
|
||
|
//:: Created On: June 11/03
|
||
|
//:://////////////////////////////////////////////
|
||
|
|
||
|
#include "nw_i0_plot"
|
||
|
#include "x4_inc_functions"
|
||
|
void main()
|
||
|
{
|
||
|
//Wa want an NPC who wanted to talk to a PC to keep on trying (in case he stops for some reason)
|
||
|
if (GetLocalInt(OBJECT_SELF, "NeedToTalk") == TRUE)
|
||
|
{
|
||
|
object oPerceived = GetFirstObjectInArea();
|
||
|
object oTalk;
|
||
|
while (GetIsObjectValid(oPerceived))
|
||
|
{
|
||
|
if (GetLocalString(OBJECT_SELF, "sOwner") == CharacterDB(oPerceived))
|
||
|
{
|
||
|
oTalk = oPerceived;
|
||
|
break;
|
||
|
}
|
||
|
oPerceived = GetNextObjectInArea();
|
||
|
}
|
||
|
ActionStartConversation(oTalk, "", FALSE, FALSE);
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
|
||
|
//We want an NPC running away to keep on doing this (in case he stops for some reason)
|
||
|
if (GetLocalInt(OBJECT_SELF, "Running") == TRUE)
|
||
|
{
|
||
|
ClearAllActions(TRUE);
|
||
|
EscapeArea();
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
//We treat the NPC as dead if petrified
|
||
|
effect eEffect = GetFirstEffect(OBJECT_SELF);
|
||
|
while (GetIsEffectValid(eEffect) && GetLocalInt(OBJECT_SELF, "Dead") == FALSE)
|
||
|
{
|
||
|
if (GetEffectType(eEffect) == EFFECT_TYPE_PETRIFY)
|
||
|
{
|
||
|
SetLocalInt(OBJECT_SELF, "Dead", TRUE);
|
||
|
ExecuteScript("adv_ondeath", OBJECT_SELF);
|
||
|
return;
|
||
|
}
|
||
|
eEffect = GetNextEffect(OBJECT_SELF);
|
||
|
}
|
||
|
|
||
|
if(GetLocalInt(OBJECT_SELF, "X4_VANILLA_AI") == TRUE) ExecuteScript("nw_c2_default1_v", OBJECT_SELF);
|
||
|
else ExecuteScript("nw_c2_default1", OBJECT_SELF);
|
||
|
}
|