Personal Skill MP Cost

IneptAttoney_08

Dimas Ridwan AP
Veteran
Joined
Mar 1, 2019
Messages
146
Reaction score
29
First Language
Indonesia
Primarily Uses
RMVXA
I am looking for scripts that can change the MP Cost from a skill. for example, adding a note tag:
<mpcost: 10, 50>
it will make the MP Cost skill with ID 10 be 50%. Is there a script like this?
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,674
Reaction score
566
First Language
English
Primarily Uses
RMVXA
Almost verbatim there is
I don't believe this is accurate.
While it does allow specifying many cost values, I do not see it adjusting in the way the OP wants.

Imaging equipping an armor that has the tag <mpcost: 10, 50>
What should happen is that the individual skill (10) would have it's cost for casting reduced to 50%. Nothing else affected.

Yanfly's script does not have a 'MP cost rate' regex. Only a 'MP cost' regex.
That mp cost is applied to skills in order to adjust the cost for the skill outside normal parameters not to armor or weapons.

I quickly wrote a mp cost rate add on, but need to test it. However this does not allow specifying individual skills.

Working
Code:
#==============================================================================
# 
# ▼ Yanfly Engine Ace - Skill Cost Manager v1.03.1     add on
# -- Last Updated: 2019.06.06
# -- Level: Normal, Hard, Lunatic
# -- Requires: n/a
# -- add on by Roninator2
#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2019.06.06 - added on mp cost
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# -----------------------------------------------------------------------------
# Actor Notetags - These notetags go in the actors notebox in the database.
# -----------------------------------------------------------------------------
# <mp cost rate: x%>
# Allows the actor to drop the MP cost of skills to x%.
# -----------------------------------------------------------------------------
# Class Notetags - These notetags go in the class notebox in the database.
# -----------------------------------------------------------------------------
# <mp cost rate: x%>
# Allows the class to drop the MP cost of skills to x%.
# -----------------------------------------------------------------------------
# Weapon Notetags - These notetags go in the weapons notebox in the database.
# -----------------------------------------------------------------------------
# <mp cost rate: x%>
# Allows the weapon to drop the MP cost of skills to x% when worn.
# -----------------------------------------------------------------------------
# Armour Notetags - These notetags go in the armours notebox in the database.
# -----------------------------------------------------------------------------
# <mp cost rate: x%>
# Allows the armour to drop the MP cost of skills to x% when worn.
# -----------------------------------------------------------------------------
# State Notetags - These notetags go in the states notebox in the database.
# -----------------------------------------------------------------------------
# <mp cost rate: x%>
# Allows the state to drop the MP cost of skills to x% when afflicted.

module YEA
  module REGEXP
  module BASEITEM
    MP_COST_RATE = /<(?:MP_COST_RATE|mp cost rate):[ ](\d+)([%%])>/i
  end
  end
end

class RPG::BaseItem
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :mp_cost_rate
  #--------------------------------------------------------------------------
  # common cache: load_notetags_scm
  #--------------------------------------------------------------------------
  alias r2_load_notetags_scm_8237fg   load_notetags_scm
  def load_notetags_scm
    r2_load_notetags_scm_8237fg
    @mp_cost_rate = 1.0
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YEA::REGEXP::BASEITEM::MP_COST_RATE
        @mp_cost_rate = $1.to_i * 0.01
      end
    }
  end
end

class Game_BattlerBase
  def mcr#;  sparam(4);  end               # MCR  Mp Cost Rate
    n = 1.0
    if actor?
      n *= self.actor.mp_cost_rate
      n *= self.class.mp_cost_rate
      for equip in equips
        next if equip.nil?
        n *= equip.mp_cost_rate
      end
    else
      n *= self.enemy.mp_cost_rate
      if $imported["YEA-Doppelganger"] && !self.class.nil?
        n *= self.class.mp_cost_rate
      end
    end
    for state in states
      next if state.nil?
      n *= state.mp_cost_rate
    end
    return n
  end
end
 
Last edited:

IneptAttoney_08

Dimas Ridwan AP
Veteran
Joined
Mar 1, 2019
Messages
146
Reaction score
29
First Language
Indonesia
Primarily Uses
RMVXA

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
You could try this:
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,674
Reaction score
566
First Language
English
Primarily Uses
RMVXA
You could try this:
Thanks Sixth! Works fine for me. I thought about making it, but still not good enough to make my own scripts.
Seems like a simple script, but I just didn't know how to go about writing it.
The only part I did know what using $2 for the % value.

I put this between yanfly skill cost manager and my add on.
It all works and the functions can be combined.
<mp cost ex: 26, 0.5>
<mp cost rate: 50%>
for a skill with 4mp cost results in 1mp
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,034
Messages
1,018,447
Members
137,820
Latest member
georg09byron
Top