浏览代码

- Fixed Taekwon stances not triggering.
- Added atcommand @exp
- Added error reporting when add_timer_interval receives a negative/0 interval value.
- Fixed a possible infinite recursion bug with splash self skills.
- Modified the way firewall_hits_on_undead works, to loop and invoke multiple skill_attacks based on the value.


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

skotlex 19 年之前
父节点
当前提交
1fb95bcf98
共有 7 个文件被更改,包括 64 次插入14 次删除
  1. 9 0
      Changelog-Trunk.txt
  2. 3 0
      conf-tmpl/atcommand_athena.conf
  3. 8 1
      src/common/timer.c
  4. 28 0
      src/map/atcommand.c
  5. 1 0
      src/map/atcommand.h
  6. 1 2
      src/map/battle.c
  7. 14 11
      src/map/skill.c

+ 9 - 0
Changelog-Trunk.txt

@@ -5,6 +5,15 @@ 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/02/20
+	* Fixed Taekwon stances not triggering. [Skotlex]
+	* Added atcommand @exp [Skotlex]
+	* Added error reporting when add_timer_interval receives a negative/0
+	  interval value. [Skotlex]
+	* Fixed a possible infinite recursion bug with splash self skills. [Skotlex]
+	* Modified the way firewall_hits_on_undead works, to loop and invoke
+	  multiple skill_attacks based on the value. Now it behaves a lot closer to
+	  how Aegis Firewall does (except a good default value for this config switch
+	  is missing) [Skotlex]
 	* Preparing eA for new mob_skill_db from Aegis 10.2 [Komurka]
 	- increased MAX_MOBSKILL 32 -> 40
 

+ 3 - 0
conf-tmpl/atcommand_athena.conf

@@ -54,6 +54,9 @@ uptime: 1
 //Shows/Hides the "there is a delay after a skill" message.
 showdelay: 1
 
+//Displays current levels and % progress.
+exp: 1
+
 // To change your (own) email (characters protection)
 // note: this command doesn't check email itself, but check structure of the email (xxx@xxx)
 //       if you want be sure of each e-mail disable this option (value: 100)

+ 8 - 1
src/common/timer.c

@@ -237,8 +237,15 @@ int add_timer(unsigned int tick,int (*func)(int,unsigned int,int,int), int id, i
 
 int add_timer_interval(unsigned int tick, int (*func)(int,unsigned int,int,int), int id, int data, int interval)
 {
-	int tid = acquire_timer();
+	int tid;
 
+	if (interval < 1) {
+		ShowError("add_timer_interval : function %08x(%s) has invalid interval %d!\n",
+			 (int)func, search_timer_func_list(func));
+		return -1;
+	}
+	
+	tid = acquire_timer();
 	timer_data[tid].tick	= tick;
 	timer_data[tid].func	= func;
 	timer_data[tid].id		= id;

+ 28 - 0
src/map/atcommand.c

@@ -256,6 +256,7 @@ ACMD_FUNC(undisguiseall);
 ACMD_FUNC(disguiseall);
 ACMD_FUNC(changelook);
 ACMD_FUNC(mobinfo);	//by Lupus
+ACMD_FUNC(exp);	// by Skotlex
 ACMD_FUNC(adopt); // by Veider
 
 ACMD_FUNC(version); // by Ancyker
@@ -565,6 +566,7 @@ static AtCommandInfo atcommand_info[] = {
 	{ AtCommand_MobInfo,			"@mobinfo",			 1, atcommand_mobinfo }, // [Lupus]
 	{ AtCommand_MobInfo,			"@monsterinfo",		 1, atcommand_mobinfo }, // [Lupus]
 	{ AtCommand_MobInfo,			"@mi",			 1, atcommand_mobinfo }, // [Lupus]
+	{ AtCommand_Exp,				"@exp",	0,	atcommand_exp },	// [Skotlex]
 	{ AtCommand_Adopt,            	"@adopt",			40, atcommand_adopt }, // [Veider]
 	{ AtCommand_Version,			"@version",			 1, atcommand_version },
 
@@ -6506,6 +6508,32 @@ int atcommand_undisguiseall(
 
 	return 0;
 }
+/*==========================================
+ * @exp by [Skotlex]
+ *------------------------------------------
+ */
+int atcommand_exp(
+	const int fd, struct map_session_data* sd,
+	const char* command, const char* message)
+{
+	char output[200];
+	double nextb, nextj;
+	nullpo_retr(-1, sd);
+	memset(output, '\0', sizeof(output));
+	
+	nextb = pc_nextbaseexp(sd);
+	if (nextb)
+		nextb = sd->status.base_exp*100.0/nextb;
+	
+	nextj = pc_nextjobexp(sd);
+	if (nextj)
+		nextj = sd->status.job_exp*100.0/nextj;
+	
+	sprintf(output, "Base Level: %d (%.3f%%) | Job Level: %d (%.3f%%)", sd->status.base_level, nextb, sd->status.job_level, nextj);
+	clif_displaymessage(fd, output);
+	return 0;
+}
+
 
 /*==========================================
  * @broadcast by [Valaris]

+ 1 - 0
src/map/atcommand.h

@@ -236,6 +236,7 @@ enum AtCommandType {
 	AtCommand_ChangeLook,
 	AtCommand_AutoLoot, //by Upa-Kun
 	AtCommand_MobInfo, //by Lupus
+	AtCommand_Exp,	// by Skotlex
 	AtCommand_Adopt, // by Veider
 	AtCommand_Version, // by Ancyker
 

+ 1 - 2
src/map/battle.c

@@ -2422,8 +2422,7 @@ struct Damage battle_calc_magic_attack(
 	switch(skill_num)
 	{
 		case MG_FIREWALL:
-			if(mflag) { //mflag has a value when it was checked it works against an undead in skill.c [Skotlex]
-				ad.div_ = mflag; //mflag contains the number of hits against undead.
+			if(mflag) { //mflag has a value when it was checked against an undead in skill.c [Skotlex]
 				ad.blewcount = 0; //No knockback
 				ad.dmotion = 0; //No flinch animation.
 			} else

+ 14 - 11
src/map/skill.c

@@ -859,13 +859,13 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
 			// Chance to trigger Taekwon kicks [Dralnu]
 			if(sd->sc.count) {
 				if(sd->sc.data[SC_READYSTORM].timer != -1)
-					status_change_start(src,SC_COMBO, TK_STORMKICK,15,0,0,0,
+					status_change_start(src,SC_COMBO, 15, TK_STORMKICK,0,0,0,
 						(2000 - 4 * status_get_agi(src) - 2 *  status_get_dex(src)),0);
 				else if(sd->sc.data[SC_READYDOWN].timer != -1)
-					status_change_start(src,SC_COMBO, TK_DOWNKICK,15,0,0,0,
+					status_change_start(src,SC_COMBO, 15, TK_DOWNKICK,0,0,0,
 						(2000 - 4 * status_get_agi(src) - 2 *  status_get_dex(src)),0);
 				else if(sd->sc.data[SC_READYTURN].timer != -1 && sd->sc.data[SC_COMBO].timer == -1)
-					status_change_start(src,SC_COMBO, TK_TURNKICK,15,0,0,0,
+					status_change_start(src,SC_COMBO, 15, TK_TURNKICK,0,0,0,
 						(2000 - 4 * status_get_agi(src) - 2 *  status_get_dex(src)),0);
 				else if(sd->sc.data[SC_READYCOUNTER].timer != -1 && sd->sc.data[SC_COMBO].timer == -1) //additional chance from SG_FRIEND [Komurka]
 				{	
@@ -874,7 +874,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
 						rate += rate*sd->sc.data[SC_SKILLRATE_UP].val2/100;
 						status_change_end(src,SC_SKILLRATE_UP,-1);
 					} 
-					status_change_start(src,SC_COMBO, TK_COUNTER,rate, bl->id,0,0,
+					status_change_start(src,SC_COMBO, rate, TK_COUNTER, bl->id,0,0,
 						(2000 - 4 * status_get_agi(src) - 2 *  status_get_dex(src)),0);
 				}
 			}
@@ -3052,7 +3052,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 		return 1;
 
 	//Self skill with target changed? We assume these are offensive auto-select-target skills. [Skotlex]
-	if (skill_get_inf(skillid)&INF_SELF_SKILL && src != bl && !(skill_get_nk(skillid)&NK_NO_DAMAGE))
+	//But only do this on the first call (flag&~1)
+	if (!(flag&1) && skill_get_inf(skillid)&INF_SELF_SKILL && src != bl && !(skill_get_nk(skillid)&NK_NO_DAMAGE))
 		return skill_castend_damage_id (src, bl, skillid, skilllv, tick, flag);
 	
 	if (skillid > 0 && skillid < MAX_SKILL)
@@ -6758,12 +6759,14 @@ int skill_unit_onplace_timer(struct skill_unit *src,struct block_list *bl,unsign
 	switch (sg->unit_id) {
 	case UNT_FIREWALL:
 		{
-			int flag=0, t_ele = status_get_elem_type(bl);
-			if (t_ele == 3 || battle_check_undead(status_get_race(bl), t_ele))
-				flag = src->val2>battle_config.firewall_hits_on_undead?battle_config.firewall_hits_on_undead:src->val2; 
-			
-			skill_attack(BF_MAGIC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,flag);
-			src->val2-=flag?flag:1;
+			int count=0, t_ele = status_get_elem_type(bl);
+			if (t_ele == 3 || battle_check_undead(status_get_race(bl), t_ele)) {
+				while (count++ < battle_config.firewall_hits_on_undead && src->val2-- && !status_isdead(bl))
+					skill_attack(BF_MAGIC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick+count*10,1);
+			} else {
+				skill_attack(BF_MAGIC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
+				src->val2--;
+			}
 			if (src->val2<=0)
 				skill_delunit(src);
 		break;