So at some point I decided that getting stat bonus items would be needed - getting HP and other stats to work was simple enough but once I got to dealing with MP I started pulling hairs.
Most people would stop at simply boosting the max value, but I want to make sure that the player also changes their current MP by the same amount boosted. The weird thing is that the script I tried does not work the same way it did for HP, and I spent quite a bit of time looking at references. For those wondering, I'm trying to do the same thing the Dragon Quest series did with stat boosting items.
The best way to describe the issue is that I can get the script to put in text how much it boosts Max MP by and actually doing it but it does NOT change the current MP by that same amount. Either I'm using the wrong syntax or $gameParty._targetActorId doesn't get taken correctly when it comes to battler.gainMP.
Script in question for reference:
The last line is the problem, so if someone has advice I'd appreciate it - just let me know if anything else is needed.
Most people would stop at simply boosting the max value, but I want to make sure that the player also changes their current MP by the same amount boosted. The weird thing is that the script I tried does not work the same way it did for HP, and I spent quite a bit of time looking at references. For those wondering, I'm trying to do the same thing the Dragon Quest series did with stat boosting items.
The best way to describe the issue is that I can get the script to put in text how much it boosts Max MP by and actually doing it but it does NOT change the current MP by that same amount. Either I'm using the wrong syntax or $gameParty._targetActorId doesn't get taken correctly when it comes to battler.gainMP.
Script in question for reference:
var randomStat2 = Math.randomInt(5)+1;
var user = $gameActors.actor($gameParty._targetActorId);
$gameVariables.setValue(12, randomStat2);
user.addParam(1, randomStat2);
user.gainMP(randomStat2);The last line is the problem, so if someone has advice I'd appreciate it - just let me know if anything else is needed.