Skip to content

Commit

Permalink
Let's try Mages.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hekili committed Sep 30, 2023
1 parent 1326e57 commit 1beb5eb
Show file tree
Hide file tree
Showing 10 changed files with 4,845 additions and 937 deletions.
625 changes: 497 additions & 128 deletions Classes.lua

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions Events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ function state:AddToHistory( spellID, destGUID )
if ability and not ability.essence then
local history = self.prev.history
insert( history, 1, key )
history[6] = nil
history[11] = nil

if ability.gcd ~= "off" then
history = self.prev_gcd.history
Expand All @@ -1128,7 +1128,7 @@ function state:AddToHistory( spellID, destGUID )
player.lastoffgcdtime = now
end
insert( history, 1, key )
history[6] = nil
history[11] = nil

ability.realCast = now
ability.realUnit = destGUID
Expand Down Expand Up @@ -1968,6 +1968,13 @@ local function StoreKeybindInfo( page, key, aType, id, console )
elseif aType == "item" then
local item, link = CGetItemInfo( id )
ability = item and ( class.abilities[ item ] or class.abilities[ link ] )

if item and not ability then
-- Try checking for item spell.
local n, id = GetItemSpell( item )
ability = class.abilities[ id ]
end

action = ability and ability.key

if not action then
Expand Down Expand Up @@ -2361,7 +2368,7 @@ end


local function DelayedUpdateKeybindings( event )
C_Timer.After( 0.05, function() ReadKeybindings( event ) end )
C_Timer.After( 1, function() ReadKeybindings( event ) end )
end

local function DelayedUpdateOneKeybinding( event, slot )
Expand All @@ -2376,6 +2383,7 @@ end )
RegisterEvent( "ACTIONBAR_SHOWGRID", DelayedUpdateKeybindings )
RegisterEvent( "ACTIONBAR_HIDEGRID", DelayedUpdateKeybindings )
RegisterEvent( "ACTIONBAR_PAGE_CHANGED", DelayedUpdateKeybindings )
RegisterEvent( "BAG_UPDATE", DelayedUpdateKeybindings )
-- RegisterEvent( "ACTIONBAR_UPDATE_STATE", ReadKeybindings )
-- RegisterEvent( "SPELL_UPDATE_ICON", ReadKeybindings )
-- RegisterEvent( "SPELLS_CHANGED", ReadKeybindings )
Expand Down
2 changes: 1 addition & 1 deletion Hekili.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 30402
## Interface: 30403
## Version: @project-version@
## Title: Hekili
## Author: Hekili
Expand Down
20 changes: 10 additions & 10 deletions Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4455,7 +4455,7 @@ do

for k, v in pairs( class.abilityList ) do
local a = class.abilities[ k ]
if a and ( a.id > 0 or a.id < -100 ) and a.id ~= state.cooldown.global_cooldown.id and not a.item then
if a and ( a.id > 0 or a.id < -100 ) and a.id ~= state.cooldown.global_cooldown.id and not ( a.isItem or a.item ) then
abilities[ v ] = k
end
end
Expand Down Expand Up @@ -4674,7 +4674,7 @@ do
local k = class.itemList[ ability.item ] or ability.name
local v = ability.itemKey or ability.key

if not item or not ability.item or not k then
if not item or not ( ability.isItem or ability.item ) or not k then
Hekili:Error( "Unable to find %s / %s / %s in the itemlist.", item or "unknown", ability.item or "unknown", k or "unknown" )
return
end
Expand Down Expand Up @@ -4789,7 +4789,7 @@ do
local toggles = {}

for k, v in pairs( class.abilities ) do
if k == "potion" or v.item and not abilities[ v.itemKey or v.key ] then
if k == "potion" or ( v.item or v.isItem ) and not abilities[ v.itemKey or v.key ] then
local name = class.itemList[ v.item ] or v.name
if name then abilities[ name ] = v.itemKey or v.key end
end
Expand Down Expand Up @@ -4960,7 +4960,7 @@ do
wipe( tAbilities )
for k, v in pairs( class.abilityList ) do
local a = class.abilities[ k ]
if a and ( a.id > 0 or a.id < -100 ) and a.id ~= state.cooldown.global_cooldown.id and not a.item then
if a and ( a.id > 0 or a.id < -100 ) and a.id ~= state.cooldown.global_cooldown.id and not ( a.isItem or a.item ) then
if settings.abilities[ k ].toggle == section or a.toggle == section and settings.abilities[ k ].toggle == 'default' then
tAbilities[ k ] = class.abilityList[ k ] or v
end
Expand Down Expand Up @@ -5032,7 +5032,7 @@ do
local a = class.abilities[ ability ]
local desc
if a then
if a.item then desc = a.link or a.name
if ( a.isItem or a.item ) then desc = a.link or a.name
else desc = class.abilityList[ a.key ] or a.name end
end
desc = desc or ability
Expand All @@ -5059,7 +5059,7 @@ do
e.name = function ()
local a = class.abilities[ ability ]
if a then
if a.item then return a.link or a.name end
if ( a.isItem or a.item ) then return a.link or a.name end
return class.abilityList[ a.key ] or a.name
end
return ability
Expand Down Expand Up @@ -5139,7 +5139,7 @@ do

for k, v in pairs( class.abilityList ) do
local a = class.abilities[ k ]
if a and ( a.id > 0 or a.id < -100 ) and a.id ~= state.cooldown.global_cooldown.id and not a.item then
if a and ( a.id > 0 or a.id < -100 ) and a.id ~= state.cooldown.global_cooldown.id and not ( a.isItem or a.item ) then
if settings.abilities[ k ].toggle == 'default' or settings.abilities[ k ].toggle == 'none' then
list[ k ] = class.abilityList[ k ] or v
end
Expand All @@ -5154,7 +5154,7 @@ do
e.set = function ( info, val )
local a = class.abilities[ val ]
if a then
settings[ a.item and "items" or "abilities" ][ val ].toggle = section
settings[ ( a.isItem or a.item ) and "items" or "abilities" ][ val ].toggle = section
config.adding[ section ] = false
Hekili:EmbedSpecOptions()
end
Expand All @@ -5176,11 +5176,11 @@ do
e.func = function ()
for k, v in pairs( settings.abilities ) do
local a = class.abilities[ k ]
if a and not a.item and v.toggle == section or ( class.abilities[ k ].toggle == section ) then v.toggle = 'default' end
if a and not ( a.isItem or a.item ) and v.toggle == section or ( class.abilities[ k ].toggle == section ) then v.toggle = 'default' end
end
for k, v in pairs( settings.items ) do
local a = class.abilities[ k ]
if a and a.item and v.toggle == section or ( class.abilities[ k ].toggle == section ) then v.toggle = 'default' end
if a and ( a.isItem or a.item ) and v.toggle == section or ( class.abilities[ k ].toggle == section ) then v.toggle = 'default' end
end
Hekili:EmbedSpecOptions()
end
Expand Down
35 changes: 17 additions & 18 deletions State.lua
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,15 @@ state.player = {
}
state.prev = {
meta = 'castsAll',
history = { "no_action", "no_action", "no_action", "no_action", "no_action" }
history = { "no_action", "no_action", "no_action", "no_action", "no_action", "no_action", "no_action", "no_action", "no_action", "no_action" }
}
state.prev_gcd = {
meta = 'castsOn',
history = { "no_action", "no_action", "no_action", "no_action", "no_action" }
history = { "no_action", "no_action", "no_action", "no_action", "no_action", "no_action", "no_action", "no_action", "no_action", "no_action" }
}
state.prev_off_gcd = {
meta = 'castsOff',
history = { "no_action", "no_action", "no_action", "no_action", "no_action" }
history = { "no_action", "no_action", "no_action", "no_action", "no_action", "no_action", "no_action", "no_action", "no_action", "no_action" }
}
state.predictions = {}
state.predictionsOff = {}
Expand Down Expand Up @@ -588,10 +588,15 @@ state.FindLowHpPlayerWithoutBuffByID = ns.FindLowHpPlayerWithoutBuffByID
-- state.GetActionInfo = GetActionInfo
state.GetActiveLossOfControlData = C_LossOfControl.GetActiveLossOfControlData
state.GetActiveLossOfControlDataCount = C_LossOfControl.GetActiveLossOfControlDataCount
--[[ state.GetNumGroupMembers = GetNumGroupMembers
-- state.GetItemCooldown = GetItemCooldown
-- state.GetNumGroupMembers = GetNumGroupMembers
state.GetItemCooldown = function( itemID )
if not itemID then return 0, 0, 0, 1 end
local _, spell = GetItemSpell( itemID )
if not spell then return 0, 0, 0, 1 end
return GetSpellCooldown( spell )
end
state.GetItemCount = GetItemCount
state.GetItemGem = GetItemGem
--[[ state.GetItemGem = GetItemGem
state.GetPlayerAuraBySpellID = GetPlayerAuraBySpellID
state.GetShapeshiftForm = GetShapeshiftForm
state.GetShapeshiftFormInfo = GetShapeshiftFormInfo
Expand Down Expand Up @@ -1982,9 +1987,6 @@ do
local n = t.true_active_enemies
if t.min_targets > 0 then n = max( t.min_targets, n ) end
if t.max_targets > 0 then n = min( t.max_targets, n ) end
if not n then
print( k, n, t.true_active_enemies, t.min_targets, t.max_targets, ns.getNumberTargets(), debugstack() )
end
t[k] = max( 1, n or 1 )

elseif k == "cycle_enemies" then
Expand Down Expand Up @@ -2700,7 +2702,8 @@ local mt_settings = {
if t.spec[ k ] ~= nil then return t.spec[ k ] end

if ability then
if ability.item and t.spec.items[ state.this_action ] ~= nil then return t.spec.items[ state.this_action ][ k ]
local item = ability.item or 0
if item > 0 and t.spec.items[ state.this_action ] ~= nil then return t.spec.items[ state.this_action ][ k ]
elseif not ability.item and t.spec.abilities[ state.this_action ] ~= nil then return t.spec.abilities[ state.this_action ][ k ] end
end
end
Expand Down Expand Up @@ -3282,7 +3285,7 @@ do
__index = function( t, k )
if type( k ) == "number" then
-- This is a SimulationCraft 7.1.5 or later indexed lookup, we support up to #5.
if k < 1 or k > 5 then return false end
if k < 1 or k > 10 then return false end
prev_lookup.meta = t.meta -- Which data to use? castsAll, castsOn (GCD), castsOff (offGCD)?
prev_lookup.index = k
return prev_lookup
Expand Down Expand Up @@ -6105,9 +6108,9 @@ function state:RunHandler( key, noStart )

self.history.casts[ key ] = self.query_time

self.predictions[6] = nil
self.predictionsOn[6] = nil
self.predictionsOff[6] = nil
self.predictions[11] = nil
self.predictionsOn[11] = nil
self.predictionsOff[11] = nil

self.prev.override = nil
self.prev_gcd.override = nil
Expand Down Expand Up @@ -6204,10 +6207,6 @@ do
if res.max > 0 then foundResource = true end

if k == "mana" then
if state.spec.arcane then
res.modmax = res.max / ( 1 + state.mastery_value )
end

local _, effectiveStat = UnitStat( "player", 4 )
local baseInt = min( 20, effectiveStat )
local bonusInt = effectiveStat - baseInt
Expand Down
20 changes: 19 additions & 1 deletion Utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,24 @@ function ns.IsActiveSpell( id )
end


function Hekili:GetSpellLinkWithTexture( id, size, color )
if not id then return "" end

local name, _, icon = GetSpellInfo( id )

if name and icon then
if type( color ) == "boolean" then
color = color and "ff00ff00" or "ffff0000"
end

if color == nil then color = "ff71d5ff" end

return "|W|T" .. icon .. ":" .. ( size or 0 ) .. ":" .. ( size or "" ) .. ":::64:64:4:60:4:60|t " .. ( color and ( "|c" .. color ) or "" ) .. name .. ( color and "|r" or "" ) .. "|w"
end

return tostring( id )
end


do
local itemCache = {}
Expand All @@ -587,7 +605,7 @@ do
end

local item = { GetItemInfo( id ) }
if item and item[ 1 ] then
if item[ 1 ] then
itemCache[ id ] = item
return unpack( item )
end
Expand Down
34 changes: 34 additions & 0 deletions Wrath/APLs 2.0/MageArcane.simc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Mage: Arcane
# https://www.icy-veins.com/wotlk-classic/arcane-mage-dps-pve-rotation-cooldowns-abilities
# September 2023

## Precombat
actions.precombat+=/arcane_brilliance,if=raid&buff.arcane_brilliance.down
actions.precombat+=/arcane_intellect,if=!raid&buff.arcane_brilliance.down&buff.arcane_intellect.down
actions.precombat+=/molten_armor,if=buff.unique_armor.down

## Default
actions+=/counterspell
actions+=/spellsteal
actions+=/remove_curse
## Cooldowns
actions+=/fire_ward,if=talent.incanters_absorption&buff.incanters_absorption.down&action.global_thermal_sapper_charge.ready
actions+=/global_thermal_sapper_charge,if=talent.incanters_absorption&buff.incanters_absorption.down&buff.fire_ward.up
actions+=/potion
actions+=/arcane_power
actions+=/icy_veins
actions+=/mirror_image
# Use any trinkets that aren't otherwise specified.
actions+=/use_items
actions+=/call_action_list,name=aoe,if=active_enemies>2
actions+=/arcane_missiles,if=debuff.arcane_blast.stack=4&(buff.missile_barrage.up|prev_gcd.6.arcane_blast)
actions+=/arcane_barrage,if=debuff.arcane_blast.stack=4&buff.missile_barrage.down&moving
actions+=/best_mana_potion
actions+=/replenish_mana,if=mana.pct<70
actions+=/evocation,if=mana.pct<30
actions+=/arcane_blast

actions.aoe+=/arcane_explosion,if=target.within10
actions.aoe+=/presence_of_mind
actions.aoe+=/blizzard
actions.aoe+=/flamestrike
37 changes: 37 additions & 0 deletions Wrath/APLs 2.0/MageFire.simc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Mage: Fire
# https://www.icy-veins.com/wotlk-classic/fire-mage-dps-pve-rotation-cooldowns-abilities
# September 2023

## Precombat
actions.precombat+=/arcane_brilliance,if=raid&buff.arcane_brilliance.down
actions.precombat+=/arcane_intellect,if=!raid&buff.arcane_brilliance.down&buff.arcane_intellect.down
actions.precombat+=/molten_armor,if=buff.unique_armor.down
actions.precombat+=/focus_magic,if=group&active_dot.focus_magic=0
actions.precombat+=/pyroblast,if=boss

## Default
actions+=/counterspell
actions+=/spellsteal,line_cd=spellsteal_cooldown
## Cooldowns
actions+=/mirror_image
actions+=/combustion
actions+=/icy_veins
actions+=/flame_cap
actions+=/potion
# Use any trinkets that aren't otherwise specified.
actions+=/use_items
# Regular Rotation
actions+=/living_bomb,cycle_targets=1,max_cycle_targets=living_bomb_cap,if=target.time_to_die>12&debuff.living_bomb.down
actions+=/call_action_list,name=aoe,if=active_enemies>2
actions+=/pyroblast,if=buff.hot_streak.react
actions+=/best_mana_potion
actions+=/replenish_mana,if=mana.pct<70
actions+=/evocation,if=mana.pct<30
actions+=/fire_blast,if=moving
actions+=/frostfire_bolt,if=glyph.frostfire.enabled
actions+=/fireball

actions.aoe+=/blast_wave,if=target.within10
actions.aoe+=/flamestrike,line_cd=8,if=buff.firestarter.up
actions.aoe+=/dragons_breath,if=target.within12
actions.aoe+=/blizzard
38 changes: 38 additions & 0 deletions Wrath/APLs 2.0/MageFrost.simc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Mage: Frost
# https://www.icy-veins.com/wotlk-classic/frost-mage-dps-pve-rotation-cooldowns-abilities
# September 2023

## Precombat
actions.precombat+=/arcane_brilliance,if=raid&buff.arcane_brilliance.down
actions.precombat+=/arcane_intellect,if=!raid&buff.arcane_brilliance.down&buff.arcane_intellect.down
actions.precombat+=/conjure_mana_gem,if=mana_gem_charges<2
actions.precombat+=/molten_armor,if=buff.unique_armor.down
actions.precombat+=/summon_water_elemental,if=!pet.active&glyph.eternal_water.enabled
actions.precombat+=/focus_magic,if=group&active_dot.focus_magic=0
actions.precombat+=/pyroblast,if=boss

## Default
actions+=/counterspell
actions+=/spellsteal,line_cd=spellsteal_cooldown
## Cooldowns
actions+=/mirror_image
actions+=/summon_water_elemental,if=!glyph.eternal_water.enabled
actions+=/icy_veins
actions+=/arcane_power
actions+=/flame_cap
actions+=/potion,use_off_gcd=1
actions+=/cold_snap,if=use_cold_snap&buff.icy_veins.down&cooldown.icy_veins.remains>60
# Use any trinkets that aren't otherwise specified.
actions+=/use_items
# Use Deep Freeze to consume your last Fingers of Frost charge simultaneously with a Frostbolt or Frostfire Bolt.
actions+=/deep_freeze,if=(debuff.frozen.up|buff.fingers_of_frost.stack=1)&(action.frostfire_bolt.in_flight|action.frostbolt.in_flight)
actions+=/frostbolt,if=buff.fingers_of_frost.up&talent.deep_freeze&cooldown.deep_freeze.remains<cast_time*buff.fingers_of_frost.stack
actions+=/frostfire_bolt,if=buff.brain_freeze.react
actions+=/blizzard,if=active_enemies>2&!moving
actions+=/cone_of_cold,if=active_enemies>2&target.within10&moving
actions+=/arcane_explosion,if=active_enemies>2&target.within10&moving
actions+=/fire_blast,if=moving&target.within20
actions+=/best_mana_potion,use_off_gcd=1
actions+=/use_mana_gem,use_off_gcd=1,if=mana.pct<70
actions+=/evocation,if=mana.pct<30
actions+=/frostbolt
Loading

0 comments on commit 1beb5eb

Please sign in to comment.