YE

Boost Stone en Legendarios

Por yerenix, 08 de mar. de 2014 em Archived

dúvida
pokemon
script
5
1k
yerenixY
08 de março de 2014 às 22:04

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.

 

KilluaK
08 de março de 2014 às 23:03

E como eu faço pra saber se um pokemon é legendário? Só pelo nome?

yerenixY
09 de março de 2014 às 00:01

Sim como Moltres, Articuno,Zapdos e muito mas

Editado Março 9 por Yerenzitop

KilluaK
09 de março de 2014 às 00:07

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.

zipter98Z
09 de março de 2014 às 12:42

Vou mover para pedidos e dúvidas de derivados, já que o código se trata exclusivamente de Pokémon.