Exemple #1
0
 public InnerMap(string Map, string Dest, Point2D ArriveLoc, List<Point2D> Locs)
 {
     this.Map = Map;
     this.Dest = Dest;
     this.Locs = Locs;
     this.ArriveLoc = ArriveLoc;
 }
Exemple #2
0
 public void CreateMagicEffect(Point2D target, string map, byte sprite, int time = 1500)
 {
     int mobile = Serial.NewMobile;
     World.SendToAll(new QueDele(map, new CreateMagicEffect(mobile, 1, (short)target.X, (short)target.Y, new byte[] { 4, 0, 0, 0, 0, 0, 0, 0, 0, sprite }, 0).Compile()));
     var tmp = new QueDele(LKCamelot.Server.tickcount.ElapsedMilliseconds + time, map, new DeleteObject(mobile).Compile());
     tmp.tempser = mobile;
     World.TickQue.Add(tmp);
 }
Exemple #3
0
 public NeoWarDummy(Serial temp, int x, int y, string map)
     : this(temp)
 {
     m_MonsterID = 14;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temp;
 }
Exemple #4
0
 public BloodShot(Serial temp, int x, int y, string map)
     : this(temp)
 {
     m_MonsterID = 38;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temp;
 }
Exemple #5
0
 public ItemZombie(Serial temp, int x, int y, string map)
     : this(temp)
 {
     m_MonsterID = 9;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temp;
 }
Exemple #6
0
 public NeoSkelEscottor(Serial temp, int x, int y, string map)
     : this(temp)
 {
     m_MonsterID = 23;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temp;
 }
Exemple #7
0
 public iHardBoil(Serial temp, int x, int y, string map)
     : this(temp)
 {
     m_MonsterID = 28;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temp;
 }
Exemple #8
0
 public GolemGuard(Serial temp, int x, int y, string map)
     : this(temp)
 {
     m_MonsterID = 31;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temp;
 }
Exemple #9
0
 public WildDog(Serial temps, int x, int y, string map)
     : this(temps)
 {
     m_MonsterID = 27;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temps;
 }
 public iButcherGreen(Serial temp, int x, int y, string map)
     : this(temp)
 {
     m_MonsterID = 8;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temp;
 }
 public NeoGreatStone(Serial temp, int x, int y, string map)
     : this(temp)
 {
     m_MonsterID = 6;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temp;
 }
Exemple #12
0
 public HoundsOfDoom(Serial temp, int x, int y, string map)
     : this(temp)
 {
     m_MonsterID = 19;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temp;
 }
Exemple #13
0
 public WarBadGirl(Serial temp, int x, int y, string map)
     : this(temp)
 {
     m_MonsterID = 7;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temp;
 }
Exemple #14
0
 public WarButcher(Serial temps, int x, int y, string map)
     : this(temps)
 {
     m_MonsterID = 12;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temps;
 }
Exemple #15
0
 public BioRubber(Serial temp, int x, int y, string map)
     : this(temp)
 {
     m_MonsterID = 219;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temp;
 }
Exemple #16
0
 public Skeleton(Serial temp, int x, int y, string map)
     : this(temp)
 {
     m_MonsterID = 1;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temp;
 }
Exemple #17
0
 public iMummyBlue(Serial temp, int x, int y, string map)
     : this(temp)
 {
     m_MonsterID = 3;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temp;
 }
Exemple #18
0
 public HeadCutter(Serial temp, int x, int y, string map)
     : this(temp)
 {
     m_MonsterID = 30;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temp;
 }
Exemple #19
0
 public BoneDryRed(Serial temp, int x, int y, string map)
     : this(temp)
 {
     m_MonsterID = 24;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temp;
 }
Exemple #20
0
 public Iron(Serial temp, int x, int y, string map)
     : this(temp)
 {
     LastAction = int.MaxValue;
     m_MonsterID = 4;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temp;
 }
Exemple #21
0
        public static int Dist2d(Point2D one, Point2D two)
        {
            int ret = (int)Math.Sqrt((one.X - two.X) * (one.X - two.X) + (one.Y - two.Y) * (one.Y - two.Y));

            return(ret);
        }
Exemple #22
0
 /*
  public const byte Hat = 0x00;
 public const byte Amulet = 0x01;
 public const byte Weapon = 0x02;
 public const byte Armor = 0x03;
 public const byte Shield = 0x04;
 public const byte Ring = 0x05;
  */
 public void Drop(Player player)
 {
     InvSlot = -1;
     m_Map = player.Map;
     Loc = new Point2D(player.X, player.Y);
     Parent = null;
     ParSer = 0;
     try
     {
      //   World.DBConnect.WriteQue.Enqueue(() => World.DBConnect.DeleteItem(m_Serial));
         //   World.DBConnect.DeleteItem(m_Serial);
     }
     catch
     {
         Console.WriteLine("failed to delete item on drop");
     }
 }
Exemple #23
0
 public Mercenary(Serial temp, int x, int y, string map)
     : this(temp)
 {
     m_MonsterID = 209;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temp;
 }
Exemple #24
0
        public static Point2D SpawnPoint(string map)
        {
            Point2D temp = null;
            var nmap = LKCamelot.model.Map.FullMaps.Where(xe => xe.Key == map).FirstOrDefault().Value;
            var curmap = loadedmaps[nmap];
            var randomtile = curmap.tiles[Util.Random(0,mapsizes[nmap].X), Util.Random(0,mapsizes[nmap].Y)];
            if (randomtile.IsWall == false && randomtile.SpawnP == false)
            {
                temp = new Point2D(0,0);
                temp.X = randomtile.X;
                temp.Y = randomtile.Y;
                randomtile.SpawnP = true;
            }

            return temp;
        }
Exemple #25
0
        public static Point2D SpawnPointFixed(string map, int xe, int ye, int xe2, int ye2)
        {
            Point2D temp = null;
            var nmap = LKCamelot.model.Map.FullMaps.Where(xee => xee.Key == map).FirstOrDefault().Value;
            var curmap = loadedmaps[nmap];
            var randomtile = curmap.tiles[Util.RandomMinMax(xe, xe2), Util.RandomMinMax(ye, ye2)];
            if (randomtile.IsWall == false && randomtile.SpawnP == false)
            {
                temp = new Point2D(0, 0);
                temp.X = randomtile.X;
                temp.Y = randomtile.Y;
                randomtile.SpawnP = true;
            }

            return temp;
        }
Exemple #26
0
        public void Drop(Player player, int j)
        {
            InvSlot = -1;
            m_Map = player.Map;
            DropTime = LKCamelot.Server.tickcount.ElapsedMilliseconds;

            Loc = new Point2D(player.m_Loc.X, player.m_Loc.Y);

            Parent = null;
        }
Exemple #27
0
        public void Drop(script.monster.Monster mob, Player player)
        {
            InvSlot = -1;
            m_Map = player.Map;
            DropTime = LKCamelot.Server.tickcount.ElapsedMilliseconds;

            Loc = new Point2D(mob.m_Loc.X, mob.m_Loc.Y);

            Parent = null;
        }
Exemple #28
0
 public DeadlyMessenger(Serial temp, int x, int y, string map)
     : this(temp)
 {
     m_MonsterID = 203;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temp;
 }
Exemple #29
0
 public TwinCobra(Serial temp, int x, int y, string map)
     : this(temp)
 {
     m_MonsterID = 201;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temp;
 }
Exemple #30
0
 public Temptress(Serial temp, int x, int y, string map)
     : this(temp)
 {
     m_MonsterID = 223;
     m_Loc = new Point2D(x, y);
     m_SpawnLoc = new Point2D(m_Loc.X, m_Loc.Y);
     m_Map = map;
     m_Serial = temp;
 }
Exemple #31
0
        public static List <BaseObject> GetTileTarget(Player play, Point2D adjecentTile, int swingdir = 0)
        {
            List <BaseObject> ret = new List <BaseObject>();
            var Targets           = World.NewMonsters.Where(xe => xe.Value.m_Map != null &&
                                                            xe.Value.m_Map == play.Map &&
                                                            xe.Value.m_Loc.X == adjecentTile.X &&
                                                            xe.Value.m_Loc.Y == adjecentTile.Y &&
                                                            xe.Value.Alive).Select(xe => xe);

            // .Select(xe => xe);

            foreach (var tttt in Targets)
            {
                ret.Add(tttt.Value);
            }


            var Targets2 = PlayerHandler.getSingleton().add.Where(xe => xe.Value != null &&
                                                                  xe.Value.Map != null &&
                                                                  xe.Value != play && xe.Value.Map == play.Map &&
                                                                  xe.Value.loggedIn &&
                                                                  xe.Value.Loc.X == adjecentTile.X &&
                                                                  xe.Value.Loc.Y == adjecentTile.Y)
                           .Select(xe => xe);

            foreach (var tttt in Targets2)
            {
                ret.Add(tttt.Value);
            }

            var TargetOre = World.NewMonsters.Where(xe => xe.Value.m_Map != null &&
                                                    xe.Value.m_Map == play.Map &&
                                                    xe.Value.m_Loc.X == adjecentTile.X &&
                                                    xe.Value.m_Loc.Y == adjecentTile.Y &&
                                                    (xe.Value is script.monster.BaseNode) &&
                                                    xe.Value.Alive).Select(xe => xe);

            foreach (var ore in TargetOre)
            {
                (ore.Value as script.monster.BaseNode).Hit(play);
                return(null);
            }

            if (play.m_Buffs.Where(xe => xe.BuffEffect.BuffType == script.spells.BuffCase.Triple)
                .FirstOrDefault() != null)
            {
                ret.Clear();
                Targets = World.NewMonsters.Where(xe => xe.Value.m_Map != null && xe.Value.m_Map == play.Map
                                                  &&
                                                  (
                                                      (xe.Value.m_Loc.X == adjecentTile.X && xe.Value.m_Loc.Y == adjecentTile.Y) ||
                                                      (xe.Value.m_Loc.X == CombatHandler2.AdjecentTile(play, swingdir - 1).X&& xe.Value.m_Loc.Y == CombatHandler2.AdjecentTile(play, swingdir - 1).Y) ||
                                                      (xe.Value.m_Loc.X == CombatHandler2.AdjecentTile(play, swingdir + 1).X&& xe.Value.m_Loc.Y == CombatHandler2.AdjecentTile(play, swingdir + 1).Y)
                                                  ) &&
                                                  xe.Value.Alive)
                          .Select(xe => xe);

                Targets2 = PlayerHandler.getSingleton().add.Where(xe => xe.Key != null && xe.Value != null && xe.Value.loggedIn && xe.Value.Map == play.Map
                                                                  &&
                                                                  (
                                                                      (xe.Value.m_Loc.X == adjecentTile.X && xe.Value.m_Loc.Y == adjecentTile.Y) ||
                                                                      (xe.Value.m_Loc.X == CombatHandler2.AdjecentTile(play, swingdir - 1).X&& xe.Value.m_Loc.Y == CombatHandler2.AdjecentTile(play, swingdir - 1).Y) ||
                                                                      (xe.Value.m_Loc.X == CombatHandler2.AdjecentTile(play, swingdir + 1).X&& xe.Value.m_Loc.Y == CombatHandler2.AdjecentTile(play, swingdir + 1).Y)
                                                                  )
                                                                  ).Select(xe => xe);
                foreach (var tttt in Targets)
                {
                    ret.Add(tttt.Value);
                }
                foreach (var tttt in Targets2)
                {
                    ret.Add(tttt.Value);
                }
            }

            if (play.m_Buffs.Where(xe => xe.BuffEffect.BuffType == script.spells.BuffCase.Twister)
                .FirstOrDefault() != null)
            {
                ret.Clear();
                Targets = World.NewMonsters.Where(xe => xe.Value.m_Map != null && xe.Value.m_Map == play.Map
                                                  &&
                                                  (
                                                      (xe.Value.m_Loc.X == adjecentTile.X && xe.Value.m_Loc.Y == adjecentTile.Y) ||
                                                      (xe.Value.m_Loc.X == CombatHandler2.AdjecentTile(play, swingdir - 2).X&& xe.Value.m_Loc.Y == CombatHandler2.AdjecentTile(play, swingdir - 2).Y) ||
                                                      (xe.Value.m_Loc.X == CombatHandler2.AdjecentTile(play, swingdir + 2).X&& xe.Value.m_Loc.Y == CombatHandler2.AdjecentTile(play, swingdir + 2).Y) ||
                                                      (xe.Value.m_Loc.X == CombatHandler2.AdjecentTile(play, swingdir + 4).X&& xe.Value.m_Loc.Y == CombatHandler2.AdjecentTile(play, swingdir + 4).Y)
                                                  ) &&
                                                  xe.Value.Alive)
                          .Select(xe => xe);

                Targets2 = PlayerHandler.getSingleton().add.Where(xe => xe.Key != null && xe.Value != null && xe.Value.loggedIn && xe.Value.Map == play.Map
                                                                  &&
                                                                  (
                                                                      (xe.Value.m_Loc.X == adjecentTile.X && xe.Value.m_Loc.Y == adjecentTile.Y) ||
                                                                      (xe.Value.m_Loc.X == CombatHandler2.AdjecentTile(play, swingdir - 2).X&& xe.Value.m_Loc.Y == CombatHandler2.AdjecentTile(play, swingdir - 2).Y) ||
                                                                      (xe.Value.m_Loc.X == CombatHandler2.AdjecentTile(play, swingdir + 2).X&& xe.Value.m_Loc.Y == CombatHandler2.AdjecentTile(play, swingdir + 2).Y) ||
                                                                      (xe.Value.m_Loc.X == CombatHandler2.AdjecentTile(play, swingdir + 4).X&& xe.Value.m_Loc.Y == CombatHandler2.AdjecentTile(play, swingdir + 4).Y)
                                                                  )
                                                                  ).Select(xe => xe);
                foreach (var tttt in Targets)
                {
                    ret.Add(tttt.Value);
                }
                foreach (var tttt in Targets2)
                {
                    ret.Add(tttt.Value);
                }
            }

            return(ret.Count > 0 ? ret : null);
        }
Exemple #32
0
        public void HandleCast(int header, script.spells.Spell castspell, Player player, int target = 0, short castx = 0, short casty = 0)
        {
            if (castspell is Teleport)
            {
                var teleportdist = ((castspell.Level / 2) * 2);
                if (teleportdist <= 3) teleportdist = 4;
                if (teleportdist > 12) teleportdist = 12;
                if (World.Dist2d(castx, casty, player.X, player.Y) <= teleportdist
                    && player.MPCur > castspell.RealManaCost(player))
                {
                    var nmap = LKCamelot.model.Map.FullMaps.Where(xe => xe.Key == player.Map).FirstOrDefault().Value;
                    TiledMap curmap = null;
                    try
                    {
                        curmap = LKCamelot.model.Map.loadedmaps[nmap];
                    }
                    catch
                    {
                        Console.WriteLine(string.Format("Failed to nmap at {0}", nmap));
                    }
                    LKCamelot.model.MyPathNode randomtile;
                    try
                    {
                        randomtile = curmap.tiles[castx, casty];
                    }
                    catch
                    {
                        return;
                    }
                    if (randomtile.IsWall)
                        return;

                    player.MPCur -= castspell.RealManaCost(player);
                    castspell.CheckLevelUp(player);

                    player.Loc = new Point2D(castx, casty);
                    World.SendToAll(new QueDele(player.Map, new MoveSpriteTele(player.Serial, player.Face, player.X, player.Y).Compile()));
                    return;
                }
            }
            if (castspell is Trace)
            {
                if (player.MPCur > castspell.RealManaCost(player))
                {
                    player.MPCur -= castspell.RealManaCost(player);
                    castspell.CheckLevelUp(player);

                    try
                    {
                        var traceto = script.map.Portal.Portals.Where(xe => xe.Map == player.Map).Select(xe => xe).ToList();
                        if (traceto.Count > 1)
                        {
                            var temp = new Point2D(traceto[0].Locs[0].X, traceto[0].Locs[0].Y + 2);
                            player.Loc = temp;
                        }
                    }
                    catch { return; }

                    World.SendToAll(new QueDele(player.Map, new MoveSpriteTele(player.Serial, player.Face, player.X, player.Y).Compile()));
                    return;
                }
            }
            if (castspell is ComeBack)
            {
                return;
            }

            var caston = World.NewMonsters.Where(xe => xe.Value.m_Serial == target
                                && World.Dist2d(xe.Value.m_Loc.X, xe.Value.m_Loc.Y, player.X, player.Y) <= castspell.Range
                                && xe.Value.Alive
                && xe.Value.m_Map != null && xe.Value.m_Map == player.m_Map
                ).Select(xe => xe.Value);

            var playcaston = PlayerHandler.getSingleton().add.Where(xe => xe.Value != null && xe.Value != player && xe.Value.loggedIn
                && World.Dist2d(xe.Value.m_Loc.X, xe.Value.m_Loc.Y, player.m_Loc.X, player.m_Loc.Y) <= castspell.Range
                && xe.Value.Serial == (Serial)target
                && xe.Value.m_Map != null && xe.Value.m_Map == player.m_Map).FirstOrDefault();

            if (castspell.mType == LKCamelot.library.MagicType.Casted || castspell.mType == LKCamelot.library.MagicType.Target)
            {
                caston = World.NewMonsters.Where(xe => xe.Value.m_Map != null
                       && xe.Value.m_Map == player.Map
                       && World.Dist2d(xe.Value.m_Loc.X, xe.Value.m_Loc.Y, player.X, player.Y) <= castspell.Range
                       && xe.Value.Alive)
                      .Select(xe => xe.Value);
            }

            if (playcaston.Key != null
                && !(player.Map == "Village1" || player.Map == "Rest" || player.Map == "Arnold" || player.Map == "Loen")
                )
            {

                if (castspell is ISingle)
                {
                    if (player.MPCur < castspell.RealManaCost(player))
                        return;
                    player.MPCur -= castspell.RealManaCost(player);
                    castspell.CheckLevelUp(player);

                    CreateMagicEffect(playcaston.Value.Loc, playcaston.Value.Map, (byte)castspell.Seq.OnImpactSprite, 1500);

                    TakeDamage(player, playcaston.Value, castspell);
                    return;
                }

                if (castspell.Name == "DEMON DEATH")
                {
                    if (player.HPCur < (int)(player.HP * 0.70))
                        return;

                    var miyamo = player.Equipped.Where(xe => xe.GetType() == typeof(script.item.MiyamotosStick)).FirstOrDefault();
                    var recast = castspell.RecastTime;
                    if (miyamo != null)
                    {
                        recast -= 1000;
                        recast -= miyamo.Stage * 300;
                    }

                    if (LKCamelot.Server.tickcount.ElapsedMilliseconds - recast > castspell.Cooldown)
                    {
                        castspell.Cooldown = LKCamelot.Server.tickcount.ElapsedMilliseconds;
                    }
                    else
                        return;

                    player.HPCur -= castspell.RealManaCost(player);
                    castspell.CheckLevelUp(player);

                    int mobile = Serial.NewMobile;
                    World.SendToAll(new QueDele(player.Map, new CreateMagicEffect(mobile, 1, (short)playcaston.Value.m_Loc.X, (short)playcaston.Value.m_Loc.Y, new byte[] { 4, 0, 0, 0, 0, 0, 0, 0, 0, (byte)castspell.Seq.OnImpactSprite }, 0).Compile()));
                    var tmp = new QueDele(LKCamelot.Server.tickcount.ElapsedMilliseconds + 2000, player.m_Map, new DeleteObject(mobile).Compile());
                    tmp.tempser = mobile;
                    World.TickQue.Add(tmp);

                    TakeDamage(player, playcaston.Value, castspell);

                    return;
                }

                if (player.MPCur < castspell.RealManaCost(player))
                    return;
                player.MPCur -= castspell.RealManaCost(player);
                castspell.CheckLevelUp(player);
                TakeDamage(player, playcaston.Value, castspell);
                World.SendToAll(new QueDele(player.Map, new CurveMagic(player.Serial,
                    castx, casty, castspell.Seq).Compile()));
            }

            switch (castspell.mType)
            {
                case (LKCamelot.library.MagicType.Target2):
                    foreach (var targete in caston)
                    {
                        if (castspell is ISingle)
                        {
                            if (player.MPCur < castspell.RealManaCost(player))
                                return;
                            player.MPCur -= castspell.RealManaCost(player);
                            castspell.CheckLevelUp(player);

                            CreateMagicEffect(targete.m_Loc, targete.m_Map, (byte)castspell.Seq.OnImpactSprite, 1500);

                            targete.TakeDamage(player, castspell);
                            return;
                        }

                        if (castspell.Name == "DEMON DEATH")
                        {
                            if (player.HPCur < (int)(player.HP * 0.70))
                                return;

                            var miyamo = player.Equipped.Where(xe => xe.GetType() == typeof(script.item.MiyamotosStick)).FirstOrDefault();
                            var recast = castspell.RecastTime;
                            if (miyamo != null)
                            {
                                recast -= 1000;
                                recast -= miyamo.Stage * 300;
                            }

                            if (LKCamelot.Server.tickcount.ElapsedMilliseconds - recast > castspell.Cooldown)
                            {
                                castspell.Cooldown = LKCamelot.Server.tickcount.ElapsedMilliseconds;
                            }
                            else
                                return;

                            player.HPCur -= castspell.RealManaCost(player);
                            castspell.CheckLevelUp(player);

                            int mobile = Serial.NewMobile;
                            World.SendToAll(new QueDele(player.Map, new CreateMagicEffect(mobile, 1, (short)targete.m_Loc.X, (short)targete.m_Loc.Y, new byte[] { 4, 0, 0, 0, 0, 0, 0, 0, 0, (byte)castspell.Seq.OnImpactSprite }, 0).Compile()));
                            var tmp = new QueDele(LKCamelot.Server.tickcount.ElapsedMilliseconds + 2000, player.m_Map, new DeleteObject(mobile).Compile());
                            tmp.tempser = mobile;
                            World.TickQue.Add(tmp);

                            targete.TakeDamage(player, castspell);

                            return;
                        }

                        if (player.MPCur < castspell.RealManaCost(player))
                            return;
                        player.MPCur -= castspell.RealManaCost(player);
                        castspell.CheckLevelUp(player);
                        targete.TakeDamage(player, castspell);
                        World.SendToAll(new QueDele(player.Map, new CurveMagic(player.Serial,
                            castx, casty, castspell.Seq).Compile()));
                    }

                    break;

                case (LKCamelot.library.MagicType.Casted):
                    if (player.MPCur < castspell.RealManaCost(player))
                        return;
                    player.MPCur -= castspell.RealManaCost(player);

                    if (castspell.Cast(player))
                        return;

                    foreach (var targete in caston)
                        targete.TakeDamage(player, castspell);

                    World.SendToAll(new QueDele(player.Map, new CurveMagic(player.Serial,
                      1, 1, castspell.Seq).Compile()));

                    break;
                case (LKCamelot.library.MagicType.Target):
                    if (player.MPCur < castspell.RealManaCost(player))
                        return;
                    player.MPCur -= castspell.RealManaCost(player);
                    if (castspell.Cast(player))
                        return;

                    World.SendToAll(new QueDele(player.Map, new CurveMagic(player.Serial, 1, 1, castspell.Seq).Compile()));
                    foreach (var targetee in caston)
                    {
                        int mobile = Serial.NewMobile;
                        World.SendToAll(new QueDele(player.Map, new CreateMagicEffect(mobile, 1, (short)targetee.m_Loc.X, (short)targetee.m_Loc.Y, new byte[] { 4, 0, 0, 0, 0, 0, 0, 0, 0, (byte)castspell.Seq.OnImpactSprite }, 0).Compile()));
                        // World.SendToAll(new QueDele(player.Map, new SetObjectEffectsMonsterSpell(targetee, castspell.Seq.OnImpactSprite).Compile()));
                        targetee.TakeDamage(player, castspell);
                        var tmp = new QueDele(LKCamelot.Server.tickcount.ElapsedMilliseconds + 1000, player.m_Map, new DeleteObject(mobile).Compile());
                        tmp.tempser = mobile;
                        World.TickQue.Add(tmp);
                    }
                    break;
            }
        }