Weapon has 50% of also casting spell

Do you guys remember the sword Ragnarok from FF6? It would attack like normal, then have about a 50% chance of ALSO casting Flare. I think the Fire, Ice, and Bolt rods in the game would do the same for Fire II, Ice II, and Lit II.

I can't figure out a way to do this in MV. Is there a plugin for this? A work-around? Yanfly has a "weapon unleash" script, but that changes your attack command into the extra powerful attack. I don't want that, I want the weapon to work like normal, but randomly it casts a spell too.

Thank you for any help!
How about using parallel common event that check whether the character have that particular weapon?

When the character equip the weapon, the common event will activate a switch (ex: Weapon Magic). This switch will then be used in battle event.

If the switch is on, then the battle event will run RNG at 50% chance to execute magic skill.
I can't figure out a way to do this in MV. Is there a plugin for this? A work-around? Yanfly has a "weapon unleash" script, but that changes your attack command into the extra powerful attack. I don't want that, I want the weapon to work like normal, but randomly it casts a spell too.
Yanfly's Weapon Unleash plugin would have been my suggestion. Are you sure you're using the <Weapon Unleash x%: y> notetag, as opposed to <Replace Attack: x>? E.g.
Code:
<Weapon Unleash 50%: Flare>
Edit: oh I didn't realise the unleash totally replaces the current attack, that's disappointing. 😔
I think he means he wants the sword to attack in addition to casting a spell, where Yanfly's thing replaces attack with the spell effect when it triggers. While not perfect, the only way you can do that without some extra plugin coding is to make a separate skill with an attack + flare (or whatever) animation that combines both the attack damage component and the magic damage component in the formula box. The only drawback is that it'll deal the total damage in one lump sum rather than once from the attack and again from the spell damage.
The only drawback is that it'll deal the total damage in one lump sum rather than once from the attack and again from the spell damage.
If you used it as normal attack and battle event (through force skill), you could separate the attack.
First off, thank you everyone for your help!

How about using parallel common event that check whether the character have that particular weapon?

When the character equip the weapon, the common event will activate a switch (ex: Weapon Magic). This switch will then be used in battle event.

If the switch is on, then the battle event will run RNG at 50% chance to execute magic skill.

Not a bad idea, but I tried that. In the common event force action, the "subject" has to be a specific actor. If they had an "active character" or something, that would have worked. :-(

I think he means he wants the sword to attack in addition to casting a spell, where Yanfly's thing replaces attack with the spell effect when it triggers. While not perfect, the only way you can do that without some extra plugin coding is to make a separate skill with an attack + flare (or whatever) animation that combines both the attack damage component and the magic damage component in the formula box. The only drawback is that it'll deal the total damage in one lump sum rather than once from the attack and again from the spell damage.

That might work, but even though the result would be the same... it's not what I want. lol.

How about using parallel common event that check whether the character have that particular weapon?

When the character equip the weapon, the common event will activate a switch (ex: Weapon Magic). This switch will then be used in battle event.

If the switch is on, then the battle event will run RNG at 50% chance to execute magic skill.

This might work. I didn't think of doing a common event with conditional branches for the actor having the weapon equipped. How do you call a common event after the weapon hits though?
Gonna experiment with it now.
EDIT: Experimenting... if I can just get a weapon to call a common event after it is used I can make this work.

Any more ideas if that doesn't work? I'll report back if it does.
How do you call a common event after the weapon hits though?
The trick is actually by having the switch already activated during battle. The common event will run in parallel when you equipped the sword, and it will activate the switch. In other words, it run outside of battle.

During the battle, what would actually run the effect is the switch.

1st, make a battle event that runs every turn, with the switch being active as precondition. If you're using test battle on game database, you need to set turn 0 to activate the switch (don't forget to delete during actual game).

2nd, use a variable and generate its value using random number to determine the 50% chance.

3rd, make a conditional branch. If the variable value is greater than 50, then use force skill on the character to cast the magic. If same or lesser than 50, then nothings happens.

What I expect to happen is that whatever the character is doing on the turn, whenever the variable got 51 or above, the character will do a second action that cast the magic attack.
Here's a quick way to set this up if you still need help.

Use the "Weapon Skill" plugin. I think you have this by default.
FHtOyA2.png


Next create a skill to serve as the weapon's standard attack.
dFI0cdY.png


Next place the "Weapon Skill" plugin's notetag in the note box of the weapon.
UR8MA3E.png


Create the common event that will execute the 2nd "special" attack.
Mx3iWCC.png


Place the common event in the "Effect" box of the skill serving as the weapon's standard attack.
DL43PKl.png


Mind you this setup will only work properly if the weapons are character exclusive. It'll get all messed up is other characters can use the same weapons. If the weapons aren't character exclusive it'll require a little more setup to work correctly.
Thank you again for all of your help, everyone!

Here's a quick way to set this up if you still need help.

Use the "Weapon Skill" plugin. I think you have this by default.

Mind you this setup will only work properly if the weapons are character exclusive. It'll get all messed up is other characters can use the same weapons. If the weapons aren't character exclusive it'll require a little more setup to work correctly.

Okay... I figured it out. It's working, but it was VERY round-about. BlackGoldSaw's method is probably WAY better and I'll try switching to it.

If you're curious, how I figured it out is like this...
The magic weapons add an invisible status effect something like "Ice Spell Attacks." It also has a 50% chance of adding an invisible "Ice Spell Coming" status effect when it hits an enemy.
Every troop has an event that lasts all battle and triggers at the end of the round. I set up conditions for if a character has the "Ice Spell Attacks", AND an enemy has the "Ice Spell Coming" status effect, it triggers and does the magic.

It's clunky, but it works for now. However, I'll probably be implementing BalckGoldSaw's method when I get home from my day job.

Solved! Thank you everyone!

Original thread: https://forums.rpgmakerweb.com/threads/weapon-has-50-of-also-casting-spell.105272/