- 2,531
- Posts
- 5
- Years
- बिहार, भारत। Bihar, India.
- Seen Mar 19, 2025
LAVASURF
POKEMON ESSENTIALS V18
![[PokeCommunity.com] LAVASURF [ESSENTIALS V18] [PokeCommunity.com] LAVASURF [ESSENTIALS V18]](https://i.imgur.com/UvNKHKL.gif)
Features:
- LavaSurf code all-in-one.
- No need to edit any script.
- Complete drag and drop.
- LavaSurf over Lava.
- Encounter and Battle Pokemons in Lava Environment.
Usage:
- Read the Instructions, and accordingly, configure the Options, in the Script.
- All files and script available in the Attachment.
- Place the script above Main and below Compiler.
- Put the Graphics files in their proper folders.
- Define the LavaSurf Move in the "moves.txt" PBS file as following:-
Code:XXX,LAVASURF,Lava Surf,075,95,FIRE,Special,100,15,0,AllNearOthers,0,bef,"It swamps the area around the user with a giant wave of molten rock. It can also be used for crossing lava."
- Define the LavaSurf Metadata in the "metadata.txt" PBS file as following:-
Code:PlayerA = POKEMONTRAINER_Red,trchar000,boy_bike,boy_surf,boy_run,boy_surf,boy_fish_offset,boy_fish_offset,boy_surf PlayerB = POKEMONTRAINER_Leaf,trchar001,girl_bike,girl_surf,girl_run,girl_surf,girl_fish_offset,girl_fish_offset,girl_surf
- Define the Lava Encounters in the "encounters.txt" PBS file like:-
Code:Lava CHARMANDER,5,8 CHARMELEON,6,11 CHARMANDER,7,14 CHARMELEON,15,19 CHARIZARD,23,30
Script:
Spoiler:
Code:
#==============================================================================#
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||#
#==============================================================================#
# ------------------------------------------- #
# | Lava Surf | #
# | by Bhagya Jyoti | #
# | for Pokemon Essentials v18 | #
# | adapted from mej71 | #
# | graphics by UlithiumDragon | #
# ------------------------------------------- #
# ~v1.0~ #
#==============================================================================#
#------------------------------------------------------------------------------#
# ::::Installation:::: #
# -------------- #
# Follow the below instructions for proper functioning of LavaSurfing. #
# ____________________________________________________________________________ #
#------------------------------------------------------------------------------#
# Place the script above Main and below Compiler. #
# Put the Graphics files in their proper folders. #
#------------------------------------------------------------------------------#
# Define the LavaSurf Move in the "moves.txt" PBS file as following:- #
#XXX,LAVASURF,Lava Surf,075,95,FIRE,Special,100,15,0,AllNearOthers,0,bef,"It swamps the area around the user with a giant wave of molten rock. It can also be used for crossing lava."
# Don't forget to edit the XXX to the next entry. #
#------------------------------------------------------------------------------#
# Define the LavaSurf Metadata in the "metadata.txt" PBS file as following:- #
#PlayerA = POKEMONTRAINER_Red,trchar000,boy_bike,boy_surf,boy_run,boy_surf,boy_fish_offset,boy_fish_offset,boy_surf
#PlayerB = POKEMONTRAINER_Leaf,trchar001,girl_bike,girl_surf,girl_run,girl_surf,girl_fish_offset,girl_fish_offset,girl_surf
# Addition of boy_surf and girl_surf after every Player Metadata. #
# This is the sprite of Player to be shown while LavaSurfing. #
#------------------------------------------------------------------------------#
# Define the Lava Encounters in the "encounters.txt" PBS file like:- #
#Lava
# CHARMANDER,5,8
# CHARMELEON,6,11
# CHARMANDER,7,14
# CHARMELEON,15,19
# CHARIZARD,23,30
#------------------------------------------------------------------------------#
#==============================================================================#
#==============================================================================#
# ::::Options:::: #
# -------- #
# Edit below options as per your game's perspective. #
# Source contains the main source code where you can find weather any number #
# is not reserved by any other variables, and is free for lava surf. #
# ____________________________________________________________________________ #
#------------------------------------------------------------------------------#
# The badge which must be earned to use LavaSurf Move for LavaSurfing. #
LAVASURF_BADGE = 4 #
#------------------------------------------------------------------------------#
# The path of the Sprite base for LavaSurfing. #
LAVASURF_BITMAP = "Graphics/Characters/base_lava" #
#------------------------------------------------------------------------------#
# The Terrain Tag for the LavaSurf Tiles and Autotiles. #
# Make sure this number is not used by any other Terrain Tags. #
# Source: module PBTerrain #
LAVASURF_TERRAIN_TAG = 20 #
#------------------------------------------------------------------------------#
# The Constant which controls weather to initiate the LavaSurf Environment #
# true - LavaSurf Environment, Encounters and Battles. #
# false - No LavaSurf Environment, Encounters and Battles. #
# No need to edit the below Options. #
LAVASURF_ESSENTIALS = true #
#------------------------------------------------------------------------------#
# The Environment which corresponds to LavaSurf Environment. #
# Make sure this number is not used by any other Envirronments. #
# Source: module PBEnvironment #
LAVASURF_ENVIRONMENT = 19 #
#------------------------------------------------------------------------------#
# The Encounter Type which corresponds to the LavaSurf Encounters. #
# Make sure this number is not used by any other Encounters. #
# Source: module EncounterTypes #
LAVASURF_ENCOUNTER_TYPE = 13 #
#------------------------------------------------------------------------------#
# The Graphics to be used for Battles while LavaSurfing. #
# If used a Graphic called "lava" (this is default), add 4 Graphics in the #
# directory Graphics/Battlebacks with the following names and functions:- #
# "lava_base0" - For the battle base of the player. #
# "lava_base1" - For the battle base of the enemy. #
# "lava_bg" - For the battle background while lavasurfing. #
# "lava_message" - For the battle message box while lavasurfing. #
# Note: I renamed unused mud_eve bases, and champion1 bg and message box. #
LAVASURF_BATTLE = "lava" #
#------------------------------------------------------------------------------#
#==============================================================================#
#==============================================================================#
# ::::Script:::: #
# -------- #
# ____________________________________________________________________________ #
#==============================================================================#
# * Plugin Manager #
# * Credits:- #
# Bhagya Jyoti (v18 Script adapted from mej71's code) #
# mej71 (Original Script) #
# UlithiumDragon (LavaSurf Autotiles and LavaBase Bitmap) #
#==============================================================================#
PluginManager.register({
:name => "LavaSurf",
:version => "1",
:link => "https://www.pokecommunity.com/showthread.php?t=444700",
:credits => ["Bhagya Jyoti","mej71","UlithiumDragon"]
})
#==============================================================================#
# * Adding an extra Player Metadata for LavaSurfing #
#==============================================================================#
module PokemonMetadata
GlobalTypes["PlayerA"]=[MetadataPlayerA,"essssssss",:PBTrainers]
GlobalTypes["PlayerB"]=[MetadataPlayerB,"essssssss",:PBTrainers]
GlobalTypes["PlayerC"]=[MetadataPlayerC,"essssssss",:PBTrainers]
GlobalTypes["PlayerD"]=[MetadataPlayerD,"essssssss",:PBTrainers]
GlobalTypes["PlayerE"]=[MetadataPlayerE,"essssssss",:PBTrainers]
GlobalTypes["PlayerF"]=[MetadataPlayerF,"essssssss",:PBTrainers]
GlobalTypes["PlayerG"]=[MetadataPlayerG,"essssssss",:PBTrainers]
GlobalTypes["PlayerH"]=[MetadataPlayerH,"essssssss",:PBTrainers]
end
#==============================================================================#
# * Adding the Terrain Tags #
#==============================================================================#
module PBTerrain
Lava = LAVASURF_TERRAIN_TAG
def PBTerrain.isLava?(tag)
return tag==PBTerrain::Lava
end
def PBTerrain.isLavaSurfable?(tag)
return tag==PBTerrain::Lava
end
end
#==============================================================================#
# * Adding Global Variables under $PokemonGlobal.lavasurfing #
#==============================================================================#
class PokemonGlobalMetadata
attr_accessor :lavasurfing
alias lavasurfing_init initialize
def initialize
lavasurfing_init
@lavasurfing = false
end
end
class PokemonTemp
attr_accessor :lavasurfJump
attr_accessor :lavasurfEnd
end
#==============================================================================#
# * Refreshment of the Vehicle Update codes #
#==============================================================================#
alias lavasurf_updateVehicle pbUpdateVehicle
def pbUpdateVehicle
if $PokemonGlobal.lavasurfing
meta = pbGetMetadata(0,MetadataPlayerA+$PokemonGlobal.playerID)
if meta
newCharName = pbGetPlayerCharset(meta,8)
$game_player.character_name = newCharName if newCharName
end
else
lavasurf_updateVehicle
end
end
alias lavasurf_cancelVehicle pbCancelVehicles
def pbCancelVehicles(destination=nil)
$PokemonGlobal.lavasurfing = false
lavasurf_cancelVehicle(destination)
end
#==============================================================================#
# * Edition of Passability over Lava #
#==============================================================================#
class Game_Map
alias lavasurf_playerpassable playerPassable?
def playerPassable?(x, y, d, self_event = nil)
for i in [2, 1, 0]
if PBTerrain.isLava?(@terrain_tags[@map.data[x, y, i]]) && $PokemonGlobal.lavasurfing
return true
end
end
lavasurf_playerpassable(x, y, d, self_event)
end
end
#==============================================================================#
# * Various Game_Player Editions for Movement/Sprite Updates #
#==============================================================================#
class Game_Player < Game_Character
alias lavasurf_move_down move_down
def move_down(turn_enabled = true)
if passable?(@x, @y, 2)
return if pbEndLavaSurf(0,1)
end
lavasurf_move_down(turn_enabled)
end
alias lavasurf_move_left move_left
def move_left(turn_enabled = true)
if passable?(@x, @y, 4)
return if pbEndLavaSurf(-1,0)
end
lavasurf_move_left(turn_enabled)
end
alias lavasurf_move_right move_right
def move_right(turn_enabled = true)
if passable?(@x, @y, 6)
return if pbEndLavaSurf(1,0)
end
lavasurf_move_right(turn_enabled)
end
alias lavasurf_move_up move_up
def move_up(turn_enabled = true)
if passable?(@x, @y, 8)
return if pbEndLavaSurf(0,-1)
end
lavasurf_move_up(turn_enabled)
end
alias lavasurf_move_update update
def update
if $PokemonTemp.lavasurfEnd && !moving?
pbCancelVehicles
$PokemonTemp.lavasurfJump = nil
$PokemonTemp.lavasurfEnd = false
end
lavasurf_move_update
end
alias lavasurf_canrun pbCanRun?
def pbCanRun?
return lavasurf_canrun && !$PokemonGlobal.lavasurfing
end
alias lavasurf_updateptrn update_pattern
def update_pattern
if $PokemonGlobal.lavasurfing
p = ((Graphics.frame_count%60)*@@bobFrameSpeed).floor
@pattern = p if !@lock_pattern
@pattern_surf = p
@bob_height = (p>=2) ? 2 : 0
else
lavasurf_updateptrn
end
end
def update_command
if PBTerrain.isIce?(pbGetTerrainTag)
self.move_speed = 4 # Sliding on ice
elsif !moving? && !@move_route_forcing && $PokemonGlobal
if $PokemonGlobal.bicycle
self.move_speed = 5 # Cycling
elsif pbCanRun? || $PokemonGlobal.surfing || $PokemonGlobal.lavasurfing
self.move_speed = 4 # Running, surfing
else
self.move_speed = 3 # Walking, diving
end
end
super
end
def character_name
@defaultCharacterName = "" if !@defaultCharacterName
return @defaultCharacterName if @defaultCharacterName!=""
if !@move_route_forcing && $PokemonGlobal.playerID>=0
meta = pbGetMetadata(0,MetadataPlayerA+$PokemonGlobal.playerID)
if meta && !$PokemonGlobal.bicycle && !$PokemonGlobal.diving && !$PokemonGlobal.surfing && !$PokemonGlobal.lavasurfing
charset = 1 # Display normal character sprite
if pbCanRun? && (moving? || @wasmoving) && Input.dir4!=0 && meta[4] && meta[4]!=""
charset = 4 # Display running character sprite
end
newCharName = pbGetPlayerCharset(meta,charset)
@character_name = newCharName if newCharName
@wasmoving = moving?
end
end
return @character_name
end
end
#==============================================================================#
# * Defining Base of LavaSurf #
#==============================================================================#
class Sprite_SurfBase
alias lavasurf_dispose dispose
def dispose
if !@disposed
@lavasurfbitmap.dispose
lavasurf_dispose
end
end
def update
@lavasurfbitmap = AnimatedBitmap.new(LAVASURF_BITMAP)
@cwl = @lavasurfbitmap.width/4
@chl = @lavasurfbitmap.height/4
return if disposed?
if !$PokemonGlobal.surfing && !$PokemonGlobal.diving && !$PokemonGlobal.lavasurfing
if @sprite
@sprite.dispose
@sprite = nil
end
return
end
@sprite = Sprite.new(@viewport) if !@sprite
if @sprite
if $PokemonGlobal.surfing
@sprite.bitmap = @surfbitmap.bitmap; cw = @cws; ch = @chs
elsif $PokemonGlobal.diving
@sprite.bitmap = @divebitmap.bitmap; cw = @cwd; ch = @chd
end
if $PokemonGlobal.lavasurfing
@sprite.bitmap = @lavasurfbitmap.bitmap; cw = @cwl; ch = @chl
end
sx = @event.pattern_surf*cw
sy = ((@event.direction-2)/2)*ch
@sprite.src_rect.set(sx,sy,cw,ch)
if $PokemonTemp.surfJump
@sprite.x = ($PokemonTemp.surfJump[0]*Game_Map::[email protected]_x+3)/4+(Game_Map::TILE_WIDTH/2)
@sprite.y = ($PokemonTemp.surfJump[1]*Game_Map::[email protected]_y+3)/4+(Game_Map::TILE_HEIGHT/2)+16
else
@sprite.x = @rsprite.x
@sprite.y = @rsprite.y
end
if $PokemonTemp.lavasurfJump
@sprite.x = ($PokemonTemp.lavasurfJump[0]*Game_Map::[email protected]_x+3)/4+(Game_Map::TILE_WIDTH/2)
@sprite.y = ($PokemonTemp.lavasurfJump[1]*Game_Map::[email protected]_y+3)/4+(Game_Map::TILE_HEIGHT/2)+16
else
@sprite.x = @rsprite.x
@sprite.y = @rsprite.y
end
@sprite.ox = cw/2
@sprite.oy = ch-16 # Assume base needs offsetting
@sprite.oy -= @event.bob_height
@sprite.z = @event.screen_z(ch)-1
@sprite.zoom_x = @rsprite.zoom_x
@sprite.zoom_y = @rsprite.zoom_y
@sprite.tone = @rsprite.tone
@sprite.color = @rsprite.color
@sprite.opacity = @rsprite.opacity
end
end
end
#==============================================================================#
# * Initiating LavaSurf Essentials if LAVASURF_ESSENTIALS is true #
# Initiates LavaSurf Environment, Encounters and Battles #
#==============================================================================#
if LAVASURF_ESSENTIALS
#==============================================================================#
# * Adding the Lava Environment #
#==============================================================================#
module PBEnvironment
Lava = LAVASURF_ENVIRONMENT
end
#==============================================================================#
# * Adding and Initiating Lava Surf Encounters #
#==============================================================================#
module EncounterTypes
Lava = LAVASURF_ENCOUNTER_TYPE
Names[LAVASURF_ENCOUNTER_TYPE] = "Lava"
EnctypeChances[LAVASURF_ENCOUNTER_TYPE] = [60,30,5,4,1]
EnctypeDensities[LAVASURF_ENCOUNTER_TYPE] = 10
EnctypeCompileDens[LAVASURF_ENCOUNTER_TYPE] = 1
end
class PokemonEncounters
alias lavasurf_encounter isEncounterPossibleHere?
def isEncounterPossibleHere?
if $PokemonGlobal.lavasurfing
return true
end
lavasurf_encounter
end
alias lavasurf_enctype pbEncounterType
def pbEncounterType
if $PokemonGlobal.lavasurfing
return EncounterTypes::Lava
end
lavasurf_enctype
end
end
#==============================================================================#
# * Preparing Battle Backgrounds and Bases #
#==============================================================================#
alias lavasurf_battle pbPrepareBattle
def pbPrepareBattle(battle)
lavasurf_battle(battle)
battleRules = $PokemonTemp.battleRules
if $PokemonGlobal.lavasurfing
backdrop = LAVASURF_BATTLE
end
battle.backdrop = backdrop if backdrop!=nil
if battleRules["base"].nil?
case battle.environment
when PBEnvironment::Lava
base = LAVASURF_BATTLE
end
end
battle.backdropBase = base if base!=nil
end
def pbGetEnvironment
ret = pbGetMetadata($game_map.map_id,MetadataEnvironment)
ret = PBEnvironment::None if !ret
if $PokemonTemp.encounterType==EncounterTypes::OldRod ||
$PokemonTemp.encounterType==EncounterTypes::GoodRod ||
$PokemonTemp.encounterType==EncounterTypes::SuperRod
terrainTag = pbFacingTerrainTag
else
terrainTag = $game_player.terrain_tag
end
case terrainTag
when PBTerrain::Grass, PBTerrain::SootGrass
ret = (ret==PBEnvironment::Forest) ? PBEnvironment::ForestGrass : PBEnvironment::Grass
when PBTerrain::TallGrass
ret = (ret==PBEnvironment::Forest) ? PBEnvironment::ForestGrass : PBEnvironment::TallGrass
when PBTerrain::Rock; ret = PBEnvironment::Rock
when PBTerrain::Sand; ret = PBEnvironment::Sand
when PBTerrain::DeepWater, PBTerrain::Water; ret = PBEnvironment::MovingWater
when PBTerrain::StillWater; ret = PBEnvironment::StillWater
when PBTerrain::Puddle; ret = PBEnvironment::Puddle
when PBTerrain::Ice; ret = PBEnvironment::Ice
when PBTerrain::Lava; ret = PBEnvironment::Lava
end
return ret
end
#==============================================================================#
# * Ending the LAVASURF_ESSENTIALS condition #
#==============================================================================#
end
#==============================================================================#
# * Main Lava Surf code #
#==============================================================================#
def pbLavaSurf
return false if $game_player.pbFacingEvent
return false if $game_player.pbHasDependentEvents?
move = getID(PBMoves,:LAVASURF)
movefinder = pbCheckMove(move)
if !pbCheckHiddenMoveBadge(LAVASURF_BADGE,false) || (!$DEBUG && !movefinder)
return false
end
if pbConfirmMessage(_INTL("The lava is red hot...\nWould you like to surf on it?"))
speciesname = (movefinder) ? movefinder.name : $Trainer.name
pbMessage(_INTL("{1} used {2}!",speciesname,PBMoves.getName(move)))
pbCancelVehicles
pbHiddenMoveAnimation(movefinder)
lavasurfbgm = pbGetMetadata(0,MetadataSurfBGM)
pbCueBGM(lavasurfbgm,0.5) if lavasurfbgm
pbStartLavaSurfing
return true
end
return false
end
#==============================================================================#
# * Starting LavaSurfing #
#==============================================================================#
def pbStartLavaSurfing
pbCancelVehicles
$PokemonEncounters.clearStepCount
$PokemonGlobal.lavasurfing = true
pbUpdateVehicle
$PokemonTemp.lavasurfJump = $MapFactory.getFacingCoords($game_player.x,$game_player.y,$game_player.direction)
pbJumpToward
$PokemonTemp.lavasurfJump = nil
$game_player.check_event_trigger_here([1,2])
end
#==============================================================================#
# * Ending LavaSurfing #
#==============================================================================#
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 = pbFacingTerrainTag
if PBTerrain.isLavaSurfable?(currentTag) && !PBTerrain.isLavaSurfable?(facingTag)
$PokemonTemp.lavasurfJump = [x,y]
if pbJumpToward(1,false,true)
$game_map.autoplayAsCue
$game_player.increase_steps
result = $game_player.check_event_trigger_here([1,2])
pbOnStepTaken(result)
end
$PokemonTemp.lavasurfJump = nil
return true
end
return false
end
#==============================================================================#
# * Tranferring while LavaSurfing #
#==============================================================================#
def pbTransferLavaSurfing(mapid,xcoord,ycoord,direction=$game_player.direction)
pbFadeOutIn {
$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
$scene.transfer_player(false)
$game_map.autoplay
$game_map.refresh
}
end
#==============================================================================#
# * Movement while LavaSurfing #
#==============================================================================#
Events.onAction += proc { |_sender,_e|
next if $PokemonGlobal.lavasurfing
next if pbGetMetadata($game_map.map_id,MetadataBicycleAlways)
next if !PBTerrain.isLavaSurfable?(pbFacingTerrainTag)
next if !$game_map.passable?($game_player.x,$game_player.y,$game_player.direction,$game_player)
pbLavaSurf
}
#==============================================================================#
# * Checking weather LavaSurfing can be used #
#==============================================================================#
HiddenMoveHandlers::CanUseMove.add(:LAVASURF,proc { |move,pkmn,showmsg|
next false if !pbCheckHiddenMoveBadge(LAVASURF_BADGE,showmsg)
if $PokemonGlobal.lavasurfing
pbMessage(_INTL("You're already lava surfing.")) if showmsg
next false
end
if $game_player.pbHasDependentEvents?
pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg
next false
end
if pbGetMetadata($game_map.map_id,MetadataBicycleAlways)
pbMessage(_INTL("Let's enjoy cycling!")) if showmsg
next false
end
if !PBTerrain.isLavaSurfable?(pbFacingTerrainTag) ||
!$game_map.passable?($game_player.x,$game_player.y,$game_player.direction,$game_player)
pbMessage(_INTL("No lava surfing here!")) if showmsg
next false
end
next true
})
#==============================================================================#
# * LavaSurf Hidden Move Animation #
#==============================================================================#
HiddenMoveHandlers::UseMove.add(:LAVASURF,proc { |move,pokemon|
$game_temp.in_menu = false
pbCancelVehicles
if !pbHiddenMoveAnimation(pokemon)
pbMessage(_INTL("{1} used {2}!",pokemon.name,PBMoves.getName(move)))
end
lavasurfbgm = pbGetMetadata(0,MetadataSurfBGM)
pbCueBGM(lavasurfbgm,0.5) if lavasurfbgm
pbStartLavaSurfing
next true
})
#==============================================================================#
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||#
# ____________________________________________________________________________ #
Credits:
- Bhagya Jyoti
- mej71
- UlithiumDragon
Attachments
Last edited: