Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/v1.6.0 #45

Merged
merged 24 commits into from
May 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b39d73f
Remove local declaration for TranqRotate
Slivo-fr May 6, 2021
8df4ce9
Adds gluth fear to incapacitating debuff list
Slivo-fr May 6, 2021
5169c2e
Handle lua error for yell and say in open world
Slivo-fr May 6, 2021
20325b7
small tweak on version retrieval
Slivo-fr May 6, 2021
52c157f
Fix timed alert feature
Slivo-fr May 6, 2021
ec301fc
Remove frenzy on SPELL_AURA_REMOVED
Slivo-fr May 6, 2021
b4e8b38
Allow test rotation to rotate from fresh
Slivo-fr May 6, 2021
1f5a707
Avoid self whispering when calling backup in some edge cases
Slivo-fr May 6, 2021
de1b73d
Small reword in readme
Slivo-fr May 6, 2021
7aee0ce
Improve and rework fails handling
Slivo-fr May 6, 2021
097f094
Implements version check
Slivo-fr May 6, 2021
4cf4dc5
1.6.0 changelog
Slivo-fr May 6, 2021
c5cecbf
Update version to 1.6.0
Slivo-fr May 6, 2021
6336232
rewording
Slivo-fr May 7, 2021
cebc8ab
Disable timed backup alert by default, adds migrations, tweak few def…
Slivo-fr May 8, 2021
8c117f7
Do not hide/show window on setting changes
Slivo-fr May 8, 2021
472da57
Update changelog
Slivo-fr May 8, 2021
029959c
Removes debug printing of events names
Slivo-fr May 8, 2021
956fbc1
Fix migration process
Slivo-fr May 8, 2021
7b2436b
Hide the news section in settings
Slivo-fr May 9, 2021
8b9b024
Improve testRotation function
Slivo-fr May 9, 2021
b2979f0
homogenize backup calls, no comms when tranq fail
Slivo-fr May 9, 2021
9de6f06
Adds fail event in comms and fail print to chat
Slivo-fr May 9, 2021
bff0f27
Update readme & changelog
Slivo-fr May 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Please report any issue using github issues : https://github.com/Slivo-fr/TranqR
- Display the list of raid hunters
- Display offline and dead status on hunters frames
- Allow player to re-order players between two groups : main rotation and backup
- Synchronize rotation order between player using the addon
- Synchronize rotation order between addon users
- Allow player to broadcast the configured rotation and backup group to the raid
- Provide a real time visual feedback about the rotation status, even if no one else use the addon in your raid
- Synchronize tranqshot casts to other player using the addon
Expand All @@ -32,6 +32,7 @@ Please report any issue using github issues : https://github.com/Slivo-fr/TranqR
- Display the frenzy cooldown of each boss
- Optional automatic backup call when incapacitated
- Optional automatic timed backup call
- Prints to chat name and reason of a tranq fail (miss or resist)

## Usage

Expand All @@ -53,13 +54,17 @@ The reset button is also able to resync raid hunters and rotation setup if you n
You may adds the `/tranq backup` command to a macro that you can use when you are unable to tranq and you need some help,
It will whisper all backup hunters the fail message.

The `/tranq check` command allows you to list version or TranqRotate used by others hunters and others non-hunters players

## Roadmap

Here is a list of feature I want to implement at some point, no specific order is decided yet.

- Automatic handling of death and disconnection of hunters on the rotation group (swap with a backup, send an alert about it)
- Use raid symbols to mark hunters that need to tranq, or that need to backup a failed tranqshot
- Automatic reset of rotation when raid wipe
- Adds raid markers to tranq announces if target has one
- Show an indicator on hunters that does not use TranqRotate (So you know you have to inform them about the rotation)

## Download

Expand Down
5 changes: 3 additions & 2 deletions TranqRotate.toc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Interface: 11307
## Title: TranqRotate |cff00aa001.5.1|r
## Title: TranqRotate |cff00aa001.6.0|r
## Notes: A tranqshot rotation assistant
## Author: Slivo
## Version: 1.5.1
## Version: 1.6.0
## SavedVariables: TranqRotateDb
## OptionalDeps: Ace3

Expand Down Expand Up @@ -35,3 +35,4 @@ src\defaults.lua
src\settings.lua
src\utils.lua
src\debuff.lua
src\migration.lua
10 changes: 10 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
## TranqRotate Changelog

#### v1.6.0

- Improves miss and resist tranqshot handling (no more duplicate announces or whispers)
- Adds gluth fear to handled list of incapacitating debuffs
- Adds `/tranq check` command to display the version other users have installed
- Adds printing of fail to chat window
- Fix timed alert feature that never worked (forgot to call it :D), changed default value to disabled
- Fix an ui error when trying to send announces on say/yell channel in open world (test mode)
- Fix windows hiding unexpectedly when changing settings

#### v1.5.1

- Handles the new dispel resistance mechanic
Expand Down
3 changes: 2 additions & 1 deletion locales/enUS.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local TranqRotate = select(2, ...)
TranqRotate = select(2, ...)

local L = {

Expand Down Expand Up @@ -45,6 +45,7 @@ local L = {
["SETTING_ANNOUNCES"] = "Announces",
["ENABLE_ANNOUNCES"] = "Enable announces",
["ENABLE_ANNOUNCES_DESC"] = "Enable / disable the announcement.",
["YELL_SAY_DISABLED_OPEN_WORLD"] = "(Yell and say channels does not work in open world, but will inside your raids)",

---- Channels
["ANNOUNCES_CHANNEL_HEADER"] = "Announce channel",
Expand Down
3 changes: 2 additions & 1 deletion locales/frFR.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if (GetLocale() ~= "frFR") then return end

local TranqRotate = select(2, ...)
TranqRotate = select(2, ...)

local L = {

Expand Down Expand Up @@ -47,6 +47,7 @@ local L = {
["SETTING_ANNOUNCES"] = "Annonces",
["ENABLE_ANNOUNCES"] = "Activer les annonces",
["ENABLE_ANNOUNCES_DESC"] = "Activer / désactiver les annonces",
["YELL_SAY_DISABLED_OPEN_WORLD"] = "(Les canaux dire et crier ne fonctionnent pas hors instance)",

---- Channels
["ANNOUNCES_CHANNEL_HEADER"] = "Canal",
Expand Down
3 changes: 2 additions & 1 deletion locales/ruRU.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if (GetLocale() ~= "ruRU") then return end

local TranqRotate = select(2, ...)
TranqRotate = select(2, ...)

local L = {

Expand Down Expand Up @@ -47,6 +47,7 @@ local L = {
["SETTING_ANNOUNCES"] = "Оповещения",
["ENABLE_ANNOUNCES"] = "Включить оповещения",
["ENABLE_ANNOUNCES_DESC"] = "Включить / отключить оповещения",
["YELL_SAY_DISABLED_OPEN_WORLD"] = "(Yell and say channels does not work in open world, but will inside your raids)",

---- Channels
["ANNOUNCES_CHANNEL_HEADER"] = "Канал оповещений",
Expand Down
3 changes: 2 additions & 1 deletion locales/zhCN.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if (GetLocale() ~= "zhCN") then return end

local TranqRotate = select(2, ...)
TranqRotate = select(2, ...)

local L = {

Expand Down Expand Up @@ -47,6 +47,7 @@ local L = {
["SETTING_ANNOUNCES"] = "通告",
["ENABLE_ANNOUNCES"] = "启用通告",
["ENABLE_ANNOUNCES_DESC"] = "启用 / 禁用通告",
["YELL_SAY_DISABLED_OPEN_WORLD"] = "(Yell and say channels does not work in open world, but will inside your raids)",

---- Channels
["ANNOUNCES_CHANNEL_HEADER"] = "通告频道",
Expand Down
3 changes: 2 additions & 1 deletion locales/zhTW.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if (GetLocale() ~= "zhTW") then return end

local TranqRotate = select(2, ...)
TranqRotate = select(2, ...)

local L = {

Expand Down Expand Up @@ -47,6 +47,7 @@ local L = {
["SETTING_ANNOUNCES"] = "通告",
["ENABLE_ANNOUNCES"] = "啟用通告",
["ENABLE_ANNOUNCES_DESC"] = "啟用 / 禁用通告",
["YELL_SAY_DISABLED_OPEN_WORLD"] = "(Yell and say channels does not work in open world, but will inside your raids)",

---- Channels
["ANNOUNCES_CHANNEL_HEADER"] = "通告頻道",
Expand Down
24 changes: 15 additions & 9 deletions src/comms.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
local TranqRotate = select(2, ...)

local AceComm = LibStub("AceComm-3.0")
local AceSerializer = LibStub("AceSerializer-3.0")

Expand Down Expand Up @@ -67,12 +65,13 @@ end
-----------------------------------------------------------------------------------------------------------------------

-- Broadcast a tranqshot event
function TranqRotate:sendSyncTranq(hunter, fail, timestamp)
function TranqRotate:sendSyncTranq(hunter, fail, timestamp, failEvent)
local message = {
['type'] = TranqRotate.constants.commsTypes.tranqshotDone,
['timestamp'] = timestamp,
['player'] = hunter.name,
['fail'] = fail,
['failEvent'] = failEvent,
}

TranqRotate:sendRaidAddonMessage(message)
Expand All @@ -87,7 +86,8 @@ function TranqRotate:sendSyncOrder(whisper, name)
local message = {
['type'] = TranqRotate.constants.commsTypes.syncOrder,
['version'] = TranqRotate.syncVersion,
['rotation'] = TranqRotate:getSimpleRotationTables()
['rotation'] = TranqRotate:getSimpleRotationTables(),
['addonVersion'] = TranqRotate.version,
}

if (whisper) then
Expand All @@ -102,6 +102,7 @@ function TranqRotate:sendSyncOrderRequest()

local message = {
['type'] = TranqRotate.constants.commsTypes.syncRequest,
['addonVersion'] = TranqRotate.version,
}

TranqRotate:sendRaidAddonMessage(message)
Expand Down Expand Up @@ -132,17 +133,21 @@ function TranqRotate:receiveSyncTranq(prefix, message, channel, sender)
return
end

local notDuplicate = hunter.lastTranqTime < GetTime() - TranqRotate.constants.duplicateTranqshotDelayThreshold

if (notDuplicate) then
TranqRotate:rotate(hunter, message.fail)
if (not message.fail) then
local notDuplicate = hunter.lastTranqTime < GetTime() - TranqRotate.constants.duplicateTranqshotDelayThreshold
if (notDuplicate) then
TranqRotate:rotate(hunter)
end
else
TranqRotate:handleFailTranq(hunter, message.failEvent)
end
end

-- Rotation configuration received
function TranqRotate:receiveSyncOrder(prefix, message, channel, sender)

TranqRotate:updateRaidStatus()
TranqRotate:updatePlayerAddonVersion(sender, message.addonVersion)

if (TranqRotate:isVersionEligible(message.version, sender)) then
TranqRotate.syncVersion = (message.version)
Expand All @@ -154,7 +159,8 @@ function TranqRotate:receiveSyncOrder(prefix, message, channel, sender)
end

-- Request to send current roration configuration received
function TranqRotate:receiveSyncRequest(prefix, data, channel, sender)
function TranqRotate:receiveSyncRequest(prefix, message, channel, sender)
TranqRotate:updatePlayerAddonVersion(sender, message.addonVersion)
TranqRotate:sendSyncOrder(true, sender)
end

Expand Down
4 changes: 2 additions & 2 deletions src/constants.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
local TranqRotate = select(2, ...)

TranqRotate.colors = {
['green'] = CreateColor(0.67, 0.83, 0.45),
['darkGreen'] = CreateColor(0.1, 0.4, 0.1),
Expand Down Expand Up @@ -29,6 +27,7 @@ TranqRotate.constants = {

['printPrefix'] = 'TranqRotate - ',
['duplicateTranqshotDelayThreshold'] = 10,
['duplicateFailedTranqshotDelayThreshold'] = 10,

['minimumCooldownElapsedForEligibility'] = 10,

Expand Down Expand Up @@ -78,5 +77,6 @@ TranqRotate.constants = {
19408, -- Magmadar fear
23171, -- Chromaggus Bronze affliction stun
23311, -- Chromaggus Time lapse
29685, -- Gluth fear
},
}
2 changes: 0 additions & 2 deletions src/debuff.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
local TranqRotate = select(2, ...)

-- Checks if player is incapacitated by a debuff for too long
function TranqRotate:isPlayedIncapacitatedByDebuff()

Expand Down
6 changes: 3 additions & 3 deletions src/defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ function TranqRotate:LoadDefaults()
showWindowWhenTargetingBoss = false,
showFrenzyCooldownProgress = true,
enableIncapacitatedBackupAlert = true,
incapacitatedDelay = 1.5,
enableTimedBackupAlertValue = true,
timedBackupAlertValueDelay = 1.5,
incapacitatedDelay = 2,
enableTimedBackupAlert = false,
timedBackupAlertDelay = 3,
},
}
end
2 changes: 0 additions & 2 deletions src/dragdrop.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
local TranqRotate = select(2, ...)

-- Enable drag & drop for all hunter frames
function TranqRotate:toggleListSorting(allowSorting)
for key,hunter in pairs(TranqRotate.hunterTable) do
Expand Down
22 changes: 11 additions & 11 deletions src/events.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
local TranqRotate = select(2, ...)

local tranqShot = GetSpellInfo(19801)
local arcaneShot = GetSpellInfo(14287)

Expand Down Expand Up @@ -31,32 +29,32 @@ function TranqRotate:COMBAT_LOG_EVENT_UNFILTERED()

-- @todo : Improve this with register / unregister event to save resources
-- Avoid parsing combat log when not able to use it
if not TranqRotate.raidInitialized then return end
if (not TranqRotate.raidInitialized) then return end
-- Avoid parsing combat log when outside instance if test mode isn't enabled
if not TranqRotate.testMode and not IsInInstance() then return end
if (not TranqRotate.testMode and not IsInInstance()) then return end

local timestamp, event, _, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags = CombatLogGetCurrentEventInfo()
local spellId, spellName, spellSchool, amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing, isOffHand = select(12, CombatLogGetCurrentEventInfo())

-- @todo try to refactor a bit
if (spellName == tranqShot or (TranqRotate.testMode and spellName == arcaneShot)) then
local hunter = TranqRotate:getHunter(nil, sourceGUID)
if (event == "SPELL_CAST_SUCCESS") then
TranqRotate:sendSyncTranq(hunter, false, timestamp)
TranqRotate:rotate(hunter, false)
TranqRotate:rotate(hunter)
if (sourceGUID == UnitGUID("player")) then
TranqRotate:sendAnnounceMessage(TranqRotate.db.profile.announceSuccessMessage, destName)
end
elseif (event == "SPELL_MISSED" or event == "SPELL_DISPEL_FAILED") then
TranqRotate:sendSyncTranq(hunter, true, timestamp)
TranqRotate:rotate(hunter, true)
TranqRotate:sendSyncTranq(hunter, true, timestamp, event)
TranqRotate:handleFailTranq(hunter, event)
if (sourceGUID == UnitGUID("player")) then
TranqRotate:sendAnnounceMessage(TranqRotate.db.profile.announceFailMessage, destName)
end
end
elseif (event == "SPELL_AURA_APPLIED" and TranqRotate:isBossFrenzy(spellName, sourceGUID)) then
TranqRotate.frenzy = true
if (TranqRotate:isPlayerNextTranq()) then
TranqRotate:handleTimedAlert()
TranqRotate:throwTranqAlert()

if (TranqRotate.db.profile.enableIncapacitatedBackupAlert and TranqRotate:isPlayedIncapacitatedByDebuff()) then
Expand All @@ -67,7 +65,9 @@ function TranqRotate:COMBAT_LOG_EVENT_UNFILTERED()
local type, id = TranqRotate:getIdFromGuid(sourceGUID)
TranqRotate:startBossFrenzyCooldown(TranqRotate.constants.bosses[id].cooldown)
end
elseif event == "UNIT_DIED" and TranqRotate:isTranqableBoss(destGUID) then
elseif (event == "SPELL_AURA_REMOVED" and TranqRotate:isBossFrenzy(spellName, sourceGUID)) then
TranqRotate.frenzy = false
elseif (event == "UNIT_DIED" and TranqRotate:isTranqableBoss(destGUID)) then
TranqRotate:resetRotation()
TranqRotate.mainFrame.frenzyFrame:Hide()
end
Expand Down Expand Up @@ -120,8 +120,8 @@ end

-- Handle timed alert for non tranqed frenzy
function TranqRotate:handleTimedAlert()
if (TranqRotate.db.profile.enableTimedBackupAlertValue) then
C_Timer.After(TranqRotate.db.profile.timedBackupAlertValueDelay, function()
if (TranqRotate.db.profile.enableTimedBackupAlert) then
C_Timer.After(TranqRotate.db.profile.timedBackupAlertDelay, function()
if (TranqRotate.frenzy and TranqRotate:isPlayerNextTranq()) then
TranqRotate:alertBackup(TranqRotate.db.profile.unableToTranqMessage)
end
Expand Down
2 changes: 0 additions & 2 deletions src/frames.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
local TranqRotate = select(2, ...)

-- Create main window
function TranqRotate:createMainFrame()
TranqRotate.mainFrame = CreateFrame("Frame", 'mainFrame', UIParent)
Expand Down
2 changes: 0 additions & 2 deletions src/gui.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
local TranqRotate = select(2, ...)

local L = TranqRotate.L

-- Initialize GUI frames. Shouldn't be called more than once
Expand Down
22 changes: 22 additions & 0 deletions src/migration.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
function TranqRotate:migrateProfile()

if (TranqRotate.db.profile.currentMigration == nil) then
TranqRotate.db.profile.currentMigration = 0
end

if (TranqRotate.db.profile.currentMigration < #TranqRotate.migrations) then
for i = TranqRotate.db.profile.currentMigration + 1, #TranqRotate.migrations, 1 do
TranqRotate.migrations[i]()
TranqRotate.db.profile.currentMigration = i
end
end
end

TranqRotate.migrations = {
-- 1.6.0
function()
-- Those are old, badly named key
TranqRotate.db.profile.enableTimedBackupAlertValue = nil
TranqRotate.db.profile.timedBackupAlertValueDelay = nil
end,
}
Loading