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

Request for working Shower

Exmortis

Member
Joined
Jun 27, 2008
Messages
189
Reaction score
5
Alright guys, since im a mapper rather than a scripter i would like to have a functioning shower with maybe if you are up for it some modifications like a msg that tells you "Ohh, that felt so good" and i dont know, maybe adds HP or something.

I hope the image explains most of it.

requestimage.jpg

ID for the water: 9586
ID for the switch: 9343

And i dont need a fully explanation on the whole script since i know at least a few basics.
Anyone getting this to work will get a Rep++ .
(Im useing TFS 0.2.7)
 
Should the message & addhp be triggered when you step inside the water flow, or use the switch while standing on top of grate?
 
Well, im not really sure what would be easiest for you to do, since i really dont know the limits of scripting. But my guess would be that once you step onto the tope of the grate and hit the switch then the addhp and msg both triggers. But of course, if that proves almost impossible or just a b'tch then i second alternative would do.
Thanks for the megafast response anyway. :)
 
Go at it mate, im waiting patiently :D
If you could do it that you have to stand on the grate and then hit the switch to trigger, that'll be awesome.
 
Okay, create a file called shower.lua (for example) in data/actions/scripts/
Lua:
local gratePos = {x=100, y=100, z=7}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local v = getTileItemById(gratePos, 9586).uid
	if v == 0 then
		local p = getTopCreature(gratePos).uid
		if p ~= cid then
			doPlayerSendCancel(cid, 'You need to stand on the grate.')
		else
			doCreateItem(9586, 1, gratePos)
			doSendMagicEffect(gratePos, CONST_ME_WATERSPLASH)
			doCreatureSay(cid, 'Ohh, that felt so good!', TALKTYPE_ORANGE_1)
			doCreatureAddHealth(cid, 10)
		end
	else
		doRemoveItem(v)
	end
	return true	
end
Don't forget to assign some uniqueID or actionID to the switch in editor.
Add this in actions.xml:
XML:
	<action uniqueid="the_uniqueid_you've_put_on_the_switch" event="script" value="shower.lua"/>
 
Works great!
One thing i would like to add is that if you're not directly on the grate and try to hit the switch, it says "Stand in the shower and then turn on the water".
Overall thanks for your work, i've seen your previous work and it rocks. I'll rep you right away.
 
I thought that works already, wait. :S

Its alright, can you do me another favor? I would like the same kind of stuff you just made with the exception that it's a sink.
You rightclick the sink and you get the health and the same effect the previous script had, thanks mate. :)
 
Back
Top