/
NLObP
/
AAEmu
Обзор
Документация
Войти
/
NLObP
/
AAEmu
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
AAEmu.Game/Scripts/SubCommands/Slaves/SlaveSpawnSubCommand.cs
36 строк
1 KB
ZeromusXYZ
[Game] GM script normalization (#1072)
11 авг 2024, 21:46
Не верифицирован
11 авг 2024, 21:46
41cf0b0
Код
Авторство
О чём код?
using System.Collections.Generic; using System.Drawing; using AAEmu.Game.Core.Managers; using AAEmu.Game.Models.Game.Char; using AAEmu.Game.Utils.Scripts; using AAEmu.Game.Utils.Scripts.SubCommands; namespace AAEmu.Game.Scripts.SubCommands.Slaves; public class SlaveSpawnSubCommand : SubCommandBase { public SlaveSpawnSubCommand() { Title = "[Slave Spawn]"; Description = "Spawn one slave in front of the player facing player (default) or a optional direction in degrees"; CallPrefix = $"{CommandManager.CommandPrefix}slave spawn"; AddParameter(new NumericSubCommandParameter<uint>("TemplateId", "Slave template Id", true)); AddParameter(new NumericSubCommandParameter<float>("yaw", "yaw=<facing degrees>", false, "yaw", 0, 360)); } public override void Execute(ICharacter character, string triggerArgument, IDictionary<string, ParameterValue> parameters, IMessageOutput messageOutput) { uint templateId = parameters["TemplateId"]; if (!SlaveManager.Instance.Exist(templateId)) { SendColorMessage(messageOutput, Color.Red, $"Slave template {templateId} doesn't exist"); return; } var owner = (Character)character; SlaveManager.Instance.Create(owner, null, templateId); } }