EC: Add missing timer buff for enhanced pet training hour
The following code changes to the EC will add the timer buff
for the enhanced pet training hour
Place the DDS file in your icons\my icons folder
Add the following line to icons\icons.xml
In the file source\TextParsing.lua add the following code to the function TextParsing.TimersNbuff
![](https://forum.uo.com/uploads/editor/91/dlfdah2jbq4x.bmp)
Create a DDS file using the icon provided or download the DDS file https://github.com/TimStotelmeyer/Ultima-Online/blob/main/EnhancedPetTraining.dds from github
Add the following line to icons\icons.xml
<Icon id="957569" texture="Icons/My Icons/EnhancedPetTraining.dds" name="Enhanced pet training" />In the file source\BuffDebuffWindow.lua add the following code to the structure BuffDebuff.Neutral
--Begin Custom
[957569] = true; -- Enhanced pet training
In the file source\BuffDebuffWindow.lua add the following code to the function BuffDebuff.Initialize
--add custom buff / debuff iconsIn the file source\BuffDebuffWindow.lua add the following code to the function BuffDebuff.MouseOver if you had not already added it
if (WindowData.BuffDataCSV ~= nil) then
local petHourBuff = {
["ID"] = 957569,
["ServerId"] = 957569,
["IconId"] = 957569,
["Define"] = 0
}
table.insert(WindowData.BuffDataCSV, petHourBuff)
end
--end of added code
if( data ) then
local nameString = L""
--start of added code
if(data.NameWStringVector ~= nil and type(data.NameWStringVector) == "wstring") then
nameString = data.NameWStringVector
end
--end of added code
if ( SystemData.TextID == 1157569 ) then -- * Your pet is under the effects of enhanced training progress for the next hour *
WindowData.BuffDebuffSystem.CurrentBuffId = 957569 -- use custom enhanced training buff icon.
WindowData.BuffDebuff.NameWStringVector = L"Your pet is under the effects of enhanced training progress"
WindowData.BuffDebuff.NameVectorSize = 0
WindowData.BuffDebuff.ToolTipVectorSize = 0
WindowData.BuffDebuff.IsBeingRemoved = false
BuffDebuff.Timers[957569] = 3600 -- 1 hour
BuffDebuff.ShouldCreateNewBuff()
return
end
if( SystemData.TextID == 1157570) then -- * Your pet is no longer under the effects of enhanced training progress *
if(BuffDebuff.BuffData[957569] ~= nil) then
BuffDebuff.HandleBuffRemoved(957569) --remove the enhanced training custom buff
end
return
end