Jump to content
  • 0

Use atcommand in Skill SRC


Question

Posted

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

  • 0
Posted

*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.

  • 0
Posted
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.

  • 0
Posted
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"

 

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...