diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map/battle.c | 3 | ||||
-rw-r--r-- | src/map/skill.c | 7 | ||||
-rw-r--r-- | src/map/status.c | 11 | ||||
-rw-r--r-- | src/map/unit.c | 25 |
4 files changed, 22 insertions, 24 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index a519e3a65..1136ec989 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3119,6 +3119,9 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target, return 0;
}
+ if (sc && sc->data[SC_CLOAKING].timer != -1 && !sc->data[SC_CLOAKING].val4)
+ status_change_end(src,SC_CLOAKING,-1);
+
//Check for counter attacks that block your attack. [Skotlex]
if(tsc)
{
diff --git a/src/map/skill.c b/src/map/skill.c index ee9f34a07..77705973a 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -4998,8 +4998,13 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in sc_start(bl,SC_INCAGI,100,skilllv*10,skill_get_time(skillid, skilllv)));
break;
- case NPC_SIEGEMODE:
case NPC_INVISIBLE:
+ //val4 passed as 1 is for "infinite cloak".
+ clif_skill_nodamage(src,bl,skillid,skilllv,
+ sc_start4(bl,type,100,skilllv,0,0,1,skill_get_time(skillid,skilllv)));
+ break;
+
+ case NPC_SIEGEMODE:
// not sure what it does
clif_skill_nodamage(src,bl,skillid,skilllv,1);
break;
diff --git a/src/map/status.c b/src/map/status.c index 14498f490..a4e47a97f 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -206,6 +206,7 @@ void initChangeTables(void) { set_sc(NPC_STOP, SC_STOP, SI_BLANK);
set_sc(NPC_BREAKWEAPON, SC_BROKENWEAPON, SI_BROKENWEAPON);
set_sc(NPC_BREAKARMOR, SC_BROKENARMOR, SI_BROKENARMOR);
+ set_sc(NPC_INVISIBLE, SC_CLOAKING, SI_CLOAKING);
set_sc(LK_AURABLADE, SC_AURABLADE, SI_AURABLADE);
set_sc(LK_PARRYING, SC_PARRYING, SI_PARRYING);
set_sc(LK_CONCENTRATION, SC_CONCENTRATION, SI_CONCENTRATION);
@@ -4178,11 +4179,17 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val case SC_CLOAKING: /* クロ?キング */
if (flag&4)
break;
- if(bl->type != BL_PC)
- tick = 5000*val1;
calc_flag = 1; // [Celest]
val2 = tick;
val3 = type==SC_CLOAKING ? 130-val1*3 : 135-val1*5;
+ if (!val4)
+ { //val4 signals eternal cloaking (not cancelled on attack) [Skotlex]
+ //Standard cloaking.
+ if (bl->type == BL_PC)
+ val4 = battle_config.pc_cloak_check_type&2?1:0;
+ else
+ val4 = battle_config.monster_cloak_check_type&2?1:0;
+ }
break;
case SC_SIGHT: /* サイト/ルアフ */
case SC_RUWACH:
diff --git a/src/map/unit.c b/src/map/unit.c index 8b60d4ef5..ba33bc8d2 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -901,13 +901,8 @@ int unit_skilluse_id2(struct block_list *src, int target_id, int skill_num, int ud->skillid = skill_num;
ud->skilllv = skill_lv;
- if(
- (sd && !(battle_config.pc_cloak_check_type&2) ) ||
- (src->type == BL_MOB && !(battle_config.monster_cloak_check_type&2) )
- ) {
- if( sc && sc->data[SC_CLOAKING].timer != -1 && skill_num != AS_CLOAKING)
- status_change_end(src,SC_CLOAKING,-1);
- }
+ if(sc && sc->data[SC_CLOAKING].timer != -1 && !sc->data[SC_CLOAKING].val4 && skill_num != AS_CLOAKING)
+ status_change_end(src,SC_CLOAKING,-1);
if(casttime > 0) {
ud->skilltimer = add_timer( tick+casttime, skill_castend_id, src->id, 0 );
@@ -1010,12 +1005,8 @@ int unit_skilluse_pos2( struct block_list *src, int skill_x, int skill_y, int sk ud->skilly = skill_y;
ud->skilltarget = 0;
- if((sd && !(battle_config.pc_cloak_check_type&2)) ||
- (src->type==BL_MOB && !(battle_config.monster_cloak_check_type&2))
- ) {
- if (sc && sc->data[SC_CLOAKING].timer != -1)
- status_change_end(src,SC_CLOAKING,-1);
- }
+ if (sc && sc->data[SC_CLOAKING].timer != -1 && !sc->data[SC_CLOAKING].val4)
+ status_change_end(src,SC_CLOAKING,-1);
if(casttime > 0) {
ud->skilltimer = add_timer( tick+casttime, skill_castend_pos, src->id, 0 );
@@ -1283,14 +1274,6 @@ static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int t map_freeblock_lock();
ud->attacktarget_lv = battle_weapon_attack(src,target,tick,0);
- if(
- (sd && !(battle_config.pc_cloak_check_type&2)) ||
- (!sd && !(battle_config.monster_cloak_check_type&2))
- ) {
- struct status_change *sc = status_get_sc(src);
- if (sc && sc->count && sc->data[SC_CLOAKING].timer != -1)
- status_change_end(src,SC_CLOAKING,-1);
- }
if(sd && sd->status.pet_id > 0 && sd->pd && sd->petDB && battle_config.pet_attack_support)
pet_target_check(sd,target,0);
|