static void PlayerJump(Data generalData, Client.GameState client)
        {
            // Console.WriteLine("Jump Sec " + DateTime.Now.Second + " Mile " + DateTime.Now.Millisecond + "");
            //Console.WriteLine("" + generalData + "");

            client.Entity.Action = PhoenixProject.Game.Enums.ConquerAction.None;
            client.Mining = false;
            /* #region SpeedHack Check
             if (Time32.Now > client.speedsleep.AddSeconds(60))
             {
                 client.speedHackSuspiction += 1;
                 //Console.WriteLine("SpeedHack sus "+client.speedHackSuspiction+" ");
                 if (Time32.Now > client.speedHackTime.AddSeconds(2))
                 {
                     client.speedHackTime = Time32.Now;
                     client.speedHackSuspiction = 0;
                 }
                 if (client.Entity.TransformationID == 0)
                 {
                     if (client.speedHackSuspiction > 5 && !client.Entity.OnCyclone() && !client.Entity.ContainsFlag(Update.Flags2.Oblivion) && !client.Entity.ContainsFlag(Update.Flags.Ride))
                     {
                         if (client.Entity.MapID != 6004)
                         {
                             client.HackTime += 1;
                             client.speedHackTime = Time32.Now;
                             client.speedsleep = Time32.Now;
                             client.speedHackSuspiction = 0;
                             //client.Entity.Teleport(6004, 30, 74);
                             if (client.HackTime < 3)
                             {
                                 PhoenixProject.ServerBase.Kernel.SendWorldMessage(new PhoenixProject.Network.GamePackets.Message("[GM]: " + client.Entity.Name + " is using SpeedHack, Using SpeedHack Times " + client.HackTime + " Time/s he still have " + (3 - client.HackTime) + " Warn then we will kick his/her ass Out!", System.Drawing.Color.Black, PhoenixProject.Network.GamePackets.Message.Center), PhoenixProject.ServerBase.Kernel.GamePool.Values);
                             }
                             else
                             {
                                 client.HackTime += 1;
                                 client.speedHackTime = Time32.Now;
                                 client.speedHackSuspiction = 0;
                                 client.Entity.Teleport(6004, 30, 74);
                                 PhoenixProject.ServerBase.Kernel.SendWorldMessage(new PhoenixProject.Network.GamePackets.Message("[GM]: " + client.Entity.Name + "  used SpeedHack for Three Times and sent to Botjail ,TakeCare of your account!", System.Drawing.Color.Black, PhoenixProject.Network.GamePackets.Message.Center), PhoenixProject.ServerBase.Kernel.GamePool.Values);
                             }
                         }
                     }
                 }
             }
             #endregion*/

            #region MagicDefender
            if (client.Entity.ContainsFlag3(Network.GamePackets.Update.Flags3.MagicDefender))
            {

                client.Entity.MagicDefenderTime = 0;
                client.Entity.MagicDefenderIncrease = 0;
                client.Entity.RemoveFlag3(Network.GamePackets.Update.Flags3.MagicDefender);
                SyncPacket packet = new SyncPacket
                {
                    Identifier = client.Entity.UID,
                    Count = 2,
                    Type = PhoenixProject.Network.GamePackets.SyncPacket.SyncType.StatusFlag,
                    StatusFlag1 = (ulong)client.Entity.StatusFlag,
                    StatusFlag2 = (ulong)client.Entity.StatusFlag2,
                    Unknown1 = 0x31,
                    StatusFlagOffset = 0x80,
                    Time = 0,
                    Value = 0,
                    Level = 0
                };
                client.Entity.Owner.Send((byte[])packet);
                foreach (var Client in client.MagicDef)
                {
                    if (Client.Entity.ContainsFlag2(Update.Flags2.kimo4))
                    {
                        Client.Entity.RemoveFlag2(Update.Flags2.kimo4);
                    }
                }
                client.MagicDef.Clear();
            }
            #endregion

            #region Pray
            if (client.Entity.ContainsFlag(Update.Flags.CastPray))
            {
                client.Entity.RemoveFlag(Update.Flags.CastPray);
                foreach (var Client in client.Prayers)
                {
                    if (Client.Entity.ContainsFlag(Update.Flags.Praying))
                    {
                        Client.Entity.RemoveFlag(Update.Flags.Praying);
                    }
                }
                client.Prayers.Clear();
            }

            if (client.Entity.ContainsFlag(Update.Flags.Praying))
            {
                client.Entity.RemoveFlag(Update.Flags.Praying);
                if (client.PrayLead != null)
                {
                    client.PrayLead.Prayers.Remove(client);
                    client.PrayLead = null;
                }
            }
            #endregion

            Time32 Now = Time32.Now;

            client.Attackable = true;
            if (client.Entity.AttackPacket != null)
            {
                client.Entity.AttackPacket = null;
            }
            if (client.Entity.Dead)
            {
                if (Now > client.Entity.DeathStamp.AddSeconds(4))
                {
                    //client.Disconnect();
                    return;
                }
            }

            ushort new_X = (ushort)(generalData.dwParam & 0xFFFF);
            ushort new_Y = (ushort)(generalData.dwParam >> 16);

            if (client.lastJumpDistance == 0) goto Jump;
            if (client.Entity.ContainsFlag(Update.Flags.Ride))
            {
                int distance = ServerBase.Kernel.GetDistance(new_X, new_Y, client.Entity.X, client.Entity.Y);
                ushort take = (ushort)(1.5F * (distance / 2));
                if (client.Entity.Vigor >= take)
                {
                    client.Entity.Vigor -= take;
                    Network.GamePackets.Vigor vigor = new Network.GamePackets.Vigor(true);
                    vigor.VigorValue = client.Entity.Vigor;
                    vigor.Send(client);
                }
                else
                {
                }
            }
            client.LastJumpTime = (int)ServerBase.Kernel.maxJumpTime(client.lastJumpDistance);
            int a1 = Now.GetHashCode() - client.lastJumpTime.GetHashCode();
            int a2 = generalData.TimeStamp.GetHashCode() - client.lastClientJumpTime.GetHashCode();
            bool DOO = false;
            if (a2 - a1 > 1000) DOO = true;
            if (Now < client.lastJumpTime.AddMilliseconds(client.LastJumpTime))
            {
                bool doDisconnect = false;
                if (client.Entity.Transformed)
                    if (client.Entity.TransformationID != 207 && client.Entity.TransformationID != 267)
                        doDisconnect = true;
                if (client.Entity.Transformed && doDisconnect)
                {
                }
                if (client.Entity.Transformed && !doDisconnect)
                {
                    goto Jump;
                }
                if (!client.Entity.OnCyclone() && !client.Entity.ContainsFlag(Update.Flags2.Oblivion) && !client.Entity.ContainsFlag(Update.Flags.Ride) && !DOO)
                {
                }
                else if (client.Entity.ContainsFlag(Update.Flags.Ride))
                {
                    int time = (int)ServerBase.Kernel.maxJumpTime(client.lastJumpDistance);
                    int speedprc = Database.DataHolder.SteedSpeed(client.Equipment.TryGetItem(ConquerItem.Steed).Plus);
                    if (speedprc != 0)
                    {
                        if (Now < client.lastJumpTime.AddMilliseconds(time - (time * speedprc / 100)))
                        {
                        }
                    }
                    else
                    {
                    }
                }
            }
            Jump:
            client.lastJumpDistance = ServerBase.Kernel.GetDistance(new_X, new_Y, client.Entity.X, client.Entity.Y);
            client.lastClientJumpTime = generalData.TimeStamp;
            client.lastJumpTime = Now;
            Game.Map Map = client.Map;
            if (Map != null)
            {
                if (Map.Floor[new_X, new_Y, Game.MapObjectType.Player, null])
                {
                    if (ServerBase.Kernel.GetDistance(new_X, new_Y, client.Entity.X, client.Entity.Y) <= 20)
                    {
                        client.Entity.Action = Game.Enums.ConquerAction.Jump;
                        client.Entity.Facing = ServerBase.Kernel.GetAngle(generalData.wParam1, generalData.wParam2, new_X, new_Y);
                        client.Entity.PX = client.Entity.X;
                        client.Entity.PY = client.Entity.Y;
                        client.Entity.X = new_X;
                        client.Entity.Y = new_Y;
                        client.SendScreen(generalData, true);
                        client.Screen.Reload(generalData);
                        if (client.Entity.MapID == 1005)
                        {
                            if (new_X == 42 && new_Y == 51)//stig
                            {
                                if (!client.Entity.ContainsFlag(Update.Flags.Stigma) && !client.Entity.ContainsFlag(Update.Flags.Ghost))
                                {
                                    SpellUse suse = new SpellUse(true);
                                    suse.Attacker = client.Entity.UID;
                                    suse.SpellID = 1095;
                                    suse.SpellLevel = 3;
                                    suse.X = 42;
                                    suse.Y = 51;
                                    suse.Targets.Add(client.Entity.UID, 0);
                                    client.Entity.AddFlag(Update.Flags.Stigma);
                                    client.Entity.StigmaStamp = Time32.Now;
                                    client.Entity.StigmaIncrease = 25;
                                    client.Entity.StigmaTime = 20;
                                    client.SendScreen(suse, true);
                                    if (client.Entity.EntityFlag == PhoenixProject.Game.EntityFlag.Player)
                                        client.Send(ServerBase.Constants.Stigma(25, 20));
                                }
                            }
                            else
                            {
                                if (new_X == 42 && new_Y == 48)//rev
                                {
                                    if (client.Entity.ContainsFlag(Update.Flags.Ghost))
                                    {
                                        SpellUse suse = new SpellUse(true);
                                        suse.Attacker = client.Entity.UID;
                                        suse.SpellID = 1050;
                                        suse.SpellLevel = 0;
                                        suse.X = 42;
                                        suse.Y = 48;
                                        suse.Targets.Add(client.Entity.UID, 0);
                                        client.SendScreen(suse, true);
                                        client.Entity.Action = PhoenixProject.Game.Enums.ConquerAction.None;
                                        client.ReviveStamp = Time32.Now;
                                        client.Attackable = false;
                                        client.Entity.TransformationID = 0;
                                        client.Entity.RemoveFlag(Update.Flags.Dead);
                                        client.Entity.RemoveFlag(Update.Flags.Ghost);
                                        client.Entity.Hitpoints = client.Entity.MaxHitpoints;
                                        client.Entity.Ressurect();

                                    }
                                }

                            }
                        }
                        if (client.Entity.MapID == 1002)
                        {
                            if (new_X == 436 && new_Y == 444)//stig
                            {
                                if (!client.Entity.ContainsFlag(Update.Flags.Ghost))
                                {
                                    if (client.Entity.EntityFlag == PhoenixProject.Game.EntityFlag.Player && client.Entity.MaxHitpoints != client.Entity.Hitpoints)
                                    {
                                        SpellUse suse = new SpellUse(true);
                                        suse.Attacker = client.Entity.UID;
                                        suse.SpellID = 1195;
                                        suse.SpellLevel = 0;
                                        suse.X = 436;
                                        suse.Y = 444;
                                        uint Hp = (client.Entity.MaxHitpoints - client.Entity.Hitpoints);
                                        client.Entity.Hitpoints = client.Entity.MaxHitpoints;
                                        suse.Targets.Add(client.Entity.UID, Hp);
                                        client.SendScreen(suse, true);
                                        client.Send(new Message("Your HP Now : " + client.Entity.Hitpoints + "!", System.Drawing.Color.Red, Message.Talk));
                                    }
                                }
                            }

                        }

                        if (client.Entity.InteractionInProgress && client.Entity.InteractionSet)
                        {
                            if (client.Entity.Body == 1003 || client.Entity.Body == 1004)
                            {
                                if (ServerBase.Kernel.GamePool.ContainsKey(client.Entity.InteractionWith))
                                {
                                    Client.GameState ch = ServerBase.Kernel.GamePool[client.Entity.InteractionWith];
                                    PhoenixProject.Network.GamePackets.Data general = new PhoenixProject.Network.GamePackets.Data(true);
                                    general.UID = ch.Entity.UID;
                                    general.wParam1 = new_X;
                                    general.wParam2 = new_Y;
                                    general.ID = 0x9c;
                                    ch.Send(general.ToArray());
                                    ch.Entity.Action = Game.Enums.ConquerAction.Jump;
                                    ch.Entity.X = new_X;
                                    ch.Entity.Y = new_Y;
                                    ch.Entity.Facing = ServerBase.Kernel.GetAngle(ch.Entity.X, ch.Entity.Y, new_X, new_Y);
                                    ch.SendScreen(generalData, true);
                                    ch.Screen.Reload(general);
                                    client.SendScreen(generalData, true);
                                    client.Screen.Reload(general);
                                }
                            }
                        }
                    }
                    else
                    {
                        client.Disconnect();
                    }
                }
                else
                {
                    if (client.Entity.Mode == Game.Enums.Mode.None)
                    {
                        client.Entity.Teleport(client.Map.ID, client.Entity.X, client.Entity.Y);
                    }
                }
            }
            else
            {
                if (ServerBase.Kernel.GetDistance(new_X, new_Y, client.Entity.X, client.Entity.Y) <= 20)
                {
                    client.Entity.Action = Game.Enums.ConquerAction.Jump;
                    client.Entity.Facing = ServerBase.Kernel.GetAngle(generalData.wParam1, generalData.wParam2, new_X, new_Y);
                    client.Entity.X = new_X;
                    client.Entity.Y = new_Y;
                    client.SendScreen(generalData, true);
                    client.Screen.Reload(generalData);
                }
                else
                {
                    client.Disconnect();
                }
            }
            client.Entity.MapRegion = Region.Region.FindRegion((uint)client.Map.BaseID, client.Entity.X, client.Entity.Y);
        }
        static void UseItem(Interfaces.IConquerItem item, Client.GameState client)
        {
            Database.ConquerItemInformation infos = new Database.ConquerItemInformation(item.ID, 0);
            if (client.Booth != null)
                return;
            client.Entity.UseItem = true;
            client.SpiltStack = true;
            switch (item.ID)
            {
                #region ElitePkChampion Prize
                #region 10ExpBallPack
                case 720757:
                    {
                        if (client.Inventory.Count <= 39)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(723700, 0, 10);
                        }
                        else
                            client.Send(ServerBase.Constants.FullInventory);
                        break;

                        //  break;
                    }
                #endregion
                #region +3StonePack
                case 729023:
                    {
                        if (client.Inventory.Count <= 30)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(730003, 3, 10);
                        }
                        else
                            client.Send(ServerBase.Constants.FullInventory);
                        break;

                    }
                #endregion
                #region +2StonePack
                case 729022:
                    {
                        if (client.Inventory.Count <= 30)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(730002, 2, 10);
                        }
                        else
                            client.Send(ServerBase.Constants.FullInventory);
                        break;
                    }
                #endregion
                #region +1Stone Pack
                case 723712:
                    {
                        if (client.Inventory.Count <= 35)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(730001, 1, 5);
                        }
                        else
                            client.Send(ServerBase.Constants.FullInventory);
                        break;
                    }
                #endregion
                #region 500Stuydy
                case 723342:
                    {

                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.SubClasses.StudyPoints += 500;
                        client.Send(ServerBase.Constants.Study);
                        break;
                    }
                #endregion
                #region Random Accseeoreis
                case 720836:
                    {
                        uint ItemID = 0;
                        uint rand = (uint)PhoenixProject.ServerBase.Kernel.Random.Next(1, 78);
                        switch (rand)
                        {
                            #region Rand Accesory
                            case 1:
                                ItemID = 350001;
                                break;
                            case 2:
                                ItemID = 350002;
                                break;
                            case 3:
                                ItemID = 350004;
                                break;
                            case 4:
                                ItemID = 350005;
                                break;
                            case 5:
                                ItemID = 350006;
                                break;
                            case 6:
                                ItemID = 350007;
                                break;
                            case 7:
                                ItemID = 350008;
                                break;
                            case 8:
                                ItemID = 350009;
                                break;
                            case 9:
                                ItemID = 350010;
                                break;
                            case 10:
                                ItemID = 350011;
                                break;
                            case 11:
                                ItemID = 350012;
                                break;
                            case 12:
                                ItemID = 350014;
                                break;
                            case 13:
                                ItemID = 350015;
                                break;
                            case 14:
                                ItemID = 350016;
                                break;
                            case 15:
                                ItemID = 350017;
                                break;
                            case 16://PalmLeafFan 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2-HandedAccessory A~delicate~and~beautiful~fan~made~of~palm~leaves. 8 0 0
                                ItemID = 350018;
                                break;
                            case 17://IronShovel 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2-HandedAccessory An~iron~shovel~may~come~in~handy~in~winter,~when~you~need~to~shovel~paths~through~snow. 8 0 0
                                ItemID = 350019;
                                break;
                            case 18:////FrozenTuna 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2-HandedAccessory It`s~a~strangely-shaped~tuna~from~Bird~Island. 8 0 0
                                ItemID = 350020; break;
                            case 19://IceStick 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2-HandedAccessory A~strange~stick.~Maybe~you~can~play~ice~hockey~with~it. 8 0 0
                                ItemID = 360001;
                                break;
                            case 20://Wrench 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory It`s~a~heavy~wrench.~Perhaps~you~can~use~it~to~deal~ 8 0 0
                                ItemID = 360002; break;
                            case 21://WoodenClub 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory This~wooden~club~often~gives~off~a~sweet~odor. 8 0 0
                                ItemID = 360003; break;
                            case 22://Umbrella 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory An~unbreakable~umbrella~is~a~stealth~weapon~that~also~keeps~you~dry. 8 0 0
                                ItemID = 360004; break;
                            case 23:////Blowfish 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Dried~in~the~bright~sunlight~over~the~Desert,~the~blowfish~makes~a~good~weapon~for~it`s~as~hard~as~iron. 8 0 0
                                ItemID = 360005; break;
                            case 24://FeatherDuster 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 360006; break;
                            case 25://Spatula 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 360007; break;
                            case 26://InvincibleFist 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 360008; break;
                            case 27://FishPole 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 360009; break;
                            case 28://Pan 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 360010; break;
                            case 29://Handbag 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 360011;
                                break;
                            case 30://Backpack 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 360012;
                                break;
                            case 31://SportsBag 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 360013; break;
                            case 32://Bunny 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 360014; break;
                            case 33://GoodEveningBear 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 360015; break;
                            case 34://Rod 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 360016;
                                break;
                            case 35://Clap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 360017;
                                break;
                            case 36://HeavyHammer 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 360018;
                                break;
                            case 37://LightSaber 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 360019
                                     ;
                                break;
                            case 38://TennisRacket 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 360020;
                                break;
                            case 39://ApeCityHam 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 360021;
                                break;
                            case 40: //Wrench 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory It`s~a~heavy~wrench. 8 0 0
                                ItemID = 360022;
                                break;
                            case 41: //WoodenClub 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory This~wooden~club~often~gives~off~a~sweet~odor. 8 0 0
                                ItemID = 360023;
                                break;
                            case 42://Umbrella 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory An~unbreakable~umbrella~is~a~stealth~weapon~that~also~keeps~you~dry. 8 0 0
                                ItemID = 360024;
                                break;
                            case 43://Blowfish 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Dried~in~the~bright~sunlight~over~the~Desert,~the~Mackerel~makes~a~good~weapon~for~it`s~as~hard~as~iron. 8 0 0
                                ItemID = 360025;
                                break;
                            case 44://FeatherDuster 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 360026;
                                break;
                            case 45://Spatula 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 360027;
                                break;
                            case 46://InvincibleFist 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 360028;
                                break;
                            case 47://FishPole 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 360029;
                                break;
                            case 48://Pan 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 360030;
                                break;
                            case 49://Handbag 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 360031;
                                break;
                            case 50://Backpack 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 360032;
                                break;
                            case 51://SportsBag 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 360033;
                                break;
                            case 52://Bunny 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 360034;
                                break;
                            case 53://GoodEveningBear 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 360035;
                                break;
                            case 54://Rod 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 360036;
                                break;
                            case 55://Clap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 360037;
                                break;
                            case 56://HeavyHammer 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 360038;
                                break;
                            case 57://LightSaber 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 360039;
                                break;
                            case 58://TennisRacket 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 360040;
                                break;
                            case 59://ApeCityHam 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 370001;
                                break;
                            case 60: //WoodenBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                ItemID = 370002;
                                break;
                            case 61://LoveBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                ItemID = 370003;
                                break;
                            case 62://SeaHorse 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                ItemID = 370004;
                                break;
                            case 63://Harp 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                ItemID = 370005;
                                break;
                            case 64://ForceBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                ItemID = 370011;
                                break;
                            case 65://WoodenBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                ItemID = 370012;
                                break;
                            case 66://LoveBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                ItemID = 370013;
                                break;
                            case 67://SeaHorse 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                ItemID = 370014;
                                break;
                            case 68://Harp 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                ItemID = 370015;
                                break;
                            case 69://ForceBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                ItemID = 380001;
                                break;
                            case 70://Wok 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                ItemID = 380002;
                                break;
                            case 71://TurtleShell 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                ItemID = 380003;
                                break;
                            case 72://LoveShield 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                ItemID = 380004;
                                break;
                            case 73://SunFlower 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                ItemID = 380005;
                                break;
                            case 74://Wheel 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                ItemID = 380011;
                                break;
                            case 75://Wok 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                ItemID = 380012;
                                break;
                            case 76://TurtleShell 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                ItemID = 380013;
                                break;
                            case 77://LoveShield 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                ItemID = 380014;
                                break;
                            case 78://SunFlower 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                ItemID = 380015;
                                break;
                            default:
                                ItemID = 380013;
                                break;
                            //Wheel 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                            #endregion
                        }
                        client.Inventory.Add(ItemID, 0, 1);
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        break;
                    }
                #endregion
                #region Random Refinery
                case 723693:
                    {
                        uint ItemID = 0;
                        uint rand = (uint)PhoenixProject.ServerBase.Kernel.Random.Next(1, 97);
                        switch (rand)
                        {
                            #region Rand Refinery
                            case 1:
                                ItemID = 724350;
                                break;
                            case 2:
                                ItemID = 724351;
                                break;
                            case 3:
                                ItemID = 724352;
                                break;
                            case 4:
                                ItemID = 724353;
                                break;
                            case 5:
                                ItemID = 724354;
                                break;
                            case 6:
                                ItemID = 724355;
                                break;
                            case 7:
                                ItemID = 724356;
                                break;
                            case 8:
                                ItemID = 724357;
                                break;
                            case 9:
                                ItemID = 724358;
                                break;
                            case 10:
                                ItemID = 724359;
                                break;
                            case 11:
                                ItemID = 724360;
                                break;
                            case 12:
                                ItemID = 724361;
                                break;
                            case 13:
                                ItemID = 724362;
                                break;
                            case 14:
                                ItemID = 724350;
                                break;
                            case 15:
                                ItemID = 724363;
                                break;
                            case 16://PalmLeafFan 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2-HandedAccessory A~delicate~and~beautiful~fan~made~of~palm~leaves. 8 0 0
                                ItemID = 724364;
                                break;
                            case 17://IronShovel 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2-HandedAccessory An~iron~shovel~may~come~in~handy~in~winter,~when~you~need~to~shovel~paths~through~snow. 8 0 0
                                ItemID = 724365;
                                break;
                            case 18:////FrozenTuna 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2-HandedAccessory It`s~a~strangely-shaped~tuna~from~Bird~Island. 8 0 0
                                ItemID = 724366; break;
                            case 19://IceStick 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2-HandedAccessory A~strange~stick.~Maybe~you~can~play~ice~hockey~with~it. 8 0 0
                                ItemID = 724367;
                                break;
                            case 20://Wrench 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory It`s~a~heavy~wrench.~Perhaps~you~can~use~it~to~deal~ 8 0 0
                                ItemID = 724368; break;
                            case 21://WoodenClub 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory This~wooden~club~often~gives~off~a~sweet~odor. 8 0 0
                                ItemID = 724369; break;
                            case 22://Umbrella 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory An~unbreakable~umbrella~is~a~stealth~weapon~that~also~keeps~you~dry. 8 0 0
                                ItemID = 724370; break;
                            case 23:////Blowfish 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Dried~in~the~bright~sunlight~over~the~Desert,~the~blowfish~makes~a~good~weapon~for~it`s~as~hard~as~iron. 8 0 0
                                ItemID = 724371; break;
                            case 24://FeatherDuster 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 724372; break;
                            case 25://Spatula 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 724373; break;
                            case 26://InvincibleFist 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 724374; break;
                            case 27://FishPole 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 724375; break;
                            case 28://Pan 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 724376; break;
                            case 29://Handbag 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 724377;
                                break;
                            case 30://Backpack 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 724378;
                                break;
                            case 31://SportsBag 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 724379; break;
                            case 32://Bunny 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 724380; break;
                            case 33://GoodEveningBear 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 724381; break;
                            case 34://Rod 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 724382;
                                break;
                            case 35://Clap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 724383;
                                break;
                            case 36://HeavyHammer 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 724384;
                                break;
                            case 37://LightSaber 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 724385
                                     ;
                                break;
                            case 38://TennisRacket 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 724386;
                                break;
                            case 39://ApeCityHam 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory None. 8 0 0
                                ItemID = 724387;
                                break;
                            case 40: //Wrench 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory It`s~a~heavy~wrench. 8 0 0
                                ItemID = 724388;
                                break;
                            case 41: //WoodenClub 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory This~wooden~club~often~gives~off~a~sweet~odor. 8 0 0
                                ItemID = 724389;
                                break;
                            case 42://Umbrella 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory An~unbreakable~umbrella~is~a~stealth~weapon~that~also~keeps~you~dry. 8 0 0
                                ItemID = 724390;
                                break;
                            case 43://Blowfish 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Dried~in~the~bright~sunlight~over~the~Desert,~the~Mackerel~makes~a~good~weapon~for~it`s~as~hard~as~iron. 8 0 0
                                ItemID = 724391;
                                break;
                            case 44://FeatherDuster 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724392;
                                break;
                            case 45://Spatula 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724393;
                                break;
                            case 46://InvincibleFist 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724394;
                                break;
                            case 47://FishPole 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724395;
                                break;
                            case 48://Pan 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724396;
                                break;
                            case 49://Handbag 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724397;
                                break;
                            case 50://Backpack 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724398;
                                break;
                            case 51://SportsBag 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724399;
                                break;
                            case 52://Bunny 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724400;
                                break;
                            case 53://GoodEveningBear 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724401;
                                break;
                            case 54://Rod 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724402;
                                break;
                            case 55://Clap 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724403;
                                break;
                            case 56://HeavyHammer 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724404;
                                break;
                            case 57://LightSaber 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724405;
                                break;
                            case 58://TennisRacket 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724406;
                                break;
                            case 59://ApeCityHam 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1-HandedAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724407;
                                break;
                            case 60: //WoodenBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                ItemID = 724408;
                                break;
                            case 61://LoveBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                ItemID = 724409;
                                break;
                            case 62://SeaHorse 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                ItemID = 724410;
                                break;
                            case 63://Harp 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                ItemID = 724411;
                                break;
                            case 64://ForceBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                ItemID = 724412;
                                break;
                            case 65://WoodenBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724413;
                                break;
                            case 66://LoveBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724414;
                                break;
                            case 67://SeaHorse 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724415;
                                break;
                            case 68://Harp 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724416;
                                break;
                            case 69://ForceBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724417;
                                break;
                            case 70://Wok 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                ItemID = 724418;
                                break;
                            case 71://TurtleShell 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                ItemID = 724419;
                                break;
                            case 72://LoveShield 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                ItemID = 724420;
                                break;
                            case 73://SunFlower 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                ItemID = 724421;
                                break;
                            case 74://Wheel 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                ItemID = 724422;
                                break;
                            case 75://Wok 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724423;
                                break;
                            case 76://TurtleShell 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724424;
                                break;
                            case 77://LoveShield 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724425;
                                break;
                            case 78://SunFlower 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724423;
                                break;
                            case 79: //WoodenBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                ItemID = 724424;
                                break;
                            case 80://LoveBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                ItemID = 724425;
                                break;
                            case 81://SeaHorse 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                ItemID = 724426;
                                break;
                            case 82://Harp 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                ItemID = 724427;
                                break;
                            case 83://ForceBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory None. 8 0 0
                                ItemID = 724428;
                                break;
                            case 84://WoodenBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724429;
                                break;
                            case 85://LoveBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724430;
                                break;
                            case 86://SeaHorse 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724431;
                                break;
                            case 87://Harp 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724432;
                                break;
                            case 88://ForceBow 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 BowAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724433;
                                break;
                            case 89://Wok 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                ItemID = 724434;
                                break;
                            case 90://TurtleShell 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                ItemID = 724435;
                                break;
                            case 91://LoveShield 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                ItemID = 724436;
                                break;
                            case 92://SunFlower 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                ItemID = 724437;
                                break;
                            case 93://Wheel 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 0 0 10080 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory None. 8 0 0
                                ItemID = 724438;
                                break;
                            case 94://Wok 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724439;
                                break;
                            case 95://TurtleShell 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724440;
                                break;
                            case 96://LoveShield 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724441;
                                break;
                            case 97://SunFlower 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                                ItemID = 724442;
                                break;
                            default:
                                ItemID = 724445;
                                break;
                            //Wheel 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65535 65535 0 0 0 0 0 0 0 0 0 1 800 2 2 1 215 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ShieldAccessory Right~click~to~equip. 8 0 0
                            #endregion
                        }
                        client.Inventory.Add(ItemID, 0, 1);
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        break;
                    }
                #endregion
                #region PkEliteFirst Pack
                case 720717:
                    {
                        if (client.Inventory.Count <= 23)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(723342, 0, 5);//mondostyBook
                            client.Inventory.Add(720598, 0, 3);//dragonPill
                            client.Inventory.Add(720028, 0, 3);//dbscroll
                            client.Inventory.Add(720836, 0, 1);//accessores
                            client.Inventory.Add(723693, 0, 1);//legandRefineryPack
                            client.Inventory.Add(723744, 0, 3);//powerExpBall
                            client.Inventory.Add(723864, 0, 1);//Steed+6
                        }
                        else
                        {
                            client.Send(new Message("you must have 17 space in you inventory to take prize", Color.Green, 2005));
                        }

                        break;
                    }
                #endregion
                #region PkEliteFirst Pack2
                case 720721:
                    {
                        if (client.Inventory.Count <= 30)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(723342, 0, 3);//mondostyBook
                            client.Inventory.Add(720598, 0, 2);//dragonPill
                            client.Inventory.Add(720028, 0, 1);//dbscroll
                            client.Inventory.Add(720836, 0, 1);//accessores
                            client.Inventory.Add(723693, 0, 1);//legandRefineryPack
                            client.Inventory.Add(723744, 0, 1);//powerExpBall
                            //client.Inventory.Add(723864, 0, 1);//Steed+6
                        }
                        else
                        {
                            client.Send(new Message("you must have 10 space in you inventory to take prize", Color.Green, 2005));
                        }

                        break;
                    }
                #endregion
                #region PkEliteFirst Pack3
                case 720725:
                    {
                        if (client.Inventory.Count <= 30)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(723342, 0, 2);//mondostyBook
                            client.Inventory.Add(720598, 0, 2);//dragonPill
                            client.Inventory.Add(720028, 0, 1);//dbscroll
                            client.Inventory.Add(720836, 0, 1);//accessores
                            client.Inventory.Add(723693, 0, 1);//legandRefineryPack
                            client.Inventory.Add(723912, 0, 2);//ArenaExp
                            //client.Inventory.Add(723864, 0, 1);//Steed+6
                        }
                        else
                        {
                            client.Send(new Message("you must have 10 space in you inventory to take prize", Color.Green, 2005));
                        }

                        break;
                    }
                #endregion
                #region PkEliteFirst Pack8
                case 720729:
                    {
                        if (client.Inventory.Count <= 30)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(723342, 0, 1);//mondostyBook
                            client.Inventory.Add(720598, 0, 1);//dragonPill
                            client.Inventory.Add(720028, 0, 1);//dbscroll
                            client.Inventory.Add(720836, 0, 1);//accessores
                            client.Inventory.Add(723693, 0, 1);//legandRefineryPack
                            client.Inventory.Add(723912, 0, 1);//ArenaExp
                            //client.Inventory.Add(723864, 0, 1);//Steed+6
                        }
                        else
                        {
                            client.Send(new Message("you must have 6 space in you inventory to take prize", Color.Green, 2005));
                        }

                        break;
                    }
                #endregion
                #endregion
                #region NewItems
                case 724002://SmallLotteryTicketPack
                    {
                        client.Inventory.Add(711504, 0, 3);
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        break;
                    }
                #endregion
                #region MemoryAgate
                case 720828:
                    {
                        if (ServerBase.Constants.revnomap.Contains(client.Entity.MapID))
                        {
                            client.Send(new Message("You Can't record here !", System.Drawing.Color.Tan, Message.TopLeft));
                            return;
                        }
                        else
                        {
                            item.SendAgate(client);
                        }

                        break;
                    }
                #endregion
                #region Medicine
                case 1000000:
                case 1000010:
                case 1000020:
                case 1000030:
                case 1002000:
                case 1002010:
                case 1002020:
                case 1002050:
                case 1000040:
                case 725065:
                    {
                        //Console.WriteLine("ss");
                        if (client.Entity.NoDrugsTime > 0)
                        {
                            if (Time32.Now > client.Entity.NoDrugsStamp.AddSeconds(client.Entity.NoDrugsTime))
                            {
                                client.Entity.NoDrugsTime = 0;
                            }
                            else
                            {
                                return;
                            }
                        }
                        if (client.Entity.Hitpoints == client.Entity.MaxHitpoints)
                        {
                            // Console.WriteLine("ss2");
                            return;
                        }
                        //Console.WriteLine("ss3");
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.Hitpoints = Math.Min(client.Entity.Hitpoints + infos.BaseInformation.ItemHP, client.Entity.MaxHitpoints);
                        break;
                    }
                case 1001000:
                case 1001010:
                case 1001020:
                case 1001030:
                case 1001040:
                case 1002030:
                case 1002040:
                case 725066:
                    {
                        if (client.Entity.NoDrugsTime > 0)
                        {
                            if (Time32.Now > client.Entity.NoDrugsStamp.AddSeconds(client.Entity.NoDrugsTime))
                            {
                                client.Entity.NoDrugsTime = 0;
                            }
                            else
                            {
                                return;
                            }
                        }
                        if (client.Entity.Mana == client.Entity.MaxMana)
                            return;
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.Mana = (ushort)Math.Min(client.Entity.Mana + infos.BaseInformation.ItemMP, client.Entity.MaxMana);
                        break;
                    }
                #endregion

                #region Gates
                case 0xafc95:
                case 0xafc96:
                case 0xafc97:
                case 0xafc98:
                    {
                        if (client.Guild != null)
                        {
                            ushort num2 = (ushort)(((item.ID % 100) + 0x7c) * 10);
                            NpcInitial initial = new NpcInitial
                            {
                                Identifier = 1,
                                Lookface = 3,
                                Mode = PhoenixProject.Network.GamePackets.NpcInitial.NpcModes.Place,
                                Furniture = num2
                            };
                            client.Send((byte[])initial);
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);

                        }
                        break;
                    }
                case 1060020:
                    {
                        if (client.Entity.MapID == 601) return;
                        if (client.Map.BaseID == 6000 || client.Map.BaseID == 6001 || client.Map.BaseID == 1844 || client.Map.BaseID == 1801 || client.Map.BaseID == 8883 || client.Map.BaseID == 1005 && client.Entity.MapID != 1005 || client.Map.BaseID == 700 && client.Entity.MapID != 701)
                        {
                            client.Send(ServerBase.Constants.JailItemUnusable);
                            return;
                        }
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.Teleport(1002, 429, 378);
                        break;
                    }
                case 1060021:
                    {
                        if (client.Entity.MapID == 601) return;
                        if (client.Map.BaseID == 6000 || client.Map.BaseID == 6001 || client.Map.BaseID == 1844 || client.Map.BaseID == 1801 || client.Map.BaseID == 8883 || client.Map.BaseID == 1005 && client.Entity.MapID != 1005 || client.Map.BaseID == 700 && client.Entity.MapID != 701)
                        {
                            client.Send(ServerBase.Constants.JailItemUnusable);
                            return;
                        }
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.Teleport(1000, 500, 650);
                        break;
                    }
                case 1060022:
                    {
                        if (client.Entity.MapID == 601) return;
                        if (client.Map.BaseID == 6000 || client.Map.BaseID == 6001 || client.Map.BaseID == 1844 || client.Map.BaseID == 1801 || client.Map.BaseID == 8883 || client.Map.BaseID == 1005 && client.Entity.MapID != 1005 || client.Map.BaseID == 700 && client.Entity.MapID != 701)
                        {
                            client.Send(ServerBase.Constants.JailItemUnusable);
                            return;
                        }
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.Teleport(1020, 565, 562);
                        break;
                    }
                case 1060023:
                    {
                        if (client.Entity.MapID == 601) return;
                        if (client.Map.BaseID == 6000 || client.Map.BaseID == 6001 || client.Map.BaseID == 1844 || client.Map.BaseID == 1801 || client.Map.BaseID == 8883 || client.Map.BaseID == 1005 && client.Entity.MapID != 1005 || client.Map.BaseID == 700 && client.Entity.MapID != 701)
                        {
                            client.Send(ServerBase.Constants.JailItemUnusable);
                            return;
                        }
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.Teleport(1011, 188, 264);
                        break;
                    }
                case 1060024:
                    {
                        if (client.Entity.MapID == 601) return;
                        if (client.Map.BaseID == 6000 || client.Map.BaseID == 6001 || client.Map.BaseID == 1844 || client.Map.BaseID == 1801 || client.Map.BaseID == 8883 || client.Map.BaseID == 1005 && client.Entity.MapID != 1005 || client.Map.BaseID == 700 && client.Entity.MapID != 701)
                        {
                            client.Send(ServerBase.Constants.JailItemUnusable);
                            return;
                        }
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.Teleport(1015, 717, 571);
                        break;
                    }
                case 1060039:
                    {
                        if (client.Entity.MapID == 601) return;
                        if (client.Map.BaseID == 6000 || client.Map.BaseID == 6001 || client.Map.BaseID == 1844 || client.Map.BaseID == 1801 || client.Map.BaseID == 8883 || client.Map.BaseID == 1005 && client.Entity.MapID != 1005 || client.Map.BaseID == 700 && client.Entity.MapID != 701)
                        {
                            client.Send(ServerBase.Constants.JailItemUnusable);
                            return;
                        }
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.Teleport(1217, 535, 558);
                        break;
                    }
                #endregion
                #region Dyes
                case 723584:
                    {
                        if (client.Equipment.TryGetItem(3) == null)
                            return;
                        if (client.Equipment.TryGetItem(3).ID == 0)
                            return;
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Equipment.TryGetItem(3).Color = Game.Enums.Color.Black;
                        PhoenixProject.Database.ConquerItemTable.UpdateColor(client.Equipment.TryGetItem(3));
                        client.Equipment.TryGetItem(3).Mode = PhoenixProject.Game.Enums.ItemMode.Update;
                        client.Equipment.TryGetItem(3).Send(client);
                        client.Equipment.UpdateEntityPacket();
                        break;
                    }
                case 1060030:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.HairColor = 3;
                        break;
                    }
                case 1060040:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.HairColor = 9;
                        break;
                    }
                case 1060050:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.HairColor = 8;
                        break;
                    }
                case 1060060:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.HairColor = 7;
                        break;
                    }
                case 1060070:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.HairColor = 6;
                        break;
                    }
                case 1060080:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.HairColor = 5;
                        break;
                    }
                case 1060090:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.HairColor = 4;
                        break;
                    }
                #endregion
                #region Misc
                #region ChiPoints Items By MR.Wallid
                #region ChiPill(100)
                case 729476:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Delete);
                        client.Entity.ChiPoints += 100;
                        {
                            client.Send(new Message("Congratulations you've received 100 Chi Points.", Color.Red, Message.TopLeft));
                        }
                        break;
                    }
                #endregion
                #region ChiPill(200)
                case 729477:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Delete);
                        client.Entity.ChiPoints += 200;
                        {
                            client.Send(new Message("Congratulations you've received 200 Chi Points.", Color.Red, Message.TopLeft));
                        }
                        break;
                    }
                #endregion
                #region ChiPill(300)
                case 729478:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Delete);
                        client.Entity.ChiPoints += 300;
                        {
                            client.Send(new Message("Congratulations you've received 300 Chi Points.", Color.Red, Message.TopLeft));
                        }
                        break;
                    }
                #endregion
                #region ChiPill(400)
                case 729479:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Delete);
                        client.Entity.ChiPoints += 400;
                        {
                            client.Send(new Message("Congratulations you've received 400 Chi Points.", Color.Red, Message.TopLeft));
                        }
                        break;
                    }
                #endregion
                #region VitalPill
                case 729481:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Delete);
                        client.Entity.ChiPoints += 500;
                        {
                            client.Send(new Message("Congratulations you've received 500 Chi Points.", Color.Red, Message.TopLeft));
                        }
                        break;
                    }
                #endregion
                #endregion
                #region Surprise-Box
                case 722178:
                    {
                        if (client.Inventory.Count <= 38)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            //client.Inventory.Add(722057, 0, 1);//PowerEXPBall
                            client.Entity.ConquerPoints += 2000;
                        }
                        else
                        {
                            client.Send(new Message("You Must have 1 space in you Inventory To Open You Box", Color.White, 255));
                        }
                        break;
                    }
                #endregion
                #region SteedPacks
                case 723855:
                case 728525:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        Interfaces.IConquerItem _item = new ConquerItem(true);
                        _item.ID = 300000;
                        Database.ConquerItemInformation _iteminfos = new Database.ConquerItemInformation(_item.ID, 0);
                        _item.Durability = _item.MaximDurability = _iteminfos.BaseInformation.Durability;
                        _item.Plus = 1;
                        _item.Effect = Game.Enums.ItemEffect.Horse;
                        _item.SocketProgress = 150 << 8 | 255 << 16;
                        client.Inventory.Add(_item, Game.Enums.ItemUse.CreateAndAdd);
                        break;
                    }
                case 723856:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        Interfaces.IConquerItem _item = new ConquerItem(true);
                        _item.ID = 300000;
                        Database.ConquerItemInformation _iteminfos = new Database.ConquerItemInformation(_item.ID, 0);
                        _item.Durability = _item.MaximDurability = _iteminfos.BaseInformation.Durability;
                        _item.Plus = 1;
                        _item.Effect = Game.Enums.ItemEffect.Horse;
                        _item.SocketProgress = 150 | 255 << 8;
                        client.Inventory.Add(_item, Game.Enums.ItemUse.CreateAndAdd);
                        break;
                    }
                case 723859:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        Interfaces.IConquerItem _item = new ConquerItem(true);
                        _item.ID = 300000;
                        Database.ConquerItemInformation _iteminfos = new Database.ConquerItemInformation(_item.ID, 0);
                        _item.Durability = _item.MaximDurability = _iteminfos.BaseInformation.Durability;
                        _item.Plus = 1;
                        _item.Effect = Game.Enums.ItemEffect.Horse;
                        _item.SocketProgress = 255 | 150 << 16;
                        client.Inventory.Add(_item, Game.Enums.ItemUse.CreateAndAdd);
                        break;
                    }
                case 723860:
                case 728526:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        Interfaces.IConquerItem _item = new ConquerItem(true);
                        _item.ID = 300000;
                        Database.ConquerItemInformation _iteminfos = new Database.ConquerItemInformation(_item.ID, 0);
                        _item.Durability = _item.MaximDurability = _iteminfos.BaseInformation.Durability;
                        _item.Plus = 3;
                        _item.Effect = Game.Enums.ItemEffect.Horse;
                        _item.SocketProgress = 150 << 8 | 255 << 16;
                        client.Inventory.Add(_item, Game.Enums.ItemUse.CreateAndAdd);
                        break;
                    }
                case 723861:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        Interfaces.IConquerItem _item = new ConquerItem(true);
                        _item.ID = 300000;
                        Database.ConquerItemInformation _iteminfos = new Database.ConquerItemInformation(_item.ID, 0);
                        _item.Durability = _item.MaximDurability = _iteminfos.BaseInformation.Durability;
                        _item.Plus = 3;
                        _item.Effect = Game.Enums.ItemEffect.Horse;
                        _item.SocketProgress = 150 | 255 << 8;
                        client.Inventory.Add(_item, Game.Enums.ItemUse.CreateAndAdd);
                        break;
                    }
                case 723862:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        Interfaces.IConquerItem _item = new ConquerItem(true);
                        _item.ID = 300000;
                        Database.ConquerItemInformation _iteminfos = new Database.ConquerItemInformation(_item.ID, 0);
                        _item.Durability = _item.MaximDurability = _iteminfos.BaseInformation.Durability;
                        _item.Plus = 3;
                        _item.Effect = Game.Enums.ItemEffect.Horse;
                        _item.SocketProgress = 255 | 150 << 16;
                        client.Inventory.Add(_item, Game.Enums.ItemUse.CreateAndAdd);
                        break;
                    }
                case 723863:
                case 728527:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        Interfaces.IConquerItem _item = new ConquerItem(true);
                        _item.ID = 300000;
                        Database.ConquerItemInformation _iteminfos = new Database.ConquerItemInformation(_item.ID, 0);
                        _item.Durability = _item.MaximDurability = _iteminfos.BaseInformation.Durability;
                        _item.Plus = 6;
                        _item.Effect = Game.Enums.ItemEffect.Horse;
                        _item.SocketProgress = 150 << 8 | 255 << 16;
                        client.Inventory.Add(_item, Game.Enums.ItemUse.CreateAndAdd);
                        break;
                    }
                case 723864:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        Interfaces.IConquerItem _item = new ConquerItem(true);
                        _item.ID = 300000;
                        Database.ConquerItemInformation _iteminfos = new Database.ConquerItemInformation(_item.ID, 0);
                        _item.Durability = _item.MaximDurability = _iteminfos.BaseInformation.Durability;
                        _item.Plus = 6;
                        _item.Effect = Game.Enums.ItemEffect.Horse;
                        _item.SocketProgress = 150 | 255 << 8;
                        client.Inventory.Add(_item, Game.Enums.ItemUse.CreateAndAdd);
                        break;
                    }
                case 723865:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        Interfaces.IConquerItem _item = new ConquerItem(true);
                        _item.ID = 300000;
                        Database.ConquerItemInformation _iteminfos = new Database.ConquerItemInformation(_item.ID, 0);
                        _item.Durability = _item.MaximDurability = _iteminfos.BaseInformation.Durability;
                        _item.Plus = 6;
                        _item.Effect = Game.Enums.ItemEffect.Horse;
                        _item.SocketProgress = 255 | 150 << 16;
                        client.Inventory.Add(_item, Game.Enums.ItemUse.CreateAndAdd);
                        break;
                    }
                case 723900:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        Interfaces.IConquerItem _item = new ConquerItem(true);
                        _item.ID = 300000;
                        Database.ConquerItemInformation _iteminfos = new Database.ConquerItemInformation(_item.ID, 0);
                        _item.Durability = _item.MaximDurability = _iteminfos.BaseInformation.Durability;
                        _item.Plus = 0;
                        _item.Effect = Game.Enums.ItemEffect.Horse;
                        _item.SocketProgress = 150 << 8 | 255 << 16;
                        client.Inventory.Add(_item, Game.Enums.ItemUse.CreateAndAdd);
                        break;
                    }
                case 723901:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        Interfaces.IConquerItem _item = new ConquerItem(true);
                        _item.ID = 300000;
                        Database.ConquerItemInformation _iteminfos = new Database.ConquerItemInformation(_item.ID, 0);
                        _item.Durability = _item.MaximDurability = _iteminfos.BaseInformation.Durability;
                        _item.Plus = 0;
                        _item.Effect = Game.Enums.ItemEffect.Horse;
                        _item.SocketProgress = 150 | 255 << 8;
                        client.Inventory.Add(_item, Game.Enums.ItemUse.CreateAndAdd);
                        break;
                    }
                case 723902:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        Interfaces.IConquerItem _item = new ConquerItem(true);
                        _item.ID = 300000;
                        Database.ConquerItemInformation _iteminfos = new Database.ConquerItemInformation(_item.ID, 0);
                        _item.Durability = _item.MaximDurability = _iteminfos.BaseInformation.Durability;
                        _item.Plus = 0;
                        _item.Effect = Game.Enums.ItemEffect.Horse;
                        _item.SocketProgress = 255 | 150 << 16;
                        client.Inventory.Add(_item, Game.Enums.ItemUse.CreateAndAdd);
                        break;
                    }
                #endregion
                #region LifeFruitBasket
                case 723725:
                    {
                        if (client.Inventory.Count <= 31)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(723726, 0, 10);
                        }
                        else
                            client.Send(ServerBase.Constants.FullInventory);
                        break;
                    }
                #endregion
                #region 7StarPouch
                case 725067:
                    {
                        if (client.Inventory.Count <= 35)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(725065, 0, 5);
                        }
                        else
                            client.Send(ServerBase.Constants.FullInventory);
                        break;
                    }
                #endregion
                #region SerenityPouch
                case 725068:
                    {
                        if (client.Inventory.Count <= 35)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(725066, 0, 5);
                        }
                        else
                            client.Send(ServerBase.Constants.FullInventory);
                        break;
                    }
                #endregion
                #region SpeedArrowPack
                case 727000:
                    {
                        if (client.Inventory.Count <= 35)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(1050002, 0, 1);
                        }
                        else
                            client.Send(ServerBase.Constants.FullInventory);
                        break;
                    }
                #endregion
                #region LifeFruit
                case 723726:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.Hitpoints = client.Entity.MaxHitpoints;
                        client.Entity.Mana = client.Entity.MaxMana;
                        break;
                    }
                #endregion
                #region Amrita Box
                case 720010:
                    {
                        if (client.Inventory.Count <= 38)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(1000030, 0, 3);
                        }
                        else
                            client.Send(ServerBase.Constants.FullInventory);
                        break;
                    }
                #endregion
                #region Panacea Box
                case 720011:
                    {
                        if (client.Inventory.Count <= 38)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(1002000, 0, 3);
                        }
                        else
                            client.Send(ServerBase.Constants.FullInventory);
                        break;
                    }
                #endregion
                #region Ginseng Box
                case 720012:
                    {
                        if (client.Inventory.Count <= 38)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(1002010, 0, 3);
                        }
                        else
                            client.Send(ServerBase.Constants.FullInventory);
                        break;
                    }
                #endregion
                #region Vanilla Box
                case 720013:
                    {
                        if (client.Inventory.Count <= 38)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(1002020, 0, 3);
                        }
                        else
                            client.Send(ServerBase.Constants.FullInventory);
                        break;
                    }
                #endregion
                #region RecoveryPill Box
                case 720014:
                    {
                        if (client.Inventory.Count <= 38)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(1001030, 0, 3);
                        }
                        else
                            client.Send(ServerBase.Constants.FullInventory);
                        break;
                    }
                #endregion RecoveryPill
                #region SoulPill Box
                case 720015:
                    {
                        if (client.Inventory.Count <= 38)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(1001040, 0, 3);
                        }
                        else
                            client.Send(ServerBase.Constants.FullInventory);
                        break;
                    }
                #endregion
                #region RefreshingPill Box
                case 720016:
                    {
                        if (client.Inventory.Count <= 38)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(1002030, 0, 3);
                        }
                        else
                            client.Send(ServerBase.Constants.FullInventory);
                        break;
                    }
                #endregion
                #region ChantPill Box
                case 720017:
                    {
                        if (client.Inventory.Count <= 38)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(1002040, 0, 3);
                        }
                        else
                            client.Send(ServerBase.Constants.FullInventory);
                        break;
                    }
                #endregion
                #region Mil.Ginseng Box
                case 721330:
                    {
                        if (client.Inventory.Count <= 38)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(1002050, 0, 3);
                        }
                        else
                            client.Send(ServerBase.Constants.FullInventory);
                        break;
                    }
                #endregion
                #region ExpBall
                case 723700:
                    {
                        if (client.ExpBalls < 10)
                        {
                            if (client.Entity.Level < 137)
                            {
                                client.IncreaseExperience(client.ExpBall, false);
                                client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                                client.ExpBalls++;
                            }
                        }
                        else
                            client.Send(ServerBase.Constants.ExpBallsUsed);
                        break;
                    }
                #endregion
                #region MeteorTearScroll
                case 723711:
                    {
                        if (client.Inventory.Count <= 36)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(1088002, 0, 5);
                        }
                        else
                            client.Send(ServerBase.Constants.FullInventory);
                        break;
                    }
                #endregion

                #region Class1MoneyBag
                case 723713:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.Money += 300000;
                        break;
                    }
                #endregion
                #region Class2MoneyBag
                case 723714:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.Money += 800000;
                        break;
                    }
                #endregion
                #region Class3MoneyBag
                case 723715:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.Money += 1200000;
                        break;
                    }
                #endregion
                #region Class4MoneyBag
                case 723716:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.Money += 1800000;
                        break;
                    }
                #endregion
                #region Class5MoneyBag
                case 723717:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.Money += 5000000;
                        break;
                    }
                #endregion
                #region Class6MoneyBag
                case 723718:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.Money += 20000000;
                        break;
                    }
                #endregion
                #region Class7MoneyBag
                case 723719:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.Money += 25000000;
                        break;
                    }
                #endregion
                #region Class8MoneyBag
                case 723720:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.Money += 80000000;
                        break;
                    }
                #endregion
                #region Class9MoneyBag
                case 723721:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.Money += 100000000;
                        break;
                    }
                #endregion
                #region Class10MoneyBag
                case 723722:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.Money += 300000000;
                        break;
                    }
                #endregion
                #region BeginnerPackL1
                case 723753:
                    {
                        if (client.Entity.Level >= 1)
                        {
                            if (client.Inventory.Count < 33)
                            {
                                client.Entity.Money += 500;
                                client.Entity.ConquerPoints += 10;
                                client.Inventory.Add(1000000, 0, 3);
                                client.Inventory.Add(1001000, 0, 3);
                                client.Inventory.Add(723755, 0, 1);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 7 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 1", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region BeginnerPackL10
                case 723755:
                    {
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 26)
                            {
                                client.Inventory.Add(723700, 0, 10);//ExpBall
                                client.Inventory.Add(723017, 0, 3); //ExpPotion
                                client.Inventory.Add(723767, 0, 1);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 14 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region BeginnerPackL70
                case 723767:
                    {
                        if (client.Entity.Level >= 70)
                        {
                            if (client.Inventory.Count < 36)
                            {
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                client.Entity.ConquerPoints += 20;
                                client.Inventory.Add(1080001, 0, 1); //Emerald
                                client.Inventory.Add(723772, 0, 1);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 7 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 70", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region BeginnerPackL100
                case 723772:
                    {
                        if (client.Entity.Level >= 100)
                        {
                            if (client.Inventory.Count < 28)
                            {
                                client.Inventory.Add(723774, 0, 1);
                                client.Inventory.Add(723017, 0, 10); //ExpPotion
                                if (client.Entity.Class <= 15)
                                    client.Inventory.Add(800010, 0, 1); //Trojan
                                else if (client.Entity.Class <= 25)
                                    client.Inventory.Add(800410, 0, 1); //Warrior
                                else if (client.Entity.Class <= 45)
                                    client.Inventory.Add(800610, 0, 1); //Archer
                                else if (client.Entity.Class <= 55)
                                    client.Inventory.Add(800010, 0, 1); //Ninja
                                else if (client.Entity.Class <= 65)
                                    client.Inventory.Add(800010, 0, 1); //Monk
                                else //Taoist
                                    client.Inventory.Add(800508, 0, 1);

                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);

                            }
                            else
                                client.Send(new Message("You need to make atleast 12 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 100", System.Drawing.Color.Red, Message.TopLeft));
                        break;
                    }
                #endregion
                #region BeginnerPackL110
                case 723774:
                    {
                        if (client.Entity.Level >= 110)
                        {
                            if (client.Inventory.Count < 27)
                            {
                                client.Inventory.Add(723776, 0, 1);
                                client.Inventory.Add(721090, 0, 1);//MoonBox
                                client.Inventory.Add(723017, 0, 10); //ExpPotion
                                if (client.Entity.Class <= 15)
                                    CheckCommand(new Message("@item MythicBlade Super 0 0 0 13 0", System.Drawing.Color.Red, 2001), client);
                                else if (client.Entity.Class <= 25)
                                    CheckCommand(new Message("@item DragonWand Super 0 0 0 13 0", System.Drawing.Color.Red, 2001), client);
                                else if (client.Entity.Class <= 45)
                                    CheckCommand(new Message("@item AncientBow Super 0 0 0 13 0", System.Drawing.Color.Red, 2001), client);
                                else if (client.Entity.Class <= 55)
                                    CheckCommand(new Message("@item FlameKatana Super 0 0 0 13 0", System.Drawing.Color.Red, 2001), client);
                                else if (client.Entity.Class <= 65)
                                    CheckCommand(new Message("@item BeadsOfConsciousness Super 0 0 0 13 0", System.Drawing.Color.Red, 2001), client);
                                else
                                    CheckCommand(new Message("@item ThunBacksword Super 0 0 0 3 0", System.Drawing.Color.Red, 2001), client);
                                client.Entity.ConquerPoints += 30;
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 13 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 110", System.Drawing.Color.Red, Message.TopLeft));
                        break;
                    }
                #endregion
                #region BeginnerPackL120
                case 723776:
                    {
                        if (client.Entity.Level >= 120)
                        {
                            if (client.Inventory.Count < 35)
                            {
                                client.Inventory.Add(1088001, 0, 5); //DragonBall
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 5 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 120", System.Drawing.Color.Red, Message.TopLeft));
                        break;
                    }
                #endregion
                //723755, 723768, 723772  ,723774, 723776

                #region PowerEXPBall
                case 722057:
                    {
                        if (client.ExpBalls < 30)
                        {
                            if (client.Entity.Level < 140)
                            {
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.IncreaseExperience(client.ExpBall, false);
                                client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                                client.ExpBalls++;
                            }
                        }
                        else
                            client.Send(ServerBase.Constants.ExpBallsUsed);
                        break;
                    }
                #endregion
                #region P6SoulPack
                case 729994:
                    {
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 31)
                            {
                                client.Inventory.Add(821031, 0, 1);//+8
                                client.Inventory.Add(820072, 0, 1); //+6
                                client.Inventory.Add(823055, 0, 1); //+6
                                client.Inventory.Add(822053, 0, 1); //+6
                                client.Inventory.Add(824017, 0, 1); //+6
                                client.Inventory.Add(722057, 0, 3); //+6

                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 9 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region P6WeaponPack
                case 729993:
                    {
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 29)
                            {
                                client.Inventory.Add(800000, 0, 2);//blade
                                client.Inventory.Add(800017, 0, 2); //katana
                                client.Inventory.Add(800110, 0, 2); //grim
                                client.Inventory.Add(800722, 0, 2); //holy
                                client.Inventory.Add(800513, 0, 1); //back
                                client.Inventory.Add(800804, 0, 1); //pistol
                                client.Inventory.Add(800809, 0, 1); //repiar

                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 11 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperVioletGemPack
                case 727068:
                    {
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 30)
                            {
                                client.Inventory.Add(700053, 0, 10);//volite

                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 10 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperDragonGemPack
                case 727100:
                    {
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 30)
                            {
                                client.Inventory.Add(700013, 0, 10);//dragon

                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 10 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperMoonGemPack
                case 727069:
                    {
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 30)
                            {
                                client.Inventory.Add(700063, 0, 10);//moon

                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 10 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperKylinGemPack
                case 727062:
                    {
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 30)
                            {
                                client.Inventory.Add(700043, 0, 10);//kylin

                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 10 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperRainbowGemPack
                case 727063:
                    {
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 30)
                            {
                                client.Inventory.Add(700033, 0, 10);//Rb

                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 10 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperFuryGemPack
                case 727064:
                    {
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 30)
                            {
                                client.Inventory.Add(700023, 0, 10);//Fu

                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 10 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperPhoenixGemPack
                case 727066:
                    {
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 30)
                            {
                                client.Inventory.Add(700003, 0, 10);//Fu

                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 10 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperTortoiseGemPack
                case 727067:
                    {
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 30)
                            {
                                client.Inventory.Add(700073, 0, 10);//Fu

                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 10 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperGloryGemPack
                case 727060:
                    {
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 35)
                            {
                                client.Inventory.Add(700123, 0, 5);//Fu

                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 5 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperThunderGemPack
                case 727061:
                    {
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 35)
                            {
                                client.Inventory.Add(700103, 0, 5);//Fu

                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 5 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region TopMoneyBag
                case 723723:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.Money += 500000000;
                        break;
                    }
                #endregion
                #region DrasgonBallScroll
                case 720028:
                    {
                        if (client.Inventory.Count <= 31)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(1088000, 0, 10);
                        }
                        else
                            client.Send(ServerBase.Constants.FullInventory);
                        break;
                    }
                #endregion
                #region DiligenceBook
                case 723340:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.SubClasses.StudyPoints += 5;
                        client.Inventory.Add(723903, 0, 10);
                        client.Send(new Message("Congratulations you got 5 study Points keep going", System.Drawing.Color.Red, Message.study));
                    }
                    break;
                #endregion
                #region StudyBook[Arena/Race]
                case 720774:
                case 720775:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.SubClasses.StudyPoints += 50;
                        client.Send(new Message("Congratulations you got 50 study Points keep going", System.Drawing.Color.Red, Message.study));
                    }
                    break;
                #endregion
                #region MeteorScroll
                case 720027:
                    {
                        if (client.Inventory.Count <= 31)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.Inventory.Add(1088001, 0, 10);
                        }
                        else
                            client.Send(ServerBase.Constants.FullInventory);
                        break;
                    }
                #endregion
                #region DoubleExperiencePotion
                case 723017:
                    {
                        client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                        client.Entity.DoubleExperienceTime = 3600;
                        SyncPacket packet = new SyncPacket
                        {
                            Identifier = client.Entity.UID,
                            Type = PhoenixProject.Network.GamePackets.SyncPacket.SyncType.DoubleExpTimer,
                            Duration = 3600,
                            Multiple = 1 * 100
                        };
                        client.Send((byte[])packet);
                        break;
                    }
                #endregion
                #region DoubleExperiencePotion
                case 728201:
                    {
                        client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                        client.Entity.DoubleExperienceTime = 7200;
                        SyncPacket packet = new SyncPacket
                        {
                            Identifier = client.Entity.UID,
                            Type = PhoenixProject.Network.GamePackets.SyncPacket.SyncType.DoubleExpTimer,
                            Duration = 7200,
                            Multiple = 1 * 200
                        };
                        client.Send((byte[])packet);
                        break;
                    }
                #endregion
                #region NinjaAmulet
                case 723583:
                    {
                        client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                        switch (client.Entity.Body % 10)
                        {
                            case 2:
                            case 4:
                                client.Entity.Body--;
                                break;
                            case 1:
                            case 3:
                                client.Entity.Body++;
                                break;
                        }
                        break;
                    }
                #endregion
                #region PrayingStone(S)
                case 1200000:
                    {
                        uint value = (uint)(3 * 24 * 60 * 60);
                        client.AddBless(value);
                        client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                        client.Entity.Update(Network.GamePackets.Update.OnlineTraining, client.OnlineTrainingPoints, false);
                        break;
                    }
                #endregion
                #region PrayingStone(M)
                case 1200001:
                    {
                        uint value = (uint)(7 * 24 * 60 * 60);
                        client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                        client.AddBless(value);
                        client.Entity.Update(Network.GamePackets.Update.OnlineTraining, client.OnlineTrainingPoints, false);
                        break;
                    }
                #endregion
                #region PrayingStone(L)
                case 1200002:
                    {
                        uint value = (uint)(30 * 24 * 60 * 60);
                        client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                        client.AddBless(value);
                        client.Entity.Update(Network.GamePackets.Update.OnlineTraining, client.OnlineTrainingPoints, false);
                        break;
                    }
                #endregion
                #region PenitenceAmulet
                case 723727:
                case 720128:
                    {
                        if (client.Entity.PKPoints >= 30)
                        {
                            client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            client.Entity.PKPoints -= 30;
                        }
                        break;
                    }
                #endregion
                #region DisguiseAmulet
                case 723724:
                    {
                        int disguise = ServerBase.Kernel.Random.Next(Database.DataHolder.Disguises.Length);
                        ushort selected = Database.DataHolder.Disguises[disguise];

                        client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);

                        bool wasTransformated = client.Entity.Transformed;
                        if (wasTransformated)
                        {
                            client.Entity.Hitpoints = client.Entity.MaxHitpoints;
                            client.Entity.TransformationID = 0;
                            client.Entity.TransformationStamp = Time32.Now;
                        }
                        ushort transformation = selected;
                        client.Entity.TransformationID = transformation;
                        client.Entity.TransformationStamp = Time32.Now;
                        client.Entity.TransformationTime = 110;
                        SpellUse spellUse = new SpellUse(true);
                        spellUse.Attacker = client.Entity.UID;
                        spellUse.SpellID = 1360;
                        spellUse.SpellLevel = 4;
                        spellUse.X = client.Entity.X;
                        spellUse.Y = client.Entity.Y;
                        spellUse.Targets.Add(client.Entity.UID, (uint)0);
                        client.Send(spellUse);
                        client.Entity.TransformationMaxHP = 3000;
                        double maxHP = client.Entity.MaxHitpoints;
                        double HP = client.Entity.Hitpoints;
                        double point = HP / maxHP;

                        client.Entity.Hitpoints = (uint)(client.Entity.TransformationMaxHP * point);
                        client.Entity.Update(Update.MaxHitpoints, client.Entity.TransformationMaxHP, false);
                        break;

                    }
                #endregion
                #region Chi 10
                case 729252:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.ChiPoints += 10;
                        break;
                    }
                #endregion
                #region Chi 500
                case 729242:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.Entity.ChiPoints += 500;
                        break;
                    }
                #endregion
                #region +8StonePack
                case 721222:
                    {
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 38)
                            {
                                client.Inventory.Add(730008, 8, 1);//+8
                                client.Inventory.Add(730006, 6, 1); //+6
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 2 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region ToughDrillPack
                case 721223:
                    {
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 38)
                            {
                                client.Inventory.Add(1200005, 0, 1);//ToughDrill
                                client.Inventory.Add(730003, 3, 1); //+3
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 2 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperWarrior`sArmorPack
                case 721224:
                    {
                        uint itemid = 131069;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperWarrior`sHelmetPack
                case 721225:
                    {
                        uint itemid = 111069;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperTrojan`sArmorPack
                case 721226:
                    {
                        uint itemid = 130069;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperTrojan`sCoronetPack
                case 721227:
                    {
                        uint itemid = 118069;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperNinja`sVestPack
                case 721228:
                    {
                        uint itemid = 135069;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperNinja`sVeilPack
                case 721229:
                    {
                        uint itemid = 112069;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperTaoist`sRobePack
                case 721230:
                    {
                        uint itemid = 134069;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperTaoist`sCapPack
                case 721231:
                    {
                        uint itemid = 114069;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperArcher`sCoatPack
                case 721232:
                    {
                        uint itemid = 133049;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperArcher`sHatPack
                case 721233:
                    {
                        uint itemid = 113049;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperNecklacePack
                case 721234:
                    {
                        uint itemid = 120129;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperRingPack
                case 721235:
                    {
                        uint itemid = 150139;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperTaoist`sBagPack
                case 721236:
                    {
                        uint itemid = 121129;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperTaoist`sBraceletPack
                case 721237:
                    {
                        uint itemid = 152149;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperBootsPack
                case 721238:
                    {
                        uint itemid = 160139;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperBladePack
                case 721239:
                    {
                        uint itemid = 410139;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperSwordPack
                case 721240:
                    {
                        uint itemid = 420139;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperClubPack
                case 721241:
                    {
                        uint itemid = 480139;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperShieldPack
                case 721242:
                    {
                        uint itemid = 900049;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperKatanaPack
                case 721243:
                    {
                        uint itemid = 601139;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperBackswordPack
                case 721244:
                    {
                        uint itemid = 421139;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #region SuperBowPack
                case 721245:
                    {
                        uint itemid = 500129;
                        if (client.Entity.Level >= 10)
                        {
                            if (client.Inventory.Count < 32)
                            {
                                client.Inventory.Add(1200000, 0, 1);//PrayingStone
                                client.Inventory.Add(723700, 0, 1);//ExpBall
                                client.Inventory.Add(723017, 0, 5); //ExpPotion
                                ConquerItem items = new ConquerItem(true);
                                items.ID = itemid;
                                items.Color = PhoenixProject.Game.Enums.Color.White;
                                items.Plus = 5;
                                items.SocketOne = PhoenixProject.Game.Enums.Gem.EmptySocket;
                                items.Durability = items.MaximDurability = PhoenixProject.Database.ConquerItemInformation.BaseInformations[itemid].Durability;
                                client.Inventory.Add(items, PhoenixProject.Game.Enums.ItemUse.CreateAndAdd);
                                client.Inventory.Remove(item, PhoenixProject.Game.Enums.ItemUse.Remove);
                            }
                            else
                                client.Send(new Message("You need to make atleast 8 free spots in your inventory.", System.Drawing.Color.Red, Message.TopLeft));
                        }
                        else
                            client.Send(new Message("You must be atleast level 10 to open the Pack", System.Drawing.Color.Red, Message.TopLeft));

                        break;
                    }
                #endregion
                #endregion
                #region SkillBooks
                case 725000:
                    {
                        if (client.Entity.Spirit >= 20)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.AddSpell(new Spell(true) { ID = 1000 });
                        }
                        else
                        {
                            client.Send(new Message("You need atleast 20 spirit!", System.Drawing.Color.Tan, Message.TopLeft));
                        }
                        break;
                    }
                case 725001:
                    {
                        if (client.Entity.Spirit >= 80)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.AddSpell(new Spell(true) { ID = 1001 });
                        }
                        else
                        {
                            client.Send(new Message("You need atleast 80 spirit!", System.Drawing.Color.Tan, Message.TopLeft));
                        }
                        break;
                    }
                case 725002:
                    {
                        if (client.Entity.Class >= 140 && client.Entity.Class <= 145 && client.Entity.Level >= 90)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.AddSpell(new Spell(true) { ID = 1002 });
                        }
                        break;
                    }
                case 725003:
                    {
                        if (client.Entity.Spirit >= 30)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.AddSpell(new Spell(true) { ID = 1005 });
                        }
                        break;
                    }
                case 725004:
                    {
                        if (client.Entity.Class >= 130 && client.Entity.Class <= 135 || client.Entity.Class >= 140 && client.Entity.Class <= 145 && client.Entity.Level >= 15 || client.Entity.Class == 100 || client.Entity.Class == 101)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.AddSpell(new Spell(true) { ID = 1010 });
                        }
                        break;
                    }
                case 725005:
                    {
                        if (client.Entity.Level >= 40)
                        {
                            if (client.Proficiencies.ContainsKey((ushort)Database.SpellTable.SpellInformations[1045][0].WeaponSubtype))
                                if (client.Proficiencies[(ushort)Database.SpellTable.SpellInformations[1045][0].WeaponSubtype].Level >= 5)
                                {
                                    client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                                    client.AddSpell(new Spell(true) { ID = 1045 });
                                }
                                else
                                {
                                    client.Send(new Message("You need level 5 at blade proficiency!", System.Drawing.Color.Tan, Message.TopLeft));
                                }
                        }
                        break;
                    }
                case 721158:
                    {
                        if (client.Entity.Level >= 40)
                        {
                            if (client.Proficiencies.ContainsKey((ushort)Database.SpellTable.SpellInformations[11005][0].WeaponSubtype))
                                if (client.Proficiencies[(ushort)Database.SpellTable.SpellInformations[11005][0].WeaponSubtype].Level >= 5)
                                {
                                    client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                                    client.AddSpell(new Spell(true) { ID = 11005 });
                                }
                                else
                                {
                                    client.Send(new Message("You need level 5 at Spear proficiency!", System.Drawing.Color.Tan, Message.TopLeft));
                                }
                        }
                        break;
                    }
                case 721157:
                    {
                        if (client.Entity.Level >= 40)
                        {
                            if (client.Proficiencies.ContainsKey((ushort)Database.SpellTable.SpellInformations[11000][0].WeaponSubtype))
                                if (client.Proficiencies[(ushort)Database.SpellTable.SpellInformations[11000][0].WeaponSubtype].Level >= 5)
                                {
                                    client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                                    client.AddSpell(new Spell(true) { ID = 11000 });
                                }
                                else
                                {
                                    client.Send(new Message("You need level 5 at Wand proficiency!", System.Drawing.Color.Tan, Message.TopLeft));
                                }
                        }
                        break;
                    }
                case 725010:
                    {
                        if (client.Entity.Level >= 40)
                        {
                            if (client.Proficiencies.ContainsKey((ushort)Database.SpellTable.SpellInformations[1046][0].WeaponSubtype))
                                if (client.Proficiencies[(ushort)Database.SpellTable.SpellInformations[1046][0].WeaponSubtype].Level >= 5)
                                {
                                    client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                                    client.AddSpell(new Spell(true) { ID = 1046 });
                                }
                                else
                                {
                                    client.Send(new Message("You need level 5 at sword proficiency!", System.Drawing.Color.Tan, Message.TopLeft));
                                }
                        }
                        break;
                    }
                case 725011:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 1250 });
                        break;
                    }
                case 725012:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 1260 });
                        break;
                    }
                case 725013:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 1290 });
                        break;
                    }
                case 725014:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 1300 });
                        break;
                    }
                case 725015:
                    {
                        if (client.Entity.Class >= 130 && client.Entity.Class <= 135)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.AddSpell(new Spell(true) { ID = 1350 });
                        }
                        break;
                    }
                case 725016:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 1360 });
                        break;
                    }
                case 725018:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 1380 });
                        break;
                    }
                case 725019:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 1385 });
                        break;
                    }
                case 725020:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 1390 });
                        break;
                    }
                case 725021:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 1395 });
                        break;
                    }
                case 725022:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 1400 });
                        break;
                    }
                case 725023:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 1405 });
                        break;
                    }
                case 725024:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 1410 });
                        break;
                    }
                case 725025:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 1320 });
                        break;
                    }
                case 725026:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 5010 });
                        break;
                    }
                case 725027:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 5020 });
                        break;
                    }
                case 725028:
                    {
                        if (client.Entity.Class >= 130 && client.Entity.Class <= 135 || client.Entity.Class >= 140 && client.Entity.Class <= 145)
                            client.AddSpell(new Spell(true) { ID = 5001 });
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        break;
                    }
                case 725029:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 5030 });
                        break;
                    }
                case 725030:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 5040 });
                        break;
                    }
                case 725031:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 5050 });
                        break;
                    }
                case 725040:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 7000 });
                        break;
                    }
                case 725041:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 7010 });
                        break;
                    }
                case 725042:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 7020 });
                        break;
                    }
                case 725043:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 7030 });
                        break;
                    }
                case 725044:
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        client.AddSpell(new Spell(true) { ID = 7040 });
                        break;
                    }
                case 1060100:
                    {
                        if (client.Entity.Class >= 140 && client.Entity.Class <= 145 && client.Entity.Level >= 82)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.AddSpell(new Spell(true) { ID = 1160 });
                        }
                        break;
                    }
                case 1060101:
                    {
                        if (client.Entity.Class >= 140 && client.Entity.Class <= 145 && client.Entity.Level >= 84)
                        {
                            client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            client.AddSpell(new Spell(true) { ID = 1165 });
                        }
                        break;
                    }
                #endregion
                #region Refinery Packs
                case 723130:
                case 723131:
                case 723132:
                case 723133:
                case 723134:
                case 723135:
                case 723651:
                case 723652:
                case 723653:
                case 723654:
                case 723655:
                case 723656:
                case 723657:
                case 723658:
                case 723659:
                case 723660:
                case 723661:
                case 723662:
                case 723663:
                case 723664:
                case 723665:
                case 723666:
                case 723667:
                case 723668:
                case 723669:
                case 723670:
                case 723671:
                case 723672:
                case 723673:
                case 723674:
                case 723675:
                case 723676:
                case 723677:
                case 723678:
                case 723679:
                case 723680:
                case 723681:
                case 723682:
                case 723683:
                case 723684:
                case 723685:
                case 723686:
                case 723690:
                case 723691:
                case 723692:
                case 724130:
                case 724131:
                case 724132:
                case 724133:
                case 724134:
                case 724135:
                case 724136:
                case 724137:
                case 724138:
                case 724139:
                case 724140:
                case 724141:
                case 724142:
                case 724143:
                case 724144:
                case 724145:
                case 724146:
                case 724147:
                case 724148:
                case 724149:
                case 724150:
                case 724151:
                case 724152:
                case 724153:
                case 724154:
                case 724155:
                case 724156:
                case 724157:
                case 724158:
                case 724159:
                case 724160:
                case 724161:
                case 724162:
                case 724163:
                case 724164:
                case 724165:
                case 724166:
                case 724167:
                case 724168:
                case 724169:
                case 724170:
                case 724171:
                case 724172:
                case 724173:
                case 724174:
                case 724175:
                case 724176:
                case 724177:
                case 724178:
                case 724179:
                case 724180:
                case 724181:
                case 724182:
                case 724183:
                case 724184:
                case 724185:
                case 724186:
                case 724190:
                case 724191:
                case 724192:
                case 724193:
                case 724194:
                case 724195:
                case 724196:
                case 724197:
                case 724198:
                case 724199:
                case 724200:
                case 724201:
                case 724202:
                case 724203:
                case 724204:
                case 724205:
                case 724207:
                case 724208:
                case 724210:
                case 724211:
                case 724212:
                case 724215:
                case 725055:
                case 725056:
                case 725057:
                case 725058:
                case 725160:
                case 725161:
                case 725162:
                case 725163:
                case 725164:
                case 725165:
                case 725166:
                case 725167:
                case 725168:
                case 725169:
                case 725170:
                case 725171: GainRefineryItem(item, client); break;
                #endregion
                #region FireWorks
                case 720030://firework
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        _String str = new _String(true);
                        str.UID = client.Entity.UID;
                        str.TextsCount = 1;
                        str.Type = _String.Effect;
                        str.Texts.Add("zf2-e290");
                        client.SendScreen(str, true);
                        break;
                    }
                case 720031://EndlessLove
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        _String str = new _String(true);
                        str.UID = client.Entity.UID;
                        str.TextsCount = 1;
                        str.Type = _String.Effect;
                        str.Texts.Add("zf2-e355");
                        client.SendScreen(str, true);
                        break;
                    }
                case 720032://MyWish
                    {
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        _String str = new _String(true);
                        str.UID = client.Entity.UID;
                        str.TextsCount = 1;
                        str.Type = _String.Effect;
                        str.Texts.Add("zf2-e240");
                        client.SendScreen(str, true);
                        break;
                    }
                #endregion
                #region Demon Boxs
                #region 10cps
                case 720650:
                    {
                        Database.MonsterInformation monster = new PhoenixProject.Database.MonsterInformation();
                        // monster.Boss = true;
                        monster.Hitpoints = 33;
                        monster.Level = 10;
                        monster.Mesh = 368;
                        monster.Name = "Demon";
                        monster.MaxAttack = 100;
                        monster.AttackRange = 5;
                        monster.AttackType = 2;
                        monster.AttackSpeed = 1000;
                        monster.ViewRange = 2;
                        monster.MoveSpeed = 500;
                        monster.RunSpeed = 500;
                        monster.MinAttack = 100;
                        Game.Entity entity = new Game.Entity(Game.EntityFlag.Monster, false);
                        entity.MapObjType = Game.MapObjectType.Monster;
                        entity.MonsterInfo = monster;
                        entity.MonsterInfo.Owner = entity;
                        entity.Name = "Demon";
                        entity.MinAttack = monster.MinAttack;
                        entity.MaxAttack = entity.MagicAttack = monster.MaxAttack;
                        entity.Hitpoints = entity.MaxHitpoints = monster.Hitpoints;
                        entity.Body = monster.Mesh;
                        entity.Level = monster.Level;
                        entity.Defence = 100;
                        entity.X = client.Entity.X;
                        entity.Y = client.Entity.Y;
                        entity.EntityFlag = PhoenixProject.Game.EntityFlag.Monster;
                        entity.UID = (uint)ServerBase.Kernel.Random.Next(500000, 500050);
                        entity.MapID = client.Entity.MapID;
                        entity.SendUpdates = true;
                        Network.GamePackets._String stringPacket = new PhoenixProject.Network.GamePackets._String(true);
                        stringPacket.UID = monster.ID;
                        stringPacket.Type = Network.GamePackets._String.Effect;
                        stringPacket.Texts.Add("MBStandard");
                        client.Map.RemoveEntity(entity);
                        client.Map.AddEntity(entity);
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        break;
                    }
                #endregion
                #region 50cps
                case 720651:
                    {
                        Database.MonsterInformation monster = new PhoenixProject.Database.MonsterInformation();
                        // monster.Boss = true;
                        monster.Hitpoints = 33;
                        monster.Level = 20;
                        monster.Mesh = 369;
                        monster.Name = "AncientDemon";
                        monster.MaxAttack = 100;
                        monster.AttackRange = 5;
                        monster.AttackType = 2;
                        monster.AttackSpeed = 1000;
                        monster.ViewRange = 2;
                        monster.MoveSpeed = 500;
                        monster.RunSpeed = 500;
                        monster.MinAttack = 100;
                        Game.Entity entity = new Game.Entity(Game.EntityFlag.Monster, false);
                        entity.MapObjType = Game.MapObjectType.Monster;
                        entity.MonsterInfo = monster;
                        entity.MonsterInfo.Owner = entity;
                        entity.Name = "AncientDemon";
                        entity.MinAttack = monster.MinAttack;
                        entity.MaxAttack = entity.MagicAttack = monster.MaxAttack;
                        entity.Hitpoints = entity.MaxHitpoints = monster.Hitpoints;
                        entity.Body = monster.Mesh;
                        entity.Level = monster.Level;
                        entity.Defence = 100;
                        entity.X = client.Entity.X;
                        entity.Y = client.Entity.Y;
                        entity.EntityFlag = PhoenixProject.Game.EntityFlag.Monster;
                        entity.UID = (uint)ServerBase.Kernel.Random.Next(500060, 500110);
                        entity.MapID = client.Entity.MapID;
                        entity.SendUpdates = true;
                        client.Map.RemoveEntity(entity);
                        Network.GamePackets._String stringPacket = new PhoenixProject.Network.GamePackets._String(true);
                        stringPacket.UID = monster.ID;
                        stringPacket.Type = Network.GamePackets._String.Effect;
                        stringPacket.Texts.Add("MBStandard");
                        client.Map.AddEntity(entity);
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        break;
                    }
                #endregion
                #region 100cps
                case 720652:
                    {
                        Database.MonsterInformation monster = new PhoenixProject.Database.MonsterInformation();
                        // monster.Boss = true;
                        monster.Hitpoints = 33;
                        monster.Level = 30;
                        monster.Mesh = 377;
                        monster.Name = "FloodDemon";
                        monster.MaxAttack = 100;
                        monster.AttackRange = 5;
                        monster.AttackType = 2;
                        monster.AttackSpeed = 1000;
                        monster.ViewRange = 2;
                        monster.MoveSpeed = 500;
                        monster.RunSpeed = 500;
                        monster.MinAttack = 100;
                        Game.Entity entity = new Game.Entity(Game.EntityFlag.Monster, false);
                        entity.MapObjType = Game.MapObjectType.Monster;
                        entity.MonsterInfo = monster;
                        entity.MonsterInfo.Owner = entity;
                        entity.Name = "FloodDemon";
                        entity.MinAttack = monster.MinAttack;
                        entity.MaxAttack = entity.MagicAttack = monster.MaxAttack;
                        entity.Hitpoints = entity.MaxHitpoints = monster.Hitpoints;
                        entity.Body = monster.Mesh;
                        entity.Level = monster.Level;
                        entity.Defence = 100;
                        entity.X = client.Entity.X;
                        entity.Y = client.Entity.Y;
                        entity.EntityFlag = PhoenixProject.Game.EntityFlag.Monster;
                        entity.UID = (uint)ServerBase.Kernel.Random.Next(500120, 500160);
                        entity.MapID = client.Entity.MapID;
                        entity.SendUpdates = true;
                        client.Map.RemoveEntity(entity);
                        Network.GamePackets._String stringPacket = new PhoenixProject.Network.GamePackets._String(true);
                        stringPacket.UID = monster.ID;
                        stringPacket.Type = Network.GamePackets._String.Effect;
                        stringPacket.Texts.Add("MBStandard");
                        client.Map.AddEntity(entity);
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        break;
                    }
                #endregion
                #region 500cps
                case 720671:
                    {
                        Database.MonsterInformation monster = new PhoenixProject.Database.MonsterInformation();
                        // monster.Boss = true;
                        monster.Hitpoints = 33;
                        monster.Level = 40;
                        monster.Mesh = 400;
                        monster.Name = "HeavenDemon";
                        monster.MaxAttack = 100;
                        monster.AttackRange = 5;
                        monster.AttackType = 2;
                        monster.AttackSpeed = 1000;
                        monster.ViewRange = 2;
                        monster.MoveSpeed = 500;
                        monster.RunSpeed = 500;
                        monster.MinAttack = 100;
                        Game.Entity entity = new Game.Entity(Game.EntityFlag.Monster, false);
                        entity.MapObjType = Game.MapObjectType.Monster;
                        entity.MonsterInfo = monster;
                        entity.MonsterInfo.Owner = entity;
                        entity.Name = "HeavenDemon";
                        entity.MinAttack = monster.MinAttack;
                        entity.MaxAttack = entity.MagicAttack = monster.MaxAttack;
                        entity.Hitpoints = entity.MaxHitpoints = monster.Hitpoints;
                        entity.Body = monster.Mesh;
                        entity.Level = monster.Level;
                        entity.Defence = 100;
                        entity.X = client.Entity.X;
                        entity.Y = client.Entity.Y;
                        entity.EntityFlag = PhoenixProject.Game.EntityFlag.Monster;
                        entity.UID = (uint)ServerBase.Kernel.Random.Next(500200, 500250);
                        entity.MapID = client.Entity.MapID;
                        entity.SendUpdates = true;
                        client.Map.RemoveEntity(entity);
                        Network.GamePackets._String stringPacket = new PhoenixProject.Network.GamePackets._String(true);
                        stringPacket.UID = monster.ID;
                        stringPacket.Type = Network.GamePackets._String.Effect;
                        stringPacket.Texts.Add("MBStandard");
                        client.Map.AddEntity(entity);
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        break;
                    }
                #endregion
                #region 1000cps
                case 720672:
                    {
                        Database.MonsterInformation monster = new PhoenixProject.Database.MonsterInformation();
                        // monster.Boss = true;
                        monster.Hitpoints = 33;
                        monster.Level = 50;
                        monster.Mesh = 404;
                        monster.Name = "ChaosDemon";
                        monster.MaxAttack = 100;
                        monster.AttackRange = 5;
                        monster.AttackType = 2;
                        monster.AttackSpeed = 1000;
                        monster.ViewRange = 2;
                        monster.MoveSpeed = 500;
                        monster.RunSpeed = 500;
                        monster.MinAttack = 100;
                        Game.Entity entity = new Game.Entity(Game.EntityFlag.Monster, false);
                        entity.MapObjType = Game.MapObjectType.Monster;
                        entity.MonsterInfo = monster;
                        entity.MonsterInfo.Owner = entity;
                        entity.Name = "ChaosDemon";
                        entity.MinAttack = monster.MinAttack;
                        entity.MaxAttack = entity.MagicAttack = monster.MaxAttack;
                        entity.Hitpoints = entity.MaxHitpoints = monster.Hitpoints;
                        entity.Body = monster.Mesh;
                        entity.Level = monster.Level;
                        entity.Defence = 100;
                        entity.X = client.Entity.X;
                        entity.Y = client.Entity.Y;
                        entity.EntityFlag = PhoenixProject.Game.EntityFlag.Monster;
                        entity.UID = (uint)ServerBase.Kernel.Random.Next(500300, 500350);
                        entity.MapID = client.Entity.MapID;
                        entity.SendUpdates = true;
                        client.Map.RemoveEntity(entity);
                        Network.GamePackets._String stringPacket = new PhoenixProject.Network.GamePackets._String(true);
                        stringPacket.UID = monster.ID;
                        stringPacket.Type = Network.GamePackets._String.Effect;
                        stringPacket.Texts.Add("MBStandard");
                        client.Map.AddEntity(entity);
                        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                        break;
                    }
                #endregion
                #region SwordsMaster
                case 720842:
                    {
                        if (client.Entity.UID == client.Entity.MapID)
                        {
                            if (client.Entity.Quest == 0)
                            {
                                Database.MonsterInformation monster = new PhoenixProject.Database.MonsterInformation();
                                // monster.Boss = true;
                                monster.Hitpoints = 15000000;
                                monster.Level = 140;
                                monster.Mesh = 953;
                                monster.Name = "SwordMaster";
                                monster.MaxAttack = 100;
                                monster.AttackRange = 5;
                                monster.AttackType = 2;
                                monster.SpellID = 9966;
                                monster.AttackSpeed = 5000;
                                monster.ViewRange = 2;
                                monster.MoveSpeed = 500;
                                monster.RunSpeed = 500;
                                monster.MinAttack = 100;
                                Game.Entity entity = new Game.Entity(Game.EntityFlag.Monster, false);
                                entity.MapObjType = Game.MapObjectType.Monster;
                                entity.MonsterInfo = monster;
                                entity.MonsterInfo.Owner = entity;
                                entity.Name = "SwordMaster";
                                entity.MinAttack = monster.MinAttack;
                                entity.MaxAttack = entity.MagicAttack = monster.MaxAttack;
                                entity.Hitpoints = entity.MaxHitpoints = monster.Hitpoints;
                                entity.Body = monster.Mesh;
                                entity.Level = monster.Level;
                                entity.Defence = 10000;
                                entity.X = client.Entity.X;
                                entity.Y = client.Entity.Y;
                                entity.EntityFlag = PhoenixProject.Game.EntityFlag.Monster;
                                entity.UID = (uint)ServerBase.Kernel.Random.Next(600300, 690350);
                                entity.MapID = client.Entity.MapID;
                                entity.SendUpdates = true;
                                client.Map.RemoveEntity(entity);
                                Network.GamePackets._String stringPacket = new PhoenixProject.Network.GamePackets._String(true);
                                stringPacket.UID = monster.ID;
                                stringPacket.Type = Network.GamePackets._String.Effect;
                                stringPacket.Texts.Add("MBStandard");
                                client.Map.AddEntity(entity);
                                client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                                client.Entity.Quest = 1;
                            }
                            else
                            {
                                client.Send(ServerBase.Constants.Swords2);
                            }
                        }
                        else
                        {
                            client.Send(ServerBase.Constants.Swords1);
                        }
                        break;
                    }
                #endregion
                #endregion
                /*#region House
                case 721189://itembox
                    {
                        if (Database.MapsTable.MapInformations[(ushort)client.Entity.UID].Owner == client.Entity.UID)
                        {
                            if (Database.MapsTable.MapInformations[client.Entity.UID].Box == 0)
                            {

                                Game.House.AddBox(client);
                                client.Entity.Teleport(1002, 450, 350);
                                client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
                            }
                            else
                            {
                                Network.GamePackets.NpcReply npc = new Network.GamePackets.NpcReply(6, "Sorry you can only set one itembox in your house!");
                                npc.OptionID = 255;
                                client.Send(npc.ToArray());
                            }
                        }
                        else
                        {
                            Network.GamePackets.NpcReply npc = new Network.GamePackets.NpcReply(6, "Sorry you can only set  itembox in your house lvl 2!");
                            npc.OptionID = 255;
                            client.Send(npc.ToArray());
                        }
                        break;
                    }
                #endregion*/
            }
            client.Entity.UseItem = false;
            client.SpiltStack = false;
            //if (item.StackSize > 1)
            //{
            //    item.StackSize -= 1;
            //    if (client.Inventory.ContainsUID(item.UID))
            //        client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
            //    client.Inventory.Add(item, Game.Enums.ItemUse.CreateAndAdd);
            //    Database.ConquerItemTable.UpdateStack(item);
            //}
        }
        static void Kimoz3_Execute()
        {
            lock (Values)
                    Values = ServerBase.Kernel.GamePool.Values.ToArray();
                Time32 Now = Time32.Now;
                //KimoTime5 = Time32.Now;
                foreach (Client.GameState client in Values)
                {
                    if (client.Socket != null)
                    {
                        if (client.Socket.Connected)
                        {
                            if (client.Entity.HandleTiming)
                            {
                                #region StatusFlagChange_Execute

                                #region Bless
                                if (client.Entity.ContainsFlag(Network.GamePackets.Update.Flags.CastPray))
                                {
                                    if (client.BlessTime <= 358500)
                                        client.BlessTime += 1500;
                                    else
                                        client.BlessTime = 360000;
                                }
                                else if (client.Entity.ContainsFlag(Network.GamePackets.Update.Flags.Praying))
                                {
                                    if (client.PrayLead != null)
                                    {
                                        if (client.PrayLead.Socket != null)
                                        {
                                            if (client.PrayLead.Socket.Connected)
                                            {
                                                if (client.BlessTime <= 359500)
                                                    client.BlessTime += 500;
                                                else
                                                    client.BlessTime = 360000;
                                            }
                                            else
                                                client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.Praying);
                                        }
                                    }
                                    else
                                        client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.Praying);
                                }
                                else
                                {
                                    if (client.BlessTime > 0)
                                    {
                                        if (client.BlessTime >= 500)
                                        {
                                            client.BlessTime -= 500;
                                            client.Entity.Update(Network.GamePackets.Update.LuckyTimeTimer, client.BlessTime, false);
                                        }
                                        else
                                        {
                                            client.BlessTime = 0;
                                            client.Entity.Update(Network.GamePackets.Update.LuckyTimeTimer, client.BlessTime, false);
                                        }
                                    }
                                }

                                #endregion
                                #region Flashing name
                                if (client.Entity.ContainsFlag(Network.GamePackets.Update.Flags.FlashingName))
                                {
                                    if (Now > client.Entity.FlashingNameStamp.AddSeconds(client.Entity.FlashingNameTime))
                                    {
                                        client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.FlashingName);
                                    }
                                }
                                #endregion
                                #region XPList
                                if (!client.Entity.ContainsFlag(Network.GamePackets.Update.Flags.XPList))
                                {
                                    if (Now > client.XPCountStamp.AddSeconds(3))
                                    {
                                        #region Arrows
                                        if (client.Equipment != null)
                                        {
                                            if (!client.Equipment.Free(5))
                                            {
                                                if (Network.PacketHandler.IsArrow(client.Equipment.TryGetItem(5).ID))
                                                {
                                                    Database.ConquerItemTable.UpdateDurabilityItem(client.Equipment.TryGetItem(5));
                                                }
                                            }
                                        }
                                        #endregion
                                        client.XPCountStamp = Now;
                                        client.XPCount++;
                                        if (client.XPCount >= 100)
                                        {
                                            client.Entity.AddFlag(Network.GamePackets.Update.Flags.XPList);
                                            client.XPCount = 0;
                                            client.XPListStamp = Now;
                                        }
                                    }
                                }
                                else
                                {
                                    if (Now > client.XPListStamp.AddSeconds(20))
                                    {
                                        client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.XPList);
                                    }
                                }
                                #endregion
                                #region KOSpell
                                if (client.Entity.OnKOSpell())
                                {
                                    if (client.Entity.OnCyclone())
                                    {
                                        int Seconds = Now.AllSeconds() - client.Entity.CycloneStamp.AddSeconds(client.Entity.CycloneTime).AllSeconds();
                                        if (Seconds >= 1)
                                        {
                                            client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.Cyclone);
                                            if (client.Entity.KOCount > rates.KoCount)
                                            {
                                                rates.KoCount = client.Entity.KOCount;
                                                PhoenixProject.ServerBase.Kernel.SendWorldMessage(new Network.GamePackets.Message("Congratulations," + client.Entity.Name + " has Killed " + client.Entity.KOCount + " monsters with an Xp Skill and he/she is now ranked #1 on KoRank!", System.Drawing.Color.White, Network.GamePackets.Message.Talk), PhoenixProject.ServerBase.Kernel.GamePool.Values);
                                            }
                                            if (client.Entity.KOCount > client.Entity.KoKills)
                                            {
                                                client.Entity.KoKills = client.Entity.KOCount;
                                            }
                                        }
                                    }
                                    if (client.Entity.OnOblivion())
                                    {
                                        if (Now > client.Entity.OblivionStamp.AddSeconds(client.Entity.OblivionTime))
                                        {
                                            client.Entity.RemoveFlag2(Network.GamePackets.Update.Flags2.Oblivion);
                                            if (client.Entity.KOCount > rates.KoCount)
                                            {
                                                rates.KoCount = client.Entity.KOCount;
                                                PhoenixProject.ServerBase.Kernel.SendWorldMessage(new Network.GamePackets.Message("Congratulations," + client.Entity.Name + " has Killed " + client.Entity.KOCount + " monsters with an Xp Skill and he/she is now ranked #1 on KoRank!", System.Drawing.Color.White, Network.GamePackets.Message.Talk), PhoenixProject.ServerBase.Kernel.GamePool.Values);
                                            }
                                            if (client.Entity.KOCount > client.Entity.KoKills)
                                            {
                                                client.Entity.KoKills = client.Entity.KOCount;
                                            }
                                        }
                                    }
                                    if (client.Entity.OnSuperman())
                                    {
                                        int Seconds = Now.AllSeconds() - client.Entity.SupermanStamp.AddSeconds(client.Entity.SupermanTime).AllSeconds();
                                        if (Seconds >= 1)
                                        {
                                            client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.Superman);
                                            if (client.Entity.KOCount > rates.KoCount)
                                            {
                                                rates.KoCount = client.Entity.KOCount;
                                                PhoenixProject.ServerBase.Kernel.SendWorldMessage(new Network.GamePackets.Message("Congratulations," + client.Entity.Name + " has Killed " + client.Entity.KOCount + " monsters with an Xp Skill and he/she is now ranked #1 on KoRank!", System.Drawing.Color.White, Network.GamePackets.Message.Talk), PhoenixProject.ServerBase.Kernel.GamePool.Values);
                                            }
                                            if (client.Entity.KOCount > client.Entity.KoKills)
                                            {
                                                client.Entity.KoKills = client.Entity.KOCount;
                                            }
                                        }
                                    }
                                    if (!client.Entity.OnKOSpell())
                                    {
                                        //Record KO
                                        client.Entity.KOCount = 0;
                                    }
                                }
                                #endregion
                                #region Buffers

                                if (client.Entity.ContainsFlag2(Network.GamePackets.Update.Flags2.WarriorWalk))
                                {
                                    if (Now >= client.Entity.DefensiveStanceStamp.AddSeconds(client.Entity.DefensiveStanceTime))
                                    {
                                        client.Entity.DefensiveStanceTime = 0;
                                        client.Entity.DefensiveStanceIncrease = 0;
                                        client.Entity.RemoveFlag2(Network.GamePackets.Update.Flags2.WarriorWalk);
                                    }
                                }
                                if (client.Entity.ContainsFlag3(Network.GamePackets.Update.Flags3.MagicDefender))
                                {
                                    if (Now >= client.Entity.MagicDefenderStamp.AddSeconds(client.Entity.MagicDefenderTime))
                                    {
                                        client.Entity.MagicDefenderTime = 0;
                                        client.Entity.MagicDefenderIncrease = 0;
                                        client.Entity.RemoveFlag3(Network.GamePackets.Update.Flags3.MagicDefender);
                                        SyncPacket packet = new SyncPacket
                                        {
                                            Identifier = client.Entity.UID,
                                            Count = 2,
                                            Type = PhoenixProject.Network.GamePackets.SyncPacket.SyncType.StatusFlag,
                                            StatusFlag1 = (ulong)client.Entity.StatusFlag,
                                            StatusFlag2 = (ulong)client.Entity.StatusFlag2,
                                            Unknown1 = 0x31,
                                            StatusFlagOffset = 0x80,
                                            Time = 0,
                                            Value = 0,
                                            Level = 0
                                        };
                                        client.Send((byte[])packet);

                                        foreach (var Client in client.MagicDef)
                                        {
                                            if (Client.Entity.ContainsFlag2(Network.GamePackets.Update.Flags2.kimo4))
                                            {
                                                Client.Entity.RemoveFlag2(Network.GamePackets.Update.Flags2.kimo4);
                                            }
                                        }
                                        client.MagicDef.Clear();
                                    }
                                }

                                if (client.Entity.ContainsFlag(Network.GamePackets.Update.Flags.Stigma))
                                {
                                    if (Now >= client.Entity.StigmaStamp.AddSeconds(client.Entity.StigmaTime))
                                    {
                                        client.Entity.StigmaTime = 0;
                                        client.Entity.StigmaIncrease = 0;
                                        client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.Stigma);
                                    }
                                }
                                if (client.Entity.ContainsFlag(Network.GamePackets.Update.Flags.Dodge))
                                {
                                    if (Now >= client.Entity.DodgeStamp.AddSeconds(client.Entity.DodgeTime))
                                    {
                                        client.Entity.DodgeTime = 0;
                                        client.Entity.DodgeIncrease = 0;
                                        client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.Dodge);
                                    }
                                }
                                if (client.Entity.ContainsFlag(Network.GamePackets.Update.Flags.Invisibility))
                                {
                                    if (Now >= client.Entity.InvisibilityStamp.AddSeconds(client.Entity.InvisibilityTime))
                                    {
                                        client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.Invisibility);
                                    }
                                }
                                if (client.Entity.ContainsFlag(Network.GamePackets.Update.Flags.StarOfAccuracy))
                                {
                                    if (client.Entity.StarOfAccuracyTime != 0)
                                    {
                                        if (Now >= client.Entity.StarOfAccuracyStamp.AddSeconds(client.Entity.StarOfAccuracyTime))
                                        {
                                            client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.StarOfAccuracy);
                                        }
                                    }
                                    else
                                    {
                                        if (Now >= client.Entity.AccuracyStamp.AddSeconds(client.Entity.AccuracyTime))
                                        {
                                            client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.StarOfAccuracy);
                                        }
                                    }
                                }
                                if (client.Entity.ContainsFlag(Network.GamePackets.Update.Flags.MagicShield))
                                {
                                    if (client.Entity.MagicShieldTime != 0)
                                    {
                                        if (Now >= client.Entity.MagicShieldStamp.AddSeconds(client.Entity.MagicShieldTime))
                                        {
                                            client.Entity.MagicShieldIncrease = 0;
                                            client.Entity.MagicShieldTime = 0;
                                            client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.MagicShield);
                                        }
                                    }
                                    else
                                    {
                                        if (Now >= client.Entity.ShieldStamp.AddSeconds(client.Entity.ShieldTime))
                                        {
                                            client.Entity.ShieldIncrease = 0;
                                            client.Entity.ShieldTime = 0;
                                            client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.MagicShield);
                                        }
                                    }
                                }
                                #endregion
                                #region Fly
                                if (client.Entity.ContainsFlag(Network.GamePackets.Update.Flags.Fly))
                                {
                                    if (Now >= client.Entity.FlyStamp.AddSeconds(client.Entity.FlyTime))
                                    {
                                        client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.Fly);
                                        client.Entity.FlyTime = 0;
                                    }
                                }
                                #endregion
                                #region PoisonStar
                                if (client.Entity.NoDrugsTime > 0)
                                {
                                    if (Now > client.Entity.NoDrugsStamp.AddSeconds(client.Entity.NoDrugsTime))
                                    {
                                        client.Entity.NoDrugsTime = 0;
                                    }
                                }
                                #endregion
                                #region ToxicFog
                                if (client.Entity.ToxicFogLeft > 0)
                                {
                                    if (Now >= client.Entity.ToxicFogStamp.AddSeconds(2))
                                    {
                                        float Percent = client.Entity.ToxicFogPercent;
                                        //Remove this line if you want it normal
                                        Percent = Math.Min(0.1F, client.Entity.ToxicFogPercent);
                                        client.Entity.ToxicFogLeft--;
                                        client.Entity.ToxicFogStamp = Now;
                                        if (client.Entity.Hitpoints > 1)
                                        {
                                            uint damage = Game.Attacking.Calculate.Percent(client.Entity, Percent);
                                            client.Entity.Hitpoints -= damage;
                                            Network.GamePackets.SpellUse suse = new PhoenixProject.Network.GamePackets.SpellUse(true);
                                            suse.Attacker = client.Entity.UID;
                                            suse.SpellID = 10010;
                                            suse.Targets.Add(client.Entity.UID, damage);
                                            client.SendScreen(suse, true);
                                            if (client.QualifierGroup != null)
                                                client.QualifierGroup.UpdateDamage(ServerBase.Kernel.GamePool[client.ArenaStatistic.PlayWith], damage);
                                        }
                                    }
                                }
                                #endregion
                                if (client.Entity.OnBlackBread())
                                {
                                    //int Seconds = Now.AllSeconds() - client.Entity.BlackBeardStamp.AddSeconds(client.Entity.Blackbeard).AllSeconds();
                                    if (Now > client.Entity.BlackBeardStamp.AddSeconds(client.Entity.Blackbeard))
                                    {
                                        client.Entity.RemoveFlag2(Network.GamePackets.Update.Flags2.BlackBread);
                                    }
                                }
                                if (client.Entity.OnChainBolt())
                                {
                                    //int Seconds = Now.AllSeconds() - client.Entity.BlackBeardStamp.AddSeconds(client.Entity.Blackbeard).AllSeconds();
                                    if (Now > client.Entity.ChainBoltStamp.AddSeconds(client.Entity.ChainBoltTime))
                                    {
                                        client.Entity.RemoveFlag2(Network.GamePackets.Update.Flags2.ChainBoltActive);
                                    }
                                }
                                if (client.Entity.OnCannonBrag())
                                {
                                    // int Seconds = Now.AllSeconds() - client.Entity.CannonBarageStamp.AddSeconds(client.Entity.Cannonbarage).AllSeconds();
                                    if (Now > client.Entity.CannonBarageStamp.AddSeconds(client.Entity.Cannonbarage))
                                    {
                                        client.Entity.RemoveFlag2(Network.GamePackets.Update.Flags2.CannonBraga);
                                    }
                                }
                                #region FatalStrike
                                if (client.Entity.OnFatalStrike())
                                {
                                    if (Now > client.Entity.FatalStrikeStamp.AddSeconds(client.Entity.FatalStrikeTime))
                                    {
                                        client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.FatalStrike);
                                    }
                                }
                                #endregion

                                #region ShurikenVortex
                                if (client.Entity.ContainsFlag(Network.GamePackets.Update.Flags.ShurikenVortex))
                                {
                                    if (Now > client.Entity.ShurikenVortexStamp.AddSeconds(client.Entity.ShurikenVortexTime))
                                    {
                                        client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.ShurikenVortex);
                                    }
                                }
                                #endregion
                                #region Transformations
                                if (client.Entity.Transformed)
                                {
                                    if (Now > client.Entity.TransformationStamp.AddSeconds(client.Entity.TransformationTime))
                                    {
                                        client.Entity.Untransform();
                                    }
                                }
                                #endregion
                                #endregion

                            }
                        }
                    }
                    //else
                    //    client.Disconnect();
                }
                //Thread.Sleep(1000);
        }
        static void PlayerGroundMovment(GroundMovement groundMovement, Client.GameState client)
        {
            client.Entity.Action = PhoenixProject.Game.Enums.ConquerAction.None;
            client.Attackable = true;
            client.Mining = false;

            if (client.Entity.ContainsFlag3(Network.GamePackets.Update.Flags3.MagicDefender))
            {

                client.Entity.MagicDefenderTime = 0;
                client.Entity.MagicDefenderIncrease = 0;
                client.Entity.RemoveFlag3(Network.GamePackets.Update.Flags3.MagicDefender);
                SyncPacket packet = new SyncPacket
                {
                    Identifier = client.Entity.UID,
                    Count = 2,
                    Type = PhoenixProject.Network.GamePackets.SyncPacket.SyncType.StatusFlag,
                    StatusFlag1 = (ulong)client.Entity.StatusFlag,
                    StatusFlag2 = (ulong)client.Entity.StatusFlag2,
                    Unknown1 = 0x31,
                    StatusFlagOffset = 0x80,
                    Time = 0,
                    Value = 0,
                    Level = 0
                };
                client.Entity.Owner.Send((byte[])packet);
                foreach (var Client in client.MagicDef)
                {
                    if (Client.Entity.ContainsFlag2(Update.Flags2.kimo4))
                    {
                        Client.Entity.RemoveFlag2(Update.Flags2.kimo4);
                    }
                }
                client.MagicDef.Clear();
            }
            if (client.Entity.ContainsFlag(Update.Flags.CastPray))
            {
                client.Entity.RemoveFlag(Update.Flags.CastPray);
                foreach (var Client in client.Prayers)
                {
                    if (Client.Entity.ContainsFlag(Update.Flags.Praying))
                    {
                        Client.Entity.RemoveFlag(Update.Flags.Praying);
                    }
                }
                client.Prayers.Clear();
            }
            if (client.Entity.ContainsFlag(Update.Flags.Praying))
            {
                client.Entity.RemoveFlag(Update.Flags.Praying);
                if (client.PrayLead != null)
                    client.PrayLead.Prayers.Remove(client);
                client.PrayLead = null;
            }
            if (client.Entity.AttackPacket != null)
            {
                client.Entity.AttackPacket = null;
            }
            if (client.Entity.ContainsFlag(Update.Flags.Ride))
                client.Entity.Vigor -= 1;
            client.Entity.PX = client.Entity.X;
            client.Entity.PY = client.Entity.Y;

            if ((byte)groundMovement.Direction > 7)
                groundMovement.Direction = (PhoenixProject.Game.Enums.ConquerAngle)((byte)groundMovement.Direction % 8);

            client.Entity.Move(groundMovement.Direction);

            if (groundMovement.GroundMovementType == GroundMovement.TwoCoordonates)
                client.Entity.Move(groundMovement.Direction);

            client.SendScreen(groundMovement, true);
            client.Screen.Reload(groundMovement);
            if (client.Entity.MapID == 1002)
            {
                if (client.Entity.X == 436 && client.Entity.Y == 444)//stig
                {
                    if (!client.Entity.ContainsFlag(Update.Flags.Ghost))
                    {
                        if (client.Entity.EntityFlag == PhoenixProject.Game.EntityFlag.Player && client.Entity.MaxHitpoints != client.Entity.Hitpoints)
                        {
                            SpellUse suse = new SpellUse(true);
                            suse.Attacker = client.Entity.UID;
                            suse.SpellID = 1195;
                            suse.SpellLevel = 0;
                            suse.X = 436;
                            suse.Y = 444;
                            uint Hp = (client.Entity.MaxHitpoints - client.Entity.Hitpoints);
                            client.Entity.Hitpoints = client.Entity.MaxHitpoints;
                            suse.Targets.Add(client.Entity.UID, Hp);
                            client.SendScreen(suse, true);
                            client.Send(new Message("Your HP Now : " + client.Entity.Hitpoints + "!", System.Drawing.Color.Red, Message.Talk));
                        }
                    }
                }

            }
            if (client.Entity.MapID == 1005)
            {
                if (client.Entity.X == 42 && client.Entity.Y == 51)//stig
                {
                    if (!client.Entity.ContainsFlag(Update.Flags.Stigma) && !client.Entity.ContainsFlag(Update.Flags.Ghost))
                    {
                        SpellUse suse = new SpellUse(true);
                        suse.Attacker = client.Entity.UID;
                        suse.SpellID = 1095;
                        suse.SpellLevel = 3;
                        suse.X = 42;
                        suse.Y = 51;
                        suse.Targets.Add(client.Entity.UID, 0);
                        client.Entity.AddFlag(Update.Flags.Stigma);
                        client.Entity.StigmaStamp = Time32.Now;
                        client.Entity.StigmaIncrease = 25;
                        client.Entity.StigmaTime = 20;
                        client.SendScreen(suse, true);
                        if (client.Entity.EntityFlag == PhoenixProject.Game.EntityFlag.Player)
                            client.Send(ServerBase.Constants.Stigma(25, 20));
                    }
                }
                else
                {
                    if (client.Entity.X == 42 && client.Entity.Y == 48)//rev
                    {
                        if (client.Entity.ContainsFlag(Update.Flags.Ghost))
                        {
                            SpellUse suse = new SpellUse(true);
                            suse.Attacker = client.Entity.UID;
                            suse.SpellID = 1050;
                            suse.SpellLevel = 0;
                            suse.X = 42;
                            suse.Y = 48;
                            suse.Targets.Add(client.Entity.UID, 0);
                            client.SendScreen(suse, true);
                            client.Entity.Action = PhoenixProject.Game.Enums.ConquerAction.None;
                            client.ReviveStamp = Time32.Now;
                            client.Attackable = false;
                            client.Entity.TransformationID = 0;
                            client.Entity.RemoveFlag(Update.Flags.Dead);
                            client.Entity.RemoveFlag(Update.Flags.Ghost);
                            client.Entity.Hitpoints = client.Entity.MaxHitpoints;
                            client.Entity.Ressurect();

                        }
                    }

                }
            }
            if (client.Entity.InteractionInProgress)
            {
                if (!client.Entity.InteractionSet)
                {
                    if (ServerBase.Kernel.GamePool.ContainsKey(client.Entity.InteractionWith))
                    {
                        Client.GameState ch = ServerBase.Kernel.GamePool[client.Entity.InteractionWith];
                        if (ch.Entity.InteractionInProgress && ch.Entity.InteractionWith == client.Entity.UID)
                        {
                            if (client.Entity.InteractionX == client.Entity.X && client.Entity.Y == client.Entity.InteractionY)
                            {
                                if (client.Entity.X == ch.Entity.X && client.Entity.Y == ch.Entity.Y)
                                {
                                    Network.GamePackets.Attack atac = new Network.GamePackets.Attack(true);
                                    atac.Attacker = ch.Entity.UID;
                                    atac.Attacked = client.Entity.UID;
                                    atac.X = ch.Entity.X;
                                    atac.Y = ch.Entity.Y;
                                    atac.Damage = client.Entity.InteractionType;
                                    atac.AttackType = 47;
                                    ch.Send(atac);

                                    atac.AttackType = 49;
                                    atac.Attacker = client.Entity.UID;
                                    atac.Attacked = ch.Entity.UID;
                                    client.SendScreen(atac, true);

                                    atac.Attacker = ch.Entity.UID;
                                    atac.Attacked = client.Entity.UID;
                                    client.SendScreen(atac, true);
                                }
                            }
                        }
                    }
                }
                else
                {
                    if (client.Entity.Body == 1003 || client.Entity.Body == 1004)
                    {
                        if (ServerBase.Kernel.GamePool.ContainsKey(client.Entity.InteractionWith))
                        {
                            Client.GameState ch = ServerBase.Kernel.GamePool[client.Entity.InteractionWith];

                            ch.Entity.Facing = groundMovement.Direction;
                            ch.Entity.Move(groundMovement.Direction);
                            Network.GamePackets.Data general = new Network.GamePackets.Data(true);
                            general.UID = ch.Entity.UID;
                            general.wParam1 = ch.Entity.X;
                            general.wParam2 = ch.Entity.Y;
                            general.ID = 0x9c;
                            ch.Send(general.ToArray());
                            ch.Screen.Reload(null);
                        }
                    }
                }
            }
            client.Entity.MapRegion = Region.Region.FindRegion((uint)client.Map.BaseID, client.Entity.X, client.Entity.Y);
        }
        public void TeleportHouse(ulong MapID, ushort X, ushort Y)
        {
            if (EntityFlag == EntityFlag.Player)
            {

                if (!ServerBase.Kernel.Maps.ContainsKey(MapID))
                    return;
                if (Owner.Entity.ContainsFlag3(Network.GamePackets.Update.Flags3.MagicDefender))
                {

                    Owner.Entity.MagicDefenderTime = 0;
                    Owner.Entity.MagicDefenderIncrease = 0;
                    Owner.Entity.RemoveFlag3(Network.GamePackets.Update.Flags3.MagicDefender);
                    UpdateEffects(true);
                    SyncPacket packet = new SyncPacket
                    {
                        Identifier = Owner.Entity.UID,
                        Count = 2,
                        Type = PhoenixProject.Network.GamePackets.SyncPacket.SyncType.StatusFlag,
                        StatusFlag1 = (ulong)Owner.Entity.StatusFlag,
                        StatusFlag2 = (ulong)Owner.Entity.StatusFlag2,
                        Unknown1 = 0x31,
                        StatusFlagOffset = 0x80,
                        Time = 0,
                        Value = 0,
                        Level = 0
                    };
                    Owner.Entity.Owner.Send((byte[])packet);
                    foreach (var Client in Owner.MagicDef)
                    {
                        if (Client.Entity.ContainsFlag2(Network.GamePackets.Update.Flags2.kimo4))
                        {
                            Client.Entity.RemoveFlag2(Network.GamePackets.Update.Flags2.kimo4);
                        }
                    }
                    Owner.MagicDef.Clear();
                }
                if (Owner.Entity.ContainsFlag(Network.GamePackets.Update.Flags.CastPray))
                {
                    Owner.Entity.RemoveFlag(Network.GamePackets.Update.Flags.CastPray);

                    foreach (var Client in Owner.Prayers)
                    {
                        if (Client.Entity.ContainsFlag(Network.GamePackets.Update.Flags.Praying))
                        {
                            Client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.Praying);
                        }
                    }
                    Owner.Prayers.Clear();
                }
                if (EntityFlag == EntityFlag.Player)
                {
                    if (Owner.Companion != null)
                    {
                        Owner.Map.RemoveEntity(Owner.Companion);
                        Data data = new Data(true);
                        data.UID = Owner.Companion.UID;
                        data.ID = Network.GamePackets.Data.RemoveEntity;
                        Owner.Companion.MonsterInfo.SendScreen(data);
                        Owner.Companion = null;
                    }
                }
                if (MapID == this.MapID)
                {
                    Teleport(X, Y);
                    return;
                }
                this.X = X;
                this.Y = Y;
                PX = 0;
                PY = 0;
                this.PreviousMapID = this.MapID;
                this.MapID = MapID;
                Network.GamePackets.Data Data = new Network.GamePackets.Data(true);
                Data.UID = UID;
                Data.ID = Network.GamePackets.Data.Teleport;
                Data.dwParam = (uint)ServerBase.Kernel.Maps[UID].BaseID;
                Data.wParam1 = X;
                Data.wParam2 = Y;
                Owner.Send(Data);
                Owner.Send(new MapStatus() { BaseID = (ushort)Database.MapsTable.MapInformations[Owner.Map.ID].BaseID, ID = (uint)Owner.Map.ID, Status = Database.DMapsTablesss.HouseInfo[Owner.Map.ID].Status, Weather = Database.MapsTable.MapInformations[Owner.Map.ID].Weather });
                Network.GamePackets.Weather weather = new Network.GamePackets.Weather(true);
                weather.WeatherType = (uint)Program.WeatherType;
                weather.Intensity = 100;
                weather.Appearence = 2;
                weather.Direction = 4;
                Owner.Send(weather);
                Owner.Entity.MapRegion = Region.Region.FindRegion((uint)Owner.Map.BaseID, Owner.Entity.X, Owner.Entity.Y);
            }
        }
        public void Teleportxx(ushort X, ushort Y)
        {
            if (EntityFlag == EntityFlag.Player)
            {

                if (!Database.MapsTable.MapInformations.ContainsKey(MapID))
                    return;
                if (Owner.Entity.ContainsFlag3(Network.GamePackets.Update.Flags3.MagicDefender))
                {

                    Owner.Entity.MagicDefenderTime = 0;
                    Owner.Entity.MagicDefenderIncrease = 0;
                    Owner.Entity.RemoveFlag3(Network.GamePackets.Update.Flags3.MagicDefender);
                    UpdateEffects(true);
                    SyncPacket packet = new SyncPacket
                    {
                        Identifier = Owner.Entity.UID,
                        Count = 2,
                        Type = PhoenixProject.Network.GamePackets.SyncPacket.SyncType.StatusFlag,
                        StatusFlag1 = (ulong)Owner.Entity.StatusFlag,
                        StatusFlag2 = (ulong)Owner.Entity.StatusFlag2,
                        Unknown1 = 0x31,
                        StatusFlagOffset = 0x80,
                        Time = 0,
                        Value = 0,
                        Level = 0
                    };
                    Owner.Entity.Owner.Send((byte[])packet);
                    foreach (var Client in Owner.MagicDef)
                    {
                        if (Client.Entity.ContainsFlag2(Network.GamePackets.Update.Flags2.kimo4))
                        {
                            Client.Entity.RemoveFlag2(Network.GamePackets.Update.Flags2.kimo4);
                        }
                    }
                    Owner.MagicDef.Clear();
                }
                if (Owner.Entity.ContainsFlag(Network.GamePackets.Update.Flags.CastPray))
                {
                    Owner.Entity.RemoveFlag(Network.GamePackets.Update.Flags.CastPray);

                    foreach (var Client in Owner.Prayers)
                    {
                        if (Client.Entity.ContainsFlag(Network.GamePackets.Update.Flags.Praying))
                        {
                            Client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.Praying);
                        }
                    }
                    Owner.Prayers.Clear();
                }
                this.X = X;
                this.Y = Y;
                Network.GamePackets.Data Data = new Network.GamePackets.Data(true);
                Data.UID = UID;
                Data.ID = Network.GamePackets.Data.Jump;
                Data.dwParam = (uint)Database.MapsTable.MapInformations[MapID].BaseID;
                Data.wParam1 = X;
                Data.wParam2 = Y;
                Owner.Send(Data);
            }
        }
        public void Teleport(ulong MapID, ulong DynamicID, ushort X, ushort Y)
        {
            if (EntityFlag == EntityFlag.Player)
            {

                if (!Database.DMaps.MapPaths.ContainsKey(MapID))
                {
                    Console.WriteLine(" ss ");
                    return;
                }
                if (Owner.Entity.ContainsFlag3(Network.GamePackets.Update.Flags3.MagicDefender))
                {

                    Owner.Entity.MagicDefenderTime = 0;
                    Owner.Entity.MagicDefenderIncrease = 0;
                    Owner.Entity.RemoveFlag3(Network.GamePackets.Update.Flags3.MagicDefender);
                    UpdateEffects(true);
                    SyncPacket packet = new SyncPacket
                    {
                        Identifier = Owner.Entity.UID,
                        Count = 2,
                        Type = PhoenixProject.Network.GamePackets.SyncPacket.SyncType.StatusFlag,
                        StatusFlag1 = (ulong)Owner.Entity.StatusFlag,
                        StatusFlag2 = (ulong)Owner.Entity.StatusFlag2,
                        Unknown1 = 0x31,
                        StatusFlagOffset = 0x80,
                        Time = 0,
                        Value = 0,
                        Level = 0
                    };
                    Owner.Entity.Owner.Send((byte[])packet);
                    foreach (var Client in Owner.MagicDef)
                    {
                        if (Client.Entity.ContainsFlag2(Network.GamePackets.Update.Flags2.kimo4))
                        {
                            Client.Entity.RemoveFlag2(Network.GamePackets.Update.Flags2.kimo4);
                        }
                    }
                    Owner.MagicDef.Clear();
                }
                if (Owner.Entity.ContainsFlag(Network.GamePackets.Update.Flags.CastPray))
                {
                    Owner.Entity.RemoveFlag(Network.GamePackets.Update.Flags.CastPray);

                    foreach (var Client in Owner.Prayers)
                    {
                        if (Client.Entity.ContainsFlag(Network.GamePackets.Update.Flags.Praying))
                        {
                            Client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.Praying);
                        }
                    }
                    Owner.Prayers.Clear();
                }
                this.PrevX = this.X;
                this.PrevY = this.Y;
                this.X = X;
                this.Y = Y;
                this.PreviousMapID = this.MapID;
                this.MapID = DynamicID;
                Network.GamePackets.Data Data = new Network.GamePackets.Data(true);
                Data.UID = UID;
                Data.ID = Network.GamePackets.Data.Teleport;
                Data.dwParam = (ushort)MapID;
                Data.wParam1 = X;
                Data.wParam2 = Y;
                Owner.Send(Data);
                Owner.Entity.Action = PhoenixProject.Game.Enums.ConquerAction.None;
                Owner.ReviveStamp = Time32.Now;
                Owner.Attackable = false;
                Owner.Send(new MapStatus() { BaseID = (ushort)Database.MapsTable.MapInformations[Owner.Map.ID].BaseID, ID = (uint)Owner.Map.ID, Status = Database.MapsTable.MapInformations[Owner.Map.ID].Status, Weather = Database.MapsTable.MapInformations[Owner.Map.ID].Weather });
                Network.GamePackets.Weather weather = new Network.GamePackets.Weather(true);
                weather.WeatherType = (uint)Program.WeatherType;
                weather.Intensity = 100;
                weather.Appearence = 2;
                weather.Direction = 4;
                Owner.Send(weather);
                Owner.Entity.MapRegion = Region.Region.FindRegion((uint)Owner.Map.BaseID, Owner.Entity.X, Owner.Entity.Y);
            }
        }
        public void Teleport(ulong MapID, ushort X, ushort Y)
        {
            if (EntityFlag == EntityFlag.Player)
            {

                if (Owner.WatchingGroup != null)
                {
                    PhoenixProject.Game.ConquerStructures.Arena.QualifyEngine.DoLeave(Owner);
                }
                if (Owner.QualifierGroup != null)
                {
                    PhoenixProject.Game.ConquerStructures.Arena.QualifyEngine.DoQuit(Owner);
                    //Owner.ArenaStatistic.Status = Network.GamePackets.ArenaStatistic.NotSignedUp;
                }

                if (!Database.MapsTable.MapInformations.ContainsKey(MapID))
                {
                    if (MapID != UID)
                    {

                        return;
                    }
                }
                if (Owner.Entity.ContainsFlag3(Network.GamePackets.Update.Flags3.MagicDefender))
                {

                    Owner.Entity.MagicDefenderTime = 0;
                    Owner.Entity.MagicDefenderIncrease = 0;
                    Owner.Entity.RemoveFlag3(Network.GamePackets.Update.Flags3.MagicDefender);
                    UpdateEffects(true);
                    SyncPacket packet = new SyncPacket
                    {
                        Identifier = Owner.Entity.UID,
                        Count = 2,
                        Type = PhoenixProject.Network.GamePackets.SyncPacket.SyncType.StatusFlag,
                        StatusFlag1 = (ulong)Owner.Entity.StatusFlag,
                        StatusFlag2 = (ulong)Owner.Entity.StatusFlag2,
                        Unknown1 = 0x31,
                        StatusFlagOffset = 0x80,
                        Time = 0,
                        Value = 0,
                        Level = 0
                    };
                    Owner.Entity.Owner.Send((byte[])packet);
                    foreach (var Client in Owner.MagicDef)
                    {
                        if (Client.Entity.ContainsFlag2(Network.GamePackets.Update.Flags2.kimo4))
                        {
                            Client.Entity.RemoveFlag2(Network.GamePackets.Update.Flags2.kimo4);
                        }
                    }
                    Owner.MagicDef.Clear();
                }
                if (Owner.Entity.ContainsFlag(Network.GamePackets.Update.Flags.CastPray))
                {
                    Owner.Entity.RemoveFlag(Network.GamePackets.Update.Flags.CastPray);

                    foreach (var Client in Owner.Prayers)
                    {
                        if (Client.Entity.ContainsFlag(Network.GamePackets.Update.Flags.Praying))
                        {
                            Client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.Praying);
                        }
                    }
                    Owner.Prayers.Clear();
                }

                if (EntityFlag == EntityFlag.Player)
                {
                    if (Owner.Companion != null)
                    {
                        Owner.Map.RemoveEntity(Owner.Companion);
                        Data data = new Data(true);
                        data.UID = Owner.Companion.UID;
                        data.ID = Network.GamePackets.Data.RemoveEntity;
                        Owner.Companion.MonsterInfo.SendScreen(data);
                        Owner.Companion = null;
                    }
                }
                if (MapID == this.MapID)
                {
                    Teleport(X, Y);
                    return;
                }
                this.X = X;
                this.Y = Y;
                this.PreviousMapID = this.MapID;
                this.MapID = MapID;
                Network.GamePackets.Data Data = new Network.GamePackets.Data(true);
                Data.UID = UID;
                Data.ID = Network.GamePackets.Data.Teleport;
                Data.dwParam = (uint)Database.MapsTable.MapInformations[MapID].BaseID;
                Data.wParam1 = X;
                Data.wParam2 = Y;
                Owner.Send(Data);
                Owner.Send(new MapStatus() { BaseID = (ushort)Database.MapsTable.MapInformations[Owner.Map.ID].BaseID, ID = (uint)Owner.Map.ID, Status = Database.MapsTable.MapInformations[Owner.Map.ID].Status, Weather = Database.MapsTable.MapInformations[Owner.Map.ID].Weather });
                Network.GamePackets.Weather weather = new Network.GamePackets.Weather(true);
                weather.WeatherType = (uint)Program.WeatherType;
                weather.Intensity = 100;
                weather.Appearence = 2;
                weather.Direction = 4;
                Owner.Send(weather);
                Owner.Entity.Action = PhoenixProject.Game.Enums.ConquerAction.None;
                Owner.ReviveStamp = Time32.Now;
                Owner.Attackable = false;
                Owner.Entity.MapRegion = Region.Region.FindRegion((uint)Owner.Map.BaseID, Owner.Entity.X, Owner.Entity.Y);
            }
        }
        public static uint Magic(Entity Attacker, Entity Attacked, Database.SpellInformation SInfo, ref Attack Packet)
        {
            if (Attacked.EntityFlag == EntityFlag.Player)
            {
                BlessEffect.Effect(Attacked);
            }
            if (Attacker.EntityFlag == EntityFlag.Player)
            {
                GemEffect.Effect(Attacker);
            }
            Boolean CritImmune = false;
            switch (Attacked.EntityFlag)
            {
                case EntityFlag.Player:
                    {
                        if (Attacker.EntityFlag == EntityFlag.Monster)
                        {
                            if (!Attacked.ContainsFlag(Update.Flags.Stigma) && Attacker.Name == "StigGuard")
                            {
                                Attacked.AddFlag(Update.Flags.Stigma);
                                Attacked.StigmaStamp = Time32.Now;
                                Attacked.StigmaIncrease = 25;
                                Attacked.StigmaTime = (byte)20;
                                if (Attacked.EntityFlag == EntityFlag.Player)
                                    Attacked.Owner.Send(ServerBase.Constants.Stigma(30, 20));
                                return 0;
                            }
                            if (Attacked.ContainsFlag(Update.Flags.Stigma) && Attacker.Name == "StigGuard")
                            {

                                return 0;
                            }
                            if (Attacked.Dead && Attacker.Name == "RevGuard")
                            {
                                Attacked.Owner.Entity.Action = PhoenixProject.Game.Enums.ConquerAction.None;
                                Attacked.Owner.ReviveStamp = Time32.Now;
                                Attacked.Owner.Attackable = false;

                                Attacked.Owner.Entity.TransformationID = 0;
                                Attacked.Owner.Entity.RemoveFlag(Update.Flags.Dead);
                                Attacked.Owner.Entity.RemoveFlag(Update.Flags.Ghost);
                                Attacked.Owner.Entity.Hitpoints = Attacked.Owner.Entity.MaxHitpoints;

                                Attacked.Ressurect();
                                Attacked.Owner.Send(new MapStatus() { BaseID = (ushort)Attacked.Owner.Map.BaseID, ID = (uint)Attacked.Owner.Map.ID, Status = Database.MapsTable.MapInformations[Attacked.Owner.Map.ID].Status, Weather = Database.MapsTable.MapInformations[Attacked.Owner.Map.ID].Weather });
                                //Attacked.Owner.Entity.Teleport(Attacked.Owner.Entity.MapID, Attacked.Owner.Entity.X, Attacked.Owner.Entity.Y);
                                return 0;
                            }
                        }
                        Int32 Damage = 0;
                        Int32 Defence = 0;
                        if (ChanceSuccess((float)Attacked.Immunity / 100f))
                            CritImmune = true;
                        Int32 Fan = 0, Tower = 0;
                        if (Attacker.EntityFlag == EntityFlag.Player)
                            Fan = Attacker.getFan(true);
                        if (Attacked.EntityFlag == EntityFlag.Player)
                            Tower = Attacked.getTower(true);
                        Damage = (int)Attacker.MagicAttack;
                        
                        if (Attacked.EntityFlag == EntityFlag.Player)
                            if (Attacked.ContainsFlag(Network.GamePackets.Update.Flags.ShurikenVortex))
                                return 1;

                        if (Miss(SInfo.Percent))
                            return 0;

                        Defence = (Int32)Attacked.MagicDefence;
                        Defence = (Int32)Attacked.MagicDamageDecrease;

                      
                       
                        if (Attacked.EntityFlag == EntityFlag.Player)
                        {
                            if (Attacked.Reborn == 1)
                                Damage = (Int32)(Damage * 0.69);
                            if (Attacked.Reborn == 2)
                                Damage = (Int32)(Damage * 0.49);
                        }
                        Damage += Fan;
                        if (Attacker.EntityFlag == EntityFlag.Player)
                            Damage += Attacker.MagicDamageIncrease;
                        //UInt32 bpdmage = 0, bpdefence = 0;
                        //if (Attacked.EntityFlag == EntityFlag.Player)
                            //bpdefence = (UInt32)(Attacked.BattlePower * 3.5);
                        //Damage -= (int)bpdefence;
                        //Damage -= Attacked.MagicDamageDecrease;
                        Damage -= Defence;
                        Damage -= Tower;
                        //if (Damage <= 1) Damage = 1;

                        //return (UInt32)Damage;

                        
                        //if (Damage <= 1) Damage = 1;
                        //return (UInt32)Damage;
                        //the new block offers us the behavior of the melee response.

                        if (!CritImmune)
                        {
                            if (ChanceSuccess((float)Attacker.SkillCStrike / 100f))
                            {
                                Packet.Effect1 |= Attack.AttackEffects1.CriticalStrike;
                                Damage = (Int32)Math.Floor((float)Damage * 1.3);
                            }
                        }
                        if (Attacked.EntityFlag == EntityFlag.Player)
                        {
                            if (ChanceSuccess((float)Attacked.Block / 100f))
                            {
                                Packet.Effect1 |= Attack.AttackEffects1.Block;
                                Damage = (Int32)Math.Floor((float)Damage / 2);
                            }
                        }

                        if (Damage <= 0)
                            Damage = 1;
                        Damage = Damage / 3;

                        AutoRespone(Attacker, Attacked, ref Damage);
                        if (ServerBase.Constants.Damage1Map.Contains(Attacker.MapID))
                            Damage = 1;
                        
                        //Console.WriteLine(Damage.ToString() + "       7");
                        if (Attacked.ContainsFlag2(Network.GamePackets.Update.Flags2.AzureShield))
                        {

                            if (Attacked.AzureDamage >= Damage)
                            {
                                // Console.WriteLine("^^^^Damage is " + Damage.ToString() + " Azure is : " + Attacked.AzureDamage.ToString());
                                Attacked.AzureDamage -= Damage;
                                int sec = 60 - (Time32.Now - Attacked.MagicShieldStamp).AllSeconds();
                               // Attacked.Owner.Send(ServerBase.Constants.Shield(Attacked.AzureDamage, sec));
                                SyncPacket packet4 = new SyncPacket
                                {
                                    Identifier = Attacked.UID,
                                    Count = 2,
                                    Type = PhoenixProject.Network.GamePackets.SyncPacket.SyncType.StatusFlag,
                                    StatusFlag1 = (ulong)Attacked.StatusFlag,
                                    StatusFlag2 = (ulong)Attacked.StatusFlag2,
                                    Unknown1 = 0x31,
                                    StatusFlagOffset = 0x5d,
                                    Time = (uint)sec,
                                    Value = (uint)Attacked.AzureDamage,
                                    Level = 4
                                };
                                Attacked.Owner.Send((byte[])packet4);
                                //Console.WriteLine("^^^^Damage is " + Damage.ToString() + " Azure is : " + Attacked.AzureDamage.ToString());
                                return 0;
                            }
                            else
                            {
                                //Console.WriteLine("XXXXDamage is " + Damage.ToString() + " Azure is : " + Attacked.AzureDamage.ToString());
                                Damage -= Attacked.AzureDamage;
                                Attacked.AzureDamage = 0;
                                Attacked.RemoveFlag2(Update.Flags2.AzureShield);
                                SyncPacket packet4 = new SyncPacket
                                {
                                    Identifier = Attacked.UID,
                                    Count = 2,
                                    Type = PhoenixProject.Network.GamePackets.SyncPacket.SyncType.StatusFlag,
                                    StatusFlag1 = (ulong)Attacked.StatusFlag,
                                    StatusFlag2 = (ulong)Attacked.StatusFlag2,
                                    Unknown1 = 0x31,
                                    StatusFlagOffset = 0x5d,
                                    Time = 0,
                                    Value = 0,
                                    Level = 4
                                };
                                Attacked.Owner.Send((byte[])packet4);
                                // Console.WriteLine("XXXXDamage is " + Damage.ToString() + " Azure is : " + Attacked.AzureDamage.ToString());
                                //Console.WriteLine(Damage.ToString() + "       8");
                                return (uint)Damage;

                            }

                        }
                        
                        if (ServerBase.Constants.Damage1Map.Contains(Attacker.MapID))
                            Damage = 1;
                        return (uint)Damage;
                    }
                case EntityFlag.Monster:
                    {
                        Int32 Damage = 0;
                        Int32 Defence = 0;

                        Int32 Fan = 0;
                        if (Attacker.EntityFlag == EntityFlag.Player)
                            Fan = Attacker.getFan(true);

                        if (Miss(SInfo.Percent))
                            return 0;
                        Damage = (int)Attacker.MagicAttack;
                        if (SInfo != null)
                            Damage += SInfo.Power;
                        Defence = Attacked.MonsterInfo.Level * 20;

                        if (Attacked.MonsterInfo != null)
                            if (Attacked.Name == "Guard1")
                                Damage = Damage/30;
                      

                        Damage += Fan;
                        if (Attacker.EntityFlag == EntityFlag.Player)
                            Damage += Attacker.MagicDamageIncrease;

                       

                        Damage *= (int)(2.5);

                        //Damage += (int)bpdamage;
                        Damage -= Defence;
                        if (!CritImmune)
                        {
                            if (ChanceSuccess((float)Attacker.SkillCStrike / 100f))
                            {
                                Packet.Effect1 |= Attack.AttackEffects1.CriticalStrike;
                                Damage = (Int32)Math.Floor((float)Damage * 1.2);
                            }
                        }


                        if (Damage <= 1) Damage = 1;
                        if (ServerBase.Constants.Damage1Map.Contains(Attacker.MapID))
                            Damage = 1;
                        return (UInt32)Damage;
                    }
            }
            return 0;
        }
        public static uint Melee(Entity attacker, Entity attacked, Database.SpellInformation spell, ref Attack Packet)
        {
           
            int Damage = 0;
            Boolean CritImmune = false;
            Boolean canBT = false;
            if (attacker.EntityFlag == EntityFlag.Monster)
                if (attacked.EntityFlag == EntityFlag.Player)
                    if (ServerBase.Kernel.Rate(Math.Min(60, attacked.Dodge + 30)))
                        return 0;
            if (attacker.EntityFlag == EntityFlag.Player)
            {
                GemEffect.Effect(attacker);
            }
            Durability(attacker, attacked, null);

            if (attacked.ContainsFlag(Network.GamePackets.Update.Flags.ShurikenVortex))
                return 1;
            if (!attacker.Transformed)
                Damage = ServerBase.Kernel.Random.Next(Math.Min((int)attacker.MinAttack, (int)attacker.MaxAttack), Math.Max((int)attacker.MinAttack, (int)attacker.MaxAttack) + 1);
            else
                Damage = ServerBase.Kernel.Random.Next((int)attacker.TransformationMinAttack, (int)attacker.TransformationMaxAttack + 1);
            if (attacker.EntityFlag == EntityFlag.Player)
            {
                if (attacker.BattlePower < attacked.BattlePower)
                    canBT = true;
            }
            else canBT = false;
            if (canBT)
            {
                if (canBT)
                {
                    if (ChanceSuccess((float)attacked.Counteraction / 100f))
                        canBT = false;
                }
                if (canBT)
                {
                    if (ChanceSuccess((float)attacker.Breaktrough / 100f) && spell.ID != 1115)
                    {
                        Damage = (Int32)attacker.MaxAttack + 3000;
                        Packet.Effect1 |= Attack.AttackEffects1.Penetration;
                    }
                }
            }
            if (attacker.ContainsFlag(Network.GamePackets.Update.Flags.Stigma))
                if (!attacker.Transformed && Damage > 1)
                    Damage = (int)(Damage * 1.30);

            if (attacked.EntityFlag == EntityFlag.Monster)
            {
                if (attacked.MapID < 1351 || attacked.MapID > 1354)
                    Damage = (int)(Damage * (1 + (GetLevelBonus(attacker.Level, attacked.Level) * 0.08)));
            }
            if (attacker.EntityFlag == EntityFlag.Player)
            {
                if (attacked.EntityFlag == EntityFlag.Monster)
                {
                    if (attacked.MapID < 1351 || attacked.MapID > 1354)
                        if (!attacker.Owner.Equipment.Free(4) && !attacker.Owner.Equipment.Free(5))
                            Damage = (int)(Damage * 1.5);
                }
                if (attacked.EntityFlag == EntityFlag.Monster)
                    if (attacked.MapID < 1351 || attacked.MapID > 1354)
                        Damage = (int)(Damage * AttackMultiplier(attacker, attacked));
                if (attacker.OnSuperman())
                    if (attacked.EntityFlag == EntityFlag.Monster)
                        Damage *= 10;
                  

                if (attacker.OnFatalStrike())
                    if (attacked.EntityFlag == EntityFlag.Monster)
                        Damage *= 5;
            }
            if (!attacked.Transformed)
            {
                if (attacked.ContainsFlag(Network.GamePackets.Update.Flags.MagicShield))
                {
                    if (attacked.ShieldTime > 0)
                        Damage -= 1000;
                    else
                        Damage -= (ushort)(attacked.Defence * attacked.MagicShieldIncrease);
                }
                else
                {
                    Damage -= attacked.Defence;
                }
            }
            else
                Damage -= attacked.TransformationDefence;

            if (ServerBase.Kernel.Rate(5))
            {
                if (attacker.EntityFlag == EntityFlag.Player)
                {
                    if (attacker.Owner.BlessTime > 0)
                    {
                        Damage *= 2;
                        _String str = new _String(true);
                        str.UID = attacker.UID;
                        str.TextsCount = 1;
                        str.Type = _String.Effect;
                        str.Texts.Add("LuckyGuy");
                        attacker.Owner.SendScreen(str, true);
                    }
                }
            }

            if (ServerBase.Kernel.Rate(5))
            {
                if (attacked.EntityFlag == EntityFlag.Player)
                {
                    if (attacked.Owner.BlessTime > 0)
                    {
                        Damage = 1;
                        _String str = new _String(true);
                        str.UID = attacker.UID;
                        str.TextsCount = 1;
                        str.Type = _String.Effect;
                        str.Texts.Add("LuckyGuy");
                        attacked.Owner.SendScreen(str, true);
                    }
                }
            }
            if (spell.ID == 6000 && attacked.EntityFlag == EntityFlag.Monster)
            {
                if (spell.PowerPercent != 0)
                    Damage = (int)(Damage * spell.PowerPercent);
            }
            else if (spell.ID != 6000)
            {
                if (spell.PowerPercent != 0)
                    Damage = (int)(Damage * spell.PowerPercent);
            }

            Damage = RemoveExcessDamage(Damage, attacker, attacked);

            Damage += attacker.PhysicalDamageIncrease;
            Damage -= attacked.PhysicalDamageDecrease;
            if (attacker.EntityFlag == EntityFlag.Player && spell.ID != 1115)
            {
                if (!CritImmune)
                {
                    if (ChanceSuccess((float)attacker.CriticalStrike / 200f) && spell.ID != 1115)
                    {
                        Packet.Effect1 |= Attack.AttackEffects1.CriticalStrike;
                        Damage = (Int32)Math.Floor((float)Damage * 1.2);
                    }
                }
            }
            if (attacked.EntityFlag == EntityFlag.Monster)
            {
                if (Damage >= 700 * attacked.MaxHitpoints)
                    Damage = (int)(700 * attacked.MaxHitpoints);
            }

            //Damage += Damage;
           Damage = (int)(Damage*1.8);//kimoz
            if (spell.ID == 1115 )
                Damage = Damage / 2;
            if (spell.ID == 11110)
                Damage = (int)(Damage / 1.5);

            /*if (spell.ID == 10315 || spell.ID == 11190)
                Damage = Damage / 2;*/
            

            if (Damage <= 0)
                Damage = 1;
           
            AutoRespone(attacker, attacked, ref Damage);
            if (ServerBase.Constants.Damage1Map.Contains(attacker.MapID))
                Damage = 1;
            try
            {
                if (attacked.EntityFlag == EntityFlag.Player && (attacker.BattlePower < attacked.BattlePower))
                {
                    int sub = attacked.BattlePower - attacker.BattlePower;
                    
                    if (sub == 1)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .50);
                    }
                    if (sub == 2)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .49);
                    }
                    if (sub == 3)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .48);
                    }
                    if (sub == 4)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .47);
                    }
                    if (sub == 5)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .46);
                    }
                    if (sub == 6)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .45);
                    }
                    if (sub == 7)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .44);
                    }
                    if (sub == 8)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .43);
                    }
                    if (sub == 9)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .42);
                    }
                    if (sub == 10)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .41);
                    }
                    if (sub == 11)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .40);
                    }
                    if (sub == 12)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .39);
                    }
                    if (sub == 13)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .38);
                    }
                    if (sub == 14)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .37);
                    }
                    if (sub == 15)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .36);
                    }
                    if (sub == 16)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .35);
                    }
                    if (sub == 17)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .34);
                    }
                    if (sub == 18)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .33);
                    }
                    if (sub == 19)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .32);
                    }
                    if (sub == 20)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .31);
                    }
                    if (sub == 21)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .30);
                    }
                    if (sub == 22)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .29);
                    }
                    if (sub == 23)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .28);
                    }
                    if (sub == 24)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .27);
                    }
                    if (sub == 25)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .26);
                    }
                    if (sub == 26)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .25);
                    }
                    if (sub == 27)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .24);
                    }
                    if (sub == 28)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .23);
                    }
                    if (sub == 29)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .22);
                    }
                    if (sub == 30)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .21);
                    }
                    if (sub == 31)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .20);
                    }
                    if (sub == 32)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .19);
                    }
                    if (sub == 33)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .18);
                    }
                    if (sub == 34)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .17);
                    }
                    if (sub == 35)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .16);
                    }
                    if (sub == 36)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .15);
                    }
                    if (sub == 37)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .14);
                    }
                    if (sub == 38)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .13);
                    }
                    if (sub == 39)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .12);
                    }
                    if (sub == 40)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .11);
                    }
                    if (sub == 41)
                    {
                        Damage = (Int32)Math.Floor((float)Damage * .10);
                    }
                    if (sub > 41)
                    {
                        Damage = 1;
                    }
                }
            }
            catch (Exception ex) { Program.SaveException(ex); }
            
            if (attacked.ContainsFlag2(Network.GamePackets.Update.Flags2.AzureShield))
            {

                if (attacked.AzureDamage >= Damage)
                {
                    // Console.WriteLine("^^^^Damage is " + Damage.ToString() + " Azure is : " + attacked.AzureDamage.ToString());
                    attacked.AzureDamage -= Damage;
                    int sec = 60 - (Time32.Now - attacked.MagicShieldStamp).AllSeconds();
                    //attacked.Owner.Send(ServerBase.Constants.Shield(attacked.AzureDamage, sec));
                    SyncPacket packet4 = new SyncPacket
                    {
                        Identifier = attacked.UID,
                        Count = 2,
                        Type = PhoenixProject.Network.GamePackets.SyncPacket.SyncType.StatusFlag,
                        StatusFlag1 = (ulong)attacked.StatusFlag,
                        StatusFlag2 = (ulong)attacked.StatusFlag2,
                        Unknown1 = 0x31,
                        StatusFlagOffset = 0x5d,
                        Time = (uint)sec,
                        Value = (uint)attacked.AzureDamage,
                        Level = 4
                    };
                    attacked.Owner.Send((byte[])packet4);
                    //Console.WriteLine("^^^^Damage is " + Damage.ToString() + " Azure is : " + attacked.AzureDamage.ToString());
                    return 0;
                }
                else
                {
                    // Console.WriteLine("XXXXDamage is " + Damage.ToString() + " Azure is : " + attacked.AzureDamage.ToString());
                    Damage -= attacked.AzureDamage;
                    attacked.AzureDamage = 0;
                    attacked.RemoveFlag2(Update.Flags2.AzureShield);
                    SyncPacket packet4 = new SyncPacket
                    {
                        Identifier = attacked.UID,
                        Count = 2,
                        Type = PhoenixProject.Network.GamePackets.SyncPacket.SyncType.StatusFlag,
                        StatusFlag1 = (ulong)attacked.StatusFlag,
                        StatusFlag2 = (ulong)attacked.StatusFlag2,
                        Unknown1 = 0x31,
                        StatusFlagOffset = 0x5d,
                        Time = (uint)0,
                        Value = (uint)0,
                        Level = 4
                    };
                    attacked.Owner.Send((byte[])packet4);
                    // Console.WriteLine("XXXXDamage is " + Damage.ToString() + " Azure is : " + attacked.AzureDamage.ToString());
                    return (uint)Damage;

                }

            }
            if (ServerBase.Constants.Damage1Map.Contains(attacker.MapID))
                Damage = 1;
            return (uint)Damage;
        }
        private void Execute()
        {
            #region interactions
            if (attack != null)
            {
                switch (attack.AttackType)
                {
                    case (uint)Network.GamePackets.Attack.InteractionRequest:
                        new InteractionRequest(attack, attacker);
                        return;
                    case (uint)Network.GamePackets.Attack.InteractionEffect:
                        new InteractionEffect(attack, attacker);
                        return;

                    case (uint)Network.GamePackets.Attack.InteractionAccept:
                        new InteractionAccept(attack, attacker);
                        return;
                    case (uint)Network.GamePackets.Attack.InteractionRefuse:
                        new InteractionRefuse(attack, attacker);
                        return;
                    case (uint)Network.GamePackets.Attack.InteractionStopEffect:
                        new InteractionStopEffect(attack, attacker);
                        return;
                }
            }
            #endregion
            #region Monster -> Player \ Monster
            if (attack == null)
            {
                if (attacker.EntityFlag != EntityFlag.Monster)
                    return;
                if (attacker.Companion)
                {
                    if (ServerBase.Constants.PKForbiddenMaps.Contains(attacker.MapID))
                        return;
                }
                if (attacked.EntityFlag == EntityFlag.Player)
                {
                    if (!attacked.Owner.Attackable)
                        return;
                    if (attacked.Dead && attacker.MonsterInfo.SpellID != 1050)
                        return;

                    if (attacker.MonsterInfo.SpellID == 0)// from this bracket to the next die delay replce this with urs
                    {
                        attack = new Attack(true);
                        attack.Effect1 = Attack.AttackEffects1.None;
                        uint damage = Calculate.Melee(attacker, attacked, ref attack);
                        attack.Attacker = attacker.UID;
                        attack.Attacked = attacked.UID;
                        attack.AttackType = Attack.Melee;
                        attack.Damage = damage;
                        attack.X = attacked.X;
                        attack.Y = attacked.Y;
                        BlessEffect.Effect(attacked);
                        if (attacked.EntityFlag == EntityFlag.Player)
                        {
                            if (attacked.Action == Enums.ConquerAction.Sit)
                                if (attacked.Stamina > 20)
                                    attacked.Stamina -= 20;
                                else
                                    attacked.Stamina = 0;
                            attacked.Action = Enums.ConquerAction.None;
                            //Console.WriteLine("ssS");
                        }
                        if (attacked.Hitpoints <= damage)
                        {
                            attacked.Owner.SendScreen(attack, true);
                            attacked.Die(attacker);
                        }
                        else
                        {
                            attacked.Hitpoints -= damage;
                            attacked.Owner.SendScreen(attack, true);
                        }
                    }
                    else
                    {
                        SpellUse suse = new SpellUse(true);
                        attack = new Attack(true);
                        attack.Effect1 = Attack.AttackEffects1.None;
                        uint damage = Calculate.Magic(attacker, attacked, attacker.MonsterInfo.SpellID, 0, ref attack);
                        suse.Effect1 = attack.Effect1;
                        if (attacked.EntityFlag == EntityFlag.Player)
                        {
                            if (attacked.Action == Enums.ConquerAction.Sit)
                                if (attacked.Stamina > 20)
                                    attacked.Stamina -= 20;
                                else
                                    attacked.Stamina = 0;
                            attacked.Action = Enums.ConquerAction.None;
                            //Console.WriteLine("ssS");
                        }
                        if (attacked.Hitpoints <= damage)
                        {
                            attacked.Die(attacker);
                        }
                        else
                        {
                            attacked.Hitpoints -= damage;
                        }
                        if (attacker.Companion)
                            attacker.Owner.IncreaseExperience(Math.Min(damage, attacked.Hitpoints), true);

                        suse.Attacker = attacker.UID;
                        suse.SpellID = attacker.MonsterInfo.SpellID;
                        suse.X = attacked.X;
                        suse.Y = attacked.Y;
                        suse.Targets.Add(attacked.UID, damage);
                        attacked.Owner.SendScreen(suse, true);
                    }
                }
                else
                {
                    if (attacker.MonsterInfo.SpellID == 0)
                    {
                        attack = new Attack(true);
                        attack.Effect1 = Attack.AttackEffects1.None;
                        uint damage = Calculate.Melee(attacker, attacked, ref attack);
                        attack.Attacker = attacker.UID;
                        attack.Attacked = attacked.UID;
                        attack.AttackType = Attack.Melee;
                        attack.Damage = damage;
                        attack.X = attacked.X;
                        attack.Y = attacked.Y;
                        attacked.MonsterInfo.SendScreen(attack);
                        if (attacker.Companion)
                            if (damage > attacked.Hitpoints)
                                attacker.Owner.IncreaseExperience(Math.Min(damage, attacked.Hitpoints), true);
                            else
                                attacker.Owner.IncreaseExperience(damage, true);
                        if (attacked.Hitpoints <= damage)
                        {
                            attacked.Die(attacker);
                            attack = new Attack(true);
                            attack.Attacker = attacker.UID;
                            attack.Attacked = attacked.UID;
                            attack.AttackType = Network.GamePackets.Attack.Kill;
                            attack.X = attacked.X;
                            attack.Y = attacked.Y;
                            attacked.MonsterInfo.SendScreen(attack);
                        }
                        else
                        {
                            attacked.Hitpoints -= damage;
                        }
                    }
                    else
                    {
                        SpellUse suse = new SpellUse(true);
                        if (attack != null) attack.Effect1 = Attack.AttackEffects1.None;
                        uint damage = Calculate.Magic(attacker, attacked, attacker.MonsterInfo.SpellID, 0, ref attack);
                        if (attack != null) suse.Effect1 = attack.Effect1;

                        suse.Attacker = attacker.UID;
                        suse.SpellID = attacker.MonsterInfo.SpellID;
                        suse.X = attacked.X;
                        suse.Y = attacked.Y;
                        suse.Targets.Add(attacked.UID, damage);
                        attacked.MonsterInfo.SendScreen(suse);
                        if (attacker.Companion)
                            if (damage > attacked.Hitpoints)
                                attacker.Owner.IncreaseExperience(Math.Min(damage, attacked.Hitpoints), true);
                            else
                                attacker.Owner.IncreaseExperience(damage, true);
                        if (attacked.Hitpoints <= damage)
                        {
                            attacked.Die(attacker);
                            attack = new Attack(true);
                            attack.Attacker = attacker.UID;
                            attack.Attacked = attacked.UID;
                            attack.AttackType = Network.GamePackets.Attack.Kill;
                            attack.X = attacked.X;
                            attack.Y = attacked.Y;
                            attacked.MonsterInfo.SendScreen(attack);
                        }
                        else
                        {
                            attacked.Hitpoints -= damage;
                        }
                    }
                }
            }
            #endregion
            #region Player -> Player \ Monster \ Sob Npc
            else
            {
                #region Merchant
                if (attack.AttackType == Attack.MerchantAccept || attack.AttackType == Attack.MerchantRefuse)
                {

                    attacker.AttackPacket = null;
                    return;
                }
                #endregion
                #region Marriage
                if (attack.AttackType == Attack.MarriageAccept || attack.AttackType == Attack.MarriageRequest)
                {
                    if (attack.AttackType == Attack.MarriageRequest)
                    {
                        Client.GameState Spouse = null;
                        uint takeout = attack.Attacked;
                        if (takeout == attacker.UID)
                            takeout = attack.Attacker;
                        if (ServerBase.Kernel.GamePool.TryGetValue(takeout, out Spouse))
                        {
                            if (attacker.Spouse != "None" || Spouse.Entity.Spouse != "None")
                            {
                                attacker.Owner.Send(new Message("You cannot marry someone that is already married with someone else!", System.Drawing.Color.Black, Message.TopLeft));
                            }
                            else
                            {
                                uint id1 = attacker.Mesh % 10, id2 = Spouse.Entity.Mesh % 10;

                                if (id1 <= 2 && id2 >= 3 || id1 >= 2 && id2 <= 3)
                                {

                                    attack.X = Spouse.Entity.X;
                                    attack.Y = Spouse.Entity.Y;

                                    Spouse.Send(attack);
                                }
                                else
                                {
                                    attacker.Owner.Send(new Message("You cannot marry someone of your gender!", System.Drawing.Color.Black, Message.TopLeft));
                                }
                            }
                        }
                    }
                    else
                    {
                        Client.GameState Spouse = null;
                        if (ServerBase.Kernel.GamePool.TryGetValue(attack.Attacked, out Spouse))
                        {
                            if (attacker.Spouse != "None" || Spouse.Entity.Spouse != "None")
                            {
                                attacker.Owner.Send(new Message("You cannot marry someone that is already married with someone else!", System.Drawing.Color.Black, Message.TopLeft));
                            }
                            else
                            {
                                if (attacker.Mesh % 10 <= 2 && Spouse.Entity.Mesh % 10 >= 3 || attacker.Mesh % 10 >= 3 && Spouse.Entity.Mesh % 10 <= 2)
                                {
                                    Spouse.Entity.Spouse = attacker.Name;
                                    attacker.Spouse = Spouse.Entity.Name;
                                    Message message = null;
                                    if (Spouse.Entity.Mesh % 10 >= 3)
                                        message = new Message("Joy and happiness! " + Spouse.Entity.Name + " and " + attacker.Name + " have joined together in the holy marriage. We wish them a stone house.", System.Drawing.Color.BurlyWood, Message.Center);
                                    else
                                        message = new Message("Joy and happiness! " + attacker.Name + " and " + attacker.Spouse + " have joined together in the holy marriage. We wish them a stone house.", System.Drawing.Color.BurlyWood, Message.Center);

                                    foreach (Client.GameState client in ServerBase.Kernel.GamePool.Values)
                                    {
                                        client.Send(message);
                                    }

                                    Spouse.Entity.Update(_String.Effect, "firework-2love", true);
                                    attacker.Update(_String.Effect, "firework-2love", true);
                                }
                                else
                                {
                                    attacker.Owner.Send(new Message("You cannot marry someone of your gender!", System.Drawing.Color.Black, Message.TopLeft));
                                }
                            }
                        }
                    }
                }
                #endregion
                #region Attacking
                else
                {

                    attacker.Owner.Attackable = true;
                    Entity attacked = null;

                    SobNpcSpawn attackedsob = null;

                    #region Checks
                    if (attack.Attacker != attacker.UID)
                        return;
                    if (attacker.EntityFlag != EntityFlag.Player)
                        return;
                    attacker.RemoveFlag(Update.Flags.Invisibility);

                    bool pass = false;
                    if (attack.AttackType == Attack.Melee)
                    {
                        if (attacker.OnFatalStrike())
                        {
                            if (attack.Attacked < 600000)
                            {
                                pass = true;
                            }
                        }
                    }
                    ushort decrease = 0;
                    if (attacker.OnCyclone())
                        decrease = 1;

                    if (attacker.OnSuperman())
                        decrease = 300;
                    if (!pass)
                    {
                        int milliSeconds = 1000 - attacker.Agility - decrease;
                        if (milliSeconds < 0 || milliSeconds > 5000)
                            milliSeconds = 0;
                        if (Time32.Now < attacker.AttackStamp.AddMilliseconds(milliSeconds))
                            return;
                    }
                    if (attacker.Dead)
                    {
                        if (attacker.AttackPacket != null)
                            attacker.AttackPacket = null;
                        return;
                    }
                    attacker.AttackStamp = Time32.Now;
                    if (attacker.Owner.QualifierGroup != null)
                    {
                        if (Time32.Now < attacker.Owner.QualifierGroup.CreateTime.AddSeconds(12))
                        {
                            return;
                        }
                    }

                restart:

                    #region Extract attack information
                    ushort SpellID = 0, X = 0, Y = 0;
                    uint Target = 0;
                    if (attack.AttackType == Attack.Magic)
                    {
                        if (!attack.Decoded)
                        {

                            #region GetSkillID
                            SpellID = Convert.ToUInt16(((long)attack.ToArray()[24] & 0xFF) | (((long)attack.ToArray()[25] & 0xFF) << 8));
                            SpellID ^= (ushort)0x915d;
                            SpellID ^= (ushort)attacker.UID;
                            SpellID = (ushort)(SpellID << 0x3 | SpellID >> 0xd);
                            SpellID -= 0xeb42;
                            #endregion
                            #region GetCoords
                            X = (ushort)((attack.ToArray()[16] & 0xFF) | ((attack.ToArray()[17] & 0xFF) << 8));
                            X = (ushort)(X ^ (uint)(attacker.UID & 0xffff) ^ 0x2ed6);
                            X = (ushort)(((X << 1) | ((X & 0x8000) >> 15)) & 0xffff);
                            X = (ushort)((X | 0xffff0000) - 0xffff22ee);

                            Y = (ushort)((attack.ToArray()[18] & 0xFF) | ((attack.ToArray()[19] & 0xFF) << 8));
                            Y = (ushort)(Y ^ (uint)(attacker.UID & 0xffff) ^ 0xb99b);
                            Y = (ushort)(((Y << 5) | ((Y & 0xF800) >> 11)) & 0xffff);
                            Y = (ushort)((Y | 0xffff0000) - 0xffff8922);
                            #endregion
                            #region GetTarget
                            Target = ((uint)attack.ToArray()[12] & 0xFF) | (((uint)attack.ToArray()[13] & 0xFF) << 8) | (((uint)attack.ToArray()[14] & 0xFF) << 16) | (((uint)attack.ToArray()[15] & 0xFF) << 24);
                            Target = ((((Target & 0xffffe000) >> 13) | ((Target & 0x1fff) << 19)) ^ 0x5F2D2463 ^ attacker.UID) - 0x746F4AE6;
                            #endregion

                            attack.X = X;
                            attack.Y = Y;
                            attack.Damage = SpellID;
                            attack.Attacked = Target;
                            attack.Decoded = true;

                        }
                        else
                        {
                            X = attack.X;
                            Y = attack.Y;
                            SpellID = (ushort)attack.Damage;
                            Target = attack.Attacked;
                        }
                    }
                    #endregion
                    #endregion

                    if (attacker.ContainsFlag(Update.Flags.Ride) && attacker.Owner.Equipment.TryGetItem(18) == null)
                    {
                        if (attack.AttackType != Attack.Magic)
                            attacker.RemoveFlag(Update.Flags.Ride);
                        else
                            if (!(SpellID == 7003 || SpellID == 7002))
                                attacker.RemoveFlag(Update.Flags.Ride);
                    }
                    if (attacker.ContainsFlag(Update.Flags.CastPray))
                        attacker.RemoveFlag(Update.Flags.CastPray);
                    if (attacker.ContainsFlag(Update.Flags.Praying))
                        attacker.RemoveFlag(Update.Flags.Praying);


                    #region Dash
                    if (SpellID == 1051)
                    {
                        if (ServerBase.Kernel.GetDistance(attack.X, attack.Y, attacker.X, attacker.Y) > 4)
                        {
                            attacker.Owner.Disconnect();
                            return;
                        }
                        attacker.X = attack.X; attacker.Y = attack.Y;
                        ushort x = attacker.X, y = attacker.Y;
                        Game.Map.UpdateCoordonatesForAngle(ref x, ref y, (Enums.ConquerAngle)Target);
                        for (int c = 0; c < attacker.Owner.Screen.Objects.Count; c++)
                        {
                            if (c >= attacker.Owner.Screen.Objects.Count)
                                break;
                            //List<IMapObject> list = new List<IMapObject>();
                            IMapObject obj = attacker.Owner.Screen.Objects[c];
                            if (obj == null)
                                continue;
                            if (obj.X == x && obj.Y == y && (obj.MapObjType == MapObjectType.Monster || obj.MapObjType == MapObjectType.Player))
                            {
                                Entity entity = obj as Entity;
                                if (!entity.Dead)
                                {
                                    Target = obj.UID;
                                    break;
                                }
                            }
                        }
                    }
                    #endregion
                    #region CounterKill
                    if (attack.AttackType == Attack.CounterKillSwitch)
                    {
                        if (attacked != null)
                            if (attacked.ContainsFlag(Update.Flags.Fly))
                            { attacker.AttackPacket = null; return; }
                        if (attacker != null)
                            if (attacker.ContainsFlag(Update.Flags.Fly))
                            { attacker.AttackPacket = null; return; }
                        if (attacker.Owner.Spells.ContainsKey(6003))
                        {
                            if (!attacker.CounterKillSwitch)
                            {
                                if (Time32.Now >= attacker.CounterKillStamp.AddSeconds(30))
                                {
                                    attacker.CounterKillStamp = Time32.Now;
                                    attacker.CounterKillSwitch = true;
                                    Attack m_attack = new Attack(true);
                                    m_attack.Attacked = attacker.UID;
                                    m_attack.Attacker = attacker.UID;
                                    m_attack.AttackType = Attack.CounterKillSwitch;
                                    m_attack.Damage = 1;
                                    m_attack.X = attacker.X;
                                    m_attack.Y = attacker.Y;
                                    m_attack.Send(attacker.Owner);
                                }
                            }
                            else
                            {
                                attacker.CounterKillSwitch = false;
                                Attack m_attack = new Attack(true);
                                m_attack.Attacked = attacker.UID;
                                m_attack.Attacker = attacker.UID;
                                m_attack.AttackType = Attack.CounterKillSwitch;
                                m_attack.Damage = 0;
                                m_attack.X = attacker.X;
                                m_attack.Y = attacker.Y;
                                m_attack.Send(attacker.Owner);
                            }

                            attacker.Owner.IncreaseSpellExperience(100, 6003);
                            attacker.AttackPacket = null;
                        }
                    }
                    #endregion
                    #region Melee
                    else if (attack.AttackType == Attack.Melee)
                    {
                        if (attacker.Owner.Screen.TryGetValue(attack.Attacked, out attacked))
                        {
                            if (!attacker.Owner.AlternateEquipment)
                            {
                                CheckForExtraWeaponPowers(attacker.Owner, attacked);
                            }
                            else
                            {
                                CheckForExtraWeaponPowers2(attacker.Owner, attacked);
                            }
                            if (!CanAttack(attacker, attacked, null, attack.AttackType == Attack.Melee))
                                return;
                            pass = false;
                            if (attacker.OnFatalStrike())
                            {
                                if (attacked.EntityFlag == EntityFlag.Monster)
                                {
                                    pass = true;
                                }
                            }
                            ushort range = attacker.AttackRange;
                            if (attacker.Transformed)
                                range = (ushort)attacker.TransformationAttackRange;
                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= range || pass)
                            {
                                attack.Effect1 = Attack.AttackEffects1.None;
                                uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
                                attack.Damage = damage;
                                if (attacker.OnFatalStrike())
                                {
                                    if (attacked.EntityFlag == EntityFlag.Monster)
                                    {
                                        if (!attacker.Owner.AlternateEquipment)
                                        {
                                            bool can = false;
                                            if (!attacker.Owner.Equipment.Free((byte)ConquerItem.RightWeapon))
                                                if (attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.RightWeapon).ID / 1000 == 601)
                                                    can = true;
                                            if (!attacker.Owner.Equipment.Free((byte)ConquerItem.LeftWeapon))
                                                if (attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.LeftWeapon).ID / 1000 == 601)
                                                    can = true;
                                            if (!attacker.Owner.Equipment.Free((byte)ConquerItem.RightWeapon))
                                                if (attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.RightWeapon).ID / 1000 == 511)
                                                    can = true;
                                            if (!attacker.Owner.Equipment.Free((byte)ConquerItem.LeftWeapon))
                                                if (attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.LeftWeapon).ID / 1000 == 511)
                                                    can = true;
                                            if (!can)
                                                return;
                                            ushort x = attacked.X;
                                            ushort y = attacked.Y;
                                            Map.UpdateCoordonatesForAngle(ref x, ref y, ServerBase.Kernel.GetAngle(attacked.X, attacked.Y, attacker.X, attacker.Y));
                                            attacker.Shift(x, y);
                                            attack.X = x;
                                            attack.Y = y;
                                            attack.AttackType = Attack.FatalStrike;
                                        }
                                        else
                                        {
                                            bool can = false;
                                            if (!attacker.Owner.Equipment.Free((byte)ConquerItem.AltRightHand))
                                                if (attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.AltRightHand).ID / 1000 == 601)
                                                    can = true;
                                            if (!attacker.Owner.Equipment.Free((byte)ConquerItem.AltLeftHand))
                                                if (attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.AltLeftHand).ID / 1000 == 601)
                                                    can = true;
                                            if (!attacker.Owner.Equipment.Free((byte)ConquerItem.AltRightHand))
                                                if (attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.AltRightHand).ID / 1000 == 511)
                                                    can = true;
                                            if (!attacker.Owner.Equipment.Free((byte)ConquerItem.AltLeftHand))
                                                if (attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.AltLeftHand).ID / 1000 == 511)
                                                    can = true;
                                            if (!can)
                                                return;
                                            ushort x = attacked.X;
                                            ushort y = attacked.Y;
                                            Map.UpdateCoordonatesForAngle(ref x, ref y, ServerBase.Kernel.GetAngle(attacked.X, attacked.Y, attacker.X, attacker.Y));
                                            attacker.Shift(x, y);
                                            attack.X = x;
                                            attack.Y = y;
                                            attack.AttackType = Attack.FatalStrike;
                                        }
                                    }
                                }
                                //over:
                                if (!attacker.Owner.AlternateEquipment)
                                {
                                    if (!attacker.Owner.Equipment.Free((byte)ConquerItem.RightWeapon))
                                    {
                                        Interfaces.IConquerItem rightweapon = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.RightWeapon);
                                        ushort wep1subyte = (ushort)(rightweapon.ID / 1000), wep2subyte = 0;
                                        bool wep1bs = false, wep2bs = false;
                                        /*if (wep1subyte == 421)
                                        {
                                            wep1bs = true;
                                            wep1subyte = 420;
                                        }
                                        if (wep1subyte == 511)
                                        {
                                            wep1bs = true;
                                            wep1subyte = 601;
                                        }*/
                                        ushort wep1spellid = 0, wep2spellid = 0;
                                        if (Database.SpellTable.WeaponSpells.ContainsKey(wep1subyte))
                                        {
                                            wep1spellid = Database.SpellTable.WeaponSpells[wep1subyte];
                                        }
                                        /*if (wep1subyte == 601 || wep1subyte == 511)
                                        {
                                            if (Database.SpellTable.WeaponSpells.ContainsKey(11230))
                                            {
                                                wep1spellid = 11230;
                                            }
                                        }*/
                                        Database.SpellInformation wep1spell = null, wep2spell = null;
                                        bool doWep1Spell = false, doWep2Spell = false;
                                        if (attacker.Owner.Spells.ContainsKey(wep1spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep1spellid))
                                        {
                                            wep1spell = Database.SpellTable.SpellInformations[wep1spellid][attacker.Owner.Spells[wep1spellid].Level];
                                            if (wep1spell != null)
                                            {
                                                doWep1Spell = ServerBase.Kernel.Rate(wep1spell.Percent);
                                            }

                                        }

                                        if (!doWep1Spell)
                                        {
                                            if (!attacker.Owner.Equipment.Free((byte)ConquerItem.LeftWeapon))
                                            {
                                                Interfaces.IConquerItem leftweapon = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.LeftWeapon);
                                                wep2subyte = (ushort)(leftweapon.ID / 1000);
                                                /* if (wep2subyte == 421)
                                                 {
                                                     wep2bs = true;
                                                     wep2subyte = 420;
                                                 }
                                                 if (wep2subyte == 511)
                                                 {
                                                     wep2bs = true;
                                                     wep2subyte=601;
                                                 }*/
                                                if (wep2subyte == 900 || leftweapon.ID == 1050002)
                                                {
                                                    return;
                                                }

                                                if (Database.SpellTable.WeaponSpells.ContainsKey(wep2subyte))
                                                {
                                                    wep2spellid = Database.SpellTable.WeaponSpells[wep2subyte];
                                                }

                                                if (attacker.Owner.Spells.ContainsKey(wep2spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep2spellid))
                                                {
                                                    wep2spell = Database.SpellTable.SpellInformations[wep2spellid][attacker.Owner.Spells[wep2spellid].Level];
                                                    if (wep2spell != null)
                                                    {
                                                        doWep2Spell = ServerBase.Kernel.Rate(wep2spell.Percent);
                                                    }

                                                }

                                            }
                                        }

                                        if (!attacker.Transformed)
                                        {
                                            if (doWep1Spell)
                                            {
                                                attack.AttackType = Attack.Magic;
                                                attack.Decoded = true;
                                                attack.X = attacked.X;
                                                attack.Y = attacked.Y;
                                                attack.Attacked = attacked.UID;
                                                attack.Damage = wep1spell.ID;
                                                goto restart;
                                            }
                                            if (doWep2Spell)
                                            {
                                                attack.AttackType = Attack.Magic;
                                                attack.Decoded = true;
                                                attack.X = attacked.X;
                                                attack.Y = attacked.Y;
                                                attack.Attacked = attacked.UID;
                                                attack.Damage = wep2spell.ID;
                                                goto restart;
                                            }
                                            if (wep1bs)
                                                wep1subyte++;
                                            if (attacker.EntityFlag == EntityFlag.Player && attacked.EntityFlag != EntityFlag.Player)
                                                if (damage > attacked.Hitpoints)
                                                {
                                                    attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attacked.Hitpoints), wep1subyte);
                                                    if (wep2subyte != 0)
                                                    {
                                                        if (wep2bs)
                                                            wep2subyte++;
                                                        attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attacked.Hitpoints), wep2subyte);
                                                    }
                                                }
                                                else
                                                {
                                                    attacker.Owner.IncreaseProficiencyExperience(damage, wep1subyte);
                                                    if (wep2subyte != 0)
                                                    {
                                                        if (wep2bs)
                                                            wep2subyte++;
                                                        attacker.Owner.IncreaseProficiencyExperience(damage, wep2subyte);
                                                    }
                                                }
                                        }
                                    }
                                    else
                                    {
                                        if (!attacker.Transformed)
                                        {
                                            if (attacker.EntityFlag == EntityFlag.Player && attacked.EntityFlag != EntityFlag.Player)
                                                if (damage > attacked.Hitpoints)
                                                {
                                                    attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attacked.Hitpoints), 0);
                                                }
                                                else
                                                {
                                                    attacker.Owner.IncreaseProficiencyExperience(damage, 0);
                                                }
                                        }
                                    }
                                }
                                else
                                {
                                    if (!attacker.Owner.Equipment.Free((byte)ConquerItem.AltRightHand))
                                    {
                                        Interfaces.IConquerItem rightweapon = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.AltRightHand);
                                        ushort wep1subyte = (ushort)(rightweapon.ID / 1000), wep2subyte = 0;
                                        bool wep1bs = false, wep2bs = false;
                                        /* if (wep1subyte == 421)
                                         {
                                             wep1bs = true;
                                             wep1subyte = 420;
                                         }
                                         if (wep1subyte == 511)
                                         {
                                             wep1bs = true;
                                             wep1subyte = 601;
                                         }*/

                                        ushort wep1spellid = 0, wep2spellid = 0;
                                        if (Database.SpellTable.WeaponSpells.ContainsKey(wep1subyte))
                                        {
                                            wep1spellid = Database.SpellTable.WeaponSpells[wep1subyte];
                                        }

                                        Database.SpellInformation wep1spell = null, wep2spell = null;
                                        bool doWep1Spell = false, doWep2Spell = false;
                                        if (attacker.Owner.Spells.ContainsKey(wep1spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep1spellid))
                                        {
                                            wep1spell = Database.SpellTable.SpellInformations[wep1spellid][attacker.Owner.Spells[wep1spellid].Level];
                                            doWep1Spell = ServerBase.Kernel.Rate(wep1spell.Percent);

                                        }

                                        if (!doWep1Spell)
                                        {
                                            if (!attacker.Owner.Equipment.Free((byte)ConquerItem.AltLeftHand))
                                            {
                                                Interfaces.IConquerItem leftweapon = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.AltLeftHand);
                                                wep2subyte = (ushort)(leftweapon.ID / 1000);
                                                /* if (wep2subyte == 421)
                                                 {
                                                     wep2bs = true;
                                                     wep2subyte = 420;
                                                 }
                                                 if (wep2subyte == 511)
                                                 {
                                                     wep2bs = true;
                                                     wep2subyte = 601;
                                                 }*/
                                                if (wep2subyte == 900 || leftweapon.ID == 1050002)
                                                {
                                                    return;
                                                }
                                                if (Database.SpellTable.WeaponSpells.ContainsKey(wep2subyte))
                                                {
                                                    wep2spellid = Database.SpellTable.WeaponSpells[wep2subyte];
                                                }

                                                if (attacker.Owner.Spells.ContainsKey(wep2spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep2spellid))
                                                {
                                                    wep2spell = Database.SpellTable.SpellInformations[wep2spellid][attacker.Owner.Spells[wep2spellid].Level];
                                                    doWep2Spell = ServerBase.Kernel.Rate(wep2spell.Percent);

                                                }

                                            }
                                        }

                                        if (!attacker.Transformed)
                                        {
                                            if (doWep1Spell)
                                            {
                                                attack.AttackType = Attack.Magic;
                                                attack.Decoded = true;
                                                attack.X = attacked.X;
                                                attack.Y = attacked.Y;
                                                attack.Attacked = attacked.UID;
                                                attack.Damage = wep1spell.ID;
                                                goto restart;
                                            }
                                            if (doWep2Spell)
                                            {
                                                attack.AttackType = Attack.Magic;
                                                attack.Decoded = true;
                                                attack.X = attacked.X;
                                                attack.Y = attacked.Y;
                                                attack.Attacked = attacked.UID;
                                                attack.Damage = wep2spell.ID;
                                                goto restart;
                                            }
                                            if (wep1bs)
                                                wep1subyte++;
                                            if (attacker.EntityFlag == EntityFlag.Player && attacked.EntityFlag != EntityFlag.Player)
                                                if (damage > attacked.Hitpoints)
                                                {
                                                    attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attacked.Hitpoints), wep1subyte);
                                                    if (wep2subyte != 0)
                                                    {
                                                        if (wep2bs)
                                                            wep2subyte++;
                                                        attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attacked.Hitpoints), wep2subyte);
                                                    }
                                                }
                                                else
                                                {
                                                    attacker.Owner.IncreaseProficiencyExperience(damage, wep1subyte);
                                                    if (wep2subyte != 0)
                                                    {
                                                        if (wep2bs)
                                                            wep2subyte++;
                                                        attacker.Owner.IncreaseProficiencyExperience(damage, wep2subyte);
                                                    }
                                                }
                                        }
                                    }
                                    else
                                    {
                                        if (!attacker.Transformed)
                                        {
                                            if (attacker.EntityFlag == EntityFlag.Player && attacked.EntityFlag != EntityFlag.Player)
                                                if (damage > attacked.Hitpoints)
                                                {
                                                    attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attacked.Hitpoints), 0);
                                                }
                                                else
                                                {
                                                    attacker.Owner.IncreaseProficiencyExperience(damage, 0);
                                                }
                                        }
                                    }
                                }
                                ReceiveAttack(attacker, attacked, attack, damage, null);
                                attack.AttackType = Attack.Melee;
                            }
                            else
                            {
                                attacker.AttackPacket = null;
                            }
                        }
                        else if (attacker.Owner.Screen.TryGetSob(attack.Attacked, out attackedsob))
                        {
                            // Console.WriteLine("Ss");
                            if (CanAttack(attacker, attackedsob, null))
                            {
                                ushort range = attacker.AttackRange;
                                if (attacker.Transformed)
                                    range = (ushort)attacker.TransformationAttackRange;
                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= range)
                                {
                                    attack.Effect1 = Attack.AttackEffects1.None;
                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);

                                    if (!attacker.Owner.AlternateEquipment)
                                    {
                                        if (!attacker.Owner.Equipment.Free((byte)ConquerItem.RightWeapon))
                                        {
                                            Interfaces.IConquerItem rightweapon = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.RightWeapon);
                                            ushort wep1subyte = (ushort)(rightweapon.ID / 1000), wep2subyte = 0;
                                            bool wep1bs = false, wep2bs = false;
                                            /* if (wep1subyte == 421)
                                             {
                                                 wep1bs = true;
                                                 wep1subyte=420;
                                             }
                                             if (wep1subyte == 511)
                                             {
                                                 wep1bs = true;
                                                 wep1subyte=601;
                                             }*/
                                            ushort wep1spellid = 0, wep2spellid = 0;
                                            if (Database.SpellTable.WeaponSpells.ContainsKey(wep1subyte))
                                                wep1spellid = Database.SpellTable.WeaponSpells[wep1subyte];
                                            Database.SpellInformation wep1spell = null, wep2spell = null;
                                            bool doWep1Spell = false, doWep2Spell = false;
                                            if (attacker.Owner.Spells.ContainsKey(wep1spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep1spellid))
                                            {
                                                wep1spell = Database.SpellTable.SpellInformations[wep1spellid][attacker.Owner.Spells[wep1spellid].Level];
                                                doWep1Spell = ServerBase.Kernel.Rate(wep1spell.Percent);
                                            }
                                            if (!doWep1Spell)
                                            {
                                                if (!attacker.Owner.Equipment.Free((byte)ConquerItem.LeftWeapon))
                                                {
                                                    Interfaces.IConquerItem leftweapon = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.LeftWeapon);
                                                    wep2subyte = (ushort)(leftweapon.ID / 1000);
                                                    /* if (wep2subyte == 421)
                                                     {
                                                         wep2bs = true;
                                                         wep2subyte = 420;
                                                     }
                                                     if (wep2subyte == 511)
                                                     {
                                                         wep2bs = true;
                                                         wep2subyte = 601;
                                                     }*/
                                                    if (Database.SpellTable.WeaponSpells.ContainsKey(wep2subyte))
                                                        wep2spellid = Database.SpellTable.WeaponSpells[wep2subyte];
                                                    if (attacker.Owner.Spells.ContainsKey(wep2spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep2spellid))
                                                    {
                                                        wep2spell = Database.SpellTable.SpellInformations[wep2spellid][attacker.Owner.Spells[wep2spellid].Level];
                                                        doWep2Spell = ServerBase.Kernel.Rate(wep2spell.Percent);
                                                    }
                                                }
                                            }

                                            if (!attacker.Transformed)
                                            {

                                                if (doWep1Spell)
                                                {
                                                    attack.AttackType = Attack.Magic;
                                                    attack.Decoded = true;
                                                    attack.X = attackedsob.X;
                                                    attack.Y = attackedsob.Y;
                                                    attack.Attacked = attackedsob.UID;
                                                    attack.Damage = wep1spell.ID;
                                                    goto restart;
                                                }
                                                if (doWep2Spell)
                                                {
                                                    attack.AttackType = Attack.Magic;
                                                    attack.Decoded = true;
                                                    attack.X = attackedsob.X;
                                                    attack.Y = attackedsob.Y;
                                                    attack.Attacked = attackedsob.UID;
                                                    attack.Damage = wep2spell.ID;
                                                    goto restart;
                                                }
                                                if (attacker.MapID == 1039)
                                                {
                                                    /* if (wep1bs)
                                                         wep1subyte++;*/
                                                    if (attacker.EntityFlag == EntityFlag.Player)
                                                        if (damage > attackedsob.Hitpoints)
                                                        {
                                                            attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attackedsob.Hitpoints), wep1subyte);
                                                            if (wep2subyte != 0)
                                                            {
                                                                /* if (wep2bs)
                                                                     wep2subyte++;*/
                                                                attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attackedsob.Hitpoints), wep2subyte);
                                                            }
                                                        }
                                                        else
                                                        {
                                                            attacker.Owner.IncreaseProficiencyExperience(damage, wep1subyte);
                                                            if (wep2subyte != 0)
                                                            {
                                                                /*if (wep2bs)
                                                                    wep2subyte++;*/
                                                                attacker.Owner.IncreaseProficiencyExperience(damage, wep2subyte);
                                                            }
                                                        }
                                                }
                                            }
                                        }
                                    }
                                    else
                                    {
                                        if (!attacker.Owner.Equipment.Free((byte)ConquerItem.AltRightHand))
                                        {
                                            Interfaces.IConquerItem rightweapon = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.AltRightHand);
                                            ushort wep1subyte = (ushort)(rightweapon.ID / 1000), wep2subyte = 0;
                                            bool wep1bs = false, wep2bs = false;
                                            /*if (wep1subyte == 421)
                                            {
                                                wep1bs = true;
                                                wep1subyte = 420;
                                            }
                                            if (wep1subyte == 511)
                                            {
                                                wep1bs = true;
                                                wep1subyte = 601;
                                            }*/
                                            ushort wep1spellid = 0, wep2spellid = 0;
                                            if (Database.SpellTable.WeaponSpells.ContainsKey(wep1subyte))
                                                wep1spellid = Database.SpellTable.WeaponSpells[wep1subyte];
                                            Database.SpellInformation wep1spell = null, wep2spell = null;
                                            bool doWep1Spell = false, doWep2Spell = false;
                                            if (attacker.Owner.Spells.ContainsKey(wep1spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep1spellid))
                                            {
                                                wep1spell = Database.SpellTable.SpellInformations[wep1spellid][attacker.Owner.Spells[wep1spellid].Level];
                                                doWep1Spell = ServerBase.Kernel.Rate(wep1spell.Percent);
                                            }
                                            if (!doWep1Spell)
                                            {
                                                if (!attacker.Owner.Equipment.Free((byte)ConquerItem.AltLeftHand))
                                                {
                                                    Interfaces.IConquerItem leftweapon = attacker.Owner.Equipment.TryGetItem((byte)ConquerItem.AltLeftHand);
                                                    wep2subyte = (ushort)(leftweapon.ID / 1000);
                                                    /* if (wep2subyte == 421)
                                                     {
                                                         wep2bs = true;
                                                         wep2subyte = 420;
                                                     }
                                                     if (wep2subyte == 511)
                                                     {
                                                         wep2bs = true;
                                                         wep2subyte = 601;
                                                     }*/
                                                    if (Database.SpellTable.WeaponSpells.ContainsKey(wep2subyte))
                                                        wep2spellid = Database.SpellTable.WeaponSpells[wep2subyte];
                                                    if (attacker.Owner.Spells.ContainsKey(wep2spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep2spellid))
                                                    {
                                                        wep2spell = Database.SpellTable.SpellInformations[wep2spellid][attacker.Owner.Spells[wep2spellid].Level];
                                                        doWep2Spell = ServerBase.Kernel.Rate(wep2spell.Percent);
                                                    }
                                                }
                                            }

                                            if (!attacker.Transformed)
                                            {
                                                if (doWep1Spell)
                                                {
                                                    attack.AttackType = Attack.Magic;
                                                    attack.Decoded = true;
                                                    attack.X = attackedsob.X;
                                                    attack.Y = attackedsob.Y;
                                                    attack.Attacked = attackedsob.UID;
                                                    attack.Damage = wep1spell.ID;
                                                    goto restart;
                                                }
                                                if (doWep2Spell)
                                                {
                                                    attack.AttackType = Attack.Magic;
                                                    attack.Decoded = true;
                                                    attack.X = attackedsob.X;
                                                    attack.Y = attackedsob.Y;
                                                    attack.Attacked = attackedsob.UID;
                                                    attack.Damage = wep2spell.ID;
                                                    goto restart;
                                                }
                                                if (attacker.MapID == 1039)
                                                {
                                                    if (wep1bs)
                                                        wep1subyte++;
                                                    if (attacker.EntityFlag == EntityFlag.Player)
                                                        if (damage > attackedsob.Hitpoints)
                                                        {
                                                            attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attackedsob.Hitpoints), wep1subyte);
                                                            if (wep2subyte != 0)
                                                            {
                                                                if (wep2bs)
                                                                    wep2subyte++;
                                                                attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attackedsob.Hitpoints), wep2subyte);
                                                            }
                                                        }
                                                        else
                                                        {
                                                            attacker.Owner.IncreaseProficiencyExperience(damage, wep1subyte);
                                                            if (wep2subyte != 0)
                                                            {
                                                                if (wep2bs)
                                                                    wep2subyte++;
                                                                attacker.Owner.IncreaseProficiencyExperience(damage, wep2subyte);
                                                            }
                                                        }
                                                }
                                            }
                                        }
                                    }
                                    attack.Damage = damage;
                                    ReceiveAttack(attacker, attackedsob, attack, damage, null);
                                }
                                else
                                {
                                    attacker.AttackPacket = null;
                                }
                            }
                        }
                        else
                        {
                            attacker.AttackPacket = null;
                        }
                    }
                    #endregion
                    #region Ranged
                    else if (attack.AttackType == Attack.Ranged)
                    {

                        if (attacker.Owner.Screen.TryGetValue(attack.Attacked, out attacked))
                        {
                            if (!attacker.Owner.AlternateEquipment)
                            {
                                CheckForExtraWeaponPowers(attacker.Owner, attacked);
                            }
                            else
                            {
                                CheckForExtraWeaponPowers2(attacker.Owner, attacked);
                            }
                            if (attacker.Owner.Equipment.TryGetItem(ConquerItem.LeftWeapon) == null)
                                return;
                            if (!CanAttack(attacker, attacked, null, attack.AttackType == Attack.Melee))
                                return;
                            if (!attacker.Owner.AlternateEquipment)
                            {
                                if (!attacker.Owner.Equipment.Free((byte)ConquerItem.LeftWeapon))
                                {
                                    Interfaces.IConquerItem arrow = attacker.Owner.Equipment.TryGetItem(ConquerItem.LeftWeapon);
                                    arrow.Durability -= 1;
                                    ItemUsage usage = new ItemUsage(true) { UID = arrow.UID, dwParam = arrow.Durability, ID = ItemUsage.UpdateDurability };
                                    usage.Send(attacker.Owner);
                                    if (arrow.Durability <= 0 || arrow.Durability > 5000)
                                    {
                                        Network.PacketHandler.ReloadArrows(attacker.Owner.Equipment.TryGetItem(ConquerItem.LeftWeapon), attacker.Owner);
                                    }
                                }
                            }
                            else
                            {
                                if (!attacker.Owner.Equipment.Free((byte)ConquerItem.AltLeftHand))
                                {
                                    Interfaces.IConquerItem arrow = attacker.Owner.Equipment.TryGetItem(ConquerItem.AltLeftHand);
                                    arrow.Durability -= 1;
                                    ItemUsage usage = new ItemUsage(true) { UID = arrow.UID, dwParam = arrow.Durability, ID = ItemUsage.UpdateDurability };
                                    usage.Send(attacker.Owner);
                                    if (arrow.Durability <= 0 || arrow.Durability > 5000)
                                    {
                                        Network.PacketHandler.ReloadArrows(attacker.Owner.Equipment.TryGetItem(ConquerItem.AltLeftHand), attacker.Owner);
                                    }
                                }
                            }
                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= ServerBase.Constants.pScreenDistance)
                            {
                                attack.Effect1 = Attack.AttackEffects1.None;
                                uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked, ref attack);

                                attack.Damage = damage;
                                if (attacker.EntityFlag == EntityFlag.Player && attacked.EntityFlag != EntityFlag.Player)
                                    if (damage > attacked.Hitpoints)
                                    {
                                        attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attacked.Hitpoints), 500);
                                    }
                                    else
                                    {
                                        attacker.Owner.IncreaseProficiencyExperience(damage, 500);
                                    }
                                ReceiveAttack(attacker, attacked, attack, damage, null);
                            }
                        }
                        else if (attacker.Owner.Screen.TryGetSob(attack.Attacked, out attackedsob))
                        {
                            if (CanAttack(attacker, attackedsob, null))
                            {
                                if (attacker.Owner.Equipment.TryGetItem(ConquerItem.LeftWeapon) == null)
                                    return;
                                if (attacker.MapID != 1039)
                                {
                                    if (!attacker.Owner.AlternateEquipment)
                                    {
                                        if (!attacker.Owner.Equipment.Free((byte)ConquerItem.LeftWeapon))
                                        {
                                            Interfaces.IConquerItem arrow = attacker.Owner.Equipment.TryGetItem(ConquerItem.LeftWeapon);
                                            arrow.Durability -= 1;
                                            ItemUsage usage = new ItemUsage(true) { UID = arrow.UID, dwParam = arrow.Durability, ID = ItemUsage.UpdateDurability };
                                            usage.Send(attacker.Owner);
                                            if (arrow.Durability <= 0 || arrow.Durability > 5000)
                                            {
                                                Network.PacketHandler.ReloadArrows(attacker.Owner.Equipment.TryGetItem(ConquerItem.LeftWeapon), attacker.Owner);
                                            }
                                        }
                                    }
                                    else
                                    {
                                        if (!attacker.Owner.Equipment.Free((byte)ConquerItem.AltLeftHand))
                                        {
                                            Interfaces.IConquerItem arrow = attacker.Owner.Equipment.TryGetItem(ConquerItem.AltLeftHand);
                                            arrow.Durability -= 1;
                                            ItemUsage usage = new ItemUsage(true) { UID = arrow.UID, dwParam = arrow.Durability, ID = ItemUsage.UpdateDurability };
                                            usage.Send(attacker.Owner);
                                            if (arrow.Durability <= 0 || arrow.Durability > 5000)
                                            {
                                                Network.PacketHandler.ReloadArrows(attacker.Owner.Equipment.TryGetItem(ConquerItem.AltLeftHand), attacker.Owner);
                                            }
                                        }
                                    }
                                }
                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= ServerBase.Constants.pScreenDistance)
                                {
                                    attack.Effect1 = Attack.AttackEffects1.None;
                                    uint damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
                                    attack.Damage = damage;
                                    ReceiveAttack(attacker, attackedsob, attack, damage, null);
                                    if (damage > attackedsob.Hitpoints)
                                    {
                                        attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attackedsob.Hitpoints), 500);
                                    }
                                    else
                                    {
                                        attacker.Owner.IncreaseProficiencyExperience(damage, 500);
                                    }
                                }
                            }
                        }
                        else
                        {
                            attacker.AttackPacket = null;
                        }
                    }
                    #endregion
                    #region Magic
                    else if (attack.AttackType == Attack.Magic)
                    {
                        if (!attacker.Owner.AlternateEquipment)
                        {
                            CheckForExtraWeaponPowers(attacker.Owner, attacked);
                        }
                        else
                        {
                            CheckForExtraWeaponPowers2(attacker.Owner, attacked);
                        }
                        uint Experience = 100;
                        bool shuriken = false;
                        ushort spellID = SpellID;
                        if (SpellID >= 3090 && SpellID <= 3306)
                            spellID = 3090;
                        if (spellID == 6012)
                            shuriken = true;

                        if (attacker == null)
                            return;
                        if (attacker.Owner == null)
                        {
                            attacker.AttackPacket = null;
                            return;
                        }
                        if (attacker.Owner.Spells == null)
                        {
                            attacker.Owner.Spells = new SafeDictionary<ushort, PhoenixProject.Interfaces.ISkill>(10000);
                            attacker.AttackPacket = null;
                            return;
                        }
                        if (attacker.Owner.Spells[spellID] == null && spellID != 6012)
                        {
                            attacker.AttackPacket = null;
                            return;
                        }

                        Database.SpellInformation spell = null;
                        if (shuriken)
                            spell = Database.SpellTable.SpellInformations[6010][0];
                        else
                        {
                            byte choselevel = 0;
                            if (spellID == SpellID)
                                choselevel = attacker.Owner.Spells[spellID].Level;
                            if (Database.SpellTable.SpellInformations[SpellID] != null && !Database.SpellTable.SpellInformations[SpellID].ContainsKey(choselevel))
                                choselevel = (byte)(Database.SpellTable.SpellInformations[SpellID].Count - 1);

                            spell = Database.SpellTable.SpellInformations[SpellID][choselevel];
                        }
                        if (spell == null)
                        {
                            attacker.AttackPacket = null;
                            return;
                        }
                        attacked = null;
                        attackedsob = null;
                        if (attacker.Owner.Screen.TryGetValue(Target, out attacked) || attacker.Owner.Screen.TryGetSob(Target, out attackedsob) || Target == attacker.UID || spell.Sort != 1)
                        {
                            if (Target == attacker.UID)
                                attacked = attacker;
                            if (attacked != null)
                            {
                                if (attacked.Dead && spell.Sort != Database.SpellSort.Revive && spell.ID != 10405 && spell.ID != 10425)
                                {
                                    attacker.AttackPacket = null;
                                    return;
                                }
                            }
                            if (Target >= 400000 && Target <= 600000 || Target >= 800000)
                            {
                                if (attacked == null && attackedsob == null)
                                    return;
                            }
                            else if (Target != 0 && attackedsob == null)
                                return;
                            if (attacked != null)
                            {
                                if (attacked.EntityFlag == EntityFlag.Monster)
                                {
                                    if (spell.CanKill == 1)
                                    {
                                        if (attacked.MonsterInfo.InSight == 0)
                                        {
                                            attacked.MonsterInfo.InSight = attacker.UID;
                                        }
                                    }
                                }
                            }
                            if (!attacker.Owner.Spells.ContainsKey(spellID))
                            {
                                if (spellID != 6012)
                                    return;
                            }
                            if (spell != null)
                            {
                                if (!attacker.Owner.AlternateEquipment)
                                {
                                    if (spell.OnlyWithThisWeaponSubtype != 0)
                                    {
                                        uint firstwepsubtype, secondwepsubtype;

                                        if (!attacker.Owner.Equipment.Free(4))
                                        {
                                            firstwepsubtype = attacker.Owner.Equipment.Objects[3].ID / 1000;
                                            if (!attacker.Owner.Equipment.Free(5) && attacker.Owner.Equipment.Objects[4] != null)
                                            {
                                                secondwepsubtype = attacker.Owner.Equipment.Objects[4].ID / 1000;
                                                if (firstwepsubtype != spell.OnlyWithThisWeaponSubtype)
                                                {
                                                    if (secondwepsubtype != spell.OnlyWithThisWeaponSubtype)
                                                    {
                                                        attacker.AttackPacket = null;
                                                        return;
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                if (firstwepsubtype != spell.OnlyWithThisWeaponSubtype)
                                                {
                                                    attacker.AttackPacket = null;
                                                    return;
                                                }
                                            }
                                        }
                                        else
                                        {
                                            attacker.AttackPacket = null;
                                            return;
                                        }
                                    }
                                    else
                                    {
                                        if (spell.OnlyWithThisWeaponSubtype != 0)
                                        {
                                            uint firstwepsubtype, secondwepsubtype;

                                            if (!attacker.Owner.Equipment.Free(24))
                                            {
                                                firstwepsubtype = attacker.Owner.Equipment.Objects[23].ID / 1000;
                                                if (!attacker.Owner.Equipment.Free(24) && attacker.Owner.Equipment.Objects[24] != null)
                                                {
                                                    secondwepsubtype = attacker.Owner.Equipment.Objects[24].ID / 1000;
                                                    if (firstwepsubtype != spell.OnlyWithThisWeaponSubtype)
                                                    {
                                                        if (secondwepsubtype != spell.OnlyWithThisWeaponSubtype)
                                                        {
                                                            attacker.AttackPacket = null;
                                                            return;
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    if (firstwepsubtype != spell.OnlyWithThisWeaponSubtype)
                                                    {
                                                        attacker.AttackPacket = null;
                                                        return;
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                attacker.AttackPacket = null;
                                                return;
                                            }
                                        }

                                    }
                                }
                                if (attacker.Owner.Account.State == PhoenixProject.Database.AccountTable.AccountState.Coder)
                                {
                                    attacker.Owner.Send(new Message("Spell ID: " + spellID, System.Drawing.Color.CadetBlue, Message.Talk));
                                }
                                switch (spellID)
                                {
                                    #region Single magic damage spells
                                    case 1000:
                                    case 1001:
                                    case 1002:
                                    case 1150:
                                    case 1160:
                                    case 1180:
                                    case 1320:
                                    case 10310:
                                    case 11180:
                                        //case 11040:
                                        //case 10381:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                if (attacked != null)
                                                {
                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                                    {
                                                        SpellUse suse = new SpellUse(true);
                                                        suse.Attacker = attacker.UID;
                                                        suse.SpellID = spell.ID;
                                                        suse.SpellLevel = spell.Level;
                                                        suse.X = X;
                                                        suse.Y = Y;

                                                        if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                        {
                                                            PrepareSpell(spell, attacker.Owner);

                                                            attack.Effect1 = Attack.AttackEffects1.None;
                                                            uint damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell, ref attack);
                                                            suse.Effect1 = attack.Effect1;

                                                            ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                            suse.Targets.Add(attacked.UID, damage);

                                                            if (attacked.EntityFlag == EntityFlag.Player)
                                                                attacked.Owner.SendScreen(suse, true);
                                                            else
                                                                attacked.MonsterInfo.SendScreen(suse);
                                                        }
                                                    }
                                                    else
                                                    {
                                                        attacker.AttackPacket = null;
                                                    }
                                                }
                                                else
                                                {
                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Distance)
                                                    {
                                                        SpellUse suse = new SpellUse(true);
                                                        suse.Attacker = attacker.UID;
                                                        suse.SpellID = spell.ID;
                                                        suse.SpellLevel = spell.Level;
                                                        suse.X = X;
                                                        suse.Y = Y;

                                                        if (CanAttack(attacker, attackedsob, spell))
                                                        {
                                                            PrepareSpell(spell, attacker.Owner);
                                                            attack.Effect1 = Attack.AttackEffects1.None;
                                                            uint damage = Game.Attacking.Calculate.Magic(attacker, attackedsob, spell, ref attack);
                                                            suse.Effect1 = attack.Effect1;

                                                            ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                            suse.Targets.Add(attackedsob.UID, damage);

                                                            attacker.Owner.SendScreen(suse, true);
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                attacker.AttackPacket = null;
                                            }
                                            break;
                                        }
                                    #endregion
                                    #region Single heal/meditation spells
                                    case 1190:
                                    case 1195:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;

                                                uint damage = spell.Power;
                                                if (spell.ID == 1190)
                                                {
                                                    Experience = damage = Math.Min(damage, attacker.MaxHitpoints - attacker.Hitpoints);
                                                    attacker.Hitpoints += damage;
                                                }
                                                else
                                                {
                                                    Experience = damage = Math.Min(damage, (uint)(attacker.MaxMana - attacker.Mana));
                                                    attacker.Mana += (ushort)damage;
                                                }

                                                suse.Targets.Add(attacker.UID, spell.Power);

                                                attacker.Owner.SendScreen(suse, true);
                                            }
                                            break;
                                        }
                                    #endregion
                                    #region Multi heal spells
                                    case 1005:
                                    case 1055:
                                    case 1170:
                                    case 1175:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                if (attackedsob != null)
                                                {
                                                    if (attacker.MapID == 1038)
                                                        break;
                                                    if (attacker.MapID == 2071)
                                                        break;
                                                    if (attacker.MapID == 1509)
                                                        break;
                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Distance)
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);

                                                        uint damage = spell.Power;
                                                        damage = Math.Min(damage, attackedsob.MaxHitpoints - attackedsob.Hitpoints);
                                                        attackedsob.Hitpoints += damage;
                                                        Experience += damage;
                                                        suse.Targets.Add(attackedsob.UID, damage);

                                                        attacker.Owner.SendScreen(suse, true);
                                                    }
                                                }
                                                else
                                                {
                                                    if (spell.Multi == 1)
                                                    {
                                                        if (attacker.Owner.Team != null)
                                                        {
                                                            PrepareSpell(spell, attacker.Owner);
                                                            foreach (Client.GameState teammate in attacker.Owner.Team.Teammates)
                                                            {
                                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, teammate.Entity.X, teammate.Entity.Y) <= spell.Distance)
                                                                {
                                                                    uint damage = spell.Power;
                                                                    damage = Math.Min(damage, teammate.Entity.MaxHitpoints - teammate.Entity.Hitpoints);
                                                                    teammate.Entity.Hitpoints += damage;
                                                                    Experience += damage;
                                                                    suse.Targets.Add(teammate.Entity.UID, damage);

                                                                    if (spell.NextSpellID != 0)
                                                                    {
                                                                        attack.Damage = spell.NextSpellID;
                                                                        attacker.AttackPacket = attack;
                                                                    }
                                                                    else
                                                                    {
                                                                        attacker.AttackPacket = null;
                                                                    }
                                                                }
                                                            }
                                                            if (attacked.EntityFlag == EntityFlag.Player)
                                                                attacked.Owner.SendScreen(suse, true);
                                                            else
                                                                attacked.MonsterInfo.SendScreen(suse);
                                                        }
                                                        else
                                                        {
                                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                                            {
                                                                PrepareSpell(spell, attacker.Owner);

                                                                uint damage = spell.Power;
                                                                damage = Math.Min(damage, attacked.MaxHitpoints - attacked.Hitpoints);
                                                                attacked.Hitpoints += damage;
                                                                Experience += damage;
                                                                suse.Targets.Add(attacked.UID, damage);

                                                                if (spell.NextSpellID != 0)
                                                                {
                                                                    attack.Damage = spell.NextSpellID;
                                                                    attacker.AttackPacket = attack;
                                                                }
                                                                else
                                                                {
                                                                    attacker.AttackPacket = null;
                                                                }
                                                                if (attacked.EntityFlag == EntityFlag.Player)
                                                                    attacked.Owner.SendScreen(suse, true);
                                                                else
                                                                    attacked.MonsterInfo.SendScreen(suse);
                                                            }
                                                            else
                                                            {
                                                                attacker.AttackPacket = null;
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                                        {
                                                            PrepareSpell(spell, attacker.Owner);

                                                            uint damage = spell.Power;
                                                            damage = Math.Min(damage, attacked.MaxHitpoints - attacked.Hitpoints);
                                                            attacked.Hitpoints += damage;
                                                            Experience += damage;
                                                            suse.Targets.Add(attacked.UID, damage);

                                                            if (spell.NextSpellID != 0)
                                                            {
                                                                attack.Damage = spell.NextSpellID;
                                                                attacker.AttackPacket = attack;
                                                            }
                                                            else
                                                            {
                                                                attacker.AttackPacket = null;
                                                            }
                                                            if (attacked.EntityFlag == EntityFlag.Player)
                                                                attacked.Owner.SendScreen(suse, true);
                                                            else
                                                                attacked.MonsterInfo.SendScreen(suse);
                                                        }
                                                        else
                                                        {
                                                            attacker.AttackPacket = null;
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                attacker.AttackPacket = null;
                                            }
                                            break;
                                        }
                                    #endregion
                                    #region Revive
                                    case 1050:
                                    case 1100:
                                        {
                                            if (attackedsob != null)
                                                return;
                                            if (ServerBase.Constants.revnomap.Contains(attacker.MapID))
                                                return;
                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                            {
                                                if (CanUseSpell(spell, attacker.Owner))
                                                {
                                                    PrepareSpell(spell, attacker.Owner);

                                                    SpellUse suse = new SpellUse(true);
                                                    suse.Attacker = attacker.UID;
                                                    suse.SpellID = spell.ID;
                                                    suse.SpellLevel = spell.Level;
                                                    suse.X = X;
                                                    suse.Y = Y;

                                                    //suse.Targets.Add(attacked.UID, 0);
                                                    //attacked.Action = PhoenixProject.Game.Enums.ConquerAction.None;
                                                    //attacked.Owner.ReviveStamp = Time32.Now;
                                                    //attacked.Owner.Attackable = false;

                                                    attacked.Owner.Entity.Action = PhoenixProject.Game.Enums.ConquerAction.None;
                                                    attacked.Owner.ReviveStamp = Time32.Now;
                                                    attacked.Owner.Attackable = false;

                                                    attacked.Owner.Entity.TransformationID = 0;
                                                    attacked.Owner.Entity.RemoveFlag(Update.Flags.Dead);
                                                    attacked.Owner.Entity.RemoveFlag(Update.Flags.Ghost);
                                                    attacked.Owner.Entity.Hitpoints = attacked.Owner.Entity.MaxHitpoints;

                                                    attacked.Ressurect();

                                                    attacked.Owner.SendScreen(suse, true);
                                                }
                                            }
                                            break;
                                        }
                                    #endregion
                                    #region Linear spells
                                    case 1045:
                                    case 1046:
                                    // case 11110:
                                    case 1260:
                                    case 11000:
                                    case 11005:
                                        {

                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);
                                                Game.Attacking.InLineAlgorithm ila = new PhoenixProject.Game.Attacking.InLineAlgorithm(attacker.X,
                                            X, attacker.Y, Y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = SpellID;
                                                suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                int xx = 0;
                                                int yy = 0;
                                                foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (_obj == null)
                                                        continue;
                                                    if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        attacked = _obj as Entity;
                                                        if (ila.InLine(attacked.X, attacked.Y))
                                                        {
                                                            if (attacked.X != xx && attacked.Y != yy)
                                                            {
                                                                if (!CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                                    continue;

                                                                attack.Effect1 = Attack.AttackEffects1.None;
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
                                                                suse.Effect1 = attack.Effect1;

                                                                attack.Damage = damage;
                                                                xx = attacked.X;
                                                                yy = attacked.Y;
                                                                ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                                suse.Targets.Add(attacked.UID, damage);
                                                            }
                                                        }
                                                    }
                                                    else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        attackedsob = _obj as SobNpcSpawn;

                                                        if (ila.InLine(attackedsob.X, attackedsob.Y))
                                                        {
                                                            if (!CanAttack(attacker, attackedsob, spell))
                                                                continue;

                                                            attack.Effect1 = Attack.AttackEffects1.None;
                                                            uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                            damage = (uint)(damage * spell.PowerPercent);
                                                            attack.Damage = damage;

                                                            ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                            suse.Targets.Add(attackedsob.UID, damage);
                                                        }
                                                    }
                                                }
                                                attacker.Owner.SendScreen(suse, true);
                                            }
                                            break;
                                        }
                                    #endregion
                                    #region BladeTempst

                                    case 11110:
                                        {

                                            bool yes = true;
                                            Game.Map Map = attacker.Owner.Map;
                                            // ushort rr = ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y);
                                            Game.Attacking.InLineAlgorithm ila = new PhoenixProject.Game.Attacking.InLineAlgorithm(attacker.X,
                                               X, attacker.Y, Y, (byte)ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y), InLineAlgorithm.Algorithm.DDA);
                                            List<InLineAlgorithm.coords>.Enumerator enumerator6;
                                            ushort x = 0;
                                            ushort y = 0;
                                            using (enumerator6 = ila.getCoords.GetEnumerator())
                                            {
                                                while (enumerator6.MoveNext())
                                                {
                                                    if (yes)
                                                    {
                                                        Func<IMapObject, bool> func4 = null;
                                                        InLineAlgorithm.coords coord = enumerator6.Current;

                                                        if (Map.Floor[coord.X, coord.Y, Game.MapObjectType.Player, null])
                                                        {
                                                            if (attacker.MapID == 1038)
                                                            {
                                                                if (attacker.X > 223 && attacker.Y < 185 && coord.X < 224)
                                                                {
                                                                    // Console.WriteLine(" r " + PhoenixProject.Game.ConquerStructures.Society.GuildWar.RightGate.Mesh + "");
                                                                    if (PhoenixProject.Game.ConquerStructures.Society.GuildWar.RightGate.Mesh == 271)
                                                                    {
                                                                        yes = false;
                                                                    }
                                                                    else
                                                                    {
                                                                        yes = true;
                                                                        x = (ushort)coord.X;
                                                                        y = (ushort)coord.Y;
                                                                        foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                                        {
                                                                            if (_obj == null)
                                                                                continue;
                                                                            if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                                            {
                                                                                attacked = _obj as Entity;
                                                                                if (ServerBase.Kernel.GetDistance((ushort)coord.X, (ushort)coord.Y, attacked.X, attacked.Y) <= 1)
                                                                                {
                                                                                    attacked.CanBlade = true;
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                                else
                                                                {
                                                                    //Console.WriteLine(" r " + PhoenixProject.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh + "");
                                                                    if (attacker.X < 170 && attacker.Y > 210 && coord.Y < 211)
                                                                    {
                                                                        if (PhoenixProject.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh == 241)
                                                                        {
                                                                            yes = false;
                                                                        }
                                                                    }
                                                                    else
                                                                    {
                                                                        yes = true;
                                                                        x = (ushort)coord.X;
                                                                        y = (ushort)coord.Y;
                                                                        foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                                        {
                                                                            if (_obj == null)
                                                                                continue;
                                                                            if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                                            {
                                                                                attacked = _obj as Entity;
                                                                                if (ServerBase.Kernel.GetDistance((ushort)coord.X, (ushort)coord.Y, attacked.X, attacked.Y) <= 1)
                                                                                {
                                                                                    attacked.CanBlade = true;
                                                                                }
                                                                            }
                                                                        }
                                                                    }

                                                                }



                                                            }
                                                            else
                                                            {
                                                                yes = true;
                                                                x = (ushort)coord.X;
                                                                y = (ushort)coord.Y;
                                                                foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                                {
                                                                    if (_obj == null)
                                                                        continue;
                                                                    if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                                    {
                                                                        attacked = _obj as Entity;
                                                                        if (ServerBase.Kernel.GetDistance((ushort)coord.X, (ushort)coord.Y, attacked.X, attacked.Y) <= 1)
                                                                        {
                                                                            attacked.CanBlade = true;
                                                                        }
                                                                    }
                                                                }
                                                            }

                                                        }
                                                        else
                                                        {
                                                            yes = false;
                                                        }
                                                    }
                                                }
                                            }
                                            yes = true;
                                            X = x;
                                            Y = y;

                                            if (Map.Floor[X, Y, Game.MapObjectType.Player, null] && yes)
                                            {
                                                if (CanUseSpell(spell, attacker.Owner))
                                                {
                                                    PrepareSpell(spell, attacker.Owner);

                                                    SpellUse suse = new SpellUse(true);
                                                    suse.Attacker = attacker.UID;
                                                    suse.SpellID = SpellID;
                                                    suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
                                                    suse.X = X;
                                                    suse.Y = Y;
                                                    int xx = 0;
                                                    int yy = 0;
                                                    foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                    {
                                                        if (_obj == null)
                                                            continue;
                                                        if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                        {
                                                            attacked = _obj as Entity;
                                                            if (attacked.CanBlade)
                                                            {

                                                                // if (attacked.X != xx && attacked.Y != yy)
                                                                // {
                                                                if (!CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                                    continue;

                                                                attack.Effect1 = Attack.AttackEffects1.None;
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
                                                               // uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
                                                                suse.Effect1 = attack.Effect1;

                                                                attack.Damage = damage;
                                                                // xx = attacked.X;
                                                                // yy = attacked.Y;
                                                                ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                                suse.Targets.Add(attacked.UID, damage);
                                                                attacked.CanBlade = false;
                                                                if (!attacked.Dead)
                                                                {
                                                                    if (attacker.Owner.Spells.ContainsKey(11120))
                                                                    {
                                                                        BlackSpot spot = new BlackSpot
                                                                        {
                                                                            Remove = 0,
                                                                            Identifier = attacked.UID
                                                                        };
                                                                        attacker.Owner.Send((byte[])spot);

                                                                        attacked.BlackSpotTime = Time32.Now;
                                                                        attacked.BlackSpotTime2 = 8;
                                                                        attacked.BlackSpots = true;
                                                                        attacker.Owner.IncreaseSpellExperience(80, 11120);
                                                                    }
                                                                }
                                                                // }
                                                            }
                                                        }
                                                        else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                        {
                                                            attackedsob = _obj as SobNpcSpawn;

                                                            if (ila.InLine(attackedsob.X, attackedsob.Y))
                                                            {
                                                                if (!CanAttack(attacker, attackedsob, spell))
                                                                    continue;

                                                                attack.Effect1 = Attack.AttackEffects1.None;
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                                damage = (uint)(damage * spell.PowerPercent);
                                                                attack.Damage = damage;

                                                                ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                                suse.Targets.Add(attackedsob.UID, damage);
                                                            }
                                                        }
                                                    }
                                                    attacker.X = X;
                                                    attacker.Y = Y;
                                                    attacker.Owner.SendScreen(attack, true);
                                                    attacker.Owner.SendScreen(suse, true);
                                                    attacker.Owner.Screen.Reload(attack);
                                                }
                                            }
                                            break;
                                        }
                                    #endregion
                                    #region XPSpells inofensive
                                    case 1015:
                                    case 1020:
                                    case 1025:
                                    case 1110:
                                    case 6011:
                                    case 10390:
                                        {

                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;

                                                suse.Targets.Add(attacked.UID, 0);

                                                if (spell.ID == 6011)
                                                {
                                                    attacker.FatalStrikeStamp = Time32.Now;
                                                    attacker.FatalStrikeTime = 60;
                                                    attacker.AddFlag(Update.Flags.FatalStrike);
                                                    attacker.RemoveFlag(Update.Flags.Ride);
                                                }
                                                else
                                                {
                                                    if (spell.ID == 1110 || spell.ID == 1025 || spell.ID == 10390)
                                                    {
                                                        if (!attacked.OnKOSpell())
                                                            attacked.KOCount = 0;

                                                        attacked.KOSpell = spell.ID;
                                                        if (spell.ID == 1110)
                                                        {
                                                            attacked.CycloneStamp = Time32.Now;
                                                            attacked.CycloneTime = 20;
                                                            attacked.AddFlag(Update.Flags.Cyclone);
                                                        }
                                                        else if (spell.ID == 10390)
                                                        {
                                                            attacked.OblivionStamp = Time32.Now;
                                                            attacked.OblivionTime = 20;
                                                            attacked.AddFlag2(Update.Flags2.Oblivion);
                                                        }

                                                        else
                                                        {
                                                            attacked.SupermanStamp = Time32.Now;
                                                            attacked.SupermanTime = 20;
                                                            attacked.AddFlag(Update.Flags.Superman);
                                                        }
                                                    }
                                                    else
                                                    {
                                                        if (spell.ID == 1020)
                                                        {
                                                            attacked.ShieldTime = 0;
                                                            attacked.ShieldStamp = Time32.Now;
                                                            attacked.MagicShieldStamp = Time32.Now;
                                                            attacked.MagicShieldTime = 0;

                                                            attacked.AddFlag(Update.Flags.MagicShield);
                                                            attacked.ShieldStamp = Time32.Now;
                                                            attacked.ShieldIncrease = spell.PowerPercent;
                                                            attacked.ShieldTime = (byte)spell.Duration;
                                                        }
                                                        else
                                                        {

                                                            attacked.AccuracyStamp = Time32.Now;
                                                            attacked.StarOfAccuracyStamp = Time32.Now;
                                                            attacked.StarOfAccuracyTime = 0;
                                                            attacked.AccuracyTime = 0;

                                                            attacked.AddFlag(Update.Flags.StarOfAccuracy);
                                                            attacked.AccuracyStamp = Time32.Now;
                                                            attacked.AccuracyTime = (byte)spell.Duration;
                                                        }
                                                    }
                                                }
                                                attacked.Owner.SendScreen(suse, true);
                                            }
                                            break;
                                        }
                                    #endregion
                                    #region Circle spells
                                    case 1010:
                                    case 1115:
                                    case 1120:
                                    case 1125:
                                    case 3090:
                                    case 5001:
                                    case 8030:
                                    case 11170:
                                    case 10315:
                                    case 11190:
                                        //case 11050:
                                        {
                                            // Console.WriteLine("xx3");
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                //Console.WriteLine("x4");
                                                PrepareSpell(spell, attacker.Owner);
                                                //Console.WriteLine("xx5");
                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                UInt16 ox, oy;
                                                ox = attacker.X;
                                                oy = attacker.Y;
                                                if (spellID == 10315 || spellID == 11190)
                                                {
                                                    /* if (attacker.MapID == 1950)
                                                     {
                                                         break;
                                                     }*/
                                                    bool yes = true;
                                                    Game.Map Map = attacker.Owner.Map;

                                                    Game.Attacking.InLineAlgorithm ila = new PhoenixProject.Game.Attacking.InLineAlgorithm(attacker.X,
                                                       X, attacker.Y, Y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
                                                    List<InLineAlgorithm.coords>.Enumerator enumerator6;
                                                    ushort x = 0;
                                                    ushort y = 0;
                                                    using (enumerator6 = ila.getCoords.GetEnumerator())
                                                    {
                                                        while (enumerator6.MoveNext())
                                                        {
                                                            if (yes)
                                                            {
                                                                Func<IMapObject, bool> func4 = null;
                                                                InLineAlgorithm.coords coord = enumerator6.Current;
                                                                if (Map.Floor[coord.X, coord.Y, Game.MapObjectType.Player, null])
                                                                {
                                                                    if (attacker.MapID == 1038)
                                                                    {
                                                                        if (attacker.X > 223 && attacker.Y < 185 && coord.X < 224)
                                                                        {
                                                                            // Console.WriteLine(" r " + PhoenixProject.Game.ConquerStructures.Society.GuildWar.RightGate.Mesh + "");
                                                                            if (PhoenixProject.Game.ConquerStructures.Society.GuildWar.RightGate.Mesh == 271)
                                                                            {
                                                                                yes = false;
                                                                            }
                                                                            else
                                                                            {
                                                                                yes = true;
                                                                                x = (ushort)coord.X;
                                                                                y = (ushort)coord.Y;
                                                                            }
                                                                        }
                                                                        else
                                                                        {
                                                                            //Console.WriteLine(" r " + PhoenixProject.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh + "");
                                                                            if (attacker.X < 170 && attacker.Y > 210 && coord.Y < 211)
                                                                            {
                                                                                if (PhoenixProject.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh == 241)
                                                                                {
                                                                                    yes = false;
                                                                                }
                                                                            }
                                                                            else
                                                                            {
                                                                                yes = true;
                                                                                x = (ushort)coord.X;
                                                                                y = (ushort)coord.Y;
                                                                            }

                                                                        }


                                                                    }
                                                                    else
                                                                    {
                                                                        yes = true;
                                                                        x = (ushort)coord.X;
                                                                        y = (ushort)coord.Y;
                                                                    }

                                                                }
                                                                else
                                                                {
                                                                    yes = false;
                                                                }
                                                            }
                                                        }
                                                    }
                                                    yes = true;
                                                    X = x;
                                                    Y = y;

                                                    Attack npacket = new Attack(true);
                                                    npacket.Attacker = attacker.UID;
                                                    npacket.AttackType = 53;
                                                    npacket.X = X;
                                                    npacket.Y = Y;
                                                    Writer.WriteUInt16(spell.ID, 24, npacket.ToArray());
                                                    Writer.WriteByte(spell.Level, 26, npacket.ToArray());
                                                    attacker.Owner.SendScreen(npacket, true);
                                                    attacker.X = X;
                                                    attacker.Y = Y;
                                                    attacker.SendSpawn(attacker.Owner);
                                                    attacker.Owner.Screen.Reload(npacket);
                                                }

                                                List<IMapObject> objects = new List<IMapObject>();
                                                if (attacker.Owner.Screen.Objects.Count() > 0)
                                                    objects = GetObjects(ox, oy, attacker.Owner);
                                                if (objects != null)
                                                {
                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)
                                                    {
                                                        if (spellID == 10315 || spellID == 11190)
                                                        {
                                                            foreach (IMapObject objs in objects.ToArray())
                                                            {
                                                                if (objs == null)
                                                                    continue;

                                                                if (objs.MapObjType == MapObjectType.Monster || objs.MapObjType == MapObjectType.Player)
                                                                {
                                                                    attacked = objs as Entity;
                                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
                                                                    {
                                                                        if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                                        {
                                                                            attack.Effect1 = Attack.AttackEffects1.None;
                                                                            uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
                                                                            suse.Effect1 = attack.Effect1;
                                                                            if (spell.Power > 0)
                                                                            {
                                                                                attack.Effect1 = Attack.AttackEffects1.None;
                                                                                damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
                                                                                //damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell, ref attack);
                                                                                suse.Effect1 = attack.Effect1;
                                                                            }
                                                                            if (spell.ID == 8030)
                                                                            {
                                                                                attack.Effect1 = Attack.AttackEffects1.None;
                                                                                damage = Game.Attacking.Calculate.Ranged(attacker, attacked, ref attack);
                                                                            }

                                                                            ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                                            suse.Targets.Add(attacked.UID, damage);
                                                                        }
                                                                    }
                                                                }
                                                                else if (objs.MapObjType == MapObjectType.SobNpc)
                                                                {
                                                                    attackedsob = objs as SobNpcSpawn;
                                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Range)
                                                                    {
                                                                        if (CanAttack(attacker, attackedsob, spell))
                                                                        {
                                                                            attack.Effect1 = Attack.AttackEffects1.None;
                                                                            uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                                            if (spell.Power > 0)
                                                                            {
                                                                                damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
                                                                               // damage = Game.Attacking.Calculate.Magic(attacker, attackedsob, spell, ref attack);
                                                                            }
                                                                            attack.Effect1 = Attack.AttackEffects1.None;
                                                                            if (spell.ID == 8030)
                                                                                damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
                                                                            suse.Effect1 = attack.Effect1;
                                                                            ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                                            suse.Targets.Add(attackedsob.UID, damage);
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                        else
                                                        {
                                                            foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                            {
                                                                if (_obj == null)
                                                                    continue;
                                                                if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                                {
                                                                    attacked = _obj as Entity;
                                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
                                                                    {
                                                                        if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                                        {
                                                                            attack.Effect1 = Attack.AttackEffects1.None;
                                                                            uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
                                                                            suse.Effect1 = attack.Effect1;
                                                                            if (spell.Power > 0)
                                                                            {
                                                                                attack.Effect1 = Attack.AttackEffects1.None;
                                                                                damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell, ref attack);
                                                                                suse.Effect1 = attack.Effect1;
                                                                            }
                                                                            attack.Effect1 = Attack.AttackEffects1.None;
                                                                            if (spell.ID == 8030)
                                                                                damage = Game.Attacking.Calculate.Ranged(attacker, attacked, ref attack);
                                                                            if (spell.ID == 1115)
                                                                                damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);


                                                                            ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                                            suse.Targets.Add(attacked.UID, damage);
                                                                        }
                                                                    }
                                                                }
                                                                else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                                {
                                                                    attackedsob = _obj as SobNpcSpawn;
                                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Range)
                                                                    {
                                                                        if (CanAttack(attacker, attackedsob, spell))
                                                                        {
                                                                            attack.Effect1 = Attack.AttackEffects1.None;
                                                                            uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                                            if (spell.Power > 0)
                                                                                damage = Game.Attacking.Calculate.Magic(attacker, attackedsob, spell, ref attack);
                                                                            attack.Effect1 = Attack.AttackEffects1.None;
                                                                            if (spell.ID == 8030)
                                                                                damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);

                                                                            suse.Effect1 = attack.Effect1;
                                                                            ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                                            suse.Targets.Add(attackedsob.UID, damage);
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        attacker.AttackPacket = null;
                                                    }
                                                }
                                                attacker.Owner.SendScreen(suse, true);
                                            }
                                            break;
                                        }
                                    #endregion
                                    #region Buffers
                                    case 1075:
                                    case 1085:
                                    case 1090:
                                    case 1095:
                                    case 3080:
                                    case 10405://this is not what I edited yesterday...
                                    case 30000:
                                    case 11160:
                                    case 11200:
                                        {
                                            if (attackedsob != null)
                                            {
                                                if (CanUseSpell(spell, attacker.Owner))
                                                {
                                                    PrepareSpell(spell, attacker.Owner);

                                                    SpellUse suse = new SpellUse(true);
                                                    suse.Attacker = attacker.UID;
                                                    suse.SpellID = spell.ID;
                                                    suse.SpellLevel = spell.Level;
                                                    suse.X = X;
                                                    suse.Y = Y;

                                                    suse.Targets.Add(attackedsob.UID, 0);

                                                    attacker.Owner.SendScreen(suse, true);
                                                }
                                            }
                                            else
                                            {
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                                {
                                                    if (CanUseSpell(spell, attacker.Owner))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);

                                                        SpellUse suse = new SpellUse(true);
                                                        suse.Attacker = attacker.UID;
                                                        suse.SpellID = spell.ID;
                                                        suse.SpellLevel = spell.Level;
                                                        suse.X = X;
                                                        suse.Y = Y;

                                                        suse.Targets.Add(attacked.UID, 0);

                                                        if (spell.ID == 1075 || spell.ID == 1085)
                                                        {
                                                            if (spell.ID == 1075)
                                                            {
                                                                attacked.AddFlag(Update.Flags.Invisibility);
                                                                attacked.InvisibilityStamp = Time32.Now;
                                                                attacked.InvisibilityTime = (byte)spell.Duration;
                                                                if (attacked.EntityFlag == EntityFlag.Player)
                                                                    attacked.Owner.Send(ServerBase.Constants.Invisibility((int)spell.Duration));
                                                            }
                                                            else
                                                            {
                                                                attacked.AccuracyStamp = Time32.Now;
                                                                attacked.StarOfAccuracyStamp = Time32.Now;
                                                                attacked.StarOfAccuracyTime = 0;
                                                                attacked.AccuracyTime = 0;

                                                                attacked.AddFlag(Update.Flags.StarOfAccuracy);
                                                                attacked.StarOfAccuracyStamp = Time32.Now;
                                                                attacked.StarOfAccuracyTime = (byte)spell.Duration;
                                                                if (attacked.EntityFlag == EntityFlag.Player)
                                                                    attacked.Owner.Send(ServerBase.Constants.Accuracy((int)spell.Duration));

                                                            }
                                                        }
                                                        else
                                                        {
                                                            if (spell.ID == 1090)
                                                            {
                                                                attacked.ShieldTime = 0;
                                                                attacked.ShieldStamp = Time32.Now;
                                                                attacked.MagicShieldStamp = Time32.Now;
                                                                attacked.MagicShieldTime = 0;

                                                                attacked.AddFlag(Update.Flags.MagicShield);
                                                                attacked.MagicShieldStamp = Time32.Now;
                                                                attacked.MagicShieldIncrease = spell.PowerPercent;
                                                                attacked.MagicShieldTime = (byte)spell.Duration;
                                                                if (attacked.EntityFlag == EntityFlag.Player)
                                                                    attacked.Owner.Send(ServerBase.Constants.Shield(spell.PowerPercent, (int)spell.Duration));
                                                            }
                                                            else if (spell.ID == 1095)
                                                            {
                                                                attacked.AddFlag(Update.Flags.Stigma);
                                                                attacked.StigmaStamp = Time32.Now;
                                                                attacked.StigmaIncrease = spell.PowerPercent;
                                                                attacked.StigmaTime = (byte)spell.Duration;
                                                                if (attacked.EntityFlag == EntityFlag.Player)
                                                                    attacked.Owner.Send(ServerBase.Constants.Stigma(spell.PowerPercent, (int)spell.Duration));
                                                            }
                                                            else if (spell.ID == 11200)
                                                            {

                                                                if (attacker.ContainsFlag(Update.Flags.Ride))
                                                                {
                                                                    attacker.RemoveFlag(Update.Flags.Ride);
                                                                }
                                                                attacker.AddFlag3(Update.Flags3.MagicDefender);
                                                                attacker.MagicDefenderStamp = Time32.Now;
                                                                attacker.MagicDefenderIncrease = spell.PowerPercent;
                                                                attacker.MagicDefenderTime = (byte)spell.Duration;

                                                                if (attacker.EntityFlag == EntityFlag.Player)
                                                                {

                                                                    attacker.Owner.SendScreen(suse, true);
                                                                    SyncPacket packet = new SyncPacket
                                                                    {
                                                                        Identifier = attacker.UID,
                                                                        Count = 2,
                                                                        Type = PhoenixProject.Network.GamePackets.SyncPacket.SyncType.StatusFlag,
                                                                        StatusFlag1 = (ulong)attacker.StatusFlag,
                                                                        StatusFlag2 = (ulong)attacker.StatusFlag2,
                                                                        Unknown1 = 0x31,
                                                                        StatusFlagOffset = 0x80,
                                                                        Time = (uint)spell.Duration,
                                                                        Value = 10,
                                                                        Level = spell.Level
                                                                    };
                                                                    attacker.Owner.Send((byte[])packet);
                                                                }
                                                                break;
                                                            }
                                                            else if (spell.ID == 11160)
                                                            {
                                                                if (attacker.DefensiveStanceTime != 0)
                                                                {
                                                                    attacker.DefensiveStanceTime = 0;
                                                                    attacker.DefensiveStanceIncrease = 0;
                                                                    attacker.RemoveFlag2(Network.GamePackets.Update.Flags2.WarriorWalk);
                                                                }
                                                                else
                                                                {
                                                                    if (attacker.ContainsFlag(Update.Flags.Ride))
                                                                    {
                                                                        attacker.RemoveFlag(Update.Flags.Ride);
                                                                    }
                                                                    attacker.AddFlag2(Update.Flags2.WarriorWalk);
                                                                    attacker.DefensiveStanceStamp = Time32.Now;
                                                                    attacker.DefensiveStanceIncrease = spell.PowerPercent;
                                                                    attacker.DefensiveStanceTime = (byte)spell.Duration;

                                                                    if (attacker.EntityFlag == EntityFlag.Player)
                                                                    {
                                                                        attacker.Owner.Send(ServerBase.Constants.DefensiveStance(spell.Percent, (int)spell.Duration));

                                                                        attacker.Owner.SendScreen(suse, true);
                                                                    }
                                                                }
                                                                break;
                                                            }
                                                            else if (spell.ID == 30000)
                                                            {

                                                                if (attacked.ContainsFlag2(Update.Flags2.AzureShield))
                                                                {
                                                                    return;
                                                                }
                                                                //attack.AttackType = Attack.kimo2;
                                                                attacked.ShieldTime = 0;
                                                                attacked.ShieldStamp = Time32.Now;
                                                                attacked.MagicShieldStamp = Time32.Now;
                                                                attacked.MagicShieldTime = 0;
                                                                //Console.WriteLine("The Dodge is :" + attacked.Dodge.ToString());
                                                                attacked.AddFlag2(Update.Flags2.AzureShield);
                                                                attacked.MagicShieldStamp = Time32.Now;
                                                                attacked.AzureDamage = 12000;
                                                                //Console.WriteLine("AzureShiled granted " + 12000 + "  The Dodge is :" + attacked.Dodge.ToString());
                                                                attacked.MagicShieldIncrease = spell.PowerPercent;
                                                                attacked.MagicShieldTime = 60;
                                                                if (attacked.EntityFlag == EntityFlag.Player)
                                                                {
                                                                    attacked.Owner.Send(ServerBase.Constants.AzureShield(12000, 30));

                                                                    SyncPacket packet4 = new SyncPacket
                                                                    {
                                                                        Identifier = attacked.UID,
                                                                        Count = 2,
                                                                        Type = PhoenixProject.Network.GamePackets.SyncPacket.SyncType.StatusFlag,
                                                                        StatusFlag1 = (ulong)attacked.StatusFlag,
                                                                        StatusFlag2 = (ulong)attacked.StatusFlag2,
                                                                        Unknown1 = 0x31,
                                                                        StatusFlagOffset = 0x5d,
                                                                        Time = (uint)60,
                                                                        Value = (uint)attacked.AzureDamage,
                                                                        Level = spell.Level
                                                                    };
                                                                    attacked.Owner.Send((byte[])packet4);
                                                                }
                                                            }
                                                            if (spell.ID == 10405 && attacked.Dead)
                                                            {
                                                                if ((attacked.BattlePower - attacker.BattlePower) >= 10)
                                                                    return;
                                                                attacked.AddFlag(Update.Flags.Dead);//Flag them as dead... should not be needed. This is no movement
                                                                attacked.ShackleStamp = Time32.Now;//Set stamp so source can remove the flag after X seconds
                                                                attacked.ShackleTime = (short)(30 + 15 * spell.Level);//double checking here. Could be db has this wrong.
                                                                if (attacked.EntityFlag == EntityFlag.Player)
                                                                {
                                                                    attacked.Owner.Send(ServerBase.Constants.Shackled(attacked.ShackleTime));

                                                                    attacked.AddFlag2(Update.Flags2.SoulShackle);//Give them shackeld effect   

                                                                    SyncPacket packet3 = new SyncPacket
                                                                    {
                                                                        Identifier = attacked.UID,
                                                                        Count = 2,
                                                                        Type = PhoenixProject.Network.GamePackets.SyncPacket.SyncType.StatusFlag,
                                                                        StatusFlag1 = (ulong)attacked.StatusFlag,
                                                                        StatusFlag2 = (ulong)attacked.StatusFlag2,
                                                                        Unknown1 = 0x36,
                                                                        StatusFlagOffset = 0x6f,
                                                                        Time = (uint)spell.Duration,
                                                                        Value = 10,
                                                                        Level = spell.Level
                                                                    };
                                                                    attacked.Owner.Send((byte[])packet3);

                                                                }
                                                            }
                                                        }
                                                        attacker.Owner.IncreaseSpellExperience(Experience, spellID);
                                                        if (attacked.EntityFlag == EntityFlag.Player)
                                                            attacked.Owner.SendScreen(suse, true);
                                                        else
                                                            attacked.MonsterInfo.SendScreen(suse);

                                                    }
                                                }
                                            }
                                            break;
                                        }
                                    #endregion
                                    #region Percent
                                    case 3050:
                                        // case 11230:
                                        {
                                            //Console.WriteLine("1");
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                if (attackedsob != null)
                                                {
                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Distance)
                                                    {
                                                        SpellUse suse = new SpellUse(true);
                                                        suse.Attacker = attacker.UID;
                                                        suse.SpellID = spell.ID;
                                                        suse.SpellLevel = spell.Level;
                                                        suse.X = X;
                                                        suse.Y = Y;

                                                        if (CanAttack(attacker, attackedsob, spell))
                                                        {
                                                            PrepareSpell(spell, attacker.Owner);
                                                            uint damage = Game.Attacking.Calculate.Percent(attackedsob, spell.PowerPercent);

                                                            attackedsob.Hitpoints -= damage;

                                                            suse.Targets.Add(attackedsob.UID, damage);

                                                            attacker.Owner.SendScreen(suse, true);
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                                    {
                                                        SpellUse suse = new SpellUse(true);
                                                        suse.Attacker = attacker.UID;
                                                        suse.SpellID = spell.ID;
                                                        suse.SpellLevel = spell.Level;
                                                        suse.X = X;
                                                        suse.Y = Y;

                                                        if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                        {
                                                            PrepareSpell(spell, attacker.Owner);
                                                            uint damage = Game.Attacking.Calculate.Percent(attacked, spell.PowerPercent);

                                                            if (attacker.Owner.QualifierGroup != null)
                                                                attacker.Owner.QualifierGroup.UpdateDamage(attacker.Owner, damage);

                                                            attacked.Hitpoints -= damage;

                                                            suse.Targets.Add(attacked.UID, damage);

                                                            if (attacked.EntityFlag == EntityFlag.Player)
                                                                attacked.Owner.SendScreen(suse, true);
                                                            else
                                                                attacked.MonsterInfo.SendScreen(suse);
                                                        }
                                                    }
                                                }
                                            }
                                            break;
                                        }
                                    #endregion
                                    #region ExtraXP
                                    case 1040:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                if (attacker.Owner.Team != null)
                                                {
                                                    PrepareSpell(spell, attacker.Owner);
                                                    foreach (Client.GameState teammate in attacker.Owner.Team.Teammates)
                                                    {
                                                        if (teammate.Entity.UID != attacker.UID)
                                                        {
                                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, teammate.Entity.X, teammate.Entity.Y) <= spell.Distance)
                                                            {
                                                                teammate.XPCount += 20;
                                                                Update update = new Update(true);
                                                                update.UID = teammate.Entity.UID;
                                                                update.Append(Update.XPCircle, teammate.XPCount);
                                                                update.Send(teammate);
                                                                suse.Targets.Add(teammate.Entity.UID, 20);

                                                                if (spell.NextSpellID != 0)
                                                                {
                                                                    attack.Damage = spell.NextSpellID;
                                                                    attacker.AttackPacket = attack;
                                                                }
                                                                else
                                                                {
                                                                    attacker.AttackPacket = null;
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                if (attacked.EntityFlag == EntityFlag.Player)
                                                    attacked.Owner.SendScreen(suse, true);
                                                else
                                                    attacked.MonsterInfo.SendScreen(suse);
                                            }
                                            break;
                                        }
                                    #endregion
                                    #region WeaponSpells
                                    #region Circle
                                    case 5010:
                                    case 7020:

                                        //case 11110:
                                        //case 10490:
                                        {

                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                if (suse.SpellID != 10415)
                                                {
                                                    suse.X = X;
                                                    suse.Y = Y;
                                                }
                                                else
                                                {
                                                    suse.X = 6;
                                                }

                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= attacker.AttackRange + 1)
                                                {
                                                    foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                    {
                                                        if (_obj == null)
                                                            continue;
                                                        if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                        {
                                                            attacked = _obj as Entity;
                                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
                                                            {
                                                                if (attacked.ContainsFlag(Update.Flags.Fly))
                                                                    return;
                                                                if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                                {
                                                                    PrepareSpell(spell, attacker.Owner);

                                                                    //attack.Effect1 = Attack.AttackEffects1.None;
                                                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
                                                                    //suse.Effect1 = attack.Effect1;

                                                                    ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                                    suse.Targets.Add(attacked.UID, damage);
                                                                }
                                                            }
                                                        }
                                                        else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                        {
                                                            attackedsob = _obj as SobNpcSpawn;
                                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Range)
                                                            {
                                                                if (CanAttack(attacker, attackedsob, spell))
                                                                {
                                                                    PrepareSpell(spell, attacker.Owner);
                                                                    // attack.Effect1 = Attack.AttackEffects1.None;
                                                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                                    damage = (uint)(damage * spell.PowerPercent);
                                                                    ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                                    suse.Targets.Add(attackedsob.UID, damage);
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                                attacker.Owner.SendScreen(suse, true);
                                            }

                                            break;
                                        }
                                    #endregion
                                    #region Single target
                                    case 10490:
                                    case 11140:
                                        //case 11230:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;

                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= attacker.AttackRange + 1)
                                                {
                                                    if (attackedsob != null)
                                                    {
                                                        if (CanAttack(attacker, attackedsob, spell))
                                                        {
                                                            PrepareSpell(spell, attacker.Owner);
                                                            suse.MakeConst();
                                                            for (uint c = 0; c < 3; c++)
                                                            {
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                                if (damage > attackedsob.Hitpoints)
                                                                    damage = attackedsob.Hitpoints;

                                                                ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                                suse.Targets.Add(attackedsob.UID + c, damage);
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                        {
                                                            PrepareSpell(spell, attacker.Owner);
                                                            suse.MakeConst();
                                                            for (uint c = 0; c < 3; c++)
                                                            {
                                                                uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
                                                                if (damage > attacked.Hitpoints)
                                                                    damage = attacked.Hitpoints;
                                                                ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                                suse.Targets.Add(attacked.UID + c, damage);
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                                attacker.Owner.SendScreen(suse, true);
                                            }
                                            break;
                                        }
                                    case 1290:
                                    case 5030:
                                    case 5040:
                                    case 7000:
                                    case 7010:
                                    case 7030:
                                    case 7040:
                                    case 11230:
                                        //case 10381:

                                        //case 10490:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;

                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= attacker.AttackRange + 1)
                                                {
                                                    if (attackedsob != null)
                                                    {
                                                        if (CanAttack(attacker, attackedsob, spell))
                                                        {
                                                            PrepareSpell(spell, attacker.Owner);
                                                            attack.Effect1 = Attack.AttackEffects1.None;
                                                            uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                            damage = (uint)(damage * spell.PowerPercent);
                                                            ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                            suse.Targets.Add(attackedsob.UID, damage);
                                                        }
                                                    }
                                                    else
                                                    {
                                                        if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                        {
                                                            PrepareSpell(spell, attacker.Owner);

                                                            attack.Effect1 = Attack.AttackEffects1.None;
                                                            uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
                                                            suse.Effect1 = attack.Effect1;

                                                            ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                            suse.Targets.Add(attacked.UID, damage);
                                                        }
                                                    }
                                                    attacker.AttackPacket = null;
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                                attacker.Owner.SendScreen(suse, true);
                                            }
                                            attacker.AttackPacket = null;
                                            break;
                                        }
                                    #endregion
                                    #region Sector
                                    case 1250:
                                    case 5050:
                                    case 5020:
                                    case 1300:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                Sector sector = new Sector(attacker.X, attacker.Y, X, Y);
                                                sector.Arrange(spell.Sector, spell.Range);
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Distance + 1)
                                                {
                                                    foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                    {
                                                        if (_obj == null)
                                                            continue;
                                                        if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                        {
                                                            attacked = _obj as Entity;

                                                            if (sector.Inside(attacked.X, attacked.Y))
                                                            {
                                                                if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                                {
                                                                    attack.Effect1 = Attack.AttackEffects1.None;
                                                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
                                                                    suse.Effect1 = attack.Effect1;

                                                                    ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                                    suse.Targets.Add(attacked.UID, damage);
                                                                }
                                                            }
                                                        }
                                                        else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                        {
                                                            attackedsob = _obj as SobNpcSpawn;

                                                            if (sector.Inside(attackedsob.X, attackedsob.Y))
                                                            {
                                                                if (CanAttack(attacker, attackedsob, spell))
                                                                {
                                                                    attack.Effect1 = Attack.AttackEffects1.None;
                                                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                                    damage = (uint)(damage * spell.PowerPercent);
                                                                    ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                                    suse.Targets.Add(attackedsob.UID, damage);
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                                attacker.Owner.SendScreen(suse, true);
                                            }
                                            break;
                                        }
                                    #endregion
                                    #endregion
                                    #region Fly
                                    case 8002:
                                    case 8003:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                if (attacker.MapID == 1950)
                                                    return;
                                                PrepareSpell(spell, attacker.Owner);
                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                attacked.FlyStamp = Time32.Now;
                                                attacked.FlyTime = (byte)spell.Duration;

                                                suse.Targets.Add(attacker.UID, attacker.FlyTime);

                                                attacker.AddFlag(Update.Flags.Fly);
                                                attacker.RemoveFlag(Update.Flags.Ride);
                                                attacker.Owner.SendScreen(suse, true);
                                            }
                                            break;
                                        }
                                    #endregion
                                    #region Pirate Spells
                                    #region Xp Skills
                                    case 10309: //Cannon Barrage
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                if (!attacker.ContainsFlag2(Update.Flags2.ChainBoltActive))
                                                {
                                                    //attacker.RemoveFlag(Update.Flags.XPList);
                                                    attacker.ChainBoltStamp = Time32.Now;
                                                    attacker.ChainBoltTime = 30;
                                                    attacker.AddFlag2(Update.Flags2.ChainBoltActive);
                                                }

                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)
                                                {
                                                    for (int c = 0; c < attacker.Owner.Screen.Objects.Count(); c++)
                                                    {
                                                        //For a multi threaded application, while we go through the collection
                                                        //the collection might change. We will make sure that we wont go off  
                                                        //the limits with a check.
                                                        if (c >= attacker.Owner.Screen.Objects.Count())
                                                            break;
                                                        Interfaces.IMapObject _obj = attacker.Owner.Screen.Objects[c];
                                                        if (_obj == null)
                                                            continue;
                                                        if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                        {
                                                            attacked = _obj as Entity;
                                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
                                                            {
                                                                if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                                {
                                                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
                                                                    if (spell.Power > 0)
                                                                        damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell, ref attack);
                                                                    if (spell.ID == 8030)
                                                                        damage = Game.Attacking.Calculate.Ranged(attacker, attacked, ref attack);
                                                                    ReceiveAttack(attacker, attacked, attack, damage, spell);
                                                                    suse.Targets.Add(attacked.UID, damage);
                                                                    //attacked.AddFlag(Update.Effects.CannonBarrage);
                                                                }
                                                            }
                                                        }
                                                        else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                        {
                                                            attackedsob = _obj as SobNpcSpawn;
                                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Range)
                                                            {
                                                                if (CanAttack(attacker, attackedsob, spell))
                                                                {
                                                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                                    if (spell.Power > 0)
                                                                        damage = Game.Attacking.Calculate.Magic(attacker, attackedsob, spell, ref attack);
                                                                    if (spell.ID == 8030)
                                                                        damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
                                                                    ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                                    suse.Targets.Add(attackedsob.UID, damage);
                                                                    //attacked.AddFlag(Update.Effects.CannonBarrage);
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                                attacker.Owner.SendScreen(suse, true);
                                            }
                                            break;
                                        }
                                    case 11050: //Cannon Barrage
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                if (!attacker.ContainsFlag2(Update.Flags2.CannonBraga))
                                                {
                                                    // attacker.RemoveFlag(Update.Flags.XPList);
                                                    attacker.CannonBarageStamp = Time32.Now;
                                                    attacker.Cannonbarage = 30;
                                                    attacker.AddFlag2(Update.Flags2.CannonBraga);
                                                }

                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= 10)
                                                {
                                                    for (int c = 0; c < attacker.Owner.Screen.Objects.Count(); c++)
                                                    {
                                                        //For a multi threaded application, while we go through the collection
                                                        //the collection might change. We will make sure that we wont go off  
                                                        //the limits with a check.
                                                        if (c >= attacker.Owner.Screen.Objects.Count())
                                                            break;
                                                        Interfaces.IMapObject _obj = attacker.Owner.Screen.Objects[c];
                                                        if (_obj == null)
                                                            continue;
                                                        if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                        {
                                                            attacked = _obj as Entity;
                                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= 10)
                                                            {
                                                                if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                                {
                                                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
                                                                    if (spell.Power > 0)
                                                                        damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell, ref attack);
                                                                    if (spell.ID == 8030)
                                                                        damage = Game.Attacking.Calculate.Ranged(attacker, attacked, ref attack);
                                                                    ReceiveAttack(attacker, attacked, attack, damage, spell);
                                                                    suse.Targets.Add(attacked.UID, damage);
                                                                    //attacked.AddFlag(Update.Effects.CannonBarrage);
                                                                }
                                                            }
                                                        }
                                                        else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                        {
                                                            attackedsob = _obj as SobNpcSpawn;
                                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= 10)
                                                            {
                                                                if (CanAttack(attacker, attackedsob, spell))
                                                                {
                                                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                                    if (spell.Power > 0)
                                                                        damage = Game.Attacking.Calculate.Magic(attacker, attackedsob, spell, ref attack);
                                                                    if (spell.ID == 8030)
                                                                        damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
                                                                    ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                                    suse.Targets.Add(attackedsob.UID, damage);
                                                                    //attacked.AddFlag(Update.Effects.CannonBarrage);
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                                attacker.Owner.SendScreen(suse, true);
                                            }
                                            break;
                                        }
                                    case 11060: // BlackPearl Rage
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                if (!attacker.ContainsFlag2(Update.Flags2.BlackBread))
                                                {
                                                    //attacker.RemoveFlag(Update.Flags.XPList);
                                                    attacker.BlackBeardStamp = Time32.Now;
                                                    attacker.Blackbeard = 30;
                                                    attacker.AddFlag2(Update.Flags2.BlackBread);
                                                }
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)
                                                {
                                                    for (int c = 0; c < attacker.Owner.Screen.Objects.Count(); c++)
                                                    {
                                                        //For a multi threaded application, while we go through the collection
                                                        //the collection might change. We will make sure that we wont go off  
                                                        //the limits with a check.
                                                        if (c >= attacker.Owner.Screen.Objects.Count())
                                                            break;
                                                        Interfaces.IMapObject _obj = attacker.Owner.Screen.Objects[c];
                                                        if (_obj == null)
                                                            continue;
                                                        if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                        {
                                                            attacked = _obj as Entity;
                                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
                                                            {
                                                                if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                                {
                                                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
                                                                    if (spell.Power > 0)
                                                                        damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell, ref attack);
                                                                    if (spell.ID == 8030)
                                                                        damage = Game.Attacking.Calculate.Ranged(attacker, attacked, ref attack);
                                                                    ReceiveAttack(attacker, attacked, attack, damage, spell);
                                                                    suse.Targets.Add(attacked.UID, damage);
                                                                }
                                                            }
                                                        }
                                                        else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                        {
                                                            attackedsob = _obj as SobNpcSpawn;
                                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Range)
                                                            {
                                                                if (CanAttack(attacker, attackedsob, spell))
                                                                {
                                                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                                    if (spell.Power > 0)
                                                                        damage = Game.Attacking.Calculate.Magic(attacker, attackedsob, spell, ref attack);
                                                                    if (spell.ID == 8030)
                                                                        damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
                                                                    ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                                    suse.Targets.Add(attackedsob.UID, damage);
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                                attacker.Owner.SendScreen(suse, true);
                                            }
                                            break;
                                        }
                                    #endregion

                                    #region Auto On Skills
                                    case 11130: //Adrenaline Rush
                                        //case 11130: //BlackSpot
                                        {
                                            spell.RemoveCooldown(0x2b16);
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PhoenixProject.Network.GamePackets.Quest.Target target5 = new PhoenixProject.Network.GamePackets.Quest.Target
                                                {
                                                    Obj = attacker,
                                                    Damage = 0x2b16,
                                                    DamageType = HitType.NoDamage,
                                                    Hit = true
                                                };
                                                if (spell.CoolDown > 0)
                                                {
                                                    spell.AddCooldown(spell.ID, (int)spell.CoolDown);
                                                }


                                            }
                                            break;
                                        }
                                    #endregion // Doesnt Work // Doest Work



                                    #region Linear Skills
                                    /* case 11110: //Blade Tempest
                                        {
                                            //if (Time32.Now < attacker.WhilrwindKick.AddMilliseconds(1500))
                                            // return;
                                            //attacker.WhilrwindKick = Time32.Now;
                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= 5)
                                            {

                                                if (CanUseSpell(spell, attacker.Owner))
                                                {
                                                    PrepareSpell(spell, attacker.Owner);

                                                    SpellUse suse = new SpellUse(true);
                                                    suse.Attacker = attacker.UID;
                                                    suse.SpellID = spell.ID;
                                                    suse.SpellLevel = spell.Level;
                                                    suse.X = X;
                                                    suse.Y = Y;

                                                    Game.Map Map = ServerBase.Kernel.Maps[attacker.MapID];
                                                    if (Map.SelectCoordonates(ref X, ref Y))
                                                    {

                                                        //attacker.X = X;
                                                        // attacker.Y = Y;
                                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= 5)
                                                        {
                                                            for (int c = 0; c < attacker.Owner.Screen.Objects.Count(); c++)
                                                            {
                                                                //For a multi threaded application, while we go through the collection
                                                                //the collection might change. We will make sure that we wont go off  
                                                                //the limits with a check.
                                                                if (c >= attacker.Owner.Screen.Objects.Count())
                                                                    break;
                                                                Interfaces.IMapObject _obj = attacker.Owner.Screen.Objects[c];
                                                                if (_obj == null)
                                                                    continue;
                                                                if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                                {
                                                                    attacked = _obj as Entity;
                                                                    if (ServerBase.Kernel.GetDistance(X, Y, attacked.X, attacked.Y) <= 1)
                                                                    {

                                                                        if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Ranged))
                                                                        {
                                                                            uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);

                                                                            ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                                            suse.Targets.Add(attacked.UID, damage);
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        attacker.AttackPacket = null;
                                                    }
                                                    attacker.Owner.SendScreen(suse, true);
                                                }
                                            }
                                            break;
                                        }*/
                                    #endregion

                                    #region Single damage Skill
                                    case 11120:
                                        {
                                            if (attacked != null)
                                            {
                                                if (attacked.EntityFlag == EntityFlag.Player || attacked.EntityFlag == EntityFlag.Monster)
                                                {
                                                    if (!attacked.Dead)
                                                    {
                                                        BlackSpot spot = new BlackSpot
                                                        {
                                                            Remove = 0,
                                                            Identifier = attacked.UID
                                                        };
                                                        attacker.Owner.Send((byte[])spot);

                                                        attacked.BlackSpotTime = Time32.Now;
                                                        attacked.BlackSpotTime2 = 12;
                                                        attacked.BlackSpots = true;
                                                        attacker.Owner.IncreaseSpellExperience(80, 11120);
                                                    }
                                                }

                                            }
                                            break;
                                        }
                                    case 11030: // Eagle Eye

                                        if (CanUseSpell(spell, attacker.Owner))
                                        {
                                            PrepareSpell(spell, attacker.Owner);



                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            suse.Effect1 = 0;
                                            bool kimo = false;
                                            //suse.Targets.Add(attacker.UID, spell.Power);
                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Distance)
                                            {
                                                if (attackedsob != null)
                                                {
                                                    if (CanAttack(attacker, attackedsob, spell))
                                                    {

                                                        PrepareSpell(spell, attacker.Owner);
                                                        uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                        damage = (uint)(damage * spell.PowerPercent * 30);
                                                        ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                        suse.Targets.Add(attackedsob.UID, damage);
                                                    }
                                                }
                                                else
                                                {
                                                    if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                    {
                                                        kimo = attacked.BlackSpots;
                                                        PrepareSpell(spell, attacker.Owner);
                                                        uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
                                                        ReceiveAttack(attacker, attacked, attack, damage, spell);
                                                        suse.Targets.Add(attacked.UID, damage);

                                                    }
                                                }
                                            }

                                            if (attacker.Owner.Spells.ContainsKey(11130))
                                            {
                                                if (kimo)
                                                {
                                                    suse.SpellID = 11060;
                                                    attacker.Owner.SendScreen(suse, true);
                                                    suse.Attacker = attacker.UID;
                                                    suse.SpellID = 11130;
                                                    suse.SpellLevel = attacker.Owner.Spells[11130].Level;
                                                    suse.X = attacker.X;
                                                    suse.Y = attacker.X;

                                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
                                                    suse.Targets.Add(attacked.UID, damage);
                                                    attacker.Owner.SendScreen(suse, true);
                                                    attacker.Owner.IncreaseSpellExperience(80, 11130);
                                                    break;

                                                }
                                            }
                                            if (attacker.Owner.Spells.ContainsKey(11130))
                                            {
                                                if (ServerBase.Kernel.Rate(5))
                                                {
                                                    ////spell.Duration = 0;
                                                    attacker.Update(_String.Effect, "RapidReplace", true);
                                                    suse.SpellID = 11060;
                                                    attacker.Owner.SendScreen(suse, true);

                                                }
                                                else
                                                {
                                                    //// spell.Duration = 0;
                                                    //attacker.Update(_String.Effect, "RapidReplace", true); 
                                                    attacker.Owner.SendScreen(suse, true);
                                                }
                                            }
                                            else
                                            {
                                                // spell.Duration = 0;
                                                // attacker.Update(_String.Effect, "RapidReplace", true); 
                                                attacker.Owner.SendScreen(suse, true);
                                            }


                                        }
                                        break;
                                    #endregion

                                    #region Region Damage Skills
                                    case 11100: //kracken revenge
                                        {
                                            //Console.WriteLine("0");
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                //Console.WriteLine("1");
                                                int counts = 0;
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= 5)
                                                {
                                                    for (int c = 0; c < attacker.Owner.Screen.Objects.Count(); c++)
                                                    {
                                                        // Console.WriteLine("2");
                                                        if (counts < 5)
                                                        {
                                                            //Console.WriteLine("3");
                                                            //For a multi threaded application, while we go through the collection
                                                            //the collection might change. We will make sure that we wont go off  
                                                            //the limits with a check.
                                                            if (c >= attacker.Owner.Screen.Objects.Count())
                                                                break;
                                                            Interfaces.IMapObject _obj = attacker.Owner.Screen.Objects[c];
                                                            if (_obj == null)
                                                                continue;
                                                            //Console.WriteLine("4");
                                                            if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                            {
                                                                attacked = _obj as Entity;
                                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= 5)
                                                                {
                                                                    // Console.WriteLine("5");
                                                                    if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                                    {
                                                                        if (attacked.EntityFlag == EntityFlag.Monster)
                                                                        {

                                                                            BlackSpot spot = new BlackSpot
                                                                            {
                                                                                Remove = 0,
                                                                                Identifier = attacked.UID
                                                                            };
                                                                            attacker.Owner.Send((byte[])spot);

                                                                            attacked.BlackSpotTime = Time32.Now;
                                                                            attacked.BlackSpotTime2 = (byte)spell.Duration;
                                                                            attacked.BlackSpots = true;
                                                                            counts += 1;
                                                                        }
                                                                        else
                                                                        {
                                                                            if (!ServerBase.Constants.BlackSpotNo.Contains(attacker.MapID))
                                                                            {

                                                                                BlackSpot spot = new BlackSpot
                                                                                {
                                                                                    Remove = 0,
                                                                                    Identifier = attacked.UID
                                                                                };
                                                                                attacker.Owner.Send((byte[])spot);

                                                                                attacked.BlackSpotTime = Time32.Now;
                                                                                attacked.BlackSpotTime2 = (byte)spell.Duration;
                                                                                attacked.BlackSpots = true;
                                                                                counts += 1;
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                                attacker.Owner.SendScreen(suse, true);
                                                attacker.Owner.IncreaseSpellExperience(80, spellID);
                                            }
                                            break;
                                        }
                                    case 11040: // Scurvey Bomb
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;

                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)
                                                {
                                                    for (int c = 0; c < attacker.Owner.Screen.Objects.Count(); c++)
                                                    {
                                                        //For a multi threaded application, while we go through the collection
                                                        //the collection might change. We will make sure that we wont go off  
                                                        //the limits with a check.
                                                        if (c >= attacker.Owner.Screen.Objects.Count())
                                                            break;
                                                        Interfaces.IMapObject _obj = attacker.Owner.Screen.Objects[c];
                                                        if (_obj == null)
                                                            continue;
                                                        if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                        {
                                                            attacked = _obj as Entity;
                                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
                                                            {
                                                                if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                                {
                                                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
                                                                    if (spell.Power > 0)
                                                                        damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell, ref attack);

                                                                    ReceiveAttack(attacker, attacked, attack, damage, spell);
                                                                    suse.Targets.Add(attacked.UID, damage);
                                                                    attacker.Owner.SendScreen(suse, true);
                                                                }
                                                            }
                                                        }
                                                        else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                        {
                                                            attackedsob = _obj as SobNpcSpawn;
                                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Range)
                                                            {
                                                                if (CanAttack(attacker, attackedsob, spell))
                                                                {
                                                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                                    if (spell.Power > 0)
                                                                        damage = Game.Attacking.Calculate.Magic(attacker, attackedsob, spell, ref attack);

                                                                    ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                                    suse.Targets.Add(attackedsob.UID, damage);
                                                                    attacker.Owner.SendScreen(suse, true);
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }

                                            }
                                            break;
                                        }
                                    case 11070: // Gale Bomb
                                        {
                                            if (Time32.Now >= attacker.MagikAttackTimeAtaque.AddMilliseconds(200))
                                            {
                                                attacker.MagikAttackTimeAtaque = Time32.Now;
                                                if (CanUseSpell(spell, attacker.Owner))
                                                {
                                                    PrepareSpell(spell, attacker.Owner);

                                                    SpellUse suse = new SpellUse(true);
                                                    suse.Attacker = attacker.UID;
                                                    suse.SpellID = spell.ID;
                                                    suse.SpellLevel = spell.Level;
                                                    suse.X = attack.X;
                                                    suse.Y = attack.Y;

                                                    attack.AttackType = 0x1b;
                                                    byte MaxDistance = (byte)spell.UnknownPush;
                                                    int counts = 0;
                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= attacker.AttackRange + 3)
                                                    {
                                                        foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                        {
                                                            if (counts < 3)
                                                            {
                                                                if (_obj == null)
                                                                    continue;

                                                                if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                                {
                                                                    attacked = _obj as Entity;
                                                                    if (ServerBase.Kernel.GetDistance(X, Y, attacked.X, attacked.Y) <= 5)
                                                                    {
                                                                        if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                                        {

                                                                            if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                                            {
                                                                                if (Misc.Distance(_obj.X, _obj.Y, (ushort)attack.X, (ushort)attack.Y) < (int)MaxDistance)
                                                                                {

                                                                                    var direction = ServerBase.Kernel.GetAngle(attacker.X, attacker.Y, attacked.X, attacked.Y);
                                                                                    attack = new Attack(true);
                                                                                    byte angle = (byte)(attack.Attacked % 8);
                                                                                    attack.Effect1 = Attack.AttackEffects1.None;
                                                                                    uint damage = Calculate.Melee(attacker, attacked, ref attack);
                                                                                    attack.AttackType = 0x1b;
                                                                                    attack.X = attacker.X;
                                                                                    attack.Y = attacker.Y;
                                                                                    attack.PushBack = angle;
                                                                                    attack.Attacker = attacker.UID;
                                                                                    attack.Attacked = attacked.UID;
                                                                                    attack.Damage = damage;
                                                                                    // attack.ToArray()[27] = (byte)direction;
                                                                                    // attacked.Move(direction);
                                                                                    // attacker.Move(direction);

                                                                                    ReceiveAttack(attacker, attacked, attack, damage, spell);
                                                                                    counts++;
                                                                                    // attacker.Owner.SendScreen(attack, true);
                                                                                    attacker.Owner.SendScreen(suse, true);
                                                                                    //attacker.X = attacker.X;

                                                                                }
                                                                                else
                                                                                    break;



                                                                            }
                                                                            else
                                                                            {
                                                                                suse.Targets.Add(attacked.UID, 0);
                                                                                suse.Targets[attacked.UID].Hit = false;
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                                else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                                {
                                                                    attackedsob = _obj as SobNpcSpawn;
                                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= 5)
                                                                    {
                                                                        if (CanAttack(attacker, attackedsob, spell))
                                                                        {
                                                                            if (ServerBase.Kernel.Rate(100))
                                                                            {
                                                                                if (CanAttack(attacker, attackedsob, spell))
                                                                                {
                                                                                    uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                                                    ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                                                    counts++;
                                                                                }
                                                                            }
                                                                            else
                                                                            {
                                                                                suse.Targets.Add(attacked.UID, 0);
                                                                                suse.Targets[attacked.UID].Hit = false;
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        attacker.AttackPacket = null;
                                                    }
                                                    attacker.Owner.SendScreen(suse, true);
                                                }
                                            }
                                            break;
                                        }
                                    #endregion

                                    #endregion
                                    #region Ninja Spells
                                    case 6010://Vortex
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;

                                                attacker.AddFlag(Update.Flags.ShurikenVortex);
                                                attacker.RemoveFlag(Update.Flags.Ride);
                                                attacker.ShurikenVortexStamp = Time32.Now;
                                                attacker.ShurikenVortexTime = 20;

                                                attacker.Owner.SendScreen(suse, true);

                                                attacker.VortexPacket = new Attack(true);
                                                attacker.VortexPacket.Decoded = true;
                                                attacker.VortexPacket.Damage = 6012;
                                                attacker.VortexPacket.AttackType = Attack.Magic;
                                                attacker.VortexPacket.Attacker = attacker.UID;
                                            }
                                            break;
                                        }
                                    case 6012://VortexRespone
                                        {
                                            if (!attacker.ContainsFlag(Update.Flags.ShurikenVortex))
                                            {
                                                attacker.AttackPacket = null;
                                                break;
                                            }
                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = attacker.X;
                                            suse.Y = attacker.Y;
                                            foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (_obj == null)
                                                    continue;
                                                if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                {
                                                    attacked = _obj as Entity;
                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
                                                    {
                                                        if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                        {
                                                            uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);

                                                            suse.Effect1 = attack.Effect1;

                                                            ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                            suse.Targets.Add(attacked.UID, damage);
                                                        }
                                                    }
                                                }
                                                else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    attackedsob = _obj as SobNpcSpawn;
                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Range)
                                                    {
                                                        if (CanAttack(attacker, attackedsob, spell))
                                                        {
                                                            attack.Effect1 = Attack.AttackEffects1.None;
                                                            uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                            suse.Effect1 = attack.Effect1;
                                                            ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                            suse.Targets.Add(attackedsob.UID, damage);
                                                        }
                                                    }
                                                }
                                            }
                                            attacker.Owner.SendScreen(suse, true);
                                            break;
                                        }
                                    case 6001:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Distance)
                                                {
                                                    foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                    {
                                                        if (_obj.MapObjType == MapObjectType.Player)
                                                        {
                                                            attacked = _obj as Entity;
                                                            if (ServerBase.Kernel.GetDistance(X, Y, attacked.X, attacked.Y) <= spell.Range)
                                                            {
                                                                if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                                {
                                                                    int potDifference = attacker.BattlePower - attacked.BattlePower;

                                                                    int rate = spell.Percent + potDifference - 20;

                                                                    if (ServerBase.Kernel.Rate(rate))
                                                                    {
                                                                        attacked.ToxicFogStamp = Time32.Now;
                                                                        attacked.ToxicFogLeft = 20;
                                                                        attacked.ToxicFogPercent = spell.PowerPercent;
                                                                        suse.Targets.Add(attacked.UID, 1);
                                                                    }
                                                                    if (attacker.BattlePower - attacked.BattlePower > 0)
                                                                    {
                                                                        attacked.ToxicFogStamp = Time32.Now;
                                                                        attacked.ToxicFogLeft = 20;
                                                                        attacked.ToxicFogPercent = spell.PowerPercent;
                                                                        suse.Targets.Add(attacked.UID, 1);
                                                                    }
                                                                    else
                                                                    {
                                                                        suse.Targets.Add(attacked.UID, 0);
                                                                        suse.Targets[attacked.UID].Hit = false;
                                                                    }
                                                                }
                                                            }
                                                        }
                                                        else
                                                        {
                                                            if (_obj.MapObjType == MapObjectType.Monster)
                                                            {
                                                                attacked = _obj as Entity;
                                                                if (!ServerBase.Constants.NoFog.Contains(attacked.Name))
                                                                {

                                                                    if (ServerBase.Kernel.GetDistance(X, Y, attacked.X, attacked.Y) <= spell.Range)
                                                                    {
                                                                        if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                                        {
                                                                            int potDifference = attacker.BattlePower - attacked.BattlePower;

                                                                            int rate = spell.Percent + potDifference - 20;

                                                                            if (ServerBase.Kernel.Rate(rate))
                                                                            {
                                                                                attacked.ToxicFogStamp = Time32.Now;
                                                                                attacked.ToxicFogLeft = 20;
                                                                                attacked.ToxicFogPercent = spell.PowerPercent;
                                                                                suse.Targets.Add(attacked.UID, 1);
                                                                            }
                                                                            if (attacker.BattlePower - attacked.BattlePower > 0)
                                                                            {
                                                                                attacked.ToxicFogStamp = Time32.Now;
                                                                                attacked.ToxicFogLeft = 20;
                                                                                attacked.ToxicFogPercent = spell.PowerPercent;
                                                                                suse.Targets.Add(attacked.UID, 1);
                                                                            }
                                                                            else
                                                                            {
                                                                                suse.Targets.Add(attacked.UID, 0);
                                                                                suse.Targets[attacked.UID].Hit = false;
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                                attacker.Owner.IncreaseSpellExperience(80, spellID);
                                                attacker.Owner.SendScreen(suse, true);
                                            }
                                            break;
                                        }
                                    case 6000:
                                    case 10381:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                ushort Xx, Yx;
                                                if (attacked != null)
                                                {
                                                    Xx = attacked.X;
                                                    Yx = attacked.Y;
                                                }
                                                else
                                                {
                                                    Xx = attackedsob.X;
                                                    Yx = attackedsob.Y;
                                                }
                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, Xx, Yx) <= spell.Range)
                                                {
                                                    if (attackedsob == null)
                                                        if (attacked.ContainsFlag(Network.GamePackets.Update.Flags.Fly))
                                                            return;
                                                    //if (attacked.ContainsFlag(Network.GamePackets.Update.Flags.Fly))
                                                    //  return;
                                                    if (attacker.ContainsFlag(Network.GamePackets.Update.Flags.Fly))
                                                        return;
                                                    PrepareSpell(spell, attacker.Owner);

                                                    SpellUse suse = new SpellUse(true);
                                                    suse.Attacker = attacker.UID;
                                                    suse.SpellID = spell.ID;
                                                    suse.SpellLevel = spell.Level;
                                                    suse.X = X;
                                                    suse.Y = Y;

                                                    bool send = false;

                                                    if (attackedsob == null)
                                                    {
                                                        if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                        {
                                                            attack.Effect1 = Attack.AttackEffects1.None;
                                                            uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
                                                            suse.Effect1 = attack.Effect1;

                                                            ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                            suse.Targets.Add(attacked.UID, damage);
                                                            send = true;
                                                        }
                                                    }
                                                    else
                                                    {
                                                        if (CanAttack(attacker, attackedsob, spell))
                                                        {
                                                            attack.Effect1 = Attack.AttackEffects1.None;
                                                            uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                            damage = (uint)(damage * spell.PowerPercent);
                                                            ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                            suse.Effect1 = attack.Effect1;

                                                            suse.Targets.Add(attackedsob.UID, damage);
                                                            send = true;
                                                        }
                                                    }
                                                    if (send)
                                                        attacker.Owner.SendScreen(suse, true);
                                                }
                                                else
                                                {
                                                    attacker.AttackPacket = null;
                                                }
                                            }
                                            break;
                                        }
                                    case 6002:
                                        {
                                            if (attackedsob != null)
                                                return;
                                            if (attacked.EntityFlag == EntityFlag.Monster)
                                                return;
                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                            {
                                                if (CanUseSpell(spell, attacker.Owner))
                                                {
                                                    PrepareSpell(spell, attacker.Owner);

                                                    int potDifference = attacker.BattlePower - attacked.BattlePower;

                                                    int rate = spell.Percent + potDifference;

                                                    SpellUse suse = new SpellUse(true);
                                                    suse.Attacker = attacker.UID;
                                                    suse.SpellID = spell.ID;
                                                    suse.SpellLevel = spell.Level;
                                                    suse.X = X;
                                                    suse.Y = Y;
                                                    if (CanAttack(attacker, attacked, spell, false))
                                                    {
                                                        suse.Targets.Add(attacked.UID, 0);
                                                        if (ServerBase.Kernel.Rate(rate))
                                                        {
                                                            attacked.NoDrugsStamp = Time32.Now;
                                                            attacked.NoDrugsTime = (short)spell.Duration;
                                                            if (attacked.EntityFlag == EntityFlag.Player)
                                                            {
                                                                attacker.Owner.IncreaseSpellExperience(80, spellID);
                                                                attacked.Owner.Send(ServerBase.Constants.NoDrugs((int)spell.Duration));
                                                            }
                                                        }
                                                        else
                                                        {
                                                            suse.Targets[attacked.UID].Hit = false;
                                                        }

                                                        attacked.Owner.SendScreen(suse, true);
                                                    }
                                                }
                                            }

                                            break;
                                        }
                                    case 6004:
                                        {
                                            if (attackedsob != null)
                                                return;
                                            if (attacked.EntityFlag == EntityFlag.Monster)
                                                return;
                                            if (!attacked.ContainsFlag(Update.Flags.Fly))
                                                return;
                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                            {
                                                if (CanUseSpell(spell, attacker.Owner))
                                                {
                                                    PrepareSpell(spell, attacker.Owner);

                                                    int potDifference = attacker.BattlePower - attacked.BattlePower;

                                                    int rate = spell.Percent + potDifference;

                                                    SpellUse suse = new SpellUse(true);
                                                    suse.Attacker = attacker.UID;
                                                    suse.SpellID = spell.ID;
                                                    suse.SpellLevel = spell.Level;
                                                    suse.X = X;
                                                    suse.Y = Y;
                                                    if (CanAttack(attacker, attacked, spell, false))
                                                    {
                                                        uint dmg = Calculate.Percent(attacked, 0.1F);
                                                        suse.Targets.Add(attacked.UID, dmg);

                                                        if (ServerBase.Kernel.Rate(rate))
                                                        {
                                                            attacked.Hitpoints -= dmg;
                                                            attacked.RemoveFlag(Update.Flags.Fly);
                                                        }
                                                        else
                                                        {
                                                            suse.Targets[attacked.UID].Hit = false;
                                                        }

                                                        attacked.Owner.SendScreen(suse, true);
                                                    }
                                                }
                                            }
                                            break;
                                        }
                                    #endregion
                                    #region Riding

                                    case 7001:
                                        {
                                            if (attacker.ContainsFlag2(Update.Flags2.WarriorWalk))
                                                return;
                                            if (attacker.ContainsFlag(Update.Flags.ShurikenVortex))
                                                return;
                                            if (ServerBase.Constants.steedguard.Contains(attacker.MapID))
                                                return;
                                            if (!attacker.Owner.Equipment.Free(12))
                                            {
                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;

                                                if (attacker.ContainsFlag(Update.Flags.Ride))
                                                {
                                                    attacker.RemoveFlag(Update.Flags.Ride);
                                                }
                                                else
                                                {
                                                    if (attacker.Owner.Equipment.TryGetItem((byte)12).Plus < attacker.MapRegion.Lineage)
                                                        break;
                                                    if (attacker.Stamina >= 100 && (attacker.Owner.QualifierGroup == null || attacker.Owner.QualifierGroup != null && !attacker.Owner.QualifierGroup.Inside))
                                                    {
                                                        attacker.AddFlag(Update.Flags.Ride);
                                                        attacker.Stamina -= 100;
                                                        attacker.Vigor = (ushort)attacker.MaxVigor;
                                                        Network.GamePackets.Vigor vigor = new Network.GamePackets.Vigor(true);
                                                        vigor.VigorValue = attacker.Owner.Entity.MaxVigor;
                                                        vigor.Send(attacker.Owner);
                                                    }
                                                }
                                                suse.Targets.Add(attacker.UID, 0);
                                                attacker.Owner.SendScreen(suse, true);
                                            }
                                            break;
                                        }
                                    case 7002:
                                        {//Spook
                                            if (attacked.ContainsFlag(Update.Flags.Ride) && attacker.ContainsFlag(Update.Flags.Ride))
                                            {
                                                Interfaces.IConquerItem attackedSteed = null, attackerSteed = null;
                                                if ((attackedSteed = attacked.Owner.Equipment.TryGetItem(ConquerItem.Steed)) != null)
                                                {
                                                    if ((attackerSteed = attacker.Owner.Equipment.TryGetItem(ConquerItem.Steed)) != null)
                                                    {
                                                        SpellUse suse = new SpellUse(true);
                                                        suse.Attacker = attacker.UID;
                                                        suse.SpellID = spell.ID;
                                                        suse.SpellLevel = spell.Level;
                                                        suse.X = X;
                                                        suse.Y = Y;
                                                        suse.Targets.Add(attacked.UID, 0);

                                                        if (attackedSteed.Plus < attackerSteed.Plus)
                                                            attacked.RemoveFlag(Update.Flags.Ride);
                                                        else if (attackedSteed.Plus == attackerSteed.Plus && attackedSteed.PlusProgress <= attackerSteed.PlusProgress)
                                                            attacked.RemoveFlag(Update.Flags.Ride);
                                                        else
                                                            suse.Targets[attacked.UID].Hit = false;
                                                        attacker.Owner.SendScreen(suse, true);
                                                    }
                                                }
                                            }
                                            break;
                                        }
                                    case 7003:
                                        {//WarCry
                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            Interfaces.IConquerItem attackedSteed = null, attackerSteed = null;
                                            foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (_obj == null)
                                                    continue;
                                                if (_obj.MapObjType == MapObjectType.Player && _obj.UID != attacker.UID)
                                                {
                                                    attacked = _obj as Entity;
                                                    if ((attackedSteed = attacked.Owner.Equipment.TryGetItem(ConquerItem.Steed)) != null)
                                                    {
                                                        if ((attackerSteed = attacker.Owner.Equipment.TryGetItem(ConquerItem.Steed)) != null)
                                                        {
                                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= attackedSteed.Plus)
                                                            {
                                                                if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                                {
                                                                    suse.Targets.Add(attacked.UID, 0);
                                                                    if (attackedSteed.Plus < attackerSteed.Plus)
                                                                        attacked.RemoveFlag(Update.Flags.Ride);
                                                                    else if (attackedSteed.Plus == attackerSteed.Plus && attackedSteed.PlusProgress <= attackerSteed.PlusProgress)
                                                                        attacked.RemoveFlag(Update.Flags.Ride);
                                                                    else
                                                                        suse.Targets[attacked.UID].Hit = false;
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            attacker.Owner.SendScreen(suse, true);
                                            break;
                                        }
                                    #endregion
                                    #region Dash
                                    case 1051:
                                        {
                                            if (attacked != null)
                                            {
                                                if (!attacked.Dead)
                                                {
                                                    var direction = ServerBase.Kernel.GetAngle(attacker.X, attacker.Y, attacked.X, attacked.Y);
                                                    if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                    {
                                                        attack = new Attack(true);
                                                        attack.Effect1 = Attack.AttackEffects1.None;
                                                        uint damage = Calculate.Melee(attacker, attacked, ref attack);
                                                        attack.AttackType = Attack.Dash;
                                                        attack.X = attacked.X;
                                                        attack.Y = attacked.Y;
                                                        attack.Attacker = attacker.UID;
                                                        attack.Attacked = attacked.UID;
                                                        attack.Damage = damage;
                                                        attack.ToArray()[27] = (byte)direction;
                                                        attacked.Move(direction);
                                                        attacker.Move(direction);

                                                        ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                        attacker.Owner.SendScreen(attack, true);
                                                    }
                                                }
                                            }
                                            break;
                                        }
                                    #endregion

                                    #region RapidFire
                                    case 8000:
                                        {
                                            if (attackedsob != null)
                                            {
                                                if (CanUseSpell(spell, attacker.Owner))
                                                {
                                                    if (CanAttack(attacker, attackedsob, spell))
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);
                                                        SpellUse suse = new SpellUse(true);
                                                        suse.Attacker = attacker.UID;
                                                        suse.SpellID = spell.ID;
                                                        suse.SpellLevel = spell.Level;
                                                        suse.X = attackedsob.X;
                                                        suse.Y = attackedsob.Y;
                                                        attack.Effect1 = Attack.AttackEffects1.None;
                                                        uint damage = Calculate.Ranged(attacker, attackedsob, ref attack);
                                                        suse.Effect1 = attack.Effect1;
                                                        damage = (uint)(damage * spell.PowerPercent);
                                                        suse.Targets.Add(attackedsob.UID, damage);

                                                        ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                        attacker.Owner.SendScreen(suse, true);
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                if (!attacked.Dead)
                                                {
                                                    if (CanUseSpell(spell, attacker.Owner))
                                                    {
                                                        if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                        {
                                                            PrepareSpell(spell, attacker.Owner);
                                                            SpellUse suse = new SpellUse(true);
                                                            suse.Attacker = attacker.UID;
                                                            suse.SpellID = spell.ID;
                                                            suse.SpellLevel = spell.Level;
                                                            suse.X = attacked.X;
                                                            suse.Y = attacked.Y;
                                                            attack.Effect1 = Attack.AttackEffects1.None;
                                                            uint damage = Calculate.Ranged(attacker, attacked, ref attack);
                                                            damage = (uint)(damage * spell.PowerPercent);
                                                            suse.Targets.Add(attacked.UID, damage);

                                                            ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                            attacker.Owner.SendScreen(suse, true);
                                                        }
                                                    }
                                                }
                                            }
                                            break;
                                        }
                                    #endregion
                                    #region FireOfHell
                                    case 1165:
                                    case 7014:
                                    case 7012:
                                    case 9971:
                                    case 7017:
                                    case 7015:
                                    case 7013:
                                    case 10360:
                                    case 9966:
                                    case 30010:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                Sector sector = new Sector(attacker.X, attacker.Y, X, Y);
                                                sector.Arrange(spell.Sector, spell.Distance);
                                                foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (_obj == null)
                                                        continue;
                                                    if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        attacked = _obj as Entity;

                                                        if (sector.Inside(attacked.X, attacked.Y))
                                                        {
                                                            if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            {
                                                                attack.Effect1 = Attack.AttackEffects1.None;
                                                                uint damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell, ref attack);
                                                                suse.Effect1 = attack.Effect1;

                                                                ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                                suse.Targets.Add(attacked.UID, damage);
                                                            }
                                                        }
                                                    }
                                                    else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        attackedsob = _obj as SobNpcSpawn;

                                                        if (sector.Inside(attackedsob.X, attackedsob.Y))
                                                        {
                                                            if (CanAttack(attacker, attackedsob, spell))
                                                            {
                                                                attack.Effect1 = Attack.AttackEffects1.None;
                                                                uint damage = Game.Attacking.Calculate.Magic(attacker, attackedsob, spell, ref attack);
                                                                suse.Effect1 = attack.Effect1;
                                                                ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                                suse.Targets.Add(attackedsob.UID, damage);
                                                            }
                                                        }
                                                    }
                                                }
                                                attacker.Owner.SendScreen(suse, true);

                                            }
                                            break;
                                        }
                                    #endregion
                                    #region Scatter
                                    case 8001:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                if (attacker.xx == attacker.X && attacker.yy == attacker.Y)
                                                {
                                                    attacker.scatter += 1;
                                                    if (attacker.scatter > 30)
                                                    {
                                                        attacker.Owner.Disconnect();
                                                    }
                                                }
                                                else
                                                {
                                                    attacker.xx = attacker.X;
                                                    attacker.yy = attacker.Y;
                                                    attacker.scatter = 0;
                                                }

                                                Sector sector = new Sector(attacker.X, attacker.Y, X, Y);
                                                sector.Arrange(spell.Sector, spell.Distance);
                                                foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (_obj == null)
                                                        continue;
                                                    if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        attacked = _obj as Entity;

                                                        if (sector.Inside(attacked.X, attacked.Y))
                                                        {
                                                            if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            {
                                                                attack.Effect1 = Attack.AttackEffects1.None;
                                                                uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked, spell, ref attack);

                                                                ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                                suse.Targets.Add(attacked.UID, damage);
                                                            }
                                                        }
                                                    }
                                                    else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        attackedsob = _obj as SobNpcSpawn;

                                                        if (sector.Inside(attackedsob.X, attackedsob.Y))
                                                        {
                                                            if (CanAttack(attacker, attackedsob, spell))
                                                            {
                                                                attack.Effect1 = Attack.AttackEffects1.None;
                                                                uint damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
                                                                suse.Effect1 = attack.Effect1;
                                                                if (damage == 0)
                                                                    damage = 1;
                                                                damage = Game.Attacking.Calculate.Percent((int)damage, spell.PowerPercent);

                                                                ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                                suse.Targets.Add(attackedsob.UID, damage);
                                                            }
                                                        }
                                                    }
                                                }
                                                attacker.Owner.SendScreen(suse, true);
                                            }
                                            break;
                                        }
                                    #endregion
                                    #region Intensify
                                    case 9000:
                                        {
                                            attacker.IntensifyStamp = Time32.Now;
                                            attacker.OnIntensify = true;
                                            SpellUse suse = new SpellUse(true);
                                            suse.Attacker = attacker.UID;
                                            suse.SpellID = spell.ID;
                                            suse.SpellLevel = spell.Level;
                                            suse.X = X;
                                            suse.Y = Y;
                                            suse.Targets.Add(attacker.UID, 0);
                                            suse.Send(attacker.Owner);
                                            break;
                                        }
                                    #endregion
                                    #region StarArrow
                                    case 10313:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                Sector sector = new Sector(attacker.X, attacker.Y, X, Y);
                                                sector.Arrange(spell.Sector, spell.Distance);
                                                foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (_obj == null)
                                                        continue;
                                                    if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        attacked = _obj as Entity;

                                                        if (sector.Inside(attacked.X, attacked.Y))
                                                        {
                                                            if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            {
                                                                attack.Effect1 = Attack.AttackEffects1.None;
                                                                uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked, spell, ref attack);

                                                                ReceiveAttack(attacker, attacked, attack, damage, spell);

                                                                suse.Targets.Add(attacked.UID, damage);
                                                            }
                                                        }
                                                    }
                                                    else if (_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        attackedsob = _obj as SobNpcSpawn;

                                                        if (sector.Inside(attackedsob.X, attackedsob.Y))
                                                        {
                                                            if (CanAttack(attacker, attackedsob, spell))
                                                            {
                                                                attack.Effect1 = Attack.AttackEffects1.None;
                                                                uint damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
                                                                suse.Effect1 = attack.Effect1;
                                                                if (damage == 0)
                                                                    damage = 1;
                                                                damage = Game.Attacking.Calculate.Percent((int)damage, spell.PowerPercent);

                                                                ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                                suse.Targets.Add(attackedsob.UID, damage);
                                                            }
                                                        }
                                                    }
                                                }
                                                attacker.Owner.SendScreen(suse, true);
                                            }
                                            break;
                                        }
                                    #endregion
                                    #region Trasnformations
                                    case 1270:
                                    case 1280:
                                    case 1350:
                                    case 1360:
                                    case 3321:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                if (attacker.MapID == 1036)
                                                    return;
                                                bool wasTransformated = attacker.Transformed;
                                                PrepareSpell(spell, attacker.Owner);

                                                #region Atributes
                                                switch (spell.ID)
                                                {
                                                    case 1350:
                                                        switch (spell.Level)
                                                        {
                                                            case 0:
                                                                {
                                                                    attacker.TransformationMaxAttack = 182;
                                                                    attacker.TransformationMinAttack = 122;
                                                                    attacker.TransformationDefence = 1300;
                                                                    attacker.TransformationMagicDefence = 94;
                                                                    attacker.TransformationDodge = 35;
                                                                    attacker.TransformationTime = 39;
                                                                    attacker.TransformationID = 207;
                                                                    break;
                                                                }
                                                            case 1:
                                                                {
                                                                    attacker.TransformationMaxAttack = 200;
                                                                    attacker.TransformationMinAttack = 134;
                                                                    attacker.TransformationDefence = 1400;
                                                                    attacker.TransformationMagicDefence = 96;
                                                                    attacker.TransformationDodge = 40;
                                                                    attacker.TransformationTime = 49;
                                                                    attacker.TransformationID = 207;
                                                                    break;
                                                                }
                                                            case 2:
                                                                {
                                                                    attacker.TransformationMaxAttack = 240;
                                                                    attacker.TransformationMinAttack = 160;
                                                                    attacker.TransformationDefence = 1500;
                                                                    attacker.TransformationMagicDefence = 97;
                                                                    attacker.TransformationDodge = 45;
                                                                    attacker.TransformationTime = 59;
                                                                    attacker.TransformationID = 207;
                                                                    break;
                                                                }
                                                            case 3:
                                                                {
                                                                    attacker.TransformationMaxAttack = 258;
                                                                    attacker.TransformationMinAttack = 172;
                                                                    attacker.TransformationDefence = 1600;
                                                                    attacker.TransformationMagicDefence = 98;
                                                                    attacker.TransformationDodge = 50;
                                                                    attacker.TransformationTime = 69;
                                                                    attacker.TransformationID = 267;
                                                                    break;
                                                                }
                                                            case 4:
                                                                {
                                                                    attacker.TransformationMaxAttack = 300;
                                                                    attacker.TransformationMinAttack = 200;
                                                                    attacker.TransformationDefence = 1900;
                                                                    attacker.TransformationMagicDefence = 99;
                                                                    attacker.TransformationDodge = 55;
                                                                    attacker.TransformationTime = 79;
                                                                    attacker.TransformationID = 267;
                                                                    break;
                                                                }
                                                        }
                                                        break;
                                                    case 1270:
                                                        switch (spell.Level)
                                                        {
                                                            case 0:
                                                                {
                                                                    attacker.TransformationMaxAttack = 282;
                                                                    attacker.TransformationMinAttack = 179;
                                                                    attacker.TransformationDefence = 73;
                                                                    attacker.TransformationMagicDefence = 34;
                                                                    attacker.TransformationDodge = 9;
                                                                    attacker.TransformationTime = 34;
                                                                    attacker.TransformationID = 214;
                                                                    break;
                                                                }
                                                            case 1:
                                                                {
                                                                    attacker.TransformationMaxAttack = 395;
                                                                    attacker.TransformationMinAttack = 245;
                                                                    attacker.TransformationDefence = 126;
                                                                    attacker.TransformationMagicDefence = 45;
                                                                    attacker.TransformationDodge = 12;
                                                                    attacker.TransformationTime = 39;
                                                                    attacker.TransformationID = 214;
                                                                    break;
                                                                }
                                                            case 2:
                                                                {
                                                                    attacker.TransformationMaxAttack = 616;
                                                                    attacker.TransformationMinAttack = 367;
                                                                    attacker.TransformationDefence = 180;
                                                                    attacker.TransformationMagicDefence = 53;
                                                                    attacker.TransformationDodge = 15;
                                                                    attacker.TransformationTime = 44;
                                                                    attacker.TransformationID = 214;
                                                                    break;
                                                                }
                                                            case 3:
                                                                {
                                                                    attacker.TransformationMaxAttack = 724;
                                                                    attacker.TransformationMinAttack = 429;
                                                                    attacker.TransformationDefence = 247;
                                                                    attacker.TransformationMagicDefence = 53;
                                                                    attacker.TransformationDodge = 15;
                                                                    attacker.TransformationTime = 49;
                                                                    attacker.TransformationID = 214;
                                                                    break;
                                                                }
                                                            case 4:
                                                                {
                                                                    attacker.TransformationMaxAttack = 1231;
                                                                    attacker.TransformationMinAttack = 704;
                                                                    attacker.TransformationDefence = 499;
                                                                    attacker.TransformationMagicDefence = 50;
                                                                    attacker.TransformationDodge = 20;
                                                                    attacker.TransformationTime = 54;
                                                                    attacker.TransformationID = 274;
                                                                    break;
                                                                }
                                                            case 5:
                                                                {
                                                                    attacker.TransformationMaxAttack = 1573;
                                                                    attacker.TransformationMinAttack = 941;
                                                                    attacker.TransformationDefence = 601;
                                                                    attacker.TransformationMagicDefence = 53;
                                                                    attacker.TransformationDodge = 25;
                                                                    attacker.TransformationTime = 59;
                                                                    attacker.TransformationID = 274;
                                                                    break;
                                                                }
                                                            case 6:
                                                                {
                                                                    attacker.TransformationMaxAttack = 1991;
                                                                    attacker.TransformationMinAttack = 1107;
                                                                    attacker.TransformationDefence = 1029;
                                                                    attacker.TransformationMagicDefence = 55;
                                                                    attacker.TransformationDodge = 30;
                                                                    attacker.TransformationTime = 64;
                                                                    attacker.TransformationID = 274;
                                                                    break;
                                                                }
                                                            case 7:
                                                                {
                                                                    attacker.TransformationMaxAttack = 2226;
                                                                    attacker.TransformationMinAttack = 1235;
                                                                    attacker.TransformationDefence = 1029;
                                                                    attacker.TransformationMagicDefence = 55;
                                                                    attacker.TransformationDodge = 35;
                                                                    attacker.TransformationTime = 69;
                                                                    attacker.TransformationID = 274;
                                                                    break;
                                                                }
                                                        }
                                                        break;
                                                    case 1360:
                                                        switch (spell.Level)
                                                        {
                                                            case 0:
                                                                {
                                                                    attacker.TransformationMaxAttack = 1215;
                                                                    attacker.TransformationMinAttack = 610;
                                                                    attacker.TransformationDefence = 100;
                                                                    attacker.TransformationMagicDefence = 96;
                                                                    attacker.TransformationDodge = 30;
                                                                    attacker.TransformationTime = 59;
                                                                    attacker.TransformationID = 217;
                                                                    break;
                                                                }
                                                            case 1:
                                                                {
                                                                    attacker.TransformationMaxAttack = 1310;
                                                                    attacker.TransformationMinAttack = 650;
                                                                    attacker.TransformationDefence = 400;
                                                                    attacker.TransformationMagicDefence = 97;
                                                                    attacker.TransformationDodge = 30;
                                                                    attacker.TransformationTime = 79;
                                                                    attacker.TransformationID = 217;
                                                                    break;
                                                                }
                                                            case 2:
                                                                {
                                                                    attacker.TransformationMaxAttack = 1420;
                                                                    attacker.TransformationMinAttack = 710;
                                                                    attacker.TransformationDefence = 650;
                                                                    attacker.TransformationMagicDefence = 98;
                                                                    attacker.TransformationDodge = 30;
                                                                    attacker.TransformationTime = 89;
                                                                    attacker.TransformationID = 217;
                                                                    break;
                                                                }
                                                            case 3:
                                                                {
                                                                    attacker.TransformationMaxAttack = 1555;
                                                                    attacker.TransformationMinAttack = 780;
                                                                    attacker.TransformationDefence = 720;
                                                                    attacker.TransformationMagicDefence = 98;
                                                                    attacker.TransformationDodge = 30;
                                                                    attacker.TransformationTime = 99;
                                                                    attacker.TransformationID = 277;
                                                                    break;
                                                                }
                                                            case 4:
                                                                {
                                                                    attacker.TransformationMaxAttack = 1660;
                                                                    attacker.TransformationMinAttack = 840;
                                                                    attacker.TransformationDefence = 1200;
                                                                    attacker.TransformationMagicDefence = 99;
                                                                    attacker.TransformationDodge = 30;
                                                                    attacker.TransformationTime = 109;
                                                                    attacker.TransformationID = 277;
                                                                    break;
                                                                }
                                                        }
                                                        break;
                                                    case 1280:
                                                        switch (spell.Level)
                                                        {
                                                            case 0:
                                                                {
                                                                    attacker.TransformationMaxAttack = 930;
                                                                    attacker.TransformationMinAttack = 656;
                                                                    attacker.TransformationDefence = 290;
                                                                    attacker.TransformationMagicDefence = 45;
                                                                    attacker.TransformationDodge = 40;
                                                                    attacker.TransformationTime = 29;
                                                                    attacker.TransformationID = 213;
                                                                    break;
                                                                }
                                                            case 1:
                                                                {
                                                                    attacker.TransformationMaxAttack = 1062;
                                                                    attacker.TransformationMinAttack = 750;
                                                                    attacker.TransformationDefence = 320;
                                                                    attacker.TransformationMagicDefence = 46;
                                                                    attacker.TransformationDodge = 40;
                                                                    attacker.TransformationTime = 34;
                                                                    attacker.TransformationID = 213;
                                                                    break;
                                                                }
                                                            case 2:
                                                                {
                                                                    attacker.TransformationMaxAttack = 1292;
                                                                    attacker.TransformationMinAttack = 910;
                                                                    attacker.TransformationDefence = 510;
                                                                    attacker.TransformationMagicDefence = 50;
                                                                    attacker.TransformationDodge = 40;
                                                                    attacker.TransformationTime = 39;
                                                                    attacker.TransformationID = 213;
                                                                    break;
                                                                }
                                                            case 3:
                                                                {
                                                                    attacker.TransformationMaxAttack = 1428;
                                                                    attacker.TransformationMinAttack = 1000;
                                                                    attacker.TransformationDefence = 600;
                                                                    attacker.TransformationMagicDefence = 53;
                                                                    attacker.TransformationDodge = 40;
                                                                    attacker.TransformationTime = 44;
                                                                    attacker.TransformationID = 213;
                                                                    break;
                                                                }
                                                            case 4:
                                                                {
                                                                    attacker.TransformationMaxAttack = 1570;
                                                                    attacker.TransformationMinAttack = 1100;
                                                                    attacker.TransformationDefence = 700;
                                                                    attacker.TransformationMagicDefence = 55;
                                                                    attacker.TransformationDodge = 40;
                                                                    attacker.TransformationTime = 49;
                                                                    attacker.TransformationID = 213;
                                                                    break;
                                                                }
                                                            case 5:
                                                                {
                                                                    attacker.TransformationMaxAttack = 1700;
                                                                    attacker.TransformationMinAttack = 1200;
                                                                    attacker.TransformationDefence = 880;
                                                                    attacker.TransformationMagicDefence = 57;
                                                                    attacker.TransformationDodge = 40;
                                                                    attacker.TransformationTime = 54;
                                                                    attacker.TransformationID = 273;
                                                                    break;
                                                                }
                                                            case 6:
                                                                {
                                                                    attacker.TransformationMaxAttack = 1900;
                                                                    attacker.TransformationMinAttack = 1300;
                                                                    attacker.TransformationDefence = 1540;
                                                                    attacker.TransformationMagicDefence = 59;
                                                                    attacker.TransformationDodge = 40;
                                                                    attacker.TransformationTime = 59;
                                                                    attacker.TransformationID = 273;
                                                                    break;
                                                                }
                                                            case 7:
                                                                {
                                                                    attacker.TransformationMaxAttack = 2100;
                                                                    attacker.TransformationMinAttack = 1500;
                                                                    attacker.TransformationDefence = 1880;
                                                                    attacker.TransformationMagicDefence = 61;
                                                                    attacker.TransformationDodge = 40;
                                                                    attacker.TransformationTime = 59;
                                                                    attacker.TransformationID = 273;
                                                                    break;
                                                                }
                                                            case 8:
                                                                {
                                                                    attacker.TransformationMaxAttack = 2300;
                                                                    attacker.TransformationMinAttack = 1600;
                                                                    attacker.TransformationDefence = 1970;
                                                                    attacker.TransformationMagicDefence = 63;
                                                                    attacker.TransformationDodge = 40;
                                                                    attacker.TransformationTime = 59;
                                                                    attacker.TransformationID = 273;
                                                                    break;
                                                                }
                                                        }
                                                        break;

                                                    case 3321:
                                                        {
                                                            attacker.TransformationMaxAttack = 2000000;
                                                            attacker.TransformationMinAttack = 2000000;
                                                            attacker.TransformationDefence = 65355;
                                                            attacker.TransformationMagicDefence = 65355;
                                                            attacker.TransformationDodge = 35;
                                                            attacker.TransformationTime = 65355;
                                                            attacker.TransformationID = 223;
                                                            break;
                                                        }


                                                }
                                                #endregion

                                                SpellUse spellUse = new SpellUse(true);
                                                spellUse.Attacker = attacker.UID;
                                                spellUse.SpellID = spell.ID;
                                                spellUse.SpellLevel = spell.Level;
                                                spellUse.X = X;
                                                spellUse.Y = Y;
                                                spellUse.Targets.Add(attacker.UID, (uint)0);
                                                attacker.Owner.SendScreen(spellUse, true);
                                                attacker.TransformationStamp = Time32.Now;
                                                attacker.TransformationMaxHP = 3000;
                                                if (spell.ID == 1270)
                                                    attacker.TransformationMaxHP = 50000;
                                                attacker.TransformationAttackRange = 3;
                                                if (spell.ID == 1360)
                                                    attacker.TransformationAttackRange = 10;
                                                if (!wasTransformated)
                                                {
                                                    double maxHP = attacker.MaxHitpoints;
                                                    double HP = attacker.Hitpoints;
                                                    double point = HP / maxHP;

                                                    attacker.Hitpoints = (uint)(attacker.TransformationMaxHP * point);
                                                }
                                                attacker.Update(Update.MaxHitpoints, attacker.TransformationMaxHP, false);
                                            }
                                            break;
                                        }
                                    #endregion
                                    #region Bless
                                    case 9876:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);
                                                attacker.AddFlag(Update.Flags.CastPray);
                                                SpellUse spellUse = new SpellUse(true);
                                                spellUse.Attacker = attacker.UID;
                                                spellUse.SpellID = spell.ID;
                                                spellUse.SpellLevel = spell.Level;
                                                spellUse.X = X;
                                                spellUse.Y = Y;
                                                spellUse.Targets.Add(attacker.UID, 0);
                                                attacker.Owner.SendScreen(spellUse, true);
                                            }
                                            break;
                                        }
                                    #endregion
                                    #region Companions
                                    case 4000:
                                    case 4010:
                                    case 4020:
                                    case 4050:
                                    case 4060:
                                    case 4070:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                if (ServerBase.Constants.steedguard.Contains(attacker.MapID))
                                                    return;
                                                if (attacker.Owner.Map.BaseID == 700)
                                                    return;
                                                if (attacker.Owner.Companion != null)
                                                {
                                                    if (attacker.Owner.Companion.MonsterInfo != null)
                                                    {
                                                        attacker.Owner.Map.RemoveEntity(attacker.Owner.Companion);
                                                        Data data = new Data(true);
                                                        data.UID = attacker.Owner.Companion.UID;
                                                        data.ID = Data.RemoveEntity;
                                                        attacker.Owner.Companion.MonsterInfo.SendScreen(data);
                                                        attacker.Owner.Companion = null;
                                                    }
                                                }
                                                PrepareSpell(spell, attacker.Owner);
                                                SpellUse spellUse = new SpellUse(true);
                                                spellUse.Attacker = attacker.UID;
                                                spellUse.SpellID = spell.ID;
                                                spellUse.SpellLevel = spell.Level;
                                                spellUse.X = X;
                                                spellUse.Y = Y;
                                                spellUse.Targets.Add(attacker.UID, 0);
                                                attacker.Owner.SendScreen(spellUse, true);
                                                attacker.Owner.Companion = new Entity(EntityFlag.Monster, true);
                                                attacker.Owner.Companion.MonsterInfo = new PhoenixProject.Database.MonsterInformation();
                                                Database.MonsterInformation mt = Database.MonsterInformation.MonsterInfos[spell.Power];
                                                attacker.Owner.Companion.Owner = attacker.Owner;
                                                attacker.Owner.Companion.MapObjType = MapObjectType.Monster;
                                                attacker.Owner.Companion.MonsterInfo = mt.Copy();
                                                attacker.Owner.Companion.MonsterInfo.Owner = attacker.Owner.Companion;
                                                attacker.Owner.Companion.Name = mt.Name;
                                                attacker.Owner.Companion.MinAttack = mt.MinAttack;
                                                attacker.Owner.Companion.MaxAttack = attacker.Owner.Companion.MagicAttack = mt.MaxAttack;
                                                attacker.Owner.Companion.Hitpoints = attacker.Owner.Companion.MaxHitpoints = mt.Hitpoints;
                                                attacker.Owner.Companion.Body = mt.Mesh;
                                                attacker.Owner.Companion.Level = mt.Level; //10000181 - 1000006

                                                attacker.Owner.Companion.UID = (uint)ServerBase.Kernel.Random.Next(900300, 970350);

                                                attacker.Owner.Companion.MapID = attacker.Owner.Map.ID;
                                                attacker.Owner.Companion.SendUpdates = true;
                                                attacker.Owner.Companion.X = attacker.X;
                                                attacker.Owner.Companion.Y = attacker.Y;
                                                attacker.Owner.Map.AddEntity(attacker.Owner.Companion);
                                                attacker.Owner.SendScreenSpawn(attacker.Owner.Companion, true);
                                            }
                                            break;
                                        }
                                    #endregion
                                    #region MonkSpells
                                    //Compassion
                                    case 10395:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);
                                                if (attacker.Owner.Team != null)
                                                {
                                                    foreach (Client.GameState c in attacker.Owner.Team.Teammates)
                                                    {
                                                        if (c.Entity.MapID == attacker.MapID)
                                                        {
                                                            short distance = Kernel.GetDistance(c.Entity.X, c.Entity.Y, attacker.X, attacker.Y);
                                                            if (distance < ServerBase.Constants.pScreenDistance)
                                                            {
                                                                if (c.Entity.UID != attacker.UID)
                                                                {
                                                                    if (!c.AlternateEquipment)
                                                                    {
                                                                        c.LoadItemStats(c.Entity);
                                                                    }
                                                                    else
                                                                    {
                                                                        c.LoadItemStats2(c.Entity);
                                                                    }

                                                                    c.Entity.AuraStamp = Time32.Now;
                                                                    c.Entity.AuraTime = 20;
                                                                    // attacked.MaxAttack += 1000;
                                                                    c.Entity.CriticalStrike += 10;
                                                                    //Console.WriteLine("sk" + attacked.CriticalStrike + "");
                                                                    c.Entity.RemoveFlag2(Update.Flags2.FendAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.MetalAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.WoodAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.WaterAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.EarthAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.FireAura);
                                                                    c.Entity.AddFlag2(Update.Flags2.TyrantAura);
                                                                    //Update ud = new Update(true);
                                                                    //ud.Aura(attacked, attacked.CriticalStrike, spell.Level, (byte)spell.Duration);
                                                                    PhoenixProject.Network.GamePackets.StatusIconData.AuraType tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                                    switch (spell.ID)
                                                                    {
                                                                        case 0x28b4:
                                                                            tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MetalAura;
                                                                            break;

                                                                        case 0x28b5:
                                                                            tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WoodAura;
                                                                            break;

                                                                        case 0x28b6:
                                                                            tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WaterAura;
                                                                            break;

                                                                        case 0x28b7:
                                                                            tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FireAura;
                                                                            break;

                                                                        case 0x28b8:
                                                                            tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.EarthAura;
                                                                            break;

                                                                        case 0x2bc0:
                                                                            tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MagicDefender;
                                                                            break;

                                                                        case 0x289b:
                                                                            tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                                            break;

                                                                        case 0x28aa:
                                                                            tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FendAura;
                                                                            break;
                                                                    }
                                                                    StatusIconData data2 = new StatusIconData
                                                                    {
                                                                        AuraLevel = spell.Level,
                                                                        AuraPower = spell.Power,
                                                                        AuraType2 = tyrantAura,
                                                                        Identifier = c.Entity.UID,
                                                                        Type = PhoenixProject.Network.GamePackets.StatusIconData.AuraDataTypes.Add
                                                                    };
                                                                    c.Entity.Owner.Send((byte[])data2);
                                                                }
                                                            }
                                                        }

                                                    }
                                                }
                                                if (!attacked.Owner.AlternateEquipment)
                                                {
                                                    attacked.Owner.LoadItemStats(attacked.Owner.Entity);
                                                }
                                                else
                                                {
                                                    attacked.Owner.LoadItemStats2(attacked.Owner.Entity);
                                                }
                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                attacker.Owner.SendScreen(suse, true);
                                                attacked.AuraStamp = Time32.Now;
                                                attacked.AuraTime = 20;
                                                // attacked.MaxAttack += 1000;
                                                attacked.CriticalStrike += 10;
                                                //Console.WriteLine("sk" + attacked.CriticalStrike + "");
                                                attacked.RemoveFlag2(Update.Flags2.FendAura);
                                                attacked.RemoveFlag2(Update.Flags2.MetalAura);
                                                attacked.RemoveFlag2(Update.Flags2.WoodAura);
                                                attacked.RemoveFlag2(Update.Flags2.WaterAura);
                                                attacked.RemoveFlag2(Update.Flags2.EarthAura);
                                                attacked.RemoveFlag2(Update.Flags2.FireAura);
                                                attacked.AddFlag2(Update.Flags2.TyrantAura);
                                                //Update ud = new Update(true);
                                                //ud.Aura(attacked, attacked.CriticalStrike, spell.Level, (byte)spell.Duration);
                                                PhoenixProject.Network.GamePackets.StatusIconData.AuraType tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                switch (spell.ID)
                                                {
                                                    case 0x28b4:
                                                        tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MetalAura;
                                                        break;

                                                    case 0x28b5:
                                                        tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WoodAura;
                                                        break;

                                                    case 0x28b6:
                                                        tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WaterAura;
                                                        break;

                                                    case 0x28b7:
                                                        tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FireAura;
                                                        break;

                                                    case 0x28b8:
                                                        tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.EarthAura;
                                                        break;

                                                    case 0x2bc0:
                                                        tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MagicDefender;
                                                        break;

                                                    case 0x289b:
                                                        tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                        break;

                                                    case 0x28aa:
                                                        tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FendAura;
                                                        break;
                                                }
                                                StatusIconData data = new StatusIconData
                                                {
                                                    AuraLevel = spell.Level,
                                                    AuraPower = spell.Power,
                                                    AuraType2 = tyrantAura2,
                                                    Identifier = attacker.UID,
                                                    Type = PhoenixProject.Network.GamePackets.StatusIconData.AuraDataTypes.Add
                                                };
                                                attacker.Owner.Send((byte[])data);
                                            }
                                            break;
                                        }
                                    case 10410:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);
                                                if (attacker.Owner.Team != null)
                                                {
                                                    foreach (Client.GameState c in attacker.Owner.Team.Teammates)
                                                    {
                                                        if (c.Entity.MapID == attacker.MapID)
                                                        {
                                                            short distance = Kernel.GetDistance(c.Entity.X, c.Entity.Y, attacker.X, attacker.Y);
                                                            if (distance < ServerBase.Constants.pScreenDistance)
                                                            {
                                                                if (c.Entity.UID != attacker.UID)
                                                                {
                                                                    if (!c.AlternateEquipment)
                                                                    {
                                                                        c.LoadItemStats(c.Entity);
                                                                    }
                                                                    else
                                                                    {
                                                                        c.LoadItemStats2(c.Entity);
                                                                    }

                                                                    c.Entity.AuraStamp = Time32.Now;
                                                                    c.Entity.AuraTime = 20;
                                                                    c.Entity.SkillCStrike += 10;
                                                                    c.Entity.CriticalStrike += 10;
                                                                    // attacked.MaxAttack += 100;
                                                                    c.Entity.RemoveFlag2(Update.Flags2.TyrantAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.MetalAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.WoodAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.WaterAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.EarthAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.FireAura);
                                                                    c.Entity.AddFlag2(Update.Flags2.FendAura);
                                                                    PhoenixProject.Network.GamePackets.StatusIconData.AuraType tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                                    switch (spell.ID)
                                                                    {
                                                                        case 0x28b4:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MetalAura;
                                                                            break;

                                                                        case 0x28b5:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WoodAura;
                                                                            break;

                                                                        case 0x28b6:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WaterAura;
                                                                            break;

                                                                        case 0x28b7:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FireAura;
                                                                            break;

                                                                        case 0x28b8:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.EarthAura;
                                                                            break;

                                                                        case 0x2bc0:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MagicDefender;
                                                                            break;

                                                                        case 0x289b:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                                            break;

                                                                        case 0x28aa:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FendAura;
                                                                            break;
                                                                    }
                                                                    StatusIconData data2 = new StatusIconData
                                                                    {
                                                                        AuraLevel = spell.Level,
                                                                        AuraPower = spell.Power,
                                                                        AuraType2 = tyrantAura2,
                                                                        Identifier = c.Entity.UID,
                                                                        Type = PhoenixProject.Network.GamePackets.StatusIconData.AuraDataTypes.Add
                                                                    };
                                                                    c.Entity.Owner.Send((byte[])data2);
                                                                }
                                                            }
                                                        }

                                                    }
                                                }
                                                if (!attacked.Owner.AlternateEquipment)
                                                {
                                                    attacked.Owner.LoadItemStats(attacked.Owner.Entity);
                                                }
                                                else
                                                {
                                                    attacked.Owner.LoadItemStats2(attacked.Owner.Entity);
                                                }
                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                attacker.Owner.SendScreen(suse, true);
                                                attacked.AuraStamp = Time32.Now;
                                                attacked.AuraTime = 20;
                                                attacked.SkillCStrike += 10;
                                                attacked.CriticalStrike += 10;
                                                // attacked.MaxAttack += 100;
                                                attacked.RemoveFlag2(Update.Flags2.TyrantAura);
                                                attacked.RemoveFlag2(Update.Flags2.MetalAura);
                                                attacked.RemoveFlag2(Update.Flags2.WoodAura);
                                                attacked.RemoveFlag2(Update.Flags2.WaterAura);
                                                attacked.RemoveFlag2(Update.Flags2.EarthAura);
                                                attacked.RemoveFlag2(Update.Flags2.FireAura);
                                                attacked.AddFlag2(Update.Flags2.FendAura);
                                                PhoenixProject.Network.GamePackets.StatusIconData.AuraType tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                switch (spell.ID)
                                                {
                                                    case 0x28b4:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MetalAura;
                                                        break;

                                                    case 0x28b5:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WoodAura;
                                                        break;

                                                    case 0x28b6:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WaterAura;
                                                        break;

                                                    case 0x28b7:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FireAura;
                                                        break;

                                                    case 0x28b8:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.EarthAura;
                                                        break;

                                                    case 0x2bc0:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MagicDefender;
                                                        break;

                                                    case 0x289b:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                        break;

                                                    case 0x28aa:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FendAura;
                                                        break;
                                                }
                                                StatusIconData data = new StatusIconData
                                                {
                                                    AuraLevel = spell.Level,
                                                    AuraPower = spell.Power,
                                                    AuraType2 = tyrantAura,
                                                    Identifier = attacker.UID,
                                                    Type = PhoenixProject.Network.GamePackets.StatusIconData.AuraDataTypes.Add
                                                };
                                                attacker.Owner.Send((byte[])data);
                                                //Update ud = new Update(true);
                                                //ud.Aura(attacked, attacked.SkillCStrike, spell.Level, (byte)spell.Duration);
                                            }
                                            break;
                                        }
                                    case 10420:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);
                                                if (attacker.Owner.Team != null)
                                                {
                                                    foreach (Client.GameState c in attacker.Owner.Team.Teammates)
                                                    {
                                                        if (c.Entity.MapID == attacker.MapID)
                                                        {
                                                            short distance = Kernel.GetDistance(c.Entity.X, c.Entity.Y, attacker.X, attacker.Y);
                                                            if (distance < ServerBase.Constants.pScreenDistance)
                                                            {
                                                                if (c.Entity.UID != attacker.UID)
                                                                {
                                                                    if (!c.AlternateEquipment)
                                                                    {
                                                                        c.LoadItemStats(c.Entity);
                                                                    }
                                                                    else
                                                                    {
                                                                        c.LoadItemStats2(c.Entity);
                                                                    }

                                                                    c.Entity.AuraStamp = Time32.Now;
                                                                    c.Entity.AuraTime = 20;
                                                                    c.Entity.MetalResistance += 30;
                                                                    c.Entity.RemoveFlag2(Update.Flags2.TyrantAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.FendAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.WoodAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.WaterAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.EarthAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.FireAura);
                                                                    c.Entity.AddFlag2(Update.Flags2.MetalAura);
                                                                    PhoenixProject.Network.GamePackets.StatusIconData.AuraType tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                                    switch (spell.ID)
                                                                    {
                                                                        case 0x28b4:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MetalAura;
                                                                            break;

                                                                        case 0x28b5:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WoodAura;
                                                                            break;

                                                                        case 0x28b6:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WaterAura;
                                                                            break;

                                                                        case 0x28b7:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FireAura;
                                                                            break;

                                                                        case 0x28b8:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.EarthAura;
                                                                            break;

                                                                        case 0x2bc0:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MagicDefender;
                                                                            break;

                                                                        case 0x289b:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                                            break;

                                                                        case 0x28aa:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FendAura;
                                                                            break;
                                                                    }
                                                                    StatusIconData data2 = new StatusIconData
                                                                    {
                                                                        AuraLevel = spell.Level,
                                                                        AuraPower = spell.Power,
                                                                        AuraType2 = tyrantAura2,
                                                                        Identifier = c.Entity.UID,
                                                                        Type = PhoenixProject.Network.GamePackets.StatusIconData.AuraDataTypes.Add
                                                                    };
                                                                    c.Entity.Owner.Send((byte[])data2);
                                                                }
                                                            }
                                                        }

                                                    }
                                                }
                                                if (!attacked.Owner.AlternateEquipment)
                                                {
                                                    attacked.Owner.LoadItemStats(attacked.Owner.Entity);
                                                }
                                                else
                                                {
                                                    attacked.Owner.LoadItemStats2(attacked.Owner.Entity);
                                                }
                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                attacker.Owner.SendScreen(suse, true);
                                                attacked.AuraStamp = Time32.Now;
                                                attacked.AuraTime = 20;
                                                attacked.MetalResistance += 30;
                                                attacked.RemoveFlag2(Update.Flags2.TyrantAura);
                                                attacked.RemoveFlag2(Update.Flags2.FendAura);
                                                attacked.RemoveFlag2(Update.Flags2.WoodAura);
                                                attacked.RemoveFlag2(Update.Flags2.WaterAura);
                                                attacked.RemoveFlag2(Update.Flags2.EarthAura);
                                                attacked.RemoveFlag2(Update.Flags2.FireAura);
                                                attacked.AddFlag2(Update.Flags2.MetalAura);
                                                PhoenixProject.Network.GamePackets.StatusIconData.AuraType tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                switch (spell.ID)
                                                {
                                                    case 0x28b4:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MetalAura;
                                                        break;

                                                    case 0x28b5:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WoodAura;
                                                        break;

                                                    case 0x28b6:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WaterAura;
                                                        break;

                                                    case 0x28b7:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FireAura;
                                                        break;

                                                    case 0x28b8:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.EarthAura;
                                                        break;

                                                    case 0x2bc0:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MagicDefender;
                                                        break;

                                                    case 0x289b:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                        break;

                                                    case 0x28aa:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FendAura;
                                                        break;
                                                }
                                                StatusIconData data = new StatusIconData
                                                {
                                                    AuraLevel = spell.Level,
                                                    AuraPower = spell.Power,
                                                    AuraType2 = tyrantAura,
                                                    Identifier = attacker.UID,
                                                    Type = PhoenixProject.Network.GamePackets.StatusIconData.AuraDataTypes.Add
                                                };
                                                attacker.Owner.Send((byte[])data);
                                            }
                                            //Update ud = new Update(true);
                                            //ud.Aura(attacked, attacked.MetalResistance, spell.Level, (byte)spell.Duration);
                                            break;
                                        }
                                    case 10421:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);
                                                if (attacker.Owner.Team != null)
                                                {
                                                    foreach (Client.GameState c in attacker.Owner.Team.Teammates)
                                                    {
                                                        if (c.Entity.MapID == attacker.MapID)
                                                        {
                                                            short distance = Kernel.GetDistance(c.Entity.X, c.Entity.Y, attacker.X, attacker.Y);
                                                            if (distance < ServerBase.Constants.pScreenDistance)
                                                            {
                                                                if (c.Entity.UID != attacker.UID)
                                                                {
                                                                    if (!c.AlternateEquipment)
                                                                    {
                                                                        c.LoadItemStats(c.Entity);
                                                                    }
                                                                    else
                                                                    {
                                                                        c.LoadItemStats2(c.Entity);
                                                                    }

                                                                    c.Entity.AuraStamp = Time32.Now;
                                                                    c.Entity.AuraTime = 20;
                                                                    c.Entity.WoodResistance += 30;
                                                                    c.Entity.RemoveFlag2(Update.Flags2.TyrantAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.FendAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.MetalAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.WaterAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.EarthAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.FireAura);
                                                                    c.Entity.AddFlag2(Update.Flags2.WoodAura);
                                                                    PhoenixProject.Network.GamePackets.StatusIconData.AuraType tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                                    switch (spell.ID)
                                                                    {
                                                                        case 0x28b4:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MetalAura;
                                                                            break;

                                                                        case 0x28b5:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WoodAura;
                                                                            break;

                                                                        case 0x28b6:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WaterAura;
                                                                            break;

                                                                        case 0x28b7:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FireAura;
                                                                            break;

                                                                        case 0x28b8:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.EarthAura;
                                                                            break;

                                                                        case 0x2bc0:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MagicDefender;
                                                                            break;

                                                                        case 0x289b:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                                            break;

                                                                        case 0x28aa:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FendAura;
                                                                            break;
                                                                    }
                                                                    StatusIconData data2 = new StatusIconData
                                                                    {
                                                                        AuraLevel = spell.Level,
                                                                        AuraPower = spell.Power,
                                                                        AuraType2 = tyrantAura2,
                                                                        Identifier = c.Entity.UID,
                                                                        Type = PhoenixProject.Network.GamePackets.StatusIconData.AuraDataTypes.Add
                                                                    };
                                                                    c.Entity.Owner.Send((byte[])data2);
                                                                }
                                                            }
                                                        }

                                                    }
                                                }
                                                if (!attacked.Owner.AlternateEquipment)
                                                {
                                                    attacked.Owner.LoadItemStats(attacked.Owner.Entity);
                                                }
                                                else
                                                {
                                                    attacked.Owner.LoadItemStats2(attacked.Owner.Entity);
                                                }
                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                attacker.Owner.SendScreen(suse, true);
                                                attacked.AuraStamp = Time32.Now;
                                                attacked.AuraTime = 20;
                                                attacked.WoodResistance += 30;
                                                attacked.RemoveFlag2(Update.Flags2.TyrantAura);
                                                attacked.RemoveFlag2(Update.Flags2.FendAura);
                                                attacked.RemoveFlag2(Update.Flags2.MetalAura);
                                                attacked.RemoveFlag2(Update.Flags2.WaterAura);
                                                attacked.RemoveFlag2(Update.Flags2.EarthAura);
                                                attacked.RemoveFlag2(Update.Flags2.FireAura);
                                                attacked.AddFlag2(Update.Flags2.WoodAura);
                                                PhoenixProject.Network.GamePackets.StatusIconData.AuraType tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                switch (spell.ID)
                                                {
                                                    case 0x28b4:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MetalAura;
                                                        break;

                                                    case 0x28b5:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WoodAura;
                                                        break;

                                                    case 0x28b6:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WaterAura;
                                                        break;

                                                    case 0x28b7:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FireAura;
                                                        break;

                                                    case 0x28b8:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.EarthAura;
                                                        break;

                                                    case 0x2bc0:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MagicDefender;
                                                        break;

                                                    case 0x289b:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                        break;

                                                    case 0x28aa:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FendAura;
                                                        break;
                                                }
                                                StatusIconData data = new StatusIconData
                                                {
                                                    AuraLevel = spell.Level,
                                                    AuraPower = spell.Power,
                                                    AuraType2 = tyrantAura,
                                                    Identifier = attacker.UID,
                                                    Type = PhoenixProject.Network.GamePackets.StatusIconData.AuraDataTypes.Add
                                                };
                                                attacker.Owner.Send((byte[])data);
                                                //Update ud = new Update(true);
                                            }
                                            //ud.Aura(attacked, attacked.WoodResistance, spell.Level, (byte)spell.Duration);
                                            break;
                                        }
                                    case 10422:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);
                                                if (attacker.Owner.Team != null)
                                                {
                                                    foreach (Client.GameState c in attacker.Owner.Team.Teammates)
                                                    {
                                                        if (c.Entity.MapID == attacker.MapID)
                                                        {
                                                            short distance = Kernel.GetDistance(c.Entity.X, c.Entity.Y, attacker.X, attacker.Y);
                                                            if (distance < ServerBase.Constants.pScreenDistance)
                                                            {
                                                                if (c.Entity.UID != attacker.UID)
                                                                {
                                                                    if (!c.AlternateEquipment)
                                                                    {
                                                                        c.LoadItemStats(c.Entity);
                                                                    }
                                                                    else
                                                                    {
                                                                        c.LoadItemStats2(c.Entity);
                                                                    }

                                                                    c.Entity.AuraStamp = Time32.Now;
                                                                    c.Entity.AuraTime = 20;
                                                                    c.Entity.WaterResistance += 30;
                                                                    c.Entity.RemoveFlag2(Update.Flags2.TyrantAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.FendAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.MetalAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.WoodAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.EarthAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.FireAura);
                                                                    c.Entity.AddFlag2(Update.Flags2.WaterAura);
                                                                    PhoenixProject.Network.GamePackets.StatusIconData.AuraType tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                                    switch (spell.ID)
                                                                    {
                                                                        case 0x28b4:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MetalAura;
                                                                            break;

                                                                        case 0x28b5:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WoodAura;
                                                                            break;

                                                                        case 0x28b6:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WaterAura;
                                                                            break;

                                                                        case 0x28b7:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FireAura;
                                                                            break;

                                                                        case 0x28b8:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.EarthAura;
                                                                            break;

                                                                        case 0x2bc0:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MagicDefender;
                                                                            break;

                                                                        case 0x289b:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                                            break;

                                                                        case 0x28aa:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FendAura;
                                                                            break;
                                                                    }
                                                                    StatusIconData data2 = new StatusIconData
                                                                    {
                                                                        AuraLevel = spell.Level,
                                                                        AuraPower = spell.Power,
                                                                        AuraType2 = tyrantAura2,
                                                                        Identifier = c.Entity.UID,
                                                                        Type = PhoenixProject.Network.GamePackets.StatusIconData.AuraDataTypes.Add
                                                                    };
                                                                    c.Entity.Owner.Send((byte[])data2);
                                                                }
                                                            }
                                                        }

                                                    }
                                                }
                                                if (!attacked.Owner.AlternateEquipment)
                                                {
                                                    attacked.Owner.LoadItemStats(attacked.Owner.Entity);
                                                }
                                                else
                                                {
                                                    attacked.Owner.LoadItemStats2(attacked.Owner.Entity);
                                                }
                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                attacker.Owner.SendScreen(suse, true);
                                                attacked.AuraStamp = Time32.Now;
                                                attacked.AuraTime = 20;
                                                attacked.WaterResistance += 30;
                                                attacked.RemoveFlag2(Update.Flags2.TyrantAura);
                                                attacked.RemoveFlag2(Update.Flags2.FendAura);
                                                attacked.RemoveFlag2(Update.Flags2.MetalAura);
                                                attacked.RemoveFlag2(Update.Flags2.WoodAura);
                                                attacked.RemoveFlag2(Update.Flags2.EarthAura);
                                                attacked.RemoveFlag2(Update.Flags2.FireAura);
                                                attacked.AddFlag2(Update.Flags2.WaterAura);
                                                PhoenixProject.Network.GamePackets.StatusIconData.AuraType tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                switch (spell.ID)
                                                {
                                                    case 0x28b4:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MetalAura;
                                                        break;

                                                    case 0x28b5:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WoodAura;
                                                        break;

                                                    case 0x28b6:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WaterAura;
                                                        break;

                                                    case 0x28b7:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FireAura;
                                                        break;

                                                    case 0x28b8:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.EarthAura;
                                                        break;

                                                    case 0x2bc0:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MagicDefender;
                                                        break;

                                                    case 0x289b:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                        break;

                                                    case 0x28aa:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FendAura;
                                                        break;
                                                }
                                                StatusIconData data = new StatusIconData
                                                {
                                                    AuraLevel = spell.Level,
                                                    AuraPower = spell.Power,
                                                    AuraType2 = tyrantAura,
                                                    Identifier = attacker.UID,
                                                    Type = PhoenixProject.Network.GamePackets.StatusIconData.AuraDataTypes.Add
                                                };
                                                attacker.Owner.Send((byte[])data);
                                                //Update ud = new Update(true);
                                            }
                                            //ud.Aura(attacked, attacked.WaterResistance, spell.Level, (byte)spell.Duration);
                                            break;
                                        }

                                    case 10424:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);
                                                if (attacker.Owner.Team != null)
                                                {
                                                    foreach (Client.GameState c in attacker.Owner.Team.Teammates)
                                                    {
                                                        if (c.Entity.MapID == attacker.MapID)
                                                        {
                                                            short distance = Kernel.GetDistance(c.Entity.X, c.Entity.Y, attacker.X, attacker.Y);
                                                            if (distance < ServerBase.Constants.pScreenDistance)
                                                            {
                                                                if (c.Entity.UID != attacker.UID)
                                                                {
                                                                    if (!c.AlternateEquipment)
                                                                    {
                                                                        c.LoadItemStats(c.Entity);
                                                                    }
                                                                    else
                                                                    {
                                                                        c.LoadItemStats2(c.Entity);
                                                                    }

                                                                    c.Entity.AuraStamp = Time32.Now;
                                                                    c.Entity.AuraTime = 20;
                                                                    c.Entity.EarthResistance += 30;
                                                                    c.Entity.RemoveFlag2(Update.Flags2.TyrantAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.FendAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.MetalAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.WoodAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.WaterAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.FireAura);
                                                                    c.Entity.AddFlag2(Update.Flags2.EarthAura);
                                                                    PhoenixProject.Network.GamePackets.StatusIconData.AuraType tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                                    switch (spell.ID)
                                                                    {
                                                                        case 0x28b4:
                                                                            tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MetalAura;
                                                                            break;

                                                                        case 0x28b5:
                                                                            tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WoodAura;
                                                                            break;

                                                                        case 0x28b6:
                                                                            tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WaterAura;
                                                                            break;

                                                                        case 0x28b7:
                                                                            tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FireAura;
                                                                            break;

                                                                        case 0x28b8:
                                                                            tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.EarthAura;
                                                                            break;

                                                                        case 0x2bc0:
                                                                            tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MagicDefender;
                                                                            break;

                                                                        case 0x289b:
                                                                            tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                                            break;

                                                                        case 0x28aa:
                                                                            tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FendAura;
                                                                            break;
                                                                    }
                                                                    StatusIconData data2 = new StatusIconData
                                                                    {
                                                                        AuraLevel = spell.Level,
                                                                        AuraPower = spell.Power,
                                                                        AuraType2 = tyrantAura,
                                                                        Identifier = c.Entity.UID,
                                                                        Type = PhoenixProject.Network.GamePackets.StatusIconData.AuraDataTypes.Add
                                                                    };
                                                                    c.Entity.Owner.Send((byte[])data2);

                                                                }
                                                            }
                                                        }

                                                    }
                                                }
                                                if (!attacked.Owner.AlternateEquipment)
                                                {
                                                    attacked.Owner.LoadItemStats(attacked.Owner.Entity);
                                                }
                                                else
                                                {
                                                    attacked.Owner.LoadItemStats2(attacked.Owner.Entity);
                                                }
                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                attacker.Owner.SendScreen(suse, true);
                                                attacked.AuraStamp = Time32.Now;
                                                attacked.AuraTime = 20;
                                                attacked.EarthResistance += 30;
                                                attacked.RemoveFlag2(Update.Flags2.TyrantAura);
                                                attacked.RemoveFlag2(Update.Flags2.FendAura);
                                                attacked.RemoveFlag2(Update.Flags2.MetalAura);
                                                attacked.RemoveFlag2(Update.Flags2.WoodAura);
                                                attacked.RemoveFlag2(Update.Flags2.WaterAura);
                                                attacked.RemoveFlag2(Update.Flags2.FireAura);
                                                attacked.AddFlag2(Update.Flags2.EarthAura);
                                                PhoenixProject.Network.GamePackets.StatusIconData.AuraType tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                switch (spell.ID)
                                                {
                                                    case 0x28b4:
                                                        tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MetalAura;
                                                        break;

                                                    case 0x28b5:
                                                        tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WoodAura;
                                                        break;

                                                    case 0x28b6:
                                                        tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WaterAura;
                                                        break;

                                                    case 0x28b7:
                                                        tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FireAura;
                                                        break;

                                                    case 0x28b8:
                                                        tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.EarthAura;
                                                        break;

                                                    case 0x2bc0:
                                                        tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MagicDefender;
                                                        break;

                                                    case 0x289b:
                                                        tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                        break;

                                                    case 0x28aa:
                                                        tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FendAura;
                                                        break;
                                                }
                                                StatusIconData data = new StatusIconData
                                                {
                                                    AuraLevel = spell.Level,
                                                    AuraPower = spell.Power,
                                                    AuraType2 = tyrantAura2,
                                                    Identifier = attacker.UID,
                                                    Type = PhoenixProject.Network.GamePackets.StatusIconData.AuraDataTypes.Add
                                                };
                                                attacker.Owner.Send((byte[])data);
                                                //Update ud = new Update(true);
                                            }
                                            ///ud.Aura(attacked, attacked.EarthResistance, spell.Level, (byte)spell.Duration);
                                            break;
                                        }
                                    case 10423:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);
                                                if (attacker.Owner.Team != null)
                                                {
                                                    foreach (Client.GameState c in attacker.Owner.Team.Teammates)
                                                    {
                                                        if (c.Entity.MapID == attacker.MapID)
                                                        {
                                                            short distance = Kernel.GetDistance(c.Entity.X, c.Entity.Y, attacker.X, attacker.Y);
                                                            if (distance < ServerBase.Constants.pScreenDistance)
                                                            {
                                                                if (c.Entity.UID != attacker.UID)
                                                                {
                                                                    if (!c.AlternateEquipment)
                                                                    {
                                                                        c.LoadItemStats(c.Entity);
                                                                    }
                                                                    else
                                                                    {
                                                                        c.LoadItemStats2(c.Entity);
                                                                    }

                                                                    c.Entity.AuraStamp = Time32.Now;
                                                                    c.Entity.AuraTime = 20;
                                                                    c.Entity.FireResistance += 30;
                                                                    c.Entity.RemoveFlag2(Update.Flags2.TyrantAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.FendAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.MetalAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.WoodAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.WaterAura);
                                                                    c.Entity.RemoveFlag2(Update.Flags2.EarthAura);
                                                                    c.Entity.AddFlag2(Update.Flags2.FireAura);
                                                                    PhoenixProject.Network.GamePackets.StatusIconData.AuraType tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                                    switch (spell.ID)
                                                                    {
                                                                        case 0x28b4:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MetalAura;
                                                                            break;

                                                                        case 0x28b5:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WoodAura;
                                                                            break;

                                                                        case 0x28b6:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WaterAura;
                                                                            break;

                                                                        case 0x28b7:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FireAura;
                                                                            break;

                                                                        case 0x28b8:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.EarthAura;
                                                                            break;

                                                                        case 0x2bc0:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MagicDefender;
                                                                            break;

                                                                        case 0x289b:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                                            break;

                                                                        case 0x28aa:
                                                                            tyrantAura2 = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FendAura;
                                                                            break;
                                                                    }
                                                                    StatusIconData data2 = new StatusIconData
                                                                    {
                                                                        AuraLevel = spell.Level,
                                                                        AuraPower = spell.Power,
                                                                        AuraType2 = tyrantAura2,
                                                                        Identifier = c.Entity.UID,
                                                                        Type = PhoenixProject.Network.GamePackets.StatusIconData.AuraDataTypes.Add
                                                                    };
                                                                    c.Entity.Owner.Send((byte[])data2);

                                                                }
                                                            }
                                                        }

                                                    }
                                                }
                                                if (!attacked.Owner.AlternateEquipment)
                                                {
                                                    attacked.Owner.LoadItemStats(attacked.Owner.Entity);
                                                }
                                                else
                                                {
                                                    attacked.Owner.LoadItemStats2(attacked.Owner.Entity);
                                                }
                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;
                                                attacker.Owner.SendScreen(suse, true);
                                                attacked.AuraStamp = Time32.Now;
                                                attacked.AuraTime = 20;
                                                attacked.FireResistance += 30;
                                                attacked.RemoveFlag2(Update.Flags2.TyrantAura);
                                                attacked.RemoveFlag2(Update.Flags2.FendAura);
                                                attacked.RemoveFlag2(Update.Flags2.MetalAura);
                                                attacked.RemoveFlag2(Update.Flags2.WoodAura);
                                                attacked.RemoveFlag2(Update.Flags2.WaterAura);
                                                attacked.RemoveFlag2(Update.Flags2.EarthAura);
                                                attacked.AddFlag2(Update.Flags2.FireAura);
                                                PhoenixProject.Network.GamePackets.StatusIconData.AuraType tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                switch (spell.ID)
                                                {
                                                    case 0x28b4:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MetalAura;
                                                        break;

                                                    case 0x28b5:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WoodAura;
                                                        break;

                                                    case 0x28b6:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.WaterAura;
                                                        break;

                                                    case 0x28b7:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FireAura;
                                                        break;

                                                    case 0x28b8:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.EarthAura;
                                                        break;

                                                    case 0x2bc0:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.MagicDefender;
                                                        break;

                                                    case 0x289b:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.TyrantAura;
                                                        break;

                                                    case 0x28aa:
                                                        tyrantAura = PhoenixProject.Network.GamePackets.StatusIconData.AuraType.FendAura;
                                                        break;
                                                }
                                                StatusIconData data = new StatusIconData
                                                {
                                                    AuraLevel = spell.Level,
                                                    AuraPower = spell.Power,
                                                    AuraType2 = tyrantAura,
                                                    Identifier = attacker.UID,
                                                    Type = PhoenixProject.Network.GamePackets.StatusIconData.AuraDataTypes.Add
                                                };
                                                attacker.Owner.Send((byte[])data);
                                            }
                                            // Update ud = new Update(true);
                                            // ud.Aura(attacked, attacked.FireResistance, spell.Level, (byte)spell.Duration);
                                            break;
                                        }
                                    case 10430:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = spell.ID;
                                                suse.SpellLevel = spell.Level;
                                                suse.X = X;
                                                suse.Y = Y;

                                                if (attacker.Owner.Team != null)
                                                {
                                                    PrepareSpell(spell, attacker.Owner);
                                                    foreach (Client.GameState teammate in attacker.Owner.Team.Teammates)
                                                    {
                                                        if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, teammate.Entity.X, teammate.Entity.Y) <= spell.Distance)
                                                        {
                                                            attacker.RemoveFlag(Update.Flags.Poisoned);

                                                            suse.Targets.Add(teammate.Entity.UID, 1);
                                                        }
                                                    }
                                                    if (attacked.EntityFlag == EntityFlag.Player)
                                                        attacked.Owner.SendScreen(suse, true);
                                                    else
                                                        attacked.MonsterInfo.SendScreen(suse);
                                                }
                                                else
                                                {
                                                    if (attacked == null)
                                                        return;
                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                                    {
                                                        PrepareSpell(spell, attacker.Owner);

                                                        attacker.RemoveFlag(Update.Flags.Poisoned);

                                                        suse.Targets.Add(attacked.UID, 1);

                                                        if (attacked.EntityFlag == EntityFlag.Player)
                                                            attacked.Owner.SendScreen(suse, true);
                                                        else
                                                            attacked.MonsterInfo.SendScreen(suse);
                                                    }
                                                    else
                                                    {
                                                        attacker.AttackPacket = null;
                                                    }
                                                }
                                            }
                                            attacker.AttackPacket = null;
                                            break;
                                        }
                                    //Serenity
                                    case 10400:
                                        {
                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                if (attacker == null) return;

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = SpellID;
                                                suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
                                                suse.X = X;
                                                suse.Y = Y;

                                                suse.Targets.Add(attacker.UID, 1);

                                                attacker.ToxicFogLeft = 0;
                                                attacker.NoDrugsTime = 0;
                                                attacker.RemoveFlag2(Update.Flags2.SoulShackle);
                                                SyncPacket packet3 = new SyncPacket
                                                {
                                                    Identifier = attacked.UID,
                                                    Count = 2,
                                                    Type = PhoenixProject.Network.GamePackets.SyncPacket.SyncType.StatusFlag,
                                                    StatusFlag1 = (ulong)attacked.StatusFlag,
                                                    StatusFlag2 = (ulong)attacked.StatusFlag2,
                                                    Unknown1 = 0x36,
                                                    StatusFlagOffset = 0x6f,
                                                    Time = 0,
                                                    Value = 0,
                                                    Level = spell.Level
                                                };
                                                attacked.Owner.Send((byte[])packet3);
                                                attacker.Owner.SendScreen(suse, true);
                                            }
                                            attacker.AttackPacket = null;
                                            break;
                                        }
                                    //Tranquility
                                    case 10425:
                                        {
                                            if (attacked == null) return;

                                            if (CanUseSpell(spell, attacker.Owner))
                                            {
                                                PrepareSpell(spell, attacker.Owner);

                                                if (attacked == null) return;

                                                SpellUse suse = new SpellUse(true);
                                                suse.Attacker = attacker.UID;
                                                suse.SpellID = SpellID;
                                                suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
                                                suse.X = X;
                                                suse.Y = Y;


                                                suse.Targets.Add(attacked.UID, 1);

                                                attacked.ToxicFogLeft = 0;
                                                attacked.ShackleTime = 0;
                                                attacked.NoDrugsTime = 0;
                                                attacked.RemoveFlag2(Update.Flags2.SoulShackle);
                                                if (attacked.EntityFlag == EntityFlag.Player)
                                                {
                                                    SyncPacket packet3 = new SyncPacket
                                                    {
                                                        Identifier = attacked.UID,
                                                        Count = 2,
                                                        Type = PhoenixProject.Network.GamePackets.SyncPacket.SyncType.StatusFlag,
                                                        StatusFlag1 = (ulong)attacked.StatusFlag,
                                                        StatusFlag2 = (ulong)attacked.StatusFlag2,
                                                        Unknown1 = 0x36,
                                                        StatusFlagOffset = 0x6f,
                                                        Time = 0,
                                                        Value = 0,
                                                        Level = spell.Level
                                                    };
                                                    attacked.Owner.Send((byte[])packet3);
                                                }
                                                if (attacked.EntityFlag == EntityFlag.Player)
                                                    attacked.Owner.SendScreen(suse, true);
                                                else
                                                    attacked.MonsterInfo.SendScreen(suse);
                                            }
                                            attacker.AttackPacket = null;
                                            break;
                                        }

                                    //WhirlwindKick
                                    case 10415:
                                        {
                                            if (Time32.Now < attacker.WhilrwindKick.AddMilliseconds(1200))
                                            { attacker.AttackPacket = null; return; }
                                            attacker.WhilrwindKick = Time32.Now;
                                            if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= 3)
                                            {
                                                if (CanUseSpell(spell, attacker.Owner))
                                                {
                                                    PrepareSpell(spell, attacker.Owner);

                                                    SpellUse suse = new SpellUse(true);
                                                    suse.Attacker = attacker.UID;
                                                    suse.SpellID = spell.ID;
                                                    suse.SpellLevel = 0;
                                                    suse.X = (ushort)ServerBase.Kernel.Random.Next(3, 10);
                                                    suse.Y = 0;

                                                    if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= 3)
                                                    {
                                                        for (int c = 0; c < attacker.Owner.Screen.Objects.Count; c++)
                                                        {
                                                            //For a multi threaded application, while we go through the collection
                                                            //the collection might change. We will make sure that we wont go off  
                                                            //the limits with a check.
                                                            if (c >= attacker.Owner.Screen.Objects.Count)
                                                                break;
                                                            Interfaces.IMapObject _obj = attacker.Owner.Screen.Objects[c];
                                                            if (_obj == null)
                                                                continue;
                                                            if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                            {
                                                                attacked = _obj as Entity;
                                                                if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
                                                                {
                                                                    if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Ranged))
                                                                    {
                                                                        uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);

                                                                        suse.Effect1 = attack.Effect1;
                                                                        ReceiveAttack(attacker, attacked, attack, damage, spell);
                                                                        attacked.Stunned = true;
                                                                        attacked.StunStamp = Time32.Now;
                                                                        suse.Targets.Add(attacked.UID, damage);

                                                                    }
                                                                }
                                                            }
                                                        }
                                                        attacker.AttackPacket = null;
                                                    }
                                                    else
                                                    {
                                                        attacker.AttackPacket = null; return;
                                                    }
                                                    attacker.Owner.SendScreen(suse, true);
                                                    suse.Targets = new SafeDictionary<uint, SpellUse.DamageClass>();
                                                    attacker.AttackPacket = null; return;
                                                }
                                                attacker.AttackPacket = null;
                                            }
                                            attacker.AttackPacket = null; return;
                                        }
                                    #endregion
                                    default:
                                        if (attacker.Owner.Account.State == PhoenixProject.Database.AccountTable.AccountState.ProjectManager)
                                            attacker.Owner.Send(new Message("Unknown spell id: " + spell.ID, System.Drawing.Color.CadetBlue, Message.Talk));
                                        break;

                                }

                                if (spell.CanKill == 0)
                                {
                                    attacker.Owner.IncreaseSpellExperience(80, spellID);
                                }
                                //  attacker.Owner.IncreaseSpellExperience(Experience, spellID);//kimo
                                if (attacker.MapID == 1039)
                                {
                                    if (spell.ID == 7001 || spell.ID == 9876)
                                    {
                                        attacker.AttackPacket = null;
                                        return;
                                    }
                                    if (attacker.AttackPacket != null)
                                    {
                                        attack.Damage = spell.ID;
                                        attacker.AttackPacket = attack;
                                        if (Database.SpellTable.WeaponSpells.ContainsValue(spell.ID))
                                        {
                                            if (attacker.AttackPacket == null)
                                            {
                                                attack.AttackType = Attack.Melee;
                                                attacker.AttackPacket = attack;
                                            }
                                            else
                                            {
                                                attacker.AttackPacket.AttackType = Attack.Melee;
                                            }
                                        }
                                    }
                                }
                                else
                                {
                                    if (spell.NextSpellID != 0)
                                    {
                                        if (spell.NextSpellID >= 1000 && spell.NextSpellID <= 1002)
                                            if (Target >= 1000000)
                                            {
                                                attacker.AttackPacket = null;
                                                return;
                                            }
                                        attack.Damage = spell.NextSpellID;
                                        attacker.AttackPacket = attack;
                                    }
                                    else
                                    {
                                        if (!Database.SpellTable.WeaponSpells.ContainsValue(spell.ID) || spell.ID == 9876)
                                            attacker.AttackPacket = null;
                                        else
                                        {
                                            if (attacker.AttackPacket == null)
                                            {
                                                attack.AttackType = Attack.Melee;
                                                attacker.AttackPacket = attack;
                                            }
                                            else
                                            {
                                                attacker.AttackPacket.AttackType = Attack.Melee;
                                            }
                                        }
                                    }
                                }
                            }
                            else
                            {
                                attacker.AttackPacket = null;
                            }
                        }
                    #endregion


                    }

                #endregion

                }
            #endregion
            }
        }