Issue Information
-
#006617
-
0 - None Assigned
-
Started
Issue Confirmations
-
Yes (0)No (0)
Add max possible input values on integer arguments
Posted by Hercules Bot on 03 September 2012 - 04:57 PM
Originally posted by suza12
Not every single one though, just the important ones.
Its for a more accurate documentation.
here is an example from rathena/doc/item_bonus.txt
bonus2 bSkillCooldown,s,x; Increases cooldown of skill s by x milliseconds. (supports skill names.) range:-32768<x<32767
Since I didn't know beforehand in the src the bonus value was declared "short val;" it would only be given a range of -32768ms to 32767ms at a time. I always thought it was not working until I investigated it thoroughly, I almost tried posting it as an issue.
It might be a tedious task, and it might just be a small help at all, but adding it will give more accurate info on how to use functions.
Not every single one though, just the important ones.
Its for a more accurate documentation.
here is an example from rathena/doc/item_bonus.txt
bonus2 bSkillCooldown,s,x; Increases cooldown of skill s by x milliseconds. (supports skill names.) range:-32768<x<32767
Since I didn't know beforehand in the src the bonus value was declared "short val;" it would only be given a range of -32768ms to 32767ms at a time. I always thought it was not working until I investigated it thoroughly, I almost tried posting it as an issue.
It might be a tedious task, and it might just be a small help at all, but adding it will give more accurate info on how to use functions.
Originally posted by Akkarin
I think it will be worth doing for some of them.
It's on my to-do list!
I think it will be worth doing for some of them.
It's on my to-do list!
Originally posted by suza12
Thanks, I hope to see it in updates soon
I guess this is the kind of task w/c needs to be done one at a time.
Thanks, I hope to see it in updates soon
// here start arrays to be globally zeroed at the beginning of status_calc_pc()
int param_bonus[6],param_equip[6]; //Stores card/equipment bonuses.
int subele[ELE_MAX];
int subrace[RC_MAX];
int subrace2[RC2_MAX];
int subsize[3];
int reseff[SC_COMMON_MAX-SC_COMMON_MIN+1];
int weapon_coma_ele[ELE_MAX];
int weapon_coma_race[RC_MAX];
int weapon_atk[16];
int weapon_atk_rate[16];
int arrow_addele[ELE_MAX];
int arrow_addrace[RC_MAX];
int arrow_addsize[3];
int magic_addele[ELE_MAX];
int magic_addrace[RC_MAX];
int magic_addsize[3];
int magic_atk_ele[ELE_MAX];
int critaddrace[RC_MAX];
int expaddrace[RC_MAX];
int ignore_mdef[RC_MAX];
int ignore_def[RC_MAX];
short sp_gain_race[RC_MAX];
short sp_gain_race_attack[RC_MAX];
short hp_gain_race_attack[RC_MAX];
// zeroed arrays end here.
// zeroed structures start here
struct s_autospell autospell[15], autospell2[15], autospell3[15];
struct s_addeffect addeff[MAX_PC_BONUS], addeff2[MAX_PC_BONUS];
struct s_addeffectonskill addeff3[MAX_PC_BONUS];
struct { //skillatk raises bonus dmg% of skills, skillheal increases heal%, skillblown increases bonus blewcount for some skills.
unsigned short id;
short val;
} skillatk[MAX_PC_BONUS], skillusesprate[MAX_PC_BONUS], skillusesp[MAX_PC_BONUS], skillheal[5], skillheal2[5], skillblown[MAX_PC_BONUS], skillcast[MAX_PC_BONUS], skillcooldown[MAX_PC_BONUS], skillfixcast[MAX_PC_BONUS], skillvarcast[MAX_PC_BONUS], skillfixcastrate[MAX_PC_BONUS];
struct {
short value;
int rate;
int tick;
} hp_loss, sp_loss, hp_regen, sp_regen;
struct {
short class_, rate;
} add_def[MAX_PC_BONUS], add_mdef[MAX_PC_BONUS], add_mdmg[MAX_PC_BONUS];
struct s_add_drop add_drop[MAX_PC_BONUS];
struct {
int nameid;
int rate;
} itemhealrate[MAX_PC_BONUS];
struct {
short flag, rate;
unsigned char ele;
} subele2[MAX_PC_BONUS];
// zeroed structures end here
// manually zeroed structures start here.
struct s_autobonus autobonus[MAX_PC_BONUS], autobonus2[MAX_PC_BONUS], autobonus3[MAX_PC_BONUS]; //Auto script on attack, when attacked, on skill usage
// manually zeroed structures end here.
// zeroed vars start here.
struct {
int atk_rate;
int arrow_atk,arrow_ele,arrow_cri,arrow_hit;
int nsshealhp,nsshealsp;
int critical_def,double_rate;
int long_attack_atk_rate; //Long range atk rate, not weapon based. [Skotlex]
int near_attack_def_rate,long_attack_def_rate,magic_def_rate,misc_def_rate;
int ignore_mdef_ele;
int ignore_mdef_race;
int perfect_hit;
int perfect_hit_add;
int get_zeny_rate;
int get_zeny_num; //Added Get Zeny Rate [Skotlex]
int double_add_rate;
int short_weapon_damage_return,long_weapon_damage_return;
int magic_damage_return; // AppleGirl Was Here
int break_weapon_rate,break_armor_rate;
int crit_atk_rate;
int classchange; // [Valaris]
int speed_rate, speed_add_rate, aspd_add;
int itemhealrate2; // [Epoque] Increase heal rate of all healing items.
int shieldmdef;//royal guard's
unsigned int setitem_hash, setitem_hash2; //Split in 2 because shift operations only work on int ranges. [Skotlex]
short splash_range, splash_add_range;
short add_steal_rate;
short add_heal_rate, add_heal2_rate;
short sp_gain_value, hp_gain_value, magic_sp_gain_value, magic_hp_gain_value;
short sp_vanish_rate;
short sp_vanish_per;
unsigned short unbreakable; // chance to prevent ANY equipment breaking [celest]
unsigned short unbreakable_equip; //100% break resistance on certain equipment
unsigned short unstripable_equip;
int fixcastrate,varcastrate;
int add_fixcast,add_varcast;
int ematk; // matk bonus from equipment
} bonus;this is WTFI just noticed rathena item_bonus.txt has a better format
https://github.com/r.../item_bonus.txt
this might take several days to do ....













