EC Missing timer debuff for equipment change cool down
The EC is missing a timer debuff for equipment change cool down. The follow code changes will add a macro action that you can use to show the debuff.
Download the following two icons from my GitHub repository:
Start up the EC and you will see the new action Equipment Wait at the bottom of the Actions/Equipment menu
One caveat to be aware of is the EC does not provide an indication if the equipment change that happens will have a cool down or not. The above code changes just assumes that a cool down is required.
Download the following two icons from my GitHub repository:
https://github.com/TimStotelmeyer/Ultima-Online/blob/main/EquipmentWaitAction.dds
https://github.com/TimStotelmeyer/Ultima-Online/blob/main/EquipmentWaitDebuff.dds
and put them in your "icons\my icons" directory
Add the following two lines to the file "icons\icons.xml"
<Icon id="900003" texture="Icons/My Icons/EquipmentWaitDebuff.dds" name="Equipment Wait Debuff" />
<Icon id="900004" texture="Icons/My Icons/EquipmentWaitAction.dds" name="Equipment Wait Action" />
Add the follow code to the function BuffDebuff.Initialize in the file "source\BuffDebuffWindow.lua"
UOBuildTableFromCSV("Data/GameData/buffdata.csv", "BuffDataCSV")Add the follow code to the file "source\Actions.lua"
-- start of adding custom buff / debuff icons
if (WindowData.BuffDataCSV ~= nil) then
local equipmentWaitDebuff = {
["ID"] = 900003,
["ServerId"] = 900003,
["IconId"] = 900003,
["Define"] = 0
}
table.insert(WindowData.BuffDataCSV, equipmentWaitDebuff )
end
--end of added code
--start of added codeAdd the following code to the top of the file "source\HotbarSystem.lua"
function Actions.EquipmentWait()
WindowData.BuffDebuffSystem.CurrentBuffId = 900003 -- use custom equipment delay buff icon.
WindowData.BuffDebuff.NameWStringVector = L"Equipment Delay"
WindowData.BuffDebuff.NameVectorSize = 0
WindowData.BuffDebuff.ToolTipVectorSize = 0
WindowData.BuffDebuff.IsBeingRemoved = false
local secs = 9
BuffDebuff.Timers[900003] = secs
BuffDebuff.ShouldCreateNewBuff()
HotbarSystem.EquipItemsDelayTimeMax = secs
HotbarSystem.EquipItemsDelayTime = secs
end
--end of added code
--start of added codeAdd the following code to the function HotbarSystem.UpdateActionButton in the file source\HotbarSystem.lua
HotbarSystem.EquipItemsDelayTimeMax = 0
HotbarSystem.EquipItemsDelayTime = 0
HotbarSystem.EquipItems = {}
--end of added code
if type == SystemData.UserAction.TYPE_SKILL thenAdd the following code to the function HotbarSystem.ClearActionIcon in the file source\HotbarSystem.lua
if( HotbarSystem.Skills[id] == nil ) then
HotbarSystem.Skills[id] = {}
end
HotbarSystem.Skills[id][element] = element
end
--start of added code
if type == SystemData.UserAction.TYPE_EQUIP_ITEMS or (type == SystemData.UserAction.TYPE_MACRO_REFERENCE
and ((iconId >= 875000 and iconId <= 875036) or (iconId >= 875200 and iconId <= 875206)
or (iconId >= 875250 and iconId <= 875268) or (iconId >= 875300 and iconId <= 875310)
or (iconId >= 875450 and iconId <= 875460))) then
if( HotbarSystem.EquipItems[id] == nil ) then
HotbarSystem.EquipItems[id] = {}
end
HotbarSystem.EquipItems[id][element] = element
end
--end of added code
elseif HotbarSystem.SpecialActions and HotbarSystem.SpecialActions[id] and HotbarSystem.SpecialActions[id][element] thenAdd the following code to the function HotbarSystem.Update in the file source\HotbarSystem.lua
HotbarSystem.SpecialActions[id][element] = nil
--start of added code
elseif HotbarSystem.EquipItems and HotbarSystem.EquipItems[id] and HotbarSystem.EquipItems[id][element] then
HotbarSystem.EquipItems[id][element] = nil
--end of added code
end
HotbarSystem.UpdateCooldownSlot(element, HotbarSystem.SkillDelayTime, HotbarSystem.SkillDelayTimeMax)Add the following code to the bottom of the function Interface.Cooldowns in the file Interface.lua
end
end
end
--start of added code
for id, element in pairs(HotbarSystem.EquipItems) do
for element, curElement in pairs(HotbarSystem.EquipItems[id]) do
local patt = element
local fnd = string.find(patt , "Button")
if (element and fnd ~= nil ) then
local hotbarId = tonumber(string.sub(patt,7, fnd - 1))
local itemIndex = tonumber(string.sub(patt, fnd + 6 ))
if Hotbar.IsShrunken(hotbarId)then
continue
end
if not DoesWindowNameExist(WindowGetParent(element)) then
HotbarSystem.EquipItems[id] = nil
continue
end
if( HotbarSystem.EquipItems[id] == nil ) then
HotbarSystem.EquipItems[id] = {}
end
WindowSetShowing(element.."Disabled",false)
WindowSetShowing(element.."Alert",false)
HotbarSystem.UpdateCooldownSlot(element, HotbarSystem.EquipItemsDelayTime, HotbarSystem.EquipItemsDelayTimeMax)
end
end
end
--end of added code
--start of added codeAdd the following code to the function ActionsWindow.InitActionData in the file source\ActionsWindow.lua
if HotbarSystem.EquipItemsDelayTime > 0 then
HotbarSystem.EquipItemsDelayTime = HotbarSystem.EquipItemsDelayTime - timePassed
end
--end of added code
ActionsWindow.ActionData[6006] = { type=SystemData.UserAction.TYPE_SPEECH_USER_COMMAND, inActionWindow=true, iconId=876006, detailString=GetStringFromTid(1155381), nameString=FormatProperly(GetStringFromTid(1044013)), callback=L"script Actions.MakeLast()" }
--start of added code
ActionsWindow.ActionData[900004] = { type=SystemData.UserAction.TYPE_SPEECH_USER_COMMAND, inActionWindow=true, iconId=900004, detailString=L"", nameString=FormatProperly(L"Equipment Wait"), callback=L"script Actions.EquipmentWait()" }
--end of added code
Add the follow code to the function ActionsWindow.Initialize() in the file source\ActionsWindow.lua
local actionData
--start of added code
table.insert(ActionsWindow.Groups[4].index, 900004) --EquipmentWait
--end of added code
To use it create a macro for changing your equipment and add the Equipment Wait action after the Equip action
It is important that you set the macro's icon to one of the equipment icons if you want to see which macro on the tool bar you need to wait to use.One caveat to be aware of is the EC does not provide an indication if the equipment change that happens will have a cool down or not. The above code changes just assumes that a cool down is required.
Comments
Here is the updated code:
To the function PaperdollWindow.Initialize in the file source\PaperdollWindow.lua add the following code