Переглянути джерело

- Removed sg_miracle_skill_duration, replaced it with sg_miracle_skill_min_duration and sg_miracle_skill_max_duration, to specify a range for the duration of the skill.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8679 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 18 роки тому
батько
коміт
50e0a52c9b
6 змінених файлів з 31 додано та 6 видалено
  1. 3 0
      Changelog-Trunk.txt
  2. 5 0
      conf-tmpl/Changelog.txt
  3. 3 2
      conf-tmpl/battle/skill.conf
  4. 15 2
      src/map/battle.c
  5. 2 1
      src/map/battle.h
  6. 3 1
      src/map/unit.c

+ 3 - 0
Changelog-Trunk.txt

@@ -4,6 +4,9 @@ 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/09/08
+	* Removed sg_miracle_skill_duration, replaced it with
+	  sg_miracle_skill_min_duration and sg_miracle_skill_max_duration, to specify
+	  a range for the duration of the skill. [Skotlex]
 	* Added upgrade_svn8675.sql in case, for some reason, your guild table
 	  still has the emblem_data field as a 'blob' with "NOT NULL" specified.
 	  [Skotlex]

+ 5 - 0
conf-tmpl/Changelog.txt

@@ -1,5 +1,10 @@
 Date	Added
 
+2006/09/08
+	* Removed sg_miracle_skill_duration, replaced it with
+	  sg_miracle_skill_min_duration and sg_miracle_skill_max_duration, to specify
+	  a range for the duration of the skill. [Skotlex]
+	* Skill duration for sg miracle is now 1h ~ 2.5h [Skotlex]
 2006/09/07
 	* Changed the default of sg_angel_skill_ratio to 10 based on recent
 	  information from Tharis. [Skotlex]

+ 3 - 2
conf-tmpl/battle/skill.conf

@@ -261,8 +261,9 @@ allow_es_magic_player: no
 //Miracle of the Sun, Moon and Stars skill ratio (100% = 10000)
 sg_miracle_skill_ratio: 1
 
-//Miracle of the Sun, Moon and Stars skill duration in milisecons
-sg_miracle_skill_duration: 3600000
+//Miracle of the Sun, Moon and Stars skill duration in miliseconds
+sg_miracle_skill_min_duration: 3600000
+sg_miracle_skill_max_duration: 9000000
 
 //Angel of the Sun, Moon and Stars skill ratio (100% = 10000)
 sg_angel_skill_ratio: 10

+ 15 - 2
src/map/battle.c

@@ -3806,7 +3806,8 @@ static const struct battle_data_int {
 	{ "night_duration",                    &battle_config.night_duration	}, // added by [Yor]
 	{ "max_heal",                          &battle_config.max_heal },
 	{ "mob_remove_delay",                  &battle_config.mob_remove_delay	},
-	{ "sg_miracle_skill_duration",				&battle_config.sg_miracle_skill_duration },
+	{ "sg_miracle_skill_min_duration",		&battle_config.sg_miracle_skill_duration_min },
+	{ "sg_miracle_skill_max_duration",		&battle_config.sg_miracle_skill_duration_max },
 	{ "hvan_explosion_intimate",					&battle_config.hvan_explosion_intimate },	//[orn]
 };
 
@@ -4195,7 +4196,8 @@ void battle_set_defaults() {
 	battle_config.mob_max_sc_def = 5000;
 	battle_config.sg_miracle_skill_ratio=1;
 	battle_config.sg_angel_skill_ratio=1;
-	battle_config.sg_miracle_skill_duration=600000;
+	battle_config.sg_miracle_skill_duration_min=3000000;
+	battle_config.sg_miracle_skill_duration_max=9000000;
 	battle_config.autospell_stacking = 0;
 	battle_config.override_mob_names = 0;
 	battle_config.min_chat_delay = 0;
@@ -4371,6 +4373,17 @@ void battle_validate_conf() {
 	if (battle_config.sg_miracle_skill_ratio > 10000)
 		battle_config.sg_miracle_skill_ratio = 10000;
 
+	
+	if (battle_config.sg_miracle_skill_duration_min < 1000)
+		battle_config.sg_miracle_skill_duration_min = 1000;
+
+	//Store duration variation in the max setting
+	battle_config.sg_miracle_skill_duration_max -=
+		battle_config.sg_miracle_skill_duration_min;
+
+	if (battle_config.sg_miracle_skill_duration_max < 2000)
+		battle_config.sg_miracle_skill_duration_max = 2000;
+
 	if (battle_config.skill_steal_max_tries > UCHAR_MAX)
 		battle_config.skill_steal_max_tries = UCHAR_MAX;	
 

+ 2 - 1
src/map/battle.h

@@ -434,7 +434,8 @@ extern struct Battle_Config {
 
 	unsigned short sg_angel_skill_ratio;
 	unsigned short sg_miracle_skill_ratio;
-	int sg_miracle_skill_duration;
+	int sg_miracle_skill_duration_min;
+	int sg_miracle_skill_duration_max;
 	unsigned short autospell_stacking; //Enables autospell cards to stack. [Skotlex]
 	unsigned short override_mob_names; //Enables overriding spawn mob names with the mob_db names. [Skotlex]
 	unsigned short min_chat_delay; //Minimum time between client messages. [Skotlex]

+ 3 - 1
src/map/unit.c

@@ -190,7 +190,9 @@ static int unit_walktoxy_timer(int tid,unsigned int tick,int id,int data)
 			rand()%10000 < battle_config.sg_miracle_skill_ratio
 		) {	//SG_MIRACLE [Komurka]
 			clif_displaymessage(sd->fd,"[Miracle of the Sun, Moon and Stars]");
-			sc_start(&sd->bl,SC_MIRACLE,100,1,battle_config.sg_miracle_skill_duration);
+			sc_start(&sd->bl,SC_MIRACLE,100,1,
+				battle_config.sg_miracle_skill_duration_min+
+				rand()%battle_config.sg_miracle_skill_duration_max);
 		}
 	} else if (md) {
 		if(battle_config.mob_warp&1 && map_getcell(bl->m,x,y,CELL_CHKNPC) &&