Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Dekita's=======================================================================
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #===============================================================================
- # v1.2
- # ★ Perfect MMORPG Meditate™ ★
- #
- #===============================================================================
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #===============================================================================
- #
- # -- Last updated: 30/08/2o12
- #
- # -- Difficulty: N/A
- #
- # -- Customisation: Better Than A Kick In The Nuts - (Low)
- #
- # -- Requires: N/A
- #
- # -- Recommended: any "action" battle system, e.g fight on the map.
- #
- # -- Compatable: RPG Maker VX Ace ONLY!
- #
- #===============================================================================
- #===============================================================================
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- #===============================================================================
- #===============================================================================
- # ☆ Script Information:
- #=======================
- # This Script was designed for action battle systems, e.g
- # SAS - Saphire Action System
- # or
- # XAS - Xiderwong Action System
- # and NOT the standard battle style e.g a transistion from the map into
- # battle scene. (but you can still use it)
- #
- # THIS WILL OVERRIDE REGEN METHODS, e.g hp regen buffs from increased hrg rates
- #
- # This script was made for 1 player type games.(one actor in the party at a time)
- #
- # This script is simply a replica of most mmorpg games meditate function, e.g
- # press [x] button and regenerate hp/mp/ect (works on the map not in battle)
- #
- # If testing this script out for the first time i recommend setting your
- # actors hp and mp to 100.
- #
- # This will automatically play the sound effect for your chosen animation.
- #===============================================================================
- # ☆ TERMS OF USE:
- #===============================================================================
- #
- # 1. You must give credit to Dekita.
- #
- # 2. This script is for NON-Commercial use ONLY!*
- #
- # 3. You CANNOT give credit to yourself for Re-posting this script
- # or Posting a modified version.*
- #
- # 4. Do not Re-Distribute this script.
- #
- # 5. You are NOT allowed to convert this script to any other engine,
- # E.G converting it from RGSS3 into RGSS2.*
- #
- # 6. ENJOY!
- #
- #-------------------------------------------------------------------------------
- # * = Unless permissions are given by Dekita. < e-mail DekitaRPG@gmail.com
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- #===============================================================================
- #===============================================================================
- # ☆ History:
- #============
- # D - M - Y
- # 02/09/2o12 - Added switches.
- # 30/08/2o12 - Fixed a silly fault.(stopped regen on the map and in standard battles)
- # - Finished.(v1.0)
- # 29/08/2o12 - Added a lil bit of customisation,
- # - Added TP Regen/Gain,
- # - Improved regeneration formula,
- # 28/08/2o12 - Fixed Meditate wait,
- # 25/08/2o12 - started,
- #===============================================================================
- #===============================================================================
- # ☆ Credit and Thanks to :
- #==========================
- # N/A
- #===============================================================================
- #===============================================================================
- # ☆ Foresight Into The Future:
- #==============================
- # Maybe a meditate buff for standard battles ?
- #-------------------------------------------------------------------------------
- # If you have any ideas e-mail me at DekitaRPG@gmail.com
- #===============================================================================
- #===============================================================================
- # ☆ Known Bugs:
- #=================
- # if using a non action battle system your regen skills wont work :) as i disable
- # the regen function .
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # If a new bug is found please e-mail me at DekitaRPG@gmail.com
- #===============================================================================
- #===============================================================================
- # ☆ INSTRUCTIONS:
- #=================
- # Place this script UNDER "▼ Materials" and ABOVE "▼ Main" in your script editor.
- #===============================================================================
- #===============================================================================
- # ☆ Import:
- #===========
- $imported = {} if $imported.nil?
- $imported["DPB-PMEDI"] = true
- #
- #===============================================================================
- module DPB
- module PMEDITATE
- #===============================================================================#
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- # #
- # ★ Perfect MMORPG Meditate™ ★
- #
- # - CUSTOMISATION - #
- # # #
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- #===============================================================================#
- # - DekitaRPG@gmail.com - #
- #===============================================================================#
- # make this false if you dont want to draw the gauges on screen.
- # you can also go to line 300-ish if using a real hud script and delete everything
- # below it.(if you dont plan on ever using the gauges).
- SHOW_GAUGES_ON_MAP_SCREEN = false
- #
- # NOTE:
- # Meditate regeneration has a formula for how much hp/mp you regain
- # the formula is:
- # HPgain (the base hp gain defined below)
- # + (actors hrg/mrg/trg * 100)(1% hrg/mrg/trg = 1 extra hp/mp/tp gained)
- # = total recovery value,
- # therefor more hp/mp/tp regen the more you gain per increase.
- #
- #
- #
- # Meditate_wait_time time also has a formula
- # the formula is:
- # Meditate_wait_time / Actors recovery rate.
- # therefor more rec value = faster regen , less = slower regen time
- #the keyboard key for meditating.
- MEDITATEKEY = :L # :L = Q button on the keyboard.
- #other keys:
- # :Button Default Keyboard Button
- # :L Q
- # :R W
- # :X A
- # :Y S
- # :Z D
- # Switch that enables meditate on the map.
- ENABLE_MEDITATE_SWITCH = 0 # Leave "0" if you wish to always use mediitate.
- #Base wait time for meditate regeneration.
- Meditate_wait_time = 20 #(frames)
- #animation_id for meditate
- MEDIANI = 112 # 38
- #TURN_OFF_HP to not gain hp during meditate.
- GAIN_HP = true
- #BASE HP gain while meditating(in between wait time's (defined above))
- HPgain = 1
- # Switch that enables meditate on the map.
- ENABLE_HPgain_SWITCH = 0 # Leave "0" if you wish to always use mediitate.
- #TURN_OFF_MP to not gain hp during meditate.
- GAIN_MP = true
- #BASE MP gain while meditating(in between wait time's (defined above))
- MPgain = 1
- # Switch that enables meditate on the map.
- ENABLE_MPgain_SWITCH = 0 # Leave "0" if you wish to always use mediitate.
- #TURN_OFF_TP to not gain hp during meditate.
- GAIN_TP = true
- #BASE TP gain while meditating(in between wait time's (defined above))
- TPgain = 1
- # Switch that enables meditate on the map.
- ENABLE_TPgain_SWITCH = 0 # Leave "0" if you wish to always use mediitate.
- end #Pmeditate
- end # DPB
- #===============================================================================#
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- # #
- # ★ Perfect MMORPG Meditate™ ★
- #
- # - SCRIPT BEGIN - #
- # # #
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- #===============================================================================#
- # - DekitaRPG@gmail.com - #
- #===============================================================================#
- #==============================================================================
- # ■ Switch
- #==============================================================================
- module Switch
- #--------------------------------------------------------------------------
- # self. use meditate
- #--------------------------------------------------------------------------
- def self.use_meditate
- return true if DPB::PMEDITATE::ENABLE_MEDITATE_SWITCH <= 0
- return $game_switches[DPB::PMEDITATE::ENABLE_MEDITATE_SWITCH]
- end
- #--------------------------------------------------------------------------
- # self. use meditate
- #--------------------------------------------------------------------------
- def self.meditate_hpgain
- return true if DPB::PMEDITATE::ENABLE_HPgain_SWITCH <= 0
- return $game_switches[DPB::PMEDITATE::ENABLE_HPgain_SWITCH]
- end
- #--------------------------------------------------------------------------
- # self. use meditate
- #--------------------------------------------------------------------------
- def self.meditate_mpgain
- return true if DPB::PMEDITATE::ENABLE_MPgain_SWITCH <= 0
- return $game_switches[DPB::PMEDITATE::ENABLE_MPgain_SWITCH]
- end
- #--------------------------------------------------------------------------
- # self. use meditate
- #--------------------------------------------------------------------------
- def self.meditate_tpgain
- return true if DPB::PMEDITATE::ENABLE_TPgain_SWITCH <= 0
- return $game_switches[DPB::PMEDITATE::ENABLE_TPgain_SWITCH]
- end
- end # Switch
- #####
- # Keyboard four de map ? no
- class Scene_Map < Scene_Base
- alias dpbzmediscene update_scene
- def update_scene
- dpbzmediscene
- # Define call meditate from map
- update_call_meditate unless scene_changing? or $game_player.moving?
- end # update scene
- # Define call meditate from map
- def update_call_meditate
- if Input.press?(DPB::PMEDITATE::MEDITATEKEY) && Switch.use_meditate
- call_meditate
- end
- end
- # Define call meditate from map
- def call_meditate
- $game_player.animation_id = DPB::PMEDITATE::MEDIANI
- dpbzwait((DPB::PMEDITATE::Meditate_wait_time / $game_party.members[0].rec).to_i)
- if DPB::PMEDITATE::GAIN_HP && Switch.meditate_hpgain
- hpplusvaltote
- end
- if DPB::PMEDITATE::GAIN_MP && Switch.meditate_mpgain
- mpplusvaltote
- end
- if DPB::PMEDITATE::GAIN_TP && Switch.meditate_tpgain
- tpplusvaltote
- end
- ##
- end
- #--------------------------------------------------------------------------
- # * dpbzwait
- #--------------------------------------------------------------------------
- def dpbzwait(duration)
- fade_loop(duration) {|v| Graphics.frame_count = v }
- end
- # formula for hp regen during meditate
- def hpplusvaltote
- hpval1 = DPB::PMEDITATE::HPgain
- hpval2 = ($game_party.members[0].hrg * 100).to_i
- hpvaltote = (hpval1 + hpval2)
- $game_party.members[0].hp += hpvaltote
- end
- # formula for mp regen during meditate
- def mpplusvaltote
- mpval1 = DPB::PMEDITATE::MPgain
- mpval2 = ($game_party.members[0].mrg * 100).to_i
- mpvaltote = (mpval1 + mpval2)
- $game_party.members[0].mp += mpvaltote
- end
- # formula for mp regen during meditate
- def tpplusvaltote
- tpval1 = DPB::PMEDITATE::TPgain
- tpval2 = ($game_party.members[0].trg * 100).to_i
- tpvaltote = (tpval1 + tpval2)
- $game_party.members[0].tp += tpvaltote
- end
- end# scenemap
- class Game_Player < Game_Character
- #--------------------------------------------------------------------------
- # * Determine if Movement is Possible
- #--------------------------------------------------------------------------
- alias dpbzmedimove? movable?
- def movable?
- return false if Input.press?(DPB::PMEDITATE::MEDITATEKEY)
- dpbzmedimove?
- end
- end
- #==============================================================================
- # Game_Battler
- #
- # Re-write #
- class Game_Battler < Game_BattlerBase
- def regenerate_all
- end # N/A
- end #class Game_Battler < Game_BattlerBase
- #
- #===============================================================================#
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- # #
- # ★ Perfect MMORPG Meditate™ ★
- #
- # - SCRIPT END - #
- # # #
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- #===============================================================================#
- # - DekitaRPG@gmail.com - #
- #===============================================================================#
- #
- #
- # YOU CAN DELETE EVERYTHING BELOW THIS IF YOU DONT WANT TO SHOW THE HP/MP AND TP
- # GAUGES. I RECOMMEND USING A BETTER HUD SO YOU CAN "APPRECIATE" THE MEDITATE
- # FUNCTION (I find it "pleasing" to see my hp ect rise in the gauges lol)
- #
- #
- module DPB
- module PHUD
- HP_FONT_SIZE = 15
- MP_FONT_SIZE = 15
- TP_FONT_SIZE = 15
- HUDG_Z = 99 # the z for the hud graphic (from graphics folder)
- FACE_Z = 98 # the z value for the face image
- HP_Z = 98 # the z value for hp gauge
- MP_Z = 98 # the z value for mp gauge
- TP_Z = 98 # the z value for tp gauge
- end#phud
- end#DPB
- if DPB::PMEDITATE::SHOW_GAUGES_ON_MAP_SCREEN
- class HP_HudThing < Window_Base
- #----------------------------------------------------
- # * Object Initialization
- #----------------------------------------------------
- def initialize
- super(-12, -12, Graphics.width, Graphics.height + 10)
- create_contents
- self.opacity = 0
- @actor = $game_party.members[0]
- refresh
- end
- def dpbzhp_gauge_color1; text_color(28); end; # HP gauge 1
- def dpbzhp_gauge_color2; text_color(29); end; # HP gauge 2
- def dpbzmp_gauge_color1; text_color(22); end; # MP gauge 1
- def dpbzmp_gauge_color2; text_color(23); end; # MP gauge 2
- def dpbztp_gauge_color1; text_color(10); end; # TP gauge 1
- def dpbztp_gauge_color2; text_color(2); end; # TP gauge 2
- #----------------------------------------------------
- # * Refresh
- #----------------------------------------------------
- def refresh
- self.contents.clear
- contents.clear
- draw_window_content
- end
- def draw_window_content
- dpbzhp
- dpbzmp
- dpbztp
- end
- def dpbzhp
- self.z = DPB::PHUD::HP_Z
- contents.font.size = DPB::PHUD::HP_FONT_SIZE
- @hp = @actor.hp
- rate = [@actor.hp_rate, 1.0].min
- draw_dpbzhp_gauge(5, -5, 112, rate, dpbzhp_gauge_color1, dpbzhp_gauge_color2)
- change_color(normal_color)
- draw_current_and_max_values(5, 0, 112, @actor.hp, @actor.mhp,
- hp_color(@actor), normal_color)
- end
- def draw_dpbzhp_gauge(dx, dy, dw, rate, color1, color2)
- dw -= 2
- fill_w = [(dw * rate).to_i, dw].min
- gauge_h = 14
- gauge_y = dy + line_height - 2 - gauge_h
- contents.gradient_fill_rect(dx, gauge_y, fill_w, gauge_h, color1, color2)
- end
- def dpbzmp
- self.z = DPB::PHUD::MP_Z
- contents.font.size = DPB::PHUD::MP_FONT_SIZE
- @mp = @actor.mp
- rate = [@actor.mp_rate, 1.0].min
- draw_dpbzmp_gauge(5, 15, 112, rate, dpbzmp_gauge_color1, dpbzmp_gauge_color2)
- change_color(normal_color)
- draw_current_and_max_values(5, 20, 112, @actor.mp, @actor.mmp,
- mp_color(@actor), normal_color)
- end
- def draw_dpbzmp_gauge(dx, dy, dw, rate, color1, color2)
- dw -= 2
- fill_w = [(dw * rate).to_i, dw].min
- gauge_h = 14
- gauge_y = dy + line_height - 2 - gauge_h
- contents.gradient_fill_rect(dx, gauge_y, fill_w, gauge_h, color1, color2)
- end
- def dpbztp
- self.z = DPB::PHUD::TP_Z
- contents.font.size = DPB::PHUD::TP_FONT_SIZE
- @tp = @actor.tp
- rate = [@actor.tp_rate, 1.0].min
- draw_dpbztp_gauge(5, 35, 112, rate, dpbztp_gauge_color1, dpbztp_gauge_color2)
- draw_text(62, 40, 112, line_height, @actor.tp)
- end
- def draw_dpbztp_gauge(dx, dy, dw, rate, color1, color2)
- dw -= 2
- fill_w = [(dw * rate).to_i, dw].min
- gauge_h = 14
- gauge_y = dy + line_height - 2 - gauge_h
- contents.gradient_fill_rect(dx, gauge_y, fill_w, gauge_h, color1, color2)
- end
- def update
- super
- return if !self.visible
- if @level != @actor.level or @hp != @actor.hp or @mp != @actor.mp or
- @tp != @actor.tp or @exp != @actor.exp or @gold != $game_party.gold
- refresh
- end
- end
- end
- class Spriteset_Map
- alias dpbzhud_initialize initialize
- alias dpbzhud_dispose dispose
- alias dpbzhud_update update
- def initialize
- @trash = []
- @winhud = HP_HudThing.new
- dpbzhud_initialize
- end
- def dispose
- dpbzhud_dispose
- @winhud.dispose
- end
- def update
- dpbzhud_update
- @winhud.update
- end
- end#spriteset map
- end
- #
- #end # switch
- ############################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement