You are on page 1of 9

###############################################################################

# ZUD Plugin for Pokemon Essentials v19.


#
# Contents:
# - Features
# - Installation
###############################################################################

This plugin is made for Pokemon Essentials v19.1.


Compatibility with the v19.1 iteration of the Gen 8 Project is also supported.
The ZUD Plugin is NOT currently compatible with EBDX.

###############################################################################
###############################################################################
####
#### Features
####
###############################################################################
###############################################################################

The main features included with this plugin:


- Z-Move functionality, with all official Z-Moves up to USUM.
- Ultra Burst functionality.
- Dynamax functionality, with all official G-Max forms up to Isle of Armor.
- Max Raid Battles.
- Max Raid Database (custom script).
- Dynamax Adventures.
- All battler/icon sprites for G-Max forms.
- Icon sprites for all official items.
- Several official audio tracks related to the above mechanics.

What this plugin DOESN'T contain:


- Animations for Z-Moves and Max Moves.
- Native support for 4v1 Max Raid battles.
- AI partners in Max Raid battles.
- Gen 8 content that is already found in other scripts, such as the Gen 8 project.

###############################################################################
###############################################################################
####
#### Installation
####
###############################################################################
###############################################################################

###################################################################################
#
FILE INSTALLATIONS
###################################################################################
#

1) Open the folder "Primary Installation", then drag and drop its contents into
your root folder.

NOTE 1: Graphics/Pictures contains a replacement sprite for the shinyness


icon, which blends in
better with Raid databoxes. Delete this file first if you don't
want to overwrite your
custom shiny icon.

NOTE 2: Graphics/Pictures/Battle contains a replacement sprite for the


"owned" icon, which blends
in better with Raid databoxes. Delete this file first if you don't
want to overwrite your
custom owned icon.

NOTE 3: Graphics/Pictures/Battle also contains a replacement graphic for


cursor commands in the fight
menu, to add the "Cheer" command during Raid battles. Delete this
file first if you don't want
to overwrite your custom command graphics. Note that you'll have to
create your own to add the
Cheer button otherwise.

NOTE 4: PBS contains a file named ZUD_Habitats that adds new habitat data to
all official species.
Delete this file before loading the game if you don't want the
current habitat data for your
species to be overwritten.

2) Open the folder "Secondary Installation", and perform the following:

A) ONLY If you're using the Gen 8 Project, open the folder by that name, and
then drag and drop its contents
into your root folder and replace any files if necessary. Ignore this
step otherwise.

B) If you are NOT using the Gen 8 Project, open the folder named "Vanilla
Essentials", and then drag and drop
its contents into your root folder. Ignore this step otherwise.

C) Copy the contents of the "items" text file, and add those contents to your
items.txt in your PBS folder.
Make sure any item ID's do not conflict.

D) Copy the contents of the "moves" text file, and add those contents to your
moves.txt in your PBS folder.
Make sure any move ID's do not conflict.

E) Copy the contents of the "Settings" ruby file. In your game scripts, use
Insert to create a new section
below "BattleSettings", and name it "ZUD Settings". Paste the contents
of this file there.
NOTE: If you're using the Gen 8 Project, change the "GMAX_XL_ICONS"
setting found in this script to "false".

3) Follow the instructions below for all manual script edits.

NOTE: Use CTRL+F to locate the exact lines in each section below.

4) Once all the steps have been completed, load your game in Debug mode while
holding CTRL to recompile your game.
###################################################################################
#
1) Edits to section: Battler_UseMove
###################################################################################
#
A) Below line "break if magicCoater>=0 || magicBouncer>=0"
Paste this:
#-----------------------------------------------------------------------
# ZUD - Prematurely ends multi-hit attacks on raid Pokemon.
#-----------------------------------------------------------------------
break if defined?(Settings::ZUD_COMPAT) && _ZUD_BreakMultiHits(targets,i)
#-----------------------------------------------------------------------

B) Above the line beginning with "# HP-healing held items"


Paste this:
#-------------------------------------------------------------------------
# ZUD - Raid effects on hit.
#-------------------------------------------------------------------------
_ZUD_ProcessRaidEffects(move,user,targets,hitNum) if defined?
(Settings::ZUD_COMPAT)
#-------------------------------------------------------------------------

C) Above line "# Additional effect"


Paste this:
#---------------------------------------------------------------------------
# ZUD - Raid effects on hit (after main effects).
#---------------------------------------------------------------------------
_ZUD_ProcessRaidEffects2(move,user,targets) if defined?(Settings::ZUD_COMPAT)
#---------------------------------------------------------------------------

###################################################################################
#
2) Edits to section: Battler_UseMove_SuccessChecks
###################################################################################
#
***Find this block of code***

# Imprison
@battle.eachOtherSideBattler(@index) do |b|
next if !b.effects[PBEffects::Imprison] || !b.pbHasMove?(move.id)
if showMessages
msg = _INTL("{1} can't use its sealed {2}!",pbThis,move.name)
(commandPhase) ? @battle.pbDisplayPaused(msg) : @battle.pbDisplay(msg)
end
return false
end

*****************************

And REPLACE it with all of this:


#---------------------------------------------------------------------------
# ZUD - Imprison
#---------------------------------------------------------------------------
if defined?(Settings::ZUD_COMPAT); _ZUD_Imprison(move,commandPhase);
else
# Imprison
@battle.eachOtherSideBattler(@index) do |b|
next if !b.effects[PBEffects::Imprison] || !b.pbHasMove?(move.id)
if showMessages
msg = _INTL("{1} can't use its sealed {2}!",pbThis,move.name)
(commandPhase) ? @battle.pbDisplayPaused(msg) : @battle.pbDisplay(msg)
end
return false
end
end
#---------------------------------------------------------------------------

###################################################################################
#
3) Edits to section: Battler_UseMove_TriggerEffects
###################################################################################
#
***Find this block of code in "def pbEffectsOnMakingHit"***

# Grudge
if target.effects[PBEffects::Grudge] && target.fainted?
move.pp = 0
@battle.pbDisplay(_INTL("{1}'s {2} lost all of its PP due to the grudge!",
user.pbThis,move.name))
end
# Destiny Bond (recording that it should apply)
if target.effects[PBEffects::DestinyBond] && target.fainted?
if user.effects[PBEffects::DestinyBondTarget]<0
user.effects[PBEffects::DestinyBondTarget] = target.index
end
end

*****************************

And REPLACE it with all of this:


#-------------------------------------------------------------------------
# ZUD - Grudge/Destiny Bond
#-------------------------------------------------------------------------
if defined?(Settings::ZUD_COMPAT); _ZUD_EffectsOnKO(move,user,target);
else
# Grudge
if target.effects[PBEffects::Grudge] && target.fainted?
move.pp = 0
@battle.pbDisplay(_INTL("{1}'s {2} lost all of its PP due to the
grudge!",
user.pbThis,move.name))
end
# Destiny Bond (recording that it should apply)
if target.effects[PBEffects::DestinyBond] && target.fainted?
if user.effects[PBEffects::DestinyBondTarget]<0
user.effects[PBEffects::DestinyBondTarget] = target.index
end
end
end
#-------------------------------------------------------------------------

###################################################################################
#
4) Edits to section: Move_Usage
###################################################################################
#
Above the line "# Target takes the damage"
Paste this:
#---------------------------------------------------------------------------
# ZUD - Max Raid damage thresholds.
#---------------------------------------------------------------------------
damage = _ZUD_ReduceMaxRaidDamage(target,damage) if defined?
(Settings::ZUD_COMPAT)
#---------------------------------------------------------------------------

###################################################################################
#
5) Edits to section: Move_Usage_Calculations
###################################################################################
#
Below line "c += user.effects[PBEffects::FocusEnergy]":
Paste this:
#---------------------------------------------------------------------------
# ZUD - Critical Boost
#---------------------------------------------------------------------------
c += user.effects[PBEffects::CriticalBoost] if defined?(Settings::ZUD_COMPAT)
#---------------------------------------------------------------------------

###################################################################################
#
6) Edits to section: PokeBattle_BattleCommon
###################################################################################
#
Above line "# Calculate the number of shakes (4=capture)":
Paste this:
#---------------------------------------------------------------------------
# ZUD - Prevents capturing Raid Pokemon until defeated.
#---------------------------------------------------------------------------
return if defined?(Settings::ZUD_COMPAT) && _ZUD_RaidCaptureFail(battler,ball)
#---------------------------------------------------------------------------

###################################################################################
#
7) Edits to section: Battle_Action_Switching
###################################################################################
#
Above line "# Entry hazards":
Paste this:
#---------------------------------------------------------------------------
# ZUD - Z-Parting Shot/Z-Memento, G-Max Steelsurge
#---------------------------------------------------------------------------
_ZUD_OnActiveEffects(battler) if defined?(Settings::ZUD_COMPAT)
#---------------------------------------------------------------------------

###################################################################################
#
8) Edits to section: Battle_Phase_Command
###################################################################################
#
Below line "break if pbCallMenu(idxBattler)"
Paste this:
#-----------------------------------------------------------------------
# ZUD - Allows the use of the Cheer command in raids.
#-----------------------------------------------------------------------
when 5; break if defined?(Settings::ZUD_COMPAT) &&
_ZUD_CheerMenu(idxBattler)
#-----------------------------------------------------------------------

###################################################################################
#
9) Edits to section: Battle_Phase_EndOfRound
###################################################################################
#
Above line "# Taunt":
Paste this:
#---------------------------------------------------------------------------
# ZUD - G-Max Vinelash, Wildfire, Cannonade, Volcalith
#---------------------------------------------------------------------------
_ZUD_EndOfRoundEffects(priority) if defined?(Settings::ZUD_COMPAT)
#---------------------------------------------------------------------------

###################################################################################
#
10) Edits to section: UI_Party
###################################################################################
#
A) Below the line beginning with "@pkmnsprite.z"
Paste this:
#---------------------------------------------------------------------------
# ZUD - Dynamax Icons
#---------------------------------------------------------------------------
_ZUD_DynamaxSize if defined?(Settings::ZUD_COMPAT)
#---------------------------------------------------------------------------

B) Below the line beginning with "@pkmnsprite.pokemon = value"


Paste this:
#---------------------------------------------------------------------------
# ZUD - Dynamax Icons
#---------------------------------------------------------------------------
_ZUD_DynamaxSize if defined?(Settings::ZUD_COMPAT)
#---------------------------------------------------------------------------

C) Below the line beginning with "@pkmnsprite.color"


Paste this:
#-------------------------------------------------------------------------
# ZUD - Dynamax Icons
#-------------------------------------------------------------------------
_ZUD_DynamaxColor if defined?(Settings::ZUD_COMPAT)
#-------------------------------------------------------------------------

###################################################################################
#
11) Edits to section: UI_Summary
###################################################################################
#
A) Above line "# Write the held item's name" in def drawPage(page):
Paste this:
#---------------------------------------------------------------------------
# ZUD - Summary images
#---------------------------------------------------------------------------
_ZUD_SummaryImages(textpos,3) if defined?(Settings::ZUD_COMPAT)
#---------------------------------------------------------------------------

B) In "def drawPageFourSelecting"
***Find these three lines***

type_number = GameData::Type.get(move.type).id_number
imagepos.push(["Graphics/Pictures/types", 248, yPos + 8, 0, type_number *
28, 64, 28])
textpos.push([move.name,316,yPos,0,moveBase,moveShadow])

*****************************

And REPLACE these lines with this:


#-----------------------------------------------------------------------
# ZUD - Max Move display.
#-----------------------------------------------------------------------
maxmove = (defined?(Settings::ZUD_COMPAT) && !move_to_learn) ?
_ZUD_DrawMoveSel(move)[0] : move
type_number = GameData::Type.get(maxmove.type).id_number
imagepos.push(["Graphics/Pictures/types", 248, yPos + 8, 0, type_number *
28, 64, 28])
textpos.push([maxmove.name,316,yPos,0,moveBase,moveShadow])
#-----------------------------------------------------------------------

C) In "def drawSelectedMove"

***Find this chunk of code***

case selected_move.base_damage
when 0 then textpos.push(["---", 216, 148, 1, base, shadow]) # Status move
when 1 then textpos.push(["#{flex_dmg}", 216, 148, 1, base, shadow]) #
Variable power move
else textpos.push([selected_move.base_damage.to_s, 216, 148, 1, base,
shadow])
end
if selected_move.accuracy == 0
textpos.push(["---", 216, 180, 1, base, shadow])
else
textpos.push(["#{selected_move.accuracy}%", 216 +
overlay.text_size("%").width, 180, 1, base, shadow])
end

*****************************

And REPLACE it with all of this:


#---------------------------------------------------------------------------
# ZUD - Display Max Move data.
#---------------------------------------------------------------------------
maxmove_data = (defined?(Settings::ZUD_COMPAT)) ?
_ZUD_DrawMoveSel(selected_move) : [selected_move,"???"]
flex_dmg = maxmove_data[1]
maxmove = maxmove_data[0]
case maxmove.base_damage
when 0 then textpos.push(["---", 216, 148, 1, base, shadow]) # Status move
when 1 then textpos.push(["#{flex_dmg}", 216, 148, 1, base, shadow]) #
Variable power move
else textpos.push([selected_move.base_damage.to_s, 216, 148, 1, base,
shadow])
end
if maxmove.accuracy == 0
textpos.push(["---", 216, 180, 1, base, shadow])
else
textpos.push(["#{selected_move.accuracy}%", 216 +
overlay.text_size("%").width, 180, 1, base, shadow])
end
#---------------------------------------------------------------------------

###################################################################################
#
12) Edits to section: UI_Pokegear (OPTIONAL - For Database access in Pokegear)
###################################################################################
#
A) Below line "cmdJukebox = -1"
Paste this:
#---------------------------------------------------------------------------
# ZUD - Raid Database
#---------------------------------------------------------------------------
cmdRaidData = -1 if defined?(Settings::ZUD_COMPAT)
#---------------------------------------------------------------------------

B) Above line "@scene.pbStartScene(commands)"


Paste this:
#---------------------------------------------------------------------------
# ZUD - Raid Database
#---------------------------------------------------------------------------
if defined?(Settings::ZUD_COMPAT)
commands[cmdRaidData = commands.length] = ["database",_INTL("Raid Database")]
end
#---------------------------------------------------------------------------

C) Below the very last "}" in the section


Paste this:
#-------------------------------------------------------------------------
# ZUD - Raid Database
#-------------------------------------------------------------------------
elsif defined?(Settings::ZUD_COMPAT) && cmdRaidData>=0 && cmd==cmdRaidData
pbPlayDecisionSE
pbOpenRaidData
#-------------------------------------------------------------------------

###################################################################################
#
13) Edits to section: Compiler
###################################################################################
#
A) Below the line "compile_pokemon_forms":
Paste this:
#---------------------------------------------------------------------------
# ZUD - Compile
#---------------------------------------------------------------------------
if defined?(Settings::ZUD_COMPAT)
yield(_INTL("Compiling ZUD compatibility data"))
compile_ZUD_Habitats # Depends on Species
compile_ZUD_PowerMoves # Depends on Move, Item, Type, Species
compile_ZUD_Metrics # Depends on Species, Power Moves
end
#---------------------------------------------------------------------------

B) Above the line "latestDataTime = 0":


Paste this:
#-------------------------------------------------------------------------
# ZUD data & text files.
#-------------------------------------------------------------------------
if defined?(Settings::ZUD_COMPAT)
dataFiles.push("ZUD_PowerMoves.dat")
textFiles.push("ZUD_PowerMoves.txt")
end
#-------------------------------------------------------------------------

You might also like