diff options
Diffstat (limited to 'src/actions/commands.cpp')
-rw-r--r-- | src/actions/commands.cpp | 39 |
1 files changed, 39 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 |