PoccnnEnquanto houver armas no mundo, haverá guerra!PHerói
info
Grupo: Herói
Registrado: 07/03/16
Posts: 1.4k
Reputação: +385
Gênero: Masculino
31 de agosto de 2020 às 10:13
Lubo.xml
<?xml version="1.0" encoding="UTF-8"?><npcname="Lubo"script="data/npc/scripts/Thais/Lubo.lua"walkinterval="2000"floorchange="0"><healthnow="100"max="100"/><looktype="128"head="57"body="122"legs="126"feet="94"addons="3"/><parameters><parameterkey="module_shop"value="1"/><parameterkey="shop_buyable"value="basket,1989,6;bottle,4839,3;bucket,2005,4,0;candelabrum,2041,8;closed trap,2578,280;crowbar,2416,260;cup,2013,3,0;fishing rod,2580,150;machete,2420,35;pick,2553,50;present,1990,10;backpack,1988,25;rope,2120,50;scyhe,2550,50;shovel,2554,50;torch,2050,2;worm,3976,1;"/><parameterkey="shop_sellable"value="crowbar,2416,75;closed trap,2578,50;fishing rod,2580,40;machete,2420,6;pick,2553,15;rope,2120,15;scythe,2550,10;shovel,2554,8;wooden hammer,2556,15;"/><parameterkey="message_greet"value="Welcome to my adventurer shop, |PLAYERNAME|! What do you need?"/><parameterkey="message_farewell"value="Come back soon!"/><parameterkey="module_keywords"value="1"/><parameterkey="keywords"value="job;equipment;maps;magic;name;weapon;mountain;magician;crunor;flower guys;accident;stable;buy;sell;wares;dog;inn;pet;finger;cottage;"/><parameterkey="keyword_reply1"value="I am selling equipment for adventurers. Do you need anything?"/><parameterkey="keyword_reply2"value="I sell torches, fishing rods, ropes, water hoses, backpacks, apples, and maps."/><parameterkey="keyword_reply3"value="Oh! I'm sorry, I sold the last one just five minutes ago."/><parameterkey="keyword_reply4"value="There's a lot of magic flowing in the mountain to the north."/><parameterkey="keyword_reply5"value="I am Lubo, the owner of this shop."/><parameterkey="keyword_reply6"value="If you want to buy weapons, you'll have to go to a town or city."/><parameterkey="keyword_reply7"value="It is said that once there lived a great magician on the top of this mountain."/><parameterkey="keyword_reply8"value="I don't remember his name, but it's said that his banner was the black eye."/><parameterkey="keyword_reply9"value="Ah yes, I remember my grandfather talking about that name. This house used to be an inn a long time ago. My family bought it from some of these flower guys."/><parameterkey="keyword_reply10"value="Oh, I mean druids of course. They sold the cottage to my family after some of them died in an accident or something like that."/><parameterkey="keyword_reply11"value="As far as I can remember the story, a pet escaped its stable behind the inn. It got somehow involved with powerful magic at a ritual and was transformed in some way."/><parameterkey="keyword_reply12"value="My grandpa told me, in the old days there were some behind this cottage. Nothing big though, just small ones, for chicken or rabbits."/><parameterkey="keyword_reply13"value="I sell torches, fishing rods, worms, ropes, water hoses, backpacks, apples, and maps."/><parameterkey="keyword_reply14"value="I sell torches, fishing rods, worms, ropes, water hoses, backpacks, apples, and maps."/><parameterkey="keyword_reply15"value="I sell torches, fishing rods, worms, ropes, water hoses, backpacks, apples, and maps."/><parameterkey="keyword_reply17"value="This is Ruffy my dog, please don't do him any harm."/><parameterkey="keyword_reply18"value="Frodo runs a nice inn in the near town Thais."/><parameterkey="keyword_reply19"value="There are some strange stories about a magicians pet names. Ask Hoggle about it."/><parameterkey="keyword_reply20"value="Oh, you sure mean this old story about the mage Dago, who lost two fingers when he conjured a dragon."/><parameterkey="keyword_reply21"value="Ah yes, I remember my grandfather talking about that name. This house used to be an inn a long time ago. My family bought it from some of these flower guys."/></parameters></npc>
Lubo.lua
local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)local talkState ={}function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid)endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid)endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg)endfunction onThink() npcHandler:onThink()endlocalfunction say(npc,text, cid)
doCreatureSay(npc,text,TALKTYPE_PRIVATE_NP,cid)endfunction creatureSayCallback(cid, type, msg)if(not npcHandler:isFocused(cid))thenreturnfalseendlocal talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and0or cid
local msg = string.lower(msg)if(msgcontains(msg,'time'))then
npcHandler:say("It is exactly "..getTibianTime()..".", cid)elseif(msgcontains(msg,'outfit')or msgcontains(msg,'addon'))then
npcHandler:say("Sorry, the backpack I wear is not for sale. It's handmade from rare {minotaur leather}.", cid)
talkState[talkUser]=1elseif(talkState[talkUser]==1and msgcontains(msg,'minotaur leather'))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)
talkState[talkUser]=11elseif(talkState[talkUser]==11and msgcontains(msg,'yes'))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)
talkState[talkUser]=0elseif(msgcontains(msg,'backpack'))then
npcHandler:say("Ah, right, almost forgot about the backpack! Have you brought me 100 pieces of minotaur leather as requested?", cid)
talkState[talkUser]=2elseif(talkState[talkUser]==2and msgcontains(msg,'yes'))thenif(getPlayerItemCount(cid,5878)>=100)then
npcHandler:say("Great! Alright, I need a while to finish this backpack for you. Please, wait a minute...",cid)
addEvent(say,6000,getNpcCid(),"... a little more... I'm almost finishing...",cid)
addEvent(say,20000,getNpcCid(),"... Your backpack is finished. Here you go, I hope you like it.",cid)
doPlayerRemoveItem(cid,5878,100,true)if(getPlayerSex(cid)== PLAYERSEX_FEMALE)then
doPlayerAddOutfit(cid,136,1)else
doPlayerAddOutfit(cid,128,1)endelse
npcHandler:say("Sorry, you dont have all items.",cid)end
talkState[talkUser]=0else
npcHandler:say('...?',cid)endreturntrueend
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
info
Grupo: Herói
Registrado: 07/03/16
Posts: 1.4k
Reputação: +385
Gênero: Masculino
Lubo.xml
Lubo.lua
Editado Agosto 31 por Poccnn