Jump to content
  • 0
karazu

Critical Strike on Magic [Error] (Still not solve)

Question

If somebody can also CONVERT this one to HERC much appreciated ..


I am patching this to my server
Source Rathena
http://rathena.org/board/topic/71862-critical-hit-on-magic-2/

 

 

The whole Patch
 

Index: src/map/mob.h===================================================================--- src/map/mob.h	(revision 16936)+++ src/map/mob.h	(working copy)@@ -123,6 +123,7 @@ 	struct block_list bl; 	struct unit_data  ud; 	struct view_data *vd;+	struct tmp_data tmpd; 	struct status_data status, *base_status; //Second one is in case of leveling up mobs, or tiny/large mobs. 	struct status_change sc; 	struct mob_db *db;	//For quick data access (saves doing mob_db(md->class_) all the time) [Skotlex]Index: src/map/pc.h===================================================================--- src/map/pc.h	(revision 16936)+++ src/map/pc.h	(working copy)@@ -91,6 +91,7 @@ 	struct block_list bl; 	struct unit_data ud; 	struct view_data vd;+	struct tmp_data tmpd; 	struct status_data base_status, battle_status; 	struct status_change sc; 	struct regen_data regen;Index: src/map/skill.c===================================================================--- src/map/skill.c	(revision 16936)+++ src/map/skill.c	(working copy)@@ -2110,7 +2110,38 @@  	return 0; }-+int skill_mcri_hit(int tid, unsigned int tick, int id, intptr_t data)+{+	struct mob_data *md = (struct mob_data *)data;+	struct tmp_data *tmpd;+	tmpd = &md->tmpd;+	if(tmpd!=NULL)+	{+	switch(1) // 1 = red ; 2 = blue+	{+	case 1:+		clif_damage(tmpd->src, tmpd->bl, gettick(), 1, 1, id, 0, 10, 0);+		break;+	case 2:+		clif_skill_damage(tmpd->src,tmpd->bl,gettick(), 1, 1, id, 0, TK_STORMKICK, 1, 8);+		clif_skill_nodamage(tmpd->src,tmpd->src,tmpd->num[0],tmpd->num[1],1);+		break;+	}+	}+	return 0;+}+int skill_mcri_kill_delay(int tid, unsigned int tick, int id, intptr_t data)+{+	struct block_list *bl = map_id2bl(id);+	struct block_list *src = (struct block_list *)data;+	struct mob_data *md = BL_CAST(BL_MOB, bl);+	if(bl!=NULL)+	{+		mob_dead(md,src,0);+		status_kill(bl);+	}+	return 0;+} /*  * =========================================================================  * Does a skill attack with the given properties.@@ -2449,6 +2480,48 @@ 	default: 		if( flag&SD_ANIMATION && dmg.div_ < 2 ) //Disabling skill animation doesn't works on multi-hit. 			type = 5;+		//m_cri+		if ( src->type == BL_PC || battle_get_master(src)->type == BL_PC )+		{+			char m_cri = 0;+			if(sd==NULL)+				m_cri = cap_value(map_id2sd(battle_get_master(src)->id)->battle_status.cri/10,1,100);+			else+				m_cri = cap_value(sd->battle_status.cri/10,1,100);+			if( rand()%100 < m_cri )+			{+				struct mob_data *md=NULL;+				struct tmp_data *tmpd=NULL;+				int d_ = 200;+				unsigned int u_ = 0;+				int i=0, num=abs(skill_get_num(skillid,skilllv)), _damage=0;+				damage *= 2;				+				md = mob_once_spawn_sub(src, src->m, src->x, src->y, "--en--",1083,"", SZ_SMALL, AI_NONE);+				md->deletetimer=add_timer(tick+d_*num+1,mob_timer_delete,md->bl.id,0);+				status_set_viewdata(&md->bl, INVISIBLE_CLASS);+				tmpd = &md->tmpd;				+				if(skill_get_splash(skillid,skilllv)>1&&num>1)+					num = 1;+				_damage = damage/num;+				tmpd->src = src;+				tmpd->bl = bl;+				tmpd->num[0]=skillid;+				tmpd->num[1]=skilllv;+				u_ = tick+d_*num+1;+				if( tstatus->hp <= damage )//delay to kill it+				{+					damage = 1;+					status_change_start(bl, SC_BLADESTOP_WAIT, 10000, 1, 0, 0, 0, u_, 2);+					status_change_start(bl, SC_INVINCIBLE, 10000, 1, 0, 0, 0, u_, 2);+					add_timer(u_,skill_mcri_kill_delay,bl->id,(intptr_t)src);+				}+				clif_skill_nodamage(src,src,skillid,skilllv,1);+				for(i=0;i<num;i++)+					add_timer(tick+d_*i +1,skill_mcri_hit,_damage,(intptr_t)md);+				u_ = d_ = _damage = 0;+				break;+			}+		} 		if( bl->type == BL_SKILL ){ 			TBL_SKILL *su = (TBL_SKILL*)bl; 			if( su->group && skill_get_inf2(su->group->skill_id)&INF2_TRAP )// show damage on trap targetsIndex: src/map/skill.h===================================================================--- src/map/skill.h	(revision 16936)+++ src/map/skill.h	(working copy)@@ -21,7 +21,8 @@ #define MAX_SKILL_IMPROVISE_DB 50  #define MAX_SKILL_LEVEL 100-+int skill_mcri_hit(int tid, unsigned int tick, int _damage, intptr_t data);+int skill_mcri_kill_delay(int tid, unsigned int tick, int id, intptr_t data); //Constants to identify the skill's inf value: enum e_skill_inf {Index: src/map/unit.h===================================================================--- src/map/unit.h	(revision 16936)+++ src/map/unit.h	(working copy)@@ -13,7 +13,11 @@ #include "map.h" // struct block_list #include "path.h" // struct walkpath_data #include "skill.h" // struct skill_timerskill, struct skill_unit_group, struct skill_unit_group_tickset-+struct tmp_data {+	struct block_list *src;+	struct block_list *bl;+	int num[2];+}; struct unit_data { 	struct block_list *bl; 	struct walkpath_data walkpath;

 


But I am getting this error

skill.c: In function 'skill_mcri_hit':skill.c:2122: warning: implicit declaration of function 'clif_damage'skill.c:2122: warning: implicit declaration of function 'gettick'skill.c:2125: warning: implicit declaration of function 'clif_skill_damage'skill.c:2126: warning: implicit declaration of function 'clif_skill_nodamage'skill.c: In function 'skill_mcri_kill_delay':skill.c:2134: warning: implicit declaration of function 'map_id2bl'skill.c:2134: warning: initialization makes pointer from integer without a castskill.c:2139: warning: implicit declaration of function 'mob_dead'skill.c: In function 'skill_attack':skill.c:2547: warning: implicit declaration of function 'battle_get_master'skill.c:2547: error: invalid type argument of '->' (have 'int')skill.c:2551: warning: implicit declaration of function 'map_id2sd'skill.c:2551: error: invalid type argument of '->' (have 'int')skill.c:2551: error: invalid type argument of '->' (have 'int')skill.c:2551: error: invalid type argument of '->' (have 'int')skill.c:2560: error: 'skillid' undeclared (first use in this function)skill.c:2560: error: (Each undeclared identifier is reported only onceskill.c:2560: error: for each function it appears in.)skill.c:2560: error: 'skilllv' undeclared (first use in this function)skill.c:2562: warning: implicit declaration of function 'mob_once_spawn_sub'skill.c:2562: warning: assignment makes pointer from integer without a castskill.c:2563: warning: implicit declaration of function 'add_timer'skill.c:2563: error: 'mob_timer_delete' undeclared (first use in this function)skill.c:2564: warning: implicit declaration of function 'status_set_viewdata'skill.c:2577: warning: implicit declaration of function 'status_change_start' 

 

 

 

 

 

This is the Patch

===================================================================--- src/map/skill.c	(revision 16936)+++ src/map/skill.c	(working copy)@@ -2110,7 +2110,38 @@	 return 0; }-+int skill_mcri_hit(int tid, unsigned int tick, int id, intptr_t data)+{+	struct mob_data *md = (struct mob_data *)data;+	struct tmp_data *tmpd;+	tmpd = &md->tmpd;+	if(tmpd!=NULL)+	{+	switch(1) // 1 = red ; 2 = blue+	{+	case 1:+		clif_damage(tmpd->src, tmpd->bl, gettick(), 1, 1, id, 0, 10, 0);+		break;+	case 2:+		clif_skill_damage(tmpd->src,tmpd->bl,gettick(), 1, 1, id, 0, TK_STORMKICK, 1, 8);+		clif_skill_nodamage(tmpd->src,tmpd->src,tmpd->num[0],tmpd->num[1],1);+		break;+	}+	}+	return 0;+}+int skill_mcri_kill_delay(int tid, unsigned int tick, int id, intptr_t data)+{+	struct block_list *bl = map_id2bl(id);+	struct block_list *src = (struct block_list *)data;+	struct mob_data *md = BL_CAST(BL_MOB, bl);+	if(bl!=NULL)+	{+		mob_dead(md,src,0);+		status_kill(bl);+	}+	return 0;+} /*  * =========================================================================  * Does a skill attack with the given properties.@@ -2449,6 +2480,48 @@	 default:		 if( flag&SD_ANIMATION && dmg.div_ < 2 ) //Disabling skill animation doesn't works on multi-hit.			 type = 5;+		//m_cri+		if ( src->type == BL_PC || battle_get_master(src)->type == BL_PC )+		{+			char m_cri = 0;+			if(sd==NULL)+				m_cri = cap_value(map_id2sd(battle_get_master(src)->id)->battle_status.cri/10,1,100);+			else+				m_cri = cap_value(sd->battle_status.cri/10,1,100);+			if( rand()%100 < m_cri )+			{+				struct mob_data *md=NULL;+				struct tmp_data *tmpd=NULL;+				int d_ = 200;+				unsigned int u_ = 0;+				int i=0, num=abs(skill_get_num(skillid,skilllv)), _damage=0;+				damage *= 2;				+				md = mob_once_spawn_sub(src, src->m, src->x, src->y, "--en--",1083,"", SZ_SMALL, AI_NONE);+				md->deletetimer=add_timer(tick+d_*num+1,mob_timer_delete,md->bl.id,0);+				status_set_viewdata(&md->bl, INVISIBLE_CLASS);+				tmpd = &md->tmpd;				+				if(skill_get_splash(skillid,skilllv)>1&&num>1)+					num = 1;+				_damage = damage/num;+				tmpd->src = src;+				tmpd->bl = bl;+				tmpd->num[0]=skillid;+				tmpd->num[1]=skilllv;+				u_ = tick+d_*num+1;+				if( tstatus->hp <= damage )//delay to kill it+				{+					damage = 1;+					status_change_start(bl, SC_BLADESTOP_WAIT, 10000, 1, 0, 0, 0, u_, 2);+					status_change_start(bl, SC_INVINCIBLE, 10000, 1, 0, 0, 0, u_, 2);+					add_timer(u_,skill_mcri_kill_delay,bl->id,(intptr_t)src);+				}+				clif_skill_nodamage(src,src,skillid,skilllv,1);+				for(i=0;i<num;i++)+					add_timer(tick+d_*i +1,skill_mcri_hit,_damage,(intptr_t)md);+				u_ = d_ = _damage = 0;+				break;+			}+		}		 if( bl->type == BL_SKILL ){			 TBL_SKILL *su = (TBL_SKILL*)bl;			 if( su->group && skill_get_inf2(su->group->skill_id)&INF2_TRAP )// show damage on trap targetsIndex: src/map/skill.h 

 

Edited by karazu

Share this post


Link to post
Share on other sites

17 answers to this question

Recommended Posts

  • 0
Index: src/map/mob.h===================================================================--- src/map/mob.h	(revision 16936)+++ src/map/mob.h	(working copy)@@ -123,6 +123,7 @@ 	struct block_list bl; 	struct unit_data  ud; 	struct view_data *vd;+	struct tmp_data tmpd; 	struct status_data status, *base_status; //Second one is in case of leveling up mobs, or tiny/large mobs. 	struct status_change sc; 	struct mob->db *db;	//For quick data access (saves doing mob->db(md->class_) all the time) [Skotlex]Index: src/map/pc.h===================================================================--- src/map/pc.h	(revision 16936)+++ src/map/pc.h	(working copy)@@ -91,6 +91,7 @@ 	struct block_list bl; 	struct unit_data ud; 	struct view_data vd;+	struct tmp_data tmpd; 	struct status_data base_status, battle_status; 	struct status_change sc; 	struct regen_data regen;Index: src/map/skill.c===================================================================--- src/map/skill.c	(revision 16936)+++ src/map/skill.c	(working copy)@@ -2110,7 +2110,38 @@  	return 0; }-+int skill_mcri_hit(int tid, int64 tick, int id, intptr_t data)+{+	struct mob_data *md = (struct mob_data *)data;+	struct tmp_data *tmpd;+	tmpd = &md->tmpd;+	if(tmpd!=NULL)+	{+	switch(1) // 1 = red ; 2 = blue+	{+	case 1:+		clif->damage(tmpd->src, tmpd->bl, timer->gettick(), 1, 1, id, 0, 10, 0);+		break;+	case 2:+		clif->skill_damage(tmpd->src,tmpd->bl,timer->gettick(), 1, 1, id, 0, TK_STORMKICK, 1, 8);+		clif->skill_nodamage(tmpd->src,tmpd->src,tmpd->num[0],tmpd->num[1],1);+		break;+	}+	}+	return 0;+}+int skill_mcri_kill_delay(int tid, int64 tick, int id, intptr_t data)+{+	struct block_list *bl = map->id2bl(id);+	struct block_list *src = (struct block_list *)data;+	struct mob_data *md = BL_CAST(BL_MOB, bl);+	if(bl!=NULL)+	{+		mob->dead(md,src,0);+		status_kill(bl);+	}+	return 0;+} /*  * =========================================================================  * Does a skill attack with the given properties.@@ -2449,6 +2480,48 @@ 	default: 		if( flag&SD_ANIMATION && dmg.div_ < 2 ) //Disabling skill animation doesn't works on multi-hit. 			type = 5;+		//m_cri+		if ( src->type == BL_PC || (battle->get_master(src))->type == BL_PC )+		{+			char m_cri = 0;+			if(sd==NULL)+				m_cri = cap_value(map->id2sd((battle->get_master(src))->id)->battle_status.cri/10,1,100);+			else+				m_cri = cap_value(sd->battle_status.cri/10,1,100);+			if( rand()%100 < m_cri )+			{+				struct mob_data *md=NULL;+				struct tmp_data *tmpd=NULL;+				int d_ = 200;+				unsigned int u_ = 0;+				int i=0, num=abs(skill->get_num(skill_id,skill_lv)), _damage=0;+				damage *= 2;				+				md = mob->once_spawn_sub(src, src->m, src->x, src->y, "--en--",1083,"", SZ_SMALL, AI_NONE);+				md->deletetimer=timer->add(tick+d_*num+1,mob->timer_delete,md->bl.id,0);+				status->set_viewdata(&md->bl, INVISIBLE_CLASS);+				tmpd = &md->tmpd;				+				if(skill->get_splash(skill_id,skill_lv)>1&&num>1)+					num = 1;+				_damage = damage/num;+				tmpd->src = src;+				tmpd->bl = bl;+				tmpd->num[0]=skill_id;+				tmpd->num[1]=skill_lv;+				u_ = tick+d_*num+1;+				if( tstatus->hp <= damage )//delay to kill it+				{+					damage = 1;+					status->change_start(bl, SC_BLADESTOP_WAIT, 10000, 1, 0, 0, 0, u_, 2);+					status->change_start(bl, SC_INVINCIBLE, 10000, 1, 0, 0, 0, u_, 2);+					timer->add(u_,skill_mcri_kill_delay,bl->id,(intptr_t)src);+				}+				clif->skill_nodamage(src,src,skill_id,skill_lv,1);+				for(i=0;i<num;i++)+					timer->add(tick+d_*i +1,skill_mcri_hit,_damage,(intptr_t)md);+				u_ = d_ = _damage = 0;+				break;+			}+		} 		if( bl->type == BL_SKILL ){ 			TBL_SKILL *su = (TBL_SKILL*)bl; 			if( su->group && skill->get_inf2(su->group->skill_id)&INF2_TRAP )// show damage on trap targetsIndex: src/map/skill.h===================================================================--- src/map/skill.h	(revision 16936)+++ src/map/skill.h	(working copy)@@ -21,7 +21,8 @@ #define MAX_SKILL_IMPROVISE_DB 50  #define MAX_SKILL_LEVEL 100-+int skill_mcri_hit(int tid, int64 tick, int _damage, intptr_t data);+int skill_mcri_kill_delay(int tid, int64 tick, int id, intptr_t data); //Constants to identify the skill's inf value: enum e_skill_inf {Index: src/map/unit.h===================================================================--- src/map/unit.h	(revision 16936)+++ src/map/unit.h	(working copy)@@ -13,7 +13,11 @@ #include "map.h" // struct block_list #include "path.h" // struct walkpath_data #include "skill.h" // struct skill->timerskill, struct skill_unit_group, struct skill_unit_group_tickset-+struct tmp_data {+	struct block_list *src;+	struct block_list *bl;+	int num[2];+}; struct unit_data { 	struct block_list *bl; 	struct walkpath_data walkpath;

Share this post


Link to post
Share on other sites
  • 0

Convert all function calls to pointer(the renewal phase change that Hercules have gone)

Like mob_dead to mob->dead

Share this post


Link to post
Share on other sites
  • 0

Change all
mob_dead to mob->dead 
add_timer to timer->add




 

skill.c: In function 'skill_mcri_hit':skill.c:2122: warning: implicit declaration of function 'clif_damage'skill.c:2122: warning: implicit declaration of function 'gettick'skill.c:2125: warning: implicit declaration of function 'clif_skill_damage'skill.c:2126: warning: implicit declaration of function 'clif_skill_nodamage'skill.c: In function 'skill_mcri_kill_delay':skill.c:2134: warning: implicit declaration of function 'map_id2bl'skill.c:2134: warning: initialization makes pointer from integer without a castskill.c: In function 'skill_attack':skill.c:2547: warning: implicit declaration of function 'battle_get_master'skill.c:2547: error: invalid type argument of '->' (have 'int')skill.c:2551: warning: implicit declaration of function 'map_id2sd'skill.c:2551: error: invalid type argument of '->' (have 'int')skill.c:2551: error: invalid type argument of '->' (have 'int')skill.c:2551: error: invalid type argument of '->' (have 'int')skill.c:2560: error: 'skillid' undeclared (first use in this function)skill.c:2560: error: (Each undeclared identifier is reported only onceskill.c:2560: error: for each function it appears in.)skill.c:2560: error: 'skilllv' undeclared (first use in this function)skill.c:2562: warning: implicit declaration of function 'mob_once_spawn_sub'skill.c:2562: warning: assignment makes pointer from integer without a castskill.c:2563: error: 'mob_timer_delete' undeclared (first use in this function)skill.c:2564: warning: implicit declaration of function 'status_set_viewdata'skill.c:2577: warning: implicit declaration of function 'status_change_start'skill.c:2579: warning: passing argument 2 of 'timer->add' from incompatible pointer typeskill.c:2579: note: expected 'TimerFunc' but argument is of type 'int (*)(int,  unsigned int,  int,  intptr_t)'skill.c:2583: warning: passing argument 2 of 'timer->add' from incompatible pointer typeskill.c:2583: note: expected 'TimerFunc' but argument is of type 'int (*)(int,  unsigned int,  int,  intptr_t)'

Share this post


Link to post
Share on other sites
  • 0

Last error

 

 

skill.h:38: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' tokenskill.h:39: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token 

 

Share this post


Link to post
Share on other sites
  • 0

Don't change _ to -> in .h files

I am sorry but the errors are getting many, I will still try to fix by my own buy I will also bump this one, somebody not busy  :D  :)  :)  ;)

Share this post


Link to post
Share on other sites
  • 0

 

Index: src/map/mob.h===================================================================--- src/map/mob.h	(revision 16936)+++ src/map/mob.h	(working copy)@@ -123,6 +123,7 @@ 	struct block_list bl; 	struct unit_data  ud; 	struct view_data *vd;+	struct tmp_data tmpd; 	struct status_data status, *base_status; //Second one is in case of leveling up mobs, or tiny/large mobs. 	struct status_change sc; 	struct mob->db *db;	//For quick data access (saves doing mob->db(md->class_) all the time) [Skotlex]Index: src/map/pc.h===================================================================--- src/map/pc.h	(revision 16936)+++ src/map/pc.h	(working copy)@@ -91,6 +91,7 @@ 	struct block_list bl; 	struct unit_data ud; 	struct view_data vd;+	struct tmp_data tmpd; 	struct status_data base_status, battle_status; 	struct status_change sc; 	struct regen_data regen;Index: src/map/skill.c===================================================================--- src/map/skill.c	(revision 16936)+++ src/map/skill.c	(working copy)@@ -2110,7 +2110,38 @@  	return 0; }-+int skill_mcri_hit(int tid, int64 tick, int id, intptr_t data)+{+	struct mob_data *md = (struct mob_data *)data;+	struct tmp_data *tmpd;+	tmpd = &md->tmpd;+	if(tmpd!=NULL)+	{+	switch(1) // 1 = red ; 2 = blue+	{+	case 1:+		clif->damage(tmpd->src, tmpd->bl, timer->gettick(), 1, 1, id, 0, 10, 0);+		break;+	case 2:+		clif->skill_damage(tmpd->src,tmpd->bl,timer->gettick(), 1, 1, id, 0, TK_STORMKICK, 1, 8);+		clif->skill_nodamage(tmpd->src,tmpd->src,tmpd->num[0],tmpd->num[1],1);+		break;+	}+	}+	return 0;+}+int skill_mcri_kill_delay(int tid, int64 tick, int id, intptr_t data)+{+	struct block_list *bl = map->id2bl(id);+	struct block_list *src = (struct block_list *)data;+	struct mob_data *md = BL_CAST(BL_MOB, bl);+	if(bl!=NULL)+	{+		mob->dead(md,src,0);+		status_kill(bl);+	}+	return 0;+} /*  * =========================================================================  * Does a skill attack with the given properties.@@ -2449,6 +2480,48 @@ 	default: 		if( flag&SD_ANIMATION && dmg.div_ < 2 ) //Disabling skill animation doesn't works on multi-hit. 			type = 5;+		//m_cri+		if ( src->type == BL_PC || (battle->get_master(src))->type == BL_PC )+		{+			char m_cri = 0;+			if(sd==NULL)+				m_cri = cap_value(map->id2sd((battle->get_master(src))->id)->battle_status.cri/10,1,100);+			else+				m_cri = cap_value(sd->battle_status.cri/10,1,100);+			if( rand()%100 < m_cri )+			{+				struct mob_data *md=NULL;+				struct tmp_data *tmpd=NULL;+				int d_ = 200;+				unsigned int u_ = 0;+				int i=0, num=abs(skill->get_num(skill_id,skill_lv)), _damage=0;+				damage *= 2;				+				md = mob->once_spawn_sub(src, src->m, src->x, src->y, "--en--",1083,"", SZ_SMALL, AI_NONE);+				md->deletetimer=timer->add(tick+d_*num+1,mob->timer_delete,md->bl.id,0);+				status->set_viewdata(&md->bl, INVISIBLE_CLASS);+				tmpd = &md->tmpd;				+				if(skill->get_splash(skill_id,skill_lv)>1&&num>1)+					num = 1;+				_damage = damage/num;+				tmpd->src = src;+				tmpd->bl = bl;+				tmpd->num[0]=skill_id;+				tmpd->num[1]=skill_lv;+				u_ = tick+d_*num+1;+				if( tstatus->hp <= damage )//delay to kill it+				{+					damage = 1;+					status->change_start(bl, SC_BLADESTOP_WAIT, 10000, 1, 0, 0, 0, u_, 2);+					status->change_start(bl, SC_INVINCIBLE, 10000, 1, 0, 0, 0, u_, 2);+					timer->add(u_,skill_mcri_kill_delay,bl->id,(intptr_t)src);+				}+				clif->skill_nodamage(src,src,skill_id,skill_lv,1);+				for(i=0;i<num;i++)+					timer->add(tick+d_*i +1,skill_mcri_hit,_damage,(intptr_t)md);+				u_ = d_ = _damage = 0;+				break;+			}+		} 		if( bl->type == BL_SKILL ){ 			TBL_SKILL *su = (TBL_SKILL*)bl; 			if( su->group && skill->get_inf2(su->group->skill_id)&INF2_TRAP )// show damage on trap targetsIndex: src/map/skill.h===================================================================--- src/map/skill.h	(revision 16936)+++ src/map/skill.h	(working copy)@@ -21,7 +21,8 @@ #define MAX_SKILL_IMPROVISE_DB 50  #define MAX_SKILL_LEVEL 100-+int skill_mcri_hit(int tid, int64 tick, int _damage, intptr_t data);+int skill_mcri_kill_delay(int tid, int64 tick, int id, intptr_t data); //Constants to identify the skill's inf value: enum e_skill_inf {Index: src/map/unit.h===================================================================--- src/map/unit.h	(revision 16936)+++ src/map/unit.h	(working copy)@@ -13,7 +13,11 @@ #include "map.h" // struct block_list #include "path.h" // struct walkpath_data #include "skill.h" // struct skill->timerskill, struct skill_unit_group, struct skill_unit_group_tickset-+struct tmp_data {+	struct block_list *src;+	struct block_list *bl;+	int num[2];+}; struct unit_data { 	struct block_list *bl; 	struct walkpath_data walkpath;

I will test this Angel, Thank you very much

Share this post


Link to post
Share on other sites
  • 0

 

Index: src/map/mob.h===================================================================--- src/map/mob.h	(revision 16936)+++ src/map/mob.h	(working copy)@@ -123,6 +123,7 @@ 	struct block_list bl; 	struct unit_data  ud; 	struct view_data *vd;+	struct tmp_data tmpd; 	struct status_data status, *base_status; //Second one is in case of leveling up mobs, or tiny/large mobs. 	struct status_change sc; 	struct mob->db *db;	//For quick data access (saves doing mob->db(md->class_) all the time) [Skotlex]Index: src/map/pc.h===================================================================--- src/map/pc.h	(revision 16936)+++ src/map/pc.h	(working copy)@@ -91,6 +91,7 @@ 	struct block_list bl; 	struct unit_data ud; 	struct view_data vd;+	struct tmp_data tmpd; 	struct status_data base_status, battle_status; 	struct status_change sc; 	struct regen_data regen;Index: src/map/skill.c===================================================================--- src/map/skill.c	(revision 16936)+++ src/map/skill.c	(working copy)@@ -2110,7 +2110,38 @@  	return 0; }-+int skill_mcri_hit(int tid, int64 tick, int id, intptr_t data)+{+	struct mob_data *md = (struct mob_data *)data;+	struct tmp_data *tmpd;+	tmpd = &md->tmpd;+	if(tmpd!=NULL)+	{+	switch(1) // 1 = red ; 2 = blue+	{+	case 1:+		clif->damage(tmpd->src, tmpd->bl, timer->gettick(), 1, 1, id, 0, 10, 0);+		break;+	case 2:+		clif->skill_damage(tmpd->src,tmpd->bl,timer->gettick(), 1, 1, id, 0, TK_STORMKICK, 1, 8);+		clif->skill_nodamage(tmpd->src,tmpd->src,tmpd->num[0],tmpd->num[1],1);+		break;+	}+	}+	return 0;+}+int skill_mcri_kill_delay(int tid, int64 tick, int id, intptr_t data)+{+	struct block_list *bl = map->id2bl(id);+	struct block_list *src = (struct block_list *)data;+	struct mob_data *md = BL_CAST(BL_MOB, bl);+	if(bl!=NULL)+	{+		mob->dead(md,src,0);+		status_kill(bl);+	}+	return 0;+} /*  * =========================================================================  * Does a skill attack with the given properties.@@ -2449,6 +2480,48 @@ 	default: 		if( flag&SD_ANIMATION && dmg.div_ < 2 ) //Disabling skill animation doesn't works on multi-hit. 			type = 5;+		//m_cri+		if ( src->type == BL_PC || (battle->get_master(src))->type == BL_PC )+		{+			char m_cri = 0;+			if(sd==NULL)+				m_cri = cap_value(map->id2sd((battle->get_master(src))->id)->battle_status.cri/10,1,100);+			else+				m_cri = cap_value(sd->battle_status.cri/10,1,100);+			if( rand()%100 < m_cri )+			{+				struct mob_data *md=NULL;+				struct tmp_data *tmpd=NULL;+				int d_ = 200;+				unsigned int u_ = 0;+				int i=0, num=abs(skill->get_num(skill_id,skill_lv)), _damage=0;+				damage *= 2;				+				md = mob->once_spawn_sub(src, src->m, src->x, src->y, "--en--",1083,"", SZ_SMALL, AI_NONE);+				md->deletetimer=timer->add(tick+d_*num+1,mob->timer_delete,md->bl.id,0);+				status->set_viewdata(&md->bl, INVISIBLE_CLASS);+				tmpd = &md->tmpd;				+				if(skill->get_splash(skill_id,skill_lv)>1&&num>1)+					num = 1;+				_damage = damage/num;+				tmpd->src = src;+				tmpd->bl = bl;+				tmpd->num[0]=skill_id;+				tmpd->num[1]=skill_lv;+				u_ = tick+d_*num+1;+				if( tstatus->hp <= damage )//delay to kill it+				{+					damage = 1;+					status->change_start(bl, SC_BLADESTOP_WAIT, 10000, 1, 0, 0, 0, u_, 2);+					status->change_start(bl, SC_INVINCIBLE, 10000, 1, 0, 0, 0, u_, 2);+					timer->add(u_,skill_mcri_kill_delay,bl->id,(intptr_t)src);+				}+				clif->skill_nodamage(src,src,skill_id,skill_lv,1);+				for(i=0;i<num;i++)+					timer->add(tick+d_*i +1,skill_mcri_hit,_damage,(intptr_t)md);+				u_ = d_ = _damage = 0;+				break;+			}+		} 		if( bl->type == BL_SKILL ){ 			TBL_SKILL *su = (TBL_SKILL*)bl; 			if( su->group && skill->get_inf2(su->group->skill_id)&INF2_TRAP )// show damage on trap targetsIndex: src/map/skill.h===================================================================--- src/map/skill.h	(revision 16936)+++ src/map/skill.h	(working copy)@@ -21,7 +21,8 @@ #define MAX_SKILL_IMPROVISE_DB 50  #define MAX_SKILL_LEVEL 100-+int skill_mcri_hit(int tid, int64 tick, int _damage, intptr_t data);+int skill_mcri_kill_delay(int tid, int64 tick, int id, intptr_t data); //Constants to identify the skill's inf value: enum e_skill_inf {Index: src/map/unit.h===================================================================--- src/map/unit.h	(revision 16936)+++ src/map/unit.h	(working copy)@@ -13,7 +13,11 @@ #include "map.h" // struct block_list #include "path.h" // struct walkpath_data #include "skill.h" // struct skill->timerskill, struct skill_unit_group, struct skill_unit_group_tickset-+struct tmp_data {+	struct block_list *src;+	struct block_list *bl;+	int num[2];+}; struct unit_data { 	struct block_list *bl; 	struct walkpath_data walkpath;

 

 

 

 

 

Error

 

skill.c: In function 'skill_mcri_hit':skill.c:2126: error: too many arguments to function 'clif->damage'skill.c: In function 'skill_attack':skill.c:2598: warning: passing argument 2 of 'status->change_start' makes pointer from integer without a castskill.c:2598: note: expected 'struct block_list *' but argument is of type 'int'skill.c:2598: error: too few arguments to function 'status->change_start'skill.c:2599: warning: passing argument 2 of 'status->change_start' makes pointer from integer without a castskill.c:2599: note: expected 'struct block_list *' but argument is of type 'int'skill.c:2599: error: too few arguments to function 'status->change_start' 

 

Share this post


Link to post
Share on other sites
  • 0

find

  clif->damage(tmpd->src, tmpd->bl, timer->gettick(), 1, 1, id, 0, 10, 0);

change to

clif->damage(tmpd->src, tmpd->bl, 1, 1, id, 0, 10, 0);

 

 

find

status->change_start(bl, SC_BLADESTOP_WAIT, 10000, 1, 0, 0, 0, u_, 2);
status->change_start(bl, SC_INVINCIBLE, 10000, 1, 0, 0, 0, u_, 2);

chang to

status->change_start(NULL, bl, SC_BLADESTOP_WAIT, 10000, 1, 0, 0, 0, u_, 2);
status->change_start(NULL, bl, SC_INVINCIBLE, 10000, 1, 0, 0, 0, u_, 2);

Edited by Angelmelody

Share this post


Link to post
Share on other sites
  • 0

find

  clif->damage(tmpd->src, tmpd->bl, timer->gettick(), 1, 1, id, 0, 10, 0);

change to

clif->damage(tmpd->src, tmpd->bl, 1, 1, id, 0, 10, 0);

 

 

find

status->change_start(bl, SC_BLADESTOP_WAIT, 10000, 1, 0, 0, 0, u_, 2);

status->change_start(bl, SC_INVINCIBLE, 10000, 1, 0, 0, 0, u_, 2);

chang to

status->change_start(NULL, bl, SC_BLADESTOP_WAIT, 10000, 1, 0, 0, 0, u_, 2);

status->change_start(NULL, bl, SC_INVINCIBLE, 10000, 1, 0, 0, 0, u_, 2);

Hello Angel Melody, Thank you very much.... its working... 

 

 

 

+1 for both of you for helping. 

Edited by karazu

Share this post


Link to post
Share on other sites
  • 0

find

  clif->damage(tmpd->src, tmpd->bl, timer->gettick(), 1, 1, id, 0, 10, 0);

change to

clif->damage(tmpd->src, tmpd->bl, 1, 1, id, 0, 10, 0);

 

 

find

status->change_start(bl, SC_BLADESTOP_WAIT, 10000, 1, 0, 0, 0, u_, 2);

status->change_start(bl, SC_INVINCIBLE, 10000, 1, 0, 0, 0, u_, 2);

chang to

status->change_start(NULL, bl, SC_BLADESTOP_WAIT, 10000, 1, 0, 0, 0, u_, 2);

status->change_start(NULL, bl, SC_INVINCIBLE, 10000, 1, 0, 0, 0, u_, 2);

 

 

Convert all function calls to pointer(the renewal phase change that Hercules have gone)

Like mob_dead to mob->dead

 

 

Hello Dastgir and Angel, Why is it that if I will spam a certain Skill on a Player like sonic blow that server will get disconnected..

 

 

Any idea?

 

 

[Error]: Server received crash signal! Attempting to save all online characters! 

 

I dont have problem in PvM only in PVP

Edited by karazu

Share this post


Link to post
Share on other sites
  • 0

 

find

  clif->damage(tmpd->src, tmpd->bl, timer->gettick(), 1, 1, id, 0, 10, 0);

change to

clif->damage(tmpd->src, tmpd->bl, 1, 1, id, 0, 10, 0);

 

 

find

status->change_start(bl, SC_BLADESTOP_WAIT, 10000, 1, 0, 0, 0, u_, 2);

status->change_start(bl, SC_INVINCIBLE, 10000, 1, 0, 0, 0, u_, 2);

chang to

status->change_start(NULL, bl, SC_BLADESTOP_WAIT, 10000, 1, 0, 0, 0, u_, 2);

status->change_start(NULL, bl, SC_INVINCIBLE, 10000, 1, 0, 0, 0, u_, 2);

 

 

Convert all function calls to pointer(the renewal phase change that Hercules have gone)

Like mob_dead to mob->dead

Hello Dastgir and Angel, Why is it that if I will spam a certain Skill on a Player like sonic blow that server will get disconnected..

Any idea?

 

 

[Error]: Server received crash signal! Attempting to save all online characters! 
 

I dont have problem in PvM only in PVP

Can you give gdb coredump??

Share this post


Link to post
Share on other sites
  • 0

Program received signal SIGSEGV, Segmentation fault.mob_dead (md=0x0, src=0x202d500, type=0) at mob.c:20822082            int i, temp, count, m = md->bl.m, pnum = 0;Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.132.el6_5.4.x86_64 keyutils-libs-1.4-4.el6.x86_64 krb5-libs-1.10.3-15.el6_5.1.x86_64 libcom_err-1.41.12-18.el6_5.1.x86_64 libgcc-4.4.7-4.el6.x86_64 libselinux-2.0.94-5.3.el6_4.1.x86_64 libstdc++-4.4.7-4.el6.x86_64 mysql55w-libs-5.5.40-1.w6.x86_64 openssl-1.0.1e-16.el6_5.15.x86_64 pcre-7.8-6.el6.x86_64 zlib-1.2.3-29.el6.x86_64

 

 

On Mob.c

 

 

/*========================================== * Signals death of mob. * type&1 -> no drops, type&2 -> no exp *------------------------------------------*/int mob_dead(struct mob_data *md, struct block_list *src, int type) {	struct status_data *mstatus;	struct map_session_data *sd = NULL, *tmpsd[DAMAGELOG_SIZE];	struct map_session_data *mvp_sd = NULL, *second_sd = NULL, *third_sd = NULL;	struct {		struct party_data *p;		int id,zeny;		unsigned int base_exp,job_exp;	} pt[DAMAGELOG_SIZE];	int i, temp, count, m = md->bl.m, pnum = 0;	int dmgbltypes = 0;  // bitfield of all bl types, that caused damage to the mob and are eligible for exp distribution	unsigned int mvp_damage;	int64 tick = timer->gettick();	bool rebirth, homkillonly;

Share this post


Link to post
Share on other sites
  • 0

 

Program received signal SIGSEGV, Segmentation fault.mob_dead (md=0x0, src=0x202d500, type=0) at mob.c:20822082            int i, temp, count, m = md->bl.m, pnum = 0;Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.132.el6_5.4.x86_64 keyutils-libs-1.4-4.el6.x86_64 krb5-libs-1.10.3-15.el6_5.1.x86_64 libcom_err-1.41.12-18.el6_5.1.x86_64 libgcc-4.4.7-4.el6.x86_64 libselinux-2.0.94-5.3.el6_4.1.x86_64 libstdc++-4.4.7-4.el6.x86_64 mysql55w-libs-5.5.40-1.w6.x86_64 openssl-1.0.1e-16.el6_5.15.x86_64 pcre-7.8-6.el6.x86_64 zlib-1.2.3-29.el6.x86_64

 

 

On Mob.c

 

 

/*========================================== * Signals death of mob. * type&1 -> no drops, type&2 -> no exp *------------------------------------------*/int mob_dead(struct mob_data *md, struct block_list *src, int type) {	struct status_data *mstatus;	struct map_session_data *sd = NULL, *tmpsd[DAMAGELOG_SIZE];	struct map_session_data *mvp_sd = NULL, *second_sd = NULL, *third_sd = NULL;	struct {		struct party_data *p;		int id,zeny;		unsigned int base_exp,job_exp;	} pt[DAMAGELOG_SIZE];	int i, temp, count, m = md->bl.m, pnum = 0;	int dmgbltypes = 0;  // bitfield of all bl types, that caused damage to the mob and are eligible for exp distribution	unsigned int mvp_damage;	int64 tick = timer->gettick();	bool rebirth, homkillonly;

 

try this new skill_mcri_kill_delay  :)

 

 

int skill_mcri_kill_delay(int tid, int64 tick, int id, intptr_t data){    struct block_list *bl = map->id2bl(id);    struct block_list *src = (struct block_list *)data;    if(bl!=NULL)    {         if(bl->type == BL_MOB) {            struct mob_data *md = BL_CAST(BL_MOB, bl);            if(md) mob->dead(md,src,0);        }        status_kill(bl);    }    return 0;} 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.