Hi guys. I came here cause i need help with 2 things.
"Things" 1:
I want to cap the stats of the actors. Basically, i can set the actor stats for different level in the database BUT the cap is 9999 for hp/sp and 999 for the other stats. Let's take an example; Actor 1 has a minimum of INT of 50 and MAX 500. Actor 1 can always use ton of seed of inteligence to increase his stats to 999, THIS IS EXACTLY WHAT I DON'T WANT! I would like to cap his intelligence at (for example) 750.
I have check the default script and i have been able to set the cap i want, everything is found in "Game_Battler 1". Intelligence stats are as follows by default:
#--------------------------------------------------------------------------
# * Get Intelligence (INT)
#--------------------------------------------------------------------------
def int
n = [[base_int + @int_plus, 1].max, 999].min
for i in @states
n *= $data_states[i].int_rate / 100.0
end
n = [[Integer(n), 1].max, 999].min
return n
end
and i have change it into this to cap INT at 750
#--------------------------------------------------------------------------
# * Get Intelligence (INT)
#--------------------------------------------------------------------------
def int
n = [[base_int + @int_plus, 1].max, 750].min # Moded
for i in @states
n *= $data_states[i].int_rate / 100.0
end
n = [[Integer(n), 1].max, 750].min # Moded
return n
end
As i said, it works and i have been able to set a cap BUT when i scroll a little in the "Game_Battler 1", i found this:
#--------------------------------------------------------------------------
# * Set Intelligence (INT)
# int : new Intelligence (INT)
#--------------------------------------------------------------------------
def int=(int)
@int_plus += int - self.int
@int_plus = [[@int_plus, -999].max, 999].min
end
I have not change the value since the 750 cap is working. I just want you guys to confirm me that i have do everything right, if there is something wrong then tell me and point me where i should modified in order to implement stats cap.
"Things" 2:
I wanted to know what are the normal attack damage formula and skill damage formula but the help file is too vague and didn't really help me. So, after searching the default script inside out i pin pointed where the formula was; in the "Game_Battler 3". I have been able to understand the normal attack damage formula but the skill damage formula is a pain. Here is the code for the skill damage formula:
# Calculate power
power = skill.power + user.atk * skill.atk_f / 100
if power > 0
power -= self.pdef * skill.pdef_f / 200
power -= self.mdef * skill.mdef_f / 200
power = [power, 0].max
end
# Calculate rate
rate = 20
rate += (user.str * skill.str_f / 100)
rate += (user.dex * skill.dex_f / 100)
rate += (user.agi * skill.agi_f / 100)
rate += (user.int * skill.int_f / 100)
# Calculate basic damage
self.damage = power * rate / 20
With the almost no knowledge of RGSS i have tried to rewrite the formula in a simple math form, the result is as follows:
1) Power:
Skill Power + User Attack * Skill AttackF / 100
- Target Pdef * Skill PdefF / 200
- Target Mdef * Skill MdefF / 200
2) Rate:
20 + (User str * Skill StrF / 100)
+ (User dex * Skill DexF / 100)
+ (User agi * Skill AgiF / 100)
+ (User int * Skill IntF / 100)
Final damage will be calculated as follows = Power * Rate / 20
Now the problem is when i applied the formula and make a test battle, things don't turn out well. The damage is much more than i calculated. The skill i used was Spiral Blade(skill 60) and i have set variance to 0. Also, no element damage are set. I would like to know whether my rewritten formula is right; if not then please can anybody tell me the formula for Skill Damage?
It was lot of reading but i hope that someone might come to my rescue.
Thanks for your time and patience,
SBS
P.S: I don't know much about RGSS but i trying to learn 1-2 thing so(and maybe later write some script
), please don't be hard on me