summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprotimus <protimus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-01-08 03:26:16 +0000
committerprotimus <protimus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-01-08 03:26:16 +0000
commitefdd0ca8f32811f6d7fc78555a0afcdfad308ca8 (patch)
tree608d7babab1c68c7947c3f0adc8a0a3b07b5d2d5
parent6ba747880532b4278fed801896216146ac63a90d (diff)
downloadhercules-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
-rw-r--r--db/re/skill_db.txt2
-rw-r--r--src/map/battle.c3
-rw-r--r--src/map/clif.c5
-rw-r--r--src/map/status.c9
-rw-r--r--src/map/unit.c13
5 files changed, 27 insertions, 5 deletions
diff --git a/db/re/skill_db.txt b/db/re/skill_db.txt
index 889ec6d69..a619c72bc 100644
--- a/db/re/skill_db.txt
+++ b/db/re/skill_db.txt
@@ -741,7 +741,7 @@
2030,-2,6,4,-1,0x1,0,5,1,no,0,0x200,0,weapon,0, GC_WEAPONCRUSH,Weapon Crush //CHECK SHould this and the above skill have INF2 0x200?
2031,1,6,1,-1,0,0,5,1,no,0,0,0,weapon,0, GC_VENOMPRESSURE,Venom Pressure
2032,5,6,2,0,0x1,0,5,1,yes,0,0,1,none,0, GC_POISONSMOKE,Poison Smoke
-2033,0,6,4,0,0x1,0,5,1,no,0,0,0,none,0, GC_CLOAKINGEXCEED,Cloaking Exceed
+2033,0,6,4,0,0x1,0,5,1,no,0,0,0,weapon,0, GC_CLOAKINGEXCEED,Cloaking Exceed
2034,0,6,4,-1,0x2,3,1,1,no,0,0,0,weapon,0, GC_PHANTOMMENACE,Phantom Menace
2035,0,6,4,0,0x1,0,5,1,no,0,0,0,none,0, GC_HALLUCINATIONWALK,Hallucination Walk
2036,0,6,4,-1,0x2,1,5,1,no,0,0,0,weapon,0, GC_ROLLINGCUTTER,Rolling Cutter
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);