Elemental Weaknesses Give States

I am currently in the middle of making a game, and I thought of everything, from battle systems to the story.
Now, there's something I want to have in battle. Kinda dumb but.....

I want elemental weaknesses to gives states. An example of this is from the Persona series, when the enemy is hit with it's weakness it gives them the state "Down." How do I achieve that in RMMV?

If there's a plugin for this, would you send me the link? I've looked everywhere but still no luck

Thanks
you can do this by damage coding - in the damage formula you need to add a condition that checks if the target is weak against that skills element, and if yes add the state.
you can do this by damage coding - in the damage formula you need to add a condition that checks if the target is weak against that skills element, and if yes add the state.
Tell me how, please? I'm kind of a noob in this ;D
This thread contains the answer for how to do it with code in Ace (so that you don't need to do a long check in every single formula), so you might find some hints there about how to make the change in MV. Of course, you'll need different syntax in MV, and the method will probably have a slightly different name.
This thread contains the answer for how to do it with code in Ace (so that you don't need to do a long check in every single formula), so you might find some hints there about how to make the change in MV. Of course, you'll need different syntax in MV, and the method will probably have a slightly different name.

Okay, thanks Wavelength! But y'know, I don't really know anything about coding, help me out please? ;D
your quickest method to get an answer to this would probably be on the javascript boards.
your quickest method to get an answer to this would probably be on the javascript boards.
Thanks, I'll try posting in the javascript section. Wait, is that allowed though? Won't it be treated as spam?
You can post questions like this on "Learning JavaScript". It's not spam to do so, you're fine.

P.S. - I do know JS, but I'd have to dig through the code base to figure out exactly what the correct changes would be in MV, which would take me a while to do. Some people at the Learning JS board are likely to know the answer offhand, which is why I'd prefer you get your answer there. But if you ask and you haven't gotten an answer within a week or two, feel free to PM me and I will find the answer for you.
You can post questions like this on "Learning Javascript". It's not spam to do so, you're fine.
Will do, thanks!
stick it in the quick javascript thread as opposed to making a new one.

https://forums.rpgmakerweb.com/inde...ons-that-dont-deserve-their-own-thread.46341/

Most the scripters and guys who are good with js will check that more often than here.
Your damage formula code will look something like.. my js is terrible but something like the following.

if (b.elementRate(1) > 1) { //here the (1) is the number of the element. so 1 might be fire, than if fire rate > 1 do
(100 + a.mat * 2 - b.mdf * 2) //regular magic damage plus
b.addState(10); 100} // add state (10) - add state 10, with 100% chance of landing.
else { // else basically means if the top statment is not greater than 1
100 + a.mat * 2 - b.mdf * 2} //just do basic magic damage formula.
stick it in the quick javascript thread as opposed to making a new one.

https://forums.rpgmakerweb.com/inde...ons-that-dont-deserve-their-own-thread.46341/

Most the scripters and guys who are good with js will check that more often than here.
Your damage formula code will look something like.. my js is terrible but something like the following.

if (b.elementRate(1) > 1) { //here the (1) is the number of the element. so 1 might be fire, than if fire rate > 1 do
(100 + a.mat * 2 - b.mdf * 2) //regular magic damage plus
b.addState(10); 100} // add state (10) - add state 10, with 100% chance of landing.
else { // else basically means if the top statment is not greater than 1
100 + a.mat * 2 - b.mdf * 2} //just do basic magic damage formula.

Thanks dude, you've been a great help!
@Raijinn - I figured it out for you that code is almost correct. heres a working version.

if (b.elementRate(2) > 1) {100 + a.mat * 2 - b.mdf * 2 + b.addState(4); 100} else {100 + a.mat * 2 - b.mdf * 2}

On that line it says if targets element rate for fire (fire) is over 100% than do damage and add poision (state 4)
else just do regular damage.

Just change the elementRate(x) to whatever elemet you want, and change the addState(y) to the state id number, you can also change the ;100 to any number to change the odds. Eg.. 50 will make it a 50/50 chance, 75 will make it 3 outta 4 times etc..

Original thread: https://forums.rpgmakerweb.com/threads/elemental-weaknesses-give-states.78818/