yerenix 1 Postado Março 9, 2014 Share Postado Março 9, 2014 Olá, eu gostaria de saber como posso fazer que la boost stone não trabalhe com o pokemons legendarios. Traductor: Hola, Quisiera saber como puedo hacer que la boost stone no funcione con los pokemones legendarios. Mi Boost Stone Script: function onUse(cid, item, topos, item2, frompos) local myball = getPlayerSlotItem(cid, 8) local boost = getItemAttribute(myball.uid, "boost") or 0 local boosts = 100 if boost == 1500 then doPlayerSendCancel(cid, "Your pokemon is already at maximum boost.") return true end if not isSummon(item2.uid) then doPlayerSendCancel(cid, "Use only in your pokemons.") return true end boosts = boosts local pokemon = getItemAttribute(myball.uid, "poke") local off = pokes[pokemon].offense * boost_rate * boosts local def = pokes[pokemon].defense * boost_rate * boosts local agi = pokes[pokemon].agility * boosts local spatk = pokes[pokemon].specialattack * boost_rate * boosts local vit = pokes[pokemon].vitality * boost_rate * boosts newBoost = boost + boosts if newBoost > 1500 then newBoost = 1500 end doSetItemAttribute(myball.uid, "boost", newBoost) doItemSetAttribute(myball.uid, "offense", getItemAttribute(myball.uid, "offense") + off) doItemSetAttribute(myball.uid, "defense", getItemAttribute(myball.uid, "defense") + def) doItemSetAttribute(myball.uid, "speed", getItemAttribute(myball.uid, "speed") + agi) doItemSetAttribute(myball.uid, "specialattack", getItemAttribute(myball.uid, "specialattack") + spatk) doItemSetAttribute(myball.uid, "vitality", getItemAttribute(myball.uid, "vitality") + vit) doRemoveItem(item.uid) doSendMagicEffect(getThingPos(item2.uid), 103) doPlayerSendTextMessage(cid, 27, "Congrulations, your "..pokemon..", as beem boosted +"..boosts..".") doPlayerSendTextMessage(cid, 27, "Now your "..pokemon.." have a boost +"..newBoost..".") doSendAnimatedText(getThingPos(item2.uid), "+"..boosts.." Boost", 215) return true end Gracias. Link para o comentário https://xtibia.com/forum/topic/229765-boost-stone-en-legendarios/ Compartilhar em outros sites More sharing options...
Killua 389 Postado Março 9, 2014 Share Postado Março 9, 2014 E como eu faço pra saber se um pokemon é legendário? Só pelo nome? Link para o comentário https://xtibia.com/forum/topic/229765-boost-stone-en-legendarios/#findComment-1620784 Compartilhar em outros sites More sharing options...
yerenix 1 Postado Março 9, 2014 Autor Share Postado Março 9, 2014 (editado) Sim como Moltres, Articuno,Zapdos e muito mas Editado Março 9, 2014 por Yerenzitop Link para o comentário https://xtibia.com/forum/topic/229765-boost-stone-en-legendarios/#findComment-1620810 Compartilhar em outros sites More sharing options...
Killua 389 Postado Março 9, 2014 Share Postado Março 9, 2014 function onUse(cid, item, topos, item2, frompos) local myball = getPlayerSlotItem(cid, 8) local boost = getItemAttribute(myball.uid, "boost") or 0 local boosts = 100 local legendary = {"Moltress", "Zapdos", "Articuno"} if boost == 1500 then doPlayerSendCancel(cid, "Your pokemon is already at maximum boost.") return true end if not isSummon(item2.uid) then doPlayerSendCancel(cid, "Use only in your pokemons.") return true end if isInArray(legendary, getCreatureName(item2.uid)) then doPlayerSendCancel(cid, "Voce nao pode usar em pokemons lendarios") return true end boosts = boosts local pokemon = getItemAttribute(myball.uid, "poke") local off = pokes[pokemon].offense * boost_rate * boosts local def = pokes[pokemon].defense * boost_rate * boosts local agi = pokes[pokemon].agility * boosts local spatk = pokes[pokemon].specialattack * boost_rate * boosts local vit = pokes[pokemon].vitality * boost_rate * boosts newBoost = boost + boosts if newBoost > 1500 then newBoost = 1500 end doSetItemAttribute(myball.uid, "boost", newBoost) doItemSetAttribute(myball.uid, "offense", getItemAttribute(myball.uid, "offense") + off) doItemSetAttribute(myball.uid, "defense", getItemAttribute(myball.uid, "defense") + def) doItemSetAttribute(myball.uid, "speed", getItemAttribute(myball.uid, "speed") + agi) doItemSetAttribute(myball.uid, "specialattack", getItemAttribute(myball.uid, "specialattack") + spatk) doItemSetAttribute(myball.uid, "vitality", getItemAttribute(myball.uid, "vitality") + vit) doRemoveItem(item.uid) doSendMagicEffect(getThingPos(item2.uid), 103) doPlayerSendTextMessage(cid, 27, "Congrulations, your "..pokemon..", as beem boosted +"..boosts..".") doPlayerSendTextMessage(cid, 27, "Now your "..pokemon.." have a boost +"..newBoost..".") doSendAnimatedText(getThingPos(item2.uid), "+"..boosts.." Boost", 215) return true end Vc vai ter que adicionar todos os lendários nesta tabela local legendary = {"Moltress", "Zapdos", "Articuno"} Sempre com a inical maiúscula e tomando cuidado para não errar o nome. Link para o comentário https://xtibia.com/forum/topic/229765-boost-stone-en-legendarios/#findComment-1620814 Compartilhar em outros sites More sharing options...
zipter98 1102 Postado Março 9, 2014 Share Postado Março 9, 2014 Vou mover para pedidos e dúvidas de derivados, já que o código se trata exclusivamente de Pokémon. Link para o comentário https://xtibia.com/forum/topic/229765-boost-stone-en-legendarios/#findComment-1621207 Compartilhar em outros sites More sharing options...
Posts Recomendados