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

Demon oak-like tiles

watkins577

As3, lua, xml scripter
Joined
Sep 20, 2008
Messages
130
Reaction score
0
Hey, Ive been designing a quest where you have to solve a few puzzles. The first puzzle is get into the tower, which is done by stepping on 4 tiles, so 4 magic walls are removed at once. Every tile you step on, a tile with smoke makes a pshhhhhhhhhhh sound. But the problem is I dont know how I could set this up, I know its like setGlobalStorageValue(XXXX, getGlobalStorageValue(XXXX)+1) or something, but Id also need it to close after a minute.

The tiles I want to move onto are:
450, 220, 7
457, 213, 7
471, 226, 7
470, 215, 7
and the tile I want to make a noise is:
460, 220, 7
The pos of the m-walls on are:
459-462, 227, 7

Can someone make the script please. BTW if you step on a tile more than once nothing happens.
 
Heres a base code you could use to make a larger one.

Code:
function onStepIn(cid, item, pos)

        if getPlayerStorageValue(cid,30) == -1 then
            setPlayerStorageValue(cid,30,1)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'1/5 done')
        else
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You already completed this one.')
        end
		end

And then for the TP to go in

Code:
inoak = {x=32716, y=32346, z=7}
backtp = {x=32716, y=32339, z=7}

function onStepIn(cid, item, pos)
        if getPlayerStorageValue(cid,30) == 1 and getPlayerStorageValue(cid,31) == 1 and getPlayerStorageValue(cid,32) == 1 and getPlayerStorageValue(cid,33) == 1 and getPlayerStorageValue(cid,34) == 1 then
            doTeleportThing(cid,inoak)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Welcome to Demon Oak Hell.")
            else
            doTeleportThing(cid,backtp)	
        end
		end
 
Could you help me with this?;
Like demon oak:
Step on the first tile, a text appears from the Demon Oak.
Step on the second tile, another text appears from the Demon Oak.
and so on
and when you step on the sixth tile, you can enter the Demon Oak pit.

Thanks in advance

TFS 0.3.4pl2
 
Thanks chris, but the main reason I need the script is because I dont know how to make text appear in a certain position other than doSendAnimatedText which is VERY limited since theres a 10 letter limit.

Okay, I changed my mind, so now I want a npc, but instead of him being a normal npc that you can talk to an stuff, I just want it to be that he doesnt respond to anything... so I want him to face south at all times, but how could I do this?
 
Last edited:
@Slaktaren
Even though theres a limited space to do something you could just add something like this.
Code:
function onStepIn(cid, item, pos)

        if getPlayerStorageValue(cid,30) == -1 then
            setPlayerStorageValue(cid,30,1)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'1/5 done')
            doCreatureSay({x=100,y=110,z=7}, 'Noo!', TALKTYPE_ORANGE_1)
        else
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You already completed this one.')
        end
		end


@Watkins577 Why does the NPC have to face south at all times? You could just make it like this
Code:
 autowalk="0" floorchange="0"

Then it wont walk anywhere.
 
Last edited:
Thanks, it works now :) Is there any way to make it act like a yell though, since the position I want is too far away for the presser to hear (I know it works because I put the position close to test it.)

Edit: I made a better idea so now I have an npc which shouts, but is there any way to make him always face the south? (Since he faces north when he spawns, and you cant talk to him at all?)
 
Last edited:
Im not good with Npc's so not sure if this will work.

Code:
<npc name="Yeller" script="data/npc/scripts/oakYell.lua" autowalk="0" floorchange="0" access="5" level="1" maglevel="1">
	<health now="150" max="150"/>
	<look type="152" head="0" body="132" legs="132" feet="132" addons="3"/>
</npc>

Code:
function onThink()
doNpcSetCreatureFocus(focus)
 	if focus ~= 0 then
		if getDistanceToCreature(focus) > 5 then
 			selfSay('Goodbye' .. getCreatureName(focus) .. '.')
			focus = 0
			talk_state = 0
			talk_start = 0
 		
		elseif (os.clock() - talk_start) > 30 then
 			selfSay('Goodbye' .. getCreatureName(focus) .. '.')
			focus = 0
			talk_state = 0
			talk_start = 0
		end	
 	end

local initBroadcasting = 0
local messageToSay = "You will never defeat me! The Almighty Demon Oak!."
local timeInMinutes = 3
	if (initBroadcasting == 0) then
		local param = {messageToSay = messageToSay, timeInMinutes = timeInMinutes}
		addEvent(broadCastMessage, 1000*60*timeInMinutes, param)
		initBroadcasting = 1
	end
end

function broadCastMessage(param)
local timeInMinutes = param.timeInMinutes
local messageToSay = param.messageToSay
	doCreatureSay(getNpcCid(), messageToSay, TALKTYPE_BROADCAST)
	addEvent(broadCastMessage, 1000*60*timeInMinutes, param)
end

Every 3 minutes he will yel the local messageToSay
 
Well this is my approach to it lol

Lua:
function onStepIn(cid, item, pos)
	creaturepos = {x=460, y=220, z=7, stackpos=STACKPOS_TOP_CREATURE}
	npc = getThingFromPos(creaturepos)
	if getPlayerStorageValue(cid, 6804) == -1 then
		doCreatureSay(npc.uid, "Hurry up and release me!", TALKTYPE_YELL)
		setPlayerStorageValue(cid, 6804, 1)
	end
end
 
Does it work to just make like STACKPOS_ITEM~ and it will make it yell from the item?

btw, it's better with TALKTYPE_ORANGE_2, because that will make it yell in orange, like the real Demon oak
 
Aff, I can't believe how stupid I was lol. When I first starting making it I remember putting it in but nothing happened... stupid wrong direction :p

Edit: That didnt work I dont think.

Edit: Nope that didnt work, he still faces north (even if I change the direction)
 
Last edited:
Back
Top