Aschbourne_PRC8/_module/nss/_uoa_com_add.nss
GetOffMyYarn 7030eb2235 added things
added a crafting tool merchant,
added a training hall (not quite working yet)
fixed crafting issues,
exchanged the small cave area
2024-09-01 14:11:15 -04:00

47 lines
1.5 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.");
SendMessageToPC(oPC,"This will take 30 seconds.");
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;
AssignCommand(GetModule(),DelayCommand(30.0,SetLocalInt(oDeed,"iNumberStored",iTotal)));
DelayCommand(fDelay+30.5,SendMessageToPC(oPC,"Successfully added "+IntToString(iCounter)+" "+sItemName+" to the bundle."));
DelayCommand(fDelay+30.6,SendMessageToPC(oPC,"There are now a total of "+IntToString(iTotal)+" "+sItemName+" in this bundle."));
}