I can use the event command to add the 30 points, but i have to remove the 30 points manually. It's difficult to do with multiple states that may be cast multiple times. That's why I'm hoping for a simple solution, which probably doesn't exist. For example a script command (?) in rpg maker mz.
Yep, that'll need a plugin.
ExternalPlugins:
I don't want any rights issues.
Obey the terms of use? Copyright applies to all original content unless the creator explicitly forfeits that right. But even if the content is copyrighted, the terms may allow derivative works or edits. The MIT license is a common example of this:
opensource.org
Also, I don't want to be to dependent on other programmers/scripters.
For example, I implemented passive abilities in my game such as fixed poison damage or mirror, which shoots back some of the damage an actor receives. If I wish for changes here - for example that values such as LUK changes the probability the passive skill to trigger, I can add the changes independently.
So you just need to know how to edit it (and have permission to do so), then it's all good?
I wrote a plugin (attached). Terms of use are my usual for little things like this:
Free to use and/or modify for any project, no credit required.
Here's the code, for reference:
Spoiler: plugin code
JavaScript:
/*:
* @target MZ
* @plugindesc Add flat values for basic params from states.
* @author Caethyril
* @url https://forums.rpgmakerweb.com/index.php?threads/152847/
* @help State notetag:
* <add param X: Y>
* - replace X with the param ID (see below);
* - replace Y with the flat bonus to add when affected by this state.
* - e.g. <add param 2: 5> = +5 ATK
* e.g. <add param 6: -10> = -10 AGI
*
* Basic param IDs:
* 0 - Max HP 4 - MAT
* 1 - Max MP 5 - MDF
* 2 - ATK 6 - AGI
* 3 - DEF 7 - LUK
*
* Free to use and/or modify for any project, no credit required.
*/
void (() => {
'use strict';
const getBonus = function(obj, paramId) {
const tagName = 'add param %1'.format(paramId);
return parseInt(obj.meta?.[tagName] || 0, 10);
};
const alias = Game_BattlerBase.prototype.paramPlus;
Game_BattlerBase.prototype.paramPlus = function(paramId) {
const bonus = this.states().reduce(
(a, c) => a + getBonus(c, paramId)
, 0);
return alias.apply(this, arguments) + bonus;
};
})();
This adds an extra value to a battler's
paramPlus value, based on the notetags on the states that are currently affecting that battler.
paramPlus is used by the core scripts to determine a basic parameter's current value: (base + plus) * rate * buffRate.
(Notetags are entered as text in the Note field of a database record.)