From cd37d1e9824b3962899bc3d864f3747e34c1fe5d Mon Sep 17 00:00:00 2001 From: IrishDarkshadow Date: Fri, 11 Oct 2019 17:22:28 -0700 Subject: [PATCH] allows NPC vendors to exceed 70 to 75 item limit --- .../game/script/library/static_item.java | 24 ++++++++++++++----- .../game/script/npc/vendor/vendor.java | 2 +- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/sku.0/sys.server/compiled/game/script/library/static_item.java b/sku.0/sys.server/compiled/game/script/library/static_item.java index d3efec29b..2c8a39933 100755 --- a/sku.0/sys.server/compiled/game/script/library/static_item.java +++ b/sku.0/sys.server/compiled/game/script/library/static_item.java @@ -34,17 +34,21 @@ public class static_item extends script.base_script public static final String SET_BONUS_TABLE = "datatables/item/item_sets.iff"; public static obj_id createNewItemFunction(String itemName, obj_id container) throws InterruptedException { - return createNewItemFunction(itemName, container, null, 0); + return createNewItemFunction(itemName, container, null, 0, false); } - public static obj_id createNewItemFunction(String itemName, obj_id container, int charges) throws InterruptedException + public static obj_id createNewItemFunction(String itemName, obj_id container, boolean overloaded) throws InterruptedException { - return createNewItemFunction(itemName, container, null, charges); + return createNewItemFunction(itemName, container, null, 0, overloaded); } public static obj_id createNewItemFunction(String itemName, obj_id container, location pos) throws InterruptedException { - return createNewItemFunction(itemName, container, pos, 0); + return createNewItemFunction(itemName, container, pos, 0, false); } public static obj_id createNewItemFunction(String itemName, obj_id container, location pos, int charges) throws InterruptedException + { + return createNewItemFunction(itemName, container, pos, charges, false); + } + public static obj_id createNewItemFunction(String itemName, obj_id container, location pos, int charges, boolean overloaded) throws InterruptedException { if (itemName == null || itemName.equals("")) { @@ -91,7 +95,7 @@ public class static_item extends script.base_script newItem = createObject(itemData.getString("template_name"), pos); } } - else +else { if (utils.isNestedWithinAPlayer(container)) { @@ -99,9 +103,17 @@ public class static_item extends script.base_script } else { - newItem = createObject(itemData.getString("template_name"), container, ""); + if(overloaded) + { + newItem = createObjectOverloaded(itemData.getString("template_name"), container); + } + else + { + newItem = createObject(itemData.getString("template_name"), container, ""); + } } } + if (!isIdValid(newItem)) { LOG("loot", itemName + " could not be made because item is not valid"); diff --git a/sku.0/sys.server/compiled/game/script/npc/vendor/vendor.java b/sku.0/sys.server/compiled/game/script/npc/vendor/vendor.java index 35c6dc3b6..bd7eb94e8 100755 --- a/sku.0/sys.server/compiled/game/script/npc/vendor/vendor.java +++ b/sku.0/sys.server/compiled/game/script/npc/vendor/vendor.java @@ -88,7 +88,7 @@ public class vendor extends script.base_script obj_id objectForSale = obj_id.NULL_ID; if (static_item.isStaticItem(item)) { - objectForSale = static_item.createNewItemFunction(item, containerList[idx]); + objectForSale = static_item.createNewItemFunction(item, containerList[idx], true); } else {