Scripts "Health Potion & Stone" and "Potion Used" updated
This commit is contained in:
+5
-1
@@ -4174,6 +4174,10 @@ function DF:QuickDispatch(func, ...)
|
||||
return true
|
||||
end
|
||||
|
||||
---call a function in safe mode with payload
|
||||
---@param func function
|
||||
---@param ... any
|
||||
---@return any
|
||||
function DF:Dispatch(func, ...)
|
||||
if (type(func) ~= "function") then
|
||||
return dispatch_error (_, "DF:Dispatch expect a function as parameter 1.")
|
||||
@@ -4183,7 +4187,7 @@ function DF:Dispatch(func, ...)
|
||||
local okay = dispatchResult[1]
|
||||
|
||||
if (not okay) then
|
||||
return nil
|
||||
return false
|
||||
end
|
||||
|
||||
tremove(dispatchResult, 1)
|
||||
|
||||
+1
-1
@@ -8593,7 +8593,7 @@ detailsFramework.CastFrameFunctions = {
|
||||
self.value = self.empowered and (GetTime() - self.spellStartTime) or (self.spellEndTime - GetTime())
|
||||
self.maxValue = self.spellEndTime - self.spellStartTime
|
||||
|
||||
if (self.value < 0 or self.value >= self.maxValue) then
|
||||
if (self.value < 0 or self.value > self.maxValue) then
|
||||
self.value = 0
|
||||
end
|
||||
|
||||
|
||||
@@ -944,6 +944,7 @@ DF.CrowdControlSpells = {
|
||||
[122] = "MAGE", --Frost Nova
|
||||
[157997] = "MAGE", --Ice Nova
|
||||
[31661] = "MAGE", --Dragon's Breath
|
||||
[157981] = "MAGE", --Blast Wave
|
||||
|
||||
[205364] = "PRIEST", --Mind Control (talent)
|
||||
[605] = "PRIEST", --Mind Control
|
||||
|
||||
@@ -64,8 +64,7 @@ if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE and not isExpansion_Dragonflight()) t
|
||||
end
|
||||
|
||||
local major = "LibOpenRaid-1.0"
|
||||
--local CONST_LIB_VERSION = 87
|
||||
local CONST_LIB_VERSION = 92 --this is a rollback version, due to some zero hour bug issues
|
||||
local CONST_LIB_VERSION = 93
|
||||
|
||||
if (not LIB_OPEN_RAID_MAX_VERSION) then
|
||||
LIB_OPEN_RAID_MAX_VERSION = CONST_LIB_VERSION
|
||||
@@ -98,6 +97,11 @@ local unpack = table.unpack or _G.unpack
|
||||
local CONST_CVAR_TEMPCACHE = "LibOpenRaidTempCache"
|
||||
local CONST_CVAR_TEMPCACHE_DEBUG = "LibOpenRaidTempCacheDebug"
|
||||
|
||||
--delay to request all data from other players
|
||||
local CONST_REQUEST_ALL_DATA_COOLDOWN = 30
|
||||
--delay to send all data to other players
|
||||
local CONST_SEND_ALL_DATA_COOLDOWN = 30
|
||||
|
||||
--show failures (when the function return an error) results to chat
|
||||
local CONST_DIAGNOSTIC_ERRORS = false
|
||||
--show the data to be sent and data received from comm
|
||||
@@ -764,7 +768,7 @@ end
|
||||
openRaidLib.internalCallback.TriggerEvent("talentUpdate")
|
||||
end
|
||||
local delayedTalentChange = function()
|
||||
openRaidLib.Schedules.NewUniqueTimer(0.5 + math.random(), talentChangedCallback, "TalentChangeEventGroup", "talentChangedCallback_Schedule")
|
||||
openRaidLib.Schedules.NewUniqueTimer(math.random(3, 6), talentChangedCallback, "TalentChangeEventGroup", "talentChangedCallback_Schedule")
|
||||
end
|
||||
|
||||
local eventFunctions = {
|
||||
@@ -789,7 +793,7 @@ end
|
||||
--the group has changed, trigger a long timer to send full data
|
||||
--as the timer is unique, a new change to the group will replace and refresh the time
|
||||
--using random time, players won't trigger all at the same time
|
||||
local randomTime = 0.3 + math.random(0, 0.7)
|
||||
local randomTime = 5 + math.random() + math.random(1, 5)
|
||||
openRaidLib.Schedules.NewUniqueTimer(randomTime, openRaidLib.mainControl.SendFullData, "mainControl", "sendFullData_Schedule")
|
||||
end
|
||||
|
||||
@@ -1124,12 +1128,14 @@ end
|
||||
|
||||
--send a request to all players in the group to send their data
|
||||
function openRaidLib.RequestAllData()
|
||||
--the the player isn't in group, don't send the request
|
||||
if (not IsInGroup()) then
|
||||
return
|
||||
end
|
||||
|
||||
openRaidLib.requestAllInfoCooldown = openRaidLib.requestAllInfoCooldown or 0
|
||||
|
||||
--check if the player can sent another request
|
||||
if (openRaidLib.requestAllInfoCooldown > GetTime()) then
|
||||
return
|
||||
end
|
||||
@@ -1137,22 +1143,30 @@ end
|
||||
openRaidLib.commHandler.SendCommData(CONST_COMM_FULLINFO_PREFIX)
|
||||
diagnosticComm("RequestAllInfo| " .. CONST_COMM_FULLINFO_PREFIX) --debug
|
||||
|
||||
openRaidLib.requestAllInfoCooldown = GetTime() + 5
|
||||
openRaidLib.requestAllInfoCooldown = GetTime() + CONST_REQUEST_ALL_DATA_COOLDOWN
|
||||
return true
|
||||
end
|
||||
|
||||
--this function handles the request from another player to send all data
|
||||
function openRaidLib.commHandler.SendFullData()
|
||||
openRaidLib.mainControl.SendFullData()
|
||||
end
|
||||
|
||||
openRaidLib.commHandler.RegisterComm(CONST_COMM_FULLINFO_PREFIX, function(data, sourceName)
|
||||
openRaidLib.sendRequestedAllInfoCooldown = openRaidLib.sendRequestedAllInfoCooldown or 0
|
||||
|
||||
--some player in the group requested all information from all players
|
||||
--check if there's some delay before sending the data
|
||||
if (openRaidLib.sendRequestedAllInfoCooldown > GetTime()) then
|
||||
--reschedule the function call
|
||||
openRaidLib.Schedules.NewUniqueTimer(openRaidLib.sendRequestedAllInfoCooldown - GetTime(), openRaidLib.commHandler.SendFullData, "CommHandler", "sendFullData_Schedule")
|
||||
return
|
||||
end
|
||||
|
||||
openRaidLib.Schedules.NewUniqueTimer(random() + math.random(0, 3), openRaidLib.mainControl.SendFullData, "mainControl", "sendFullData_Schedule")
|
||||
openRaidLib.sendRequestedAllInfoCooldown = GetTime() + 5
|
||||
end)
|
||||
openRaidLib.Schedules.NewUniqueTimer(math.random(1, 6), openRaidLib.commHandler.SendFullData, "CommHandler", "sendFullData_Schedule")
|
||||
|
||||
--set the delay for the next request
|
||||
openRaidLib.sendRequestedAllInfoCooldown = GetTime() + CONST_SEND_ALL_DATA_COOLDOWN
|
||||
end)
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------------------------
|
||||
--~player general ~info ~unit
|
||||
|
||||
@@ -191,6 +191,17 @@ do
|
||||
[371339] = {tier = {[562] = 3, [476] = 1, [519] = 2}}, --Phial of Elemental Chaos
|
||||
}
|
||||
|
||||
LIB_OPEN_RAID_ALL_POTIONS = {
|
||||
[370511] = 1, --Refreshing Healing Potion
|
||||
[371039] = 1, --Potion of Withering Vitality
|
||||
[370607] = 1, --Aerated Mana Potion
|
||||
[371024] = 1, --Elemental Potion of Power
|
||||
[371028] = 1, --Elemental Potion of Ultimate Power
|
||||
[371033] = 1, --Potion of Frozen Focus
|
||||
[371125] = 1, --Potion of the Hushed Zephyr
|
||||
[371052] = 1, --Potion of Chilled Clarity
|
||||
}
|
||||
|
||||
--spellId of healing from potions
|
||||
LIB_OPEN_RAID_HEALING_POTIONS = {
|
||||
[370511] = 1, --Refreshing Healing Potion
|
||||
|
||||
@@ -122,6 +122,8 @@ LIB_OPEN_RAID_FOOD_BUFF = {}
|
||||
|
||||
LIB_OPEN_RAID_FLASK_BUFF = {}
|
||||
|
||||
LIB_OPEN_RAID_ALL_POTIONS = {}
|
||||
|
||||
LIB_OPEN_RAID_MELEE_SPECS = {
|
||||
[251] = "DEATHKNIGHT",
|
||||
[252] = "DEATHKNIGHT",
|
||||
|
||||
Reference in New Issue
Block a user