2019-01-25, 15:35:38
PHP Code:
name = "Union Cave 1F"
author = "Gandalf"
description = [[Start anywhere between the exit of the Union Cave 1F and the Pokecenter Route 32.]]
movesNotToForget = {} --add moves here
function onPathAction()
if isPokemonUsable(1) then
if getMapName() == "Pokecenter Route 32" then
moveToCell(9, 22)
elseif getMapName() == "Route 32" then
moveToCell(13, 137)
elseif getMapName() == "Union Cave 1F" then
moveToRectangle(36, 45, 43, 45)
end
else
if getMapName() == "Union Cave 1F" then
moveToCell(43, 47)
elseif getMapName() == "Route 32" then
moveToCell(19, 128)
elseif getMapName() == "Pokecenter Route 32" then
talkToNpcOnCell(9, 15)
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