Tipo do script:Não sei
Protocolo (versão do Tibia): 9.10
Servidor utilizado:4Fun
Nível de experiência:Mediana ou menos.
Adicionais/Informações:Gostaria de um script em que um npc desse promotion apenas por 100 half-eaten brain ( id=10576).
Fiz um mas está totalmente errado eu sei. E não funciona . Por isso quero ajuda.
O meu:
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
if(msgcontains(msg, 'promot') or msgcontains(msg, 'promo')) then
if isPremium(cid) then
if getPlayerItemCount(cid, 10576) >= 100 then
selfSay('Do you wanna promote yourself to Experient Human , for 100 half-eaten brain?', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'no') and talkState[talkUser] == 1) then
selfSay('Come back when you have 100 half-eaten brain.', cid)
end
else
selfSay('Sorry, you need a premium account to get promotion.', cid)
end
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if doPlayerTakeItem(cid, 10576, 100)== 1 then
selfSay('/send '.. creatureGetName(cid) ..', cid)
selfSay('Now you are promoted.', cid)
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())