Ir para conteúdo

[Encerrado] [Pokemon] Dúvidas? - Pda


lucashgas

Posts Recomendados

@Slicer

 

Um duvida sobre seu serve !!

 

1 - Seu serve tem o systema que tem no pokexgames quando voçe da tanto de cath ganha uma oufit

 

2 - o mark o preço dele quando conpra ou vende ta igual do pokexgames

 

Essas sao so duvidas nao to pedindo pra voçe nao fazer nada em nem add nada so estou com duvida se seu serve tem issu ^^

Link para o comentário
Compartilhar em outros sites

@brun123

Vlw pelo sistema :)

@all

editei o boost do brun123 para o server do slicer agora ta fechando os slots e animaçao da boost :)

\/\/\/\/\/\/\/\/\/\/\/\/\/

 

local ballslot =12355

local ballslot_run = 12352

local stoneslot = 12354

local stoneslot_run = 12353

local button = 12356

local button_run = 12357

function isRunning(id)

if isInArray({button_run, stoneslot_run, ballslot_run}, id) then

return true

end

return false

end

boost_stones = {

["Bulbasaur"] = {leaf},

["Ivysaur"] = {leaf},

["Venusaur"] = {leaf},

["Charmander"] = {fire},

["Charmeleon"] = {fire},

["Charizard"] = {fire},

["Squirtle"] = {water},

["Wartortle"] = {water},

["Blastoise"] = {water},

["Caterpie"] = {coccon},

["Metapod"] = {coccon},

["Butterfree"] = {coccon},

["Weedle"] = {coccon},

["Kakuna"] = {coccon},

["Beedrill"] = {coccon},

["Pidgey"] = {heart},

["Pidgeotto"] = {heart},

["Pidgeot"] = {heart},

["Rattata"] = {heart},

["Raticate"] = {heart},

["Spearow"] = {heart},

["Fearow"] = {heart},

["Ekans"] = {venom},

["Arbok"] = {venom},

["Pikachu"] = {thunder},

["Raichu"] = {thunder},

["Sandshrew"] = {earth},

["Sandslash"] = {earth},

["Nidoran Female"] = {venom},

["Nidorina"] = {venom},

["Nidoqueen"] = {venom, earth},

["Nidoran Male"] = {venom},

["Nidorino"] = {venom},

["Nidoking"] = {venom, earth},

["Clefairy"] = {heart},

["Clefable"] = {heart},

["Vulpix"] = {fire},

["Ninetales"] = {fire},

["Jigglypuff"] = {heart},

["Wigglytuff"] = {heart},

["Zubat"] = {venom},

["Golbat"] = {venom},

["Oddish"] = {leaf, venom},

["Gloom"] = {leaf, venom},

["Vileplume"] = {leaf, venom},

["Paras"] = {coccon, leaf},

["Parasect"] = {coccon, leaf},

["Venonat"] = {coccon, venom},

["Venomoth"] = {coccon, venom},

["Diglett"] = {earth},

["Dugtrio"] = {earth},

["Meowth"] = {heart},

["Persian"] = {heart},

["Psyduck"] = {water},

["Golduck"] = {water, enigma},

["Mankey"] = {punch},

["Primeape"] = {punch},

["Growlithe"] = {fire},

["Arcanine"] = {fire},

["Poliwag"] = {water},

["Poliwhirl"] = {water},

["Poliwrath"] = {water, punch},

["Abra"] = {enigma},

["Kadabra"] = {enigma},

["Alakazam"] = {enigma},

["Machop"] = {punch},

["Machoke"] = {punch},

["Machamp"] = {punch},

["Bellsprout"] = {leaf, venom},

["Weepinbell"] = {leaf, venom},

["Victreebel"] = {leaf, venom},

["Tentacool"] = {water, venom},

["Tentacruel"] = {water, venom},

["Geodude"] = {earth, rock},

["Graveler"] = {earth, rock},

["Golem"] = {earth, rock},

["Ponyta"] = {fire},

["Rapidash"] = {fire},

["Slowpoke"] = {water, enigma},

["Slowbro"] = {water, enigma},

["Magnemite"] = {thunder, metal},

["Magneton"] = {thunder, metal},

["Farfetch'd"] = {heart},

["Doduo"] = {heart},

["Dodrio"] = {heart},

["Seel"] = {water, ice},

["Dewgong"] = {water, ice},

["Grimer"] = {venom},

["Muk"] = {venom},

["Shellder"] = {water, ice},

["Cloyster"] = {water, ice},

["Gastly"] = {dark},

["Haunter"] = {dark},

["Gengar"] = {dark},

["Onix"] = {rock, earth},

["Drowzee"] = {enigma},

["Hypno"] = {enigma},

["Krabby"] = {water},

["Kingler"] = {water},

["Voltorb"] = {thunder},

["Electrode"] = {thunder},

["Exeggcute"] = {enigma, leaf},

["Exeggutor"] = {enigma, leaf},

["Cubone"] = {earth},

["Marowak"] = {earth},

["Hitmonlee"] = {punch},

["Hitmonchan"] = {punch},

["Lickitung"] = {heart},

["Koffing"] = {venom},

["Weezing"] = {venom},

["Rhyhorn"] = {earth, rock},

["Rhydon"] = {earth, rock},

["Chansey"] = {heart},

["Tangela"] = {leaf},

["Kangaskhan"] = {heart},

["Horsea"] = {water},

["Seadra"] = {water},

["Goldeen"] = {water},

["Seaking"] = {water},

["Staryu"] = {water},

["Starmie"] = {water},

["Mr. Mime"] = {enigma},

["Scyther"] = {coccon},

["Jynx"] = {enigma, ice},

["Electabuzz"] = {thunder},

["Magmar"] = {fire},

["Pinsir"] = {coccon},

["Tauros"] = {heart},

["Magikarp"] = {water},

["Gyarados"] = {water, crystal},

["Lapras"] = {water, ice},

["Ditto"] = {heart},

["Eevee"] = {heart},

["Vaporeon"] = {water},

["Jolteon"] = {thunder},

["Flareon"] = {fire},

["Porygon"] = {heart, enigma},

["Omanyte"] = {rock, water},

["Omastar"] = {rock, water},

["Kabuto"] = {rock, water},

["Kabutops"] = {rock, water},

["Aerodactyl"] = {rock},

["Snorlax"] = {heart},

["Articuno"] = {ice},

["Zapdos"] = {thunder},

["Moltres"] = {fire},

["Dratini"] = {crystal},

["Dragonair"] = {crystal},

["Dragonite"] = {crystal},

["Mewtwo"] = {enigma},

["Mew"] = {enigma},

--

["Shiny Venusaur"] = {leaf},

["Shiny Charizard"] = {fire},

["Shiny Blastoise"] = {water},

["Shiny Butterfree"] = {coccon},

["Shiny Beedrill"] = {coccon},

["Shiny Pidgeot"] = {heart},

["Shiny Rattata"] = {heart},

["Shiny Raticate"] = {heart},

["Shiny Fearow"] = {heart},

["Shiny Raichu"] = {thunder},

["Shiny Nidoking"] = {venom, earth},

["Shiny Zubat"] = {venom},

["Shiny Golbat"] = {venom},

["Shiny Oddish"] = {leaf, venom},

["Shiny Vileplume"] = {leaf, venom},

["Shiny Paras"] = {coccon, leaf},

["Shiny Parasect"] = {coccon, leaf},

["Shiny Venonat"] = {coccon, venom},

["Shiny Venomoth"] = {coccon, venom},

["Shiny Growlithe"] = {fire},

["Shiny Arcanine"] = {fire},

["Shiny Abra"] = {enigma},

["Shiny Alakazam"] = {enigma},

["Shiny Tentacool"] = {water, venom},

["Shiny Tentacruel"] = {water, venom},

["Shiny Golem"] = {earth, rock},

["Shiny Farfetch'd"] = {heart},

["Shiny Grimer"] = {venom},

["Shiny Muk"] = {venom},

["Shiny Gengar"] = {dark},

["Shiny Onix"] = {rock, earth},

["Shiny Hypno"] = {enigma},

["Shiny Krabby"] = {water},

["Shiny Kingler"] = {water},

["Shiny Voltorb"] = {thunder},

["Shiny Electrode"] = {thunder},

["Shiny Cubone"] = {earth},

["Shiny Marowak"] = {earth},

["Shiny Hitmonlee"] = {punch},

["Shiny Hitmonchan"] = {punch},

["Shiny Hitmontop"] = {punch}, --alterado v1.4

["Shiny Tangela"] = {leaf},

["Shiny Horsea"] = {water},

["Shiny Seadra"] = {water},

["Shiny Mr. Mime"] = {enigma},

["Shiny Scyther"] = {coccon},

["Shiny Jynx"] = {enigma, ice},

["Shiny Electabuzz"] = {thunder},

["Shiny Pinsir"] = {coccon},

["Shiny Magikarp"] = {water},

["Shiny Gyarados"] = {water, crystal},

["Shiny Vaporeon"] = {water},

["Shiny Jolteon"] = {thunder},

["Shiny Flareon"] = {fire},

["Shiny Snorlax"] = {heart},

["Shiny Dratini"] = {crystal},

["Shiny Dragonair"] = {crystal},

--

["Chikorita"] = {leaf},

["Bayleef"] = {leaf},

["Meganium"] = {leaf},

["Cyndaquil"] = {fire},

["Quilava"] = {fire},

["Typhlosion"] = {fire},

["Totodile"] = {water},

["Croconaw"] = {water},

["Feraligatr"] = {water},

["Sentret"] = {heart},

["Furret"] = {heart},

["Hoothoot"] = {heart, enigma},

["Noctowl"] = {heart, enigma},

["Ledyba"] = {coccon},

["Ledian"] = {coccon},

["Spinarak"] = {coccon, venom},

["Ariados"] = {coccon, venom},

["Crobat"] = {venom},

["Chinchou"] = {water, thunder},

["Lanturn"] = {water, thunder},

["Pichu"] = {thunder},

["Cleffa"] = {heart},

["Iglybuff"] = {venom},

["Natu"] = {enigma},

["Xatu"] = {enigma},

["Mareep"] = {thunder},

["Flaaffy"] = {thunder},

["Ampharos"] = {thunder},

["Bellossom"] = {leaf},

["Marill"] = {water},

["Azulmarill"] = {water},

["Sudowoodo"] = {rock, earth},

["Politoed"] = {water, earth},

["Hoppip"] = {leaf},

["Skiploom"] = {leaf},

["Jumpluff"] = {leaf},

["Aipom"] = {heart},

["Sunkern"] = {leaf},

["Sunflora"] = {leaf},

["Yanma"] = {venom, coccon},

["Wooper"] = {water},

["Quagsire"] = {water, earth},

["Murkrow"] = {dark},

["Slowking"] = {water,enigma},

["Misdreavus"] = {dark},

["Wobbuffet"] = {enigma},

["Girafarig"] = {enigma},

["Pineco"] = {coccon},

["Forretress"] = {coccon},

["Gligar"] = {dark, heart},

["Steelix"] = {earth, rock},

["Snubbull"] = {heart},

["Granbull"] = {heart},

["Qwilfish"] = {water},

["Shuckle"] = {earth},

["Heracross"] = {coccon},

["Teddiursa"] = {heart},

["Ursaring"] = {heart, dark},

["Slugma"] = {fire},

["Magcargo"] = {fire},

["Swinub"] = {ice, earth},

["Piloswine"] = {ice, earth},

["Corsola"] = {water},

["Remoraid"] = {water},

["Octillery"] = {water},

["Delibird"] = {ice, heart},

["Mantine"] = {water},

["Skarmory"] = {heart},

["Houndour"] = {fire, dark},

["Houndoom"] = {fire, dark},

["Kingdra"] = {water, crystal},

["Phanpy"] = {earth},

["Donphan"] = {earth},

["porygon2"] = {enigma},

["Stantler"] = {heart},

["Smeargle"] = {heart},

["Tyrogue"] = {punch},

["Hitmontop"] = {punch},

["Smoochum"] = {ice, enigma},

["Elekid"] = {thunder},

["Magby"] = {fire},

["Miltank"] = {heart},

["Blissey"] = {heart},

["Raikou"] = {thunder},

["Entei"] = {fire},

["Suicune"] = {water},

["Larvitar"] = {earth, dark},

["Pupitar"] = {earth, dark},

["Tyranitar"] = {earth, dark},

["Lugia"] = {enigma, water},

["Ho-oh"] = {enigma, fire},

["Celebi"] = {leaf, enigma}}

function doRestoreBoostMachine(cid, b_pos, p_pos, s_pos, msg, msg2)

--doSendMagicEffect(p_pos, 247)

if isCreature(cid) then

doCreatureSetNoMove(cid, false)

doPlayerSendTextMessage(cid, 27, msg)

end

local ball_s = getTileItemById(p_pos, ballslot_run)

doTransformItem(ball_s.uid, ballslot)

local stne_s = getTileItemById(s_pos, stoneslot_run)

doTransformItem(stne_s.uid, stoneslot)

local butn_s = getTileItemById(b_pos, button_run)

doTransformItem(butn_s.uid, button)

end

local stones_required = { -- custo base de stones para boostar

[heart] = 1,

[leaf] = 1,

[water] = 1,

[venom] = 1,

[thunder] = 1,

[rock] = 1,

[punch] = 1,

[fire] = 1,

[coccon] = 1,

[crystal] = 1,

[dark] = 1,

[earth] = 1,

[enigma] = 1,

[ice] = 1,

}

local stone_increase = { -- a cada quantos boosts irá aumentar o custo de stones

[heart] = 3,

[leaf] = 3,

[water] = 3,

[venom] = 4,

[thunder] = 4,

[rock] = 3,

[punch] = 4,

[fire] = 3,

[coccon] = 2,

[crystal] = 15,

[dark] = 4,

[earth] = 4,

[enigma] = 4,

[ice] = 4,

}

function onUse(cid, item, topos, item2, frompos)

if isRunning(item.itemid) then

doPlayerSendCancel(cid, "Wait until boosting finishes.")

return true

end

if item.itemid == button then

local pbpos = topos

pbpos.x = pbpos.x + 1

local ball_slot = getTileItemById(pbpos, ballslot)

local myball = getContainerItem(ball_slot.uid, 0)

if myball.uid <= 0 or getItemWeight(myball.uid) == 0 then

doPlayerSendCancel(cid, "You need to put a pokeball in the ball slot.")

return true

end

local pokemon = getItemAttribute(myball.uid, "poke")

local boost = getItemAttribute(myball.uid, "boost") or 0

if boost >= 50 then

doPlayerSendCancel(cid, "Your pokemon is already at maximum boost.")

return true

end

local stnpos = pbpos

stnpos.x = stnpos.x - 2

local stone_slot = getTileItemById(stnpos, stoneslot)

local stone = getContainerItem(stone_slot.uid, 0)

if stone.uid <= 0 then

doPlayerSendCancel(cid, "You need to put a stone in the stone slot.")

return true

end

if not isStone(stone.itemid) then

doPlayerSendCancel(cid, "Please, put only stones in the stone slot.")

return true

end

if not isInArray(boost_stones[pokemon], stone.itemid) then

local cancelstr = "Sorry, you are not using the correct stone."

if #boost_stones[pokemon] > 1 then

local stonesused = ""

cancelstr = cancelstr.." This pokemon needs "

for su = 1, #boost_stones[pokemon] do

local n = doCorrectString(getItemNameById(boost_stones[pokemon][su]))

if su == #boost_stones[pokemon] then

stonesused = stonesused.." or "..getArticle(n).." "..n..""

elseif su == 1 then

stonesused = stonesused..""..getArticle(n).." "..n..""

else

stonesused = stonesused..", "..n..""

end

end

cancelstr = cancelstr..""..stonesused.." to be boosted."

else

cancelstr = cancelstr.." This pokemon needs a "..doCorrectString(getItemNameById(boost_stones[pokemon][1])).." to be boosted."

end

doPlayerSendCancel(cid, cancelstr)

return true

end

local removeStones = 0

local extraStones = math.floor(boost / stone_increase[stone.itemid])

local required_stones = stones_required[stone.itemid] + extraStones

local boosts = 0

local availableStones = 0

for a = 0, getContainerSize(stone_slot.uid) - 1 do

local it = getContainerItem(stone_slot.uid, a)

if it.uid > 0 then

if not isStone(it.itemid) then

doPlayerSendCancel(cid, "Please, put only stones in the stone slot.")

return true

end

if it.itemid ~= stone.itemid then

doPlayerSendCancel(cid, "Please, put only one type of stone in the stone slot.")

return true

end

availableStones = availableStones + it.type

end

end

 

for a = 1, availableStones do

if required_stones > 0 then

required_stones = required_stones - 1

if required_stones <= 0 then

boosts = boosts + 1

removeStones = removeStones + stones_required[stone.itemid] + extraStones

if boost + boosts <= 49 then

extraStones = math.floor((boost + boosts) / stone_increase[stone.itemid])

required_stones = stones_required[stone.itemid] + extraStones

end

end

end

end

 

if required_stones > 0 and boosts == 0 then

doPlayerSendCancel(cid, "You need more stones to boost this pokemon.")

return true

end

for b = 1, removeStones do

local i = getContainerItem(stone_slot.uid, 0)

doChangeTypeItem(i.uid, i.type - 1)

end

doSetItemAttribute(myball.uid, "boost", boost + boosts)

local msg = "Mensagem que vai aparecer ao boost :)"

local downpos = getThingPos(cid)

downpos.y = downpos.y + 1

local mypos = getThingPos(cid)

doTeleportThing(cid, downpos, false)

doTeleportThing(cid, mypos, false)

doTransformItem(ball_slot.uid, ballslot_run)

doTransformItem(stone_slot.uid, stoneslot_run)

doTransformItem(item.uid, button_run)

doCreatureSetNoMove(cid, true)

doCreatureAddCondition(cid, boostcondition)

addEvent(doRestoreBoostMachine, 3000, cid, getThingPos(item.uid), getThingPos(ball_slot.uid), getThingPos(stone_slot.uid), msg, msg2)

return true

end

end

 

Editado por PkNfan
Link para o comentário
Compartilhar em outros sites

@Brunnoo

1 - nao n tem, mas eh bemmmm simplis fazer esse npc ^^

 

2 - oia.. eles mudaram tanto aquilo na atualizaçao das ilhas laranjas, q acredito eu q n ta igual n ^^

 

@zeref

eh o brun owna muito... foda... eu fiz o script aki tb, soh alterei algumas coisas mas blz hehe ja agradeço a ele pela function kk

Link para o comentário
Compartilhar em outros sites

@ZerefShirou

Ficou perfeito! Valeu por trazer para o forum esse script. Muito bom mesmo. Sendo que está incompleto em pequenos fatores, mas isso é fácil de resolver. Os slot não fecham na hora do boost e nem exibe a animação, mas só adicionar as funções. Valeu ai.

 

 

 

[12/09/2012 18:10:12] [Error - LuaScriptInterface::loadFile] data/actions/scripts/boost.lua:89: unexpected symbol near ','

[12/09/2012 18:10:12] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/boost.lua)

[12/09/2012 18:10:12] data/actions/scripts/boost.lua:89: unexpected symbol near ','

 

 

Linha 89 tava com uma "," a mais

 

["Golem"] = {earth,, rock},

 

Mas mesmo concertando isso não exibe a animação e nem os slots fecham ao boosta.

 

 

[12/09/2012 18:20:38] [Error - Action Interface]

[12/09/2012 18:20:38] data/actions/scripts/boost.lua:onUse

[12/09/2012 18:20:38] Description:

[12/09/2012 18:20:38] data/actions/scripts/boost.lua:317: attempt to perform arithmetic on a nil value

[12/09/2012 18:20:38] stack traceback:

[12/09/2012 18:20:38] data/actions/scripts/boost.lua:317: in function <data/actions/scripts/boost.lua:215>

Link para o comentário
Compartilhar em outros sites

É porque esse boost foi feito a partir do boost.lua original, talvez algumas mudanças que tenham feito no server tornou o script incompatível, eu baixei o server 1.4f (dash advanced) e peguei o boost.lua sem modificação alguma e coloquei pra funcionar com stone agrupável, diferente do script mais acima, esse funciona com stone agrupável ou não... se der erro foi alguma mudança na lib do server de vocês que atrapalha:

 

 

local ballslot = 12355
local ballslot_run = 12352

local stoneslot = 12354
local stoneslot_run = 12353

local button = 12356
local button_run = 12357

function isRunning(id)
   if isInArray({button_run, stoneslot_run, ballslot_run}, id) then
   return true
   end
return false
end

boost_stones = {
["Bulbasaur"] = {leaf},
["Ivysaur"] = {leaf},
["Venusaur"] = {leaf},
["Charmander"] = {fire},
["Charmeleon"] = {fire},
["Charizard"] = {fire},
["Squirtle"] = {water},
["Wartortle"] = {water},
["Blastoise"] = {water},
["Caterpie"] = {coccon},
["Metapod"] = {coccon},
["Butterfree"] = {coccon},
["Weedle"] = {coccon},
["Kakuna"] = {coccon},
["Beedrill"] = {coccon},
["Pidgey"] = {heart},
["Pidgeotto"] = {heart},
["Pidgeot"] = {heart},
["Rattata"] = {heart},
["Raticate"] = {heart},
["Spearow"] = {heart},
["Fearow"] = {heart},
["Ekans"] = {venom},
["Arbok"] = {venom},
["Pikachu"] = {thunder},
["Raichu"] = {thunder},
["Sandshrew"] = {earth},
["Sandslash"] = {earth},
["Nidoran Female"] = {venom},
["Nidorina"] = {venom},
["Nidoqueen"] = {venom, earth},
["Nidoran Male"] = {venom},
["Nidorino"] = {venom},
["Nidoking"] = {venom, earth},
["Clefairy"] = {heart},
["Clefable"] = {heart},
["Vulpix"] = {fire},
["Ninetales"] = {fire},
["Jigglypuff"] = {heart},
["Wigglytuff"] = {heart},
["Zubat"] = {venom},
["Golbat"] = {venom},
["Oddish"] = {leaf, venom},
["Gloom"] = {leaf, venom},
["Vileplume"] = {leaf, venom},
["Paras"] = {coccon, leaf},
["Parasect"] = {coccon, leaf},
["Venonat"] = {coccon, venom},
["Venomoth"] = {coccon, venom},
["Diglett"] = {earth},
["Dugtrio"] = {earth},
["Meowth"] = {heart},
["Persian"] = {heart},
["Psyduck"] = {water},
["Golduck"] = {water, enigma},
["Mankey"] = {punch},
["Primeape"] = {punch},
["Growlithe"] = {fire},
["Arcanine"] = {fire},
["Poliwag"] = {water},
["Poliwhirl"] = {water},
["Poliwrath"] = {water, punch},
["Abra"] = {enigma},
["Kadabra"] = {enigma},
["Alakazam"] = {enigma},
["Machop"] = {punch},
["Machoke"] = {punch},
["Machamp"] = {punch},
["Bellsprout"] = {leaf, venom},
["Weepinbell"] = {leaf, venom},
["Victreebel"] = {leaf, venom},
["Tentacool"] = {water, venom},
["Tentacruel"] = {water, venom},
["Geodude"] = {earth, rock},
["Graveler"] = {earth, rock},
["Golem"] = {earth, rock},
["Ponyta"] = {fire},
["Rapidash"] = {fire},
["Slowpoke"] = {water, enigma},
["Slowbro"] = {water, enigma},
["Magnemite"] = {thunder, metal},
["Magneton"] = {thunder, metal},
["Farfetch'd"] = {heart},
["Doduo"] = {heart},
["Dodrio"] = {heart},
["Seel"] = {water, ice},
["Dewgong"] = {water, ice},
["Grimer"] = {venom},
["Muk"] = {venom},
["Shellder"] = {water, ice},
["Cloyster"] = {water, ice},
["Gastly"] = {dark},
["Haunter"] = {dark},
["Gengar"] = {dark},
["Onix"] = {rock, earth},
["Drowzee"] = {enigma},
["Hypno"] = {enigma},
["Krabby"] = {water},
["Kingler"] = {water},
["Voltorb"] = {thunder},
["Electrode"] = {thunder},
["Exeggcute"] = {enigma, leaf},
["Exeggutor"] = {enigma, leaf},
["Cubone"] = {earth},
["Marowak"] = {earth},
["Hitmonlee"] = {punch},
["Hitmonchan"] = {punch},
["Lickitung"] = {heart},
["Koffing"] = {venom},
["Weezing"] = {venom},
["Rhyhorn"] = {earth, rock},
["Rhydon"] = {earth, rock},
["Chansey"] = {heart},
["Tangela"] = {leaf},
["Kangaskhan"] = {heart},
["Horsea"] = {water},
["Seadra"] = {water},
["Goldeen"] = {water},
["Seaking"] = {water},
["Staryu"] = {water},
["Starmie"] = {water},
["Mr. Mime"] = {enigma},
["Scyther"] = {coccon},
["Jynx"] = {enigma, ice},
["Electabuzz"] = {thunder},
["Magmar"] = {fire},
["Pinsir"] = {coccon},
["Tauros"] = {heart},
["Magikarp"] = {water},
["Gyarados"] = {water, crystal},
["Lapras"] = {water, ice},
["Ditto"] = {heart},
["Eevee"] = {heart},
["Vaporeon"] = {water},
["Jolteon"] = {thunder},
["Flareon"] = {fire},
["Porygon"] = {heart, enigma},
["Omanyte"] = {rock, water},
["Omastar"] = {rock, water},
["Kabuto"] = {rock, water},
["Kabutops"] = {rock, water},
["Aerodactyl"] = {rock},
["Snorlax"] = {heart},
["Articuno"] = {ice},
["Zapdos"] = {thunder},
["Moltres"] = {fire},
["Dratini"] = {crystal},
["Dragonair"] = {crystal},
["Dragonite"] = {crystal},
["Mewtwo"] = {enigma},
["Mew"] = {enigma}}

function doRestoreBoostMachine(cid, b_pos, p_pos, s_pos, msg, msg2)

   doSendAnimatedText(b_pos, "DONE.", 215)

   if isCreature(cid) then
       doCreatureSetNoMove(cid, false)
       doPlayerSendTextMessage(cid, 27, msg)
       doPlayerSendTextMessage(cid, 27, msg2)
   end

   local ball_s = getTileItemById(p_pos, ballslot_run)
   doTransformItem(ball_s.uid, ballslot)

   local stne_s = getTileItemById(s_pos, stoneslot_run)
   doTransformItem(stne_s.uid, stoneslot)

   local butn_s = getTileItemById(b_pos, button_run)
   doTransformItem(butn_s.uid, button)

end

local stones_required = {    -- custo base de stones para boostar
[heart] = 1,
[leaf] = 1,
[water] = 1,
[venom] = 1,
[thunder] = 1,
[rock] = 1,
[punch] = 1,
[fire] = 1,
[coccon] = 1,
[crystal] = 1,
[dark] = 1,
[earth] = 1,
[enigma] = 1,
[ice] = 1,
}

local stone_increase = {    -- a cada quantos boosts irá aumentar o custo de stones
[heart] = 3,
[leaf] = 3,
[water] = 3,
[venom] = 4,
[thunder] = 4,
[rock] = 3,
[punch] = 4,
[fire] = 3,
[coccon] = 2,
[crystal] = 15,
[dark] = 4,
[earth] = 4,
[enigma] = 4,
[ice] = 4,
}

function onUse(cid, item, topos, item2, frompos)

   if isRunning(item.itemid) then
       doPlayerSendCancel(cid, "Wait until boosting finishes.")
   return true
   end

   if item.itemid == button then

       local pbpos = topos
      	   pbpos.x = pbpos.x + 1
       local ball_slot = getTileItemById(pbpos, ballslot)
       local myball = getContainerItem(ball_slot.uid, 0)

       if myball.uid <= 0 or getItemWeight(myball.uid) == 0 then
           doPlayerSendCancel(cid, "You need to put a pokeball in the ball slot.")
       return true
       end

       local pokemon = getItemAttribute(myball.uid, "poke")
       local boost = getItemAttribute(myball.uid, "boost") or 0

       if boost >= 50 then
           doPlayerSendCancel(cid, "Your pokemon is already at maximum boost.")
       return true
       end

       local stnpos = pbpos
      	   stnpos.x = stnpos.x - 2
       local stone_slot = getTileItemById(stnpos, stoneslot)

       local stone = getContainerItem(stone_slot.uid, 0)

       if stone.uid <= 0 then
           doPlayerSendCancel(cid, "You need to put a stone in the stone slot.")
       return true
       end

       if not isStone(stone.itemid) then
           doPlayerSendCancel(cid, "Please, put only stones in the stone slot.")
       return true
       end

       if not isInArray(boost_stones[pokemon], stone.itemid) then

           local cancelstr = "Sorry, you are not using the correct stone."

           if #boost_stones[pokemon] > 1 then
               local stonesused = ""
               cancelstr = cancelstr.." This pokemon needs "
               for su = 1, #boost_stones[pokemon] do
                   local n = doCorrectString(getItemNameById(boost_stones[pokemon][su]))
                   if su == #boost_stones[pokemon] then
                       stonesused = stonesused.." or "..getArticle(n).." "..n..""
                   elseif su == 1 then
                       stonesused = stonesused..""..getArticle(n).." "..n..""
                   else
                       stonesused = stonesused..", "..n..""
                   end
               end
               cancelstr = cancelstr..""..stonesused.." to be boosted."
           else
               cancelstr = cancelstr.." This pokemon needs a "..doCorrectString(getItemNameById(boost_stones[pokemon][1])).." to be boosted."
           end

           doPlayerSendCancel(cid, cancelstr)

       return true
       end

       local removeStones = 0
       local extraStones = math.floor(boost / stone_increase[stone.itemid])
       local required_stones = stones_required[stone.itemid] + extraStones

       local boosts = 0
       local availableStones = 0

       for a = 0, getContainerSize(stone_slot.uid) - 1 do

           local it = getContainerItem(stone_slot.uid, a)

           if it.uid > 0 then

               if not isStone(it.itemid) then
                   doPlayerSendCancel(cid, "Please, put only stones in the stone slot.")
               return true
               end

               if it.itemid ~= stone.itemid then
                   doPlayerSendCancel(cid, "Please, put only one type of stone in the stone slot.")
               return true
               end

               local toAdd = it.type == 0 and 1 or it.type
               availableStones = availableStones + toAdd

           end

       end

       for a = 1, availableStones do

           if required_stones > 0 then
               required_stones = required_stones - 1

               if required_stones <= 0 then
                   boosts = boosts + 1
                   removeStones = removeStones + stones_required[stone.itemid] + extraStones
                   if boost + boosts <= 49 then
                       extraStones = math.floor((boost + boosts) / stone_increase[stone.itemid])
                       required_stones = stones_required[stone.itemid] + extraStones
                   end
               end
           end
       end


       if required_stones > 0 and boosts == 0 then
           doPlayerSendCancel(cid, "You need more stones to boost this pokemon.")
       return true
       end

       for b = 1, removeStones do
           local i = getContainerItem(stone_slot.uid, 0)
           if i.type == 0 then doRemoveItem(i.uid) else doChangeTypeItem(i.uid, i.type - 1) end
       end

       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

       doSetItemAttribute(myball.uid, "boost", boost + boosts)
       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)

       local msg = "Your "..getPokeballName(myball.uid).." ["..getItemAttribute(myball.uid, "level").."] has been boosted!"
       local msg2 = "• Boost: "..(boost + boosts).." (+"..boosts..")  • Offense: +"..doMathDecimal(off).."  • Defense: +"..doMathDecimal(def).."  • Spc. Atk: +"..doMathDecimal(spatk).."  • Agility: +"..doMathDecimal(agi).."  • Vitality: +"..doMathDecimal(vit)..""

       local downpos = getThingPos(cid)
       downpos.y = downpos.y + 1

       local mypos = getThingPos(cid)

       doTeleportThing(cid, downpos, false)
       doTeleportThing(cid, mypos, false)

       doTransformItem(ball_slot.uid, ballslot_run)
       doTransformItem(stone_slot.uid, stoneslot_run)
       doTransformItem(item.uid, button_run)

       doCreatureSetNoMove(cid, true)
       doCreatureAddCondition(cid, boostcondition)

       addEvent(doRestoreBoostMachine, 3000, cid, getThingPos(item.uid), getThingPos(ball_slot.uid), getThingPos(stone_slot.uid), msg, msg2)

   return true
   end
end

 

Link para o comentário
Compartilhar em outros sites

@Slicer.

to em duvida aki, kkk.

Sobre tava pensando em algumas quest... tipo teria como criar um system de "TASK De kilar npcs? "

Exemplo.

voce vai fala com npc, ele te manda voce mata XX tanto de npcs Rocket, tu volta ele te da teu premio.. Dificil ? obrigado :)

Link para o comentário
Compartilhar em outros sites

@stylo

n n seria.. os npcs quando podem ser atacos eles viram monsters... entao da pra usar qlqr script de task normal q deve funcionar ^^ eu to pensando em fazer um sistema de task q aceite varias tasks ao ms tempo, tpw pxg, q fica aparecendo o nome do npc e qnts pokes faltam matar e pah... quando tiver um tempo começo a fazer ele.. ^^

Link para o comentário
Compartilhar em outros sites

Pronto arrumei o script do boost. Fala ae bruno sumido.

 

 

 

 

local ballslot = 12355

local ballslot_run = 12352

local stoneslot = 12354

local stoneslot_run = 12353

local button = 12356

local button_run = 12357

function isRunning(id)

if isInArray({button_run, stoneslot_run, ballslot_run}, id) then

return true

end

return false

end

 

 

 

boost_stones = {

["Bulbasaur"] = {leaf},

["Ivysaur"] = {leaf},

["Venusaur"] = {leaf},

["Charmander"] = {fire},

["Charmeleon"] = {fire},

["Charizard"] = {fire},

["Squirtle"] = {water},

["Wartortle"] = {water},

["Blastoise"] = {water},

["Caterpie"] = {coccon},

["Metapod"] = {coccon},

["Butterfree"] = {coccon},

["Weedle"] = {coccon},

["Kakuna"] = {coccon},

["Beedrill"] = {coccon},

["Pidgey"] = {heart},

["Pidgeotto"] = {heart},

["Pidgeot"] = {heart},

["Rattata"] = {heart},

["Raticate"] = {heart},

["Spearow"] = {heart},

["Fearow"] = {heart},

["Ekans"] = {venom},

["Arbok"] = {venom},

["Pikachu"] = {thunder},

["Raichu"] = {thunder},

["Sandshrew"] = {earth},

["Sandslash"] = {earth},

["Nidoran Female"] = {venom},

["Nidorina"] = {venom},

["Nidoqueen"] = {venom, earth},

["Nidoran Male"] = {venom},

["Nidorino"] = {venom},

["Nidoking"] = {venom, earth},

["Clefairy"] = {heart},

["Clefable"] = {heart},

["Vulpix"] = {fire},

["Ninetales"] = {fire},

["Jigglypuff"] = {heart},

["Wigglytuff"] = {heart},

["Zubat"] = {venom},

["Golbat"] = {venom},

["Oddish"] = {leaf, venom},

["Gloom"] = {leaf, venom},

["Vileplume"] = {leaf, venom},

["Paras"] = {coccon, leaf},

["Parasect"] = {coccon, leaf},

["Venonat"] = {coccon, venom},

["Venomoth"] = {coccon, venom},

["Diglett"] = {earth},

["Dugtrio"] = {earth},

["Meowth"] = {heart},

["Persian"] = {heart},

["Psyduck"] = {water},

["Golduck"] = {water, enigma},

["Mankey"] = {punch},

["Primeape"] = {punch},

["Growlithe"] = {fire},

["Arcanine"] = {fire},

["Poliwag"] = {water},

["Poliwhirl"] = {water},

["Poliwrath"] = {water, punch},

["Abra"] = {enigma},

["Kadabra"] = {enigma},

["Alakazam"] = {enigma},

["Machop"] = {punch},

["Machoke"] = {punch},

["Machamp"] = {punch},

["Bellsprout"] = {leaf, venom},

["Weepinbell"] = {leaf, venom},

["Victreebel"] = {leaf, venom},

["Tentacool"] = {water, venom},

["Tentacruel"] = {water, venom},

["Geodude"] = {earth, rock},

["Graveler"] = {earth, rock},

["Golem"] = {earth, rock},

["Ponyta"] = {fire},

["Rapidash"] = {fire},

["Slowpoke"] = {water, enigma},

["Slowbro"] = {water, enigma},

["Magnemite"] = {thunder, metal},

["Magneton"] = {thunder, metal},

["Farfetch'd"] = {heart},

["Doduo"] = {heart},

["Dodrio"] = {heart},

["Seel"] = {water, ice},

["Dewgong"] = {water, ice},

["Grimer"] = {venom},

["Muk"] = {venom},

["Shellder"] = {water, ice},

["Cloyster"] = {water, ice},

["Gastly"] = {dark},

["Haunter"] = {dark},

["Gengar"] = {dark},

["Onix"] = {rock, earth},

["Drowzee"] = {enigma},

["Hypno"] = {enigma},

["Krabby"] = {water},

["Kingler"] = {water},

["Voltorb"] = {thunder},

["Electrode"] = {thunder},

["Exeggcute"] = {enigma, leaf},

["Exeggutor"] = {enigma, leaf},

["Cubone"] = {earth},

["Marowak"] = {earth},

["Hitmonlee"] = {punch},

["Hitmonchan"] = {punch},

["Lickitung"] = {heart},

["Koffing"] = {venom},

["Weezing"] = {venom},

["Rhyhorn"] = {earth, rock},

["Rhydon"] = {earth, rock},

["Chansey"] = {heart},

["Tangela"] = {leaf},

["Kangaskhan"] = {heart},

["Horsea"] = {water},

["Seadra"] = {water},

["Goldeen"] = {water},

["Seaking"] = {water},

["Staryu"] = {water},

["Starmie"] = {water},

["Mr. Mime"] = {enigma},

["Scyther"] = {coccon},

["Jynx"] = {enigma, ice},

["Electabuzz"] = {thunder},

["Magmar"] = {fire},

["Pinsir"] = {coccon},

["Tauros"] = {heart},

["Magikarp"] = {water},

["Gyarados"] = {water, crystal},

["Lapras"] = {water, ice},

["Ditto"] = {heart},

["Eevee"] = {heart},

["Vaporeon"] = {water},

["Jolteon"] = {thunder},

["Flareon"] = {fire},

["Porygon"] = {heart, enigma},

["Omanyte"] = {rock, water},

["Omastar"] = {rock, water},

["Kabuto"] = {rock, water},

["Kabutops"] = {rock, water},

["Aerodactyl"] = {rock},

["Snorlax"] = {heart},

["Articuno"] = {ice},

["Zapdos"] = {thunder},

["Moltres"] = {fire},

["Dratini"] = {crystal},

["Dragonair"] = {crystal},

["Dragonite"] = {crystal},

["Mewtwo"] = {enigma},

["Mew"] = {enigma}}

 

function doRestoreBoostMachine(cid, b_pos, p_pos, s_pos, msg, msg2)

doSendAnimatedText(b_pos, "DONE.", 215)

if isCreature(cid) then

doCreatureSetNoMove(cid, false)

doPlayerSendTextMessage(cid, 27, msg)

doPlayerSendTextMessage(cid, 27, msg2)

end

local ball_s = getTileItemById(p_pos, ballslot_run)

doTransformItem(ball_s.uid, ballslot)

local stne_s = getTileItemById(s_pos, stoneslot_run)

doTransformItem(stne_s.uid, stoneslot)

local butn_s = getTileItemById(b_pos, button_run)

doTransformItem(butn_s.uid, button)

end

local stones_required = { -- custo base de stones para boostar

[heart] = 1,

[leaf] = 1,

[water] = 1,

[venom] = 1,

[thunder] = 1,

[rock] = 1,

[punch] = 1,

[fire] = 1,

[coccon] = 1,

[crystal] = 1,

[dark] = 1,

[earth] = 1,

[enigma] = 1,

[ice] = 1,

}

local stone_increase = { -- a cada quantos boosts irá aumentar o custo de stones

[heart] = 3,

[leaf] = 3,

[water] = 3,

[venom] = 4,

[thunder] = 4,

[rock] = 3,

[punch] = 4,

[fire] = 3,

[coccon] = 2,

[crystal] = 15,

[dark] = 4,

[earth] = 4,

[enigma] = 4,

[ice] = 4,

}

function onUse(cid, item, topos, item2, frompos)

if isRunning(item.itemid) then

doPlayerSendCancel(cid, "Wait until boosting finishes.")

return true

end

if item.itemid == button then

local pbpos = topos

pbpos.x = pbpos.x + 1

local ball_slot = getTileItemById(pbpos, ballslot)

local myball = getContainerItem(ball_slot.uid, 0)

if myball.uid <= 0 or getItemWeight(myball.uid) == 0 then

doPlayerSendCancel(cid, "You need to put a pokeball in the ball slot.")

return true

end

local pokemon = getItemAttribute(myball.uid, "poke")

local boost = getItemAttribute(myball.uid, "boost") or 0

if boost >= 50 then

doPlayerSendCancel(cid, "Your pokemon is already at maximum boost.")

return true

end

local stnpos = pbpos

stnpos.x = stnpos.x - 2

local stone_slot = getTileItemById(stnpos, stoneslot)

local stone = getContainerItem(stone_slot.uid, 0)

if stone.uid <= 0 then

doPlayerSendCancel(cid, "You need to put a stone in the stone slot.")

return true

end

if not isStone(stone.itemid) then

doPlayerSendCancel(cid, "Please, put only stones in the stone slot.")

return true

end

if not isInArray(boost_stones[pokemon], stone.itemid) then

local cancelstr = "Sorry, you are not using the correct stone."

if #boost_stones[pokemon] > 1 then

local stonesused = ""

cancelstr = cancelstr.." This pokemon needs "

for su = 1, #boost_stones[pokemon] do

local n = doCorrectString(getItemNameById(boost_stones[pokemon][su]))

if su == #boost_stones[pokemon] then

stonesused = stonesused.." or "..getArticle(n).." "..n..""

elseif su == 1 then

stonesused = stonesused..""..getArticle(n).." "..n..""

else

stonesused = stonesused..", "..n..""

end

end

cancelstr = cancelstr..""..stonesused.." to be boosted."

else

cancelstr = cancelstr.." This pokemon needs a "..doCorrectString(getItemNameById(boost_stones[pokemon][1])).." to be boosted."

end

doPlayerSendCancel(cid, cancelstr)

return true

end

local removeStones = 0

local extraStones = math.floor(boost / stone_increase[stone.itemid])

local required_stones = stones_required[stone.itemid] + extraStones

local boosts = 0

local availableStones = 0

for a = 0, getContainerSize(stone_slot.uid) - 1 do

local it = getContainerItem(stone_slot.uid, a)

if it.uid > 0 then

if not isStone(it.itemid) then

doPlayerSendCancel(cid, "Please, put only stones in the stone slot.")

return true

end

if it.itemid ~= stone.itemid then

doPlayerSendCancel(cid, "Please, put only one type of stone in the stone slot.")

return true

end

availableStones = availableStones + it.type

end

end

 

for a = 1, availableStones do

if required_stones > 0 then

required_stones = required_stones - 1

if required_stones <= 0 then

boosts = boosts + 1

removeStones = removeStones + stones_required[stone.itemid] + extraStones

if boost + boosts <= 49 then

extraStones = math.floor((boost + boosts) / stone_increase[stone.itemid])

required_stones = stones_required[stone.itemid] + extraStones

end

end

end

end

 

if required_stones > 0 and boosts == 0 then

doPlayerSendCancel(cid, "You need more stones to boost this pokemon.")

return true

end

for b = 1, removeStones do

local i = getContainerItem(stone_slot.uid, 0)

doChangeTypeItem(i.uid, i.type - 1)

end

doSetItemAttribute(myball.uid, "boost", boost + boosts)

local msg = "Your "..getPokeballName(myball.uid).." has been boosted!"

local msg2 = "• Boost: "..(boost + boosts).." (+"..boosts..")"

local downpos = getThingPos(cid)

downpos.y = downpos.y + 1

local mypos = getThingPos(cid)

doTeleportThing(cid, downpos, false)

doTeleportThing(cid, mypos, false)

doTransformItem(ball_slot.uid, ballslot_run)

doTransformItem(stone_slot.uid, stoneslot_run)

doTransformItem(item.uid, button_run)

doCreatureSetNoMove(cid, true)

doCreatureAddCondition(cid, boostcondition)

addEvent(doRestoreBoostMachine, 3000, cid, getThingPos(item.uid), getThingPos(ball_slot.uid), getThingPos(stone_slot.uid), msg, msg2)

return true

end

end

 

 

Editado por pedrowarlock
Link para o comentário
Compartilhar em outros sites

@Stylo

creio que nao seja dificil:

data/action/order

na parte do duel :)

 

if #getCreatureSummons(cid) == 0 then

doPlayerSendTextMessage(cid, 27, "You need you pokemon to invite/accept duel!")

return true

end

me corrija se eu tiver errado Slicer

Editado por PkNfan
Link para o comentário
Compartilhar em outros sites

slicer uma duvida sobre teu serve:

 

esses npc's .aRocket e .aPolice sao aqueles que atacam quem n tem a storage do roket ou da policia certo?

 

e pra vira policial ou um roket so é preciso fala com o .aCommanderRocket ou .aCommanderOfficer?

 

não tem nen uma task pra fazer pra vira esses caras?

 

 

so isso ;D

Link para o comentário
Compartilhar em outros sites

slicer uma duvida sobre teu serve:

 

esses npc's .aRocket e .aPolice sao aqueles que atacam quem n tem a storage do roket ou da policia certo?

 

e pra vira policial ou um roket so é preciso fala com o .aCommanderRocket ou .aCommanderOfficer?

 

não tem nen uma task pra fazer pra vira esses caras?

 

 

so isso ;D

 

 

@Cacaiu O NPC está feito. Só você usar a criatividade para adicionar uma função a ele...task e tudo mais depende de você.

 

Para virar policia e ser atacado pelos Roket precisa invocar a (office Jenny) >> /n Officer Jenny

Para virar Roket e ser atacado pelos policias precisa invocar o (Giovanni) >>> /n Giovanni

 

 

 

Os .aCommanderRocket ou .aCommanderOfficer são NPCs mais fortes do que o .aRocket ou .aPolice.xml.

Editado por pedrowarlock
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...