2019-03-12, 13:02:19
PHP Code:
name = "Granite Cave 1F"
author = "whtmn"
description = [[Start anywhere between the exit of the Granite Cave 1F and the Pokecenter Dewford Town.]]
movesNotToForget = {} --add moves here
function onPathAction()
if isPokemonUsable(1) then
if getMapName() == "Pokecenter Dewford Town" then
moveToCell(8, 22)
elseif getMapName() == "Dewford Town" then
moveToCell(18, 0)
elseif getMapName() == "Route 106" then
moveToCell(75, 34)
elseif getMapName() == "Granite Cave 1F" then
moveToRectangle(37, 14, 40, 14)
end
else
if getMapName() == "Granite Cave 1F" then
moveToCell(39, 15)
elseif getMapName() == "Route 106" then
moveToCell(99, 42)
elseif getMapName() == "Dewford Town" then
moveToCell(13, 14)
elseif getMapName() == "Pokecenter Dewford Town" then
talkToNpcOnCell(8, 14)
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