Boost Stone en Legendarios

yerenix
em Lixeira Pública

yerenix

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 11/08/11Posts: 13

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.

 

Killua

Vivendo e Aprendendo
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 29/04/09Posts: 904Char no Tibia: Jabuti Selvagem

yerenix

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 11/08/11Posts: 13

Sim como Moltres, Articuno,Zapdos e muito mas

Killua

Vivendo e Aprendendo
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 29/04/09Posts: 904Char no Tibia: Jabuti Selvagem

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.

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

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

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.