HoS_PRC8/_mod/_module/nss/npcact_scriptd.nss
Jaysyn904 e2f4ba74d5 Merged redundant hak files
Merged redundant hak files.  Moved hak scripts into module.  Updated gitignore.  Full Compile.  Added release folder & archive.
2024-12-12 15:02:17 -05:00

52 lines
2.1 KiB
Plaintext

////////////////////////////////////////////////////////////////
// NPC ACTIVITIES 5.0 - OnUserDefined Script
////////////////////////////////////////////////////////////////
// By Deva Bryson Winblood. 01/2003
// Renamed for NPC ACTIVITIES 6.0 09/08/2004
//==============================================================
// Required for SLIS, and GOSSIP commands
//==============================================================
// SCRIPT: npcact_scriptd
////////////////////////////////////////////////////////////////
// Do not assign this manually to an NPC it will be assigned by
// the CRSP functions of NPC ACTIVITIES if necessary
////////////////////////////////////////////////////////////////
#include "npcactstackh"
void main()
{
int nUserEvent=GetUserDefinedEventNumber();
int nLisNum;
string sPatternNPC=GetLocalString(OBJECT_SELF,"sGNBListen");
string sHeard;
string sWork;
int nRnd;
struct StackHeader stack;
//SendMessageToPC(GetFirstPC(),GetTag(OBJECT_SELF)+" UserDef called.");
if (nUserEvent==1004)
{ // gossip phrase was heard
nLisNum=GetListenPatternNumber();
if (nLisNum==112670)
{ // the gossip pattern
sHeard=GetMatchedSubstring(0);
//SendMessageToPC(GetFirstPC(),GetTag(OBJECT_SELF)+" HEARD:"+sHeard);
if (TestStringAgainstPattern(sPatternNPC,sHeard)==TRUE)
{ // gossip trigger was heard
sHeard=GetStringRight(sHeard,GetStringLength(sHeard)-(GetStringLength(sPatternNPC)-2));
stack=fnGetLocalStack("Gossip");
if(!fnAlreadyOnStack(stack,sHeard))
{ // it is something new
nRnd=d4();
if (nRnd==1) ActionSpeakString("I had not heard that.");
else if (nRnd==2) ActionSpeakString("That is interesting.");
else if (nRnd==3) ActionSpeakString("Really?");
else ActionSpeakString("That is quite extraordinary.");
stack = fnPushStack(stack,sHeard);
fnSetLocalStack(stack);
} // it is something new
} // gossip trigger was heard
} // the gossip pattern
} // gossip phrase was heard
}