Преглед изворни кода

- Fixed being able to Encore skills you no longer have in your tree.
- Added no HP regen while Bleeding, -25% ATK and ASPD penalties as well.
- Added VIT reduces duration of confusion.
- Added MSC_SPAWN "onspawn" mob skill condition.


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

skotlex пре 19 година
родитељ
комит
cf99ac6795
7 измењених фајлова са 24 додато и 7 уклоњено
  1. 6 0
      Changelog-Trunk.txt
  2. 2 1
      db/mob_skill_db.txt
  3. 2 0
      src/map/mob.c
  4. 1 0
      src/map/mob.h
  5. 3 3
      src/map/pc.c
  6. 2 3
      src/map/skill.c
  7. 8 0
      src/map/status.c

+ 6 - 0
Changelog-Trunk.txt

@@ -5,6 +5,12 @@ 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/01/31
+	* Fixed being able to Encore skills you no longer have in your tree.
+	  [Skotlex]
+	* Added no HP regen while Bleeding, -25% ATK and ASPD penalties as well.
+	  [Skotlex]
+	* Added VIT reduces duration of confusion. [Skotlex]
+	* Added "onspawn" mob skill condition. [Skotlex]
 	* Changed the exp table format. The new format allows specifying exp tables
 	  for any particular class. Thanks to Playstester for converting the official
 	  exp table to the new format. [Skotlex]

+ 2 - 1
db/mob_skill_db.txt

@@ -25,7 +25,8 @@
 // around (11x11 area around self)
 //
 //conditions: (condition type) (value which specifies a condition value)
-//	always			uncondtional
+//	always		unconditional
+//	onspawn		when the mob spawns/respawns.
 //	myhpltmaxrate		when the mob's hp drops to a certain %
 //	mystatuson		If the mob has any abnormalities in status (condition value),
 //	mystatusoff		If the mob has ended any abnormalities in status (condition value),

+ 2 - 0
src/map/mob.c

@@ -1164,6 +1164,7 @@ int mob_spawn (int id)
 
 	clif_spawnmob(md);
 
+	mobskill_use(md, tick, MSC_SPAWN);
 	return 0;
 }
 
@@ -4516,6 +4517,7 @@ static int mob_readskilldb(void)
 		{	"masterhpltmaxrate",MSC_MASTERHPLTMAXRATE	},
 		{	"masterattacked",	MSC_MASTERATTACKED		},
 		{	"alchemist",		MSC_ALCHEMIST			},
+		{	"onspawn",		MSC_SPAWN},
 	}, cond2[] ={
 		{	"anybad",		-1				},
 		{	"stone",		SC_STONE		},

+ 1 - 0
src/map/mob.h

@@ -85,6 +85,7 @@ enum {
 	MSC_MASTERHPLTMAXRATE,
 	MSC_MASTERATTACKED,
 	MSC_ALCHEMIST,
+	MSC_SPAWN,
 };
 
 //Mob skill states.

+ 3 - 3
src/map/pc.c

@@ -7779,7 +7779,8 @@ static int pc_natural_heal_sub(struct map_session_data *sd,va_list ap) {
 			(sd->sc_data[SC_POISON].timer != -1 && sd->sc_data[SC_SLOWPOISON].timer == -1) ||
 			(sd->sc_data[SC_DPOISON].timer != -1 && sd->sc_data[SC_SLOWPOISON].timer == -1) ||
 			sd->sc_data[SC_BERSERK].timer != -1 ||
-			sd->sc_data[SC_TRICKDEAD].timer != -1
+			sd->sc_data[SC_TRICKDEAD].timer != -1 ||
+			sd->sc_data[SC_BLEEDING].timer != -1
 		))
 	) { //Cannot heal neither natural or special.
 		sd->hp_sub = sd->inchealhptick = sd->inchealspirithptick = 0;
@@ -7793,8 +7794,7 @@ static int pc_natural_heal_sub(struct map_session_data *sd,va_list ap) {
 			pc_natural_heal_hp(sd);
 			if(sd->sc_count && (
 				sd->sc_data[SC_EXTREMITYFIST].timer != -1 ||
-				sd->sc_data[SC_DANCING].timer != -1 ||
-				sd->sc_data[SC_BLEEDING].timer != -1
+				sd->sc_data[SC_DANCING].timer != -1
 			))	//No SP natural heal.
 				sd->sp_sub = sd->inchealsptick = 0;
 			else

+ 2 - 3
src/map/skill.c

@@ -8833,12 +8833,11 @@ int skill_use_id (struct map_session_data *sd, int target_id, int skill_num, int
 		break;
 
 	case BD_ENCORE:					/* アンコ?ル */
-		if (!sd->skillid_dance) { //前回使用した踊りがないとだめ
+		if (!sd->skillid_dance || pc_checkskill(sd, sd->skillid_dance) <= 0) { //Prevent using the dance skill if you no longer have the skill in your tree.
 			clif_skill_fail(sd,skill_num,0,0);
 			return 0;
-		} else {
-			sd->skillid_old = skill_num;
 		}
+		sd->skillid_old = skill_num;
 		break;
 
 	case GD_BATTLEORDER:

+ 8 - 0
src/map/status.c

@@ -2114,6 +2114,8 @@ int status_calc_batk(struct block_list *bl, int batk)
   			batk -= batk * 25/100;
 		if(sc_data[SC_CURSE].timer!=-1)
   			batk -= batk * 25/100;
+		if(sc_data[SC_BLEEDING].timer != -1)
+			batk -= batk * 25/100;
 	}
 
 	return batk;
@@ -2475,6 +2477,8 @@ int status_calc_aspd_rate(struct block_list *bl, int aspd_rate)
 				aspd_rate += 25;
 			if(sc_data[SC_GRAVITATION].timer!=-1)
 				aspd_rate += sc_data[SC_GRAVITATION].val2;
+			if(sc_data[SC_BLEEDING].timer != -1)
+				aspd_rate += 25;
 			if(sc_data[SC_JOINTBEAT].timer!=-1) {
 				if (sc_data[SC_JOINTBEAT].val2 == 1)
 					aspd_rate += 25;
@@ -4258,6 +4262,10 @@ int status_change_start(struct block_list *bl,int type,int val1,int val2,int val
 			}
 			break;
 		case SC_CONFUSION:
+			if(!(flag&2)) {
+				int sc_def = 100 - status_get_vit(bl);
+				tick = tick * sc_def / 100;
+			}
 			clif_emotion(bl,1);
 			break;
 		case SC_BLIND:				/* ˆÃ? */