diff --git a/.gitignore b/.gitignore index 5a05264..b183e09 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .vs/ .vscode/ build.sh -todo.txt \ No newline at end of file +todo.txt +.idea +src/zones/dungeons/template_dg.lua \ No newline at end of file diff --git a/src/WizardsWardrobe.lua b/src/WizardsWardrobe.lua index 77aa364..01b72e7 100644 --- a/src/WizardsWardrobe.lua +++ b/src/WizardsWardrobe.lua @@ -7,7 +7,7 @@ WW.name = "WizardsWardrobe" WW.simpleName = "Wizard's Wardrobe" WW.displayName = "|c18bed8W|c26c2d1i|c35c6c9z|c43cac2a|c52cebar|c60d1b3d|c6fd5ab'|c7dd9a4s|c8cdd9d |c9ae195W|ca8e58ea|cb7e986r|cc5ed7fd|cd4f077r|ce2f470o|cf1f868b|cfffc61e|r" -WW.version = "1.16.2" +WW.version = "2.0.0" WW.zones = {} WW.currentIndex = 0 diff --git a/src/WizardsWardrobe.txt b/src/WizardsWardrobe.txt index 1f1738a..41cd9c5 100644 --- a/src/WizardsWardrobe.txt +++ b/src/WizardsWardrobe.txt @@ -1,8 +1,8 @@ ## Title: Wizard's Wardrobe -## Author: ownedbynico, |c268074JN_Slevin|r, |c00a313Ghostbane|r -## Version: 1.16.2 +## Author: ownedbynico, |c268074JN_Slevin|r, |c00a313Ghostbane|r, |cFFCC66@Doc_Landerf|r +## Version: 2.0.0 ## Description: Throw all your setups into the wardrobe and let the wizard equip them exactly when you need it. -## APIVersion: 101040 +## APIVersion: 101041 101042 ## DependsOn: LibAddonMenu-2.0 LibChatMessage>=105 LibDebugLogger LibAsync ## SavedVariables: WizardsWardrobeSV @@ -21,11 +21,11 @@ libs/gridcombobox.lua lang/en.lua lang/$(language).lua -WizardsWardrobeSetup.lua -WizardsWardrobeConst.lua -WizardsWardrobeUtils.lua -WizardsWardrobeQueue.lua -WizardsWardrobeSetupValidation.lua +utils/WizardsWardrobeSetup.lua +utils/WizardsWardrobeConst.lua +utils/WizardsWardrobeUtils.lua +utils/WizardsWardrobeQueue.lua +utils/WizardsWardrobeSetupValidation.lua modules/WizardsWardrobeConditions.lua modules/WizardsWardrobeTransfer.lua @@ -47,20 +47,57 @@ WizardsWardrobe.lua zones/GEN.lua zones/SUB.lua zones/PVP.lua -zones/AA.lua -zones/SO.lua -zones/HRC.lua -zones/MOL.lua -zones/HOF.lua -zones/AS.lua -zones/CR.lua -zones/SS.lua -zones/KA.lua -zones/RG.lua -zones/DSR.lua -zones/SE.lua -zones/BRP.lua -zones/EA.lua +zones/trials/AA.lua +zones/trials/SO.lua +zones/trials/HRC.lua +zones/trials/MOL.lua +zones/trials/HOF.lua +zones/trials/AS.lua +zones/trials/CR.lua +zones/trials/SS.lua +zones/trials/KA.lua +zones/trials/RG.lua +zones/trials/DSR.lua +zones/trials/SE.lua + +zones/arenas/MA.lua +zones/arenas/VH.lua +zones/arenas/DSA.lua +zones/arenas/BRP.lua +zones/arenas/EA.lua + +zones/dungeons/WGT.lua +zones/dungeons/ICP.lua +zones/dungeons/ROM.lua +zones/dungeons/COS.lua +zones/dungeons/FH.lua +zones/dungeons/BF.lua +zones/dungeons/FL.lua +zones/dungeons/SCP.lua +zones/dungeons/MHK.lua +zones/dungeons/MOS.lua +zones/dungeons/FV.lua +zones/dungeons/DOM.lua +zones/dungeons/LOM.lua +zones/dungeons/MGF.lua +zones/dungeons/IR.lua +zones/dungeons/UHG.lua +zones/dungeons/SG.lua +zones/dungeons/CT.lua +zones/dungeons/BDV.lua +zones/dungeons/TC.lua +zones/dungeons/RPB.lua +zones/dungeons/DC.lua +zones/dungeons/CA.lua +zones/dungeons/SR.lua +zones/dungeons/ERE.lua +zones/dungeons/GD.lua +zones/dungeons/BS.lua +zones/dungeons/SH.lua +zones/dungeons/BV.lua +zones/dungeons/OP.lua + +# DG from Mephisto, merge by @Doc_Landerf© MIT # EA should technically be IA # It was released as Endless Archive then changed to Infinite Archive afterward diff --git a/src/lang/en.lua b/src/lang/en.lua index 00fde64..0929864 100644 --- a/src/lang/en.lua +++ b/src/lang/en.lua @@ -101,7 +101,7 @@ local language = { "Shows the set and page name as well as the current zone.\nA |cF8FF70yellow|r set name indicates a delayed loading of the setup. A |cFF7070red|r set name means that the current setup no longer matches the saved one.", WW_MENU_PANEL_MINI = "Lite mode", WW_MENU_PANEL_MINI_TT = "Hides icon and reduces the size of the panel.", - WW_MENU_PANEL_LOCK = "Lock movement", + WW_MENU_PANEL_LOCK = "Lock ui", WW_MENU_MODULES = "Modules", WW_MENU_CHARGEWEAPONS = "Automatically charge weapons", WW_MENU_REPAIRARMOR = "Automatically repair armor", @@ -277,7 +277,9 @@ local language = { WW_SE_TWELVANE = "Archwizard Twelvane", WW_SE_ANSUUL = "Ansuul the Tormentor", - WW_MSA_NAME = "Maelstrom Arena", + -- Arena + + WW_MA_NAME = "Maelstrom Arena", WW_VH_NAME = "Vateshran Hollows", @@ -291,6 +293,216 @@ local language = { WW_BRP_FIFTH = "Drakeeh the Unchained", WW_BRP_FINALROUND = "Final Round", + -- DUNGEONS + WW_WGT_NAME = "White Gold Tower", + WW_WGT_THE_ADJUDICATOR = "The Adjudicator", + WW_WGT_THE_PLANAR_INHIBITOR = "The Planar Inhibitor", + WW_WGT_MOLAG_KENA = "Molag Kena", + + WW_ICP_NAME = "Imperial City Prison", + WW_ICP_IBOMEZ_THE_FLESH_SCULPTOR = "Ibomez the Flesh Sculptor", + WW_ICP_FLESH_ABOMINATION = "Flesh Abomination", + WW_ICP_LORD_WARDEN_DUSK = "Lord Warden Dusk", + + WW_ROM_NAME = "Ruins of Mazzatun", + WW_ROM_MIGHTY_CHUDAN = "Mighty Chudan", + WW_ROM_XAL_NUR_THE_SLAVER = "Xal-Nur the Slaver", + WW_ROM_TREE_MINDER_NA_KESH = "Tree-Minder Na-Kesh", + + WW_COS_NAME = "Cradle of Shadows", + WW_COS_KHEPHIDAEN = "Khephidaen", + WW_COS_DRANOS_VELEADOR = "Dranos Velador", + WW_COS_VELIDRETH = "Velidreth", + + WW_FH_NAME = "Falkreath Hold", + WW_FH_MORRIGH_BULLBLOOD = "Morrigh Bullblood", + WW_FH_SIEGE_MAMMOTH = "Siege Mammoth", + WW_FH_CERNUNNON = "Cernunnon", + WW_FH_DEATHLORD_BJARFRUD_SKJORALMOR = "Deathlord Bjarfrud Skjoralmor", + WW_FH_DOMIHAUS_THE_BLOODY_HORNED = "Domihaus the Bloody-Horned", + + WW_BF_NAME = "Bloodroot Forge", + WW_BF_MATHGAMAIN = "Mathgamain", + WW_BF_CAILLAOIFE = "Caillaoife", + WW_BF_STONEHEARTH = "Stoneheart", + WW_BF_GALCHOBHAR = "Galchobhar", + WW_BF_GHERIG_BULLBLOOD = "Gherig Bullblood", + WW_BF_EARTHGORE_AMALGAM = "Earthgore Amalgam", + + WW_FL_NAME = "Fang Lair", + WW_FL_LIZABET_CHARNIS = "Lizabet Charnis", + WW_FL_CADAVEROUS_BEAR = "Cadaverous Bear", + WW_FL_CALUURION = "Caluurion", + WW_FL_ULFNOR = "Ulfnor", + WW_FL_THURVOKUN = "Thurvokun", + + WW_SCP_NAME = "Scalescaller Peak", + WW_SCP_ORZUN_THE_FOUL_SMELLING = "Orzun the Foul-Smelling", + WW_SCP_DOYLEMISH_IRONHEARTH = "Doylemish Ironheart", + WW_SCP_MATRIACH_ALDIS = "Matriarch Aldis", + WW_SCP_PLAGUE_CONCOCTER_MORTIEU = "Plague Concocter Mortieu", + WW_SCP_ZAAN_THE_SCALECALLER = "Zaan the Scalecaller", + + WW_MHK_NAME = "Moon Hunter Keep", + WW_MHK_JAILER_MELITUS = "Jailer Melitus", + WW_MHK_HEDGE_MAZE_GUARDIAN = "Hedge Maze Guardian", + WW_MHK_MYLENNE_MOON_CALLER = "Mylenne Moon-Caller", + WW_MHK_ARCHIVIST_ERNADE = "Archivist Ernarde", + WW_MHK_VYKOSA_THE_ASCENDANT = "Vykosa the Ascendant", + + WW_MOS_NAME = "March of Sacrifices", + WW_MOS_WYRESS_RANGIFER = "Wyress Strigidae", + WW_MOS_AGHAEDH_OF_THE_SOLSTICE = "Aghaedh of the Solstice", + WW_MOS_DAGRUND_THE_BULKY = "Dagrund the Bulky", + WW_MOS_TARCYR = "Tarcyr", + WW_MOS_BALORGH = "Balorgh", + + WW_FV_NAME = "Frostvault", + WW_FV_ICESTALKER = "Icestalker", + WW_FV_WARLORD_TZOGVIN = "Warlord Tzogvin", + WW_FV_VAULT_PROTECTOR = "Vault Protector", + WW_FV_RIZZUK_BONECHILL = "Rizzuk Bonechill", + WW_FV_THE_STONEKEEPER = "The Stonekeeper", + + WW_DOM_NAME = "Depths of Malatar", + WW_DOM_THE_SCAVENGING_MAW = "The Scavenging Maw", + WW_DOM_THE_WEEPING_WOMAN = "The Weeping Woman", + WW_DOM_DARK_ORB = "Dark Orb", + WW_DOM_KING_NARILMOR = "King Narilmor", + WW_DOM_SYMPHONY_OF_BLADE = "Symphony of Blades", + + WW_LOM_NAME = "Lair of Maarselok", + WW_LOM_SELENE = "Selene", + WW_LOM_AZUREBLIGHT_LURCHER = "Azureblight Lurcher", + WW_LOM_AZUREBLIGHT_CANCROID = "Azureblight Cancroid", + WW_LOM_MAARSELOK = "Maarselok", + WW_LOM_MAARSELOK_BOSS = "Maarselok (Boss)", + + WW_MGF_NAME = "Moongrave Fane", + WW_MGF_RISEN_RUINS = "Risen Ruins", + WW_MGF_DRO_ZAKAR = "Dro'zakar", + WW_MGF_KUJO_KETHBA = "Kujo Kethba", + WW_MGF_NISAAZDA = "Nisaazda", + WW_MGF_GRUNDWULF = "Grundwulf", + + WW_IR_NAME = "Icereach", + WW_IR_KJARG_THE_TUSKSCRAPER = "Kjarg the Tuskscraper", + WW_IR_SISTER_SKELGA = "Sister Skelga", + WW_IR_VEAROGH_THE_SHAMBLER = "Vearogh the Shambler", + WW_IR_STORMBOND_REVENANT = "Stormborn Revenant", + WW_IR_ICEREACH_COVEN = "Icereach Coven", + + WW_UHG_NAME = "Unhallowed Grave", + WW_UHG_HAKGRYM_THE_HOWLER = "Hakgrym the Howler", + WW_UHG_KEEPER_OF_THE_KILN = "Keeper of the Kiln", + WW_UHG_ETERNAL_AEGIS = "Eternal Aegis", + WW_UHG_ONDAGORE_THE_MAD = "Ondagore the Mad", + WW_UHG_KJALNAR_TOMBSKALD = "Kjalnar Tombskald", + WW_UHG_NABOR_THE_FORGOTTEN = "Nabor the Forgotten", + WW_UHG_VORIA_THE_HEARTH_THIEF = "Voria the Heart-Thief", + WW_UHG_VORIAS_MASTERPIECE = "Voria's Masterpiece", + + WW_SG_NAME = "Stone Garden", + WW_SG_EXARCH_KRAGLEN = "Exarch Kraglen", + WW_SG_STONE_BEHEMOTH = "Stone Behemoth", + WW_SG_ARKASIS_THE_MAD_ALCHEMIST = "Arkasis the Mad Alchemist", + + WW_CT_NAME = "Castle Thorn", + WW_CT_DREAD_TINDULRA = "Dread Tindulra", + WW_CT_BLOOD_TWILIGHT = "Blood Twilight", + WW_CT_VADUROTH = "Vaduroth", + WW_CT_TALFYG = "Talfyg", + WW_CT_LADY_THORN = "Lady Thorn", + + WW_BDV_NAME = "Black Drake Villa", + WW_BDV_KINRAS_IRONEYE = "Kinras Ironeye", + WW_BDV_CAPTAIN_GEMINUS = "Captain Geminus", + WW_BDV_PYROTURGE_ENCRATIS = "Pyroturge Encratis", + WW_BDV_AVATAR_OF_ZEAL = "Avatar of Zeal", + WW_BDV_AVATAR_OF_VIGOR = "Avatar of Vigor", + WW_BDV_AVATAR_OF_FORTITUDE = "Avatar of Fortitude", + WW_BDV_SENTINEL_AKSALAZ = "Sentinel Aksalaz", + + WW_TC_NAME = "The Cauldron", + WW_TC_OXBLOOD_THE_DEPRAVED = "Oxblood the Depraved", + WW_TC_TASKMASTER_VICCIA = "Taskmaster Viccia", + WW_TC_MOLTEN_GUARDIAN = "Molten Guardian", + WW_TC_DAEDRIC_SHIELD = "Daedric Shield", + WW_TC_BARON_ZAULDRUS = "Baron Zaudrus", + + WW_RPB_NAME = "Red Petal Bastion", + WW_RPB_ROGERAIN_THE_SLY = "Rogerain the Sly", + WW_RPB_ELIAM_MERICK = "Eliam Merick", + WW_RPB_PRIOR_THIERRIC_SARAZEN = "Prior Thierric Sarazen", + WW_RPB_WRAITH_OF_CROWS = "Wraith of Crows", + WW_RPB_SPIDER_DEADRA = "Spider Daedra", + WW_RPB_GRIEVIOUS_TWILIGHT = "Grievous Twilight", + + WW_DC_NAME = "Dread Cellar", + WW_DC_SCORION_BROODLORD = "Scorion Broodlord", + WW_DC_CYRONIN_ARTELLIAN = "Cyronin Artellian", + WW_DC_MAGMA_INCARNATE = "Magma Incarnate", + WW_DC_PURGATOR = "Purgator", + WW_DC_UNDERTAKER = "Undertaker", + WW_DC_GRIM_WARDEN = "Grim Warden", + + WW_CA_NAME ="Coral Arie", + WW_CA_B1 ="Magligalig", + WW_CA_B2 ="Sarydil", + WW_CA_B3 ="Varallion", + WW_CA_SCB1 ="Sword Guardian", + WW_CA_SCB2 ="Staff Guardian", + WW_CA_SCB3 ="Shield Guardian", + WW_CA_SCB4 ="Z’baza", + + WW_SR_NAME = "Shipwright’s Regret", + WW_SR_B1="Foreman Bradiggan", + WW_SR_B2="Nazaray", + WW_SR_B3="Captain Numirril", + WW_SR_SCB1="Lost Maiden", + WW_SR_SCB2="Shrouded Axeman", + WW_SR_SCB3="Storm-Cursed Sailor", + + WW_ERE_NAME="Earthen Root Enclave", + WW_ERE_B1="Corruption of Stone", + WW_ERE_B2="Corruption of Root", + WW_ERE_B3="Archdruid Devyric", + WW_ERE_SCB1="Scaled Roots", + WW_ERE_SCB2="Lutea", + WW_ERE_SCB3="Jodoro", + + WW_GD_NAME="Graven Deep", + WW_GD_B1="The Euphotic Gatekeeper", + WW_GD_B2="Varzunon", + WW_GD_B3="Zelvraak the Unbreathing", + WW_GD_SCB1="Mzugru", + WW_GD_SCB2="Xzyviian", + WW_GD_SCB3="Chralzak", + + WW_BS_NAME="Bal Sunnar", + WW_BS_B1="Kovan Giryon", + WW_BS_B2="Roksa the Warped", + WW_BS_B3="Matriarch Lladi Telvanni", + WW_BS_SCB="Urvel Drath", + + WW_SH_NAME="Scrivener's Hall", + WW_SH_B1="Riftmaster Maqri", + WW_SH_B2="Ozezan the Inferno", + WW_SH_B3="Valinna", + + WW_BV_NAME="Bedlam Veil", + WW_BV_B1="Shattered Champion", + WW_BV_B2="Darkshard", + WW_BV_B3="The Blind", + + WW_OP_NAME="Oathsworn Pit", + WW_OP_B1="Packmaster Rethelros & Malthil", + WW_OP_B2="Anthelmir’s Construct", + WW_OP_B3="Aradros the Awakened", + WW_OP_MB1="Sluthrug the Bloodied", + WW_OP_MB2="Bolg of Wicked Barbs", + WW_OP_MB3="Grubduthag Many-Fates", + -- KEYBINDS SI_BINDING_NAME_WW_HOTKEY_SHOW_UI = "Open Wizard's Wardrobe", diff --git a/src/WizardsWardrobeConst.lua b/src/utils/WizardsWardrobeConst.lua similarity index 62% rename from src/WizardsWardrobeConst.lua rename to src/utils/WizardsWardrobeConst.lua index 4c38e0d..bcfa43a 100644 --- a/src/WizardsWardrobeConst.lua +++ b/src/utils/WizardsWardrobeConst.lua @@ -1,212 +1,329 @@ -WizardsWardrobe = WizardsWardrobe or {} -local WW = WizardsWardrobe - -WW.LINK_TYPES = { - PREVIEW = "wwp", - URL = "wwu", -} - -WW.LOGTYPES = { - NORMAL = "FFFFFF", - ERROR = "FF7070", - INFO = "F8FF70", -} - -WW.GEARSLOTS = { - EQUIP_SLOT_HEAD, - EQUIP_SLOT_SHOULDERS, - EQUIP_SLOT_CHEST, - EQUIP_SLOT_HAND, - EQUIP_SLOT_WAIST, - EQUIP_SLOT_LEGS, - EQUIP_SLOT_FEET, - EQUIP_SLOT_NECK, - EQUIP_SLOT_RING1, - EQUIP_SLOT_RING2, - EQUIP_SLOT_COSTUME, - EQUIP_SLOT_MAIN_HAND, - EQUIP_SLOT_OFF_HAND, - EQUIP_SLOT_POISON, - EQUIP_SLOT_BACKUP_MAIN, - EQUIP_SLOT_BACKUP_OFF, - EQUIP_SLOT_BACKUP_POISON, -} - -WW.GEARICONS = { - [EQUIP_SLOT_HEAD] = "/esoui/art/characterwindow/gearslot_head.dds", - [EQUIP_SLOT_SHOULDERS] = "/esoui/art/characterwindow/gearslot_shoulders.dds", - [EQUIP_SLOT_CHEST] = "/esoui/art/characterwindow/gearslot_chest.dds", - [EQUIP_SLOT_HAND] = "/esoui/art/characterwindow/gearslot_hands.dds", - [EQUIP_SLOT_WAIST] = "/esoui/art/characterwindow/gearslot_belt.dds", - [EQUIP_SLOT_LEGS] = "/esoui/art/characterwindow/gearslot_legs.dds", - [EQUIP_SLOT_FEET] = "/esoui/art/characterwindow/gearslot_feet.dds", - [EQUIP_SLOT_NECK] = "/esoui/art/characterwindow/gearslot_neck.dds", - [EQUIP_SLOT_RING1] = "/esoui/art/characterwindow/gearslot_ring.dds", - [EQUIP_SLOT_RING2] = "/esoui/art/characterwindow/gearslot_ring.dds", - [EQUIP_SLOT_COSTUME] = "/esoui/art/characterwindow/gearslot_costume.dds", - [EQUIP_SLOT_MAIN_HAND] = "/esoui/art/characterwindow/gearslot_mainhand.dds", - [EQUIP_SLOT_OFF_HAND] = "/esoui/art/characterwindow/gearslot_offhand.dds", - [EQUIP_SLOT_POISON] = "/esoui/art/characterwindow/gearslot_poison.dds", - [EQUIP_SLOT_BACKUP_MAIN] = "/esoui/art/characterwindow/gearslot_mainhand.dds", - [EQUIP_SLOT_BACKUP_OFF] = "/esoui/art/characterwindow/gearslot_offhand.dds", - [EQUIP_SLOT_BACKUP_POISON] = "/esoui/art/characterwindow/gearslot_poison.dds", -} - -WW.GEARTYPE = { - [EQUIP_TYPE_HEAD] = EQUIP_SLOT_HEAD, - [EQUIP_TYPE_SHOULDERS] = EQUIP_SLOT_SHOULDERS, - [EQUIP_TYPE_CHEST] = EQUIP_SLOT_CHEST, - [EQUIP_TYPE_HAND] = EQUIP_SLOT_HAND, - [EQUIP_TYPE_WAIST] = EQUIP_SLOT_WAIST, - [EQUIP_TYPE_LEGS] = EQUIP_SLOT_LEGS, - [EQUIP_TYPE_FEET] = EQUIP_SLOT_FEET, - [EQUIP_TYPE_NECK] = EQUIP_SLOT_NECK, - [EQUIP_TYPE_RING] = EQUIP_SLOT_RING1, - [EQUIP_TYPE_COSTUME] = EQUIP_SLOT_COSTUME, - [EQUIP_TYPE_MAIN_HAND] = EQUIP_SLOT_MAIN_HAND, - [EQUIP_TYPE_TWO_HAND] = EQUIP_SLOT_MAIN_HAND, - [EQUIP_TYPE_ONE_HAND] = EQUIP_SLOT_MAIN_HAND, - [EQUIP_TYPE_OFF_HAND] = EQUIP_SLOT_MAIN_HAND, - [EQUIP_TYPE_POISON] = EQUIP_SLOT_POISON, -} - -WW.CPCOLOR = { - [1] = "A5DB52", - [2] = "A5DB52", - [3] = "A5DB52", - [4] = "A5DB52", - [5] = "5ABAE7", - [6] = "5ABAE7", - [7] = "5ABAE7", - [8] = "5ABAE7", - [9] = "E76931", - [10] = "E76931", - [11] = "E76931", - [12] = "E76931", -} - -WW.CPICONS = { - [1] = "/esoui/art/champion/champion_points_stamina_icon.dds", - [2] = "/esoui/art/champion/champion_points_stamina_icon.dds", - [3] = "/esoui/art/champion/champion_points_stamina_icon.dds", - [4] = "/esoui/art/champion/champion_points_stamina_icon.dds", - [5] = "/esoui/art/champion/champion_points_magicka_icon.dds", - [6] = "/esoui/art/champion/champion_points_magicka_icon.dds", - [7] = "/esoui/art/champion/champion_points_magicka_icon.dds", - [8] = "/esoui/art/champion/champion_points_magicka_icon.dds", - [9] = "/esoui/art/champion/champion_points_health_icon.dds", - [10] = "/esoui/art/champion/champion_points_health_icon.dds", - [11] = "/esoui/art/champion/champion_points_health_icon.dds", - [12] = "/esoui/art/champion/champion_points_health_icon.dds", -} - -WW.BUFFFOOD = { - [87695] = 84720, -- Ghastly Eye Bowl - [87697] = 84731, -- Witchmother's Potent Brew - [133556] = 100498, -- Clockwork Citrus Filet - [68242] = 61257, -- Mistral Banana-Bunny Hash - [68243] = 61257, -- Melon-Baked Parmesan Pork - [68244] = 61257, -- Solitude Salmon-Millet Soup - [139016] = 107748, -- Artaeum Pickled Fish Bowl - [68236] = 61260, -- Firsthold Fruit and Cheese Plate - [68237] = 61260, -- Thrice-Baked Gorapple Pie - [68238] = 61260, -- Tomato Garlic Chutney - - [112425] = 86673, -- Lava Foot Soup-and-Saltrice - [120763] = 89957, -- Dubious Camoran Throne - [68245] = 61255, -- Sticky Pork and Radish Noodles - [68246] = 61255, -- Garlic Cod with Potato Crust - [68247] = 61255, -- Braised Rabbit with Spring Vegetables - [139018] = 107789, -- Artaeum Takeaway Broth - [68239] = 61261, -- Hearty Garlic Corn Chowder - [68240] = 61261, -- Bravil's Best Beet Risotto - [68241] = 61261, -- Tenmar Millet-Carrot Couscous - - [68249] = 61294, -- Grapes and Ash Yam Falafel - [87686] = 84681, -- Crisp and Crunchy Pumpkin Snack Skewer - - [71059] = 72824, -- Orzorga's Smoked Bear Haunch - [120764] = 89971, -- Jewels of Misrule - [68251] = 61218, -- Capon Tomato-Beet Casserole - [68252] = 61218, -- Jugged Rabbit in Preserves - [68253] = 61218, -- Longfin Pasty with Melon Sauce - [68254] = 61218, -- Withered Tree Inn Venison Pot Roast - [153629] = 127596, -- Bewitched Sugar Sculls - [71056] = 72816, -- Orzorga's Red Frothgar - - [120762] = 89955, -- Candied Jester's Coins - [87691] = 84709, -- Crunchy Spider Skewer - - [112434] = 86749, -- Jagga-Drenched Mud Ball -} - -WW.CONDITIONS = { - NONE = 0, - EVERYWHERE = -1, -} - -WW.DISABLEDBAGS = { - [BAG_GUILDBANK] = true, - [BAG_BUYBACK] = true, - [BAG_DELETE] = true, - [BAG_VIRTUAL] = true, -} - -WW.MARKINVENTORIES = { - ZO_PlayerInventoryBackpack, - ZO_PlayerBankBackpack, - ZO_GuildBankBackpack, - ZO_SmithingTopLevelDeconstructionPanelInventoryBackpack, - ZO_SmithingTopLevelImprovementPanelInventoryBackpack, -} - -WW.TRAITS = { - ITEM_TRAIT_TYPE_ARMOR_DIVINES, - ITEM_TRAIT_TYPE_ARMOR_IMPENETRABLE, - ITEM_TRAIT_TYPE_ARMOR_INFUSED, - ITEM_TRAIT_TYPE_ARMOR_INTRICATE, - ITEM_TRAIT_TYPE_ARMOR_NIRNHONED, - ITEM_TRAIT_TYPE_ARMOR_ORNATE, - ITEM_TRAIT_TYPE_ARMOR_PROSPEROUS, - ITEM_TRAIT_TYPE_ARMOR_REINFORCED, - ITEM_TRAIT_TYPE_ARMOR_STURDY, - ITEM_TRAIT_TYPE_ARMOR_TRAINING, - ITEM_TRAIT_TYPE_ARMOR_WELL_FITTED, - ITEM_TRAIT_TYPE_JEWELRY_ARCANE, - ITEM_TRAIT_TYPE_JEWELRY_BLOODTHIRSTY, - ITEM_TRAIT_TYPE_JEWELRY_HARMONY, - ITEM_TRAIT_TYPE_JEWELRY_HEALTHY, - ITEM_TRAIT_TYPE_JEWELRY_INFUSED, - ITEM_TRAIT_TYPE_JEWELRY_INTRICATE, - ITEM_TRAIT_TYPE_JEWELRY_ORNATE, - ITEM_TRAIT_TYPE_JEWELRY_PROTECTIVE, - ITEM_TRAIT_TYPE_JEWELRY_ROBUST, - ITEM_TRAIT_TYPE_JEWELRY_SWIFT, - ITEM_TRAIT_TYPE_JEWELRY_TRIUNE, - ITEM_TRAIT_TYPE_WEAPON_CHARGED, - ITEM_TRAIT_TYPE_WEAPON_DECISIVE, - ITEM_TRAIT_TYPE_WEAPON_DEFENDING, - ITEM_TRAIT_TYPE_WEAPON_INFUSED, - ITEM_TRAIT_TYPE_WEAPON_INTRICATE, - ITEM_TRAIT_TYPE_WEAPON_NIRNHONED, - ITEM_TRAIT_TYPE_WEAPON_ORNATE, - ITEM_TRAIT_TYPE_WEAPON_POWERED, - ITEM_TRAIT_TYPE_WEAPON_PRECISE, - ITEM_TRAIT_TYPE_WEAPON_SHARPENED, - ITEM_TRAIT_TYPE_WEAPON_TRAINING, -} - -WW.PREVIEW = { - CHARACTERS = { - "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", - "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", - "y", "z", "1", "2", "3", "4", "5", "6", "7", "8", "9", - }, - TRAITS = { - [0] = 0, - }, - FOOD = { - [0] = 0, - ["0"] = 0, - }, +WizardsWardrobe = WizardsWardrobe or {} +local WW = WizardsWardrobe + +WW.LINK_TYPES = { + PREVIEW = "wwp", + URL = "wwu", +} + +WW.LOGTYPES = { + NORMAL = "FFFFFF", + ERROR = "FF7070", + INFO = "F8FF70", +} + +WW.GEARSLOTS = { + EQUIP_SLOT_HEAD, + EQUIP_SLOT_SHOULDERS, + EQUIP_SLOT_CHEST, + EQUIP_SLOT_HAND, + EQUIP_SLOT_WAIST, + EQUIP_SLOT_LEGS, + EQUIP_SLOT_FEET, + EQUIP_SLOT_NECK, + EQUIP_SLOT_RING1, + EQUIP_SLOT_RING2, + EQUIP_SLOT_COSTUME, + EQUIP_SLOT_MAIN_HAND, + EQUIP_SLOT_OFF_HAND, + EQUIP_SLOT_POISON, + EQUIP_SLOT_BACKUP_MAIN, + EQUIP_SLOT_BACKUP_OFF, + EQUIP_SLOT_BACKUP_POISON, +} + +WW.GEARICONS = { + [EQUIP_SLOT_HEAD] = "/esoui/art/characterwindow/gearslot_head.dds", + [EQUIP_SLOT_SHOULDERS] = "/esoui/art/characterwindow/gearslot_shoulders.dds", + [EQUIP_SLOT_CHEST] = "/esoui/art/characterwindow/gearslot_chest.dds", + [EQUIP_SLOT_HAND] = "/esoui/art/characterwindow/gearslot_hands.dds", + [EQUIP_SLOT_WAIST] = "/esoui/art/characterwindow/gearslot_belt.dds", + [EQUIP_SLOT_LEGS] = "/esoui/art/characterwindow/gearslot_legs.dds", + [EQUIP_SLOT_FEET] = "/esoui/art/characterwindow/gearslot_feet.dds", + [EQUIP_SLOT_NECK] = "/esoui/art/characterwindow/gearslot_neck.dds", + [EQUIP_SLOT_RING1] = "/esoui/art/characterwindow/gearslot_ring.dds", + [EQUIP_SLOT_RING2] = "/esoui/art/characterwindow/gearslot_ring.dds", + [EQUIP_SLOT_COSTUME] = "/esoui/art/characterwindow/gearslot_costume.dds", + [EQUIP_SLOT_MAIN_HAND] = "/esoui/art/characterwindow/gearslot_mainhand.dds", + [EQUIP_SLOT_OFF_HAND] = "/esoui/art/characterwindow/gearslot_offhand.dds", + [EQUIP_SLOT_POISON] = "/esoui/art/characterwindow/gearslot_poison.dds", + [EQUIP_SLOT_BACKUP_MAIN] = "/esoui/art/characterwindow/gearslot_mainhand.dds", + [EQUIP_SLOT_BACKUP_OFF] = "/esoui/art/characterwindow/gearslot_offhand.dds", + [EQUIP_SLOT_BACKUP_POISON] = "/esoui/art/characterwindow/gearslot_poison.dds", +} + +WW.GEARTYPE = { + [EQUIP_TYPE_HEAD] = EQUIP_SLOT_HEAD, + [EQUIP_TYPE_SHOULDERS] = EQUIP_SLOT_SHOULDERS, + [EQUIP_TYPE_CHEST] = EQUIP_SLOT_CHEST, + [EQUIP_TYPE_HAND] = EQUIP_SLOT_HAND, + [EQUIP_TYPE_WAIST] = EQUIP_SLOT_WAIST, + [EQUIP_TYPE_LEGS] = EQUIP_SLOT_LEGS, + [EQUIP_TYPE_FEET] = EQUIP_SLOT_FEET, + [EQUIP_TYPE_NECK] = EQUIP_SLOT_NECK, + [EQUIP_TYPE_RING] = EQUIP_SLOT_RING1, + [EQUIP_TYPE_COSTUME] = EQUIP_SLOT_COSTUME, + [EQUIP_TYPE_MAIN_HAND] = EQUIP_SLOT_MAIN_HAND, + [EQUIP_TYPE_TWO_HAND] = EQUIP_SLOT_MAIN_HAND, + [EQUIP_TYPE_ONE_HAND] = EQUIP_SLOT_MAIN_HAND, + [EQUIP_TYPE_OFF_HAND] = EQUIP_SLOT_MAIN_HAND, + [EQUIP_TYPE_POISON] = EQUIP_SLOT_POISON, +} + +WW.CPCOLOR = { + [1] = "A5DB52", + [2] = "A5DB52", + [3] = "A5DB52", + [4] = "A5DB52", + [5] = "5ABAE7", + [6] = "5ABAE7", + [7] = "5ABAE7", + [8] = "5ABAE7", + [9] = "E76931", + [10] = "E76931", + [11] = "E76931", + [12] = "E76931", +} + +WW.CPICONS = { + [1] = "/esoui/art/champion/champion_points_stamina_icon.dds", + [2] = "/esoui/art/champion/champion_points_stamina_icon.dds", + [3] = "/esoui/art/champion/champion_points_stamina_icon.dds", + [4] = "/esoui/art/champion/champion_points_stamina_icon.dds", + [5] = "/esoui/art/champion/champion_points_magicka_icon.dds", + [6] = "/esoui/art/champion/champion_points_magicka_icon.dds", + [7] = "/esoui/art/champion/champion_points_magicka_icon.dds", + [8] = "/esoui/art/champion/champion_points_magicka_icon.dds", + [9] = "/esoui/art/champion/champion_points_health_icon.dds", + [10] = "/esoui/art/champion/champion_points_health_icon.dds", + [11] = "/esoui/art/champion/champion_points_health_icon.dds", + [12] = "/esoui/art/champion/champion_points_health_icon.dds", +} + +WW.BUFFFOOD = { + [87695] = 84720, -- Ghastly Eye Bowl + [87697] = 84731, -- Witchmother's Potent Brew + [133556] = 100498, -- Clockwork Citrus Filet + [68242] = 61257, -- Mistral Banana-Bunny Hash + [68243] = 61257, -- Melon-Baked Parmesan Pork + [68244] = 61257, -- Solitude Salmon-Millet Soup + [139016] = 107748, -- Artaeum Pickled Fish Bowl + [68236] = 61260, -- Firsthold Fruit and Cheese Plate + [68237] = 61260, -- Thrice-Baked Gorapple Pie + [68238] = 61260, -- Tomato Garlic Chutney + + [112425] = 86673, -- Lava Foot Soup-and-Saltrice + [120763] = 89957, -- Dubious Camoran Throne + [68245] = 61255, -- Sticky Pork and Radish Noodles + [68246] = 61255, -- Garlic Cod with Potato Crust + [68247] = 61255, -- Braised Rabbit with Spring Vegetables + [139018] = 107789, -- Artaeum Takeaway Broth + [68239] = 61261, -- Hearty Garlic Corn Chowder + [68240] = 61261, -- Bravil's Best Beet Risotto + [68241] = 61261, -- Tenmar Millet-Carrot Couscous + + [68249] = 61294, -- Grapes and Ash Yam Falafel + [87686] = 84681, -- Crisp and Crunchy Pumpkin Snack Skewer + + [71059] = 72824, -- Orzorga's Smoked Bear Haunch + [120764] = 89971, -- Jewels of Misrule + [68251] = 61218, -- Capon Tomato-Beet Casserole + [68252] = 61218, -- Jugged Rabbit in Preserves + [68253] = 61218, -- Longfin Pasty with Melon Sauce + [68254] = 61218, -- Withered Tree Inn Venison Pot Roast + [153629] = 127596, -- Bewitched Sugar Sculls + [71056] = 72816, -- Orzorga's Red Frothgar + + [120762] = 89955, -- Candied Jester's Coins + [87691] = 84709, -- Crunchy Spider Skewer + + [112434] = 86749, -- Jagga-Drenched Mud Ball + + [64711] = 68411, -- Crown Fortifying Meal + [64712] = 68416, -- Crown Refreshing Drink + [68233] = 61259, -- Garlic-and-Pepper Venison Steak + [68234] = 61259, -- Millet and Beef Stuffed Peppers + [68235] = 61259, -- Lilmoth Garlic Hagfish + [68236] = 61260, -- Firsthold Fruit and Cheese Plate + [68237] = 61260, -- Thrice-Baked Gorapple Pie + [68238] = 61260, -- Tomato Garlic Chutney + [68239] = 61261, -- Hearty Garlic Corn Chowder + [68240] = 61261, -- Bravil's Best Beet Risotto + [68241] = 61261, -- Tenmar Millet-Carrot Couscous + [68242] = 61257, -- Mistral Banana-Bunny Hash + [68243] = 61257, -- Melon-Baked Parmesan Pork + [68244] = 61257, -- Solitude Salmon-Millet Soup + [68245] = 61255, -- Sticky Pork and Radish Noodles + [68246] = 61255, -- Garlic Cod with Potato Crust + [68247] = 61255, -- Braised Rabbit with Spring Vegetables + [68248] = 61294, -- Chevre-Radish Salad with Pumpkin Seeds + [68249] = 61294, -- Grapes and Ash Yam Falafel + [68250] = 61294, -- Late Hearthfire Vegetable Tart + [68251] = 61218, -- Capon Tomato-Beet Casserole + [68252] = 61218, -- Jugged Rabbit in Preserves + [68253] = 61218, -- Longfin Pasty with Melon Sauce + [68254] = 61218, -- Withered Tree Inn Venison Pot Roast + [68255] = 61322, -- Kragenmoor Zinger Mazte + [68256] = 61322, -- Colovian Ginger Beer + [68257] = 61322, -- Markarth Mead + [68258] = 61325, -- Heart's Day Rose Tea + [68259] = 61325, -- Soothing Bard's-Throat Tea + [68260] = 61325, -- Muthsera's Remorse + [68261] = 61328, -- Fredas Night Infusion + [68262] = 61328, -- Old Hegathe Lemon Kaveh + [68263] = 61328, -- Hagraven's Tonic + [68264] = 61335, -- Port Hunding Pinot Noir + [68265] = 61335, -- Dragontail Blended Whisky + [68266] = 61335, -- Bravil Bitter Barley Beer + [68267] = 61340, -- Wide-Eye Double Rye + [68268] = 61340, -- Camlorn Sweet Brown Ale + [68269] = 61340, -- Flowing Bowl Green Port + [68270] = 61345, -- Honest Lassie Honey Tea + [68271] = 61345, -- Rosy Disposition Tonic + [68272] = 61345, -- Cloudrest Clarified Coffee + [68273] = 61350, -- Senche-Tiger Single Malt + [68274] = 61350, -- Velothi View Vintage Malbec + [68275] = 61350, -- Orcrest Agony Pale Ale + [68276] = 61350, -- Lusty Argonian Maid Mazte + [71056] = 72816, -- Orzorga's Red Frothgar + [71057] = 72819, -- Orzorga's Tripe Trifle Pocket + [71058] = 72822, -- Orzorga's Blood Price Pie + [71059] = 72824, -- Orzorga's Smoked Bear Haunch + [87685] = 84678, -- Sweet Sanguine Apples + [87686] = 84681, -- Crisp and Crunchy Pumpkin Snack Skewer + [87687] = 84700, -- Bowl of "Peeled Eyeballs" + [87690] = 84704, -- Witchmother's Party Punch + [87691] = 84709, -- Crunchy Spider Skewer + [87695] = 84720, -- Ghastly Eye Bowl + [87696] = 84725, -- Frosted Brains + [87697] = 84731, -- Witchmother's Potent Brew + [87699] = 84735, -- Purifying Bloody Mara + [94437] = 85484, -- Crown Crate Fortifying Meal + [94438] = 85497, -- Crown Crate Refreshing Drink + [101879] = 86559, -- Hissmir Fish-Eye Rye + [112425] = 86673, -- Lava Foot Soup-and-Saltrice + [112426] = 86677, -- Bergama Warning Fire + [112433] = 86746, -- Betnikh Twice-Spiked Ale + [112434] = 86749, -- Jagga-Drenched "Mud Ball" + [112435] = 84678, -- Old Aldmeri Orphan Gruel + [112438] = 86787, -- Rajhin's Sugar Claws + [112439] = 86789, -- Alcaire Festival Sword-Pie + [112440] = 86791, -- Snow Bear Glow-Wine + [120436] = 84678, -- Princess's Delight + [120762] = 89955, -- Candied Jester's Coins + [120763] = 89957, -- Dubious Camoran Throne + [120764] = 89971, -- Jewels of Misrule + [133554] = 100502, -- Deregulated Mushroom Stew + [133555] = 100488, -- Spring-Loaded Infusion + [133556] = 100498, -- Clockwork Citrus Filet + [139016] = 107748, -- Artaeum Pickled Fish Bowl + [139018] = 107789, -- Artaeum Takeaway Broth + [153625] = 127531, -- Corrupting Bloody Mara + [153627] = 127572, -- Pack Leader's Bone Broth + [153629] = 127596, -- Bewitched Sugar Skulls + [171322] = 148633, -- Sparkling Mudcrab Apple Cider +} + +WW.CONDITIONS = { + NONE = 0, + EVERYWHERE = -1, +} + +WW.DISABLEDBAGS = { + [BAG_GUILDBANK] = true, + [BAG_BUYBACK] = true, + [BAG_DELETE] = true, + [BAG_VIRTUAL] = true, +} + +WW.MARKINVENTORIES = { + ZO_PlayerInventoryBackpack, + ZO_PlayerBankBackpack, + ZO_GuildBankBackpack, + ZO_SmithingTopLevelDeconstructionPanelInventoryBackpack, + ZO_SmithingTopLevelImprovementPanelInventoryBackpack, +} + +WW.TRAITS = { + ITEM_TRAIT_TYPE_ARMOR_DIVINES, + ITEM_TRAIT_TYPE_ARMOR_IMPENETRABLE, + ITEM_TRAIT_TYPE_ARMOR_INFUSED, + ITEM_TRAIT_TYPE_ARMOR_INTRICATE, + ITEM_TRAIT_TYPE_ARMOR_NIRNHONED, + ITEM_TRAIT_TYPE_ARMOR_ORNATE, + ITEM_TRAIT_TYPE_ARMOR_PROSPEROUS, + ITEM_TRAIT_TYPE_ARMOR_REINFORCED, + ITEM_TRAIT_TYPE_ARMOR_STURDY, + ITEM_TRAIT_TYPE_ARMOR_TRAINING, + ITEM_TRAIT_TYPE_ARMOR_WELL_FITTED, + ITEM_TRAIT_TYPE_JEWELRY_ARCANE, + ITEM_TRAIT_TYPE_JEWELRY_BLOODTHIRSTY, + ITEM_TRAIT_TYPE_JEWELRY_HARMONY, + ITEM_TRAIT_TYPE_JEWELRY_HEALTHY, + ITEM_TRAIT_TYPE_JEWELRY_INFUSED, + ITEM_TRAIT_TYPE_JEWELRY_INTRICATE, + ITEM_TRAIT_TYPE_JEWELRY_ORNATE, + ITEM_TRAIT_TYPE_JEWELRY_PROTECTIVE, + ITEM_TRAIT_TYPE_JEWELRY_ROBUST, + ITEM_TRAIT_TYPE_JEWELRY_SWIFT, + ITEM_TRAIT_TYPE_JEWELRY_TRIUNE, + ITEM_TRAIT_TYPE_WEAPON_CHARGED, + ITEM_TRAIT_TYPE_WEAPON_DECISIVE, + ITEM_TRAIT_TYPE_WEAPON_DEFENDING, + ITEM_TRAIT_TYPE_WEAPON_INFUSED, + ITEM_TRAIT_TYPE_WEAPON_INTRICATE, + ITEM_TRAIT_TYPE_WEAPON_NIRNHONED, + ITEM_TRAIT_TYPE_WEAPON_ORNATE, + ITEM_TRAIT_TYPE_WEAPON_POWERED, + ITEM_TRAIT_TYPE_WEAPON_PRECISE, + ITEM_TRAIT_TYPE_WEAPON_SHARPENED, + ITEM_TRAIT_TYPE_WEAPON_TRAINING, +} + +WW.PREVIEW = { + CHARACTERS = { + "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", + "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", + "y", "z", "1", "2", "3", "4", "5", "6", "7", "8", "9", + }, + TRAITS = { + [0] = 0, + }, + FOOD = { + [0] = 0, + ["0"] = 0, + }, +} + +WW.DUNGEONSTAGS = { + "WGT", + "ICP", + "ROM", + "COS", + "FH", + "BF", + "FL", + "SCP", + "MHK", + "MOS", + "FV", + "DOM", + "LOM", + "MGF", + "IR", + "UHG", + "SG", + "CT", + "BDV", + "TC", + "RPB", + "DC", + "CA", + "SR", + "ERE", + "GD", + "BS", + "SH", + "BV", + "OP", } \ No newline at end of file diff --git a/src/WizardsWardrobeQueue.lua b/src/utils/WizardsWardrobeQueue.lua similarity index 95% rename from src/WizardsWardrobeQueue.lua rename to src/utils/WizardsWardrobeQueue.lua index 5687729..b31e9b3 100644 --- a/src/WizardsWardrobeQueue.lua +++ b/src/utils/WizardsWardrobeQueue.lua @@ -1,71 +1,71 @@ -WizardsWardrobe = WizardsWardrobe or {} -local WW = WizardsWardrobe - -WW.queue = {} -local WWQ = WW.queue -WWQ.list = { first = 0, last = -1 } -local WWL = WWQ.list - -function WWQ.Init() - WWQ.name = WW.name .. "Queue" - WWQ.queueRunning = false - EVENT_MANAGER:RegisterForEvent( WWQ.name, EVENT_PLAYER_COMBAT_STATE, WWQ.StartQueue ) - EVENT_MANAGER:RegisterForEvent( WWQ.name, EVENT_PLAYER_REINCARNATED, WWQ.StartQueue ) -- no longer ghost - EVENT_MANAGER:RegisterForEvent( WWQ.name, EVENT_PLAYER_ALIVE, WWQ.StartQueue ) -- revive at wayshrine -end - -function WWQ.Run() - if WWQ.queueRunning then - return - end - - WWQ.queueRunning = true - while WWQ.Size() > 0 - and not IsUnitInCombat( "player" ) - and not IsUnitDeadOrReincarnating( "player" ) do - local task = WWQ.Pop() - task() - end - WWQ.queueRunning = false -end - -function WWQ.Push( task, delay ) - if delay and delay > 0 then - local delayedFunction = function() - zo_callLater( task, delay ) - end - WWQ.Push( delayedFunction ) - return - end - - local last = WWL.last + 1 - WWL.last = last - WWL[ last ] = task - - WWQ.Run() -end - -function WWQ.Pop() - if WWQ.Size() < 1 then return nil end - local first = WWL.first - local task = WWL[ first ] - WWL[ first ] = nil - WWL.first = first + 1 - return task -end - -function WWQ.Size() - return WWL.last - WWL.first + 1 -end - -function WWQ.Reset() - WWL = { first = 0, last = -1 } -end - -function WWQ.StartQueue() - zo_callLater( function() - if WWQ.Size() > 0 and not IsUnitInCombat( "player" ) then - WWQ.Run() - end - end, 800 ) -end +WizardsWardrobe = WizardsWardrobe or {} +local WW = WizardsWardrobe + +WW.queue = {} +local WWQ = WW.queue +WWQ.list = { first = 0, last = -1 } +local WWL = WWQ.list + +function WWQ.Init() + WWQ.name = WW.name .. "Queue" + WWQ.queueRunning = false + EVENT_MANAGER:RegisterForEvent( WWQ.name, EVENT_PLAYER_COMBAT_STATE, WWQ.StartQueue ) + EVENT_MANAGER:RegisterForEvent( WWQ.name, EVENT_PLAYER_REINCARNATED, WWQ.StartQueue ) -- no longer ghost + EVENT_MANAGER:RegisterForEvent( WWQ.name, EVENT_PLAYER_ALIVE, WWQ.StartQueue ) -- revive at wayshrine +end + +function WWQ.Run() + if WWQ.queueRunning then + return + end + + WWQ.queueRunning = true + while WWQ.Size() > 0 + and not IsUnitInCombat( "player" ) + and not IsUnitDeadOrReincarnating( "player" ) do + local task = WWQ.Pop() + task() + end + WWQ.queueRunning = false +end + +function WWQ.Push( task, delay ) + if delay and delay > 0 then + local delayedFunction = function() + zo_callLater( task, delay ) + end + WWQ.Push( delayedFunction ) + return + end + + local last = WWL.last + 1 + WWL.last = last + WWL[ last ] = task + + WWQ.Run() +end + +function WWQ.Pop() + if WWQ.Size() < 1 then return nil end + local first = WWL.first + local task = WWL[ first ] + WWL[ first ] = nil + WWL.first = first + 1 + return task +end + +function WWQ.Size() + return WWL.last - WWL.first + 1 +end + +function WWQ.Reset() + WWL = { first = 0, last = -1 } +end + +function WWQ.StartQueue() + zo_callLater( function() + if WWQ.Size() > 0 and not IsUnitInCombat( "player" ) then + WWQ.Run() + end + end, 800 ) +end diff --git a/src/WizardsWardrobeSetup.lua b/src/utils/WizardsWardrobeSetup.lua similarity index 95% rename from src/WizardsWardrobeSetup.lua rename to src/utils/WizardsWardrobeSetup.lua index 562f5dd..f13ee58 100644 --- a/src/WizardsWardrobeSetup.lua +++ b/src/utils/WizardsWardrobeSetup.lua @@ -1,279 +1,279 @@ -WizardsWardrobe = WizardsWardrobe or {} -local WW = WizardsWardrobe - -Setup = { - name = GetString( WW_EMPTY ), - disabled = false, - condition = {}, - code = "", - skills = { - [ 0 ] = {}, - [ 1 ] = {}, - }, - gear = { - mythic = nil, - }, - cp = {}, - food = {}, -} - -function Setup:New( data ) - data = data or {} - setmetatable( data, self ) - self.__index = self - return data -end - -function Setup:FromStorage( tag, pageId, index ) - local data = { - name = GetString( WW_EMPTY ), - disabled = false, - condition = {}, - code = "", - skills = { - [ 0 ] = {}, - [ 1 ] = {}, - }, - gear = { - mythic = nil, - }, - cp = {}, - food = {}, - } - if WW.setups[ tag ] - and WW.setups[ tag ][ pageId ] - and WW.setups[ tag ][ pageId ][ index ] then - data = ZO_DeepTableCopy( WW.setups[ tag ][ pageId ][ index ] ) - end - setmetatable( data, self ) - self.__index = self - return data -end - -function Setup:ToStorage( tag, pageId, index ) - if not WW.setups[ tag ] then - WW.setups[ tag ] = {} - end - if not WW.setups[ tag ][ pageId ] then - WW.setups[ tag ][ pageId ] = {} - end - if not WW.setups[ tag ][ pageId ][ index ] then - WW.setups[ tag ][ pageId ][ index ] = {} - end - WW.setups[ tag ][ pageId ][ index ] = ZO_DeepTableCopy( self:GetData() ) -end - -function Setup:Clear() - self.name = GetString( WW_EMPTY ) - self.disabled = false - self.condition = {} - self.code = "" - self.skills = { - [ 0 ] = {}, - [ 1 ] = {}, - } - self.gear = { - mythic = nil, - } - self.cp = {} - self.food = {} -end - -function Setup:GetData() - return { - name = self.name, - disabled = self.disabled, - condition = self.condition, - code = self.code, - skills = self.skills, - gear = self.gear, - cp = self.cp, - food = self.food, - } -end - -function Setup:IsEmpty() - local i = 0 - if next( self.skills[ 0 ] ) then i = i + 1 end - if next( self.skills[ 1 ] ) then i = i + 1 end - if next( self.cp ) then i = i + 1 end - if next( self.gear ) then i = i + 1 end - if next( self.food ) then i = i + 1 end - if #self.code > 0 then i = i + 1 end - return i == 0 -end - -function Setup:IsDisabled() - return self.disabled -end - -function Setup:SetDisabled( disabled ) - self.disabled = disabled -end - -function Setup:GetName() - return self.name -end - -function Setup:SetName( name ) - self.name = name or GetString( WW_UNNAMED ) -end - -function Setup:HasCondition() - if self.condition and self.condition.boss then - return true - end - return false -end - -function Setup:GetCondition() - return self.condition -end - -function Setup:SetCondition( conditionTable ) - self.condition = conditionTable -end - -function Setup:GetCode() - return self.code -end - -function Setup:SetCode( code ) - self.code = code -end - -function Setup:ExecuteCode( setup, zone, pageId, index, auto ) - if not self.code then return end - local func = string.format( "return function(setup, zone, pageId, setupId, autoLoaded) %s end", self.code ) - local exec = zo_loadstring( func ) - if exec then - exec()( setup, zone, pageId, index, auto ) - end -end - -function Setup:GetSkills() - return self.skills -end - -function Setup:SetSkills( skillTable ) - self.skills = skillTable -end - -function Setup:SetSkill( hotbar, slot, abilityId ) - self.skills[ hotbar ][ slot ] = abilityId -end - -function Setup:GetHotbar( hotbarCategory ) - return self.skills[ hotbarCategory ] -end - -function Setup:GetSkillsText() - if not next( self.skills[ 0 ] ) and not next( self.skills[ 1 ] ) then return GetString( WW_BUTTON_SKILLS ) end - local skillsText = {} - for hotbar = 0, 1 do - for slot = 3, 8 do - local abilityId = self:GetHotbar( hotbar )[ slot ] - if abilityId and abilityId > 0 then - local abilityName = zo_strformat( "<>", GetAbilityName( abilityId ) ) - table.insert( skillsText, abilityName ) - end - end - end - return table.concat( skillsText, "\n" ) -end - -function Setup:GetGear() - return self.gear -end - -function Setup:SetGear( gearTable ) - self.gear = gearTable - WW.markers.BuildGearList() -end - -function Setup:GetGearInSlot( gearSlot ) - if self.gear[ gearSlot ] and self.gear[ gearSlot ].id ~= "0" then - return self.gear[ gearSlot ] - end - return nil -end - -function Setup:GetMythic() - return self.gear.mythic, self:GetGearInSlot( self.gear.mythic ) -end - -function Setup:SetMythic( gearSlot ) - self.gear.mythic = gearSlot -end - -function Setup:GetGearText() - if not next( self.gear ) then return GetString( WW_BUTTON_GEAR ) end - local gearText = {} - for _, gearSlot in ipairs( WW.GEARSLOTS ) do - if self.gear[ gearSlot ] then - local link = self.gear[ gearSlot ].link - if link and #link > 0 then - local itemQuality = GetItemLinkDisplayQuality( link ) - local itemColor = GetItemQualityColor( itemQuality ) - local itemName = LocalizeString( "<>", GetItemLinkName( link ) ) - if self.gear[ gearSlot ].creator then - itemName = string.format( "%s (%s)", itemName, self.gear[ gearSlot ].creator ) - end - table.insert( gearText, itemColor:Colorize( itemName ) ) - end - end - end - return table.concat( gearText, "\n" ) -end - -function Setup:GetCP() - return self.cp -end - -function Setup:SetCP( cpTable ) - self.cp = cpTable -end - -function Setup:GetCPText() - if not next( self.cp ) then return GetString( WW_BUTTON_CP ) end - local cpText = {} - for slotIndex = 1, 12 do - local skillId = self.cp[ slotIndex ] - if skillId then - local skillName = zo_strformat( "<>", GetChampionSkillName( skillId ) ) - if #skillName > 0 then - local line = string.format( "|c%s%s|r", WW.CPCOLOR[ slotIndex ], skillName ) - table.insert( cpText, line ) - end - end - end - return table.concat( cpText, "\n" ) -end - -function Setup:GetFood() - return self.food -end - -function Setup:SetFood( foodTable ) - self.food = foodTable -end - -function WW.MigrateSkills() - local setupCounter = 0 - local migratedCounter = 0 - for entry in WW.SetupIterator() do - local setup = entry.setup - if setup.skills and type( setup.skills[ 0 ][ 3 ] ) == "table" then - for hotbar = 0, 1 do - for slot = 3, 8 do - local abilityId = setup.skills[ hotbar ][ slot ].id - setup.skills[ hotbar ][ slot ] = tonumber( abilityId ) - end - end - migratedCounter = migratedCounter + 1 - end - setupCounter = setupCounter + 1 - end - local messagePattern = "Looped through %d setups and migrated %d of them." - WW.Log( messagePattern, WW.LOGTYPES.INFO, "FFFFFF", setupCounter, migratedCounter ) -end +WizardsWardrobe = WizardsWardrobe or {} +local WW = WizardsWardrobe + +Setup = { + name = GetString( WW_EMPTY ), + disabled = false, + condition = {}, + code = "", + skills = { + [ 0 ] = {}, + [ 1 ] = {}, + }, + gear = { + mythic = nil, + }, + cp = {}, + food = {}, +} + +function Setup:New( data ) + data = data or {} + setmetatable( data, self ) + self.__index = self + return data +end + +function Setup:FromStorage( tag, pageId, index ) + local data = { + name = GetString( WW_EMPTY ), + disabled = false, + condition = {}, + code = "", + skills = { + [ 0 ] = {}, + [ 1 ] = {}, + }, + gear = { + mythic = nil, + }, + cp = {}, + food = {}, + } + if WW.setups[ tag ] + and WW.setups[ tag ][ pageId ] + and WW.setups[ tag ][ pageId ][ index ] then + data = ZO_DeepTableCopy( WW.setups[ tag ][ pageId ][ index ] ) + end + setmetatable( data, self ) + self.__index = self + return data +end + +function Setup:ToStorage( tag, pageId, index ) + if not WW.setups[ tag ] then + WW.setups[ tag ] = {} + end + if not WW.setups[ tag ][ pageId ] then + WW.setups[ tag ][ pageId ] = {} + end + if not WW.setups[ tag ][ pageId ][ index ] then + WW.setups[ tag ][ pageId ][ index ] = {} + end + WW.setups[ tag ][ pageId ][ index ] = ZO_DeepTableCopy( self:GetData() ) +end + +function Setup:Clear() + self.name = GetString( WW_EMPTY ) + self.disabled = false + self.condition = {} + self.code = "" + self.skills = { + [ 0 ] = {}, + [ 1 ] = {}, + } + self.gear = { + mythic = nil, + } + self.cp = {} + self.food = {} +end + +function Setup:GetData() + return { + name = self.name, + disabled = self.disabled, + condition = self.condition, + code = self.code, + skills = self.skills, + gear = self.gear, + cp = self.cp, + food = self.food, + } +end + +function Setup:IsEmpty() + local i = 0 + if next( self.skills[ 0 ] ) then i = i + 1 end + if next( self.skills[ 1 ] ) then i = i + 1 end + if next( self.cp ) then i = i + 1 end + if next( self.gear ) then i = i + 1 end + if next( self.food ) then i = i + 1 end + if #self.code > 0 then i = i + 1 end + return i == 0 +end + +function Setup:IsDisabled() + return self.disabled +end + +function Setup:SetDisabled( disabled ) + self.disabled = disabled +end + +function Setup:GetName() + return self.name +end + +function Setup:SetName( name ) + self.name = name or GetString( WW_UNNAMED ) +end + +function Setup:HasCondition() + if self.condition and self.condition.boss then + return true + end + return false +end + +function Setup:GetCondition() + return self.condition +end + +function Setup:SetCondition( conditionTable ) + self.condition = conditionTable +end + +function Setup:GetCode() + return self.code +end + +function Setup:SetCode( code ) + self.code = code +end + +function Setup:ExecuteCode( setup, zone, pageId, index, auto ) + if not self.code then return end + local func = string.format( "return function(setup, zone, pageId, setupId, autoLoaded) %s end", self.code ) + local exec = zo_loadstring( func ) + if exec then + exec()( setup, zone, pageId, index, auto ) + end +end + +function Setup:GetSkills() + return self.skills +end + +function Setup:SetSkills( skillTable ) + self.skills = skillTable +end + +function Setup:SetSkill( hotbar, slot, abilityId ) + self.skills[ hotbar ][ slot ] = abilityId +end + +function Setup:GetHotbar( hotbarCategory ) + return self.skills[ hotbarCategory ] +end + +function Setup:GetSkillsText() + if not next( self.skills[ 0 ] ) and not next( self.skills[ 1 ] ) then return GetString( WW_BUTTON_SKILLS ) end + local skillsText = {} + for hotbar = 0, 1 do + for slot = 3, 8 do + local abilityId = self:GetHotbar( hotbar )[ slot ] + if abilityId and abilityId > 0 then + local abilityName = zo_strformat( "<>", GetAbilityName( abilityId ) ) + table.insert( skillsText, abilityName ) + end + end + end + return table.concat( skillsText, "\n" ) +end + +function Setup:GetGear() + return self.gear +end + +function Setup:SetGear( gearTable ) + self.gear = gearTable + WW.markers.BuildGearList() +end + +function Setup:GetGearInSlot( gearSlot ) + if self.gear[ gearSlot ] and self.gear[ gearSlot ].id ~= "0" then + return self.gear[ gearSlot ] + end + return nil +end + +function Setup:GetMythic() + return self.gear.mythic, self:GetGearInSlot( self.gear.mythic ) +end + +function Setup:SetMythic( gearSlot ) + self.gear.mythic = gearSlot +end + +function Setup:GetGearText() + if not next( self.gear ) then return GetString( WW_BUTTON_GEAR ) end + local gearText = {} + for _, gearSlot in ipairs( WW.GEARSLOTS ) do + if self.gear[ gearSlot ] then + local link = self.gear[ gearSlot ].link + if link and #link > 0 then + local itemQuality = GetItemLinkDisplayQuality( link ) + local itemColor = GetItemQualityColor( itemQuality ) + local itemName = LocalizeString( "<>", GetItemLinkName( link ) ) + if self.gear[ gearSlot ].creator then + itemName = string.format( "%s (%s)", itemName, self.gear[ gearSlot ].creator ) + end + table.insert( gearText, itemColor:Colorize( itemName ) ) + end + end + end + return table.concat( gearText, "\n" ) +end + +function Setup:GetCP() + return self.cp +end + +function Setup:SetCP( cpTable ) + self.cp = cpTable +end + +function Setup:GetCPText() + if not next( self.cp ) then return GetString( WW_BUTTON_CP ) end + local cpText = {} + for slotIndex = 1, 12 do + local skillId = self.cp[ slotIndex ] + if skillId then + local skillName = zo_strformat( "<>", GetChampionSkillName( skillId ) ) + if #skillName > 0 then + local line = string.format( "|c%s%s|r", WW.CPCOLOR[ slotIndex ], skillName ) + table.insert( cpText, line ) + end + end + end + return table.concat( cpText, "\n" ) +end + +function Setup:GetFood() + return self.food +end + +function Setup:SetFood( foodTable ) + self.food = foodTable +end + +function WW.MigrateSkills() + local setupCounter = 0 + local migratedCounter = 0 + for entry in WW.SetupIterator() do + local setup = entry.setup + if setup.skills and type( setup.skills[ 0 ][ 3 ] ) == "table" then + for hotbar = 0, 1 do + for slot = 3, 8 do + local abilityId = setup.skills[ hotbar ][ slot ].id + setup.skills[ hotbar ][ slot ] = tonumber( abilityId ) + end + end + migratedCounter = migratedCounter + 1 + end + setupCounter = setupCounter + 1 + end + local messagePattern = "Looped through %d setups and migrated %d of them." + WW.Log( messagePattern, WW.LOGTYPES.INFO, "FFFFFF", setupCounter, migratedCounter ) +end diff --git a/src/WizardsWardrobeSetupValidation.lua b/src/utils/WizardsWardrobeSetupValidation.lua similarity index 100% rename from src/WizardsWardrobeSetupValidation.lua rename to src/utils/WizardsWardrobeSetupValidation.lua diff --git a/src/WizardsWardrobeUtils.lua b/src/utils/WizardsWardrobeUtils.lua similarity index 96% rename from src/WizardsWardrobeUtils.lua rename to src/utils/WizardsWardrobeUtils.lua index d29a212..c04db37 100644 --- a/src/WizardsWardrobeUtils.lua +++ b/src/utils/WizardsWardrobeUtils.lua @@ -1,284 +1,284 @@ -WizardsWardrobe = WizardsWardrobe or {} -local WW = WizardsWardrobe - -WW.gui = WW.gui or {} -local WWG = WW.gui - -function WW.GetSelectedPage( zone ) - if WW.pages[ zone.tag ] and WW.pages[ zone.tag ][ 0 ] then - return WW.pages[ zone.tag ][ 0 ].selected - end - return nil -end - -function WW.GetBossName( zone, index ) - if zone.bosses - and zone.bosses[ index ] - and zone.bosses[ index ].name - and zone.bosses[ index ].name ~= GetString( WW_EMPTY ) then - return zone.bosses[ index ].displayName or zone.bosses[ index ].name - end - return nil -end - -function WW.ChangeItemLinkStyle( itemLink, linkStyle ) - return string.format( "%s%d%s", itemLink:sub( 1, 2 ), linkStyle, itemLink:sub( 4 ) ) -end - -function WW.CompareCP( setup ) - for slotIndex = 1, 12 do - local savedSkillId = setup:GetCP()[ slotIndex ] - local selectedSkilId = GetSlotBoundId( slotIndex, HOTBAR_CATEGORY_CHAMPION ) - if not savedSkillId or savedSkillId ~= selectedSkilId then - return false - end - end - return true -end - -function WW.CheckGear( zone, pageId ) - local missingTable = {} - local inventoryList = WW.GetItemLocation() - for entry in WW.PageIterator( zone, pageId ) do - local setup = Setup:FromStorage( zone.tag, pageId, entry.index ) - for _, gearSlot in ipairs( WW.GEARSLOTS ) do - if gearSlot ~= EQUIP_SLOT_POISON and gearSlot ~= EQUIP_SLOT_BACKUP_POISON then - local gear = setup:GetGearInSlot( gearSlot ) - if gear and gear.id ~= "0" then - if not inventoryList[ gear.id ] then - table.insert( missingTable, gear.link ) - - -- sorts out duplicates - inventoryList[ gear.id ] = 0 - end - end - end - end - end - return missingTable -end - -function WW.GetItemLocation() - local inventoryList = {} - for _, bag in ipairs( { BAG_WORN, BAG_BACKPACK } ) do - for slot = 0, GetBagSize( bag ) do - local lookupId = Id64ToString( GetItemUniqueId( bag, slot ) ) - inventoryList[ lookupId ] = { - bag = bag, - slot = slot, - } - end - end - return inventoryList -end - -function WW.IsMythic( bag, slot ) - local _, _, _, _, _, _, _, _, itemType = GetItemInfo( bag, slot ) - if itemType == 6 then - return true - end - return false -end - -function WW.IsWipe() - if not IsUnitGrouped( "player" ) then - if IsUnitDeadOrReincarnating( "player" ) then - return true - end - return false - end - for i = 1, GetGroupSize() do - local groupTag = GetGroupUnitTagByIndex( i ) - if IsUnitOnline( groupTag ) then - if not IsUnitDeadOrReincarnating( groupTag ) then - return false - end - end - end - return true -end - -function WW.Log( logMessage, logType, formatColor, ... ) - if WW.settings.printMessages == "chat" or WW.settings.printMessages == "alert" or WW.settings.printMessages == "announcement" then - if not logType then logType = WW.LOGTYPES.NORMAL end - if not formatColor then formatColor = "FFFFFF" end - logMessage = string.format( logMessage, ... ) - logMessage = string.gsub( logMessage, "%[", "|c" .. formatColor .. "[" ) - logMessage = string.gsub( logMessage, "%]", "]|c" .. logType ) - logMessage = string.format( "|c18bed8[|c65d3b0W|cb2e789W|cfffc61]|r|c%s %s|r", logType, logMessage ) - - if WW.settings.printMessages == "alert" then - ZO_Alert( UI_ALERT_CATEGORY_ALERT, nil, logMessage ) - elseif WW.settings.printMessages == "announcement" then - local sound = SOUNDS.NONE - if logType == WW.LOGTYPES.ERROR then - sound = SOUNDS.GENERAL_ALERT_ERROR - end - local messageParams = CENTER_SCREEN_ANNOUNCE:CreateMessageParams( CSA_CATEGORY_MAJOR_TEXT, - sound ) - messageParams:SetText( logMessage ) - messageParams:SetCSAType( CENTER_SCREEN_ANNOUNCE_TYPE_BATTLEGROUND_NEARING_VICTORY ) - CENTER_SCREEN_ANNOUNCE:AddMessageWithParams( messageParams ) - else - CHAT_ROUTER:AddSystemMessage( logMessage ) - end - end -end - -function WW.GetTableLength( givenTable ) - local count = 0 - for _ in pairs( givenTable ) do - count = count + 1 - end - return count -end - --- food -function WW.FindFood( foodChoice ) - if not foodChoice then return nil end - local consumables = WW.GetConsumableItems() - for _, itemId in ipairs( foodChoice ) do - if consumables[ itemId ] then - return consumables[ itemId ] - end - end - return nil -end - -function WW.GetConsumableItems() - local itemList = {} - for slotIndex = 0, GetBagSize( BAG_BACKPACK ) do - local itemType = GetItemType( BAG_BACKPACK, slotIndex ) - if itemType == ITEMTYPE_DRINK or itemType == ITEMTYPE_FOOD then - local itemLink = GetItemLink( BAG_BACKPACK, slotIndex, LINK_STYLE_DEFAULT ) - local itemId = GetItemLinkItemId( itemLink ) - itemList[ itemId ] = slotIndex - end - end - return itemList -end - -function WW.HasFoodIdRunning( itemId ) - for i = 1, GetNumBuffs( "player" ) do - local abilityId = select( 11, GetUnitBuffInfo( "player", i ) ) - if WW.BUFFFOOD[ itemId ] == abilityId then - return abilityId - end - end - return false -end - -function WW.HasFoodRunning() - for i = 1, GetNumBuffs( "player" ) do - local abilityId = select( 11, GetUnitBuffInfo( "player", i ) ) - if WW.lookupBuffFood[ abilityId ] then - return abilityId - end - end - return false -end - --- gui -function WWG.HidePage( hidden ) - if WWG.zones[ WW.selection.zone.tag ] - and WWG.zones[ WW.selection.zone.tag ].scrollContainer then - WWG.zones[ WW.selection.zone.tag ].scrollContainer:SetHidden( hidden ) - end -end - -function WWG.SetSetupDisabled( zone, pageId, index, disabled ) - local setup = Setup:FromStorage( zone.tag, pageId, index ) - setup:SetDisabled( disabled ) - setup:ToStorage( zone.tag, pageId, index ) - WWG.RefreshSetup( zone, pageId, index ) -end - -function WWG.GetSortedZoneList() - local zoneList = {} - for _, zone in pairs( WW.zones ) do - table.insert( zoneList, zone ) - end - table.sort( zoneList, function( a, b ) return a.priority < b.priority end ) - return zoneList -end - -function WWG.GearLinkTableToString( gearLinkTable ) - local gearText = {} - for _, gear in ipairs( gearLinkTable ) do - local itemQuality = GetItemLinkDisplayQuality( gear ) - local itemColor = GetItemQualityColor( itemQuality ) - local itemName = LocalizeString( "<>", GetItemLinkName( gear ) ) - table.insert( gearText, itemColor:Colorize( itemName ) ) - end - return table.concat( gearText, "\n" ) -end - -function WWG.SetTooltip( control, align, text ) - control:SetMouseEnabled( true ) - control:SetHandler( "OnMouseEnter", function( self ) - if text and text ~= "" then - ZO_Tooltips_ShowTextTooltip( self, align, tostring( text ) ) - end - end ) - control:SetHandler( "OnMouseExit", function( self ) - ZO_Tooltips_HideTextTooltip() - end ) -end - -function WWG.ShowConfirmationDialog( name, dialogText, confirmCallback, cancelCallback ) - local uniqueId = string.format( "%s%s", "WizardsWardrobeDialog", name ) - ESO_Dialogs[ uniqueId ] = { - canQueue = true, - uniqueIdentifier = uniqueId, - title = { text = WW.displayName }, - mainText = { text = dialogText }, - buttons = { - [ 1 ] = { - text = SI_DIALOG_CONFIRM, - callback = function() - confirmCallback() - end, - }, - [ 2 ] = { - text = SI_DIALOG_CANCEL, - callback = function() - if cancelCallback then - cancelCallback() - end - end, - }, - }, - setup = function() end, - } - ZO_Dialogs_ShowDialog( uniqueId, nil, { mainTextParams = {} } ) -end - -function WWG.ShowEditDialog( name, dialogText, initialText, confirmCallback, cancelCallback ) - local uniqueId = string.format( "%s%s", "WizardsWardrobeDialog", name ) - ESO_Dialogs[ uniqueId ] = { - canQueue = true, - uniqueIdentifier = uniqueId, - title = { text = WW.displayName }, - mainText = { text = dialogText }, - editBox = {}, - buttons = { - [ 1 ] = { - text = SI_DIALOG_CONFIRM, - callback = function( dialog ) - local input = ZO_Dialogs_GetEditBoxText( dialog ) - confirmCallback( input ) - end, - }, - [ 2 ] = { - text = SI_DIALOG_CANCEL, - callback = function() - if cancelCallback then - cancelCallback() - end - end, - }, - }, - setup = function() end, - } - ZO_Dialogs_ShowDialog( uniqueId, nil, { mainTextParams = {}, initialEditText = initialText } ) -end +WizardsWardrobe = WizardsWardrobe or {} +local WW = WizardsWardrobe + +WW.gui = WW.gui or {} +local WWG = WW.gui + +function WW.GetSelectedPage( zone ) + if WW.pages[ zone.tag ] and WW.pages[ zone.tag ][ 0 ] then + return WW.pages[ zone.tag ][ 0 ].selected + end + return nil +end + +function WW.GetBossName( zone, index ) + if zone.bosses + and zone.bosses[ index ] + and zone.bosses[ index ].name + and zone.bosses[ index ].name ~= GetString( WW_EMPTY ) then + return zone.bosses[ index ].displayName or zone.bosses[ index ].name + end + return nil +end + +function WW.ChangeItemLinkStyle( itemLink, linkStyle ) + return string.format( "%s%d%s", itemLink:sub( 1, 2 ), linkStyle, itemLink:sub( 4 ) ) +end + +function WW.CompareCP( setup ) + for slotIndex = 1, 12 do + local savedSkillId = setup:GetCP()[ slotIndex ] + local selectedSkilId = GetSlotBoundId( slotIndex, HOTBAR_CATEGORY_CHAMPION ) + if not savedSkillId or savedSkillId ~= selectedSkilId then + return false + end + end + return true +end + +function WW.CheckGear( zone, pageId ) + local missingTable = {} + local inventoryList = WW.GetItemLocation() + for entry in WW.PageIterator( zone, pageId ) do + local setup = Setup:FromStorage( zone.tag, pageId, entry.index ) + for _, gearSlot in ipairs( WW.GEARSLOTS ) do + if gearSlot ~= EQUIP_SLOT_POISON and gearSlot ~= EQUIP_SLOT_BACKUP_POISON then + local gear = setup:GetGearInSlot( gearSlot ) + if gear and gear.id ~= "0" then + if not inventoryList[ gear.id ] then + table.insert( missingTable, gear.link ) + + -- sorts out duplicates + inventoryList[ gear.id ] = 0 + end + end + end + end + end + return missingTable +end + +function WW.GetItemLocation() + local inventoryList = {} + for _, bag in ipairs( { BAG_WORN, BAG_BACKPACK } ) do + for slot = 0, GetBagSize( bag ) do + local lookupId = Id64ToString( GetItemUniqueId( bag, slot ) ) + inventoryList[ lookupId ] = { + bag = bag, + slot = slot, + } + end + end + return inventoryList +end + +function WW.IsMythic( bag, slot ) + local _, _, _, _, _, _, _, _, itemType = GetItemInfo( bag, slot ) + if itemType == 6 then + return true + end + return false +end + +function WW.IsWipe() + if not IsUnitGrouped( "player" ) then + if IsUnitDeadOrReincarnating( "player" ) then + return true + end + return false + end + for i = 1, GetGroupSize() do + local groupTag = GetGroupUnitTagByIndex( i ) + if IsUnitOnline( groupTag ) then + if not IsUnitDeadOrReincarnating( groupTag ) then + return false + end + end + end + return true +end + +function WW.Log( logMessage, logType, formatColor, ... ) + if WW.settings.printMessages == "chat" or WW.settings.printMessages == "alert" or WW.settings.printMessages == "announcement" then + if not logType then logType = WW.LOGTYPES.NORMAL end + if not formatColor then formatColor = "FFFFFF" end + logMessage = string.format( logMessage, ... ) + logMessage = string.gsub( logMessage, "%[", "|c" .. formatColor .. "[" ) + logMessage = string.gsub( logMessage, "%]", "]|c" .. logType ) + logMessage = string.format( "|c18bed8[|c65d3b0W|cb2e789W|cfffc61]|r|c%s %s|r", logType, logMessage ) + + if WW.settings.printMessages == "alert" then + ZO_Alert( UI_ALERT_CATEGORY_ALERT, nil, logMessage ) + elseif WW.settings.printMessages == "announcement" then + local sound = SOUNDS.NONE + if logType == WW.LOGTYPES.ERROR then + sound = SOUNDS.GENERAL_ALERT_ERROR + end + local messageParams = CENTER_SCREEN_ANNOUNCE:CreateMessageParams( CSA_CATEGORY_MAJOR_TEXT, + sound ) + messageParams:SetText( logMessage ) + messageParams:SetCSAType( CENTER_SCREEN_ANNOUNCE_TYPE_BATTLEGROUND_NEARING_VICTORY ) + CENTER_SCREEN_ANNOUNCE:AddMessageWithParams( messageParams ) + else + CHAT_ROUTER:AddSystemMessage( logMessage ) + end + end +end + +function WW.GetTableLength( givenTable ) + local count = 0 + for _ in pairs( givenTable ) do + count = count + 1 + end + return count +end + +-- food +function WW.FindFood( foodChoice ) + if not foodChoice then return nil end + local consumables = WW.GetConsumableItems() + for _, itemId in ipairs( foodChoice ) do + if consumables[ itemId ] then + return consumables[ itemId ] + end + end + return nil +end + +function WW.GetConsumableItems() + local itemList = {} + for slotIndex = 0, GetBagSize( BAG_BACKPACK ) do + local itemType = GetItemType( BAG_BACKPACK, slotIndex ) + if itemType == ITEMTYPE_DRINK or itemType == ITEMTYPE_FOOD then + local itemLink = GetItemLink( BAG_BACKPACK, slotIndex, LINK_STYLE_DEFAULT ) + local itemId = GetItemLinkItemId( itemLink ) + itemList[ itemId ] = slotIndex + end + end + return itemList +end + +function WW.HasFoodIdRunning( itemId ) + for i = 1, GetNumBuffs( "player" ) do + local abilityId = select( 11, GetUnitBuffInfo( "player", i ) ) + if WW.BUFFFOOD[ itemId ] == abilityId then + return abilityId + end + end + return false +end + +function WW.HasFoodRunning() + for i = 1, GetNumBuffs( "player" ) do + local abilityId = select( 11, GetUnitBuffInfo( "player", i ) ) + if WW.lookupBuffFood[ abilityId ] then + return abilityId + end + end + return false +end + +-- gui +function WWG.HidePage( hidden ) + if WWG.zones[ WW.selection.zone.tag ] + and WWG.zones[ WW.selection.zone.tag ].scrollContainer then + WWG.zones[ WW.selection.zone.tag ].scrollContainer:SetHidden( hidden ) + end +end + +function WWG.SetSetupDisabled( zone, pageId, index, disabled ) + local setup = Setup:FromStorage( zone.tag, pageId, index ) + setup:SetDisabled( disabled ) + setup:ToStorage( zone.tag, pageId, index ) + WWG.RefreshSetup( zone, pageId, index ) +end + +function WWG.GetSortedZoneList() + local zoneList = {} + for _, zone in pairs( WW.zones ) do + table.insert( zoneList, zone ) + end + table.sort( zoneList, function( a, b ) return a.priority < b.priority end ) + return zoneList +end + +function WWG.GearLinkTableToString( gearLinkTable ) + local gearText = {} + for _, gear in ipairs( gearLinkTable ) do + local itemQuality = GetItemLinkDisplayQuality( gear ) + local itemColor = GetItemQualityColor( itemQuality ) + local itemName = LocalizeString( "<>", GetItemLinkName( gear ) ) + table.insert( gearText, itemColor:Colorize( itemName ) ) + end + return table.concat( gearText, "\n" ) +end + +function WWG.SetTooltip( control, align, text ) + control:SetMouseEnabled( true ) + control:SetHandler( "OnMouseEnter", function( self ) + if text and text ~= "" then + ZO_Tooltips_ShowTextTooltip( self, align, tostring( text ) ) + end + end ) + control:SetHandler( "OnMouseExit", function( self ) + ZO_Tooltips_HideTextTooltip() + end ) +end + +function WWG.ShowConfirmationDialog( name, dialogText, confirmCallback, cancelCallback ) + local uniqueId = string.format( "%s%s", "WizardsWardrobeDialog", name ) + ESO_Dialogs[ uniqueId ] = { + canQueue = true, + uniqueIdentifier = uniqueId, + title = { text = WW.displayName }, + mainText = { text = dialogText }, + buttons = { + [ 1 ] = { + text = SI_DIALOG_CONFIRM, + callback = function() + confirmCallback() + end, + }, + [ 2 ] = { + text = SI_DIALOG_CANCEL, + callback = function() + if cancelCallback then + cancelCallback() + end + end, + }, + }, + setup = function() end, + } + ZO_Dialogs_ShowDialog( uniqueId, nil, { mainTextParams = {} } ) +end + +function WWG.ShowEditDialog( name, dialogText, initialText, confirmCallback, cancelCallback ) + local uniqueId = string.format( "%s%s", "WizardsWardrobeDialog", name ) + ESO_Dialogs[ uniqueId ] = { + canQueue = true, + uniqueIdentifier = uniqueId, + title = { text = WW.displayName }, + mainText = { text = dialogText }, + editBox = {}, + buttons = { + [ 1 ] = { + text = SI_DIALOG_CONFIRM, + callback = function( dialog ) + local input = ZO_Dialogs_GetEditBoxText( dialog ) + confirmCallback( input ) + end, + }, + [ 2 ] = { + text = SI_DIALOG_CANCEL, + callback = function() + if cancelCallback then + cancelCallback() + end + end, + }, + }, + setup = function() end, + } + ZO_Dialogs_ShowDialog( uniqueId, nil, { mainTextParams = {}, initialEditText = initialText } ) +end diff --git a/src/zones/BRP.lua b/src/zones/arenas/BRP.lua similarity index 96% rename from src/zones/BRP.lua rename to src/zones/arenas/BRP.lua index 8b3c31c..fcd737f 100644 --- a/src/zones/BRP.lua +++ b/src/zones/arenas/BRP.lua @@ -1,201 +1,201 @@ -local WW = WizardsWardrobe -WW.zones["BRP"] = {} -local BRP = WW.zones["BRP"] - -BRP.name = GetString(WW_BRP_NAME) -BRP.tag = "BRP" -BRP.icon = "/esoui/art/icons/achievement_blackrose_veteran.dds" -BRP.priority = 13 -BRP.id = 1082 -BRP.node = 378 - -BRP.bosses = { - [1] = { - name = GetString(WW_TRASH), - }, - [2] = { - name = GetString(WW_BRP_FIRST), - }, - [3] = { - name = GetString(WW_BRP_SECOND), - }, - [4] = { - name = GetString(WW_BRP_THIRD), - }, - [5] = { - name = GetString(WW_BRP_FOURTH), - }, - [6] = { - name = GetString(WW_BRP_FIFTH), - }, -} - -BRP.LOCATIONS = { - FIRST = { - x1 = 100908, - x2 = 106042, - z1 = 65900, - z2 = 71000, - }, - SECOND = { - x1 = 88100, - x2 = 93100, - z1 = 60911, - z2 = 66032, - }, - THIRD = { - x1 = 94504, - x2 = 99517, - z1 = 46800, - z2 = 51900, - }, - FORTH = { - x1 = 105900, - x2 = 111100, - z1 = 35255, - z2 = 40383, - }, - FIFTH = { - x1 = 93800, - x2 = 98281, - z1 = 28200, - z2 = 33300, - }, -} - -BRP.PORTALID = 114578 - -function BRP.Init() - BRP.lastArena = 0 - - BRP.lastPortalSpawn = 0 - BRP.currentRound = 0 - BRP.currentWave = 0 - - EVENT_MANAGER:UnregisterForEvent(WW.name, EVENT_BOSSES_CHANGED) - EVENT_MANAGER:RegisterForUpdate(WW.name .. BRP.tag .. "MovementLoop", 2000, BRP.OnMovement) - EVENT_MANAGER:RegisterForEvent(WW.name .. BRP.tag, EVENT_PLAYER_COMBAT_STATE, BRP.OnCombatChange) - - EVENT_MANAGER:RegisterForEvent(WW.name .. BRP.tag.. "PortalSpawn", EVENT_COMBAT_EVENT, BRP.OnPortalSpawn) - EVENT_MANAGER:AddFilterForEvent(WW.name .. BRP.tag.. "PortalSpawn", EVENT_COMBAT_EVENT, REGISTER_FILTER_ABILITY_ID, BRP.PORTALID) - EVENT_MANAGER:RegisterForEvent(WW.name .. BRP.tag .. "LastWave", EVENT_DISPLAY_ANNOUNCEMENT, BRP.OnLastWave) -end - -function BRP.Reset() - EVENT_MANAGER:UnregisterForEvent(WW.name .. BRP.tag, EVENT_PLAYER_COMBAT_STATE) - EVENT_MANAGER:UnregisterForUpdate(WW.name .. BRP.tag .. "MovementLoop") - EVENT_MANAGER:RegisterForEvent(WW.name, EVENT_BOSSES_CHANGED, WW.OnBossChange) - - EVENT_MANAGER:UnregisterForEvent(WW.name .. BRP.tag.. "PortalSpawn") - EVENT_MANAGER:UnregisterForEvent(WW.name .. BRP.tag .. "LastWave") -end - -function BRP.OnBossChange(bossName) - WW.conditions.OnBossChange(bossName) -end - -function BRP.OnCombatChange(_, inCombat) - if inCombat == true then - EVENT_MANAGER:UnregisterForUpdate(WW.name .. BRP.tag .. "MovementLoop") - else - EVENT_MANAGER:RegisterForUpdate(WW.name .. BRP.tag .. "MovementLoop", 2000, BRP.OnMovement) - end -end - -function BRP.OnMovement() - local arena = BRP.GetStageByLocation() - --d("Arena " .. tostring(arena) .. " / Last arena " .. BRP.lastArena) - if arena == 0 and BRP.lastArena > 0 then - --d("Trash!") - WW.OnBossChange(_, true, "") - end - BRP.lastArena = arena -end - -function BRP.GetStageByLocation() - local zone, x, y, z = GetUnitWorldPosition("player") - - if x > BRP.LOCATIONS.FIRST.x1 and x < BRP.LOCATIONS.FIRST.x2 - and z > BRP.LOCATIONS.FIRST.z1 and z < BRP.LOCATIONS.FIRST.z2 then - - return 1 - - elseif x > BRP.LOCATIONS.SECOND.x1 and x < BRP.LOCATIONS.SECOND.x2 - and z > BRP.LOCATIONS.SECOND.z1 and z < BRP.LOCATIONS.SECOND.z2 then - - return 2 - - elseif x > BRP.LOCATIONS.THIRD.x1 and x < BRP.LOCATIONS.THIRD.x2 - and z > BRP.LOCATIONS.THIRD.z1 and z < BRP.LOCATIONS.THIRD.z2 then - - return 3 - - elseif x > BRP.LOCATIONS.FORTH.x1 and x < BRP.LOCATIONS.FORTH.x2 - and z > BRP.LOCATIONS.FORTH.z1 and z < BRP.LOCATIONS.FORTH.z2 then - - return 4 - - elseif x > BRP.LOCATIONS.FIFTH.x1 and x < BRP.LOCATIONS.FIFTH.x2 - and z > BRP.LOCATIONS.FIFTH.z1 and z < BRP.LOCATIONS.FIFTH.z2 then - - return 5 - - else - - return 0 - - end -end - --- Stuff below stolen from BRHelper (with permission) --- https://www.esoui.com/downloads/info2181-BlackrosePrisonHelper.html -function BRP.OnLastWave(_, title) - if title == GetString(WW_BRP_FINALROUND) then - BRP.currentRound = 5 - BRP.currentWave = 0 - else - local round = string.match(title, '^.+%s(%d)$') - if round then - BRP.currentRound = tonumber(round) - BRP.currentWave = 0 - end - end -end - -function BRP.Wave() - local stage = BRP.GetStageByLocation() - local round = BRP.currentRound - local wave = BRP.currentWave - - -- STAGE 1 - if stage == 1 then - if round == 4 and wave == 3 then WW.OnBossChange(_, true, GetString(WW_BRP_FIRST)) end - - -- STAGE 2 - elseif stage == 2 then - if round == 4 and wave == 2 then WW.OnBossChange(_, true, GetString(WW_BRP_SECOND)) end - - -- STAGE 3 - elseif stage == 3 then - if round == 4 and wave == 3 then WW.OnBossChange(_, true, GetString(WW_BRP_THIRD)) end - - -- STAGE 4 - elseif stage == 4 then - if round == 4 and wave == 3 then WW.OnBossChange(_, true, GetString(WW_BRP_FOURTH)) end - - -- STAGE 5 - elseif stage == 5 then - if round == 4 and wave == 3 then WW.OnBossChange(_, true, GetString(WW_BRP_FIFTH)) end - end -end - -function BRP.OnPortalSpawn(_, result, _, _, _, _, _, _, _, _, _, _, _, _, _, _, abilityId) - if result == ACTION_RESULT_EFFECT_GAINED then - local spawnTime = GetGameTimeMilliseconds() - if spawnTime - BRP.lastPortalSpawn > 2000 then - BRP.currentWave = BRP.currentWave + 1 - BRP.Wave() - end - BRP.lastPortalSpawn = spawnTime - end -end +local WW = WizardsWardrobe +WW.zones["BRP"] = {} +local BRP = WW.zones["BRP"] + +BRP.name = GetString(WW_BRP_NAME) +BRP.tag = "BRP" +BRP.icon = "/esoui/art/icons/achievement_blackrose_veteran.dds" +BRP.priority = 13 +BRP.id = 1082 +BRP.node = 378 + +BRP.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_BRP_FIRST), + }, + [3] = { + name = GetString(WW_BRP_SECOND), + }, + [4] = { + name = GetString(WW_BRP_THIRD), + }, + [5] = { + name = GetString(WW_BRP_FOURTH), + }, + [6] = { + name = GetString(WW_BRP_FIFTH), + }, +} + +BRP.LOCATIONS = { + FIRST = { + x1 = 100908, + x2 = 106042, + z1 = 65900, + z2 = 71000, + }, + SECOND = { + x1 = 88100, + x2 = 93100, + z1 = 60911, + z2 = 66032, + }, + THIRD = { + x1 = 94504, + x2 = 99517, + z1 = 46800, + z2 = 51900, + }, + FORTH = { + x1 = 105900, + x2 = 111100, + z1 = 35255, + z2 = 40383, + }, + FIFTH = { + x1 = 93800, + x2 = 98281, + z1 = 28200, + z2 = 33300, + }, +} + +BRP.PORTALID = 114578 + +function BRP.Init() + BRP.lastArena = 0 + + BRP.lastPortalSpawn = 0 + BRP.currentRound = 0 + BRP.currentWave = 0 + + EVENT_MANAGER:UnregisterForEvent(WW.name, EVENT_BOSSES_CHANGED) + EVENT_MANAGER:RegisterForUpdate(WW.name .. BRP.tag .. "MovementLoop", 2000, BRP.OnMovement) + EVENT_MANAGER:RegisterForEvent(WW.name .. BRP.tag, EVENT_PLAYER_COMBAT_STATE, BRP.OnCombatChange) + + EVENT_MANAGER:RegisterForEvent(WW.name .. BRP.tag.. "PortalSpawn", EVENT_COMBAT_EVENT, BRP.OnPortalSpawn) + EVENT_MANAGER:AddFilterForEvent(WW.name .. BRP.tag.. "PortalSpawn", EVENT_COMBAT_EVENT, REGISTER_FILTER_ABILITY_ID, BRP.PORTALID) + EVENT_MANAGER:RegisterForEvent(WW.name .. BRP.tag .. "LastWave", EVENT_DISPLAY_ANNOUNCEMENT, BRP.OnLastWave) +end + +function BRP.Reset() + EVENT_MANAGER:UnregisterForEvent(WW.name .. BRP.tag, EVENT_PLAYER_COMBAT_STATE) + EVENT_MANAGER:UnregisterForUpdate(WW.name .. BRP.tag .. "MovementLoop") + EVENT_MANAGER:RegisterForEvent(WW.name, EVENT_BOSSES_CHANGED, WW.OnBossChange) + + EVENT_MANAGER:UnregisterForEvent(WW.name .. BRP.tag.. "PortalSpawn") + EVENT_MANAGER:UnregisterForEvent(WW.name .. BRP.tag .. "LastWave") +end + +function BRP.OnBossChange(bossName) + WW.conditions.OnBossChange(bossName) +end + +function BRP.OnCombatChange(_, inCombat) + if inCombat == true then + EVENT_MANAGER:UnregisterForUpdate(WW.name .. BRP.tag .. "MovementLoop") + else + EVENT_MANAGER:RegisterForUpdate(WW.name .. BRP.tag .. "MovementLoop", 2000, BRP.OnMovement) + end +end + +function BRP.OnMovement() + local arena = BRP.GetStageByLocation() + --d("Arena " .. tostring(arena) .. " / Last arena " .. BRP.lastArena) + if arena == 0 and BRP.lastArena > 0 then + --d("Trash!") + WW.OnBossChange(_, true, "") + end + BRP.lastArena = arena +end + +function BRP.GetStageByLocation() + local zone, x, y, z = GetUnitWorldPosition("player") + + if x > BRP.LOCATIONS.FIRST.x1 and x < BRP.LOCATIONS.FIRST.x2 + and z > BRP.LOCATIONS.FIRST.z1 and z < BRP.LOCATIONS.FIRST.z2 then + + return 1 + + elseif x > BRP.LOCATIONS.SECOND.x1 and x < BRP.LOCATIONS.SECOND.x2 + and z > BRP.LOCATIONS.SECOND.z1 and z < BRP.LOCATIONS.SECOND.z2 then + + return 2 + + elseif x > BRP.LOCATIONS.THIRD.x1 and x < BRP.LOCATIONS.THIRD.x2 + and z > BRP.LOCATIONS.THIRD.z1 and z < BRP.LOCATIONS.THIRD.z2 then + + return 3 + + elseif x > BRP.LOCATIONS.FORTH.x1 and x < BRP.LOCATIONS.FORTH.x2 + and z > BRP.LOCATIONS.FORTH.z1 and z < BRP.LOCATIONS.FORTH.z2 then + + return 4 + + elseif x > BRP.LOCATIONS.FIFTH.x1 and x < BRP.LOCATIONS.FIFTH.x2 + and z > BRP.LOCATIONS.FIFTH.z1 and z < BRP.LOCATIONS.FIFTH.z2 then + + return 5 + + else + + return 0 + + end +end + +-- Stuff below stolen from BRHelper (with permission) +-- https://www.esoui.com/downloads/info2181-BlackrosePrisonHelper.html +function BRP.OnLastWave(_, title) + if title == GetString(WW_BRP_FINALROUND) then + BRP.currentRound = 5 + BRP.currentWave = 0 + else + local round = string.match(title, '^.+%s(%d)$') + if round then + BRP.currentRound = tonumber(round) + BRP.currentWave = 0 + end + end +end + +function BRP.Wave() + local stage = BRP.GetStageByLocation() + local round = BRP.currentRound + local wave = BRP.currentWave + + -- STAGE 1 + if stage == 1 then + if round == 4 and wave == 3 then WW.OnBossChange(_, true, GetString(WW_BRP_FIRST)) end + + -- STAGE 2 + elseif stage == 2 then + if round == 4 and wave == 2 then WW.OnBossChange(_, true, GetString(WW_BRP_SECOND)) end + + -- STAGE 3 + elseif stage == 3 then + if round == 4 and wave == 3 then WW.OnBossChange(_, true, GetString(WW_BRP_THIRD)) end + + -- STAGE 4 + elseif stage == 4 then + if round == 4 and wave == 3 then WW.OnBossChange(_, true, GetString(WW_BRP_FOURTH)) end + + -- STAGE 5 + elseif stage == 5 then + if round == 4 and wave == 3 then WW.OnBossChange(_, true, GetString(WW_BRP_FIFTH)) end + end +end + +function BRP.OnPortalSpawn(_, result, _, _, _, _, _, _, _, _, _, _, _, _, _, _, abilityId) + if result == ACTION_RESULT_EFFECT_GAINED then + local spawnTime = GetGameTimeMilliseconds() + if spawnTime - BRP.lastPortalSpawn > 2000 then + BRP.currentWave = BRP.currentWave + 1 + BRP.Wave() + end + BRP.lastPortalSpawn = spawnTime + end +end diff --git a/src/zones/arenas/DSA.lua b/src/zones/arenas/DSA.lua new file mode 100644 index 0000000..25d140c --- /dev/null +++ b/src/zones/arenas/DSA.lua @@ -0,0 +1,49 @@ +local WW = WizardsWardrobe +WW.zones["DSA"] = {} +local DSA = WW.zones["DSA"] + +DSA.name = GetString(WW_DSA_NAME) +DSA.tag = "DSA" +DSA.icon = "/esoui/art/icons/achievement_026.dds" +DSA.priority = 50 +DSA.id = 635 +DSA.node = 270 + +DSA.bosses = { + [1] = { + name = GetString(WW_EMPTY), + }, + [2] = { + name = GetString(WW_EMPTY), + }, + [3] = { + name = GetString(WW_EMPTY), + }, + [4] = { + name = GetString(WW_EMPTY), + }, + [5] = { + name = GetString(WW_EMPTY), + }, + [6] = { + name = GetString(WW_EMPTY), + }, + [7] = { + name = GetString(WW_EMPTY), + }, + [8] = { + name = GetString(WW_EMPTY), + }, +} + +function DSA.Init() + +end + +function DSA.Reset() + +end + +function DSA.OnBossChange(bossName) + +end diff --git a/src/zones/EA.lua b/src/zones/arenas/EA.lua similarity index 100% rename from src/zones/EA.lua rename to src/zones/arenas/EA.lua diff --git a/src/zones/arenas/MA.lua b/src/zones/arenas/MA.lua new file mode 100644 index 0000000..5426bfe --- /dev/null +++ b/src/zones/arenas/MA.lua @@ -0,0 +1,52 @@ +local WW = WizardsWardrobe +WW.zones["MA"] = {} +local MA = WW.zones["MA"] + +MA.name = GetString(WW_MA_NAME) +MA.tag = "MA" +MA.icon = "/esoui/art/icons/store_orsiniumdlc_maelstromarena.dds" +MA.priority = 52 +MA.id = 677 +MA.node = 249 + +MA.bosses = { + [1] = { + name = GetString(WW_EMPTY), + }, + [2] = { + name = GetString(WW_EMPTY), + }, + [3] = { + name = GetString(WW_EMPTY), + }, + [4] = { + name = GetString(WW_EMPTY), + }, + [5] = { + name = GetString(WW_EMPTY), + }, + [6] = { + name = GetString(WW_EMPTY), + }, + [7] = { + name = GetString(WW_EMPTY), + }, + [8] = { + name = GetString(WW_EMPTY), + }, + [8] = { + name = GetString(WW_EMPTY), + }, +} + +function MA.Init() + +end + +function MA.Reset() + +end + +function MA.OnBossChange(bossName) + +end diff --git a/src/zones/arenas/VH.lua b/src/zones/arenas/VH.lua new file mode 100644 index 0000000..221f93f --- /dev/null +++ b/src/zones/arenas/VH.lua @@ -0,0 +1,49 @@ +local WW = WizardsWardrobe +WW.zones["VH"] = {} +local VH = WW.zones["VH"] + +VH.name = GetString(WW_VH_NAME) +VH.tag = "VH" +VH.icon = "/esoui/art/icons/achievement_u28_varena_veteran.dds" +VH.priority = 53 +VH.id = 1227 +VH.node = 457 + +VH.bosses = { + [1] = { + name = GetString(WW_EMPTY), + }, + [2] = { + name = GetString(WW_EMPTY), + }, + [3] = { + name = GetString(WW_EMPTY), + }, + [4] = { + name = GetString(WW_EMPTY), + }, + [5] = { + name = GetString(WW_EMPTY), + }, + [6] = { + name = GetString(WW_EMPTY), + }, + [7] = { + name = GetString(WW_EMPTY), + }, + [8] = { + name = GetString(WW_EMPTY), + }, +} + +function VH.Init() + +end + +function VH.Reset() + +end + +function VH.OnBossChange(bossName) + +end diff --git a/src/zones/dungeons/BDV.lua b/src/zones/dungeons/BDV.lua new file mode 100644 index 0000000..946207f --- /dev/null +++ b/src/zones/dungeons/BDV.lua @@ -0,0 +1,47 @@ +local WW = WizardsWardrobe +WW.zones["BDV"] = {} +local BDV = WW.zones["BDV"] + +BDV.name = GetString(WW_BDV_NAME) +BDV.tag = "BDV" +BDV.icon = "/esoui/art/icons/achievement_u29_dun1_vet_bosses.dds" +BDV.priority = 118 +BDV.id = 1228 +BDV.node = 437 + +BDV.bosses = { [1] = { + name = GetString(WW_TRASH), + }, [2] = { + name = GetString(WW_BDV_KINRAS_IRONEYE), + }, [3] = { + name = GetString(WW_BDV_CAPTAIN_GEMINUS), + }, [4] = { + name = GetString(WW_BDV_PYROTURGE_ENCRATIS), + }, [5] = { + name = GetString(WW_BDV_AVATAR_OF_ZEAL), + }, [6] = { + name = GetString(WW_BDV_AVATAR_OF_VIGOR), + }, [7] = { + name = GetString(WW_BDV_AVATAR_OF_FORTITUDE), + }, [8] = { + name = GetString(WW_BDV_SENTINEL_AKSALAZ), + }, +} + +function BDV.Init() + +end + +function BDV.Reset() + +end + +function BDV.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = BDV.lookupBosses[bossName] + WW.LoadSetup(BDV, pageId, index, true) +end diff --git a/src/zones/dungeons/BF.lua b/src/zones/dungeons/BF.lua new file mode 100644 index 0000000..8bbf0b4 --- /dev/null +++ b/src/zones/dungeons/BF.lua @@ -0,0 +1,52 @@ +local WW = WizardsWardrobe +WW.zones["BF"] = {} +local BF = WW.zones["BF"] + +BF.name = GetString(WW_BF_NAME) +BF.tag = "BF" +BF.icon = "/esoui/art/icons/achievement_update15_002.dds" +BF.priority = 105 +BF.id = 973 +BF.node = 326 + +BF.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_BF_MATHGAMAIN), + }, + [3] = { + name = GetString(WW_BF_CAILLAOIFE), + }, + [4] = { + name = GetString(WW_BF_STONEHEARTH), + }, + [5] = { + name = GetString(WW_BF_GALCHOBHAR), + }, + [6] = { + name = GetString(WW_BF_GHERIG_BULLBLOOD), + }, + [7] = { + name = GetString(WW_BF_EARTHGORE_AMALGAM), + }, +} + +function BF.Init() + +end + +function BF.Reset() + +end + +function BF.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = BF.lookupBosses[bossName] + WW.LoadSetup(BF, pageId, index, true) +end diff --git a/src/zones/dungeons/BS.lua b/src/zones/dungeons/BS.lua new file mode 100644 index 0000000..958a9d0 --- /dev/null +++ b/src/zones/dungeons/BS.lua @@ -0,0 +1,46 @@ +local WW = WizardsWardrobe +WW.zones["BS"] = {} +local BS = WW.zones["BS"] + +BS.name = GetString(WW_BS_NAME) +BS.tag = "BS" +BS.icon = "/esoui/art/icons/achievement_u37_dun1_vet_bosses.dds" +BS.priority = 126 +BS.id = 1389 +BS.node = 531 + +BS.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_BS_B1), + }, + [3] = { + name = GetString(WW_BS_B2), + }, + [4] = { + name = GetString(WW_BS_B3), + }, + [5] = { + name = GetString(WW_BS_SCB), + }, +} + +function BS.Init() + +end + +function BS.Reset() + +end + +function BS.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = BS.lookupBosses[bossName] + WW.LoadSetup(BS, pageId, index, true) +end diff --git a/src/zones/dungeons/BV.lua b/src/zones/dungeons/BV.lua new file mode 100644 index 0000000..44beacf --- /dev/null +++ b/src/zones/dungeons/BV.lua @@ -0,0 +1,43 @@ +local WW = WizardsWardrobe +WW.zones["BV"] = {} +local BV = WW.zones["BV"] + +BV.name = GetString(WW_BV_NAME) +BV.tag = "BV" +BV.icon = "/esoui/art/icons/achievement_u41_dun2_vet_bosses.dds" +BV.priority = 128 +BV.id = 1471 +BV.node = 565 + +BV.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_BV_B1), + }, + [3] = { + name = GetString(WW_BV_B2), + }, + [4] = { + name = GetString(WW_BV_B3), + }, +} + +function BV.Init() + +end + +function BV.Reset() + +end + +function BV.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = BV.lookupBosses[bossName] + WW.LoadSetup(BV, pageId, index, true) +end diff --git a/src/zones/dungeons/CA.lua b/src/zones/dungeons/CA.lua new file mode 100644 index 0000000..935b778 --- /dev/null +++ b/src/zones/dungeons/CA.lua @@ -0,0 +1,47 @@ +local WW = WizardsWardrobe +WW.zones["CA"] = {} +local CA = WW.zones["CA"] + +CA.name = GetString(WW_CA_NAME) +CA.tag = "CA" +CA.icon = "/esoui/art/icons/u33_dun1_vet_bosses.dds" +CA.priority = 122 +CA.id = 1301 +CA.node = 497 + +CA.bosses = { [1] = { + name = GetString(WW_TRASH), + },[2] = { + name = GetString(WW_CA_B1), + },[3] = { + name = GetString(WW_CA_B2), + },[4] = { + name = GetString(WW_CA_B3), + },[5] = { + name = GetString(WW_CA_SCB1), + },[6] = { + name = GetString(WW_CA_SCB2), + },[7] = { + name = GetString(WW_CA_SCB3), + },[8] = { + name = GetString(WW_CA_SCB4), + }, +} + +function CA.Init() + +end + +function CA.Reset() + +end + +function CA.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(TRASH) + end + + local pageId = WW.selection.pageId + local index = CA.lookupBosses[bossName] + WW.LoadSetup(CA, pageId, index, true) +end diff --git a/src/zones/dungeons/COS.lua b/src/zones/dungeons/COS.lua new file mode 100644 index 0000000..04ff27e --- /dev/null +++ b/src/zones/dungeons/COS.lua @@ -0,0 +1,43 @@ +local WW = WizardsWardrobe +WW.zones["COS"] = {} +local COS = WW.zones["COS"] + +COS.name = GetString(WW_COS_NAME) +COS.tag = "COS" +COS.icon = "/esoui/art/icons/achievement_update11_dungeons_034.dds" +COS.priority = 103 +COS.id = 848 +COS.node = 261 + +COS.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_COS_KHEPHIDAEN), + }, + [3] = { + name = GetString(WW_COS_DRANOS_VELEADOR), + }, + [4] = { + name = GetString(WW_COS_VELIDRETH), + }, +} + +function COS.Init() + +end + +function COS.Reset() + +end + +function COS.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = COS.lookupBosses[bossName] + WW.LoadSetup(COS, pageId, index, true) +end diff --git a/src/zones/dungeons/CT.lua b/src/zones/dungeons/CT.lua new file mode 100644 index 0000000..aa484c6 --- /dev/null +++ b/src/zones/dungeons/CT.lua @@ -0,0 +1,49 @@ +local WW = WizardsWardrobe +WW.zones["CT"] = {} +local CT = WW.zones["CT"] + +CT.name = GetString(WW_CT_NAME) +CT.tag = "CT" +CT.icon = "/esoui/art/icons/achievement_u27_dun2_vetbosses.dds" +CT.priority = 117 +CT.id = 1201 +CT.node = 436 + +CT.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_CT_DREAD_TINDULRA), + }, + [3] = { + name = GetString(WW_CT_BLOOD_TWILIGHT), + }, + [4] = { + name = GetString(WW_CT_VADUROTH), + }, + [5] = { + name = GetString(WW_CT_TALFYG), + }, + [6] = { + name = GetString(WW_CT_LADY_THORN), + }, +} + +function CT.Init() + +end + +function CT.Reset() + +end + +function CT.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = CT.lookupBosses[bossName] + WW.LoadSetup(CT, pageId, index, true) +end diff --git a/src/zones/dungeons/DC.lua b/src/zones/dungeons/DC.lua new file mode 100644 index 0000000..25d5703 --- /dev/null +++ b/src/zones/dungeons/DC.lua @@ -0,0 +1,52 @@ +local WW = WizardsWardrobe +WW.zones["DC"] = {} +local DC = WW.zones["DC"] + +DC.name = GetString(WW_DC_NAME) +DC.tag = "DC" +DC.icon = "/esoui/art/icons/achievement_u31_dun2_vet_bosses.dds" +DC.priority = 121 +DC.id = 1268 +DC.node = 469 + +DC.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_DC_SCORION_BROODLORD), + }, + [3] = { + name = GetString(WW_DC_CYRONIN_ARTELLIAN), + }, + [4] = { + name = GetString(WW_DC_MAGMA_INCARNATE), + }, + [5] = { + name = GetString(WW_DC_PURGATOR), + }, + [6] = { + name = GetString(WW_DC_UNDERTAKER), + }, + [7] = { + name = GetString(WW_DC_GRIM_WARDEN), + }, +} + +function DC.Init() + +end + +function DC.Reset() + +end + +function DC.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = DC.lookupBosses[bossName] + WW.LoadSetup(DC, pageId, index, true) +end diff --git a/src/zones/dungeons/DOM.lua b/src/zones/dungeons/DOM.lua new file mode 100644 index 0000000..bf490d4 --- /dev/null +++ b/src/zones/dungeons/DOM.lua @@ -0,0 +1,49 @@ +local WW = WizardsWardrobe +WW.zones["DOM"] = {} +local DOM = WW.zones["DOM"] + +DOM.name = GetString(WW_DOM_NAME) +DOM.tag = "DOM" +DOM.icon = "/esoui/art/icons/achievement_depthsofmalatar_vet_bosses.dds" +DOM.priority = 111 +DOM.id = 1081 +DOM.node = 390 + +DOM.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_DOM_THE_SCAVENGING_MAW), + }, + [3] = { + name = GetString(WW_DOM_THE_WEEPING_WOMAN), + }, + [4] = { + name = GetString(WW_DOM_DARK_ORB), + }, + [5] = { + name = GetString(WW_DOM_KING_NARILMOR), + }, + [6] = { + name = GetString(WW_DOM_SYMPHONY_OF_BLADE), + }, +} + +function DOM.Init() + +end + +function DOM.Reset() + +end + +function DOM.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = DOM.lookupBosses[bossName] + WW.LoadSetup(DOM, pageId, index, true) +end diff --git a/src/zones/dungeons/ERE.lua b/src/zones/dungeons/ERE.lua new file mode 100644 index 0000000..6e61352 --- /dev/null +++ b/src/zones/dungeons/ERE.lua @@ -0,0 +1,45 @@ +local WW = WizardsWardrobe +WW.zones["ERE"] = {} +local ERE = WW.zones["ERE"] + +ERE.name = GetString(WW_ERE_NAME) +ERE.tag = "ERE" +ERE.icon = "/esoui/art/icons/achievement_u35_dun1_vet_bosses.dds" +ERE.priority = 124 +ERE.id = 1360 +ERE.node = 520 + +ERE.bosses = { [1] = { + name = GetString(WW_TRASH), + }, [2] = { + name = GetString(WW_ERE_B1), + }, [3] = { + name = GetString(WW_ERE_B2), + }, [4] = { + name = GetString(WW_ERE_B3), + }, [5] = { + name = GetString(WW_ERE_SCB1), + }, [6] = { + name = GetString(WW_ERE_SCB2), + },[7] = { + name = GetString(WW_ERE_SCB3), + }, +} + +function ERE.Init() + +end + +function ERE.Reset() + +end + +function ERE.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = ERE.lookupBosses[bossName] + WW.LoadSetup(ERE, pageId, index, true) +end diff --git a/src/zones/dungeons/FH.lua b/src/zones/dungeons/FH.lua new file mode 100644 index 0000000..7b93e2b --- /dev/null +++ b/src/zones/dungeons/FH.lua @@ -0,0 +1,49 @@ +local WW = WizardsWardrobe +WW.zones["FH"] = {} +local FH = WW.zones["FH"] + +FH.name = GetString(WW_FH_NAME) +FH.tag = "FH" +FH.icon = "/esoui/art/icons/achievement_update15_008.dds" +FH.priority = 104 +FH.id = 974 +FH.node = 332 + +FH.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_FH_MORRIGH_BULLBLOOD), + }, + [3] = { + name = GetString(WW_FH_SIEGE_MAMMOTH), + }, + [4] = { + name = GetString(WW_FH_CERNUNNON), + }, + [5] = { + name = GetString(WW_FH_DEATHLORD_BJARFRUD_SKJORALMOR), + }, + [6] = { + name = GetString(WW_FH_DOMIHAUS_THE_BLOODY_HORNED), + }, +} + +function FH.Init() + +end + +function FH.Reset() + +end + +function FH.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = FH.lookupBosses[bossName] + WW.LoadSetup(FH, pageId, index, true) +end diff --git a/src/zones/dungeons/FL.lua b/src/zones/dungeons/FL.lua new file mode 100644 index 0000000..c5e0540 --- /dev/null +++ b/src/zones/dungeons/FL.lua @@ -0,0 +1,49 @@ +local WW = WizardsWardrobe +WW.zones["FL"] = {} +local FL = WW.zones["FL"] + +FL.name = GetString(WW_FL_NAME) +FL.tag = "FL" +FL.icon = "/esoui/art/icons/achievement_fanglairpeak_veteran.dds" +FL.priority = 106 +FL.id = 1009 +FL.node = 341 + +FL.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_FL_LIZABET_CHARNIS), + }, + [3] = { + name = GetString(WW_FL_CADAVEROUS_BEAR), + }, + [4] = { + name = GetString(WW_FL_CALUURION), + }, + [5] = { + name = GetString(WW_FL_ULFNOR), + }, + [6] = { + name = GetString(WW_FL_THURVOKUN), + }, +} + +function FL.Init() + +end + +function FL.Reset() + +end + +function FL.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = FL.lookupBosses[bossName] + WW.LoadSetup(FL, pageId, index, true) +end diff --git a/src/zones/dungeons/FV.lua b/src/zones/dungeons/FV.lua new file mode 100644 index 0000000..ab91e9f --- /dev/null +++ b/src/zones/dungeons/FV.lua @@ -0,0 +1,49 @@ +local WW = WizardsWardrobe +WW.zones["FV"] = {} +local FV = WW.zones["FV"] + +FV.name = GetString(WW_FV_NAME) +FV.tag = "FV" +FV.icon = "/esoui/art/icons/achievement_frostvault_vet_bosses.dds" +FV.priority = 110 +FV.id = 1080 +FV.node = 389 + +FV.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_FV_ICESTALKER), + }, + [3] = { + name = GetString(WW_FV_WARLORD_TZOGVIN), + }, + [4] = { + name = GetString(WW_FV_VAULT_PROTECTOR), + }, + [5] = { + name = GetString(WW_FV_RIZZUK_BONECHILL), + }, + [6] = { + name = GetString(WW_FV_THE_STONEKEEPER), + }, +} + +function FV.Init() + +end + +function FV.Reset() + +end + +function FV.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = FV.lookupBosses[bossName] + WW.LoadSetup(FV, pageId, index, true) +end diff --git a/src/zones/dungeons/GD.lua b/src/zones/dungeons/GD.lua new file mode 100644 index 0000000..87ee824 --- /dev/null +++ b/src/zones/dungeons/GD.lua @@ -0,0 +1,45 @@ +local WW = WizardsWardrobe +WW.zones["GD"] = {} +local GD = WW.zones["GD"] + +GD.name = GetString(WW_GD_NAME) +GD.tag = "GD" +GD.icon = "/esoui/art/icons/achievement_u35_dun2_vet_bosses.dds" +GD.priority = 125 +GD.id = 1361 +GD.node = 521 + +GD.bosses = { [1] = { + name = GetString(WW_TRASH), + }, [2] = { + name = GetString(WW_GD_B1), + }, [3] = { + name = GetString(WW_GD_B2), + }, [4] = { + name = GetString(WW_GD_B3), + }, [5] = { + name = GetString(WW_GD_SCB1), + }, [6] = { + name = GetString(WW_GD_SCB2), + },[7] = { + name = GetString(WW_GD_SCB3), + }, +} + +function GD.Init() + +end + +function GD.Reset() + +end + +function GD.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = GD.lookupBosses[bossName] + WW.LoadSetup(GD, pageId, index, true) +end diff --git a/src/zones/dungeons/ICP.lua b/src/zones/dungeons/ICP.lua new file mode 100644 index 0000000..90787f6 --- /dev/null +++ b/src/zones/dungeons/ICP.lua @@ -0,0 +1,43 @@ +local WW = WizardsWardrobe +WW.zones["ICP"] = {} +local ICP = WW.zones["ICP"] + +ICP.name = GetString(WW_ICP_NAME) +ICP.tag = "ICP" +ICP.icon = "/esoui/art/icons/achievement_ic_025_heroic.dds" +ICP.priority = 101 +ICP.id = 678 +ICP.node = 236 + +ICP.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_ICP_IBOMEZ_THE_FLESH_SCULPTOR), + }, + [3] = { + name = GetString(WW_ICP_FLESH_ABOMINATION), + }, + [4] = { + name = GetString(WW_ICP_LORD_WARDEN_DUSK), + }, +} + +function ICP.Init() + +end + +function ICP.Reset() + +end + +function ICP.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = ICP.lookupBosses[bossName] + WW.LoadSetup(ICP, pageId, index, true) +end diff --git a/src/zones/dungeons/IR.lua b/src/zones/dungeons/IR.lua new file mode 100644 index 0000000..39ac384 --- /dev/null +++ b/src/zones/dungeons/IR.lua @@ -0,0 +1,49 @@ +local WW = WizardsWardrobe +WW.zones["IR"] = {} +local IR = WW.zones["IR"] + +IR.name = GetString(WW_IR_NAME) +IR.tag = "IR" +IR.icon = "/esoui/art/icons/achievement_u25_dun1_vet_bosses.dds" +IR.priority = 114 +IR.id = 1152 +IR.node = 424 + +IR.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_IR_KJARG_THE_TUSKSCRAPER), + }, + [3] = { + name = GetString(WW_IR_SISTER_SKELGA), + }, + [4] = { + name = GetString(WW_IR_VEAROGH_THE_SHAMBLER), + }, + [5] = { + name = GetString(WW_IR_STORMBOND_REVENANT), + }, + [6] = { + name = GetString(WW_IR_ICEREACH_COVEN), + }, +} + +function IR.Init() + +end + +function IR.Reset() + +end + +function IR.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = IR.lookupBosses[bossName] + WW.LoadSetup(IR, pageId, index, true) +end diff --git a/src/zones/dungeons/LOM.lua b/src/zones/dungeons/LOM.lua new file mode 100644 index 0000000..8572e96 --- /dev/null +++ b/src/zones/dungeons/LOM.lua @@ -0,0 +1,131 @@ +local WW = WizardsWardrobe +WW.zones["LOM"] = {} +local LOM = WW.zones["LOM"] + +LOM.name = GetString(WW_LOM_NAME) +LOM.tag = "LOM" +LOM.icon = "/esoui/art/icons/achievement_u23_dun2_flavorboss5b.dds" +LOM.priority = 112 +LOM.id = 1123 +LOM.node = 398 + +LOM.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_LOM_SELENE), + }, + [3] = { + name = GetString(WW_LOM_AZUREBLIGHT_LURCHER), + }, + [4] = { + name = GetString(WW_LOM_AZUREBLIGHT_CANCROID), + }, + [5] = { + name = GetString(WW_LOM_MAARSELOK), + }, + [6] = { + name = GetString(WW_LOM_MAARSELOK_BOSS), + }, +} + +LOM.LOCATIONS = { + FIRST = { + x1 = 101000, -- porte entrée selene + x2 = 109000, -- porte sortie selene + z1 = 27000, -- Z1 corespond pas + z2 = 35000, -- Z2 corespond pas + }, + SECOND = { + x1 = 134000, + x2 = 143000, + z1 = 59000, -- Z1 corespond pas + z2 = 68000, -- Z2 corespond pas + }, + THIRD = { + x1 = 70000, + x2 = 79000, + z1 = 104300, -- Z1 corespond pas + z2 = 114200, -- Z2 corespond pas + }, + FORTH = { + x1 = 83000, + x2 = 98000, + z1 = 141000, -- Z1 corespond pas + z2 = 150000, -- Z2 corespond pas + }, + FIFTH = { + x1 = 128000, --porte entrée + x2 = 140000, --boss + z1 = 137000, -- Z1 corespond pas + z2 = 144000, -- Z2 corespond pas + } +} + +function LOM.Init() + EVENT_MANAGER:UnregisterForEvent(WW.name, EVENT_BOSSES_CHANGED) + EVENT_MANAGER:RegisterForUpdate(WW.name .. LOM.tag .. "MovementLoop", 2000, LOM.OnMovement) + EVENT_MANAGER:RegisterForEvent(WW.name .. LOM.tag, EVENT_PLAYER_COMBAT_STATE, LOM.OnCombatChange) +end + +function LOM.Reset() + EVENT_MANAGER:UnregisterForUpdate(WW.name .. LOM.tag .. "MovementLoop") + EVENT_MANAGER:RegisterForEvent(WW.name, EVENT_BOSSES_CHANGED, WW.OnBossChange) +end + +function LOM.OnCombatChange(_, inCombat) + if inCombat == true then + EVENT_MANAGER:UnregisterForUpdate(WW.name .. LOM.tag .. "MovementLoop") + else + EVENT_MANAGER:RegisterForUpdate(WW.name .. LOM.tag .. "MovementLoop", 2000, LOM.OnMovement) + end +end + +function LOM.OnMovement() + local boss = LOM.GetBossByLocation() + if boss == 0 then + WW.OnBossChange(_, true, "") + return + end + WW.OnBossChange(_, true, LOM.bosses[boss].name) +end + +function LOM.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + + local index = LOM.lookupBosses[bossName] + WW.LoadSetup(LOM, pageId, index, true) +end + +function LOM.GetBossByLocation() + local zone, x, y, z = GetUnitWorldPosition("player") + + if x > LOM.LOCATIONS.FIRST.x1 and x < LOM.LOCATIONS.FIRST.x2 + and z > LOM.LOCATIONS.FIRST.z1 and z < LOM.LOCATIONS.FIRST.z2 then + return 1 + 1 + + elseif x > LOM.LOCATIONS.SECOND.x1 and x < LOM.LOCATIONS.SECOND.x2 + and z > LOM.LOCATIONS.SECOND.z1 and z < LOM.LOCATIONS.SECOND.z2 then + return 2 + 1 + + elseif x > LOM.LOCATIONS.THIRD.x1 and x < LOM.LOCATIONS.THIRD.x2 + and z > LOM.LOCATIONS.THIRD.z1 and z < LOM.LOCATIONS.THIRD.z2 then + return 3 + 1 + + elseif x > LOM.LOCATIONS.FORTH.x1 and x < LOM.LOCATIONS.FORTH.x2 + and z > LOM.LOCATIONS.FORTH.z1 and z < LOM.LOCATIONS.FORTH.z2 then + return 4 + 1 + + elseif x > LOM.LOCATIONS.FIFTH.x1 and x < LOM.LOCATIONS.FIFTH.x2 + and z > LOM.LOCATIONS.FIFTH.z1 and z < LOM.LOCATIONS.FIFTH.z2 then + return 5 + 1 + + else + return 0 + end +end diff --git a/src/zones/dungeons/MGF.lua b/src/zones/dungeons/MGF.lua new file mode 100644 index 0000000..c7a2e94 --- /dev/null +++ b/src/zones/dungeons/MGF.lua @@ -0,0 +1,49 @@ +local WW = WizardsWardrobe +WW.zones["MGF"] = {} +local MGF = WW.zones["MGF"] + +MGF.name = GetString(WW_MGF_NAME) +MGF.tag = "MGF" +MGF.icon = "/esoui/art/icons/achievement_u23_dun1_meta.dds" +MGF.priority = 113 +MGF.id = 1122 +MGF.node = 391 + +MGF.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_MGF_RISEN_RUINS), + }, + [3] = { + name = GetString(WW_MGF_DRO_ZAKAR), + }, + [4] = { + name = GetString(WW_MGF_KUJO_KETHBA), + }, + [5] = { + name = GetString(WW_MGF_NISAAZDA), + }, + [6] = { + name = GetString(WW_MGF_GRUNDWULF), + }, +} + +function MGF.Init() + +end + +function MGF.Reset() + +end + +function MGF.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = MGF.lookupBosses[bossName] + WW.LoadSetup(MGF, pageId, index, true) +end diff --git a/src/zones/dungeons/MHK.lua b/src/zones/dungeons/MHK.lua new file mode 100644 index 0000000..4762111 --- /dev/null +++ b/src/zones/dungeons/MHK.lua @@ -0,0 +1,49 @@ +local WW = WizardsWardrobe +WW.zones["MHK"] = {} +local MHK = WW.zones["MHK"] + +MHK.name = GetString(WW_MHK_NAME) +MHK.tag = "MHK" +MHK.icon = "/esoui/art/icons/vmh_vet_bosses.dds" +MHK.priority = 108 +MHK.id = 1052 +MHK.node = 371 + +MHK.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_MHK_JAILER_MELITUS), + }, + [3] = { + name = GetString(WW_MHK_HEDGE_MAZE_GUARDIAN), + }, + [4] = { + name = GetString(WW_MHK_MYLENNE_MOON_CALLER), + }, + [5] = { + name = GetString(WW_MHK_ARCHIVIST_ERNADE), + }, + [6] = { + name = GetString(WW_MHK_VYKOSA_THE_ASCENDANT), + }, +} + +function MHK.Init() + +end + +function MHK.Reset() + +end + +function MHK.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = MHK.lookupBosses[bossName] + WW.LoadSetup(MHK, pageId, index, true) +end diff --git a/src/zones/dungeons/MOS.lua b/src/zones/dungeons/MOS.lua new file mode 100644 index 0000000..ebb7e26 --- /dev/null +++ b/src/zones/dungeons/MOS.lua @@ -0,0 +1,49 @@ +local WW = WizardsWardrobe +WW.zones["MOS"] = {} +local MOS = WW.zones["MOS"] + +MOS.name = GetString(WW_MOS_NAME) +MOS.tag = "MOS" +MOS.icon = "/esoui/art/icons/vmos_vet_bosses.dds" +MOS.priority = 109 +MOS.id = 1055 +MOS.node = 370 + +MOS.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_MOS_WYRESS_RANGIFER), + }, + [3] = { + name = GetString(WW_MOS_AGHAEDH_OF_THE_SOLSTICE), + }, + [4] = { + name = GetString(WW_MOS_DAGRUND_THE_BULKY), + }, + [5] = { + name = GetString(WW_MOS_TARCYR), + }, + [6] = { + name = GetString(WW_MOS_BALORGH), + }, +} + +function MOS.Init() + +end + +function MOS.Reset() + +end + +function MOS.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = MOS.lookupBosses[bossName] + WW.LoadSetup(MOS, pageId, index, true) +end diff --git a/src/zones/dungeons/OP.lua b/src/zones/dungeons/OP.lua new file mode 100644 index 0000000..45c9d52 --- /dev/null +++ b/src/zones/dungeons/OP.lua @@ -0,0 +1,52 @@ +local WW = WizardsWardrobe +WW.zones["OP"] = {} +local OP = WW.zones["OP"] + +OP.name = GetString(WW_OP_NAME) +OP.tag = "OP" +OP.icon = "/esoui/art/icons/achievement_u41_dun1_vet_bosses.dds" +OP.priority = 129 +OP.id = 1470 +OP.node = 556 + +OP.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_OP_B1), + }, + [3] = { + name = GetString(WW_OP_B2), + }, + [4] = { + name = GetString(WW_OP_B3), + }, + [5] = { + name = GetString(WW_OP_MB1), + }, + [6] = { + name = GetString(WW_OP_MB2), + }, + [7] = { + name = GetString(WW_OP_MB3), + }, +} + +function OP.Init() + +end + +function OP.Reset() + +end + +function OP.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = OP.lookupBosses[bossName] + WW.LoadSetup(OP, pageId, index, true) +end diff --git a/src/zones/dungeons/ROM.lua b/src/zones/dungeons/ROM.lua new file mode 100644 index 0000000..64f262b --- /dev/null +++ b/src/zones/dungeons/ROM.lua @@ -0,0 +1,43 @@ +local WW = WizardsWardrobe +WW.zones["ROM"] = {} +local ROM = WW.zones["ROM"] + +ROM.name = GetString(WW_ROM_NAME) +ROM.tag = "ROM" +ROM.icon = "/esoui/art/icons/achievement_u30_groupboss6.dss" +ROM.priority = 102 +ROM.id = 843 +ROM.node = 260 + +ROM.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_ROM_MIGHTY_CHUDAN), + }, + [3] = { + name = GetString(WW_ROM_XAL_NUR_THE_SLAVER), + }, + [4] = { + name = GetString(WW_ROM_TREE_MINDER_NA_KESH), + }, +} + +function ROM.Init() + +end + +function ROM.Reset() + +end + +function ROM.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = ROM.lookupBosses[bossName] + WW.LoadSetup(ROM, pageId, index, true) +end diff --git a/src/zones/dungeons/RPB.lua b/src/zones/dungeons/RPB.lua new file mode 100644 index 0000000..65c4aab --- /dev/null +++ b/src/zones/dungeons/RPB.lua @@ -0,0 +1,52 @@ +local WW = WizardsWardrobe +WW.zones["RPB"] = {} +local RPB = WW.zones["RPB"] + +RPB.name = GetString(WW_RPB_NAME) +RPB.tag = "RPB" +RPB.icon = "/esoui/art/icons/achievement_u31_dun1_vet_bosses.dds" +RPB.priority = 120 +RPB.id = 1267 +RPB.node = 470 + +RPB.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_RPB_ROGERAIN_THE_SLY), + }, + [3] = { + name = GetString(WW_RPB_ELIAM_MERICK), + }, + [4] = { + name = GetString(WW_RPB_PRIOR_THIERRIC_SARAZEN), + }, + [5] = { + name = GetString(WW_RPB_WRAITH_OF_CROWS), + }, + [6] = { + name = GetString(WW_RPB_SPIDER_DEADRA), + }, + [7] = { + name = GetString(WW_RPB_GRIEVIOUS_TWILIGHT), + }, +} + +function RPB.Init() + +end + +function RPB.Reset() + +end + +function RPB.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = RPB.lookupBosses[bossName] + WW.LoadSetup(RPB, pageId, index, true) +end diff --git a/src/zones/dungeons/SCP.lua b/src/zones/dungeons/SCP.lua new file mode 100644 index 0000000..625fd2a --- /dev/null +++ b/src/zones/dungeons/SCP.lua @@ -0,0 +1,49 @@ +local WW = WizardsWardrobe +WW.zones["SCP"] = {} +local SCP = WW.zones["SCP"] + +SCP.name = GetString(WW_SCP_NAME) +SCP.tag = "SCP" +SCP.icon = "/esoui/art/icons/achievement_scalecaller_veteran.dds" +SCP.priority = 107 +SCP.id = 1010 +SCP.node = 363 + +SCP.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_SCP_ORZUN_THE_FOUL_SMELLING), + }, + [3] = { + name = GetString(WW_SCP_DOYLEMISH_IRONHEARTH), + }, + [4] = { + name = GetString(WW_SCP_MATRIACH_ALDIS), + }, + [5] = { + name = GetString(WW_SCP_PLAGUE_CONCOCTER_MORTIEU), + }, + [6] = { + name = GetString(WW_SCP_ZAAN_THE_SCALECALLER), + }, +} + +function SCP.Init() + +end + +function SCP.Reset() + +end + +function SCP.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = SCP.lookupBosses[bossName] + WW.LoadSetup(SCP, pageId, index, true) +end diff --git a/src/zones/dungeons/SG.lua b/src/zones/dungeons/SG.lua new file mode 100644 index 0000000..ec4abef --- /dev/null +++ b/src/zones/dungeons/SG.lua @@ -0,0 +1,43 @@ +local WW = WizardsWardrobe +WW.zones["SG"] = {} +local SG = WW.zones["SG"] + +SG.name = GetString(WW_SG_NAME) +SG.tag = "SG" +SG.icon = "/esoui/art/icons/achievement_u27_dun1_vetbosses.dds" +SG.priority = 116 +SG.id = 1197 +SG.node = 433 + +SG.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_SG_EXARCH_KRAGLEN), + }, + [3] = { + name = GetString(WW_SG_STONE_BEHEMOTH), + }, + [4] = { + name = GetString(WW_SG_ARKASIS_THE_MAD_ALCHEMIST), + }, +} + +function SG.Init() + +end + +function SG.Reset() + +end + +function SG.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = SG.lookupBosses[bossName] + WW.LoadSetup(SG, pageId, index, true) +end diff --git a/src/zones/dungeons/SH.lua b/src/zones/dungeons/SH.lua new file mode 100644 index 0000000..e3f18bd --- /dev/null +++ b/src/zones/dungeons/SH.lua @@ -0,0 +1,43 @@ +local WW = WizardsWardrobe +WW.zones["SH"] = {} +local SH = WW.zones["SH"] + +SH.name = GetString(WW_SH_NAME) +SH.tag = "SH" +SH.icon = "/esoui/art/icons/u37_dun2_vet_bosses.dds" +SH.priority = 127 +SH.id = 1390 +SH.node = 532 + +SH.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_SH_B1), + }, + [3] = { + name = GetString(WW_SH_B2), + }, + [4] = { + name = GetString(WW_SH_B3), + }, +} + +function SH.Init() + +end + +function SH.Reset() + +end + +function SH.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = SH.lookupBosses[bossName] + WW.LoadSetup(SH, pageId, index, true) +end diff --git a/src/zones/dungeons/SR.lua b/src/zones/dungeons/SR.lua new file mode 100644 index 0000000..e368142 --- /dev/null +++ b/src/zones/dungeons/SR.lua @@ -0,0 +1,45 @@ +local WW = WizardsWardrobe +WW.zones["SR"] = {} +local SR = WW.zones["SR"] + +SR.name = GetString(WW_SR_NAME) +SR.tag = "SR" +SR.icon = "/esoui/art/icons/u33_dun2_vet_bosses.dds" +SR.priority = 123 +SR.id = 1302 +SR.node = 498 + +SR.bosses = { [1] = { + name = GetString(WW_TRASH), + }, [2] = { + name = GetString(WW_SR_B1), + }, [3] = { + name = GetString(WW_SR_B2), + }, [4] = { + name = GetString(WW_SR_B3), + }, [5] = { + name = GetString(WW_SR_SCB1), + }, [6] = { + name = GetString(WW_SR_SCB2), + },[7] = { + name = GetString(WW_SR_SCB3), + }, +} + +function SR.Init() + +end + +function SR.Reset() + +end + +function SR.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = SR.lookupBosses[bossName] + WW.LoadSetup(SR, pageId, index, true) +end diff --git a/src/zones/dungeons/TC.lua b/src/zones/dungeons/TC.lua new file mode 100644 index 0000000..fcb2d20 --- /dev/null +++ b/src/zones/dungeons/TC.lua @@ -0,0 +1,49 @@ +local WW = WizardsWardrobe +WW.zones["TC"] = {} +local TC = WW.zones["TC"] + +TC.name = GetString(WW_TC_NAME) +TC.tag = "TC" +TC.icon = "/esoui/art/icons/achievement_u29_dun2_vet_bosses.dds" +TC.priority = 119 +TC.id = 1229 +TC.node = 454 + +TC.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_TC_OXBLOOD_THE_DEPRAVED), + }, + [3] = { + name = GetString(WW_TC_TASKMASTER_VICCIA), + }, + [4] = { + name = GetString(WW_TC_MOLTEN_GUARDIAN), + }, + [5] = { + name = GetString(WW_TC_DAEDRIC_SHIELD), + }, + [6] = { + name = GetString(WW_TC_BARON_ZAULDRUS), + }, +} + +function TC.Init() + +end + +function TC.Reset() + +end + +function TC.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = TC.lookupBosses[bossName] + WW.LoadSetup(TC, pageId, index, true) +end diff --git a/src/zones/dungeons/UHG.lua b/src/zones/dungeons/UHG.lua new file mode 100644 index 0000000..a76f3ca --- /dev/null +++ b/src/zones/dungeons/UHG.lua @@ -0,0 +1,58 @@ +local WW = WizardsWardrobe +WW.zones["UHG"] = {} +local UHG = WW.zones["UHG"] + +UHG.name = GetString(WW_UHG_NAME) +UHG.tag = "UHG" +UHG.icon = "/esoui/art/icons/achievement_u25_dun2_bosses.dds" +UHG.priority = 115 +UHG.id = 1153 +UHG.node = 425 + +UHG.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_UHG_HAKGRYM_THE_HOWLER), + }, + [3] = { + name = GetString(WW_UHG_KEEPER_OF_THE_KILN), + }, + [4] = { + name = GetString(WW_UHG_ETERNAL_AEGIS), + }, + [5] = { + name = GetString(WW_UHG_ONDAGORE_THE_MAD), + }, + [6] = { + name = GetString(WW_UHG_KJALNAR_TOMBSKALD), + }, + [7] = { + name = GetString(WW_UHG_NABOR_THE_FORGOTTEN), + }, + [8] = { + name = GetString(WW_UHG_VORIA_THE_HEARTH_THIEF), + }, + [9] = { + name = GetString(WW_UHG_VORIAS_MASTERPIECE), + }, +} + +function UHG.Init() + +end + +function UHG.Reset() + +end + +function UHG.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = UHG.lookupBosses[bossName] + WW.LoadSetup(UHG, pageId, index, true) +end diff --git a/src/zones/dungeons/WGT.lua b/src/zones/dungeons/WGT.lua new file mode 100644 index 0000000..aa7c355 --- /dev/null +++ b/src/zones/dungeons/WGT.lua @@ -0,0 +1,43 @@ +local WW = WizardsWardrobe +WW.zones["WGT"] = {} +local WGT = WW.zones["WGT"] + +WGT.name = GetString(WW_WGT_NAME) +WGT.tag = "WGT" +WGT.icon = "/esoui/art/icons/achievement_ic_027_heroic.dds" +WGT.priority = 100 +WGT.id = 688 +WGT.node = 247 + +WGT.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_WGT_THE_ADJUDICATOR), + }, + [3] = { + name = GetString(WW_WGT_THE_PLANAR_INHIBITOR), + }, + [4] = { + name = GetString(WW_WGT_MOLAG_KENA), + }, +} + +function WGT.Init() + +end + +function WGT.Reset() + +end + +function WGT.OnBossChange(bossName) + if #bossName == 0 then + bossName = GetString(WW_TRASH) + end + + local pageId = WW.selection.pageId + local index = WGT.lookupBosses[bossName] + WW.LoadSetup(WGT, pageId, index, true) +end diff --git a/src/zones/AA.lua b/src/zones/trials/AA.lua similarity index 94% rename from src/zones/AA.lua rename to src/zones/trials/AA.lua index 3aac430..703cfc6 100644 --- a/src/zones/AA.lua +++ b/src/zones/trials/AA.lua @@ -1,40 +1,40 @@ -local WW = WizardsWardrobe -WW.zones["AA"] = {} -local AA = WW.zones["AA"] - -AA.name = GetString(WW_AA_NAME) -AA.tag = "AA" -AA.icon = "/esoui/art/icons/achievement_update11_dungeons_002.dds" -AA.priority = 1 -AA.id = 638 -AA.node = 231 - -AA.bosses = { - [1] = { - name = GetString(WW_TRASH), - }, - [2] = { - name = GetString(WW_AA_STORMATRO), - }, - [3] = { - name = GetString(WW_AA_STONEATRO), - }, - [4] = { - name = GetString(WW_AA_VARLARIEL), - }, - [5] = { - name = GetString(WW_AA_MAGE), - }, -} - -function AA.Init() - -end - -function AA.Reset() - -end - -function AA.OnBossChange(bossName) - WW.conditions.OnBossChange(bossName) +local WW = WizardsWardrobe +WW.zones["AA"] = {} +local AA = WW.zones["AA"] + +AA.name = GetString(WW_AA_NAME) +AA.tag = "AA" +AA.icon = "/esoui/art/icons/achievement_update11_dungeons_002.dds" +AA.priority = 1 +AA.id = 638 +AA.node = 231 + +AA.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_AA_STORMATRO), + }, + [3] = { + name = GetString(WW_AA_STONEATRO), + }, + [4] = { + name = GetString(WW_AA_VARLARIEL), + }, + [5] = { + name = GetString(WW_AA_MAGE), + }, +} + +function AA.Init() + +end + +function AA.Reset() + +end + +function AA.OnBossChange(bossName) + WW.conditions.OnBossChange(bossName) end \ No newline at end of file diff --git a/src/zones/AS.lua b/src/zones/trials/AS.lua similarity index 96% rename from src/zones/AS.lua rename to src/zones/trials/AS.lua index ad4dc33..4faf51d 100644 --- a/src/zones/AS.lua +++ b/src/zones/trials/AS.lua @@ -1,63 +1,63 @@ -local WW = WizardsWardrobe -WW.zones["AS"] = {} -local AS = WW.zones["AS"] - -AS.name = GetString(WW_AS_NAME) -AS.tag = "AS" -AS.icon = "/esoui/art/icons/achievement_update16_029.dds" -AS.priority = 6 -AS.id = 1000 -AS.node = 346 - -AS.bosses = { - [1] = { - name = GetString(WW_AS_OLMS), - }, - [2] = { - name = GetString(WW_AS_FELMS), - }, - [3] = { - name = GetString(WW_AS_LLOTHIS), - }, -} - -function AS.Init() - EVENT_MANAGER:UnregisterForEvent(WW.name, EVENT_BOSSES_CHANGED) - EVENT_MANAGER:RegisterForUpdate(WW.name .. AS.tag .. "MovementLoop", 2000, AS.OnMovement) - EVENT_MANAGER:RegisterForEvent(WW.name .. AS.tag, EVENT_PLAYER_COMBAT_STATE, AS.OnCombatChange) -end - -function AS.Reset() - EVENT_MANAGER:UnregisterForEvent(WW.name .. AS.tag, EVENT_PLAYER_COMBAT_STATE) - EVENT_MANAGER:UnregisterForUpdate(WW.name .. AS.tag .. "MovementLoop") - EVENT_MANAGER:RegisterForEvent(WW.name, EVENT_BOSSES_CHANGED, WW.OnBossChange) -end - -function AS.OnCombatChange(_, inCombat) - if inCombat then - EVENT_MANAGER:UnregisterForUpdate(WW.name .. AS.tag .. "MovementLoop") - else - EVENT_MANAGER:RegisterForUpdate(WW.name .. AS.tag .. "MovementLoop", 2000, AS.OnMovement) - end -end - -function AS.OnMovement() - local _, x, y, z = GetUnitWorldPosition("player") - local bossName = GetString(WW_AS_OLMS) - if y > 65000 then -- upper part of AS - bossName = GetString(WW_AS_LLOTHIS) - if z > 100000 then - bossName = GetString(WW_AS_FELMS) - end - end - WW.OnBossChange(_, true, bossName) -end - -function AS.OnBossChange(bossName) - -- no trash setup in AS - if #bossName == 0 then - return - end - - WW.conditions.OnBossChange(bossName) +local WW = WizardsWardrobe +WW.zones["AS"] = {} +local AS = WW.zones["AS"] + +AS.name = GetString(WW_AS_NAME) +AS.tag = "AS" +AS.icon = "/esoui/art/icons/achievement_update16_029.dds" +AS.priority = 6 +AS.id = 1000 +AS.node = 346 + +AS.bosses = { + [1] = { + name = GetString(WW_AS_OLMS), + }, + [2] = { + name = GetString(WW_AS_FELMS), + }, + [3] = { + name = GetString(WW_AS_LLOTHIS), + }, +} + +function AS.Init() + EVENT_MANAGER:UnregisterForEvent(WW.name, EVENT_BOSSES_CHANGED) + EVENT_MANAGER:RegisterForUpdate(WW.name .. AS.tag .. "MovementLoop", 2000, AS.OnMovement) + EVENT_MANAGER:RegisterForEvent(WW.name .. AS.tag, EVENT_PLAYER_COMBAT_STATE, AS.OnCombatChange) +end + +function AS.Reset() + EVENT_MANAGER:UnregisterForEvent(WW.name .. AS.tag, EVENT_PLAYER_COMBAT_STATE) + EVENT_MANAGER:UnregisterForUpdate(WW.name .. AS.tag .. "MovementLoop") + EVENT_MANAGER:RegisterForEvent(WW.name, EVENT_BOSSES_CHANGED, WW.OnBossChange) +end + +function AS.OnCombatChange(_, inCombat) + if inCombat then + EVENT_MANAGER:UnregisterForUpdate(WW.name .. AS.tag .. "MovementLoop") + else + EVENT_MANAGER:RegisterForUpdate(WW.name .. AS.tag .. "MovementLoop", 2000, AS.OnMovement) + end +end + +function AS.OnMovement() + local _, x, y, z = GetUnitWorldPosition("player") + local bossName = GetString(WW_AS_OLMS) + if y > 65000 then -- upper part of AS + bossName = GetString(WW_AS_LLOTHIS) + if z > 100000 then + bossName = GetString(WW_AS_FELMS) + end + end + WW.OnBossChange(_, true, bossName) +end + +function AS.OnBossChange(bossName) + -- no trash setup in AS + if #bossName == 0 then + return + end + + WW.conditions.OnBossChange(bossName) end \ No newline at end of file diff --git a/src/zones/CR.lua b/src/zones/trials/CR.lua similarity index 94% rename from src/zones/CR.lua rename to src/zones/trials/CR.lua index 12e1a58..38f868c 100644 --- a/src/zones/CR.lua +++ b/src/zones/trials/CR.lua @@ -1,53 +1,53 @@ -local WW = WizardsWardrobe -WW.zones["CR"] = {} -local CR = WW.zones["CR"] - -CR.name = GetString(WW_CR_NAME) -CR.tag = "CR" -CR.icon = "/esoui/art/icons/achievement_su_karnwasten_groupevent.dds" -CR.priority = 7 -CR.id = 1051 -CR.node = 364 - -CR.bosses = { - [1] = { - name = GetString(WW_CR_ZMAJA), - }, - [2] = { - name = GetString(WW_CR_GALENWE), - }, - [3] = { - name = GetString(WW_CR_SIRORIA), - }, - [4] = { - name = GetString(WW_CR_RELEQUEN), - }, -} - -function CR.Init() - CR.lastBoss1 = "" - CR.lastBoss2 = "" - CR.lastBoss3 = "" -end - -function CR.Reset() - -end - -function CR.OnBossChange(bossName) - CR.lastBoss3 = CR.lastBoss2 - CR.lastBoss2 = CR.lastBoss1 - CR.lastBoss1 = bossName - - -- dont change if boss - trash - boss - if CR.lastBoss1 == CR.lastBoss3 and CR.lastBoss2 == "" then - return - end - - -- no trash setup in CR - if #bossName == 0 then - return - end - - WW.conditions.OnBossChange(bossName) +local WW = WizardsWardrobe +WW.zones["CR"] = {} +local CR = WW.zones["CR"] + +CR.name = GetString(WW_CR_NAME) +CR.tag = "CR" +CR.icon = "/esoui/art/icons/achievement_su_karnwasten_groupevent.dds" +CR.priority = 7 +CR.id = 1051 +CR.node = 364 + +CR.bosses = { + [1] = { + name = GetString(WW_CR_ZMAJA), + }, + [2] = { + name = GetString(WW_CR_GALENWE), + }, + [3] = { + name = GetString(WW_CR_SIRORIA), + }, + [4] = { + name = GetString(WW_CR_RELEQUEN), + }, +} + +function CR.Init() + CR.lastBoss1 = "" + CR.lastBoss2 = "" + CR.lastBoss3 = "" +end + +function CR.Reset() + +end + +function CR.OnBossChange(bossName) + CR.lastBoss3 = CR.lastBoss2 + CR.lastBoss2 = CR.lastBoss1 + CR.lastBoss1 = bossName + + -- dont change if boss - trash - boss + if CR.lastBoss1 == CR.lastBoss3 and CR.lastBoss2 == "" then + return + end + + -- no trash setup in CR + if #bossName == 0 then + return + end + + WW.conditions.OnBossChange(bossName) end \ No newline at end of file diff --git a/src/zones/DSR.lua b/src/zones/trials/DSR.lua similarity index 100% rename from src/zones/DSR.lua rename to src/zones/trials/DSR.lua diff --git a/src/zones/HOF.lua b/src/zones/trials/HOF.lua similarity index 96% rename from src/zones/HOF.lua rename to src/zones/trials/HOF.lua index f2b8d66..f3eb2a0 100644 --- a/src/zones/HOF.lua +++ b/src/zones/trials/HOF.lua @@ -1,156 +1,156 @@ -local WW = WizardsWardrobe -WW.zones["HOF"] = {} -local HOF = WW.zones["HOF"] - -HOF.name = GetString(WW_HOF_NAME) -HOF.tag = "HOF" -HOF.icon = "/esoui/art/icons/achievement_vvardenfel_036.dds" -HOF.priority = 5 -HOF.id = 975 -HOF.node = 331 - -HOF.bosses = { - [1] = { - name = GetString(WW_TRASH), - }, - [2] = { - displayName = GetString(WW_HOF_HUNTERKILLER_DN), - name = GetString(WW_HOF_HUNTERKILLER), - }, - [3] = { - name = GetString(WW_HOF_FACTOTUM), - }, - [4] = { - name = GetString(WW_HOF_SPIDER), - }, - [5] = { - displayName = GetString(WW_HOF_COMMITEE_DN), - name = GetString(WW_HOF_COMMITEE), - }, - [6] = { - name = GetString(WW_HOF_GENERAL), - }, -} - -HOF.LOCATIONS = { - HUNTERFACTOTUM = { - x1 = 40000, - x2 = 45500, - y1 = 49800, - y2 = 55000, - z1 = 23000, - z2 = 29000, - }, - SPIDER = { - x1 = 67700, - x2 = 93000, - y1 = 52000, - y2 = 53000, - z1 = 12200, - z2 = 37500, - }, - COMMITEE = { - x1 = 25960, - x2 = 33030, - y1 = 52900, - y2 = 53450, - z1 = 70700, - z2 = 75950, - }, - GENERAL = { - x1 = 70000, - x2 = 80000, - y1 = 54500, - y2 = 56500, - z1 = 65000, - z2 = 75500, - }, -} - -function HOF.Init() - HOF.isHunterkillerDead = false - EVENT_MANAGER:UnregisterForEvent(WW.name, EVENT_BOSSES_CHANGED) - EVENT_MANAGER:RegisterForUpdate(WW.name .. HOF.tag .. "MovementLoop", 2000, HOF.OnMovement) - EVENT_MANAGER:RegisterForEvent(WW.name .. HOF.tag, EVENT_PLAYER_COMBAT_STATE, HOF.OnCombatChange) - EVENT_MANAGER:RegisterForEvent(WW.name .. HOF.tag, EVENT_UNIT_DEATH_STATE_CHANGED, HOF.OnUnitDeath) -end - -function HOF.Reset() - EVENT_MANAGER:UnregisterForEvent(WW.name .. HOF.tag, EVENT_UNIT_DEATH_STATE_CHANGED) - EVENT_MANAGER:UnregisterForEvent(WW.name .. HOF.tag, EVENT_PLAYER_COMBAT_STATE) - EVENT_MANAGER:UnregisterForUpdate(WW.name .. HOF.tag .. "MovementLoop") - EVENT_MANAGER:RegisterForEvent(WW.name, EVENT_BOSSES_CHANGED, WW.OnBossChange) -end - -function HOF.OnUnitDeath(_, unitTag, isDead) - if not isDead then return end - if unitTag:sub(1, 1) ~= "b" then return end - local bossName = GetUnitName(unitTag) - if bossName == GetString(WW_HOF_HUNTERKILLER) then - HOF.isHunterkillerDead = true - end -end - -function HOF.OnMovement() - local bossName = HOF.GetBossByLocation() - if not bossName then return end - WW.OnBossChange(_, true, bossName) -end - -function HOF.GetBossByLocation() - local zone, x, y, z = GetUnitWorldPosition("player") - - if zone ~= HOF.id then return nil end - - if x > HOF.LOCATIONS.HUNTERFACTOTUM.x1 and x < HOF.LOCATIONS.HUNTERFACTOTUM.x2 - and y > HOF.LOCATIONS.HUNTERFACTOTUM.y1 and y < HOF.LOCATIONS.HUNTERFACTOTUM.y2 - and z > HOF.LOCATIONS.HUNTERFACTOTUM.z1 and z < HOF.LOCATIONS.HUNTERFACTOTUM.z2 then - - -- if player reloads/crashes/ports in after hunter killers are dead - if GetUnitName("boss1") == GetString(WW_HOF_FACTOTUM) then - HOF.isHunterkillerDead = true - elseif GetUnitName("boss1") == GetString(WW_HOF_HUNTERKILLER) then - HOF.isHunterkillerDead = false - end - - if HOF.isHunterkillerDead then - return GetString(WW_HOF_FACTOTUM) - else - return GetString(WW_HOF_HUNTERKILLER) - end - - elseif x > HOF.LOCATIONS.SPIDER.x1 and x < HOF.LOCATIONS.SPIDER.x2 - and y > HOF.LOCATIONS.SPIDER.y1 and y < HOF.LOCATIONS.SPIDER.y2 - and z > HOF.LOCATIONS.SPIDER.z1 and z < HOF.LOCATIONS.SPIDER.z2 then - - return GetString(WW_HOF_SPIDER) - - elseif x > HOF.LOCATIONS.COMMITEE.x1 and x < HOF.LOCATIONS.COMMITEE.x2 - and y > HOF.LOCATIONS.COMMITEE.y1 and y < HOF.LOCATIONS.COMMITEE.y2 - and z > HOF.LOCATIONS.COMMITEE.z1 and z < HOF.LOCATIONS.COMMITEE.z2 then - - return GetString(WW_HOF_COMMITEE) - - elseif x > HOF.LOCATIONS.GENERAL.x1 and x < HOF.LOCATIONS.GENERAL.x2 - and y > HOF.LOCATIONS.GENERAL.y1 and y < HOF.LOCATIONS.GENERAL.y2 - and z > HOF.LOCATIONS.GENERAL.z1 and z < HOF.LOCATIONS.GENERAL.z2 then - - return GetString(WW_HOF_GENERAL) - - else - - return ""--GetString(WW_TRASH) - end -end - -function HOF.OnCombatChange(_, inCombat) - if inCombat then - EVENT_MANAGER:UnregisterForUpdate(WW.name .. HOF.tag .. "MovementLoop") - else - EVENT_MANAGER:RegisterForUpdate(WW.name .. HOF.tag .. "MovementLoop", 2000, HOF.OnMovement) - end -end - -function HOF.OnBossChange(bossName) - WW.conditions.OnBossChange(bossName) +local WW = WizardsWardrobe +WW.zones["HOF"] = {} +local HOF = WW.zones["HOF"] + +HOF.name = GetString(WW_HOF_NAME) +HOF.tag = "HOF" +HOF.icon = "/esoui/art/icons/achievement_vvardenfel_036.dds" +HOF.priority = 5 +HOF.id = 975 +HOF.node = 331 + +HOF.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + displayName = GetString(WW_HOF_HUNTERKILLER_DN), + name = GetString(WW_HOF_HUNTERKILLER), + }, + [3] = { + name = GetString(WW_HOF_FACTOTUM), + }, + [4] = { + name = GetString(WW_HOF_SPIDER), + }, + [5] = { + displayName = GetString(WW_HOF_COMMITEE_DN), + name = GetString(WW_HOF_COMMITEE), + }, + [6] = { + name = GetString(WW_HOF_GENERAL), + }, +} + +HOF.LOCATIONS = { + HUNTERFACTOTUM = { + x1 = 40000, + x2 = 45500, + y1 = 49800, + y2 = 55000, + z1 = 23000, + z2 = 29000, + }, + SPIDER = { + x1 = 67700, + x2 = 93000, + y1 = 52000, + y2 = 53000, + z1 = 12200, + z2 = 37500, + }, + COMMITEE = { + x1 = 25960, + x2 = 33030, + y1 = 52900, + y2 = 53450, + z1 = 70700, + z2 = 75950, + }, + GENERAL = { + x1 = 70000, + x2 = 80000, + y1 = 54500, + y2 = 56500, + z1 = 65000, + z2 = 75500, + }, +} + +function HOF.Init() + HOF.isHunterkillerDead = false + EVENT_MANAGER:UnregisterForEvent(WW.name, EVENT_BOSSES_CHANGED) + EVENT_MANAGER:RegisterForUpdate(WW.name .. HOF.tag .. "MovementLoop", 2000, HOF.OnMovement) + EVENT_MANAGER:RegisterForEvent(WW.name .. HOF.tag, EVENT_PLAYER_COMBAT_STATE, HOF.OnCombatChange) + EVENT_MANAGER:RegisterForEvent(WW.name .. HOF.tag, EVENT_UNIT_DEATH_STATE_CHANGED, HOF.OnUnitDeath) +end + +function HOF.Reset() + EVENT_MANAGER:UnregisterForEvent(WW.name .. HOF.tag, EVENT_UNIT_DEATH_STATE_CHANGED) + EVENT_MANAGER:UnregisterForEvent(WW.name .. HOF.tag, EVENT_PLAYER_COMBAT_STATE) + EVENT_MANAGER:UnregisterForUpdate(WW.name .. HOF.tag .. "MovementLoop") + EVENT_MANAGER:RegisterForEvent(WW.name, EVENT_BOSSES_CHANGED, WW.OnBossChange) +end + +function HOF.OnUnitDeath(_, unitTag, isDead) + if not isDead then return end + if unitTag:sub(1, 1) ~= "b" then return end + local bossName = GetUnitName(unitTag) + if bossName == GetString(WW_HOF_HUNTERKILLER) then + HOF.isHunterkillerDead = true + end +end + +function HOF.OnMovement() + local bossName = HOF.GetBossByLocation() + if not bossName then return end + WW.OnBossChange(_, true, bossName) +end + +function HOF.GetBossByLocation() + local zone, x, y, z = GetUnitWorldPosition("player") + + if zone ~= HOF.id then return nil end + + if x > HOF.LOCATIONS.HUNTERFACTOTUM.x1 and x < HOF.LOCATIONS.HUNTERFACTOTUM.x2 + and y > HOF.LOCATIONS.HUNTERFACTOTUM.y1 and y < HOF.LOCATIONS.HUNTERFACTOTUM.y2 + and z > HOF.LOCATIONS.HUNTERFACTOTUM.z1 and z < HOF.LOCATIONS.HUNTERFACTOTUM.z2 then + + -- if player reloads/crashes/ports in after hunter killers are dead + if GetUnitName("boss1") == GetString(WW_HOF_FACTOTUM) then + HOF.isHunterkillerDead = true + elseif GetUnitName("boss1") == GetString(WW_HOF_HUNTERKILLER) then + HOF.isHunterkillerDead = false + end + + if HOF.isHunterkillerDead then + return GetString(WW_HOF_FACTOTUM) + else + return GetString(WW_HOF_HUNTERKILLER) + end + + elseif x > HOF.LOCATIONS.SPIDER.x1 and x < HOF.LOCATIONS.SPIDER.x2 + and y > HOF.LOCATIONS.SPIDER.y1 and y < HOF.LOCATIONS.SPIDER.y2 + and z > HOF.LOCATIONS.SPIDER.z1 and z < HOF.LOCATIONS.SPIDER.z2 then + + return GetString(WW_HOF_SPIDER) + + elseif x > HOF.LOCATIONS.COMMITEE.x1 and x < HOF.LOCATIONS.COMMITEE.x2 + and y > HOF.LOCATIONS.COMMITEE.y1 and y < HOF.LOCATIONS.COMMITEE.y2 + and z > HOF.LOCATIONS.COMMITEE.z1 and z < HOF.LOCATIONS.COMMITEE.z2 then + + return GetString(WW_HOF_COMMITEE) + + elseif x > HOF.LOCATIONS.GENERAL.x1 and x < HOF.LOCATIONS.GENERAL.x2 + and y > HOF.LOCATIONS.GENERAL.y1 and y < HOF.LOCATIONS.GENERAL.y2 + and z > HOF.LOCATIONS.GENERAL.z1 and z < HOF.LOCATIONS.GENERAL.z2 then + + return GetString(WW_HOF_GENERAL) + + else + + return ""--GetString(WW_TRASH) + end +end + +function HOF.OnCombatChange(_, inCombat) + if inCombat then + EVENT_MANAGER:UnregisterForUpdate(WW.name .. HOF.tag .. "MovementLoop") + else + EVENT_MANAGER:RegisterForUpdate(WW.name .. HOF.tag .. "MovementLoop", 2000, HOF.OnMovement) + end +end + +function HOF.OnBossChange(bossName) + WW.conditions.OnBossChange(bossName) end \ No newline at end of file diff --git a/src/zones/HRC.lua b/src/zones/trials/HRC.lua similarity index 94% rename from src/zones/HRC.lua rename to src/zones/trials/HRC.lua index aa44855..ba7633d 100644 --- a/src/zones/HRC.lua +++ b/src/zones/trials/HRC.lua @@ -1,40 +1,40 @@ -local WW = WizardsWardrobe -WW.zones["HRC"] = {} -local HRC = WW.zones["HRC"] - -HRC.name = GetString(WW_HRC_NAME) -HRC.tag = "HRC" -HRC.icon = "/esoui/art/icons/achievement_update11_dungeons_001.dds" -HRC.priority = 3 -HRC.id = 636 -HRC.node = 230 - -HRC.bosses = { - [1] = { - name = GetString(WW_TRASH), - }, - [2] = { - name = GetString(WW_HRC_RAKOTU), - }, - [3] = { - name = GetString(WW_HRC_LOWER), - }, - [4] = { - name = GetString(WW_HRC_UPPER), - }, - [5] = { - name = GetString(WW_HRC_WARRIOR), - }, -} - -function HRC.Init() - -end - -function HRC.Reset() - -end - -function HRC.OnBossChange(bossName) - WW.conditions.OnBossChange(bossName) +local WW = WizardsWardrobe +WW.zones["HRC"] = {} +local HRC = WW.zones["HRC"] + +HRC.name = GetString(WW_HRC_NAME) +HRC.tag = "HRC" +HRC.icon = "/esoui/art/icons/achievement_update11_dungeons_001.dds" +HRC.priority = 3 +HRC.id = 636 +HRC.node = 230 + +HRC.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_HRC_RAKOTU), + }, + [3] = { + name = GetString(WW_HRC_LOWER), + }, + [4] = { + name = GetString(WW_HRC_UPPER), + }, + [5] = { + name = GetString(WW_HRC_WARRIOR), + }, +} + +function HRC.Init() + +end + +function HRC.Reset() + +end + +function HRC.OnBossChange(bossName) + WW.conditions.OnBossChange(bossName) end \ No newline at end of file diff --git a/src/zones/KA.lua b/src/zones/trials/KA.lua similarity index 96% rename from src/zones/KA.lua rename to src/zones/trials/KA.lua index 8227bfc..ef2c8d7 100644 --- a/src/zones/KA.lua +++ b/src/zones/trials/KA.lua @@ -1,110 +1,110 @@ -local WW = WizardsWardrobe -WW.zones["KA"] = {} -local KA = WW.zones["KA"] - -KA.name = GetString(WW_KA_NAME) -KA.tag = "KA" -KA.icon = "/esoui/art/icons/achievement_u26_skyrim_vtrial_meta.dds" -KA.priority = 9 -KA.id = 1196 -KA.node = 434 - -KA.bosses = { - [1] = { - name = GetString(WW_TRASH), - }, - [2] = { - name = GetString(WW_KA_YANDIR), - }, - [3] = { - name = GetString(WW_KA_VROL), - }, - [4] = { - name = GetString(WW_KA_FALGRAVN), - }, -} - -KA.LOCATIONS = { - YANDIR = { - x1 = 63200, - x2 = 68900, - y1 = 24300, - y2 = 26300, - z1 = 90500, - z2 = 99600, - }, - VROL = { - x1 = 110200, - x2 = 118500, - y1 = 24500, - y2 = 29000, - z1 = 65000, - z2 = 78800, - }, - FALGRAVN = { - x1 = 73700, - x2 = 84500, - y1 = 6000, - y2 = 22500, - z1 = 50200, - z2 = 61900, - }, -} - -function KA.Init() - EVENT_MANAGER:UnregisterForEvent(WW.name, EVENT_BOSSES_CHANGED) - EVENT_MANAGER:RegisterForUpdate(WW.name .. KA.tag .. "MovementLoop", 2000, KA.OnMovement) - EVENT_MANAGER:RegisterForEvent(WW.name .. KA.tag, EVENT_PLAYER_COMBAT_STATE, KA.OnCombatChange) -end - -function KA.Reset() - EVENT_MANAGER:UnregisterForEvent(WW.name .. KA.tag, EVENT_PLAYER_COMBAT_STATE) - EVENT_MANAGER:UnregisterForUpdate(WW.name .. KA.tag .. "MovementLoop") - EVENT_MANAGER:RegisterForEvent(WW.name, EVENT_BOSSES_CHANGED, WW.OnBossChange) -end - -function KA.OnCombatChange(_, inCombat) - if inCombat then - EVENT_MANAGER:UnregisterForUpdate(WW.name .. KA.tag .. "MovementLoop") - else - EVENT_MANAGER:RegisterForUpdate(WW.name .. KA.tag .. "MovementLoop", 2000, KA.OnMovement) - end -end - -function KA.OnMovement() - local bossName = KA.GetBossByLocation() - if not bossName then return end - WW.OnBossChange(_, true, bossName) -end - -function KA.GetBossByLocation() - local zone, x, y, z = GetUnitWorldPosition("player") - - if zone ~= KA.id then return nil end - - if x > KA.LOCATIONS.YANDIR.x1 and x < KA.LOCATIONS.YANDIR.x2 - and y > KA.LOCATIONS.YANDIR.y1 and y < KA.LOCATIONS.YANDIR.y2 - and z > KA.LOCATIONS.YANDIR.z1 and z < KA.LOCATIONS.YANDIR.z2 then - - return GetString(WW_KA_YANDIR) - - elseif x > KA.LOCATIONS.VROL.x1 and x < KA.LOCATIONS.VROL.x2 - and y > KA.LOCATIONS.VROL.y1 and y < KA.LOCATIONS.VROL.y2 - and z > KA.LOCATIONS.VROL.z1 and z < KA.LOCATIONS.VROL.z2 then - - return GetString(WW_KA_VROL) - - elseif x > KA.LOCATIONS.FALGRAVN.x1 and x < KA.LOCATIONS.FALGRAVN.x2 - and y > KA.LOCATIONS.FALGRAVN.y1 and y < KA.LOCATIONS.FALGRAVN.y2 - and z > KA.LOCATIONS.FALGRAVN.z1 and z < KA.LOCATIONS.FALGRAVN.z2 then - - return GetString(WW_KA_FALGRAVN) - - else - return GetString(WW_TRASH) - end -end - -function KA.OnBossChange(bossName) - WW.conditions.OnBossChange(bossName) +local WW = WizardsWardrobe +WW.zones["KA"] = {} +local KA = WW.zones["KA"] + +KA.name = GetString(WW_KA_NAME) +KA.tag = "KA" +KA.icon = "/esoui/art/icons/achievement_u26_skyrim_vtrial_meta.dds" +KA.priority = 9 +KA.id = 1196 +KA.node = 434 + +KA.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_KA_YANDIR), + }, + [3] = { + name = GetString(WW_KA_VROL), + }, + [4] = { + name = GetString(WW_KA_FALGRAVN), + }, +} + +KA.LOCATIONS = { + YANDIR = { + x1 = 63200, + x2 = 68900, + y1 = 24300, + y2 = 26300, + z1 = 90500, + z2 = 99600, + }, + VROL = { + x1 = 110200, + x2 = 118500, + y1 = 24500, + y2 = 29000, + z1 = 65000, + z2 = 78800, + }, + FALGRAVN = { + x1 = 73700, + x2 = 84500, + y1 = 6000, + y2 = 22500, + z1 = 50200, + z2 = 61900, + }, +} + +function KA.Init() + EVENT_MANAGER:UnregisterForEvent(WW.name, EVENT_BOSSES_CHANGED) + EVENT_MANAGER:RegisterForUpdate(WW.name .. KA.tag .. "MovementLoop", 2000, KA.OnMovement) + EVENT_MANAGER:RegisterForEvent(WW.name .. KA.tag, EVENT_PLAYER_COMBAT_STATE, KA.OnCombatChange) +end + +function KA.Reset() + EVENT_MANAGER:UnregisterForEvent(WW.name .. KA.tag, EVENT_PLAYER_COMBAT_STATE) + EVENT_MANAGER:UnregisterForUpdate(WW.name .. KA.tag .. "MovementLoop") + EVENT_MANAGER:RegisterForEvent(WW.name, EVENT_BOSSES_CHANGED, WW.OnBossChange) +end + +function KA.OnCombatChange(_, inCombat) + if inCombat then + EVENT_MANAGER:UnregisterForUpdate(WW.name .. KA.tag .. "MovementLoop") + else + EVENT_MANAGER:RegisterForUpdate(WW.name .. KA.tag .. "MovementLoop", 2000, KA.OnMovement) + end +end + +function KA.OnMovement() + local bossName = KA.GetBossByLocation() + if not bossName then return end + WW.OnBossChange(_, true, bossName) +end + +function KA.GetBossByLocation() + local zone, x, y, z = GetUnitWorldPosition("player") + + if zone ~= KA.id then return nil end + + if x > KA.LOCATIONS.YANDIR.x1 and x < KA.LOCATIONS.YANDIR.x2 + and y > KA.LOCATIONS.YANDIR.y1 and y < KA.LOCATIONS.YANDIR.y2 + and z > KA.LOCATIONS.YANDIR.z1 and z < KA.LOCATIONS.YANDIR.z2 then + + return GetString(WW_KA_YANDIR) + + elseif x > KA.LOCATIONS.VROL.x1 and x < KA.LOCATIONS.VROL.x2 + and y > KA.LOCATIONS.VROL.y1 and y < KA.LOCATIONS.VROL.y2 + and z > KA.LOCATIONS.VROL.z1 and z < KA.LOCATIONS.VROL.z2 then + + return GetString(WW_KA_VROL) + + elseif x > KA.LOCATIONS.FALGRAVN.x1 and x < KA.LOCATIONS.FALGRAVN.x2 + and y > KA.LOCATIONS.FALGRAVN.y1 and y < KA.LOCATIONS.FALGRAVN.y2 + and z > KA.LOCATIONS.FALGRAVN.z1 and z < KA.LOCATIONS.FALGRAVN.z2 then + + return GetString(WW_KA_FALGRAVN) + + else + return GetString(WW_TRASH) + end +end + +function KA.OnBossChange(bossName) + WW.conditions.OnBossChange(bossName) end \ No newline at end of file diff --git a/src/zones/MOL.lua b/src/zones/trials/MOL.lua similarity index 96% rename from src/zones/MOL.lua rename to src/zones/trials/MOL.lua index ae0ceea..545d082 100644 --- a/src/zones/MOL.lua +++ b/src/zones/trials/MOL.lua @@ -1,110 +1,110 @@ -local WW = WizardsWardrobe -WW.zones["MOL"] = {} -local MOL = WW.zones["MOL"] - -MOL.name = GetString(WW_MOL_NAME) -MOL.tag = "MOL" -MOL.icon = "/esoui/art/icons/achievement_thievesguild_004.dds" -MOL.priority = 4 -MOL.id = 725 -MOL.node = 258 - -MOL.bosses = { - [1] = { - name = GetString(WW_TRASH), - }, - [2] = { - name = GetString(WW_MOL_ZHAJHASSA), - }, - [3] = { - name = GetString(WW_MOL_TWINS), - }, - [4] = { - name = GetString(WW_MOL_RAKKHAT), - }, -} - -MOL.LOCATIONS = { - ZHAJHASSA = { - x1 = 100000, - x2 = 105800, - y1 = 45500, - y2 = 46500, - z1 = 125500, - z2 = 130900, - }, - TWINS = { - x1 = 76800, - x2 = 81700, - y1 = 45650, - y2 = 45900, - z1 = 144200, - z2 = 149600, - }, - RAKKHAT = { - x1 = 0, - x2 = 57500, - y1 = 61400, - y2 = 62000, - z1 = 171000, - z2 = 208000, - }, -} - -function MOL.Init() - EVENT_MANAGER:UnregisterForEvent(WW.name, EVENT_BOSSES_CHANGED) - EVENT_MANAGER:RegisterForUpdate(WW.name .. MOL.tag .. "MovementLoop", 2000, MOL.OnMovement) - EVENT_MANAGER:RegisterForEvent(WW.name .. MOL.tag, EVENT_PLAYER_COMBAT_STATE, MOL.OnCombatChange) -end - -function MOL.Reset() - EVENT_MANAGER:UnregisterForEvent(WW.name .. MOL.tag, EVENT_PLAYER_COMBAT_STATE) - EVENT_MANAGER:UnregisterForUpdate(WW.name .. MOL.tag .. "MovementLoop") - EVENT_MANAGER:RegisterForEvent(WW.name, EVENT_BOSSES_CHANGED, WW.OnBossChange) -end - -function MOL.OnCombatChange(_, inCombat) - if inCombat then - EVENT_MANAGER:UnregisterForUpdate(WW.name .. MOL.tag .. "MovementLoop") - else - EVENT_MANAGER:RegisterForUpdate(WW.name .. MOL.tag .. "MovementLoop", 2000, MOL.OnMovement) - end -end - -function MOL.OnMovement() - local bossName = MOL.GetBossByLocation() - if not bossName then return end - WW.OnBossChange(_, true, bossName) -end - -function MOL.GetBossByLocation() - local zone, x, y, z = GetUnitWorldPosition("player") - - if zone ~= MOL.id then return nil end - - if x > MOL.LOCATIONS.ZHAJHASSA.x1 and x < MOL.LOCATIONS.ZHAJHASSA.x2 - and y > MOL.LOCATIONS.ZHAJHASSA.y1 and y < MOL.LOCATIONS.ZHAJHASSA.y2 - and z > MOL.LOCATIONS.ZHAJHASSA.z1 and z < MOL.LOCATIONS.ZHAJHASSA.z2 then - - return GetString(WW_MOL_ZHAJHASSA) - - elseif x > MOL.LOCATIONS.TWINS.x1 and x < MOL.LOCATIONS.TWINS.x2 - and y > MOL.LOCATIONS.TWINS.y1 and y < MOL.LOCATIONS.TWINS.y2 - and z > MOL.LOCATIONS.TWINS.z1 and z < MOL.LOCATIONS.TWINS.z2 then - - return GetString(WW_MOL_TWINS) - - elseif x > MOL.LOCATIONS.RAKKHAT.x1 and x < MOL.LOCATIONS.RAKKHAT.x2 - and y > MOL.LOCATIONS.RAKKHAT.y1 and y < MOL.LOCATIONS.RAKKHAT.y2 - and z > MOL.LOCATIONS.RAKKHAT.z1 and z < MOL.LOCATIONS.RAKKHAT.z2 then - - return GetString(WW_MOL_RAKKHAT) - - else - return GetString(WW_TRASH) - end -end - -function MOL.OnBossChange(bossName) - WW.conditions.OnBossChange(bossName) +local WW = WizardsWardrobe +WW.zones["MOL"] = {} +local MOL = WW.zones["MOL"] + +MOL.name = GetString(WW_MOL_NAME) +MOL.tag = "MOL" +MOL.icon = "/esoui/art/icons/achievement_thievesguild_004.dds" +MOL.priority = 4 +MOL.id = 725 +MOL.node = 258 + +MOL.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_MOL_ZHAJHASSA), + }, + [3] = { + name = GetString(WW_MOL_TWINS), + }, + [4] = { + name = GetString(WW_MOL_RAKKHAT), + }, +} + +MOL.LOCATIONS = { + ZHAJHASSA = { + x1 = 100000, + x2 = 105800, + y1 = 45500, + y2 = 46500, + z1 = 125500, + z2 = 130900, + }, + TWINS = { + x1 = 76800, + x2 = 81700, + y1 = 45650, + y2 = 45900, + z1 = 144200, + z2 = 149600, + }, + RAKKHAT = { + x1 = 0, + x2 = 57500, + y1 = 61400, + y2 = 62000, + z1 = 171000, + z2 = 208000, + }, +} + +function MOL.Init() + EVENT_MANAGER:UnregisterForEvent(WW.name, EVENT_BOSSES_CHANGED) + EVENT_MANAGER:RegisterForUpdate(WW.name .. MOL.tag .. "MovementLoop", 2000, MOL.OnMovement) + EVENT_MANAGER:RegisterForEvent(WW.name .. MOL.tag, EVENT_PLAYER_COMBAT_STATE, MOL.OnCombatChange) +end + +function MOL.Reset() + EVENT_MANAGER:UnregisterForEvent(WW.name .. MOL.tag, EVENT_PLAYER_COMBAT_STATE) + EVENT_MANAGER:UnregisterForUpdate(WW.name .. MOL.tag .. "MovementLoop") + EVENT_MANAGER:RegisterForEvent(WW.name, EVENT_BOSSES_CHANGED, WW.OnBossChange) +end + +function MOL.OnCombatChange(_, inCombat) + if inCombat then + EVENT_MANAGER:UnregisterForUpdate(WW.name .. MOL.tag .. "MovementLoop") + else + EVENT_MANAGER:RegisterForUpdate(WW.name .. MOL.tag .. "MovementLoop", 2000, MOL.OnMovement) + end +end + +function MOL.OnMovement() + local bossName = MOL.GetBossByLocation() + if not bossName then return end + WW.OnBossChange(_, true, bossName) +end + +function MOL.GetBossByLocation() + local zone, x, y, z = GetUnitWorldPosition("player") + + if zone ~= MOL.id then return nil end + + if x > MOL.LOCATIONS.ZHAJHASSA.x1 and x < MOL.LOCATIONS.ZHAJHASSA.x2 + and y > MOL.LOCATIONS.ZHAJHASSA.y1 and y < MOL.LOCATIONS.ZHAJHASSA.y2 + and z > MOL.LOCATIONS.ZHAJHASSA.z1 and z < MOL.LOCATIONS.ZHAJHASSA.z2 then + + return GetString(WW_MOL_ZHAJHASSA) + + elseif x > MOL.LOCATIONS.TWINS.x1 and x < MOL.LOCATIONS.TWINS.x2 + and y > MOL.LOCATIONS.TWINS.y1 and y < MOL.LOCATIONS.TWINS.y2 + and z > MOL.LOCATIONS.TWINS.z1 and z < MOL.LOCATIONS.TWINS.z2 then + + return GetString(WW_MOL_TWINS) + + elseif x > MOL.LOCATIONS.RAKKHAT.x1 and x < MOL.LOCATIONS.RAKKHAT.x2 + and y > MOL.LOCATIONS.RAKKHAT.y1 and y < MOL.LOCATIONS.RAKKHAT.y2 + and z > MOL.LOCATIONS.RAKKHAT.z1 and z < MOL.LOCATIONS.RAKKHAT.z2 then + + return GetString(WW_MOL_RAKKHAT) + + else + return GetString(WW_TRASH) + end +end + +function MOL.OnBossChange(bossName) + WW.conditions.OnBossChange(bossName) end \ No newline at end of file diff --git a/src/zones/RG.lua b/src/zones/trials/RG.lua similarity index 96% rename from src/zones/RG.lua rename to src/zones/trials/RG.lua index a6ed607..f6057cc 100644 --- a/src/zones/RG.lua +++ b/src/zones/trials/RG.lua @@ -1,151 +1,151 @@ -local WW = WizardsWardrobe -WW.zones["RG"] = {} -local RG = WW.zones["RG"] - -RG.name = GetString(WW_RG_NAME) -RG.tag = "RG" -RG.icon = "/esoui/art/icons/achievement_u30_vtrial_meta.dds" -RG.priority = 10 -RG.id = 1263 -RG.node = 468 - -RG.bosses = { - [1] = { - name = GetString(WW_TRASH), - }, - [2] = { - name = GetString(WW_RG_OAXILTSO), - }, - [3] = { - name = GetString(WW_RG_BAHSEI), - }, - [4] = { - name = GetString(WW_RG_XALVAKKA), - }, - [5] = { - name = GetString(WW_RG_SNAKE), - }, - [6] = { - name = GetString(WW_RG_ASHTITAN), - }, -} - -RG.LOCATIONS = { - OAXILTSO = { - x1 = 86200, - x2 = 94000, - y1 = 35000, - y2 = 36500, - z1 = 76700, - z2 = 83600, - }, - BAHSEI = { - x1 = 96500, - x2 = 103800, - y1 = 42000, - y2 = 43100, - z1 = 96000, - z2 = 103200, - }, - XALVAKKA = { - x1 = 149400, - x2 = 168000, - y1 = 30000, - y2 = 39000, - z1 = 150000, - z2 = 168000, - }, - SNAKE = { - x1 = 100400, - x2 = 117000, - y1 = 32500, - y2 = 34500, - z1 = 50200, - z2 = 54580, - }, - ASHTITAN = { - x1 = 163900, - x2 = 172500, - y1 = 29800, - y2 = 31800, - z1 = 141000, - z2 = 150300, - }, -} - -function RG.Init() - EVENT_MANAGER:UnregisterForEvent(WW.name, EVENT_BOSSES_CHANGED) - EVENT_MANAGER:RegisterForUpdate(WW.name .. RG.tag .. "MovementLoop", 2000, RG.OnMovement) - EVENT_MANAGER:RegisterForEvent(WW.name .. RG.tag, EVENT_PLAYER_COMBAT_STATE, RG.OnCombatChange) - RG.lastBoss = "" -end - -function RG.Reset() - EVENT_MANAGER:UnregisterForEvent(WW.name .. RG.tag, EVENT_PLAYER_COMBAT_STATE) - EVENT_MANAGER:UnregisterForUpdate(WW.name .. RG.tag .. "MovementLoop") - EVENT_MANAGER:RegisterForEvent(WW.name, EVENT_BOSSES_CHANGED, WW.OnBossChange) -end - -function RG.OnCombatChange(_, inCombat) - if inCombat then - EVENT_MANAGER:UnregisterForUpdate(WW.name .. RG.tag .. "MovementLoop") - else - EVENT_MANAGER:RegisterForUpdate(WW.name .. RG.tag .. "MovementLoop", 2000, RG.OnMovement) - end -end - -function RG.OnMovement() - local bossName = RG.GetBossByLocation() - if not bossName then return end - WW.OnBossChange(_, true, bossName) -end - -function RG.GetBossByLocation() - local zone, x, y, z = GetUnitWorldPosition("player") - - if zone ~= RG.id then return nil end - - if x > RG.LOCATIONS.OAXILTSO.x1 and x < RG.LOCATIONS.OAXILTSO.x2 - and y > RG.LOCATIONS.OAXILTSO.y1 and y < RG.LOCATIONS.OAXILTSO.y2 - and z > RG.LOCATIONS.OAXILTSO.z1 and z < RG.LOCATIONS.OAXILTSO.z2 then - - return GetString(WW_RG_OAXILTSO) - - elseif x > RG.LOCATIONS.BAHSEI.x1 and x < RG.LOCATIONS.BAHSEI.x2 - and y > RG.LOCATIONS.BAHSEI.y1 and y < RG.LOCATIONS.BAHSEI.y2 - and z > RG.LOCATIONS.BAHSEI.z1 and z < RG.LOCATIONS.BAHSEI.z2 then - - return GetString(WW_RG_BAHSEI) - - elseif x > RG.LOCATIONS.XALVAKKA.x1 and x < RG.LOCATIONS.XALVAKKA.x2 - and y > RG.LOCATIONS.XALVAKKA.y1 and y < RG.LOCATIONS.XALVAKKA.y2 - and z > RG.LOCATIONS.XALVAKKA.z1 and z < RG.LOCATIONS.XALVAKKA.z2 then - - return GetString(WW_RG_XALVAKKA) - - elseif x > RG.LOCATIONS.SNAKE.x1 and x < RG.LOCATIONS.SNAKE.x2 - and y > RG.LOCATIONS.SNAKE.y1 and y < RG.LOCATIONS.SNAKE.y2 - and z > RG.LOCATIONS.SNAKE.z1 and z < RG.LOCATIONS.SNAKE.z2 then - - return GetString(WW_RG_SNAKE) - - elseif x > RG.LOCATIONS.ASHTITAN.x1 and x < RG.LOCATIONS.ASHTITAN.x2 - and y > RG.LOCATIONS.ASHTITAN.y1 and y < RG.LOCATIONS.ASHTITAN.y2 - and z > RG.LOCATIONS.ASHTITAN.z1 and z < RG.LOCATIONS.ASHTITAN.z2 then - - return GetString(WW_RG_ASHTITAN) - - else - return GetString(WW_TRASH) - end -end - -function RG.OnBossChange(bossName) - if RG.lastBoss == GetString(WW_RG_ASHTITAN) and bossName == "" then - -- dont swap back to trash after ash titan - return - end - RG.lastBoss = bossName - - WW.conditions.OnBossChange(bossName) +local WW = WizardsWardrobe +WW.zones["RG"] = {} +local RG = WW.zones["RG"] + +RG.name = GetString(WW_RG_NAME) +RG.tag = "RG" +RG.icon = "/esoui/art/icons/achievement_u30_vtrial_meta.dds" +RG.priority = 10 +RG.id = 1263 +RG.node = 468 + +RG.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_RG_OAXILTSO), + }, + [3] = { + name = GetString(WW_RG_BAHSEI), + }, + [4] = { + name = GetString(WW_RG_XALVAKKA), + }, + [5] = { + name = GetString(WW_RG_SNAKE), + }, + [6] = { + name = GetString(WW_RG_ASHTITAN), + }, +} + +RG.LOCATIONS = { + OAXILTSO = { + x1 = 86200, + x2 = 94000, + y1 = 35000, + y2 = 36500, + z1 = 76700, + z2 = 83600, + }, + BAHSEI = { + x1 = 96500, + x2 = 103800, + y1 = 42000, + y2 = 43100, + z1 = 96000, + z2 = 103200, + }, + XALVAKKA = { + x1 = 149400, + x2 = 168000, + y1 = 30000, + y2 = 39000, + z1 = 150000, + z2 = 168000, + }, + SNAKE = { + x1 = 100400, + x2 = 117000, + y1 = 32500, + y2 = 34500, + z1 = 50200, + z2 = 54580, + }, + ASHTITAN = { + x1 = 163900, + x2 = 172500, + y1 = 29800, + y2 = 31800, + z1 = 141000, + z2 = 150300, + }, +} + +function RG.Init() + EVENT_MANAGER:UnregisterForEvent(WW.name, EVENT_BOSSES_CHANGED) + EVENT_MANAGER:RegisterForUpdate(WW.name .. RG.tag .. "MovementLoop", 2000, RG.OnMovement) + EVENT_MANAGER:RegisterForEvent(WW.name .. RG.tag, EVENT_PLAYER_COMBAT_STATE, RG.OnCombatChange) + RG.lastBoss = "" +end + +function RG.Reset() + EVENT_MANAGER:UnregisterForEvent(WW.name .. RG.tag, EVENT_PLAYER_COMBAT_STATE) + EVENT_MANAGER:UnregisterForUpdate(WW.name .. RG.tag .. "MovementLoop") + EVENT_MANAGER:RegisterForEvent(WW.name, EVENT_BOSSES_CHANGED, WW.OnBossChange) +end + +function RG.OnCombatChange(_, inCombat) + if inCombat then + EVENT_MANAGER:UnregisterForUpdate(WW.name .. RG.tag .. "MovementLoop") + else + EVENT_MANAGER:RegisterForUpdate(WW.name .. RG.tag .. "MovementLoop", 2000, RG.OnMovement) + end +end + +function RG.OnMovement() + local bossName = RG.GetBossByLocation() + if not bossName then return end + WW.OnBossChange(_, true, bossName) +end + +function RG.GetBossByLocation() + local zone, x, y, z = GetUnitWorldPosition("player") + + if zone ~= RG.id then return nil end + + if x > RG.LOCATIONS.OAXILTSO.x1 and x < RG.LOCATIONS.OAXILTSO.x2 + and y > RG.LOCATIONS.OAXILTSO.y1 and y < RG.LOCATIONS.OAXILTSO.y2 + and z > RG.LOCATIONS.OAXILTSO.z1 and z < RG.LOCATIONS.OAXILTSO.z2 then + + return GetString(WW_RG_OAXILTSO) + + elseif x > RG.LOCATIONS.BAHSEI.x1 and x < RG.LOCATIONS.BAHSEI.x2 + and y > RG.LOCATIONS.BAHSEI.y1 and y < RG.LOCATIONS.BAHSEI.y2 + and z > RG.LOCATIONS.BAHSEI.z1 and z < RG.LOCATIONS.BAHSEI.z2 then + + return GetString(WW_RG_BAHSEI) + + elseif x > RG.LOCATIONS.XALVAKKA.x1 and x < RG.LOCATIONS.XALVAKKA.x2 + and y > RG.LOCATIONS.XALVAKKA.y1 and y < RG.LOCATIONS.XALVAKKA.y2 + and z > RG.LOCATIONS.XALVAKKA.z1 and z < RG.LOCATIONS.XALVAKKA.z2 then + + return GetString(WW_RG_XALVAKKA) + + elseif x > RG.LOCATIONS.SNAKE.x1 and x < RG.LOCATIONS.SNAKE.x2 + and y > RG.LOCATIONS.SNAKE.y1 and y < RG.LOCATIONS.SNAKE.y2 + and z > RG.LOCATIONS.SNAKE.z1 and z < RG.LOCATIONS.SNAKE.z2 then + + return GetString(WW_RG_SNAKE) + + elseif x > RG.LOCATIONS.ASHTITAN.x1 and x < RG.LOCATIONS.ASHTITAN.x2 + and y > RG.LOCATIONS.ASHTITAN.y1 and y < RG.LOCATIONS.ASHTITAN.y2 + and z > RG.LOCATIONS.ASHTITAN.z1 and z < RG.LOCATIONS.ASHTITAN.z2 then + + return GetString(WW_RG_ASHTITAN) + + else + return GetString(WW_TRASH) + end +end + +function RG.OnBossChange(bossName) + if RG.lastBoss == GetString(WW_RG_ASHTITAN) and bossName == "" then + -- dont swap back to trash after ash titan + return + end + RG.lastBoss = bossName + + WW.conditions.OnBossChange(bossName) end \ No newline at end of file diff --git a/src/zones/SE.lua b/src/zones/trials/SE.lua similarity index 100% rename from src/zones/SE.lua rename to src/zones/trials/SE.lua diff --git a/src/zones/SO.lua b/src/zones/trials/SO.lua similarity index 93% rename from src/zones/SO.lua rename to src/zones/trials/SO.lua index 8546e6c..2c53b2c 100644 --- a/src/zones/SO.lua +++ b/src/zones/trials/SO.lua @@ -1,40 +1,40 @@ -local WW = WizardsWardrobe -WW.zones["SO"] = {} -local SO = WW.zones["SO"] - -SO.name = GetString(WW_SO_NAME) -SO.tag = "SO" -SO.icon = "/esoui/art/icons/achievement_darkbrotherhood_038.dds" -SO.priority = 2 -SO.id = 639 -SO.node = 232 - -SO.bosses = { - [1] = { - name = GetString(WW_TRASH), - }, - [2] = { - name = GetString(WW_SO_MANTIKORA), - }, - [3] = { - name = GetString(WW_SO_TROLL), - }, - [4] = { - name = GetString(WW_SO_OZARA), - }, - [5] = { - name = GetString(WW_SO_SERPENT), - }, -} - -function SO.Init() - -end - -function SO.Reset() - -end - -function SO.OnBossChange(bossName) - WW.conditions.OnBossChange(bossName) +local WW = WizardsWardrobe +WW.zones["SO"] = {} +local SO = WW.zones["SO"] + +SO.name = GetString(WW_SO_NAME) +SO.tag = "SO" +SO.icon = "/esoui/art/icons/achievement_darkbrotherhood_038.dds" +SO.priority = 2 +SO.id = 639 +SO.node = 232 + +SO.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_SO_MANTIKORA), + }, + [3] = { + name = GetString(WW_SO_TROLL), + }, + [4] = { + name = GetString(WW_SO_OZARA), + }, + [5] = { + name = GetString(WW_SO_SERPENT), + }, +} + +function SO.Init() + +end + +function SO.Reset() + +end + +function SO.OnBossChange(bossName) + WW.conditions.OnBossChange(bossName) end \ No newline at end of file diff --git a/src/zones/SS.lua b/src/zones/trials/SS.lua similarity index 91% rename from src/zones/SS.lua rename to src/zones/trials/SS.lua index 5c703dd..0a3575d 100644 --- a/src/zones/SS.lua +++ b/src/zones/trials/SS.lua @@ -1,110 +1,110 @@ -local WW = WizardsWardrobe -WW.zones["SS"] = {} -local SS = WW.zones["SS"] - -SS.name = GetString(WW_SS_NAME) -SS.tag = "SS" -SS.icon = "/esoui/art/icons/achievement_els_sunspire_hardmode_all.dds" -SS.priority = 8 -SS.id = 1121 -SS.node = 399 - -SS.bosses = { - [1] = { - name = GetString(WW_TRASH), - }, - [2] = { - name = GetString(WW_SS_LOKKESTIIZ), - }, - [3] = { - name = GetString(WW_SS_YOLNAHKRIIN), - }, - [4] = { - name = GetString(WW_SS_NAHVIINTAAS), - }, -} - -SS.LOCATIONS = { - LOKKESTIIZ = { - x1 = 112000, - x2 = 118000, - y1 = 55500, - y2 = 56500, - z1 = 100700, - z2 = 109900, - }, - YOLNAHKRIIN = { - x1 = 93500, - x2 = 101500, - y1 = 49000, - y2 = 50500, - z1 = 103500, - z2 = 115600, - }, - NAHVIINTAAS = { - x1 = 102200, - x2 = 109300, - y1 = 63000, - y2 = 64800, - z1 = 84700, - z2 = 96700, - }, -} - -function SS.Init() - EVENT_MANAGER:UnregisterForEvent(WW.name, EVENT_BOSSES_CHANGED) - EVENT_MANAGER:RegisterForUpdate(WW.name .. SS.tag .. "MovementLoop", 2000, SS.OnMovement) - EVENT_MANAGER:RegisterForEvent(WW.name .. SS.tag, EVENT_PLAYER_COMBAT_STATE, SS.OnCombatChange) -end - -function SS.Reset() - EVENT_MANAGER:UnregisterForEvent(WW.name .. SS.tag, EVENT_PLAYER_COMBAT_STATE) - EVENT_MANAGER:UnregisterForUpdate(WW.name .. SS.tag .. "MovementLoop") - EVENT_MANAGER:RegisterForEvent(WW.name, EVENT_BOSSES_CHANGED, WW.OnBossChange) -end - -function SS.OnCombatChange(_, inCombat) - if inCombat then - EVENT_MANAGER:UnregisterForUpdate(WW.name .. SS.tag .. "MovementLoop") - else - EVENT_MANAGER:RegisterForUpdate(WW.name .. SS.tag .. "MovementLoop", 2000, SS.OnMovement) - end -end - -function SS.OnMovement() - local bossName = SS.GetBossByLocation() - if not bossName then return end - WW.OnBossChange(_, true, bossName) -end - -function SS.GetBossByLocation() - local zone, x, y, z = GetUnitWorldPosition("player") - - if zone ~= SS.id then return nil end - - if x > SS.LOCATIONS.LOKKESTIIZ.x1 and x < SS.LOCATIONS.LOKKESTIIZ.x2 - and y > SS.LOCATIONS.LOKKESTIIZ.y1 and y < SS.LOCATIONS.LOKKESTIIZ.y2 - and z > SS.LOCATIONS.LOKKESTIIZ.z1 and z < SS.LOCATIONS.LOKKESTIIZ.z2 then - - return GetString(WW_SS_LOKKESTIIZ) - - elseif x > SS.LOCATIONS.YOLNAHKRIIN.x1 and x < SS.LOCATIONS.YOLNAHKRIIN.x2 - and y > SS.LOCATIONS.YOLNAHKRIIN.y1 and y < SS.LOCATIONS.YOLNAHKRIIN.y2 - and z > SS.LOCATIONS.YOLNAHKRIIN.z1 and z < SS.LOCATIONS.YOLNAHKRIIN.z2 then - - return GetString(WW_SS_YOLNAHKRIIN) - - elseif x > SS.LOCATIONS.NAHVIINTAAS.x1 and x < SS.LOCATIONS.NAHVIINTAAS.x2 - and y > SS.LOCATIONS.NAHVIINTAAS.y1 and y < SS.LOCATIONS.NAHVIINTAAS.y2 - and z > SS.LOCATIONS.NAHVIINTAAS.z1 and z < SS.LOCATIONS.NAHVIINTAAS.z2 then - - return GetString(WW_SS_NAHVIINTAAS) - - else - return GetString(WW_TRASH) - end -end - -function SS.OnBossChange(bossName) - WW.conditions.OnBossChange(bossName) +local WW = WizardsWardrobe +WW.zones["SS"] = {} +local SS = WW.zones["SS"] + +SS.name = GetString(WW_SS_NAME) +SS.tag = "SS" +SS.icon = "/esoui/art/icons/achievement_els_sunspire_hardmode_all.dds" +SS.priority = 8 +SS.id = 1121 +SS.node = 399 + +SS.bosses = { + [1] = { + name = GetString(WW_TRASH), + }, + [2] = { + name = GetString(WW_SS_LOKKESTIIZ), + }, + [3] = { + name = GetString(WW_SS_YOLNAHKRIIN), + }, + [4] = { + name = GetString(WW_SS_NAHVIINTAAS), + }, +} + +SS.LOCATIONS = { + LOKKESTIIZ = { + x1 = 112000, + x2 = 118000, + y1 = 55500, + y2 = 57000,-- the coord change due auto-equip issue on it + z1 = 100700, + z2 = 108600,-- the coord change due auto-equip issue on it + }, + YOLNAHKRIIN = { + x1 = 93500, + x2 = 101500, + y1 = 49000, + y2 = 52000, -- the coord change due auto-equip issue on it + z1 = 107000, -- the coord change due auto-equip issue on it + z2 = 115600, + }, + NAHVIINTAAS = { + x1 = 102200, + x2 = 109300, + y1 = 63000, + y2 = 64800, + z1 = 84700, + z2 = 96700, + }, +} + +function SS.Init() + EVENT_MANAGER:UnregisterForEvent(WW.name, EVENT_BOSSES_CHANGED) + EVENT_MANAGER:RegisterForUpdate(WW.name .. SS.tag .. "MovementLoop", 2000, SS.OnMovement) + EVENT_MANAGER:RegisterForEvent(WW.name .. SS.tag, EVENT_PLAYER_COMBAT_STATE, SS.OnCombatChange) +end + +function SS.Reset() + EVENT_MANAGER:UnregisterForEvent(WW.name .. SS.tag, EVENT_PLAYER_COMBAT_STATE) + EVENT_MANAGER:UnregisterForUpdate(WW.name .. SS.tag .. "MovementLoop") + EVENT_MANAGER:RegisterForEvent(WW.name, EVENT_BOSSES_CHANGED, WW.OnBossChange) +end + +function SS.OnCombatChange(_, inCombat) + if inCombat then + EVENT_MANAGER:UnregisterForUpdate(WW.name .. SS.tag .. "MovementLoop") + else + EVENT_MANAGER:RegisterForUpdate(WW.name .. SS.tag .. "MovementLoop", 2000, SS.OnMovement) + end +end + +function SS.OnMovement() + local bossName = SS.GetBossByLocation() + if not bossName then return end + WW.OnBossChange(_, true, bossName) +end + +function SS.GetBossByLocation() + local zone, x, y, z = GetUnitWorldPosition("player") + + if zone ~= SS.id then return nil end + + if x > SS.LOCATIONS.LOKKESTIIZ.x1 and x < SS.LOCATIONS.LOKKESTIIZ.x2 + and y > SS.LOCATIONS.LOKKESTIIZ.y1 and y < SS.LOCATIONS.LOKKESTIIZ.y2 + and z > SS.LOCATIONS.LOKKESTIIZ.z1 and z < SS.LOCATIONS.LOKKESTIIZ.z2 then + + return GetString(WW_SS_LOKKESTIIZ) + + elseif x > SS.LOCATIONS.YOLNAHKRIIN.x1 and x < SS.LOCATIONS.YOLNAHKRIIN.x2 + and y > SS.LOCATIONS.YOLNAHKRIIN.y1 and y < SS.LOCATIONS.YOLNAHKRIIN.y2 + and z > SS.LOCATIONS.YOLNAHKRIIN.z1 and z < SS.LOCATIONS.YOLNAHKRIIN.z2 then + + return GetString(WW_SS_YOLNAHKRIIN) + + elseif x > SS.LOCATIONS.NAHVIINTAAS.x1 and x < SS.LOCATIONS.NAHVIINTAAS.x2 + and y > SS.LOCATIONS.NAHVIINTAAS.y1 and y < SS.LOCATIONS.NAHVIINTAAS.y2 + and z > SS.LOCATIONS.NAHVIINTAAS.z1 and z < SS.LOCATIONS.NAHVIINTAAS.z2 then + + return GetString(WW_SS_NAHVIINTAAS) + + else + return GetString(WW_TRASH) + end +end + +function SS.OnBossChange(bossName) + WW.conditions.OnBossChange(bossName) end \ No newline at end of file