Ir para conteúdo
  • Cadastre-se

(Resolvido)Mudar Elemento dá Wand por Item


Ir para solução Resolvido por gabrielzika,

Posts Recomendados

Já procurei aqui no fórum mais só encontrei por Talkactions, alguém poderia fazer por Actions ? por 1 item que mudaria o elemento dá wand.

Cada pedra que a pessoa usasse seria um elemento diferente. Alguém por favor poderia ajudar ?

 

Obrigado desde de já.

Link para o post
Compartilhar em outros sites
  • Respostas 49
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

@Gabrielk  function onUse(cid, item, fromPos, itemEx, toPos) ItemFire = 13743 -- ID dos Itens que precisa pra cada efeito... by: garden ItemIce = 13744 ItemEarth = 13745 ItemDeath = 13746 ItemEne

@Gabrielk ai Mano function onUse(cid, item, fromPos, itemEx, toPos) ItemFire = 13743 -- ID dos Itens que precisa pra cada efeito... by: garden ItemIce = 13744 ItemPoison = 13745 ItemDeath = 13746

function onUse(cid, item, fromPos, itemEx, toPos) ItemFire = 13743 -- ID dos Itens que precisa pra cada efeito... by: garden ItemIce = 13744 ItemPoison = 13745 ItemDeath = 13746 ItemEnergy = 13747 It

Manda o Link da que é Por Talkactions, pra mim entender oque você tá querendo :3

Link para o post
Compartilhar em outros sites

@Gabrielk 

function onUse(cid, item, fromPos, itemEx, toPos)

ItemFire = 13743 -- ID dos Itens que precisa pra cada efeito... by: garden
ItemIce = 13744
ItemEarth = 13745
ItemDeath = 13746
ItemEnergy = 13747
ItemHoly = 13748

local wandEffect = {
      [ItemFire] = {effect = 12031, name = "fire"},  -- [ItemID] = {effect = Numero do Efeito, name = Nome do Efeito}
      [ItemIce] = {effect = 12032, name = "ice"},
      [ItemEarth] = {effect = 12033, name = "earth"},
      [ItemDeath] = {effect = 12034, name = "death"},
      [ItemEnergy] = {effect = 12035, name = "energy"},
      [ItemHoly] = {effect = 12036, name = "holy"}
}

local id = 7735 --- aqui vai o id da wand
if getPlayerItemCount(cid, id) == 0 then
doPlayerSendTextMessage(cid, 27, "Desculpe, mais você precisa ter a "..getItemNameById(id).." para trocar o elemento.")
return true
end

status = getPlayerStorageValue(cid, wandEffect[item.itemid].effect)
if status == 1 then
doPlayerSendTextMessage(cid, 27, "Desculpe, mais você já está usando o efeito ".. wandEffect[item.itemid].name .. ".")
return true
end
 
setPlayerStorageValue(cid, 12031, 0)
setPlayerStorageValue(cid, 12032, 0)
setPlayerStorageValue(cid, 12033, 0)
setPlayerStorageValue(cid, 12034, 0)
setPlayerStorageValue(cid, 12035, 0)
setPlayerStorageValue(cid, 12036, 0)
setPlayerStorageValue(cid, wandEffect[item.itemid].effect, 1)
doPlayerSendTextMessage(cid, 27 , "Você mudou o elemento da wand para ".. wandEffect[item.itemid].name .. ".")
doRemoveItem(item.uid, 1)
return true
end

 

<action itemid="13743;13744;13745;13746;13747;13748" event="script" value="NomeDoArquivo.lua" blockwalls="1"/>

 

Editado por gabrielzika (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Então mano @gabrielzika, rep+ para ti. mais não funcionou eu tentei mais não bate nada. Eu acho que é o script que eu te mandei o link que tá com problema. Eu testei esse outro. Se puder adaptar eu agradeço mano

http://www.tibiaking.com/forum/forums/topic/50972-wand-of-elements/

Link para o post
Compartilhar em outros sites
  • Solução

@Gabrielk ai Mano

function onUse(cid, item, fromPos, itemEx, toPos)

ItemFire = 13743 -- ID dos Itens que precisa pra cada efeito... by: garden
ItemIce = 13744
ItemPoison = 13745
ItemDeath = 13746
ItemEnergy = 13747
ItemPhysical = 13748
ItemHoly = 13749
id = 7735 --- aqui vai o id da wand

types = {
      [ItemFire] = {effect = 1, name = "fire"},  -- [ItemID] = {effect = Numero do Efeito, name = Nome do Efeito}
      [ItemIce] = {effect = 2, name = "ice"},
      [ItemPoison] = {effect = 3, name = "poison"},
      [ItemDeath] = {effect = 4, name = "death"},
      [ItemEnergy] = {effect = 5, name = "energy"},
      [ItemPhysical] = {effect = 6, name = "energy"},
      [ItemHoly] = {effect = 7, name = "holy"}
}

    local wand_left = getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid
    local wand_right = getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid 

    if wand_left ~= id and wand_right ~= id then
        doPlayerSendCancel(cid, "Voce deve estar equipado com uma ".. getItemNameById(id) .." para usar este efeito.")
        return true
    end
    
    status = getPlayerStorageValue(cid, 4561)
    if status == types[item.itemid].effect then
        doPlayerSendTextMessage(cid, 27, "Desculpe, mais você já está usando o efeito ".. types[item.itemid].name .. ".")
        return true
    end

     setPlayerStorageValue(cid, 4561, types[item.itemid].effect)
     doPlayerSendTextMessage(cid, 27 , "Você mudou o elemento da wand para ".. types[item.itemid].name .. ".")
     doRemoveItem(item.uid, 1)
   return true
end

 

xml

 

<action itemid="13743;13744;13745;13746;13747;13748;13749" event="script" value="NomeDoArquivo.lua" blockwalls="1"/>

 

Link para o post
Compartilhar em outros sites
function onUse(cid, item, fromPos, itemEx, toPos)

ItemFire = 13743 -- ID dos Itens que precisa pra cada efeito... by: garden
ItemIce = 13744
ItemPoison = 13745
ItemDeath = 13746
ItemEnergy = 13747
ItemPhysical = 13748
ItemHoly = 13749
  
local types = {
      [ItemFire] = {effect = 1, name = "fire"},  -- [ItemID] = {effect = Numero do Efeito, name = Nome do Efeito}
      [ItemIce] = {effect = 2, name = "ice"},
      [ItemPoison] = {effect = 3, name = "poison"},
      [ItemDeath] = {effect = 4, name = "death"},
      [ItemEnergy] = {effect = 5, name = "energy"},
      [ItemPhysical] = {effect = 6, name = "energy"},
      [ItemHoly] = {effect = 7, name = "holy"}
}

local wandid1 = 7735 -- ID da Wand 1 
local wandid2 = 7736 -- ID da Wand 2 
local wandid3 = 7737 -- ID da Wand 3
local wandid4 = 7738 -- ID da Wand 4
local wandid5 = 7739 -- ID da Wand 5


    local wand_left = getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid
    local wand_right = getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid 
	
	local wands1 = wand_left ~= wandid1 and wand_right ~= wandid1
	local wands2 = wand_left ~= wandid2 and wand_right ~= wandid2
    local wands3 = wand_left ~= wandid3 and wand_right ~= wandid3
	local wands4 = wand_left ~= wandid4 and wand_right ~= wandid4
	local wands5 = wand_left ~= wandid5 and wand_right ~= wandid5

    if wands1 or wands2 or wands3 or wands4 or wands5 then
        doPlayerSendCancel(cid, "Voce deve estar com a wand equipada para usar este efeito.")
        return true
    end
    
    status = getPlayerStorageValue(cid, 4561)
    if status == types[item.itemid].effect then
        doPlayerSendTextMessage(cid, 27, "Desculpe, mais você já está usando o efeito ".. types[item.itemid].name .. ".")
        return true
    end

     setPlayerStorageValue(cid, 4561, types[item.itemid].effect)
     doPlayerSendTextMessage(cid, 27 , "Você mudou o elemento da wand para ".. types[item.itemid].name .. ".")
     doRemoveItem(item.uid, 1)
   return true
end

 

 

@Gabrielk

Link para o post
Compartilhar em outros sites

@Gabrielk vc tem que estar com a wand equipada

Link para o post
Compartilhar em outros sites

@Gabrielk me manda a tag que vc colocou no arquivo .xml

Link para o post
Compartilhar em outros sites

@Gabrielk mais fácil, me manda todas alterações que você fez... xml e o arquivo lua

Link para o post
Compartilhar em outros sites

@gabrielzika 

Spoiler

function onUse(cid, item, fromPos, itemEx, toPos)

ItemFire = 12601 -- ID dos Itens que precisa pra cada efeito... by: garden
ItemIce = 12429
ItemPoison = 12599
ItemDeath = 12367
ItemEnergy = 12383
ItemPhysical = 13748
ItemHoly = 12602

  
local types = {
      [ItemFire] = {effect = 1, name = "fire"},  -- [ItemID] = {effect = Numero do Efeito, name = Nome do Efeito}
      [ItemIce] = {effect = 2, name = "ice"},
      [ItemPoison] = {effect = 3, name = "poison"},
      [ItemDeath] = {effect = 4, name = "death"},
      [ItemEnergy] = {effect = 5, name = "energy"},
      [ItemPhysical] = {effect = 6, name = "energy"},
      [ItemHoly] = {effect = 7, name = "holy"}
}

local wandid1 = 7735 -- ID da Wand 1 
local wandid2 = 12671 -- ID da Wand 2 
local wandid3 = 12672 -- ID da Wand 3
local wandid4 = 12673 -- ID da Wand 4
local wandid5 = 12674 -- ID da Wand 5
local wandid6 = 12675 -- ID da Wand 6
local wandid7 = 12676 -- ID da Wand 7
local wandid8 = 12677 -- ID da Wand 8
local wandid9 = 12678 -- ID da Wand 9
local wandid10 = 12679 -- ID da Wand 10


    local wand_left = getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid
    local wand_right = getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid 
    
    local wands1 = wand_left ~= wandid1 and wand_right ~= wandid1
    local wands2 = wand_left ~= wandid2 and wand_right ~= wandid2
    local wands3 = wand_left ~= wandid3 and wand_right ~= wandid3
    local wands4 = wand_left ~= wandid4 and wand_right ~= wandid4
    local wands5 = wand_left ~= wandid5 and wand_right ~= wandid5
    local wands6 = wand_left ~= wandid6 and wand_right ~= wandid6
    local wands7 = wand_left ~= wandid7 and wand_right ~= wandid7
    local wands8 = wand_left ~= wandid8 and wand_right ~= wandid8
    local wands9 = wand_left ~= wandid9 and wand_right ~= wandid9
    local wands10 = wand_left ~= wandid10 and wand_right ~= wandid10

    if wands1 or wands2 or wands3 or wands4 or wands5 or wands6 or wands7 or wands8 or wands9 or wands10 then
        doPlayerSendCancel(cid, "Voce deve estar com a wand equipada para usar este efeito.")
        return true
    end
    
    status = getPlayerStorageValue(cid, 4561)
    if status == types[item.itemid].effect then
        doPlayerSendTextMessage(cid, 27, "Desculpe, mais você já está usando o efeito ".. types[item.itemid].name .. ".")
        return true
    end

     setPlayerStorageValue(cid, 4561, types[item.itemid].effect)
     doPlayerSendTextMessage(cid, 27 , "Você mudou o elemento da wand para ".. types[item.itemid].name .. ".")
     doRemoveItem(item.uid, 1)
   return true
end

<action itemid="12601;12602;12367;12383;12429;12425;12599" event="script" value="elementwand.lua" blockwalls="1"/>

 

Link para o post
Compartilhar em outros sites

@Gabrielk

 

manda a id de todas as wands q você quer usar ai e os ids de todos os itens que dão efeitos... id do item mais o nome do efeito q ele dá na frente...

Link para o post
Compartilhar em outros sites

os items e seus efeitos :

ItemFire = 12601
ItemIce = 12429
ItemPoison = 12599
ItemDeath = 12367
ItemEnergy = 12383
ItemPhysical = 13748
ItemHoly = 12602

 

os Ids das wands são esses :

 

local wandid1 = 7735 -- ID da Wand 1 
local wandid2 = 12671 -- ID da Wand 2 
local wandid3 = 12672 -- ID da Wand 3
local wandid4 = 12673 -- ID da Wand 4
local wandid5 = 12674 -- ID da Wand 5
local wandid6 = 12675 -- ID da Wand 6
local wandid7 = 12676 -- ID da Wand 7
local wandid8 = 12677 -- ID da Wand 8
local wandid9 = 12678 -- ID da Wand 9
local wandid10 = 12679 -- ID da Wand 10

 

@gabrielzika

Link para o post
Compartilhar em outros sites

@Gabrielk

 

<action itemid="12601;12602;12367;12383;12429;13748;12599" event="script" value="elementwand.lua" blockwalls="1"/>

 

function onUse(cid, item, fromPos, itemEx, toPos)

ItemFire = 12601 -- ID dos Itens que precisa pra cada efeito... by: garden
ItemIce = 12429
ItemPoison = 12599
ItemDeath = 12367
ItemEnergy = 12383
ItemPhysical = 13748
ItemHoly = 12602

  
local types = {
      [ItemFire] = {effect = 1, name = "fire"},  -- [ItemID] = {effect = Numero do Efeito, name = Nome do Efeito}
      [ItemIce] = {effect = 2, name = "ice"},
      [ItemPoison] = {effect = 3, name = "poison"},
      [ItemDeath] = {effect = 4, name = "death"},
      [ItemEnergy] = {effect = 5, name = "energy"},
      [ItemPhysical] = {effect = 6, name = "energy"},
      [ItemHoly] = {effect = 7, name = "holy"}
}

local wandid1 = 7735 -- ID da Wand 1 
local wandid2 = 12671 -- ID da Wand 2 
local wandid3 = 12672 -- ID da Wand 3
local wandid4 = 12673 -- ID da Wand 4
local wandid5 = 12674 -- ID da Wand 5
local wandid6 = 12675 -- ID da Wand 6
local wandid7 = 12676 -- ID da Wand 7
local wandid8 = 12677 -- ID da Wand 8
local wandid9 = 12678 -- ID da Wand 9
local wandid10 = 12679 -- ID da Wand 10


    local wand_left = getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid
    local wand_right = getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid 
    
    local wands1 = wand_left ~= wandid1 and wand_right ~= wandid1
    local wands2 = wand_left ~= wandid2 and wand_right ~= wandid2
    local wands3 = wand_left ~= wandid3 and wand_right ~= wandid3
    local wands4 = wand_left ~= wandid4 and wand_right ~= wandid4
    local wands5 = wand_left ~= wandid5 and wand_right ~= wandid5
    local wands6 = wand_left ~= wandid6 and wand_right ~= wandid6
    local wands7 = wand_left ~= wandid7 and wand_right ~= wandid7
    local wands8 = wand_left ~= wandid8 and wand_right ~= wandid8
    local wands9 = wand_left ~= wandid9 and wand_right ~= wandid9
    local wands10 = wand_left ~= wandid10 and wand_right ~= wandid10

    if wands1 or wands2 or wands3 or wands4 or wands5 or wands6 or wands7 or wands8 or wands9 or wands10 then
        doPlayerSendCancel(cid, "Voce deve estar com a wand equipada para usar este efeito.")
        return true
    end
    
    status = getPlayerStorageValue(cid, 4561)
    if status == types[item.itemid].effect then
        doPlayerSendTextMessage(cid, 27, "Desculpe, mais você já está usando o efeito ".. types[item.itemid].name .. ".")
        return true
    end

     setPlayerStorageValue(cid, 4561, types[item.itemid].effect)
     doPlayerSendTextMessage(cid, 27 , "Você mudou o elemento da wand para ".. types[item.itemid].name .. ".")
     doRemoveItem(item.uid, 1)
   return true
end

 

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.


×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo