diff options
author | protimus <protimus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-01-08 03:26:16 +0000 |
---|---|---|
committer | protimus <protimus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-01-08 03:26:16 +0000 |
commit | efdd0ca8f32811f6d7fc78555a0afcdfad308ca8 (patch) | |
tree | 608d7babab1c68c7947c3f0adc8a0a3b07b5d2d5 /src | |
parent | 6ba747880532b4278fed801896216146ac63a90d (diff) | |
download | hercules-efdd0ca8f32811f6d7fc78555a0afcdfad308ca8.tar.gz hercules-efdd0ca8f32811f6d7fc78555a0afcdfad308ca8.tar.bz2 hercules-efdd0ca8f32811f6d7fc78555a0afcdfad308ca8.tar.xz hercules-efdd0ca8f32811f6d7fc78555a0afcdfad308ca8.zip |
Fixed Cloaking Exceed.
- Stop hiding status when use skills or attack enemies.
- Added security fixes to clear hiding status in some cases, like warped and reloging.
- Updated walk speed formula.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15408 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/map/battle.c | 3 | ||||
-rw-r--r-- | src/map/clif.c | 5 | ||||
-rw-r--r-- | src/map/status.c | 9 | ||||
-rw-r--r-- | src/map/unit.c | 13 |
4 files changed, 26 insertions, 4 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index c3d22a489..c31058047 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3778,6 +3778,9 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t if (sc && sc->data[SC_CLOAKING] && !(sc->data[SC_CLOAKING]->val4&2)) status_change_end(src, SC_CLOAKING, INVALID_TIMER); + + if (sc && sc->data[SC_CLOAKINGEXCEED] && !(sc->data[SC_CLOAKINGEXCEED]->val4&2)) + status_change_end(src, SC_CLOAKINGEXCEED, INVALID_TIMER); if( tsc && tsc->data[SC_AUTOCOUNTER] && status_check_skilluse(target, src, KN_AUTOCOUNTER, 1) ) { diff --git a/src/map/clif.c b/src/map/clif.c index 65d16f0a6..2810a624b 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9040,7 +9040,7 @@ void clif_parse_QuitGame(int fd, struct map_session_data *sd) WFIFOW(fd,0) = 0x18b; /* Rovert's prevent logout option fixed [Valaris] */ - if( !sd->sc.data[SC_CLOAKING] && !sd->sc.data[SC_HIDING] && !sd->sc.data[SC_CHASEWALK] && + if( !sd->sc.data[SC_CLOAKING] && !sd->sc.data[SC_HIDING] && !sd->sc.data[SC_CHASEWALK] && !sd->sc.data[SC_CLOAKINGEXCEED] && (!battle_config.prevent_logout || DIFF_TICK(gettick(), sd->canlog_tick) > battle_config.prevent_logout) ) { set_eof(fd); @@ -9365,7 +9365,7 @@ void clif_parse_Restart(int fd, struct map_session_data *sd) break; case 0x01: /* Rovert's Prevent logout option - Fixed [Valaris] */ - if( !sd->sc.data[SC_CLOAKING] && !sd->sc.data[SC_HIDING] && !sd->sc.data[SC_CHASEWALK] && + if( !sd->sc.data[SC_CLOAKING] && !sd->sc.data[SC_HIDING] && !sd->sc.data[SC_CHASEWALK] && !sd->sc.data[SC_CLOAKINGEXCEED] && (!battle_config.prevent_logout || DIFF_TICK(gettick(), sd->canlog_tick) > battle_config.prevent_logout) ) { //Send to char-server for character selection. chrif_charselectreq(sd, session[fd]->client_addr); @@ -9579,6 +9579,7 @@ void clif_parse_TakeItem(int fd, struct map_session_data *sd) sd->sc.data[SC_CLOAKING] || sd->sc.data[SC_TRICKDEAD] || sd->sc.data[SC_BLADESTOP] || + sd->sc.data[SC_CLOAKINGEXCEED] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOITEM)) ) break; diff --git a/src/map/status.c b/src/map/status.c index 41ef41ea8..7295d7b4f 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -990,7 +990,7 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s if(sc->data[SC_DANCING] && (unsigned int)hp > status->max_hp>>2) status_change_end(target, SC_DANCING, INVALID_TIMER); if(sc->data[SC_CLOAKINGEXCEED] && --(sc->data[SC_CLOAKINGEXCEED]->val2) <= 0) - status_change_end(target,SC_CLOAKINGEXCEED,-1); + status_change_end(target, SC_CLOAKINGEXCEED, INVALID_TIMER); } unit_skillcastcancel(target, 2); } @@ -1467,6 +1467,8 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, int return 0; if( tsc->data[SC_CAMOUFLAGE] && !(status->mode&(MD_BOSS|MD_DETECTOR)) && !skill_num ) return 0; + if ( tsc->data[SC_CLOAKINGEXCEED] && !(status->mode&MD_BOSS) ) + return 0; } break; case BL_ITEM: //Allow targetting of items to pick'em up (or in the case of mobs, to loot them). @@ -1513,6 +1515,7 @@ int status_check_visibility(struct block_list *src, struct block_list *target) switch (target->type) { //Check for chase-walk/hiding/cloaking opponents. case BL_PC: + if ( tsc->data[SC_CLOAKINGEXCEED] && !(status->mode&MD_BOSS) ) if( (tsc->option&(OPTION_HIDE|OPTION_CLOAK|OPTION_CHASEWALK) || tsc->data[SC_CAMOUFLAGE]) && !(status->mode&MD_BOSS) && ( ((TBL_PC*)target)->special_state.perfect_hiding || !(status->mode&MD_DETECTOR) ) ) return 0; @@ -4414,6 +4417,8 @@ static unsigned short status_calc_speed(struct block_list *bl, struct status_cha val = max( val, 10 * sc->data[SC_AVOID]->val1 ); if( sc->data[SC_INVINCIBLE] && !sc->data[SC_INVINCIBLEOFF] ) val = max( val, 75 ); + if( sc->data[SC_CLOAKINGEXCEED] ) + val = max( val, sc->data[SC_CLOAKINGEXCEED]->val3); //FIXME: official items use a single bonus for this [ultramage] if( sc->data[SC_SPEEDUP0] ) // temporary item-based speedup @@ -6894,7 +6899,7 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val break; case SC_CLOAKINGEXCEED: val2 = ( val1 + 1 ) / 2; // Hits - val3 = ( val1 - 1 ) * 10; // Walk speed + val3 = 90 + val1 * 10; // Walk speed val_flag |= 1|2|4; if (bl->type == BL_PC) val4 |= battle_config.pc_cloak_check_type&7; diff --git a/src/map/unit.c b/src/map/unit.c index 1cfa2bfa2..5e0d5527f 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -1282,6 +1282,12 @@ int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, sh status_change_end(src, SC_CLOAKING, INVALID_TIMER); if (!src->prev) return 0; //Warped away! } + + if( sc && sc->data[SC_CLOAKINGEXCEED] && !(sc->data[SC_CLOAKINGEXCEED]->val4&4) && skill_num != GC_CLOAKINGEXCEED ) + { + status_change_end(src,SC_CLOAKINGEXCEED, INVALID_TIMER); + if (!src->prev) return 0; + } if( casttime > 0 ) { @@ -1395,6 +1401,12 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, sh status_change_end(src, SC_CLOAKING, INVALID_TIMER); if (!src->prev) return 0; //Warped away! } + + if (sc && sc->data[SC_CLOAKINGEXCEED] && !(sc->data[SC_CLOAKINGEXCEED]->val4&4)) + { + status_change_end(src, SC_CLOAKINGEXCEED, INVALID_TIMER); + if (!src->prev) return 0; + } if( casttime > 0 ) { @@ -1955,6 +1967,7 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file, status_change_end(bl, SC_HIDING, INVALID_TIMER); status_change_end(bl, SC_CLOAKING, INVALID_TIMER); status_change_end(bl, SC_CHASEWALK, INVALID_TIMER); + status_change_end(bl, SC_CLOAKINGEXCEED, INVALID_TIMER); if (sc->data[SC_GOSPEL] && sc->data[SC_GOSPEL]->val4 == BCT_SELF) status_change_end(bl, SC_GOSPEL, INVALID_TIMER); status_change_end(bl, SC_CHANGE, INVALID_TIMER); |