I've been looking around, as I somehow remember to have read something close to what I want somewhere, but I can't find it for the life of me.
I have a "thief" class in a project of mine, and one of the skills she have, is a "hide" skill, which hides the thief, and opens up for a different set of skills.
The hide skill is linked to a state, and works as intended,which last 2 rounds, 1 for the usage of the hide skill, and one to perform the next attack, while under "hide".
One of the new skills or attacks the thief gets, is one called "quick attack" which I want to deal a bit of damage, and possible extend the time of hide, by reapplying the state again.
The basic formula I worked towards, by reading a few guides and such, looks like this:
c=1+rand(2); if c==1; a.add_state(5); 0 + a.atk * 4 - b.def * 2 ;end;
But it's not working as intended
State(5) is the hide state in this case.
Is there anyone that could help me out with this by any chance?
Damage formula help
● ARCHIVED · READ-ONLY
-
-
You'll need a script to set it up so that if the state is already present, it restarts (or adds time to) the state. By default, the engine will not apply a state that is already present, so you will need a script to override it. I know Yanlfy has one that does this (Look for Yanfly buff and state manager), but there are probably others you can use.
-
Thanks for answering mate, but that's actually not quite correct.
I got the
c=1+rand(2); if c==1; a.add_state(5);end;to extend the period of the state in about 50% of the times, without the use of a script. :)
But I can't seem to get it to add damage to the attack as well, by adding
a.atk * 4 - b.def * 2Edit:
By doing:
a.add_state(5); a.atk * 4 - b.def * 2 it applies the damage and the state, even while it's active, and thus extending it.By doing:
c=1+rand(2); if c==1; a.add_state(5); a.atk * 4 - b.def * 2;end;It only applies the state 50% of the times, as I more or less want, but it also only applies the damage if it applies the state, I want the damage applied on every successful hit.
Hope that makes sense. :) -
it should be
Code:Basically, on your original formula, the damage was still inside the if clause...c=1+rand(2); if c==1; a.add_state(5);end; a.atk * 4 - b.def * 2 -
You can shorten that to
Code:if 1+rand(2)==1; a.add_state(5);end; a.atk * 4 - b.def * 2 -
you dont even need the 1+ in front of the rand.
-
Engr. Adiktuzmiko, and Shaz, thanks a lot for the replies.
That's me in a nutshell, thank you very much for clearing that, much appreciated. :)Basically, on your original formula, the damage was still inside the if clause...
Cypher, I didn't know that, the formula I found to have a random effect had the +1 in front of the rand.
But again, thanks a lot everyone for answering. :) -
Yeah, rand(2) would give you 0 or 1. 1+rand(2) would give you 1 or 2. In both cases, you have a 50% chance of the result being 1 ;)
-
You learn something new everyday. :)
Thanks again everyone.