切換
舊版
前往
大廳
主題

[WOW][BFA]火法燃灼炎爆數量及點燃峰值通報

死鬥 | 2020-08-31 00:58:02 | 巴幣 0 | 人氣 295

火法燃灼炎爆數量及點燃峰值

(非WA版)

local addonName,addonTable = ...
---------確認是否有載入Lib_ZYF, 若無則返回
if (Lib_ZYF == nil ) then
print("No Lib_ZYF loaded")
return
end
---------
addonTable.CountOfFlameBurst = nil
addonTable.maxIgnite = 0

---------戰鬥子事件:光環套用時開始統計

Lib_ZYF:SetCombatLogEvent("SPELL_AURA_APPLIED",function(...)
---------
local timestamp, eventType, hideCaster,                                                                                           -- arg1  to arg3
sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags,                        -- arg4  to arg11
spellId, spellName, spellSchool,                                                                                           -- arg12 to arg14
amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing = CombatLogGetCurrentEventInfo()       -- arg15 to arg23
local msg
if (sourceGUID == UnitGUID("player")) and (spellId == 190319) then
msg = "開始統計"..spellName.."期間炎爆數量"
if UnitInRaid("player") then
SendChatMessage(msg,"say")
else
--SendChatMessage(msg,"guild")
print(msg)
end
addonTable.CountOfFlameBurst = 0
end
end)

---------戰鬥子事件:光環移除時通報統計數值

Lib_ZYF:SetCombatLogEvent("SPELL_AURA_REMOVED",function(...)

---------
local timestamp, eventType, hideCaster,                                                                                           -- arg1  to arg3
sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags,                        -- arg4  to arg11
spellId, spellName, spellSchool,                                                                                           -- arg12 to arg14
amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing = CombatLogGetCurrentEventInfo()       -- arg15 to arg23
local msg
if (sourceGUID == UnitGUID("player")) and (spellId == 190319) then
msg = GetSpellLink(spellId).."結束,期間"..GetSpellLink(11366)
msg = msg..addonTable.CountOfFlameBurst.."發"
msg = msg..","..GetSpellLink(12654).."峰值"..addonTable.maxIgnite

if UnitInRaid("player") then
SendChatMessage(msg,"say")
else
SendChatMessage(msg,"guild")
end
addonTable.CountOfFlameBurst = nil
addonTable.maxIgnite = 0
end
end)

---------戰鬥子事件:每次炎爆術施放成功時統計並通報

Lib_ZYF:SetCombatLogEvent("SPELL_CAST_SUCCESS",function(...)
---------
local timestamp, eventType, hideCaster,                                                                         -- arg1  to arg3
sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags,       -- arg4  to arg11
spellId, spellName, spellSchool,                                                                          -- arg12 to arg14
amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing = ...
local msg
local SendChatMessage = SendChatMessage
if (sourceGUID == UnitGUID("player")) and (spellId == 11366) then
if addonTable.CountOfFlameBurst then
addonTable.CountOfFlameBurst = addonTable.CountOfFlameBurst + 1
msg = GetSpellLink(190319)
msg = msg..GetSpellLink(195283)
msg = msg..GetSpellLink(11366)
msg = msg..addonTable.CountOfFlameBurst
--print(msg)

--若在團隊內則通報到白字,若不在團隊則通報到公會頻道

--若不想通報到任何頻道則可自行修改成print(msg)
if UnitInRaid("player") then
SendChatMessage(msg,"say")
else
SendChatMessage(msg,"guild")
end
end
end
end)

---------戰鬥子事件:週期性傷害,紀錄點燃最大傷害

Lib_ZYF:SetCombatLogEvent("SPELL_PERIODIC_DAMAGE",function(...)
---------
local timestamp, eventType, hideCaster,                                                                         -- arg1  to arg3
sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags,       -- arg4  to arg11
spellId, spellName, spellSchool,                                                                          -- arg12 to arg14
amount, overkill, school, resisted, blocked, absorbed, critical, glancing, crushing = ...
if (sourceGUID == UnitGUID("player")) and (spellId == 12654) then
if amount > addonTable.maxIgnite then
addonTable.maxIgnite = amount
print(GetSpellLink(spellId)..amount.."(MAX:"..addonTable.maxIgnite..")")
end
end
end)



創作回應

更多創作