summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-22 02:31:58 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-22 02:31:58 +0000
commit38c57a94616b709508e78ea4d49a4e6d02621c3f (patch)
tree925ce7e074fad45eb8eb22d2eea8c52ccbd9a563 /src/map/battle.c
parent444511502b3812c587f6289f88c6d5617ed2b3a6 (diff)
downloadhercules-38c57a94616b709508e78ea4d49a4e6d02621c3f.tar.gz
hercules-38c57a94616b709508e78ea4d49a4e6d02621c3f.tar.bz2
hercules-38c57a94616b709508e78ea4d49a4e6d02621c3f.tar.xz
hercules-38c57a94616b709508e78ea4d49a4e6d02621c3f.zip
Fixed bug with Sacrifice, Triple Attack and SC_MAGICALATK stopping the character from attacking if either missed.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15749 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 3b1aded89..1b00abe3e 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -4056,17 +4056,17 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
}
}
- if(sd && (skillv = pc_checkskill(sd,MO_TRIPLEATTACK)) > 0)
- {
+ if(sd && (skillv = pc_checkskill(sd,MO_TRIPLEATTACK)) > 0) {
int triple_rate= 30 - skillv; //Base Rate
- if (sc && sc->data[SC_SKILLRATE_UP] && sc->data[SC_SKILLRATE_UP]->val1 == MO_TRIPLEATTACK)
- {
+ if (sc && sc->data[SC_SKILLRATE_UP] && sc->data[SC_SKILLRATE_UP]->val1 == MO_TRIPLEATTACK) {
triple_rate+= triple_rate*(sc->data[SC_SKILLRATE_UP]->val2)/100;
status_change_end(src, SC_SKILLRATE_UP, INVALID_TIMER);
}
- if (rnd()%100 < triple_rate)
- //FIXME: invalid return type!
- return (damage_lv)skill_attack(BF_WEAPON,src,src,target,MO_TRIPLEATTACK,skillv,tick,0);
+ if (rnd()%100 < triple_rate) {
+ if( skill_attack(BF_WEAPON,src,src,target,MO_TRIPLEATTACK,skillv,tick,0) )
+ return wd.dmg_lv;
+ return ATK_MISS;
+ }
}
if (sc) {
@@ -4084,12 +4084,15 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
ret_val = (damage_lv)skill_attack(BF_WEAPON,src,src,target,PA_SACRIFICE,skilllv,tick,0);
status_zap(src, sstatus->max_hp*9/100, 0);//Damage to self is always 9%
-
+ if( ret_val == ATK_NONE )
+ return ATK_MISS;
return ret_val;
}
- if (sc->data[SC_MAGICALATTACK])
- //FIXME: invalid return type!
- return (damage_lv)skill_attack(BF_MAGIC,src,src,target,NPC_MAGICALATTACK,sc->data[SC_MAGICALATTACK]->val1,tick,0);
+ if (sc->data[SC_MAGICALATTACK]) {
+ if( skill_attack(BF_MAGIC,src,src,target,NPC_MAGICALATTACK,sc->data[SC_MAGICALATTACK]->val1,tick,0) )
+ return ATK_DEF;
+ return ATK_MISS;
+ }
}
if(tsc && tsc->data[SC_KAAHI] && tsc->data[SC_KAAHI]->val4 == INVALID_TIMER && tstatus->hp < tstatus->max_hp)