(Answered) Weapon that consumes MP for crit (Illumina).

If anyone has played Final Fantasy 6, then they're probably familliar with the Illumina weapon. I believe they renamed it to Lightbringer in the re-releases, but I don't recall.


Now aside from the Pearl/Holy proc (which I don't need), it also consumed 20 MP for a guaranteed Crit on the enemy with a regular attack, but if you were out of MP it wouldn't consume any and you won't have the guaranteed crit.


How would I go about recreating this crit weapon? I have all of Yanfly's scripts.


Alternatively a state would work for me as well since I could give the weapon the passive state.
This should do it:





Add those two notetags to the weapon

Code:
<custom critical rate>
result = a.mp >= 20 ? 1000 : -1000;
</custom critical rate>
Code:
<custom critical code>
a.gainMp(-20)
</custom critical code>

(using 1000 values  for the critical rate to ensure that the rate will not be affected by other modifiers)
I get a TypeError "Cannot read property 'flat' of null".
Just tested it and it's working, so it's probably a compatibility issue.
I can't seem to figure out which plugin it is that's causing the issue. Tried turning off everything that's not Yanfly. Still had an issue. Turned off a few of the yanfly plugins that I thought may have been the issue, and still had the issue. Think I'm going to have to pass on this plugin. It looks great, but if it's having some compatibility issues with core Yanfly plugins I won't be able to use it.


Thanks anyway, Victor.


Is there another way to accomplish this?


Maybe changing note-tags on the "attack" skill to have the same result based on if that weapon id is equipped?
There's more than a few ways you can go about this.


I would use Yanfly's "Weapon Unleash" and "Critical Control"


The following tag can go wherever you want. It'll probably work best under Actors though. This tag will check to see which skill/attack the actor will use based on the actor's remaining MP. If it's more than 20, it'll use skill ID #3, if not, it'll use the standard attack skill.


<Custom Replace Attack>
if (user.mp > 20) {
id = 3;
} else {
id = 1;
}
</Custom Replace Attack>




The next tag can go in the duplicate Attack skill that will always be a critical. In this case, Skill #3. Make sure to set the MP cost of this attack to 20 (or whatever you want the cost to be)


<Critical Rate: 1000%>




I haven't had a chance to test this (I'm on break, and bored...) But it should work. Let me know how it goes.
There's more than a few ways you can go about this.


I would use Yanfly's "Weapon Unleash" and "Critical Control"


The following tag can go wherever you want. It'll probably work best under Actors though. This tag will check to see which skill/attack the actor will use based on the actor's remaining MP. If it's more than 20, it'll use skill ID #3, if not, it'll use the standard attack skill.



<Custom Replace Attack>
if (user.mp > 20) {
id = 3;
} else {
id = 1;
}
</Custom Replace Attack>




The next tag can go in the duplicate Attack skill that will always be a critical. In this case, Skill #3. Make sure to set the MP cost of this attack to 20 (or whatever you want the cost to be)



<Critical Rate: 1000%>




I haven't had a chance to test this (I'm on break, and bored...) But it should work. Let me know how it goes.

That worked perfectly for me as I already use Yanfly's Weapon Unleash. Thank you very much!

Original thread: https://forums.rpgmakerweb.com/threads/answered-weapon-that-consumes-mp-for-crit-illumina.60879/