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

Commit

Permalink
#77 Don't track heal done to enemy units
Browse files Browse the repository at this point in the history
  • Loading branch information
onechiporenko committed Nov 10, 2020
1 parent 17b53c6 commit c2db545
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### v1.6.0

* [#77](https://github.com/onechiporenko/my-dungeons-book/issues/77) Don't track heal done to enemy units
* [#76](https://github.com/onechiporenko/my-dungeons-book/issues/76) Shield/offhand item sometimes is shifted to the second row
* [#74](https://github.com/onechiporenko/my-dungeons-book/issues/74) Reset viewed challenge info when MDB is closed
* [#73](https://github.com/onechiporenko/my-dungeons-book/issues/73) Show heal done by each spell
Expand Down
8 changes: 4 additions & 4 deletions Events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ function MyDungeonsBook:COMBAT_LOG_EVENT_UNFILTERED()
if (subEventSuffix == "HEAL") then
local spellId, _, _, amount, overheal, _, crit = select(12, CombatLogGetCurrentEventInfo());
self:TrackAllHealDoneByPartyMembersToEachOther(srcName, srcGUID, dstName, dstGUID, spellId, amount, overheal);
self:TrackAllHealBySpellDoneByPartyMembers(srcName, srcGUID, spellId, amount, overheal, crit);
self:TrackAllHealBySpellDoneByPartyMembers(srcName, srcGUID, srcFlags, dstName, dstGUID, dstFlags, spellId, amount, overheal, crit);
end
if (subEventName == "DAMAGE_SPLIT" or
subEventName == "DAMAGE_SHIELD") then
local spellId, _, _, amount, overheal = select(12, CombatLogGetCurrentEventInfo());
self:TrackAllHealDoneByPartyMembersToEachOther(srcName, srcGUID, dstName, dstGUID, spellId, amount, overheal);
self:TrackAllHealBySpellDoneByPartyMembers(srcName, srcGUID, spellId, amount, overheal, false);
self:TrackAllHealBySpellDoneByPartyMembers(srcName, srcGUID, srcFlags, dstName, dstGUID, dstFlags, spellId, amount, overheal, false);
end
if (subEventName == "SPELL_ABSORBED") then
local unitGUID, unitName, _, _, spellId, _, _, amount = select(12, CombatLogGetCurrentEventInfo());
local unitGUID, unitName, unitFlags, _, spellId, _, _, amount = select(12, CombatLogGetCurrentEventInfo());
self:TrackAllHealDoneByPartyMembersToEachOther(unitName, unitGUID, dstName, dstGUID, spellId, amount, -1);
self:TrackAllHealBySpellDoneByPartyMembers(srcName, srcGUID, spellId, amount, -1, false);
self:TrackAllHealBySpellDoneByPartyMembers(unitName, unitGUID, unitFlags, dstName, dstGUID, dstFlags, spellId, amount, -1, false);
end
if (subEventSuffix == "INTERRUPT") then
local spellId, _, _, extraSpellId = select(12, CombatLogGetCurrentEventInfo());
Expand Down
10 changes: 9 additions & 1 deletion Mechanics/Common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -391,17 +391,25 @@ Track all heal done by party members (including pets and other summonned units)
@param[type=string] sourceUnitName
@param[type=GUID] sourceUnitGUID
@param[type=number] sourceUnitFlags
@param[type=string] targetUnitName
@param[type=GUID] targetUnitGUID
@param[type=number] targetUnitFlags
@param[type=number] spellId
@param[type=number] amount
@param[type=number] overheal
@param[type=bool] crit
]]
function MyDungeonsBook:TrackAllHealBySpellDoneByPartyMembers(sourceUnitName, sourceUnitGUID, spellId, amount, overheal, crit)
function MyDungeonsBook:TrackAllHealBySpellDoneByPartyMembers(sourceUnitName, sourceUnitGUID, sourceUnitFlags, targetUnitName, targetUnitGUID, targetUnitFlags, spellId, amount, overheal, crit)
local id = self.db.char.activeChallengeId;
local type = strsplit("-", sourceUnitGUID);
self:InitMechanics1Lvl("PARTY-MEMBERS-SUMMON");
local summonedUnitOwner = self.db.char.challenges[id].mechanics["PARTY-MEMBERS-SUMMON"][sourceUnitGUID];
local sourceUnitNameToUse = sourceUnitName;
local targetIsEnemy = bit.band(targetUnitFlags, COMBATLOG_OBJECT_REACTION_HOSTILE) ~= 0;
if (targetIsEnemy) then
return;
end
if ((not summonedUnitOwner) and (type ~= "Pet") and (type ~= "Player")) then
return;
end
Expand Down
3 changes: 2 additions & 1 deletion UI/ChallengeDetails/Tabs/DEV.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ function MyDungeonsBook:DevFrame_Create(parentFrame, challengeId)
editBox.button:SetText("Get JSON");
editBox.button:Show();
editBox:SetCallback("OnEnterPressed", function ()
editBox:SetText(self:Table2Json(select(2, self:Decompress(challenge.mechanics))));
local isTable = type(challenge.mechanics) == "table";
editBox:SetText(self:Table2Json((isTable and challenge.mechanics) or select(2, self:Decompress(challenge.mechanics))));
editBox:HighlightText();
end);
devFrame:AddChild(editBox);
Expand Down

0 comments on commit c2db545

Please sign in to comment.