OscarScorp Posted November 5, 2019 Posted November 5, 2019 Hello, How can a skill run a command? I know atcommand "@command"; and useatcmd "@command"; in an NPC script but these won't work in SRC. I would like to run a special command when using a specific skill. Thank you in advance! Quote
0 Easycore Posted November 6, 2019 Posted November 6, 2019 is_atcommand(fd, sd, "@command", 1); 1 Quote
0 LOOLP - OFF Posted November 5, 2019 Posted November 5, 2019 *unitskilluseid <GID>,<skill id>,<skill lvl>{,<target id>}; *unitskilluseid <GID>,"<skill name>",<skill lvl>{,<target id>}; *unitskillusepos <GID>,<skill id>,<skill lvl>,<x>,<y>; *unitskillusepos <GID>,"<skill name>",<skill lvl>,<x>,<y>; This is the replacement of the older commands, these use the same values for GID as the other unit* commands (See 'GID'). Skill ID is the ID of the skill, skill level is the level of the skill. For the position, the x and y are given in the unitSkillUsePos. Quote
0 OscarScorp Posted November 5, 2019 Author Posted November 5, 2019 6 minutes ago, Disabled LOOLP said: *unitskilluseid <GID>,<skill id>,<skill lvl>{,<target id>}; *unitskilluseid <GID>,"<skill name>",<skill lvl>{,<target id>}; *unitskillusepos <GID>,<skill id>,<skill lvl>,<x>,<y>; *unitskillusepos <GID>,"<skill name>",<skill lvl>,<x>,<y>; This is the replacement of the older commands, these use the same values for GID as the other unit* commands (See 'GID'). Skill ID is the ID of the skill, skill level is the level of the skill. For the position, the x and y are given in the unitSkillUsePos. So there is no way to use a command through the SRC? Like in skill.cpp, when using Bash skill for example, run a command from @command. Quote
0 Naruto Posted November 6, 2019 Posted November 6, 2019 yeah i mean you cant just do this? atcommand_whatever ( 0 , 0 , 0 , 0 ) + all your stuff in the skill stuff? not sure besides gutting it completely Quote
0 OscarScorp Posted November 6, 2019 Author Posted November 6, 2019 On 11/6/2019 at 8:17 AM, Naruto said: yeah i mean you cant just do this? atcommand_whatever ( 0 , 0 , 0 , 0 ) + all your stuff in the skill stuff? not sure besides gutting it completely Yeah I'm trying adding lines such as: In skill.cpp: atcommand "@mycommand"; useatcmd "@mycommand"; atcommand_mycommand(); But these won't work. I only get errors in console when trying to recompile. And yes, @mycommand works by itself, but I want users to get acces to it through a Skill, not by typing the command Or is there a way to make a clif_displaymessage type of clif to not display a message but to make the user type a string automatically? Therefore, auto-typing a command. On 11/6/2019 at 10:36 AM, Easycore said: is_atcommand(fd, sd, "@command", 1); It works!! Thank you so much! I just had to add at the beginning: #include "script.hpp" #include "status.hpp" #include "unit.hpp" ++ #include "atcommand.hpp" Quote
Question
OscarScorp
Hello,
How can a skill run a command?
I know atcommand "@command"; and useatcmd "@command"; in an NPC script but these won't work in SRC.
I would like to run a special command when using a specific skill.
Thank you in advance!
5 answers 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.