Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
#104 MDB should track time not in combat for every party member
Browse files Browse the repository at this point in the history
#95 Add units to track taken damage for De Other Side
#98 Add units to track taken damage for Theater of Pain
#99 Add units to track taken damage for Mists of Tirna Scithe
#97 Add units to track taken damage for Spires of Ascension
#96 Add units to track taken damage for Halls of Atonement
#94 Add units to track taken damage for Plaguefall
#93 Add units to track taken damage for Necrotic Wake
#100 Add units to track taken damage for Sanguine Depths
#103 Allow MDB to communicate with other party member
  • Loading branch information
onechiporenko committed Dec 25, 2020
1 parent ef144b3 commit c71204b
Show file tree
Hide file tree
Showing 11 changed files with 410 additions and 86 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
* Add more avoidable spells and auras (related to [#34](https://github.com/onechiporenko/my-dungeons-book/issues/34), [#29](https://github.com/onechiporenko/my-dungeons-book/issues/29), [#32](https://github.com/onechiporenko/my-dungeons-book/issues/32), [#33](https://github.com/onechiporenko/my-dungeons-book/issues/33), [#30](https://github.com/onechiporenko/my-dungeons-book/issues/30), [#31](https://github.com/onechiporenko/my-dungeons-book/issues/31), [#28](https://github.com/onechiporenko/my-dungeons-book/issues/28), [#27](https://github.com/onechiporenko/my-dungeons-book/issues/27))
* [#102](https://github.com/onechiporenko/my-dungeons-book/issues/102) Group damage done to all units and highlight important units
* [#101](https://github.com/onechiporenko/my-dungeons-book/issues/101) Show avoidable damage as part of all taken damage tab
* [#93](https://github.com/onechiporenko/my-dungeons-book/issues/93) Add units to track taken damage for Necrotic Wake
* [#94](https://github.com/onechiporenko/my-dungeons-book/issues/94) Add units to track taken damage for Plaguefall
* [#95](https://github.com/onechiporenko/my-dungeons-book/issues/95) Add units to track taken damage for De Other Side
* [#96](https://github.com/onechiporenko/my-dungeons-book/issues/96) Add units to track taken damage for Halls of Atonement
* [#97](https://github.com/onechiporenko/my-dungeons-book/issues/97) Add units to track taken damage for Spires of Ascension
* [#98](https://github.com/onechiporenko/my-dungeons-book/issues/98) Add units to track taken damage for Theater of Pain
* [#99](https://github.com/onechiporenko/my-dungeons-book/issues/99) Add units to track taken damage for Mists of Tirna Scithe
* [#100](https://github.com/onechiporenko/my-dungeons-book/issues/100) Add units to track taken damage for Sanguine Depths
* [#103](https://github.com/onechiporenko/my-dungeons-book/issues/103) Allow MDB to communicate with other party member

### v2.1.0

Expand Down
24 changes: 22 additions & 2 deletions Challenge.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function MyDungeonsBook:ParseUnitInfoWithWowApi(unit)
local itemLink = GetInventoryItemLink(unit, i);
items[i] = itemLink;
end
return {
local unitInfo = {
name = name,
role = role,
race = race,
Expand All @@ -79,8 +79,28 @@ function MyDungeonsBook:ParseUnitInfoWithWowApi(unit)
realm = realm,
items = items,
talents = {},
misc = {}
misc = {},
covenant = {}
};
if (unit == "player") then
local covenantId = C_Covenants.GetActiveCovenantID();
local activeSoulbindId = C_Soulbinds.GetActiveSoulbindID();
local activeSoulbindData = C_Soulbinds.GetSoulbindData(activeSoulbindId);
local conduits = {};
for _, conduit in pairs(activeSoulbindData.tree.nodes) do
if (conduit.failureRenownRequirement == nil and conduit.state == 3) then
tinsert(conduits, conduit);
end
end
unitInfo.covenant.id = covenantId;
unitInfo.covenant.soulbind = {
id = activeSoulbindId,
name = activeSoulbindData.name,
textureKit = activeSoulbindData.textureKit,
conduits = conduits
};
end
return unitInfo;
end

--[[--
Expand Down
8 changes: 4 additions & 4 deletions Events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ function MyDungeonsBook:CHALLENGE_MODE_START()
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
self:RegisterEvent("PLAYER_REGEN_DISABLED");
self:RegisterEvent("PLAYER_REGEN_ENABLED");
self:Message_IdleTime_StartTrack();
self:DebugPrint("CHALLENGE_MODE_START");
self:DebugPrint("CHALLENGE_MODE_START");
if (self.db.char.activeChallengeId) then
self:DebugPrint(string.format("Challenge already exists with id %s", self.db.char.activeChallengeId));
return;
Expand Down Expand Up @@ -222,6 +221,7 @@ function MyDungeonsBook:CHALLENGE_MODE_START()
if (self.challengesTable) then
self.challengesTable:SetData(self:ChallengesFrame_GetDataForTable());
end
self:Messages_StartTrack();
self:LogPrint(string.format(L["%s +%s is started"], zoneName, cmLevel));
end

Expand All @@ -232,7 +232,7 @@ function MyDungeonsBook:CHALLENGE_MODE_RESET()
self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
self:UnregisterEvent("PLAYER_REGEN_DISABLED");
self:UnregisterEvent("PLAYER_REGEN_ENABLED");
self:Message_IdleTime_StopTrack();
self:Messages_StopTrack();
local id = self.db.char.activeChallengeId;
if (self.db.char.challenges[id]) then
self.db.char.challenges[id].endTime = time();
Expand Down Expand Up @@ -286,7 +286,7 @@ function MyDungeonsBook:CHALLENGE_MODE_COMPLETED()
self:UnregisterEvent("PLAYER_REGEN_ENABLED");
self:Message_IdleTime_Send();
self:ScheduleTimer(function()
self:Message_IdleTime_StopTrack();
--self:Messages_StopTrack();
end, 5);
end

Expand Down
197 changes: 179 additions & 18 deletions Mechanics/SL/Common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -475,29 +475,190 @@ local SLSpecificItemsUsedByPartyMembers = {
};

local SLDamageDoneToSpecificUnits = {
[120651] = {}, -- Explosive Orbs
[120651] = {
type = "AFFIX"
}, -- Explosive Orbs
[174773] = {
type = "AFFIX"
}, -- Spiteful Shade

-- Plaguefall
[164362] = {}, -- Slimy Morsel (Globgrog adds)
[171887] = {}, -- Slimy Smorgasbord (Globgrog adds)
[163915] = {}, -- Hatchling Nest
[169159] = {}, -- Unstable Canister
[169498] = {}, -- Plague Bomb (Doctor Ickus adds)
[168837] = {}, -- Stealthling
[170474] = {}, -- Brood Assassin (Domina Venomblade adds)
[165430] = {}, -- Malignant Spawn (Margrave Stradama adds)
[164362] = {
type = "ADD"
}, -- Slimy Morsel (Globgrog adds)
[171887] = {
type = "ADD"
}, -- Slimy Smorgasbord (Globgrog adds)
[163915] = {
type = "MOB"
}, -- Hatchling Nest
[169159] = {
type = "MOB"
}, -- Unstable Canister
[169498] = {
type = "ADD"
}, -- Plague Bomb (Doctor Ickus adds)
[168837] = {
type = "MOB"
}, -- Stealthling
[170474] = {
type = "ADD"
}, -- Brood Assassin (Domina Venomblade adds)
[165430] = {
type = "ADD"
}, -- Malignant Spawn (Margrave Stradama adds)
[164255] = {
type = "BOSS"
}, -- Globgrog
[164967] = {
type = "BOSS"
}, -- Doctor Ickus
[164266] = {
type = "BOSS"
}, -- Domina Venomblade,
[164267] = {
type = "BOSS"
}, -- Margrave Stradama

-- The Necrotic Wake
[163121] = {}, -- Stitched Vanguard
[164702] = {}, -- Carrion Worm (Blightbone adds)
[164414] = {}, -- Reanimated Mage (Amarth adds)
[164427] = {}, -- Reanimated Warrior (Amarth adds)
[168246] = {}, -- Reanimated Crossbowman (Amarth adds)
[163121] = {
type = "MOB"
}, -- Stitched Vanguard
[164702] = {
type = "ADD"
}, -- Carrion Worm (Blightbone adds)
[164414] = {
type = "ADD"
}, -- Reanimated Mage (Amarth adds)
[164427] = {
type = "ADD"
}, -- Reanimated Warrior (Amarth adds)
[168246] = {
type = "ADD"
}, -- Reanimated Crossbowman (Amarth adds)
[162691] = {
type = "BOSS"
}, -- Blightbone
[163157] = {
type = "BOSS"
}, -- Amarth
[162689] = {
type = "BOSS"
}, -- Surgeon Stitchflesh
[162693] = {
type = "BOSS"
}, -- Nalthor the Rimebinder

-- Spires of Ascension
[163077] = {}, -- Azules
[163077] = {
type = "BOSS"
}, -- Azules
[162059] = {
type = "BOSS"
}, -- Kin-Tara
[162058] = {
type = "BOSS"
}, -- Ventunax
[162060] = {
type = "BOSS"
}, -- Oryphrion
[167410] = {
type = "BOSS"
}, -- Devos

-- Sanguine Depths
[168882] = {}, -- Fleeting Manifestation
[168882] = {
type = "MOB"
}, -- Fleeting Manifestation
[162100] = {
type = "BOSS"
}, -- Kryxis the Voracious
[162103] = {
type = "BOSS"
}, -- Executor Tarvold
[162102] = {
type = "BOSS"
}, -- Grand Proctor Beryllia
[165318] = {
type = "BOSS"
}, -- General Kaal

-- Mists of Tirna Scithe
[165251] = {}, -- Illusionary Vulpin
[165560] = {}, -- Gormling Larva
[165251] = {
type = "ADD"
}, -- Illusionary Vulpin
[165560] = {
type = "ADD"
}, -- Gormling Larva
[164567] = {
type = "BOSS"
}, -- Ingra Maloch
[164501] = {
type = "BOSS"
}, -- Mistcaller
[164517] = {
type = "BOSS"
}, -- Tred'ova
[164804] = {
type = "BOSS"
}, -- Droman Oulfarran

-- De Other Side
[165905] = {
type = "ADD"
}, -- Son of Hakkar (Hakkar adds),
[164450] = {
type = "BOSS",
}, -- Dealer Xy'exa
[164558] = {
type = "BOSS"
}, -- Hakkar the Soulflayer
[164555] = {
type = "BOSS"
}, -- Millificent Manastorm
[164556] = {
type = "BOSS"
}, -- Millhouse Manastorm
[166608] = {
type = "BOSS"
}, -- Mueh'zala

-- Halls of Atonement
[165408] = {
type = "BOSS"
}, -- Halkias
[164185] = {
type = "BOSS"
}, -- Echelon
[165410] = {
type = "BOSS"
}, -- High Adjudicator Aleez
[164218] = {
type = "BOSS"
}, -- Lord Chamberlain

-- Theater of Pain
[164451] = {
type = "BOSS"
}, -- Dessia the Decapitator
[164463] = {
type = "BOSS"
}, -- Paceran the Virulent
[164461] = {
type = "BOSS"
}, -- Sathel the Accursed
[162317] = {
type = "BOSS"
}, -- Gorechop
[162329] = {
type = "BOSS"
}, -- Xav the Unfallen
[162309] = {
type = "BOSS"
}, -- Kul'tharok
[165946] = {
type = "BOSS"
}, -- Mordretha, the Endless Empress
};

function MyDungeonsBook:GetSLDamageDoneToSpecificUnits()
Expand Down
55 changes: 8 additions & 47 deletions Messages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,55 +7,16 @@ Event Handlers
@section EventHandlers
]]

local MDB_CHALLENGE_IDLE_TIME = "MDB_CHALLENGE_IDLE_TIME";

--[[--
]]
function MyDungeonsBook:Message_IdleTime_StartTrack()
self:RegisterMessage(MDB_CHALLENGE_IDLE_TIME);
end

function MyDungeonsBook:Message_IdleTime_StopTrack()
self:UnregisterMessage(MDB_CHALLENGE_IDLE_TIME);
function MyDungeonsBook:Messages_StartTrack()
self:Message_CovenantInfo_StartTrack();
self:Message_IdleTime_StartTrack();
end

function MyDungeonsBook:Message_IdleTime_Send()
local id = self.db.char.activeChallengeId;
if (not id) then
return;
end
local challenge = self:Challenge_GetById(id);
local idleMechanics = challenge.mechanics["PARTY_MEMBERS_IDLE"];
local player = challenge.players.player;
self:DebugPrint(string.format("Idle Time is send"));
self:SendMessage(MDB_CHALLENGE_IDLE_TIME, self:Serialize({
idleTime = idleMechanics[player.name],
name = player.name,
realm = player.realm
}));
end

function MyDungeonsBook:MDB_CHALLENGE_IDLE_TIME(_, msg)
local success, data = self:Deserialize(msg);
if (not success) then
return;
end
local id = self.db.char.activeChallengeId;
if (not id) then
return;
end
local challenge = self:Challenge_GetById(id);
for _, unitId in pairs(self:GetPartyRoster()) do
local unitName = challenge.players[unitId].name;
local unitRealm = challenge.players[unitId].realm;
if (unitName == data.name and unitRealm == data.realm) then
local mechanicPartyMemberKey = data.name;
if (challenge.players.player.realm ~= data.realm) then
mechanicPartyMemberKey = string.format("%s-%s", data.name. data.realm);
end
challenge.mechanics["PARTY_MEMBERS_IDLE"][mechanicPartyMemberKey] = data.idleTime;
self:DebugPrint(string.format("Idle Time is saved for %s (%s)", unitName, unitId));
break;
end
end
--[[--
]]
function MyDungeonsBook:Messages_StopTrack()
self:Message_CovenantInfo_StopTrack();
self:Message_IdleTime_StopTrack();
end
Loading

0 comments on commit c71204b

Please sign in to comment.