-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Cjewett/feature/alter_existing_wow_honor_…
…gained_message Instead of having own log message change the WoW chat message for hon…
- Loading branch information
Showing
5 changed files
with
30 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
local addonName, addonTable = ... | ||
HonorAssist = addonTable | ||
|
||
-- This runs after HonorAssistDailyCalculator. That means the kill is already added to that database, so we can use the times killed from that service. | ||
-- When calculating realistic honor we need to decrease by 1 to get the real value of the kill. | ||
ChatFrame_AddMessageEventFilter("CHAT_MSG_COMBAT_HONOR_GAIN", function(self, event, text, ...) | ||
local estimatedHonorGained = string.match(text, "%d+") | ||
local playerKilled = string.match(text, "^([^%s]+)") | ||
local playerRank = HonorAssist:Trim(string.match(text, "(Rank:.([^(]+))")) | ||
local timesKilled = HonorAssist:GetTotalKillsDailyDatabase(playerKilled) | ||
local percentage, realisticHonor = HonorAssist:CalculateRealisticHonor(timesKilled - 1, estimatedHonorGained) | ||
local timeText = 'times' | ||
|
||
if timesKilled == 1 then | ||
timeText = 'time' | ||
end | ||
|
||
text = 'You have killed ' .. playerKilled .. ' (' .. playerRank .. ') ' .. timesKilled .. ' ' .. timeText | ||
.. '. This kill granted ' .. percentage * 100 .. '% value for ' .. realisticHonor .. ' honor ' .. string.match(text, "(%(.+)") .. '.' | ||
|
||
return false, text, ... | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters