Browse Source

- Fixed Potion Pitcher sometimes crashing the server.
- Fixed a compile warning by adjusting the acid demonstration formula.
- Added flag 2 to the skill_castnodex_db file for skills that shouldn't be affected by delay/cast reducing skills/effects.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5714 54d463be-8e91-2dee-dedb-b68131a5f0ec

skotlex 19 năm trước cách đây
mục cha
commit
edc99399f6
5 tập tin đã thay đổi với 59 bổ sung42 xóa
  1. 5 0
      Changelog-Trunk.txt
  2. 3 1
      conf-tmpl/mapflag/water_height.txt
  3. 7 4
      db/skill_castnodex_db.txt
  4. 7 7
      src/map/battle.c
  5. 37 30
      src/map/skill.c

+ 5 - 0
Changelog-Trunk.txt

@@ -5,6 +5,11 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.  EV
 GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
 
 2006/03/23
+	* Fixed Potion Pitcher sometimes crashing the server. [Skotlex]
+	* Fixed a compile warning by adjusting the acid demonstration formula.
+	  [Skotlex]
+	* Added flag 2 to the skill_castnodex_db file for skills that shouldn't be
+	  affected by delay/cast reducing skills/effects. [Skotlex]
 	* Added SantaPoring's water_height.txt modifications. [Lance]
 	* Minor cleanups. [Lance]
 

+ 3 - 1
conf-tmpl/mapflag/water_height.txt

@@ -3,6 +3,8 @@
 // map_name map_water_level_to_use
 // Example: Use geffen's water level for prontera when prontera.rsw isn't found in the grf.
 // prontera.gat	geffen.gat
+// You can also directly specify the rsw file:
+// prontera.gat	geffen.rsw
 
 force_1-1.gat	force_map1.gat
 force_2-1.gat	force_map1.gat
@@ -175,4 +177,4 @@ y_airport.gat	airport.gat
 lhz_airport.gat	airport.gat
 airplane_01.gat	airplane.gat
 que_job03.gat	que_job02.gat
-p_track02.gat	p_track01.gat
+p_track02.gat	p_track01.gat

+ 7 - 4
db/skill_castnodex_db.txt

@@ -1,7 +1,10 @@
 //<Skill id>,<Cast: 1 or 0>,<Delay (Optional): 1 or 0>
 // Cast: With 1, dex does not affect the skill's cast rate
+// Cast: With 2, cast-rate cannot be reduced by Suffragium and the like
+// Cast: With 3, same effect as 1 + 2
 // Cast: With 0, dex affects the skill's cast rate
 // Delay: With 1, dex does not affect the skill's delay rate
+// Delay: With 2, delay cannot be reduced by Suffragium and the like
 // Delay: With 0, dex affects the skill's delay rate
 // Example - 46,1,1 = Double Strafe's casting time and delay is not affected by dex.
 // By default, dex NEVER affects after-cast delay, so no need of putting 'x,0,1' in this file
@@ -34,7 +37,7 @@
 468,1 //SL_STUN
 469,1 //SL_SMA
 1014,1	//PR_REDEMPTIO
-10010,1	//GD_BATTLEORDER
-10011,1	//GD_REGENERATION
-10012,1	//GD_RESTORE
-10013,1	//GD_EMERGENCYCALL
+10010,3	//GD_BATTLEORDER
+10011,3	//GD_REGENERATION
+10012,3	//GD_RESTORE
+10013,3	//GD_EMERGENCYCALL

+ 7 - 7
src/map/battle.c

@@ -2807,13 +2807,13 @@ struct Damage  battle_calc_misc_attack(
 		aflag = (aflag&~BF_RANGEMASK)|BF_LONG;
 		break;
 	case CR_ACIDDEMONSTRATION:
-		//This equation is not official, but it's the closest to the official one 
-		//that Viccious Pucca and the other folks at the forums could come up with. [Skotlex]
-		// updated the formula based on a Japanese formula found to be exact [Reddozen]
-		damage = (int)((0.7 * status_get_vit(target) * (int_ * int_)) / (status_get_vit(target) + int_));
-		if (tsd) damage/=2;
-		aflag = (aflag&~BF_RANGEMASK)|BF_LONG;
-		break;
+		{	// updated the formula based on a Japanese formula found to be exact [Reddozen]
+			int vit = status_get_vit(target);
+			damage = 7*(vit*int_*int_) / (10*(vit+int_));
+			if (tsd) damage/=2;
+			aflag = (aflag&~BF_RANGEMASK)|BF_LONG;
+			break;
+		}
 	case NJ_ZENYNAGE:
 		{
 		int dmgnage = (500*skill_lv)+rand()%(500*skill_lv);

+ 37 - 30
src/map/skill.c

@@ -4544,6 +4544,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 					hp = hp * (100 + pc_checkskill(dstsd,SM_RECOVERY)*10) / 100;
 			}
 			tbl.id = 0;
+			tbl.type = BL_NUL;
 			tbl.m = src->m;
 			tbl.x = src->x;
 			tbl.y = src->y;
@@ -8224,6 +8225,7 @@ int skill_check_condition(struct map_session_data *sd,int skill, int lv, int typ
 int skill_castfix( struct block_list *bl, int skill_id, int skill_lv, int time)
 {
 	struct status_change *sc;
+	int castnodex = skill_get_castnodex(skill_id, skill_lv);
 	
 	nullpo_retr(0, bl);
 
@@ -8232,7 +8234,7 @@ int skill_castfix( struct block_list *bl, int skill_id, int skill_lv, int time)
 		nullpo_retr(0, sd);
 
 		// calculate base cast time (reduced by dex)
-		if (!skill_get_castnodex(skill_id, skill_lv) > 0) {
+		if (castnodex&~1) {
 			int scale = battle_config.castrate_dex_scale - status_get_dex(bl);
 			if (scale > 0)	// not instant cast
 				time = time * scale / battle_config.castrate_dex_scale;
@@ -8247,28 +8249,30 @@ int skill_castfix( struct block_list *bl, int skill_id, int skill_lv, int time)
 		if (sd->castrate != 100)
 			time -= time * (100 - sd->castrate) / 100;
 	} else if (bl->type == BL_PET) { //Skotlex: Simple scaling
-		int scale = battle_config.castrate_dex_scale - status_get_dex(bl);
-		if (scale > 0)	// not instant cast
-			time = time * scale / battle_config.castrate_dex_scale;
-		else return 0;	// instant cast
-		
+		if (castnodex&~1) {
+			int scale = battle_config.castrate_dex_scale - status_get_dex(bl);
+			if (scale > 0)	// not instant cast
+				time = time * scale / battle_config.castrate_dex_scale;
+			else return 0;	// instant cast
+		}
 		if (battle_config.cast_rate != 100)
 			time = time * battle_config.cast_rate / 100;
 	}
 
-	// calculate cast time reduced by skill bonuses
-	sc = status_get_sc(bl);
-	/* ƒTƒtƒ‰ƒMƒEƒ€ */
-	if (sc && sc->count) {
-		if (sc->data[SC_SUFFRAGIUM].timer != -1) {
-			time -= time * (sc->data[SC_SUFFRAGIUM].val1 * 15) / 100;
-			status_change_end(bl, SC_SUFFRAGIUM, -1);
+	if (castnodex&~2)
+  	{	// calculate cast time reduced by skill bonuses
+		sc = status_get_sc(bl);
+		/* ƒTƒtƒ‰ƒMƒEƒ€ */
+		if (sc && sc->count) {
+			if (sc->data[SC_SUFFRAGIUM].timer != -1) {
+				time -= time * (sc->data[SC_SUFFRAGIUM].val1 * 15) / 100;
+				status_change_end(bl, SC_SUFFRAGIUM, -1);
+			}
+			/* ƒuƒ‰ƒM‚ÌŽ? */
+			if (sc->data[SC_POEMBRAGI].timer != -1)
+				time -= time * sc->data[SC_POEMBRAGI].val2 / 100;
 		}
-		/* ƒuƒ‰ƒM‚ÌŽ? */
-		if (sc->data[SC_POEMBRAGI].timer != -1)
-			time -= time * sc->data[SC_POEMBRAGI].val2 / 100;
 	}
-
 	// return final cast time
 	return (time > 0) ? time : 0;
 }
@@ -8278,7 +8282,8 @@ int skill_castfix( struct block_list *bl, int skill_id, int skill_lv, int time)
  */
 int skill_delayfix( struct block_list *bl, int skill_id, int skill_lv, int time )
 {
-	struct status_change *sc;	
+	struct status_change *sc;
+	int delaynodex = skill_get_delaynodex(skill_id, skill_lv);
 
 	nullpo_retr(0, bl);
 
@@ -8295,13 +8300,13 @@ int skill_delayfix( struct block_list *bl, int skill_id, int skill_lv, int time
 		} else if (time < 0)
 			time = -time + status_get_amotion(bl);	// if set to <0, the attack motion is added.
 
-		if (battle_config.delay_dependon_dex &&	/* dex‚̉e‹¿‚ðŒvŽZ‚·‚é */
-			!skill_get_delaynodex(skill_id, skill_lv))	// if skill casttime is allowed to be reduced by dex
-		{
+		if (battle_config.delay_dependon_dex && delaynodex&~1)
+		{	// if skill casttime is allowed to be reduced by dex
 			int scale = battle_config.castrate_dex_scale - status_get_dex(bl);
-			if (scale < 0)
-				scale = 0;
-			time = time * scale / battle_config.castrate_dex_scale;
+			if (scale > 0)
+				time = time * scale / battle_config.castrate_dex_scale;
+			else
+				time = battle_config.min_skill_delay_limit;
 		}
 
 		if (battle_config.delay_rate != 100)
@@ -8314,12 +8319,13 @@ int skill_delayfix( struct block_list *bl, int skill_id, int skill_lv, int time
 			time = battle_config.min_skill_delay_limit;
 	}
 
-	/* ƒuƒ‰ƒM‚ÌŽ? */
-	sc= status_get_sc(bl);
-	if (sc && sc->count) {
-		if (sc->data[SC_POEMBRAGI].timer != -1)
-			time -= time * sc->data[SC_POEMBRAGI].val3 / 100;
-		if (sc->data[SC_SPIRIT].timer != -1)
+	if (delaynodex&~2)
+	{	/* ƒuƒ‰ƒM‚ÌŽ? */
+		sc= status_get_sc(bl);
+		if (sc && sc->count) {
+			if (sc->data[SC_POEMBRAGI].timer != -1)
+				time -= time * sc->data[SC_POEMBRAGI].val3 / 100;
+			if (sc->data[SC_SPIRIT].timer != -1)
 			switch (skill_id) {
 				case CR_SHIELDBOOMERANG:
 					if (sc->data[SC_SPIRIT].val2 == SL_CRUSADER)
@@ -8330,6 +8336,7 @@ int skill_delayfix( struct block_list *bl, int skill_id, int skill_lv, int time
 						time /= 2;
 					break;
 			}
+		}
 	}
 
 	return (time > 0) ? time : 0;