diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/battle.c | 3 | ||||
-rw-r--r-- | src/map/map.c | 10 | ||||
-rw-r--r-- | src/map/map.h | 6 | ||||
-rw-r--r-- | src/map/pc.c | 20 | ||||
-rw-r--r-- | src/map/skill.c | 69 |
5 files changed, 32 insertions, 76 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index a6dad0538..1f7295578 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3023,9 +3023,6 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f return -1; } - if (flag&BCT_ENEMY && (map_getcell(m,src->x,src->y,CELL_CHKNODAMAGE) || map_getcell(m,target->x,target->y,CELL_CHKNODAMAGE))) - return -1; // [NoDamage] - //t_bl/s_bl hold the 'master' of the attack, while src/target are the actual //objects involved. if ((t_bl = battle_get_master(target)) == NULL) diff --git a/src/map/map.c b/src/map/map.c index 32838dfa9..a9ac939bf 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -2272,12 +2272,8 @@ int map_getcellp(struct map_data* m,int x,int y,cell_chk cellchk) return (cell.basilica); case CELL_CHKLANDPROTECTOR: return (cell.landprotector); - case CELL_CHKICEWALL: - return (cell.icewall); case CELL_CHKNOVENDING: return (cell.novending); - case CELL_CHKNODAMAGE: - return (cell.nodamage); case CELL_CHKNOCHAT: return (cell.nochat); @@ -2287,14 +2283,14 @@ int map_getcellp(struct map_data* m,int x,int y,cell_chk cellchk) if (cell.cell_bl >= battle_config.cell_stack_limit) return 0; #endif case CELL_CHKREACH: - return (cell.walkable && !cell.icewall); + return (cell.walkable); case CELL_CHKNOPASS: #ifdef CELL_NOSTACK if (cell.cell_bl >= battle_config.cell_stack_limit) return 1; #endif case CELL_CHKNOREACH: - return (!cell.walkable || cell.icewall); + return (!cell.walkable); case CELL_CHKSTACK: #ifdef CELL_NOSTACK @@ -2328,11 +2324,9 @@ void map_setcell(int m, int x, int y, cell_t cell, bool flag) case CELL_WATER: map[m].cell[j].water = flag; break; case CELL_NPC: map[m].cell[j].npc = flag; break; - case CELL_ICEWALL: map[m].cell[j].icewall = flag; break; case CELL_BASILICA: map[m].cell[j].basilica = flag; break; case CELL_LANDPROTECTOR: map[m].cell[j].landprotector = flag; break; case CELL_NOVENDING: map[m].cell[j].novending = flag; break; - case CELL_NODAMAGE: map[m].cell[j].nodamage = flag; break; case CELL_NOCHAT: map[m].cell[j].nochat = flag; break; default: ShowWarning("map_setcell: invalid cell type '%d'\n", (int)cell); diff --git a/src/map/map.h b/src/map/map.h index f04ae9340..d0716ba8e 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -1104,9 +1104,7 @@ typedef enum { CELL_NPC, CELL_BASILICA, CELL_LANDPROTECTOR, - CELL_ICEWALL, CELL_NOVENDING, - CELL_NODAMAGE, CELL_NOCHAT, } cell_t; @@ -1127,9 +1125,7 @@ typedef enum { CELL_CHKNPC, CELL_CHKBASILICA, CELL_CHKLANDPROTECTOR, - CELL_CHKICEWALL, CELL_CHKNOVENDING, - CELL_CHKNODAMAGE, CELL_CHKNOCHAT, } cell_chk; @@ -1146,9 +1142,7 @@ struct mapcell npc : 1, landprotector : 1, basilica : 1, - icewall : 1, novending : 1, - nodamage : 1, nochat : 1; #ifdef CELL_NOSTACK diff --git a/src/map/pc.c b/src/map/pc.c index 1d4b9feb6..0dbc8c076 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -3426,18 +3426,14 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y return 0; } - if(x <0 || x >= map[m].xs || y <0 || y >= map[m].ys) - x=y=0; - if((x==0 && y==0) || - (map_getcell(m, x, y, CELL_CHKNOPASS) && -#ifdef CELL_NOSTACK - !map_getcell(m, x, y, CELL_CHKSTACK) && -#endif - !map_getcell(m, x, y, CELL_CHKICEWALL)) - ){ //It is allowed on top of Moonlight/icewall tiles to prevent force-warping 'cheats' [Skotlex] - if(x||y) { - ShowError("pc_setpos: attempt to place player %s (%d:%d) on non-walkable tile (%s-%d,%d)\n", sd->status.name, sd->status.account_id, sd->status.char_id, mapindex_id2name(mapindex),x,y); - } + if( x < 0 || x >= map[m].xs || y < 0 || y >= map[m].ys ) + { + ShowError("pc_setpos: attempt to place player %s (%d:%d) on invalid coordinates (%s-%d,%d)\n", sd->status.name, sd->status.account_id, sd->status.char_id, mapindex_id2name(mapindex),x,y); + x = y = 0; // make it random + } + + if( x == 0 && y == 0 ) + {// pick a random walkable cell do { x=rand()%(map[m].xs-2)+1; y=rand()%(map[m].ys-2)+1; diff --git a/src/map/skill.c b/src/map/skill.c index 39c048bad..00bfa96cb 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -6427,18 +6427,14 @@ struct skill_unit_group* skill_unitsetting (struct block_list *src, short skilli if(range<=0) map_foreachincell(skill_cell_overlap,src->m,ux,uy,BL_SKILL,skillid,&alive, src); - if(alive && map_getcell(src->m,ux,uy,CELL_CHKWALL)) + if( alive && map_getcell(src->m,ux,uy,CELL_CHKWALL) ) alive = 0; if( alive && battle_config.skill_wall_check && !path_search_long(NULL,src->m,ux,uy,x,y,CELL_CHKWALL) ) alive = 0; //no path between cell and center of casting. - if(alive && skillid == WZ_ICEWALL) { - if( map_getcell(src->m,ux,uy,CELL_CHKWALL) || map_getcell(src->m,ux,uy,CELL_CHKCLIFF) ) - alive=0; - else - clif_changemapcell(0,src->m,ux,uy,5,AREA); - } + if( alive && skillid == WZ_ICEWALL && !map_getcell(src->m,ux,uy,CELL_CHKREACH) ) + alive = 0; if(alive){ //FIXME: why not calculate val1/val2 in here? [ultramage] @@ -7250,37 +7246,6 @@ int skill_unit_effect (struct block_list* bl, va_list ap) } /*========================================== - * Triggers when a skill unit is about to be deleted - *------------------------------------------*/ -static int skill_unit_ondelete (struct skill_unit *src, unsigned int tick) -{ - struct skill_unit_group *sg; - nullpo_retr(0, src); - nullpo_retr(0, sg=src->group); - - switch( sg->unit_id ) - { - - case UNT_ICEWALL: - // hack to prevent client from leaving cells unwalkable - //FIXME: this should be done individually in insight/outsight code instead [ultramage] - clif_changemapcell(0,src->bl.m,src->bl.x,src->bl.y,src->val2,ALL_SAMEMAP); - break; - - case UNT_ANKLESNARE: - { - struct block_list *target = map_id2bl(sg->val2); - if(target) - status_change_end(target,SC_ANKLE,-1); - } - break; - - } - - return 0; -} - -/*========================================== * *------------------------------------------*/ int skill_unit_ondamaged (struct skill_unit *src, struct block_list *bl, int damage, unsigned int tick) @@ -9249,22 +9214,26 @@ struct skill_unit *skill_initunit (struct skill_unit_group *group, int idx, int map_addblock(&unit->bl); + // perform oninit actions switch (group->skill_id) { + case WZ_ICEWALL: + map_setgatcell(unit->bl.m,unit->bl.x,unit->bl.y,5); + clif_changemapcell(0,unit->bl.m,unit->bl.x,unit->bl.y,5,AREA); + break; case SA_LANDPROTECTOR: skill_unitsetmapcell(unit,SA_LANDPROTECTOR,group->skill_lv,CELL_LANDPROTECTOR,true); break; case HP_BASILICA: skill_unitsetmapcell(unit,HP_BASILICA,group->skill_lv,CELL_BASILICA,true); break; - case WZ_ICEWALL: - skill_unitsetmapcell(unit,WZ_ICEWALL,group->skill_lv,CELL_ICEWALL,true); - break; default: if (group->state.song_dance&0x1) //Check for dissonance. skill_dance_overlap(unit, 1); break; } + clif_skill_setunit(unit); + return unit; } @@ -9280,9 +9249,6 @@ int skill_delunit (struct skill_unit* unit) return 0; nullpo_retr(0, group=unit->group); - // invoke ondelete event - skill_unit_ondelete(unit, gettick()); - if( group->state.song_dance&0x1 ) //Cancel dissonance effect. skill_dance_overlap(unit, 0); @@ -9290,16 +9256,25 @@ int skill_delunit (struct skill_unit* unit) if( !unit->range ) map_foreachincell(skill_unit_effect,unit->bl.m,unit->bl.x,unit->bl.y,group->bl_flag,&unit->bl,gettick(),4); + // perform ondelete actions switch (group->skill_id) { + case HT_ANKLESNARE: + { + struct block_list* target = map_id2bl(group->val2); + if( target ) + status_change_end(target,SC_ANKLE,-1); + } + break; + case WZ_ICEWALL: + map_setgatcell(unit->bl.m,unit->bl.x,unit->bl.y,unit->val2); + clif_changemapcell(0,unit->bl.m,unit->bl.x,unit->bl.y,unit->val2,ALL_SAMEMAP); // hack to avoid clientside cell bug + break; case SA_LANDPROTECTOR: skill_unitsetmapcell(unit,SA_LANDPROTECTOR,group->skill_lv,CELL_LANDPROTECTOR,false); break; case HP_BASILICA: skill_unitsetmapcell(unit,HP_BASILICA,group->skill_lv,CELL_BASILICA,false); break; - case WZ_ICEWALL: - skill_unitsetmapcell(unit,WZ_ICEWALL,group->skill_lv,CELL_ICEWALL,false); - break; } clif_skill_delunit(unit); |