//::////////////////////////////////////////////////// //:: NW_C2_DEFAULT4 /* Default OnConversation event handler for NPCs. */ //::////////////////////////////////////////////////// //:: Copyright (c) 2002 Floodgate Entertainment //:: Created By: Naomi Novik //:: Created On: 12/22/2002 //::////////////////////////////////////////////////// //:: Editied By: Thomas Howlett //:: Editied On: June 20, 2005 //::////////////////////////////////////////////////// #include "nw_i0_generic" void main() { // * if petrified, jump out if (GetHasEffect(EFFECT_TYPE_PETRIFY, OBJECT_SELF) == TRUE) { return; } // * If dead, exit directly. if (GetIsDead(OBJECT_SELF) == TRUE) { return; } // See if what we just 'heard' matches any of our // predefined patterns int nMatch = GetListenPatternNumber(); object oShouter = GetLastSpeaker(); if (nMatch == -1) { // Not a match -- start an ordinary conversation if (GetCommandable(OBJECT_SELF)) { ClearActions(CLEAR_NW_C2_DEFAULT4_29); //----------------------------------Edit--------------------------------------// //If the object the pc is talking to is a ox or chicken or cow or the banker if(GetResRef(OBJECT_SELF)=="ox" || GetResRef(OBJECT_SELF)=="chicken" || GetResRef(OBJECT_SELF)=="bank" || GetResRef(OBJECT_SELF)=="cow") //Starting a privite converstation AssignCommand(OBJECT_SELF, ActionStartConversation(oShouter, "", TRUE, FALSE)); else BeginConversation(); //--------------------------------End Edit------------------------------------// } else // * July 31 2004 // * If only charmed then allow conversation // * so you can have a better chance of convincing // * people of lowering prices if (GetHasEffect(EFFECT_TYPE_CHARMED) == TRUE) { ClearActions(CLEAR_NW_C2_DEFAULT4_29); BeginConversation(); } } // Respond to shouts from friendly non-PCs only else if (GetIsObjectValid(oShouter) && !GetIsPC(oShouter) && GetIsFriend(oShouter)) { object oIntruder = OBJECT_INVALID; // Determine the intruder if any 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; } } } } // Actually respond to the shout RespondToShout(oShouter, nMatch, oIntruder); } // Send the user-defined event if appropriate if(GetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT)) { SignalEvent(OBJECT_SELF, EventUserDefined(EVENT_DIALOGUE)); } }
//:://///////////////////////////////////////////// //:: Associate: On Dialogue //:: NW_CH_AC4 //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* Determines the course of action to be taken by the generic script after dialogue or a shout is initiated. */ //::////////////////////////////////////////////// //:: Created By: Preston Watamaniuk //:: Created On: Oct 24, 2001 //::////////////////////////////////////////////////// //:: Editied By: Thomas Howlett //:: Editied On: June 20, 2005 //::////////////////////////////////////////////////// #include "x0_inc_henai" // * This function checks to make sure no // * dehibilating effects are on the player that should // * Don't use getcommandable for this since the dying system // * will sometimes leave a player in a noncommandable state int AbleToTalk(object oSelf) { if (GetCommandable(oSelf) == FALSE) { if (GetHasEffect(EFFECT_TYPE_CONFUSED, oSelf) || GetHasEffect(EFFECT_TYPE_DOMINATED, oSelf) || GetHasEffect(EFFECT_TYPE_PETRIFY, oSelf) || GetHasEffect(EFFECT_TYPE_PARALYZE, oSelf) || GetHasEffect(EFFECT_TYPE_STUNNED, oSelf) || GetHasEffect(EFFECT_TYPE_FRIGHTENED, oSelf) ) { return FALSE; } } return TRUE; } void main() { object oMaster = GetMaster(); int nMatch = GetListenPatternNumber(); object oShouter = GetLastSpeaker(); object oIntruder; if (nMatch == -1) { if(AbleToTalk(OBJECT_SELF) || GetCurrentAction() != ACTION_OPENLOCK) { ClearActions(CLEAR_NW_CH_AC4_28); // * if in XP2, use an alternative dialog file string sDialog = ""; if (GetLocalInt(GetModule(), "X2_L_XP2") == 1) { sDialog = "x2_associate"; } //----------------------------------Edit--------------------------------------// // BeginConversation(sDialog);
Zen - 6/20/2005 11:03 PMAs to the question #2 thats what the trash cans are for right?