private int Process(MacroObject macro) { int result = 0; switch (macro.Code) { case MacroType.Say: case MacroType.Emote: case MacroType.Whisper: case MacroType.Yell: MacroObjectString mos = (MacroObjectString)macro; if (!string.IsNullOrEmpty(mos.Text)) { MessageType type = MessageType.Regular; ushort hue = Engine.Profile.Current.SpeechHue; switch (macro.Code) { case MacroType.Emote: type = MessageType.Emote; hue = Engine.Profile.Current.EmoteHue; break; case MacroType.Whisper: type = MessageType.Whisper; hue = Engine.Profile.Current.WhisperHue; break; case MacroType.Yell: type = MessageType.Yell; break; } Chat.Say(mos.Text, hue, type); } break; case MacroType.Walk: byte dt = (byte)Direction.Up; if (macro.SubCode != MacroSubType.NW) { dt = (byte)(macro.SubCode - 2); if (dt > 7) { dt = 0; } } if (!Pathfinder.AutoWalking) { World.Player.Walk((Direction)dt, false); } break; case MacroType.WarPeace: GameActions.ToggleWarMode(); break; case MacroType.Paste: if (SDL.SDL_HasClipboardText() != SDL.SDL_bool.SDL_FALSE) { string s = SDL.SDL_GetClipboardText(); if (!string.IsNullOrEmpty(s)) { WorldViewportGump viewport = Engine.UI.GetByLocalSerial <WorldViewportGump>(); if (viewport != null) { SystemChatControl chat = viewport.FindControls <SystemChatControl>().SingleOrDefault(); if (chat != null) { chat.textBox.Text += s; } } } } break; case MacroType.Open: case MacroType.Close: case MacroType.Minimize: case MacroType.Maximize: switch (macro.Code) { case MacroType.Open: switch (macro.SubCode) { case MacroSubType.Configuration: OptionsGump opt = Engine.UI.GetByLocalSerial <OptionsGump>(); if (opt == null) { Engine.UI.Add(opt = new OptionsGump()); opt.SetInScreen(); } else { opt.SetInScreen(); opt.BringOnTop(); } break; case MacroSubType.Paperdoll: GameActions.OpenPaperdoll(World.Player); break; case MacroSubType.Status: if (StatusGumpBase.GetStatusGump() == null) { StatusGumpBase.AddStatusGump(100, 100); } break; case MacroSubType.Journal: JournalGump journalGump = Engine.UI.GetByLocalSerial <JournalGump>(); if (journalGump == null) { Engine.UI.Add(new JournalGump() { X = 64, Y = 64 }); } else { journalGump.SetInScreen(); journalGump.BringOnTop(); } break; case MacroSubType.Skills: World.SkillsRequested = true; NetClient.Socket.Send(new PSkillsRequest(World.Player)); break; case MacroSubType.MageSpellbook: case MacroSubType.NecroSpellbook: case MacroSubType.PaladinSpellbook: case MacroSubType.BushidoSpellbook: case MacroSubType.NinjitsuSpellbook: case MacroSubType.SpellWeavingSpellbook: case MacroSubType.MysticismSpellbook: SpellBookType type = SpellBookType.Magery; switch (macro.SubCode) { case MacroSubType.NecroSpellbook: type = SpellBookType.Necromancy; break; case MacroSubType.PaladinSpellbook: type = SpellBookType.Chivalry; break; case MacroSubType.BushidoSpellbook: type = SpellBookType.Bushido; break; case MacroSubType.NinjitsuSpellbook: type = SpellBookType.Ninjitsu; break; case MacroSubType.SpellWeavingSpellbook: type = SpellBookType.Spellweaving; break; case MacroSubType.MysticismSpellbook: type = SpellBookType.Mysticism; break; } NetClient.Socket.Send(new POpenSpellBook((byte)type)); break; case MacroSubType.Chat: Log.Message(LogTypes.Warning, $"Macro '{macro.SubCode}' not implemented"); break; case MacroSubType.Backpack: Item backpack = World.Player.Equipment[(int)Layer.Backpack]; if (backpack != null) { GameActions.DoubleClick(backpack); } break; case MacroSubType.Owerview: MiniMapGump miniMapGump = Engine.UI.GetByLocalSerial <MiniMapGump>(); if (miniMapGump == null) { Engine.UI.Add(new MiniMapGump()); } else { miniMapGump.SetInScreen(); miniMapGump.BringOnTop(); } break; case MacroSubType.WorldMap: Log.Message(LogTypes.Warning, $"Macro '{macro.SubCode}' not implemented"); break; case MacroSubType.Mail: case MacroSubType.PartyManifest: var party = Engine.UI.GetByLocalSerial <PartyGumpAdvanced>(); if (party == null) { Engine.UI.Add(new PartyGumpAdvanced()); } else { party.BringOnTop(); } break; case MacroSubType.Guild: GameActions.OpenGuildGump(); break; case MacroSubType.QuestLog: GameActions.RequestQuestMenu(); break; case MacroSubType.PartyChat: case MacroSubType.CombatBook: case MacroSubType.RacialAbilitiesBook: case MacroSubType.BardSpellbook: Log.Message(LogTypes.Warning, $"Macro '{macro.SubCode}' not implemented"); break; } break; case MacroType.Close: case MacroType.Minimize: // TODO: miniminze/maximize case MacroType.Maximize: switch (macro.SubCode) { case MacroSubType.Configuration: if (macro.Code == MacroType.Close) { Engine.UI.GetByLocalSerial <OptionsGump>()?.Dispose(); } break; case MacroSubType.Paperdoll: if (macro.Code == MacroType.Close) { Engine.UI.GetByLocalSerial <PaperDollGump>()?.Dispose(); } break; case MacroSubType.Status: if (macro.Code == MacroType.Close) { StatusGumpBase.GetStatusGump()?.Dispose(); } break; case MacroSubType.Journal: if (macro.Code == MacroType.Close) { Engine.UI.GetByLocalSerial <JournalGump>()?.Dispose(); } break; case MacroSubType.Skills: if (macro.Code == MacroType.Close) { Engine.UI.GetByLocalSerial <SkillGumpAdvanced>()?.Dispose(); } break; case MacroSubType.MageSpellbook: case MacroSubType.NecroSpellbook: case MacroSubType.PaladinSpellbook: case MacroSubType.BushidoSpellbook: case MacroSubType.NinjitsuSpellbook: case MacroSubType.SpellWeavingSpellbook: case MacroSubType.MysticismSpellbook: if (macro.Code == MacroType.Close) { Engine.UI.GetByLocalSerial <SpellbookGump>()?.Dispose(); } break; case MacroSubType.Chat: Log.Message(LogTypes.Warning, $"Macro '{macro.SubCode}' not implemented"); break; case MacroSubType.Owerview: if (macro.Code == MacroType.Close) { Engine.UI.GetByLocalSerial <MiniMapGump>()?.Dispose(); } break; case MacroSubType.Mail: Log.Message(LogTypes.Warning, $"Macro '{macro.SubCode}' not implemented"); break; case MacroSubType.PartyManifest: if (macro.Code == MacroType.Close) { Engine.UI.GetByLocalSerial <PartyGumpAdvanced>()?.Dispose(); } break; case MacroSubType.PartyChat: case MacroSubType.CombatBook: case MacroSubType.RacialAbilitiesBook: case MacroSubType.BardSpellbook: Log.Message(LogTypes.Warning, $"Macro '{macro.SubCode}' not implemented"); break; } break; } break; case MacroType.OpenDoor: GameActions.OpenDoor(); break; case MacroType.UseSkill: int skill = macro.SubCode - MacroSubType.Anatomy; if (skill >= 0 && skill < 24) { skill = _skillTable[skill]; if (skill != 0xFF) { GameActions.UseSkill(skill); } } break; case MacroType.LastSkill: GameActions.UseSkill(GameActions.LastSkillIndex); break; case MacroType.CastSpell: int spell = macro.SubCode - MacroSubType.Clumsy + 1; if (spell > 0 && spell <= 151) { int totalCount = 0; int spellType = 0; for (spellType = 0; spellType < 7; spellType++) { totalCount += _spellsCountTable[spellType]; if (spell < totalCount) { break; } } if (spellType < 7) { spell += spellType * 100; if (spellType > 2) { spell += 100; } GameActions.CastSpell(spell); } } break; case MacroType.LastSpell: GameActions.CastSpell(GameActions.LastSpellIndex); break; case MacroType.Bow: case MacroType.Salute: int index = macro.Code - MacroType.Bow; const string BOW = "bow"; const string SALUTE = "salute"; GameActions.EmoteAction(index == 0 ? BOW : SALUTE); break; case MacroType.QuitGame: Engine.SceneManager.GetScene <GameScene>()?.RequestQuitGame(); break; case MacroType.AllNames: GameActions.AllNames(); break; case MacroType.LastTarget: if (WaitForTargetTimer == 0) { WaitForTargetTimer = Engine.Ticks + Constants.WAIT_FOR_TARGET_DELAY; } if (TargetManager.IsTargeting) { //if (TargetManager.TargetingState != TargetType.Object) //{ // TargetManager.TargetGameObject(TargetManager.LastGameObject); //} //else TargetManager.TargetGameObject(World.Get(TargetManager.LastGameObject)); WaitForTargetTimer = 0; } else if (WaitForTargetTimer < Engine.Ticks) { WaitForTargetTimer = 0; } else { result = 1; } break; case MacroType.TargetSelf: if (WaitForTargetTimer == 0) { WaitForTargetTimer = Engine.Ticks + Constants.WAIT_FOR_TARGET_DELAY; } if (TargetManager.IsTargeting) { TargetManager.TargetGameObject(World.Player); WaitForTargetTimer = 0; } else if (WaitForTargetTimer < Engine.Ticks) { WaitForTargetTimer = 0; } else { result = 1; } break; case MacroType.ArmDisarm: int handIndex = 1 - (macro.SubCode - MacroSubType.LeftHand); GameScene gs = Engine.SceneManager.GetScene <GameScene>(); if (handIndex < 0 || handIndex > 1 || gs.IsHoldingItem) { break; } if (_itemsInHand[handIndex] != 0) { Item item = World.Items.Get(_itemsInHand[handIndex]); if (item != null) { GameActions.PickUp(item, 1); gs.WearHeldItem(World.Player); } _itemsInHand[handIndex] = 0; } else { Item backpack = World.Player.Equipment[(int)Layer.Backpack]; if (backpack == null) { break; } Item item = World.Player.Equipment[(int)Layer.OneHanded + handIndex]; if (item != null) { _itemsInHand[handIndex] = item.Serial; GameActions.PickUp(item, 1); GameActions.DropItem(item, Position.INVALID, backpack); } } break; case MacroType.WaitForTarget: if (WaitForTargetTimer == 0) { WaitForTargetTimer = Engine.Ticks + Constants.WAIT_FOR_TARGET_DELAY; } if (TargetManager.IsTargeting || WaitForTargetTimer < Engine.Ticks) { WaitForTargetTimer = 0; } else { result = 1; } break; case MacroType.TargetNext: if (TargetManager.LastGameObject.IsMobile) { Mobile mob = World.Mobiles.Get(TargetManager.LastGameObject); if (mob.HitsMax == 0) { NetClient.Socket.Send(new PStatusRequest(mob)); } World.LastAttack = mob.Serial; } break; case MacroType.AttackLast: GameActions.Attack(World.LastAttack); break; case MacroType.Delay: MacroObjectString mosss = (MacroObjectString)macro; string str = mosss.Text; if (!string.IsNullOrEmpty(str) && int.TryParse(str, out int rr)) { _nextTimer = Engine.Ticks + rr; } break; case MacroType.CircleTrans: Engine.Profile.Current.UseCircleOfTransparency = !Engine.Profile.Current.UseCircleOfTransparency; break; case MacroType.CloseGump: Engine.UI.Gumps .Where(s => !(s is TopBarGump) && !(s is BuffGump) && !(s is WorldViewportGump)) .ToList() .ForEach(s => s.Dispose()); break; case MacroType.AlwaysRun: Engine.Profile.Current.AlwaysRun = !Engine.Profile.Current.AlwaysRun; break; case MacroType.SaveDesktop: Engine.Profile.Current?.Save(Engine.UI.Gumps.OfType <Gump>().Where(s => s.CanBeSaved).Reverse().ToList()); break; case MacroType.EnableRangeColor: Engine.Profile.Current.NoColorObjectsOutOfRange = true; break; case MacroType.DisableRangeColor: Engine.Profile.Current.NoColorObjectsOutOfRange = false; break; case MacroType.ToggleRangeColor: Engine.Profile.Current.NoColorObjectsOutOfRange = !Engine.Profile.Current.NoColorObjectsOutOfRange; break; case MacroType.AttackSelectedTarget: // TODO: break; case MacroType.UseSelectedTarget: // TODO: break; case MacroType.CurrentTarget: // TODO: break; case MacroType.TargetSystemOnOff: // TODO: break; case MacroType.BandageSelf: case MacroType.BandageTarget: if (FileManager.ClientVersion < ClientVersions.CV_5020 || Engine.Profile.Current.BandageSelfOld) { if (WaitingBandageTarget) { if (WaitForTargetTimer == 0) { WaitForTargetTimer = Engine.Ticks + Constants.WAIT_FOR_TARGET_DELAY; } if (TargetManager.IsTargeting) { TargetManager.TargetGameObject(macro.Code == MacroType.BandageSelf ? World.Player : World.Mobiles.Get(TargetManager.LastGameObject)); } else { result = 1; } WaitingBandageTarget = false; WaitForTargetTimer = 0; } else { var bandage = World.Player.FindBandage(); if (bandage != null) { WaitingBandageTarget = true; GameActions.DoubleClick(bandage); result = 1; } } } else { var bandage = World.Player.FindBandage(); if (bandage != null) { if (macro.Code == MacroType.BandageSelf) { NetClient.Socket.Send(new PTargetSelectedObject(bandage.Serial, World.Player.Serial)); } else { // TODO: NewTargetSystem Log.Message(LogTypes.Warning, $"BandageTarget (NewTargetSystem) not implemented yet."); } } } break; case MacroType.SetUpdateRange: case MacroType.ModifyUpdateRange: if (macro is MacroObjectString moss && !string.IsNullOrEmpty(moss.Text) && byte.TryParse(moss.Text, out byte res)) { if (res < Constants.MIN_VIEW_RANGE) { res = Constants.MIN_VIEW_RANGE; } else if (res > Constants.MAX_VIEW_RANGE) { res = Constants.MAX_VIEW_RANGE; } World.ViewRange = res; } break; case MacroType.IncreaseUpdateRange: World.ViewRange++; if (World.ViewRange > Constants.MAX_VIEW_RANGE) { World.ViewRange = Constants.MAX_VIEW_RANGE; } break; case MacroType.DecreaseUpdateRange: World.ViewRange--; if (World.ViewRange < Constants.MIN_VIEW_RANGE) { World.ViewRange = Constants.MIN_VIEW_RANGE; } break; case MacroType.MaxUpdateRange: World.ViewRange = Constants.MAX_VIEW_RANGE; break; case MacroType.MinUpdateRange: World.ViewRange = Constants.MIN_VIEW_RANGE; break; case MacroType.DefaultUpdateRange: World.ViewRange = Constants.MAX_VIEW_RANGE; break; case MacroType.SelectNext: case MacroType.SelectPrevious: case MacroType.SelectNearest: // TODO: int scantype = macro.SubCode - MacroSubType.Hostile; int scanRange = macro.Code - MacroType.SelectNext; switch (scanRange) { case 0: break; case 1: break; case 2: break; } break; case MacroType.ToggleBuiconWindow: BuffGump buff = Engine.UI.GetByLocalSerial <BuffGump>(); if (buff != null) { buff.Dispose(); } else { Engine.UI.Add(new BuffGump(100, 100)); } break; case MacroType.InvokeVirtue: byte id = (byte)(macro.SubCode - MacroSubType.Honor + 31); NetClient.Socket.Send(new PInvokeVirtueRequest(id)); break; case MacroType.PrimaryAbility: GameActions.UsePrimaryAbility(); break; case MacroType.SecondaryAbility: GameActions.UseSecondaryAbility(); break; case MacroType.ToggleGargoyleFly: if (World.Player.Race == RaceType.GARGOYLE) { NetClient.Socket.Send(new PToggleGargoyleFlying()); } break; case MacroType.EquipLastWeapon: NetClient.Socket.Send(new PEquipLastWeapon()); break; case MacroType.KillGumpOpen: // TODO: break; case MacroType.DefaultScale: Engine.SceneManager.GetScene <GameScene>().Scale = 1; break; } return(result); }
private int Process(MacroObject macro) { int result = 0; switch (macro.Code) { case MacroType.Say: case MacroType.Emote: case MacroType.Whisper: case MacroType.Yell: MacroObjectString mos = (MacroObjectString)macro; if (!string.IsNullOrEmpty(mos.Text)) { MessageType type = MessageType.Regular; switch (macro.Code) { case MacroType.Emote: type = MessageType.Emote; break; case MacroType.Whisper: type = MessageType.Whisper; break; case MacroType.Yell: type = MessageType.Yell; break; } Chat.Say(mos.Text, type: type); } break; case MacroType.Walk: byte dt = (byte)Direction.Up; if (macro.SubCode != MacroSubType.NW) { dt = (byte)(macro.SubCode - 2); if (dt > 7) { dt = 0; } } if (!Pathfinder.AutoWalking) { World.Player.Walk((Direction)dt, false); } break; case MacroType.WarPeace: GameActions.ToggleWarMode(); break; case MacroType.Paste: // TODO: break; case MacroType.Open: case MacroType.Close: case MacroType.Minimize: case MacroType.Maximize: // TODO: break; case MacroType.OpenDoor: GameActions.OpenDoor(); break; case MacroType.UseSkill: int skill = macro.SubCode - MacroSubType.Anatomy; if (skill >= 0 && skill < 24) { skill = _skillTable[skill]; if (skill != 0xFF) { GameActions.UseSkill(skill); } } break; case MacroType.LastSkill: GameActions.UseSkill(GameActions.LastSkillIndex); break; case MacroType.CastSpell: int spell = macro.SubCode - MacroSubType.Clumsy + 1; if (spell > 0 && spell <= 151) { int totalCount = 0; int spellType = 0; for (spellType = 0; spellType < 7; spellType++) { totalCount += _spellsCountTable[spellType]; if (spell < totalCount) { break; } } if (spellType < 7) { spell += spellType * 100; if (spellType > 2) { spell += 100; } GameActions.CastSpell(spell); } } break; case MacroType.LastSpell: GameActions.CastSpell(GameActions.LastSpellIndex); break; case MacroType.Bow: case MacroType.Salute: int index = macro.Code - MacroType.Bow; const string BOW = "bow"; const string SALUTE = "salute"; GameActions.EmoteAction(index == 0 ? BOW : SALUTE); break; case MacroType.QuitGame: Engine.SceneManager.GetScene <GameScene>()?.RequestQuitGame(); break; case MacroType.AllNames: GameActions.AllNames(); break; case MacroType.LastTarget: if (WaitForTargetTimer == 0) { WaitForTargetTimer = Engine.Ticks + Constants.WAIT_FOR_TARGET_DELAY; } if (TargetManager.IsTargeting) { //if (TargetManager.TargetingState != TargetType.Object) //{ // TargetManager.TargetGameObject(TargetManager.LastGameObject); //} //else TargetManager.TargetGameObject(TargetManager.LastGameObject); WaitForTargetTimer = 0; } else if (WaitForTargetTimer < Engine.Ticks) { WaitForTargetTimer = 0; } else { result = 1; } break; case MacroType.TargetSelf: if (WaitForTargetTimer == 0) { WaitForTargetTimer = Engine.Ticks + Constants.WAIT_FOR_TARGET_DELAY; } if (TargetManager.IsTargeting) { TargetManager.TargetGameObject(World.Player); WaitForTargetTimer = 0; } else if (WaitForTargetTimer < Engine.Ticks) { WaitForTargetTimer = 0; } else { result = 1; } break; case MacroType.ArmDisarm: int handIndex = 1 - (macro.SubCode - MacroSubType.LeftHand); GameScene gs = Engine.SceneManager.GetScene <GameScene>(); if (handIndex < 0 || handIndex > 1 || gs.IsHoldingItem) { break; } if (_itemsInHand[handIndex] != 0) { Item item = World.Items.Get(_itemsInHand[handIndex]); if (item != null) { GameActions.PickUp(item, 1); gs.WearHeldItem(World.Player); } _itemsInHand[handIndex] = 0; } else { Item backpack = World.Player.Equipment[(int)Layer.Backpack]; if (backpack == null) { break; } Item item = World.Player.Equipment[(int)Layer.OneHanded + handIndex]; if (item != null) { _itemsInHand[handIndex] = item.Serial; GameActions.PickUp(item, 1); GameActions.DropItem(item, Position.INVALID, backpack); } } break; case MacroType.WaitForTarget: if (WaitForTargetTimer == 0) { WaitForTargetTimer = Engine.Ticks + Constants.WAIT_FOR_TARGET_DELAY; } if (TargetManager.IsTargeting || WaitForTargetTimer < Engine.Ticks) { WaitForTargetTimer = 0; } else { result = 1; } break; case MacroType.TargetNext: if (TargetManager.LastGameObject is Mobile mob) { if (mob.HitsMax == 0) { NetClient.Socket.Send(new PStatusRequest(mob)); } TargetManager.LastGameObject = mob; World.LastAttack = mob.Serial; } break; case MacroType.AttackLast: GameActions.Attack(World.LastAttack); break; case MacroType.Delay: MacroObjectString mosss = (MacroObjectString)macro; string str = mosss.Text; if (!string.IsNullOrEmpty(str) && int.TryParse(str, out int rr)) { _nextTimer = Engine.Ticks + rr; } break; case MacroType.CircleTrans: Engine.Profile.Current.UseCircleOfTransparency = !Engine.Profile.Current.UseCircleOfTransparency; break; case MacroType.CloseGump: Engine.UI.Gumps .Where(s => !(s is TopBarGump) && !(s is BuffGump) && !(s is WorldViewportGump)) .ToList() .ForEach(s => s.Dispose()); break; case MacroType.AlwaysRun: Engine.Profile.Current.AlwaysRun = !Engine.Profile.Current.AlwaysRun; break; case MacroType.SaveDesktop: Engine.Profile.Current?.Save(Engine.UI.Gumps.OfType <Gump>().Where(s => s.CanBeSaved).Reverse().ToList()); break; case MacroType.EnableRangeColor: Engine.Profile.Current.NoColorObjectsOutOfRange = true; break; case MacroType.DisableRangeColor: Engine.Profile.Current.NoColorObjectsOutOfRange = false; break; case MacroType.ToggleRangeColor: Engine.Profile.Current.NoColorObjectsOutOfRange = !Engine.Profile.Current.NoColorObjectsOutOfRange; break; case MacroType.AttackSelectedTarget: // TODO: break; case MacroType.UseSelectedTarget: // TODO: break; case MacroType.CurrentTarget: // TODO: break; case MacroType.TargetSystemOnOff: // TODO: break; case MacroType.BandageSelf: case MacroType.BandageTarget: // TODO: if (FileManager.ClientVersion < ClientVersions.CV_5020) { } break; case MacroType.SetUpdateRange: case MacroType.ModifyUpdateRange: if (macro is MacroObjectString moss && !string.IsNullOrEmpty(moss.Text) && byte.TryParse(moss.Text, out byte res)) { if (res < Constants.MIN_VIEW_RANGE) { res = Constants.MIN_VIEW_RANGE; } else if (res > Constants.MAX_VIEW_RANGE) { res = Constants.MAX_VIEW_RANGE; } World.ViewRange = res; } break; case MacroType.IncreaseUpdateRange: World.ViewRange++; if (World.ViewRange > Constants.MAX_VIEW_RANGE) { World.ViewRange = Constants.MAX_VIEW_RANGE; } break; case MacroType.DecreaseUpdateRange: World.ViewRange--; if (World.ViewRange < Constants.MIN_VIEW_RANGE) { World.ViewRange = Constants.MIN_VIEW_RANGE; } break; case MacroType.MaxUpdateRange: World.ViewRange = Constants.MAX_VIEW_RANGE; break; case MacroType.MinUpdateRange: World.ViewRange = Constants.MIN_VIEW_RANGE; break; case MacroType.DefaultUpdateRange: World.ViewRange = Constants.MAX_VIEW_RANGE; break; case MacroType.SelectNext: case MacroType.SelectPrevious: case MacroType.SelectNearest: // TODO: int scantype = macro.SubCode - MacroSubType.Hostile; int scanRange = macro.Code - MacroType.SelectNext; switch (scanRange) { case 0: break; case 1: break; case 2: break; } break; case MacroType.ToggleBuiconWindow: // TODO: break; case MacroType.InvokeVirtue: byte id = (byte)(macro.SubCode - MacroSubType.Honor + 31); NetClient.Socket.Send(new PInvokeVirtueRequest(id)); break; case MacroType.PrimaryAbility: GameActions.UsePrimaryAbility(); break; case MacroType.SecondaryAbility: GameActions.UseSecondaryAbility(); break; case MacroType.ToggleGargoyleFly: if (World.Player.Race == RaceType.GARGOYLE) { NetClient.Socket.Send(new PToggleGargoyleFlying()); } break; case MacroType.EquipLastWeapon: NetClient.Socket.Send(new PEquipLastWeapon()); break; case MacroType.KillGumpOpen: break; } return(result); }