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

Need some help.!

Dekon

Zerenia.net Owner
Joined
Feb 4, 2008
Messages
235
Reaction score
3
Location
Sweden
function onStepIn(cid, item, frompos, item2, topos)

playerpos = getPlayerPosition(cid)
novapos = {x=19980, y=20277, z=9}

if item.actionid == 17340 then

getThingfromPos(playerpos)
doSendMagicEffect(playerpos,2)
doTeleportThing(cid,novapos)
doSendMagicEffect(novapos,10)
end
end

-------------------------------------------------
function onStepIn(cid, item, pos)
if item.actionid == 13678 then
if isPlayer(cid) == TRUE then
if getPlayerStorageValue(cid,132568) == -1 then
setPlayerStorageValue(cid,132568,1)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Send the others! I want him dead!')
monster1pos = {x=20047, y=20410, z=9} --Phantasm
monster2pos = {x=20047, y=20407, z=9} --Phantasm
monster3pos = {x=20053, y=20409, z=9} --Phantasm
monster4pos = {x=20053, y=20411, z=9} --Lost Soul
monster5pos = {x=20053, y=20406, z=9} --Lost soul
monster6pos = {x=20055, y=20409, z=9} --juggernaut
monster7pos = {x=20050, y=20408, z=9} --hand
monster8pos = {x=20056, y=20409, z=9} --hand
doSummonCreature("Phantasm", monster1pos)
doSummonCreature("Phantasm", monster2pos)
doSummonCreature("Phantasm", monster3pos)
doSummonCreature("Lost Soul", monster4pos)
doSummonCreature("Lost Soul", monster5pos)
doSummonCreature("Juggernaut", monster6pos)
doSummonCreature("Hand of Cursed Fate", monster7pos)
doSummonCreature("Hand of Cursed Fate", monster8pos)
else
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have already killed the second guards!')
end
end
end
end

these script is currently working on tfs 0.3 rev 916 and i dont know how to get it working with newest tfs 0.2 patch 20 if anyone know please help :))
/Danne
 
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end
-- OTServ event handling functions end

function creatureSayCallback(cid, type, msg)
if(npcHandler.focus ~= cid) then
return false
end


-- start config
local queststate1 = getPlayerStorageValue(cid,6667)
local queststate2 = getPlayerStorageValue(cid,6668)
local response01 = "Xerxes will kill those who actually pass the test! Do you really want me to test you?"
local response02 = "FOOL! Now you're doomed! But well ... So be it! Let's start out with the first question: What was the name of Xerxes favourite assistant?"
local response03 = "Correct! First time lucky.. Alright. Question Number two:What colour was the cloth with a sign saying Two above it?"
local response04 = "Correct again! You won't get this. What colour did the flag with a letter T have?"
local response05 = "Oh my GOD! Who was the only survivor of the warlock race?"
local response06 = "You definately won't get this once! Its lighter then a feather but no living creature can hold it for ten minutes?"
local response07 = "That was an easy one. Let's try the second: If you name it, you break it."
local response08 = "Hm. I bet you think you're smart. All right. How about this: What does everybody want to become but nobody to be?"
local response09 = "ARGH! You did it again! Well all right. Do you wish to continue the test? It does get harder"
local response10 = "GOOD! So I will get you at last. Answer this: What item was to the north of the altar?"
local response11 = "UHM UH OH ... How could you guess that? Are you mad??? All right. Question number two: What item was to the south of the altar?"
local response12 = "NO! NO! NO! That can't be true. You're not only mad, you are a complete idiot! Ah well. Here is the last question: What is Xerxes favourite number?"
local response13 = "WRONG!"
local response14 = "RIGHT!"

local wrong = "NO! HAHA! YOU FAILED!"
local keywordAbadon = "no"
local abadon = "Better for you..."

-- all keywords MUST be lower-case
local keyword01 = "test"
local keyword02 = "yes"
local keyword03 = "manubis"
local keyword04 = "blue"
local keyword05 = "green"
local keyword06 = "xerxes"
local keyword07 = "breath"
local keyword08 = "silence"
local keyword09 = "old"
local keyword10 = "yes"
local keyword11 = "knight armor"
local keyword12 = "demon helmet"
local keyword13 = "1132asas"
local keyword14 = "10"

local posPass = {x=34433, y=32525, z=13, stackpos=0}
local posFail = {x=34465, y=32591, z=7, stackpos=0}

-- end config
if msgcontains(msg, keyword01) then
selfSay(response01)
talkState = 13
elseif msgcontains(msg, keyword02) and talkState == 13 then
selfSay(response02)
talkState = 14
elseif msgcontains(msg, keywordAbadon) and talkState == 13 then
selfSay(abadon)
talkState = 0
-- let's start the right answers
elseif msgcontains(msg, keyword03) and talkState == 14 then
selfSay(response03)
talkState = 15
elseif msgcontains(msg, keyword04) and talkState == 15 then
selfSay(response04)
talkState = 16
elseif msgcontains(msg, keyword05) and talkState == 16 then
selfSay(response05)
talkState = 17
elseif msgcontains(msg, keyword06) and talkState == 17 then
selfSay(response06)
talkState = 18
elseif msgcontains(msg, keyword07) and talkState == 18 then
selfSay(response07)
talkState = 19
elseif msgcontains(msg, keyword08) and talkState == 19 then
selfSay(response08)
talkState = 20
elseif msgcontains(msg, keyword09) and talkState == 20 then
selfSay(response09)
talkState = 21
elseif msgcontains(msg, keyword10) and talkState == 21 then
selfSay(response10)
talkState = 22
elseif msgcontains(msg, keyword11) and talkState == 22 then
selfSay(response11)
talkState = 23
elseif msgcontains(msg, keyword12) and talkState == 23 then
selfSay(response12)
talkState = 24
elseif msgcontains(msg, keyword14) and talkState == 24 then
doTeleportThing(cid,posPass)
selfSay(response14)
-- let's start the wrong answers annd the "death" teleport :D
elseif msgcontains(msg, keyword03) == nil and talkState == 13 then
selfSay(wrong)
talkState = 0
doTeleportThing(cid,posFail)
elseif msgcontains(msg, keyword04) == nil and talkState == 14 then
selfSay(wrong)
talkState = 0
doTeleportThing(cid,posFail)
elseif msgcontains(msg, keyword05) == nil and talkState == 15 then
selfSay(wrong)
talkState = 0
doTeleportThing(cid,posFail)
elseif msgcontains(msg, keyword06) == nil and talkState == 16 then
selfSay(wrong)
talkState = 0
doTeleportThing(cid,posFail)
elseif msgcontains(msg, keyword07) == nil and talkState == 17 then
selfSay(wrong)
talkState = 0
doTeleportThing(cid,posFail)
elseif msgcontains(msg, keyword08) == nil and talkState == 18 then
selfSay(wrong)
talkState = 0
doTeleportThing(cid,posFail)
elseif msgcontains(msg, keyword09) == nil and talkState == 19 then
selfSay(wrong)
talkState = 0
doTeleportThing(cid,posFail)
elseif msgcontains(msg, keyword10) == nil and talkState == 20 then
selfSay(wrong)
talkState = 0
doTeleportThing(cid,posFail)
elseif msgcontains(msg, keyword11) == nil and talkState == 21 then
selfSay(wrong)
talkState = 0
doTeleportThing(cid,posFail)
elseif msgcontains(msg, keyword12) == nil and talkState == 22 then
selfSay(wrong)
talkState = 0
doTeleportThing(cid,posFail)
elseif msgcontains(msg, keyword13) == nil and talkState == 23 then
selfSay(wrong)
talkState = 0
--1st--
elseif msgcontains(msg, keyword01) and queststate1 == 1 then
selfSay(response01)
talkState = 1
elseif msgcontains(msg, keyword02) and talkState == 1 then
selfSay(response02)
talkState = 2
elseif msgcontains(msg, keywordAbadon) and talkState == 1 then
selfSay(abadon)
talkState = 0
-- let's start the right answers
elseif msgcontains(msg, keyword03) and talkState == 2 then
selfSay(response03)
talkState = 3
elseif msgcontains(msg, keyword04) and talkState == 3 then
selfSay(response04)
talkState = 4
elseif msgcontains(msg, keyword05) and talkState == 4 then
selfSay(response05)
talkState = 5
elseif msgcontains(msg, keyword06) and talkState == 5 then
selfSay(response06)
talkState = 6
elseif msgcontains(msg, keyword07) and talkState == 6 then
selfSay(response07)
talkState = 7
elseif msgcontains(msg, keyword08) and talkState == 7 then
selfSay(response08)
talkState = 8
elseif msgcontains(msg, keyword09) and talkState == 8 then
selfSay(response09)
talkState = 9
elseif msgcontains(msg, keyword10) and talkState == 9 then
selfSay(response10)
talkState = 10
elseif msgcontains(msg, keyword11) and talkState == 10 then
selfSay(response11)
talkState = 11
elseif msgcontains(msg, keyword12) and talkState == 11 then
selfSay(response12)
talkState = 12
elseif msgcontains(msg, keyword13) == nil and talkState == 12 then
selfSay(response13)
doTeleportThing(cid,posFail)
-- let's start the wrong answers annd the "death" teleport :D
elseif msgcontains(msg, keyword03) == nil and talkState == 2 then
selfSay(wrong)
talkState = 0
doTeleportThing(cid,posFail)
elseif msgcontains(msg, keyword04) == nil and talkState == 3 then
selfSay(wrong)
talkState = 0
doTeleportThing(cid,posFail)

elseif msgcontains(msg, keyword05) == nil and talkState == 4 then
selfSay(wrong)
talkState = 0
doTeleportThing(cid,posFail)
elseif msgcontains(msg, keyword06) == nil and talkState == 5 then
selfSay(wrong)
talkState = 0


doTeleportThing(cid,posFail)
elseif msgcontains(msg, keyword07) == nil and talkState == 6 then
selfSay(wrong)
talkState = 0
doTeleportThing(cid,posFail)
elseif msgcontains(msg, keyword08) == nil and talkState == 7 then
selfSay(wrong)
talkState = 0
doTeleportThing(cid,posFail)
elseif msgcontains(msg, keyword09) == nil and talkState == 8 then
selfSay(wrong)
talkState = 0
doTeleportThing(cid,posFail)
elseif msgcontains(msg, keyword10) == nil and talkState == 9 then
selfSay(wrong)
talkState = 0
doTeleportThing(cid,posFail)
elseif msgcontains(msg, keyword11) == nil and talkState == 10 then
selfSay(wrong)
talkState = 0
doTeleportThing(cid,posFail)
elseif msgcontains(msg, keyword12) == nil and talkState == 11 then
selfSay(wrong)
talkState = 0
doTeleportThing(cid,posFail)
elseif msgcontains(msg, keyword13) == nil and talkState == 12 then
selfSay(wrong)
talkState = 0





end
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

and

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end

function creatureSayCallback(cid, type, msg)
--- TODO: bless function in modules.lua
if(npcHandler.focus ~= cid) then
return FALSE
end

if msgcontains(msg, 'jail') or msgcontains(msg, 'cell') then
npcHandler:say("I've been in this jail for 10 years now.. I know some 'facts' that might help you.")
talkState = 0
elseif msgcontains(msg, 'fact') then
npcHandler:say("I know a simple 'number' that can help you")
talkState = 1
elseif msgcontains(msg, 'number') or msgcontains(msg, 'plan') then
npcHandler:say("There is a 'rumour' that this number should never be mentioned in these lands.")
talkState = 2
elseif msgcontains(msg, 'rumour') then
npcHandler:say("The rumour was made by old beggar called Richard, he said that if anyone was to 'say' this number Xerxes would kill their family!")
talkState = 3
elseif msgcontains(msg, 'say') then
npcHandler:say("This number is supposed to be Xerxes favourite number, he hates people that know anything about him! The number is 10.")
talkState = 4
end
return TRUE
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

/Danne
 
Back
Top