//:://///////////////////////////////////////////// //:: NPCBusy //:: NW_C2_DEFAULT4 //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* Put this in the NPC's OnDialog event. The NPC will then check itself for a local int named "BUSY". If this equals 1 the NPC will not initiate dialog. An example of use is when you don't want a player to disturb an NPC performing an action. Before you assign the scripted actions to the NPC use ActionDoCommand(SetLocalInt(oNPC,"BUSY",1)); and when you want the NPC to start normal dialog again, use ActionDoCommand(SetLocalInt(oNPC,"BUSY",0)); */ //::////////////////////////////////////////////// //:: Created By: Preston Watamaniuk //:: Edited By: Siiverei //:: Created On: Oct 24, 2001 //::////////////////////////////////////////////// #include "NW_I0_GENERIC" void main() { int nMatch = GetListenPatternNumber(); object oShouter = GetLastSpeaker(); object oIntruder; if (nMatch == -1 && GetCommandable(OBJECT_SELF)) { if(GetLocalInt(OBJECT_SELF,"BUSY") != 1) { ClearAllActions(); BeginConversation(); } else SpeakString("I'm busy!"); } else if(nMatch != -1 && GetIsObjectValid(oShouter) && !GetIsPC(oShouter) && GetIsFriend(oShouter)) { if(nMatch == 4) { oIntruder = GetLocalObject(oShouter, "NW_BLOCKER_INTRUDER"); } else if (nMatch == 5) { oIntruder = GetLastHostileActor(oShouter); if(!GetIsObjectValid(oIntruder)) { oIntruder = GetAttemptedAttackTarget(); if(!GetIsObjectValid(oIntruder)) { oIntruder = GetAttemptedSpellTarget(); if(!GetIsObjectValid(oIntruder)) { oIntruder = OBJECT_INVALID; } } } } RespondToShout(oShouter, nMatch, oIntruder); } if(GetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT)) { SignalEvent(OBJECT_SELF, EventUserDefined(1004)); } }