viewing paste overbrand | C

Posted on the
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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
Index: src/map/skill.c
===================================================================
--- src/map/skill.c (revision 17319)
+++ src/map/skill.c (working copy)
@@ -10396,15 +10396,7 @@
        break;
 
    case LG_OVERBRAND:
-       {
-           int width;//according to data from irowiki it actually is a square
-           for( width = 0; width < 7; width++ )
-               for( i = 0; i < 7; i++ )
-                   map_foreachincell(skill_area_sub, src->m, x-2+i, y-2+width, splash_target(src), src, LG_OVERBRAND_BRANDISH, skill_lv, tick, flag|BCT_ENEMY,skill_castend_damage_id);
-           for( width = 0; width < 7; width++ )
-               for( i = 0; i < 7; i++ )
-                   map_foreachincell(skill_area_sub, src->m, x-2+i, y-2+width, splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY,skill_castend_damage_id);
-       }
+       skill_overbrand(src, skill_id, skill_lv, x, y, tick, flag);
        break;
 
    case LG_BANDING:
@@ -14284,6 +14276,45 @@
 /*=========================================
  *
  *-----------------------------------------*/
+void skill_overbrand(struct block_list* src, uint16 skill_id, uint16 skill_lv, uint16 x, uint16 y, unsigned int tick, int flag)
+{
+   struct s_skill_unit_layout *layout;
+   int i, ux[53], uy[53];
+   layout = skill_get_unit_layout(skill_id,skill_lv,src,x,y);
+   short dir = map_calc_dir(src,x,y);
+   if(dir > 0 && dir < 4) {
+       for(i = 0; i < 53; i++) {
+           ux[i] = layout->dy[i];
+           uy[i] = layout->dx[i] * -1;
+       }
+   } else if(dir == 4) {
+       for(i = 0; i < 53; i++) {
+           ux[i] = layout->dx[i];
+           uy[i] = layout->dy[i];
+       }
+   } else if(dir > 4) {
+       for(i = 0; i < 53; i++) {
+           ux[i] = layout->dy[i] * -1;
+           uy[i] = layout->dx[i];
+       }
+   } else {
+       for(i = 0; i < 53; i++) {
+           ux[i] = layout->dx[i];
+           uy[i] = layout->dy[i] * -1;
+       }
+   }
+   for( i = 0; i < 53; i++ ) {
+       if(i < 12) { //Close range hits twice
+           map_foreachincell(skill_area_sub, src->m, x+ux[i], y+uy[i], splash_target(src), src, LG_OVERBRAND_BRANDISH, skill_lv, tick, flag|BCT_ENEMY,skill_castend_damage_id);
+           map_foreachincell(skill_area_sub, src->m, x+ux[i], y+uy[i], splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY,skill_castend_damage_id);
+       } else if(i > 11 && i < 45) //Far sides do knockback damage
+           map_foreachincell(skill_area_sub, src->m, x+ux[i], y+uy[i], splash_target(src), src, skill_id, skill_lv, tick, flag|BCT_ENEMY,skill_castend_damage_id);
+       else //Far middle does piercing damage
+           map_foreachincell(skill_area_sub, src->m, x+ux[i], y+uy[i], splash_target(src), src, LG_OVERBRAND_BRANDISH, skill_lv, tick, flag|BCT_ENEMY,skill_castend_damage_id);
+   }
+
+}
+
 struct square {
    int val1[5];
    int val2[5];
@@ -17530,6 +17561,18 @@
                        memcpy(skill_unit_layout[pos].dy,dy,sizeof(dy));
                    }
                    break;
+               case LG_OVERBRAND: {
+                       static const int dx[] = {-1,-1,-1,-1, 0, 0, 0, 0, 1, 1, 1, 1,
+                                    -5,-5,-5,-5,-4,-4,-4,-4,-3,-3,-3,-3,-2,-2,-2,-2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5,
+                                    -1,-1,-1, 0, 0, 0, 1, 1, 1};
+                       static const int dy[] = { 0,-1,-2,-3, 0,-1,-2,-3, 0,-1,-2,-3, 
+                                     0,-1,-2,-3, 0,-1,-2,-3, 0,-1,-2,-3, 0,-1,-2,-3, 0,-1,-2,-3, 0,-1,-2,-3, 0,-1,-2,-3, 0,-1,-2,-3,
+                                    -4,-5,-6,-4,-5,-6,-4,-5,-6};
+                       skill_unit_layout[pos].count = 53;
+                       memcpy(skill_unit_layout[pos].dx,dx,sizeof(dx));
+                       memcpy(skill_unit_layout[pos].dy,dy,sizeof(dy));
+                   }
+                   break;
                default:
                    ShowError("unknown unit layout at skill %d\n",i);
                    break;
Index: src/map/skill.h
===================================================================
--- src/map/skill.h (revision 17319)
+++ src/map/skill.h (working copy)
@@ -333,6 +333,7 @@
 
 int skill_sit (struct map_session_data *sd, int type);
 void skill_brandishspear(struct block_list* src, struct block_list* bl, uint16 skill_id, uint16 skill_lv, unsigned int tick, int flag);
+void skill_overbrand(struct block_list* src, uint16 skill_id, uint16 skill_lv, uint16 x, uint16 y, unsigned int tick, int flag);
 void skill_repairweapon(struct map_session_data *sd, int idx);
 void skill_identify(struct map_session_data *sd,int idx);
 void skill_weaponrefine(struct map_session_data *sd,int idx); // [Celest]
Index: db/re/skill_db.txt
===================================================================
--- db/re/skill_db.txt  (revision 17319)
+++ db/re/skill_db.txt  (working copy)
@@ -889,7 +889,7 @@
 2314,1,6,1,-1,0,0,1,1,no,0,0,0,weapon,0,   LG_RAGEBURST,Rage Burst
 2315,0,6,4,0,0x2,3,3,1,yes,0,0,0,none,2,   LG_SHIELDSPELL,Shield Spell
 2316,0,6,4,0,0x1,0,5,1,yes,0,0,0,none,0,   LG_EXEEDBREAK,Exceed Break
-2317,1,6,2,-1,0x2,5,5,1,yes,0,0,0,none,3:4:5:6:7,  LG_OVERBRAND,Over Brand //CHECK I know the splash is needed somehow for the strange AoE it gives.
+2317,0,6,2,-1,0x2,0,5,1,yes,0,0,0,none,3:4:5:6:7,  LG_OVERBRAND,Over Brand //CHECK I know the splash is needed somehow for the strange AoE it gives.
 2318,0,6,4,0,0x1,0,5,1,yes,0,0,0,none,0,   LG_PRESTIGE,Prestige
 2319,0,6,4,0,0x1,3,5,1,no,0,0,0,weapon,0,  LG_BANDING,Banding //CHECK Splash isnt needed right? Banding has its own UNIT ID.
 2320,0,6,4,-1,0x2,3,5,1,yes,0,0,0,weapon,0,    LG_MOONSLASHER,Moon Slasher
Index: db/re/skill_unit_db.txt
===================================================================
--- db/re/skill_unit_db.txt (revision 17319)
+++ db/re/skill_unit_db.txt (working copy)
@@ -127,6 +127,7 @@
 2303,0xd0,    ,  3, 0,  -1,all,   0x2018   //SC_BLOODYLUST
 2304,0xd1,    ,  0, 2,  -1,enemy, 0x000    //SC_FEINTBOMB
 
+2317,0xec,    , -1, 0, -1,enemy, 0x000 //LG_OVERBRAND
 2319,0xec,    ,  0, 3,5000,all,   0x000    //LG_BANDING
 
 2414,0xda,    ,  0, 0,1000,enemy, 0x008    //WM_REVERBERATION
Viewed 1014 times, submitted by Guest.