• 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 Djin how to

pioncz

New Member
Joined
Dec 3, 2008
Messages
149
Reaction score
1
Hello,
How to make djin like in rl tibia. When i didn't djin quest he will say get out but when it done he will trade for me ?
I made this npc :
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Shad" script="data/npc/scripts/SellEliteLoot.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="51" head="78" body="88" legs="0" feet="88" addons="3"/>
</npc>
And scripts/SellEliteLoot :
Code:
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:setMessage(MESSAGE_GREET, "Greetings |PLAYERNAME|. Im selling elite loot only for good players. Did you do djin quest ? Say {trade}.")
function selleliteloot(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    queststatus = getPlayerStorageValue(cid,10576)
    if (parameters.confirm ~= true) and (parameters.decline ~= true) then
	if queststatus == -1 then
            npcHandler:say('Sorry, but you dont did djin quest!', cid)
            npcHandler:resetNpc()
            return false
	end
    end
    return false
end
local noNode = KeywordNode:new({'no'}, playerBuyAddonNPC, {decline = true})
local yesNode = KeywordNode:new({'yes'}, playerBuyAddonNPC, {confirm = true})
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
shopModule:addSellableItem({'serpent sword'}, 2409, 900, 'serpent sword') 
shopModule:addSellableItem({'dragonbone staff'}, 7430, 2500, 'dragonbone staff')
shopModule:addSellableItem({'giant sword'}, 2393, 17000, 'giant sword')
shopModule:addSellableItem({'ice rapier'}, 2396, 1000, 'ice rapier') 
shopModule:addSellableItem({'fire sword'}, 2392, 4000, 'fire sword')
shopModule:addSellableItem({'war hammer'}, 2391, 1200, 'war hammer') 
shopModule:addSellableItem({'skull staff'}, 2436, 6000, 'skull staff') 
shopModule:addSellableItem({'dragon hammer'}, 2434, 2000, 'dragon hammer') 
shopModule:addSellableItem({'dragon lance'}, 2414, 9000, 'dragon lance') 
shopModule:addSellableItem({'fire axe'}, 2432, 8000, 'fire axe') 
shopModule:addSellableItem({'guardian halberd'}, 2427, 10000, 'guardian halberd') 
shopModule:addSellableItem({'naginata'}, 2426, 1000, 'naginata') 
shopModule:addSellableItem({'obsidian lance'}, 2425, 500, 'obsidian lance axe') 
shopModule:addSellableItem({'knight axe'}, 2430, 4000, 'knight axe') 
shopModule:addSellableItem({'royal helmet'}, 2498, 30000, 'royal helmet') 
shopModule:addSellableItem({'warrior helmet'}, 2475, 5000, 'warrior helmet') 
shopModule:addSellableItem({'crown helmet'}, 2491, 2500, 'crown helmet') 
shopModule:addSellableItem({'devil helmet'}, 2462, 1000, 'devil helmet') 
shopModule:addSellableItem({'strange helmet'}, 2479, 500, 'strange helmet')
shopModule:addSellableItem({'dragon scale mail', 'dsm'}, 2492, 40000, 'dragon scale mail') 
shopModule:addSellableItem({'golden armor'}, 2466, 15000, 'golden armor') 
shopModule:addSellableItem({'crown armor'}, 2487, 12000, 'crown armor') 
shopModule:addSellableItem({'knight armor'}, 2476, 5000, 'knight armor') 
shopModule:addSellableItem({'blue robe'}, 2656, 15000, 'blue robe') 
shopModule:addSellableItem({'crown legs'}, 2488, 12000, 'crown legs') 
shopModule:addSellableItem({'knight legs'}, 2477, 5000, 'knight legs') 
shopModule:addSellableItem({'demon shield'}, 2520, 25000,  'demon shield') 
shopModule:addSellableItem({'vampire shield'}, 2534, 15000, 'vampire shield') 
shopModule:addSellableItem({'medusa shield'}, 2536, 9000, 'medusa shield') 
shopModule:addSellableItem({'crown shield'}, 2519, 8000,  'crown shield') 
shopModule:addSellableItem({'tower shield'}, 2528, 8000, 'tower shield') 
shopModule:addSellableItem({'dragon shield'}, 2516, 4000, 'dragon shield')
shopModule:addSellableItem({'steel boots', 'sbs'}, 2645, 40000, 'steel boots') 
shopModule:addSellableItem({'boots of haste', 'boh'}, 2195, 30000, 'boots of haste') 
shopModule:addSellableItem({'platinum amulet'}, 2171, 3000, 'platinum amulet') 
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To buy the first addon say \'first NAME addon\', for the second addon say \'second NAME addon\'.'})
npcHandler:addModule(FocusModule:new())
Edit:
Bad script. Now is what i really have.
 
Last edited:
Back
Top