Ir para conteúdo
  • Cadastre-se

(Resolvido)Script Look Bonus Level PDA


Ir para solução Resolvido por zipter98,

Posts Recomendados

Ola Galera eu estou querendo editar um Script aki de Look da ball do PDA onde Mostra o Level do Pokemon e a quantia de Level que ele Upou nesse Pokemon (Para Saber o tanto de Level que o Jogador Upou de Level do Pokemon)

 

Fica +- assim o look:

 

13:41 You see a Moon Ball.
It contains a Shiny Oddish [level 14].
 [bonus level:  +7].
It is female.
--- Status ---
Offense: 52 Defense: 58
Agility: 1 Sp. Attack: 78
Vitality: 130
 
- Ou Seja o Jogador Upou 7 Leveis do Pokemon
 
Bonus Level: é o Acumulativo de Level do Pokemon  
 
- Intao eu quero que Acumula o Valor do Level do Pokemon o script do look:
 

local NPCBattle = {


["Brock"] = {artig = "He is", cidbat = "Pewter"},
["Misty"] = {artig = "She is", cidbat = "Cerulean"},
["Blaine"] = {artig = "He is", cidbat = "Cinnabar"},
["Sabrina"] = {artig = "She is", cidbat = "Saffron"}, --alterado v2.9 \/ peguem tudo!
["Kira"] = {artig = "She is", cidbat = "Viridian"},
["Koga"] = {artig = "He is", cidbat = "Fushcia"},
["Erika"] = {artig = "She is", cidbat = "Celadon"},
["Surge"] = {artig = "He is", cidbat = "Vermilion"},
}

function onLook(cid, thing, position, lookDistance)


local str = {}

if not isCreature(thing.uid) then
local iname = getItemInfo(thing.itemid)
if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then

unLock(thing.uid)
local lock = getItemAttribute(thing.uid, "lock")
local pokename = getItemAttribute(thing.uid, "poke")

table.insert(str, "You see "..iname.article.." "..iname.name..".")
if getItemAttribute(thing.uid, "unique") then
table.insert(str, " It's an unique item.")
end
table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename.." [level "..getItemAttribute(thing.uid, "level").."].\n [bonus level: "..(getItemAttribute(thing.uid, "level")).."].\n")
if lock and lock > 0 then
table.insert(str, "It will unlock in ".. os.date("%d/%m/%y %X", lock)..".\n")
end
local boost = getItemAttribute(thing.uid, "boost") or 0
if boost > 0 then
table.insert(str, "Boost level: +"..boost..".\n")
end
if getItemAttribute(thing.uid, "nick") then
table.insert(str, "It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n")
end
if getItemAttribute(thing.uid, "gender") == SEX_MALE then
table.insert(str, "It is male.")
elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
table.insert(str, "It is female.")
else
table.insert(str, "It is genderless.")
end
table.insert(str, "\n--- Status ---")
table.insert(str, "\nOffense: "..math.floor(getItemAttribute(thing.uid, "offense")).." Defense: "..math.floor(getItemAttribute(thing.uid, "defense")).."\n")
table.insert(str, "Agility: "..math.floor(getItemAttribute(thing.uid, "speed")).." Sp. Attack: "..math.floor(getItemAttribute(thing.uid, "specialattack")).."\n")
table.insert(str, "Vitality: "..math.floor(getItemAttribute(thing.uid, "vitality")).."")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
return false

elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then

table.insert(str, "You see a "..string.lower(iname.name).." ["..getItemAttribute(thing.uid, "level").."]. ")
if isContainer(thing.uid) then
table.insert(str, "(Vol: "..getContainerCap(thing.uid)..")")
end
table.insert(str, "\n")

if getItemAttribute(thing.uid, "gender") == SEX_MALE then
table.insert(str, "It is male.")
elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
table.insert(str, "It is female.")
else
table.insert(str, "It is genderless.")
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
return false

elseif isContainer(thing.uid) then --containers

if iname.name == "dead human" and getItemAttribute(thing.uid, "pName") then
table.insert(str, "You see a dead human (Vol:"..getContainerCap(thing.uid).."). ")
table.insert(str, "You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a ")
table.insert(str, getItemAttribute(thing.uid, "attacker")..".")
else
table.insert(str, "You see "..iname.article.." "..iname.name..". (Vol:"..getContainerCap(thing.uid)..").")
end
if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
table.insert(str, "\nItemID: ["..thing.itemid.."]")
local pos = getThingPos(thing.uid)
table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]")
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
return false

elseif getItemAttribute(thing.uid, "unique") then --alterado v2.8 \/
local p = getThingPos(thing.uid)

table.insert(str, "You see ")
if thing.type > 1 then
table.insert(str, thing.type.." "..iname.plural..".")
else
table.insert(str, iname.article.." "..iname.name..".")
end
table.insert(str, " It's an unique item.\n"..iname.description)

if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
table.insert(str, "\nItemID: ["..thing.itemid.."]")
table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]")
end

sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str))
return false

else
return true
end
end

local npcname = getCreatureName(thing.uid)
if isNpc(thing.uid) and NPCBattle[npcname] then --npcs duel
table.insert(str, "You see "..npcname..". "..NPCBattle[npcname].artig.." leader of the gym from "..NPCBattle[npcname].cidbat..".")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
return false
end
if getPlayerStorageValue(thing.uid, 697548) ~= -1 then --npcs de TV
table.insert(str, getPlayerStorageValue(thing.uid, 697548))
local pos = getThingPos(thing.uid)
if youAre[getPlayerGroupId(cid)] then
table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]")
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
return false
end

if not isPlayer(thing.uid) and not isMonster(thing.uid) then
table.insert(str, "You see "..getCreatureName(thing.uid)..".")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
return false
end
local torneio = (getPlayerStorageValue(thing.uid,130131) +1)
local loses = (getPlayerStorageValue(thing.uid,19998) +1)
local wins = (getPlayerStorageValue(thing.uid,19999) +1)
local rank = (getPlayerClanRank(thing.uid)+0)
if isPlayer(thing.uid) then
doPlayerSendTextMessage(cid, 25,"You See "..getCreatureName(thing.uid).."\n Level: ["..getPlayerLevel(thing.uid).."].\nClan: ["..getPlayerClanName(thing.uid).."] - Rank: ["..rank.."].\nGuild: ["..getPlayerGuildName(thing.uid).."] - Rank: ["..getPlayerGuildRank(thing.uid).."].\nWins: ["..wins.."].\nLoses: ["..loses.."].\nTorneio: ["..torneio.."].")
return false
end

if getCreatureName(thing.uid) == "Evolution" then return false end

if not isSummon(thing.uid) then
table.insert(str, "You see a wild "..string.lower(getCreatureName(thing.uid)).." [level "..getPokemonLevel(thing.uid).."].\n")
if getPokemonGender(thing.uid) == SEX_MALE then
table.insert(str, "It is male.")
elseif getPokemonGender(thing.uid) == SEX_FEMALE then
table.insert(str, "It is female.")
else
table.insert(str, "It is genderless.")
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
return false

elseif isSummon(thing.uid) and not isPlayer(thing.uid) then
local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
local boostshow = " + "..boostlevel.."]"
if showBoostSeparated then
boostshow = "] [+"..boostlevel.."]"
end
local levelinfo = "["..getPokemonLevel(thing.uid)..""..boostshow..""
if getCreatureMaster(thing.uid) == cid then
local myball = getPlayerSlotItem(cid, 8).uid
local nexp = getItemAttribute(myball, "nextlevelexp")
table.insert(str, "You see your "..string.lower(getCreatureName(thing.uid)).." "..levelinfo..".")
table.insert(str, "\nVida: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
table.insert(str, "\n"..getPokemonHappinessDescription(thing.uid))
if getItemAttribute(myball, "level") <= 299 then
table.insert(str, "\nExperiencia Para Proximo Level: ["..nexp.."].")
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid)).." "..levelinfo..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".\nVida: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
end
return false
end
return true
end

 
- Funçao da Lib que adiciona Level ao Pokemon Caso Precise:
 

function adjustPokemonLevel(item, cid, id, rarecandy)



if not isCreature(cid) then return true end

local exp = getItemAttribute(item, "exp")
local level = getItemAttribute(item, "level")



local leveltable = getPokemonExperienceTable(getPokeballName(item, true))
local newlevel = 1

for x = 1, 300 do
if exp >= leveltable[x] and exp < leveltable[x+1] then
newlevel = x
end
end

if newlevel <= 1 then return true end

local levelsup = (newlevel - level)

local pokemon = getItemAttribute(item, "poke")
local happy = getItemAttribute(item, "happy")
local rate = happy / happy
local newhappiness = happy

if happy >= 250 then
newhappiness = 255
elseif happy >= 230 then
newhappiness = happy + 4
elseif happy >= 210 then
newhappiness = happy + 6
elseif happy >= 180 then
newhappiness = happy + 8
elseif happy >= 140 then
newhappiness = happy + 10
elseif happy >= 110 then
newhappiness = happy + 12
else
newhappiness = happy + 15
end

local status = getPokemonStatus(pokemon)

local off = status.off * rate * levelsup
local def = status.def * rate * levelsup
local agi = status.agi * rate * levelsup
local spatk = status.spatk * rate * levelsup
local vit = status.vit * rate * levelsup

doItemSetAttribute(item, "level", newlevel)


if not rarecandy then
doItemSetAttribute(item, "happy", newhappiness)
end

local nextexp = leveltable[newlevel + 1] - exp
doItemSetAttribute(item, "nextlevelexp", nextexp)



doItemSetAttribute(item, "offense", getItemAttribute(item, "offense") + off)
doItemSetAttribute(item, "defense", getItemAttribute(item, "defense") + def)
doItemSetAttribute(item, "speed", getItemAttribute(item, "speed") + agi)
doItemSetAttribute(item, "specialattack", getItemAttribute(item, "specialattack") + spatk)
doItemSetAttribute(item, "vitality", getItemAttribute(item, "vitality") + vit)

if newlevel > getPlayerLevel(cid) + pokemonMaxLevelAbovePlayer then
addEvent(doPlayerSendTextMessage, 30, cid, 18, "Warning: Your "..getPokeballName(item).."'s ["..newlevel.."] level is much higher than yours, so you will not be able to call him to battles.")
end

if isCreature(cid) and id >= 1 and isBeingUsed(id) then
adjustStatus(getCreatureSummons(cid)[1], item, false, true)
doPlayerSendTextMessage(cid, 27, "• Level: "..newlevel.." (+"..levelsup..") • Offense: +"..doMathDecimal(off).." • Defense: +"..doMathDecimal(def).." • Spc. Atk: +"..doMathDecimal(spatk).." • Agility: +"..doMathDecimal(agi).." • Vitality: +"..doMathDecimal(vit).."")

if happy < minHappyToEvolve then return true end

if pokemonsCanEvolveByLevel then

local summon = getCreatureSummons(cid)[1]

local reqlevel = poevo[getCreatureName(summon)] and poevo[getCreatureName(summon)].level or -1
local level = getItemAttribute(item, "level")
local evolution = "none"
local name = getCreatureName(summon)

if name == "Tyrogue" and level >= 20 then
if getOffense(summon) == getDefense(summon) then
evolution = "Hitmontop"
elseif getOffense(summon) > getDefense(summon) then
evolution = "Hitmonlee"
else
evolution = "Hitmonchan"
end
elseif name == "Eevee" then
if happy >= maxHappyToEvolve then
if isDay() then
evolution = "Espeon"
else
evolution = "Umbreon"
end
end
elseif name == "Slowpoke" and level >= 28 then
evolution = "Slowbro"
elseif name == "Poliwhirl" and level >= 36 then
evolution = "Poliwrath"
elseif reqlevel > 4 and level >= reqlevel then
evolution = poevo[getCreatureName(summon)].evolution
elseif reqlevel == 2 and happy >= maxHappyToEvolve then
evolution = poevo[getCreatureName(summon)] and poevo[getCreatureName(summon)].evolution or "none"
end

if evolution ~= "none" then
doStartEvolution(summon, evolution, 4)
end
end
end
end

 
Rep + Para quem Ajudar Vlw =)
Editado por Rodrigo Augusto (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • Solução

Na função da lib, abaixo de:

local status = getPokemonStatus(pokemon)

você coloca:

local bonus_level = getItemAttribute(item, "b_level") or 0

Depois, abaixo de:

doItemSetAttribute(item, "level", newlevel)

você coloca:

doItemSetAttribute(item, "b_level", bonus_level + 1)

No código do look, você troca:

table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename.." [level "..getItemAttribute(thing.uid, "level").."].\n [Bonus level: "..(getItemAttribute(thing.uid, "level")).."].\n")

por:

local bonus_level = getItemAttribute(thing.uid, "b_level") or 0
table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename.." [level "..getItemAttribute(thing.uid, "level").."].\n [Bonus level: +"..bonus_level.."].\n")

PS: Isso só vai funcionar com pokémons criados/capturados após a atualização acima.

Editado por zipter98 (veja o histórico de edições)

não respondo pms solicitando suporte em programação/scripting

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo