示例#1
0
 public static void SendSlaveSwitchContextMessage(IPacketReceiver client, FightActor source, FightActor target)
 {
     if (target is SummonedMonster)
     {
         var             spells    = (target as SummonedMonster).Monster.Spells.Select(x => x.GetSpellItem());
         List <Shortcut> shortcuts = new List <Shortcut>();
         for (sbyte i = 0; i < spells.Count(); i++)
         {
             shortcuts.Add(new ShortcutSpell(i, (ushort)spells.ElementAt(i).spellId));
         }
         target.Stats.Initialize((target as SummonedMonster).Monster);
         client.Send(new SlaveSwitchContextMessage(source.Id, target.Id, spells, target.GetSlaveStats(source), shortcuts));
     }
 }