• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

GlobalEvent [MOD]Splashing water fountain heal v 1.0

Miziak

New Member
Joined
Nov 3, 2009
Messages
62
Reaction score
1
Location
Okolice Płocka, Poland
So, I have for you MOD on a "splashing water fountain heal", unfortunately you must give positions around fountain ;/

Ok let's go :)

in mods folder create fontanna.xml file and paste to file this:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Chlapiaca Fontanna" version="1.0" author="Miziak" contact="[email protected]" enabled="yes">
        <config name="chlap_config"><![CDATA[
		min, max = 10, 20 -- first number its minimal heal value, second is max value
		txt = {"Glup...", "Plum..." , "Chlap..."} -- "sounds"
        pos = {
								{{x=464, y=434, z=6}, {x=467, y=434, z=6}, {x=467, y=437, z=6}, {x=464, y=437, z=6}}, --first fountain splashing positions
								{{x=469, y=434, z=6}, {x=472, y=434, z=6}, {x=469, y=437, z=6}, {x=472, y=437, z=6}}, --second fountain splashing positions
								--etc
							  }
        ]]></config>
        <globalevent name="ChlapFontanna" interval="5" event="script"><![CDATA[
        domodlib('chlap_config')
		function onThink(interval, lastExecution)
		for _,v in pairs(pos) do
			for i=1, 2 do
				local poss = v[math.random(1,#v)]
				local thing = getThingFromPos({x=poss.x, y=poss.y, z=poss.z, stackpos=253})
				doSendAnimatedText(poss,txt[math.random(1,#txt)], 5)
				doSendMagicEffect(poss,1)
				if(isPlayer(thing.uid))then
					doCreatureAddHealth(thing.uid, math.random(min,max))
				end
			end
		end
		return true
		end
        ]]></globalevent>
</mod>

Globalevents version:
data/globalevents/scripts create file fontanny.lua and paste this:
Code:
local min, max = 10, 20 -- first number its minimal heal value, second is max value
local txt = {"Glup...", "Plum..." , "Chlap..."} -- "sounds"
local pos = {
					{{x=464, y=434, z=6}, {x=467, y=434, z=6}, {x=467, y=437, z=6}, {x=464, y=437, z=6}}, --first fountain splashing positions
					{{x=469, y=434, z=6}, {x=472, y=434, z=6}, {x=469, y=437, z=6}, {x=472, y=437, z=6}}, --second fountain splashing positions
					--etc
					}

function onThink(interval, lastExecution, thinkInterval)
		for _,v in pairs(pos) do
			for i=1, 2 do
				local poss = v[math.random(1,#v)]
				local thing = getThingFromPos({x=poss.x, y=poss.y, z=poss.z, stackpos=253})
				doSendAnimatedText(poss,txt[math.random(1,#txt)], 5)
				doSendMagicEffect(poss,1)
				if(isPlayer(thing.uid))then
					doCreatureAddHealth(thing.uid, math.random(min,max))
				end
			end
		end
	return true
end

globalevents.xml
Code:
<globalevent name="Fontanny" interval="5" event="script" value="fontanny.lua"/>

Effect this mod is:


Testing on TFS 0.3.5pl1

Greet(Pozdrawiam),
Miziak ;)

Btw. And I Sorry for my English :(
 
Last edited:
Thanks. Works Great Actually. Little more info Next time would Be great. I kept Getting An Error Even After Setting The X Y Z, But There is another spot also you need to set of the POS of The fountain.
 
Back
Top