From 8188128698408ab4caf7809e98943402bdc116cc Mon Sep 17 00:00:00 2001 From: skotlex Date: Fri, 31 Mar 2006 17:22:06 +0000 Subject: - 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 --- src/map/battle.c | 53 +++++++++++++++++++---------------------------------- 1 file changed, 19 insertions(+), 34 deletions(-) (limited to 'src/map/battle.c') 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; } } -- cgit v1.2.3-60-g2f50