EC: Add missing timer buff for enhanced pet training hour

TimStTimSt Posts: 1,801
edited May 2023 in General Discussions
The following code changes to the EC will add the timer buff  for the enhanced pet training hour

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

Place the DDS file in your icons\my icons folder

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 icons
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

In the file source\BuffDebuffWindow.lua add the following code to the function BuffDebuff.MouseOver if you had not already added it
	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

In the file source\TextParsing.lua add the following code to the function TextParsing.TimersNbuff

	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





Sign In or Register to comment.