Holy87

X-SParam Changer - EN

Jul 23rd, 2015
267
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. =begin
  2.  ==============================================================================
  3.   ■ Holy87 - XPARAM and SPARAM changer
  4.       version 1.0 - EN
  5.       User difficulty: ★
  6.       License: CC-BY. Everyone can distribute this script and use in their free
  7.       and commercial games. Credit required.
  8.  
  9.   ■ This script allow the maker to manually change actor's
  10.     ● xparams: hit, eva, cri, cev (critical evasion), mev (magic evasion),
  11.       mrf (magic reflection rate), cnt, hrg, mrg, trg
  12.     ● sparams: tgr, grd, rec, pha, mcr, tcr, pdr, mdr, fdr, exr
  13.  ==============================================================================
  14.   ■ Compatibility
  15.     Game_BattlerBase -> alias initialize, xparam, sparam
  16.  ==============================================================================
  17.   ■ Installation
  18.     Install this script under Materials and above Main
  19.  ==============================================================================
  20.   ■ Istructions
  21.     To change an actor's parameter, use a call script like this:
  22.     $game_actors[ACTORID].PARAM = VALUE
  23.     wich ACTORID is the actor's ID, PARAM is the xparam or sparam and VALUE the
  24.     value. For example:
  25.     $game_actors[1].eva = 5 #sets the first actor's evasion to 5
  26.     $game_actors[3].cri += 3 #adds 3 points to actor 3's critical rate
  27. =end
  28.  
  29. # ------------------------- BEGIN OF THE SCRIPT -------------------------------
  30.  
  31. #==============================================================================
  32. # ** Game_BattlerBase
  33. #------------------------------------------------------------------------------
  34. #  Core script
  35. #==============================================================================
  36. class Game_BattlerBase
  37.   alias h87xsparam_initialize initialize unless $@
  38.   alias h87xsparam_xparam xparam unless $@
  39.   alias h87xsparam_sparam sparam unless $@
  40.   #--------------------------------------------------------------------------
  41.   # * alias di initialize per inizializzare le tavole di xparam e sparam
  42.   #--------------------------------------------------------------------------
  43.   def initialize
  44.     h87xsparam_initialize
  45.     @sparam_changes = {0=>0,1=>0,2=>0,3=>0,4=>0,5=>0,6=>0,7=>0,8=>0,9=>0}
  46.     @xparam_changes = {0=>0,1=>0,2=>0,3=>0,4=>0,5=>0,6=>0,7=>0,8=>0,9=>0}
  47.   end
  48.   #--------------------------------------------------------------------------
  49.   # * Alias method for xparam to including xparam changes
  50.   #--------------------------------------------------------------------------
  51.   def xparam(n)
  52.     return h87xsparam_xparam(n) + @xparam_changes[n]
  53.   end
  54.   #--------------------------------------------------------------------------
  55.   # * Alias method for sparam to including sparam changes
  56.   #--------------------------------------------------------------------------
  57.   def sparam(n)
  58.     return h87xsparam_sparam(n) + @sparam_changes[n]
  59.   end
  60.   #--------------------------------------------------------------------------
  61.   # * Xparam and Sparam changing methods
  62.   #--------------------------------------------------------------------------
  63.   def hit=(n);  @xparam_changes[0]=n;  end          # HIT  HIT rate
  64.   def eva=(n);  @xparam_changes[1]=n;  end          # EVA  EVAsion rate
  65.   def cri=(n);  @xparam_changes[2]=n;  end          # CRI  CRItical rate
  66.   def cev=(n);  @xparam_changes[3]=n;  end          # CEV  Critical EVasion rate
  67.   def mev=(n);  @xparam_changes[4]=n;  end          # MEV  Magic EVasion rate
  68.   def mrf=(n);  @xparam_changes[5]=n;  end          # MRF  Magic ReFlection rate
  69.   def cnt=(n);  @xparam_changes[6]=n;  end          # CNT  CouNTer attack rate
  70.   def hrg=(n);  @xparam_changes[7]=n;  end          # HRG  Hp ReGeneration rate
  71.   def mrg=(n);  @xparam_changes[8]=n;  end          # MRG  Mp ReGeneration rate
  72.   def trg=(n);  @xparam_changes[9]=n;  end          # TRG  Tp ReGeneration rate
  73.   def tgr=(n);  @sparam_changes[0]=n;  end          # TGR  TarGet Rate
  74.   def grd=(n);  @sparam_changes[1]=n;  end          # GRD  GuaRD effect rate
  75.   def rec=(n);  @sparam_changes[2]=n;  end          # REC  RECovery effect rate
  76.   def pha=(n);  @sparam_changes[3]=n;  end          # PHA  PHArmacology
  77.   def mcr=(n);  @sparam_changes[4]=n;  end          # MCR  Mp Cost Rate
  78.   def tcr=(n);  @sparam_changes[5]=n;  end          # TCR  Tp Charge Rate
  79.   def pdr=(n);  @sparam_changes[6]=n;  end          # PDR  Physical Damage Rate
  80.   def mdr=(n);  @sparam_changes[7]=n;  end          # MDR  Magical Damage Rate
  81.   def fdr=(n);  @sparam_changes[8]=n;  end          # FDR  Floor Damage Rate
  82.   def exr=(n);  @sparam_changes[9]=n;  end          # EXR  EXperience Rate
  83. end #script end
RAW Paste Data