- 0
pedido scripts NPC De Runas
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.
-
Conteúdo Similar
-
- 5 respostas
- 1757 visualizações
-
- 1 resposta
- 1331 visualizações
-
- 1 resposta
- 1355 visualizações
-
- 0 respostas
- 1359 visualizações
-
- 0 respostas
- 1277 visualizações
-
Pergunta
francklezinho 0
Boooa noite galera .. , seguinte se alguem puder me ajudar com o meu problema ficarei muito gratooo OTserv versao 7.4 / 7.72
Problema: meu npc de runa só vende de 1 em 1 bp de life fluid ou mana fluid .. , queria colocar ele pra vender tipo varias ..
Exemplo: o player quer compra 10 bp de lf de uma vez ... e o npc vai la e vende .. entenderam?
NPC:
-------------------
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
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
-- OTServ event handling functions end
function creatureSayCallback(cid, type, msg)
if not npcHandler:isFocused(cid) then
return false
end
if msgcontains(msg, 'bp of lf') or msgcontains(msg, 'bp of life fluid') or msgcontains(msg, 'bp lf') then
npcHandler:say('Do you want to buy a backpack of explosion rune for 1200 gold coins?')
talk_state = 5
elseif msgcontains(msg, 'yes') and talk_state == 5 then
if getPlayerMoney(cid) >= 1200 then
purple2_bp = doPlayerAddItem(cid, 2000, 1)
doAddContainerItem(purple2_bp, 2006, 10)
doAddContainerItem(purple2_bp, 2006, 10)
doAddContainerItem(purple2_bp, 2006, 10)
doAddContainerItem(purple2_bp, 2006, 10)
doAddContainerItem(purple2_bp, 2006, 10)
doAddContainerItem(purple2_bp, 2006, 10)
doAddContainerItem(purple2_bp, 2006, 10)
doAddContainerItem(purple2_bp, 2006, 10)
doAddContainerItem(purple2_bp, 2006, 10)
doAddContainerItem(purple2_bp, 2006, 10)
doAddContainerItem(purple2_bp, 2006, 10)
doAddContainerItem(purple2_bp, 2006, 10)
doAddContainerItem(purple2_bp, 2006, 10)
doAddContainerItem(purple2_bp, 2006, 10)
doAddContainerItem(purple2_bp, 2006, 10)
doAddContainerItem(purple2_bp, 2006, 10)
doAddContainerItem(purple2_bp, 2006, 10)
doAddContainerItem(purple2_bp, 2006, 10)
doAddContainerItem(purple2_bp, 2006, 10)
doAddContainerItem(purple2_bp, 2006, 10)
doPlayerRemoveMoney(cid, 1200)
npcHandler:say('Thank you for buying.')
talk_state = 0
else
npcHandler:say('You don\'t have enough money.')
talk_state = 0
end
end
if msgcontains(msg, 'bp of mf') or msgcontains(msg, 'bp of manafluid') or msgcontains(msg, 'bp mf') then
npcHandler:say('Do you want to buy a backpack of mana fluid for 2000 gold coins?')
talk_state = 6
elseif msgcontains(msg, 'yes') and talk_state == 6 then
if getPlayerMoney(cid) >= 2000 then
brown_bp = doPlayerAddItem(cid, 2001, 1)
doAddContainerItem(brown_bp, 2006, 7)
doAddContainerItem(brown_bp, 2006, 7)
doAddContainerItem(brown_bp, 2006, 7)
doAddContainerItem(brown_bp, 2006, 7)
doAddContainerItem(brown_bp, 2006, 7)
doAddContainerItem(brown_bp, 2006, 7)
doAddContainerItem(brown_bp, 2006, 7)
doAddContainerItem(brown_bp, 2006, 7)
doAddContainerItem(brown_bp, 2006, 7)
doAddContainerItem(brown_bp, 2006, 7)
doAddContainerItem(brown_bp, 2006, 7)
doAddContainerItem(brown_bp, 2006, 7)
doAddContainerItem(brown_bp, 2006, 7)
doAddContainerItem(brown_bp, 2006, 7)
doAddContainerItem(brown_bp, 2006, 7)
doAddContainerItem(brown_bp, 2006, 7)
doAddContainerItem(brown_bp, 2006, 7)
doAddContainerItem(brown_bp, 2006, 7)
doAddContainerItem(brown_bp, 2006, 7)
doAddContainerItem(brown_bp, 2006, 7)
doPlayerRemoveMoney(cid, 2000)
npcHandler:say('Thank you for buying.')
talk_state = 0
else
npcHandler:say('You don\'t have enough money.')
talk_state = 0
end
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Obrigado e aguardo respostas.
Link para o comentário
Compartilhar em outros sites
1 resposta a esta questão
Posts Recomendados