Beispiel #1
0
 public void WriteLine(string msg, Logger.Type type = Logger.Type.All)
 {
     logger.WriteLine(msg, type);
 }
Beispiel #2
0
        private void OnExecuteOrder(Player sender, ExecuteOrderEventArgs args)
        {
            switch (args.OrderId)
            {
            case OrderId.Ability:
            case OrderId.AbilityLocation:
            case OrderId.AbilityTarget:
            case OrderId.AbilityTargetRune:
            case OrderId.AbilityTargetTree:
            case OrderId.ToggleAbility:
                if (!mainMenu.OnExecuteOrderMenu.Abilities.Enabled)
                {
                    return;
                }
                break;

            case OrderId.AttackLocation:
            case OrderId.AttackTarget:
            case OrderId.MoveLocation:
            case OrderId.MoveTarget:
            case OrderId.Stop:
            case OrderId.Hold:
            case OrderId.Continue:
            case OrderId.Patrol:
                if (!mainMenu.OnExecuteOrderMenu.AttackMove.Enabled)
                {
                    return;
                }
                break;

            default:
                if (!mainMenu.OnExecuteOrderMenu.Other.Enabled)
                {
                    return;
                }
                break;
            }

            const Color       Color = Color.Magenta;
            const Logger.Type Type  = Logger.Type.ExecuteOrder;

            logger.Write("Executed order", Type, Color, true);
            logger.Write("Sender name: " + args.Entities.FirstOrDefault()?.Name, Type, Color);
            logger.Write("Sender network name: " + args.Entities.FirstOrDefault()?.NetworkName, Type, Color);
            logger.Write("Sender classID: " + args.Entities.FirstOrDefault()?.ClassId, Type, Color);
            logger.Write("Order: " + args.OrderId, Type, Color);
            if (args.Ability != null)
            {
                logger.Write("Ability name: " + args.Ability?.Name, Type, Color);
                logger.Write("Ability network name: " + args.Ability?.NetworkName, Type, Color);
                logger.Write("Ability classID: " + args.Ability?.ClassId, Type, Color);
            }
            if (!args.TargetPosition.IsZero)
            {
                logger.Write("Position: " + args.TargetPosition, Type, Color);
            }
            if (args.Target != null)
            {
                logger.Write("Target name: " + args.Target.Name, Type, Color);
                logger.Write("Target network name: " + args.Target.NetworkName, Type, Color);
                logger.Write("Target classID: " + args.Target.ClassId, Type, Color);
            }
            logger.EmptyLine();
        }
Beispiel #3
0
        private void SpellsOnDump(object sender, EventArgs eventArgs)
        {
            var unit = SelectedEntity as Unit;

            if (unit == null)
            {
                return;
            }

            var menu = mainMenu.DumpMenu.Spells;

            const Color       Color = Color.Yellow;
            const Logger.Type Type  = Logger.Type.Spell;

            logger.Write("Spell dump", Type, Color, true);
            logger.Write("Unit name: " + unit.Name, Type, Color);
            logger.Write("Unit network name: " + unit.NetworkName, Type, Color);
            logger.Write("Unit classID: " + unit.ClassId, Type, Color);
            logger.EmptyLine();

            foreach (var spell in unit.Spellbook.Spells)
            {
                if (!menu.ShowHidden && spell.IsHidden)
                {
                    continue;
                }

                if (!menu.ShowTalents && spell.Name.StartsWith("special_"))
                {
                    continue;
                }

                logger.Write("Name: " + spell.Name, Type, Color);
                logger.Write("Network Name: " + unit.NetworkName, Type, Color);
                logger.Write("ClassID: " + spell.ClassId, Type, Color);

                if (menu.ShowLevels)
                {
                    logger.Write("Level: " + spell.Level, Type, Color);
                }
                if (menu.ShowManaCost)
                {
                    logger.Write("Mana cost: " + spell.ManaCost, Type, Color);
                }
                if (menu.ShowCastRange)
                {
                    logger.Write("Cast range: " + spell.GetCastRange(), Type, Color);
                }
                if (menu.ShowBehavior)
                {
                    logger.Write("Behavior: " + spell.AbilityBehavior, Type, Color);
                }
                if (menu.ShowTargetType)
                {
                    logger.Write("Target type: " + spell.TargetType, Type, Color);
                    logger.Write("Target team type: " + spell.TargetTeamType, Type, Color);
                }
                if (menu.ShowSpecialData)
                {
                    logger.Write("Special data =>", Type, Color);
                    foreach (var abilitySpecialData in spell.AbilitySpecialData)
                    {
                        logger.Write("  " + abilitySpecialData.Name + ": " + abilitySpecialData.Value, Type, Color);
                    }
                }

                logger.EmptyLine();
            }

            logger.EmptyLine();
        }
Beispiel #4
0
        private void ItemsOnDump(object sender, EventArgs e)
        {
            var unit = SelectedEntity as Unit;

            if (unit == null)
            {
                return;
            }

            var menu = mainMenu.DumpMenu.Items;

            const Color       Color = Color.Yellow;
            const Logger.Type Type  = Logger.Type.Item;

            logger.Write("Item dump", Type, Color, true);
            logger.Write("Unit name: " + unit.Name, Type, Color);
            logger.Write("Unit network name: " + unit.NetworkName, Type, Color);
            logger.Write("Unit classID: " + unit.ClassId, Type, Color);
            logger.EmptyLine();

            if (!unit.HasInventory)
            {
                return;
            }

            var items = new List <Item>();

            if (menu.ShowInventoryItems)
            {
                items.AddRange(unit.Inventory.Items);
            }
            if (menu.ShowBackpackItems)
            {
                items.AddRange(unit.Inventory.Backpack);
            }
            if (menu.ShowStashItems)
            {
                items.AddRange(unit.Inventory.Stash);
            }

            foreach (var item in items)
            {
                logger.Write("Name: " + item.Name, Type, Color);
                logger.Write("Network Name: " + item.NetworkName, Type, Color);
                logger.Write("ClassID: " + item.ClassId, Type, Color);

                if (menu.ShowManaCost)
                {
                    logger.Write("Mana cost: " + item.ManaCost, Type, Color);
                }
                if (menu.ShowCastRange)
                {
                    logger.Write("Cast range: " + item.GetCastRange(), Type, Color);
                }
                if (menu.ShowBehavior)
                {
                    logger.Write("Behavior: " + item.AbilityBehavior, Type, Color);
                }
                if (menu.ShowTargetType)
                {
                    logger.Write("Target type: " + item.TargetType, Type, Color);
                    logger.Write("Target team type: " + item.TargetTeamType, Type, Color);
                }
                if (menu.ShowSpecialData)
                {
                    logger.Write("Special data =>", Type, Color);
                    foreach (var abilitySpecialData in item.AbilitySpecialData)
                    {
                        logger.Write("  " + abilitySpecialData.Name + ": " + abilitySpecialData.Value, Type, Color);
                    }
                }

                logger.EmptyLine();
            }

            logger.EmptyLine();
        }