Thread Tools Display Modes
04-18-23, 09:56 AM   #1
Fecker
A Kobold Labourer
Join Date: Apr 2023
Posts: 1
Smile Revenge - Partial Blocks Lua code

Hi,

I've got Revenge proc activation working but it's missing partial blocks.
Normally revenge gets activated if I(player) dodge, parry or block ....or partially block an attack(melee/range).

Here is the code taking care of block, parry and dodge:

Code:
function(event,_, subEvent,_,_,_, destGUID,_,_, missType,_,_, rangeMissType)
    if event == "COMBAT_LOG_EVENT_UNFILTERED"
    and destGUID == aura_env.myGUID then
        if subEvent  == "SWING_MISSED" then
            if missType == "DODGE" 
            or missType == "BLOCK" 
            or missType == "PARRY" then               
                return aura_env:StartTimer()
            end 
        elseif subEvent == "SPELL_MISSED" or subEvent == "RANGE_MISSED" then
            if rangeMissType == "DODGE" 
            or rangeMissType == "BLOCK" 
            or rangeMissType == "PARRY" then               
                return aura_env:StartTimer()
            end 
        end
    end
end
I'd like the activation to happen with Partial blocks but the following does not seem to work:
Code:
function(event,_, subEvent,_,_,_, destGUID,_,_, missType,_,_, rangeMissType)
    if event == "COMBAT_LOG_EVENT_UNFILTERED"
    and destGUID == aura_env.myGUID then
        if subEvent  == "SWING_MISSED" then
            if missType == "DODGE" 
            or missType == "BLOCK" 
            or missType == "PARRY" then               
                return aura_env:StartTimer()
            end 
        elseif subEvent == "SPELL_MISSED" or subEvent == "RANGE_MISSED" then
            if rangeMissType == "DODGE" 
            or rangeMissType == "BLOCK" 
            or rangeMissType == "PARRY" then               
                return aura_env:StartTimer()
            end 
        elseif subEvent == "SWING_DAMAGE" then
            if missType == "BLOCK" then               
                return aura_env:StartTimer()
            end
        elseif subEvent == "SPELL_DAMAGE" or subEvent == "RANGE_DAMAGE" then
            if rangeMissType == "BLOCK" then               
                return aura_env:StartTimer()
            end 
        end
    end
end
Any ideas please ? thanks

Events being tracked:
CLEU, WARRIOR_REVENGE
Actions:
Code:
aura_env.myGUID = UnitGUID("player")
aura_env.duration = 5
aura_env.expirationTime = 0

function aura_env:StartTimer()
    self.expirationTime = self.duration + GetTime() - select(3, GetNetStats())/1000
    WeakAuras.timer:CancelTimer(self.timer)
    self.timer = WeakAuras.timer:ScheduleTimer(WeakAuras.ScanEvents, self.duration, "WARRIOR_REVENGE")
    return true
end
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Revenge - Partial Blocks Lua code


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off