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

Paradox Tower NPC

Shockah

Member
Joined
Aug 31, 2010
Messages
625
Reaction score
17
Location
England
Could somebody fix this NPC for me? Doesn't work, I'm using TFS 0.4 btw, dont know if it matters...
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

-- OTServ event handling functions start
function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)     npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                         npcHandler:onThink() 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 = "Death awaits those who fail the test of the three seals! 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 Seal of Knowledge and the first question: What name did the necromant king choose for himself?"
    local response03 = "HOHO! You have learned your lesson well. Question number two then: Who or what is the feared Hugo?"
    local response04 = "HOHO! Right again. All right. The final question of the first seal: Who was the first warrior to follow the path of the Mooh'Tah?"
    local response05 = "HOHO! Lucky you. You have passed the first seal! So ... would you like to continue with the Seal of the Mind?"
    local response06 = "As you wish, foolish one! Here is my first question: 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 break the Seal of Madness?"
    local response10 = "GOOD! So I will get you at last. Answer this: What is my favourite colour?"
    local response11 = "UHM UH OH ... How could you guess that? Are you mad??? All right. Question number two: What is the opposite?"
    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 1 plus 1?"
    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 = "goshnar"
    local keyword04 = "demonbunny"
    local keyword05 = "tha'kull"
    local keyword06 = "yes"
    local keyword07 = "breath"
    local keyword08 = "silence"
    local keyword09 = "old"
    local keyword10 = "yes"
    local keyword11 = "green"
    local keyword12 = "none"
    local keyword13 = "1132asas"
    local keyword14 = "2"
    
    local posPass = {x=32478, y=31905, z=1, stackpos=0}
    local posFail = {x=32725, y=31589, z=12, stackpos=0}

    -- end config
    if msgcontains(msg, keyword01) and queststate2 == 1 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())

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

local Topic = {}
local storage = {
	firstQuestPart = 211,
	test = 212,
	favoriteColor = 2,
	whatIsOnePlusOne = 1
}

function onCreatureAppear(cid)				npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) 			npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) 	npcHandler:onCreatureSay(cid, type, msg) end
function onThink() 						npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)
	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	if (msgcontains(msg, "hello") or msgcontains(msg, "hi")) and (not npcHandler:isFocused(cid)) then
		npcHandler:say(getCreatureName(cid).."! HEHEHEHE! Another fool! Excellent!", cid, TRUE)
		Topic[talkUser] = 0
		npcHandler:addFocus(cid)
		return true
	end
	if(not npcHandler:isFocused(cid)) then
		return false
	end
	if msgcontains(msg, "bye") or msgcontains(msg, "farewell") then
		npcHandler:say("HEHEHE! I knew you don't have the stomach.", cid, TRUE)
		Topic[talkUser] = nil
		npcHandler:releaseFocus(cid)
	elseif msgcontains(msg, "name") then
		npcHandler:say("I am known as the riddler. That is all you need to know.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "job") then
		npcHandler:say("I am the guardian of the paradox tower.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "time") then
		npcHandler:say("It is the age of the talon.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "tower") or msgcontains(msg, "paradox") then
		npcHandler:say("This tower, of course, silly one. It holds my master's treasure.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "master") then
		npcHandler:say("His name is none of your business.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "guard") or msgcontains(msg, "treasure") then
		npcHandler:say("I am guarding the treasures of the tower. Only those who pass the test of the three sigils may pass.", cid)
		Topic[talkUser] = 0
	elseif msgcontains(msg, "test") or msgcontains(msg, "sigil") then
		npcHandler:say("Death awaits those who fail the test of the three seals! Do you really want me to test you?", cid)
		Topic[talkUser] = 1
	elseif msgcontains(msg, "key") or msgcontains(msg, "door") then
		npcHandler:say("The key of this tower! You will never find it! A malicious plant spirit is guarding it!", cid)
		Topic[talkUser] = 0
	elseif Topic[talkUser] == 1 then
		if msgcontains(msg, "yes") then
			if getPlayerStorageValue(cid, storage.test) <= 0 then
				npcHandler:say("FOOL! Now you're doomed! But well ... So be it! Let's start out with the Seal of Knowledge and the first question: What name did the necromant king choose for himself?", cid)
				setPlayerStorageValue(cid, storage.test, 1)
				Topic[talkUser] = 2
			else
				npcHandler:say("So you think you're smart! But well ... So be it! Let's start out with the Seal of Knowledge and the first question: What do I have in my pocket?", cid)
				Topic[talkUser] = 14
			end
		elseif msgcontains(msg, "no") then
			npcHandler:say("HEHEHE! I knew you wouldn't have the stomach.", cid)
			npcHandler:releaseFocus(cid)
		end
	elseif Topic[talkUser] == 14 then
		npcHandler:say("WRONG!", cid)
		npcHandler:releaseFocus(cid)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		setPlayerStorageValue(cid, storage.test, 0)
		doTeleportThing(cid, {x=32725,y=31589,z=12}, FALSE)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	elseif Topic[talkUser] == 2 then
		if msgcontains(msg, "goshnar") then
			npcHandler:say("HOHO! You have learned your lesson well. Question number two then: Who or what is the feared Hugo?", cid)
			Topic[talkUser] = 3
		else
			npcHandler:say("WRONG!", cid)
			npcHandler:releaseFocus(cid)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			setPlayerStorageValue(cid, storage.test, 0)
			doTeleportThing(cid, {x=32725,y=31589,z=12}, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		end
	elseif Topic[talkUser] == 3 then
		if msgcontains(msg, "demonrabbit") or msgcontains(msg, "demonbunny") then
			if getPlayerStorageValue(cid, firstQuestPart) == 4 then
				npcHandler:say("HOHO! Right again. All right. The final question of the first seal: Who was the first warrior to follow the path of the Mooh'Tah?", cid)
				Topic[talkUser] = 4
			else
				npcHandler:say("Hmmm, so you think cheating will get you through that test? Then your final question of the first seal is: What is the meaning of life?", cid)
				Topic[talkUser] = 13
			end
		else	
			npcHandler:say("WRONG!", cid)
			npcHandler:releaseFocus(cid)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			setPlayerStorageValue(cid, storage.test, 0)
			doTeleportThing(cid, {x=32725,y=31589,z=12}, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		end
	elseif Topic[talkUser] == 13 then
		npcHandler:say("WRONG!", cid)
		npcHandler:releaseFocus(cid)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		setPlayerStorageValue(cid, storage.test, 0)
		doTeleportThing(cid, {x=32725,y=31589,z=12}, FALSE)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	elseif Topic[talkUser] == 4 then
		if msgcontains(msg, "Tha'kull") then
			npcHandler:say("HOHO! Lucky you. You have passed the first seal! So ... would you like to continue with the Seal of the Mind?", cid)
			Topic[talkUser] = 5
		else
			npcHandler:say("WRONG!", cid)
			npcHandler:releaseFocus(cid)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			setPlayerStorageValue(cid, storage.test, 0)
			doTeleportThing(cid, {x=32725,y=31589,z=12}, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		end
	elseif Topic[talkUser] == 5 then
		if msgcontains(msg, "yes") then
			npcHandler:say("As you wish, foolish one! Here is my first question: Its lighter then a feather but no living creature can hold it for ten minutes?", cid)
			Topic[talkUser] = 6
		else
			npcHandler:say("HEHEHE! I knew you don't have the stomach.", cid)
			npcHandler:releaseFocus(cid)
			setPlayerStorageValue(cid, storage.test, 0)
		end
	elseif Topic[talkUser] == 6 then
		if msgcontains(msg, "breath") then
			npcHandler:say("That was an easy one. Let's try the second: If you name it, you break it.", cid)
			Topic[talkUser] = 7
		else
			npcHandler:say("WRONG!", cid)
			npcHandler:releaseFocus(cid)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			setPlayerStorageValue(cid, storage.test, 0)
			doTeleportThing(cid, {x=32725,y=31589,z=12}, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		end
	elseif Topic[talkUser] == 7 then
		if msgcontains(msg, "silence") then
			npcHandler:say("Hm. I bet you think you're smart. All right. How about this: What does everybody want to become but nobody to be?", cid)
			Topic[talkUser] = 8
		else
			npcHandler:say("WRONG!", cid)
			npcHandler:releaseFocus(cid)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			setPlayerStorageValue(cid, storage.test, 0)
			doTeleportThing(cid, {x=32725,y=31589,z=12}, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		end
	elseif Topic[talkUser] == 8 then
		if msgcontains(msg, "old") then
			npcHandler:say("ARGH! You did it again! Well all right. Do you wish to break the Seal of Madness?", cid)
			Topic[talkUser] = 9
		else
			npcHandler:say("WRONG!", cid)
			npcHandler:releaseFocus(cid)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			setPlayerStorageValue(cid, storage.test, 0)
			doTeleportThing(cid, {x=32725,y=31589,z=12}, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		end
	elseif Topic[talkUser] == 9 then
		if msgcontains(msg, "yes") then
			npcHandler:say("GOOD! So I will get you at last. Answer this: What is your favourite colour?", cid)
			Topic[talkUser] = 10
		else
			npcHandler:say("HEHEHE! I knew you don't have the stomach.", cid)
			npcHandler:releaseFocus(cid)
			setPlayerStorageValue(cid, storage.test, 0)
		end
	elseif Topic[talkUser] == 10 then
		if msgcontains(msg, "red") then
			npcHandler:say("UHM UH OH ... How could you guess that? Are you mad??? All right. Question number two: What is the opposite?", cid)
			setPlayerStorageValue(cid, favoriteColor, 1)
			Topic[talkUser] = 11
		elseif msgcontains(msg, "blue") then
			npcHandler:say("UHM UH OH ... How could you guess that? Are you mad??? All right. Question number two: What is the opposite?", cid)
			setPlayerStorageValue(cid, favoriteColor, 2)
			Topic[talkUser] = 11
		elseif msgcontains(msg, "black") then
			npcHandler:say("UHM UH OH ... How could you guess that? Are you mad??? All right. Question number two: What is the opposite?", cid)
			setPlayerStorageValue(cid, favoriteColor, 3)
			Topic[talkUser] = 11
		elseif msgcontains(msg, "white") then
			npcHandler:say("UHM UH OH ... How could you guess that? Are you mad??? All right. Question number two: What is the opposite?", cid)
			setPlayerStorageValue(cid, favoriteColor, 4)
			Topic[talkUser] = 11
		elseif msgcontains(msg, "orange") then
			npcHandler:say("UHM UH OH ... How could you guess that? Are you mad??? All right. Question number two: What is the opposite?", cid)
			setPlayerStorageValue(cid, favoriteColor, 5)
			Topic[talkUser] = 11
		elseif msgcontains(msg, "green") then
			npcHandler:say("UHM UH OH ... How could you guess that? Are you mad??? All right. Question number two: What is the opposite?", cid)
			setPlayerStorageValue(cid, favoriteColor, 6)
			Topic[talkUser] = 11
		elseif msgcontains(msg, "yellow") then
			npcHandler:say("UHM UH OH ... How could you guess that? Are you mad??? All right. Question number two: What is the opposite?", cid)
			setPlayerStorageValue(cid, favoriteColor, 7)
			Topic[talkUser] = 11
		elseif msgcontains(msg, "brown") then
			npcHandler:say("UHM UH OH ... How could you guess that? Are you mad??? All right. Question number two: What is the opposite?", cid)
			setPlayerStorageValue(cid, favoriteColor, 8)
			Topic[talkUser] = 11
		elseif msgcontains(msg, "violet") then
			npcHandler:say("UHM UH OH ... How could you guess that? Are you mad??? All right. Question number two: What is the opposite?", cid)
			setPlayerStorageValue(cid, favoriteColor, 9)
			Topic[talkUser] = 11
		elseif msgcontains(msg, "pink") then
			npcHandler:say("UHM UH OH ... How could you guess that? Are you mad??? All right. Question number two: What is the opposite?", cid)
			setPlayerStorageValue(cid, favoriteColor, 10)
			Topic[talkUser] = 11
		elseif msgcontains(msg, "silver") then
			npcHandler:say("UHM UH OH ... How could you guess that? Are you mad??? All right. Question number two: What is the opposite?", cid)
			setPlayerStorageValue(cid, favoriteColor, 11)
			Topic[talkUser] = 11
		elseif msgcontains(msg, "gold") then
			npcHandler:say("UHM UH OH ... How could you guess that? Are you mad??? All right. Question number two: What is the opposite?", cid)
			setPlayerStorageValue(cid, favoriteColor, 12)
			Topic[talkUser] = 11
		elseif msgcontains(msg, "grey") then
			npcHandler:say("UHM UH OH ... How could you guess that? Are you mad??? All right. Question number two: What is the opposite?", cid)
			setPlayerStorageValue(cid, favoriteColor, 13)
			Topic[talkUser] = 11
		else
			npcHandler:say("WRONG!", cid)
			npcHandler:releaseFocus(cid)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			setPlayerStorageValue(cid, storage.test, 0)
			doTeleportThing(cid, {x=32725,y=31589,z=12}, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		end
	elseif Topic[talkUser] == 11 then
		if msgcontains(msg, "nothing") or msgcontains(msg, "none") then
			npcHandler:say("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 1 plus 1?", cid)
			Topic[talkUser] = 12
		else
			npcHandler:say("SORRY I AM NOT ALLOWED TO HELP HEHEHE!", cid)
			npcHandler:releaseFocus(cid)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			setPlayerStorageValue(cid, storage.test, 0)
			doTeleportThing(cid, {x=32725,y=31589,z=12}, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		end
	elseif Topic[talkUser] == 12 then
		if getPlayerStorageValue(cid, storage.whatIsOnePlusOne) == 1 and msgcontains(msg, "49") then
			npcHandler:say("DAMN YOUUUUUUUUUUUUUUUUUUUUUU!", cid)
			npcHandler:releaseFocus(cid)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			setPlayerStorageValue(cid, storage.test, 0)
			doTeleportThing(cid, {x=32478,y=31905,z=1}, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		elseif getPlayerStorageValue(cid, storage.whatIsOnePlusOne) == 2 and msgcontains(msg, "94") then
			npcHandler:say("DAMN YOUUUUUUUUUUUUUUUUUUUUUU!", cid)
			npcHandler:releaseFocus(cid)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			setPlayerStorageValue(cid, storage.test, 0)
			doTeleportThing(cid, {x=32478,y=31905,z=1}, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		elseif getPlayerStorageValue(cid, storage.whatIsOnePlusOne) == 3 and msgcontains(msg, "13") then
			npcHandler:say("DAMN YOUUUUUUUUUUUUUUUUUUUUUU!", cid)
			npcHandler:releaseFocus(cid)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			setPlayerStorageValue(cid, storage.test, 0)
			doTeleportThing(cid, {x=32478,y=31905,z=1}, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		elseif getPlayerStorageValue(cid, storage.whatIsOnePlusOne) == 4 and msgcontains(msg, "1") then
			npcHandler:say("DAMN YOUUUUUUUUUUUUUUUUUUUUUU!", cid)
			npcHandler:releaseFocus(cid)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			setPlayerStorageValue(cid, storage.test, 0)
			doTeleportThing(cid, {x=32478,y=31905,z=1}, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		else
			npcHandler:say("WRONG!", cid)
			npcHandler:releaseFocus(cid)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			setPlayerStorageValue(cid, storage.test, 0)
			doTeleportThing(cid, {x=32725,y=31589,z=12}, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		end
	end
	return TRUE
end

npcHandler:setMessage(MESSAGE_WALKAWAY, "COWARD! CHICKEN! HEHEHEHE!")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
 
Back
Top