• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

NPC Tibia.com NPC 26.11.2012

BDG

Banned User
Joined
Nov 26, 2012
Messages
84
Reaction score
1
Welcome to the topic will make available NPC made ​​by me for you.
I take all the details of the tibia wiki.
If you find a bug, please write here.

Lubo.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Lubo" script="data/npc/scripts/Lubo.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="128" head="38" body="39" legs="96" feet="118" addons="3"/>
<voices>
<voice text="Stop by and rest a while, tired adventurer! Have a look at my wares!" interval2="100" margin="1" yell="no"/>
</voices>
<parameters>
<parameter key="module_shop" value="1" />
<parameter key="shop_buyable" value="backpack,1988,25;crowbar,2416,260;fishing rod,2580,175;red apple,2674,3;rope,2120,60;torch,2050,3;waterskin of water,2031,10,1;worm,3976,1;" />
<parameter key="message_greet" value="Welcome to my adventurer shop, |PLAYERNAME|! What do you need? Ask me for a {trade} to look at my wares."/>
<parameter key="message_farewell" value="Good bye, |PLAYERNAME|."/>
<parameter key="message_walkaway" value="Good bye." />
<parameter key="message_sendtrade" value="Of course, just browse through my offers." />
<parameter key="module_keywords" value="1" />
<parameter key="keywords" value="job;dog;offer;name;" />
<parameter key="keyword_reply1" value="I am selling equipment for adventurers. If you need anything, let me know." />
<parameter key="keyword_reply2" value="This is Ruffy my dog, please don't do him any harm." />
<parameter key="keyword_reply3" value=" I sell torches, fishing rods, worms, ropes, water hoses, backpacks, apples, and maps." />
<parameter key="keyword_reply4" value="I am Lubo, the owner of this shop." />
</parameters>
</npc>
Lubo
Code:
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

local storage = getPlayerStorageValue(cid, 55000)

if msgcontains(msg, 'addon') then
if getPlayerPremiumDays(cid) >= 1 then
if storage >= 1 then
else
npcHandler:say("Sorry, the backpack I wear is not for sale. It's handmade from rare minotaur leather.", cid)
setPlayerStorageValue(cid, 55000, 1)
end
else
npcHandler:say("Sorry, you don\'t have premium time.", cid)
end
end
talkState[talkUser] = 1

if msgcontains(msg, 'minotaur leather') and talkState[talkUser] == 1 then
if storage == 1 then
npcHandler:say("Well, if you really like this backpack, I could make one for you, but minotaur leather is hard to come by these days. Are you willing to put some work into this?", cid)
setPlayerStorageValue(cid, 55000, 2)
end
end
talkState[talkUser] = 2

if msgcontains(msg, 'yes') and talkState[talkUser] == 2 then
if storage == 2 then
npcHandler:say("Alright then, if you bring me 100 pieces of fine minotaur leather I will see what I can do for you. You probably have to kill really many minotaurs though... so good luck!", cid)
setPlayerStorageValue(cid, 55000, 3)
end
end
talkState[talkUser] = 3

if msgcontains(msg, 'addon') and talkState[talkUser] == 3 then
if storage == 3 then
npcHandler:say("Ah, right, almost forgot about the backpack! Have you brought me 100 pieces of minotaur leather as requested?", cid)
setPlayerStorageValue(cid, 55000, 4)
end
end
talkState[talkUser] = 4

local block, duration = 55005, 7200

if msgcontains(msg, "yes") and storage == 4 and talkState[talkUser] == 4 then
if doPlayerRemoveItem(cid,5878,100) then
npcHandler:say("Great! Alright, I need a while to finish this backpack for you. Come ask me later, okay?", cid)
setPlayerStorageValue(cid, 55000, 5)
setPlayerStorageValue(cid, block, os.time()) 
else
npcHandler:say("Sorry, but You don\'t have minotaur leathers.", cid)
setPlayerStorageValue(cid, 55000, 3)
end
end
talkState[talkUser] = 5

if msgcontains(msg, 'addon') and storage == 5 and talkState[talkUser] == 5 then
if (os.time() - getPlayerStorageValue(cid, block)) >= duration then
npcHandler:say("Just in time! Your backpack is finished. Here you go, I hope you like it.", cid)
setPlayerStorageValue(cid, 55000, 6)
doPlayerAddOutfit(cid, 128, 1)
doPlayerAddOutfit(cid, 136, 1)
else
npcHandler:say("I'm not finished.", cid)
end
end
talkState[talkUser] = 6

return true
end

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

Hanna.xml
Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <npc name="Hanna" script="data/npc/scripts/Hanna.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="136" head="113" body="65" legs="0" feet="96" addons="2"/>
     <voices>
    <voice text="I have gems and beautiful jewellery for you!" interval2="100" margin="1" yell="no"/>
    </voices>
    <parameters>
    <parameter key="message_greet" value="Oh, please come in, |PLAYERNAME|. What do you need? Have a look at my wonderful offers in gems and jewellery."/>
    <parameter key="message_farewell" value="Good bye."/>
    <parameter key="message_walkaway" value="Good bye." />
    <parameter key="message_sendtrade" value="Here, take a look." />
    <parameter key="module_shop" value="1"/>
    <parameter key="shop_buyable" value="black pearl,2144,560;white pearl,2143,320;small amethyst,2150,400;small diamond,2145,600;small emerald,2149,500;small ruby,2147,500;small sapphire,2146,500;golden amulet,2130,6600;ruby necklace,2133,3560;wedding ring,2121,990;bronze goblet,5807,2000;golden goblet,5805,5000;silver goblet,5806,3000;" />
    <parameter key="shop_sellable" value="gold ingot,9971,5000;white pearl,2143,160;giant green pearl,7632,3000;giant brown pearl,7633,3000;black pearl,2144,280;small amethyst,2150,200;small diamond,2145,300;small emerald,2149,250;small ruby,2147,250;small sapphire,2146,250;small topaz,9970,200;wedding ring,2121,100;" />
    </parameters>
    </npc>
Hanna
Code:
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

local storage = getPlayerStorageValue(cid, 55001)

if msgcontains(msg, 'hat') then
if getPlayerPremiumDays(cid) >= 1 then
if storage >= 1 then
else
npcHandler:say("Pretty, isn't it? My friend Amber taught me how to make it, but I could help you with one if you like. What do you say?", cid)
setPlayerStorageValue(cid, 55001, 1)
end
else
npcHandler:say("Sorry, you don\'t have premium time.", cid)
end
end
talkState[talkUser] = 1

if msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
if storage == 1 then
npcHandler:say("Okay, here we go, listen closely! I need a few things... a basic hat of course, maybe a legion helmet would do. Then about 100 chicken feathers... and 50 honeycombs as glue. That's it, come back to me once you gathered it!", cid)
setPlayerStorageValue(cid, 55001, 2)
end
end
talkState[talkUser] = 2

if msgcontains(msg, 'hat') and talkState[talkUser] == 2 then
if storage == 2 then
npcHandler:say("Oh, you're back already? Did you bring a legion helmet, 100 chicken feathers and 50 honeycombs?", cid)
setPlayerStorageValue(cid, 55001, 3)
end
end
talkState[talkUser] = 3

if msgcontains(msg, "yes") and storage == 3 and talkState[talkUser] == 3 then
if doPlayerRemoveItem(cid,5890,100) and doPlayerRemoveItem(cid,5902,50) and doPlayerRemoveItem(cid,2480,1) then
npcHandler:say("Great job! That must have taken a lot of work. Okay, you put it like this... then glue like this... here!", cid)
setPlayerStorageValue(cid, 55001, 4)
doPlayerAddOutfit(cid, 128, 2)
doPlayerAddOutfit(cid, 136, 2)
else
npcHandler:say("Sorry, but You don\'t have items.", cid)
setPlayerStorageValue(cid, 55001, 2)
end
end
talkState[talkUser] = 4

return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Wstrzymałem projekt rl więc narazie nie mam :)
 
I updated your Hanna NPC to include the new gems from gnome base, and I also added some basic keywords.

Code:
<npc name="Hanna" script="data/npc/scripts/Hanna.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="136" head="113" body="65" legs="0" feet="96" addons="2"/>
	
     <voices>
    <voice text="Gems and jewellery! Best prices in town!" interval2="100" margin="1" yell="no"/>
    </voices>
	
    <parameters>
		<parameter key="message_greet" value="Oh, please come in, |PLAYERNAME|. What do you need? Have a look at my wonderful offers in gems and jewellery."/>
		<parameter key="message_farewell" value="Good bye."/>
		<parameter key="message_walkaway" value="Good bye." />
		<parameter key="message_sendtrade" value="Here, take a look." />
		
		<parameter key="module_shop" value="1"/>
		<parameter key="shop_buyable" value="black pearl,2144,560;white pearl,2143,320;small amethyst,2150,400;small diamond,2145,600;small emerald,2149,500;small ruby,2147,500;small sapphire,2146,500;golden amulet,2130,6600;ruby necklace,2133,3560;wedding ring,2121,990;bronze goblet,5807,2000;golden goblet,5805,5000;silver goblet,5806,3000;" />
		<parameter key="shop_sellable" value="blue crystal shard,18413,1500;blue crystal splinter,18418,400;brown crystal splinter,18417,400;cyan crystal fragment,18419,800;giant brown pearl,7633,3000;giant green pearl,7632,3000;green crystal fragment,18421,800;green crystal shard,18415,1500;green crystal splinter,18416,400;red crystal fragment,18420,800;gold ingot,9971,5000;white pearl,2143,160;black pearl,2144,280;small amethyst,2150,200;small diamond,2145,300;small emerald,2149,250;small ruby,2147,250;small sapphire,2146,250;small topaz,9970,200;violet crystal shard,18414,1500;wedding ring,2121,100;" />
		
		<parameter key="module_keywords" value="1" />
			<parameter key="keywords" value="job;name" />
			<parameter key="keyword_reply1" value="I am a jeweler. Maybe you want to have a look at my wonderful offers." />
			<parameter key="keyword_reply2" value="I am Hanna." />
		</parameters>
    </npc>
 
Last edited:
Back
Top Bottom