From 6a6e3bb8e69890ee69981467f1e5e3591c0f9356 Mon Sep 17 00:00:00 2001 From: Michieru Date: Sat, 18 Oct 2014 17:52:17 +0200 Subject: Fix bug:7454 * Official Icewall implementation and other fixes - Reverted all the icewall-related changes done in SVN r15777 and following as testing shows they aren't official and are actually pretty exploitable (bugreport:7412) - Instead implemented the official icewall characteristic that monsters can only leave an icewall cell to the west or south, the changes include: * The "sight" path check no longer checks for the current cell so standing on an icewall allows you to see/attack into any direction * The path finding will still ignore the current cell as before but the walk routine will not allow to walk east or north while standing on an icewall cell * This leads monsters in the situation where they go through an AI loop not allowing them to escape the icewall (if their target is north or east of them) * Monster in this situation will use idle skills and if they get attacked will use their rudeattacked skills if available, similar to traps like Spiderweb * Added a configuration icewall_walk_block that allows to configure how long a monster should go through the AI loop before the server allows it any movement, this "safety" system is official and seems to equal about 75 AI loops; if you want to disable the whole icewall system so that monsters don't get stuck in icewall at all, just set this to 0 * Here are videos from jRO showing how this system works: http://ragdo.blog56.fc2.com/blog-entry-763.html - Implemented the official calculation for "direction"; now you will be considered horizontal/vertical/diagonally aligned with a target cell in the exact same way as on official servers, this is for example used to determine whether an icewall or a firewall should be horizontal, vertical or diagonal; the only thing that is still unofficial is the default direction (officially always "west"); effectively now there are more situations considered diagonal than before - Further cleanups on the idle skill use code for immobile monsters and monsters near a player but without a target (now skill using will always go via mob_unlocktarget) * This also fixes that monsters switched to idle mode and start to use idle skills one second too late Mega thanks to Playtester (rathena 5540d89cb0e) --- src/map/skill.c | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'src/map/skill.c') diff --git a/src/map/skill.c b/src/map/skill.c index 51e266559..414ca74d3 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -10782,28 +10782,6 @@ bool skill_dance_switch(struct skill_unit* su, int flag) { return true; } -/** - * Upon Ice Wall cast it checks all nearby mobs to find any who may be blocked by the IW - **/ -int skill_icewall_block(struct block_list *bl,va_list ap) { - struct block_list *target = NULL; - struct mob_data *md = ((TBL_MOB*)bl); - - nullpo_ret(bl); - nullpo_ret(md); - if( !md->target_id || ( target = map->id2bl(md->target_id) ) == NULL ) - return 0; - - if( path->search_long(NULL,bl->m,bl->x,bl->y,target->x,target->y,CELL_CHKICEWALL) ) - return 0; - - if( !check_distance_bl(bl, target, status_get_range(bl) ) ) { - mob->unlocktarget(md,timer->gettick()); - mob_stop_walking(md,1); - } - - return 0; -} /*========================================== * Initializes and sets a ground skill. * flag&1 is used to determine when the skill 'morphs' (Warp portal becomes active, or Fire Pillar becomes active) @@ -11303,9 +11281,6 @@ struct skill_unit_group* skill_unitsetting(struct block_list *src, uint16 skill_ //success, unit created. switch( skill_id ) { - case WZ_ICEWALL: - map->foreachinrange(skill->icewall_block, src, AREA_SIZE, BL_MOB); - break; case NJ_TATAMIGAESHI: //Store number of tiles. group->val1 = group->alive_count; break; @@ -15599,7 +15574,6 @@ struct skill_unit *skill_initunit (struct skill_unit_group *group, int idx, int map->setgatcell(su->bl.m,su->bl.x,su->bl.y,5); clif->changemapcell(0,su->bl.m,su->bl.x,su->bl.y,5,AREA); skill->unitsetmapcell(su,WZ_ICEWALL,group->skill_lv,CELL_ICEWALL,true); - map->list[su->bl.m].icewall_num++; break; case SA_LANDPROTECTOR: skill->unitsetmapcell(su,SA_LANDPROTECTOR,group->skill_lv,CELL_LANDPROTECTOR,true); @@ -15651,7 +15625,6 @@ int skill_delunit (struct skill_unit* su) { map->setgatcell(su->bl.m,su->bl.x,su->bl.y,su->val2); clif->changemapcell(0,su->bl.m,su->bl.x,su->bl.y,su->val2,ALL_SAMEMAP); // hack to avoid clientside cell bug skill->unitsetmapcell(su,WZ_ICEWALL,group->skill_lv,CELL_ICEWALL,false); - map->list[su->bl.m].icewall_num--; // AS_CLOAKING in low levels requires a wall to be cast, thus it needs to be // checked again when a wall disapears! issue:8182 [Panikon] map->foreachinarea(skill->check_cloaking_end, su->bl.m, @@ -18803,7 +18776,6 @@ void skill_defaults(void) { skill->frostjoke_scream = skill_frostjoke_scream; skill->greed = skill_greed; skill->destroy_trap = skill_destroy_trap; - skill->icewall_block = skill_icewall_block; skill->unitgrouptickset_search = skill_unitgrouptickset_search; skill->dance_switch = skill_dance_switch; skill->check_condition_char_sub = skill_check_condition_char_sub; -- cgit v1.2.3-60-g2f50