summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-20 21:38:02 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-20 21:38:02 +0000
commitf076819852059809b4281ef2e87e50aee102cfd0 (patch)
treed45a2a5311abe91268b7ed93be120adb84c9081b /src
parentd2b562b8242d07c6a373baaa6dce66fa85df9eb5 (diff)
downloadhercules-f076819852059809b4281ef2e87e50aee102cfd0.tar.gz
hercules-f076819852059809b4281ef2e87e50aee102cfd0.tar.bz2
hercules-f076819852059809b4281ef2e87e50aee102cfd0.tar.xz
hercules-f076819852059809b4281ef2e87e50aee102cfd0.zip
- Gravitation now only blocks the caster from using potions.
- Corrected Madness Canceller not letting you walk while the effect lasts. - Splitted yet again ASC_BREAKER into a two-part attack. This time the int-based damage is a MISC type attack, and gets reduced by skills as such. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8392 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c17
-rw-r--r--src/map/pc.c4
-rw-r--r--src/map/unit.c31
3 files changed, 31 insertions, 21 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index d78b83c31..fff1dbe81 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -754,6 +754,9 @@ void battle_consume_ammo(TBL_PC*sd, int skill, int lv)
pc_delitem(sd,sd->equip_index[10],qty,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);
+
//For quick div adjustment.
#define damage_div_fix(dmg, div) { if (div > 1) (dmg)*=div; else if (div < 0) (div)*=-1; }
/*==========================================
@@ -1813,10 +1816,6 @@ static struct Damage battle_calc_weapon_attack(
}
}
- //Breaker's int-based damage (applies after attribute modifiers)
- if(skill_num==ASC_BREAKER)
- ATK_ADD(rand()%500 + 500 + skill_lv * sstatus->int_ * 5);
-
if ((!flag.rh || !wd.damage) && (!flag.lh || !wd.damage2))
flag.cardfix = 0; //When the attack does no damage, avoid doing %bonuses
@@ -2027,6 +2026,12 @@ static struct Damage battle_calc_weapon_attack(
}
}
+ if(skill_num==ASC_BREAKER)
+ { //Breaker's int-based damage (a misc attack?)
+ struct Damage md = battle_calc_misc_attack(src, target, skill_num, skill_lv, wflag);
+ wd.damage += md.damage;
+ }
+
if (wd.damage || wd.damage2) {
if (sd && battle_config.equip_self_break_rate)
{ // Self weapon breaking
@@ -2518,6 +2523,7 @@ struct Damage battle_calc_misc_attack(
case SN_FALCONASSAULT:
case PA_GOSPEL:
case CR_ACIDDEMONSTRATION:
+ case ASC_BREAKER:
md.flag = (md.flag&~BF_RANGEMASK)|BF_LONG;
break;
case HVAN_EXPLOSION:
@@ -2613,6 +2619,9 @@ struct Damage battle_calc_misc_attack(
case HVAN_EXPLOSION: //[orn]
md.damage = sstatus->hp * (50 + 50 * skill_lv) / 100 ;
break ;
+ case ASC_BREAKER:
+ md.damage = 500+rand()%500 + 5*skill_lv * sstatus->int_;
+ break;
}
damage_div_fix(md.damage, md.div_);
diff --git a/src/map/pc.c b/src/map/pc.c
index 0acccb16e..befbce5f8 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -2914,9 +2914,9 @@ int pc_useitem(struct map_session_data *sd,int n)
if (sd->sc.count && (
sd->sc.data[SC_BERSERK].timer!=-1 ||
sd->sc.data[SC_MARIONETTE].timer!=-1 ||
- sd->sc.data[SC_GRAVITATION].timer!=-1 ||
+ (sd->sc.data[SC_GRAVITATION].timer!=-1 && sd->sc.data[SC_GRAVITATION].val3 == BCT_SELF) ||
//Cannot use Potions/Healing items while under Gospel.
- (sd->sc.data[SC_GOSPEL].timer!=-1 && sd->sc.data[SC_GOSPEL].val4 == BCT_SELF && sd->inventory_data[n]->type == 0)
+ (sd->sc.data[SC_GOSPEL].timer!=-1 && sd->sc.data[SC_GOSPEL].val4 == BCT_SELF && sd->inventory_data[n]->type == IT_HEALING)
))
return 0;
diff --git a/src/map/unit.c b/src/map/unit.c
index e04244469..5c48cf8e4 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -664,23 +664,24 @@ int unit_can_move(struct block_list *bl)
return 0;
if (sc->count && (
- sc->data[SC_ANKLE].timer != -1 ||
- sc->data[SC_AUTOCOUNTER].timer !=-1 ||
- sc->data[SC_TRICKDEAD].timer !=-1 ||
- sc->data[SC_BLADESTOP].timer !=-1 ||
- sc->data[SC_BLADESTOP_WAIT].timer !=-1 ||
- sc->data[SC_SPIDERWEB].timer !=-1 ||
- (sc->data[SC_DANCING].timer !=-1 && (
+ sc->data[SC_ANKLE].timer != -1
+ || sc->data[SC_AUTOCOUNTER].timer !=-1
+ || sc->data[SC_TRICKDEAD].timer !=-1
+ || sc->data[SC_BLADESTOP].timer !=-1
+ || sc->data[SC_BLADESTOP_WAIT].timer !=-1
+ || sc->data[SC_SPIDERWEB].timer !=-1
+ || (sc->data[SC_DANCING].timer !=-1 && (
(sc->data[SC_DANCING].val4 && sc->data[SC_LONGING].timer == -1) ||
sc->data[SC_DANCING].val1 == CG_HERMODE //cannot move while Hermod is active.
- )) ||
- sc->data[SC_MOONLIT].timer != -1 ||
- (sc->data[SC_GOSPEL].timer !=-1 && sc->data[SC_GOSPEL].val4 == BCT_SELF) || // cannot move while gospel is in effect
- sc->data[SC_STOP].timer != -1 ||
- sc->data[SC_CLOSECONFINE].timer != -1 ||
- sc->data[SC_CLOSECONFINE2].timer != -1 ||
- (sc->data[SC_CLOAKING].timer != -1 && //Need wall at level 1-2
- sc->data[SC_CLOAKING].val1 < 3 && !(sc->data[SC_CLOAKING].val4&1))
+ ))
+ || sc->data[SC_MOONLIT].timer != -1
+ || (sc->data[SC_GOSPEL].timer !=-1 && sc->data[SC_GOSPEL].val4 == BCT_SELF) // cannot move while gospel is in effect
+ || sc->data[SC_STOP].timer != -1
+ || sc->data[SC_CLOSECONFINE].timer != -1
+ || sc->data[SC_CLOSECONFINE2].timer != -1
+ || (sc->data[SC_CLOAKING].timer != -1 && //Need wall at level 1-2
+ sc->data[SC_CLOAKING].val1 < 3 && !(sc->data[SC_CLOAKING].val4&1))
+ || sc->data[SC_MADNESSCANCEL].timer != -1
))
return 0;
}