/* This script is to be used along with the losw_1liner_dlg in order to simplify commoner NPC interaction. Using the local variables defined on the set NPC, that NPC will speak one line of text. If Shop(int) = 1 then that NPC will open the store's tag that is assigned to Shop1(string). It's a pretty self explanitory system. Just read the comments on the two included NPC's (in Custom 1) and goto town! */ // // losw_1convo.nss // /* Created By : SoulFlame (SoulFlame555@hotmail.com) Date Created : Dec 30, 2003 */ #include "nw_i0_plot" #include "lod_include" // Custom Token integer defined locally. Was in losw_tokens, but removed // to upload for common usage. const int CT_ONELINER = 58000; int StartingConditional() { // Custom Token is set for the conversation to "speak" based on a // string local variable "1Liner" SetCustomToken(CT_ONELINER, GetLocalString(OBJECT_SELF, "1Liner")); // If the local integer "Shop" = 1 then the store tag of "Shop1" // will be loaded. If Appraise is set to 1, then the merchant // will use the new Appraise checks for favorability. if (GetLocalInt(OBJECT_SELF, "Shop") ==1) { string sStore = GetLocalString(OBJECT_SELF, "Shop1"); int iAppraise = GetLocalInt(OBJECT_SELF, "Appraise"); if (iAppraise == TRUE) gplotAppraiseOpenStore(GetNearestObjectByTag(sStore), GetPCSpeaker()); else OpenStore(GetNearestObjectByTag(sStore), GetPCSpeaker()); } // Setup to give out a item, whose tag is equal to the local string "item_2_give // if the string returns empty, nothing happens. If the NPC has that item in // their inventory, nothing happens. if (GetLocalString(OBJECT_SELF, "item_2_give") != "") { GivePCItem(GetPCSpeaker(), GetLocalString(OBJECT_SELF, "item_2_give")); } return TRUE; }