viewing paste ra_LP_AOE_patch | Diff

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
Index: src/map/skill.c
===================================================================
--- src/map/skill.c (revision 17256)
+++ src/map/skill.c (working copy)
@@ -11214,7 +11214,10 @@
    nullpo_ret(sg=src->group);
    nullpo_ret(ss=map_id2bl(sg->src_id));
 
-   if( skill_get_type(sg->skill_id) == BF_MAGIC && map_getcell(bl->m, bl->x, bl->y, CELL_CHKLANDPROTECTOR) && sg->skill_id != SA_LANDPROTECTOR )
+   if(sg->skill_id != SA_LANDPROTECTOR
+       && skill_get_type(sg->skill_id) == BF_MAGIC
+       && map_foreachinrange(map_iscellchk, bl, 1, BL_SKILL, CELL_CHKLANDPROTECTOR) >= 8
+       )
        return 0; //AoE skills are ineffective. [Skotlex]
 
    sc = status_get_sc(bl);
@@ -15599,7 +15602,8 @@
 
    nullpo_ret(group);
 
-   if( !(skill_get_inf2(group->skill_id)&(INF2_SONG_DANCE|INF2_TRAP|INF2_NOLP)) && map_getcell(bl->m, bl->x, bl->y, CELL_CHKLANDPROTECTOR) )
+   if( !(skill_get_inf2(group->skill_id)&(INF2_SONG_DANCE|INF2_TRAP|INF2_NOLP))
+       &&  map_foreachinrange(map_iscellchk, bl, 1, BL_SKILL, CELL_CHKLANDPROTECTOR) >= 8 ) //chk if all around has lp
        return 0; //AoE skills are ineffective. [Skotlex]
 
    if( battle_check_target(&unit->bl,bl,group->target_flag) <= 0 )
@@ -15618,7 +15622,7 @@
    struct skill_unit* unit = db_data2ptr(data);
    struct skill_unit_group* group = unit->group;
    unsigned int tick = va_arg(ap,unsigned int);
-   bool dissonance;
+   bool dissonance;
    struct block_list* bl = &unit->bl;
 
    if( !unit->alive )
@@ -15824,7 +15828,7 @@
        }
    }
 
-   if( dissonance ) skill_dance_switch(unit, 1);
+   if( dissonance ) skill_dance_switch(unit, 1);
 
    return 0;
 }
Index: src/map/map.c
===================================================================
--- src/map/map.c   (revision 17256)
+++ src/map/map.c   (working copy)
@@ -554,7 +554,7 @@
 #ifdef CIRCULAR_AREA
                        && check_distance_bl(center, bl, range)
 #endif
-                       && bl_list_count < BL_LIST_MAX )
+                       && bl_list_count < BL_LIST_MAX )
                        bl_list[ bl_list_count++ ] = bl;
                }
            }
@@ -579,6 +579,7 @@
 
    map_freeblock_lock();
 
+
    for( i = blockcount; i < bl_list_count; i++ )
        if( bl_list[ i ]->prev ) { //func() may delete this bl_list[] slot, checking for prev ensures it wasnt queued for deletion.
            va_start(ap, type);
@@ -2573,6 +2574,10 @@
    map[m].cell[j].water = cell.water;
 }
 
+int map_iscellchk(struct block_list *bl, va_list ap){
+   cell_chk cellchk = va_arg(ap, cell_chk);
+   return map_getcell(bl->m, bl->x, bl->y, cellchk)?1:0;
+}
 /*==========================================
  * Invisible Walls
  *------------------------------------------*/
Index: src/map/map.h
===================================================================
--- src/map/map.h   (revision 17256)
+++ src/map/map.h   (working copy)
@@ -608,6 +608,7 @@
    uint16 port;
 };
 
+int map_iscellchk(struct block_list *bl, va_list ap);
 int map_getcell(int16 m,int16 x,int16 y,cell_chk cellchk);
 int map_getcellp(struct map_data* m,int16 x,int16 y,cell_chk cellchk);
 void map_setcell(int16 m, int16 x, int16 y, cell_t cell, bool flag);
Viewed 1287 times, submitted by lighta.