Browse Source

- Fixed battle_getenemy picking dead characters.
- Adjusted Spiral Pierce, Shield Boomerang and Shield Chain to use atk2 instead of weight when used by non-players.
- Adjusted skills blindAttack, SilenceAttack, StunAttack, PetrifyAttack, CurseAttack, SleepAttack, Lex Divina and Dispell to be area effect skills, if the used skill level has a splash-range different from 0.
- Mob used Meteor Assault (and by extension Spread Attack) is able to hit icewalls now.


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

skotlex 18 years ago
parent
commit
0d740342ae
3 changed files with 67 additions and 38 deletions
  1. 8 0
      Changelog-Trunk.txt
  2. 23 23
      src/map/battle.c
  3. 36 15
      src/map/skill.c

+ 8 - 0
Changelog-Trunk.txt

@@ -3,6 +3,14 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 
+2007/04/15
+	* Fixed 'randomtarget' picking dead characters.
+	* Adjusted Spiral Pierce, Shield Boomerang and Shield Chain to use atk2
+	  instead of weight when used by non-players.
+	* Adjusted skills blindAttack, SilenceAttack, StunAttack, PetrifyAttack,
+	  CurseAttack, SleepAttack, Lex Divina and Dispell to be area effect skills,
+	  if the used skill level has a splash-range different from 0.
+	* Mob used Meteor Assault is able to hit icewalls now. [Skotlex]
 2007/04/15
 2007/04/15
 	* Fixed TXT char creation blocking characters with nonstandard names
 	* Fixed TXT char creation blocking characters with nonstandard names
 2007/04/13
 2007/04/13

+ 23 - 23
src/map/battle.c

@@ -118,7 +118,8 @@ static int battle_getenemy_sub(struct block_list *bl, va_list ap)
 		return 0;
 		return 0;
 	if (*c >= 24)
 	if (*c >= 24)
 		return 0;
 		return 0;
-
+	if (status_isdead(bl))
+		return 0;
 	if (battle_check_target(target, bl, BCT_ENEMY) > 0) {
 	if (battle_check_target(target, bl, BCT_ENEMY) > 0) {
 		bl_list[(*c)++] = bl;
 		bl_list[(*c)++] = bl;
 		return 1;
 		return 1;
@@ -1207,36 +1208,37 @@ static struct Damage battle_calc_weapon_attack(
 						sd->inventory_data[index] &&
 						sd->inventory_data[index] &&
 						sd->inventory_data[index]->type == IT_WEAPON)
 						sd->inventory_data[index]->type == IT_WEAPON)
 						wd.damage = sd->inventory_data[index]->weight*8/100; //80% of weight
 						wd.damage = sd->inventory_data[index]->weight*8/100; //80% of weight
-
-					ATK_ADDRATE(50*skill_lv); //Skill modifier applies to weight only.
-					index = sstatus->str/10;
-					index = index*index;
-					ATK_ADD(index); //Add str bonus.
-
-					switch (tstatus->size) { //Size-fix. Is this modified by weapon perfection?
-						case 0: //Small: 125%
-							ATK_RATE(125);
-							break;
-						//case 1: //Medium: 100%
-						case 2: //Large: 75%
-							ATK_RATE(75);
-							break;
-					}
-					break;
+				} else
+					wd.damage = sstatus->rhw.atk2*8/10; //Else use Atk2
+
+				ATK_ADDRATE(50*skill_lv); //Skill modifier applies to weight only.
+				i = sstatus->str/10;
+				i*=i;
+				ATK_ADD(i); //Add str bonus.
+				switch (tstatus->size) { //Size-fix. Is this modified by weapon perfection?
+					case 0: //Small: 125%
+						ATK_RATE(125);
+						break;
+					//case 1: //Medium: 100%
+					case 2: //Large: 75%
+						ATK_RATE(75);
+						break;
 				}
 				}
+				break;
 			case CR_SHIELDBOOMERANG:
 			case CR_SHIELDBOOMERANG:
 			case PA_SHIELDCHAIN:
 			case PA_SHIELDCHAIN:
+				wd.damage = sstatus->batk;
 				if (sd) {
 				if (sd) {
 					short index = sd->equip_index[EQI_HAND_L];
 					short index = sd->equip_index[EQI_HAND_L];
 
 
-					wd.damage = sstatus->batk;
-
 					if (index >= 0 &&
 					if (index >= 0 &&
 						sd->inventory_data[index] &&
 						sd->inventory_data[index] &&
 						sd->inventory_data[index]->type == IT_ARMOR)
 						sd->inventory_data[index]->type == IT_ARMOR)
 						ATK_ADD(sd->inventory_data[index]->weight/10);
 						ATK_ADD(sd->inventory_data[index]->weight/10);
 					break;
 					break;
-				}
+				} else
+					ATK_ADD(sstatus->rhw.atk2); //Else use Atk2
+				break;
 			case HFLI_SBR44:	//[orn]
 			case HFLI_SBR44:	//[orn]
 				if(src->type == BL_HOM) {
 				if(src->type == BL_HOM) {
 					wd.damage = ((TBL_HOM*)src)->homunculus.intimacy ;
 					wd.damage = ((TBL_HOM*)src)->homunculus.intimacy ;
@@ -3106,9 +3108,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
 						return 0;
 						return 0;
 				}
 				}
 			} else if (su->group->skill_id==WZ_ICEWALL)
 			} else if (su->group->skill_id==WZ_ICEWALL)
-			{	//Icewall can be hit by anything except skills.
-				if (src->type == BL_SKILL)
-					return 0;
+			{
 				state |= BCT_ENEMY;
 				state |= BCT_ENEMY;
 				strip_enemy = 0;
 				strip_enemy = 0;
 			} else	//Excepting traps and icewall, you should not be able to target skills.
 			} else	//Excepting traps and icewall, you should not be able to target skills.

+ 36 - 15
src/map/skill.c

@@ -2761,12 +2761,6 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
 	case NPC_COMBOATTACK:
 	case NPC_COMBOATTACK:
 	case NPC_GUIDEDATTACK:
 	case NPC_GUIDEDATTACK:
 	case NPC_POISON:
 	case NPC_POISON:
-	case NPC_BLINDATTACK:
-	case NPC_SILENCEATTACK:
-	case NPC_STUNATTACK:
-	case NPC_PETRIFYATTACK:
-	case NPC_CURSEATTACK:
-	case NPC_SLEEPATTACK:
 	case NPC_RANDOMATTACK:
 	case NPC_RANDOMATTACK:
 	case NPC_WATERATTACK:
 	case NPC_WATERATTACK:
 	case NPC_GROUNDATTACK:
 	case NPC_GROUNDATTACK:
@@ -2814,6 +2808,20 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
 	case HFLI_SBR44:	//[orn]
 	case HFLI_SBR44:	//[orn]
 		skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag);
 		skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag);
 		break;
 		break;
+	case NPC_BLINDATTACK:
+	case NPC_SILENCEATTACK:
+	case NPC_STUNATTACK:
+	case NPC_PETRIFYATTACK:
+	case NPC_CURSEATTACK:
+	case NPC_SLEEPATTACK:
+		if (flag&1 || skill_get_splash(skillid, skilllv) < 1)
+			skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag);
+		else
+			map_foreachinrange(skill_area_sub, bl,
+				skill_get_splash(skillid, skilllv),BL_CHAR,
+				src,skillid,skilllv,tick, flag|BCT_ENEMY|1,
+				skill_castend_damage_id);
+		break;
 
 
 	case LK_JOINTBEAT: // decide the ailment first (affects attack damage and effect)
 	case LK_JOINTBEAT: // decide the ailment first (affects attack damage and effect)
 		switch( rand()%6 ){
 		switch( rand()%6 ){
@@ -3502,14 +3510,21 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 		break;
 		break;
 
 
 	case PR_LEXDIVINA:
 	case PR_LEXDIVINA:
-		if (tsc && tsc->count && tsc->data[type].timer != -1) {
-			status_change_end(bl,type, -1);
-			clif_skill_nodamage (src, bl, skillid, skilllv, 1);
-		} else 
-			clif_skill_nodamage (src, bl, skillid, skilllv, 
-		  		sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
+		if (flag&1 || (i = skill_get_splash(skillid, skilllv)) < 1)
+		{
+			if (tsc && tsc->count && tsc->data[type].timer != -1) {
+				status_change_end(bl,type, -1);
+				clif_skill_nodamage (src, bl, skillid, skilllv, 1);
+			} else 
+				clif_skill_nodamage (src, bl, skillid, skilllv, 
+					sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
+			break;
+		}
+		//Affect all targets on splash area.
+		map_foreachinrange(skill_area_sub, bl, i, BL_CHAR,
+			src, skillid, skilllv, tick, flag|1,
+			skill_castend_damage_id);
 		break;
 		break;
-
 	case SA_ABRACADABRA:
 	case SA_ABRACADABRA:
 		{
 		{
 			int abra_skillid = 0, abra_skilllv;
 			int abra_skillid = 0, abra_skilllv;
@@ -4069,8 +4084,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 	case GS_SPREADATTACK:
 	case GS_SPREADATTACK:
 		clif_skill_nodamage(src,bl,skillid,skilllv,1);
 		clif_skill_nodamage(src,bl,skillid,skilllv,1);
 		skill_area_temp[1] = bl->id;
 		skill_area_temp[1] = bl->id;
+		//Mob casted skills should also hit skills.
 		map_foreachinrange(skill_area_sub, bl,
 		map_foreachinrange(skill_area_sub, bl,
-			skill_get_splash(skillid, skilllv), BL_CHAR,
+			skill_get_splash(skillid, skilllv), md?BL_CHAR|BL_SKILL:BL_CHAR,
 			src,skillid,skilllv,tick, flag|BCT_ENEMY|1,
 			src,skillid,skilllv,tick, flag|BCT_ENEMY|1,
 			skill_castend_damage_id);
 			skill_castend_damage_id);
 		break;
 		break;
@@ -4661,8 +4677,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 		}
 		}
 		break;
 		break;
 	case SA_DISPELL:
 	case SA_DISPELL:
+		if (flag&1 || (i = skill_get_splash(skillid, skilllv)) < 1)
 		{
 		{
-			int i;
 			clif_skill_nodamage(src,bl,skillid,skilllv,1);
 			clif_skill_nodamage(src,bl,skillid,skilllv,1);
 			i = tstatus->mdef;
 			i = tstatus->mdef;
 			if (i >= 100 ||
 			if (i >= 100 ||
@@ -4698,7 +4714,12 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 				if(i==SC_BERSERK) tsc->data[i].val2=0; //Mark a dispelled berserk to avoid setting hp to 100 by setting hp penalty to 0.
 				if(i==SC_BERSERK) tsc->data[i].val2=0; //Mark a dispelled berserk to avoid setting hp to 100 by setting hp penalty to 0.
 				status_change_end(bl,i,-1);
 				status_change_end(bl,i,-1);
 			}
 			}
+			break;
 		}
 		}
+		//Affect all targets on splash area.
+		map_foreachinrange(skill_area_sub, bl, i, BL_CHAR,
+			src, skillid, skilllv, tick, flag|1,
+			skill_castend_damage_id);
 		break;
 		break;
 
 
 	case TF_BACKSLIDING: //This is the correct implementation as per packet logging information. [Skotlex]
 	case TF_BACKSLIDING: //This is the correct implementation as per packet logging information. [Skotlex]