Explorar o código

Added config option for legacy NPC EMOTION behavior (#4728)

Co-authored-by: Victor Ferreira <victor.ferreira@esig.com.br>
victorgawk %!s(int64=5) %!d(string=hai) anos
pai
achega
044acebd75
Modificáronse 4 ficheiros con 12 adicións e 2 borrados
  1. 7 0
      conf/battle/skill.conf
  2. 1 0
      src/map/battle.cpp
  3. 1 0
      src/map/battle.hpp
  4. 3 2
      src/map/skill.cpp

+ 7 - 0
conf/battle/skill.conf

@@ -370,6 +370,13 @@ can_damage_skill: 1
 // Legacy Athena: 1
 land_protector_behavior: 0
 
+// NPC EMOTION behavior (Note 1)
+// On official servers, certain mobs cast NPC EMOTION skill which displays an emoticon and change their mode from
+// Aggressive to Passive for a certain time. The Athena behavior does not change their mode to Passive.
+// Official: 0
+// Legacy Athena: 1
+npc_emotion_behavior: 0
+
 // Should Tarot Card of Fate have the same chance for each card to occur? (Note 1)
 // Official chances: 15%: LOVERS | 10%: FOOL, MAGICIAN, HIGH PRIESTESS, STRENGTH, SUN | 8%: TEMPERANCE
 // 7%: CHARIOT | 6%: THE HANGED MAN | 5%: DEATH, STAR | 2%: TOWER | 1%: WHEEL OF FORTUNE, DEVIL

+ 1 - 0
src/map/battle.cpp

@@ -8717,6 +8717,7 @@ static const struct _battle_data {
 	{ "mail_show_status",                   &battle_config.mail_show_status,                0,      0,      2,              },
 	{ "client_limit_unit_lv",               &battle_config.client_limit_unit_lv,            0,      0,      BL_ALL,         },
 	{ "land_protector_behavior",            &battle_config.land_protector_behavior,         0,      0,      1,              },
+	{ "npc_emotion_behavior",               &battle_config.npc_emotion_behavior,            0,      0,      1,              },
 // BattleGround Settings
 	{ "bg_update_interval",                 &battle_config.bg_update_interval,              1000,   100,    INT_MAX,        },
 	{ "bg_short_attack_damage_rate",        &battle_config.bg_short_damage_rate,            80,     0,      INT_MAX,        },

+ 1 - 0
src/map/battle.hpp

@@ -349,6 +349,7 @@ struct Battle_Config
 	int prevent_logout;	// Added by RoVeRT
 	int prevent_logout_trigger;
 	int land_protector_behavior;
+	int npc_emotion_behavior;
 
 	int alchemist_summon_reward;	// [Valaris]
 	int drops_by_luk;

+ 3 - 2
src/map/skill.cpp

@@ -8798,7 +8798,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 				status_change_end(bl, type, INVALID_TIMER);
 
 			//If mode gets set by NPC_EMOTION then the target should be reset [Playtester]
-			if(skill_id == NPC_EMOTION && md->db->skill[md->skill_idx].val[1])
+			if(!battle_config.npc_emotion_behavior && skill_id == NPC_EMOTION && md->db->skill[md->skill_idx].val[1])
 				mob_unlocktarget(md,tick);
 
 			if(md->db->skill[md->skill_idx].val[1] || md->db->skill[md->skill_idx].val[2])
@@ -8809,7 +8809,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 					skill_get_time(skill_id, skill_lv));
 
 			//Reset aggressive state depending on resulting mode
-			md->state.aggressive = status_has_mode(&md->status,MD_ANGRY)?1:0;
+			if (!battle_config.npc_emotion_behavior)
+				md->state.aggressive = status_has_mode(&md->status,MD_ANGRY)?1:0;
 		}
 		break;