Eval Collection: Recover Magic (Runes of Magic)

sp_mag_001

Recover Magic is a mage skill from Runes of Magic. When used, the caster has a chance to regain MP whenever he expends MP for the next few turns.

Requirements:

♦ YEP_BuffsStatesCore.js

 

  1. First, create the Recover Magic skill. Make it add your Recover Magic state.
  2. In your Recover Magic state’s notebox add this:

 


<Custom Confirm Effect>
if (this.item().mpCost > 0) {

// Chance of recovering MP. Default = 25%
var chance = 0.25
// The amount of MP recovered. Default 5% MaxMP + 35.
var mpRecover = user.mmp * 0.05 + 35

if (Math.random() < chance) {
user.gainMp(Math.floor(mpRecover));
user.startDamagePopup();
user.clearResult();
};
};
</Custom Confirm Effect>

Please read my comments. They will tell you all important things.

Advertisements

2 thoughts on “Eval Collection: Recover Magic (Runes of Magic)

Write a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s