So I was thinking how to make a state which heals MP to the party except user when the user spends MP for a spell. Henceforth, I used Yanfly's Reverence code as a reference. This code in particular.
It works beyond perfect so I and the good people willing to help with the issue made these changes.
After that point, it goes out of control. The only thing I did was adding the party member count but it gives a Syntax Error. I have been facing this issue for a long time before I finally decided to post here so if anyone would help me with the issue I would be glad.
<Custom Action Start Effect>
// Get the user's current HP.
user._reverenceMp = user.mp;
</Custom Action Start Effect>
<Custom Initiate Effect>
// Check if the stored MP value exists.
if (user._reverenceMp !== undefined) {
// If it does, calculate the difference between the user's initial MP and the user's current MP after the cost.
var difference = user._reverenceMp - user.mp;
// Check if the difference is greater than zero...
if (difference > 0) {
// If it is, calculate the amount of HP healed.
var hp = Math.ceil(difference * 20.00);
// Make the user gain that HP.
user.gainHp(hp);
// Play a damage popup.
user.startDamagePopup();
// Clear the damage results.
user.clearResult();
}
user._reverenceMp = undefined;
}
</Custom Initiate Effect>
// Get the user's current HP.
user._reverenceMp = user.mp;
</Custom Action Start Effect>
<Custom Initiate Effect>
// Check if the stored MP value exists.
if (user._reverenceMp !== undefined) {
// If it does, calculate the difference between the user's initial MP and the user's current MP after the cost.
var difference = user._reverenceMp - user.mp;
// Check if the difference is greater than zero...
if (difference > 0) {
// If it is, calculate the amount of HP healed.
var hp = Math.ceil(difference * 20.00);
// Make the user gain that HP.
user.gainHp(hp);
// Play a damage popup.
user.startDamagePopup();
// Clear the damage results.
user.clearResult();
}
user._reverenceMp = undefined;
}
</Custom Initiate Effect>
It works beyond perfect so I and the good people willing to help with the issue made these changes.
<Custom Action Start Effect>
// Get the user's current HP.
user._reverenceMp = user.mp;
</Custom Action Start Effect>
<Custom Initiate Effect>
// Check if the stored MP value exists.
if (user._reverenceMp !== undefined) {
// If it does, calculate the difference between the user's initial MP and the user's current MP after the cost.
var difference = user._reverenceMp - user.mp;
// Check if the difference is greater than zero...
if (difference > 0) {
for(i=0; i < $gameParty.size()){
if(user.actorId() !== $gameParty.members().actorId()){
var member = $gameParty.members();
var mp = Math.ceil(difference * 0.25);
member.gainMp(mp);
member.startDamagePopup();
member.clearResult();
}
}
}
}
</Custom Initiate Effect>
// Get the user's current HP.
user._reverenceMp = user.mp;
</Custom Action Start Effect>
<Custom Initiate Effect>
// Check if the stored MP value exists.
if (user._reverenceMp !== undefined) {
// If it does, calculate the difference between the user's initial MP and the user's current MP after the cost.
var difference = user._reverenceMp - user.mp;
// Check if the difference is greater than zero...
if (difference > 0) {
for(i=0; i < $gameParty.size()){
if(user.actorId() !== $gameParty.members().actorId()){
var member = $gameParty.members();
var mp = Math.ceil(difference * 0.25);
member.gainMp(mp);
member.startDamagePopup();
member.clearResult();
}
}
}
}
</Custom Initiate Effect>
After that point, it goes out of control. The only thing I did was adding the party member count but it gives a Syntax Error. I have been facing this issue for a long time before I finally decided to post here so if anyone would help me with the issue I would be glad.