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 ControlableMonsterFighter(FightTeam team, MonsterRecord template, sbyte gradeId, CharacterFighter owner, short summonCellId) : base(team, 0) { this.Template = template; this.GradeId = gradeId; this.Owner = owner; this.Owner.OnLeavePreFightEvt += Owner_OnLeavePreFight; this.Owner.OnTurnEndEvt += Owner_TurnEnd; this.OnTurnEndEvt += ControlableMonsterFighter_TurnEnd; this.AfterDeadEvt += ControlableMonsterFighter_OnDead; this.SummonCellId = summonCellId; this.Spells = Array.ConvertAll(template.SpellRecords.ToArray(), x => new CharacterSpell(x.Id, x.GetLastLevelGrade())); this.Shortcuts = new ShortcutSpell[Spells.Length]; for (int i = 0; i < Spells.Length; i++) { Shortcuts[i] = new ShortcutSpell((sbyte)i, Spells[i].SpellId); } this.IsReady = true; }
public void Add(ShortcutSpell shortcut) { Add(new SpellShortcut(Character, shortcut)); }
public SpellShortcut(PlayedCharacter character, ShortcutSpell shortcut) : base(character, shortcut.slot) { Character = character; SpellId = shortcut.spellId; }