PRC8_fork/nwn/trunk/scripts/xchst_onused.nss
Jaysyn904 5914ed2ab5 Updated Release Archive
Updated Release Archive.  Fixed Mage-killer prereqs.  Removed old LETO & ConvoCC related files.  Added organized spell scroll store.  Fixed Gloura spellbook. Various TLK fixes.  Reorganized Repo.  Removed invalid user folders. Added DocGen back in.
2023-08-22 10:00:21 -04:00

30 lines
679 B
Plaintext

#include "inc_debug"
#include "xchst_inc"
void main()
{
object oPC = GetLastUsedBy();
if(!GetIsPC(oPC))
return;
object oChest = GetLocalObject(OBJECT_SELF, XCHST_CONT);
//only owner(caster) can open the chest
if(oPC != GetLocalObject(oChest, XCHST_OWN))
return;
ClearAllActions();
PlayAnimation(ANIMATION_PLACEABLE_OPEN);
if(GetMaster(oChest) != oPC)
{
//add as henchmen and open inventory
int i = GetMaxHenchmen();
SetMaxHenchmen(99);
AddHenchman(oPC, oChest);
SetMaxHenchmen(i);
}
DelayCommand(1.0f, OpenInventory(oChest, oPC));
AddChatEventHook(oPC, "xchst_chat");
}