Discussion in 'RPG Maker MV' started by omfgkevin, Nov 2, 2015.
How would I make a skill apply a buff to yourself once you hit an enemy?
You need to use the Formula damage box, using the function addState(state_id)
Example, apply state 4 on the user when attack an enemy:
a.addState(4); a.atk * 4 - b.def * 2;
a is the user, b is the target, so, you can apply to the user a buff, debuff or state. But you must add de state BEFORE the damage formula, or will be ignored.
If you don't want the buff afects dagame in this round, then you need to use a third variable.
dmg = a.atk * 4 - b.def * 2; a.addState(4); dmg;
This way, you store the damage value in the dmg variable, then apply the state, then apply damage.
YOu can use also addbuff(paramId, turns) or addDebuff(paramId, turns), like:
dmg = a.atk * 4 - b.def * 2; a.addBuff(2,4); dmg;
This one adds attack buff for 4 turns.
The ID list is:
0 Maximun HP
1 Maximum MP
4 Magic Attack
5 Magic Defense
Damage must be deal the last, or all the code after will be ignored. Separate each function with ;
The way I did this exact thing in VX Ace was i used the effects for call a common event that "Force Action" into using a buff skill with the same name. This works for MV too, I just tried it.
So basically it's 2 different skills liked together. And you have a lot more range in what the buff skill does exactly this way.
But the formula method works too.
Thanks for this detailed explanation! Helps out a lot!
Actually, this works perfectly on single target skills. But do note that if you use such formula in a skill that targets all, the main target (the one that you selected) will receive damage without the buff and the remaining targets will take buffed-up damage.
The buff is applied as soon as the main target is damaged. Since each target damage is calculated separately, the buff will likely re-apply for each additional target.
Reason I said 'likely' is because I've tried this with states instead of buffs, but I believe they should work the same way.
Hope this helps!
Is it possible to have an attack that only does damage or does more damage if the target is affected by a state. For example if a formula for an attack that only does damage if a target is poisoned or one that does double damage if its affected by a state.
Please do not hijack someone else's thread with a different question.
There is a thread which deals specifically with general questions about the damage formula, and I'm fairly sure that your question has already been answered there.
And if i want to buff the entire party with a single attack skill?
For example my hero use "insertnameskill" on enemy and then after the damage this skill leave a buff or heal my entire party for a few turns.
Please do not hijack someone else's thread with your own query.
It might be an idea to look at the MV Damage Formula thread which already has a lot of content. If you don't find what you are looking for, post your query there.
You can find that thread here http://forums.rpgmakerweb.com/index.php?/topic/47099-rmmv-damage-formula-ideas-and-help/
If you wanted to make add a percent chance to whether or not the state would be applied, how would you write that?
EDIT: Wait nevermind, this should be it's own thread
Separate names with a comma.