احصائياتى

الردود
14

المشاهدات
2246
 
ElSaher
.:: مشرف اقسام كونكر ::.

المشاركات
3,131

+التقييم
1.15

تاريخ التسجيل
Jun 2019

الاقامة
الزقازيق

نظام التشغيل
ويندوز 0

رقم العضوية
279
2019-08-18, 07:06 PM
المشاركة 1
2019-08-18, 07:06 PM
المشاركة 1
Like مـلـف اتــااكـأات 2 هــت للـسـرفـرت السهـلةة ..
بسـم الله الرحمان الرحيم

الـنهـااردة جيبـلـكـووم ملف الاتكـاات !

اتــاكـاات تـوو هـت للسـرفـرات السهـلة !

تــاابــعـوو ..

هـنـرووح ع كـلااس

كلاس Handle.cs

هتبحث عن دي

كود:
#region Allowed Skills 

بـعـد كــدا تقفـلهــا !!

بعد كدا تمسح من اول الكلمه دي لحد الكلمه دي


كود:
 default:
                                    { 

هتــمـسح الكـلأاس كـولو والاسكــلات كمــاان !!

هتبـدلـوو بـ داا ..


كود:
                            #region Allowed Skills
                            
if (!attacker.Owner.Fake)
                            {
                                var 
xspell = GetWeaponSpell(spell);
                                
//  var xspell = Database.SpellTable.WeaponSpells.Values.Where(p => p.Contains(spell.ID)).FirstOrDefault();
                                
if (xspell != null)
                                {
                                    if (!
attack.weaponspell && spell.Sort == SpellSort.SingleWeaponSkill)
                                    {
                                        
attacker.AttackPacket = null;
                                        return;
                                    }
                                }
                                
                                if (
attacker.Owner.LobbyGroup != null)
                                {
                                    if (
attacker.Owner.LobbyGroup.MatchType == Lobby.MatchType.FBSS)
                                    {
                                        if (
spellID != 1045 && spellID != 1046 && spellID != 11005)
                                        {
                                            
attacker.AttackPacket = null;
                                            return;
                                        }
                                    }
                                }

                                if (
spellID == 1045 || spellID == 1046)
                                {
                                    if (
attack.Attacked != 0)
                                    {
                                        
attacker.AttackPacket = null;
                                        return;
                                    }
                                }
                            }
                            
#endregion

                            
switch (spellID)
                            {
                                
#region Single magic damage spells
                                
case 11030:
                                case 
1000:
                                case 
1001:
                                case 
1002:
                                case 
1150:
                                case 
1160:
                                case 
1180:
                                case 
1320:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            if (
spell.ID == 10310)
                                            {
                                                if (
Time32.Now > attacker.EagleEyeStamp.AddSeconds(20))
                                                    return;
                                                
attacker.EagleEyeStamp = Time32.Now;
                                            }
                                            if (
attacked != null)
                                            {
                                                if (
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.Melee(attacker, attacked, spell, ref attack, client_Spell.LevelHu2);
                                                        
damage = (uint)(damage * 0.8);
                                                        if (
spell.ID == 11030)
                                                        {
                                                            
attack.Effect1 = Attack.AttackEffects1.None;
                                                            
damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
                                                        }
                                                        
suse.Effect1 = attack.Effect1;

                                                        
suse.Effect1 = attack.Effect1;

                                                        
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
                                                        if (
Time32.Now >= attacker.SpellStamp.AddMilliseconds(1900))
                                                        {
                                                            if (
spell.ID == 1002)
                                                            {
                                                                if (
attacked.EntityFlag == EntityFlag.Entity)
                                                                    
attacked.Owner.BreakTouch(attacker.Owner);

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

                                                            }
                                                        }
                                                        
suse.AddTarget(attacked, damage, attack);
                                                        
attacker.Owner.Player.IsEagleEyeShooted = true;

                                                        if (
attacked.EntityFlag == EntityFlag.Entity)
                                                            
attacked.Owner.SendScreen(suse, true);
                                                        else
                                                            
attacked.MonsterInfo.SendScreen(suse);

                                                        var 
attackd = attacked as Entity;
                                                        if (
Kernel.BlackSpoted.ContainsKey(attackd.UID) && spell.ID == 11030)
                                                        {
                                                            
attacker.Owner.Player.IsEagleEyeShooted = false;
                                                            if (
attacker.Owner.Spells.ContainsKey(11130))
                                                            {
                                                                var 
s = attacker.Owner.Spells[11130];
                                                                var 
sspell = Database.SpellTable.SpellInformations[s.ID][s.Level];
                                                                if (
spell != null)
                                                                {
                                                                    
attacker.EagleEyeStamp = Time32.Now;
                                                                    
attacker.Owner.Player.IsEagleEyeShooted = false;
                                                                    
SpellUse ssuse = new SpellUse(true);
                                                                    
ssuse.Attacker = attacker.UID;
                                                                    
ssuse.SpellID = sspell.ID;
                                                                    
ssuse.SpellLevel = sspell.Level;
                                                                    
ssuse.AddTarget(attacker.Owner.Player, new SpellUse.DamageClass().Damage = 11030, attack);
                                                                    if (
attacker.EntityFlag == EntityFlag.Entity)
                                                                    {
                                                                        
attacker.Owner.SendScreen(ssuse, true);
                                                                    }

                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    
attacker.AttackPacket = null;
                                                }
                                            }
                                            else
                                            {
                                                if (
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.AddTarget(attackedsob, damage, attack);

                                                        
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.AddTarget(attacker, spell.Power, attack);

                                            
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 (
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.AddTarget(attackedsob, damage, attack);

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

                                                                if (
spell.NextSpellID != 0)
                                                                {
                                                                    
attack.Damage = spell.NextSpellID;
                                                                    
attacker.AttackPacket = attack;
                                                                }
                                                                else
                                                                {
                                                                    
attacker.AttackPacket = null;
                                                                }
                                                            }
                                                        }
                                                        if (
attacked.EntityFlag == EntityFlag.Entity)
                                                            
attacked.Owner.SendScreen(suse, true);
                                                        else
                                                            
attacked.MonsterInfo.SendScreen(suse);
                                                    }
                                                    else
                                                    {
                                                        if (
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.AddTarget(attacked, damage, attack);

                                                            if (
spell.NextSpellID != 0)
                                                            {
                                                                
attack.Damage = spell.NextSpellID;
                                                                
attacker.AttackPacket = attack;
                                                            }
                                                            else
                                                            {
                                                                
attacker.AttackPacket = null;
                                                            }
                                                            if (
attacked.EntityFlag == EntityFlag.Entity)
                                                                
attacked.Owner.SendScreen(suse, true);
                                                            else
                                                                
attacked.MonsterInfo.SendScreen(suse);
                                                        }
                                                        else
                                                        {
                                                            
attacker.AttackPacket = null;
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    if (
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.AddTarget(attacked, damage, attack);

                                                        if (
spell.NextSpellID != 0)
                                                        {
                                                            
attack.Damage = spell.NextSpellID;
                                                            
attacker.AttackPacket = attack;
                                                        }
                                                        else
                                                        {
                                                            
attacker.AttackPacket = null;
                                                        }
                                                        if (
attacked.EntityFlag == EntityFlag.Entity)
                                                            
attacked.Owner.SendScreen(suse, true);
                                                        else
                                                            
attacked.MonsterInfo.SendScreen(suse);
                                                    }
                                                    else
                                                    {
                                                        
attacker.AttackPacket = null;
                                                    }
                                                }
                                            }
                                        }
                                        else
                                        {
                                            
attacker.AttackPacket = null;
                                        }
                                        break;
                                    }
                                
#endregion

                                #region AuroraLotus
                                
case 12370:
                                    {
                                        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.Owner.SendScreen(suse, true);
                                            
FloorItem item = new FloorItem(true);
                                            
item.UID = FloorItem.FloorUID.Next;
                                            
item.ItemID = FloorItem.AuroraLotus;
                                            
item.MapID = attacker.MapID;
                                            
item.X = X;
                                            
item.Y = Y;
                                            
item.ItemColor = (Game.Enums.Color)25;
                                            
item.Type = FloorItem.Effect;
                                            
item.mColor = 13;
                                            
item.OwnerUID = attacker.UID;
                                            
item.OwnerGuildUID = attacker.GuildID;
                                            
item.Name = spell.Name;
                                            
item.Owner = attacker.Owner;
                                            
item.OnFloor = Time32.Now;
                                            
item.FlowerType = 3;
                                            
item.Timer = Kernel.Gettime();
                                            
attacker.Owner.Map.AddFloorItem(item);
                                            
attacker.Owner.SendScreenSpawn(item, true);
                                            
attacker.Energy = 0;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region FlameLotus
                                
case 12380:
                                    {
                                        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.Owner.SendScreen(suse, true);
                                            
FloorItem item = new FloorItem(true);
                                            
item.UID = FloorItem.FloorUID.Next;
                                            
item.ItemID = FloorItem.FlameLotus;
                                            
item.MapID = attacker.MapID;
                                            
item.X = X;
                                            
item.Y = Y;
                                            
item.ItemColor = (Game.Enums.Color)25;
                                            
item.Type = FloorItem.Effect;
                                            
item.mColor = 13;
                                            
item.OwnerUID = attacker.UID;
                                            
item.OwnerGuildUID = attacker.GuildID;
                                            
item.Name = spell.Name;
                                            
item.Owner = attacker.Owner;
                                            
item.OnFloor = Time32.Now;
                                            
item.FlowerType = 3;
                                            
item.Timer = Kernel.Gettime();
                                            
attacker.Owner.Map.AddFloorItem(item);
                                            
attacker.Owner.SendScreenSpawn(item, true);
                                            
attacker.Energy = 0;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Revive
                                
case 1050:
                                case 
1100:
                                    {
                                        if (
attackedsob != null)
                                            return;
                                        if (
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.AddTarget(attacked, 0, attack);
                                                
attacked.Owner.Player.Action =
                                                
Game.Enums.ConquerAction.None;
                                                
attacked.Owner.ReviveStamp = Time32.Now;
                                                
attacked.Owner.Attackable = false;
                                                
attacked.Owner.Player.TransformationID = 0;
                                                
attacked.Owner.Player.RemoveFlag((ulong)Update.Flags.Dead);
                                                
attacked.Owner.Player.RemoveFlag((ulong)Update.Flags.Ghost);
                                                
attacked.Owner.Player.Hitpoints = attacked.Owner.Player.MaxHitpoints;
                                                
attacked.Ressurect();
                                                
attacked.Owner.SendScreen(suse, true);
                                                if (
attacker.Owner.Spells.ContainsKey(12390))
                                                {
                                                    if (
Kernel.Rate(Database.SpellTable.GetSpell(12390, attacker.Owner).Percent))
                                                    {
                                                        
SpellUse susee = new SpellUse(true);
                                                        
susee.Attacker = attacker.UID;
                                                        
susee.SpellID = 12390;
                                                        
susee.SpellLevel = attacker.Owner.Spells[12390].Level;
                                                        
susee.X = attacked.X;
                                                        
susee.Y = attacked.Y;
                                                        
attacked.Owner.SendScreen(susee, true);
                                                        
attacked.AddFlag((ulong)Update.Flags.Stigma);
                                                        
attacked.StigmaStamp = Time32.Now;
                                                        
attacked.StigmaIncrease = 15;
                                                        
attacked.StigmaTime = 60;
                                                        
attacked.MagicShieldStamp = Time32.Now;
                                                        
attacked.MagicShieldIncrease = 15;
                                                        
attacked.MagicShieldTime = 60;
                                                        
attacked.LoadTopStatus();
                                                        
attacked.AddFlag(Update.Flags.MagicShield);
                                                        
attacked.AddFlag(Update.Flags.StarOfAccuracy);
                                                        
attacked.AccuracyStamp = Time32.Now;
                                                        
attacked.AccuracyTime = 60;
                                                    }
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion

                                #region Linear spells
                                
case 11000:

                                case 
11005:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
PrepareSpell(spell, attacker.Owner);
                                            
Game.Attacking.InLineAlgorithm ila = new ahmedfathy.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;
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
                                                {
                                                    
attacked = _obj as Entity;
                                                    if (
ila.InLine(attacked.X, attacked.Y))
                                                    {
                                                        if (!
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            continue;

                                                        
attack.Effect1 = Attack.AttackEffects1.None;
                                                        
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack, client_Spell.LevelHu2);
                                                        
damage = (damage * 46) / 100;
                                                        
suse.Effect1 = attack.Effect1;

                                                        
attack.Damage = damage;

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

                                                        
suse.AddTarget(attacked, damage, attack);
                                                    }
                                                }
                                                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 = (damage * 46) / 100;
                                                        
attack.Damage = damage;

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

                                                        
suse.AddTarget(attackedsob, damage, attack);
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Linear spells

                                
case 1045:
                                case 
1046:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
PrepareSpell(spell, attacker.Owner);
                                            
Game.Attacking.InLineAlgorithm ila = new ahmedfathy.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;
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
                                                {
                                                    
attacked = _obj as Entity;
                                                    if (
ila.InLine(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, ref attack);

                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.King)
                                                            {
                                                                
damage = (uint)(damage * 1.100);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Prince)
                                                            {
                                                                
damage = (uint)(damage * 1.000);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Duke)
                                                            {
                                                                
damage = (uint)(damage * 0.940);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Earl)
                                                            {
                                                                
damage = (uint)(damage * 0.990);
                                                            }
                                                            
suse.Effect1 = attack.Effect1;

                                                            
attack.Damage = damage;

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

                                                            
suse.AddTarget(attacked, damage, attack);
                                                        }
                                                    }
                                                    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 = (damage * 180) / 100;
                                                            
attack.Damage = damage;

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

                                                            
suse.AddTarget(attackedsob, damage, attack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion

                                #region XPSpells inofensive
                                
case 1015:
                                case 
1020:
                                case 
1110:
                                case 
6011:
                                case 
10390:
                                    {
                                        if (
Time32.Now >= attacker.SpellStamp.AddMilliseconds(500))
                                        {
                                            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.AddTarget(attacked, 0, attack);

                                                if (
spell.ID == 6011)
                                                {
                                                    
attacked.FatalStrikeStamp = Time32.Now;
                                                    
attacked.FatalStrikeTime = 60;
                                                    
attacked.AddFlag(Update.Flags.FatalStrike);
                                                    
attacker.RemoveFlag(Update.Flags.Ride);
                                                }
                                                else
                                                {
                                                    if (
spell.ID == 1110 || 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
                                                    {
                                                        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 = 1.1f;
                                                            
attacked.ShieldTime = 60;
                                                        }
                                                        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);
                                                
attacker.SpellStamp = Time32.Now;
                                            }
                                        }
                                        break;
                                    }
                                
#endregion

                                #region Circle spells
                                
case 1010:
                                case 
1120:
                                case 
1125:
                                case 
3090:
                                case 
5001:
                                case 
8030:
                                case 
1115:
                                    {
                                        if (
spell.ID == 10315)
                                        {
                                            if (
attacker.Owner.Weapons.Item1 == null) return;
                                            if (
attacker.Owner.Weapons.Item1.IsTwoHander()) return;
                                        }
                                        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;
                                            
UInt16 ox, oy;
                                            
ox = attacker.X;
                                            
oy = attacker.Y;
                                            if (
spellID == 10315)
                                            {
                                                
Attack npacket = new Attack(true);
                                                
npacket.Attacker = attacker.UID;
                                                
npacket.AttackType = 53;
                                                
npacket.X = X;
                                                
npacket.Y = Y;
                                                
Writer.WriteUInt16(spell.ID, 28, npacket.ToArray());
                                                
Writer.WriteByte(spell.Level, 30, npacket.ToArray());
                                                
attacker.Owner.SendScreen(npacket, true);
                                                
attacker.X = X;
                                                
attacker.Y = Y;
                                                
attacker.SendSpawn(attacker.Owner);
                                            }

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

                                                            if (
objs.MapObjType == MapObjectType.Monster || objs.MapObjType == MapObjectType.Entity)
                                                            {
                                                                
attacked = objs as Entity;
                                                                if (
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, client_Spell.LevelHu2);
                                                                        
damage = (uint)(damage * 0.5);

                                                                        
suse.Effect1 = attack.Effect1;
                                                                        if (
spell.Power > 0)
                                                                        {
                                                                            
attack.Effect1 = Attack.AttackEffects1.None;
                                                                            
damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell, ref attack, client_Spell.LevelHu2);
                                                                            
damage = (uint)(damage * 0.5);
                                                                            
suse.Effect1 = attack.Effect1;
                                                                        }
                                                                        if (
spell.ID == 8030)
                                                                        {
                                                                            
attack.Effect1 = Attack.AttackEffects1.None;
                                                                            
damage = Game.Attacking.Calculate.Ranged(attacker, attacked, ref attack, client_Spell.LevelHu2);
                                                                        }

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

                                                                        
suse.AddTarget(attacked, damage, attack);
                                                                    }
                                                                }
                                                            }
                                                            else if (
objs.MapObjType == MapObjectType.SobNpc)
                                                            {
                                                                
attackedsob = objs as SobNpcSpawn;
                                                                if (
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.AddTarget(attackedsob, damage, attack);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                        {
                                                            if (
_obj == null)
                                                                continue;
                                                            if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
                                                            {
                                                                
attacked = _obj as Entity;
                                                                if (
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.Magic(attacker, attacked, spell, ref attack, client_Spell.LevelHu2);

                                                                        if (
spell.ID == 1115)
                                                                        {
                                                                            
attack.Effect1 = Attack.AttackEffects1.None;
                                                                            
damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack, client_Spell.LevelHu2);
                                                                            
damage = (uint)(damage * 0.55);
                                                                        }
                                                                        else if (
spell.Power > 0)
                                                                        {
                                                                            
attack.Effect1 = Attack.AttackEffects1.None;
                                                                            
damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell, ref attack, client_Spell.LevelHu2);

                                                                        }
                                                                        
suse.Effect1 = attack.Effect1;
                                                                        
ReceiveAttack(attacker, attacked, attack, ref damage, spell);

                                                                        
suse.AddTarget(attacked, damage, attack);


                                                                    }
                                                                }
                                                            }
                                                            else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                            {
                                                                
attackedsob = _obj as SobNpcSpawn;
                                                                if (
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.AddTarget(attackedsob, damage, attack);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    
attacker.AttackPacket = null;
                                                }
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                            
ahmedfathy.Game.Calculations.IsBreaking(attacker.Owner, ox, oy);
                                        }
                                        break;
                                    }
                                
#endregion

                                #region Buffers
                                
case 1075:
                                case 
1085:
                                case 
1090:
                                case 
1095:
                                case 
3080:
                                case 
10405:
                                case 
30000:
                                    {
                                        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.AddTarget(attackedsob, 0, null);

                                                
attacker.Owner.SendScreen(suse, true);
                                            }
                                        }
                                        else
                                        {
                                            if (
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.AddTarget(attacked, 0, null);

                                                    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.Entity)
                                                                
attacked.Owner.Send(Constants.Invisibility(spell.Duration));
                                                        }
                                                        else
                                                        {
                                                            
attacked.AccuracyStamp = Time32.Now;
                                                            
attacked.StarOfAccuracyStamp = Time32.Now;
                                                            
attacked.StarOfAccuracyTime = 0;
                                                            
attacked.AccuracyTime = 0;
                                                            
attacker.Stamina -= 0;//////////////
                                                            
attacker.Stamina += 150;//////////

                                                            
attacked.AddFlag(Update.Flags.StarOfAccuracy);
                                                            
attacked.StarOfAccuracyStamp = Time32.Now;
                                                            
attacked.StarOfAccuracyTime = (byte)spell.Duration;
                                                            if (
attacked.EntityFlag == EntityFlag.Entity)
                                                                
attacked.Owner.Send(Constants.Accuracy(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 = 1.1f;//spell.PowerPercent;
                                                            
attacked.MagicShieldTime = (byte)spell.Duration;
                                                            if (
attacked.EntityFlag == EntityFlag.Entity)
                                                                
attacked.Owner.Send(Constants.Shield(spell.PowerPercent, 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.Entity)
                                                                
attacked.Owner.Send(Constants.Stigma(spell.PowerPercent, spell.Duration));
                                                        }
                                                        else if (
spell.ID == 30000)
                                                        {
                                                            if (
attacked.ContainsFlag2(Update.Flags2.AzureShield))
                                                            {
                                                                return;
                                                            }

                                                            if (
spell.Level == 0)
                                                                
attacked.AzureShieldDefence = 3000;
                                                            else
                                                                
attacked.AzureShieldDefence = (ushort)(3000 * spell.Level);
                                                            
attacked.AzureShieldLevel = spell.Level;
                                                            
attacked.MagicShieldStamp = Time32.Now;

                                                            
attacked.AzureShieldStamp = DateTime.Now;
                                                            
attacked.AddFlag2(Update.Flags2.AzureShield);
                                                            
attacked.MagicShieldTime = spell.Percent;
                                                            
attacked.AzureShieldPacket();
                                                            if (
attacked.EntityFlag == EntityFlag.Entity)
                                                                
attacked.Owner.Send(Constants.Shield(12000, attacked.MagicShieldTime));
                                                        }
                                                        if (
spell.ID == 10405 && attacked.Dead)
                                                        {
                                                            if (
attacked.EntityFlag != EntityFlag.Entity) break;
                                                            if (!
attacked.ContainsFlag2(Update.Flags2.SoulShackle))
                                                            {
                                                                if ((
attacked.BattlePower - attacker.BattlePower) > 20) break;
                                                                {
                                                                    
#region Perfection
                                                                    
Game.Enums.PerfectionEffect effect = Enums.PerfectionEffect.FreeSoul;
                                                                    
byte chance = 0;
                                                                    new 
MsgRefineEffect().HandleFreeSoul(attacker, ref chance);
                                                                    if (
Kernel.Rate(chance))
                                                                    {
                                                                        new 
MsgRefineEffect().SendEffect(attacked, attacker, effect);
                                                                        break;
                                                                    }
                                                                    
#endregion
                                                                    
attacker.SpellStamp = Time32.Now;
                                                                    
attacked.AddFlag(Update.Flags.Dead);
                                                                    
attacked.AddFlag2(Update.Flags2.SoulShackle);
                                                                    
attacked.ShackleStamp = Time32.Now;
                                                                    
attacked.ShackleTime = 90;
                                                                    
Network.GamePackets.Update upgrade = new Network.GamePackets.Update(true);
                                                                    
upgrade.UID = attacked.UID;
                                                                    
upgrade.Append((byte)Network.GamePackets.Update.DataType.SoulShackle, 111, 90, 0, spell.Level);
                                                                    
attacked.Owner.Send(upgrade.ToArray());
                                                                    if (
attacked.EntityFlag == EntityFlag.Entity) attacked.Owner.Send(Constants.Shackled(attacked.ShackleTime));
                                                                }
                                                            }
                                                        }
                                                    }
                                                    if (
attacked.EntityFlag == EntityFlag.Entity)
                                                        
attacked.Owner.SendScreen(suse, true);
                                                    else
                                                        
attacked.MonsterInfo.SendScreen(suse);

                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion

                                #region Percent
                                
case 3050:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            if (
attackedsob != null)
                                            {
                                                if (
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.AddTarget(attackedsob, damage, attack);

                                                        
attacker.Owner.SendScreen(suse, true);
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                if (
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 (
attacked.Owner != null)
                                                        {
                                                            
attacked.Owner.UpdateQualifier(damage);
                                                        }
                                                        
attacked.Hitpoints -= damage;

                                                        
suse.AddTarget(attacked, damage, attack);

                                                        if (
attacked.EntityFlag == EntityFlag.Entity)
                                                            
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;
                                            
PrepareSpell(spell, attacker.Owner);
                                            if (
attacker.Owner.Team != null)
                                            {
                                                foreach (
Client.GameState teammate in attacker.Owner.Team.Teammates)
                                                {
                                                    if (
teammate.Player.UID != attacker.UID)
                                                    {
                                                        if (
Kernel.GetDistance(attacker.X, attacker.Y, teammate.Player.X, teammate.Player.Y) <= 18)
                                                        {
                                                            
teammate.XPCount += 20;
                                                            
suse.AddTarget(teammate.Player, 20, null);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion

                                #region WeaponSpells
                                #region Circle
                                
case 5010:
                                case 
7020:
                                    {

                                        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 (
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.Entity)
                                                    {
                                                        
attacked = _obj as Entity;
                                                        if (
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, client_Spell.LevelHu2);
                                                                
suse.Effect1 = attack.Effect1;

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

                                                                
suse.AddTarget(attacked, damage, attack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob = _obj as SobNpcSpawn;
                                                        if (
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);
                                                                
ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                                
suse.AddTarget(attackedsob, damage, attack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket = null;
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                        }

                                        break;
                                    }
                                
#endregion

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

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

                                            if (
Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= attacker.AttackRange + 1)
                                            {
                                                if (
attackedsob != null)
                                                {
                                                    if (
CanAttack(attacker, attackedsob, spell))
                                                    {
                                                        
suse.Attacked = attackedsob.UID;
                                                        
PrepareSpell(spell, attacker.Owner);
                                                        
attack.Effect1 = Attack.AttackEffects1.None;
                                                        
uint AllDamage = 0;
                                                        
uint damage1 = 0;
                                                        
uint damage2 = 0;
                                                        
uint damage = 0;
                                                        
Network.GamePackets.Attack.AttackEffects1 Eff1 = 0;
                                                        
Network.GamePackets.Attack.AttackEffects1 Eff2 = 0;
                                                        
Network.GamePackets.Attack.AttackEffects1 Eff3 = 0;
                                                        
damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                        
AllDamage += damage;
                                                        
Eff1 = attack.Effect1;
                                                        
attack.Effect1 = Attack.AttackEffects1.None;
                                                        if (
attackedsob.Hitpoints <= AllDamage)
                                                        {
                                                            
suse.Effect1 = attack.Effect1;
                                                            
suse.Damage += damage;

                                                        }
                                                        else
                                                        {
                                                            
damage1 = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                            
Eff2 = attack.Effect1;
                                                            
attack.Effect1 = Attack.AttackEffects1.None;
                                                            
AllDamage += damage1;
                                                            if (
attackedsob.Hitpoints <= AllDamage)
                                                            {
                                                                
suse.Effect1 = attack.Effect1;
                                                                
suse.Effect2 = attack.Effect2;
                                                                
suse.Damage += damage;
                                                            }
                                                            else
                                                            {
                                                                
damage2 = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                                
Eff3 = attack.Effect1;
                                                                
attack.Effect1 = Attack.AttackEffects1.None;
                                                                
AllDamage += damage2;
                                                                
suse.Effect1 = attack.Effect1;
                                                                
suse.Effect2 = attack.Effect2;
                                                                
suse.Damage = damage;

                                                            }
                                                        }
                                                        if (
spellID == 10490)
                                                        {
                                                            if (
attacker.EpicMonk())
                                                            {
                                                                if (
attacker.Owner.Spells.ContainsKey(12570))
                                                                {
                                                                    
attacker.WrathoftheEmperor = true;
                                                                    
attacker.WrathoftheEmperorStamp = DateTime.Now;
                                                                }
                                                            }
                                                        }
                                                        
ReceiveAttack(attacker, attackedsob, attack, AllDamage, spell);

                                                    }
                                                }
                                                else
                                                {
                                                    if (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                    {
                                                        
suse.Attacked = attacked.UID;
                                                        
PrepareSpell(spell, attacker.Owner);
                                                        
attack.Effect1 = Attack.AttackEffects1.None;
                                                        
uint AllDamage = 0;
                                                        
uint damage1 = 0;
                                                        
uint damage2 = 0;
                                                        
uint damage = 0;
                                                        
Network.GamePackets.Attack.AttackEffects1 Eff1 = 0;
                                                        
Network.GamePackets.Attack.AttackEffects1 Eff3 = 0;
                                                        
damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
                                                        
damage1 = (uint)(damage1 * 1.5);
                                                        
//damage1 = (damage1 * 103) / 100;
                                                        
AllDamage += damage;
                                                        
Eff1 = attack.Effect1;
                                                        
attack.Effect1 = Attack.AttackEffects1.None;
                                                        if (
attacked.Hitpoints <= AllDamage)
                                                        {
                                                            
suse.Effect1 = attack.Effect1;
                                                            
suse.Damage += damage;
                                                        }
                                                        else
                                                        {
                                                            
damage1 = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
                                                            
damage1 = (uint)(damage1 * 1.5);
                                                            
//damage1 = (damage1 * 103) / 100;
                                                            
AllDamage += damage;
                                                            
Eff3 = attack.Effect1;
                                                            
attack.Effect1 = Attack.AttackEffects1.None;
                                                            
AllDamage += damage1;
                                                            if (
attacked.Hitpoints <= AllDamage)
                                                            {
                                                                
suse.Effect1 = attack.Effect1;
                                                                
suse.Effect2 = attack.Effect2;
                                                                
suse.Damage += damage;
                                                            }
                                                            else
                                                            {
                                                                
damage2 = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
                                                                
damage2 = (uint)(damage2 * 1.5);
                                                                
//damage2 = (damage2 * 22) / 100;
                                                                
Eff3 = attack.Effect1;
                                                                
attack.Effect1 = Attack.AttackEffects1.None;
                                                                
AllDamage += damage2;
                                                                
suse.Effect1 = attack.Effect1;
                                                                
suse.Effect2 = attack.Effect2;
                                                                
suse.Damage = damage;
                                                            }
                                                        }
                                                        if (
spellID == 10490)
                                                        {
                                                            if (
attacker.EpicMonk())
                                                            {
                                                                if (
attacker.Owner.Spells.ContainsKey(12570))
                                                                {
                                                                    
attacker.WrathoftheEmperor = true;
                                                                    
attacker.WrathoftheEmperorStamp = DateTime.Now;
                                                                }
                                                            }
                                                        }
                                                        
ReceiveAttack(attacker, attacked, attack, ref AllDamage, spell);
                                                    }
                                                }
                                                
//attacker.AttackPacket = null;
                                            
}
                                            else
                                            {
                                                
attacker.AttackPacket = null;
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        
//attacker.AttackPacket = null;
                                        
break;
                                    }
                                case 
1290:
                                case 
5030:
                                case 
5040:
                                case 
7000:
                                case 
7010:
                                case 
7030:
                                case 
7040:
                                    {
                                        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.SpellLevelHu = client_Spell.LevelHu2;
                                            
suse.X = X;
                                            
suse.Y = Y;

                                            if (
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);
                                                        
ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                        
suse.AddTarget(attackedsob, damage, attack);
                                                    }
                                                }
                                                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, client_Spell.LevelHu2);
                                                        
damage = (uint)(damage * 0.7);
                                                        
suse.Effect1 = attack.Effect1;

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

                                                        
suse.AddTarget(attacked, damage, attack);
                                                    }
                                                }
                                                
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.SpellLevelHu = client_Spell.LevelHu2;
                                            
suse.Y = Y;
                                            
Sector sector = new Sector(attacker.X, attacker.Y, X, Y);
                                            
sector.Arrange(spell.Sector, spell.Range);
                                            if (
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.Entity)
                                                    {
                                                        
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, client_Spell.LevelHu2);

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

                                                                
suse.AddTarget(attacked, damage, attack);
                                                            }
                                                        }
                                                    }
                                                    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);

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

                                                                
suse.AddTarget(attackedsob, damage, attack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket = null;
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion

                                #region Fly
                                
case 8002:
                                case 
8003:
                                    {
                                        if (
attacker.Owner.Map.ID == 1645)
                                        {
                                            
Kernel.SendWorldMessage(new Message("Mr: " + attacker.Name + " You Can`t Use Fly Here !!!", System.Drawing.Color.White, Message.Talk), Program.Values);
                                            return;
                                        }
                                        if (
attacker.Owner.Map.ID == 1645)
                                        {
                                            
Kernel.SendWorldMessage(new Message("Mr: " + attacker.Name + " You Can`t Use Fly Here !!!", System.Drawing.Color.White, Message.Talk), Program.Values);
                                            return;
                                        }
                                        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.AddTarget(attacker, attacker.FlyTime, null);

                                            
attacker.AddFlag(Update.Flags.Fly);
                                            
attacker.RemoveFlag(Update.Flags.Ride);
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion


                                #region Ninja Spells
                                
case 6010:
                                    {
                                        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;
                                        
//suse.SpellLevelHu = client_Spell.LevelHu2;
                                        
foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                        {
                                            if (
_obj == null)
                                                continue;
                                            if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
                                            {
                                                
attacked = _obj as Entity;
                                                if (
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, client_Spell.LevelHu2);
                                                        
//   damage = (UInt32)((damage * 25) / 100);
                                                        
suse.Effect1 = attack.Effect1;

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

                                                        
suse.AddTarget(attacked, damage, attack);
                                                    }
                                                }
                                            }
                                            else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                            {
                                                
attackedsob = _obj as SobNpcSpawn;
                                                if (
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.AddTarget(attackedsob, damage, attack);
                                                    }
                                                }
                                            }
                                        }
                                        
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;
                                            
//suse.SpellLevelHu = client_Spell.LevelHu2;
                                            
if (Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Distance)
                                            {
                                                foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (
_obj.MapObjType == MapObjectType.Entity || _obj.MapObjType == MapObjectType.Monster)
                                                    {
                                                        
attacked = _obj as Entity;
                                                        if (
attacked.MapObjType == MapObjectType.Monster)
                                                            if (
attacked.MonsterInfo.Boss)
                                                                continue;
                                                        if (
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 (
Kernel.Rate(rate))
                                                                {
                                                                    
attacked.ToxicFogStamp = Time32.Now;
                                                                    
attacked.ToxicFogLeft = 20;
                                                                    
attacked.ToxicFogPercent = spell.PowerPercent;
                                                                    
attacked.AddFlag(Update.Flags.Poisoned);
                                                                    
suse.AddTarget(attacked, 1, null);
                                                                }
                                                                else
                                                                {
                                                                    
suse.AddTarget(attacked, 0, null);
                                                                    
suse.Targets[attacked.UID].Hit = false;
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket = null;
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                case 
6000:
                                    {
                                        
// if (Time32.Now >= attacker.SpellStamp.AddMilliseconds(1))
                                        
{
                                            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 (
Kernel.GetDistance(attacker.X, attacker.Y, Xx, Yx) <= 5)
                                                {
                                                    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;
                                                    
//suse.SpellLevelHu = client_Spell.LevelHu2;
                                                    
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, client_Spell.LevelHu2);
                                                            
suse.Effect1 = attack.Effect1;
                                                            
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
                                                            
suse.AddTarget(attacked, damage, attack);
                                                            
send = true;

                                                            if (
attacker.Owner.Spells.ContainsKey(11230) && !attacked.Dead)
                                                            {
                                                                var 
s = attacker.Owner.Spells[11230];
                                                                var 
spellz = Database.SpellTable.SpellInformations[s.ID][s.Level];
                                                                if (
spellz != null)
                                                                {
                                                                    if (
Kernel.Rate(spellz.Percent))
                                                                    {
                                                                        
SpellUse ssuse = new SpellUse(true);
                                                                        
ssuse.Attacker = attacker.UID;
                                                                        
ssuse.SpellID = spellz.ID;

                                                                        
ssuse.SpellLevel = spellz.Level;
                                                                        
damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack) / 2;
                                                                        
damage = 1000;
                                                                        
ssuse.AddTarget(attacked, new SpellUse.DamageClass().Damage = damage, attack);
                                                                        
ReceiveAttack(attacker, attacked, attack, ref damage, spellz);
                                                                        
attacker.Owner.SendScreen(ssuse, true);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        if (
CanAttack(attacker, attackedsob, spell))
                                                        {
                                                            
attack.Effect1 = Attack.AttackEffects1.None;
                                                            
uint damage = Calculate.Melee(attacker, attackedsob, ref attack);
                                                            
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                            
suse.Effect1 = attack.Effect1;

                                                            
suse.AddTarget(attackedsob, damage, attack);
                                                            
send = true;
                                                        }
                                                    }
                                                    if (
send)
                                                        
attacker.Owner.SendScreen(suse, true);
                                                    
attacker.SpellStamp = Time32.Now;
                                                }
                                                else
                                                {
                                                    
attacker.AttackPacket = null;
                                                }
                                            }
                                        }
                                        break;
                                    }


                                case 
6002:
                                    {
                                        if (
attackedsob != null)
                                            return;
                                        if (
attacked.EntityFlag == EntityFlag.Monster)
                                            return;
                                        if (
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;
                                                
//suse.SpellLevelHu = client_Spell.LevelHu2;

                                                
if (CanAttack(attacker, attacked, spell, false))
                                                {
                                                    
suse.AddTarget(attacked, 1, attack);
                                                    if (
Calculate.RateStatus(35))//Kernel.Rate(rate))
                                                    
{
                                                        
attacked.AddFlag2(Update.Flags2.EffectBall);
                                                        
attacked.NoDrugsStamp = Time32.Now;
                                                        
attacked.NoDrugsTime = (short)spell.Duration;
                                                        if (
attacked.EntityFlag == EntityFlag.Entity)
                                                            
attacked.Owner.Send(Constants.NoDrugs(spell.Duration));
                                                    }
                                                    else
                                                    {
                                                        
suse.Targets[attacked.UID].Hit = false;
                                                        
suse.Targets[attacked.UID].Damage = spell.ID;
                                                    }

                                                    
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 (
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;
                                                
//suse.SpellLevelHu = client_Spell.LevelHu2;
                                                
if (CanAttack(attacker, attacked, spell, false))
                                                {
                                                    
uint dmg = Calculate.Percent(attacked, 0.1F);
                                                    
suse.AddTarget(attacked, dmg, attack);

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

                                                    
attacked.Owner.SendScreen(suse, true);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                case 
11180:
                                    {
                                        if (
attacked != null)
                                        {
                                            if (
attacked.ContainsFlag(Update.Flags.Fly))
                                                return;
                                            if (
Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                            {
                                                if (
CanUseSpell(spell, attacker.Owner))
                                                {
                                                    if (!
Kernel.Rate(Math.Max(5, 100 - (attacked.BattlePower - attacker.BattlePower) / 5))) return;
                                                    
PrepareSpell(spell, attacker.Owner);
                                                    
SpellUse suse = new SpellUse(true);
                                                    
suse.Attacker = attacker.UID;
                                                    
suse.SpellID = spell.ID;
                                                    
suse.SpellLevel = spell.Level;
                                                    
//suse.SpellLevelHu = client_Spell.LevelHu2;
                                                    
suse.X = attacked.X;
                                                    
suse.Y = attacked.Y;
                                                    
ushort newx = attacker.X;
                                                    
ushort newy = attacker.Y;
                                                    
Map.Pushback(ref newx, ref newy, attacked.Facing, 5);
                                                    if (
attacker.Owner.Map.Floor[newx, newy, MapObjectType.Entity, attacked])
                                                    {
                                                        
suse.X = attacked.X = newx;
                                                        
suse.Y = attacked.Y = newy;
                                                    }
                                                    
ahmedfathy.Network.GamePackets.SpellUse.DamageClass tar = new SpellUse.DamageClass();
                                                    if (
CanAttack(attacker, attacked, spell, false))
                                                    {
                                                        
tar.Damage = Calculate.Melee(attacker, attacked, ref attack) / 2;
                                                        
suse.AddTarget(attacked, tar, attack);
                                                        
ReceiveAttack(attacker, attacked, attack, ref tar.Damage, spell);
                                                    }
                                                    if (
attacker.EntityFlag == EntityFlag.Entity)
                                                        
attacker.Owner.SendScreen(suse, true);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                case 
11170:
                                    {
                                        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.SpellLevelHu = client_Spell.LevelHu2;
                                            
ahmedfathy.Network.GamePackets.SpellUse.DamageClass tar = new SpellUse.DamageClass();
                                            foreach (var 
t in attacker.Owner.Screen.Objects)
                                            {
                                                if (
t == null)
                                                    continue;
                                                if (
t.MapObjType == MapObjectType.Entity || t.MapObjType == MapObjectType.Monster)
                                                {
                                                    var 
target = t as Entity;
                                                    if (
Kernel.GetDistance(X, Y, target.X, target.Y) <= spell.Range)
                                                    {
                                                        if (
CanAttack(attacker, target, spell, false))
                                                        {
                                                            
tar.Damage = Calculate.Melee(attacker, target, spell, ref attack, client_Spell.LevelHu2) / 4;
                                                            
tar.Hit = true;
                                                            
suse.AddTarget(target, tar, attack);
                                                            
ReceiveAttack(attacker, target, attack, ref tar.Damage, spell);
                                                        }
                                                    }
                                                }
                                            }

                                            if (
attacker.EntityFlag == EntityFlag.Entity)
                                                
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion

                                #region InfernalEcho
                                
case 12550:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            var 
map = attacker.Owner.Map;
                                            if (!
map.Floor[X, Y, MapObjectType.Item, null]) return;
                                            
PrepareSpell(spell, attacker.Owner);
                                            
SpellUse suse = new SpellUse(true);
                                            
suse.Attacker = attacker.UID;
                                            
suse.Attacker1 = attacker.UID;
                                            
suse.SpellID = SpellID;
                                            
suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
                                            
suse.X = X;
                                            
suse.Y = Y;
                                            
suse.SpellEffect = 0;
                                            
suse.AddTarget(attacker, 0, null);
                                            
attacker.Owner.SendScreen(suse, true);

                                            
Random R = new Random();
                                            
int Nr = R.Next(1, 3);
                                            switch (
spell.Level)
                                            {
                                                
#region case 0 - 1 - 2 - 3 - 4 - 5
                                                
case 0:
                                                case 
1:
                                                case 
2:
                                                case 
3:
                                                case 
4:
                                                case 
5:
                                                    {
                                                        var 
area2 = GetLocation2(attacker.X, attacker.Y);
                                                        
int count = 3;
                                                        List<
System.Drawing.Point> Area = new List<Point>();
                                                        for (
int i = 0; i < 360; i += spell.Sector)
                                                        {
                                                            if (
Area.Count >= count)
                                                            {
                                                                break;
                                                            }
                                                            
int r = i;
                                                            var 
distance = Kernel.Random.Next(spell.Range, spell.Distance);
                                                            var 
x2 = (ushort)(X + (distance * Math.Cos(r)));
                                                            var 
y2 = (ushort)(Y + (distance * Math.Sin(r)));
                                                            
System.Drawing.Point point = new System.Drawing.Point((int)x2, (int)y2);
                                                            if (!
Area.Contains(point))
                                                            {
                                                                
Area.Add(point);
                                                            }
                                                            else
                                                            {
                                                                
i--;
                                                            }
                                                        }
                                                        if (
Nr == 1)
                                                        {
                                                            foreach (var 
a in area2)
                                                            {
                                                                
FloorItem item = new FloorItem(true);
                                                                
item.ItemID = 1397;
                                                                
item.MapID = attacker.MapID;
                                                                
item.Type = FloorItem.Effect;
                                                                
item.X = (ushort)a.X;
                                                                
item.Y = (ushort)a.Y;
                                                                
item.OnFloor = Time32.Now;
                                                                
item.Owner = attacker.Owner;
                                                                
item.UID = FloorItem.FloorUID.Next;
                                                                while (
attacker.Owner.Map.FloorItems.ContainsKey(item.UID))
                                                                    
item.UID = FloorItem.FloorUID.Next;
                                                                
item.mColor = 14;
                                                                
item.OwnerUID = attacker.UID;
                                                                
item.OwnerGuildUID = attacker.GuildID;
                                                                
item.FlowerType = 0;
                                                                
item.Timer = Kernel.TqTimer(DateTime.Now.AddSeconds(3));
                                                                
item.Name = "InfernalEcho";
                                                                
attacker.Owner.SendScreenSpawn(item, true);
                                                                
attacker.AttackPacket = null;
                                                            }
                                                        }
                                                        else if (
Nr == 2)
                                                        {
                                                            foreach (var 
a in Area)
                                                            {
                                                                
FloorItem item = new FloorItem(true);
                                                                
item.ItemID = 1397;
                                                                
item.MapID = attacker.MapID;
                                                                
item.Type = FloorItem.Effect;
                                                                
item.X = (ushort)a.X;
                                                                
item.Y = (ushort)a.Y;
                                                                
item.OnFloor = Time32.Now;
                                                                
item.Owner = attacker.Owner;
                                                                
item.UID = FloorItem.FloorUID.Next;
                                                                while (
attacker.Owner.Map.FloorItems.ContainsKey(item.UID))
                                                                    
item.UID = FloorItem.FloorUID.Next;
                                                                
item.mColor = 14;
                                                                
item.OwnerUID = attacker.UID;
                                                                
item.OwnerGuildUID = attacker.GuildID;
                                                                
item.FlowerType = 0;
                                                                
item.Timer = Kernel.TqTimer(DateTime.Now.AddSeconds(3));
                                                                
item.Name = "InfernalEcho";
                                                                
attacker.Owner.SendScreenSpawn(item, true);
                                                                
attacker.AttackPacket = null;
                                                            }
                                                        }
                                                        else if (
Nr == 3)
                                                        {
                                                            foreach (var 
a in Area)
                                                            {
                                                                
FloorItem item = new FloorItem(true);
                                                                
item.ItemID = 1397;
                                                                
item.MapID = attacker.MapID;
                                                                
item.Type = FloorItem.Effect;
                                                                
item.X = (ushort)a.X;
                                                                
item.Y = (ushort)a.Y;
                                                                
item.OnFloor = Time32.Now;
                                                                
item.Owner = attacker.Owner;
                                                                
item.UID = FloorItem.FloorUID.Next;
                                                                while (
attacker.Owner.Map.FloorItems.ContainsKey(item.UID))
                                                                    
item.UID = FloorItem.FloorUID.Next;
                                                                
item.mColor = 14;
                                                                
item.OwnerUID = attacker.UID;
                                                                
item.OwnerGuildUID = attacker.GuildID;
                                                                
item.FlowerType = 0;
                                                                
item.Timer = Kernel.TqTimer(DateTime.Now.AddSeconds(3));
                                                                
item.Name = "InfernalEcho";
                                                                
attacker.Owner.SendScreenSpawn(item, true);
                                                                
attacker.AttackPacket = null;
                                                            }
                                                        }
                                                        break;
                                                    }
                                                
#endregion
                                                #region case 6
                                                
case 6:
                                                    {
                                                        var 
area2 = GetLocation(attacker.X, attacker.Y);
                                                        
int count = 4;
                                                        List<
System.Drawing.Point> Area = new List<Point>();
                                                        for (
int i = 0; i < 360; i += spell.Sector)
                                                        {
                                                            if (
Area.Count >= count)
                                                            {
                                                                break;
                                                            }
                                                            
int r = i;
                                                            var 
distance = Kernel.Random.Next(spell.Range, spell.Distance);
                                                            var 
x2 = (ushort)(X + (distance * Math.Cos(r)));
                                                            var 
y2 = (ushort)(Y + (distance * Math.Sin(r)));
                                                            
System.Drawing.Point point = new System.Drawing.Point((int)x2, (int)y2);
                                                            if (!
Area.Contains(point))
                                                            {
                                                                
Area.Add(point);
                                                            }
                                                            else
                                                            {
                                                                
i--;
                                                            }
                                                        }
                                                        if (
Nr == 1)
                                                        {
                                                            foreach (var 
a in area2)
                                                            {
                                                                
FloorItem item = new FloorItem(true);
                                                                
item.ItemID = 1397;
                                                                
item.MapID = attacker.MapID;
                                                                
item.Type = FloorItem.Effect;
                                                                
item.X = (ushort)a.X;
                                                                
item.Y = (ushort)a.Y;
                                                                
item.OnFloor = Time32.Now;
                                                                
item.Owner = attacker.Owner;
                                                                
item.UID = FloorItem.FloorUID.Next;
                                                                while (
attacker.Owner.Map.FloorItems.ContainsKey(item.UID))
                                                                    
item.UID = FloorItem.FloorUID.Next;
                                                                
item.mColor = 14;
                                                                
item.OwnerUID = attacker.UID;
                                                                
item.OwnerGuildUID = attacker.GuildID;
                                                                
item.FlowerType = 0;
                                                                
item.Timer = Kernel.TqTimer(DateTime.Now.AddSeconds(3));
                                                                
item.Name = "InfernalEcho";
                                                                
attacker.Owner.SendScreenSpawn(item, true);
                                                                
attacker.AttackPacket = null;

                                                            }
                                                        }
                                                        else if (
Nr == 2)
                                                        {
                                                            foreach (var 
a in Area)
                                                            {
                                                                
FloorItem item = new FloorItem(true);
                                                                
item.ItemID = 1397;
                                                                
item.MapID = attacker.MapID;
                                                                
item.Type = FloorItem.Effect;
                                                                
item.X = (ushort)a.X;
                                                                
item.Y = (ushort)a.Y;
                                                                
item.OnFloor = Time32.Now;
                                                                
item.Owner = attacker.Owner;
                                                                
item.UID = FloorItem.FloorUID.Next;
                                                                while (
attacker.Owner.Map.FloorItems.ContainsKey(item.UID))
                                                                    
item.UID = FloorItem.FloorUID.Next;
                                                                
item.mColor = 14;
                                                                
item.OwnerUID = attacker.UID;
                                                                
item.OwnerGuildUID = attacker.GuildID;
                                                                
item.FlowerType = 0;
                                                                
item.Timer = Kernel.TqTimer(DateTime.Now.AddSeconds(3));
                                                                
item.Name = "InfernalEcho";
                                                                
attacker.Owner.SendScreenSpawn(item, true);
                                                                
attacker.AttackPacket = null;
                                                            }
                                                        }
                                                        else if (
Nr == 3)
                                                        {
                                                            foreach (var 
a in Area)
                                                            {
                                                                
FloorItem item = new FloorItem(true);
                                                                
item.ItemID = 1397;
                                                                
item.MapID = attacker.MapID;
                                                                
item.Type = FloorItem.Effect;
                                                                
item.X = (ushort)a.X;
                                                                
item.Y = (ushort)a.Y;
                                                                
item.OnFloor = Time32.Now;
                                                                
item.Owner = attacker.Owner;
                                                                
item.UID = FloorItem.FloorUID.Next;
                                                                while (
attacker.Owner.Map.FloorItems.ContainsKey(item.UID))
                                                                    
item.UID = FloorItem.FloorUID.Next;
                                                                
item.mColor = 14;
                                                                
item.OwnerUID = attacker.UID;
                                                                
item.OwnerGuildUID = attacker.GuildID;
                                                                
item.FlowerType = 0;
                                                                
item.Timer = Kernel.TqTimer(DateTime.Now.AddSeconds(3));
                                                                
item.Name = "InfernalEcho";
                                                                
attacker.Owner.SendScreenSpawn(item, true);
                                                                
attacker.AttackPacket = null;
                                                            }
                                                        }
                                                        break;
                                                    }
                                                
#endregion
                                            
}
                                        }
                                        break;
                                    }
                                
#endregion

                                #region WrathoftheEmperor
                                
case 12570:
                                    {
                                        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;
                                            
suse.SpellEffect = 1;
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null) continue;
                                                if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
                                                {
                                                    
attacked = _obj as Entity;
                                                    if (
Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= 2)
                                                    {
                                                        if (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Ranged))
                                                        {
                                                            var 
damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
                                                            
damage = (uint)(damage * 1.100);
                                                            
suse.Effect1 = attack.Effect1;
                                                            
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
                                                            
attacked.Stunned = true;
                                                            
attacked.StunStamp = Time32.Now;
                                                            
suse.AddTarget(attacked, damage, attack);
                                                        }
                                                    }
                                                }
                                                else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    
attackedsob = _obj as SobNpcSpawn;
                                                    if (
Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= 2)
                                                    {
                                                        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.AddTarget(attackedsob, damage, attack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion

                                #region GraceofHeaven
                                
case 12560:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
PrepareSpell(spell, attacker.Owner);
                                            
SpellUse suse = new SpellUse(true);
                                            
suse.Attacker = attacker.UID;
                                            
suse.Attacker1 = attacker.UID;
                                            
SpellID = 10425;
                                            
suse.SpellID = spell.ID;
                                            
suse.SpellLevel = spell.Level;
                                            
attacker.Stamina += (byte)spell.Power;
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null) continue;
                                                if (
_obj.MapObjType == MapObjectType.Entity)
                                                {
                                                    
attacked = _obj as Entity;
                                                    if (
Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= 12)
                                                    {
                                                        
int R = Kernel.Random.Next(1, 10);
                                                        if (
R != 4) continue;
                                                        if (
attacked.ContainsFlag2((ulong)Update.Flags2.SoulShackle))
                                                        {

                                                            
suse.AddTarget(attacked, 0, attack);

                                                            
attacked.RemoveFlag2((ulong)Update.Flags2.SoulShackle);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.Owner.IncreaseSpellExperience(10, 12560);
                                            
attacker.Owner.SendScreen(suse, true);
                                            
attacker.AttackPacket = null;
                                        }
                                        break;
                                    }
                                
#endregion

                                #region Riding
                                
case 7001:
                                    {
                                        if (
attacker.Owner.Map.ID == 1081 || attacker.Owner.Map.ID == 4444 || attacker.Owner.Map.ID == 1038 || attacker.Owner.Map.ID == 1707 || attacker.Owner.Map.ID == 2233 || attacker.Owner.Map.ID == 9898 || attacker.Owner.Map.ID == 2233 || attacker.Owner.Map.ID == 16414 || attacker.Owner.Map.ID == 3691 || attacker.Owner.Map.ID == 3692 || attacker.Owner.Map.ID == 3693 || attacker.Owner.Map.ID == 3694 || attacker.Owner.Map.ID == 44444 || attacker.Owner.Map.ID == 2222 || attacker.Owner.Map.ID == 8899 || attacker.Owner.Map.ID == 1365 || attacker.Owner.Map.ID == 1366)
                                        {
                                            
Kernel.SendWorldMessage(new Message("Mr: " + attacker.Name + " You Can`t Use Riding Here !!!", System.Drawing.Color.White, Message.Talk), Program.Values);
                                            return;
                                        }
                                        if (
attacker.Owner.Map.ID == 1507 || attacker.Owner.Map.ID == 881 || attacker.Owner.Map.ID == 882 || attacker.Owner.Map.ID == 883 || attacker.Owner.Map.ID == 884 || attacker.Owner.Map.ID == 1238 || attacker.Owner.Map.ID == 1459 || attacker.Owner.Map.ID == 1458 || attacker.Owner.Map.ID == 1460 || attacker.Owner.Map.ID == 1991 || attacker.Owner.Map.ID == 1992 || attacker.Owner.Map.ID == 1993 || attacker.Owner.Map.ID == 1994 || attacker.Owner.Map.ID == 1995 || attacker.Owner.Map.ID == 1996 || attacker.Owner.Map.ID == 1997 || attacker.Owner.Map.ID == 1998 || attacker.Owner.Map.ID == 1989 || attacker.Owner.Map.ID == 2005 || attacker.Owner.Map.ID == 2000 || attacker.Owner.Map.ID == 1990 || attacker.Owner.Map.ID == 1987 || attacker.Owner.Map.ID == 1988 || attacker.Owner.Map.ID == 39990 || attacker.Owner.Map.ID == 39984)
                                        {
                                            
Kernel.SendWorldMessage(new Message("Mr: " + attacker.Name + " You Can`t Use Riding Here !!!", System.Drawing.Color.White, Message.Talk), Program.Values);
                                            return;
                                        }
                                        if (
attacker.ContainsFlag(Update.Flags.ShurikenVortex))
                                            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;
                                            
UInt16 ox, oy;
                                            
ox = attacker.X;
                                            
oy = attacker.Y;
                                            if (
attacker.ContainsFlag(Update.Flags.Ride))
                                            {
                                                
attacker.RemoveFlag(Update.Flags.Ride);
                                            }
                                            else
                                            {
                                                if (
attacker.Owner.Map.ID == 1036 && attacker.Owner.Equipment.TryGetItem((byte)12).Plus < 6)
                                                    break;
                                                if (
attacker.Owner.Map.BaseID == 700)
                                                    break;
                                                if (
attacker.Stamina >= 1)
                                                {
                                                    
attacker.AddFlag(Update.Flags.Ride);
                                                    
attacker.Stamina -= 1;
                                                    
attacker.Vigor = (ushort)(attacker.Owner.MaxVigor / 2);
                                                    
Network.GamePackets.Vigor vigor = new Network.GamePackets.Vigor(true);
                                                    
vigor.Amount = attacker.Owner.Vigor;
                                                    
vigor.Send(attacker.Owner);
                                                }
                                            }
                                            
suse.AddTarget(attacker, 0, attack);
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                case 
7002:
                                    {
//Spook
                                        
if (attacked.ContainsFlag(Update.Flags.Ride) && attacker.ContainsFlag(Update.Flags.Ride))
                                        {
                                            
ConquerItem 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.AddTarget(attacked, 0, attack);
                                                    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;
                                        
ConquerItem attackedSteed = null, attackerSteed = null;
                                        foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                        {
                                            if (
_obj == null)
                                                continue;
                                            if (
_obj.MapObjType == MapObjectType.Entity && _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 (
Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= attackedSteed.Plus)
                                                        {
                                                            if (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            {
                                                                
suse.AddTarget(attacked, 0, attack);
                                                                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 = 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, ref 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.SpellLevelHu = client_Spell.LevelHu2;
                                                    
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;
                                                    
suse.AddTarget(attackedsob, damage, attack);

                                                    
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);
                                                        
suse.AddTarget(attacked, damage, attack);

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

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

                                #region FireOfHell
                                
case 1165:
                                case 
7014:
                                case 
7017:
                                case 
7015:
                                case 
7011:
                                case 
7012:
                                    {
                                        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.SpellLevelHu = client_Spell.LevelHu2;
                                            
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.Entity)
                                                {
                                                    
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, client_Spell.LevelHu2);
                                                            
suse.Effect1 = attack.Effect1;

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

                                                            
suse.AddTarget(attacked, damage, attack);

                                                            if (
spell.ID == 1165)
                                                            {
                                                                if (
attacked.EntityFlag == EntityFlag.Entity)
                                                                {
                                                                    
#region BreakingTouch
                                                                    
attacked.Owner.BreakTouch(attacker.Owner);
                                                                    
#endregion
                                                                
}
                                                            }

                                                        }
                                                    }
                                                }
                                                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.AddTarget(attackedsob, damage, attack);
                                                        }
                                                    }
                                                }
                                            }
                                            
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;
                                            
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.Entity)
                                                {
                                                    
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, ref damage, spell);

                                                            
suse.AddTarget(attacked, damage, attack);
                                                        }
                                                    }
                                                }
                                                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.AddTarget(attackedsob, damage, attack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        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.SpellLevelHu = client_Spell.LevelHu2;
                                            
if (attacked != null)
                                            {
                                                if (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                {
                                                    
ushort _X = attacked.X, _Y = attacked.Y;
                                                    
byte dist = 5;
                                                    var 
angle = Kernel.GetAngle(attacker.X, attacker.Y, attacked.X, attacked.Y);
                                                    while (
dist != 0)
                                                    {
                                                        if (
attacked.fMove(angle, ref _X, ref _Y))
                                                        {
                                                            
X = _X;
                                                            
Y = _Y;
                                                        }
                                                        else break;
                                                        
dist--;
                                                    }
                                                    
suse.X = attacked.X = X;
                                                    
suse.Y = attacked.Y = Y;
                                                    
attack.Effect1 = Attack.AttackEffects1.None;
                                                    
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
                                                    
ReceiveAttack(attacker, attacked, attack, ref damage, spell);

                                                    
suse.AddTarget(attacked, damage, attack);
                                                }
                                            }
                                            else if (
attackedsob != null)
                                            {
                                                if (
CanAttack(attacker, attackedsob, spell))
                                                {
                                                    
suse.X = attackedsob.X;
                                                    
suse.Y = attackedsob.Y;
                                                    
attack.Effect1 = Attack.AttackEffects1.None;
                                                    
uint damage = Game.Attacking.Calculate.Melee(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.AddTarget(attackedsob, damage, attack);
                                                }
                                            }
                                            
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;
                                            if (
attacker.MapID == 1950)
                                                return;
                                            
bool wasTransformated = attacker.Transformed;
                                            
PrepareSpell(spell, attacker.Owner);

                                            
#region Atributes
                                            
switch (spell.ID)
                                            {
                                                case 
3321://GM skill
                                                    
{
                                                        
attacker.TransformationMaxAttack = 2000000;
                                                        
attacker.TransformationMinAttack = 2000000;
                                                        
attacker.TransformationDefence = 65355;
                                                        
attacker.TransformationMagicDefence = 65355;
                                                        
attacker.TransformationDodge = 35;
                                                        
attacker.TransformationTime = 65355;
                                                        
attacker.TransformationID = 223;
                                                        
attacker.Hitpoints = attacker.MaxHitpoints;
                                                        
attacker.Mana = attacker.MaxMana;
                                                        break;
                                                    }
                                                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;

                                            }
                                            
#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.AddTarget(attacker, (uint)0, attack);
                                            
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.AddTarget(attacker, 0, attack);
                                            
attacker.Owner.SendScreen(spellUse, true);
                                        }
                                        break;
                                    }
                                
#endregion

                                #region Companions
                                
case 4000:
                                case 
4010:
                                case 
4020:
                                case 
4050:
                                case 
4060:
                                case 
4070:
                                case 
12020:
                                case 
12030:
                                case 
12040:
                                case 
12610:
                                case 
12050:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {

                                            
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.AddTarget(attacker, 0, attack);
                                            
attacker.Owner.SendScreen(spellUse, true);
                                            
MonsterInformation information5 = null;
                                            if (
MonsterInformation.MonsterInformations.TryGetValue(spell.Power, out information5))
                                                
attacker.Owner.Pet.AddPet(information5);


                                        }
                                        break;
                                    }
                                
#endregion

                                #region MonkSpells
                                #region Auras

                                
case 10424:
                                case 
10423:
                                case 
10422:
                                case 
10421:
                                case 
10420:
                                
//Tyrant Aura
                                
case 10395:
                                
//Fend Aura
                                
case 10410:
                                    {
                                        
HandleAura(attacker, spell);
                                    }
                                    break;
                                
#endregion
                                #region Compassion
                                
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 (
Kernel.GetDistance(attacker.X, attacker.Y, teammate.Player.X, teammate.Player.Y) <= spell.Distance)
                                                    {
                                                        
teammate.Player.RemoveFlag(Update.Flags.Poisoned);

                                                        
suse.AddTarget(teammate.Player, 0, attack);
                                                    }
                                                }
                                                
attacker.Owner.SendScreen(suse, true);
                                            }
                                            else
                                            {
                                                
PrepareSpell(spell, attacker.Owner);

                                                
attacker.RemoveFlag(Update.Flags.Poisoned);

                                                
suse.AddTarget(attacker, 0, attack);

                                                if (
attacked.EntityFlag == EntityFlag.Entity)
                                                    
attacked.Owner.SendScreen(suse, true);
                                                else
                                                    
attacker.Owner.SendScreen(suse, true);
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region 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.AddTarget(attacker, 0, attack);
                                            
attacked.ToxicFogLeft = 0;
                                            
attacked.NoDrugsTime = 0;
                                            
attacked.RemoveFlag2(Update.Flags2.SoulShackle);
                                            
attacked.RemoveFlag2(Update.Flags2.EffectBall);
                                            
attacked.lianhuaranLeft = 0;
                                            
//                                            attacked.Owner.Send(new GameCharacterUpdates(true) { UID = attacked.UID, }
                                            //                                                        .Remove(GameCharacterUpdates.SoulShacle));
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion
                                
case 10425:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
//if (attacker.EpicMonk())
                                            
{


                                                
PrepareSpell(spell, attacker.Owner);

                                                if (
attacked == null) return;

                                                
SpellUse suse = new SpellUse(true);
                                                
suse.Attacker = attacker.UID;*//*Mr.Lover*__!__*For*Other*:D 
                                                
suse.SpellID = SpellID;
                                                
suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
                                                
suse.X = X;
                                                
suse.Y = Y;


                                                
suse.AddTarget(attacked, 0, attack);

                                                
attacked.ToxicFogLeft = 0;
                                                
attacked.RemoveFlag2(Update.Flags2.SoulShackle);

                                                
Network.GamePackets.Update upgrade = new Network.GamePackets.Update(true);
                                                
upgrade.UID = attacked.UID;
                                                
upgrade.Append(Network.GamePackets.Update.SoulShackle
                                                    
, 111//*Mr.Lover*__!__*For*Other*:D 
                                                    
, 0, 0, spell.Level);
                                                if (
attacked.EntityFlag == EntityFlag.Entity)
                                                    
attacked.Owner.Send(upgrade.ToArray());

                                                
attacked.RemoveFlag2(Update.Flags2.Congelado);
                                                
attacked.RemoveFlag2(Update.Flags2.EffectBall);
                                                
//*attacked.lianhuaranLeft1*=*0; 


                                                
attacked.NoDrugsTime = 0;//*Mr.Lover*__!__*For*Other*:D 
                                                
if (attacked.EntityFlag == EntityFlag.Entity)
                                                    
attacked.Owner.SendScreen(suse, true);
                                                else
                                                    
attacker.Owner.SendScreen(suse, true);//*Mr.Lover*__!__*For*Other*:D 


                                            
}
                                            break;

                                        }
                                        break;
                                    }
                                
#region WhirlwindKick
                                
case 10415:
                                    {
                                        if (
Time32.Now < attacker.SpellStamp.AddMilliseconds(300))
                                        {
                                            
attacker.AttackPacket = null; return;
                                        }
                                        if (
Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= 400)
                                        {
                                            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)Kernel.Random.Next(3, 10);
                                                
suse.Y = 0;
                                                
//suse.SpellLevelHu = client_Spell.LevelHu2;
                                                
if (Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= 500)
                                                {
                                                    for (
int c = 0; c < attacker.Owner.Screen.Objects.Length; 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.Length)
                                                            break;
                                                        
Interfaces.IMapObject _obj = attacker.Owner.Screen.Objects[c];
                                                        if (
_obj == null)
                                                            continue;
                                                        if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
                                                        {
                                                            
attacked = _obj as Entity;
                                                            if (
Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
                                                            {
                                                                if (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Ranged))
                                                                {
                                                                    var 
damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
                                                                    
damage = (uint)(damage * 0.550);
                                                                    
suse.Effect1 = attack.Effect1;
                                                                    
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
                                                                    
attacked.Stunned = true;
                                                                    
attacked.StunStamp = Time32.Now;
                                                                    
suse.AddTarget(attacked, damage, attack);

                                                                }
                                                            }
                                                        }
                                                    }
                                                    
attacker.AttackPacket = null;
                                                }
                                                else
                                                {
                                                    
attacker.AttackPacket = null; return;
                                                }
                                                
attacker.Owner.SendScreen(suse, true);
                                                
attacker.SpellStamp = Time32.Now;
                                                
suse.Targets = new SafeDictionary<uint, SpellUse.DamageClass>();
                                                
attacker.AttackPacket = null; return;
                                            }
                                            
attacker.AttackPacket = null;
                                        }
                                        
attacker.AttackPacket = null; return;
                                    }
                                
#endregion
                                #endregion

                                #region PirateSpells

                                #region GaleBomb
                                
case 11070:
                                    if (
CanUseSpell(spell, attacker.Owner))
                                    {

                                        
PrepareSpell(spell, attacker.Owner);
                                        
Map map;
                                        
SpellUse suse = new SpellUse(true);
                                        
suse.Attacker = attacker.UID;
                                        
suse.SpellID = spell.ID;
                                        
suse.SpellLevel = spell.Level;
                                        
suse.X = X;
                                        
suse.Y = Y;
                                        
//suse.SpellLevelHu = client_Spell.LevelHu2;
                                        
ahmedfathy.Network.GamePackets.SpellUse.DamageClass tar = new SpellUse.DamageClass();
                                        
int num = 0;

                                        switch (
spell.Level)
                                        {
                                            case 
0:
                                            case 
1:
                                                
num = 3;
                                                break;
                                            case 
2:
                                            case 
3:
                                                
num = 4;
                                                break;
                                            default:
                                                
num = 5;
                                                break;
                                        }
                                        
int i = 0;
                                        
Kernel.Maps.TryGetValue(attacker.Owner.Map.BaseID, out map);
                                        foreach (var 
t in attacker.Owner.Screen.Objects)
                                        {
                                            if (
t == null)
                                                continue;
                                            if (
t.MapObjType == MapObjectType.Entity || t.MapObjType == MapObjectType.Monster)
                                            {
                                                var 
target = t as Entity;
                                                if (
Kernel.GetDistance(X, Y, target.X, target.Y) <= spell.Range)
                                                {
                                                    if (
CanAttack(attacker, target, spell, false))
                                                    {
                                                        
tar.Damage = Calculate.Ranged(attacker, target, spell, ref attack);
                                                        
tar.Hit = true;
                                                        
tar.newX = target.X;
                                                        
tar.newY = target.Y;
                                                        
Map.Pushback(ref tar.newX, ref tar.newY, attacker.Facing, 5);

                                                        if (
map != null)
                                                        {
                                                            if (
map.Floor[tar.newX, tar.newY, MapObjectType.Entity, attacker])
                                                            {
                                                                
target.X = tar.newX;
                                                                
target.Y = tar.newY;
                                                            }
                                                            else
                                                            {
                                                                
tar.newX = target.X;
                                                                
tar.newY = target.Y;
                                                            }
                                                        }
                                                        else
                                                        {
                                                            if (
attacker.Owner.Map.Floor[tar.newX, tar.newY, MapObjectType.Entity, attacker])
                                                            {
                                                                
target.X = tar.newX;
                                                                
target.Y = tar.newY;
                                                            }
                                                            else
                                                            {
                                                                
target.X = tar.newX;
                                                                
target.Y = tar.newY;
                                                            }
                                                        }
                                                        
suse.AddTarget(target, tar, attack);
                                                        
ReceiveAttack(attacker, target, attack, ref tar.Damage, spell);

                                                        
i++;
                                                        if (
i > num) break;
                                                    }
                                                }
                                            }
                                        }

                                        if (
attacker.EntityFlag == EntityFlag.Entity)
                                            
attacker.Owner.SendScreen(suse, true);
                                    }
                                    break;
                                
#endregion

                                #region BladeTempest
                                
case 11110:
                                    {
                                        if (
Time32.Now >= attacker.SpellStamp.AddMilliseconds(400))
                                        {
                                            if (
CanUseSpell(spell, attacker.Owner))
                                            {
                                                
PrepareSpell(spell, attacker.Owner);
                                                
SpellUse suse = new SpellUse(true);
                                                
suse.Attacker = attacker.UID;
                                                
suse.SpellID = spell.ID;
                                                
// suse.SpellLevelHu = 0;
                                                
suse.SpellLevel = spell.Level;
                                                
ushort _X = attacker.X, _Y = attacker.Y;
                                                
ushort _tX = X, _tY = Y;
                                                
byte dist = (byte)spell.Distance;
                                                var Array = 
attacker.Owner.Screen.Objects;
                                                
InLineAlgorithm algo = new InLineAlgorithm(attacker.X, X, attacker.Y, Y, dist,
                                                                                   
InLineAlgorithm.Algorithm.DDA);
                                                
X = attacker.X;
                                                
Y = attacker.Y;
                                                
int i = 0;
                                                for (
i = 0; i < algo.lcoords.Count; i++)
                                                {
                                                    if (
attacker.Owner.Map.Floor[algo.lcoords[i].X, algo.lcoords[i].Y, MapObjectType.Entity]
                                                        && !
attacker.ThroughGate(algo.lcoords[i].X, algo.lcoords[i].Y))
                                                    {
                                                        
X = (ushort)algo.lcoords[i].X;
                                                        
Y = (ushort)algo.lcoords[i].Y;
                                                    }
                                                    else
                                                    {
                                                        break;
                                                    }
                                                }
                                                
suse.X = X;
                                                
suse.Y = Y;
                                                if (!
attacker.Owner.Map.Floor[X, Y, MapObjectType.Entity, null])
                                                    return;
                                                
double disth = 2;

                                                foreach (
Interfaces.IMapObject _obj in Array)
                                                {
                                                    
bool hit = false;
                                                    for (
int j = 0; j < i; j++)
                                                        if (
Kernel.GetDDistance(_obj.X, _obj.Y, (ushort)algo.lcoords[j].X, (ushort)algo.lcoords[j].Y) <= disth)
                                                            
hit = true;
                                                    if (
hit)
                                                    {
                                                        if (
_obj.MapObjType == MapObjectType.Monster)
                                                        {
                                                            
attacked = _obj as Entity;
                                                            if (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            {
                                                                
attack.Effect1 = Attack.AttackEffects1.None;
                                                                
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);

                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.King)
                                                                {
                                                                    
damage = (uint)(damage * 0.818);
                                                                }
                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Prince)
                                                                {
                                                                    
damage = (uint)(damage * 0.855);
                                                                }
                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Duke)
                                                                {
                                                                    
damage = (uint)(damage * 0.958);
                                                                }
                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Earl)
                                                                {
                                                                    
damage = (uint)(damage * 1.050);
                                                                }
                                                                
ReceiveAttack(attacker, attacked, attack, ref damage, spell);

                                                                
suse.AddTarget(attacked, damage, attack);
                                                            }
                                                        }
                                                        else if (
_obj.MapObjType == MapObjectType.Entity)
                                                        {
                                                            
attacked = _obj as Entity;
                                                            if (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            {
                                                                
attack.Effect1 = Attack.AttackEffects1.None;
                                                                
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);

                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.King)
                                                                {
                                                                    
damage = (uint)(damage * 0.818);
                                                                }
                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Prince)
                                                                {
                                                                    
damage = (uint)(damage * 0.855);
                                                                }
                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Duke)
                                                                {
                                                                    
damage = (uint)(damage * 0.958);
                                                                }
                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Earl)
                                                                {
                                                                    
damage = (uint)(damage * 1.050);
                                                                }

                                                                
suse.Effect1 = attack.Effect1;
                                                                
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
                                                                
suse.AddTarget(attacked, damage, attack);
                                                            }
                                                        }
                                                        else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                        {
                                                            
attackedsob = _obj as SobNpcSpawn;
                                                            if (
CanAttack(attacker, attackedsob, spell))
                                                            {
                                                                
uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);

                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.King)
                                                                {
                                                                    
damage = (uint)(damage * 0.850);
                                                                }
                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Prince)
                                                                {
                                                                    
damage = (uint)(damage * 0.840);
                                                                }
                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Duke)
                                                                {
                                                                    
damage = (uint)(damage * 0.800);
                                                                }
                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Earl)
                                                                {
                                                                    
damage = (uint)(damage * 0.6);
                                                                }
                                                                
ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                                
suse.AddTarget(attackedsob, damage, attack);
                                                            }
                                                        }
                                                    }
                                                }
                                                
attacker.PX = attacker.X;
                                                
attacker.PY = attacker.Y;
                                                
attacker.X = X;
                                                
attacker.Y = Y;
                                                
attacker.Owner.SendScreen(suse, true);
                                                
attacker.Owner.Screen.Reload(suse);
                                            }
                                        }
                                        break;
                                    }
                                
#endregion

                                #region Kraken`sRevenge
                                
case 11100:
                                    {
                                        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;
                                            
int num = 0;

                                            switch (
spell.Level)
                                            {
                                                case 
0:
                                                case 
1:
                                                    
num = 3;
                                                    break;
                                                case 
2:
                                                case 
3:
                                                    
num = 4;
                                                    break;
                                                default:
                                                    
num = 5;
                                                    break;
                                            }

                                            
int i = 0;
                                            
BlackSpotPacket bsp = new BlackSpotPacket();
                                            foreach (var 
t in attacker.Owner.Screen.Objects)
                                            {
                                                if (
t == null)
                                                    continue;
                                                if (
t.MapObjType == MapObjectType.Entity || t.MapObjType == MapObjectType.Monster)
                                                {
                                                    var 
target = t as Entity;
                                                    if (
CanAttack(attacker, target, spell, false))
                                                    {
                                                        
target.IsBlackSpotted = true;
                                                        
target.BlackSpotStamp = Time32.Now;
                                                        
target.BlackSpotStepSecs = spell.Duration;
                                                        
Kernel.BlackSpoted.TryAdd(target.UID, target);
                                                        
suse.AddTarget(target, new SpellUse.DamageClass(), attack);
                                                        
i++;
                                                        if (
i == num) break;
                                                    }
                                                }
                                            }
                                            if (
attacker.EntityFlag == EntityFlag.Entity)
                                                
attacker.Owner.SendScreen(suse, true);

                                            foreach (var 
h in Program.Values)
                                            {
                                                foreach (var 
t in suse.Targets.Keys)
                                                {
                                                    
h.Send(bsp.ToArray(true, t));
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion

                                #region ScurvyBomb
                                
case 11040:
                                    if (
CanUseSpell(spell, attacker.Owner))
                                    {

                                        
PrepareSpell(spell, attacker.Owner);
                                        
Map map;
                                        
SpellUse suse = new SpellUse(true);
                                        
suse.Attacker = attacker.UID;
                                        
suse.SpellID = spell.ID;
                                        
suse.SpellLevel = spell.Level;
                                        
suse.X = X;
                                        
suse.Y = Y;
                                        
//suse.SpellLevelHu = client_Spell.LevelHu2;
                                        
ahmedfathy.Network.GamePackets.SpellUse.DamageClass tar = new SpellUse.DamageClass();
                                        
int num = 0;

                                        switch (
spell.Level)
                                        {
                                            case 
0:
                                            case 
1:
                                                
num = 3;
                                                break;
                                            case 
2:
                                            case 
3:
                                                
num = 4;
                                                break;
                                            default:
                                                
num = 5;
                                                break;
                                        }
                                        
int i = 0;
                                        
Kernel.Maps.TryGetValue(attacker.Owner.Map.BaseID, out map);
                                        foreach (var 
t in attacker.Owner.Screen.Objects)
                                        {
                                            if (
t == null)
                                                continue;
                                            if (
t.MapObjType == MapObjectType.Entity || t.MapObjType == MapObjectType.Monster)
                                            {
                                                var 
target = t as Entity;
                                                if (
Kernel.GetDistance(X, Y, target.X, target.Y) <= spell.Range)
                                                {
                                                    if (
CanAttack(attacker, target, spell, false))
                                                    {
                                                        
tar.Damage = Calculate.Ranged(attacker, target, ref attack);
                                                        
tar.Hit = true;
                                                        
tar.newX = target.X;
                                                        
tar.newY = target.Y;
                                                        
Map.Pushback(ref tar.newX, ref tar.newY, attacker.Facing, 5);

                                                        if (
map != null)
                                                        {
                                                            if (
map.Floor[tar.newX, tar.newY, MapObjectType.Entity, attacker])
                                                            {
                                                                
target.X = tar.newX;
                                                                
target.Y = tar.newY;
                                                            }
                                                            else
                                                            {
                                                                
tar.newX = target.X;
                                                                
tar.newY = target.Y;
                                                            }
                                                        }
                                                        else
                                                        {
                                                            if (
attacker.Owner.Map.Floor[tar.newX, tar.newY, MapObjectType.Entity, attacker])
                                                            {
                                                                
target.X = tar.newX;
                                                                
target.Y = tar.newY;
                                                            }
                                                            else
                                                            {
                                                                
target.X = tar.newX;
                                                                
target.Y = tar.newY;
                                                            }
                                                        }

                                                        
suse.AddTarget(target, tar, attack);
                                                        
ReceiveAttack(attacker, target, attack, ref tar.Damage, spell);

                                                        
i++;
                                                        if (
i > num) break;
                                                    }
                                                }
                                            }
                                        }

                                        if (
attacker.EntityFlag == EntityFlag.Entity)
                                            
attacker.Owner.SendScreen(suse, true);
                                    }
                                    break;
                                
#endregion

                                #region Cannon Barrage
                                
case 11050:
                                    {
                                        if (
attacker.Owner.Player.ContainsFlag(ahmedfathy.Network.GamePackets.Update.Flags.XPList))
                                        {
                                            
attacker.Owner.Player.RemoveFlag(ahmedfathy.Network.GamePackets.Update.Flags.XPList);
                                            
attacker.Owner.Player.AddFlag2(ahmedfathy.Network.GamePackets.Update.Flags2.CannonBarrage);
                                            
attacker.Owner.Player.CannonBarrageStamp = Time32.Now;
                                            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;
                                        
//suse.SpellLevelHu = client_Spell.LevelHu2;
                                        
ahmedfathy.Network.GamePackets.SpellUse.DamageClass tar = new SpellUse.DamageClass();
                                        foreach (var 
t in attacker.Owner.Screen.Objects)
                                        {
                                            if (
t == null)
                                                continue;
                                            if (
t.MapObjType == MapObjectType.Entity || t.MapObjType == MapObjectType.Monster)
                                            {
                                                var 
target = t as Entity;
                                                if (
Kernel.GetDistance(attacker.Owner.Player.X, attacker.Owner.Player.Y, target.X, target.Y) <= spell.Range)
                                                {
                                                    if (
CanAttack(attacker, target, spell, false))
                                                    {
                                                        
tar.Damage = Calculate.Ranged(attacker, target, ref attack, client_Spell.LevelHu2);
                                                        
suse.AddTarget(target, tar, attack);
                                                        
ReceiveAttack(attacker, target, attack, ref tar.Damage, spell);
                                                    }
                                                }
                                            }
                                        }

                                        if (
attacker.EntityFlag == EntityFlag.Entity)
                                            
attacker.Owner.SendScreen(suse, true);

                                        break;
                                    }
                                
#endregion

                                #region Blackbeard`sRage
                                
case 11060:
                                    {
                                        if (
attacker.Owner.Player.ContainsFlag(ahmedfathy.Network.GamePackets.Update.Flags.XPList))
                                        {
                                            
attacker.Owner.Player.RemoveFlag(ahmedfathy.Network.GamePackets.Update.Flags.XPList);
                                            
attacker.Owner.Player.AddFlag2(ahmedfathy.Network.GamePackets.Update.Flags2.BlackbeardsRage);
                                            
attacker.Owner.Player.BlackbeardsRageStamp = Time32.Now;
                                            return;
                                        }

                                        
int num = 0;
                                        switch (
spell.Level)
                                        {
                                            case 
0:
                                            case 
1:
                                                
num = 3;
                                                break;
                                            case 
2:
                                            case 
3:
                                                
num = 4;
                                                break;
                                            default:
                                                
num = 5;
                                                break;
                                        }
                                        
int i = 0;
                                        
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.SpellLevelHu = client_Spell.LevelHu2;
                                        
ahmedfathy.Network.GamePackets.SpellUse.DamageClass tar = new SpellUse.DamageClass();
                                        foreach (var 
t in attacker.Owner.Screen.Objects)
                                        {
                                            if (
t == null)
                                                continue;
                                            if (
t.MapObjType == MapObjectType.Entity || t.MapObjType == MapObjectType.Monster)
                                            {
                                                var 
target = t as Entity;
                                                if (
Kernel.GetDistance(attacker.Owner.Player.X, attacker.Owner.Player.Y, target.X, target.Y) <= spell.Range)
                                                {
                                                    if (
CanAttack(attacker, target, spell, false))
                                                    {
                                                        
tar.Damage = Calculate.Ranged(attacker, target, ref attack, client_Spell.LevelHu2);
                                                        
suse.AddTarget(target, tar, attack);
                                                        
ReceiveAttack(attacker, target, attack, ref tar.Damage, spell);
                                                        
i++;
                                                        if (
i == num) break;
                                                    }
                                                }
                                            }
                                        }

                                        if (
attacker.EntityFlag == EntityFlag.Entity)
                                            
attacker.Owner.SendScreen(suse, true);

                                        break;
                                    }
                                
#endregion

                                #endregion
                                #region MagicDefender
                                
case 11200:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
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;
                                            if (
attacker.Owner.Team != null)
                                            {
                                                foreach (var 
mate in attacker.Owner.Team.Teammates)
                                                {
                                                    if (
Kernel.GetDistance(attacker.X, attacker.Y, mate.Player.X, mate.Player.Y) <= 4)
                                                    {
                                                        
spellUse.AddTarget(mate.Player, 0, attack);
                                                        if (
attacker.UID == mate.Player.UID)
                                                            
mate.Player.MagicDefenderOwner = true;
                                                        
mate.Player.HasMagicDefender = true;
                                                        
mate.Player.MagicDefenderSecs = (byte)spell.Duration;
                                                        
attacker.RemoveFlag3(ahmedfathy.Network.GamePackets.Update.Flags3.MagicDefender);
                                                        
mate.Player.AddFlag3(ahmedfathy.Network.GamePackets.Update.Flags3.MagicDefender);
                                                        
mate.Player.Update(mate.Player.StatusFlag, mate.Player.StatusFlag2, mate.Player.StatusFlag3, Update.MagicDefenderIcone, 0x80, mate.Player.MagicDefenderSecs, 0, false);
                                                        
mate.Player.MagicDefenderStamp = Time32.Now;
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
spellUse.AddTarget(attacker, 0, null);
                                                
attacker.Owner.Player.HasMagicDefender = true;
                                                
attacker.Owner.Player.MagicDefenderOwner = true;
                                                
attacker.Owner.Player.MagicDefenderSecs = (byte)spell.Duration;
                                                
attacker.RemoveFlag3(ahmedfathy.Network.GamePackets.Update.Flags3.MagicDefender);
                                                
attacker.AddFlag3(ahmedfathy.Network.GamePackets.Update.Flags3.MagicDefender);
                                                
attacker.Owner.Player.Update(attacker.Owner.Player.StatusFlag, attacker.Owner.Player.StatusFlag2, attacker.Owner.Player.StatusFlag3, Update.MagicDefenderIcone, 0x80, attacker.Owner.Player.MagicDefenderSecs, 0, false);
                                                
attacker.Owner.Player.MagicDefenderStamp = Time32.Now;
                                            }
                                            
attacker.Owner.SendScreen(spellUse, true);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region DefensiveStance
                                
case 11160:
                                    {
                                        if (
Time32.Now >= attacker.DefensiveStanceStamp.AddSeconds(10))
                                        {
                                            if (
CanUseSpell(spell, attacker.Owner))
                                            {
                                                
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;
                                                
attacker.Owner.SendScreen(spellUse, true);
                                                if (
attacker.IsDefensiveStance)
                                                {
                                                    
attacker.RemoveFlag2(ahmedfathy.Network.GamePackets.Update.Flags2.Fatigue);
                                                    
attacker.IsDefensiveStance = false;
                                                }
                                                else
                                                {
                                                    
attacker.FatigueSecs = spell.Duration;
                                                    
attacker.FatigueStamp = Time32.Now;
                                                    
attacker.AddFlag2(ahmedfathy.Network.GamePackets.Update.Flags2.Fatigue);
                                                    
attacker.Update(attacker.Owner.Player.StatusFlag, attacker.Owner.Player.StatusFlag2, attacker.Owner.Player.StatusFlag3, Update.DefensiveStance, 0x7E, (uint)spell.Duration, (uint)(spell.Level + 1), false);
                                                    
attacker.IsDefensiveStance = true;
                                                }
                                            }
                                        }
                                        else
                                        {
                                            
attacker.Owner.Send(new Message("You need to wait 10 seconds in order to cast the spell again!", Color.Red, Message.TopLeft));
                                        }
                                        break;
                                    }
                                
#endregion
                                #region ShieldBlock
                                
case 10470: // Shield Block
                                    
{

                                        {
                                            if (
CanUseSpell(spell, attacker.Owner))
                                            {
                                                
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;
                                                
attacker.Owner.SendScreen(spellUse, true);
                                                if (
attacker.IsShieldBlock)
                                                {
                                                    
Network.GamePackets.Update aupgrade = new Network.GamePackets.Update(true);
                                                    
aupgrade.UID = attacker.UID;
                                                    
aupgrade.Append(49
                                                   
, 113
                                                   
, (uint)0, 0, 0);
                                                    
attacker.Owner.Send(aupgrade);
                                                    
attacker.IsShieldBlock = false;
                                                }
                                                else
                                                {
                                                    
attacker.ShieldBlockStamp = Time32.Now;
                                                    
attacker.ShieldBlockPercent = (ushort)spell.Power;
                                                    
Network.GamePackets.Update aupgrade = new Network.GamePackets.Update(true);
                                                    
aupgrade.UID = attacker.UID;
                                                    
aupgrade.Append(49
                                                   
, 113
                                                   
, (uint)spell.Duration, spell.Power, spell.Level);
                                                    
attacker.Owner.Send(aupgrade);
                                                    
attacker.IsShieldBlock = true;
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Assassin
                                #region Blistering Wave
                                
case 11650:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            if (!
attacker.ContainsFlag3(Update.Flags3.Assassin))
                                                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;
                                            
//suse.SpellLevelHu = client_Spell.LevelHu2;
                                            
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.Entity)
                                                {
                                                    
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, ref attack);

                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.King)
                                                            {
                                                                
damage = (uint)(damage * 0.628);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Prince)
                                                            {
                                                                
damage = (uint)(damage * 0.712);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Duke)
                                                            {
                                                                
damage = (uint)(damage * 0.780);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Earl)
                                                            {
                                                                
damage = (uint)(damage * 0.820);
                                                            }
                                                            
suse.Effect1 = attack.Effect1;

                                                            
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
                                                            
suse.AddTarget(attacked, damage, attack);
                                                        }
                                                    }
                                                }
                                                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 * 1.0);

                                                            
suse.Effect1 = attack.Effect1;
                                                            
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                            
suse.AddTarget(attackedsob, damage, attack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region PathOfJoseph
                                
case 11620:
                                    {
                                        var 
weps = attacker.Owner.Weapons;
                                        if ((
weps.Item1 != null && weps.Item1.ID / 1000 != 613) || (weps.Item2 != null && weps.Item2.ID / 1000 != 613))
                                        {
                                            
attacker.Owner.Send(new Message("You need to wear only knifes!", Color.Red, Message.Talk));
                                            return;
                                        }
                                        
SpellUse spellUse = new SpellUse(true);
                                        
spellUse.Attacker = attacker.UID;
                                        
spellUse.SpellID = spell.ID;
                                        
spellUse.SpellLevel = spell.Level;
                                        
spellUse.X = X;
                                        
spellUse.Y = Y;
                                        
attacker.Owner.SendScreen(spellUse, true);
                                        if (
attacker.ContainsFlag3(Update.Flags3.Assassin))
                                        {
                                            
attacker.RemoveFlag3(Update.Flags3.Assassin);
                                            if (
attacker.ContainsFlag3(Update.Flags3.BladeFlurry))
                                                
attacker.RemoveFlag3(Update.Flags3.BladeFlurry);
                                            if (
attacker.ContainsFlag3(Update.Flags3.KineticSpark))
                                                
attacker.RemoveFlag3(Update.Flags3.KineticSpark);
                                        }
                                        else
                                            
attacker.AddFlag3(Update.Flags3.Assassin);
                                        break;
                                    }
                                
#endregion
                                #region Blade Furry
                                
case 11610:
                                    {
                                        if (!
attacker.ContainsFlag3(Update.Flags3.Assassin))
                                            return;
                                        
SpellUse suse = new SpellUse(true);
                                        
suse.Attacker = attacker.UID;
                                        
suse.SpellID = spell.ID;
                                        
suse.SpellLevel = spell.Level;
                                        
suse.X = X;
                                        
//suse.SpellLevelHu = client_Spell.LevelHu2;
                                        
suse.Y = Y;
                                        if (
attacker.ContainsFlag(Update.Flags.XPList))
                                        {
                                            
attacker.AddFlag3(Update.Flags3.BladeFlurry);
                                            
attacker.BladeFlurryStamp = Time32.Now;
                                            
attacker.RemoveFlag(Update.Flags.XPList);
                                        }
                                        else
                                        {
                                            if (
Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)
                                            {
                                                foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (
_obj == null) continue;
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
                                                    {
                                                        
attacked = _obj as Entity;
                                                        if (
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, spell, ref attack, client_Spell.LevelHu2);
                                                                
suse.Effect1 = attack.Effect1;
                                                                
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
                                                                
suse.AddTarget(attacked, damage, attack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob = _obj as SobNpcSpawn;
                                                        if (
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.AddTarget(attackedsob, damage, attack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        
attacker.Owner.SendScreen(suse, true);
                                        break;
                                    }
                                
#endregion
                                #region Mortal Wound
                                
case 11660:
                                    {
                                        if (
attacker.Stamina >= 10)
                                            
attacker.Stamina -= 10;
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            if (!
attacker.ContainsFlag3(Update.Flags3.Assassin))
                                                return;
                                            if (
Time32.Now > attacker.MortalWoundStamp.AddMilliseconds(10))
                                            {
                                                
attacker.MortalWoundStamp = Time32.Now;
                                                
PrepareSpell(spell, attacker.Owner);
                                                
attacker.AttackPacket = null;
                                                
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 (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                    {
                                                        
attack.Effect1 = Attack.AttackEffects1.None;
                                                        
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);

                                                        if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.King)
                                                        {
                                                            
damage = (uint)(damage * 0.558);
                                                        }
                                                        if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Prince)
                                                        {
                                                            
damage = (uint)(damage * 0.633);
                                                        }
                                                        if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Duke)
                                                        {
                                                            
damage = (uint)(damage * 0.667);
                                                        }
                                                        if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Earl)
                                                        {
                                                            
damage = (uint)(damage * 0.820);
                                                        }
                                                        
suse.Effect1 = attack.Effect1;
                                                        
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
                                                        
suse.AddTarget(attacked, damage, attack);
                                                        
attacker.Owner.SendScreen(suse, 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 * 1.0);
                                                        
suse.Effect1 = attack.Effect1;

                                                        
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                        
suse.AddTarget(attackedsob, damage, attack);
                                                        
attacker.Owner.SendScreen(suse, true);
                                                    }
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion

                                #region Spirit Focus
                                
case 9000:
                                case 
11670:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            if (
spell.ID == 11670)
                                                if (!
attacker.ContainsFlag3(Update.Flags3.Assassin))
                                                    return;

                                            
PrepareSpell(spell, attacker.Owner);

                                            
attack = new Attack(true);
                                            
attack.Attacker = attacker.UID;
                                            
attack.Attacked = attacker.UID;
                                            
attack.AttackType = Attack.Magic;
                                            
attack.X = attacker.X;
                                            
attack.Y = attacker.Y;
                                            
attack.Damage = spell.ID;
                                            
attack.KOCount = spell.Level;
                                            
attacker.Owner.SendScreen(attack, true);

                                            
attacker.IntensifyPercent = spell.PowerPercent;
                                            
attacker.IntensifyStamp = Time32.Now;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Kinetic Spark
                                
case 11590:
                                    {
                                        if (!
attacker.ContainsFlag3(Update.Flags3.Assassin))
                                            return;

                                        
SpellUse spellUse = new SpellUse(true);
                                        
spellUse.Attacker = attacker.UID;
                                        
spellUse.SpellID = spell.ID;
                                        
spellUse.SpellLevel = spell.Level;
                                        
spellUse.X = X;
                                        
spellUse.Y = Y;
                                        
attacker.Owner.SendScreen(spellUse, true);

                                        if (
attacker.ContainsFlag3(Update.Flags3.KineticSpark))
                                            
attacker.RemoveFlag3(Update.Flags3.KineticSpark);
                                        else
                                            
attacker.AddFlag3(Update.Flags3.KineticSpark);
                                        break;
                                    }
                                
#endregion
                                #region Dagger Storm
                                
case 11600:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            if (!
attacker.ContainsFlag3((ulong)Update.Flags3.Assassin)) return;
                                            var 
map = attacker.Owner.Map;
                                            if (!
map.Floor[X, Y, MapObjectType.Item, null]) return;
                                            
PrepareSpell(spell, attacker.Owner);
                                            
SpellUse suse = new SpellUse(true);
                                            
suse.Attacker = attacker.UID;
                                            
suse.Attacker1 = attacker.UID;
                                            
suse.SpellID = spell.ID;
                                            
suse.SpellLevel = spell.Level;
                                            
suse.AddTarget(attacker, 0, null);
                                            
attacker.Owner.SendScreen(suse, true);
                                            
FloorItem flooritem = new FloorItem(true);
                                            if (
attacker.Owner.Spells[spellID].LevelHu2 == 1)
                                            {

                                                
flooritem.ItemID = FloorItem.FuryofEgg;
                                                
flooritem.X = X;
                                                
flooritem.MapID = map.ID;
                                                
flooritem.Y = Y;
                                                
flooritem.Type = FloorItem.Effect;
                                                
flooritem.mColor = 10;
                                                
flooritem.OwnerUID = attacker.UID;
                                                
flooritem.OnFloor = Time32.Now;
                                                
flooritem.Owner = attacker.Owner;
                                                
flooritem.Name = "FuryofEgg";
                                                
map.AddFloorItem(flooritem);
                                                
attacker.Owner.SendScreenSpawn(flooritem, true);
                                            }
                                            else if (
attacker.Owner.Spells[spellID].LevelHu2 == 2)
                                            {
                                                
flooritem.ItemID = FloorItem.ShacklingIce;
                                                
flooritem.X = X;
                                                
flooritem.MapID = map.ID;
                                                
flooritem.Y = Y;
                                                
flooritem.Type = FloorItem.Effect;
                                                
flooritem.mColor = 10;
                                                
flooritem.OwnerUID = attacker.UID;
                                                
flooritem.OnFloor = Time32.Now;
                                                
flooritem.Owner = attacker.Owner;
                                                
flooritem.Name = "ShacklingIce";
                                                
map.AddFloorItem(flooritem);
                                                
attacker.Owner.SendScreenSpawn(flooritem, true);

                                            }
                                            else
                                            {
                                                
flooritem.ItemID = FloorItem.DaggerStorm;
                                                
flooritem.X = X;
                                                
flooritem.MapID = map.ID;
                                                
flooritem.Y = Y;
                                                
flooritem.Type = FloorItem.Effect;
                                                
flooritem.mColor = 10;
                                                
flooritem.OwnerUID = attacker.UID;
                                                
flooritem.OnFloor = Time32.Now;
                                                
flooritem.Owner = attacker.Owner;
                                                
flooritem.Name = "DaggerStorm";
                                                
map.AddFloorItem(flooritem);
                                                
attacker.Owner.SendScreenSpawn(flooritem, true);

                                            }

                                        }
                                        break;
                                    }
                                
#endregion

                                #endregion
                                #region ChainBolt
                                
case 10309:
                                    {
                                        
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;
                                        if (
attacked != null)
                                        {
                                            if (
attacker.ContainsFlag2(Update.Flags2.ChainBoltActive))
                                            {
                                                
PrepareSpell(spell, attacker.Owner);
                                                
suse.X = X;
                                                
suse.Y = Y;
                                                
int maxR = spell.Distance;
                                                if (
attacked != null)
                                                {
                                                    if (
Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= maxR)
                                                    {
                                                        if (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                        {
                                                            var 
damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell, ref attack);
                                                            
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
                                                            
suse.AddTarget(attacked, damage, attack);
                                                        }
                                                    }
                                                }
                                                var Array = 
attacker.Owner.Screen.Objects;
                                                var 
closestTarget = findClosestTarget(attacked, attacked.X, attacked.Y, Array);
                                                
ushort x = closestTarget.X, y = closestTarget.Y;
                                                
int targets = Math.Max((int)spell.Level, 1);

                                                foreach (
Interfaces.IMapObject _obj in Array)
                                                {
                                                    if (
targets == 0) continue;
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
                                                    {
                                                        
attacked = _obj as Entity;

                                                        if (
Kernel.GetDistance(x, y, attacked.X, attacked.Y) <= maxR)
                                                        {
                                                            if (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            {
                                                                
maxR = 6;

                                                                var 
damage2 = Game.Attacking.Calculate.Magic(attacker, attacked, spell, ref attack);
                                                                
damage2 = (uint)(damage2 / 2);
                                                                
ReceiveAttack(attacker, attacked, attack, ref damage2, spell);

                                                                
suse.AddTarget(attacked, damage2, attack);
                                                                
x = attacked.X;
                                                                
y = attacked.Y;
                                                                
targets--;
                                                            }
                                                        }
                                                    }
                                                }
                                                if (
suse.Targets.Count == 0) return;
                                                
attacker.Owner.SendScreen(suse, true);
                                            }
                                            else
                                            {
                                                if (
CanUseSpell(spell, attacker.Owner))
                                                {
                                                    
PrepareSpell(spell, attacker.Owner);
                                                    
attacker.ChainboltStamp = Time32.Now;
                                                    
attacker.ChainboltTime = spell.Duration;
                                                    
attacker.AddFlag2(Update.Flags2.ChainBoltActive);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region ChargingVortex
                                
case 1260:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
spell.UseStamina = 20;
                                            
PrepareSpell(spell, attacker.Owner);
                                            
Game.Attacking.InLineAlgorithm ila = new ahmedfathy.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;
                                            
//suse.SpellLevelHu = client_Spell.LevelHu2;
                                            
foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
                                                {
                                                    
attacked = _obj as Entity;
                                                    if (
ila.InLine(attacked.X, attacked.Y))
                                                    {
                                                        if (!
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            continue;

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

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

                                                        
suse.AddTarget(attacked, damage, attack);
                                                    }
                                                }
                                                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);
                                                        
attack.Damage = damage;

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

                                                        
suse.AddTarget(attackedsob, damage, attack);
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#region RadiantPalm
                                
case 10381:
                                    {
                                        if (
Time32.Now >= attacker.SpellStamp.AddMilliseconds(620))
                                        {
                                            if (
CanUseSpell(spell, attacker.Owner))
                                            {
                                                
attacker.SpellStamp = Time32.Now;
                                                
ushort Xx, Yx;
                                                if (
attacked != null)
                                                {
                                                    
Xx = attacked.X;
                                                    
Yx = attacked.Y;
                                                }
                                                else
                                                {
                                                    
Xx = attackedsob.X;
                                                    
Yx = attackedsob.Y;
                                                }
                                                if (
Kernel.GetDistance(attacker.X, attacker.Y, Xx, Yx) <= 7)
                                                {
                                                    if (
attackedsob == null)
                                                        if (
attacked.ContainsFlag(Update.Flags.Fly))
                                                            return;
                                                    if (
attacker.ContainsFlag(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, ref attack);
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.King)
                                                            {
                                                                
damage = (uint)(damage * 0.899);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Prince)
                                                            {
                                                                
damage = (uint)(damage * 0.929);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Duke)
                                                            {
                                                                
damage = (uint)(damage * 0.999);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Earl)
                                                            {
                                                                
damage = (uint)(damage * 1.100);
                                                            }
                                                            
suse.Effect1 = attack.Effect1;
                                                            
ReceiveAttack(attacker, attacked, attack, ref damage, spell);

                                                            
suse.AddTarget(attacked, damage, attack);
                                                            
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 * 180 / 100);
                                                            
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                            
suse.Effect1 = attack.Effect1;
                                                            
suse.AddTarget(attackedsob, damage, attack);
                                                            
send = true;
                                                        }
                                                    }
                                                    if (
send)
                                                        
attacker.Owner.SendScreen(suse, true);
                                                }
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket = null;
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                
case 10315:
                                    {
                                        if (
spell.ID == 10315)
                                        {
                                            if (
attacker.Owner.Weapons.Item1 == null) return;
                                            if (
attacker.Owner.Weapons.Item1.IsTwoHander()) return;
                                        }
                                        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;
                                            
UInt16 ox, oy;
                                            
ox = attacker.X;
                                            
oy = attacker.Y;
                                            if (
spellID == 10315)
                                            {
                                                
Attack npacket = new Attack(true);
                                                
npacket.Attacker = attacker.UID;
                                                
npacket.AttackType = 53;
                                                
npacket.X = X;
                                                
npacket.Y = Y;
                                                
Writer.WriteUInt16(spell.ID, 28, npacket.ToArray());
                                                
Writer.WriteByte(spell.Level, 30, 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 (
Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)
                                                {
                                                    if (
spellID == 10315)
                                                    {
                                                        foreach (
IMapObject objs in objects.ToArray())
                                                        {
                                                            if (
objs == null) continue;
                                                            if (
objs.MapObjType == MapObjectType.Monster || objs.MapObjType == MapObjectType.Entity)
                                                            {
                                                                
attacked = objs as Entity;
                                                                if (
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);
                                                                        
damage = (uint)(damage * 0.8);
                                                                        
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;
                                                                        }
                                                                        if (
spell.ID == 8030)
                                                                        {
                                                                            
attack.Effect1 = Attack.AttackEffects1.None;
                                                                            
damage = Game.Attacking.Calculate.Ranged(attacker, attacked, ref attack);
                                                                        }
                                                                        
suse.Effect1 = attack.Effect1;
                                                                        
ReceiveAttack(attacker, attacked, attack, ref damage, spell);

                                                                        
suse.AddTarget(attacked, damage, attack);
                                                                    }
                                                                }
                                                            }
                                                            else if (
objs.MapObjType == MapObjectType.SobNpc)
                                                            {
                                                                
attackedsob = objs as SobNpcSpawn;
                                                                if (
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.AddTarget(attackedsob, damage, attack);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                        {
                                                            if (
_obj == null) continue;
                                                            if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
                                                            {
                                                                
attacked = _obj as Entity;
                                                                if (
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, ref damage, spell);
                                                                        
suse.AddTarget(attacked, damage, attack);
                                                                    }
                                                                }
                                                            }
                                                            else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                            {
                                                                
attackedsob = _obj as SobNpcSpawn;
                                                                if (
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.AddTarget(attackedsob, damage, attack);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    
attacker.AttackPacket = null;
                                                }
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                            
Calculations.IsBreaking(attacker.Owner, ox, oy);
                                        }
                                        break;
                                    }
                                
#region ChargingVortex
                                
case 11190:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            if (
attacker.Owner.Map.Floor[X, Y, MapObjectType.InvalidCast, null])
                                                break;
                                            
spell.UseStamina = 20;
                                            
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;
                                            
UInt16 ox, oy;
                                            
ox = attacker.X;
                                            
oy = attacker.Y;
                                            
attack.X = X;
                                            
attack.Y = Y;
                                            
attack.Attacker = attacker.UID;
                                            
attack.AttackType = 53;
                                            
attack.X = X;
                                            
attack.Y = Y;
                                            
attacker.Owner.SendScreen(attack, true);
                                            
attacker.X = X;
                                            
attacker.Y = Y;
                                            if (
Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)
                                            {

                                                var Array = 
attacker.Owner.Screen.Objects;

                                                foreach (
Interfaces.IMapObject _obj in Array)
                                                {
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
                                                    {
                                                        
attacked = _obj as Entity;
                                                        if (
Kernel.GetDistance(X, Y, attacked.X, attacked.Y) > spell.Range)
                                                            continue;
                                                        if (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                        {
                                                            var 
damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);

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

                                                            
suse.AddTarget(attacked, damage, attack);
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob = _obj as SobNpcSpawn;
                                                        if (
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);
                                                                
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                                
suse.AddTarget(attackedsob, damage, attack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket = null;
                                            }
                                            
Calculations.IsBreaking(attacker.Owner, ox, oy);
                                            
attacker.Owner.SendScreen(suse, true);
                                            
attacker.Owner.Screen.Reload(suse);
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region Heaven Blade
                                
case 10310:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            if (
attacked != null)
                                            {
                                                if (
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, false))
                                                    {
                                                        
PrepareSpell(spell, attacker.Owner);
                                                        var 
damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell, ref attack, client_Spell.LevelHu2);
                                                        
damage = (uint)(damage * 1.4);
                                                        if (
Kernel.Rate(spell.Percent))
                                                        {
                                                            
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
                                                            
suse.AddTarget(attacked, damage, attack);
                                                        }
                                                        else
                                                        {
                                                            
damage = 0;
                                                            
suse.AddTarget(attacked, damage, attack);
                                                        }
                                                        
attacker.Owner.SendScreen(suse, true);
                                                    }
                                                }
                                                else
                                                {
                                                    
attacker.AttackPacket = null;
                                                }
                                            }
                                            else
                                            {
                                                if (
attackedsob != null)
                                                {
                                                    if (
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);
                                                            var 
damage = Game.Attacking.Calculate.Magic(attacker, attackedsob, spell, ref attack);
                                                            if (
Kernel.Rate(spell.Percent))
                                                            {
                                                                
ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                                
suse.AddTarget(attackedsob, damage, attack);
                                                            }
                                                            else
                                                            {
                                                                
damage = 0;
                                                                
suse.AddTarget(attackedsob, damage, attack);
                                                            }
                                                            
attacker.Owner.SendScreen(suse, true);
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        else
                                        {
                                            
attacker.AttackPacket = null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region New Trojan
                                #region SuperCyclone
                                
case 11970:
                                    {
                                        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 (!
attacked.OnKOSpell())
                                                
attacked.KOCount = 0;
                                            
attacked.KOSpell = spell.ID;
                                            
suse.AddTarget(attacked, 0, attack);
                                            
attacked.SuperCycloneStamp = Time32.Now;
                                            
attacked.SuperCycloneTime = 40;
                                            
attacked.AddFlag3(Update.Flags3.SuperCyclone);
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region FatalCross
                                
case 11980:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner) && Time32.Now > attacker.SpellStamp.AddMilliseconds(1))
                                        {
                                            
PrepareSpell(spell, attacker.Owner);
                                            
SpellUse suse = new SpellUse(true);
                                            
suse.Attacker = attacker.UID;
                                            
suse.SpellID = spell.ID;
                                            
suse.SpellLevel = spell.Level;
                                            
ushort _X = attacker.X, _Y = attacker.Y;
                                            
ushort _tX = X, _tY = Y;
                                            
byte dist = (byte)spell.Distance;
                                            var Array = 
attacker.Owner.Screen.Objects;
                                            
InLineAlgorithm algo = new InLineAlgorithm(attacker.X, X, attacker.Y, Y, dist,
                                                                               
InLineAlgorithm.Algorithm.DDA);
                                            
int i = algo.lcoords.Count;
                                            
suse.X = X;
                                            
suse.Y = Y;
                                            foreach (
Interfaces.IMapObject _obj in Array)
                                            {
                                                
bool hit = false;
                                                for (
int j = 0; j < i; j++)
                                                    if (
Kernel.GetDDistance(_obj.X, _obj.Y, (ushort)algo.lcoords[j].X, (ushort)algo.lcoords[j].Y) <= 5)
                                                        
hit = true;
                                                if (
hit)
                                                {
                                                    if (
_obj.MapObjType == MapObjectType.Monster)
                                                    {
                                                        
attacked = _obj as Entity;
                                                        if (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                        {
                                                            var 
damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
                                                            
damage = (damage * 36) / 100;

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

                                                            
suse.AddTarget(attacked, damage, attack);
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.Entity)
                                                    {
                                                        
attacked = _obj as Entity;
                                                        if (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                        {
                                                            
attack.Effect1 = Attack.AttackEffects1.None;
                                                            
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);

                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.King)
                                                            {
                                                                
damage = (uint)(damage * 0.818);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Prince)
                                                            {
                                                                
damage = (uint)(damage * 0.855);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Duke)
                                                            {
                                                                
damage = (uint)(damage * 0.958);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Earl)
                                                            {
                                                                
damage = (uint)(damage * 1.050);
                                                            }
                                                            
suse.Effect1 = attack.Effect1;
                                                            
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
                                                            
suse.AddTarget(attacked, damage, attack);
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob = _obj as SobNpcSpawn;
                                                        if (
CanAttack(attacker, attackedsob, spell))
                                                        {
                                                            var 
damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                            
ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                            
suse.AddTarget(attackedsob, damage, attack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(suse, true);

                                        }
                                        break;
                                    }
                                
#endregion
                                #region BreathFocus
                                
case 11960:
                                    {
                                        
SpellUse suse = new SpellUse(true);
                                        
suse.Attacker = attacker.UID;
                                        
suse.SpellID = spell.ID;
                                        
suse.X = attacker.X;
                                        
suse.Y = attacker.Y;
                                        
suse.Targets.Add(attacker.UID, 1);
                                        
attacker.Owner.SendScreen(suse, true);
                                        
attacker.Stamina += (byte)spell.Power;
                                        
attacker.Owner.Send(new Message("Your Stamina has increased by " + spell.Power, Message.TopLeft));
                                        break;
                                    }
                                
#endregion
                                #region MortalStrike
                                
case 11990:
                                    {
                                        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 (
Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range + 1)
                                            {
                                                foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (
_obj == null)
                                                        continue;
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
                                                    {
                                                        
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;
                                                                var 
damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
                                                                
damage = (uint)(damage * 1.0);
                                                                
suse.Effect1 = attack.Effect1;
                                                                
ReceiveAttack(attacker, attacked, attack, ref damage, spell);

                                                                
suse.AddTarget(attacked, damage, attack);
                                                            }
                                                        }
                                                    }
                                                    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);
                                                                
ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                                
suse.AddTarget(attackedsob, damage, attack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket = null;
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region Windwalker
                                #region Chaser
                                #region ShadowofChaser(Active)
                                
case 13090:
                                    {
                                        if (
attacker.ContainsFlag4(Update.Flags4.ShadowofChaser))
                                        {
                                            
attacker.RemoveFlag4(Update.Flags4.ShadowofChaser);
                                            
attacker.AttackPacket = null;
                                            break;
                                        }
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
PrepareSpell(spell, attacker.Owner);
                                            
SpellUse suse = new SpellUse(true);
                                            
suse.Attacker = attacker.UID;
                                            
suse.Attacker1 = attacker.UID;
                                            
suse.SpellID = spell.ID;
                                            
suse.SpellLevel = spell.Level;
                                            
suse.AddTarget(attacker, 0, null);
                                            
attack = new Attack(true);
                                            
attack.Attacker = attack.Attacked = attacker.UID;
                                            
attack.X = attacker.X; attack.Y = attacker.Y;
                                            
attack.AttackType = 24;
                                            
attack.SpellID = spell.ID;
                                            
attacker.Owner.SendScreen(suse, true);
                                            
attacker.AddFlag4(Update.Flags4.ShadowofChaser);
                                            
attacker.AttackPacket = null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region ThunderCloud[Chaser]
                                
case 12840:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
attacker.GreenEffect = 10;
                                            
PrepareSpell(spell, attacker.Owner);
                                            
SpellUse suse = new SpellUse(true);
                                            
suse.Attacker = attacker.UID;
                                            
suse.Attacker1 = attacker.UID;
                                            
suse.SpellID = spell.ID;
                                            
suse.SpellLevel = spell.Level;
                                            var 
cl = new WindWalker.ThunderCloud(attacker.Owner, attack.X, attack.Y);
                                            
suse.AddTarget(cl.UID, 0, null);
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region ThunderBolt[Chaser]
                                
case 12970:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
//attacker.GreenEffect = 10;
                                            
PrepareSpell(spell, attacker.Owner);
                                            
SpellUse suse = new SpellUse(true);
                                            
suse.Attacker = attacker.UID;
                                            
suse.Attacker1 = attacker.UID;
                                            
suse.SpellID = spell.ID;
                                            
suse.SpellLevel = spell.Level;
                                            
suse.AddTarget(attacker.UID, 0, null);
                                            
attacker.Owner.SendScreen(suse, true);
                                            foreach (var 
Cloud in attacker.Owner.Map.Clouds.Values.ToList())
                                            {
                                                
Cloud.ThunderBolt = true;
                                                
attacker.ThunderBolt = true;
                                                
//Cloud.DisposeCloud2(attacker.Owner);
                                                
if (Kernel.GetDistance(Cloud.X, Cloud.Y, attacker.Owner.Player.X, attacker.Owner.Player.Y) > 16) continue;
                                                
Cloud.SendSpawn2(attacker.Owner, false);
                                                
//ThunderCloud cl = new ThunderCloud(attacker.Owner, Cloud.X, Cloud.Y);
                                            
}

                                        }
                                        break;
                                    }
                                
#endregion
                                #region TripleBlasts(Passive)
                                
case 12850:
                                    if (
attacker.Stamina >= 10)
                                        
attacker.Stamina -= 10;
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
PrepareSpell(spell, attacker.Owner);
                                            
SpellUse suse = new SpellUse(true);
                                            
suse.Attacker = attacker.UID;
                                            
suse.Attacker1 = attackedsob == null ? attacked.UID : attackedsob.UID;
                                            
suse.SpellID = spell.ID;
                                            
suse.SpellLevel = spell.Level;
                                            
suse.X = X;
                                            
suse.Y = Y;
                                            if (
attackedsob == null)
                                            {
                                                if (
CanAttack(attacker, attacked, spell, false))
                                                {
                                                    if (
attacker.ContainsFlag4(Update.Flags4.ShadowofChaser) && attacker.IsChaser2())
                                                    {
                                                        var 
spell2 = Database.SpellTable.GetSpell(13090, attacker.Owner);
                                                        if (
spell2 != null)
                                                        {
                                                            
spell2.CanKill = true;
                                                            if (
Kernel.Rate(spell2.Percent))
                                                            {
                                                                
ShadowofChaser(attacker, attacked, attack, 1);
                                                                break;
                                                            }
                                                        }
                                                    }
                                                    
attack.Effect1 = Attack.AttackEffects1.None;
                                                    
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);

                                                    if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.King)
                                                    {
                                                        
damage = (uint)(damage * 0.558);
                                                    }
                                                    if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Prince)
                                                    {
                                                        
damage = (uint)(damage * 0.633);
                                                    }
                                                    if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Duke)
                                                    {
                                                        
damage = (uint)(damage * 0.667);
                                                    }
                                                    if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Earl)
                                                    {
                                                        
damage = (uint)(damage * 0.820);
                                                    }
                                                    
suse.Effect1 = attack.Effect1;
                                                    
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
                                                    
suse.AddTarget(attacked, damage, attack);
                                                    
attacker.Owner.SendScreen(suse, true);
                                                }
                                            }
                                            else
                                            {
                                                if (
CanAttack(attacker, attackedsob, spell))
                                                {
                                                    
attack.Effect1 = Attack.AttackEffects1.None;
                                                    
uint damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
                                                    
suse.Effect1 = attack.Effect1;
                                                    
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                    
suse.AddTarget(attackedsob, damage, attack);
                                                    
attacker.Owner.SendScreen(suse, true);
                                                }
                                            }

                                        }
                                        break;
                                    }
                                
#endregion
                                #region SwirlingStorm(Passive)
                                
case 12890:
                                    if (
attacker.Stamina >= 15)
                                        
attacker.Stamina -= 15;
                                    {
                                        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)
                                            {
                                                
byte dist = (byte)spell.Distance;
                                                
InLineAlgorithm algo = new InLineAlgorithm(attacker.X, X, attacker.Y, Y, dist, InLineAlgorithm.Algorithm.DDA);
                                                
int i = algo.lcoords.Count;
                                                
double disth = 3.0;
                                                if (
_obj == null)
                                                    continue;
                                                if (
_obj.MapObjType == MapObjectType.Entity)
                                                {
                                                    
bool hit = false;
                                                    for (
int j = 0; j < i; j++)
                                                        if (
Kernel.GetDDistance(_obj.X, _obj.Y, (ushort)algo.lcoords[j].X, (ushort)algo.lcoords[j].Y) <= disth)
                                                            
hit = true;
                                                    if (
hit)
                                                    {
                                                        
attacked = _obj as Entity;

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

                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.King)
                                                                {
                                                                    
damage = (uint)(damage * 0.628);
                                                                }
                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Prince)
                                                                {
                                                                    
damage = (uint)(damage * 0.712);
                                                                }
                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Duke)
                                                                {
                                                                    
damage = (uint)(damage * 0.780);
                                                                }
                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Earl)
                                                                {
                                                                    
damage = (uint)(damage * 0.820);
                                                                }
                                                                
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
                                                                
suse.AddTarget(attacked, damage, attack);
                                                            }
                                                        }
                                                    }
                                                }
                                                else if (
_obj.MapObjType == MapObjectType.Monster)
                                                {
                                                    
bool hit = false;
                                                    for (
int j = 0; j < i; j++)
                                                        if (
Kernel.GetDDistance(_obj.X, _obj.Y, (ushort)algo.lcoords[j].X, (ushort)algo.lcoords[j].Y) <= disth)
                                                            
hit = true;
                                                    if (
hit)
                                                    {
                                                        
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);
                                                                
damage = (uint)(damage * 0.9);
                                                                
suse.Effect1 = attack.Effect1;
                                                                
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
                                                                
suse.AddTarget(attacked, damage, attack);
                                                            }
                                                        }
                                                    }
                                                }
                                                else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    
bool hit = false;
                                                    for (
int j = 0; j < i; j++)
                                                        if (
Kernel.GetDDistance(_obj.X, _obj.Y, (ushort)algo.lcoords[j].X, (ushort)algo.lcoords[j].Y) <= disth)
                                                            
hit = true;
                                                    if (
hit)
                                                    {
                                                        
attackedsob = _obj as SobNpcSpawn;
                                                        if (
attackedsob == null) continue;
                                                        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 * 0.3);
                                                                
attack.Damage = 0;
                                                                
suse.Effect1 = attack.Effect1;
                                                                
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                                
suse.AddTarget(attackedsob, damage, attack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        else
                                        {
                                            
attacker.AttackPacket = null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Omnipotence(XP)
                                
case 12860:
                                    {
                                        
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.XPList))
                                        {
                                            
attacker.AddFlag4(Update.Flags4.Omnipotence);
                                            
attacker.OmnipotenceStamp = Time32.Now;
                                            
attacker.RemoveFlag(Update.Flags.XPList);
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        else
                                        {
                                            if (
Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)
                                            {
                                                foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (
_obj == null) continue;
                                                    if (
_obj.MapObjType == MapObjectType.Entity)
                                                    {
                                                        
attacked = _obj as Entity;
                                                        if (
attacked == null) break;
                                                        if (
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, spell, ref attack) / 10;
                                                                
suse.Effect1 = attack.Effect1;
                                                                
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
                                                                
suse.AddTarget(attacked, damage, attack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob = _obj as SobNpcSpawn;
                                                        if (
attackedsob == null) continue;
                                                        if (
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);
                                                                
damage = (uint)(damage * 180 / 100);
                                                                
suse.Effect1 = attack.Effect1;

                                                                
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                                
suse.AddTarget(attackedsob, damage, attack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.Monster)
                                                    {
                                                        
attacked = _obj as Entity;
                                                        if (
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, spell, ref attack);
                                                                
damage = (uint)(damage * 0.5);
                                                                
suse.Effect1 = attack.Effect1;
                                                                
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
                                                                
suse.AddTarget(attacked, damage, attack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        
attacker.Owner.SendScreen(suse, true);
                                        
attacker.AttackPacket = null;
                                        break;
                                    }
                                
#endregion
                                #region FrostGaze(I-II-III)
                                
case 12830:
                                case 
13070:
                                case 
13080:
                                    {
                                        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.Owner.SendScreen(suse, true);
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
_obj.MapObjType == MapObjectType.Entity)
                                                {
                                                    
attacked = _obj as Entity;
                                                    if (
attacked == null) break;
                                                    if (
Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
                                                    {
                                                        if (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                        {
                                                            
int Rate = 100;
                                                            
int diff = attacked.BattlePower - attacker.BattlePower;
                                                            if (
diff < 0) diff = 0;
                                                            
Rate -= (byte)(diff * 5);
                                                            if (
Rate < 0) Rate = 0;
                                                            if (
Kernel.Rate(Rate))
                                                            {
                                                                if (
attacked.Stamina >= (byte)spell.Power)
                                                                    
attacked.Stamina -= (byte)spell.Power;
                                                                else 
attacked.Stamina = 0;
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region Stomper
                                #region HealingSnow(Active)
                                
case 12950:
                                    {
                                        if (
attacker.ContainsFlag4(Update.Flags4.HealingSnow))
                                        {
                                            
attacker.RemoveFlag4(Update.Flags4.HealingSnow);
                                            
attacker.AttackPacket = null;
                                            break;
                                        }
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
attacker.RemoveFlag4(Update.Flags4.HealingSnow);
                                            
attacker.RemoveFlag4(Update.Flags4.HealingSnow);
                                            
PrepareSpell(spell, attacker.Owner);
                                            
SpellUse suse = new SpellUse(true);
                                            
suse.Attacker = attacker.UID;
                                            
suse.Attacker1 = attacker.UID;
                                            
suse.SpellID = spell.ID;
                                            
suse.SpellLevel = spell.Level;
                                            
suse.X = X;
                                            
suse.Y = Y;
                                            
suse.AddTarget(attacker, 0, attack);
                                            
attacker.Owner.SendScreen(suse, true);
                                            
attacker.AddFlag4(Update.Flags4.HealingSnow);
                                            
attacker.AttackPacket = null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region RevengeTail(Active)
                                
case 13030:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
PrepareSpell(spell, attacker.Owner);
                                            
SpellUse suse = new SpellUse(true);
                                            
suse.Attacker = attacker.UID;
                                            
suse.Attacker1 = attacker.UID;
                                            
suse.SpellID = spell.ID;
                                            
suse.SpellLevel = spell.Level;
                                            
suse.X = X;
                                            
suse.Y = Y;
                                            
suse.AddTarget(attacker, 0, attack);
                                            
attacker.Owner.SendScreen(suse, true);
                                            
attacker.AddFlag4(Update.Flags4.RevengeTaill);
                                            
attacker.RevengeTaillStamp = Time32.Now;
                                            
attacker.AttackPacket = null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region BurntFrost[Stomper]
                                
case 12940:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
PrepareSpell(spell, attacker.Owner); if (CanUseSpell(spell, attacker.Owner))
                                                
attacker.GreenEffect = 10;
                                            
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(180, spell.Distance);
                                            if (
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.Entity)
                                                    {
                                                        
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, ref attack);

                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.King)
                                                                {
                                                                    
damage = (uint)(damage * 0.780);
                                                                }
                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Prince)
                                                                {
                                                                    
damage = (uint)(damage * 0.810);
                                                                }
                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Duke)
                                                                {
                                                                    
damage = (uint)(damage * 0.958);
                                                                }
                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Earl)
                                                                {
                                                                    
damage = (uint)(damage * 1.050);
                                                                }
                                                                
suse.Effect1 = attack.Effect1;
                                                                
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
                                                                
suse.AddTarget(attacked, damage, attack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob = _obj as SobNpcSpawn;
                                                        if (
attackedsob == null) continue;
                                                        
//if (attackedsob == null) Console.WriteLine(Environment.StackTrace);
                                                        
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);
                                                                
suse.Effect1 = attack.Effect1;
                                                                
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                                
suse.AddTarget(attackedsob, damage, attack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket = null;
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region RageofWar(Passive)
                                
case 12930:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
PrepareSpell(spell, attacker.Owner);
                                            
Game.Attacking.InLineAlgorithm ila = new 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;
                                            
attacker.Owner.SendScreen(suse, true);
                                            
bool first = false;
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
_obj.MapObjType == MapObjectType.Entity)
                                                {
                                                    
attacked = _obj as Entity;
                                                    if (
ila.InLine(attacked.X, attacked.Y))
                                                    {
                                                        if (!
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            continue;
                                                        if (
Kernel.GetDistance(attacked.X, attacked.Y, attacker.X, attacker.Y) > 15) continue;
                                                        if (!
first)
                                                        {
                                                            var 
map = Kernel.Maps[attacker.MapID];
                                                            
Network.GamePackets.FloorItem flooritem = new Network.GamePackets.FloorItem(true);
                                                            
flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
                                                            while (
map.Npcs.ContainsKey(flooritem.UID))
                                                                
flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
                                                            
flooritem.ItemID = FloorItem.RageOfWarTrap;
                                                            
flooritem.X = attacked.X;
                                                            
flooritem.MapID = map.ID;
                                                            
flooritem.Y = attacked.Y;
                                                            
flooritem.MapObjType = MapObjectType.FloorSpell;
                                                            
flooritem.Type = FloorItem.Effect;
                                                            
flooritem.mColor = 15;
                                                            
flooritem.OwnerUID = attacker.UID;
                                                            
flooritem.OnFloor = Time32.Now;
                                                            
flooritem.Owner = attacker.Owner;
                                                            
flooritem.Name2 = "RageofWarTrap";
                                                            
map.AddFloorItem(flooritem);
                                                            
attacker.Owner.SendScreenSpawn(flooritem, true);
                                                            
first = true;
                                                        }
                                                        
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);

                                                        if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.King)
                                                        {
                                                            
damage = (uint)(damage * 0.758);
                                                        }
                                                        if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Prince)
                                                        {
                                                            
damage = (uint)(damage * 0.858);
                                                        }
                                                        if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Duke)
                                                        {
                                                            
damage = (uint)(damage * 0.920);
                                                        }
                                                        if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Earl)
                                                        {
                                                            
damage = (uint)(damage * 1.020);
                                                        }
                                                        
attack.Damage = damage;
                                                        
ReceiveAttack(attacker, attacked, attack, ref damage, spell);

                                                        
suse.AddTarget(attacked, damage, attack);
                                                    }
                                                }
                                                else if (
_obj.MapObjType == MapObjectType.Monster)
                                                {
                                                    
attacked = _obj as Entity;
                                                    if (
ila.InLine(attacked.X, attacked.Y))
                                                    {
                                                        if (!
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            continue;
                                                        if (
Kernel.GetDistance(attacked.X, attacked.Y, attacker.X, attacker.Y) > 11) continue;
                                                        if (!
first)
                                                        {
                                                            var 
map = Kernel.Maps[attacker.MapID];
                                                            
Network.GamePackets.FloorItem flooritem = new Network.GamePackets.FloorItem(true);
                                                            
flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
                                                            while (
map.Npcs.ContainsKey(flooritem.UID))
                                                                
flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;

                                                            
flooritem.ItemID = FloorItem.RageOfWarTrap;
                                                            
flooritem.X = attacked.X;
                                                            
flooritem.MapID = map.ID;
                                                            
flooritem.Y = attacked.Y;
                                                            
flooritem.Type = FloorItem.Effect;
                                                            
flooritem.MapObjType = MapObjectType.FloorSpell;
                                                            
flooritem.mColor = 15;
                                                            
flooritem.OwnerUID = attacker.UID;
                                                            
flooritem.OnFloor = Time32.Now;
                                                            
flooritem.Owner = attacker.Owner;
                                                            
flooritem.Name2 = "RageofWarTrap";
                                                            
map.AddFloorItem(flooritem);
                                                            
attacker.Owner.SendScreenSpawn(flooritem, true);
                                                            
first = true;
                                                        }

                                                        
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
                                                        
damage = (uint)(damage * 1.0);

                                                        
attack.Damage = damage;

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

                                                        
suse.AddTarget(attacked, damage, attack);
                                                    }


                                                }
                                                else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    
attackedsob = _obj as SobNpcSpawn;
                                                    if (
attackedsob == null) continue;
                                                    if (
ila.InLine(attackedsob.X, attackedsob.Y))
                                                    {
                                                        if (!
CanAttack(attacker, attackedsob, spell))
                                                            continue;
                                                        if (
Kernel.GetDistance(attackedsob.X, attackedsob.Y, attacker.X, attacker.Y) > 11) continue;
                                                        if (!
first)
                                                        {
                                                            var 
map = Kernel.Maps[attacker.MapID];
                                                            
Network.GamePackets.FloorItem flooritem = new Network.GamePackets.FloorItem(true);
                                                            
flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
                                                            while (
map.Npcs.ContainsKey(flooritem.UID))
                                                                
flooritem.UID = Network.GamePackets.FloorItem.FloorUID.Next;
                                                            
flooritem.MapObjType = MapObjectType.FloorSpell;
                                                            
flooritem.ItemID = FloorItem.RageOfWarTrap;
                                                            
flooritem.X = attackedsob.X;
                                                            
flooritem.MapID = map.ID;
                                                            
flooritem.Y = attackedsob.Y;
                                                            
flooritem.Type = FloorItem.Effect;
                                                            
flooritem.mColor = 15;
                                                            
flooritem.OwnerUID = attacker.UID;
                                                            
flooritem.OnFloor = Time32.Now;
                                                            
flooritem.Owner = attacker.Owner;
                                                            
flooritem.Name2 = "RageofWarTrap";
                                                            
map.AddFloorItem(flooritem);
                                                            
attacker.Owner.SendScreenSpawn(flooritem, true);
                                                            
first = true;
                                                        }

                                                        
uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                        
damage = (uint)(damage * 180 / 100);
                                                        
attack.Damage = damage;

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

                                                        
suse.AddTarget(attackedsob, damage, attack);
                                                    }


                                                }
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                            
attacker.AttackPacket = null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #endregion
                                #region EpicWarrior
                                
case 12660:
                                    {
                                        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.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#region Superman
                                
case 1025:
                                    {
                                        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 (!
attacked.OnKOSpell())
                                                
attacked.KOCount = 0;
                                            
attacked.KOSpell = spell.ID;
                                            
suse.AddTarget(attacked, 0, attack);
                                            
attacked.SupermanStamp = Time32.Now;
                                            
attacked.SupermanTime = 20;
                                            
attacked.AddFlag(Update.Flags.Superman);
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region ScarofEarth
                                
case 12670:
                                    {
                                        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;
                                            
suse.SpellEffect = 1;
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null) continue;
                                                if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
                                                {
                                                    
attacked = _obj as Entity;
                                                    if (
Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= 2)
                                                    {
                                                        if (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Ranged))
                                                        {
                                                            var 
damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
                                                            
damage = (uint)(damage * 1.100);
                                                            
suse.Effect1 = attack.Effect1;
                                                            
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
                                                            
attacked.Stunned = true;
                                                            
attacked.StunStamp = Time32.Now;
                                                            
suse.AddTarget(attacked, damage, attack);
                                                        }
                                                    }
                                                }
                                                else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    
attackedsob = _obj as SobNpcSpawn;
                                                    if (
Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= 2)
                                                    {
                                                        if (
CanAttack(attacker, attackedsob, spell))
                                                        {

                                                            
attack.Effect1 = Attack.AttackEffects1.None;
                                                            
uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                            
damage = (damage * 2);
                                                            
attack.Damage = damage;
                                                            
suse.Effect1 = attack.Effect1;
                                                            
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                            
suse.AddTarget(attackedsob, damage, attack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Pounce
                                
case 12770:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
PrepareSpell(spell, attacker.Owner);
                                            
SpellUse suse = new SpellUse(true);
                                            
suse.Attacker = attacker.UID;
                                            
suse.SpellID = spell.ID;
                                            
//suse.SpellLevelHu = client_Spell.LevelHu2;
                                            
suse.SpellLevel = spell.Level;
                                            
ushort _X = attacker.X, _Y = attacker.Y;
                                            
ushort _tX = X, _tY = Y;
                                            
byte dist = (byte)spell.Distance;
                                            var Array = 
attacker.Owner.Screen.Objects;
                                            
InLineAlgorithm algo = new InLineAlgorithm(attacker.X, X, attacker.Y, Y, dist,
                                                                               
InLineAlgorithm.Algorithm.DDA);
                                            
X = attacker.X;
                                            
Y = attacker.Y;
                                            
int i = 0;
                                            for (
i = 0; i < algo.lcoords.Count; i++)
                                            {
                                                if (
attacker.Owner.Map.Floor[algo.lcoords[i].X, algo.lcoords[i].Y, MapObjectType.Entity]
                                                    && !
attacker.ThroughGate(algo.lcoords[i].X, algo.lcoords[i].Y))
                                                {
                                                    
X = (ushort)algo.lcoords[i].X;
                                                    
Y = (ushort)algo.lcoords[i].Y;
                                                }
                                                else
                                                {
                                                    break;
                                                }
                                            }
                                            
suse.X = X;
                                            
suse.Y = Y;
                                            if (!
attacker.Owner.Map.Floor[X, Y, MapObjectType.Entity, null])
                                                return;
                                            
double disth = 1.5;

                                            foreach (
Interfaces.IMapObject _obj in Array)
                                            {
                                                
bool hit = false;
                                                for (
int j = 0; j < i; j++)
                                                    if (
Kernel.GetDDistance(_obj.X, _obj.Y, (ushort)algo.lcoords[j].X, (ushort)algo.lcoords[j].Y) <= disth)
                                                        
hit = true;
                                                if (
hit)
                                                {
                                                    if (
_obj.MapObjType == MapObjectType.Monster)
                                                    {
                                                        
attacked = _obj as Entity;
                                                        if (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                        {
                                                            var 
damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack, client_Spell.LevelHu2);
                                                            
ReceiveAttack(attacker, attacked, attack, ref damage, spell);

                                                            
suse.AddTarget(attacked, damage, attack);
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.Entity)
                                                    {
                                                        
attacked = _obj as Entity;
                                                        if (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                        {
                                                            var 
damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
                                                            
damage = (uint)(damage * 1.100);
                                                            
ReceiveAttack(attacker, attacked, attack, ref damage, spell);

                                                            
suse.AddTarget(attacked, damage, attack);
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob = _obj as SobNpcSpawn;
                                                        if (
CanAttack(attacker, attackedsob, spell))
                                                        {
                                                            var 
damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);

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

                                                            
suse.AddTarget(attackedsob, damage, attack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.X = X;
                                            
attacker.Y = Y;
                                            
attacker.Owner.SendScreen(suse, true);
                                            
attacker.Owner.Screen.Reload(suse);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region ManiacDance
                                
case 12700:
                                    {

                                        if (
attacker.ContainsFlag(Update.Flags.XPList))
                                        {
                                            
attacker.RemoveFlag(Update.Flags.XPList);
                                            
SpellUse suse = new SpellUse(true);
                                            
suse.Attacker = attacker.UID;
                                            
suse.SpellID = spell.ID;
                                            
suse.SpellLevel = spell.Level;
                                            
suse.X = X;
                                            
suse.Y = Y;

                                            
attacker.ManiacDanceStamp = Time32.Now;
                                            
attacker.AddFlag3(Update.Flags3.WaniacDance);
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region BackFire
                                
case 12680:
                                    if (
attacker.Stamina >= 10)
                                        
attacker.Stamina -= 10;
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
PrepareSpell(spell, attacker.Owner);
                                            
attack.Attacker = attack.Attacked = attacker.UID;
                                            
attack.X = attacker.X;
                                            
attack.Y = attacker.Y;
                                            
attack.AttackType = 24;
                                            
attack.Damage = 3000;
                                            
attacker.Owner.SendScreen(attack, true);
                                            
SpellUse suse = new SpellUse(true);
                                            
suse.Attacker = attacker.UID;
                                            
suse.Attacker1 = attacker.UID;
                                            
suse.SpellID = spell.ID;
                                            
suse.SpellLevel = spell.Level;
                                            
suse.X = X;
                                            
suse.Y = Y;
                                            
attacker.BackFireStamp = Time32.Now;
                                            
attacker.AddFlag3(Update.Flags3.BackFire);
                                            if (
attacker.Stamina <= 70) attacker.Stamina += 30;
                                            else 
attacker.Stamina = 100;
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region WaveofBlood
                                
case 12690:
                                    {
                                        if (
Time32.Now >= attacker.SpellStamp.AddMilliseconds(1))
                                        {
                                            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 (
Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Distance + 1)
                                                {
                                                    foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                    {
                                                        
byte dist = (byte)spell.Distance;
                                                        
InLineAlgorithm algo = new InLineAlgorithm(attacker.X, X, attacker.Y, Y, dist, InLineAlgorithm.Algorithm.DDA);
                                                        
int i = algo.lcoords.Count;
                                                        
double disth = 3.0;
                                                        if (
_obj == null)
                                                            continue;
                                                        if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
                                                        {
                                                            
bool hit = false;
                                                            for (
int j = 0; j < i; j++)
                                                                if (
Kernel.GetDDistance(_obj.X, _obj.Y, (ushort)algo.lcoords[j].X, (ushort)algo.lcoords[j].Y) <= disth)
                                                                    
hit = true;
                                                            if (
hit)
                                                            {
                                                                
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, ref attack);

                                                                        if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.King)
                                                                        {
                                                                            
damage = (uint)(damage * 0.818);
                                                                        }
                                                                        if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Prince)
                                                                        {
                                                                            
damage = (uint)(damage * 0.855);
                                                                        }
                                                                        if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Duke)
                                                                        {
                                                                            
damage = (uint)(damage * 0.958);
                                                                        }
                                                                        if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Earl)
                                                                        {
                                                                            
damage = (uint)(damage * 1.050);
                                                                        }
                                                                        
suse.Effect1 = attack.Effect1;
                                                                        
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
                                                                        
suse.AddTarget(attacked, damage, attack);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                        else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                        {
                                                            
bool hit = false;
                                                            for (
int j = 0; j < i; j++)
                                                                if (
Kernel.GetDDistance(_obj.X, _obj.Y, (ushort)algo.lcoords[j].X, (ushort)algo.lcoords[j].Y) <= disth)
                                                                    
hit = true;
                                                            if (
hit)
                                                            {
                                                                
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 * 180 / 100);
                                                                        
ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                                        
suse.AddTarget(attackedsob, damage, attack);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    
attacker.AttackPacket = null;
                                                }
                                                
byte seconds = 8;
                                                if (
Time32.Now >= attacker.AngerCooldown.AddSeconds(seconds))
                                                {
                                                    
attacker.AngerCooldown = Time32.Now;
                                                    
attacker.Update(90, seconds, false);
                                                }
                                                
attacker.Owner.SendScreen(suse, true);
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region New Ninja By Phoenix
                                #region TwilightDance
                                
case 12070:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
PrepareSpell(spell, attacker.Owner);
                                            
SpellUse suse = new SpellUse(true);
                                            
suse.Attacker = attacker.UID;
                                            
// suse.Attacker1 = attacker.UID;
                                            
suse.SpellID = spell.ID;
                                            
suse.SpellLevel = spell.Level;

                                            
TwilightAction(attacker, suse, spell, X, Y);

                                            
attacker.Owner.SendScreen(suse, true);
                                            
attacker.AttackPacket = null;

                                        }
                                        break;
                                    }
                                
#endregion
                                #region SuperTwofoldBlade
                                
case 12080:
                                    {
                                        if (
Time32.Now >= attacker.SpellStamp.AddMilliseconds(870))
                                        {
                                            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 (
Kernel.GetDistance(attacker.X, attacker.Y, Xx, Yx) <= 5)
                                                {
                                                    if (
attackedsob == null)
                                                        if (
attacked.ContainsFlag(Update.Flags.Fly))
                                                            return;
                                                    if (
attacker.ContainsFlag(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, ref attack);
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.King)
                                                            {
                                                                
damage = (uint)(damage * 0.899);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Prince)
                                                            {
                                                                
damage = (uint)(damage * 0.929);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Duke)
                                                            {
                                                                
damage = (uint)(damage * 0.999);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Earl)
                                                            {
                                                                
damage = (uint)(damage * 1.100);
                                                            }

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

                                                            
suse.AddTarget(attacked, damage, attack);
                                                            
send = true;

                                                            if (
attacker.Owner.Spells.ContainsKey(0) && !attacked.Dead)
                                                            {
                                                                var 
s = attacker.Owner.Spells[0];
                                                                var 
spellz = Database.SpellTable.SpellInformations[s.ID][s.Level];
                                                                if (
spellz != null)
                                                                {
                                                                    if (
Kernel.Rate(spellz.Percent))
                                                                    {
                                                                        
SpellUse ssuse = new SpellUse(true);
                                                                        
ssuse.Attacker = attacker.UID;
                                                                        
ssuse.SpellID = spellz.ID;

                                                                        
ssuse.SpellLevel = spellz.Level;
                                                                        
damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
                                                                        
ssuse.AddTarget(attacked, new SpellUse.DamageClass().Damage = damage, attack);
                                                                        
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
                                                                        
attacker.Owner.SendScreen(ssuse, 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 * 180 / 100);
                                                            
ReceiveAttack(attacker, attackedsob, attack, damage, spell);
                                                            
suse.Effect1 = attack.Effect1;

                                                            
suse.AddTarget(attackedsob, damage, attack);
                                                            
send = true;
                                                        }
                                                    }
                                                    if (
send)
                                                        
attacker.Owner.SendScreen(suse, true);
                                                    
attacker.SpellStamp = Time32.Now;
                                                }
                                                else
                                                {
                                                    
attacker.AttackPacket = null;
                                                }
                                            }
                                        }
                                        break;
                                    }


                                
#endregion
                                #region ShadowClone
                                
case 12090:
                                    {
                                        if (
attacker.Owner.Map.ID == 6565 || attacker.Owner.Map.ID == 5555 || attacker.Owner.Map.ID == 2014)
                                        {
                                            
Kernel.SendWorldMessage(new Message("Mr: " + attacker.Name + " You Can`t Use ThisSpell Here !!!", System.Drawing.Color.Red, Message.Talk), Program.Values);
                                            return;
                                        }
                                        if (
attacker.Owner.Map.ID == 6565 || attacker.Owner.Map.ID == 5555 || attacker.Owner.Map.ID == 2014)
                                        {
                                            
Kernel.SendWorldMessage(new Message("Mr: " + attacker.Name + " You Can`t Use ThisSpell Here !!!", System.Drawing.Color.Red, Message.Talk), Program.Values);
                                            return;
                                        }
                                        
attacker.AttackPacket = null;
                                        if (
attacker.MyClones.Count > 0)
                                        {
                                            var 
clones = attacker.MyClones.Values.ToArray();
                                            for (
int i = 0; i < clones.Length; i++)
                                            {
                                                var 
item = clones[i];
                                                if (
item == null)
                                                    continue;
                                                
Data data = new Data(true);
                                                
data.UID = item.UID;
                                                
data.ID = Network.GamePackets.Data.RemoveEntity;
                                                
attacker.Owner.SendScreen(data);
                                                
//  attacker.MyClones[item.UID] = null;
                                            
}
                                            
attacker.MyClones.Clear();
                                        }
                                        else
                                        {
                                            if (
CanUseSpell(spell, attacker.Owner))
                                            {
                                                
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;
                                                
attacker.AddClone(3);
                                                if (
spell.Level >= 0)
                                                    
attacker.AddClone(0);
                                                foreach (var 
item in attacker.MyClones.Values)
                                                    
spellUse.AddTarget(item, 0, attack);

                                                
attacker.Owner.SendScreen(spellUse, true);
                                            }

                                        }
                                        break;
                                    }
                                
#endregion
                                #region FatalSpin
                                
case 12110:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
PrepareSpell(spell, attacker.Owner);
                                            
Game.Attacking.InLineAlgorithm ila = new ahmedfathy.Game.Attacking.InLineAlgorithm(attacker.X,
                                        
X, attacker.Y, Y, (byte)spell.Distance, 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;
                                            
//suse.SpellLevelHu = client_Spell.LevelHu2;
                                            
foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
                                                {
                                                    
attacked = _obj as Entity;
                                                    if (
ila.InLine(attacked.X, attacked.Y))
                                                    {
                                                        if (!
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                            continue;

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

                                                        
attack.Damage = damage;

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

                                                        
suse.AddTarget(attacked, damage, attack);
                                                    }
                                                }
                                                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;
                                                        var 
damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                        
damage = (uint)(damage * 1.100);
                                                        
attack.Damage = damage;

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

                                                        
suse.AddTarget(attackedsob, damage, attack);
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region LeeLong

                                #region DragonFlow
                                
case 12270:
                                    {

                                        
SpellUse spellUse = new SpellUse(true);
                                        
spellUse.Attacker = attacker.UID;
                                        
spellUse.Attacker1 = attacker.UID;
                                        
spellUse.SpellID = spell.ID;
                                        
spellUse.SpellLevel = spell.Level;
                                        
spellUse.X = X;
                                        
spellUse.Y = Y;
                                        
spellUse.AddTarget(attacker, 1, attack);
                                        
attacker.Owner.SendScreen(spellUse, true);
                                        if (
attacker.ContainsFlag3((uint)Update.Flags3.DragonFlow))
                                            
attacker.RemoveFlag3((uint)Update.Flags3.DragonFlow);
                                        else
                                            
attacker.AddFlag3((uint)Update.Flags3.DragonFlow);
                                        
attacker.DragonFlowStamp = attacker.DragonFlowStamp2 = Time32.Now;
                                        break;
                                    }
                                
#endregion
                                #region DragonRoar
                                
case 12280:
                                    {
                                        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;
                                            
PrepareSpell(spell, attacker.Owner);
                                            if (
attacker.Owner.Team != null)
                                            {
                                                foreach (
Client.GameState teammate in attacker.Owner.Team.Teammates)
                                                {
                                                    if (
teammate.Player.UID != attacker.UID)
                                                    {
                                                        if (
Kernel.GetDistance(attacker.X, attacker.Y, teammate.Player.X, teammate.Player.Y) <= spell.Range)
                                                        {
                                                            
teammate.Player.Stamina += (byte)spell.Power;
                                                            
suse.AddTarget(teammate.Player, spell.Power, null);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region DragonCyclone
                                
case 12290:
                                    {
                                        
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.XPList))
                                        {
                                            
attacker.RemoveFlag(Update.Flags.XPList);
                                            
attacker.AddFlag3(Update.Flags3.DragonCyclone);
                                            
attacker.DragonCycloneStamp = Time32.Now;
                                            
attacker.Owner.SendScreen(suse, true);

                                        }
                                        else
                                        {
                                            
ushort _X = attacker.X, _Y = attacker.Y;
                                            
ushort _tX = X, _tY = Y;
                                            
byte dist = (byte)spell.Distance;
                                            var Array = 
attacker.Owner.Screen.Objects;
                                            
InLineAlgorithm algo = new InLineAlgorithm(attacker.X, X, attacker.Y, Y, dist,
                                                                               
InLineAlgorithm.Algorithm.DDA);
                                            
X = attacker.X;
                                            
Y = attacker.Y;
                                            
int i = 0;
                                            for (
i = 0; i < algo.lcoords.Count; i++)
                                            {
                                                if (
attacker.Owner.Map.Floor[algo.lcoords[i].X, algo.lcoords[i].Y, MapObjectType.Entity]
                                                    && !
attacker.ThroughGate(algo.lcoords[i].X, algo.lcoords[i].Y))
                                                {
                                                    
X = (ushort)algo.lcoords[i].X;
                                                    
Y = (ushort)algo.lcoords[i].Y;
                                                }
                                                else
                                                {
                                                    break;
                                                }
                                            }
                                            
suse.X = X;
                                            
suse.Y = Y;
                                            if (!
attacker.Owner.Map.Floor[X, Y, MapObjectType.Entity, null])
                                                return;
                                            
double disth = 1.5;
                                            
//   if (attacker.MapID == DeathMatch.MAPID) disth = 1;
                                            
foreach (Interfaces.IMapObject _obj in Array)
                                            {
                                                
bool hit = false;
                                                for (
int j = 0; j < i; j++)
                                                    if (
Kernel.GetDDistance(_obj.X, _obj.Y, (ushort)algo.lcoords[j].X, (ushort)algo.lcoords[j].Y) <= disth)
                                                        
hit = true;
                                                if (
hit)
                                                {
                                                    if (
_obj.MapObjType == MapObjectType.Monster)
                                                    {
                                                        
attacked = _obj as Entity;
                                                        if (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                        {
                                                            var 
damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
                                                            
ReceiveAttack(attacker, attacked, attack, ref damage, spell);

                                                            
suse.AddTarget(attacked, damage, attack);
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.Entity)
                                                    {
                                                        
attacked = _obj as Entity;
                                                        if (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                        {
                                                            
attack.Effect1 = Attack.AttackEffects1.None;
                                                            
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);

                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.King)
                                                            {
                                                                
damage = (uint)(damage * 0.758);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Prince)
                                                            {
                                                                
damage = (uint)(damage * 0.858);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Duke)
                                                            {
                                                                
damage = (uint)(damage * 0.985);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Earl)
                                                            {
                                                                
damage = (uint)(damage * 1.120);
                                                            }
                                                            
ReceiveAttack(attacker, attacked, attack, ref damage, spell);

                                                            
suse.AddTarget(attacked, damage, attack);
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob = _obj as SobNpcSpawn;
                                                        if (
CanAttack(attacker, attackedsob, spell))
                                                        {
                                                            var 
damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);

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

                                                            
suse.AddTarget(attackedsob, damage, attack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.PX = attacker.X;
                                            
attacker.PY = attacker.Y;
                                            
attacker.X = X;
                                            
attacker.Y = Y;
                                            
attacker.Owner.SendScreen(suse, true);
                                            
attacker.Owner.Screen.Reload(suse);

                                        }
                                        break;
                                    }
                                
#endregion
                                #region DragonSlash
                                
case 12350:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
PrepareSpell(spell, attacker.Owner);
                                            
Game.Attacking.InLineAlgorithm ila = new ahmedfathy.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.Attacker1 = attacker.UID;
                                            
suse.SpellID = SpellID;
                                            
suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
                                            
suse.X = X;
                                            
suse.Y = Y;
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
_obj.MapObjType == MapObjectType.Entity)
                                                {
                                                    
attacked = _obj as Entity;
                                                    if (
ila.InLine(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, ref attack);

                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.King)
                                                            {
                                                                
damage = (uint)(damage * 0.758);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Prince)
                                                            {
                                                                
damage = (uint)(damage * 0.858);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Duke)
                                                            {
                                                                
damage = (uint)(damage * 0.920);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Earl)
                                                            {
                                                                
damage = (uint)(damage * 1.020);
                                                            }
                                                            
suse.Effect1 = attack.Effect1;

                                                            
attack.Damage = damage;

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

                                                            
suse.AddTarget(attacked, damage, attack);
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.Monster)
                                                    {
                                                        
attacked = _obj as Entity;
                                                        if (
ila.InLine(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);
                                                                
damage = (uint)(damage * 1.0);
                                                                
suse.Effect1 = attack.Effect1;

                                                                
attack.Damage = damage;

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

                                                                
suse.AddTarget(attacked, damage, attack);
                                                            }
                                                        }
                                                    }
                                                    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);
                                                            
attack.Damage = damage;

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

                                                            
suse.AddTarget(attackedsob, damage, attack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region AirKick
                                
case 12320:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
PrepareSpell(spell, attacker.Owner);
                                            
SpellUse suse = new SpellUse(true);
                                            
suse.Attacker = attacker.UID;
                                            
suse.SpellID = spell.ID;
                                            
//suse.SpellLevelHu = client_Spell.LevelHu2;
                                            
suse.SpellLevel = spell.Level;
                                            
ushort _X = attacker.X, _Y = attacker.Y;
                                            
ushort _tX = X, _tY = Y;
                                            
byte dist = (byte)spell.Distance;
                                            var Array = 
attacker.Owner.Screen.Objects;
                                            
InLineAlgorithm algo = new InLineAlgorithm(attacker.X, X, attacker.Y, Y, dist,
                                                                               
InLineAlgorithm.Algorithm.DDA);
                                            
X = attacker.X;
                                            
Y = attacker.Y;
                                            
int i = 0;
                                            for (
i = 0; i < algo.lcoords.Count; i++)
                                            {
                                                if (
attacker.Owner.Map.Floor[algo.lcoords[i].X, algo.lcoords[i].Y, MapObjectType.Entity]
                                                    && !
attacker.ThroughGate(algo.lcoords[i].X, algo.lcoords[i].Y))
                                                {
                                                    
X = (ushort)algo.lcoords[i].X;
                                                    
Y = (ushort)algo.lcoords[i].Y;
                                                }
                                                else
                                                {
                                                    break;
                                                }
                                            }
                                            
suse.X = X;
                                            
suse.Y = Y;
                                            if (!
attacker.Owner.Map.Floor[X, Y, MapObjectType.Entity, null])
                                                return;
                                            
double disth = 0.5;

                                            foreach (
Interfaces.IMapObject _obj in Array)
                                            {
                                                
bool hit = false;
                                                for (
int j = 0; j < i; j++)
                                                    if (
Kernel.GetDDistance(_obj.X, _obj.Y, (ushort)algo.lcoords[j].X, (ushort)algo.lcoords[j].Y) <= disth)
                                                        
hit = true;
                                                if (
hit)
                                                {
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
                                                    {
                                                        
attacked = _obj as Entity;
                                                        if (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                        {
                                                            
attack.Effect1 = Attack.AttackEffects1.None;
                                                            
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);

                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.King)
                                                            {
                                                                
damage = (uint)(damage * 0.758);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Prince)
                                                            {
                                                                
damage = (uint)(damage * 0.858);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Duke)
                                                            {
                                                                
damage = (uint)(damage * 0.985);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Earl)
                                                            {
                                                                
damage = (uint)(damage * 1.120);
                                                            }
                                                            
ReceiveAttack(attacker, attacked, attack, ref damage, spell);

                                                            
suse.AddTarget(attacked, damage, attack);
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob = _obj as SobNpcSpawn;
                                                        if (
CanAttack(attacker, attackedsob, spell))
                                                        {
                                                            var 
damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);

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

                                                            
suse.AddTarget(attackedsob, damage, attack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.PX = attacker.X;
                                            
attacker.PY = attacker.Y;
                                            
attacker.X = X;
                                            
attacker.Y = Y;
                                            
attacker.Owner.SendScreen(suse, true);
                                            
attacker.Owner.Screen.Reload(suse);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region AirSweep and AirRaid
                                
case 12330:
                                case 
12210:
                                case 
12340:
                                    {
                                        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 (
Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)
                                            {
                                                foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (
_obj == null)
                                                        continue;
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
                                                    {
                                                        
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, ref attack);

                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.King)
                                                                {
                                                                    
damage = (uint)(damage * 0.758);
                                                                }
                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Prince)
                                                                {
                                                                    
damage = (uint)(damage * 0.858);
                                                                }
                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Duke)
                                                                {
                                                                    
damage = (uint)(damage * 0.985);
                                                                }
                                                                if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Earl)
                                                                {
                                                                    
damage = (uint)(damage * 1.120);
                                                                }
                                                                
suse.Effect1 = attack.Effect1;

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

                                                                
suse.AddTarget(attacked, damage, attack);
                                                            }
                                                        }
                                                    }
                                                    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);
                                                                
ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                                
suse.AddTarget(attackedsob, damage, attack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket = null;
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Speed Kick
                                
case 12120:
                                case 
12130:
                                case 
12140:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
PrepareSpell(spell, attacker.Owner);
                                            
SpellUse suse = new SpellUse(true);
                                            
suse.Attacker = attacker.UID;
                                            
suse.SpellID = spell.ID;
                                            
//suse.SpellLevelHu = client_Spell.LevelHu2;
                                            
suse.SpellLevel = spell.Level;
                                            
ushort _X = attacker.X, _Y = attacker.Y;
                                            
ushort _tX = X, _tY = Y;
                                            
byte dist = (byte)spell.Distance;
                                            var Array = 
attacker.Owner.Screen.Objects;
                                            
InLineAlgorithm algo = new InLineAlgorithm(attacker.X, X, attacker.Y, Y, dist,
                                                                               
InLineAlgorithm.Algorithm.DDA);
                                            
X = attacker.X;
                                            
Y = attacker.Y;
                                            
int i = 0;
                                            for (
i = 0; i < algo.lcoords.Count; i++)
                                            {
                                                if (
attacker.Owner.Map.Floor[algo.lcoords[i].X, algo.lcoords[i].Y, MapObjectType.Entity]
                                                    && !
attacker.ThroughGate(algo.lcoords[i].X, algo.lcoords[i].Y))
                                                {
                                                    
X = (ushort)algo.lcoords[i].X;
                                                    
Y = (ushort)algo.lcoords[i].Y;
                                                }
                                                else
                                                {
                                                    break;
                                                }
                                            }
                                            
suse.X = X;
                                            
suse.Y = Y;
                                            if (!
attacker.Owner.Map.Floor[X, Y, MapObjectType.Entity, null])
                                                return;
                                            
double disth = 1.5;
                                            foreach (
Interfaces.IMapObject _obj in Array)
                                            {
                                                
bool hit = false;
                                                for (
int j = 0; j < i; j++)
                                                    if (
Kernel.GetDDistance(_obj.X, _obj.Y, (ushort)algo.lcoords[j].X, (ushort)algo.lcoords[j].Y) <= disth)
                                                        
hit = true;
                                                if (
hit)
                                                {
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
                                                    {
                                                        
attacked = _obj as Entity;
                                                        if (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                        {
                                                            
attack.Effect1 = Attack.AttackEffects1.None;
                                                            
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);

                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.King)
                                                            {
                                                                
damage = (uint)(damage * 0.358);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Prince)
                                                            {
                                                                
damage = (uint)(damage * 0.458);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Duke)
                                                            {
                                                                
damage = (uint)(damage * 0.585);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Earl)
                                                            {
                                                                
damage = (uint)(damage * 0.620);
                                                            }
                                                            
ReceiveAttack(attacker, attacked, attack, ref damage, spell);

                                                            
suse.AddTarget(attacked, damage, attack);
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob = _obj as SobNpcSpawn;
                                                        if (
CanAttack(attacker, attackedsob, spell))
                                                        {
                                                            var 
damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);

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

                                                            
suse.AddTarget(attackedsob, damage, attack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.PX = attacker.X;
                                            
attacker.PY = attacker.Y;
                                            
attacker.X = X;
                                            
attacker.Y = Y;
                                            
attacker.Owner.SendScreen(suse, true);
                                            
attacker.Owner.Screen.Reload(suse);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Cracking swipe
                                
case 12170:
                                case 
12160:
                                    {
                                        if (
Time32.Now >= attacker.SpellStamp.AddMilliseconds(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;
                                                
Fan sector = new Fan(attacker.X, attacker.Y, X, Y, spell.Range, spell.Sector);
                                                if (
Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= 15)
                                                {
                                                    foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                    {
                                                        if (
_obj == null)
                                                            continue;
                                                        if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
                                                        {
                                                            
attacked = _obj as Entity;

                                                            if (
sector.IsInFan(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, ref attack);

                                                                    if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.King)
                                                                    {
                                                                        
damage = (uint)(damage * 0.780);
                                                                    }
                                                                    if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Prince)
                                                                    {
                                                                        
damage = (uint)(damage * 0.810);
                                                                    }
                                                                    if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Duke)
                                                                    {
                                                                        
damage = (uint)(damage * 0.958);
                                                                    }
                                                                    if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Earl)
                                                                    {
                                                                        
damage = (uint)(damage * 1.050);
                                                                    }


                                                                    
suse.Effect1 = attack.Effect1;
                                                                    
suse.Effect1 = attack.Effect1;
                                                                    
ReceiveAttack(attacker, attacked, attack, ref damage, spell);
                                                                    
suse.AddTarget(attacked, damage, attack);
                                                                }
                                                            }
                                                        }
                                                        else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                        {
                                                            
attackedsob = _obj as SobNpcSpawn;

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

                                                                    
suse.AddTarget(attackedsob, damage, attack);
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    
attacker.AttackPacket = null;
                                                }
                                                
attacker.Owner.SendScreen(suse, true);
                                                
attacker.SpellStamp = Time32.Now;
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Dragon Punch
                                
case 12240:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
PrepareSpell(spell, attacker.Owner);
                                            
Game.Attacking.InLineAlgorithm ila = new ahmedfathy.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;
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Entity)
                                                {
                                                    
attacked = _obj as Entity;
                                                    if (
ila.InLine(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, ref attack);

                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.King)
                                                            {
                                                                
damage = (uint)(damage * 1.100);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Prince)
                                                            {
                                                                
damage = (uint)(damage * 1.200);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Duke)
                                                            {
                                                                
damage = (uint)(damage * 1.300);
                                                            }
                                                            if (
attacker.NobilityRank == ahmedfathy.Game.ConquerStructures.NobilityRank.Earl)
                                                            {
                                                                
damage = (uint)(damage * 1.200);
                                                            }
                                                            
suse.Effect1 = attack.Effect1;

                                                            
attack.Damage = damage;

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

                                                            
suse.AddTarget(attacked, damage, attack);
                                                        }
                                                    }
                                                    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);
                                                            
attack.Damage = damage;

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

                                                            
suse.AddTarget(attackedsob, damage, attack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }

                                
#endregion
                                #region DragonFury
                                
case 12220:
                                    {
                                        if (
attacked != null)
                                        {
                                            if (
Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Distance)
                                            {
                                                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 (
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
                                                    {
                                                        
PrepareSpell(spell, attacker.Owner);
                                                        
attack.Effect1 = Attack.AttackEffects1.None;

                                                        var 
damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
                                                        
damage = (uint)(damage * 1.100);
                                                        
suse.Effect1 = attack.Effect1;

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

                                                        
suse.AddTarget(attacked, damage, attack);
                                                        
attacker.Owner.Player.IsEagleEyeShooted = true;

                                                        if (
attacked.EntityFlag == EntityFlag.Entity)
                                                            
attacked.Owner.SendScreen(suse, true);
                                                        else
                                                            
attacked.MonsterInfo.SendScreen(suse);
                                                        if (
attacked.EntityFlag == EntityFlag.Entity)
                                                        {
                                                            
int potDifference = attacker.BattlePower - attacked.BattlePower;

                                                            
int rate = spell.Percent + potDifference - 20;
                                                            if (
Kernel.Rate(rate))
                                                            {

                                                                
attacked.AddFlag3(Update.Flags3.DragonFury);
                                                                
attacked.DragonFuryStamp = Time32.Now;
                                                                
attacked.DragonFuryTime = spell.Duration;

                                                                
Network.GamePackets.Update upgrade = new Network.GamePackets.Update(true);
                                                                
upgrade.UID = attacked.UID;
                                                                
upgrade.Append(74
                                                                    
, (uint)spell.Status
                                                                    
, (uint)spell.Duration, spell.Power, spell.Level);
                                                                
attacker.Owner.Send(upgrade.ToArray());

                                                                if (
attacked.EntityFlag == EntityFlag.Entity)
                                                                    
attacked.Owner.Send(upgrade);
                                                                else
                                                                    
attacked.MonsterInfo.SendScreen(upgrade);
                                                            }
                                                        }

                                                    }
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region DragonSwing
                                
case 12200:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
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;
                                            
attacker.Owner.SendScreen(spellUse, true);
                                            if (
attacker.OnDragonSwing)
                                            {
                                                
attacker.OnDragonSwing = false;
                                                
attacker.RemoveFlag3(Update.Flags3.DragonSwing);
                                                
Update upgrade = new Update(true);
                                                
upgrade.UID = attacker.UID;
                                                
upgrade.Append(Update.DragonSwing, (uint)spell.Status, 0, 0, 0);
                                                
attacker.Owner.Send(upgrade.ToArray());
                                            }
                                            else
                                            {
                                                
attacker.OnDragonSwing = true;
                                                
attacker.DragonSwingPower = spell.Level;
                                                
attacker.AddFlag3(Update.Flags3.DragonSwing);
                                                
Update upgrade = new Update(true);
                                                
upgrade.UID = attacker.UID;
                                                
upgrade.Append(Update.DragonSwing, (uint)spell.Duration, (uint)spell.Status, spell.Power, spell.Level);
                                                
attacker.Owner.Send(upgrade.ToArray());
                                                
attacker.DragonSwingStamp = Time32.Now;
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion

                                
default:
                                    { 

لو انتا سورسك Player هيجيلك ايرور في

ahmedfathy

هتغـير كـل اسـم اسمــو AhmedFathy

بـي اسـم بــرووجيـكـك

ولــو سـوورسـك

Entity

هيـجـيـلك ايـرور ف Player

ويـ Ahmed Fathy

هتبـدل Player بيEntity

وهتغــير اسـم Ahmed Fathy

بي اسـم البـرووجيـكت بتــاعــك ..

والـي مشـعــارف يعـمـل الاتـكـاات هسـيب الفيسـ ف الكومنتـاات

#بــااي ♥



التعديل الأخير تم بواسطة LyokaWarior ; 2019-08-18 الساعة 07:58 PM سبب آخر: تنـسـيق المـوضوع !
قديم 2019-08-18, 07:45 PM
المشاركة 2
Hazem
.:: المدير العام::.
  • غير متواجد
Cry رد: ملف اتاكات 2هت للسلفرات السهلا
جمــيــل!!

قديم 2019-08-18, 08:03 PM
المشاركة 3
LyokaWarior
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: مـلـف اتــااكـأات 2 هــت للـسـرفـرت السهـلةة ..
الفــيســ بـعـد تنســيق المــوضوع !

اكـك صــااحـب المـوضوع !!

عفواً لايمكن عرض الرابط إلا بعد الرد على الموضوع

#ســلامـووز

قديم 2019-08-18, 08:05 PM
المشاركة 4
Hassan Emprator
.:: مشرف قسم المشاكل ::.
  • غير متواجد
افتراضي رد: مـلـف اتــااكـأات 2 هــت للـسـرفـرت السهـلةة ..
حلو عاش

قديم 2019-08-18, 08:14 PM
المشاركة 5
ElSaher
.:: مشرف اقسام كونكر ::.
  • غير متواجد
Like رد: مـلـف اتــااكـأات 2 هــت للـسـرفـرت السهـلةة ..
عفواً لايمكن عرض الرابط إلا بعد الرد على الموضوع
حلو عاش
حبيبي يا حسن

قديم 2019-08-18, 08:15 PM
المشاركة 6
ElSaher
.:: مشرف اقسام كونكر ::.
  • غير متواجد
Like رد: ملف اتاكات 2هت للسلفرات السهلا
عفواً لايمكن عرض الرابط إلا بعد الرد على الموضوع
جـمــيــل !!
تســلم يحــااززم

قديم 2019-08-18, 09:29 PM
المشاركة 7
ElSaher
.:: مشرف اقسام كونكر ::.
  • غير متواجد
Like رد: مـلـف اتــااكـأات 2 هــت للـسـرفـرت السهـلةة ..
عفواً لايمكن عرض الرابط إلا بعد الرد على الموضوع
الفــيســ بـعـد تنســيق المــوضوع !

اكـك صــااحـب المـوضوع !!

عفواً لايمكن عرض الرابط إلا بعد الرد على الموضوع

#ســلامـووز
تسلم يا صحبيMuuHaaMmeedd

قديم 2019-08-19, 01:14 AM
المشاركة 8
MRonlineGvrix
.:: عضو مميز ::.
  • غير متواجد
افتراضي رد: مـلـف اتــااكـأات 2 هــت للـسـرفـرت السهـلةة ..
جميل جدا استمر يباشا

قديم 2019-08-19, 01:41 AM
المشاركة 9
LyokaWarior
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: مـلـف اتــااكـأات 2 هــت للـسـرفـرت السهـلةة ..
عفواً لايمكن عرض الرابط إلا بعد الرد على الموضوع
تسلم يا صحبيmuuhaammeedd
الـعـفــووا يغــالي ع ايــ ايــ حــاجة تقبـلك سيبهـا ف قســم المشــأأكــل

#بــالتـووفيــق

قديم 2019-08-22, 08:52 PM
المشاركة 10
ElSaher
.:: مشرف اقسام كونكر ::.
  • غير متواجد
افتراضي رد: مـلـف اتــااكـأات 2 هــت للـسـرفـرت السهـلةة ..
عفواً لايمكن عرض الرابط إلا بعد الرد على الموضوع
الـعـفــووا يغــالي ع ايــ ايــ حــاجة تقبـلك سيبهـا ف قســم المشــأأكــل

#بــالتـووفيــق
اوك يا صحبي


العلامات المرجعية



الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1)
 

الانتقال السريع



الساعة الآن 03:08 PM