Miziak
New Member
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:
Globalevents version:
data/globalevents/scripts create file fontanny.lua and paste this:
globalevents.xml
Effect this mod is:
Testing on TFS 0.3.5pl1
Greet(Pozdrawiam),
Miziak
Btw. And I Sorry for my English
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: