Add ESB Anniversary Celebration Items and Rewards (Fix #190)

Handles all changes listed here: https://swg.fandom.com/wiki/The_Empire_Strikes_Back_30th_Anniversary_Celebration
This commit is contained in:
AconiteGodOfSWG
2020-11-19 19:31:33 -05:00
parent d37b1f9e53
commit a0c0a9ddb5
15 changed files with 739 additions and 446 deletions
@@ -87,6 +87,7 @@ public class live_conversions extends script.base_script
givePlayersDeathTroopersPrologQuestComlink(player);
removeDeprecatedQuests(player);
addPlayerScripts(player);
handleEsbAnniversaryGifts(player);
}
public void runOncePerTravelConversions(obj_id player) throws InterruptedException
{
@@ -945,4 +946,23 @@ public class live_conversions extends script.base_script
}
return true;
}
public void handleEsbAnniversaryGifts(obj_id player) throws InterruptedException {
if(!utils.checkConfigFlag("Custom", "grantEsbAnniversaryRewards")) {
return;
}
if(hasObjVar(player, "publish_gifts.has_esb_rewards")) {
return;
}
obj_id inv = utils.getInventoryContainer(player);
obj_id col1 = createObjectInInventoryAllowOverload("object/tangible/collection/esb_week_1.iff", player);
obj_id col2 = createObjectInInventoryAllowOverload("object/tangible/collection/esb_week_2.iff", player);
obj_id col3 = createObjectInInventoryAllowOverload("object/tangible/collection/esb_week_3.iff", player);
obj_id col4 = createObjectInInventoryAllowOverload("object/tangible/collection/esb_week_4.iff", player);
obj_id cos1 = static_item.createNewItemFunction("item_esb_luke_costume", inv);
obj_id cos2 = static_item.createNewItemFunction("item_esb_leia_costume", inv);
obj_id cos3 = static_item.createNewItemFunction("item_esb_han_solo_costume", inv);
obj_id cos4 = static_item.createNewItemFunction("item_esb_lando_costume", inv);
showLootBox(player, new obj_id[] {col1, col2, col3, col4, cos1, cos2, cos3, cos4});
setObjVar(player, "publish_gifts.has_esb_rewards", 1);
}
}