Hello, I need help with something, I'm making a stat works like Serene grace from Pokemon games, those who are not familiarized with this state, well... It increases the probability to add a state of an attack, for example: There is an attack can make some damage and has a 20% to add the "confuse" state, but with Serene grace, this attack now has a 40% to add the same state
Thanks to Waterguy to make this one, he could solve it of this way
class Game_Battler < Game_BattlerBase
def custom_damage_state(a, b, state, state_chance, damage)
chance = state_chance
chance *= b.state_rate(state)
chance *= b.luk_effect_rate(a)
chance *= 2 if a.state?(41)
b.add_state(state) if rand(100) <= chance
damage
end
end
It works perfectly, but now I want to make the same to make an attack adds a parameter buff/debuff with an attack, can someone adapt this formula to make this possible? Thank you
Serene grace state with buff/debuff parameters
● ARCHIVED · READ-ONLY
-
-
BUMP
-
I think this is the method you're looking for in Game_Battler.
#-------------------------------------------------------------------------- # * [Debuff] Effect #-------------------------------------------------------------------------- def item_effect_add_debuff(user, item, effect) chance = debuff_rate(effect.data_id) * luk_effect_rate(user) if rand < chance add_debuff(effect.data_id, effect.value1) @result.success = true end endSo just do the same thing as you mentioned in your first post: add the chance *= 2 if a.state?(x) line right after chance is calculated. -
Sorry, I didn't get it, would you mind to make that for me? That thing confuses me still :S
-
OK...
Code:#-------------------------------------------------------------------------- # * [Debuff] Effect #-------------------------------------------------------------------------- def item_effect_add_debuff(user, item, effect) chance = debuff_rate(effect.data_id) * luk_effect_rate(user) chance *= 2 if a.state?(42) if rand < chance add_debuff(effect.data_id, effect.value1) @result.success = true end end -
Let's see, to become that in a damage formula (because I see this damage formula and I don't see this (a, b, state, state_chance, damage) so I can asume it's not made to become it in a damage formula) It'd be like this:
class Game_Battler < Game_BattlerBase
def debuff_custom_damage(a, b, debuff, debuff_rate, damage)
chance = debuff_rate(effect.data_id) * luk_effect_rate(user)
chance *= 2 if a.state?(51)
b.add_debuff(effect.data_id, effect.value1) if rand(100) <= chance
damage
end
end
I don't know how to add the parameter I want to be debuffed there, any idea? -
This state affects all debuffs that the battler would inflict on enemies, not just debuffs from a single skill, right?
Just replace the method in Game_Battler with the one I gave you. You don't need to do anything with formula boxes. -
That'll add a buff/debuff even if the attack doesn't do any damage, right?
-
Ok, it's solved, sorry by not answering that before, I have been busy, but it works