luizragna Posted October 11, 2018 Group: Members Topic Count: 35 Topics Per Day: 0.01 Content Count: 107 Reputation: 28 Joined: 02/12/14 Last Seen: January 9, 2023 Share Posted October 11, 2018 (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 October 11, 2018 by luizragna Quote Link to comment Share on other sites More sharing options...
0 Vykimo Posted October 21, 2018 Group: Members Topic Count: 23 Topics Per Day: 0.00 Content Count: 236 Reputation: 189 Joined: 11/27/11 Last Seen: August 4, 2024 Share Posted October 21, 2018 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. 1 Quote Link to comment Share on other sites More sharing options...
Question
luizragna
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:
script.c
and script.h
const char *useskill_event_name;
Test script:
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.