/
NLObP
/
AAEmu
Обзор
Документация
Войти
/
NLObP
/
AAEmu
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
AAEmu.Game/Utils/Scripts/SubCommands/World/WorldSetExprateSubCommand.cs
29 строк
1 KB
ZeromusXYZ
[Game] Rewrite SendMessage to have arguments removed (#824)
24 фев 2024, 16:37
Не верифицирован
24 фев 2024, 16:37
502f5b9
Код
Авторство
О чём код?
using System.Collections.Generic; using System.Drawing; using AAEmu.Game.Core.Managers; using AAEmu.Game.Models.Game.Char; namespace AAEmu.Game.Utils.Scripts.SubCommands.World; public class WorldSetExprateSubCommand : SubCommandBase { public WorldSetExprateSubCommand() { Title = "[World Set ExpRate]"; Description = "Setting the exp rate"; CallPrefix = $"{CommandManager.CommandPrefix}exprate"; AddParameter(new NumericSubCommandParameter<float>("ExpRate", "ExpRate", true)); } public override void Execute(ICharacter character, string triggerArgument, IDictionary<string, ParameterValue> parameters, IMessageOutput messageOutput) { float expRate = parameters["ExpRate"]; if (expRate < 1.0f || expRate > 1000.0f) { SendColorMessage(messageOutput, Color.Coral, $"Exp Rate = {expRate} must be at least 1.0 and no more than 1000.0"); return; } character.SetExpRate(expRate); SendMessage(messageOutput, $"Set ExpRate {expRate}"); Logger.Warn($"{Title}: {expRate}"); } }