2019-01-29, 08:30:14
PHP Code:
name = "Route 45"
author = "Gandalf"
description = [[Start anywhere between the exit of the Route 45 and the Pokecenter Blackthorn.]]
movesNotToForget = {Inferno} --add moves here
function onPathAction()
if isPokemonUsable(1) then
if getMapName() == "Pokecenter Blackthorn" then
moveToCell(10, 20)
elseif getMapName() == "Blackthorn City" then
moveToCell(19, 50)
elseif getMapName() == "Route 45" then
moveToRectangle(4, 33, 11, 33)
end
else
if getMapName() == "Route 45" then
moveToCell(28, 0)
elseif getMapName() == "Blackthorn City" then
moveToCell(29, 39)
elseif getMapName() == "Pokecenter Blackthorn" then
talkToNpcOnCell(10, 12)
end
end
end
function onBattleAction()
if isWildBattle() and (isOpponentShiny() or isAlreadyCaught() == false) then
if useItem("Pokeball") then
return
end
end
if getActivePokemonNumber() == 1 then
return attack() or sendUsablePokemon() or run() or sendAnyPokemon()
else
return run() or attack() or sendUsablePokemon() or sendAnyPokemon()
end
end
function onLearningMove(moveName, pokemonIndex)
forgetAnyMoveExcept(movesNotToForget)
end