Lankhmar_PRC8/_module/nss/cnv_tk_all_invt.nss

77 lines
1.7 KiB
Plaintext
Raw Permalink Normal View History

2025-04-03 12:54:47 -04:00
#include "nw_i0_spells"
#include "x3_inc_horse"
void main()
{
object oHench;
int nHench;
int nCount;
object oTarget;
object oItem;
// Get the PC who is in this conversation.
object oPC = GetPCSpeaker();
while (GetIsObjectValid(GetMaster(oPC)))
{
oPC=GetMaster(oPC);
}
//object oHench = GetHenchman(oPC);
FadeToBlack(oPC);
FadeFromBlack(oPC);
// Relieve the PC of its possessions.
oTarget = GetObjectByTag("chstfdrwrsyrtimz");
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));
// Have the PC its henchman.
nHench = 1;
oHench = GetHenchman(oPC, 1);
while ( oHench != OBJECT_INVALID )
{
// RemoveHenchman(oPC, oHench);
// Update the loop.
oHench = GetHenchman(oPC, ++nHench);
// Relieve the Henchma of possessions.
oTarget = GetObjectByTag("chstfdrwrsyrtimz");
oItem = GetFirstItemInInventory(oHench);
while ( oItem != OBJECT_INVALID )
{
AssignCommand(oTarget, ActionTakeItem(oItem, oHench));
oItem = GetNextItemInInventory(oHench);
}
// Relieve the Hench of equipment.
nCount = NUM_INVENTORY_SLOTS;
while ( nCount-- > 0 )
{
oItem = GetItemInSlot(nCount, oPC);
AssignCommand(oTarget, ActionTakeItem(oItem, oHench));
}
}
}