Jump to content
  • 0
luizragna

Where can i add trigger for my custom label? (OnUseSkillEvent)

Question

Hello guys!

I'm creating a custom label, OnUseSkillEvent

I need add this trigger: (probabily in the skill.c)

npc_script_event(sd, NPCE_USESKILL);

I added in the skill especify cases (for exmple: case: MG_FIREBOLT) but i want for all skills.

 

i already created the code for others files.

npc.hpp:

NPCE_USESKILL,

script.c

"OnUseSkillEvent";

and script.h

const char *useskill_event_name;

 

Test script:

-	script	OnUseTest	FAKE_NPC,{

OnUseSkillEvent:

mes "Do you used a skill!";
close;


}

 

Edited by luizragna
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi,

Go in npc.cpp :

after that :

	case NPCE_LOGIN:
		return script_config.login_event_name;

Add that :

	case NPCE_USESKILL:
		return script_config.useskill_event_name;

 

Go in skill.cpp :

after that :


	if( sd && sd->autobonus3[0].rate ) {
		for( i = 0; i < ARRAYLENGTH(sd->autobonus3); i++ ) {
			if( rnd()%1000 >= sd->autobonus3[i].rate )
				continue;
			if( sd->autobonus3[i].atk_type != skill_id )
				continue;
			pc_exeautobonus(sd,&sd->autobonus3[i]);
		}
	}

add :

		npc_script_event(sd, NPCE_USESKILL);

 

 

It should be enough.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.