Spoiler: BADGEFORWATERFALL = 8 add

# You can make this equal to whatever, I'm just using this as a default BADGEFORLAVASURF = BADGEFORSURF add

Spoiler: # Make water tiles passable if player is surfing elsif $PokemonGlobal.surfing && pbIsPassableWaterTag?(@terrain_tags[tile_id]) return true add

# Make lava tiles passable if player is lava surfing elsif $PokemonGlobal.lavasurfing && pbIsPassableLavaTag?(@terrain_tags[tile_id]) return true add

Spoiler: def move_down(turn_enabled = true) if turn_enabled turn_down end if passable?(@x, @y, 2) return if pbLedge(0,1) return if pbEndSurf(0,1) || pbEndLavaSurf(0,1) turn_down @y += 1 $PokemonTemp.dependentEvents.pbMoveDependentEvents increase_steps else if !check_event_trigger_touch(@x, @y+1) if [email protected]_se || @bump_se<=0 pbSEPlay("bump"); @bump_se=10 end end end end def move_left(turn_enabled = true) if turn_enabled turn_left end if passable?(@x, @y, 4) return if pbLedge(-1,0) return if pbEndSurf(-1,0) || pbEndLavaSurf(-1,0) turn_left @x -= 1 $PokemonTemp.dependentEvents.pbMoveDependentEvents increase_steps else if !check_event_trigger_touch(@x-1, @y) if [email protected]_se || @bump_se<=0 pbSEPlay("bump"); @bump_se=10 end end end end def move_right(turn_enabled = true) if turn_enabled turn_right end if passable?(@x, @y, 6) return if pbLedge(1,0) return if pbEndSurf(1,0) || pbEndLavaSurf(1,0) turn_right @x += 1 $PokemonTemp.dependentEvents.pbMoveDependentEvents increase_steps else if !check_event_trigger_touch(@x+1, @y) if [email protected]_se || @bump_se<=0 pbSEPlay("bump"); @bump_se=10 end end end end def move_up(turn_enabled = true) if turn_enabled turn_up end if passable?(@x, @y, 8) return if pbLedge(0,-1) return if pbEndSurf(0,-1) || pbEndLavaSurf(0,-1) turn_up @y -= 1 $PokemonTemp.dependentEvents.pbMoveDependentEvents increase_steps else if !check_event_trigger_touch(@x, @y-1) if [email protected]_se || @bump_se<=0 pbSEPlay("bump"); @bump_se=10 end end end end

Spoiler: if @character==$game_player && @tile_id == 0 if $PokemonGlobal.surfing || $PokemonGlobal.diving || $PokemonGlobal.lavasurfing bob=((Graphics.frame_count%60)/15).floor self.oy=(bob>=2) ? @ch-16-2 : @ch-16 end end if @tile_id == 0 if @character==$game_player && !$PokemonGlobal.fishing && ($PokemonGlobal.surfing || $PokemonGlobal.diving || $PokemonGlobal.lavasurfing ) sx = bob * @cw sy = (@character.direction - 2) / 2 * @ch self.src_rect.set(sx, sy, @cw, @ch) else sx = @character.pattern * @cw sy = (@character.direction - 2) / 2 * @ch self.src_rect.set(sx, sy, @cw, @ch) end end

Spoiler: def pbCanRun? terrain=pbGetTerrainTag return Input.press?(Input::A) && !pbMapInterpreterRunning? && [email protected]_route_forcing && $PokemonGlobal && $PokemonGlobal.runningShoes && !$PokemonGlobal.diving && !$PokemonGlobal.surfing && !$PokemonGlobal.bicycle && terrain!=PBTerrain::TallGrass && terrain!=PBTerrain::Ice && !$PokemonGlobal.lavasurfing end

Spoiler: if $PokemonGlobal.playerID>=0 && meta && !$PokemonGlobal.bicycle && !$PokemonGlobal.diving && !$PokemonGlobal.surfing && !$PokemonGlobal.lavasurfing if meta[4] && meta[4]!="" && Input.dir4!=0 && passable?(@x,@y,Input.dir4) && pbCanRun? # Display running character sprite @character_name=pbGetPlayerCharset(meta,4) else # Display normal character sprite @character_name=pbGetPlayerCharset(meta,1) end end

Spoiler: elsif $PokemonGlobal.surfing trialname="Water" elsif $PokemonGlobal.lavasurfing trialname="Lava"

Spoiler: Bridge = 15 Lava = 16 16 can be a different number if you've added other tiles. As long as it's defined separately from other tiles. 16 can be a different number if you've added other tiles. As long as it's defined separately from other tiles.

Spoiler: def pbIsPassableLavaTag?(tag) return tag==PBTerrain::Lava end

Spoiler: def Kernel.pbUpdateVehicle meta=pbGetMetadata(0,MetadataPlayerA+$PokemonGlobal.playerID) if meta if $PokemonGlobal.diving $game_player.character_name=pbGetPlayerCharset(meta,5) # Diving graphic elsif $PokemonGlobal.surfing $game_player.character_name=pbGetPlayerCharset(meta,3) # Surfing graphic elsif $PokemonGlobal.bicycle $game_player.character_name=pbGetPlayerCharset(meta,2) # Bicycle graphic elsif $PokemonGlobal.lavasurfing $game_player.character_name=pbGetPlayerCharset(meta,8) # Lava surfing graphic else $game_player.character_name=pbGetPlayerCharset(meta,1) # Regular graphic end end end

Spoiler: def Kernel.pbCancelVehicles(destination=nil) $PokemonGlobal.surfing=false $PokemonGlobal.diving=false $PokemonGlobal.lavasurfing=false if !destination || !pbCanUseBike?(destination) $PokemonGlobal.bicycle=false end Kernel.pbUpdateVehicle end

Spoiler: def pbFishingBegin $PokemonGlobal.fishing=true if !pbCommonEvent(FISHINGBEGINCOMMONEVENT) patternb = 2*$game_player.direction - 1 playertrainer=pbGetPlayerTrainerType meta=pbGetMetadata(0,MetadataPlayerA+$PokemonGlobal.playerID) num=($PokemonGlobal.surfing) ? 7 : ($PokemonGlobal.lavasurfing)? 9 : 6 if meta && meta[num] && meta[num]!="" charset=pbGetPlayerCharset(meta,num) 4.times do |pattern| $game_player.setDefaultCharName(charset,patternb-pattern) 2.times do Graphics.update Input.update pbUpdateSceneMap end end end end end def pbFishingEnd if !pbCommonEvent(FISHINGENDCOMMONEVENT) patternb = 2*($game_player.direction - 2) playertrainer=pbGetPlayerTrainerType meta=pbGetMetadata(0,MetadataPlayerA+$PokemonGlobal.playerID) num=($PokemonGlobal.surfing) ? 7 : ($PokemonGlobal.lavasurfing)? 9 : 6 if meta && meta[num] && meta[num]!="" charset=pbGetPlayerCharset(meta,num) 4.times do |pattern| $game_player.setDefaultCharName(charset,patternb+pattern) 2.times do Graphics.update Input.update pbUpdateSceneMap end end end end $PokemonGlobal.fishing=false end

Spoiler: #=============================================================================== # Lava Surf #=============================================================================== def Kernel.pbLavaSurf if $game_player.pbHasDependentEvents? return false end if $DEBUG || (HIDDENMOVESCOUNTBADGES ? $Trainer.numbadges>=BADGEFORLAVASURF : $Trainer.badges[BADGEFORLAVASURF]) movefinder=Kernel.pbCheckMove(:LAVASURF) if $DEBUG || movefinder if Kernel.pbConfirmMessage(_INTL("The lava is a deep red...

Would you like to surf on it?")) speciesname=!movefinder ? $Trainer.name : movefinder.name Kernel.pbMessage(_INTL("{1} used Lava Surf!",speciesname)) pbHiddenMoveAnimation(movefinder) surfbgm=pbGetMetadata(0,MetadataSurfBGM) if surfbgm pbCueBGM(surfbgm,0.5) end pbStartLavaSurfing() return true end end end return false end def pbStartLavaSurfing() Kernel.pbCancelVehicles $PokemonEncounters.clearStepCount $PokemonGlobal.lavasurfing=true Kernel.pbUpdateVehicle Kernel.pbJumpToward Kernel.pbUpdateVehicle $game_player.check_event_trigger_here([1,2]) end def pbEndLavaSurf(xOffset,yOffset) return false if !$PokemonGlobal.lavasurfing x=$game_player.x y=$game_player.y currentTag=$game_map.terrain_tag(x,y) facingTag=Kernel.pbFacingTerrainTag if pbIsPassableLavaTag?(currentTag) && !pbIsPassableLavaTag?(facingTag) if Kernel.pbJumpToward(1,false,true) # Kernel.pbCancelVehicles $game_map.autoplayAsCue $game_player.increase_steps result=$game_player.check_event_trigger_here([1,2]) Kernel.pbOnStepTaken(result) end return true end return false end def Kernel.pbTransferLavaSurfing(mapid,xcoord,ycoord,direction=$game_player.direction) pbFadeOutIn(99999){ $game_temp.player_new_map_id=mapid $game_temp.player_new_x=xcoord $game_temp.player_new_y=ycoord $game_temp.player_new_direction=direction Kernel.pbCancelVehicles $PokemonGlobal.lavasurfing=true Kernel.pbUpdateVehicle $scene.transfer_player(false) $game_map.autoplay $game_map.refresh } end Events.onAction+=proc{|sender,e| terrain=Kernel.pbFacingTerrainTag notCliff=$game_map.passable?($game_player.x,$game_player.y,$game_player.direction) if pbIsPassableLavaTag?(terrain) && !$PokemonGlobal.lavasurfing && !pbGetMetadata($game_map.map_id,MetadataBicycleAlways) && notCliff Kernel.pbLavaSurf return end } HiddenMoveHandlers::CanUseMove.add(:LAVASURF,proc{|move,pkmn| terrain=Kernel.pbFacingTerrainTag notCliff=$game_map.passable?($game_player.x,$game_player.y,$game_player.direction) if !$DEBUG && !(HIDDENMOVESCOUNTBADGES ? $Trainer.numbadges>=BADGEFORLAVASURF : $Trainer.badges[BADGEFORLAVASURF]) Kernel.pbMessage(_INTL("Sorry, a new Badge is required.")) return false end if $PokemonGlobal.lavasurfing Kernel.pbMessage(_INTL("You're already surfing.")) return false end if $game_player.pbHasDependentEvents? Kernel.pbMessage(_INTL("It can't be used when you have someone with you.")) return false end if pbGetMetadata($game_map.map_id,MetadataBicycleAlways) Kernel.pbMessage(_INTL("Let's enjoy cycling!")) return false end if !pbIsPassableLavaTag?(terrain) || !notCliff Kernel.pbMessage(_INTL("No surfing here!")) return false end return true }) HiddenMoveHandlers::UseMove.add(:LAVASURF,proc{|move,pokemon| if !pbHiddenMoveAnimation(pokemon) Kernel.pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move))) end pbStartLavaSurfing() return true })

Spoiler: attr_accessor :surfing attr_accessor :lavasurfing

Spoiler: @surfing = false @lavasurfing = false

Spoiler: GlobalTypes={ "Home"=>[MetadataHome,"uuuu"], "WildBattleBGM"=>[MetadataWildBattleBGM,"s"], "TrainerBattleBGM"=>[MetadataTrainerBattleBGM,"s"], "WildVictoryME"=>[MetadataWildVictoryME,"s"], "TrainerVictoryME"=>[MetadataTrainerVictoryME,"s"], "SurfBGM"=>[MetadataSurfBGM,"s"], "BicycleBGM"=>[MetadataBicycleBGM,"s"], "PlayerA"=>[MetadataPlayerA,"esssssssss",:PBTrainers], "PlayerB"=>[MetadataPlayerB,"esssssssss",:PBTrainers], "PlayerC"=>[MetadataPlayerC,"esssssssss",:PBTrainers], "PlayerD"=>[MetadataPlayerD,"esssssssss",:PBTrainers], "PlayerE"=>[MetadataPlayerE,"esssssssss",:PBTrainers], "PlayerF"=>[MetadataPlayerF,"esssssssss",:PBTrainers], "PlayerG"=>[MetadataPlayerG,"esssssssss",:PBTrainers], "PlayerH"=>[MetadataPlayerH,"esssssssss",:PBTrainers] }

Spoiler: 560,LAVASURF,Lava Surf,075,95,FIRE,Special,100,15,0,08,0,bef,"It swamps the area around the user with a giant wave of molten rock. It can also be used for crossing lava."

Spoiler: PlayerA=POKEMONTRAINER_Red,trchar000,boy_bike,boy_surf_offset,boy_run,boy_dive_offset,boy_fish_offset,boy_fishsurf_offset ,boy_surf_offset ,boy_fishsurf_offset PlayerB=POKEMONTRAINER_Leaf,trchar001,girl_bike,girl_surf_offset,girl_run,girl_dive_offset,girl_fish_offset,girl_fishsurf_offset ,girl_surf_offset,girl_fishsurf_offset

Note before you add this: PokeCommunity's formatting breaks scripts. To avoid unnecessary errors, please click Thread Tools and use the Show Printable Version tool. This will show the raw text data in the post, without all the formatting. If you comment on this with a syntax error after I've told you how to solve this, I will not respond.Follow all these instructions, and you'll be surfing on lava very soon!In Settings, underIn Game_Map, underIn Game_Player , add the red parts to the following methodsIn Sprite_Character, in def update add the red partsIn Walk_Run add the red part to pbCanRun?then (same section) under def character_name add the red partIn PokeBattle_ActualScene add the red partThis just allows you to have a lava base during battlesIn PokemonField, under module PBTerrain, add the red partRight after this module ends, addSame section, add the red part to def Kernel.pbUpdateVehicleNext add the red part to def Kernel.pbCancelVehicleReplace def pbFishingBegin and def pbFishingEndBetween the sections for Surf and Waterfall in PokemonHiddenMoves, add this whole thingIn PokemonMap under class PokemonGlobalMetadata, add the red partSlightly lower under def initialize, add the red partLastly, same section, under Module PokemonMetadata replace this partAnd that's all the coding part. Three other things you will need to do.1. Add Lava Surf as a move to moves.txt2. Add a filepath for each character in your metadata.txt (red part is the addition)I'm just using the default surfing graphic, you can use a special graphic or whatever3. Just like with bridges, you'll have to add the terrain tag to lava tiles through the Editor. Otherwise they won't be seen as lava tags. Don't forget that the terrain tag has to be added to the tile individually on each tileset.4. (Optional) Make Lava Surf a tm/hm move. I didn't provide this, but you can just basically copy surf and rename it.I've provided a 4th gen style lava autotile you can use (credit to rayquaza_dot)Note that while this allows for the graphics to change and work for fishing, this does not enable fishing while lava surfing, because I think that's just silly.Tutorial is written for v15, untested for previous versions.