Files
Anphillia_PRC8/_module/nss/anph_open_store.nss
Jaysyn904 28cdb617b3 Initial commit
Adding all of the current content for Anphillia Unlimited.
2024-01-04 07:49:38 -05:00

23 lines
825 B
Plaintext

#include "store_inc"
void main()
{
string sNPCTag = GetTag(OBJECT_SELF);
object oStore = GetNearestObjectByTag("STORE_" + sNPCTag);
if (oStore == OBJECT_INVALID)
oStore = GetNearestObjectByTag(GetLocalString(OBJECT_SELF, "STORE_TO_OPEN"));
if (GetObjectType(oStore) == OBJECT_TYPE_STORE)
{
WriteTimestampedLogEntry("STOREDBG: NPC " + sNPCTag + " in " + GetName(GetArea(OBJECT_SELF)) + " opening store " + GetTag(oStore) + " for " + GetName(GetPCSpeaker()));
store_Initialize(oStore);
OpenStore(oStore, GetPCSpeaker());
}
else
{
WriteTimestampedLogEntry("STOREDBG: store not found for NPC " +sNPCTag + " STORE_TO_OPEN:" + GetLocalString(OBJECT_SELF, "STORE_TO_OPEN"));
ActionSpeakString("Sorry, the store is closed", TALKVOLUME_TALK);
}
}