From a5c0636f74a2177839aec9153b542afd8c36850a Mon Sep 17 00:00:00 2001 From: Michieru Date: Sat, 25 Oct 2014 18:14:59 +0200 Subject: Sight Blaster and other skill fixes, magic reflect, crash, trap display and monster behavior fixes - Fixed cast time of Sightrasher in pre-renewal (700ms -> 500ms) - Official Sight Blaster behavior (bugreport:6945, partially bugreport:144) * Sight Blaster's AoE is now 3x3 even in pre-renewal (it was originally larger so it hits traps before they trigger) * Sight Blaster will now prevent traps from triggering as long as they are knocked back * Fixed a bug that caused Sight Blaster to not work on traps and ice walls at all * Sight Blaster will no longer expire when the attack was reflected * Sight Blaster will now expire when hitting an ice wall * Sight Blaster will now properly protect you from being attacked from its AoE range - Sight, Ruwach and Sight Blaster will now check for a target every 20ms (previously every 250ms) - Step action will now be canceled when being knocked back (skills won't be executed anymore when knocked out of range) - When knock back magic is reflected it will no longer lead to the caster being knocked back (related to bugreport:6945) - Activated traps can no longer be hit - Fixed a problem that left "trap ghosts" forever on the screen when a trap was knocked out of the screen - Monster behavior fixes * Monsters will no longer be able to do normal attacks when hiding * If out of any reason a monster on "attack" state can't move and can't do normal attacks, it will now use "attack" state skills * The order of monster thought processing is now equal to official servers - Fixed some potential map server crashes Mega thanks to Playtester (rathena b88e95381d6a7) --- src/map/status.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) (limited to 'src/map/status.c') diff --git a/src/map/status.c b/src/map/status.c index d452d81d1..315a5e4a5 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -6015,7 +6015,9 @@ int status_get_party_id(struct block_list *bl) { return ((TBL_MER*)bl)->master->status.party_id; break; case BL_SKILL: - return ((TBL_SKILL*)bl)->group->party_id; + if (((TBL_SKILL*)bl)->group) + return ((TBL_SKILL*)bl)->group->party_id; + break; case BL_ELEM: if (((TBL_ELEM*)bl)->master) return ((TBL_ELEM*)bl)->master->status.party_id; @@ -6058,7 +6060,9 @@ int status_get_guild_id(struct block_list *bl) { return ((TBL_NPC*)bl)->u.scr.guild_id; break; case BL_SKILL: - return ((TBL_SKILL*)bl)->group->guild_id; + if (((TBL_SKILL*)bl)->group) + return ((TBL_SKILL*)bl)->group->guild_id; + break; case BL_ELEM: if (((TBL_ELEM*)bl)->master) return ((TBL_ELEM*)bl)->master->status.guild_id; @@ -7883,8 +7887,8 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t case SC_RUWACH: case SC_WZ_SIGHTBLASTER: val3 = skill->get_splash(val2, val1); //Val2 should bring the skill-id. - val2 = tick/250; - tick_time = 10; // [GodLesZ] tick time + val2 = tick/20; + tick_time = 20; // [GodLesZ] tick time break; //Permanent effects. @@ -10522,14 +10526,17 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) { case SC_SIGHT: case SC_RUWACH: case SC_WZ_SIGHTBLASTER: - if(type == SC_WZ_SIGHTBLASTER) + if(type == SC_WZ_SIGHTBLASTER) { + //Restore trap immunity + if(sce->val4%2) + sce->val4--; map->foreachinrange(status->change_timer_sub, bl, sce->val3, BL_CHAR|BL_SKILL, bl, sce, type, tick); - else + } else map->foreachinrange(status->change_timer_sub, bl, sce->val3, BL_CHAR, bl, sce, type, tick); if( --(sce->val2)>0 ){ - sce->val4 += 250; // use for Shadow Form 2 seconds checking. - sc_timer_next(250+tick, status->change_timer, bl->id, data); + sce->val4 += 20; // use for Shadow Form 2 seconds checking. + sc_timer_next(20+tick, status->change_timer, bl->id, data); return 0; } break; @@ -11324,10 +11331,13 @@ int status_change_timer_sub(struct block_list* bl, va_list ap) { if (battle->check_target( src, bl, BCT_ENEMY ) > 0 && status->check_skilluse(src, bl, WZ_SIGHTBLASTER, 2) ) { - if (sce && !(bl->type&BL_SKILL) //The hit is not counted if it's against a trap - && skill->attack(BF_MAGIC,src,src,bl,WZ_SIGHTBLASTER,1,tick,0) - ){ - sce->val2 = 0; //This signals it to end. + struct skill_unit *su = (struct skill_unit *)bl; + if (sce && skill->attack(BF_MAGIC,src,src,bl,WZ_SIGHTBLASTER,sce->val1,tick,0x4000) + && (!su || !su->group || !(skill->get_inf2(su->group->skill_id)&INF2_TRAP))) { // The hit is not counted if it's against a trap + sce->val2 = 0; // This signals it to end. + } else if((bl->type&BL_SKILL) && sce->val4%2 == 0) { + //Remove trap immunity temporarily so it triggers if you still stand on it + sce->val4++; } } break; -- cgit v1.2.3-70-g09d2