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..ee00e2321 --- /dev/null +++ b/sku.0/sys.server/compiled/game/script/item/special/no_trade_removable.java @@ -0,0 +1,58 @@ +package script.item.special; + +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 + * 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 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, SID_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 (getOwner(self) != player && !isGod(player)) { + sendSystemMessage(player, SID_ITEM_NOT_OWNER); + return SCRIPT_CONTINUE; + } + + 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); + CustomerServiceLog("noTrade", getPlayerName(player) + " (" + player + ") removed the noTrade ObjVar from object " + getTemplateName(self) + " (" + self + ")"); + detachScript(self, SCRIPT_NAME); + } + } + return SCRIPT_CONTINUE; + } +} 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; + } } 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++; 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); 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;