Ir para conteúdo
  • 0

[Resolvido] Conflito no sistema de Addon e HM!


boxxer321

Pergunta

Galera, estou com um pequeno conflito entre esses dois sistemas... o que acontece, o sistema de HM libera uma outfit por exemplo no RIDE, assim como nessa linha:

Spoiler

rideItem = { -- HM Ride
["Tauros"] = {outfit = 128, speed = 960},

 

porém, com o sistema de addon, no ride, TAMBÉM, libera uma outfit e fica dando esse conflito, o pokémon não fica com o addon na hora do RIDE e sim, a da outfit do HM! linha do addon:

Spoiler

     [15512] = {stor = 200013, addon = 1824, spec = 1825}, -- Tauros 1

 

queria saber se tem alguma forma de por no sistema que caso o pokémon tiver o addon, prevalecer a outfit de certo addon!

 

 

actions/addon:

Spoiler

function eraseAllOutfits(cid, summon)
     for id1, id2 in pairs(itensAddons) do
       local a = {"addon", "addon2", "addon3", "addon4", "addon5", "addon6", "addon7"}
          for i = 1, #a do 
           if getItemAttribute(getPlayerSlotItem(cid, 8).uid, a) == id2.addon then 
             setPlayerStorageValue(cid, id2.stor, 1)
             setPlayerStorageValue(cid, pokeAddons[getCreatureName(summon)].default, 1)
           else
             setPlayerStorageValue(cid, pokeAddons[getCreatureName(summon)].default, 1)  
          end
          end
      end
      
  setPlayerStorageValue(cid, storages.addonSystem, "")
  
setPlayerStorageValue(cid, 130390, -1)
     setPlayerStorageValue(cid, 130389, -1)
  setPlayerStorageValue(cid, 15024, 1)
  for i = 181612, 181638 do 
   if getPlayerStorageValue(cid, i) >= 1 then
      setPlayerStorageValue(cid, storages.addonSystem, getPlayerStorageValue(cid, storages.addonSystem)..","..i)
      setPlayerStorageValue(cid, i, 0)
   end
  end
  for j = 100, 111 do
     if getPlayerStorageValue(cid, j) >= 1 then
      setPlayerStorageValue(cid, storages.addonSystem, getPlayerStorageValue(cid, storages.addonSystem)..","..j)
      setPlayerStorageValue(cid, j, 0)
   end
  end
     if pokeAddons[getCreatureName(summon)] then
        doPlayerSendOutfitWindow(cid)
     end
  --doPlayerSendTextMessage(cid, 20, getPlayerStorageValue(cid, storages.addonSystem)) 
end


function onUse(cid, item, frompos, item2, topos)
if tonumber(getPlayerStorageValue(cid, storages.addonSystem3)) and getPlayerStorageValue(cid, storages.addonSystem3) <= 0 then setPlayerStorageValue(cid, storages.addonSystem3, "") end
local pk = getCreatureSummons(cid)
if isSummon(item2.uid) then
  if isPlayerSummon(cid, item2.uid) then 
  if item.itemid == 13075 then
    if not pokeAddons[getCreatureName(pk[1])] then
       return doPlayerSendTextMessage(cid, 27, "This pokemon don't have any addons.")
    end 
      eraseAllOutfits(cid, item2.uid)
     --doPlayerSendTextMessage(cid, 20, getPlayerStorageValue(cid, storages.addonSystem3)) 
  return true
  end

   for id1, id2 in pairs(itensAddons) do
     if item.itemid == id1 then
       if not pokeAddons[getCreatureName(pk[1])] then return doPlayerSendCancel(cid, "Sorry, this itens no belong in the your pokemon.") end
       if not isInArray(pokeAddons[getCreatureName(pk[1])].itens, item.itemid) then
          return doPlayerSendCancel(cid, "Sorry, this itens no belong in the your pokemon.")
       end
        setPlayerStorageValue(cid, storages.addonSystem3, getPlayerStorageValue(cid, storages.addonSystem3)..","..id2.stor)
       
        local a = {"addon", "addon2", "addon3", "addon4", "addon5", "addon6", "addon7"}
          for i = 1, #a do 
           if getItemAttribute(getPlayerSlotItem(cid, 8).uid, a) == id2.addon then 
              return doPlayerSendTextMessage(cid, 27, "This pokemon having this addon.")
           end
          end
          
         if not getItemAttribute(getPlayerSlotItem(cid, 8).uid, "addon") then
            doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "addon", id2.addon)
            doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "spec", id2.spec)
            doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "addonName", getItemNameById(id1))
         elseif not getItemAttribute(getPlayerSlotItem(cid, 8).uid, "addon2") then
            doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "addon2", id2.addon)
            doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "spec2", id2.spec)
            doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "addonName2", getItemNameById(id1))
         elseif not getItemAttribute(getPlayerSlotItem(cid, 8).uid, "addon3") then
            doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "addon3", id2.addon)
            doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "spec3", id2.spec)
            doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "addonName3", getItemNameById(id1))
         elseif not getItemAttribute(getPlayerSlotItem(cid, 8).uid, "addon4") then
            doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "addon4", id2.addon)
            doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "spec4", id2.spec)
            doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "addonName4", getItemNameById(id1))
         elseif not getItemAttribute(getPlayerSlotItem(cid, 8).uid, "addon5") then
            doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "addon5", id2.addon)
            doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "spec5", id2.spec)
            doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "addonName5", getItemNameById(id1))
         elseif not getItemAttribute(getPlayerSlotItem(cid, 8).uid, "addon6") then
            doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "addon6", id2.addon)
            doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "spec6", id2.spec)
            doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "addonName6", getItemNameById(id1))
         elseif not getItemAttribute(getPlayerSlotItem(cid, 8).uid, "addon7") then
            doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "addon7", id2.addon)
            doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "spec7", id2.spec)
            doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "addonName7", getItemNameById(id1))
         end
            doSendMagicEffect(getThingPos(item2.uid), 29)
            doPlayerSendTextMessage(cid, 27, "Congrulations, your pokemon have now a "..getItemNameById(id1)..".")
            eraseAllOutfits(cid, item2.uid)
            --doCreatureChangeOutfit(pk[1], {lookType = id2.addon}) 
            doRemoveItem(item.uid, 1)
        return true
     end
   end
   
   else
      doPlayerSendCancel(cid, "Sorry, use this itens only your pokemons.")
      return true     
   end
   else
      doPlayerSendCancel(cid, "Sorry, use this itens in only pokemons.")
      return true
   end         
    
return true
end

 

 

actions/hm:

Spoiler

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if isCreature(itemEx.uid) then
        return doPlayerSendCancel(cid, "Use in your pokeball.")
    elseif not getItemAttribute(itemEx.uid, "poke") then
        return doPlayerSendCancel(cid, "Use in your pokeball with your pokemon.")
    elseif not rideItem[getItemAttribute(itemEx.uid, "poke")] then
        return doPlayerSendCancel(cid, "This pokemon can not learn this HM.")
    elseif getItemAttribute(getPlayerSlotItem(cid, 8).uid, "cutItem") or getItemAttribute(getPlayerSlotItem(cid, 8).uid, "rideItem") or getItemAttribute(getPlayerSlotItem(cid, 8).uid, "flyItem") or getItemAttribute(getPlayerSlotItem(cid, 8).uid, "smashItem") or getItemAttribute(getPlayerSlotItem(cid, 8).uid, "flashItem") or getItemAttribute(getPlayerSlotItem(cid, 8).uid, "surfItem") then
        return doPlayerSendCancel(cid, "This pokemon has already learned an HM.")
    elseif getItemAttribute(getPlayerSlotItem(cid, 8).uid, "ehditto") or getItemAttribute(getPlayerSlotItem(cid, 8).uid, "ehshinyditto") then
        return doPlayerSendCancel(cid, "This pokemon does not accept HMs.")
    end
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your pokemon has learned HM04 RIDE.")
    doItemSetAttribute(itemEx.uid, "rideItem", true)
    doRemoveItem(item.uid, 1)
    return true
end

 

Link para o comentário
Compartilhar em outros sites

Posts Recomendados

Visitante
Este tópico está impedido de receber novos posts.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...