From 476b705432c8b43d3a39a48fc6e6ca200cc6aba9 Mon Sep 17 00:00:00 2001 From: Geit Date: Mon, 21 Sep 2020 14:32:16 -0400 Subject: [PATCH 1/8] GU 16.9 - No Trade Removable --- .../no_trade/no_trade_removable.tab | 75 +++++++++++++++++++ .../item/special/no_trade_removable.java | 46 ++++++++++++ 2 files changed, 121 insertions(+) create mode 100755 sku.0/sys.server/compiled/game/datatables/no_trade/no_trade_removable.tab create mode 100644 sku.0/sys.server/compiled/game/script/item/special/no_trade_removable.java diff --git a/sku.0/sys.server/compiled/game/datatables/no_trade/no_trade_removable.tab b/sku.0/sys.server/compiled/game/datatables/no_trade/no_trade_removable.tab new file mode 100755 index 000000000..7c5c95f54 --- /dev/null +++ b/sku.0/sys.server/compiled/game/datatables/no_trade/no_trade_removable.tab @@ -0,0 +1,75 @@ +Object Template Comment +s c +item_pgc_planet_hologram_dantooine +item_pgc_planet_hologram_dathomir +item_pgc_planet_hologram_endor +item_pgc_planet_hologram_lok +item_pgc_planet_hologram_naboo +item_pgc_planet_hologram_rori +item_pgc_planet_hologram_talus +item_pgc_planet_hologram_tatooine +item_pgc_planet_hologram_yavin4 +item_pgc_planet_hologram_corellia_02 +item_pgc_planet_hologram_dantooine_02 +item_pgc_planet_hologram_dathomir_02 +item_pgc_planet_hologram_endor_02 +item_pgc_planet_hologram_lok_02 +item_pgc_planet_hologram_naboo_02 +item_pgc_planet_hologram_rori_02 +item_pgc_planet_hologram_talus_02 +item_pgc_planet_hologram_tatooine_02 +item_pgc_planet_hologram_yavin4_02 +item_deed_landspeeder_usv5_s02 +item_deed_podracer_anakin +item_pgc_chronicle_master_robe +item_pgc_chronicle_master_sign +item_pgc_chronicle_master_sign_02 +item_pgc_chronicle_master_statuette +item_pgc_monitorscreen +item_pgc_monitorscreen_sm +item_pgc_glass_pane_01 +item_pgc_glass_pane_02 +item_pgc_jabba_chandelier +item_pgc_jabba_drapes +item_pgc_jabba_fancyrug +item_pgc_jabba_gargoyle +item_pgc_jabba_generator +item_pgc_jabba_table +item_pgc_jabba_tassels +item_pgc_jabba_windchime +item_pgc_decal_pgc_s01 +item_pgc_decal_pgc_s02 +item_pgc_decal_pgc_s03 +item_pgc_decal_pgc_s04 +item_pgc_decal_pgc_s05 +item_pgc_decal_pgc_s06 +item_pgc_booster_pack +item_pgc_booster_pack_goto +item_pgc_booster_pack_comm +item_pgc_starter_kit +item_pgc_fireplace +item_pgc_starship_storage_device_01 +item_pgc_sandcrawler_house_deed +item_pgc_chronicler_tent_deed +item_costume_chiss_01 +item_costume_exar_kun_cultist +item_npe_sparky_droid_02_01 +col_reward_buddy_painting_01 +col_reward_buddy_painting_02 +col_reward_buddy_painting_03 +item_tow_schematic_saber_03_01 +item_tow_schematic_saber_03_02 +weapon_smuggler_reward_pistol_04_01 +weapon_smuggler_reward_pistol_dl44_04_01 +weapon_content_pistol_commando_pistol_03_01 +weapon_content_heavy_commando_03_01 +item_tow_schematic_vehicle_02_02 +item_deed_light_bend_barc_06_01 +item_publish_gift_27_04_01 +item_tow_cystal_buff_drained_05_01 +item_tow_schematic_psg_05_01 +item_content_binocs_detection_03_02 +item_content_click_health_02_01 +item_tow_schematic_jedi_statue_02_01 +heroic_minder_creature_knowledge_gloves_02_01 +item_outbreak_cornburr_brain diff --git a/sku.0/sys.server/compiled/game/script/item/special/no_trade_removable.java b/sku.0/sys.server/compiled/game/script/item/special/no_trade_removable.java new file mode 100644 index 000000000..e1ea81edb --- /dev/null +++ b/sku.0/sys.server/compiled/game/script/item/special/no_trade_removable.java @@ -0,0 +1,46 @@ +package script.item.special; + +import script.obj_id; +import script.string_id; +import script.menu_info; +import script.menu_info_types; + +/** + * Allows items that previously had the "noTrade" flag to be made tradeable by + * their original owner. + * + * Automatically attached to objects in no_trade_removable.tab + */ +public class no_trade_removable extends script.base_script { + public no_trade_removable() { + } + + // Using one of the unused reserved entries. + public static final int RADIAL_MENU_ENTRY = menu_info_types.SERVER_MENU47; + public static final string_id REMOVE_NO_TRADE = new string_id("ui_radial", "no_trade_removable"); + + public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException { + if (hasObjVar(self, "noTrade") && (getOwner(self) == player || isGod(player))) { + mi.addRootMenu(RADIAL_MENU_ENTRY, REMOVE_NO_TRADE); + } + return SCRIPT_CONTINUE; + } + + public int OnObjectMenuSelect(obj_id self, obj_id player, int selectedMenuItem) throws InterruptedException { + if (selectedMenuItem == RADIAL_MENU_ENTRY) { + if (!hasObjVar(self, "noTrade")) { + sendSystemMessage(player, "This item is already tradeable.", null); + return SCRIPT_CONTINUE; + } + + if (getOwner(self) != player && !isGod(player)) { + sendSystemMessage(player, "This item does not belong to you.", null); + return SCRIPT_CONTINUE; + } + + removeObjVar(self, "noTrade"); + sendSystemMessage(player, "This item is now tradable.", null); + } + return SCRIPT_CONTINUE; + } +} From 7ef9f9282253714e6e3a75046261a939e562b565 Mon Sep 17 00:00:00 2001 From: Geit Date: Mon, 21 Sep 2020 18:42:29 -0400 Subject: [PATCH 2/8] Update from code review comments --- .../item/special/no_trade_removable.java | 25 ++++++++++++------- .../compiled/game/script/menu_info_types.java | 8 +++--- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/sku.0/sys.server/compiled/game/script/item/special/no_trade_removable.java b/sku.0/sys.server/compiled/game/script/item/special/no_trade_removable.java index e1ea81edb..b63cefc0e 100644 --- a/sku.0/sys.server/compiled/game/script/item/special/no_trade_removable.java +++ b/sku.0/sys.server/compiled/game/script/item/special/no_trade_removable.java @@ -4,6 +4,7 @@ import script.obj_id; import script.string_id; import script.menu_info; import script.menu_info_types; +import script.library.utils; /** * Allows items that previously had the "noTrade" flag to be made tradeable by @@ -18,9 +19,13 @@ public class no_trade_removable extends script.base_script { // Using one of the unused reserved entries. public static final int RADIAL_MENU_ENTRY = menu_info_types.SERVER_MENU47; public static final string_id REMOVE_NO_TRADE = new string_id("ui_radial", "no_trade_removable"); + public static final string_id SID_ITEM_NOT_INVENTORY = new string_id("sarlacc_minigame", "item_not_inventory"); + public static final string_id SID_ITEM_NOT_OWNER = new string_id("base_player", "item_not_owner"); + public static final string_id SID_ITEM_MADE_TRADABLE = new string_id("system_msg", "item_made_tradable"); public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException { - if (hasObjVar(self, "noTrade") && (getOwner(self) == player || isGod(player))) { + if ((getOwner(self) == player || isGod(player) && hasObjVar(self, "noTrade")) + && utils.getContainingPlayer(self) == player) { mi.addRootMenu(RADIAL_MENU_ENTRY, REMOVE_NO_TRADE); } return SCRIPT_CONTINUE; @@ -28,18 +33,20 @@ public class no_trade_removable extends script.base_script { public int OnObjectMenuSelect(obj_id self, obj_id player, int selectedMenuItem) throws InterruptedException { if (selectedMenuItem == RADIAL_MENU_ENTRY) { - if (!hasObjVar(self, "noTrade")) { - sendSystemMessage(player, "This item is already tradeable.", null); - return SCRIPT_CONTINUE; - } - if (getOwner(self) != player && !isGod(player)) { - sendSystemMessage(player, "This item does not belong to you.", null); + sendSystemMessage(player, SID_ITEM_NOT_OWNER); return SCRIPT_CONTINUE; } - removeObjVar(self, "noTrade"); - sendSystemMessage(player, "This item is now tradable.", null); + if (utils.getContainingPlayer(self) != player) { + sendSystemMessage(player, SID_ITEM_NOT_INVENTORY); + return SCRIPT_CONTINUE; + } + + if (hasObjVar(self, "noTrade")) { + removeObjVar(self, "noTrade"); + sendSystemMessage(player, SID_ITEM_MADE_TRADABLE); + } } return SCRIPT_CONTINUE; } diff --git a/sku.0/sys.server/compiled/game/script/menu_info_types.java b/sku.0/sys.server/compiled/game/script/menu_info_types.java index fe7f810a6..358c3dd0f 100755 --- a/sku.0/sys.server/compiled/game/script/menu_info_types.java +++ b/sku.0/sys.server/compiled/game/script/menu_info_types.java @@ -214,10 +214,10 @@ public class menu_info_types public static final int SERVER_MENU44 = index++; public static final int SERVER_MENU45 = index++; public static final int SERVER_MENU46 = index++; - public static final int SERVER_MENU47 = index++; - public static final int SERVER_MENU48 = index++; - public static final int SERVER_MENU49 = index++; - public static final int SERVER_MENU50 = index++; + public static final int SERVER_MENU47 = index++; // Used for No Trade Removal + public static final int SERVER_MENU48 = index++; // Used for Galactic Reserve Withdrawl + public static final int SERVER_MENU49 = index++; // Used for Autostack and Galactic Reserve Deposit + public static final int SERVER_MENU50 = index++; // Used for Autostack root and Galatic Reserve Root public static final int SERVER_HARVESTER_MANAGE = index++; public static final int SERVER_HOUSE_MANAGE = index++; From a1bada5ab6a55af49d8ce17c6a3b231c9d74e958 Mon Sep 17 00:00:00 2001 From: Geit Date: Tue, 22 Sep 2020 12:49:04 -0400 Subject: [PATCH 3/8] Move an errant bracket into the correct place. --- .../compiled/game/script/item/special/no_trade_removable.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sku.0/sys.server/compiled/game/script/item/special/no_trade_removable.java b/sku.0/sys.server/compiled/game/script/item/special/no_trade_removable.java index b63cefc0e..5b1f93796 100644 --- a/sku.0/sys.server/compiled/game/script/item/special/no_trade_removable.java +++ b/sku.0/sys.server/compiled/game/script/item/special/no_trade_removable.java @@ -22,9 +22,10 @@ public class no_trade_removable extends script.base_script { public static final string_id SID_ITEM_NOT_INVENTORY = new string_id("sarlacc_minigame", "item_not_inventory"); public static final string_id SID_ITEM_NOT_OWNER = new string_id("base_player", "item_not_owner"); public static final string_id SID_ITEM_MADE_TRADABLE = new string_id("system_msg", "item_made_tradable"); + public static final String SCRIPT_NAME = "item.special.no_trade_removable"; public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException { - if ((getOwner(self) == player || isGod(player) && hasObjVar(self, "noTrade")) + if ((getOwner(self) == player || isGod(player)) && hasObjVar(self, "noTrade") && utils.getContainingPlayer(self) == player) { mi.addRootMenu(RADIAL_MENU_ENTRY, REMOVE_NO_TRADE); } From 2ed8587a7a5a29a4d716c271ad661299adbf9f95 Mon Sep 17 00:00:00 2001 From: Geit Date: Tue, 22 Sep 2020 12:50:08 -0400 Subject: [PATCH 4/8] Remove unused line --- .../compiled/game/script/item/special/no_trade_removable.java | 1 - 1 file changed, 1 deletion(-) diff --git a/sku.0/sys.server/compiled/game/script/item/special/no_trade_removable.java b/sku.0/sys.server/compiled/game/script/item/special/no_trade_removable.java index 5b1f93796..7e74d9394 100644 --- a/sku.0/sys.server/compiled/game/script/item/special/no_trade_removable.java +++ b/sku.0/sys.server/compiled/game/script/item/special/no_trade_removable.java @@ -22,7 +22,6 @@ public class no_trade_removable extends script.base_script { public static final string_id SID_ITEM_NOT_INVENTORY = new string_id("sarlacc_minigame", "item_not_inventory"); public static final string_id SID_ITEM_NOT_OWNER = new string_id("base_player", "item_not_owner"); public static final string_id SID_ITEM_MADE_TRADABLE = new string_id("system_msg", "item_made_tradable"); - public static final String SCRIPT_NAME = "item.special.no_trade_removable"; public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException { if ((getOwner(self) == player || isGod(player)) && hasObjVar(self, "noTrade") From a2fdb18727df988211d3b7144db5b3e82093d0b9 Mon Sep 17 00:00:00 2001 From: Geit Date: Tue, 22 Sep 2020 13:24:55 -0400 Subject: [PATCH 5/8] Detach script and add Customer Service logging --- .../game/script/item/special/no_trade_removable.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sku.0/sys.server/compiled/game/script/item/special/no_trade_removable.java b/sku.0/sys.server/compiled/game/script/item/special/no_trade_removable.java index 7e74d9394..ee00e2321 100644 --- a/sku.0/sys.server/compiled/game/script/item/special/no_trade_removable.java +++ b/sku.0/sys.server/compiled/game/script/item/special/no_trade_removable.java @@ -18,15 +18,18 @@ public class no_trade_removable extends script.base_script { // Using one of the unused reserved entries. public static final int RADIAL_MENU_ENTRY = menu_info_types.SERVER_MENU47; - public static final string_id REMOVE_NO_TRADE = new string_id("ui_radial", "no_trade_removable"); + + public static final string_id SID_REMOVE_NO_TRADE = new string_id("ui_radial", "no_trade_removable"); public static final string_id SID_ITEM_NOT_INVENTORY = new string_id("sarlacc_minigame", "item_not_inventory"); public static final string_id SID_ITEM_NOT_OWNER = new string_id("base_player", "item_not_owner"); public static final string_id SID_ITEM_MADE_TRADABLE = new string_id("system_msg", "item_made_tradable"); + + public static final String SCRIPT_NAME = "item.special.no_trade_removable"; public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException { if ((getOwner(self) == player || isGod(player)) && hasObjVar(self, "noTrade") && utils.getContainingPlayer(self) == player) { - mi.addRootMenu(RADIAL_MENU_ENTRY, REMOVE_NO_TRADE); + mi.addRootMenu(RADIAL_MENU_ENTRY, SID_REMOVE_NO_TRADE); } return SCRIPT_CONTINUE; } @@ -46,6 +49,8 @@ public class no_trade_removable extends script.base_script { if (hasObjVar(self, "noTrade")) { removeObjVar(self, "noTrade"); sendSystemMessage(player, SID_ITEM_MADE_TRADABLE); + CustomerServiceLog("noTrade", getPlayerName(player) + " (" + player + ") removed the noTrade ObjVar from object " + getTemplateName(self) + " (" + self + ")"); + detachScript(self, SCRIPT_NAME); } } return SCRIPT_CONTINUE; From b890557f6038127ae553c30c7d2725bdd13cfed0 Mon Sep 17 00:00:00 2001 From: AconiteGodOfSWG <63141077+AconiteGodOfSWG@users.noreply.github.com> Date: Fri, 16 Oct 2020 21:03:26 -0400 Subject: [PATCH 6/8] Add getExclusiveItemRewardCount method --- .../game/script/library/groundquests.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sku.0/sys.server/compiled/game/script/library/groundquests.java b/sku.0/sys.server/compiled/game/script/library/groundquests.java index b7455cad1..94cdee5f6 100755 --- a/sku.0/sys.server/compiled/game/script/library/groundquests.java +++ b/sku.0/sys.server/compiled/game/script/library/groundquests.java @@ -1730,4 +1730,23 @@ public class groundquests extends script.base_script } return null; } + + // NOTE this method only works for getting the item count for a selected exclusive reward + // from a questLIST not a questTASK. This was added to accommodate a specific WOD expansion + // quest, but it can be expanded later if needed. + public static int getExclusiveItemRewardCount(String questName, String itemName) { + String datatable = "datatables/questlist/"+questName+".iff"; + dictionary questData = dataTableGetRow(datatable, 0); + String itemColName = "QUEST_REWARD_EXCLUSIVE_LOOT_NAME"; + String countColName = "QUEST_REWARD_EXCLUSIVE_LOOT_COUNT"; + for(int i = 1; i <= 10; i++) { + if(i == 1) { + if(itemName.equals(questData.getString(itemColName))) return questData.getInt(countColName); + } + else { + if(itemName.equals(questData.getString(itemColName + "_" + i))) return questData.getInt(countColName + "_" + i); + } + } + return 1; + } } From 601be3d3a354c5d5054a41ec0d18663f4546801f Mon Sep 17 00:00:00 2001 From: AconiteGodOfSWG <63141077+AconiteGodOfSWG@users.noreply.github.com> Date: Fri, 16 Oct 2020 21:07:21 -0400 Subject: [PATCH 7/8] Fix exclusiveLootChoiceCount in OnQuestCompleted --- .../compiled/game/script/player/base/base_player.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sku.0/sys.server/compiled/game/script/player/base/base_player.java b/sku.0/sys.server/compiled/game/script/player/base/base_player.java index 9585b829e..e6b83c6c5 100755 --- a/sku.0/sys.server/compiled/game/script/player/base/base_player.java +++ b/sku.0/sys.server/compiled/game/script/player/base/base_player.java @@ -10674,7 +10674,7 @@ public class base_player extends script.base_script exclusiveLootNames[9] = groundquests.getQuestStringDataEntry(questCrc, groundquests.dataTableColumnQuestRewardExclusiveLootName10); exclusiveLootCounts[9] = groundquests.getQuestIntDataEntry(questCrc, groundquests.dataTableColumnQuestRewardExclusiveLootCount10); String badge = groundquests.getQuestStringDataEntry(questCrc, groundquests.dataTableColumnBadge); - int exclusiveLootCountChoice = 1; + int exclusiveLootCountChoice = groundquests.getExclusiveItemRewardCount(questGetQuestName(questCrc), exclusiveItemChoice); groundquests.grantQuestReward(self, questCrc, questLevel, questTier, experienceType, experienceAmount, factionName, factionAmount, grantGcwReward, bankCredits, item, itemCount, weapon, weaponCount, weaponSpeed, weaponDamage, weaponEfficiency, weaponElementalValue, armor, armorCount, armorQuality, inclusiveLootNames, inclusiveLootCounts, exclusiveItemChoice, exclusiveLootCountChoice, badge, (questIsQuestForceAccept(questCrc) || !questDoesUseAcceptanceUI(questCrc)), grantGcwOverwriteAmt, grantGcwSFModifier, grantGcwRebReward, grantGcwRebRewardCount, grantGcwImpReward, grantGcwImpRewardCount, grantGcwSFRewardMultip); experienceAmount = groundquests.getQuestExperienceReward(self, questLevel, questTier, experienceAmount); metrics.doQuestMetrics(self, questCrc, questLevel, questTier, experienceType, experienceAmount); From d8dda3aac0ee4c537a6093e107aab3230ffe9a99 Mon Sep 17 00:00:00 2001 From: AconiteGodOfSWG <63141077+AconiteGodOfSWG@users.noreply.github.com> Date: Sun, 25 Oct 2020 01:07:40 -0400 Subject: [PATCH 8/8] Update delivery_no_pickup.java --- .../game/script/space/quest_logic/delivery_no_pickup.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sku.0/sys.server/compiled/game/script/space/quest_logic/delivery_no_pickup.java b/sku.0/sys.server/compiled/game/script/space/quest_logic/delivery_no_pickup.java index 67d966f2e..ef0a32adb 100755 --- a/sku.0/sys.server/compiled/game/script/space/quest_logic/delivery_no_pickup.java +++ b/sku.0/sys.server/compiled/game/script/space/quest_logic/delivery_no_pickup.java @@ -21,9 +21,8 @@ public class delivery_no_pickup extends script.space.quest_logic.delivery return SCRIPT_CONTINUE; } String qTable = "datatables/spacequest/" + questType + "/" + questName + ".iff"; - sendSystemMessageTestingOnly(player, "table is " + qTable); dictionary questInfo = dataTableGetRow(qTable, 0); - if (questInfo == null) + if (questInfo == null && isGod(player)) { sendSystemMessageTestingOnly(player, "Debug: Failed to open quest table " + qTable); return SCRIPT_CONTINUE;