Skip to content

Commit

Permalink
Merge pull request #45 from Slivo-fr/release/v1.6.0
Browse files Browse the repository at this point in the history
Release/v1.6.0
  • Loading branch information
Slivo-fr authored May 9, 2021
2 parents 096623b + bff0f27 commit 02a4795
Show file tree
Hide file tree
Showing 21 changed files with 238 additions and 99 deletions.
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

0 comments on commit 02a4795

Please sign in to comment.