Lankhmar_PRC8/_module/nss/ent_take_stuff.nss
Jaysyn904 ebc0c6a9b2 Initial commit
Initial commit [v9.7]
2025-04-03 12:54:47 -04:00

48 lines
1.2 KiB
Plaintext

void main()
{
int nCount;
object oTarget;
object oItem;
// Get the creature who triggered this event.
object oPC = GetEnteringObject();
// Only fire for (real) PCs.
if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) )
return;
// Only fire once.
if ( GetLocalInt(GetModule(), "DO_ONCE__" + GetTag(OBJECT_SELF)) )
return;
SetLocalInt(GetModule(), "DO_ONCE__" + GetTag(OBJECT_SELF), TRUE);
// Relieve the PC of its possessions.
oTarget = GetObjectByTag("start_chest");
oItem = GetFirstItemInInventory(oPC);
while ( oItem != OBJECT_INVALID )
{
AssignCommand(oTarget, ActionTakeItem(oItem, oPC));
oItem = GetNextItemInInventory(oPC);
}
// Relieve the PC of its equipment.
nCount = NUM_INVENTORY_SLOTS;
while ( nCount-- > 0 )
{
oItem = GetItemInSlot(nCount, oPC);
AssignCommand(oTarget, ActionTakeItem(oItem, oPC));
}
// Relieve the PC of its gold.
AssignCommand(oTarget, TakeGoldFromCreature(GetGold(oPC), oPC));
AssignCommand(oPC, TakeGoldFromCreature(GetGold(oPC), oPC, TRUE));
//AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_FRONT, 1.0f, 4.0f));
FadeFromBlack(oPC);
FadeFromBlack(oPC);
}