ESOUI SVN TaosGroupUltimate

[/] [trunk/] [TaosGroupUltimate/] [logic/] [UltimateGroupHandler.lua] - Rev 14

Go to most recent revision | Compare with Previous | Blame | View Log

--[[
        Addon: Taos Group Ultimate
        Author: TProg Taonnor
        Created by @Taonnor
]]--

--[[
        Global variables
]]--
local LOG_ACTIVE = false

--[[
        Class UltimateGroupHandler
]]--
UltimateGroupHandler = {}
UltimateGroupHandler.__index = UltimateGroupHandler

--[[
        Class Members
]]--
UltimateGroupHandler.Name = "TGU-UltimateGroupHandler"
UltimateGroupHandler.UltimateGroups = nil

--[[
        GetUltimateGroupByAbilityId gets the specific ability ID of ultimate group from given ability ID
]]--
function UltimateGroupHandler.GetUltimateGroupByAbilityId(abilityID)
    if (LOG_ACTIVE) then 
        logTrace("UltimateGroupHandler.GetUltimateGroupByAbilityId")
        logDebug("abilityID: " .. tostring(abilityID))
    end

    for i, group in pairs(UltimateGroupHandler.UltimateGroups) do
        for i, groupAbilityId in pairs(group.GroupAbilityIds) do
            --if (LOG_ACTIVE) then logDebug("abilityId " .. groupAbilityId  .. " of group " .. group.GroupName) end

            if (groupAbilityId == abilityID) then
                return group
            end
        end
    end

    -- GroupName not found
    if (LOG_ACTIVE) then 
        logError("AbilityId not found " .. tostring(abilityID))
    end

    return nil
end

--[[
        GetUltimateGroupByGroupName gets the specific ability ID of ultimate group from given group name
]]--
function UltimateGroupHandler.GetUltimateGroupByGroupName(groupName)
    if (LOG_ACTIVE) then 
        logTrace("UltimateGroupHandler.GetUltimateGroupByGroupName")
        logDebug("groupName: " .. tostring(groupName))
    end

    for i, group in pairs(UltimateGroupHandler.UltimateGroups) do
        if (LOG_ACTIVE) then logDebug(string.lower(group.GroupName) .. " == " .. string.lower(groupName)) end
        if (string.lower(group.GroupName) == string.lower(groupName)) then
            return group
        end
    end

    -- GroupName not found
    if (LOG_ACTIVE) then 
        logError("GroupName not found " .. tostring(groupName))
    end

    return nil
end

--[[
        GetUltimateGroups gets all ultimate groups
]]--
function UltimateGroupHandler.GetUltimateGroups()
    if (LOG_ACTIVE) then logTrace("UltimateGroupHandler.GetUltimateGroups") end

    return UltimateGroupHandler.UltimateGroups
end

--[[
        CreateUltimateGroups Creates UltimateGroups array
]]--
function UltimateGroupHandler.CreateUltimateGroups()
    if (LOG_ACTIVE) then logTrace("UltimateGroupHandler.GetUltimateGroups") end

    -- TODO: Komplette Liste aller Ultimategruppen

    local negate = {}
    negate.GroupName = "NEGATE"
    negate.GroupDescription = "Negate ultimates from Sorcerer class"
    negate.GroupAbitiyId = 29861
    negate.GroupAbilityIds = { 28348, 29867, 29874, 29881, 28341, 29849, 29855, 29861 } -- FIXME: Missing unmorphed ID's

    local templarHeal = {}
    templarHeal.GroupName = "TPHEAL"
    templarHeal.GroupDescription = "Heal ultimates from Templar class"
    templarHeal.GroupAbitiyId = 27413
    templarHeal.GroupAbilityIds = { 22226, 27419, 27423, 27427, 22229, 27401, 27407, 27413, 22223, 27388, 27392, 27396 }

    local wardenIce = {}
    wardenIce.GroupName = "FREEZE"
    wardenIce.GroupDescription = "Ice ultimates from Warden class"
    wardenIce.GroupAbitiyId = 86112
    wardenIce.GroupAbilityIds = { 86113, 86114, 86115, 86116, 86117, 86118, 86119, 86120, 86109, 86110, 86111, 86112 }

    local staffIce = {}
    staffIce.GroupName = "ICE"
    staffIce.GroupDescription = "Ice ultimates from Destruction Staff weapon"
    staffIce.GroupAbitiyId = 86542
    staffIce.GroupAbilityIds = { 86546, 86544, 83684, 86542, 86494, 83628, 86496, 86522, 86518, 86520, 85128 } -- FIXME: Missing Ice Storm 4

    local staffFire = {}
    staffFire.GroupName = "FIRE"
    staffFire.GroupDescription = "Fire ultimates from Destruction Staff weapon"
    staffFire.GroupAbitiyId = 86536
    staffFire.GroupAbilityIds = { 83682, 86538, 86540, 86536, 86512, 85126, 86513, 86515, 86488, 86490, 86492, 83625 }

    local staffLightning = {}
    staffLightning.GroupName = "LIGHT"
    staffLightning.GroupDescription = "Lightning ultimates from Destruction Staff weapon"
    staffLightning.GroupAbitiyId = 86550
    staffLightning.GroupAbilityIds = { 86552, 83686, 86548, 86550, 86502, 83630, 86504, 86500, 86526, 86528, 86524, 85130 }

    local staffHeal = {}
    staffHeal.GroupName = "STHEAL"
    staffHeal.GroupDescription = "Heal ultimates from Healing Staff weapon"
    staffHeal.GroupAbitiyId = 86454
    staffHeal.GroupAbilityIds = { 83850, 86428, 86441, 86454, 85132, 86467, 86471, 86475, 83552, 86421, 86423, 86425 }

    local meteor = {}
    meteor.GroupName = "METEOR"
    meteor.GroupDescription = "Meteor ultimates from Mages guild"
    meteor.GroupAbitiyId = 42492
    meteor.GroupAbilityIds = { 40489, 42470, 42474, 42478, 16536, 42461, 42464, 42467, 40493, 42482, 42487, 42492 }

    local dawnbreaker = {}
    dawnbreaker.GroupName = "DAWN"
    dawnbreaker.GroupDescription = "Dawnbreaker ultimates from Fighters guild"
    dawnbreaker.GroupAbitiyId = 42492
    dawnbreaker.GroupAbilityIds = { 35713, 42554, 42560, 42566, 40158, 42592, 42595, 42598, 40161, 42575, 42581, 42586 }

    local barrier = {}
    barrier.GroupName = "BARRIER"
    barrier.GroupDescription = "Barrier ultimates from Support alliance skill line"
    barrier.GroupAbitiyId = 46622
    barrier.GroupAbilityIds = { 38573, 46607, 46608, 46609, 40239, 46616, 46619, 46622, 40237, 46610, 46612, 46614 }

    local horn = {}
    horn.GroupName = "HORN"
    horn.GroupDescription = "Horn ultimates from Assoult alliance skill line"
    horn.GroupAbitiyId = 88888
    horn.GroupAbilityIds = { 46527, 46525, 46529, 88888, 38563 } -- FIXME: Complete missing of correct ability id's

    local dynamic = {}
    dynamic.GroupName = "DYNAMIC"
    dynamic.GroupDescription = "Shows the current ultimate from active actionbar"
    dynamic.GroupAbitiyId = 0
    dynamic.GroupAbilityIds = { 0, 0}

    -- Add groups
    UltimateGroupHandler.UltimateGroups = { negate, templarHeal, wardenIce, staffIce, staffFire, staffLightning, staffHeal, meteor, dawnbreaker, barrier, horn, dynamic }
end

--[[
        Initialize initializes UltimateGroupHandler
]]--
function UltimateGroupHandler.Initialize()
    if (LOG_ACTIVE) then logTrace("UltimateGroupHandler.Initialize") end

    UltimateGroupHandler.CreateUltimateGroups()
end

Go to most recent revision | Compare with Previous | Blame