diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-06-19 15:19:25 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-06-19 15:19:25 +0000 |
commit | d6aa899bd3508d34b569f5745afb08fe97593b20 (patch) | |
tree | 00fe59b73270e82e8a10521fcde1c710adfe198a | |
parent | ead9663ed875ca0c3e64ebe5f9a5dd6004b2abbc (diff) | |
download | hercules-d6aa899bd3508d34b569f5745afb08fe97593b20.tar.gz hercules-d6aa899bd3508d34b569f5745afb08fe97593b20.tar.bz2 hercules-d6aa899bd3508d34b569f5745afb08fe97593b20.tar.xz hercules-d6aa899bd3508d34b569f5745afb08fe97593b20.zip |
- Some cleanups and corrections in battle.c to account for negative (absorbed) damage.
- Fixed umbala.txt's Elemental Stones Quest bug. Thanks to Vhan Morthis.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7250 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Trunk.txt | 2 | ||||
-rw-r--r-- | npc/Changelog.txt | 2 | ||||
-rw-r--r-- | npc/cities/umbala.txt | 4 | ||||
-rw-r--r-- | src/map/battle.c | 27 | ||||
-rw-r--r-- | src/map/status.c | 1 |
5 files changed, 20 insertions, 16 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index a3af035ed..4c6ac9503 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/06/19
+ * Some cleanups and corrections in battle.c to account for negative
+ (absorbed) damage. [Skotlex]
* Fixed fame-list updating crashing char-sql server when the given char-id
just got into ranking. [Skotlex]
* Added missing Arunafeltz maps with information from NLZ [Evera]
diff --git a/npc/Changelog.txt b/npc/Changelog.txt index ab47a9ea7..57eec178c 100644 --- a/npc/Changelog.txt +++ b/npc/Changelog.txt @@ -37,6 +37,8 @@ Musashiden Date Added
======
06/19
+ * Fixed umbala.txt's Elemental Stones Quest bug. Thanks to Vhan Morthis.
+ [Skotlex]
* Removed Jfunc1-1.txt, merged parts of scripts back. Changed job numbers to constants [Lupus]
- Jfunc2-1.txt & Jfunc2-2.txt todo
06/17
diff --git a/npc/cities/umbala.txt b/npc/cities/umbala.txt index c51835b51..1967690d4 100644 --- a/npc/cities/umbala.txt +++ b/npc/cities/umbala.txt @@ -580,7 +580,7 @@ umbala.gat,221,193,1 script #Skeletal Gate 111,{ if(event_umbala < 6) goto LSecondCheck;
if(@ryumon == 33) goto Lwarp;
LSecondCheck:
- if(event_umbala >= 6) goto LLNewEnd;
+ if(event_umbala >= 6) goto LNewEnd;
if(@ryumon == 13) goto Lwarp;
LNewEnd:
mes "^3355FFNothing happened.";
@@ -1684,4 +1684,4 @@ L4: umbala.gat,136,195,0 script #Warp Point 139,1,1,{
warp "umbala.gat",145,166;
end;
-}
\ No newline at end of file +}
diff --git a/src/map/battle.c b/src/map/battle.c index 85a8310e0..357e169e3 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -232,8 +232,8 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i nullpo_retr(0, bl); - if (damage <= 0) - return 0; + if (damage <= 0) //No reductions to make. + return damage; if (bl->type == BL_MOB) { md=(struct mob_data *)bl; @@ -457,8 +457,8 @@ int battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int dama struct mob_data *md = NULL; int class_; - if (damage <= 0) - return 0; + if (damage <= 0) //No reductions to make. + return damage; class_ = status_get_class(bl); @@ -1720,7 +1720,7 @@ static struct Damage battle_calc_weapon_attack( } } - if ((!flag.rh || wd.damage == 0) && (!flag.lh || wd.damage2 == 0)) + if ((!flag.rh || !wd.damage) && (!flag.lh || !wd.damage2)) flag.cardfix = 0; //When the attack does no damage, avoid doing %bonuses if (sd) @@ -1877,13 +1877,13 @@ static struct Damage battle_calc_weapon_attack( flag.lh=0; } else if(sd->status.weapon > MAX_WEAPON_TYPE) { //Dual-wield - if (wd.damage > 0) + if (wd.damage) { skill = pc_checkskill(sd,AS_RIGHT); wd.damage = wd.damage * (50 + (skill * 10))/100; if(wd.damage < 1) wd.damage = 1; } - if (wd.damage2 > 0) + if (wd.damage2) { skill = pc_checkskill(sd,AS_LEFT); wd.damage2 = wd.damage2 * (30 + (skill * 10))/100; @@ -1894,7 +1894,7 @@ static struct Damage battle_calc_weapon_attack( skill = pc_checkskill(sd,TF_DOUBLE); wd.damage2 = wd.damage * (1 + (skill * 2))/100; - if(wd.damage > 0 && wd.damage2 < 1) wd.damage2 = 1; + if(wd.damage && !wd.damage2) wd.damage2 = 1; flag.lh = 1; } } @@ -1907,11 +1907,12 @@ static struct Damage battle_calc_weapon_attack( if(wd.damage > 0 || wd.damage2 > 0) { - if(wd.damage2<1) { + if(!wd.damage2) { wd.damage=battle_calc_damage(src,target,wd.damage,wd.div_,skill_num,skill_lv,wd.flag); if (map_flag_gvg(target->m)) wd.damage=battle_calc_gvg_damage(src,target,wd.damage,wd.div_,skill_num,skill_lv,wd.flag); - } else if(wd.damage<1) { + } else + if(!wd.damage) { wd.damage2=battle_calc_damage(src,target,wd.damage2,wd.div_,skill_num,skill_lv,wd.flag); if (map_flag_gvg(target->m)) wd.damage2=battle_calc_gvg_damage(src,target,wd.damage2,wd.div_,skill_num,skill_lv,wd.flag); @@ -1949,7 +1950,7 @@ static struct Damage battle_calc_weapon_attack( } } - if (wd.damage > 0 || wd.damage2 > 0) { + if (wd.damage || wd.damage2) { if (sd && battle_config.equip_self_break_rate) { // Self weapon breaking int breakrate = battle_config.equip_natural_break_rate; @@ -2360,8 +2361,8 @@ struct Damage battle_calc_magic_attack( damage_div_fix(ad.damage, ad.div_); - if (flag.infdef && ad.damage > 0) - ad.damage = 1; + if (flag.infdef && ad.damage) + ad.damage/= ad.damage; //Why this? Because, well, if damage is absorbed, it should heal 1, not do 1 dmg. ad.damage=battle_calc_damage(src,target,ad.damage,ad.div_,skill_num,skill_lv,ad.flag); if (map_flag_gvg(target->m)) diff --git a/src/map/status.c b/src/map/status.c index 59182d648..3452c2a5d 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -5157,7 +5157,6 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val case SC_CLOSECONFINE2: case SC_ANKLE: case SC_SPIDERWEB: - case SC_MADNESSCANCEL: unit_stop_walking(bl,1); break; case SC_HIDING: |