• 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 Help With Npc

freak15

Professional Hoster
Joined
Dec 31, 2008
Messages
356
Reaction score
2
Location
Sweden
Hello i wud like some help with creating my npc Chondur like real tibia
wud be really nice if some1 helped me since iam still learning to script

The Function Should be like

The npc shud buy
Black Skull 4,000 gp
Blood Goblet 10,000 gp
Blood Herb 500 gp
Enigmatic Voodoo Skull 4,000 gp
Mysterious Voodoo Skull 4,000 gp

and you should be able to turn in

Stampor Horn Id 13299
Hallow Stampor Hoof ID 13301
Stampor Talon ID 13300

100x Stampor Talons
30x Stampor Hoofs
50x stampor horns

and you will recive Stampor Mount When You turn that in

Somthing Like this but it removes the items instead of money

Code:
local table = { 
    ["Stampor"] = {price = 0, id = 11}, 
} 
local keywordHandler = KeywordHandler:new() 
local npcHandler = NpcHandler:new(keywordHandler) 
NpcSystem.parseParameters(npcHandler) 
local talkState = {} 

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) 
    if(not npcHandler:isFocused(cid)) then 
        return false 
    end 

    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid 
     if table[msg] then 
      local t = table[msg] 
      talkState[talkUser] = 1 
       if getPlayerPremiumDays(cid) >= 1 then 
        if not getPlayerMount(cid, t.id) then 
         if doPlayerRemoveMoney(cid, t.cena) then 
          doPlayerAddMount(cid, t.id) 
          selfSay("You lost "..t.price.." gp! for mount!", cid) 
          talkState[talkUser] = 0 
         else 
          selfSay("Sorry, you do not all the required items! you need 100x stampor talon 50x stampor horn 30x hallow stampor hoofs come back when you got em!", cid) 
          talkState[talkUser] = 0 
         end 
        else 
         selfSay("Get Out Of Here You Already Got This Mount!", cid) 
         talkState[talkUser] = 0 
        end 
       else 
        selfSay("You must be Premium!", cid) 
        talkState[talkUser] = 0 
       end 
    else 
    selfSay('What? Please told me a correct name of mount!', cid) 
    talkState[talkUser] = 0 
   end 
   return true 
end
 
Back
Top