Ir para conteúdo

Featured Replies

Postado

Galera meu ot esta sem o Npc de bless e sem um npc especifico que compre todos os itens , se ninguém tiver ,eu preciso no causo do Npc que compre itens iniciais , itens que cai de cyc de drag e de bichos como rotworm . itens iniciais , se alguém tiver vou ficar muito grato ,ão tenho nem o npc que compra halberd . dai complica =/

 

obrigado

Postado

Amigo, sobre o NPC de vendas você mesmo pode criar facilmente com os itens que deseja, segue um exemplo:

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Vendedor De Itens" script="data/npc/scripts/default.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="134" head="39" body="114" legs="114" feet="85" addons="3"/>
    <parameters>
        <parameter key="module_shop" value="1"/>
        <parameter key="shop_buyable" value="Mace,7417,20;Halberd,8926,20;"/>
    </parameters>
</npc>

Ai é só copiar do nome até o ponto e vírgula:
Em vermelho é o nome do item.

Em azul é o ID do item.

Em verde é o preço do item.

 

O NPC de bless vou ver se consigo fazer pra você e já edito.

 

@Edit

Vá em "Data/npc/scripts" copie e cole um arquivo .lua e renomeie para bless.lua, apague tudo e cole:

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

-- All bless --
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
        return false
    end

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
msg = msg:lower();
local price = 10000 -- Preço de todas as bless.
     if msgcontains(msg, 'bless') then
        if getPlayerBlessing(cid,5) then
           selfSay('Você já tem todas as bless.', cid)
           return true
           else
        end   
            if doPlayerRemoveMoney(cid, price) == TRUE then
               selfSay('Você recebeu todas as bless', cid)
               for b = 1,5 do
               doPlayerAddBlessing(cid,b)
               end
            else
               selfSay('Você não tem '.. price ..' golds.', cid)
            end
     end        
end        
-- All bless --
       
local node1 = keywordHandler:addKeyword({'first bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the first blessing for 2000 (plus level depending amount) gold?'})
    node1:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 1, premium = true, baseCost = 2000, levelCost = 200, startLevel = 30, endLevel = 120})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})

local node2 = keywordHandler:addKeyword({'second bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the second blessing for 2000 (plus level depending amount) gold?'})
    node2:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 2, premium = true, baseCost = 2000, levelCost = 200, startLevel = 30, endLevel = 120})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})

local node3 = keywordHandler:addKeyword({'third bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the third blessing for 2000 (plus level depending amount) gold?'})
    node3:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 3, premium = true, baseCost = 2000, levelCost = 200, startLevel = 30, endLevel = 120})
    node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})

local node4 = keywordHandler:addKeyword({'fourth bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the fourth blessing for 2000 (plus level depending amount) gold?'})
    node4:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 4, premium = true, baseCost = 2000, levelCost = 200, startLevel = 30, endLevel = 120})
    node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})

local node5 = keywordHandler:addKeyword({'fifth bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the fifth blessing for 2000 (plus level depending amount) gold?'})
    node5:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 5, premium = true, baseCost = 2000, levelCost = 200, startLevel = 30, endLevel = 120})
    node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Depois em "Data/npcs" copie e cole um arquivo .xml renomeie para Blessman.xml, apague tudo e cole:

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Bless Man" script="data/npc/scripts/bless.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="132" head="0" body="114" legs="94" feet="0" addons="3"/>
    <parameters>
        <parameter key="module_shop" value="1"/>
        <parameter key="message_greet" value="Ola |PLAYERNAME|. Eu vendo bless, diga {bless}."/>
    </parameters>
</npc>

 

Esse tá configurado para duas maneiras, comprando manual uma por uma ou falando bless e comprando todas.

Não esqueça de mudar o valor do manual também e se quiser que eu retire é só falar.

Editado por Wakon (veja o histórico de edições)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.8k

Informação Importante

Confirmação de Termo