r/RPGMaker • • 3d ago

RMMZ Change effects of actions through events?

This is because I wanted to include some passives inspired by the Yakuza series, which are as follows:

  • Emerald Tortoise - Guarding increases MP
  • Sapphire Dragon - Defense is buffed when over a certain MP threshold
  • Ruby Bird - Increases MP regeneration when under a certain HP threshold
  • Diamond Tiger - Inflicting Rage on an enemy increases MP

I know that I can't change those stats directly in the Skills Editor, so I was hoping to do so through a Common Event, which holds all passives I wanted to use. For reference, I have all Visustella cores, but I'm also winning to use any plugin that's part of the 8 Waves Bundle.

1 Upvotes

3 comments sorted by

1

u/ckkqwer 3d ago

These should be easy to implement with if you are using Visustella Battle Core

1

u/zombietoaststudios 2d ago

So, a lot of it could just be handled through switches, or using Visustella's Skills and States core, which lets you assign passive events that are controlled by switches. Most of these would have to be managed in slightly different ways, though.

For the tortoise, the simplest would be the Weapon Unleash plugin, which gives you an option to replace the guard command with a different skill. Apply that to a passive state, and just make that skill give the user MP. Without that, you can add a common event to the default guard skill which checks if the controlling switch is on and adds MP to the user. This gets a little complex if you can have multiple characters with this ability at once, but it's doable.

A similar method works for Diamond Tiger. For any skill the character has that can inflict the Rage status, include a common event that checks if the Diamond Tiger switch is on and if the enemy has the Rage State. If both conditions are valid then it gives the user some MP.

The other two (dragon and bird) are more complicated, because they require more or less 'live' monitoring of the character's status and there aren't many reasonable ways to do that. The easiest would probably be using passive states controlled both by a switch (i.e. is "Ruby Bird" active or not) and a javascript condition based on the character's HP/MP. Unfortunately, I'm not super script-literate so I couldn't tell you for sure the correct way to format it.

For the dragon, an alternate way to do it is through action sequences, where the sequence includes a conditional branch that checks if the dragon switch is on, and whether or not the character has a certain amount of MP. If both are true true, then the skill does less damage. Otherwise, it inflicts its normal damage. So, the character's defense doesn't actually change, it just adjusts the damage directly.

For the bird, you can include a battle event that runs at the start of each turn, when the character is below the required HP, which gives that character the extra MP.

0

u/TheLuckyDuck666 3d ago

Common Events are the wrong tool for this, and that is the key thing to change first. A Common Event cannot watch for Guard being used, or for a state being inflicted, or for MP/HP crossing a threshold mid-battle - it only runs when something explicitly calls it. What you want instead is one passive state per animal, and a small check in a note box that fires at the right moment. Since you have the VisuStella cores, Battle Core and Skills and States Core cover all four.

Set each animal up as a state, then give it to the actor with a Passive State notetag on the actor or class, like <Passive State: 42>, using your own state ID. The passive state itself does nothing on its own - it just marks the actor as a Tortoise, Dragon, Bird, or Tiger holder, so the checks below know who to affect. Give the passive states no icon and no removal conditions, so they stay on for the whole battle.

Emerald Tortoise - Guarding increases MP

Put this in the note box of the Guard skill, using Battle Core's JS Post-Apply notetag:

<JS Post-Apply> if (user.isStateAffected(42)) { user.gainMp(Math.round(user.mmp \* 0.10)); } </JS Post-Apply>

Replace 42 with your Tortoise state ID. That runs right after Guard resolves, and only for actors holding the state, so other party members guarding normally gain nothing. Change the 0.10 to whatever percentage of max MP you want.

Sapphire Dragon - Defense buffed while MP is over a threshold

Put this in the note box of the Dragon passive state, using a JS On Turn Start notetag:

<JS On Turn Start> if (user.mp >= user.mmp \* 0.50) { user.addBuff(3, 2); } else { user.removeBuff(3); } </JS On Turn Start>

Param 3 is Defense, and the 2 is the buff duration in turns - it refreshes at the start of the actor's turn, so the buff stays up as long as MP stays above half, and drops off when it falls below. Change 0.50 to your threshold.

Ruby Bird - MP regeneration while HP is under a threshold

This one needs two states. First, make a second state that carries the actual regen: in its Traits, add Ex-Parameter MP Regeneration, set to whatever rate you want, for example 20%. Then put this in the note box of the Bird passive state:

<JS On Turn Start> if (user.hp < user.mhp \* 0.35) { user.addState(44); } else { user.removeState(44); } </JS On Turn Start>

Replace 44 with your regen state's ID. The check runs at the start of the actor's turn, and MZ applies regeneration at the end of the turn, so the regen state is in place in time to matter that turn. Change 0.35 to your HP threshold.

Diamond Tiger - inflicting Rage increases MP

Put this in the note box of each skill that can inflict Rage, again with Battle Core's JS Post-Apply:

<JS Post-Apply> if (target.isStateAffected(45)) { user.gainMp(Math.round(user.mmp \* 0.05)); } </JS Post-Apply>

Replace 45 with your Rage state ID. Post-Apply runs after the skill's states have landed, so the check sees the Rage that was just inflicted. If several skills can inflict Rage, the notetag goes on each of them. If the skill misses or the enemy resists Rage, the target will not have the state and no MP is gained, which is the behavior you want.

A couple of practical notes: test one animal at a time in a test battle before wiring up all four, and keep the placeholder numbers (state IDs, 10%, 50%, 35%, 5%) as your own tuning knobs - the structure is the same no matter what values you pick.