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 09:53
Tom.xml
<?xml version="1.0" encoding="UTF-8"?><npcname="Tom"script="data/npc/scripts/Rookgaard/Tom.lua"walkinterval="2000"floorchange="0"><healthnow="100"max="100"/><looktype="144"head="113"body="115"legs="115"feet="115"addons="0"/><parameters><parameterkey="message_greet"value="Hey there, |PLAYERNAME|. I'm Tom the tanner. If you have fresh corpses, leather or paws, trade with me."/><parameterkey="message_farewell"value="Good bye."/><parameterkey="message_walkaway"value="D'oh?"/><parameterkey="message_idletimeout"value="D'oh?"/><parameterkey="message_sendtrade"value="Sure, check what I buy."/><parameterkey="module_shop"value="1"/><parameterkey="shop_sellable"value="bear paw,5896,10;dead rabbit,3119,2;dead rat,2813,2;dead wolf,2826,5;minotaur leather,5878,12;dead spider,2848,3;wolf paw,5897,7;"/><parameterkey="module_keywords"value="1"/><parameterkey="keywords"value="Oracle;Seymour;Cipfried;Tom;tanner;corpse;monster;sewer;troll;orc;Amber;Rookgaard;main;mainland;Obi;Dixi;Lily;Al Dee;wares;job;merchants;Lee'Delle;weapon;shield;Willie;Billy;Norma;"/><parameterkey="keyword_reply1"value="It's in the academy, just above {Seymour}. Go there once you are level 8 to leave this place."/><parameterkey="keyword_reply2"value="He sticks his nose too much in books."/><parameterkey="keyword_reply3"value="I'm not what you'd call a 'believer'."/><parameterkey="keyword_reply4"value="Yep."/><parameterkey="keyword_reply5"value="That's my job. It can be dirty at times but it provides enough income for my living."/><parameterkey="keyword_reply6"value="I'm buying fresh {corpses} of rats, rabbits and wolves. I don't buy half-decayed ones. If you have any for sale, {trade} with me."/><parameterkey="keyword_reply7"value="Good monsters to start with are rats. They live in the {sewers} under the village of {Rookgaard}."/><parameterkey="keyword_reply8"value="The nearest sewer entrance is just to the right of this building."/><parameterkey="keyword_reply9"value="Troll leather stinks. Can't use it."/><parameterkey="keyword_reply10"value="I don't buy orcs. Their skin is too scratchy."/><parameterkey="keyword_reply11"value="Now that's an interesting woman."/><parameterkey="keyword_reply12"value="This island has its own problems, but all in all it's a decent place to live."/><parameterkey="keyword_reply13"value="You can go there once you are level 8 and have talked to the {oracle}."/><parameterkey="keyword_reply14"value="You can go there once you are level 8 and have talked to the {oracle}."/><parameterkey="keyword_reply15"value="He is such a hypocrite."/><parameterkey="keyword_reply16"value="She buys my fine leather clothes."/><parameterkey="keyword_reply17"value="She always comes and preaches about how one should not wear animal skin."/><parameterkey="keyword_reply18"value="He's an apple polisher."/><parameterkey="keyword_reply19"value="I'm buying fresh {corpses} of rats, rabbits and wolves. I don't buy half-decayed ones. If you have any for sale, {trade} with me."/><parameterkey="keyword_reply20"value="I'm the local {tanner}. I buy fresh animal {corpses}, tan them, and convert them into fine leather clothes which I then sell to {merchants}."/><parameterkey="keyword_reply21"value="{Dixi} and {Lee'Delle} sell my leather clothes in their shops."/><parameterkey="keyword_reply22"value="Her nose is a little high in the air, I think. She never shakes my hand."/><parameterkey="keyword_reply23"value="Nope, sorry, don't sell that. Ask {Obi} or {Lee'Delle}."/><parameterkey="keyword_reply24"value="Nope, sorry, don't sell that. Ask {Dixi} or {Lee'Delle}."/><parameterkey="keyword_reply25"value="I kinda like him. At least he says what he thinks."/><parameterkey="keyword_reply26"value="He's a better cook than his cousin {Willie}, actually."/><parameterkey="keyword_reply27"value="I like her beer."/></parameters></npc>
Tom.lua
local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)local talkState,price ={},0function 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()endlocal shopModule = ShopModule:new()
npcHandler:addModule(shopModule)function creatureSayCallback(cid, type, msg)if(not npcHandler:isFocused(cid))thenreturnfalseendlocal talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and0or cid
if msgcontains(msg,'human')then
selfSay('Are you crazy?!', cid)
npcHandler:releaseFocus(cid)endreturntrueendfunction thinkCallback()
talk = math.random(1,200)if talk ==1then
doCreatureSay(getNpcCid(),"Oh yeah, I'm also interested in wolf paws and bear paws.", TALKTYPE_YELL)elseif talk ==2then
doCreatureSay(getNpcCid(),"Also buying minotaur leather.", TALKTYPE_YELL)elseif talk ==3then
doCreatureSay(getNpcCid(),"Buying fresh corpses of rats, rabbits and wolves.", TALKTYPE_YELL)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
Tom.xml
Tom.lua