|
@@ -10991,11 +10991,9 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
|
|
break;
|
|
break;
|
|
case GN_CRAZYWEED: {
|
|
case GN_CRAZYWEED: {
|
|
int area = skill_get_splash(GN_CRAZYWEED_ATK, skill_lv);
|
|
int area = skill_get_splash(GN_CRAZYWEED_ATK, skill_lv);
|
|
- short x1 = 0, y1 = 0;
|
|
|
|
-
|
|
|
|
for( i = 0; i < 3 + (skill_lv/2); i++ ) {
|
|
for( i = 0; i < 3 + (skill_lv/2); i++ ) {
|
|
- x1 = x - area + rnd()%(area * 2 + 1);
|
|
|
|
- y1 = y - area + rnd()%(area * 2 + 1);
|
|
|
|
|
|
+ int x1 = x - area + rnd()%(area * 2 + 1);
|
|
|
|
+ int y1 = y - area + rnd()%(area * 2 + 1);
|
|
skill_addtimerskill(src,tick+i*150,0,x1,y1,GN_CRAZYWEED_ATK,skill_lv,-1,0);
|
|
skill_addtimerskill(src,tick+i*150,0,x1,y1,GN_CRAZYWEED_ATK,skill_lv,-1,0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -13395,11 +13393,10 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
|
|
break;
|
|
break;
|
|
case AS_CLOAKING:
|
|
case AS_CLOAKING:
|
|
{
|
|
{
|
|
- static int dx[] = { 0, 1, 0, -1, -1, 1, 1, -1};
|
|
|
|
- static int dy[] = {-1, 0, 1, 0, -1, -1, 1, 1};
|
|
|
|
-
|
|
|
|
if( skill_lv < 3 && ((sd->bl.type == BL_PC && battle_config.pc_cloak_check_type&1)
|
|
if( skill_lv < 3 && ((sd->bl.type == BL_PC && battle_config.pc_cloak_check_type&1)
|
|
|| (sd->bl.type != BL_PC && battle_config.monster_cloak_check_type&1) )) { //Check for walls.
|
|
|| (sd->bl.type != BL_PC && battle_config.monster_cloak_check_type&1) )) { //Check for walls.
|
|
|
|
+ static int dx[] = { 0, 1, 0, -1, -1, 1, 1, -1};
|
|
|
|
+ static int dy[] = {-1, 0, 1, 0, -1, -1, 1, 1};
|
|
int i;
|
|
int i;
|
|
ARR_FIND( 0, 8, i, map_getcell(sd->bl.m, sd->bl.x+dx[i], sd->bl.y+dy[i], CELL_CHKNOPASS) != 0 );
|
|
ARR_FIND( 0, 8, i, map_getcell(sd->bl.m, sd->bl.x+dx[i], sd->bl.y+dy[i], CELL_CHKNOPASS) != 0 );
|
|
if( i == 8 ) {
|
|
if( i == 8 ) {
|
|
@@ -13552,11 +13549,11 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
|
|
break;
|
|
break;
|
|
case CG_MOONLIT: //Check there's no wall in the range+1 area around the caster. [Skotlex]
|
|
case CG_MOONLIT: //Check there's no wall in the range+1 area around the caster. [Skotlex]
|
|
{
|
|
{
|
|
- int i,x,y,range = skill_get_splash(skill_id, skill_lv)+1;
|
|
|
|
|
|
+ int i,range = skill_get_splash(skill_id, skill_lv)+1;
|
|
int size = range*2+1;
|
|
int size = range*2+1;
|
|
for (i=0;i<size*size;i++) {
|
|
for (i=0;i<size*size;i++) {
|
|
- x = sd->bl.x+(i%size-range);
|
|
|
|
- y = sd->bl.y+(i/size-range);
|
|
|
|
|
|
+ int x = sd->bl.x+(i%size-range);
|
|
|
|
+ int y = sd->bl.y+(i/size-range);
|
|
if (map_getcell(sd->bl.m,x,y,CELL_CHKWALL)) {
|
|
if (map_getcell(sd->bl.m,x,y,CELL_CHKWALL)) {
|
|
clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
|
|
clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
|
|
return 0;
|
|
return 0;
|
|
@@ -13577,11 +13574,11 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id
|
|
case HP_BASILICA:
|
|
case HP_BASILICA:
|
|
if( !sc || (sc && !sc->data[SC_BASILICA])) {
|
|
if( !sc || (sc && !sc->data[SC_BASILICA])) {
|
|
if( sd ) {
|
|
if( sd ) {
|
|
- int i,x,y,range = skill_get_unit_range(skill_id,skill_lv)+1;
|
|
|
|
|
|
+ int i,range = skill_get_unit_range(skill_id,skill_lv)+1;
|
|
int size = range*2+1;
|
|
int size = range*2+1;
|
|
for( i=0;i<size*size;i++ ) {
|
|
for( i=0;i<size*size;i++ ) {
|
|
- x = sd->bl.x+(i%size-range);
|
|
|
|
- y = sd->bl.y+(i/size-range);
|
|
|
|
|
|
+ int x = sd->bl.x+(i%size-range);
|
|
|
|
+ int y = sd->bl.y+(i/size-range);
|
|
if( map_getcell(sd->bl.m,x,y,CELL_CHKWALL) ) {
|
|
if( map_getcell(sd->bl.m,x,y,CELL_CHKWALL) ) {
|
|
clif_skill_fail(sd,skill_id,USESKILL_FAIL,0);
|
|
clif_skill_fail(sd,skill_id,USESKILL_FAIL,0);
|
|
return 0;
|
|
return 0;
|
|
@@ -14170,7 +14167,7 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id,
|
|
}
|
|
}
|
|
case NC_SILVERSNIPER:
|
|
case NC_SILVERSNIPER:
|
|
case NC_MAGICDECOY: {
|
|
case NC_MAGICDECOY: {
|
|
- int c = 0, j;
|
|
|
|
|
|
+ int c = 0;
|
|
int maxcount = skill_get_maxcount(skill_id,skill_lv);
|
|
int maxcount = skill_get_maxcount(skill_id,skill_lv);
|
|
int mob_class = MOBID_SILVERSNIPER;
|
|
int mob_class = MOBID_SILVERSNIPER;
|
|
if( skill_id == NC_MAGICDECOY )
|
|
if( skill_id == NC_MAGICDECOY )
|
|
@@ -14178,6 +14175,7 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id,
|
|
|
|
|
|
if( battle_config.land_skill_limit && maxcount > 0 && ( battle_config.land_skill_limit&BL_PC ) ) {
|
|
if( battle_config.land_skill_limit && maxcount > 0 && ( battle_config.land_skill_limit&BL_PC ) ) {
|
|
if( skill_id == NC_MAGICDECOY ) {
|
|
if( skill_id == NC_MAGICDECOY ) {
|
|
|
|
+ int j;
|
|
for( j = mob_class; j <= MOBID_MAGICDECOY_WIND; j++ )
|
|
for( j = mob_class; j <= MOBID_MAGICDECOY_WIND; j++ )
|
|
map_foreachinmap(skill_check_condition_mob_master_sub, sd->bl.m, BL_MOB, sd->bl.id, j, skill_id, &c);
|
|
map_foreachinmap(skill_check_condition_mob_master_sub, sd->bl.m, BL_MOB, sd->bl.id, j, skill_id, &c);
|
|
} else
|
|
} else
|
|
@@ -15241,14 +15239,14 @@ void skill_weaponrefine (struct map_session_data *sd, int idx)
|
|
|
|
|
|
if (idx >= 0 && idx < MAX_INVENTORY)
|
|
if (idx >= 0 && idx < MAX_INVENTORY)
|
|
{
|
|
{
|
|
- int i = 0, ep = 0, per;
|
|
|
|
- int material[5] = { 0, ITEMID_PHRACON, ITEMID_EMVERETARCON, ITEMID_ORIDECON, ITEMID_ORIDECON, };
|
|
|
|
struct item *item;
|
|
struct item *item;
|
|
struct item_data *ditem = sd->inventory_data[idx];
|
|
struct item_data *ditem = sd->inventory_data[idx];
|
|
item = &sd->status.inventory[idx];
|
|
item = &sd->status.inventory[idx];
|
|
|
|
|
|
if(item->nameid > 0 && ditem->type == IT_WEAPON)
|
|
if(item->nameid > 0 && ditem->type == IT_WEAPON)
|
|
{
|
|
{
|
|
|
|
+ int i = 0, ep = 0, per;
|
|
|
|
+ int material[5] = { 0, ITEMID_PHRACON, ITEMID_EMVERETARCON, ITEMID_ORIDECON, ITEMID_ORIDECON, };
|
|
if( ditem->flag.no_refine ) { // if the item isn't refinable
|
|
if( ditem->flag.no_refine ) { // if the item isn't refinable
|
|
clif_skill_fail(sd,sd->menuskill_id,USESKILL_FAIL_LEVEL,0);
|
|
clif_skill_fail(sd,sd->menuskill_id,USESKILL_FAIL_LEVEL,0);
|
|
return;
|
|
return;
|
|
@@ -15951,13 +15949,13 @@ int skill_enchant_elemental_end (struct block_list *bl, int type)
|
|
|
|
|
|
bool skill_check_cloaking(struct block_list *bl, struct status_change_entry *sce)
|
|
bool skill_check_cloaking(struct block_list *bl, struct status_change_entry *sce)
|
|
{
|
|
{
|
|
- static int dx[] = { 0, 1, 0, -1, -1, 1, 1, -1};
|
|
|
|
- static int dy[] = {-1, 0, 1, 0, -1, -1, 1, 1};
|
|
|
|
bool wall = true;
|
|
bool wall = true;
|
|
|
|
|
|
if( (bl->type == BL_PC && battle_config.pc_cloak_check_type&1)
|
|
if( (bl->type == BL_PC && battle_config.pc_cloak_check_type&1)
|
|
|| (bl->type != BL_PC && battle_config.monster_cloak_check_type&1) )
|
|
|| (bl->type != BL_PC && battle_config.monster_cloak_check_type&1) )
|
|
{ //Check for walls.
|
|
{ //Check for walls.
|
|
|
|
+ static int dx[] = { 0, 1, 0, -1, -1, 1, 1, -1};
|
|
|
|
+ static int dy[] = {-1, 0, 1, 0, -1, -1, 1, 1};
|
|
int i;
|
|
int i;
|
|
ARR_FIND( 0, 8, i, map_getcell(bl->m, bl->x+dx[i], bl->y+dy[i], CELL_CHKNOPASS) != 0 );
|
|
ARR_FIND( 0, 8, i, map_getcell(bl->m, bl->x+dx[i], bl->y+dy[i], CELL_CHKNOPASS) != 0 );
|
|
if( i == 8 )
|
|
if( i == 8 )
|
|
@@ -15984,11 +15982,11 @@ bool skill_check_cloaking(struct block_list *bl, struct status_change_entry *sce
|
|
}
|
|
}
|
|
bool skill_check_camouflage(struct block_list *bl, struct status_change_entry *sce)
|
|
bool skill_check_camouflage(struct block_list *bl, struct status_change_entry *sce)
|
|
{
|
|
{
|
|
- static int dx[] = { 0, 1, 0, -1, -1, 1, 1, -1};
|
|
|
|
- static int dy[] = {-1, 0, 1, 0, -1, -1, 1, 1};
|
|
|
|
bool wall = true;
|
|
bool wall = true;
|
|
|
|
|
|
if( bl->type == BL_PC ) { //Check for walls.
|
|
if( bl->type == BL_PC ) { //Check for walls.
|
|
|
|
+ static int dx[] = { 0, 1, 0, -1, -1, 1, 1, -1};
|
|
|
|
+ static int dy[] = {-1, 0, 1, 0, -1, -1, 1, 1};
|
|
int i;
|
|
int i;
|
|
ARR_FIND( 0, 8, i, map_getcell(bl->m, bl->x+dx[i], bl->y+dy[i], CELL_CHKNOPASS) != 0 );
|
|
ARR_FIND( 0, 8, i, map_getcell(bl->m, bl->x+dx[i], bl->y+dy[i], CELL_CHKNOPASS) != 0 );
|
|
if( i == 8 )
|
|
if( i == 8 )
|
|
@@ -16188,12 +16186,14 @@ struct skill_unit_group* skill_initunitgroup (struct block_list* src, int count,
|
|
if(i == MAX_SKILLUNITGROUP) {
|
|
if(i == MAX_SKILLUNITGROUP) {
|
|
// array is full, make room by discarding oldest group
|
|
// array is full, make room by discarding oldest group
|
|
int j=0;
|
|
int j=0;
|
|
- unsigned maxdiff=0,x,tick=gettick();
|
|
|
|
- for(i=0;i<MAX_SKILLUNITGROUP && ud->skillunit[i];i++)
|
|
|
|
- if((x=DIFF_TICK(tick,ud->skillunit[i]->tick))>maxdiff){
|
|
|
|
|
|
+ unsigned maxdiff=0,tick=gettick();
|
|
|
|
+ for(i=0;i<MAX_SKILLUNITGROUP && ud->skillunit[i];i++){
|
|
|
|
+ unsigned int x=DIFF_TICK(tick,ud->skillunit[i]->tick);
|
|
|
|
+ if(x>maxdiff){
|
|
maxdiff=x;
|
|
maxdiff=x;
|
|
j=i;
|
|
j=i;
|
|
}
|
|
}
|
|
|
|
+ }
|
|
skill_delunitgroup(ud->skillunit[j]);
|
|
skill_delunitgroup(ud->skillunit[j]);
|
|
//Since elements must have shifted, we use the last slot.
|
|
//Since elements must have shifted, we use the last slot.
|
|
i = MAX_SKILLUNITGROUP-1;
|
|
i = MAX_SKILLUNITGROUP-1;
|
|
@@ -16384,7 +16384,7 @@ int skill_clear_unitgroup (struct block_list *src)
|
|
*
|
|
*
|
|
*------------------------------------------*/
|
|
*------------------------------------------*/
|
|
struct skill_unit_group_tickset *skill_unitgrouptickset_search (struct block_list *bl, struct skill_unit_group *group, int tick) {
|
|
struct skill_unit_group_tickset *skill_unitgrouptickset_search (struct block_list *bl, struct skill_unit_group *group, int tick) {
|
|
- int i,j=-1,k,s,id;
|
|
|
|
|
|
+ int i,j=-1,s,id;
|
|
struct unit_data *ud;
|
|
struct unit_data *ud;
|
|
struct skill_unit_group_tickset *set;
|
|
struct skill_unit_group_tickset *set;
|
|
|
|
|
|
@@ -16403,7 +16403,7 @@ struct skill_unit_group_tickset *skill_unitgrouptickset_search (struct block_lis
|
|
id = s = group->group_id;
|
|
id = s = group->group_id;
|
|
|
|
|
|
for (i=0; i<MAX_SKILLUNITGROUPTICKSET; i++) {
|
|
for (i=0; i<MAX_SKILLUNITGROUPTICKSET; i++) {
|
|
- k = (i+s) % MAX_SKILLUNITGROUPTICKSET;
|
|
|
|
|
|
+ int k = (i+s) % MAX_SKILLUNITGROUPTICKSET;
|
|
if (set[k].id == id)
|
|
if (set[k].id == id)
|
|
return &set[k];
|
|
return &set[k];
|
|
else if (j==-1 && (DIFF_TICK(tick,set[k].tick)>0 || set[k].id==0))
|
|
else if (j==-1 && (DIFF_TICK(tick,set[k].tick)>0 || set[k].id==0))
|
|
@@ -16941,7 +16941,7 @@ int skill_can_produce_mix (struct map_session_data *sd, int nameid, int trigger,
|
|
}
|
|
}
|
|
|
|
|
|
for(j=0;j<MAX_PRODUCE_RESOURCE;j++){
|
|
for(j=0;j<MAX_PRODUCE_RESOURCE;j++){
|
|
- int id,x,y;
|
|
|
|
|
|
+ int id;
|
|
if( (id=skill_produce_db[i].mat_id[j]) <= 0 )
|
|
if( (id=skill_produce_db[i].mat_id[j]) <= 0 )
|
|
continue;
|
|
continue;
|
|
if(skill_produce_db[i].mat_amount[j] <= 0) {
|
|
if(skill_produce_db[i].mat_amount[j] <= 0) {
|
|
@@ -16949,6 +16949,7 @@ int skill_can_produce_mix (struct map_session_data *sd, int nameid, int trigger,
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
|
|
+ int x,y;
|
|
for(y=0,x=0;y<MAX_INVENTORY;y++)
|
|
for(y=0,x=0;y<MAX_INVENTORY;y++)
|
|
if( sd->status.inventory[y].nameid == id )
|
|
if( sd->status.inventory[y].nameid == id )
|
|
x+=sd->status.inventory[y].amount;
|
|
x+=sd->status.inventory[y].amount;
|
|
@@ -17767,7 +17768,7 @@ int skill_elementalanalysis(struct map_session_data* sd, int n, uint16 skill_lv,
|
|
return 1;
|
|
return 1;
|
|
|
|
|
|
for( i = 0; i < n; i++ ) {
|
|
for( i = 0; i < n; i++ ) {
|
|
- int nameid, add_amount, del_amount, idx, product, flag;
|
|
|
|
|
|
+ int nameid, add_amount, del_amount, idx, product;
|
|
struct item tmp_item;
|
|
struct item tmp_item;
|
|
|
|
|
|
idx = item_list[i*2+0]-2;
|
|
idx = item_list[i*2+0]-2;
|
|
@@ -17815,7 +17816,8 @@ int skill_elementalanalysis(struct map_session_data* sd, int n, uint16 skill_lv,
|
|
tmp_item.identify = 1;
|
|
tmp_item.identify = 1;
|
|
|
|
|
|
if( tmp_item.amount ) {
|
|
if( tmp_item.amount ) {
|
|
- if( (flag = pc_additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_CONSUME)) ) {
|
|
|
|
|
|
+ int flag = pc_additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_CONSUME);
|
|
|
|
+ if( flag != 0 ) {
|
|
clif_additem(sd,0,0,flag);
|
|
clif_additem(sd,0,0,flag);
|
|
map_addflooritem(&tmp_item,tmp_item.amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
|
|
map_addflooritem(&tmp_item,tmp_item.amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
|
|
}
|
|
}
|
|
@@ -18079,11 +18081,16 @@ int skill_split_str (char *str, char **val, int num) {
|
|
|
|
|
|
return i;
|
|
return i;
|
|
}
|
|
}
|
|
-/*
|
|
|
|
- *
|
|
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * Split the string with ':' as separator and put each value for a skilllv
|
|
|
|
+ * if no more value found put the latest to fill the array
|
|
|
|
+ * @param str : string to split
|
|
|
|
+ * @param val : array of MAX_SKILL_LEVEL to put value into
|
|
|
|
+ * @return 0:error, x:number of value assign (should be MAX_SKILL_LEVEL)
|
|
*/
|
|
*/
|
|
int skill_split_atoi (char *str, int *val) {
|
|
int skill_split_atoi (char *str, int *val) {
|
|
- int i, j, diff, step = 1;
|
|
|
|
|
|
+ int i, j, step = 1;
|
|
|
|
|
|
for (i=0; i<MAX_SKILL_LEVEL; i++) {
|
|
for (i=0; i<MAX_SKILL_LEVEL; i++) {
|
|
if (!str) break;
|
|
if (!str) break;
|
|
@@ -18101,7 +18108,7 @@ int skill_split_atoi (char *str, int *val) {
|
|
}
|
|
}
|
|
//Check for linear change with increasing steps until we reach half of the data acquired.
|
|
//Check for linear change with increasing steps until we reach half of the data acquired.
|
|
for (step = 1; step <= i/2; step++) {
|
|
for (step = 1; step <= i/2; step++) {
|
|
- diff = val[i-1] - val[i-step-1];
|
|
|
|
|
|
+ int diff = val[i-1] - val[i-step-1];
|
|
for(j = i-1; j >= step; j--)
|
|
for(j = i-1; j >= step; j--)
|
|
if ((val[j]-val[j-step]) != diff)
|
|
if ((val[j]-val[j-step]) != diff)
|
|
break;
|
|
break;
|
|
@@ -18126,13 +18133,13 @@ int skill_split_atoi (char *str, int *val) {
|
|
*
|
|
*
|
|
*/
|
|
*/
|
|
void skill_init_unit_layout (void) {
|
|
void skill_init_unit_layout (void) {
|
|
- int i,j,size,pos = 0;
|
|
|
|
|
|
+ int i,j,pos = 0;
|
|
|
|
|
|
memset(skill_unit_layout,0,sizeof(skill_unit_layout));
|
|
memset(skill_unit_layout,0,sizeof(skill_unit_layout));
|
|
|
|
|
|
// standard square layouts go first
|
|
// standard square layouts go first
|
|
for (i=0; i<=MAX_SQUARE_LAYOUT; i++) {
|
|
for (i=0; i<=MAX_SQUARE_LAYOUT; i++) {
|
|
- size = i*2+1;
|
|
|
|
|
|
+ int size = i*2+1;
|
|
skill_unit_layout[i].count = size*size;
|
|
skill_unit_layout[i].count = size*size;
|
|
for (j=0; j<size*size; j++) {
|
|
for (j=0; j<size*size; j++) {
|
|
skill_unit_layout[i].dx[j] = (j%size-i);
|
|
skill_unit_layout[i].dx[j] = (j%size-i);
|