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

NPC Real Tibian NPC - 0.6.2 - not in progress

it should work just as a normal,

and i found 1 bug if you use TFS 0.3

change
Code:
autowalk="1"
to
Code:
walkinterval="1"

in NPCNAME.XML


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

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

npcHandler:addModule(FocusModule:new())
 
Why do you start these kind of projects? I really hate people who do it. Many people worked on the real tibia NPC's for many hours because it's exclusive to have them and they actually are worth a lot of money and you all fuck it up probably just because you want to have some reputation.

If I did hurt you or something I apologize for that but it's just lame to release them.

your jsut selfish and want to make money! everyone has the right to do what they want and everyone should have the right to make npcs and release them to make a good rl map server. he doesn't destroy the work of other people because he does it himself and this exclusivity you talk about is the worst shit of all i hate it that people think their shit don't stink because they have rl npcs. i hate people like you that opress the development of an better OT rl map server
 
Bump and Update again!

0.6.1, fixed ab'dendriels elf looktypes and some other too, and all in carlin too! they are only white atm :p

Rep++ please ^^
 
I think its great, although...
I wish you had the looktypes all correct.

Atleast do that.
 
i found an missing npc "Xodet" in thais he is the magicshop npc so he is rly important
 
Ruprecht

May not be a very important NPC, but it's exactly like real tibia, (not sure if it works in NPC window). It's Ruprecht, the guy you give Christmas tokens too. Anyway I released it on another OT site and I figured I'd lend you a hand, it's just the .lua, not the .xml. I made it when clients we're still 8.1 by the way.

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)
    -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
    if(npcHandler.focus ~= cid) then
        return false
    end

    -- use the real conversation? (true/false)
    real = true
    
    if real == true then
        tradeMsg = 'I accept presents that were stolen from Santa by those little pest Grynch Goblins in exchange for christmas tokens.'
        presentMsg = 'Do you want trade a present bag for a christmas token?'
        gingerMsg = 'Do you want trade a christmas token for a gingerbread man?'
        recipeMsg = 'Do you want trade 10 christmas tokens for a gingerbread man recipe?'
        jewelMsg = 'Do you want trade 25 christmas tokens for a jewel case?'
        hatMsg = 'Do you want trade 50 christmas tokens for a santa hat?'
        dollMsg = 'Do you want trade 100 christmas tokens for a santa doll?'
        hasNoMsg = 'I only want present bags.'
        askMsg = 'I will trade a gingerbread man for 1 token, the gingerbread recipe for 10, a jewel case for 25, a santa hat for 50 and a santa doll for 100 tokens.'
        noMsg = 'I\'ll be here when you\'re ready.'
    else
        tradeMsg = 'I accept presents that were stolen from Santa by those little pest Grynch Goblins in exchange for christmas tokens.'
        presentMsg = 'Do you want trade a present bag for a christmas token?'
        gingerMsg = 'Do you want trade a christmas token for a gingerbread man?'
        recipeMsg = 'Do you want trade 10 christmas tokens for a gingerbread man recipe?'
        jewelMsg = 'Do you want trade 25 christmas tokens for a jewel case?'
        hatMsg = 'Do you want trade 50 christmas tokens for a santa hat?'
        dollMsg = 'Do you want trade 100 christmas tokens for a santa doll?'
        hasNoMsg = 'I only want present bags.'
        askMsg = 'I will trade a gingerbread man for 1 token, the gingerbread recipe for 10, a jewel case for 25, a santa hat for 50 and a santa doll for 100 tokens.'
        noMsg = 'I\'ll be here when you\'re ready.'
    end
        if msgcontains(msg, 'items') or msgcontains(msg, 'item') or msgcontains(msg, 'offers') or msgcontains(msg, 'offer') then
            selfSay(tradeMsg)
        elseif msgcontains(msg, 'christmas token') or msgcontains(msg, 'token') or msgcontains(msg, 'xmas token') then
            selfSay(askMsg)
        elseif msgcontains(msg, 'present bag') or msgcontains(msg, 'present') or msgcontains(msg, 'bag') then
            selfSay(presentMsg)
            talk_state = 1
        elseif msgcontains(msg, 'gingerbread man') or msgcontains(msg, 'gingerbread cookie') or msgcontains(msg, 'ginger cookie') then
            selfSay(gingerMsg)
            talk_state = 2
        elseif msgcontains(msg, 'gingerbread recipe') or msgcontains(msg, 'recipe') or msgcontains(msg, 'cookie recipe') then
            selfSay(recipeMsg)
            talk_state = 3
        elseif msgcontains(msg, 'jewel case') or msgcontains(msg, 'case') or msgcontains(msg, 'jewel') or msgcontains(msg, 'jewels') or msgcontains(msg, 'locket') or msgcontains(msg, 'jewel box') then
            selfSay(jewelMsg)
            talk_state = 4
        elseif msgcontains(msg, 'santa hat') or msgcontains(msg, 'santas hat') or msgcontains(msg, 'hat') or msgcontains(msg, 'santa\'s hat') then
            selfSay(hatMsg)
            talk_state = 5
        elseif msgcontains(msg, 'santa doll') or msgcontains(msg, 'santas doll') or msgcontains(msg, 'doll') or msgcontains(msg, 'santa\'s doll') then
            selfSay(dollMsg)
            talk_state = 6
------------------------------------------------ confirm yes ------------------------------------------------
        elseif msgcontains(msg, 'yes') and talk_state == 1 then
            if getPlayerItemCount(cid,6497) >= 1 then
                if doPlayerTakeItem(cid,6497,1) == 0 then
                    selfSay('Here you are.')
                    doPlayerAddItem(cid,6527,1)
                end
            else
                selfSay(hasNoMsg)
            end
            talk_state = 0
        elseif msgcontains(msg, 'yes') and talk_state == 2 then
            if getPlayerItemCount(cid,6527) >= 1 then
                if doPlayerTakeItem(cid,6527,1) == 0 then
                    selfSay('Here you are.')
                    doPlayerAddItem(cid,6501,1)
                end
            else
                selfSay(hasNoMsg)
            end
            talk_state = 0
        elseif msgcontains(msg, 'yes') and talk_state == 3 then
            if getPlayerItemCount(cid,6527) >= 10 then
                if doPlayerTakeItem(cid,6527,10) == 0 then
                    selfSay('Here you are.')
                    doPlayerAddItem(cid,6523,1)
                end
            else
                selfSay(hasNoMsg)
            end
            talk_state = 0
        elseif msgcontains(msg, 'yes') and talk_state == 4 then
            if getPlayerItemCount(cid,6527) >= 25 then
                if doPlayerTakeItem(cid,6527,25) == 0 then
                    selfSay('Here you are.')
                    doPlayerAddItem(cid,6104,1)
                end
            else
                selfSay(hasNoMsg)
            end
            talk_state = 0
        elseif msgcontains(msg, 'yes') and talk_state == 5 then
            if getPlayerItemCount(cid,6527) >= 50 then
                if doPlayerTakeItem(cid,6527,50) == 0 then
                    selfSay('Here you are.')
                    doPlayerAddItem(cid,6531,1)
                end
            else
                selfSay(hasNoMsg)
            end
            talk_state = 0
        elseif msgcontains(msg, 'yes') and talk_state == 6 then
            if getPlayerItemCount(cid,6527) >= 100 then
                if doPlayerTakeItem(cid,6527,100) == 0 then
                    selfSay('Here you are.')
                    doPlayerAddItem(cid,6512,1)
                end
            else
                selfSay(hasNoMsg)
            end
            talk_state = 0
------------------------------------------------ confirm no ------------------------------------------------
        elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then
            selfSay(noMsg)
            talk_state = 0
        end
    -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
    return true
end

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