Ir para conteúdo
  • 0

Sistema De Icone Nas Pokeballs


etarus

Pergunta

Achei esse script aqui no forum : http://www.xtibia.co...cone-nas-balls/

Mas é para o Pokemon Dash Adventures, eu tenho um server antigo q não tem na pasta lib o Configurations.lua e os arquivos são diferentes...

Queria que alguem me ajudasse a implantar esse sistema no meu server , vou postar alguns scripts...

 

data\actions\scripts\goback.lua

 

 

local pokes = {

 

--- Retirei alguns pokemons \/ para o script ficar menor...

["Yanmega"] = {level = 80, cons = 100, vida = 6000},

["Chikorita"] = {level = 20, cons = 40, vida = 1200},

["Shiny Voltorb"] = {level = 30, cons = 40, vida = 2000},

["Shiny Zubat"] = {level = 15, cons = 30, vida = 2000}

}

 

local msgunica = true

local msgunicago1, msgunicaback1 = "Go, doka!", "Come back, doka!"

local msgunicago2, msgunicaback2 = "Let's do it, doka!", "Thanks for helping, doka!"

local msgunicago3, msgunicaback3 = "I choose you, doka!", "That's enough, come back!"

local msgunicago4, msgunicaback4 = "I need your help, doka!", "You were great, doka!"

local msgunicago5, msgunicaback5 = "Let's fight, doka!", "Excellent work, doka!"

local msgunicago6, msgunicaback6 = "It's battle time, doka!", "Well done, doka!"

 

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

setPlayerStorageValue(cid,9506,-1)

if #getCreatureSummons(cid) >= 1 and getPlayerStorageValue(getCreatureSummons(cid)[1], 33) >= 1 then

return true

end

local random2 = math.random(1,6)

if random2 == 1 then

msgunicaback = msgunicaback1

elseif random2 == 2 then

msgunicaback = msgunicaback2

elseif random2 == 3 then

msgunicaback = msgunicaback3

elseif random2 == 4 then

msgunicaback = msgunicaback4

elseif random2 == 5 then

msgunicaback = msgunicaback5

elseif random2 == 6 then

msgunicaback = msgunicaback6

end

local random = math.random(1,6)

if random == 1 then

msgunicago = msgunicago1

elseif random == 2 then

msgunicago = msgunicago2

elseif random == 3 then

msgunicago = msgunicago3

elseif random == 4 then

msgunicago = msgunicago4

elseif random == 5 then

msgunicago = msgunicago5

elseif random == 6 then

msgunicago = msgunicago6

end

 

if item.itemid == 2222 or item.itemid == 2223 then

gobackeff = 188

elseif item.itemid == 8775 or item.itemid == 8996 then

gobackeff = 188

elseif item.itemid == 2220 or item.itemid == 2221 then

gobackeff = 191

elseif item.itemid == 11438 or item.itemid == 11439 then

gobackeff = 189

elseif item.itemid == 11442 or item.itemid == 11443 then

gobackeff = 190

elseif item.itemid == 11446 or item.itemid == 11447 then

gobackeff = 195

elseif item.itemid == 11449 or item.itemid == 11450 then

gobackeff = 194

elseif item.itemid == 11452 or item.itemid == 11453 then

gobackeff = 192

elseif item.itemid == 11455 or item.itemid == 11456 then

gobackeff = 193

elseif item.itemid == 11458 or item.itemid == 11459 then

gobackeff = 196

 

end

local effect = gobackeff

 

if item.itemid == 2223 or item.itemid == 2221 or item.itemid == 11439 or item.itemid == 11443 or item.itemid == 11447 or item.itemid == 11450 or item.itemid == 11453 or item.itemid == 11456 or item.itemid == 11459 then

 

if #getCreatureSummons(cid) >= 1 then

local z = getCreatureSummons(cid)[1]

local pokename = getCreatureName(z)

local mbk = msgunicaback:gsub("doka", pokename)

if getItemAttribute(item.uid, "poke"):find(getCreatureName(z)) then

doTransformItem(item.uid, item.itemid-1)

doCreatureSay(cid, mbk, TALKTYPE_SAY)

local summom = getCreatureSummons(cid)

local maxh = pokes[getCreatureName(summom[1])].vida

local pct2 = ((getCreatureHealth(summom[1])) / (getCreatureMaxHealth(summom[1])))

local vids = ((getCreatureHealth(summom[1])) - 2)

doCreatureAddHealth(summom[1], -vids)

setCreatureMaxHealth(summom[1], maxh)

doCreatureAddHealth(summom[1], ((maxh) * (pct2)))

doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")) .. " HP = ["..getCreatureHealth(z).."/"..getCreatureMaxHealth(z).."]")

setPlayerStorageValue(cid, 61204, 0)

setPlayerStorageValue(cid, 2, 0)

doSendMagicEffect(getCreaturePosition(z), effect)

doRemoveCreature(z)

return true

end

end

 

 

elseif item.itemid == 2222 or item.itemid == 8775 or item.itemid == 8996 or item.itemid == 2220 or item.itemid == 11438 or item.itemid == 11442 or item.itemid == 11446 or item.itemid == 11449 or item.itemid == 11452 or item.itemid == 11455 or item.itemid == 11458 then

 

if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then

doPlayerSendCancel(cid, "You must put your pokeball in the correct place!")

return TRUE

end

 

 

if not canSummon(cid) then

return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM)

end

 

if getPlayerStorageValue(cid, 63215) >= 1 then

return doPlayerSendCancel(cid, "You can't use pokeball while surfing.")

end

 

if getPlayerStorageValue(cid, 62314) >= 1 then

return doPlayerSendCancel(cid, "You can't use pokeball while flying.")

end

 

if #getCreatureSummons(cid) >= 1 then

return doPlayerSendCancel(cid, "You have already summoned a pokemon.")

end

 

for i,x in pairs(pokes) do

if i == getItemAttribute(item.uid, "poke"):sub(9, findLetter(getItemAttribute(item.uid, "poke"), "'")-1) then

 

if getPlayerLevel(cid) < x.level then

doPlayerSendCancel(cid, "You need level "..x.level.." or higher to use this pokemon.")

return true

end

local removed = doCreateItem(1285, 1, getThingPos(cid))

doSummonMonster(cid, i)

local pk = getCreatureSummons(cid)[1]

doTeleportThing(pk, getClosestFreeTile(pk, getThingPos(cid)), false)

doRemoveItem(removed, 1)

doCreatureSetLookDir(pk, 2)

local maxh = pokes[getCreatureName(pk)].vida

local levellife = (((getPlayerLevel(cid))) * (pokes[getCreatureName(pk)].cons))

local health = tonumber(getItemAttribute(item.uid, "poke"):match("%[(.-)/"))

doConvinceCreature(cid, pk)

doCreatureAddHealth(pk, health-maxh)

local pct = ((getCreatureHealth(pk)) / (getCreatureMaxHealth(pk)))

local vidis = (getCreatureHealth(pk))

setCreatureMaxHealth(pk, ((maxh) + (levellife)))

doCreatureAddHealth(pk, 2)

doCreatureAddHealth(pk, -vidis)

doCreatureAddHealth(pk, ((getCreatureMaxHealth(pk)) * (pct)) - 2)

doTransformItem(item.uid, item.itemid+1)

local pokename = getCreatureName(getCreatureSummons(cid)[1])

local mgo = msgunicago:gsub("doka", pokename)

doCreatureSay(cid, mgo, TALKTYPE_SAY)

doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")))

doSendMagicEffect(getCreaturePosition(pk), effect)

setPlayerStorageValue(cid, 61204, 1)

registerCreatureEvent(pk, "DiePoke")

registerCreatureEvent(pk, "Exp")

break

end

end

end

return TRUE

end

 

 

 

 

 

data\actions\scripts\catch.lua

 

local pokes = {

 

--- Retirei alguns pokemons \/ para o script ficar menor ;]

["Bulbasaur"] = {chance = 120, corpse = 5969, health = 1200, maxhealth = 1200},

["Yanmega"] = {chance = 500, corpse = 0, health = 6000, maxhealth = 6000},

["Shiny Zubat"] = {chance = 30, corpse =8750, health = 2000, maxhealth = 2000}

 

 

}

 

local description = "Contains a %pokename."

 

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

local name = getItemNameById(item2.itemid)

if item.itemid == 2147 then

catchrate = 2

oncatch = 24

onfail = 23

bolabola = 2222

elseif item.itemid == 11437 then

catchrate = 3

oncatch = 198

onfail = 197

bolabola = 11438

elseif item.itemid == 11441 then

catchrate = 4

oncatch = 202

onfail = 201

bolabola = 11442

elseif item.itemid == 2146 then

catchrate = 5

oncatch = 200

onfail = 199

bolabola = 2220

elseif item.itemid == 11445 then

catchrate = 6

oncatch = 204

onfail = 203

bolabola = 11446

end

local rate = (catchrate)

local catch = oncatch

local fail = onfail

local newid = bolabola

for i,x in pairs(pokes) do

if getItemNameById(item2.itemid):find(i:lower()) then

if getItemIdByName(name) == pokes.corpse then

if cid ~= getItemAttribute(item2.uid, "corpseowner") and isInArray({1,8}, getPlayerGroupId(cid)) then

doPlayerSendCancel(cid, "You are not allowed to catch this pokemon.")

return true

end

doRemoveItem(item.uid, 1)

doRemoveItem(item2.uid, 1)

local pegar = math.random(0, x.chance)

if pegar <= 1*(rate) then

doSendMagicEffect(topos, catch)

 

local nas = {

['%%pokename'] = i

}

for i,x in pairs(nas) do

if description:find(i) then

description = description:gsub(i, x)

end

end

 

local function capturou(params)

if not isCreature(params.cid) then

return true

end

if not string.find(getPlayerStorageValue(cid, 54842), ""..i..",") then

doPlayerAddSoul(cid, 1)

setPlayerStorageValue(cid, 54842, getPlayerStorageValue(cid, 54842)..""..i..", ")

end

if getPlayerFreeCap(cid) <= 0.99 then

item = doCreateItemEx(params.ball)

doItemSetAttribute(item, "poke", params.poke)

doItemSetAttribute(item, "nome", params.nome)

doItemSetAttribute(item, "description", params.description)

doTransformItem(item, newid)

doPlayerSendMailByName(getCreatureName(params.cid), item, 1)

doPlayerSendTextMessage(cid, 27, "You catch a Pokemon! ("..i..").")

doPlayerSendTextMessage(cid, 27, "You already holding six pokemons, your new pokemon will be teleported to the Pokemon Center!")

else

item = doCreateItemEx(params.ball)

doItemSetAttribute(item, "poke", params.poke)

doItemSetAttribute(item, "nome", params.nome)

doItemSetAttribute(item, "description", params.description)

doPlayerAddItemEx(params.cid, item, true)

doTransformItem(item, newid)

doPlayerSendTextMessage(cid, 27, "You catch a Pokemon! ("..i..").")

end

if #getCreatureSummons(cid) >= 1 then

doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 173)

else

doSendMagicEffect(getThingPos(cid), 173)

end

end

 

local description = "Contains a "..i.."."

local poke1 = "This is "..i.."'s pokeball. HP = ["..x.health.."/"..x.maxhealth.."]"

addEvent(capturou, 4000, {cid = cid, poke = poke1, nome = i, description = description, ball = 2219, letter = 2597})

else

function ruim(params)

if not isCreature(params.cid) then

return true

end

doPlayerSendTextMessage(params.cid, 27, "Sorry, your poke ball broke.")

if #getCreatureSummons(params.cid) >= 1 then

doSendMagicEffect(getThingPos(getCreatureSummons(params.cid)[1]), 166)

else

doSendMagicEffect(getThingPos(params.cid), 166)

end

end

addEvent(ruim, 4000, {cid = cid})

doSendMagicEffect(topos, fail)

end

end

end

end

return TRUE

end

 

 

 

 

 

data\talkactions\scripts\createpokeball.lua

Esse script é um comando que faz o pokemon

 

function onSay(cid, words, param)

if param == 'water' then

doAreaCombatHealth(cid, WATERDAMAGE, getThingPos(getCreatureSummons(cid)[1]), 0, -100, -101, 255)

elseif param == 'fire' then

doAreaCombatHealth(cid, FIREDAMAGE, getThingPos(getCreatureSummons(cid)[1]), 0, -100, -101, 255)

elseif param == 'psy' then

doAreaCombatHealth(cid, PSYCHICDAMAGE, getThingPos(getCreatureSummons(cid)[1]), 0, -100, -101, 255)

elseif param == 'grass' then

doAreaCombatHealth(cid, GRASSDAMAGE, getThingPos(getCreatureSummons(cid)[1]), 0, -100, -101, 255)

elseif param == 'ice' then

doAreaCombatHealth(cid, ICEDAMAGE, getThingPos(getCreatureSummons(cid)[1]), 0, -100, -101, 255)

 

elseif param == 'normal' then

doAreaCombatHealth(cid, NORMALDAMAGE, getThingPos(getCreatureSummons(cid)[1]), 0, -100, -101, 255)

elseif param == 'ghost' then

doAreaCombatHealth(cid, GHOSTDAMAGE, getThingPos(getCreatureSummons(cid)[1]), 0, -100, -101, 255)

elseif param == 'ground' then

doAreaCombatHealth(cid, GROUNDDAMAGE, getThingPos(getCreatureSummons(cid)[1]), 0, -100, -101, 255)

elseif param == 'electric' then

doAreaCombatHealth(cid, ELECTRICDAMAGE, getThingPos(getCreatureSummons(cid)[1]), 0, -100, -101, 255)

elseif param == 'flying' then

doAreaCombatHealth(cid, FLYDAMAGE, getThingPos(getCreatureSummons(cid)[1]), 0, -100, -101, 255)

elseif param == 'rock' then

doAreaCombatHealth(cid, ROCKDAMAGE, getThingPos(getCreatureSummons(cid)[1]), 0, -100, -101, 255)

elseif param == 'dragon' then

doAreaCombatHealth(cid, DRAGONDAMAGE, getThingPos(getCreatureSummons(cid)[1]), 0, -100, -101, 255)

elseif param == 'poison' then

doAreaCombatHealth(cid, POISONDAMAGE, getThingPos(getCreatureSummons(cid)[1]), 0, -100, -101, 255)

elseif param == 'fight' then

doAreaCombatHealth(cid, FIGHTINGDAMAGE, getThingPos(getCreatureSummons(cid)[1]), 0, -100, -101, 255)

elseif param == 'bug' then

doAreaCombatHealth(cid, BUGDAMAGE, getThingPos(getCreatureSummons(cid)[1]), 0, -100, -101, 255)

elseif param == 'sand' then

setPlayerStorageValue(cid, 60996, getPlayerStorageValue(cid, 60996).."oi")

doSendAnimatedText(getThingPos(cid), getPlayerStorageValue(cid, 60996), 35)

else

local description = "Contains a "..param.."."

local poke1 = "This is "..param.."'s pokeball. HP = [1/1]"

item = doCreateItemEx(2219)

doItemSetAttribute(item, "poke", poke1)

doItemSetAttribute(item, "nome", "Weedle")

doItemSetAttribute(item, "description", description)

doItemSetAttribute(item, "icone", "yes")

doItemSetAttribute(item, "morta", "no")

doPlayerAddItemEx(cid, item, true)

doTransformItem(item, 2222)

 

end

 

return 1

end

 

 

Se presisar de mais algum script eu passo...

Me ajudem por favorrr ;s

Link para o comentário
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

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