🧙‍♂️ Brought to you by Peptides.gg — Use code UO20 for 20% off — GLP-1's, 90+ Peptides and more!

EC Add center notifications for luck ending and potion of glorious fortune ending

Started by TimSt · 2023-10-23 · 8 posts · General Discussions
#0
If you, like me, want a more obvious notification of the ending of your hour of luck from a statue or the ending of the hour of glorious fortune than the disappearing of the buff icons, I have a solution for you.

I have created the following two center notifications:


To use them
Download the following two DDS files from my github repository
https://github.com/TimStotelmeyer/Ultima-Online/blob/main/cst_YourLuckJustEnded.dds
https://github.com/TimStotelmeyer/Ultima-Online/blob/main/cst_GloriousFortuneJustEnded.dds
and put them in your "Textures\My Textures" directory

Add the following lines to the file Textures\Textures.xml at the bottom of the Assets section
		<Texture name="CST_YouAreFree" file="Textures/cst_YouFree.dds"/>
<!-- start of added entries -->
<Texture name="CST_YOURLUCKJUSTENDED" file="Textures/My Textures/cst_YourLuckJustEnded.dds"/>
<Texture name="CST_GLORIOUSFORTUNEJUSTENDED" file="Textures/My Textures/cst_GloriousFortuneJustEnded.dds"/>
<!-- end of added entries-->
</Assets>

Add the following code to the function CenterScreenText.SendCenterScreenTexture in the file sources\CenterScreenText.lua
--start of added code	
if ( message == "yourluckjustended" ) then
DynamicImageSetTexture( "CenterScreenTextImage", "CST_YOURLUCKJUSTENDED", 0, 0 )
DynamicImageSetTextureDimensions( "CenterScreenTextImage", 640, 80 )
WindowSetDimensions("CenterScreenTextImage", 640, 80 )
WindowStopAlphaAnimation("CenterScreenTextImage")
WindowSetAlpha("CenterScreenTextImage", 0)
WindowStartAlphaAnimation("CenterScreenTextImage", Window.AnimationType.LOOP, 0.5, 1, 1, false, 0, 3)
local sid = 1065
PlaySound(1, sid, WindowData.PlayerLocation.x,WindowData.PlayerLocation.y,WindowData.PlayerLocation.z)
CenterScreenText.LOWHPMEStarted = false
CenterScreenText.LOWHPPetStarted = false
end

if ( message == "gloriousfortunejustended" ) then
DynamicImageSetTexture( "CenterScreenTextImage", "CST_GLORIOUSFORTUNEJUSTENDED", 0, 0 )
DynamicImageSetTextureDimensions( "CenterScreenTextImage", 640, 80 )
WindowSetDimensions("CenterScreenTextImage", 640, 80 )
WindowStopAlphaAnimation("CenterScreenTextImage")
WindowSetAlpha("CenterScreenTextImage", 0)
WindowStartAlphaAnimation("CenterScreenTextImage", Window.AnimationType.LOOP, 0.5, 1, 1, false, 0, 3)
local sid = 62
PlaySound(1, sid, WindowData.PlayerLocation.x,WindowData.PlayerLocation.y,WindowData.PlayerLocation.z)
CenterScreenText.LOWHPMEStarted = false
CenterScreenText.LOWHPPetStarted = false
end

--end of added coded

Add the following code to the function BuffDebuff.Update in the file source\BuffDebuffWindow.lua
			else
BuffDebuff.Timers[key] = 0
BuffDebuff.HandleBuffRemoved(key)
--start of added code
if( key == 1187 ) then --glorious fortune potion
CenterScreenText.SendCenterScreenTexture("gloriousfortunejustended")
end
--end of added code
end

Add the following code to the function TextParsing.CenterScreenText in the file source\TextParsing.lua
--start of added code
if ( SystemData.TextID == 1079552) then -- Your luck just ended
CenterScreenText.SendCenterScreenTexture("yourluckjustended")
end
--end of added code


#1
Why can't we get these and all the other great fixes added in so we don't have to risk messing up something doing it ourselves? 
#2
Grimbeard said:
Why can't we get these and all the other great fixes added in so we don't have to risk messing up something doing it ourselves? 
lol that is the question of the  decade. players know more about fixing bugs in UO then the people payed to fix the bugs in UO. unless they have players coding and working on NL there is no hope for it.
#3
@Mariah this post needs to archive with the rest of EC tutorials
#4
Seth said:
@ Mariah this post needs to archive with the rest of EC tutorials
Why can't these things be directly added ?? @Kyronix @Community Manager
#5
Pinco's UI has that already ;)
#6
Pinco's UI has that already ;)
Tried Pinco, it's too heavily mod... 
#7
Grimbeard said:
Seth said:
@ Mariah this post needs to archive with the rest of EC tutorials
Why can't these things be directly added ?? @ Kyronix @ "Community Manager"
+⁹99⁹99999999999
← Browse more General Discussions discussions