Jump to content
  • 0

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


Question

Posted (edited)

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

1 answer to this question

Recommended Posts

  • 0
Posted

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...