-
Total de itens
74 -
Registro em
-
Última visita
-
Dias Ganhos
4
Posts postados por georgelxll
-
-
A respeito da edição do site, a página HOME, você a editava a partir de qual arquivo do HTDOCS? era feito a partir do Login do ADM no site gerando noticias ou tem algum HTML onde eu possa editar as noticias?
-
Em 08/11/2021 em 22:07, thepota disse:
Essa função já existe:
doAddPokeball(cid, name, level, boost, ballKey, dp, msg)
cid = id do player (player:getId() caso tenha o objeto player)
name = nome do poke
ballKey = "pokeball", "greatball", etc
dp = se tenta criar no player ou manda direto para o CP (false cria no player)
msg = "parabens, voce encontrou um poke"
exemplo:
doAddPokeball(player:getId(), "Rattata", 5, 0, "pokeball", false, "parabens, voce encontrou um poke")
Porém, para seu uso específico como item de quest, basta criar uma nova entrada no dicionário quests do arquivo newfunctions.lua (data/lib/core). Exemplo:
questinicial = { prizes = { [1] = { uid = 85000, items = { [1] = {item = "crystal coin", count = 5} }, pokes = { [1] = {name = "Shiny Electabuzz", level = 35, boost = 5} }, badges = {} } }, level = 10, teleportCP = 0 },
85000 é o uniqueID que deve colocar no baú pelo editor de mapa, level = 10 é o nível mínimo para fazer a quest. teleportCP = 0 significa que o player n é teleportado para o CP após abrir o baú. Esse código deve ir na linha 105 do arquivo newfunctions.lua. Pronto!
Eu vi hoje mais cedo, estava estudando a base, obrigado amigo.
Em 08/11/2021 em 14:52, lSainty disse:O sistema dessa base 10.98 é completamente diferente, não tem nada haver com PDA, não tem pq adaptar. Analise o sistema de catch e veja se há uma função que faça o mesmo, ou o comando usado para criar pokemons (em talkactions).
Eu poderia ter adaptado se eu quisesse a partir dessa função, eu só não tenho conhecimento suficiente ...
-
Agora, Slytherin disse:
eu conseguir compila só o servidor, o cliente eu não to conseguindo nem a pau.
Compilou com Visual mesmo?
-
Opa gente, boa tarde, beleza?
Antes de tudo, TFS 1.2
Versão 10.98
Seguinte, tava aqui montando meu poketibia de boa, ai fui montar um scriptzinho básico de baú inicial para o player pegar o teu pokemon, porém, não tem a função addPokeToPlayer no meu servidor, cheguei a tentar adicionar ela porém dá muitos erros, e como não tenho conhecimento em TFS 1.2 fica meio dificil de mexer, gostaria de saber se algum de vocês poderia me ajudar com isso, vou estar deixando a função de addPokeToPlayer do PDA aqui para vocês...
O server que eu utilizo não possui o sistema de Gender(Gêneros), peço que desconsiderem essa parte.
Estou com dificuldade em converter dessa versão 0.3.6 para a TFS 1.2
-
Em 04/11/2021 em 22:32, thepota disse:
Servidor vscode, tem tutorial no github do theforgottenserver: https://github.com/otland/forgottenserver/wiki/Compiling-on-Windows
o client n lembro pq compilei há muito tempo, mas devo ter seguido o tutorial do github do otclientEntendi, então beleza cara, tava fazendo algumas mudanças na source do cliente pra deixar ela arrumadinha e ai quando fui compilar com os programas que eu uso eu parei e pensei ... será que vai funcionar??? KKKK, mas vlw
-
Cara, vc tava compilando teu servidor e teu cliente por qual programa?
-
17 horas atrás, mrbassa disse:
mano... fiz isso e continua dando o mesmo erro, eu abro o schema com o notepad troco os utf e quando tento abrir o sql pelo phpmyadmin dá o mesmo erro...
PARA QUEM ESTÁ COM DIFICULDADE, USEM ESSA DATABASE ...
-
17 horas atrás, rafersiq disse:
e so deixar -spawn e -house? ou coloco alguo antes dos -
deixa só house e só spawn, sem esse tracinho tbm
-
17 horas atrás, R e d disse:
Aparece isto no momento em que uso cut e no momento em que o arbusto cresce novamente:
[02/11/2021 21:08:56] [Error - Action Interface]
[02/11/2021 21:08:56] In a timer event called from:
[02/11/2021 21:08:56] data/actions/scripts/order.lua:onUse
[02/11/2021 21:08:56] Description:
[02/11/2021 21:08:56] (luaGetThingPosition) Thing not found[02/11/2021 21:08:56] [Error - Action Interface]
[02/11/2021 21:08:56] In a timer event called from:
[02/11/2021 21:08:56] data/actions/scripts/order.lua:onUse
[02/11/2021 21:08:56] Description:
[02/11/2021 21:08:56] (luaDoTransformItem) Item not found[02/11/2021 21:08:56] [Error - Action Interface]
[02/11/2021 21:08:56] In a timer event called from:
[02/11/2021 21:08:56] data/actions/scripts/order.lua:onUse
[02/11/2021 21:08:56] Description:
[02/11/2021 21:08:56] (luaGetThingPosition) Thing not found[02/11/2021 21:08:56] [Error - Action Interface]
[02/11/2021 21:08:56] In a timer event called from:
[02/11/2021 21:08:56] data/actions/scripts/order.lua:onUse
[02/11/2021 21:08:56] Description:
[02/11/2021 21:08:56] (luaDoTransformItem) Item not found[02/11/2021 21:09:11] [Error - Action Interface]
[02/11/2021 21:09:11] In a timer event called from:
[02/11/2021 21:09:11] data/actions/scripts/order.lua:onUse
[02/11/2021 21:09:11] Description:
[02/11/2021 21:09:11] (luaDoTransformItem) Item not found[02/11/2021 21:09:11] [Error - Action Interface]
[02/11/2021 21:09:11] In a timer event called from:
[02/11/2021 21:09:11] data/actions/scripts/order.lua:onUse
[02/11/2021 21:09:11] Description:
[02/11/2021 21:09:11] (luaDoTransformItem) Item not found
Thing not Found e Item not found, você passou os ID's corretos?
-
21 minutos atrás, rafersiq disse:
?
Isso
-
16 horas atrás, Hikigaya disse:
Não existe groups ids, não consigo logar, como fazer?
Simples, quando vc extraiu ele meio que apagou sozinho ... vai em XML dps procura por groups, lá vai ter esse arquivo, pegue somente esse arquivo do winrar e substitua pelo seu atual ...
-
Obrigado cara, isso vai ajudar bastante a galera que quer abrir um projeto mas não sabe qual base usar, vou dar uma testada nela aqui, mas cara ... sensacional!!
-
Em 28/10/2021 em 07:11, rafersiq disse:
teve esse aki
seguinte, tira esse exchange- da frente dos 2 e tenta novamente por favor ... Desculpa a demora pra responder
-
3 horas atrás, rafersiq disse:
bom dia galera do fórum xtibia eu to aqui pra pedir um ajuda com o remeres map editor
sempre que eu abro um mapa nele ele não carrega o monster.xml e o npc.xml
umas prints pra dar uma melhor explicação do erro
outra print
esse e o erro ai eu procuro aonde esta dando o erro e tento resolver e sempre da o msm erro
Esse failed to load Spawns e houses não tem a ver com o monster.xml ou o npc.xml, tem a ver com o Spawn e house que ficam na pasta World, deve ter dado alguma zoada em algum Spawn específico, quando vc abrir o seu servidor tenta dar uma olhada pra ver se não tem nenhum erro de Spawn lá por gentileza, me retorna aqui depois pra eu saber
-
Abra o seu Spell.xml e vá na linha 2340, provavelmente haverá algum erro próximo a essa linha ou nela mesma ...
[15/09/2021 15:50:26] Reloaded spells. [15/09/2021 15:52:55] [Warning - BaseEvents::loadFromXml] Cannot open spells.xml file. [15/09/2021 15:52:55] Line: 2340, Info: Extra content at the end of the document [15/09/2021 15:52:56] [Error - Game::reloadInfo] Failed to reload spells.
Ou seja ... tem coisas a mais no arquivo que o fazem dar esse erro, só que como o arquivo XML tá com vc n tem muito o que eu fazer ... mas da uma olhada próximo a essa linha de erro ou até mesmo no fim do arquivo assim como o erro diz
-
Existe 2 formas colocar ele pra abrir em interface.otmod ou mudar o pokemon.otmod ver imagem abaixo.
Depois no cliente existe icon:setImageSource('pokes/'..t[2]..'.png') que no caso na pasta pokes ele pega o .png do nome do pokemon que foi passado e esta em t[2], e como mandar isso? no servidor ao colocar o pokemon no slot, ao logar etc... se passa algo assim
doPlayerSendCancel(player, "#NewInfo,"..COLOCA_PRA_PEGAR_NOME_POKEMON_ATRIBUTOBALL_AO_SUMONADO)
mudar o interface.otmod o correto.
mudar o pokemon.otmod tem que testar.
-
Opa cara, blz? acho que está no lugar certo, mas acho que deve ter algum tópico aqui no XTibia mesmo relacionado a isso que você quer, porém, vamos lá, tem esse vídeo, bem antigo que eu encontrei, veja se te ajuda ...
Se ajudar, poderia dar um REP + por favor?
-
Em 09/10/2021 em 22:45, DanijoBR disse:
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, ?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
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
-
15 horas atrás, DanijoBR disse:
Pode me dar uma ajuda pelo discord amigo? Vai ser mais fácil pra mim entender
Danijo#9360 meu discord para vc me ajudar
Cara, é bom fazer aqui pelo Xtibia mesmo, pq assim, outras pessoas que tiverem com essa dúvida poderão entender melhor.
-
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
-
21 horas atrás, MordekayRalf disse:
Entao eu estou mechendo com uma base poketibia, Ate entao começou a dar esse erro ao adc novas fotos de pokemons, Tipo eu cheguei a adc umas 10 fotos no maximo, Ai depois meu object builder parou de carregar ate o fim, E no iten editor nao consego achar a foto que tento adc no obj builder, Alguem Sabe o motivo da uma força ai, Agradeço..
Demonstraçao na foto abaixo..
Ele nao termina de compila, Depois que fecho e abro novamente ele ate chega aparecer a foto q adc, So que quando pesquiso no itens editor nao acha oq adc.
AJUDE-ME PLIS
Cara ... uma coisa é vc adicionar no Object builder, outra é vc adicionar no Item editor, pra vc adicionar no item editor vc precisa criar um slot novo e no ID do client vc coloca o mesmo id do object builder pra poder adicionar lá
-
1 minuto atrás, rafersiq disse:
dos npc peguei sim e dos pokemons eu peguei o xml que fiaca arquivado todos os pokemons
entendi, tenta dar um F5 dps de importar e ve o que dá por favor
-
1 hora atrás, rafersiq disse:
eu fiz isso e eles nao aparesem
Uhmmm, entendi ... vc dos npc's vc pegou o xml de 1 por 1??? e dos pokemons tbm???
-
29 minutos atrás, rafersiq disse:
ou to com mais um problema no remeres
os montros e npcs nao quer aparecer quando eu abro o mapa no remeres vc sabe me ajudar nisso
Sei sim cara, vai em import monster e quando abrir o negócio vc vai em monster e seleciona os xml
e os npc's tbm, vc seleciona os xml dos npcs e reinicia o remeres pra ver :D
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.
[10.98] PokeDash Pota v1.0 - TFS 1.2 - Server, Client, Sources, Site, Map editor e Item editor
em OTServer Alternativo (ATS)
Postado
Beleza cara, valeu!