diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-03-19 19:44:21 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-03-19 19:44:21 +0000 |
commit | cb227339015cdd739580b36222d31b6755694d49 (patch) | |
tree | 60f6f9376731e9ab5bddc8c59775aa86c40f9dc5 /src/map/battle.c | |
parent | b4633cd02038b02bf6760e9f1fffec3a0a820cab (diff) | |
download | hercules-cb227339015cdd739580b36222d31b6755694d49.tar.gz hercules-cb227339015cdd739580b36222d31b6755694d49.tar.bz2 hercules-cb227339015cdd739580b36222d31b6755694d49.tar.xz hercules-cb227339015cdd739580b36222d31b6755694d49.zip |
- Removed the last argument from skillitem, the skill name passed to the client should always be of the type "AL_HEAL" anyway.
- Added skill ITEM_ENCHANTARMS, this is what weapon enchanting items should use.
- Corrected itemskill calls in the item_db, also made the weapon enchanting items invoke the ITEM_ENCHANTARMS skill. Corrected Holy Egg not being type 11 (delay consume)
- Updated item_db.sql with item_db information.
- Added support for specifying different elements per skill level in the skill_db
- Added bonus bNoKnockback
- Corrected typo in bonus bSubRace2 (it was called bSPSubRace2 for some reason)
- Corrected login sql server not resetting your account state to 0 when the banuntil duration expires.
- Corrected use of UINT_MAX instead of INT_MAX in some jailing check.
- Made the skillatk bonus it's own function, it can now be used to boost Heal/Sanctuary/Potion Pitcher and Slim Pitcher as well.
- Cleaned up TK_WARMWIND to use the element acquired from the skill_db rather than hardcoded values.
- Corrected Teleport's save map entry being sent without the .gat extension.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10031 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r-- | src/map/battle.c | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index dd18d38bd..92297e67d 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -833,6 +833,20 @@ static int battle_blewcount_bonus(struct map_session_data *sd, int skill_num) return 0; } +int battle_skillatk_bonus(struct map_session_data *sd, int skill_num) +{ + int i; + if (!sd->skillatk[0].id) + return 0; + for (i = 0; i < MAX_PC_BONUS && sd->skillatk[i].id && + sd->skillatk[i].id != skill_num; i++); + + if (i < MAX_PC_BONUS && sd->skillatk[i].id) + return sd->skillatk[i].val; + + return 0; +} + struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list *target,int skill_num,int skill_lv,int mflag); struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *target,int skill_num,int skill_lv,int mflag); @@ -975,7 +989,7 @@ static struct Damage battle_calc_weapon_attack( } t_class = status_get_class(target); - s_ele = s_ele_ = skill_get_pl(skill_num); + s_ele = s_ele_ = skill_get_pl(skill_num, skill_lv); if (!skill_num || s_ele == -1) { //Take weapon's element s_ele = sstatus->rhw.ele; s_ele_ = sstatus->lhw?sstatus->lhw->ele:0; @@ -1627,14 +1641,8 @@ static struct Damage battle_calc_weapon_attack( if(sd) { - if (skill_num && sd->skillatk[0].id) - { //Additional skill damage. - for (i = 0; i < MAX_PC_BONUS && sd->skillatk[i].id && - sd->skillatk[i].id != skill_num; i++); - - if (i < MAX_PC_BONUS && sd->skillatk[i].id == skill_num) - ATK_ADDRATE(sd->skillatk[i].val); - } + if (skill_num && (i = battle_skillatk_bonus(sd, skill_num))) + ATK_ADDRATE(i); if(skill_num != PA_SACRIFICE && skill_num != MO_INVESTIGATE && skill_num != CR_GRANDCROSS && skill_num != NPC_GRANDDARKNESS && @@ -2145,7 +2153,7 @@ struct Damage battle_calc_magic_attack( BL_CAST(BL_PC, target, tsd); //Initialize variables that will be used afterwards - s_ele = skill_get_pl(skill_num); + s_ele = skill_get_pl(skill_num, skill_lv); if (s_ele == -1) // pl=-1 : the skill takes the weapon's element s_ele = sstatus->rhw.ele; @@ -2324,12 +2332,8 @@ struct Damage battle_calc_magic_attack( if(sd) { //Damage bonuses - if (sd->skillatk[0].id) - { - for (i = 0; i < MAX_PC_BONUS && sd->skillatk[i].id && sd->skillatk[i].id != skill_num; i++); - if (i < MAX_PC_BONUS && sd->skillatk[i].id == skill_num) - ad.damage += ad.damage*sd->skillatk[i].val/100; - } + if ((i = battle_skillatk_bonus(sd, skill_num))) + ad.damage += ad.damage*i/100; //Ignore Defense? if (!flag.imdef && ( @@ -2468,7 +2472,7 @@ struct Damage battle_calc_misc_attack( md.blewcount += battle_blewcount_bonus(sd, skill_num); } - s_ele = skill_get_pl(skill_num); + s_ele = skill_get_pl(skill_num, skill_lv); if (s_ele < 0) //Attack that takes weapon's element for misc attacks? Make it neutral [Skotlex] s_ele = ELE_NEUTRAL; @@ -2625,12 +2629,9 @@ struct Damage battle_calc_misc_attack( if (cardfix != 10000) md.damage=md.damage*cardfix/10000; } - if (sd && skill_num > 0 && sd->skillatk[0].id != 0) - { - for (i = 0; i < MAX_PC_BONUS && sd->skillatk[i].id != 0 && sd->skillatk[i].id != skill_num; i++); - if (i < MAX_PC_BONUS && sd->skillatk[i].id == skill_num) - md.damage += md.damage*sd->skillatk[i].val/100; - } + + if (sd && (i = battle_skillatk_bonus(sd, skill_num))) + md.damage += md.damage*i/100; if(md.damage < 0) md.damage = 0; |