diff options
author | rud0lp20 <rud0lp20@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2013-01-10 18:17:32 +0000 |
---|---|---|
committer | rud0lp20 <rud0lp20@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2013-01-10 18:17:32 +0000 |
commit | de0374e0afa0fe11e5609d619a222754a5e879c5 (patch) | |
tree | 12791944920536ae2d18e7735bfdac6f137b83e5 | |
parent | bac08d580258b69b365db32ab1705df232851c5b (diff) | |
download | hercules-de0374e0afa0fe11e5609d619a222754a5e879c5.tar.gz hercules-de0374e0afa0fe11e5609d619a222754a5e879c5.tar.bz2 hercules-de0374e0afa0fe11e5609d619a222754a5e879c5.tar.xz hercules-de0374e0afa0fe11e5609d619a222754a5e879c5.zip |
Implemented official walk path dealing with obstacle.(bugreport:6159)
-see 'src/config/core.h' for settings[OFFICIAL_WALKPATH].
Fixed bugreport:7057 where HP_ASSUMPTIO should only double eDEF & eMDEF.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17091 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | src/map/battle.c | 9 | ||||
-rw-r--r-- | src/map/status.c | 22 | ||||
-rw-r--r-- | src/map/unit.c | 15 |
3 files changed, 20 insertions, 26 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 6f9595108..7b6bf5869 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3137,7 +3137,10 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo short vit_def; defType def1 = status_get_def(target); //Don't use tstatus->def1 due to skill timer reductions. short def2 = tstatus->def2; - +#ifdef RENEWAL + if( tsc && tsc->data[SC_ASSUMPTIO] ) + def1 <<= 1; // only eDEF is doubled +#endif if( sd ) { i = sd->ignore_def[is_boss(target)?RC_BOSS:RC_NONBOSS]; @@ -4081,6 +4084,10 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list if(!flag.imdef){ defType mdef = tstatus->mdef; int mdef2= tstatus->mdef2; +#ifdef RENEWAL + if(tsc && tsc->data[SC_ASSUMPTIO]) + mdef <<= 1; // only eMDEF is doubled +#endif if(sd) { i = sd->ignore_mdef[is_boss(target)?RC_BOSS:RC_NONBOSS]; i+= sd->ignore_mdef[tstatus->race]; diff --git a/src/map/status.c b/src/map/status.c index 357683c95..649cfa1ae 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -359,7 +359,7 @@ void initChangeTables(void) { set_sc( LK_CONCENTRATION , SC_CONCENTRATION , SI_CONCENTRATION , SCB_BATK|SCB_WATK|SCB_HIT|SCB_DEF|SCB_DEF2|SCB_MDEF|SCB_DSPD ); set_sc( LK_TENSIONRELAX , SC_TENSIONRELAX , SI_TENSIONRELAX , SCB_REGEN ); set_sc( LK_BERSERK , SC_BERSERK , SI_BERSERK , SCB_DEF|SCB_DEF2|SCB_MDEF|SCB_MDEF2|SCB_FLEE|SCB_SPEED|SCB_ASPD|SCB_MAXHP|SCB_REGEN ); - set_sc( HP_ASSUMPTIO , SC_ASSUMPTIO , SI_ASSUMPTIO , SCB_DEF|SCB_DEF2|SCB_MDEF|SCB_MDEF2 ); + set_sc( HP_ASSUMPTIO , SC_ASSUMPTIO , SI_ASSUMPTIO , SCB_NONE ); add_sc( HP_BASILICA , SC_BASILICA ); set_sc( HW_MAGICPOWER , SC_MAGICPOWER , SI_MAGICPOWER , SCB_MATK ); add_sc( PA_SACRIFICE , SC_SACRIFICE ); @@ -468,7 +468,7 @@ void initChangeTables(void) { set_sc( CASH_BLESSING , SC_BLESSING , SI_BLESSING , SCB_STR|SCB_INT|SCB_DEX ); set_sc( CASH_INCAGI , SC_INCREASEAGI , SI_INCREASEAGI , SCB_AGI|SCB_SPEED ); - set_sc( CASH_ASSUMPTIO , SC_ASSUMPTIO , SI_ASSUMPTIO , SCB_DEF|SCB_DEF2|SCB_MDEF|SCB_MDEF2 ); + set_sc( CASH_ASSUMPTIO , SC_ASSUMPTIO , SI_ASSUMPTIO , SCB_NONE ); set_sc( ALL_PARTYFLEE , SC_PARTYFLEE , SI_PARTYFLEE , SCB_NONE ); set_sc( ALL_ODINS_POWER , SC_ODINS_POWER , SI_ODINS_POWER , SCB_MATK|SCB_BATK|SCB_MDEF|SCB_DEF ); @@ -4893,10 +4893,6 @@ static defType status_calc_def(struct block_list *bl, struct status_change *sc, def >>=1; if(sc->data[SC_FREEZE]) def >>=1; -#ifdef RENEWAL - if(sc->data[SC_ASSUMPTIO]) - def *= 2; -#endif if(sc->data[SC_SIGNUMCRUCIS]) def -= def * sc->data[SC_SIGNUMCRUCIS]->val2/100; if(sc->data[SC_CONCENTRATION]) @@ -4971,10 +4967,6 @@ static signed short status_calc_def2(struct block_list *bl, struct status_change def2 -= def2 * 50/100; if(sc->data[SC_PROVOKE]) def2 -= def2 * sc->data[SC_PROVOKE]->val4/100; -#ifdef RENEWAL - if(sc->data[SC_ASSUMPTIO]) - def2 *= 2; -#endif if(sc->data[SC_JOINTBEAT]) def2 -= def2 * ( sc->data[SC_JOINTBEAT]->val2&BREAK_SHOULDER ? 50 : 0 ) / 100 + def2 * ( sc->data[SC_JOINTBEAT]->val2&BREAK_WAIST ? 25 : 0 ) / 100; @@ -5030,12 +5022,6 @@ static defType status_calc_mdef(struct block_list *bl, struct status_change *sc, mdef += sc->data[SC_STONEHARDSKIN]->val1; if(sc->data[SC_WATER_BARRIER]) mdef += sc->data[SC_WATER_BARRIER]->val2; - -#ifdef RENEWAL - if(sc->data[SC_ASSUMPTIO]) - mdef *= 2; -#endif - if(sc->data[SC_STONE] && sc->opt1 == OPT1_STONE) mdef += 25*mdef/100; if(sc->data[SC_FREEZE]) @@ -5068,10 +5054,6 @@ static signed short status_calc_mdef2(struct block_list *bl, struct status_chang return 0; if(sc->data[SC_SKA]) return 90; -#ifdef RENEWAL - if(sc->data[SC_ASSUMPTIO]) - mdef2 *= 2; -#endif if(sc->data[SC_MINDBREAKER]) mdef2 -= mdef2 * sc->data[SC_MINDBREAKER]->val3/100; if(sc->data[SC_ANALYZE]) diff --git a/src/map/unit.c b/src/map/unit.c index e0dc69d15..0104e9a42 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -315,16 +315,21 @@ int unit_walktoxy( struct block_list *bl, short x, short y, int flag) { struct unit_data* ud = NULL; struct status_change* sc = NULL; - +#ifdef OFFICIAL_WALKPATH + struct walkpath_data wpd; +#endif nullpo_ret(bl); ud = unit_bl2ud(bl); if( ud == NULL) return 0; -// disabled until we find the correct algorithm. [malufett] -//#ifdef OFFICIAL_WALKPATH -// if( !path_search_long(NULL, bl->m, bl->x, bl->y, x, y, CELL_CHKWALL) ) return 0; -//#endif + +#ifdef OFFICIAL_WALKPATH + if( path_search(&wpd, bl->m, bl->x, bl->y, x, y, flag&1, CELL_CHKNOPASS) // Check if there is an obstacle between + && wpd.path_len > 14 ) // Official number of walkable cells is 14 if and only if there is an obstacle between. [malufett] + return 0; +#endif + if (flag&4 && DIFF_TICK(ud->canmove_tick, gettick()) > 0 && DIFF_TICK(ud->canmove_tick, gettick()) < 2000) { // Delay walking command. [Skotlex] |