Browse Source

Added homunculus_friendly_rate battle config

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8361 54d463be-8e91-2dee-dedb-b68131a5f0ec
toms 19 năm trước cách đây
mục cha
commit
066765b702

+ 1 - 0
Changelog-Trunk.txt

@@ -4,6 +4,7 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2006/08/19
+	* Added homunculus_friendly_rate battle config [Toms]
 	* Some compilation warnings fixed [Toms]
 	* Added skill's required item check on homunc skills [Toms]
 	* Add Condensed Red Potion as a required item for HLIF_HEAL [Toms]

+ 31 - 0
conf-tmpl/battle/homunc.conf

@@ -0,0 +1,31 @@
+//      ______  __    __                                 
+//     /\  _  \/\ \__/\ \                                
+//   __\ \ \L\ \ \ ,_\ \ \___      __    ___      __     
+// /'__`\ \  __ \ \ \/\ \  _ `\  /'__`\/' _ `\  /'__`\   
+///\  __/\ \ \/\ \ \ \_\ \ \ \ \/\  __//\ \/\ \/\ \L\.\_ 
+//\ \____\\ \_\ \_\ \__\\ \_\ \_\ \____\ \_\ \_\ \__/.\_\
+// \/____/ \/_/\/_/\/__/ \/_/\/_/\/____/\/_/\/_/\/__/\/_/
+//  _   _   _   _   _   _   _     _   _   _   _   _   _
+// / \ / \ / \ / \ / \ / \ / \   / \ / \ / \ / \ / \ / \ 
+//( e | n | g | l | i | s | h ) ( A | t | h | e | n | a )
+// \_/ \_/ \_/ \_/ \_/ \_/ \_/   \_/ \_/ \_/ \_/ \_/ \_/
+//
+//--------------------------------------------------------------
+// eAthena Battle Configuration File
+// Originally Translated by Peter Kieser <pfak@telus.net>
+// Made in to plainer English by Ancyker
+//--------------------------------------------------------------
+//Note 1: Directives can be set using on/off, yes/no or 1/0.
+//Note 2: All rates are in percents, 100 would mean 100%, 200
+//   would mean 200%, etc
+//Note 3: Value is not limited to 60K (see below)
+// Other Information:
+// All options are limited to a max of 60K (aprox) which is 600%
+// or 60secs as appropiate.
+// 1000 miliseconds is 1 second.
+// Unless otherwise specified, the minimum value is 0 for all
+// features.
+//--------------------------------------------------------------
+
+// The rate a homunculus will get friendly by feeding it. (Note 2)
+homunculus_friendly_rate: 100

+ 3 - 0
conf-tmpl/battle_athena.conf

@@ -47,6 +47,9 @@ import: conf/battle/party.conf
 //Pet related configuration
 import: conf/battle/pet.conf
 
+//Homunc related configuration
+import: conf/battle/homunc.conf
+
 //Player specific settings
 import: conf/battle/player.conf
 

+ 2 - 0
src/map/battle.c

@@ -3738,6 +3738,7 @@ static const struct battle_data_short {
 	{ "override_mob_names", 				&battle_config.override_mob_names },
 	{ "min_chat_delay",						&battle_config.min_chat_delay },
 	{ "homunculus_show_growth",					&battle_config.homunculus_show_growth },	//[orn]
+	{ "homunculus_friendly_rate",				&battle_config.homunculus_friendly_rate },
 };
 
 static const struct battle_data_int {
@@ -4171,6 +4172,7 @@ void battle_set_defaults() {
 	battle_config.min_chat_delay = 0;
 	battle_config.hvan_explosion_intimate = 45000;	//[orn]
 	battle_config.homunculus_show_growth = 0;	//[orn]
+	battle_config.homunculus_friendly_rate = 100;
 }
 
 void battle_validate_conf() {

+ 1 - 1
src/map/battle.h

@@ -437,7 +437,7 @@ extern struct Battle_Config {
 	unsigned short min_chat_delay; //Minimum time between client messages. [Skotlex]
 	unsigned int hvan_explosion_intimate ;	// fix [albator]
 	unsigned short homunculus_show_growth ;	//[orn]
-
+	unsigned short homunculus_friendly_rate;
 } battle_config;
 
 void do_init_battle(void);

+ 3 - 0
src/map/mercenary.c

@@ -393,6 +393,9 @@ int merc_hom_gainexp(struct homun_data *hd,int exp)
 // Return then new value
 int merc_hom_increase_intimacy(struct homun_data * hd, unsigned int value)
 {
+	if (battle_config.homunculus_friendly_rate != 100)
+		value = (value * battle_config.homunculus_friendly_rate) / 100;
+
 	if (hd->master->homunculus.intimacy + value <= 100000)
 		hd->master->homunculus.intimacy += value;
 	else