public static void HandleShortcutBarAdd(ShortcutBarAddRequestMessage message, WorldClient client) { switch ((ShortcutBarEnum)message.barType) { case ShortcutBarEnum.GENERAL_SHORTCUT_BAR: if (message.shortcut is ShortcutObjectItem) { ShortcutObjectItem shortcutObj = (ShortcutObjectItem)message.shortcut; GeneralShortcutRecord.AddShortcut(client.Character.Id, shortcutObj.slot, ShortcutObjectItem.Id, shortcutObj.itemUID, shortcutObj.itemGID); } if (message.shortcut is ShortcutSmiley) { ShortcutSmiley shortcutSmiley = (ShortcutSmiley)message.shortcut; GeneralShortcutRecord.AddShortcut(client.Character.Id, shortcutSmiley.slot, ShortcutSmiley.Id, shortcutSmiley.smileyId, 0); } if (message.shortcut is ShortcutEmote) { ShortcutEmote shortcutEmote = (ShortcutEmote)message.shortcut; GeneralShortcutRecord.AddShortcut(client.Character.Id, shortcutEmote.slot, ShortcutEmote.Id, shortcutEmote.emoteId, 0); } break; case ShortcutBarEnum.SPELL_SHORTCUT_BAR: ShortcutSpell shortcut = (ShortcutSpell)message.shortcut; SpellShortcutRecord.AddShortcut(client.Character.Id, shortcut.slot, shortcut.spellId); break; } client.Character.RefreshShortcuts(); }
public static void HandleShortcutBarAdd(ShortcutBarAddRequestMessage message, WorldClient client) { var bar = client.Character.GetShortcutBar((ShortcutBarEnum)message.barType); CharacterShortcut shortcut = ShortcutBar.GetCharacterShortcut(client.Character, message.shortcut); if (shortcut != null) { bar.Add(shortcut); } }
public void ShortcutBarAddRequestMessageFrame(WorldClient client, ShortcutBarAddRequestMessage shortcutBarAddRequestMessage) { var shortcutsBars = client.ActiveCharacter.CharacterShortcutBars; if (shortcutsBars == null) { return; } switch ((ShortcutBarEnum)shortcutBarAddRequestMessage.barType) { case ShortcutBarEnum.GENERAL_SHORTCUT_BAR: //check si bien un object (preset, ensemble, objet) if (!(shortcutBarAddRequestMessage.shortcut is ShortcutObject)) { return; } var generalBarShortcut = shortcutsBars.Find(x => x.BarType == ShortcutBarEnum.GENERAL_SHORTCUT_BAR); CharacterShortcutRepository.Instance.AddShortcutObject(generalBarShortcut, shortcutBarAddRequestMessage.shortcut); break; case ShortcutBarEnum.SPELL_SHORTCUT_BAR: //check si bien un spell if (!(shortcutBarAddRequestMessage.shortcut is ShortcutSpell)) { return; } var spellBarShortcut = shortcutsBars.Find(x => x.BarType == ShortcutBarEnum.SPELL_SHORTCUT_BAR); CharacterShortcutRepository.Instance.AddShortcutObject(spellBarShortcut, shortcutBarAddRequestMessage.shortcut); break; default: client.SendPacket(new ShortcutBarAddErrorMessage(1)); return; } client.SendPacket(new ShortcutBarRefreshMessage(shortcutBarAddRequestMessage.barType, shortcutBarAddRequestMessage.shortcut)); }
public static void HandleShortcutBarAddRequestMessage(WorldClient client, ShortcutBarAddRequestMessage message) { client.Character.Shortcuts.AddShortcut((ShortcutBarEnum)message.barType, message.shortcut); }