浏览代码

Fixed Sura's Lightning Walk, bugreport:5407

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15713 54d463be-8e91-2dee-dedb-b68131a5f0ec
shennetsind 13 年之前
父节点
当前提交
f81e19f10a
共有 1 个文件被更改,包括 14 次插入0 次删除
  1. 14 0
      src/map/battle.c

+ 14 - 0
src/map/battle.c

@@ -588,6 +588,20 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
 
 		if (!damage) return 0;
 
+		if( (sce = sc->data[SC_LIGHTNINGWALK]) && flag&BF_LONG && rand()%100 < sce->val1 ) {
+			int dx[8]={0,-1,-1,-1,0,1,1,1};
+			int dy[8]={1,1,0,-1,-1,-1,0,1};
+			int dir = map_calc_dir(bl, src->x, src->y);
+			if( unit_movepos(bl, src->x-dx[dir], src->y-dy[dir], 1, 1) ) {
+				clif_slide(bl,src->x-dx[dir],src->y-dy[dir]);
+				unit_setdir(bl, dir);
+			}
+			d->dmg_lv = ATK_DEF;
+			status_change_end(bl, SC_LIGHTNINGWALK, -1);
+			return 0;
+		}
+
+
 		//Probably not the most correct place, but it'll do here
 		//(since battle_drain is strictly for players currently)
 		if ((sce=sc->data[SC_BLOODLUST]) && flag&BF_WEAPON && damage > 0 &&