Aschbourne_PRC8/_module/nss/_uoa_com_add.nss
GetOffMyYarn 7f75e229f9 Adds and Changes
Added missing crafting maps, removed unnecessary maps, changed a few miscellaneous things.
2024-09-14 13:52:39 -04:00

47 lines
1.4 KiB
Plaintext

#include "nw_i0_plot"
void main()
{
object oPC = GetPCSpeaker();
object oDeed = GetLocalObject(oPC,"oDeed");
DeleteLocalObject(oPC,"oDeed");
string sItemTag = GetLocalString(oDeed,"sItemTag");
string sItemResRef = GetLocalString(oDeed,"sItemResRef");
string sItemName = GetLocalString(oDeed,"sItemName");
int iTotal = GetLocalInt(oDeed,"iNumberStored");
int iTemp = GetNumItems(oPC,sItemTag);
SendMessageToPC(oPC,"Attempting to add "+IntToString(iTemp)+" "+sItemName+" to this bundle.");
object oGone = GetFirstItemInInventory(oPC);
float fDelay = 2.0;
int iCounter;
if (oGone!=OBJECT_INVALID)
{
while (oGone!=OBJECT_INVALID)
{
if (GetTag(oGone)==sItemTag)
{
if (GetLocalInt(oGone,"iAmCounted")==0)
{
SetLocalInt(oGone,"iAmCounted",99);
iCounter=iCounter+GetNumStackedItems(oGone);
DestroyObject(oGone,fDelay);
fDelay=fDelay+0.2;
}
}
oGone = GetNextItemInInventory(oPC);
if (oGone==OBJECT_INVALID) break;
}
}
iTotal = iTotal+iCounter;
SetLocalInt(oDeed,"iNumberStored",iTotal);
DelayCommand(fDelay+0.5,SendMessageToPC(oPC,"Successfully added "+IntToString(iCounter)+" "+sItemName+" to the bundle."));
DelayCommand(fDelay+0.6,SendMessageToPC(oPC,"There are now a total of "+IntToString(iTotal)+" "+sItemName+" in this bundle."));
}