浏览代码

Updated Camouflage behavior (fixes #1438)
* Camouflage now ends when attacking plant type monsters.
* Camouflage bonus is applied to the first skill after activating Camouflage.
* Corrected movement speed bonus checks.
* Removed INF3_NOENDCAMOUFLAGE enum as it is no longer needed.
* Updated skill_db documentation.

aleos89 8 年之前
父节点
当前提交
bec9845499
共有 7 个文件被更改,包括 25 次插入22 次删除
  1. 7 4
      db/import-tmpl/skill_db.txt
  2. 1 1
      db/pre-re/skill_db.txt
  3. 1 1
      db/re/skill_db.txt
  4. 2 0
      src/map/battle.c
  5. 11 13
      src/map/skill.c
  6. 1 1
      src/map/skill.h
  7. 2 2
      src/map/status.c

+ 7 - 4
db/import-tmpl/skill_db.txt

@@ -36,23 +36,24 @@
 //    0x00400 - usable only on party-members (and enemies if skill is offensive)
 //    0x00800 - usable only on guild-mates (and enemies if skill is offensive)
 //    0x01000 - disable usage on enemies (for non-offensive skills).
-//    0x02000 - free
+//    0x02000 - available skill for SC_AUTOSHADOWSPELL
 //    0x04000 - chorus skill
 //    0x08000 - skill that ignore bg reduction
 //    0x10000 - skill that ignore gvg reduction
 //    0x20000 - makes 'self'/'place' skill cannot be casted/placed when near NPC (see 'db/skill_nonearnpc_db.txt' for more options)
+//    0x40000 - skill that can hit trap-type skill (inf2 has 0x00080)
 // 13 maxcount: max amount of skill instances to place on the ground when
 //    player_land_skill_limit/monster_land_skill_limit is enabled. For skills
 //    that attack using a path, this is the path length to be used.
 // 14 attack type (none, weapon, magic, misc)
 // 15 Blowcount (amount of tiles skill knockbacks)
 // 16 inf3 (skill information 3):
-//    0x00001 - skill ignores land protector (e.g. arrow shower)
-//    0x00002 - skill that doesn't end camouflage
+//    0x00001 - skill ignores land protector
+//    0x00002 - free
 //    0x00004 - usable skills while hiding
 //    0x00008 - skill that can be use while in dancing state
 //    0x00010 - skill that could hit emperium
-//    0x00020 - skill blocked by statis
+//    0x00020 - skill ignores SC_STASIS
 //    0x00040 - skill blocked by kagehumi
 //    0x00080 - skill range affected by AC_VULTURE
 //    0x00100 - skill range affected by GS_SNAKEEYE
@@ -65,6 +66,8 @@
 //    0x08000 - skill that can be used to target while under SC__MANHOLE effect
 //    0x10000 - skill that affects hidden targets
 //    0x20000 - skill that affects SC_GLOOMYDAY_SK
+//    0x40000 - skill that is affected by SC_DANCEWITHWUG
+//    0x80000 - skill blocked by RA_WUGBITE
 // 17 Name
 // 18 Description
 

+ 1 - 1
db/pre-re/skill_db.txt

@@ -49,7 +49,7 @@
 // 15 Blowcount (amount of tiles skill knockbacks)
 // 16 inf3 (skill information 3):
 //    0x00001 - skill ignores land protector
-//    0x00002 - skill that doesn't end camouflage
+//    0x00002 - free
 //    0x00004 - usable skills while hiding
 //    0x00008 - skill that can be use while in dancing state
 //    0x00010 - skill that could hit emperium

+ 1 - 1
db/re/skill_db.txt

@@ -49,7 +49,7 @@
 // 15 Blowcount (amount of tiles skill knockbacks)
 // 16 inf3 (skill information 3):
 //    0x00001 - skill ignores land protector
-//    0x00002 - skill that doesn't end camouflage
+//    0x00002 - free
 //    0x00004 - usable skills while hiding
 //    0x00008 - skill that can be use while in dancing state
 //    0x00010 - skill that could hit emperium

+ 2 - 0
src/map/battle.c

@@ -4737,6 +4737,8 @@ struct Damage battle_calc_attack_plant(struct Damage wd, struct block_list *src,
 	int left_element = battle_get_weapon_element(wd, src, target, skill_id, skill_lv, EQI_HAND_L, false);
 	short class_ = status_get_class(target);
 
+	status_change_end(src, SC_CAMOUFLAGE, INVALID_TIMER);
+
 	//Plants receive 1 damage when hit
 	if( attack_hits || wd.damage > 0 )
 		wd.damage = 1; //In some cases, right hand no need to have a weapon to deal a damage

+ 11 - 13
src/map/skill.c

@@ -7045,7 +7045,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 		if (tsce) {
 			i = status_change_end(bl, type, INVALID_TIMER);
 			if( i )
-				clif_skill_nodamage(src,bl,skill_id,( skill_id == LG_FORCEOFVANGUARD ) ? skill_lv : -1,i);
+				clif_skill_nodamage(src,bl,skill_id,( skill_id == LG_FORCEOFVANGUARD || skill_id == RA_CAMOUFLAGE ) ? skill_lv : -1,i);
 			else if( sd )
 				clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
 			map_freeblock_unlock();
@@ -7053,7 +7053,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 		}
 		i = sc_start(src,bl,type,100,skill_lv,skill_get_time(skill_id,skill_lv));
 		if( i )
-			clif_skill_nodamage(src,bl,skill_id,( skill_id == LG_FORCEOFVANGUARD ) ? skill_lv : -1,i);
+			clif_skill_nodamage(src,bl,skill_id,( skill_id == LG_FORCEOFVANGUARD || skill_id == RA_CAMOUFLAGE ) ? skill_lv : -1,i);
 		else if( sd )
 			clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
 		break;
@@ -11180,15 +11180,14 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data)
 
 		map_freeblock_lock();
 
-		// only normal attack and auto cast skills benefit from its bonuses
-		if(!(skill_get_inf3(ud->skill_id)&INF3_NOENDCAMOUFLAGE))
-			status_change_end(src,SC_CAMOUFLAGE, INVALID_TIMER);
-
 		if (skill_get_casttype(ud->skill_id) == CAST_NODAMAGE)
 			skill_castend_nodamage_id(src,target,ud->skill_id,ud->skill_lv,tick,flag);
 		else
 			skill_castend_damage_id(src,target,ud->skill_id,ud->skill_lv,tick,flag);
 
+		if (ud->skill_id != RA_CAMOUFLAGE)
+			status_change_end(src, SC_CAMOUFLAGE, INVALID_TIMER); // Applies to the first skill if active
+
 		sc = status_get_sc(src);
 		if(sc && sc->count) {
 			if(sc->data[SC_SPIRIT] &&
@@ -11390,11 +11389,12 @@ int skill_castend_pos(int tid, unsigned int tick, int id, intptr_t data)
 //			}
 //		}
 		unit_set_walkdelay(src, tick, battle_config.default_walk_delay+skill_get_walkdelay(ud->skill_id, ud->skill_lv), 1);
-		if(!(skill_get_inf3(ud->skill_id)&INF3_NOENDCAMOUFLAGE))
-			status_change_end(src,SC_CAMOUFLAGE, INVALID_TIMER);
 		map_freeblock_lock();
 		skill_castend_pos2(src,ud->skillx,ud->skilly,ud->skill_id,ud->skill_lv,tick,0);
 
+		if (ud->skill_id != RA_CAMOUFLAGE)
+			status_change_end(src, SC_CAMOUFLAGE, INVALID_TIMER); // Applies to the first skill if active
+
 		if( sd && sd->skillitem != AL_WARP ) // Warp-Portal thru items will clear data in skill_castend_map. [Inkfish]
 			sd->skillitem = sd->skillitemlv = 0;
 
@@ -17339,7 +17339,7 @@ void skill_enchant_elemental_end(struct block_list *bl, int type)
 }
 
 /**
- * Check camouflage condition
+ * Check cloaking condition
  * @param bl
  * @param sce
  * @return True if near wall; False otherwise
@@ -17442,10 +17442,8 @@ bool skill_check_camouflage(struct block_list *bl, struct status_change_entry *s
 	}
 
 	if( sce ) {
-		if( !wall ) {
-			if( sce->val1 == 1 ) //End camouflage.
-				status_change_end(bl, SC_CAMOUFLAGE, INVALID_TIMER);
-		}
+		if( !wall && sce->val1 < 3 ) //End camouflage.
+			status_change_end(bl, SC_CAMOUFLAGE, INVALID_TIMER);
 		status_calc_bl(bl,SCB_SPEED);
 	}
 

+ 1 - 1
src/map/skill.h

@@ -79,7 +79,7 @@ enum e_skill_inf2 {
 /// Skill info type 3
 enum e_skill_inf3 {
 	INF3_NOLP             = 0x00001, // Skill that can ignore Land Protector
-	INF3_NOENDCAMOUFLAGE  = 0x00002, // Skill that doesn't end camouflage
+	INF3_FREE             = 0x00002, // Free
 	INF3_USABLE_HIDING    = 0x00004, // Skill that can be use in hiding
 	INF3_USABLE_DANCE     = 0x00008, // Skill that can be use while in dancing state
 	INF3_HIT_EMP          = 0x00010, // Skill that could hit emperium

+ 2 - 2
src/map/status.c

@@ -6286,8 +6286,8 @@ static unsigned short status_calc_speed(struct block_list *bl, struct status_cha
 				val = max( val, 50 );
 			if( sc->data[SC_MARSHOFABYSS] )
 				val = max( val, sc->data[SC_MARSHOFABYSS]->val3 );
-			if( sc->data[SC_CAMOUFLAGE] && (sc->data[SC_CAMOUFLAGE]->val3&1) == 0 )
-				val = max( val, sc->data[SC_CAMOUFLAGE]->val1 < 3 ? 0 : 25 * (5 - sc->data[SC_CAMOUFLAGE]->val1) );
+			if( sc->data[SC_CAMOUFLAGE] && sc->data[SC_CAMOUFLAGE]->val1 > 2 )
+				val = max( val, 25 * (5 - sc->data[SC_CAMOUFLAGE]->val1) );
 			if( sc->data[SC_STEALTHFIELD] )
 				val = max( val, 20 );
 			if( sc->data[SC__LAZINESS] )