Просмотр исходного кода

- Moved skill_counter_additional_effect calls to trigger right after skill_additional_effect (which means they trigger at the end of the attack motion for physical attacks)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5888 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 19 лет назад
Родитель
Сommit
ac3277f2b2
3 измененных файлов с 25 добавлено и 11 удалено
  1. 4 0
      Changelog-Trunk.txt
  2. 15 6
      src/map/battle.c
  3. 6 5
      src/map/skill.c

+ 4 - 0
Changelog-Trunk.txt

@@ -4,6 +4,10 @@ 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/04/03
+	* Moved skill_counter_additional_effect calls to trigger right after
+	  skill_additional_effect (which means they trigger at the end of the attack
+	  motion for physical attacks instead of at the beginning of the attack
+	  animation) [Skotlex]
 	* Cleaned up (fixed?) a possible overflow in pc_isUseitem, thanks to
 	  foobar. [Skotlex]
 	* When you have the wrong ammo-type equipped the skill-failed message is

+ 15 - 6
src/map/battle.c

@@ -125,8 +125,14 @@ int battle_delay_damage_sub (int tid, unsigned int tick, int id, int data)
 		target->m == dat->src->m && check_distance_bl(dat->src, target, dat->distance)) //Check to see if you haven't teleported. [Skotlex]
 	{
 		battle_damage(dat->src, target, dat->damage, dat->flag);
-		if (!status_isdead(target) && (dat->dmg_lv == ATK_DEF || dat->damage > 0) && dat->attack_type)
-			skill_additional_effect(dat->src,target,dat->skill_id,dat->skill_lv,dat->attack_type, tick);
+		if ((dat->dmg_lv == ATK_DEF || dat->damage > 0) && dat->attack_type)
+		{
+			if (!status_isdead(target))
+				skill_additional_effect(dat->src,target,dat->skill_id,dat->skill_lv,dat->attack_type, tick);
+
+			skill_counter_additional_effect(dat->src,target,dat->skill_id,dat->skill_lv,dat->attack_type,tick);
+		}
+
 	}
 	ers_free(delay_damage_ers, dat);
 	return 0;
@@ -140,8 +146,13 @@ int battle_delay_damage (unsigned int tick, struct block_list *src, struct block
 
 	if (!battle_config.delay_battle_damage) {
 		battle_damage(src, target, damage, flag);
-		if (!status_isdead(target) && (damage > 0 || dmg_lv == ATK_DEF) && attack_type)
-			skill_additional_effect(src, target, skill_id, skill_lv, attack_type, gettick());
+		if ((damage > 0 || dmg_lv == ATK_DEF) && attack_type)
+		{
+			if (!status_isdead(target))
+				skill_additional_effect(src, target, skill_id, skill_lv, attack_type, gettick());
+
+			skill_counter_additional_effect(src, target, skill_id, skill_lv, attack_type, gettick());
+		}
 		return 0;
 	}
 	dat = ers_alloc(delay_damage_ers, struct delay_damage);
@@ -3068,8 +3079,6 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target,
 
 	battle_delay_damage(tick+wd.amotion, src, target, BF_WEAPON, 0, 0, damage, wd.dmg_lv, 0);
 
-	if (wd.dmg_lv == ATK_DEF || damage > 0) //Added counter effect [Skotlex]
-		skill_counter_additional_effect(src, target, 0, 0, BF_WEAPON, tick);
 	if (!status_isdead(target) && damage > 0) {
 		if (sd) {
 			int boss = status_get_mode(target)&MD_BOSS;

+ 6 - 5
src/map/skill.c

@@ -1981,8 +1981,12 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
 	}
 	if ((skillid || flag) && !(attack_type&BF_WEAPON)) {  // do not really deal damage for ASC_BREAKER's 1st attack
 		battle_damage(src,bl,damage, 0); //Deal damage before knockback to allow stuff like firewall+storm gust combo.
-		if (!status_isdead(bl) && (dmg.dmg_lv == ATK_DEF || damage > 0))
-			skill_additional_effect(src,bl,skillid,skilllv,attack_type,tick);
+		if (dmg.dmg_lv == ATK_DEF || damage > 0) {
+			if (!status_isdead(bl))
+				skill_additional_effect(src,bl,skillid,skilllv,attack_type,tick);
+			//Counter status effects [Skotlex] 
+			skill_counter_additional_effect(dsrc,bl,skillid,skilllv,attack_type,tick);
+		}
 	}
 
 	//Only knockback if it's still alive, otherwise a "ghost" is left behind. [Skotlex]
@@ -2002,9 +2006,6 @@ int skill_attack( int attack_type, struct block_list* src, struct block_list *ds
 			skill_addtimerskill(src,tick + 800,bl->id,0,0,skillid,skilllv,0,flag);
 	}
 
-	if (dmg.dmg_lv == ATK_DEF || damage > 0) //Counter status effects [Skotlex] 
-		skill_counter_additional_effect(dsrc,bl,skillid,skilllv,attack_type,tick);
-	
 	if(sd && dmg.flag&BF_WEAPON && src != bl && src == dsrc && damage > 0) {
 		int hp = 0,sp = 0;
 		if(sd->right_weapon.hp_drain_rate && sd->right_weapon.hp_drain_per > 0 && dmg.damage > 0 && rand()%1000 < sd->right_weapon.hp_drain_rate) {