Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Options and settings
- -----------------
- -- Bar Options --
- -----------------
- soulShard_castPrediction = { --Shows the shards that are going to be consumed at the end of the cast
- [1] = true, -- Affliction
- [2] = true, -- Demonology
- [3] = true, -- Destruction
- }
- soulShard_tickThreshold = 0.70 -- the amount of time doom needs to tick for to show a timer (default 70%)
- soulShard_emptyShards = true -- Toggles the display of empty soul shards
- -- Note: This option doesn't play well with soulShard_centerCounter
- ------------------
- -- Text Options --
- ------------------
- soulShard_textDisplay = { -- Specialization specific text options
- [1] = true, -- Affliction
- [2] = false, -- Demonology
- [3] = true, -- Destruction
- }
- soulShard_textPrediction = { -- Toggles shard text prediction
- [1] = true, -- Affliction
- [2] = true, -- Demonology
- [3] = true, -- Destruction
- }
- soulShard_fragCounter = true -- Shows the amount of fragments you have
- soulShard_fragDisplay = "decimal" -- Changes the displayed value of destro shards (options are "whole", "shortened" & "decimal")
- -- decimal: shows the amount of fragments you have in demical form (e.g. 3.6)
- -- whole: shows the raw value of Enum.PowerType.SoulShards (e.g. 36)
- -- shortened: shows the amount of fragments you have without shards (e.g. 6)
- soulShard_textPosition = "CENTER" -- Changes the position of the text field (options are "CENTER", "LEFT", "RIGHT" & "FREE")
- -- Note: FREE allows the positioning of the shard counter anywhere on your user interface
- soulShard_textPositionX = 0 soulShard_textPositionY = -20 -- Only used for "FREE"
- soulShard_centerCounter = 0 -- Changes the position of the fragment counter
- -- (0 = most recent shard, 1 = shard1, 2 = shard2, etc...)
- -- Text shadow options, because I like text shadow
- soulShard_textShadowX = 1 soulShard_textShadowY = -1
- --------------------
- -- Colour Options --
- --------------------
- soulShard_maxShardColour = true -- Changes all shards to a specific colour when you're capped
- soulShard_specColours = { -- Activates specialization specific colouring, if this option is off the colour defaults to the regular bar colour options
- -- changing these options requires a /reload
- [1] = false, -- Affliction
- [2] = false, -- Demonology
- [3] = false, -- Destruction
- }
- -- Colours should be selected using a value between 0 and 1, using rbg you can pick the colours you want (e.g. rbgvalue/255)
- soulShard_colourPicker = { -- Changes the specialization specific shards
- -- Shard Cap
- ["capr"] = 0.7, -- red value
- ["capg"] = 0, -- green value
- ["capb"] = 0.35, -- blue value
- ["capa"] = 1, -- alpha value
- -- Affliction
- ["affr"] = 1, -- red value
- ["affg"] = 0, -- green value
- ["affb"] = 0, -- blue value
- ["affa"] = 1, -- alpha value
- ["affbr"] = 0.3, -- red background value
- ["affbg"] = 0, -- green background value
- ["affbb"] = 0, -- blue background value
- ["affba"] = 1, -- alpha background value
- -- Demonology
- ["demor"] = 0.5, -- red value
- ["demog"] = 0, -- green value
- ["demob"] = 1, -- blue value
- ["demoa"] = 1, -- alpha value
- ["demobr"] = 0.12, -- red background value
- ["demobg"] = 0, -- green background value
- ["demobb"] = 0.23, -- blue background value
- ["demoba"] = 1, -- alpha background value
- -- Destruction
- ["destr"] = 0, -- red value
- ["destg"] = 1, -- green value
- ["destb"] = 0, -- blue value
- ["desta"] = 1, -- alpha value
- ["destbr"] = 0, -- red background value
- ["destbg"] = 0.3, -- green background value
- ["destbb"] = 0, -- blue background value
- ["destba"] = 1, -- alpha background value
- }
- soulShard_predictionColour = { -- Changes the colour of cast prediction shards
- ["r"] = 0.88, -- red value
- ["g"] = 0, -- green value
- ["b"] = 0.88, -- blue value
- ["a"] = 1, -- alpha value
- }
- --------------------
- -- How Doom works --
- --------------------
- -- Doom is a dot, it ticks for damage at the end of it's duration.
- -- Doom can partially tick if it's doesn't tick for it's full tickrate.
- -- If doom is going to fall off before reaching it's full tick duration, the tick will happen at the end of Doom's duration unless doom is refreshed. Then the current tick will take how ever much more time it needs from the refresh to fully tick
- -- Doom's pandemic window is based on your current haste (it's current tickrate)
- -- Shard generation is based on how long doom was up for before it ticked vs it's tickrate.
- -- Doom snapshots haste on cast, but the hasted interval is only calculated, from the next tick.
- -------------
- -- Examples--
- -------------
- -- Short -> Long | (High Haste -> Low Haste) --
- -- Let's assume that you cast doom, with haste such that it's tickrate is 10 seconds.
- -- Your haste when you casted the Doom, has now snapshotted it's tickrate (10 seconds).
- -- If your haste effects now fall off, such that Doom's tickrate is now 20 seconds (Doom's pandemic is now 6 seconds).
- -- Assume that you now refresh doom at 4 seconds remaining, bringing it's duration up to 24 seconds.
- -- Doom will then tick 4 seconds after the refresh at 20 seconds, for a full tick.
- -- The next doom tick then starts, snapshotting the last refresh's haste as it's tickrate.
- -- Long -> Short | (Low Haste -> High Haste) --
- -- Let's say that you opened with Hand of Gul'dan (before your haste procs and Bloodlust). Applying a Doom with a tickrate of 20 seconds (snapshotting your haste).
- -- Now you gain some haste, through the effects of Bloodlust and whispers. Doom's tickrate is brought down to 10 seconds.
- -- While under the haste effects, you refresh doom at 5 seconds. Bringing the duration down to 13 seconds (10 + 10*0.3), because it's current pandemic is 3 seconds
- -- You've now brought the duration of a Doom, with the tickrate of 20 seconds, down to 13 seconds.
- -- You will get a tick at the end of dooms duration, that will deal 65% damage (13/20) and have a 65% change to generate a shard.
- -------------------------
- -- Extended ticklength --
- -------------------------
- -- Let's imagine a situation in which you refresh a short doom, with a long duration above it's pandemic threshold.
- -- For simplicity we'll keep the ticks at 10 and 20 respectively.
- -- You cast Doom to start the fight. Then refresh it with Hand of Gul'dan when it has 9 seconds remaining (1 seconds after you applied it).
- -- This brings the duration up to 26 seconds (20 + 0.3*20).
- -- Doom will tick at 17 seconds remaining (9 seconds after the refresh), snapshotting the next hasted interval with the last refreshed tickrate (20 seconds)
- -- Following the logic provided, Doom should partially tick at the end of it's duration for 85% damage, and an 85% chance to generate a shard.
- -- Now's assume that you refresh Doom before it expires at 3 seconds remaining, pushing doom's duration to 23 seconds (20 + 3).
- -- Doom now has enough time to make a full tick, so the nexttick will get pushed back from the time at which it would have expired to 6 seconds after the refresh (17 seconds remaning)
- ----------
- -- Todo --
- ----------
- -- make a long term solution for cost reduction on spells from items and tier
- ---------------------
- -- Shard Cost Info --
- ---------------------
- soulShard_CostInfo = { -- [spell] = {cost, dynamic cost, max cost, reduced cost item, amount reduced}
- -- Affliction
- [GetSpellInfo(30108)] = {1}, -- Unstable Affliction
- [GetSpellInfo(27243)] = {1}, -- Seed of Corruption
- -- Destruction
- [GetSpellInfo(116858)] = {2}, -- Chaos Bolt
- [GetSpellInfo(5740)] = {3}, -- Rain of Fire
- -- Demonology
- [GetSpellInfo(105174)] = {1, true, 4}, -- Hand of Gul'dan
- [GetSpellInfo(104316)] = {2, false, nil, aura_env.recurrentRitual, 1}, -- Call Dreadstalkers
- -- General
- [GetSpellInfo(18540)] = {1}, -- Summon Doomguard
- [GetSpellInfo(688)] = {1}, -- Summon Imp
- [GetSpellInfo(1122)] = {1}, -- Summon Infernal
- [GetSpellInfo(691)] = {1}, -- Summon Felhunter
- [GetSpellInfo(712)] = {1}, -- Summon Succubus
- [GetSpellInfo(697)] = {1}, -- Summon Voidwalker
- [GetSpellInfo(30146)] = {1} -- Summon Felguard
- }
- -- Calculate how many shards are going to be spent
- soulShard_getPowerFromCast = function()
- local cast = UnitCastingInfo("player") or UnitChannelInfo("player") or nil
- if not cast then
- return 0
- end
- local data = soulShard_CostInfo[cast] or nil
- if not data then
- return 0
- end
- local power = data[1] or 0
- if data[2] then
- power = UnitPower("player", Enum.PowerType.SoulShards, false)
- if power >= data[3] then
- power = data[3]
- end
- end
- if data[4] then
- power = power - data[5]
- end
- return power
- end
- -- The remaining amount after cast
- soulShard_shardAmount = function()
- if aura_env.specID == 3 then
- if soulShard_fragDisplay == "shortened" then
- shardValue = aura_env.fragCount - aura_env.ssCount*10
- if shardValue == 0 and aura_env.fragCount > 0 then
- shardValue = 10
- end
- elseif soulShard_fragDisplay == "decimal" then
- shardValue = format("%.1f", aura_env.fragCount/10)
- elseif soulShard_fragDisplay == "whole" then
- shardValue = aura_env.fragCount
- end
- elseif aura_env.specID == 1 or aura_env.specID == 2 then
- shardValue = aura_env.ssCount
- end
- if soulShard_textPrediction[aura_env.specID] then
- if aura_env.specID == 3 then
- if soulShard_fragDisplay == "decimal" then
- shardValue = format("%.1f", shardValue - soulShard_getPowerFromCast())
- elseif soulShard_fragDisplay == "shortened" then
- shardValue = shardValue
- elseif soulShard_fragDisplay == "whole" then
- shardValue = shardValue - soulShard_getPowerFromCast()*10
- elseif aura_env.specID == 1 or aura_env.specID == 2 then
- shardValue = shardValue - soulShard_getPowerFromCast()*10
- end
- else
- shardValue = shardValue - soulShard_getPowerFromCast()
- end
- end
- return shardValue
- end
- if not soulShard_text then
- local region = WeakAuras.regions[aura_env.id].region
- soulShard_text = region:CreateFontString(nil, "OVERLAY", "GameFontHighlight")
- end
- soulShard_timerInfo = {} -- this is the table that holds everything
- soulShard_sortedTable = {} -- sorted table
- if WeakAuras.IsOptionsOpen() then
- wipe(soulShard_sortedTable)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement