cada coisa q os kra inventa kkkkk mas vamos testar, vou tentar add no meu poketibia
poxa não deu ![]()
info
Grupo: Campones
Registrado: 21/01/16
Posts: 39
Reputação: +2
Gênero: Masculino

cada coisa q os kra inventa kkkkk mas vamos testar, vou tentar add no meu poketibia
poxa não deu ![]()
info
Grupo: Conde
Registrado: 15/06/15
Posts: 729
Reputação: +200
Author:Printer
Como funciona:
Esse é somente um código,e não o evento em si:
Vamos a instalação;
vá em movements.xml e adicione:
Agora em movements/script crie um arquivo e renomeie para football.lua e bote dentro dele:
function onStepIn(creature, item, position, fromPosition) local player = creature:getPlayer() if player == nil then return true end local nextPosition = player:getPosition() nextPosition:getNextPosition(player:getDirection()) if nextPosition:isWalkable(false) then position:sendMagicEffect(CONST_ME_POFF) item:moveTo(nextPosition) end return true endAgora vá em talkactions.xml e adicione essa linha:
Agora em talkactions/scripts crie um arquivo e renomeie para football.lua e bote dentro dele:
function onTargetTile(creature, position) local tile = Tile(position) if not tile then return false end local football = tile:getItemById(2109) if football then local playerPosition, footballPosition = creature:getPosition(), football:getPosition() playerPosition:sendDistanceEffect(footballPosition, CONST_ANI_WHIRLWINDCLUB) footballPosition:sendMagicEffect(CONST_ME_HITAREA) local distance = playerPosition:getDistance(footballPosition) local nextPosition = footballPosition for i = 1, (6 - distance) do nextPosition:getNextPosition(creature:getDirection()) if nextPosition:isWalkable(false) then football:moveTo(nextPosition) else break end end creature:say("POWER SHOOT!", TALKTYPE_MONSTER_SAY) end end local powerShoot = Combat() powerShoot:setCallback(CALLBACK_PARAM_TARGETTILE, "onTargetTile") powerShoot:setArea(createCombatArea(AREA_SHOOTRANGE, AREADIAGONAL_SHOOTRANGE))Aqui é o lib:
AREA_SHOOTRANGE = { {1}, {1}, {1}, {3} } AREADIAGONAL_SHOOTRANGE = { {0, 1, 0, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 0, 1, 0}, {0, 0, 0, 0, 3} } function Position.isWalkable(position, playerBlock) local tile = Tile(position) if not tile then return false end if playerBlock and tile:getCreatureCount() ~= 0 then return false end local ground = tile:getGround() if not ground or ground:hasProperty(CONST_PROP_BLOCKSOLID) then return false end local items = tile:getItems() for i = 1, tile:getItemCount() do local item = items[i] local itemType = item:getType() if itemType:getType() ~= ITEM_TYPE_MAGICFIELD and not itemType:isMovable() and item:hasProperty(CONST_PROP_BLOCKSOLID) then return false end end return true endComandos:
Author:Printer
Editado Janeiro 21 por kaleudd