-
Total de itens
14 -
Registro em
-
Última visita
Posts postados por DanijoBR
-
-
-
Em 27/10/2021 em 19:54, thepota disse:
Desenvolvi por muito tempo uma base Pokémon do 0 (parti do TFS 1.2 e fui implementando tudo até chegar nessa versão que estou disponibilizando). O resultado é um servidor extremamente leve e estável (já testado com 100+ players e por mais de 1 mês sem cair). Basicamente, ele suporta tranquilamente 1k+ players e não tem nenhum bug conhecido que faça com que ele caia.
Esse servidor ficou no ar por muito tempo (mais de 2 anos) e era conhecido como PokeDash. Acabei ficando sem tempo para administrar o servidor, o que fez com que a maioria dos players parassem de jogar e com que eu fechasse de vez.
Pensei por muito tempo sobre o que fazer com ele, e decidi disponibilizar para a comunidade. Trata-se de algo único (eu ao menos nunca vi um servidor de Pokémon construído a partir do TFS 1.2)!
Como desenvolvi todos os sistemas do 0, tomei cuidado para fazer tudo da melhor maneira possível e para que possa ser facilmente modificado e atualizado. Basicamente, os Pokémons podem ser criados a partir de um único arquivo XML (como monstros do Tibia), e nesse arquivo você pode especificar tudo, desde level máximo e mínimo de spawn, loots, tipos (fogo, agua, etc), se ele pode usar habilidades (surf, fly, etc), moves (quando alguém captura), ataques (quando selvagem), evoluções, chance de catch, etc.
Exemplo de Pokemon
<?xml version="1.0" encoding="ISO-8859-1"?> <monster name="Abra" nameDescription="an abra" race="psychic" race2="none" experience="31" speed="180" manacost="0"> <level min="10" max="25"/> <health now="527" max="527" /> <look type="966" head="113" body="57" legs="95" feet="113" corpse="26924" /> <targetchange interval="5000" chance="0" /> <flags> <flag summonable="1" /> <flag attackable="1" /> <flag hostile="1" /> <flag passive="0" /> <flag illusionable="1" /> <flag convinceable="1" /> <flag pushable="1" /> <flag canpushitems="1" /> <flag canpushcreatures="0" /> <flag targetdistance="1" /> <flag staticattack="97" /> <flag runonhealth="0" /> <flag dexentry="63" /> <flag portraitid="27179" /> <flag hasshiny="0" /> <flag hasmega="0" /> <flag flyable="0" /> <flag rideable="0" /> <flag surfable="0" /> <flag canteleport="1" /> <flag catchchance="23" /> <flag moveMagicAttackBase="105" /> <flag moveMagicDefenseBase="55" /> </flags> <script> <event name="MonsterHealthChange"/> <event name="CorpseLevel"/> <event name="CorpseLoot"/> </script> <moves> <move name="double slap" interval="3000" isTarget="1" range="1"/> <move name="zen headbutt" interval="7000" isTarget="1"/> </moves> <evolutions> <evolution name="Kadabra" level="25" chance="50" itemName="enigma stone" count="1"/> </evolutions> <attacks> <attack name="melee" interval="2000" min="-20" max="-20" /> <attack name="double slap" interval="3000" chance="40" range="1" target="1"/> <attack name="zen headbutt" interval="7000" chance="40" target="1"/> </attacks> <defenses armor="0" defense="15" > </defenses> <elements> </elements> <immunities> </immunities> <voices interval="5000" chance="10"> <voice sentence="ABRA!" /> </voices> <loot> <item name="enigma stone" countmax="1" chance="88"/> <item name="gold coin" countmax="35" chance="40000"/> <item name="blue gem" countmax="2" chance="10000"/> <item name="future orb" countmax="2" chance="30000"/> </loot> </monster>
Resumo de alguns sistemas (tem muita coisa, então coloquei os principais)
✅ Pokemons com level, status e boost. O level do player/boost também influencia no status dos pokes.
✅ Sistema de Love (seu poke fica mais forte que os demais quando upa de level matando pokemons mais fortes que ele).
✅ Base propria com Shinys e Ancients.
✅ Cada player pode conseguir ancient stone para evoluir 1 shiny para ancient através de quest.
✅ Moves bar e pokemon bar (troca de pokemon com 1 click).
✅ Autoloot agrupando em bags.
✅ Ganho de exp ao capturar/dar dex em pokes com um bonus adicional para o primeiro catch de cada poke.
✅ Mapa original com mais de 40 quests, incluindo outland com Ancients.
✅ Eventos diários automáticos: Futebol todo dia 19:30, arena PVP todo dia 20:00, golden arena aos sabados 17:00, bag premiada aos domingos/feriados 17:00.
✅ Profissões (facilmente customizáveis):
- Catcher: 3.5% mais chance de capturar um Pokemon.
- Hunter: 10% mais status de dano para o seu Pokemon (tanto magico quanto fisico).
- Blocker: 25% mais vida para seus Pokemons.
- Healer: 100% mais cura que aplica tanto em potions quando moves dos seus Pokemons.
- Explorer: 15% mais experiencia para seu personagem durante a caça.
✅ Task diária de catch/loot dando Tokens. Os tokens podem ser trocados por itens raros (dentre eles premier ball e bags personalizadas) além de pagar seu curso com o NPC Job Manager para aprender uma das profissões acima. Uma das maneiras de conseguir tokens é fazendo tasks diárias.
✅ Muito mais!
Screenshots
Download
Baixe o pack contendo o servidor, cliente, site, editor de mapa e editor de itens clique aqui!. Caso considere minha contribuição interessante para a comunidade, considere realizar uma doação para a chave pix: server.pokedash@gmail.com
GM account: gm/gmgmgm
O projeto será atualizado em sua homepage: https://pokedashpota.vercel.app/
Sources
Tem sistema de moto no seu game?,Tô precisando de script e sprite pra adicionar no meu haha
-
Em 28/05/2020 em 11:58, Paraibaano disse:
Pode me falar como vc conseguiu, fiz a mesma coisa que você porém não sei oq mudar no config.lua do servidor pra ele se conectar com o site na hospedagem
-
-
Chama discord Danijo#9360
-
Em 06/10/2021 em 10:43, georgelxll disse:
Simples, manda o script da bike e o Id do player montado na moto, tanto male quanto female, manda tbm o Id da sprite da chave que vc quer que seja a moto que eu mando o script feito pra vc e te explico tbm como funciona
Opa, pode me ajudar ainda?
-
Aluguei uma hospedagem de site e um domínio de site
Configurei e o site está funcionado
Mas não sei como configuro o config.lua do servidor pra ele achar os arquivos SQL e ligar o Server
, eu rodava via xampp e sempre foi bem simples porém eu quis mudar pra hospedagem paga para abrir no computador, celular de qualquer pessoa
Se alguém puder me ajudar agradeço muito
-
4 horas atrás, georgelxll disse:
Esse seu sistema de bike usa portrait ... quando vc clica na bike pra andar, a chavinha da bike muda alguma coisa ou algo do tipo assim?
Faltou mandar o action da bike, que você usa pra clicar, na pasta Action deve ter alguma coisa relacionada a bike
Fiz a alteração nos dois scripts, tanto do Player quanto da moto, só que para usar, você precisa me passar antes o action que tá faltando, ai mando todos os 3 de uma vez pra vc e já te explico a alteração que fiz
Clico na chave da bike porém não muda nada,o personagem apenas muda de sprite e fica em cima da bike
Mais tarde a noite eu procuro e mando oq esta faltando
1 minuto atrás, DanijoBR disse:Clico na chave da bike porém não muda nada,o personagem apenas muda de sprite e fica em cima da bike
Mais tarde a noite eu procuro e mando oq esta faltando
Eu estou usando uma script que tá funcionando a moto no game
Porém o erro é que:
Quando estou usando a moto eu consigo jogar a chave no chão e alguem pode clicar e usar a moto
Eu uso a moto
Jogo a chave no chao e não perco a sprite da moto,ai se eu jogar qualquer um pode clicar e usar a sprite também, mesmo não tendo a chave
Vc sabe alterar script para não poder jogar no chão enquanto estiver usando
3 minutos atrás, DanijoBR disse:Clico na chave da bike porém não muda nada,o personagem apenas muda de sprite e fica em cima da bike
Mais tarde a noite eu procuro e mando oq esta faltando
Eu estou usando uma script que tá funcionando a moto no game
Porém o erro é que:
Quando estou usando a moto eu consigo jogar a chave no chão e alguem pode clicar e usar a moto
Eu uso a moto
Jogo a chave no chao e não perco a sprite da moto,ai se eu jogar qualquer um pode clicar e usar a sprite também, mesmo não tendo a chave
Vc sabe alterar script para não poder jogar no chão enquanto estiver usando
Pq eu te mando Vc altera e soluciona o problema facilmente
Eu já adicionei 4 motos diferentes e estão funcionando porém tem esse problema de poder jogar no chão enquanto esta em use
8 horas atrás, georgelxll disse:Esse seu sistema de bike usa portrait ... quando vc clica na bike pra andar, a chavinha da bike muda alguma coisa ou algo do tipo assim?
Faltou mandar o action da bike, que você usa pra clicar, na pasta Action deve ter alguma coisa relacionada a bike
Fiz a alteração nos dois scripts, tanto do Player quanto da moto, só que para usar, você precisa me passar antes o action que tá faltando, ai mando todos os 3 de uma vez pra vc e já te explico a alteração que fiz
moto que esta com problema : quando estou usando ela eu consigo jogar o item chave no chao e ainda fico usando ela,qualquer player pode cliclar na mesma chave que esta no chão e tambem usar ela
actions.xml
<action itemid="30136" event="script" value="moto.lua"/>
<action itemid="30137" event="script" value="motoverde.lua"/>
<action itemid="30138" event="script" value="motoazul.lua"/>
<action itemid="30139" event="script" value="motoamarela.lua"/>items.xml
</item>
<item id="30136" article="a" name="moto vermelha">
<attribute key="slotType" value="ring" />
</item>
<item id="30137" article="a" name="moto verde">
<attribute key="slotType" value="ring" />
</item>
<item id="30138" article="a" name="moto azul">
<attribute key="slotType" value="ring" />
</item>
<item id="30139" article="a" name="moto amarela">
<attribute key="slotType" value="ring" />
moto.lua ( motoverde.lua, motoazul.lua, motoamarela.lua ) todos estao com mesmo script mas com nomes diferentes em arquivos lua diferentes para nao dar problema.
function onUse(cid, item, frompos, item2, topos)
local bike = {lookType = 2590 } --- LookType do player em cima da bike.
local speed = 1500 --- Velocidade que a bike terá.if getPlayerStorageValue(cid, 32001) == 1 then
setPlayerStorageValue(cid, 32001, 0)
doRemoveCondition(cid, CONDITION_OUTFIT)
doSendAnimatedText(getCreaturePosition(cid), 'Moto OFF!', 32)
doChangeSpeed(cid, -speed)
doPlayerSendTextMessage(cid, MESSSAGE_STATUS_CONSOLE_ORANGE, 'Voce desmontou da moto.')else
doChangeSpeed(cid, speed)
doSetCreatureOutfit(cid, bike, -1)
doSendAnimatedText(getCreaturePosition(cid), 'Moto ON!', 32)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Voce montou na moto.')
setPlayerStorageValue(cid, 32001, 1)end
return true
end -
Em 14/10/2020 em 18:57, Nysman disse:
Resolvido, ninguém ajuda mais no forum, pode fechar.
No meu caso velocidade vai pra 10 assim que saio da bike haha,Você pode me ajudar por favor
-
Em 06/10/2021 em 10:43, georgelxll disse:
Simples, manda o script da bike e o Id do player montado na moto, tanto male quanto female, manda tbm o Id da sprite da chave que vc quer que seja a moto que eu mando o script feito pra vc e te explico tbm como funciona
Moto.Lua
function onUse(cid, item)
if (getPlayerSlotItem(cid, PLAYER_SLOT_KEY_ITEM).uid ~= item.uid) then
doPlayerSendCancel(cid, "To use this bike, put in the correct slot.")
elseif (not isBiking(cid)) then
if (isPokemonOnline(cid)) then
inUseBall(cid, getPlayerSlotItem(cid, PLAYER_SLOT_BALL))
endif (isPokemonOnline(cid) or getPlayerMounted(cid) or isFishing(cid) or isPlayerOnPvpArena(cid)) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
else
doPlayerRideBike(cid, item)
end
else
doPlayerDeRideBike(cid, item)
end
return true
end
Player. lua
-- Local vars
local OUTFIT_BIKE_MALE = createConditionObject(CONDITION_OUTFIT)
setConditionParam(OUTFIT_BIKE_MALE, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(OUTFIT_BIKE_MALE, { lookType = 1744 })local OUTFIT_BIKE_FEMALE = createConditionObject(CONDITION_OUTFIT)
setConditionParam(OUTFIT_BIKE_FEMALE, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(OUTFIT_BIKE_FEMALE, { lookType = 1743 })local UNLOCKED_MACH_BIKE_ID = 13218
local LOCKED_MACH_BIKE_ID = 13480local EMPTY_PORTRAIT_ID = 12853
local EVOLVE_ICON_OFF_ID = 13205
local ORDER_ICON_OFF_ID = 13206
local DUEL_ICON_OFF_ID = 13207
local EVOLVE_ICON_ID = 13204
local ORDER_ICON_ID = 7730
local DUEL_ICON_ID = 13016
local PORTRAIT_CONTAINER_SIZE = 9
local EMPTY_SKILL_ID = 13442
--[[local UNLOCKED_OXYGEN_MASK_ID = 13299
local LOCKED_OXYGEN_MASK_ID = 13300]]-- Get
function getPlayerPokemon(cid)
return getCreatureStorage(cid, playersStorages.pokemonUid)
endfunction getPlayerPokemonName(cid, referenceName)
local pokemon = getPlayerPokemon(cid)
if (isCreature(pokemon)) then
if (referenceName and isPokemonTransformed(pokemon)) then
return getPokemonCurrentTransformation(pokemon)
end
return getCreatureName(pokemon)
endif (referenceName) then
local ball = getPlayerBall(cid)
if (isItem(ball)) then
local transform = getBallCurrentTransform(ball.uid)
if (transform) then
return transform
end
end
endreturn getCreatureStorage(cid, playersStorages.pokemonName)
endfunction getPlayerPokemonNickname(cid)
local pokemon = getPlayerPokemon(cid)
if (isCreature(pokemon)) then
return getCreatureNickname(pokemon)
endlocal ball = getPlayerBall(cid)
if (isItem(ball)) then
local nick = getBallPokemonNickname(ball.uid)
if (nick and nick ~= -1) then
return nick
end
endreturn getCreatureStorage(cid, playersStorages.pokemonName)
endfunction getPlayerBall(cid)
return getPlayerSlotItem(cid, CONST_SLOT_FEET)
endfunction getPlayerPokemonLevel(cid)
return getBallPokemonLevel(getPlayerBall(cid).uid)
endfunction getPlayerPokemonExperience(cid)
return getBallPokemonExp(getPlayerBall(cid).uid)
endfunction getPlayerPokemonNickname(cid)
return getBallPokemonNickname(getPlayerBall(cid).uid) or getBallPokemonName(getPlayerBall(cid).uid)
endfunction getPlayerTotalBattleWin(cid)
return getPlayerSkillLevel(cid, PLAYER_SKILL_BATTLE_WIN)
endfunction getPlayerTotalBattleLoss(cid)
return getPlayerSkillLevel(cid, PLAYER_SKILL_BATTLE_LOSS)
endfunction getPlayerRespect(cid)
return getPlayerSoul(cid)
endfunction getPlayerBackPosition(cid)
local t = string.explode(getCreatureStorage(cid, playersStorages.tradeBackPosition), ";")
if (t) then
local pos = { x = t[2], y = t[3], z = t[4] }
if (isWalkable(cid, pos)) then
return pos
end
endreturn getTownTemplePosition(getPlayerTown(cid))
end--[[
function getPlayerPvpArenaBackPosition(cid)
local pvpArenaBackPositionTable = string.explode(getCreatureStorage(cid, playersStorages.pvpArenaBackPosition), ";")
return {x = pvpArenaBackPositionTable[2], y = pvpArenaBackPositionTable[3], z = pvpArenaBackPositionTable[4]}
end
]]
function getPlayerAllBallsWithPokemon(cid)
local ballsWithPokemon = {}local ballSlotItem = getPlayerSlotItem(cid, PLAYER_SLOT_BALL)
if (isItem(ballSlotItem) and isBallWithPokemon(ballSlotItem.uid)) then
table.insert(ballsWithPokemon, ballSlotItem)
endlocal playerBackpack = getPlayerSlotItem(cid, PLAYER_SLOT_BACKPACK)
if (isItem(playerBackpack) and isContainer(playerBackpack.uid)) then
local items = getContainerItems(playerBackpack.uid)
local i = #items
local currentItemwhile (i > 0) do
currentItem = items[i]if (isContainer(currentItem.uid)) then
items = table_concat(items, getContainerItems(currentItem.uid))
elseif (isBallWithPokemon(currentItem.uid)) then
table.insert(ballsWithPokemon, currentItem)
endtable.remove(items, i)
i = #items
end
endreturn ballsWithPokemon
end-- Is
function isPlayerOnPvpArena(cid)
return getPlayerPvpArena(cid)
endfunction isExhaust(cid)
return hasCondition(cid, CONDITION_EXHAUST)
endfunction isPokemonOnline(cid)
return isCreature(getPlayerPokemon(cid))
endfunction isSurfing(cid)
return getCreatureStorage(cid, playersStorages.isSurfing) > -1
endfunction isRiding(cid)
return getCreatureStorage(cid, playersStorages.isRiding) > -1
endfunction isFlying(cid)
return getCreatureStorage(cid, playersStorages.isFlying) > -1
endfunction isLevitating(cid)
return getCreatureStorage(cid, playersStorages.isLevitating) > -1
endfunction isFishing(cid)
return getCreatureStorage(cid, playersStorages.isFishing) > -1
endfunction isDueling(cid)
return getPlayerDueling(cid) --getCreatureStorage(cid, playersStorages.canDuel) > -1
endfunction isEvolving(cid)
return getCreatureStorage(cid, playersStorages.isEvolving) > -1
endfunction isBiking(cid)
return getCreatureStorage(cid, playersStorages.isBiking) > -1
endfunction isDiving(cid)
return getCreatureStorage(cid, playersStorages.isDiving) > -1
endfunction isUnderwater(cid)
return getCreatureStorage(cid, playersStorages.isUnderwater) > -1
endfunction isPlayerWithBackpackFull(playerUid)
local playerBackpackUid = getPlayerSlotItem(playerUid, PLAYER_SLOT_BACKPACK).uid
return getContainerCap(playerBackpackUid) == getContainerSize(playerBackpackUid)
endfunction getSafariZone(cid)
return getCreatureStorage(cid, playersStorages.safariZone) > -1
end-- Set
function setSafariZone(cid, status)
doCreatureSetStorage(cid, playersStorages.safariZone, (status and 1 or -1))
end--[[
function setPlayerPvpArena(cid, status, team, backPosition)
if (status) then
doCreatureSetStorage(cid, playersStorages.isOnPvpArena, 1)
else
doCreatureSetStorage(cid, playersStorages.isOnPvpArena, -1)
end
doCreatureSetStorage(cid, playersStorages.pvpArenaTeam, team)
doCreatureSetStorage(cid, playersStorages.pvpArenaBackPosition, ";" .. backPosition.x .. ";" .. backPosition.y .. ";" .. backPosition.z)
doPlayerSetPvpArena(cid, status, team)
end
]]function setFishingStatus(cid, status)
doCreatureSetStorage(cid, playersStorages.isFishing, (status and 1 or -1))
endfunction setSurfingStatus(cid, status)
doCreatureSetStorage(cid, playersStorages.isSurfing, (status and 1 or -1))
endfunction setRidingStatus(cid, status)
doCreatureSetStorage(cid, playersStorages.isRiding, (status and 1 or -1))
endfunction setFlyingStatus(cid, status)
doCreatureSetStorage(cid, playersStorages.isFlying, (status and 1 or -1))
endfunction setLevitatingStatus(cid, status)
doCreatureSetStorage(cid, playersStorages.isLevitating, (status and 1 or -1))
endfunction setDivingStatus(cid, status)
doCreatureSetStorage(cid, playersStorages.isDiving, (status and 1 or -1))
endfunction setBikingStatus(cid, status)
doCreatureSetStorage(cid, playersStorages.isBiking, (status and 1 or -1))
endfunction setUnderwaterStatus(cid, status)
doCreatureSetStorage(cid, playersStorages.isUnderwater, (status and 1 or -1))
endfunction setPlayerVulnerable(cid, vulnerable)
local playerGroupId = getPlayerGroupId(cid)if (playerGroupId == 1 and not vulnerable) then -- Player vulnerable coming unvulnerable
setPlayerGroupId(cid, 7)elseif (playerGroupId == 7 and vulnerable) then -- Player unvulnerable coming vulnerable
setPlayerGroupId(cid, 1)elseif (playerGroupId == 2 and not vulnerable) then -- Tutor vulnerable coming unvulnerable
setPlayerGroupId(cid, 8)elseif (playerGroupId == 8 and vulnerable) then -- Tutor unvulnerable coming vulnerable
setPlayerGroupId(cid, 2)elseif (playerGroupId == 3 and not vulnerable) then -- Tutor vulnerable coming unvulnerable
setPlayerGroupId(cid, 9)elseif (playerGroupId == 9 and vulnerable) then -- Tutor unvulnerable coming vulnerable
setPlayerGroupId(cid, 3)
end
endfunction setPlayerPokemonNickname(cid, newNickname, removing)
local ball = getPlayerBall(cid)setBallPokemonNickname(ball.uid, newNickname, removing)
doBallUpdateDescription(ball.uid)if (isPokemonOnline(cid)) then
setCreatureNickname(getPlayerPokemon(cid), newNickname)
end
endfunction setPlayerBackPosition(cid, newPos)
doCreatureSetStorage(cid, playersStorages.tradeBackPosition, string.concat(";", newPos.x, ";",
newPos.y, ";", newPos.z))
end-- Can
function canBlink(cid)
local time = doMasteryAdvantageCheck(cid, MASTERY_ADVANTAGES.BLINK_COOLDOWN) and 7 or 10
return getCreatureStorage(cid, playersStorages.blink) == -1 or
(os.time() - getCreatureStorage(cid, playersStorages.blink)) >= time
endfunction canLove(cid)
return getCreatureStorage(cid, playersStorages.love) == -1 or
(os.time() - getCreatureStorage(cid, playersStorages.love)) >= 5 * 60
end-- Do
function doPlayerUseBallOnSlot(cid)
if (isPlayer(cid)) then
local item = getPlayerSlotItem(cid, PLAYER_SLOT_BALL)
if (isItem(item)) then
doPlayerUseItem(cid, item.uid)
end
end
endfunction doPlayerRemoveAbilitySpeedCondition(cid)
return doRemoveCondition(cid, CONDITION_HASTE, CONDITION_SUBID.HASTE.ABILITIES)
endfunction doPlayerUpdateOutfit(cid)
doUpdateAbilityOutfitCondition(cid)
doPlayerRemoveAbilitySpeedCondition(cid)
local speedCondition = getAbilitySpeedCondition(cid)
if (speedCondition) then
doAddCondition(cid, speedCondition)
end
endfunction doAddExhaust(cid)
doAddCondition(cid, delayCondition)
endfunction doPlayerAddBattleWin(cid)
doPlayerAddSkill(cid, PLAYER_SKILL_BATTLE_WIN, 1, true)
endfunction doPlayerAddBattleLoss(cid)
doPlayerAddSkill(cid, PLAYER_SKILL_BATTLE_LOSS, 1, true)
endfunction doPlayerAddRespect(cid, amount)
local current = getPlayerSoul(cid)
if (amount > 0) then
if (current < PLAYER_RESPECT_MAX) then
if ((current + amount) < PLAYER_RESPECT_MAX) then
return doPlayerAddSoul(cid, amount)
else
return doPlayerAddSoul(cid, PLAYER_RESPECT_MAX - current)
end
end
else
return doPlayerAddSoul(cid, amount)
end
return false
endfunction doPlayerUpdatePokemonLevelPercent(cid, currentExp, currentLevel)
local TotalExpToNextLevel = getExperienceForLevel(currentLevel + 1)
local TotalExpToCurrentLevel = getExperienceForLevel(currentLevel)
local ExpBetweenLevels = TotalExpToNextLevel - TotalExpToCurrentLevel
local onePercent = math.ceil(ExpBetweenLevels / 100)setPlayerMagicLevelPercent(cid, math.ceil((currentExp - TotalExpToCurrentLevel) / onePercent))
endlocal function doPlayerSendPokemonSkillWindowData(cid, ballUid, moves, pokemonName, showAllMoves)
if (ballUid == 0) then
return -- This occur when a never used ball is put on the slot. getPlayerBall() is called before a ball exists there. Dont worry, this gonna be called again after the fail try. Yes, this is an ungly hack.
endif (not pokemonName) then
pokemonName = getBallPokemonName(ballUid)
endif (not moves) then
moves = getPokemonSkills(pokemonName, ballUid)
endif (not showAllMoves) then -- Eg.: When use Transform ability
local pokemonLevel = getBallPokemonLevel(ballUid)
local eggMoveSlot = getBallEggMoveSlot(ballUid)
local tm1Slot = getBallTmSlot(ballUid, 1)
local tm2Slot = getBallTmSlot(ballUid, 2)
for k, move in ipairs(moves) do
if (getPokemonSkillRequiredLevel(pokemonName, move) > pokemonLevel and
((not eggMoveSlot or k > eggMoveSlot) and
(not tm1Slot or k > tm1Slot) and
(not tm2Slot or k > tm2Slot))) then
moves[k] = nil
end
end
endlocal icons = {}
for _, move in pairs(moves) do
icons[#icons + 1] = getPokemonSkillClientIconId(move)
enddoPlayerSendPokemonSkills(cid, getPokemonFastcallPortraitId(pokemonName), icons)
endlocal function doSendPlayerPokemonCooldowns(cid, ball, moves)
for _, move in pairs(moves) do
local cooldown = getBallSkillCooldown(ball.uid, move)
if (cooldown > 0) then
doPlayerSendPokemonSkillCooldown(cid, getPokemonSkillClientIconId(move), cooldown)
end
end
endfunction doPlayerPokemonAddExperience(player, pokemon, expAmount, multiplier, referenceItem) -- When receive referenceItem(ball), pokemon is ignored
if (expAmount > 0) then
if (multiplier == nil) then
multiplier = true
endlocal ball = isItem(referenceItem) and referenceItem or getPlayerBall(player)
if (getBallFromNpc(ball.uid)) then
return false
endlocal currentLevel = getBallPokemonLevel(ball.uid)
local currentExtraPoints = getBallPokemonExtraPoints(ball.uid)local pokemonName = getBallPokemonName(ball.uid)
local maxExtraPoints = isShinyName(pokemonName) and (POKEMON_EXTRA_POINT_MAX - 10) or POKEMON_EXTRA_POINT_MAXPokemonHeldItem.onGainExperience(player, pokemon, ball, expAmount)
if (currentLevel < POKEMON_LEVEL_MAX or currentExtraPoints < maxExtraPoints) then
if (multiplier) then -- Pokemon Exp Stage
if (currentLevel <= 10) then
expAmount = expAmount * 42
elseif (currentLevel <= 15) then
expAmount = expAmount * 30
elseif (currentLevel <= 20) then
expAmount = expAmount * 16
elseif (currentLevel <= 25) then
expAmount = expAmount * 9
elseif (currentLevel <= 30) then
expAmount = expAmount * 5
elseif (currentLevel <= 50) then
expAmount = expAmount * 3
elseif (currentLevel <= 70) then
expAmount = expAmount * 2
else
expAmount = expAmount * 1.5
endexpAmount = expAmount * 1.25
expAmount = expAmount + math.floor(expAmount * getPlayerExtraExpRate(player))
endlocal oldExperience = getBallPokemonExp(ball.uid)
local newExperience = oldExperience + expAmount
local nextLevelExp = ((50 * (currentLevel) * (currentLevel) * (currentLevel)) - (150 * (currentLevel) * (currentLevel)) + (400 * (currentLevel))) / 3
local gainLevel = 0if (newExperience >= nextLevelExp and currentLevel - getPlayerLevel(player) >= MAX_LEVEL_DIFF_BETWEEN_PLAYER_POKEMON) then
doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_BLUE, string.format(__L(player, "Your Pokemon is %s levels higher than you and is no longer receiving experience as this difference exists."), MAX_LEVEL_DIFF_BETWEEN_PLAYER_POKEMON))
return false
endsetBallPokemonExp(ball.uid, newExperience)
doSendAnimatedText(getCreaturePosition(pokemon and pokemon or player), string.concat("+", expAmount, " EXP"), COLOR_GREEN)
doPlayerSendTextMessage(player, MESSAGE_EVENT_DEFAULT, string.format(__L(player, "Your %s received %s experience point%s."), pokemonName, expAmount, (expAmount > 0 and "s" or "")))while (newExperience >= nextLevelExp) do
gainLevel = gainLevel + 1
nextLevelExp = ((50 * (currentLevel + gainLevel) * (currentLevel + gainLevel) * (currentLevel + gainLevel)) - (150 * (currentLevel + gainLevel) * (currentLevel + gainLevel)) + (400 * (currentLevel + gainLevel))) / 3
endif (gainLevel > 0) then
if (currentLevel < POKEMON_LEVEL_MAX) then
local pokemonPosition = getCreaturePosition(pokemon and pokemon or player)
local maxEnergy = getCreatureMaxMana(player)
local energy = getCreatureMana(player)
local pokemonNickname = getBallPokemonNickname(ball.uid)
local pokemonExtraPoints = getBallPokemonExtraPoints(ball.uid) + gainLevel
local newLevel = currentLevel + gainLevel
local messageClass = getPlayerUsingOtClient(player) and MESSAGE_EVENT_DEFAULT or MESSAGE_EVENT_ADVANCEif (pokemonNickname ~= nil and pokemonNickname ~= -1) then
doBallUpdateDescription(ball.uid, getBallPokemonSex(ball.uid), pokemonName, pokemonNickname, newLevel, pokemonExtraPoints)
doPlayerSendTextMessage(player, messageClass,
string.format(__L(player, "Congratulations! Your %s advanced from level %s to level %s."), pokemonNickname, currentLevel, newLevel))
else
doBallUpdateDescription(ball.uid, getBallPokemonSex(ball.uid), pokemonName, nil, newLevel, pokemonExtraPoints)
doPlayerSendTextMessage(player, messageClass,
string.format(__L(player, "Congratulations! Your %s advanced from level %s to level %s."), pokemonName, currentLevel, newLevel))
endif (pokemon) then
setMonsterExtraPoints(pokemon, pokemonExtraPoints)
setMonsterLevel(pokemon, newLevel)
doCreatureAddHealth(pokemon, (getCreatureMaxHealth(pokemon) - getCreatureHealth(pokemon)))
setCreatureMaxMana(player, maxEnergy + POKEMON_GAIN_ENERGY * gainLevel)
doCreatureAddMana(player, (maxEnergy - energy) + POKEMON_GAIN_ENERGY * gainLevel)
setPlayerMagicLevel(player, newLevel)
else
doBallHeal(player, ball)
enddoSendMagicEffect(pokemonPosition, EFFECT_GREEN_BUFF)
doSendMagicEffect(pokemonPosition, EFFECT_LEVEL_UP)setBallPokemonLevel(ball.uid, newLevel)
setBallPokemonMaxEnergy(ball.uid, maxEnergy + POKEMON_GAIN_ENERGY * gainLevel)
setBallPokemonExtraPoints(ball.uid, pokemonExtraPoints)doDatalogPokemonLevelUp(player, getPokemonNumberByName(pokemonName), currentLevel,
newLevel, os.time(), pokemonPosition)local moves = getPokemonSkills(pokemonName, ball.uid)
local sendCooldowns = nil
local newMoves = {}
for _, move in pairs(moves) do
if (getPokemonSkillRequiredLevel(pokemonName, move) <= newLevel and
getPokemonSkillRequiredLevel(pokemonName, move) > currentLevel) then
doPlayerSendTextMessage(player, messageClass, string.format(__L(player, "Your %s learned a new move: %s."), pokemonName, move))
if (pokemon) then
doPlayerSendPokemonSkillWindowData(player, ball.uid) -- Show the new move
sendCooldowns = true
end
newMoves[#newMoves + 1] = getPokemonSkillClientIconId(move)
end
endif (sendCooldowns) then
doSendPlayerPokemonCooldowns(player, ball, moves)
endfor _, evolution in ipairs(getPokemonEvolutions(pokemonName)) do
if (evolution.requiredLevel <= newLevel and evolution.requiredLevel > currentLevel) then
doPlayerSendTextMessage(player, messageClass, string.format(__L(player, "Your %s reached the required level to evolve! Check your Pokedex."), pokemonName))
break
end
endcurrentLevel = currentLevel + gainLevel
doPlayerSendPokemonLevelUp(player, getPokemonNumberByName(pokemonName), currentLevel, newMoves)else -- We are at Extra Point up mode
local pokemonPosition = getCreaturePosition(pokemon and pokemon or player)
local maxEnergy = getCreatureMaxMana(player)
local energy = getCreatureMana(player)
local pokemonNickname = getBallPokemonNickname(ball.uid)
local pokemonExtraPoints = getBallPokemonExtraPoints(ball.uid) + gainLevelif (pokemonNickname ~= nil and pokemonNickname ~= -1) then
doBallUpdateDescription(ball.uid, getBallPokemonSex(ball.uid), pokemonName,
pokemonNickname, currentLevel, pokemonExtraPoints)
doPlayerSendTextMessage(player, MESSAGE_EVENT_ADVANCE,
string.format(__L(player, "Congratulations! Your %s upgraded his extra points from level %s to level %s."), pokemonNickname, pokemonExtraPoints - gainLevel, pokemonExtraPoints))
else
doBallUpdateDescription(ball.uid, getBallPokemonSex(ball.uid), pokemonName, nil,
currentLevel, pokemonExtraPoints)
doPlayerSendTextMessage(player, MESSAGE_EVENT_ADVANCE,
string.format(__L(player, "Congratulations! Your %s upgraded his extra points from level %s to level %s."), pokemonName, pokemonExtraPoints - gainLevel, pokemonExtraPoints))
endif (pokemon) then
setMonsterExtraPoints(pokemon, pokemonExtraPoints)
setMonsterLevel(pokemon, currentLevel)
doCreatureAddHealth(pokemon, (getCreatureMaxHealth(pokemon) - getCreatureHealth(pokemon)))
setCreatureMaxMana(player, maxEnergy + POKEMON_GAIN_ENERGY * gainLevel)
doCreatureAddMana(player, (maxEnergy - energy) + POKEMON_GAIN_ENERGY * gainLevel)
setPlayerMagicLevel(player, currentLevel)
enddoSendMagicEffect(pokemonPosition, EFFECT_GREEN_BUFF)
doSendMagicEffect(pokemonPosition, EFFECT_LEVEL_UP)if (not isBallPokemonFromEgg(ball.uid)) then
setBallIsNotPokemonFromEgg(ball.uid, true)
endsetBallPokemonExp(ball.uid, getExperienceForLevel(currentLevel))
setBallPokemonExtraPoints(ball.uid, pokemonExtraPoints)
enddoPlayerAchievementCheck(player, ACHIEVEMENT_IDS.POKEMON_LEVEL_100, currentLevel)
endif (pokemon) then
doPlayerUpdatePokemonLevelPercent(player, newExperience, currentLevel)
end
end
end
return true
endfunction doPlayerUpdatePokemonMoves(cid, ballUid, moves, pokemonName, showAllMoves)
doPlayerSendPokemonSkillWindowData(cid, ballUid, moves, pokemonName, showAllMoves)
doPlayerSendPokemonSkillContainerOpen(cid)
endfunction doPlayerUpdatePokemonIcons(cid, pokemonName, showAllMoves)
if (isItem(getPlayerSlotItem(cid, PLAYER_SLOT_PORTRAIT))) then
doRemoveItem(getPlayerSlotItem(cid, PLAYER_SLOT_PORTRAIT).uid)
endlocal portraitContainer, ball = doPlayerAddItem(cid, getPokemonPortraitId(pokemonName)), getPlayerBall(cid)
local pokemonSkills = (isItem(ball) and getPokemonSkills(pokemonName, ball.uid) or getPokemonDefaultSkills(pokemonName))doPlayerUpdatePokemonMoves(cid, ball.uid, pokemonSkills, pokemonName, showAllMoves)
if (isItem(ball)) then -- Sometimes this is called but the ball doesn't exist
doSendPlayerPokemonCooldowns(cid, ball, pokemonSkills)
end
endfunction setPlayerIcons(cid, ball, status)
if (status) then
local pokemonLevel = getBallPokemonLevel(ball.uid)setPlayerMagicLevel(cid, pokemonLevel)
doPlayerUpdatePokemonLevelPercent(cid, getBallPokemonExp(ball.uid), pokemonLevel)doTransformItem(getPlayerSlotItem(cid, PLAYER_SLOT_EVOLVE).uid, EVOLVE_ICON_ID)
doTransformItem(getPlayerSlotItem(cid, PLAYER_SLOT_ORDER).uid, ORDER_ICON_ID)
doPlayerUpdatePokemonIcons(cid, getBallPokemonName(ball.uid))if (not isDueling(cid)) then
doTransformItem(getPlayerSlotItem(cid, PLAYER_SLOT_DUEL).uid, DUEL_ICON_ID)
endelse
setPlayerMagicLevel(cid, 0)
setPlayerMagicLevelPercent(cid, 0)
doRemoveItem(getPlayerSlotItem(cid, PLAYER_SLOT_PORTRAIT).uid)
doTransformItem(getPlayerSlotItem(cid, PLAYER_SLOT_EVOLVE).uid, EVOLVE_ICON_OFF_ID)
doTransformItem(getPlayerSlotItem(cid, PLAYER_SLOT_ORDER).uid, ORDER_ICON_OFF_ID)
--doTransformItem(getPlayerSlotItem(cid, PLAYER_SLOT_DUEL).uid, DUEL_ICON_OFF_ID)
--New
doPlayerSendPokemonSkillContainerClose(cid)
end
endlocal BIKE_SPEED_CONDITION = createConditionObject(CONDITION_HASTE, -1, -1, CONDITION_SUBID.HASTE.BIKE)
setConditionParam(BIKE_SPEED_CONDITION, CONDITION_PARAM_SPEED, 120)function doPlayerRideBike(cid, item)
doTransformItem(item.uid, LOCKED_MACH_BIKE_ID)
doAddCondition(cid, BIKE_SPEED_CONDITION)
setBikingStatus(cid, true)local outfit = getCreatureOutfit(cid)
if (getPlayerSex(cid) == PLAYERSEX_FEMALE) then
outfit.lookType = 1743
doSetCreatureOutfit(cid, outfit, -1, CONDITION_SUBID.OUTFITS.BIKE)
else
outfit.lookType = 1744
doSetCreatureOutfit(cid, outfit, -1, CONDITION_SUBID.OUTFITS.BIKE)
end
doSendMagicEffect(getCreaturePosition(cid), EFFECT_POFF)
endfunction doPlayerDeRideBike(cid, item)
doRemoveCondition(cid, CONDITION_HASTE, CONDITION_SUBID.HASTE.BIKE)
setBikingStatus(cid, false)
doTransformItem(item.uid, UNLOCKED_MACH_BIKE_ID)
doRemoveCondition(cid, CONDITION_OUTFIT, CONDITION_SUBID.OUTFITS.BIKE)
doSendMagicEffect(getCreaturePosition(cid), EFFECT_POFF)
end--[[ Is not used anymore
-- function doPlayerResetSpeed(cid)
for i = 0, 15 do -- try to remove all haste conditions
if (hasCondition(cid, CONDITION_HASTE)) then
doRemoveCondition(cid, CONDITION_HASTE)
else
break
end
endfor i = 0, 15 do -- try to remove all paralyze conditions
if (hasCondition(cid, CONDITION_PARALYZE)) then
doRemoveCondition(cid, CONDITION_PARALYZE)
else
break
end
enddoChangeSpeed(cid, -(getCreatureSpeed(cid) - getCreatureBaseSpeed(cid)))
end]]-- Others
function getPlayerLastOpponent(cid)
return getCreatureStorage(cid, playersStorages.lastOpponent)
endfunction setPlayerLastOpponent(cid, _lastOpponent)
doCreatureSetStorage(cid, playersStorages.lastOpponent, _lastOpponent)
endfunction getPlayerLastMaxPokemon(cid)
return getCreatureStorage(cid, playersStorages.lastMaxPokemon)
endfunction setPlayerLastMaxPokemon(cid, _lastMaxPokemon)
doCreatureSetStorage(cid, playersStorages.lastMaxPokemon, _lastMaxPokemon)
endfunction getPlayerLastMaxMembers(cid)
return getCreatureStorage(cid, playersStorages.lastMaxMembers)
endfunction setPlayerLastMaxMembers(cid, _lastMaxMembers)
doCreatureSetStorage(cid, playersStorages.lastMaxMembers, _lastMaxMembers)
end-- Main items related
function doPlayerAddMainItems(cid)
setItemUniqueOwner(doPlayerAddItem(cid, 12157, 100, false), cid) -- 100x Empty poke ball
setItemUniqueOwner(doPlayerAddItem(cid, 2687, 100, false), cid) -- 100x Cookie
setItemUniqueOwner(doPlayerAddItem(cid, 12244, 20, false), cid) -- 20x Pokemon health potion
setItemUniqueOwner(doPlayerAddItem(cid, 2120, 1, false), cid) -- 1x Rope
setItemUniqueOwner(doPlayerAddItem(cid, 12292, 1, false), cid) -- 1x Old Fishing Rood
endfunction getPlayerFirstPokemon(cid)
local dbResult = db.getResult("SELECT `firstpokemon` FROM `players` WHERE `id` = '" .. getPlayerGUID(cid) .. " LIMIT 1';")
local firstPokemonId = dbResult:getDataInt('firstpokemon')
if (firstPokemonId == 0) then
return "Bulbasaur"
elseif (firstPokemonId == 1) then
return "Charmander"
elseif (firstPokemonId == 2) then
return "Squirtle"
elseif (firstPokemonId == 3) then
return "Chikorita"
elseif (firstPokemonId == 4) then
return "Cyndaquil"
elseif (firstPokemonId == 5) then
return "Totodile"
end
return "Bulbasaur"
end--function getPlayerFirstPokemonSex(cid)
-- local dbResult = db.getResult("SELECT `pokemon_sex` FROM `player_first_pokemon` WHERE `id` = '".. getPlayerGUID(cid) .." LIMIT 1';")
-- if (dbResult == -1) then
-- return table.random({POKEMON_SEX_FEMALE, POKEMON_SEX_MALE})
-- end
-- local pokemonSex = dbResult:getDataInt('pokemon_sex')
-- if (not pokemonSex or (pokemonSex ~= POKEMON_SEX_FEMALE and pokemonSex ~= POKEMON_SEX_MALE)) then
-- return table.random({POKEMON_SEX_FEMALE, POKEMON_SEX_MALE})
-- end
-- return pokemonSex
--endfunction getPlayerPokemonCaughts(cid, pokemonName)
local r = getCreatureStorage(cid, getPokemonCatchStorage(pokemonName))
return r > -1 and r or 0
endfunction setPlayerPokemonCaughts(cid, pokemonName, caughts)
doCreatureSetStorage(cid, getPokemonCatchStorage(pokemonName), caughts)if (caughts == 1) then -- First
setPlayerIndividualCaughts(cid, getPlayerIndividualCaughts(cid) + 1)
end
endfunction getPlayerCaughts(cid)
local r = tonumber(getCreatureStorage(cid, playersStorages.caughts))
return r > -1 and r or 0
endfunction setPlayerCaughts(cid, caughts)
doCreatureSetStorage(cid, playersStorages.caughts, caughts)
endfunction setPlayerIndividualCaughts(cid, v)
doCreatureSetStorage(cid, playersStorages.individualCaughts, v)
endfunction getPlayerIndividualCaughts(cid)
local r = getCreatureStorage(cid, playersStorages.individualCaughts)
if (r == EMPTY_STORAGE) then
r = 0
if (getPlayerCaughts(cid) > 0) then -- Otherwise this is a new player
for i = 1, POKEMON_NUMBER do
if (getPlayerPokemonCaughts(cid, getPokemonNameByNumber(i)) > 0) then
r = r + 1
end
end
endsetPlayerIndividualCaughts(cid, r)
endreturn r
endfunction getPlayerExtraExpRateTime(cid)
local r = getCreatureStorage(cid, playersStorages.extraExpRateTime)
return r > -1 and r or 0
endfunction setPlayerExtraExpRateTime(cid, value)
doCreatureSetStorage(cid, playersStorages.extraExpRateTime, value)
endfunction getPlayerExtraExpRateValue(cid)
local r = tonumber(getCreatureStorage(cid, playersStorages.extraExpRateValue))
return r > -1 and r or 0
endfunction setPlayerExtraExpRateValue(cid, value)
doCreatureSetStorage(cid, playersStorages.extraExpRateValue, value)
endfunction getPlayerMasteryDungeon(cid)
return getCreatureStorage(cid, playersStorages.masteryDungeon)
endfunction setPlayerMasteryDungeon(cid, masteryDungeon)
doCreatureSetStorage(cid, playersStorages.masteryDungeon, masteryDungeon)
endfunction getPlayerLastDungeonDate(cid)
return getCreatureStorage(cid, playersStorages.lastDungeonDate)
endfunction setPlayerLastDungeonDate(cid, value)
doCreatureSetStorage(cid, playersStorages.lastDungeonDate, value)
endfunction getPlayerLastSafariZoneDate(cid)
return getCreatureStorage(cid, playersStorages.lastSafariZoneDate)
endfunction setPlayerLastSafariZoneDate(cid, value)
doCreatureSetStorage(cid, playersStorages.lastSafariZoneDate, value)
endfunction getPlayerSafariZonePass(cid)
local r = getCreatureStorage(cid, playersStorages.safariZonePass)
return r > -1 and r or 0
endfunction setPlayerSafariZonePass(cid, value)
doCreatureSetStorage(cid, playersStorages.safariZonePass, value)
end--
function getPlayerLastUsedTm(cid)
return getPlayerItemByAttribute(cid, true, ITEM_ATTRIBUTES.LAST_USED_TM_MARK,
getCreatureStorage(cid, playersStorages.lastUsedTmMark))
endfunction setPlayerLastUsedTm(cid, itemUid)
local v = getCurrentTimeInSeconds()
doItemSetAttribute(itemUid, ITEM_ATTRIBUTES.LAST_USED_TM_MARK, v)
doCreatureSetStorage(cid, playersStorages.lastUsedTmMark, v)
endfunction getPlayerLastUsedTmBall(cid)
return getPlayerItemByAttribute(cid, true, ITEM_ATTRIBUTES.LAST_USED_TM_BALL_MARK,
getCreatureStorage(cid, playersStorages.lastUsedTmBallMark))
endfunction setPlayerLastUsedTmBall(cid, itemUid)
local v = getCurrentTimeInSeconds()
doItemSetAttribute(itemUid, ITEM_ATTRIBUTES.LAST_USED_TM_BALL_MARK, v)
doCreatureSetStorage(cid, playersStorages.lastUsedTmBallMark, v)
endfunction isPlayerAutoWalking(cid)
return getCreatureStorage(cid, playersStorages.isAutoWalking) > 0
endfunction setPlayerAutoWalking(cid, value)
doCreatureSetStorage(cid, playersStorages.isAutoWalking, value and 1 or 0)
endfunction getPlayerFrontierIsland(cid)
return getCreatureStorage(cid, playersStorages.frontierIsland) > 0
endfunction setPlayerFrontierIsland(cid, value)
doCreatureSetStorage(cid, playersStorages.frontierIsland, value and 1 or 0)
endfunction getPlayerLastBattleTowerTwenty(cid)
return getCreatureStorage(cid, playersStorages.lastBattleTowerTwenty)
endfunction setPlayerLastBattleTowerTwenty(cid, value)
doCreatureSetStorage(cid, playersStorages.lastBattleTowerTwenty, value)
endfunction getPlayerLastBattleTowerFifteen(cid)
return getCreatureStorage(cid, playersStorages.lastBattleTowerFifteen)
endfunction setPlayerLastBattleTowerFifteen(cid, value)
doCreatureSetStorage(cid, playersStorages.lastBattleTowerFifteen, value)
endfunction getPlayerLastBattleTowerTen(cid)
return getCreatureStorage(cid, playersStorages.lastBattleTowerTen)
endfunction setPlayerLastBattleTowerTen(cid, value)
doCreatureSetStorage(cid, playersStorages.lastBattleTowerTen, value)
endfunction getPlayerOrangeArchipelagoAccess(cid)
local v = getCreatureStorage(cid, playersStorages.orangeArchipelagoAccess)
return v > 0 and v or 1
endlocal ORANGE_ARCHIPELAGO_ISLANDS_PER_ACCESS = {
[2] = "Valencia, Pinkan and Pummelo",
[3] = "Tarroco, Hamlin and Kumquat",
[4] = "Mandarin North, Butwal and Navel",
[5] = "Ascorbia, The Seven Grapefruit and Moro",
[6] = "Shamouti, Murcott and Mandarin South"
}function setPlayerOrangeArchipelagoAccess(cid, value)
local old = getPlayerOrangeArchipelagoAccess(cid)
doCreatureSetStorage(cid, playersStorages.orangeArchipelagoAccess, value)if (value > old) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,
string.format(__L(cid, "Your Orange Archipelago access has increased! Your new unlocked islands: %s."), __L(cid, ORANGE_ARCHIPELAGO_ISLANDS_PER_ACCESS[value])))
end
endfunction getPlayerBoughtRareCandy(cid)
local v = getAccountStorage(getPlayerAccountId(cid), ACCOUNT_STORAGES.BOUGHT_RARE_CANDY) --getCreatureStorage(cid, playersStorages.boughtRareCandy)
return v > -1 and v or 0
endfunction setPlayerBoughtRareCandy(cid, value)
--doCreatureSetStorage(cid, playersStorages.boughtRareCandy, value)
setAccountStorage(getPlayerAccountId(cid), ACCOUNT_STORAGES.BOUGHT_RARE_CANDY, value)
endfunction getPlayerLastDexedTmItemId(cid)
local v = getCreatureStorage(cid, playersStorages.lastDexedTmItemId)
return v > -1 and v or 0
endfunction setPlayerLastDexedTmItemId(cid, value)
doCreatureSetStorage(cid, playersStorages.lastDexedTmItemId, value)
end--
--[[
function doPlayerOxygenMaskLock(cid)
local item = getPlayerSlotItem(cid, PLAYER_SLOT_KEY_ITEM)
if (isItem(item) and item.itemid == UNLOCKED_OXYGEN_MASK_ID) then
doTransformItem(item.uid, LOCKED_OXYGEN_MASK_ID)
return true
end
return false
endfunction doPlayerOxygenMaskUnlock(cid)
local item = getPlayerSlotItem(cid, PLAYER_SLOT_KEY_ITEM)
if (isItem(item) and item.itemid == LOCKED_OXYGEN_MASK_ID) then
doTransformItem(item.uid, UNLOCKED_OXYGEN_MASK_ID)
return true
end
return false
end
]]function doPlayerRemoveFrontierBalls(cid)
for _, item in pairs(getPlayerAllBallsWithPokemon(cid)) do
if (ballsNames[item.itemid] == "frontier") then
doRemoveItem(item.uid)
end
end
endfunction doPlayerRemoveEpicBalls(cid)
for _, item in pairs(getPlayerAllBallsWithPokemon(cid)) do
if (ballsNames[item.itemid] == "epic") then
doRemoveItem(item.uid)
end
end
endfunction doPlayerReset(cid) -- Called by onLogin and onDeath
setPlayerVulnerable(cid, true)
setFishingStatus(cid, false)
doCreatureSetStorage(cid, playersStorages.isEvolving, -1)
setCreatureMaxMana(cid, 0)
doPlayerAddMana(cid, -getPlayerMana(cid), false)setPokemonBadPoison(cid, false)
setPokemonPoison(cid, false)
setPokemonBurn(cid, false)doPlayerRemoveSafariZoneItems(cid)
setSafariZone(cid, false)setIsPokemonUsingHealthPotion(cid, false)
setPlayerAutoWalking(cid, false)
setPlayerFrontierIsland(cid, false)
setPlayerTraveling(cid, false)if (isBiking(cid)) then
doPlayerDeRideBike(cid, getPlayerSlotItem(cid, PLAYER_SLOT_KEY_ITEM))
end
endfunction doPlayerSendWindowsData(cid, sendMoves)
doPlayerSendPokemonWindowClose(cid) -- reset window icons
local balls = getPlayerAllBallsWithPokemon(cid)
for _, ball in ipairs(balls) do
doFastcallLink(cid, ball.uid)
endif (sendMoves) then -- We didn't need to send it if this is called by onLogin, cuz this will be send when onEquip gets called
local ball = getPlayerBall(cid)
if (isItem(ball)) then
doPlayerSendPokemonSkillWindowData(cid, ball.uid)
end
enddoPokedexStatusSend(cid)
if (#balls > 0) then
doPlayerSendPokemonSkillContainerOpen(cid)
doPlayerSendPokemonWindowOpen(cid)
end
endfunction getPlayerKeyItem(cid)
return getPlayerSlotItem(cid, PLAYER_SLOT_KEY_ITEM)
endfunction getPlayerMounted(cid)
return isSurfing(cid) or isFlying(cid) or isRiding(cid) or isDiving(cid) or isLevitating(cid)
endfunction getPlayerBlockLogout(cid)
return getCreatureStorage(cid, playersStorages.blockLogout) > 0
endfunction setPlayerBlockLogout(cid, value) -- This will prevent the player logout. If the player forces exit, he will be teleported to Trade Room and this will be setted to false. This will be setted to false also if the player dies or use ability teleport.
doCreatureSetStorage(cid, playersStorages.blockLogout, (value and 1 or 0))
endfunction getPlayerGotStarterPokemon(cid)
return getCreatureStorage(cid, playersStorages.gotStarterPokemon) > 0
endfunction setPlayerGotStarterPokemon(cid, value)
doCreatureSetStorage(cid, playersStorages.gotStarterPokemon, (value and 1 or 0))
endfunction onPlayerWinDuel(cid)
if (getPlayerTournamentReady(cid)) then
doPlayerResetBerryCooldown(cid)
end
endfunction onPlayerEndDuel(cid) -- Called when win/lose, its duels and battles too
doRemoveCondition(cid, CONDITION_EXHAUST, CONDITION_SUBID.EXHAUST.POKEMONCALL)
endfunction getPlayerTraveling(cid)
return getCreatureStorage(cid, playersStorages.traveling) > -1
endfunction setPlayerTraveling(cid, value)
doCreatureSetStorage(cid, playersStorages.traveling, (value and 1 or -1))
endfunction getPlayerTotalCasedDolls(cid)
local r = getCreatureStorage(cid, playersStorages.casedDolls)
return r > -1 and r or 0
endfunction setPlayerTotalCasedDolls(cid, value)
doCreatureSetStorage(cid, playersStorages.casedDolls, value)
endfunction getPlayerLastUsedIncubator(cid)
return getPlayerItemByAttribute(cid, true, ITEM_ATTRIBUTES.LAST_USED_INCUBATOR_MARK,
getCreatureStorage(cid, playersStorages.lastUsedIncubatorMark))
endfunction setPlayerLastUsedIncubator(cid, itemUid)
local v = getCurrentTimeInSeconds()
doItemSetAttribute(itemUid, ITEM_ATTRIBUTES.LAST_USED_INCUBATOR_MARK, v)
doCreatureSetStorage(cid, playersStorages.lastUsedIncubatorMark, v)
endfunction getPlayerAutoLootSave(cid)
local r = getCreatureStorage(cid, playersStorages.autoLootSave)
return r == 1
endfunction setPlayerAutoLootSave(cid, value)
doCreatureSetStorage(cid, playersStorages.autoLootSave, value and 1 or 0)
endfunction getPlayerDeliveredEasterEggs(cid)
local r = getCreatureStorage(cid, playersStorages.deliveredEasterEggs)
return r ~= EMPTY_STORAGE and r or 0
endfunction setPlayerDeliveredEasterEggs(cid, value)
doCreatureSetStorage(cid, playersStorages.deliveredEasterEggs, value)
endfunction getPlayerColosseumArenaPaid(cid)
local r = getCreatureStorage(cid, playersStorages.colosseumnArenaPaid)
return r ~= EMPTY_STORAGE and r or false
endfunction setPlayerColosseumArenaPaid(cid, value)
doCreatureSetStorage(cid, playersStorages.colosseumnArenaPaid, value)
endfunction getPlayerLastEliteFourTry(cid)
local r = getCreatureStorage(cid, playersStorages.lastEliteFourTry)
return r ~= EMPTY_STORAGE and r or -1
endfunction setPlayerLastEliteFourTry(cid, value)
doCreatureSetStorage(cid, playersStorages.lastEliteFourTry, value)
end
id dos player montado na moto
outfitMale = 2589, -- Outfit male
itemid="30136" da chave da moto
outfitFemale = 2590, -- Outfit female
-
Em 06/10/2021 em 10:43, georgelxll disse:
Simples, manda o script da bike e o Id do player montado na moto, tanto male quanto female, manda tbm o Id da sprite da chave que vc quer que seja a moto que eu mando o script feito pra vc e te explico tbm como funciona
Pode me dar uma ajuda pelo discord amigo? Vai ser mais fácil pra mim entender
Danijo#9360 meu discord para vc me ajudar
-
Meu sevidor de poketibia pussui apenas a bike
Consegui achar uma sprite de moto pelo object builder
Vi vários vídeos sobre item editor
Mas pelo fato de serem vídeos ou tópicos antigos nenhum deles me esclareceu o suficiente
Se alguém puder me mandar um super tutorial sobre isso agradeço muito
Passar essa sprite de moto para o meu servidor e criar uma script para que funcione
Obs:No meu Server eu uso a chave da bike e ele logo monta na bike,queria que fosse assim com a moto
-
Alguém pode me ajudar a colocar sprite de moto em um servidor que não a possui,Se esse for o local errado mi desculpem
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.
[OTClient] Player Info OTPokemon
em Clients
Postado
Olá amigo ,Muito obrigado por essa contribuição
Poderia me ajudar em uma coisa
O module funcionou perfeitamente no meu cliente
Consegui adicionar contagem de headbutt além da contagem de fishing porém não consigo aumentar esse module (colocar mais linhas)
Queria colocar uma barra abaixo de fishing contando headbutt,consegui coçar a contagem de headbutt porém ficou por cima da barra de fishing
Não consegui desvendar o module para aumentar ele da forma correta, Poderia me ajudar nisso,adicionar 1 barra abaixo de fishing,aí eu coloco minha contagem de headbutt