1.1.8

esorochinskiy [11-13-22 - 08:07]
1.1.8
Filename
WellEater.lua
WellEater.txt
diff --git a/WellEater.lua b/WellEater.lua
index f705069..c13e09f 100644
--- a/WellEater.lua
+++ b/WellEater.lua
@@ -2,7 +2,7 @@ WellEater = WellEater or {}
 WellEater.WELLEATER_SAVED_VERSION = 1
 WellEater.AddonName = "WellEater"
 WellEater.DisplayName = "|cFFFFFFWell |c0099FFEater|r"
-WellEater.Version = "1.1.7"
+WellEater.Version = "1.1.8"
 WellEater.Author = "|c5EFFF5esorochinskiy|r"
 local NAMESPACE = {}
 NAMESPACE.settingsDefaults = {
@@ -642,6 +642,27 @@ local function InitOnLoad(_, addonName)
             end
     )

+    -- sprint
+    local SPRINT_ABILITY_ID = 973
+    EVENT_MANAGER:RegisterForEvent(WellEater.AddonName, EVENT_COMBAT_EVENT, function(_, result, isError, abilityName, abilityGraphic, abilityActionSlotType, sourceName, sourceType, targetName, targetType, hitValue, powerType, damageType, log, sourceUnitId, targetUnitId, abilityId)
+        if(hitValue == 0) then -- seems the event triggers twice, once with hitValue 0 and a second time with 1
+            --d("sprint start")
+            ShutDown()
+        end
+    end)
+    EVENT_MANAGER:AddFilterForEvent(WellEater.AddonName, EVENT_COMBAT_EVENT, REGISTER_FILTER_UNIT_TAG, "player")
+    EVENT_MANAGER:AddFilterForEvent(WellEater.AddonName, EVENT_COMBAT_EVENT, REGISTER_FILTER_COMBAT_RESULT, ACTION_RESULT_EFFECT_GAINED)
+    EVENT_MANAGER:AddFilterForEvent(WellEater.AddonName, EVENT_COMBAT_EVENT, REGISTER_FILTER_ABILITY_ID, SPRINT_ABILITY_ID)
+
+    EVENT_MANAGER:RegisterForEvent(WellEater.AddonName, EVENT_COMBAT_EVENT, function(_, result, isError, abilityName, abilityGraphic, abilityActionSlotType, sourceName, sourceType, targetName, targetType, hitValue, powerType, damageType, log, sourceUnitId, targetUnitId, abilityId)
+        --d("sprint end")
+        StartUp()
+    end)
+    EVENT_MANAGER:AddFilterForEvent(WellEater.AddonName, EVENT_COMBAT_EVENT, REGISTER_FILTER_UNIT_TAG, "player")
+    EVENT_MANAGER:AddFilterForEvent(WellEater.AddonName, EVENT_COMBAT_EVENT, REGISTER_FILTER_COMBAT_RESULT, ACTION_RESULT_EFFECT_FADED)
+    EVENT_MANAGER:AddFilterForEvent(WellEater.AddonName, EVENT_COMBAT_EVENT, REGISTER_FILTER_ABILITY_ID, SPRINT_ABILITY_ID)
+    -- end sprint
+
     EVENT_MANAGER:RegisterForEvent(WellEater.AddonName, EVENT_LUA_ERROR, OnUIError)

     -- local lamPanel =
diff --git a/WellEater.txt b/WellEater.txt
index 6ffc60b..803e3b0 100644
--- a/WellEater.txt
+++ b/WellEater.txt
@@ -31,7 +31,7 @@
 ## Author: |c5EFFF5esorochinskiy|r
 ## APIVersion: 101033 101034 101035 101036
 ## Description: Auto eat your preferred meals provided by your inventory after food or drink buff expiration. Provides weapon autoload and armor autorepair
-## Version: 1.1.7
+## Version: 1.1.8
 ## SavedVariables: WellEater_Settings
 ## DependsOn: LibAddonMenu-2.0>=28