• 0
Sign in to follow this  
Followers 0
Crown The Empire

[Ranger]: Electric Shock

Question

1 answer to this question

  • 0

Posted (edited)

I think its official, otherwise there are 2 places to check it doesn't trigger on boss

Spoiler

patch

 src/map/skill.c  | 2 --
 src/map/status.c | 1 -
 2 files changed, 3 deletions(-)

diff --git a/src/map/skill.c b/src/map/skill.c
index 633a73d67..cf0aa23df 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -12934,8 +12934,6 @@ static int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *b
 
 		case UNT_ELECTRICSHOCKER:
 			if( bl->id != ss->id ) {
-				if( status_get_mode(bl)&MD_BOSS )
-					break;
 				if( status->change_start(ss,bl,type,10000,sg->skill_lv,sg->group_id,0,0,skill->get_time2(sg->skill_id, sg->skill_lv), SCFLAG_FIXEDRATE) ) {
 					map->moveblock(bl, src->bl.x, src->bl.y, tick);
 					clif->fixpos(bl);
diff --git a/src/map/status.c b/src/map/status.c
index f06bb0330..630c72b6a 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -10574,7 +10574,6 @@ static bool status_is_boss_resist_sc(enum sc_type type)
 
 		// Ranger Effects
 		case SC_WUGBITE:
-		case SC_ELECTRICSHOCKER:
 		case SC_MAGNETICFIELD:
 
 		// Masquerades
Spoiler

plugin

#include "common/hercules.h"
#include "map/mob.h"
#include "map/clif.h"
#include "map/skill.h"
#include "map/status.h"
#include "plugins/HPMHooking.h"
#include "common/HPMDataCheck.h"

HPExport struct hplugin_info pinfo = {
	"ELECTRICSHOCKER",
	SERVER_TYPE_MAP,
	"x.x",
	HPM_VERSION,
};

int skill_unit_onplace_timer_pre( struct skill_unit **src, struct block_list **bl, int64 *tick ) {
	if ( *src == NULL || *bl == NULL )
		return 0;
	struct skill_unit_group *sg = (*src)->group;
	struct block_list *ss = map->id2bl(sg->src_id);
	if ( sg == NULL || ss == NULL )
		return 0;
	enum sc_type type = status->skill2sc(sg->skill_id);
	uint16 skill_id = sg->skill_id;
	if ( sg->unit_id == UNT_ELECTRICSHOCKER && (status_get_mode(*bl) & MD_BOSS) ) {
		if ( (*bl)->id != ss->id ) {
			if ( status->change_start( ss, *bl, type, 10000, sg->skill_lv, sg->group_id, 0, 0, skill->get_time2( sg->skill_id, sg->skill_lv), SCFLAG_FIXEDRATE ) ) {
				map->moveblock( *bl, (*src)->bl.x, (*src)->bl.y, *tick );
				clif->fixpos(*bl);
			}
			skill->trap_do_splash( &(*src)->bl, sg->skill_id, sg->skill_lv, sg->bl_flag, *tick );
			sg->unit_id = UNT_USED_TRAPS; //Changed ID so it does not invoke a for each in area again.
		}
		if ( (*bl)->type == BL_MOB && ss != *bl )
			mob->skill_event(BL_UCAST(BL_MOB, *bl), ss, *tick, MSC_SKILLUSED|(skill_id<<16));
		hookStop();
	}
	return skill_id;
}
			
bool status_is_boss_resist_sc_post( bool retVal, enum sc_type type ) {
	if ( retVal == true && type == SC_ELECTRICSHOCKER )
		retVal = false;
	return retVal;
}

HPExport void plugin_init (void) {
	addHookPre( skill, unit_onplace_timer, skill_unit_onplace_timer_pre );
	addHookPost( status, is_boss_resist_sc, status_is_boss_resist_sc_post );
}

 

Edited by AnnieRuru

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0