- Fórum
- OTServ
- Recursos
- Scripting
- Actions e Talkactions
- [PokeTibia]pokemon pescado aparece em volta do seu pokemon
RA
[PokeTibia]pokemon pescado aparece em volta do seu pokemon
Por Rayo, 17 de jun. de 2019 em Actions e Talkactions
1
1.4k
Por Rayo, 17 de jun. de 2019 em Actions e Talkactions
info
Grupo: Campones
Registrado: 16/06/19
Posts: 21
Reputação: +3
Gênero: Masculino
Char no Tibia: Kyo Ex
Versão do Servidor: TFS - 0.3.4
Pedido feito pelo @Furyox:
Solução desenvolvida por mim:
Substitua a função doFish no arquivo: "DxP-Server-V3\data\actions\scripts\Basic\pesca.lua"
local function doFish(cid, pos, ppos, interval) if not isCreature(cid) then return false end if getThingPos(cid).x ~= ppos.x or getThingPos(cid).y ~= ppos.y then return false end doSendMagicEffect(pos, CONST_ME_LOSEENERGY) if interval > 0 then addEvent(doFish, 1000, cid, pos, ppos, interval-1) return true end local peixe = 0 local playerpos = getClosestFreeTile(cid, getThingPos(cid)) local fishes = fishing[getPlayerStorageValue(cid, sto_iscas)] local random = {} if getPlayerSkillLevel(cid, 6) < limite then doPlayerAddSkillTry(cid, 6, bonus * 5) end --[[if math.random(1, 100) <= chance then if getPlayerSkillLevel(cid, 6) < limite then doPlayerAddSkillTry(cid, 6, bonus * 5) end]] random = fishes.pokes[math.random(#fishes.pokes)] for i = 1, math.random(random[2]) do if #getCreatureSummons(cid) >= 1 -- se o jogador tiver sumonado algum pokemon,pegará a posição do pokemon then peixe = doSummonCreature(random[1], getClosestFreeTile(cid, getThingPos(getCreatureSummons(cid)[1]))) -- se não pegará a do jogador else peixe = doSummonCreature(random[1],playerpos) end if not isCreature(peixe) then setPlayerStorageValue(cid, storageP, -1) doRemoveCondition(cid, CONDITION_OUTFIT) return true end setPokemonPassive(peixe, true) doSetPokemonAgressiveToPlayer(peixe, cid) setPlayerStorageValue(peixe, storageP, 1) if #getCreatureSummons(cid) >= 1 then doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 0) doChallengeCreature(getCreatureSummons(cid)[1], peixe) else doSendMagicEffect(getThingPos(cid), 0) doChallengeCreature(cid, peixe) end end setPlayerStorageValue(cid, storageP, -1) doRemoveCondition(cid, CONDITION_OUTFIT) return true endComo funciona?
Se o jogador tiver invocado um pokemon,ele vai sumonar os pokemons pescados próximo ao pokemon do jogador,caso contrario,será próximo ao jogador.
Resultado: