summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-31 17:22:06 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-31 17:22:06 +0000
commit8188128698408ab4caf7809e98943402bdc116cc (patch)
tree55ccd22540fa0661c7f726bd43c8e48285ad0b58 /src/map/battle.c
parent0521cef44f741f120f3ba0e8573653a2f018c048 (diff)
downloadhercules-8188128698408ab4caf7809e98943402bdc116cc.tar.gz
hercules-8188128698408ab4caf7809e98943402bdc116cc.tar.bz2
hercules-8188128698408ab4caf7809e98943402bdc116cc.tar.xz
hercules-8188128698408ab4caf7809e98943402bdc116cc.zip
- Changed the look field of all arrows to 1.
- Added column "RequiredArrowType" to skill_require_db, set to 1 all arrow-based skills. - Added support for ArrowType requirement on skills. It checks for having an item equipped on the arrow-slot who's view has to match with the required arrow-type (works the same way it does for weapons). - Skills will automatically be ranged and arrow-types when they have a arrow-requirement. - Skills will automatically consume arrows if used with a bow and the skill is an attack weapon-based skill even if the skill_require_db doesn't specifies arrow requirements (this is for stuff like backstab used with bows) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5829 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c53
1 files changed, 19 insertions, 34 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index cc992fbc4..ba3dc6ce4 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1021,32 +1021,33 @@ static struct Damage battle_calc_weapon_attack(
}
}
//Set miscellaneous data that needs be filled regardless of hit/miss
- if(sd && (sd->status.weapon == 11 || sd->status.weapon == 17 || sd->status.weapon == 18
- || sd->status.weapon == 19 || sd->status.weapon == 20 || sd->status.weapon == 21)) {
- wd.flag=(wd.flag&~BF_RANGEMASK)|BF_LONG;
- flag.arrow = 1;
+ if(sd) {
+ switch (sd->status.weapon) {
+ case 11:
+ case 17:
+ case 18:
+ case 19:
+ case 20:
+ case 21:
+ wd.flag=(wd.flag&~BF_RANGEMASK)|BF_LONG;
+ flag.arrow = 1;
+ break;
+ }
} else if (status_get_range(src) > 3)
wd.flag=(wd.flag&~BF_RANGEMASK)|BF_LONG;
-
+ if(skill_num && skill_get_arrowtype(skill_num)) {
+ //Skills that require a consumable are also long-ranged arrow-types
+ wd.flag=(wd.flag&~BF_RANGEMASK)|BF_LONG;
+ flag.arrow = 1;
+ }
+
if(skill_num){
wd.flag=(wd.flag&~BF_SKILLMASK)|BF_SKILL;
switch(skill_num)
{
- case AC_DOUBLE:
- case AC_SHOWER:
- case AC_CHARGEARROW:
- case BA_MUSICALSTRIKE:
- case DC_THROWARROW:
- case CG_ARROWVULCAN:
- case AS_VENOMKNIFE:
- case HT_POWER:
- wd.flag=(wd.flag&~BF_RANGEMASK)|BF_LONG;
- flag.arrow = 1;
- break;
-
case HT_PHANTASMIC:
- wd.flag=(wd.flag&~BF_RANGEMASK)|BF_LONG;
+ case GS_MAGICALBULLET:
flag.arrow = 0;
break;
@@ -1103,22 +1104,6 @@ static struct Damage battle_calc_weapon_attack(
//Until they're at right position - gs_arrow- [Vicious]
case GS_RAPIDSHOWER:
wd.div_= 5;
- case GS_BULLSEYE:
- case GS_CRACKER:
- case GS_TRACKING:
- case GS_PIERCINGSHOT:
- case GS_DUST:
- case GS_SPREADATTACK:
- case NJ_SYURIKEN:
- case NJ_KUNAI:
- case NJ_HUUMA:
- wd.flag=(wd.flag&~BF_RANGEMASK)|BF_LONG;
- flag.arrow = 1;
- break;
-
- case GS_MAGICALBULLET:
- wd.flag=(wd.flag&~BF_RANGEMASK)|BF_LONG;
- flag.arrow = 0;
break;
}
}