diff options
Diffstat (limited to 'src/actions')
-rw-r--r-- | src/actions/commands.cpp | 39 | ||||
-rw-r--r-- | src/actions/commands.h | 1 |
2 files changed, 40 insertions, 0 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 5dcbc3d93..cea0bdc67 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -1076,4 +1076,43 @@ impHandler(selectSkillLevel) return false; } +impHandler(skill) +{ + if (!skillDialog) + return false; + + StringVect vect; + splitToStringVector(vect, event.args, ' '); + const int sz = static_cast<int>(vect.size()); + if (sz < 1) + return true; + const int skillId = atoi(vect[0].c_str()); + int level = 0; + std::string text; + if (sz > 1) + { + level = atoi(vect[1].c_str()); + if (sz > 2) + text = vect[2]; + } + if (text.empty()) + { + skillDialog->useSkill(skillId, + AutoTarget_true, + level, + false, + ""); + } + else + { + logger->log("text: " + text); + skillDialog->useSkill(skillId, + AutoTarget_true, + level, + true, + text); + } + return true; +} + } // namespace Actions diff --git a/src/actions/commands.h b/src/actions/commands.h index 0e71f409c..67b53be0c 100644 --- a/src/actions/commands.h +++ b/src/actions/commands.h @@ -91,6 +91,7 @@ namespace Actions decHandler(serverConfGet); decHandler(slide); decHandler(selectSkillLevel); + decHandler(skill); } // namespace Actions #undef decHandler |