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:25
Dermot.xml
<?xml version="1.0" encoding="UTF-8"?><npcname="Dermot"script="data/npc/scripts/Fibula/Dermot.lua"walkinterval="2000"floorchange="0"><healthnow="100"max="100"/><looktype="129"head="57"body="68"legs="38"feet="114"addons="0"/><parameters><parameterkey="message_greet"value="Hello, traveller |PLAYERNAME|. How can I help you?"/><parameterkey="message_farewell"value="See you again."/><parameterkey="message_needmoremoney"value="You need more money."/><parameterkey="message_sendtrade"value="...."/><parameterkey="message_onbuy"value="thank you."/><parameterkey="message_decline"value="No problem..."/><parameterkey="message_walkaway"value="Yeah, get lost."/><parameterkey="message_onsendtrade"value="Yeah, buy something."/><parameterkey="module_keywords"value="1"/><parameterkey="keywords"value="job;magistrate;name;time;fibula;dungeon;monsters;"/><parameterkey="keyword_reply1"value="I am the magistrate of this isle."/><parameterkey="keyword_reply2"value="Thats me."/><parameterkey="keyword_reply3"value="I am Dermot, the magistrate of this isle."/><parameterkey="keyword_reply4"value="Time is not important on Fibula."/><parameterkey="keyword_reply5"value="You are at Fibula. This isle is not very dangerous. Just the wolves bother outside the village."/><parameterkey="keyword_reply6"value="Oh, my god. In the dungeon of Fibula are a lot of monsters. That's why we have sealed it with a solid door."/><parameterkey="keyword_reply7"value="Oh, my god. In the dungeon of Fibula are a lot of monsters. That's why we have sealed it with a solid door."/><parameterkey="keyword_reply8"value=""/></parameters></npc>
Dermot.lua
local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)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()endlocal talkState,talkUser ={},0function creatureSayCallback(cid, type, msg)ifnot(npcHandler:isFocused(cid))thenreturnfalseendlocal msg = string.lower(msg)
talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and0or cid
if(msgcontains(msg,'door')or msgcontains(msg,'key'))then
npcHandler:say("Do you want to buy the dungeon key for 2000 gold?", cid)
talkState[talkUser]=1elseif(talkState[talkUser]==1)thenif(msgcontains(msg,'yes'))thenif(getPlayerMoney(cid)>=2000)thenlocal key = doCreateItemEx(2087)
doItemSetAttribute(key,"aid",3940)
doPlayerAddItemEx(cid, key)
doPlayerRemoveMoney(cid,2000)
npcHandler:say("Now you own the hot key.",cid)else
npcHandler:say("Hmm, I need 2000 gold piece.",cid)endelse
npcHandler:say("Hmm, maybe next time.",cid)end
talkState[talkUser]=0else
npcHandler:say('...?',cid)
talkState[talkUser]=0endreturntrueend
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
Dermot.xml
Dermot.lua