Por favor gente.
Me mandem um script pra ot 8.50 que o npc troca itens por itens
ou seja, ele troca blessed shield por magic plate armor ou sei la... plzzz
Vlw
Por favor gente.
Me mandem um script pra ot 8.50 que o npc troca itens por itens
ou seja, ele troca blessed shield por magic plate armor ou sei la... plzzz
Vlw
Ae eu tenho um no meu ot ,
é 8.5 e funciona!
Ot/data/npc copie qualquer script, renomeie pra trocadeitens , apague tud o que estiver dentro, e cole isto:
<?xml version="1.0" encoding="UTF-8"?> <npc name="Nome do Npc" script="data/npc/scripts/troca.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="332" head="0" body="0" legs="0" feet="0"/> <parameters> <parameter key="message_greet" value="Aqui voce bota uma msg que voce quiser, poder ser informando os itens que poder sem trocados , voce escolhe" /> </parameters> </npc>
depois em data/npc/scripts , copie qualquer script, renomeie pra troca , apague tud o que estiver dentro, e cole isto:
local talk_state = 0 local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 msgcontains(msg, 'nome do item') then if getPlayerItemCount(cid,6512) >= 1 then if doPlayerRemoveItem(cid,6512,1) then doPlayerAddItem(cid,1990,1) npcHandler:say('mensagem quando o item é trocado.') end else npcHandler:say('mensagem quando o player nao tem o item') talk_state = 0 end elseif msgcontains(msg, 'bye') then npcHandler:say('Até mais, ' .. getCreatureName(cid) .. '! Volte em breve...') talk_state = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
explicando:
aonde ta ali "nome do item" é o que o player vai falar pra trocar os items!
if getPlayerItemCount(cid,6512) >= 1 then << aqi voce muda o id do item que o player precisa ter, e 1 then é a quantidade
if doPlayerRemoveItem(cid,6512,1) then << aqi pra remover o item, e a quantidade
doPlayerAddItem(cid,1990,1) << aqi o tem que o player irá ganhar na troca
ai voce muda pra o que voce quiser.
Espero ter ajudado!
^^
Ae eu tenho um no meu ot ,
é 8.5 e funciona!
Ot/data/npc copie qualquer script, renomeie pra trocadeitens , apague tud o que estiver dentro, e cole isto:
<?xml version="1.0" encoding="UTF-8"?> <npc name="Nome do Npc" script="data/npc/scripts/troca.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="332" head="0" body="0" legs="0" feet="0"/> <parameters> <parameter key="message_greet" value="Aqui voce bota uma msg que voce quiser, poder ser informando os itens que poder sem trocados , voce escolhe" /> </parameters> </npc>
depois em data/npc/scripts , copie qualquer script, renomeie pra troca , apague tud o que estiver dentro, e cole isto:
local talk_state = 0 local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 msgcontains(msg, 'nome do item') then if getPlayerItemCount(cid,6512) >= 1 then if doPlayerRemoveItem(cid,6512,1) then doPlayerAddItem(cid,1990,1) npcHandler:say('mensagem quando o item é trocado.') end else npcHandler:say('mensagem quando o player nao tem o item') talk_state = 0 end elseif msgcontains(msg, 'bye') then npcHandler:say('Até mais, ' .. getCreatureName(cid) .. '! Volte em breve...') talk_state = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
explicando:
aonde ta ali "nome do item" é o que o player vai falar pra trocar os items!
if getPlayerItemCount(cid,6512) >= 1 then << aqi voce muda o id do item que o player precisa ter, e 1 then é a quantidade
if doPlayerRemoveItem(cid,6512,1) then << aqi pra remover o item, e a quantidade
doPlayerAddItem(cid,1990,1) << aqi o tem que o player irá ganhar na troca
ai voce muda pra o que voce quiser.
Espero ter ajudado!
^^
Muito Obrigado, funcionou muito bem aqui.
Pedido entregue, tópico reportado.
Abraços.
luisfe23 here
Movido para Pedidos Atendidos!
Chat do B@r: group884066@groupsim.com
Gifts: Kaonic, Kaonic, XMapping5, XMapping6, XMapping7, XMapping8, XMapping9, XMapping10, CEM#1, Lais
Contato:
Email: [email protected]
Twitter:
@Alissow
Acesse: www.sotserv.blogspot.com
Movido para Pedidos Atendidos!
Que bom que funcionou!
cara e c for assim trocar varios itens por apenas um
exemplo 5 fire sword, 3 magma boots, 4 tome of knowledge por 1 elite draken helmet
o q teria q mudar ?
Cara você reviveu um tópico muito antigo,não faça mais isso amigo tópicos com guest de 30 dias já são antigos!
Reportado.
Eu Ja Tentei Mais Nao Consegui Tem Como Modificar
Ele Para Vender Tipow 3 Itens Diferentes
ex : Fire Sword, Demon Shield E BOH por Um Demon Armor ?
Muda Ele Pra Mim Que Te Do Um REP +
Gostaria de Saber como eu faço para adicionar mais itens para a troca ..
Rep++