2019-01-26, 12:06:37
PHP Code:
name = "Route 34"
author = "Gandalf"
description = [[Start anywhere between the exit of the Route 34 and the Pokecenter Goldenrod.]]
movesNotToForget = {Tackle} --add moves here
function onPathAction()
if isPokemonUsable(1) then
if getMapName() == "Pokecenter Goldenrod" then
moveToCell(10, 20)
elseif getMapName() == "Goldenrod City" then
moveToCell(69, 62)
elseif getMapName() == "Route 34" then
moveToRectangle(19, 1, 19, 11)
end
else
if getMapName() == "Route 34" then
moveToCell(11, 0)
elseif getMapName() == "Goldenrod City" then
moveToCell(64, 47)
elseif getMapName() == "Pokecenter Goldenrod" 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