Areas and Fixes
Added CCOH and missing areas Changed some areas to be craftable, Fixed some on death issues, Fixed the Gaurd
This commit is contained in:
50
_module/nss/per_safe_item_st.nss
Normal file
50
_module/nss/per_safe_item_st.nss
Normal file
@@ -0,0 +1,50 @@
|
||||
//ScarFace's Persistent Baking system -OnClose-
|
||||
void main()
|
||||
{
|
||||
ActionLockObject(OBJECT_SELF);
|
||||
object oPC = GetLastUsedBy();
|
||||
string sKey = GetPCPublicCDKey(oPC);
|
||||
object oItem = GetFirstItemInInventory(OBJECT_SELF);
|
||||
int iCount = 1;
|
||||
|
||||
while (GetIsObjectValid(oItem))
|
||||
{
|
||||
oItem = GetNextItemInInventory(OBJECT_SELF);
|
||||
iCount++;
|
||||
}
|
||||
|
||||
if (iCount >=101)
|
||||
{
|
||||
FloatingTextStringOnCreature("**WARNING** You can't store more than 100 items. You have "+IntToString(iCount)+" items in the chest. No items were saved. Please remove some items", oPC);
|
||||
ActionUnlockObject(OBJECT_SELF);
|
||||
return;
|
||||
}
|
||||
|
||||
iCount = 1;
|
||||
oItem = GetFirstItemInInventory(OBJECT_SELF);
|
||||
|
||||
if (!GetIsObjectValid(oItem))
|
||||
{
|
||||
iCount = 0;
|
||||
}
|
||||
|
||||
string sCount;
|
||||
|
||||
while (GetIsObjectValid(oItem))
|
||||
{
|
||||
sCount = IntToString(iCount);
|
||||
StoreCampaignObject("STORAGE", sKey+sCount, oItem, oPC);
|
||||
DestroyObject(oItem);
|
||||
oItem = GetNextItemInInventory(OBJECT_SELF);
|
||||
iCount++;
|
||||
}
|
||||
|
||||
if (iCount == 0)
|
||||
{
|
||||
FloatingTextStringOnCreature("Chest empty, No items saved", oPC);
|
||||
ActionUnlockObject(OBJECT_SELF);
|
||||
return;
|
||||
}
|
||||
FloatingTextStringOnCreature("Items successfully saved", oPC);
|
||||
ActionUnlockObject(OBJECT_SELF);
|
||||
}
|
Reference in New Issue
Block a user