• 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!

Action Healing Fountain with Exhaust

Santy

Member
Joined
Aug 14, 2007
Messages
654
Reaction score
22
This is a fountain that heals your hp full and it has exhaustion for 15 mins..

Code:
function onUse(cid, item, frompos, item2, topos)
local exhausttime = 1200
local storevalue = 4850

	if item.uid == 3912 then
		if (exhaust(cid, storevalue, exhausttime) == 1) then
			doSendAnimatedText(getPlayerPosition(cid), "Ahh", TEXTCOLOR_LIGHTBLUE)
			doPlayerAddHealth(cid,1000000)
		else
			doPlayerSendCancel(cid,"You are full of water.")
		end
	end
end

Credits to papercut for the exhaustion.. everything else to me.
 
This is a fountain that heals your hp full and it has exhaustion for 15 mins..

Code:
function onUse(cid, item, frompos, item2, topos)
local exhausttime = 1200
local storevalue = 4850

	if item.uid == 3912 then
		if (exhaust(cid, storevalue, exhausttime) == 1) then
			doSendAnimatedText(getPlayerPosition(cid), "Ahh", TEXTCOLOR_LIGHTBLUE)
			doPlayerAddHealth(cid,1000000)
		else
			doPlayerSendCancel(cid,"You are full of water.")
		end
	end
end

Credits to papercut for the exhaustion.. everything else to me.

exhaust command working at forggoten?
 
yes exhausted is working but may i ask where dit get the idea of this healing fontain??
 
I didn't copy from him.. :O.. Really.. look @ tibiafans.. I made it :p.

Sorry if it was released b4.
 
Where am i suppose to put this code and stuff so I can use it?
 
go to \data\actions\scripts and add a file called "fountain.lua" and add the code
Code:
function onUse(cid, item, frompos, item2, topos)
local exhausttime = 1200
local storevalue = 4850

    if item.uid == 3912 then
        if (exhaust(cid, storevalue, exhausttime) == 1) then
            doSendAnimatedText(getPlayerPosition(cid), "Ahh", TEXTCOLOR_LIGHTBLUE)
            doPlayerAddHealth(cid,1000000)
        else
            doPlayerSendCancel(cid,"You are full of water.")
        end
    end
end
then go to \data\actions and open actions.xml and add
Code:
    <action actionid="[COLOR=Red]ACTIONID[/COLOR]" script="fountain.lua"/>
and then put the actionID you chose on a fountain in your map editor.
 
Thanks Empty :)

I hate when I find a useful script, and its noob protected :C
[noob protected means they don't explain where to put the scripts] :p
 
yes exhausted is working but may i ask where dit get the idea of this healing fontain??

Healing fountains exists in most games, and it's not very rare someone gets this idea, did you really think he got that idea from you? :blink:
 
I get this problem when clicking on the fountain, any one know what to do?



EDIT:
Im using TFS mystic spirit [0.2.9]
 
Last edited:
Dosnt work i did what you said but when i try use it it says sorry cant use
any ideas? i done everything right...
 
I get this problem when clicking on the fountain, any one know what to do?



EDIT:
Im using TFS mystic spirit [0.2.9]

You don't got the 'exhaust' function :p Just search for it, I think it's out here somewhere :huh:
 
I can post it for ya, wait 2 secs.

EDIT: Put this at the end of your global.lua

Code:
function exhaust(cid, storevalue, exhausttime)
  
    newExhaust = os.time()
    oldExhaust = getPlayerStorageValue(cid, storevalue)
    if (oldExhaust == nil or oldExhaust < 0) then
        oldExhaust = 0
    end
    if (exhausttime == nil or exhausttime < 0) then
        exhausttime = 1
    end
    diffTime = os.difftime(newExhaust, oldExhaust)
    if (diffTime >= exhausttime or diffTime < 0) then
        setPlayerStorageValue(cid, storevalue, newExhaust) 
        return 1
    else
        return 0
    end
end
 
Back
Top