- 2,531
- Posts
- 5
- Years
- बिहार, भारत। Bihar, India.
- Seen Mar 19, 2025
RIDE PAGER
The Complete Pokeride Solution
Features:
- Interact with Pokemons and register them in your Ride Pager.
- Call the Mounts wherever you wish just from the Ride Pager.
- Pass marshy waters, climb mountains, and escape dungeons.
- Easy to define more Mounts and to use them as you wish.
- And many more Pokemon Mount features.
NOTE:
- This script is for Pokemon Essentials v17.
- This script requires "Pokeride" script by Marin! Please have that installed before installing this script!
- Higher version will be released as soon as there is official conversion of Pokeride script by Marin to v18.
- Special Thanks to Ulithium Dragon to grant permission to use, convert and release the script!
RIDE PREVIEWS:
Tauros & Rampardos can Smash small Rocks.
Machamp can use Strength.
Stoutland can find hidden Items.
Mudsdale & Rhyhorn climbing Mountain.
More PokeRides:-
Spoiler:
Gogoat can climb ledges and headbutt trees.
Kabutops can cut small trees.
Swampert can surf on swampy/marshy water.
Luxray can use Flash.
Avalugg can walk on Ice.
Hippowdon can Dig.
Flygon can Fly over Waters or to Cities.
Lapras can climb Waterfall while Surfing.
Sharpedo can Surf and Dive Underwater.
Araquanid can walk on water and dive underwater.
Code:
Link of Album- https://imgur.com/a/NtCnmWz
Spoiler:
INSTALLATION:
- Download the files from here or from the attachments.
- Place the script above Main and below Pokéride_Main and Pokéride_Rides.
- Replace the Pokeride_Rides script with the one provided in the folder.
- Put the Audio, Data, Graphics, and PBS files to their proper folders.
- Define the Ride Pager item in the "items.txt" PBS file as following:-
XXX,RIDEPAGER,Ride Pager,Ride Pagers,8,0,"By entering certain numbers on this pager, you can summon Ride Pokémon in an instant.",2,0,6,
Don't forget to edit the XXX to the next entry, and rename the item icon to it before pasting it in Graphics/Icons - In "PScreen_Load" script section, search for
$PokemonStorage = Marshal.load(f)"
under"File.open(savefile){|f|
and place the code below it:
Code:$RideMounts = Marshal.load(f)
- In "PScreen_Save" script section, search for
Marshal.dump($PokemonStorage,f)"
under"File.open
and place the code below it:
Code:Marshal.dump($RideMounts,f)
Options:
Spoiler:
$REGISTERALLMOUNTS
- Default: falseAdds all mounts to the ride pager from the start (mostly used for testing).
$MOUNTMODE
- Default: 0The Mode by which you want to Mount the Pokemons from Ride Pager.
0 - Mount those Pokemon which have been registered via
pbRegisterMount
method.Most preferred mode of mounting. More info in Methods section below.
1 - Mount only those Pokemon which are present in Trainer's Party.
A primitive mode as only 6 Pokemons could be available at most.
2 - A combination of 0 and 1 and requires both.
Primitive mode as the pokemon must be present in party and also must be
registered through
pbRegisterMount
methods.3 - A combination of 0 and 1 but requires at least one condition.
A mount is registered if it is in party or registered via the methods.
$MOUNTEVENTID
- Default: 10The ID of the Common Event that holds the mount/dismount animation.
By default it is
10
, and therefore, the Common Event #10 will be initiiated for the animation effects.$MOUNTANIMATION
- Default: trueToggles the MountAnimation to be played from the common event id.
If
true
, don't forget to specify the Common Event ID in $MOUNTEVENTID
.$PLAYMOUNTSE
- Default: trueControls whether the mounting/dismounting sound effects should be played.
$PLAYMOUNTCRY
- Default: trueControls whether the Pokemon's cry sound should play when summoned.
The cries shall be present in the
Audio/Se/Cries
.$CANUSE_INDOORS
- Default: falseControls whether or not mounts can be summoned indoors.
This affects all indoor maps, including caves.
Currently this check is tied to the bike check. Ergo, if you can ride a bike, you can mount.
$CANUSE_INDOORS_SURFMOUNTS
- Default: trueIf
$CANUSE_INDOORS
is false
, this controls whether or not to include the surf mounts.It is highly recommend leaving this on
true
unless you're certain that you have no maps with surfable water that have the metadata flag Bicycle=false
(cave maps usually have this set to true).$NOMOUNTING_TERRAINTAG
- Default: nilIf you want terrain tag that blocks mounting when standing on or facing a tile, put its terrain ID as defined in PBTerrain here.
$NODISMOUNTING_TERRAINTAG
- Default: nilIf you want a terrain tag that blocks dismounting when standing on or facing a tile, put its terrain ID as defined in PBTerrain here.
NOTE: In most cases
$NODISMOUNTING_TERRAINTAG
should be the same as $NOMOUNTING_TERRAINTAG
.Methods:
Spoiler:
Call any of the methods in an event or elsewhere to perform various functions:-
pbGiveRidePagerItem
Give the Ride Pager item to the Player.
It must also be defined in the PBS/items.txt.
pbRidePagerMenu
Initiate the Ride Pager scene any where. Note that, this is the same code that runs in the Item Handler section.
pbRegisterAllMounts
Register all Pokeride Mounts directly.
It also takes an argument
msg
which is true
by default to show message that all mounts have been successfully been registered.To register all mounts silently without message, call
pbRegisterAllMounts(false)
.pbRegisterMount(mountname)
Register a particular mount, where
mountname
is the name of the mount, which can be in variations.It also has another argument to show that the particular pokemon has been registered. To disable the message, call
pbRegisterMount(mountname,false)
, where mountname is the pokeride name.Example- Registering Tauros:-
- The internal name of Pokemon-
pbRegisterMount(:TAUROS)
- Even in lower case (or any case)-
pbRegisterMount(:tauros)
- The name of Pokemon in a string-
pbRegisterMount("Tauros")
- This also can be in any case like-
pbRegisterMount("taUrOs")
But, the spelling must be correct, else it will show error message.
pbMountAnim
Show the Mount Animation. It needs
$MOUNTANIMATION
to be true
and common event id in $MOUNTEVENTID
.Mounts:
Spoiler:
Defining and manipulating mounts has become more easier now.
Now, you just need to define the mounts properly and make the module.
1. The first step in defining a mount is from
PBS/mounts.txt
. It follows a similar structure like those of pokemonforms.txt
. It also has elegant and easy-to-understand entries.The following is the default structure of entries in mounts.txt PBS file:-
Code:
[internal name of mount pokemon]
MountID = ID of mounts starting from 1 followed by 2,3,4,5,6,7,etc in order
PokedexID = Pokedex Number of the mount pokemon
MountName = Name of the mount, shall be pokemon name, but can be anything (This shall be noted and is required in Pokeride_Rides for creating module)
Description = The description which will appear in Ride Pager for this mount
Take a look at how Tauros is defined:-
Code:
[TAUROS] #Internal Name of mount Tauros. It is generally the name in all-caps.
MountID = 1 #The first mount entry, hence 1. Further entries will have 2,3,etc.
PokedexID = 128 #The pokedex number of pokemon Tauros.
MountName = Tauros #Name of mount pokemon. (Can be anything, explained later).
Description = This Tauros' charge can break rocks.
Same is with Lapras mount:-
Code:
[LAPRAS]
MountID = 2 #ID is 2 as it is second entry.
PokedexID = 131
MountName = Lapras
Description = This Lapras allows you to fish on the water.
So, now you get the idea of how to define the mounts.
Define all mounts and save the file.
2. The second step is by adding the mounts pokeride module in
Pokeride_Rides
. As in original Pokeride script, it is below Pokeride_Main
. It must be above this Pokeride_RidePager
script, or errors will occur.You must be familiar with the structure of a mount module from Pokeride.
I am just elaborating the naming sequence, it must be decided beforehand now.
Following is how Tauros's mount module is defined:-
Code:
module Tauros
MoveSheet = ["Pokeride/boy_tauros","Pokeride/girl_tauros"]
MoveSpeed = 5.0
ActionSheet = ["Pokeride/boy_tauros_charge","Pokeride/girl_tauros_charge"]
ActionSpeed = 5.6
RockSmash = true
end
module Tauros
but it can be anything as its independent.And can be called from anywhere by
pbMount(Tauros)
. This was what previous versions of this script did.
But now, the module must be the
MountName
, yes, the one defined in PBS file.So, if the
MountName = Tauros
, the module name must be module Tauros
.And if
MountName = OxPokemon
, the module name must be module OxPokemon
.But, I would prefer the first, the pokemon name as the mount name.
You have now registered the entered mounts into your game.
3. The third step is to add the graphics for the new mounts. Go to
Graphics/Characters/Pokeride
.Add the needed graphics for MoveSheet and ActionSheet for the new mounts.
Also add the custom graphics for there features like for DiveSheet.
Now, open the
RidePager
folder in this same directory. That is- Graphics/Characters/Pokeride/RidePager
.Here, insert the sprite to be shown in the Ride Pager menu for the mounts.
The naming is as-
PokeRide_MountName
where
MountName
is the name defined for the mount in MountName
section in PBS/mounts.txt
PBS file.For example, the graphics for Tauros will be
PokeRide_Tauros
.The new mounts have been successfully inserted and now, can be used in-game.
4. The fourth step is to know how mounts.txt file is compiled.
It is optional, just to give an overview about how mounts.txt is compiled, and can be skipped if looks overcomplicated.
- It is not compiled by the default essentials compiler.
- It is compiled by its own codes found in the latter part of this script.
- It will recompile whenever you edit the PBS/mounts.txt, so no need to worry.
- After compiling, it will print a successful message, assuring its compiled.
There are also 2 options that you can toggle according to choice.
$NOPRINTMOUNT
- Default: false
If you don't want any success message aftermounts.txt
being compiled, you can turn$NOPRINTMOUNT
totrue
.
Though the message assures successful compiling, I prefer not altering.
$COMPILEMOUNTS
- Default: false
In case you edited the file and the compiling message is not shown, its sign that file is not compiled, due to some internal problems.
Thats another reason of putting$NOPRINTMOUNT
tofalse
for the assurity.
Manually compile the file by turning$COMPILEMOUNTS
totrue
.
Don't forget to turn it off after compiling, cause it takes time on Debug.
Now you are completely prepared to use this script.
Script: (Can also be found here)
Spoiler:Code:#==============================================================================# #//////////////////////////////////////////////////////////////////////////////# #==============================================================================# # ------------------------------------------- # # | Pokéride Ride Pager and Mount Expansion | # # | by Ulithium_Dragon | # # | Updated and Rehanced by | # # | Bhagya Jyoti | # # ------------------------------------------- # # ~v3.0~ # #==============================================================================# #==============================================================================# # ::::Installation:::: # # -------------- # # Place the script above Main and below Pokéride_Main and Pokéride_Rides. # # Put the Audio, Graphics, and PBS files to their proper folders. # # Also replace Pokeride_Rides with the given file. # # ____________________________________________________________________________ # #==============================================================================# # Define the Ride Pager item in the "items.txt" PBS file as following:- # # XXX,RIDEPAGER,Ride Pager,Ride Pagers,8,0,"By entering certain numbers on this pager, you can summon Ride Pokémon in an instant.",2,0,6, # Don't forget to edit the XXX to the next entry, # # and rename the item icon to it before pasting it in Graphics/Icons # #==============================================================================# # In "PScreen_Load" script section, search for the following:- # # "$PokemonStorage = Marshal.load(f)" under "File.open(savefile){|f|" # # and place the code below it: $RideMounts = Marshal.load(f) # #------------------------------------------------------------------------------# # In "PScreen_Save" script section, search for the following:- # # "Marshal.dump($PokemonStorage,f)" under "File.open" # # and place the code below it: Marshal.dump($RideMounts,f) # #------------------------------------------------------------------------------# #==============================================================================# #==============================================================================# # ::::Options:::: # # -------- # # Below are the options for toggling certain features on or off: # # ____________________________________________________________________________ # #==============================================================================# # Adds all mounts to the ride pager from the start (mostly used for testing). # $REGISTERALLMOUNTS = false #Default: false #------------------------------------------------------------------------------# # The Mode by which you want to Mount the Pokemons from Ride Pager. # # 0 - Mount those Pokemon which have been registered via pbRegisterMount # # Most preferred mode of mounting. More info in Methods section below. # # 1 - Mount only those Pokemon which are present in Trainer's Party. # # A primitive mode as only 6 Pokemons could be available at most. # # 2 - A combination of 0 and 1 and requires both. # # Primitive mode as the pokemon must be present in party and also must be# # registered through pbRegisterMount methods. # # 3 - A combination of 0 and 1 but requires at least one condition. # # A mount is registered if it is in party or registered via the methods. # $MOUNTMODE = 0 #Default: 0 #==============================================================================# # The ID of the Common Event that holds the mount/dismount animation. # $MOUNTEVENTID = 10 #Default: 10 #------------------------------------------------------------------------------# # Toggles the MountAnimation to be played from the common event id. # $MOUNTANIMATION = true #Default: true #==============================================================================# # Controls whether the mounting/dismounting sound effect should play. # $PLAYMOUNTSE = true #Default: true #------------------------------------------------------------------------------# # Controls whether the Pokemon's cry sound should play when summoned. # $PLAYMOUNTCRY = true #Default: true #==============================================================================# # Controls whether or not mounts can be summoned indoors. # # *NOTE: This affects ALL indoor maps, including caves! Currently this check # # is tied to the bike check. Ergo, if you can ride a bike, you can mount. # $CANUSE_INDOORS = false #Default: false #------------------------------------------------------------------------------# # If "CANUSE_INDOORS" is false, this controls whether or not to include the # # surf mounts. It is highly recommend leaving this on "true" unless you're # # certain that you have no maps with surfable water/lava that have the # # metadata flag "Bicycle=false" (cave maps usually have this set to true). # $CANUSE_INDOORS_SURFMOUNTS = true #Default: true #==============================================================================# # If you want terrain tag that blocks mounting when standing on # # or facing a tile, put its terrain ID as defined in PBTerrain here. # $NOMOUNTING_TERRAINTAG = 99 #Default: nil #------------------------------------------------------------------------------# # If you want a terrain tag that blocks dismounting when standing on # # or facing a tile, put its terrain ID as defined in PBTerrain here. # # *NOTE: In most cases this should be the same as "NOMOUNTING_TERRAINTAG". # $NODISMOUNTING_TERRAINTAG = 99 #Default: nil #==============================================================================# #==============================================================================# # ::::Methods:::: # # -------- # # Below are the methods for using every aspect of Ride Pager: # # ____________________________________________________________________________ # #==============================================================================# # Give the Ride Pager with- pbGiveRidePagerItem # # It must be defined in the PBS/items.txt # #------------------------------------------------------------------------------# # Initiate the Ride Pager scene any where with- pbRidePagerMenu # # This is the same code that runs in the Item Handler section # #==============================================================================# # Register all Pokeride Mounts with- pbRegisterAllMounts # # It also takes an argument "msg" which is true by default to show message # # To register all mounts silently without message- pbRegisterAllMounts(false) # #------------------------------------------------------------------------------# # Register a particular mount with- pbRegisterMount(mountname) # # where mountname is the name of the mount, which can be in variations. # #------------------------------------------------------------------------------# # Example- Registering Tauros # # The internal name of Pokemon- pbRegisterMount(:TAUROS) # # Even in lower case (or any case)- pbRegisterMount(:tauros) # # The name of Pokemon in a string- pbRegisterMount("Tauros") # # This also can be in any case like- pbRegisterMount("taUrOs") # # But, the spelling must be correct, else it will show following message:- # # "{mountname} is not a mount!" # #------------------------------------------------------------------------------# # To register a pokemon silently without any message, add another argument:- # # pbRegisterMount(mountname,false) where mountname is the pokeride name # #==============================================================================# # Show the Mount Animation any time with - pbMountAnim # # It needs $MOUNTANIMATION to be true and common event id in $MOUNTEVENTID # #==============================================================================# # Following are the new terrain tags (including Marin's Pokeride):- # # 1. Mudsdale Terrain Tag - 17 # # 2. Rhyhorn / Rock Climb Terrain Tag - 18 # # 3. Swamp Surf Terrain Tag - 19 # #==============================================================================# # Press G on the KeyBoard to call special mount features, like # # 1. Flygon's CanFly feature # # 2. Hippowdon's CanDig feature # # 3. Luxray's CanFlash feature # #==============================================================================# #==============================================================================# # ::::Mounts:::: # # -------- # # Adding/removing/editing/manipulating mounts has become more easier now # # Now, you just need to define the mounts properly and make the module. # # ____________________________________________________________________________ # #==============================================================================# =begin #==============================================================================# #------------------------------------------------------------------------------# 1. The first step in defining a mount is from PBS/mounts.txt It follows a similar structure like those of pokemonforms.txt It also has elegant and easy-to-understand entries. #------------------------------------------------------------------------------# The following is the default structure of entries in mounts.txt PBS file:- #------------------------------------------------------------------------------# [internal name of mount pokemon] MountID = ID of mounts starting from 1 followed by 2,3,4,5,6,7,etc in order PokedexID = Pokedex Number of the mount pokemon MountName = Name of the mount, shall be pokemon name, but can be anything (This shall be noted and is required in Pokeride_Rides for creating module) Description = The description which will appear in Ride Pager for this mount #------------------------------------------------------------------------------# Take a look at how Tauros is defined:- #------------------------------------------------------------------------------# [TAUROS] #Internal Name of mount Tauros. It is generally the name in all-caps. MountID = 1 #The first mount entry, hence 1. Further entries will have 2,3,etc. PokedexID = 128 #The pokedex number of pokemon Tauros. MountName = Tauros #Name of mount pokemon. (Can be anything, explained later). Description = This Tauros' charge can break rocks. #------------------------------------------------------------------------------# Same is with Lapras mount:- [LAPRAS] MountID = 2 #ID is 2 as it is second entry. PokedexID = 131 MountName = Lapras Description = This Lapras allows you to fish on the water. #------------------------------------------------------------------------------# So, now you get the idea of how to define the mounts. Define all mounts and save the file. #------------------------------------------------------------------------------# #==============================================================================# #------------------------------------------------------------------------------# 2. The second step is by adding the mounts pokeride module in Pokeride_Rides As in original Pokeride script, it is below Pokeride_Main. It must be above this Pokeride_RidePager script, or errors will occur. #------------------------------------------------------------------------------# You must be familiar with the structure of a mount module from Pokeride. I am just elaborating the naming sequence, it must be decided beforehand now. #------------------------------------------------------------------------------# Following is how Tauros's mount module is defined. #------------------------------------------------------------------------------# module Tauros MoveSheet = ["Pokeride/boy_tauros","Pokeride/girl_tauros"] MoveSpeed = 5.0 ActionSheet = ["Pokeride/boy_tauros_charge","Pokeride/girl_tauros_charge"] ActionSpeed = 5.6 RockSmash = true end #------------------------------------------------------------------------------# It starts with "module Tauros" but it can be anything as its independent. And can be called from anywhere by "pbMount(Tauros)" . This was what previous versions of this script did. #------------------------------------------------------------------------------# But now, the module must be the "MountName" , yes, the one defined in PBS file. So, if the "MountName = Tauros" , the module name must be "module Tauros" And if "MountName = OxPokemon" , the module name must be "module OxPokemon" But, I would prefer the first, the pokemon name as the mount name. #------------------------------------------------------------------------------# You have now registered the entered mounts into your game. #------------------------------------------------------------------------------# #==============================================================================# #------------------------------------------------------------------------------# 3. The third step is to add the graphics for the new mounts. Go to Graphics/Characters/Pokeride. #------------------------------------------------------------------------------# Add the needed graphics for MoveSheet and ActionSheet for the new mounts. Also add the custom graphics for there features like for DiveSheet. #------------------------------------------------------------------------------# Now, open the RidePager folder in this same directory. Here, insert the sprite to be shown in the Ride Pager menu for the mounts. The naming is as follows:- #------------------------------------------------------------------------------# PokeRide_MountName , where MountName is the name defined for the mount in MountName section in PBS/mounts.txt PBS file. For example, the graphics for Tauros will be PokeRide_Tauros #------------------------------------------------------------------------------# The new mounts have been successfully inserted and now, can be used in-game. #------------------------------------------------------------------------------# #==============================================================================# #------------------------------------------------------------------------------# 4. The fourth step is to know how mounts.txt file is compiled. It is optional, just to give an overview about how mounts.txt is compiled. It is not compiled by the default essentials compiler. It is compiled by its own codes found in the latter part of this script. It will recompile whenever you edit the PBS/mounts.txt, so no need to worry. After compiling, it will print a successful message, assuring its compiled. #------------------------------------------------------------------------------# =end #------------------------------------------------------------------------------# # If you don't want any success message after mounts.txt being compiled, # # you can turn $NOPRINTMOUNT to true. # # Though the message assures successful compiling, I prefer not altering. # $NOPRINTMOUNT = false #Default: false #------------------------------------------------------------------------------# # In case you edited the file and the compiling message is not shown, # # its sign that file is not compiled, due to some internal problems. # # Thats another reason of putting $NOPRINTMOUNT to false for the assurity. # # Manually compile the file by turning $COMPILEMOUNTS to true. # # Don't forget to turn it off after compiling, cause it takes time on Debug.# $COMPILEMOUNTS = false #Default: false #------------------------------------------------------------------------------# # Now you are completely prepared to use this script. # #------------------------------------------------------------------------------# #==============================================================================# #==============================================================================# # ::::Script:::: # # -------- # # The Ride Pager script starts from here. Don't alter any lines. # # ____________________________________________________________________________ # #==============================================================================# #==============================================================================# # Obtaining the Ride Pager # #==============================================================================# #Gives the Ride Pager item with the appropriate sound effect. def pbGiveRidePagerItem Kernel.pbReceiveItem(:RIDEPAGER) pbSEPlay("RidePager_ItemGet") if $PLAYMOUNTSE pbWait(8) end #==============================================================================# # Item Handler code for Ride Pager # #==============================================================================# ItemHandlers::UseFromBag.add(:RIDEPAGER,proc{|item| next 2 }) ItemHandlers::UseInField.add(:RIDEPAGER,proc{|item| #Registers all of the mounts by default if the option is enabled. if $REGISTERALLMOUNTS pbRegisterAllMounts(false) end #Show the menu. pbRidePagerMenu(item) }) #==============================================================================# # Playing the Mount Animation # #==============================================================================# def pbMountAnim if $MOUNTANIMATION && $MOUNTEVENTID!=nil pbCommonEvent($MOUNTEVENTID) end #Play the SE of Pokeride Summoning. pbSEPlay("PokeRide_Summon") if $PLAYMOUNTSE end #==============================================================================# # Registering all Mounts at once # #==============================================================================# def pbRegisterAllMounts(msg=true) @msg=msg pokemount = 0 while pokemount != $RideMounts.length $RideMounts[pokemount] = true pokemount+=1 end if @msg == true Kernel.pbMessage(_INTL("All Pokémon were registered in the Ride Pager!\\me[Pokeride Mount Registered]")) end end #==============================================================================# # Registering a particular mount # #==============================================================================# def pbRegisterMount(mountname,showmsg=true) @mountname=mountname.to_s.upcase if $MountsPBS.include?(@mountname) @mountname = $MountsPBS[@mountname]["MountID"].to_i-1 if !$RideMounts[@mountname] pbSEPlay("Pokeride Mount Registered") if $PLAYMOUNTSE Kernel.pbMessage(_INTL("{1} was registered in the Ride Pager!\\me[Pokeride Mount Registered]",mountname.to_s.capitalize)) if showmsg $RideMounts[@mountname] = true else Kernel.pbMessage(_INTL("{1} is already registered in the Ride Pager!\\se[error_01]",mountname.to_s.capitalize)) if showmsg end else pbSEPlay("error_404") if $PLAYMOUNTSE Kernel.pbMessage(_INTL("{1} is not a mount!\\se[error_404]",mountname.to_s.capitalize)) if showmsg end end #==============================================================================# # Methods for initiating Moves of Mounts # #==============================================================================# #Cut def pbCutEvent(event) return if !event if event.name=="Rock"; pbSEPlay("Rock Smash",80) elsif event.name=="Tree"; pbSEPlay("Cut",80) end pbMoveRoute(event,[ PBMoveRoute::Wait,2, PBMoveRoute::TurnLeft, PBMoveRoute::Wait,2, PBMoveRoute::TurnRight, PBMoveRoute::Wait,2, PBMoveRoute::TurnUp, PBMoveRoute::Wait,2 ]) pbWait(2*2*4) event.erase $PokemonMap.addErasedEvent(event.id) if $PokemonMap end #Headbutt def pbHeadbuttEvent(event) return if !event a = (event.x+(event.x/24).floor+1)*(event.y+(event.y/24).floor+1) a = (a*2/5)%10 # Even 2x as likely as odd, 0 is 1.5x as likely as odd b = ($Trainer.publicID)%10 # Practically equal odds of each value chance = 1 # ~50% if a==b; chance = 8 # 10% elsif a>b && (a-b).abs<5; chance = 5 # ~30.3% elsif a<b && (a-b).abs>5; chance = 5 # ~9.7% end if rand(10)>=chance Kernel.pbMessage(_INTL("Nope. Nothing...")) else enctype = (chance==1) ? EncounterTypes::HeadbuttLow : EncounterTypes::HeadbuttHigh if !pbEncounter(enctype) Kernel.pbMessage(_INTL("Nope. Nothing...")) end end return false end #==============================================================================# # Codes for aliasing different methods in essentials # #==============================================================================# class PokemonGlobalMetadata attr_accessor :ridingWaterfall attr_accessor :mount_attack attr_accessor :mount_flash attr_accessor :mount_fly attr_accessor :step_anime alias ridepager_init initialize def initialize ridepager_init @ridingWaterfall = false @mount_attack = false @mount_flash = false @mount_fly = false end end #Making various terrain tags for mounts module PBTerrain SwampWater = 19 # Can only be traversed on a Pokéride with SwampSurf capabilities def PBTerrain.isMudsdaleTag?(tag) return tag==PBTerrain::Mudsdale end def PBTerrain.isRockTag?(tag) return tag==PBTerrain::RockClimb end def PBTerrain.isSwampWater?(tag) return tag==PBTerrain::SwampWater end end #Press G to use special features module Input class << Input alias ridepager_key buttonToKey end G = 30 def self.buttonToKey(btn) return [0x47] if btn == Input::G ridepager_key(btn) end end #Ice Traction feature module Kernel class << Kernel alias ice_traction pbSlideOnIce end def self.pbSlideOnIce(event=nil) return if $PokemonGlobal.mount && defined?($PokemonGlobal.mount::IceTraction) && $PokemonGlobal.mount::IceTraction ice_traction(event=nil) end end #Various Passability checks class Game_Map alias ridepager_playerpassable playerPassable? def playerPassable?(x, y, d, self_event = nil) for i in [2, 1, 0] tile_id=data[x,y,i] #Jump over Ledges if mounted. if PBTerrain.isLedge?(@terrain_tags[tile_id]) && $PokemonGlobal.mount && defined?($PokemonGlobal.mount::ClimbLedge) && $PokemonGlobal.mount::ClimbLedge return $PokemonGlobal.mount && defined?($PokemonGlobal.mount::ClimbLedge) && $PokemonGlobal.mount::ClimbLedge #Walk over Swamp Water if mounted. elsif PBTerrain.isSwampWater?(@terrain_tags[tile_id]) return ($PokemonGlobal.mount && defined?($PokemonGlobal.mount::SwampSurf) && $PokemonGlobal.mount::SwampSurf) || ($PokemonGlobal.mount && defined?($PokemonGlobal.mount::FlyOverWater) && $PokemonGlobal.mount::FlyOverWater) #Walk over Water tiles if mounted. elsif PBTerrain.isPassableWater?(@terrain_tags[tile_id]) && $PokemonGlobal.mount && defined?($PokemonGlobal.mount::WalkOnWater) && $PokemonGlobal.mount::WalkOnWater return $PokemonGlobal.mount && defined?($PokemonGlobal.mount::WalkOnWater) && $PokemonGlobal.mount::WalkOnWater #Fly over Water tiles if mounted. elsif PBTerrain.isPassableWater?(@terrain_tags[tile_id]) && $PokemonGlobal.mount && defined?($PokemonGlobal.mount::FlyOverWater) && $PokemonGlobal.mount::FlyOverWater return $PokemonGlobal.mount && defined?($PokemonGlobal.mount::FlyOverWater) && $PokemonGlobal.mount::FlyOverWater #Walk on Mudsdale tiles if mounted. elsif defined?(PBTerrain::Mudsdale) && PBTerrain.isMudsdaleTag?(@terrain_tags[tile_id]) return $PokemonGlobal.mount && defined?($PokemonGlobal.mount::WalkOnMudsdale) && $PokemonGlobal.mount::WalkOnMudsdale && $PokemonGlobal.mount==Mudsdale #Make Rock Climb tiles passable if mounted. elsif defined?(PBTerrain::RockClimb) && @terrain_tags[data[x, y, i]] == PBTerrain::RockClimb return $PokemonGlobal.mount && defined?($PokemonGlobal.mount::RockClimb) && $PokemonGlobal.mount::RockClimb elsif defined?(PBTerrain::RockCrest) && @terrain_tags[data[x, y, i]] == PBTerrain::RockCrest return $PokemonGlobal.mount && defined?($PokemonGlobal.mount::RockClimb) && $PokemonGlobal.mount::RockClimb end end ridepager_playerpassable(x, y, d, self_event) end end #Using Moves on the events class Game_Character alias ridepager_passable passableEx? def passableEx?(x, y, d, strict = false) new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0) new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0) return false unless self.map.valid?(new_x, new_y) return true if @through # Pokéride Rock Smash if $PokemonGlobal.mount && $PokemonGlobal.mount_action && defined?($PokemonGlobal.mount::RockSmash) && $PokemonGlobal.mount::RockSmash for event in self.map.events if event[1].name == "Rock" && event[1].x == new_x && event[1].y == new_y facingEvent = $game_player.pbFacingEvent if facingEvent pbSmashEvent(facingEvent) return true end end end end # Pokéride Cut if $PokemonGlobal.mount && $PokemonGlobal.mount_action && defined?($PokemonGlobal.mount::CanCut) && $PokemonGlobal.mount::CanCut for event in self.map.events if event[1].name == "Tree" && event[1].x == new_x && event[1].y == new_y facingEvent = $game_player.pbFacingEvent if facingEvent pbMoveRoute($game_player,[PBMoveRoute::StepAnimeOn]) pbCutEvent(facingEvent) pbMoveRoute($game_player,[PBMoveRoute::StepAnimeOff]) return true end end end end # Pokéride Headbutt if $PokemonGlobal.mount && $PokemonGlobal.mount_action && defined?($PokemonGlobal.mount::CanHeadbutt) && $PokemonGlobal.mount::CanHeadbutt for event in self.map.events if event[1].name == "HeadbuttTree" && event[1].x == new_x && event[1].y == new_y facingEvent = $game_player.pbFacingEvent pbHeadbuttEvent(facingEvent) end end end return ridepager_passable(x, y, d, strict) end end #Overwriting Pokeride Codes class Game_Player alias pokeride_initialize initialize def initialize pokeride_initialize $ionlyrunonce = nil end alias ridepager_update update def update ridepager_update if $PokemonGlobal.mount #Added a new keybind, 'G' (can be changed) that triggers special mount events. if Input.press?(Input::G) if defined?($PokemonGlobal.mount::CanFly) && $PokemonGlobal.mount::CanFly #Check that our mount can Fly first. #Manually call the map used for the Fly HM. scene=PokemonRegionMap_Scene.new(-1,false) screen=PokemonRegionMapScreen.new(scene) ret=screen.pbStartFlyScreen #Warp the player to their selection (ret) on the map. if ret Kernel.pbMessage(_INTL("{1} used Fly!",$PokemonGlobal.mount)) $game_player.turn_down $game_player.through = true pbWait(8) pbSEPlay("Cries/330Cry") pbWait(8) pbSEPlay("thwap_03",100,100) $game_player.move_up $game_player.move_up $game_player.move_up pbWait(2) #Sets temporary flydata for destination, then transfers player. pbFadeOutIn(99999){ $PokemonTemp.flydata=ret $game_temp.player_new_map_id=$PokemonTemp.flydata[0] $game_temp.player_new_x=$PokemonTemp.flydata[1] $game_temp.player_new_y=$PokemonTemp.flydata[2] $PokemonTemp.flydata=nil $game_temp.player_new_direction=2 $scene.transfer_player(false) #Set to false so not dismounted. $game_map.autoplay $game_map.refresh } $game_player.through = false end elsif defined?($PokemonGlobal.mount::CanDig) && $PokemonGlobal.mount::CanDig escape=($PokemonGlobal.escapePoint rescue nil) mapname=pbGetMapNameFromId(escape[0]) speciesname=$PokemonGlobal.mount if !$ionlyrunonce #Prevents the key from being spammed, causing the message to play multiple times. $ionlyrunonce = true if !escape || escape==[] Kernel.pbMessage(_INTL("You can't use Dig here!")) $ionlyrunonce = false return false end if $game_player.pbHasDependentEvents? Kernel.pbMessage(_INTL("Dig can't be used when you have someone with you.")) $ionlyrunonce = false return false end if Kernel.pbConfirmMessage(_INTL("Want to escape from here and return to {1}?",mapname)) Kernel.pbMessage(_INTL("{1} used Dig!",speciesname)) if $PLAYMOUNTCRY pbPlayCry(MountsClass.new($PokemonGlobal.mount.to_s.upcase).mountpokedexid.to_i,100) end #Spin the pokemon pbWait(18) $game_player.turn_down pbWait(12) $game_player.turn_right pbWait(11) $game_player.turn_up pbWait(10) $game_player.turn_left pbWait(9) $game_player.turn_down pbWait(8) $game_player.turn_right pbWait(7) $game_player.turn_up pbWait(6) $game_player.turn_left pbWait(6) $game_player.turn_down pbWait(5) $game_player.turn_right pbWait(4) $game_player.turn_up pbWait(4) $game_player.turn_left pbWait(4) $game_player.turn_down pbWait(1) if escape pbFadeOutIn(99999){ pbSEPlay("Door exit") pbCaveExit $game_temp.player_new_map_id=escape[0] $game_temp.player_new_x=escape[1] $game_temp.player_new_y=escape[2] $game_temp.player_new_direction=escape[3] $scene.transfer_player $game_map.autoplay $game_map.refresh } pbEraseEscapePoint $ionlyrunonce = false return true end else $ionlyrunonce = false return false end end elsif defined?($PokemonGlobal.mount::CanFlash) && $PokemonGlobal.mount::CanFlash darkness=$PokemonTemp.darknessSprite speciesname=$PokemonGlobal.mount if !$ionlyrunonce #Prevents the key from being spammed, causing the message to play multiple times. $ionlyrunonce = true if !pbGetMetadata($game_map.map_id,MetadataDarkMap) Kernel.pbMessage(_INTL("You can't use Flash here!")) $ionlyrunonce = false return false end if $PokemonGlobal.flashUsed Kernel.pbMessage(_INTL("Flash is already in use!")) $ionlyrunonce = false return false end if Kernel.pbConfirmMessage(_INTL("Want to use Flash to light up the area?")) Kernel.pbMessage(_INTL("{1} used Flash!",speciesname)) if $PLAYMOUNTCRY pbPlayCry(MountsClass.new($PokemonGlobal.mount.to_s.upcase).mountpokedexid.to_i,100) end pbWait(20) #Play the flash mount animation. $PokemonGlobal.mount_flash = true pbSEPlay("Electric Crackle") pbWait(26) $PokemonGlobal.mount_flash = false $PokemonGlobal.flashUsed=true while darkness.radius<176 #This value controls the light radius. Graphics.update Input.update pbUpdateSceneMap darkness.radius+=4 end $ionlyrunonce = false return true else $ionlyrunonce = false end end elsif defined?($PokemonGlobal.mount::CanWaterfall) && $PokemonGlobal.mount::CanWaterfall if !$ionlyrunounce $ionlyrunounce = true if PBTerrain.isWaterfall?(Kernel.pbFacingTerrainTag) && $game_player.direction==8 if Kernel.pbConfirmMessage(_INTL("It's a large waterfall. Would you like to use Waterfall?")) Kernel.pbAscendWaterfall $ionlyrunounce = false return true else $ionlyrunounce = false return false end else Kernel.pbMessage(_INTL("There is no Waterfall ahead.")) $ionlyrunounce = false return false end end elsif defined?($PokemonGlobal.mount::CanDive) && $PokemonGlobal.mount::CanDive divemap = pbGetMetadata($game_map.map_id,MetadataDiveMap) speciesname=$PokemonGlobal.mount if !$ionlyrunonce $ionlyrunonce=true if $PokemonGlobal.diving divemap = nil meta = pbLoadMetadata for i in 0...meta.length if meta[i] && meta[i][MetadataDiveMap] && meta[i][MetadataDiveMap]==$game_map.map_id divemap = i break end end if PBTerrain.isDeepWater?($MapFactory.getTerrainTag(divemap,$game_player.x,$game_player.y)) divemap = nil meta = pbLoadMetadata for i in 0...meta.length if meta[i] && meta[i][MetadataDiveMap] && meta[i][MetadataDiveMap]==$game_map.map_id divemap = i break end end return if !divemap if Kernel.pbConfirmMessage(_INTL("Light is filtering down from above. Would you like to use Dive?")) pbFadeOutIn(99999){ sheet = $PokemonGlobal.mount::MoveSheet[$Trainer.gender] @move_speed = $PokemonGlobal.mount::MoveSpeed $game_player.setDefaultCharName(sheet,$game_player.fullPattern) $game_temp.player_new_map_id = divemap $game_temp.player_new_x = $game_player.x $game_temp.player_new_y = $game_player.y $game_temp.player_new_direction = $game_player.direction $PokemonGlobal.surfing = true if (defined?($PokemonGlobal.mount::WalkOnWater) && !$PokemonGlobal.mount::WalkOnWater) $PokemonGlobal.diving = false $scene.transfer_player(false) surfbgm = pbGetMetadata(0,MetadataSurfBGM) (surfbgm) ? pbBGMPlay(surfbgm) : $game_map.autoplayAsCue $game_map.refresh } $ionlyrunonce = false return true end else Kernel.pbMessage(_INTL("You are already diving!")) $ionlyrunonce = false return false end $ionlyrunonce = false return false elsif !PBTerrain.isDeepWater?(pbGetTerrainTag) || !divemap Kernel.pbMessage(_INTL("You can't Dive here!")) $ionlyrunonce = false return false elsif Kernel.pbConfirmMessage(_INTL("The sea is deep here. Would you like to use Dive?")) Kernel.pbMessage(_INTL("{1} used Dive!",speciesname)) if $PLAYMOUNTCRY pbPlayCry(MountsClass.new($PokemonGlobal.mount.to_s.upcase).mountpokedexid.to_i,100) end pbWait(20) pbFadeOutIn(99999){ sheet = $PokemonGlobal.mount::DiveMoveSheet[$Trainer.gender] @move_speed = $PokemonGlobal.mount::DiveMoveSpeed $game_player.setDefaultCharName(sheet,$game_player.fullPattern) $game_temp.player_new_map_id = divemap $game_temp.player_new_x = $game_player.x $game_temp.player_new_y = $game_player.y $game_temp.player_new_direction = $game_player.direction $PokemonGlobal.diving = true $scene.transfer_player(false) $game_map.autoplay $game_map.refresh } $ionlyrunonce = false return true else $ionlyrunonce = false end end end end if Input.press?(Input::A) @move_speed = $PokemonGlobal.mount::ActionSpeed sheet = $PokemonGlobal.mount::ActionSheet[$Trainer.gender] if $PokemonGlobal.diving sheet = $PokemonGlobal.mount::DiveActionSheet[$Trainer.gender] @move_speed = $PokemonGlobal.mount::DiveActionSpeed end $game_player.setDefaultCharName(sheet,$game_player.fullPattern) $PokemonGlobal.mount_action = true if defined?($PokemonGlobal.mount::ShowHidden) && $PokemonGlobal.mount::ShowHidden if pbHiddenItemNearby? sheet = $PokemonGlobal.mount::HiddenNearbySheet[$Trainer.gender] $game_player.setDefaultCharName(sheet,$game_player.fullPattern) @move_speed = $PokemonGlobal.mount::HiddenNearbySpeed end end else @move_speed = $PokemonGlobal.mount::MoveSpeed sheet = $PokemonGlobal.mount::MoveSheet[$Trainer.gender] if $PokemonGlobal.diving sheet = $PokemonGlobal.mount::DiveMoveSheet[$Trainer.gender] @move_speed = $PokemonGlobal.mount::DiveMoveSpeed end $game_player.setDefaultCharName(sheet,$game_player.fullPattern) $PokemonGlobal.mount_action = false end end end end #=============================================================================== # Compile mounts #=============================================================================== def pbCompileMounts sections = {} if File.exists?("PBS/mounts.txt") File.open("PBS/mounts.txt", "r") do |f| FileLineData.file = "PBS/mounts.txt" pbEachFileSectionEx(f) do |section,name| sections[name] = section end end end for key in sections.keys sections[key]["MountID"] = sections[key]["MountID"].to_i sections[key]["PokedexID"] = sections[key]["PokedexID"].to_i end save_data(sections,"Data/mounts.dat") $MountsPBS = sections print "PBS/mounts.txt file has been successfully compiled" if !$NOPRINTMOUNT end #Compile Mounts when mounts.txt is editted or pressed Control while in Debug if $DEBUG begin File.open("Data/mounts.dat"){|file| latestdatatime = [latestdatatime,file.mtime.to_i].max } rescue SystemCallError mustcompile = true end begin File.open("PBS/mounts.txt"){|file| latesttexttime = [latesttexttime,file.mtime.to_i].max } rescue SystemCallError end mustcompile |= (latesttexttime>=latestdatatime) if mustcompile begin File.delete("Data/mounts.dat") pbCompileMounts rescue SystemCallError end end if Input.press?(Input::CTRL) || $COMPILEMOUNTS pbCompileMounts end end #==============================================================================# # Code for reading Mount Data from the Mounts PBS file # #==============================================================================# class MountsClass #Force our $MountsPBS to be recompiled if it isn't already if File.exist?("Data/mounts.dat") $MountsPBS = load_data("Data/mounts.dat") if !$MountsPBS else pbCompileMounts end def initialize(name) if !$MountsPBS.include?(name) raise ArgumentError.new(_INTL("There is no entry with that name!")) end @name = name end def mountid return $MountsPBS[@name]["MountID"] end def mountpokedexid return $MountsPBS[@name]["PokedexID"] end def mountname return $MountsPBS[@name]["MountName"] end def mountdescription return $MountsPBS[@name]["Description"] end end def getMountName(id) for mounts in $MountsPBS.keys mountname = $MountsPBS[mounts]["MountName"] currentid = $MountsPBS[mounts]["MountID"].to_i if currentid==id return mountname end end end if File.exist?("Data/mounts.dat") $RideMounts = [] mounts = 0 while mounts!=$MountsPBS.length $RideMounts[mounts] = false mounts+=1 end end #==============================================================================# # Codes for opening and using ride pager menu. # #==============================================================================# def Kernel.pbShowRidePagerCmds(msgwindow,commands,desc,cmdIfCancel=0,defaultCmd=0) msgwin=msgwindow if !msgwindow msgwin=Kernel.pbCreateMessageWindow(nil) end oldlbl=msgwin.letterbyletter msgwin.letterbyletter=false if commands cmdwindow=Window_CommandPokemonEx.new(commands) cmdwindow.z=99999 cmdwindow.visible=true cmdwindow.resizeToFit(cmdwindow.commands) cmdwindow.height=msgwin.y if cmdwindow.height>msgwin.y cmdwindow.index=defaultCmd command=0 msgwin.text=desc[cmdwindow.index] #Get the bitmap of the selected mount. filename = "Graphics/Characters/Pokeride/RidePager/PokeRide_"+commands[cmdwindow.index]+".png" mountBitmap = pbResolveBitmap(filename) #Create a new bitmap window, with the start mount as the loading bitmap. iconWin = createMountBitmapWindow(mountBitmap,cmdwindow,msgwin) msgwin.width=msgwin.width # Necessary evil to make it use the proper margins. loop do Graphics.update Input.update oldindex=cmdwindow.index cmdwindow.update if oldindex!=cmdwindow.index msgwin.text=desc[cmdwindow.index] #Code for udpating the Ride Pager icon display #If the current index isn't the command "QUIT"... if commands[cmdwindow.index] != "QUIT" #Get the bitmap for the mount the index is on. filename = "Graphics/Characters/Pokeride/RidePager/PokeRide_"+commands[cmdwindow.index]+".png" mountBitmap = pbResolveBitmap(filename) #Update our icon window with the bitmap we got. iconWin.setBitmap(mountBitmap) #Reposition the window in the case of a larger/smaller mount bitmap. moveIconWindow(iconWin,cmdwindow,msgwin) #If the current index IS the command "QUIT"... else #Set an empty bitmap/or just hide it. iconWin.setBitmap(pbResolveBitmap("Graphics/Characters/Pokeride/RidePager/RidePager.png")) #Reposition the window to account for the size change. moveIconWindow(iconWin,cmdwindow,msgwin) end end msgwin.update yield if block_given? if Input.trigger?(Input::B) if cmdIfCancel>0 command=cmdIfCancel-1 break elsif cmdIfCancel<0 command=cmdIfCancel break end end if Input.trigger?(Input::C) command=cmdwindow.index break end pbUpdateSceneMap end ret=command cmdwindow.dispose #Dispose our icon window iconWin.dispose Input.update end msgwin.letterbyletter=oldlbl if !msgwindow msgwin.dispose end return ret end #A method that creates a PictureWindow for our mount bitmap that we want to display. #Returns: An instance of the PictureWindow class, containing a default image of the #first bitmap passed to it. #Edited to force top most Z layer where other effects might over-ride this message box. def createMountBitmapWindow(mountBitmap,cmdWindow,msgWindow) #If there was an actual bitmap file passed... if mountBitmap #Instance the PictureWindow class, passing the bitmap we want to show. iconWindow = PictureWindow.new(mountBitmap) #Reposition the window to properly display to the right of the command window. iconWindow.x=(Graphics.width-cmdWindow.width)-(iconWindow.width/2) #Show the icon window above the description text window. iconWindow.y=(msgWindow.y/2)-(iconWindow.height/2) #Show the icon window at the top of the screen iconWindow.z=999999 #Return the instanced class of PictureWindow, currently displaying the bitmap #passed to it. return iconWindow end end #A method that allows us to reposition the icon window in case it gets resized. def moveIconWindow(iconWin,cmdWindow,msgWindow) #Reposition the window to properly display to the right of the command window. iconWin.x=(Graphics.width-cmdWindow.width)-(iconWin.width/2) #Show the icon window above the description text window. iconWin.y=(msgWindow.y/2)-(iconWin.height/2) end #==============================================================================# # Code for various in-game Checks # #==============================================================================# #Checks if you are surfing and are facing a "no surfing" tile. def pbSurfingChecker #Needed for Terrain Tag checks. x=$game_player.x y=$game_player.y currentTag=$game_map.terrain_tag(x,y) facingTag=Kernel.pbFacingTerrainTag notCliff=$game_map.passable?($game_player.x,$game_player.y,$game_player.direction) if $PokemonGlobal.surfing == true if PBTerrain.isSurfable?(currentTag) && !PBTerrain.isSurfable?(facingTag) && notCliff surfingchecker = true end end end #Checks if you are currently surfing. def pbCurrentlySurfingChecker #Is the player surfing? if $PokemonGlobal.surfing == true currentlysurfingchecker = true end end #Checks if you are cycling def pbBikesChecker if $PokemonGlobal.bicycle == true bikeschecker = true end if defined?($PokemonGlobal.acrobike) if $PokemonGlobal.acrobike == true bikeschecker = true end end if defined?($PokemonGlobal.machbike) if $PokemonGlobal.machbike == true bikeschecker = true end end end #Overwrites the function located in PItem_Items. def pbBikeCheck if $PokemonGlobal.surfing || (!$PokemonGlobal.bicycle && PBTerrain.onlyWalk?(pbGetTerrainTag)) || $PokemonGlobal.mount if $PokemonGlobal.mount Kernel.pbMessage(_INTL("You can't ride your bike while on Pokémon!")) return false else Kernel.pbMessage(_INTL("Can't use that here.")) return false end end if $game_player.pbHasDependentEvents? Kernel.pbMessage(_INTL("It can't be used when you have someone with you.")) return false end if $PokemonGlobal.bicycle if pbGetMetadata($game_map.map_id,MetadataBicycleAlways) Kernel.pbMessage(_INTL("You can't dismount your Bike here.")) return false end return true else val=pbGetMetadata($game_map.map_id,MetadataBicycle) val=pbGetMetadata($game_map.map_id,MetadataOutdoor) if val==nil if !val Kernel.pbMessage(_INTL("Can't use that here.")) return false end return true end end #Dismounts your bicycle. def pbStopAllBikes $PokemonGlobal.bicycle = false if defined?($PokemonGlobal.acrobike) $PokemonGlobal.acrobike = false end if defined?($PokemonGlobal.machbike) $PokemonGlobal.machbike = false end end #Jump effect used for mounting and dismounting surf mounts. def pbMountJumpTowards dist=1 x=$game_player.x y=$game_player.y case $game_player.direction when 2 # down $game_player.jump(0,dist) when 4 # left $game_player.jump(-dist,0) when 6 # right $game_player.jump(dist,0) when 8 # up $game_player.jump(0,-dist) end end #==============================================================================# # Code for the Ride Pager Screen # #==============================================================================# def pbRidePagerMenu(item=nil) #Needed for Terrain Tag checks. x=$game_player.x y=$game_player.y currentTag=$game_map.terrain_tag(x,y) facingTag=Kernel.pbFacingTerrainTag notCliff=$game_map.passable?($game_player.x,$game_player.y,$game_player.direction) #Resets back to "false" each time so the check can be run again. surfingchecker = false currentlysurfingchecker = false bikeschecker = false #Map Metadata checks. bikeval=pbGetMetadata($game_map.map_id,MetadataBicycle) bikeval=pbGetMetadata($game_map.map_id,MetadataOutdoor) if bikeval==nil if !$PokemonGlobal.mount #If already mounted, skip to dismounting. commands=[] cmdMounts = [] mount = 0 while mount != $RideMounts.length cmdMounts[mount] = -1 mount+=1 end index = 0 while index != $RideMounts.length registered = $RideMounts[index] partymon = pbHasSpecies?(MountsClass.new(getMountName(index+1).upcase).mountpokedexid) case $MOUNTMODE when 0 commands[cmdMounts[index]=commands.length]=_INTL(getMountName(index+1)) if registered when 1 commands[cmdMounts[index]=commands.length]=_INTL(getMountName(index+1)) if partymon when 2 commands[cmdMounts[index]=commands.length]=_INTL(getMountName(index+1)) if (registered && partymon) when 3 commands[cmdMounts[index]=commands.length]=_INTL(getMountName(index+1)) if (registered || partymon) else Kernel.pbMessage(_INTL("$MOUNTMODE in Pokeride_RidePager must be an integer.")) Kernel.pbMessage(_INTL("$MOUNTMODE must be an available mode- 0/1/2/3.")) return end index+=1 end #QUIT cmdQUIT = -1 commands[cmdQUIT=commands.length]=_INTL("QUIT") pbBikesChecker #If the player is on a bike, no do not show the menu. #Do not show the menu if no mounts are registered. if commands.length<=1 Kernel.pbMessage(_INTL("No mounts registered.")) pbWait(10) #Checks the Bicycle map metadata to see if the player can mount on the current map. elsif !bikeval && !$CANUSE_INDOORS && !$CANUSE_INDOORS_SURFMOUNTS Kernel.pbMessage(_INTL("You can't call a mount in here!")) #Checks if the player is on their bike. elsif $PokemonGlobal.bicycle == true Kernel.pbMessage(_INTL("You can't call a mount while riding your bike!")) #Checks if the player has a dependent event following them. elsif $game_player.pbHasDependentEvents? Kernel.pbMessage(_INTL("You can't call a mount when you have someone with you!")) #Is Diving? elsif $PokemonGlobal.diving == true Kernel.pbMessage(_INTL("You can't call a mount here!")) #Is Surfing? elsif $PokemonGlobal.surfing == true && $PokemonGlobal.mount == nil Kernel.pbMessage(_INTL("You can't call a mount here!")) #Is Rock Climbing? elsif defined?($PokemonGlobal.rockclimbing) && $PokemonGlobal.rockclimbing == true && $PokemonGlobal.mount == nil Kernel.pbMessage(_INTL("You can't call a mount here!")) #Is Sliding? elsif $PokemonGlobal.sliding == true #Do nothing #Checks if the player is on or facing custom "no-mounting" terrain tag. elsif $NOMOUNTING_TERRAINTAG && (facingTag==$NOMOUNTING_TERRAINTAG || facingTag==$NOMOUNTING_TERRAINTAG || currentTag==$NOMOUNTING_TERRAINTAG) Kernel.pbMessage(_INTL("You can't mount here.")) else #Show the menu. #Create new array to hold our Mount description text descArray = Array.new #Loop through the names that are currently selectable... for name in commands #If the command name isn't "Quit"... if name != "QUIT" #Set a new instance of the MountsClass that handles the PBS data for the #Mount name passed. mountPBS = MountsClass.new(name.upcase) #Set the string to add to our descArray to be the help text if it isn't #a null value. Otherwise set it to be empty. descString = mountPBS.mountdescription ? mountPBS.mountdescription : "" #Add the current mount help text to the end of the array. descArray.push(descString) #If the command name IS "Quit"... else #Pass this string for the Quit command. descArray.push("Exit the Ride Pager.") end end loop do pbSurfingChecker pbBikesChecker #Create a new window for the help text, using the menu frame style msgwindow = Kernel.pbCreateMessageWindow(nil,MessageConfig.pbDefaultSystemFrame) #Call our commands list with our descArray and help text message box command=Kernel.pbShowRidePagerCmds(msgwindow,commands,descArray,-1) #Dispose our messagebox when an option is selected Kernel.pbDisposeMessageWindow(msgwindow) #Exit the menu if the B or C buttons are pressed. if command==-1 break end mounting=0 while mounting!=cmdMounts.length mount_module = Kernel.const_get(getMountName(mounting+1).to_s) if cmdMounts[mounting]>=0 && command==cmdMounts[mounting] mount_name = getMountName(mounting+1) #Checks if you are surfing and are facing a "no surfing" tile. if surfingchecker == true Kernel.pbMessage(_INTL("You can't dismount here.")) return end #Checks if you can use mounts indoors. if !$CANUSE_INDOORS && !bikeval Kernel.pbMessage(_INTL("You can't call {1} here.",mount_name)) elsif defined?(mount_module::CanSurf) && mount_module::CanSurf #elsif SURFING_MOUNTS.include?(mounting+1) if PBTerrain.isSurfable?(facingTag) && !$PokemonGlobal.surfing && !pbGetMetadata($game_map.map_id,MetadataBicycleAlways) && notCliff $PokemonGlobal.bicycle = false pbMount(mount_module) pbMountJumpTowards pbMountAnim pbWait(8) if $PLAYMOUNTCRY pbPlayCry(MountsClass.new(mount_name.upcase).mountpokedexid.to_i,100) end surfbgm=pbGetMetadata(0,MetadataSurfBGM) if defined?(pbGetSurfTheme) surfbgm=pbGetSurfTheme pbCueBGM(surfbgm,0.5) if surfbgm elsif surfbgm pbBGMPlay(surfbgm) else $game_map.autoplayAsCue end else #No surfable tiles. Kernel.pbMessage(_INTL("You can't call {1} here.",mount_name)) end else $PokemonGlobal.bicycle = false pbMountAnim pbMount(mount_module) pbWait(4) if $PLAYMOUNTCRY pbPlayCry(MountsClass.new(mount_name.upcase).mountpokedexid.to_i,100) end pbWait(8) end return elsif cmdQUIT>=0 && command==cmdQUIT #Exit the menu. return end mounting+=1 end end end #Dismount else #Checks if you are surfing and facing a "no surfing" tile. pbSurfingChecker #Checks if you are surfing. pbCurrentlySurfingChecker #Checks if the player is on or facing custom "no-dismounting" terrain tag. if $NODISMOUNTING_TERRAINTAG && (facingTag==$NODISMOUNTING_TERRAINTAG || facingTag==$NODISMOUNTING_TERRAINTAG || currentTag==$NODISMOUNTING_TERRAINTAG) Kernel.pbMessage(_INTL("You can't dismount right now.")) #Is Diving? elsif $PokemonGlobal.diving == true Kernel.pbMessage(_INTL("You can't dismount right now.")) #Is Sliding? elsif $PokemonGlobal.sliding == true #Do nothing. #On a bike? elsif $PokemonGlobal.bicycle == true Kernel.pbMessage(_INTL("You can't use your bike while riding a Pokémon!")) #Surf Dismount elsif $PokemonGlobal.surfing == true if PBTerrain.isSurfable?(currentTag) && PBTerrain.isSurfable?(facingTag) Kernel.pbMessage(_INTL("You can't dismount right now.")) #If surfing, jump to land first. elsif pbSurfingChecker == true $PokemonGlobal.surfing = false pbDismount #Dismount pbMountJumpTowards pbWait(2) pbMountAnim pbWait(8) $game_map.autoplayAsCue $game_player.increase_steps result=$game_player.check_event_trigger_here([1,2]) Kernel.pbOnStepTaken(result) end #Swamp Surfing or Mudsdale/Rhyhorn tile Dismount elsif PBTerrain.isSwampWater?(pbGetTerrainTag) || PBTerrain.isMudsdaleTag?(currentTag) || PBTerrain.isRockTag?(currentTag) || PBTerrain.isSurfable?(currentTag) Kernel.pbMessage(_INTL("You can't dismount right now.")) else #Dismount normally. pbMountAnim pbDismount end end end #==============================================================================# #||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||# # ____________________________________________________________________________ #
Spoiler:Code:# Every PokéRide should have MoveSheet, MoveSpeed, ActionSheet, and ActionSpeed. # A PokéRide can also have one or more of the following options: # -> RockSmash: While the action button (Z) is being pressed, any rock you # walk up to will be smashed. # -> CanSurf: This Pokémon can be surfed with. # -> WalkOnMudsdale: With this PokéRide, you can walk over terrain with # terrain tag 17. # -> Strength: Boulders can be moved if the action button is held down. # -> ShowHidden: If the action button is held down, any listed event with # ".hidden" (without the quotation marks) within a 4x4 radius # will cause the Pokéride to use "HiddenNearbySheet" and # "HiddenNearbySpeed". Those two must also be implemented if your # Pokéride has "ShowHidden" # -> RockClimb: If set to true, climb RockClimb tiles # # -> CanWaterfall: If Feature Button is pressed down, mount can be used to # climb Waterfalls. # # -> CanDive: This Pokemon Mount can be used to dive underwater. # DiveMoveSheet, DiveActionSheet, DiveMoveSpeed, DiveActionSpeed # must be defined if a pokemon can Dive. # # -> CanCut: If the action button is held down, this mount will be able to # Cut small trees. # # -> IceTraction: This Pokemon will walk on ice, instead of sliding. # # -> CanHeadbutt: This Pokemon can headbutt trees. # # -> ClimbLedge: This Pokemon Mount can be used to climb Ledges # from both sides. # # -> CanDig: When the Feature button is pressed, this mount can be used to # escape caves and dungeons. # # -> CanFlash: When the Feature button is pressed, this mount can be used to # lighten up dark caves and dungeons. # # -> SwampSurf: This Pokemon can be used to surf on tiles marked as SwampWater. # # -> WalkOnWater: This Pokemon can be used to walk on surfable water. # # -> FlyOverWater: This Pokemon can be used to fly over water bodies. # # -> CanFly: When Feature button is pressed, this Pokemon Mount can be # used to fly to other cities/routes where fly points are pointed. # You can have multiple of these options at once. They should all be compatible # with one another. # Rock Smash rocks still have to be called "Rock" without the quotation marks. # Boulders still have to be called "Boulder" and their trigger method should be # "Player Touch" and it should have just one line of script: "pbPushThisBoulder" # Hidden items are ".hidden" without the quotation marks for compatibility # with my Pokétch resource. # They work the same way as hidden items there: # pbUnlist(event_id): The event becomes hidden from the Itemfinder (Stoutland) # pbList(event_id): The event becomes visible for the Itemfinder (Stoutland) # IF the event has ".hidden" in the name. # If you want Surf to be the normal surf, set this to nil. Else, set it to the # name of the PokéRide in a string (e.g. "Sharpedo") SURF_MOUNT = nil # If you want a Pokéride to be able to perform Rock Climb, set this to the # name of the Pokéride. If you don't want Rock Climb, set this to nil. ROCK_CLIMB_MOUNT = "Rhyhorn" # This is the Pokéride that is called if you press C in front of a Rock Climb tile # while not being on a Pokéride that can already use Rock Climb, which means # that this is essentially the same as "SURF_MOUNT". # A Pokéride can also have an effect that is activated when you mount it. # To implement something there, add your code in a method called "def self.mount". # The same can be done for dismounting, but in "def self.dismount" # pbMount(Tauros) module Tauros MoveSheet = ["Pokeride/boy_tauros","Pokeride/girl_tauros"] MoveSpeed = 5.0 ActionSheet = ["Pokeride/boy_tauros_charge","Pokeride/girl_tauros_charge"] ActionSpeed = 5.6 RockSmash = true end module Lapras MoveSheet = ["Pokeride/boy_lapras","Pokeride/girl_lapras"] MoveSpeed = 4.8 ActionSheet = ["Pokeride/boy_lapras_fast","Pokeride/girl_lapras_fast"] ActionSpeed = 5.4 WaterfallSheet = ["Pokeride/boy_lapras_waterfall","Pokeride/girl_lapras_waterfall"] CanSurf = true CanWaterfall = true end module Sharpedo MoveSheet = ["Pokeride/boy_sharpedo","Pokeride/girl_sharpedo"] MoveSpeed = 5.4 ActionSheet = ["Pokeride/boy_sharpedo_fast","Pokeride/girl_sharpedo_fast"] ActionSpeed = 6.0 DiveMoveSheet = ["Pokeride/boy_sharpedo_dive","Pokeride/girl_sharpedo_dive"] DiveMoveSpeed = 5.2 DiveActionSheet = ["Pokeride/boy_sharpedo_dive_fast","Pokeride/girl_sharpedo_dive_fast"] DiveActionSpeed = 5.6 CanSurf = true CanDive = true end # pbMount(Machamp) module Machamp MoveSheet = ["Pokeride/boy_machamp","Pokeride/girl_machamp"] MoveSpeed = 4.3 ActionSheet = ["Pokeride/boy_machamp_push","Pokeride/girl_machamp_push"] ActionSpeed = 3.8 Strength = true end # You get the idea now. pbMount(Mudsdale) module Mudsdale MoveSheet = ["Pokeride/boy_mudsdale","Pokeride/girl_mudsdale"] MoveSpeed = 4.1 ActionSheet = ["Pokeride/boy_mudsdale_run","Pokeride/girl_mudsdale_run"] ActionSpeed = 4.6 WalkOnMudsdale = true end module Stoutland MoveSheet = ["Pokeride/boy_stoutland","Pokeride/girl_stoutland"] MoveSpeed = 4.6 ActionSheet = ["Pokeride/boy_stoutland_search","Pokeride/girl_stoutland_search"] ActionSpeed = 3.6 HiddenNearbySheet = ["Pokeride/boy_stoutland_found","Pokeride/girl_stoutland_found"] HiddenNearbySpeed = 3.5 ShowHidden = true end module Rhyhorn MoveSheet = ["Pokeride/boy_rhyhorn","Pokeride/girl_rhyhorn"] MoveSpeed = 4.4 ActionSheet = ["Pokeride/boy_rhyhorn","Pokeride/girl_rhyhorn"] ActionSpeed = 4.4 RockClimb = true end # pbMount(Kabutops) module Kabutops MoveSheet = ["Pokeride/boy_kabutops","Pokeride/girl_kabutops"] MoveSpeed = 4.2 ActionSheet = ["Pokeride/boy_kabutops_fast","Pokeride/girl_kabutops_fast"] ActionSpeed = 5.0 CutSpeed = 5.5 CanCut = true end # pbMount(Avalugg) module Avalugg MoveSheet = ["Pokeride/boy_avalugg","Pokeride/girl_avalugg"] MoveSpeed = 3.9 ActionSheet = ["Pokeride/boy_avalugg_fast","Pokeride/girl_avalugg_fast"] ActionSpeed = 4.5 IceTraction = true end # pbMount(Gogoat) module Gogoat MoveSheet = ["Pokeride/boy_gogoat","Pokeride/girl_gogoat"] MoveSpeed = 4.9 ActionSheet = ["Pokeride/boy_gogoat_fast","Pokeride/girl_gogoat_fast"] ActionSpeed = 5.5 CanHeadbutt = true ClimbLedge = true end # pbMount(Hippowdon) module Hippowdon MoveSheet = ["Pokeride/boy_hippowdon","Pokeride/girl_hippowdon"] MoveSpeed = 4.5 ActionSheet = ["Pokeride/boy_hippowdon","Pokeride/girl_hippowdon"] ActionSpeed = 4.9 CanDig = true end # pbMount(Luxray) module Luxray MoveSheet = ["Pokeride/boy_luxray","Pokeride/girl_luxray"] MoveSpeed = 4.8 ActionSheet = ["Pokeride/boy_luxray","Pokeride/girl_luxray"] ActionSpeed = 5.2 FlashSheet = ["Pokeride/boy_luxray_flash","Pokeride/girl_luxray_flash"] CanFlash = true end # pbMount(Swampert) module Swampert MoveSheet = ["Pokeride/boy_swampert","Pokeride/girl_swampert"] MoveSpeed = 4.8 ActionSheet = ["Pokeride/boy_swampert","Pokeride/girl_swampert"] ActionSpeed = 5.2 SwampSurf = true end # pbMount(Lanturn) module Lanturn MoveSheet = ["Pokeride/boy_lanturn","Pokeride/girl_lanturn"] MoveSpeed = 5.0 ActionSheet = ["Pokeride/boy_lanturn_fast","Pokeride/girl_lanturn_fast"] ActionSpeed = 5.6 DiveMoveSheet = ["Pokeride/boy_lanturn_dive","Pokeride/girl_lanturn_dive"] DiveMoveSpeed = 4.8 DiveActionSheet = ["Pokeride/boy_lanturn_dive","Pokeride/girl_lanturn_dive"] DiveActionSpeed = 5.5 CanSurf = true CanDive = true end # pbMount(Araquanid) module Araquanid MoveSheet = ["Pokeride/boy_araquanid","Pokeride/girl_araquanid"] MoveSpeed = 4.8 ActionSheet = ["Pokeride/boy_araquanid_fast","Pokeride/girl_araquanid_fast"] ActionSpeed = 5.8 DiveMoveSheet = ["Pokeride/boy_araquanid_dive","Pokeride/girl_araquanid_dive"] DiveMoveSpeed = 4.5 DiveActionSheet = ["Pokeride/boy_araquanid_dive_fast","Pokeride/girl_araquanid_dive_fast"] DiveActionSpeed = 5.5 CanDive = true WalkOnWater = true end # pbMount(Rampardos) module Rampardos MoveSheet = ["Pokeride/boy_rampardos","Pokeride/girl_rampardos"] MoveSpeed = 5.0 ActionSheet = ["Pokeride/boy_rampardos_charge","Pokeride/girl_rampardos_charge"] ActionSpeed = 5.6 RockSmash = true end # pbMount(Flygon) module Flygon MoveSheet = ["Pokeride/boy_flygon","Pokeride/girl_flygon"] MoveSpeed = 4.6 ActionSheet = ["Pokeride/boy_flygon_fast","Pokeride/girl_flygon_fast"] ActionSpeed = 5.2 FlyOverWater = true RockClimb = true WalkOnMudsdale = true IceTraction = true CanFly = true end
Credits:
- Bhagya Jyoti
- UlithiumDragon
Attachments
Last edited: