Kaynağa Gözat

* Fixed AutospellWhenHit effect to only work on melee attacks

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@1311 54d463be-8e91-2dee-dedb-b68131a5f0ec
celest 20 yıl önce
ebeveyn
işleme
06661cb573
2 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  1. 1 0
      Changelog-SVN.txt
  2. 2 1
      src/map/battle.c

+ 1 - 0
Changelog-SVN.txt

@@ -1,6 +1,7 @@
 Date	Added
 
 03/27
+	* Fixed AutospellWhenHit effect to only work on melee attacks [celest]
 	* Fixed AddEffWhenHit effect to only work on melee attacks [celest]
 	* Moved guardian hostility checking and monster_ignore_gm check to battle.c --
 	  processed earlier, and more appropiate [celest]

+ 2 - 1
src/map/battle.c

@@ -3616,7 +3616,8 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target,
 		}
 		if (target->type == BL_PC) {
 			struct map_session_data *tsd = (struct map_session_data *)target;
-			if(tsd->autospell2_id > 0 && rand()%100 < tsd->autospell2_rate) {
+			if(tsd && ((sd && !sd->state.arrow_atk) || (status_get_range(src)<=2)) &&
+				tsd->autospell2_id > 0 && rand()%100 < tsd->autospell2_rate) {
 				int skilllv = tsd->autospell_lv,i,f=0,sp;
 				i = rand()%100;
 				if(i >= 50) skilllv -= 2;