Przeglądaj źródła

- Corrected a status_get_race call which should be status_get_race2 in misc attacks.
- Moved the Devotion code to the top of the SC list in status_damage, meaning that now stuff like being asleep or confused won't end if you are hit, but the damage is absorbed by devotion.
- Some cleanups in battle.c (replaced usage of status_get_* for status->*)


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

skotlex 19 lat temu
rodzic
commit
5bbd6fe6b9
3 zmienionych plików z 19 dodań i 14 usunięć
  1. 5 0
      Changelog-Trunk.txt
  2. 3 3
      src/map/battle.c
  3. 11 11
      src/map/status.c

+ 5 - 0
Changelog-Trunk.txt

@@ -4,6 +4,11 @@ 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/07/31
+	* Corrected a status_get_race call which should be status_get_race2 in misc
+	  attacks. [Skotlex]
+	* Moved the Devotion code to the top of the SC list in status_damage,
+	  meaning that now stuff like being asleep or confused won't end if you are
+	  hit, but the damage is absorbed by devotion. [Skotlex]
 	* Added the Soul Link of Rogue speed bonus to Chase-Walk. Since there's no
 	  information of how much the bonus should be, it currently is a conservative
 	  10%. [Skotlex]

+ 3 - 3
src/map/battle.c

@@ -823,7 +823,7 @@ static struct Damage battle_calc_weapon_attack(
 	//Set miscellaneous data that needs be filled regardless of hit/miss
 	if(
 		(sd && sd->state.arrow_atk) ||
-		(!sd && ((skill_num && skill_get_ammotype(skill_num)) || status_get_range(src)>3))
+		(!sd && ((skill_num && skill_get_ammotype(skill_num)) || sstatus->rhw.range>3))
 	) {	
 		wd.flag=(wd.flag&~BF_RANGEMASK)|BF_LONG;
 		flag.arrow = 1;
@@ -2114,7 +2114,7 @@ struct Damage battle_calc_magic_attack(
 	//Initial Values
 	ad.damage = 1;
 	ad.div_=skill_get_num(skill_num,skill_lv);
-	ad.amotion=skill_get_inf(skill_num)&INF_GROUND_SKILL?0:status_get_amotion(src); //Amotion should be 0 for ground skills.
+	ad.amotion=skill_get_inf(skill_num)&INF_GROUND_SKILL?0:sstatus->amotion; //Amotion should be 0 for ground skills.
 	ad.dmotion=tstatus->dmotion;
 	ad.blewcount = skill_get_blewcount(skill_num,skill_lv);
 	ad.flag=BF_MAGIC|BF_LONG|BF_SKILL;
@@ -2663,7 +2663,7 @@ struct Damage  battle_calc_misc_attack(
 
 	if(md.damage && flag.cardfix && tsd){
 		int cardfix = 10000;
-		int race2 = status_get_race(src);
+		int race2 = status_get_race2(src);
 		cardfix=cardfix*(100-tsd->subele[s_ele])/100;
 		cardfix=cardfix*(100-tsd->subsize[sstatus->size])/100;
 		cardfix=cardfix*(100-tsd->subrace2[race2])/100;

+ 11 - 11
src/map/status.c

@@ -573,6 +573,17 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
 
 	if (hp && !(flag&1)) {
 		if (sc) {
+			if (sc->data[SC_DEVOTION].val1 && src && battle_getcurrentskill(src) != PA_PRESSURE)
+			{	//Devotion prevents any of the other ailments from ending.
+				struct map_session_data *sd2 = map_id2sd(sc->data[SC_DEVOTION].val1);
+				if (sd2 && sd2->devotion[sc->data[SC_DEVOTION].val2] == target->id)
+				{
+					clif_damage(&sd2->bl, &sd2->bl, gettick(), 0, 0, hp, 0, 0, 0);
+					status_fix_damage(NULL, &sd2->bl, hp, 0);
+					return 0;
+				}
+				status_change_end(target, SC_DEVOTION, -1);
+			}
 			if (sc->data[SC_FREEZE].timer != -1)
 				status_change_end(target,SC_FREEZE,-1);
 			if (sc->data[SC_STONE].timer!=-1 && sc->opt1 == OPT1_STONE)
@@ -607,17 +618,6 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s
 					status_change_end(target, SC_GRAVITATION, -1);
 				}
 			}
-			if (sc->data[SC_DEVOTION].val1 && src && battle_getcurrentskill(src) != PA_PRESSURE)
-			{
-				struct map_session_data *sd2 = map_id2sd(sc->data[SC_DEVOTION].val1);
-				if (sd2 && sd2->devotion[sc->data[SC_DEVOTION].val2] == target->id)
-				{
-					clif_damage(&sd2->bl, &sd2->bl, gettick(), 0, 0, hp, 0, 0, 0);
-					status_fix_damage(NULL, &sd2->bl, hp, 0);
-					return 0;
-				}
-				status_change_end(target, SC_DEVOTION, -1);
-			}
 			if(sc->data[SC_DANCING].timer != -1 && hp > (signed int)status->max_hp>>2)
 				skill_stop_dancing(target);
 		}