قديم 2019-08-20, 12:55 AM
المشاركة 13
LyokaWarior
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: مشكلة بخصوص اسكلة الويند ولكر thundercloud
بالتوفيق ان شاء الله في انتظار ردك
ريدار افتحح فيس كلمني اسمي محمد !!

قديم 2019-08-20, 12:56 AM
المشاركة 14
Tefa
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: مشكلة بخصوص اسكلة الويند ولكر thundercloud
في انتظار ردك باذن الله

قديم 2019-08-20, 01:12 AM
المشاركة 15
ابو مروان
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: مشكلة بخصوص اسكلة الويند ولكر thundercloud
تمت الاضافة فى
#region Monster -> Player \ Monster
تحت
#region ThrillingSpook
وبرده متصلحتش انا بقول انت تنزل السورس وتتعامل عليه لان فيها مشكله كمان اللسكله شكلها بيظهر عندى وعند الناس مختفيه انا بقول تشوفها على الطبيعه افضل بس مشكلة ظاهرة عندى وعند الناس لا دى فى سورسى انا بس مش فى السورسات التانيه :]

قديم 2019-08-20, 07:57 AM
المشاركة 16
Tefa
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: مشكلة بخصوص اسكلة الويند ولكر thundercloud
تمت الاضافة فى
#region Monster -> Player \ Monster
تحت
#region ThrillingSpook
وبرده متصلحتش انا بقول انت تنزل السورس وتتعامل عليه لان فيها مشكله كمان اللسكله شكلها بيظهر عندى وعند الناس مختفيه انا بقول تشوفها على الطبيعه افضل بس مشكلة ظاهرة عندى وعند الناس لا دى فى سورسى انا بس مش فى السورسات التانيه :]
بدل كلاس هندل ده بالي عندك

كود:
// ? Created by bode
// ? Copyright © 2010 - 2016 TQ Digital
// ? Emulator - Project

using System;
using System.Linq;
using System.Text;
using System.Drawing;
using Mr.HaMoOo.Network;
using Mr.HaMoOo.Database;
using Mr.HaMoOo.Interfaces;
using System.Collections.Generic;
using Mr.HaMoOo.Network.GamePackets;
using Mr.HaMoOo.Game.ConquerStructures;
using DavidEid.Game.Features.Event;
using DavidEid.Game;

namespace 
Mr.HaMoOo.Game.Attacking
{
    public 
unsafe class Handle
    
{
        public static 
void StomperMelee(MsgMapItem itemushort SpellID)
        {
            var 
attack item.Attack;
            var 
spell Database.SpellTable.GetSpell(SpellIDitem.Owner);
            
MsgMagicEffect suse = new MsgMagicEffect(true);
            
suse.Attacker SpellID == 12990 item.UID item.Owner.Player.UID;
            
suse.SpellID SpellID;
            
suse.SpellLevel spell.Level;
            
suse.SpecialEffect 1;
            if (
SpellID == 12990)
            {
                
suse.item.X2;
                
suse.item.Y2;
                foreach (
Interfaces.IMapObject _obj in item.Owner.Screen.Objects)
                {
                    if (
_obj.MapObjType == MapObjectType.Monster)
                    {
                        if (
_obj == null) continue;
                        var 
attacked1 _obj as Player;
                        if (
CanAttack(item.Owner.Playerattacked1spellfalse))
                        {
                            {
                                var 
spellange Enums.HorrorofStomperAngle(item.Angle);
                                
ushort xxxx item.X;
                                
ushort yyyy item.Y;
                                
Map.Pushback(ref xxxxref  yyyyspellange7);
                                
Fan sector = new Fan(item.Xitem.Yxxxxyyyyspell.Rangespell.Sector);
                                if (
sector.IsInFan(attacked1.Xattacked1.Y))
                                {
                                    
uint damage Game.Attacking.Calculate.Melee(item.Owner.Playerattacked1ref attackspell) * (spell.Power 30000) / 100;
                                    
ReceiveAttack(item.Owner.Playerattacked1attackref damagespell);
                                    
suse.AddTarget(attacked1.UIDdamagenull);
                                    continue;
                                }
                            }
                            {
                                var 
spellange Enums.OppositeAngle(Enums.HorrorofStomperAngle(item.Angle));
                                
ushort xxxx item.X;
                                
ushort yyyy item.Y;
                                
Map.Pushback(ref xxxxref  yyyyspellange7);
                                
Fan sector = new Fan(item.Xitem.Yxxxxyyyyspell.Rangespell.Sector);
                                if (
sector.IsInFan(attacked1.Xattacked1.Y))
                                {
                                    
uint damage Game.Attacking.Calculate.Melee(item.Owner.Playerattacked1ref attackspell) * (spell.Power 30000) / 100;
                                    
ReceiveAttack(item.Owner.Playerattacked1attackref damagespell);
                                    
suse.AddTarget(attacked1.UIDdamagenull);
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                
suse.item.X;
                
suse.item.Y;
                foreach (
Interfaces.IMapObject _obj in item.Owner.Screen.Objects)
                {
                    if (
_obj.MapObjType == MapObjectType.Monster)
                    {
                        if (
_obj == null) continue;
                        var 
attacked1 _obj as Player;
                        if (
Kernel.GetDistance(item.Xitem.Yattacked1.Xattacked1.Y) <= spell.Range)
                        {
                            if (
CanAttack(item.Owner.Playerattacked1spellfalse))
                            {
                                
uint damage Game.Attacking.Calculate.Melee(item.Owner.Playerattacked1ref attackspell) * (spell.Power 30000) / 100;
                                
ReceiveAttack(item.Owner.Playerattacked1attackref damagespell);
                                
suse.AddTarget(attacked1.UIDdamagenull);
                            }
                        }
                    }
                }
            }
            
item.Owner.SendScreen(susetrue);
            
item.Owner.Player.AttackPacket null;
        }
        public static 
void ShadowofChaser(Player attackerPlayer attackedMsgInteract attackbyte oneortwo)
        {
            
#region ShadowofChaser(Active)
            
IMapObject lastAttacked attacked;
            if (
oneortwo == 1)
            {
                if (
attacker.ContainsFlag4((ulong)MsgUpdate.Flags4.ShadowofChaser) && attacker.IsChaser2())
                {
                    
#region MsgMapItem
                    
var map Kernel.Maps[attacker.MapID];
                    
Network.GamePackets.MsgMapItem flooritem = new Network.GamePackets.MsgMapItem(true);
                    
flooritem.UID Network.GamePackets.MsgMapItem.FloorUID.Next;
                    while (
map.Npcs.ContainsKey(flooritem.UID))
                        
flooritem.UID Network.GamePackets.MsgMapItem.FloorUID.Next;

                    
flooritem.ItemID MsgMapItem.ShadowofChaser;
                    
flooritem.lastAttacked.X;
                    
flooritem.MapID attacker.MapID;
                    
flooritem.lastAttacked.Y;
                    
flooritem.Type MsgMapItem.Effect;
                    
flooritem.mColor 14;
                    
flooritem.FlowerType 3;
                    
flooritem.Unknown37 1;
                    
flooritem.Attack attack;
                    
flooritem.OwnerUID attacker.UID;
                    
flooritem.Owner attacker.Owner;
                    
flooritem.OwnerGuildUID attacker.GuildID;
                    
flooritem.OnFloor Time32.Now;
                    
flooritem.Name2 "ShadowofChaser";
                    
flooritem.ShadowofChaserAttacked attacked;
                    
flooritem.ShadowofChaserAttacker attacker;
                    
attacker.Owner.Map.AddFloorItem(flooritem);
                    
attacker.Owner.SendScreenSpawn(flooritemtrue);
                    
#endregion
                    
return;
                }
            }
            else if (
oneortwo == 2)
            {
                var 
spell Database.SpellTable.GetSpell(13090attacker.Owner);
                
MsgMagicEffect suse = new MsgMagicEffect(true);
                
suse.Attacker attacker.UID;
                
suse.Attacker1 attacker.UID;
                
suse.SpellID spell.ID;
                
suse.SpellLevel spell.Level;
                if (
CanAttack(attackerattackedspellfalse))
                {
                    
lastAttacked attacked;
                    
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attackspell) * (spell.Power 30000) / 100;
                    
Handle.ReceiveAttack(attackerattackedattackref damagespell);
                    
suse.AddTarget(attacked.UIDdamagenull);
                }
                
attacker.Owner.SendScreen(susetrue);
                
MsgMagicEffect suse2 = new MsgMagicEffect(true);
                
suse2.Attacker attacker.UID;
                
suse2.SpellID spell.ID;
                
suse2.SpellLevel spell.Level;
                
suse2.attacked.X;
                
suse2.attacked.Y;
                foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                {
                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                    {
                        if (
_obj == null) continue;
                        var 
attacked1 _obj as Player;
                        if (
lastAttacked.UID == attacked1.UID) continue;
                        if (
Kernel.GetDistance(lastAttacked.XlastAttacked.Yattacked1.Xattacked1.Y) <= 4)
                        {
                            if (
CanAttack(attackerattacked1spellfalse))
                            {
                                
uint damage Game.Attacking.Calculate.Melee(attackerattacked1ref attackspell) * (spell.Power 30000) / 100;
                                
attack.Damage damage;
                                
ReceiveAttack(attackerattacked1attackref damagespell);
                                
suse2.AddTarget(attacked1.UIDdamagenull);
                            }
                        }
                    }
                }
                
attacker.Owner.SendScreen(suse2true);
            }
            
#endregion
            
attacker.AttackPacket null;
        }
        public static 
void cheakteam(Client.GameState clientNpcs dail)
        {
            if (
client.Team == null)
                
client.Player.Teleport(1002430378);
            
client.Player.AddTopStatus((ulong)MsgUpdate.Flags2.Top3Water2DateTime.Now.AddMinutes(30));
            
uint TeamCount 0;
            foreach (
Client.GameState clients in Kernel.GamePool.Values.ToArray())
            {
                if (
clients.Player.MapID == 16414)
                {
                    if (
clients.Team != null)
                    {
                        if (!
clients.Player.Dead)
                            
TeamCount++;
                    }
                }
            }

            if (
TeamCount <= 5)
            {
                
uint lastcheak 0;
                if (
client.Team != null)
                {
                    foreach (
Client.GameState team in client.Team.Teammates)
                    {
                        if (
team.Player.MapID == 16414 && !team.Player.Dead)
                            
lastcheak++;
                    }
                    if (
TeamCount == lastcheak)
                    {
                        
uint won = (uint)(rates.AllTops client.Team.Teammates.Count());
                        foreach (
Client.GameState team in client.Team.Teammates)
                        {
                            
team.Player.Teleport(1002302276);
                            
team.Player.ConquerPoints += won;
                        }
                        
Thread.LastTeamFight false;
                        
Kernel.SendWorldMessage(new MsgTalk("Congratulations! " client.Player.Name " Team Has Won Last Team Standing and all Team Member Got " won " cps"System.Drawing.Color.Red2011), Kernel.GamePool.Values.ToArray());
                    }
                    else
                    {
                        
dail.Text("There Are:| " + (TeamCount lastcheak) + " |: other player in other Team Kill Him");
                        
dail.Option("i Will Kill him "255);
                        
dail.Send();
                    }
                }
            }
            else
            {
                
dail.Text("There Are:| " TeamCount " |: other player in other Team Kill Him");
                
dail.Option("i Will Kill him "255);
                
dail.Send();
            }

        }
        private 
MsgInteract attack;
        private 
Player attackerattacked;
        
#region Interations
        
public class InteractionRequest
        
{
            public 
InteractionRequest(MsgInteract attackGame.Player a_client)
            {
                
Client.GameState client a_client.Owner;
                
client.Player.InteractionInProgress false;
                
client.Player.InteractionWith attack.Attacked;
                
client.Player.InteractionType 0;
                
client.InteractionEffect attack.ResponseDamage;
                if (
Kernel.GamePool.ContainsKey(attack.Attacked))
                {
                    
Client.GameState clienttarget Kernel.GamePool[attack.Attacked];
                    
clienttarget.Player.InteractionInProgress false;
                    
clienttarget.Player.InteractionWith client.Player.UID;
                    
clienttarget.Player.InteractionType 0;
                    
clienttarget.InteractionEffect attack.ResponseDamage;
                    
attack.Attacker client.Player.UID;
                    
attack.clienttarget.Player.X;
                    
attack.clienttarget.Player.Y;
                    
attack.InteractType 46;
                    
clienttarget.Send(attack);
                    
clienttarget.Send(attack);
                }
            }
        }
        public class 
InteractionEffect
        
{
            public 
InteractionEffect(MsgInteract attackGame.Player a_client)
            {
                
Client.GameState client a_client.Owner;
                if (
Kernel.GamePool.ContainsKey(client.Player.InteractionWith))
                {
                    
Client.GameState clienttarget Kernel.GamePool[client.Player.InteractionWith];
                    if (
clienttarget.Player.== client.Player.&& clienttarget.Player.== client.Player.Y)
                    {
                        
attack.Damage client.Player.InteractionType;
                        
attack.ResponseDamage client.InteractionEffect;
                        
clienttarget.Player.InteractionSet true;
                        
client.Player.InteractionSet true;
                        
attack.Attacker clienttarget.Player.UID;
                        
attack.Attacked client.Player.UID;
                        
attack.InteractType 47;
                        
attack.clienttarget.Player.X;
                        
attack.clienttarget.Player.Y;
                        
clienttarget.Send(attack);
                        
attack.InteractType 49;
                        
attack.Attacker client.Player.UID;
                        
attack.Attacked clienttarget.Player.UID;
                        
client.SendScreen(attacktrue);
                        
attack.Attacker clienttarget.Player.UID;
                        
attack.Attacked client.Player.UID;
                        
client.SendScreen(attacktrue);
                    }
                }
            }
        }
        public class 
InteractionAccept
        
{
            public 
InteractionAccept(MsgInteract attackGame.Player a_client)
            {

                
Client.GameState client a_client.Owner;
                if (
client.Player.ContainsFlag((ulong)MsgUpdate.Flags.Ride))
                    
client.Player.RemoveFlag((ulong)MsgUpdate.Flags.Ride);
                if (
client.Player.InteractionWith != attack.Attacked) return;
                
attack.ResponseDamage client.InteractionEffect;
                
client.Player.InteractionSet false;
                if (
Kernel.GamePool.ContainsKey(attack.Attacked))
                {
                    
Client.GameState clienttarget Kernel.GamePool[attack.Attacked];
                    if (
clienttarget.Player.ContainsFlag((ulong)MsgUpdate.Flags.Ride))
                        
clienttarget.Player.RemoveFlag((ulong)MsgUpdate.Flags.Ride);
                    
clienttarget.Player.InteractionSet false;
                    if (
clienttarget.Player.InteractionWith != client.Player.UID) return;
                    if (
clienttarget.Player.Body == 1003 || clienttarget.Player.Body == 1004)
                    {
                        
attack.Attacker client.Player.UID;
                        
attack.client.Player.X;
                        
attack.client.Player.Y;
                        
clienttarget.Send(attack);
                        
clienttarget.Player.InteractionInProgress true;
                        
client.Player.InteractionInProgress true;
                        
clienttarget.Player.InteractionType attack.Damage;
                        
clienttarget.Player.InteractionX client.Player.X;
                        
clienttarget.Player.InteractionY client.Player.Y;
                        
client.Player.InteractionType attack.Damage;
                        
client.Player.InteractionX client.Player.X;
                        
client.Player.InteractionY client.Player.Y;
                        if (
clienttarget.Player.== client.Player.&& clienttarget.Player.== client.Player.Y)
                        {
                            
attack.Damage client.Player.InteractionType;
                            
clienttarget.Player.InteractionSet true;
                            
client.Player.InteractionSet true;
                            
attack.Attacker clienttarget.Player.UID;
                            
attack.Attacked client.Player.UID;
                            
attack.InteractType 47;
                            
attack.clienttarget.Player.X;
                            
attack.clienttarget.Player.Y;
                            
attack.ResponseDamage clienttarget.InteractionEffect;
                            
clienttarget.Send(attack);
                            
attack.InteractType 49;
                            
attack.Attacker client.Player.UID;
                            
attack.Attacked clienttarget.Player.UID;
                            
client.SendScreen(attacktrue);
                            
attack.Attacker clienttarget.Player.UID;
                            
attack.Attacked client.Player.UID;
                            
client.SendScreen(attacktrue);
                        }
                    }
                    else
                    {
                        
attack.InteractType 47;
                        
attack.Attacker client.Player.UID;
                        
attack.client.Player.X;
                        
attack.client.Player.Y;
                        
clienttarget.Send(attack);
                        
clienttarget.Player.InteractionInProgress true;
                        
client.Player.InteractionInProgress true;
                        
clienttarget.Player.InteractionType attack.Damage;
                        
clienttarget.Player.InteractionX clienttarget.Player.X;
                        
clienttarget.Player.InteractionY clienttarget.Player.Y;
                        
client.Player.InteractionType attack.Damage;
                        
client.Player.InteractionX clienttarget.Player.X;
                        
client.Player.InteractionY clienttarget.Player.Y;
                        if (
clienttarget.Player.== client.Player.&& clienttarget.Player.== client.Player.Y)
                        {
                            
clienttarget.Player.InteractionSet true;
                            
client.Player.InteractionSet true;
                            
attack.Attacker clienttarget.Player.UID;
                            
attack.Attacked client.Player.UID;
                            
attack.clienttarget.Player.X;
                            
attack.clienttarget.Player.Y;
                            
attack.ResponseDamage clienttarget.InteractionEffect;
                            
clienttarget.Send(attack);
                            
attack.InteractType 49;
                            
client.SendScreen(attacktrue);
                            
attack.Attacker client.Player.UID;
                            
attack.Attacked clienttarget.Player.UID;
                            
client.SendScreen(attacktrue);
                        }
                    }
                }
            }
        }
        public class 
InteractionStopEffect
        
{
            public 
InteractionStopEffect(MsgInteract attackGame.Player a_client)
            {
                
Client.GameState client a_client.Owner;
                if (
Kernel.GamePool.ContainsKey(attack.Attacked))
                {
                    
Client.GameState clienttarget Kernel.GamePool[attack.Attacked];
                    
attack.Attacker client.Player.UID;
                    
attack.Attacked clienttarget.Player.UID;
                    
attack.Damage client.Player.InteractionType;
                    
attack.client.Player.X;
                    
attack.client.Player.Y;
                    
attack.InteractType 50;
                    
client.SendScreen(attacktrue);
                    
attack.Attacker clienttarget.Player.UID;
                    
attack.Attacked client.Player.UID;
                    
clienttarget.SendScreen(attacktrue);
                    
client.Player.Teleport(client.Player.MapIDclient.Player.Xclient.Player.Y);
                    
clienttarget.Player.Teleport(clienttarget.Player.MapIDclienttarget.Player.Xclienttarget.Player.Y);
                    
client.Player.InteractionType 0;
                    
client.Player.InteractionWith 0;
                    
client.Player.InteractionInProgress false;
                    
clienttarget.Player.InteractionType 0;
                    
clienttarget.Player.InteractionWith 0;
                    
clienttarget.Player.InteractionInProgress false;
                }
            }
        }
        public class 
InteractionRefuse
        
{
            public 
InteractionRefuse(MsgInteract attackGame.Player a_client)
            {
                
Client.GameState client a_client.Owner;
                
client.Player.InteractionType 0;
                
client.Player.InteractionWith 0;
                
client.Player.InteractionInProgress false;
                if (
Kernel.GamePool.ContainsKey(attack.Attacked))
                {
                    
Client.GameState clienttarget Kernel.GamePool[attack.Attacked];
                    
attack.Attacker clienttarget.Player.UID;
                    
attack.InteractType 48;
                    
attack.clienttarget.Player.X;
                    
attack.clienttarget.Player.Y;
                    
clienttarget.Send(attack);
                    
clienttarget.Player.InteractionType 0;
                    
clienttarget.Player.InteractionWith 0;
                    
clienttarget.Player.InteractionInProgress false;
                }
            }
        }
        
#endregion
        
private void Execute()
        {
            
#region interactions
            
if (attack != null)
            {
                switch (
attack.InteractType)
                {
                    case 
MsgInteract.InteractionRequest:
                        {
                            new 
InteractionRequest(attackattacker); return;
                        }
                    case 
MsgInteract.InteractionEffect:
                        {
                            new 
InteractionEffect(attackattacker); return;
                        }
                    case 
MsgInteract.InteractionAccept:
                        {
                            new 
InteractionAccept(attackattacker); return;
                        }
                    case 
MsgInteract.InteractionRefuse:
                        {
                            new 
InteractionRefuse(attackattacker); return;
                        }
                    case 
MsgInteract.InteractionStopEffect:
                        {
                            new 
InteractionStopEffect(attackattacker); return;
                        }
                }
            }
            
#endregion
            #region Monster -> Player \ Monster
            
if (attack == null)
            {
                if (
attacker.PlayerFlag != PlayerFlag.Monster) return;
                if (
attacked == null) return;
                if (
attacker.Companion && attacker.Name != "Thundercloud")
                {
                    if (
Constants.PKForbiddenMaps.Contains(attacker.MapID)) return;
                }
                if (
attacked.PlayerFlag == PlayerFlag.Player)
                {
                    if (!
attacked.Owner.Attackable) return;
                    if (
attacked.Dead) return;
                    if (
attacker.AttackStamp.AddMilliseconds(2000) < Time32.Now)
                    {
                        
attacker.AttackStamp Time32.Now;
                        
#region SnowBanhe
                        
if (attacker.Name == "SnowBanshee" || attacker.Name == "SnowBansheeSoul" || attacker.Name == "PurpleBanshee")
                        {

                            
uint rand = (uint)Mr.HaMoOo.Kernel.Random.Next(18);
                            switch (
rand)
                            {
                                case 
1:
                                    
attacker.MonsterInfo.SpellID 10001;
                                    break;
                                case 
2:
                                    
attacker.MonsterInfo.SpellID 30010;
                                    break;
                                case 
4:
                                    
attacker.MonsterInfo.SpellID 30011;
                                    break;
                                case 
6:
                                    
attacker.MonsterInfo.SpellID 30012;
                                    break;
                            }
                            
#region IceThrom AngerCop
                            
if (attacker.MonsterInfo.SpellID == 30010 || attacker.MonsterInfo.SpellID == 10001)
                            {
                                
uint damage 0;
                                
damage += (uint)Kernel.Random.Next(10002000);
                                if (
attacked.Hitpoints <= damage)
                                {
                                    
attacked.Die(attacker);
                                }
                                else
                                {
                                    
attacked.Hitpoints -= damage;
                                }
                                if (
attacker.Companion)
                                    
attacker.Owner.IncreaseExperience(Math.Min(damageattacked.Hitpoints), true);
                                
MsgMagicEffect suse = new MsgMagicEffect(true);
                                
suse.Attacker attacker.UID;
                                
suse.SpellID attacker.MonsterInfo.SpellID;
                                
suse.attacked.X;
                                
suse.attacked.Y;
                                
suse.AddTarget(attacked.UIDdamageattack);
                                
attacked.Owner.SendScreen(susetrue);
                            }
                            
#endregion
                            #region Chill
                            
if (attacker.MonsterInfo.SpellID == 30011)
                            {
                                
MsgMagicEffect suse = new MsgMagicEffect(true);
                                
attack = new MsgInteract(true);
                                
attack.Effect MsgInteract.InteractEffects.None;
                                
uint damage 0;
                                
damage += (uint)Kernel.Random.Next(10002000);
                                
suse.Effect attack.Effect;
                                if (
attacked.Hitpoints <= damage)
                                {
                                    
attacked.Die(attacker);
                                }
                                else
                                {
                                    
attacked.Hitpoints -= damage;
                                    
attacked.Owner.FrightenStamp Time32.Now;
                                    var 
upd = new MsgRaceTrackStatus(true);
                                    
upd.UID attacked.UID;
                                    
upd.Add(MsgRaceTrackStatus.Flustered05);
                                    
attacked.Owner.SendScreen(updtrue);
                                    
attacked.Owner.Player.AddFlag((ulong)MsgUpdate.Flags.ChaosCycle);

                                }
                                if (
attacker.Companion)
                                    
attacker.Owner.IncreaseExperience(Math.Min(damageattacked.Hitpoints), true);

                                
suse.Attacker attacker.UID;
                                
suse.SpellID attacker.MonsterInfo.SpellID;
                                
suse.attacked.X;
                                
suse.attacked.Y;
                                
suse.AddTarget(attacked.UIDdamageattack);
                                foreach (var 
obj in attacked.Owner.Screen.Objects)
                                {
                                    if (
Calculations.InBox(obj.Xobj.Yattacker.Xattacker.Y14))
                                    {
                                        if (
obj.MapObjType == MapObjectType.Player)
                                        {
                                            if (
obj.Owner.Player.ContainsFlag((ulong)MsgUpdate.Flags.Dead)) continue;
                                            
attacked obj as Player;
                                            if (
attacked.Hitpoints <= damage)
                                            {
                                                
attacked.Die(attacker);
                                            }
                                            else
                                            {
                                                
attacked.Hitpoints -= damage;
                                                
attacked.Owner.FrightenStamp Time32.Now;
                                                var 
upd = new MsgRaceTrackStatus(true);
                                                
upd.UID attacked.UID;
                                                
upd.Add(MsgRaceTrackStatus.Flustered05);
                                                
attacked.Owner.SendScreen(updtrue);
                                                
attacked.Owner.Player.AddFlag((ulong)MsgUpdate.Flags.ChaosCycle);
                                            }

                                            
suse.AddTarget(attacked.UIDdamageattack);
                                        }
                                    }
                                }
                                
attacked.Owner.SendScreen(susetrue);
                            }
                            
#endregion
                            #region AngerCrop
                            
if (attacker.MonsterInfo.SpellID == 30012)
                            {
                                
MsgMagicEffect suse = new MsgMagicEffect(true);
                                
attack = new MsgInteract(true);
                                
attack.Effect MsgInteract.InteractEffects.None;
                                
uint damage 0;
                                
damage += (uint)Kernel.Random.Next(10002000);
                                
suse.Effect attack.Effect;
                                if (
attacked.Hitpoints <= damage)
                                {
                                    
attacked.Die(attacker);
                                }
                                else
                                {
                                    
attacked.Hitpoints -= damage;
                                    
attacked.Owner.Player.FrozenStamp Time32.Now;
                                    
attacked.Owner.Player.FrozenTime 5;
                                    
MsgRaceTrackStatus update = new MsgRaceTrackStatus(true);
                                    
update.UID attacked.UID;
                                    
update.Add(MsgRaceTrackStatus.Freeze05);
                                    
attacked.Owner.SendScreen(updatetrue);
                                    
attacked.AddFlag((ulong)MsgUpdate.Flags.Freeze);
                                }
                                if (
attacker.Companion)
                                    
attacker.Owner.IncreaseExperience(Math.Min(damageattacked.Hitpoints), true);

                                
suse.Attacker attacker.UID;
                                
suse.SpellID attacker.MonsterInfo.SpellID;
                                
suse.attacked.X;
                                
suse.attacked.Y;
                                
suse.AddTarget(attacked.UIDdamageattack);
                                foreach (var 
obj in attacked.Owner.Screen.Objects)
                                {
                                    if (
Calculations.InBox(obj.Xobj.Yattacker.Xattacker.Y10))
                                    {
                                        if (
obj.MapObjType == MapObjectType.Player)
                                        {
                                            if (
obj.Owner.Player.ContainsFlag((ulong)MsgUpdate.Flags.Dead))
                                                continue;
                                            
attacked obj as Player;
                                            if (
attacked.Hitpoints <= damage)
                                            {
                                                
attacked.Die(attacker);
                                            }
                                            else
                                            {
                                                
attacked.Hitpoints -= damage;
                                                
attacked.Owner.Player.FrozenStamp Time32.Now;
                                                
attacked.Owner.Player.FrozenTime 5;
                                                
MsgRaceTrackStatus update = new MsgRaceTrackStatus(true);
                                                
update.UID attacked.UID;
                                                
update.Add(MsgRaceTrackStatus.Freeze05);
                                                
attacked.Owner.SendScreen(updatetrue);
                                                
attacked.AddFlag((ulong)MsgUpdate.Flags.Freeze);
                                            }
                                            
suse.AddTarget(attacked.UIDdamageattack);
                                        }
                                    }
                                }
                                
attacked.Owner.SendScreen(susetrue);
                            }
                            
#endregion
                        
}
                        
#endregion
                        #region NemesisTyrant
                        
if (attacker.Name == "NemesisTyrant")
                        {
                            
uint rand = (uint)Kernel.Random.Next(122);
                            switch (
rand)
                            {
                                case 
1:
                                    
attacker.MonsterInfo.SpellID 10001;
                                    break;
                                case 
2:
                                    
attacker.MonsterInfo.SpellID 30010;
                                    break;
                                case 
3:
                                    
attacker.MonsterInfo.SpellID 10001;
                                    break;
                                case 
4:
                                    
attacker.MonsterInfo.SpellID 30010;
                                    break;
                                case 
5:
                                    
attacker.MonsterInfo.SpellID 30011;
                                    break;
                                case 
6:
                                    
attacker.MonsterInfo.SpellID 30012;
                                    break;
                                case 
7:
                                    
attacker.MonsterInfo.SpellID 7014;
                                    break;
                                case 
8:
                                    
attacker.MonsterInfo.SpellID 7017;
                                    break;
                                case 
9:
                                    
attacker.MonsterInfo.SpellID 7017;
                                    break;
                                case 
10:
                                    
attacker.MonsterInfo.SpellID 7012;
                                    break;
                                case 
11:
                                    
attacker.MonsterInfo.SpellID 7013;
                                    break;
                                case 
12:
                                    
attacker.MonsterInfo.SpellID 7015;
                                    break;
                                case 
13:
                                    
attacker.MonsterInfo.SpellID 7016;
                                    break;
                                case 
14:
                                    
attacker.MonsterInfo.SpellID 10502;
                                    break;
                                case 
15:
                                    
attacker.MonsterInfo.SpellID 10504;
                                    break;
                                case 
16:
                                    
attacker.MonsterInfo.SpellID 10506;
                                    break;
                                case 
17:
                                    
attacker.MonsterInfo.SpellID 10505;
                                    break;
                                case 
18:
                                    
attacker.MonsterInfo.SpellID 10500;
                                    break;
                                case 
19:
                                    
attacker.MonsterInfo.SpellID 10363;
                                    break;
                                case 
20:
                                    
attacker.MonsterInfo.SpellID 10360;
                                    
attacked.AddFlag((ulong)MsgUpdate.Flags.Stun);
                                    
attacked.ShockStamp Time32.Now;
                                    
attacked.Shock 5;
                                    var 
upd = new MsgRaceTrackStatus(true);
                                    
upd.UID attacked.UID;
                                    
upd.Add(MsgRaceTrackStatus.Dizzy05);
                                    
attacked.Owner.SendScreen(updtrue);
                                    break;
                                case 
21:
                                    
attacker.MonsterInfo.SpellID 10361;
                                    
attacked.AddFlag((ulong)MsgUpdate.Flags.Stun);
                                    
attacked.ShockStamp Time32.Now;
                                    
attacked.Shock 5;
                                    var 
upd1 = new MsgRaceTrackStatus(true);
                                    
upd1.UID attacked.UID;
                                    
upd1.Add(MsgRaceTrackStatus.Dizzy05);
                                    
attacked.Owner.SendScreen(upd1true);
                                    break;
                                case 
22:
                                    
attacker.MonsterInfo.SpellID 10362;
                                    break;
                            }
                            
#region IceThrom AngerCop
                            
if (attacker.MonsterInfo.SpellID == 30010 || attacker.MonsterInfo.SpellID == 10001)
                            {
                                
uint damage 0;
                                
damage += (uint)Kernel.Random.Next(10002000);
                                if (
attacked.Hitpoints <= damage)
                                {
                                    
attacked.Die(attacker);
                                }
                                else
                                {
                                    
attacked.Hitpoints -= damage;
                                }
                                if (
attacker.Companion)
                                    
attacker.Owner.IncreaseExperience(Math.Min(damageattacked.Hitpoints), true);
                                
MsgMagicEffect suse = new MsgMagicEffect(true);
                                
suse.Attacker attacker.UID;
                                
suse.SpellID attacker.MonsterInfo.SpellID;
                                
suse.attacked.X;
                                
suse.attacked.Y;
                                
suse.AddTarget(attacked.UIDdamageattack);
                                
attacked.Owner.SendScreen(susetrue);
                            }
                            
#endregion
                            #region Chill
                            
if (attacker.MonsterInfo.SpellID == 30011)
                            {
                                
MsgMagicEffect suse = new MsgMagicEffect(true);
                                
attack = new MsgInteract(true);
                                
attack.Effect MsgInteract.InteractEffects.None;
                                
uint damage 0;
                                
damage += (uint)Kernel.Random.Next(10002000);
                                
suse.Effect attack.Effect;
                                if (
attacked.Hitpoints <= damage)
                                {
                                    
attacked.Die(attacker);
                                }
                                else
                                {
                                    
attacked.Hitpoints -= damage;
                                    
attacked.Owner.FrightenStamp Time32.Now;
                                    var 
upd = new MsgRaceTrackStatus(true);
                                    
upd.UID attacked.UID;
                                    
upd.Add(MsgRaceTrackStatus.Flustered05);
                                    
attacked.Owner.SendScreen(updtrue);
                                    
attacked.Owner.Player.AddFlag((ulong)MsgUpdate.Flags.ChaosCycle);

                                }
                                if (
attacker.Companion)
                                    
attacker.Owner.IncreaseExperience(Math.Min(damageattacked.Hitpoints), true);

                                
suse.Attacker attacker.UID;
                                
suse.SpellID attacker.MonsterInfo.SpellID;
                                
suse.attacked.X;
                                
suse.attacked.Y;
                                
suse.AddTarget(attacked.UIDdamageattack);
                                foreach (var 
obj in attacked.Owner.Screen.Objects)
                                {
                                    if (
Calculations.InBox(obj.Xobj.Yattacker.Xattacker.Y14))
                                    {
                                        if (
obj.MapObjType == MapObjectType.Player)
                                        {
                                            if (
obj.Owner.Player.ContainsFlag((ulong)MsgUpdate.Flags.Dead))
                                                continue;
                                            
attacked obj as Player;
                                            if (
attacked.Hitpoints <= damage)
                                            {
                                                
attacked.Die(attacker);
                                            }
                                            else
                                            {
                                                
attacked.Hitpoints -= damage;
                                                
attacked.Owner.FrightenStamp Time32.Now;
                                                var 
upd = new MsgRaceTrackStatus(true);
                                                
upd.UID attacked.UID;
                                                
upd.Add(MsgRaceTrackStatus.Flustered05);
                                                
attacked.Owner.SendScreen(updtrue);
                                                
attacked.Owner.Player.AddFlag((ulong)MsgUpdate.Flags.ChaosCycle);
                                            }

                                            
suse.AddTarget(attacked.UIDdamageattack);
                                        }
                                    }
                                }
                                
attacked.Owner.SendScreen(susetrue);
                            }
                            
#endregion
                            #region AngerCrop
                            
if (attacker.MonsterInfo.SpellID == 30012)
                            {
                                
MsgMagicEffect suse = new MsgMagicEffect(true);
                                
attack = new MsgInteract(true);
                                
attack.Effect MsgInteract.InteractEffects.None;
                                
uint damage 0;
                                
damage += (uint)Kernel.Random.Next(10002000);
                                
suse.Effect attack.Effect;
                                if (
attacked.Hitpoints <= damage)
                                {
                                    
attacked.Die(attacker);
                                }
                                else
                                {
                                    
attacked.Hitpoints -= damage;
                                    
attacked.Owner.Player.FrozenStamp Time32.Now;
                                    
attacked.Owner.Player.FrozenTime 5;
                                    
MsgRaceTrackStatus update = new MsgRaceTrackStatus(true);
                                    
update.UID attacked.UID;
                                    
update.Add(MsgRaceTrackStatus.Freeze05);
                                    
attacked.Owner.SendScreen(updatetrue);
                                    
attacked.AddFlag((ulong)MsgUpdate.Flags.Freeze);
                                }
                                if (
attacker.Companion)
                                    
attacker.Owner.IncreaseExperience(Math.Min(damageattacked.Hitpoints), true);

                                
suse.Attacker attacker.UID;
                                
suse.SpellID attacker.MonsterInfo.SpellID;
                                
suse.attacked.X;
                                
suse.attacked.Y;
                                
suse.AddTarget(attacked.UIDdamageattack);
                                foreach (var 
obj in attacked.Owner.Screen.Objects)
                                {
                                    if (
Calculations.InBox(obj.Xobj.Yattacker.Xattacker.Y10))
                                    {
                                        if (
obj.MapObjType == MapObjectType.Player)
                                        {
                                            if (
obj.Owner.Player.ContainsFlag((ulong)MsgUpdate.Flags.Dead))
                                                continue;
                                            
attacked obj as Player;
                                            if (
attacked.Hitpoints <= damage)
                                            {
                                                
attacked.Die(attacker);
                                            }
                                            else
                                            {
                                                
attacked.Hitpoints -= damage;
                                                
attacked.Owner.Player.FrozenStamp Time32.Now;
                                                
attacked.Owner.Player.FrozenTime 5;
                                                
MsgRaceTrackStatus update = new MsgRaceTrackStatus(true);
                                                
update.UID attacked.UID;
                                                
update.Add(MsgRaceTrackStatus.Freeze05);
                                                
attacked.Owner.SendScreen(updatetrue);
                                                
attacked.AddFlag((ulong)MsgUpdate.Flags.Freeze);
                                            }

                                            
suse.AddTarget(attacked.UIDdamageattack);
                                        }
                                    }
                                }
                                
attacked.Owner.SendScreen(susetrue);
                            }
                            
#endregion
                        
}
                        
#endregion
                        #region TreatoDragon
                        
if (attacker.Name == "TeratoDragon" || attacker.Name == "LavaBeast" || attacker.Name == "ShadowClone")
                        {
                            
uint rand = (uint)Mr.HaMoOo.Kernel.Random.Next(17);
                            switch (
rand)
                            {
                                case 
1:
                                    
attacker.MonsterInfo.SpellID 7014;
                                    break;
                                case 
2:
                                    
attacker.MonsterInfo.SpellID 7017;
                                    break;
                                case 
3:
                                    
attacker.MonsterInfo.SpellID 7017;
                                    break;
                                case 
4:
                                    
attacker.MonsterInfo.SpellID 7012;
                                    break;
                                case 
5:
                                    
attacker.MonsterInfo.SpellID 7013;
                                    break;
                                case 
6:
                                    
attacker.MonsterInfo.SpellID 7015;
                                    break;
                                case 
7:
                                    
attacker.MonsterInfo.SpellID 7016;
                                    break;
                            }
                            
#region TD Area
                            
if (attacker.MonsterInfo.SpellID == 7014 || attacker.MonsterInfo.SpellID == 7017)
                            {
                                
MsgMagicEffect suse = new MsgMagicEffect(true);
                                
attack = new MsgInteract(true);
                                
attack.Effect MsgInteract.InteractEffects.None;
                                
uint damage 0;
                                
damage += (uint)Kernel.Random.Next(10002000);
                                
suse.Effect attack.Effect;
                                if (
attacked.Hitpoints <= damage)
                                {
                                    
attacked.Die(attacker);
                                }
                                else
                                {
                                    
attacked.Hitpoints -= damage;
                                }
                                if (
attacker.Companion)
                                    
attacker.Owner.IncreaseExperience(Math.Min(damageattacked.Hitpoints), true);

                                
suse.Attacker attacker.UID;
                                
suse.SpellID attacker.MonsterInfo.SpellID;
                                
suse.attacked.X;
                                
suse.attacked.Y;
                                
suse.AddTarget(attacked.UIDdamageattack);
                                foreach (var 
obj in attacked.Owner.Screen.Objects)
                                {
                                    if (
Calculations.InBox(obj.Xobj.Yattacker.Xattacker.Y14))
                                    {
                                        if (
obj.MapObjType == MapObjectType.Player)
                                        {
                                            if (
obj.Owner.Player.ContainsFlag((ulong)MsgUpdate.Flags.Dead))
                                                continue;
                                            
attacked obj as Player;
                                            if (
attacked.Hitpoints <= damage)
                                            {
                                                
attacked.Die(attacker);
                                            }
                                            else
                                            {
                                                
attacked.Hitpoints -= damage;
                                            }

                                            
suse.AddTarget(attacked.UIDdamageattack);
                                        }
                                    }
                                }
                                
attacked.Owner.SendScreen(susetrue);
                            }
                        }
                            
#endregion
                        #region 2nd skill
                        
if (attacker.MonsterInfo.SpellID == 7013)
                        {
                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                            
attack = new MsgInteract(true);
                            
attack.Effect MsgInteract.InteractEffects.None;
                            
uint damage 0;
                            
damage += (uint)Kernel.Random.Next(10002000);
                            
suse.Effect attack.Effect;
                            if (
attacked.Hitpoints <= damage)
                            {
                                
attacked.Die(attacker);
                            }
                            else
                            {
                                
attacked.Hitpoints -= damage;
                                
attacked.Owner.FrightenStamp Time32.Now;
                                
attacked.Owner.Player.Fright 5;
                                var 
upd = new MsgRaceTrackStatus(true);
                                
upd.UID attacked.UID;
                                
upd.Add(MsgRaceTrackStatus.Dizzy05);
                                
attacked.Owner.SendScreen(updtrue);
                                
attacked.Owner.Player.AddFlag((ulong)MsgUpdate.Flags.FreezeSmall);
                            }
                            if (
attacker.Companion)
                                
attacker.Owner.IncreaseExperience(Math.Min(damageattacked.Hitpoints), true);
                            
suse.Attacker attacker.UID;
                            
suse.SpellID attacker.MonsterInfo.SpellID;
                            
suse.attacked.X;
                            
suse.attacked.Y;
                            
suse.AddTarget(attacked.UIDdamageattack);
                            foreach (var 
obj in attacked.Owner.Screen.Objects)
                            {
                                if (
Calculations.InBox(obj.Xobj.Yattacker.Xattacker.Y14))
                                {
                                    if (
obj.MapObjType == MapObjectType.Player)
                                    {
                                        if (
obj.Owner.Player.ContainsFlag((ulong)MsgUpdate.Flags.Dead))
                                            continue;
                                        
attacked obj as Player;
                                        if (
attacked.Hitpoints <= damage)
                                        {
                                            
attacked.Die(attacker);
                                        }
                                        else
                                        {
                                            
attacked.Hitpoints -= damage;
                                            
attacked.Owner.FrightenStamp Time32.Now;
                                            
attacked.Owner.Player.Fright 5;
                                            var 
upd = new MsgRaceTrackStatus(true);
                                            
upd.UID attacked.UID;
                                            
upd.Add(MsgRaceTrackStatus.Dizzy05);
                                            
attacked.Owner.SendScreen(updtrue);
                                            
attacked.Owner.Player.AddFlag((ulong)MsgUpdate.Flags.FreezeSmall);
                                        }

                                        
suse.AddTarget(attacked.UIDdamageattack);
                                    }
                                }
                            }
                            
attacked.Owner.SendScreen(susetrue);
                        }
                        
#endregion
                        #region Chill
                        
if (attacker.MonsterInfo.SpellID == 7015)
                        {
                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                            
attack = new MsgInteract(true);
                            
attack.Effect MsgInteract.InteractEffects.None;
                            
uint damage 0;
                            
damage += (uint)Kernel.Random.Next(10002000);
                            
suse.Effect attack.Effect;
                            if (
attacked.Hitpoints <= damage)
                            {
                                
attacked.Die(attacker);
                            }
                            else
                            {
                                
attacked.Hitpoints -= damage;
                                
attacked.Owner.FrightenStamp Time32.Now;
                                var 
upd = new MsgRaceTrackStatus(true);
                                
upd.UID attacked.UID;
                                
upd.Add(MsgRaceTrackStatus.Flustered05);
                                
attacked.Owner.SendScreen(updtrue);
                                
attacked.Owner.Player.AddFlag((ulong)MsgUpdate.Flags.ChaosCycle);

                            }
                            if (
attacker.Companion)
                                
attacker.Owner.IncreaseExperience(Math.Min(damageattacked.Hitpoints), true);

                            
suse.Attacker attacker.UID;
                            
suse.SpellID attacker.MonsterInfo.SpellID;
                            
suse.attacked.X;
                            
suse.attacked.Y;
                            
suse.AddTarget(attacked.UIDdamageattack);
                            foreach (var 
obj in attacked.Owner.Screen.Objects)
                            {
                                if (
Calculations.InBox(obj.Xobj.Yattacker.Xattacker.Y14))
                                {
                                    if (
obj.MapObjType == MapObjectType.Player)
                                    {
                                        if (
obj.Owner.Player.ContainsFlag((ulong)MsgUpdate.Flags.Dead))
                                            continue;
                                        
attacked obj as Player;
                                        if (
attacked.Hitpoints <= damage)
                                        {
                                            
attacked.Die(attacker);
                                        }
                                        else
                                        {
                                            
attacked.Hitpoints -= damage;
                                            
attacked.Owner.FrightenStamp Time32.Now;
                                            var 
upd = new MsgRaceTrackStatus(true);
                                            
upd.UID attacked.UID;
                                            
upd.Add(MsgRaceTrackStatus.Flustered05);
                                            
attacked.Owner.SendScreen(updtrue);
                                            
attacked.Owner.Player.AddFlag((ulong)MsgUpdate.Flags.ChaosCycle);
                                        }

                                        
suse.AddTarget(attacked.UIDdamageattack);
                                    }
                                }
                            }
                            
attacked.Owner.SendScreen(susetrue);
                        }
                        
#endregion
                        #endregion
                        #region SwordMaster
                        
if (attacker.Name == "SwordMaster" || attacker.Name == "HollowBeast")
                        {
                            
uint rand = (uint)Mr.HaMoOo.Kernel.Random.Next(15);
                            switch (
rand)
                            {
                                case 
1:
                                    
attacker.MonsterInfo.SpellID 10502;
                                    break;
                                case 
2:
                                    
attacker.MonsterInfo.SpellID 10504;
                                    break;
                                case 
3:
                                    
attacker.MonsterInfo.SpellID 10506;
                                    break;
                                case 
4:
                                    
attacker.MonsterInfo.SpellID 10505;
                                    break;
                                case 
5:
                                    
attacker.MonsterInfo.SpellID 10500;
                                    break;
                            }
                            
uint damage 0;
                            
damage += (uint)Kernel.Random.Next(10002000);

                            if (
attacked.Hitpoints <= damage)
                                
attacked.Die(attacker);
                            else
                                
attacked.Hitpoints -= damage;
                            if (
attacker.Companion)
                                
attacker.Owner.IncreaseExperience(Math.Min(damageattacked.Hitpoints), true);
                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                            
suse.Attacker attacker.UID;
                            
suse.SpellID attacker.MonsterInfo.SpellID;
                            
suse.attacked.X;
                            
suse.attacked.Y;
                            
suse.AddTarget(attacked.UIDdamageattack);
                            
attacked.Owner.SendScreen(susetrue);
                        }
                        
#endregion
                        #region ThrillingSpook
                        
if (attacker.Name == "ThrillingSpook" || attacker.Name == "ThrillingSpook2" || attacker.Name == "ThrillingSpook3")
                        {
                            
uint rand = (uint)Kernel.Random.Next(17);
                            switch (
rand)
                            {
                                case 
1attacker.MonsterInfo.SpellID 10363; break;
                                case 
2:
                                    {
                                        if (!
attacked.ContainsFlag((ulong)MsgUpdate.Flags.Stun))
                                        {
                                            
attacker.MonsterInfo.SpellID 10360;
                                            
attacked.AddFlag((ulong)MsgUpdate.Flags.Stun);
                                            
attacked.ShockStamp Time32.Now;
                                            
attacked.Shock 5;
                                            var 
upd = new MsgRaceTrackStatus(true);
                                            
upd.UID attacked.UID;
                                            
upd.Add(MsgRaceTrackStatus.SoulShacle05);
                                            
attacked.Owner.SendScreen(updtrue);
                                        }
                                        break;
                                    }
                                case 
3attacker.MonsterInfo.SpellID 10362; break;
                                case 
4attacker.MonsterInfo.SpellID 10363; break;
                                case 
5attacker.MonsterInfo.SpellID 10363; break;
                                case 
6attacker.MonsterInfo.SpellID 10362; break;
                                case 
7:
                                    if (!
attacked.ContainsFlag((ulong)MsgUpdate.Flags.Stun))
                                    {
                                        
attacker.MonsterInfo.SpellID 10361;
                                        
attacked.AddFlag((ulong)MsgUpdate.Flags.Stun);
                                        
attacked.ShockStamp Time32.Now;
                                        
attacked.Shock 5;
                                        var 
upd1 = new MsgRaceTrackStatus(true);
                                        
upd1.UID attacked.UID;
                                        
upd1.Add(MsgRaceTrackStatus.SoulShacle05);
                                        
attacked.Owner.SendScreen(upd1true);
                                    }
                                    break;
                            }
                            
uint damage 0;
                            
damage += (uint)Kernel.Random.Next(10002000);
                            if (
attacked.Hitpoints <= damage)
                            {
                                
attacked.Die(attacker);
                            }
                            else
                            {
                                
attacked.Hitpoints -= damage;
                            }
                            if (
attacker.Companion)
                                
attacker.Owner.IncreaseExperience(Math.Min(damageattacked.Hitpoints), true);
                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                            
suse.Attacker attacker.UID;
                            
suse.SpellID attacker.MonsterInfo.SpellID;
                            
suse.attacked.X;
                            
suse.attacked.Y;
                            
suse.AddTarget(attacked.UIDdamageattack);
                            
attacked.Owner.SendScreen(susetrue);
                        }
                        
#endregion
                        #region ThunderCloud
                        
if (attacker.Name == "Thundercloud")
                        {
                            if (
attacker.Owner.Player.PKMode != Game.Enums.PKMode.PK &&
                         
attacker.Owner.Player.PKMode != Game.Enums.PKMode.Team) return;
                            if (
Kernel.GamePool.ContainsKey(attacker.OwnerUID))
                            {
                                var 
owner Kernel.GamePool[attacker.OwnerUID];
                                var 
spell Database.SpellTable.GetSpell(12840owner);
                                var 
spell2 Database.SpellTable.GetSpell(12970owner);
                                
byte percent 0;
                                if (
spell2 != null)
                                {
                                    if (
spell2.Level == 0percent 130;
                                    if (
spell2.Level == 1percent 140;
                                    if (
spell2.Level == 2percent 150;
                                    if (
spell2.Level == 3percent 160;
                                    if (
spell2.Level == 4percent 170;
                                    if (
spell2.Level == 5percent 180;
                                    if (
spell2.Level == 6percent 200;
                                }
                                
attack = new MsgInteract(true);
                                
attack.Attacker attacker.UID;
                                
attack.Attacked attacked.UID;
                                
attack.InteractType Network.GamePackets.MsgInteract.Kill;
                                
attack.attacked.X;
                                
attack.attacked.Y;
                                
attack.Damage 1;
                                
uint damage2 = (uint)(Calculate.Melee(owner.Playerattackedref attack) * spell.FirstDamage 100);
                                if (
attacker.SpawnPacket[50] == 128)//ThunderBolt
                                    
damage2 = (uint)(damage2 percent 100);
                                
MsgMagicEffect suse2 = new MsgMagicEffect(true);
                                
suse2.Attacker attacker.UID;
                                
suse2.Attacker1 attacked.UID;
                                
suse2.SpellID 13190;
                                
suse2.attacked.X;
                                
suse2.attacked.Y;
                                
suse2.AddTarget(attacked.UIDdamage2attack);
                                
attacker.MonsterInfo.SendScreen(suse2);
                                if (
attacked.Hitpoints <= damage2)
                                {
                                    
attacked.Die(attacker);
                                    
attack.ResponseDamage damage2;
                                    
attacker.MonsterInfo.SendScreen(attack);
                                }
                                else
                                {
                                    
attacked.Hitpoints -= damage2;
                                }
                                return;
                            }
                            else
                                return;
                        }
                        
#endregion
                        #region ThunderCloudSight
                        
foreach (var th in Kernel.Maps[attacker.MapID].Entities.Values.Where(=> i.Name == "Thundercloud"))
                        {
                            if (
th.OwnerUID == attacked.UID)
                            {
                                if (
attacker == null || Kernel.GetDistance(attacker.Xattacker.Yth.Xth.Y) > th.MonsterInfo.AttackRange || attacker.Dead) break;

                                
th.MonsterInfo.InSight attacker.UID;
                                break;
                            }
                        }
                        
#endregion
                        #region Guard
                        
if (attacker.Name == "Guard1")
                        {
                            
uint rand = (uint)Kernel.Random.Next(115);
                            switch (
rand)
                            {
                                case 
1:
                                    
attacker.MonsterInfo.SpellID 7012;
                                    break;
                                case 
2:
                                    
attacker.MonsterInfo.SpellID 7013;
                                    break;
                                case 
3:
                                    
attacker.MonsterInfo.SpellID 7015;
                                    break;
                                case 
4:
                                    
attacker.MonsterInfo.SpellID 7016;
                                    break;
                                case 
5:
                                    
attacker.MonsterInfo.SpellID 7017;
                                    break;
                                case 
6:
                                    
attacker.MonsterInfo.SpellID 10001;
                                    break;
                                case 
7:
                                    
attacker.MonsterInfo.SpellID 10363;
                                    break;
                                case 
8:
                                    
attacker.MonsterInfo.SpellID 10362;
                                    break;
                                case 
9:
                                    
attacker.MonsterInfo.SpellID 10502;
                                    break;
                                case 
10:
                                    
attacker.MonsterInfo.SpellID 10504;
                                    break;
                                case 
11:
                                    
attacker.MonsterInfo.SpellID 10506;
                                    break;
                                case 
12:
                                    
attacker.MonsterInfo.SpellID 10505;
                                    break;
                                case 
13:
                                    
attacker.MonsterInfo.SpellID 30012;
                                    break;
                                case 
14:
                                    
attacker.MonsterInfo.SpellID 10001;
                                    break;
                                case 
15:
                                    
attacker.MonsterInfo.SpellID 30015;
                                    break;
                            }
                            
uint damage 0;
                            
damage += (uint)Kernel.Random.Next(5000060000);
                            if (
attacked == null)
                                return;
                            if (
attacked.Hitpoints <= damage)
                            {
                                
attacked.Die(attacker);
                            }
                            else
                            {
                                
attacked.Hitpoints -= damage;
                            }
                            if (
attacker.Companion)
                                
attacker.Owner.IncreaseExperience(Math.Min(damageattacked.Hitpoints), true);
                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                            
suse.Attacker attacker.UID;
                            
suse.SpellID attacker.MonsterInfo.SpellID;
                            
suse.attacked.X;
                            
suse.attacked.Y;
                            
suse.AddTarget(attacked.UIDdamageattack);
                            
attacked.Owner.SendScreen(susetrue);
                        }
                        
#endregion
                    
}
                    
attack = new MsgInteract(true);
                    
attack.Effect MsgInteract.InteractEffects.None;
                    
attack.Attacker attacker.UID;
                    
attack.Attacked attacker.MonsterInfo.ID;
                    
attack.attacked.X;
                    
attack.attacked.Y;
                    
attack.InteractType MsgInteract.ShowUseSpell;
                    
attack.MonsterSpellID attacker.MonsterInfo.SpellID;
                    
attacker.MonsterInfo.SendScreen(attack);
                    if (
attacker.MonsterInfo.SpellID == 0)
                    {
                        
attack = new MsgInteract(true);
                        
attack.Effect MsgInteract.InteractEffects.None;

                        
uint damage Calculate.Melee(attackerattackedref attack);
                        
#region RevengeTaill
                        
if (attacked.ContainsFlag4((ulong)Network.GamePackets.MsgUpdate.Flags4.RevengeTaill))
                        {
                            if (
attacked.Owner != null && attacked.Owner.Spells != null && attacked.Owner.Spells.ContainsKey(13030))
                            {
                                var 
spelll Database.SpellTable.GetSpell(13030attacked.Owner);
                                if (
damage <= spelll.Power)
                                {
                                    
MsgMagicEffect suses = new MsgMagicEffect(true);
                                    
suses.Attacker attacked.UID;
                                    
suses.Attacker1 attacker.UID;
                                    
suses.SpellID 13030;
                                    
suses.SpecialEffect 1;
                                    
suses.AddTarget(attacker.UIDdamagenull);
                                    if (
attacker.Hitpoints <= damage)
                                    {
                                        
attacker.Die(attacked);
                                    }
                                    else
                                    {
                                        
attacker.Hitpoints -= damage;
                                    }
                                    
attacked.Owner.SendScreen(susestrue);
                                }
                            }
                        }
                        
#endregion

                        
attack.Attacker attacker.UID;
                        
attack.Attacked attacked.UID;
                        
attack.InteractType MsgInteract.Melee;
                        
attack.Damage damage;
                        
attack.attacked.X;
                        
attack.attacked.Y;
                        if (
attacked.Hitpoints <= damage)
                        {
                            if (
attacked.InHangUp)
                            {
                                
MsgHangUp AutoHunt = new MsgHangUp();
                                
AutoHunt.Action MsgHangUp.Mode.KilledBy;
                                
AutoHunt.Unknown 3329;
                                
AutoHunt.KilledName attacker.MonsterInfo.Name;
                                
AutoHunt.EXPGained attacked.HangUpEXP;
                                
attacked.Owner.Send(AutoHunt.ToArray());
                                
attacked.AutoRevStamp Time32.Now;
                                
attacked.AutoRev 20;
                            }
                            
attacked.Owner.SendScreen(attacktrue);
                            
attacked.Die(attacker.UID);
                        }
                        else
                        {
                            
attacked.Hitpoints -= damage;
                            
attacked.Owner.SendScreen(attacktrue);
                        }
                    }
                    else
                    {
                        
MsgMagicEffect suse = new MsgMagicEffect(true);
                        
attack = new MsgInteract(true);
                        
attack.Effect MsgInteract.InteractEffects.None;
                        
uint damage Calculate.Magic(attackerattackedattacker.MonsterInfo.SpellID0ref attack);
                        
#region RevengeTaill
                        
if (attacked.ContainsFlag4((ulong)Network.GamePackets.MsgUpdate.Flags4.RevengeTaill))
                        {
                            if (
attacked.Owner != null && attacked.Owner.Spells != null && attacked.Owner.Spells.ContainsKey(13030))
                            {
                                var 
spelll Database.SpellTable.GetSpell(13030attacked.Owner);
                                if (
damage <= spelll.Power)
                                {
                                    
MsgMagicEffect suses = new MsgMagicEffect(true);
                                    
suses.Attacker attacked.UID;
                                    
suses.Attacker1 attacker.UID;
                                    
suses.SpellID 13030;
                                    
suses.SpecialEffect 1;
                                    
suses.AddTarget(attacker.UIDdamagenull);
                                    if (
attacker.Hitpoints <= damage)
                                    {
                                        
attacker.Die(attacked);
                                    }
                                    else
                                    {
                                        
attacker.Hitpoints -= damage;
                                    }
                                    
attacked.Owner.SendScreen(susestrue);
                                }
                            }
                        }
                        
#endregion

                        
suse.Effect attack.Effect;
                        if (
attacked.Hitpoints <= damage)
                        {
                            
attacked.Die(attacker.UID);
                            if (
attacked.InHangUp)
                            {
                                
MsgHangUp AutoHunt = new MsgHangUp();
                                
AutoHunt.Action MsgHangUp.Mode.KilledBy;
                                
AutoHunt.Unknown 3329;
                                
AutoHunt.KilledName attacker.MonsterInfo.Name;
                                
AutoHunt.EXPGained attacked.HangUpEXP;
                                
attacked.Owner.Send(AutoHunt.ToArray());
                                
attacked.AutoRevStamp Time32.Now;
                                
attacked.AutoRev 20;
                            }
                        }
                        else
                        {
                            
attacked.Hitpoints -= damage;
                        }
                        if (
attacker.Companion)
                            
attacker.Owner.IncreaseExperience(Math.Min(damageattacked.Hitpoints), true);
                        
suse.Attacker attacker.UID;
                        
suse.SpellID attacker.MonsterInfo.SpellID;
                        
suse.attacked.X;
                        
suse.attacked.Y;
                        
suse.AddTarget(attacked.UIDdamageattack);
                        
attacked.Owner.SendScreen(susetrue);
                    }
                }
                else
                {
                    if (
attacker.MonsterInfo.SpellID == 0)
                    {
                        
attack = new MsgInteract(true);
                        
attack.Effect MsgInteract.InteractEffects.None;
                        
uint damage Calculate.Melee(attackerattackedref attack);
                        
#region RevengeTaill
                        
if (attacked.ContainsFlag4((ulong)Network.GamePackets.MsgUpdate.Flags4.RevengeTaill))
                        {
                            if (
attacked.Owner != null && attacked.Owner.Spells != null && attacked.Owner.Spells.ContainsKey(13030))
                            {
                                var 
spelll Database.SpellTable.GetSpell(13030attacked.Owner);
                                if (
damage <= spelll.Power)
                                {
                                    
MsgMagicEffect suses = new MsgMagicEffect(true);
                                    
suses.Attacker attacked.UID;
                                    
suses.Attacker1 attacker.UID;
                                    
suses.SpellID 13030;
                                    
suses.SpecialEffect 1;
                                    
suses.AddTarget(attacker.UIDdamagenull);
                                    if (
attacker.Hitpoints <= damage)
                                    {
                                        
attacker.Die(attacked);
                                    }
                                    else
                                    {
                                        
attacker.Hitpoints -= damage;
                                    }
                                    
attacked.Owner.SendScreen(susestrue);
                                }
                            }
                        }
                        
#endregion

                        
attack.Attacker attacker.UID;
                        
attack.Attacked attacked.UID;
                        
attack.InteractType MsgInteract.Melee;
                        
attack.Damage damage;
                        
attack.attacked.X;
                        
attack.attacked.Y;
                        
attacked.MonsterInfo.SendScreen(attack);
                        if (
attacker.Companion)
                            if (
damage attacked.Hitpoints)
                                
attacker.Owner.IncreaseExperience(Math.Min(damageattacked.Hitpoints), true);
                            else 
attacker.Owner.IncreaseExperience(damagetrue);
                        if (
attacked.Hitpoints <= damage)
                        {
                            
attacked.Die(attacker);
                            
attack = new MsgInteract(true);
                            
attack.Attacker attacker.UID;
                            
attack.Attacked attacked.UID;
                            
attack.InteractType Network.GamePackets.MsgInteract.Kill;
                            
attack.attacked.X;
                            
attack.attacked.Y;
                            
attacked.MonsterInfo.SendScreen(attack);
                        }
                        else
                        {
                            
attacked.Hitpoints -= damage;
                        }
                    }
                    else
                    {
                        
MsgMagicEffect suse = new MsgMagicEffect(true);
                        
attack = new MsgInteract(true);
                        
attack.Effect MsgInteract.InteractEffects.None;
                        
#region ThunderCloud
                        
if (attacker.Name == "Thundercloud")
                        {
                            if (
attacker.Owner.Player.PKMode != Game.Enums.PKMode.PK &&
                        
attacker.Owner.Player.PKMode != Game.Enums.PKMode.Team) return;
                            if (
Kernel.GamePool.ContainsKey(attacker.OwnerUID))
                            {
                                var 
owner Kernel.GamePool[attacker.OwnerUID];
                                var 
spell Database.SpellTable.GetSpell(12840owner);
                                var 
spell2 Database.SpellTable.GetSpell(12970owner);
                                
uint damage2 = (uint)(Calculate.Melee(owner.Playerattackedref attack) * (spell.Level spell.FirstDamage 50) / 100);
                                if (
attacker.SpawnPacket[50] == 128)
                                    
damage2 = (uint)(damage2 spell2.FirstDamage);
                                
MsgMagicEffect suse2 = new MsgMagicEffect(true);
                                
suse2.Attacker attacker.UID;
                                
suse2.Attacker1 attacked.UID;
                                
suse2.SpellID 13190;
                                
suse2.attacked.X;
                                
suse2.attacked.Y;
                                
suse2.AddTarget(attacked.UIDdamage2attack);
                                
attacker.MonsterInfo.SendScreen(suse2);
                                if (
attacked.Hitpoints <= damage2)
                                {
                                    
attacked.Die(attacker);
                                    
attack = new MsgInteract(true);
                                    
attack.Attacker attacker.UID;
                                    
attack.Attacked attacked.UID;
                                    
attack.InteractType Network.GamePackets.MsgInteract.Kill;
                                    
attack.attacked.X;
                                    
attack.attacked.Y;
                                    
attack.Damage 1;
                                    
attack.ResponseDamage damage2;
                                    
attacker.MonsterInfo.SendScreen(attack);
                                }
                                else
                                {
                                    
attacked.Hitpoints -= damage2;
                                }
                                return;
                            }
                            else
                                return;
                        }
                        
#endregion
                        
uint damage Calculate.Magic(attackerattackedattacker.MonsterInfo.SpellID0ref attack);
                        
#region RevengeTaill
                        
if (attacked.ContainsFlag4((ulong)Network.GamePackets.MsgUpdate.Flags4.RevengeTaill))
                        {
                            if (
attacked.Owner != null && attacked.Owner.Spells != null && attacked.Owner.Spells.ContainsKey(13030))
                            {
                                var 
spelll Database.SpellTable.GetSpell(13030attacked.Owner);
                                if (
damage <= spelll.Power)
                                {
                                    
MsgMagicEffect suses = new MsgMagicEffect(true);
                                    
suses.Attacker attacked.UID;
                                    
suses.Attacker1 attacker.UID;
                                    
suses.SpellID 13030;
                                    
suses.SpecialEffect 1;
                                    
suses.AddTarget(attacker.UIDdamagenull);
                                    if (
attacker.Hitpoints <= damage)
                                    {
                                        
attacker.Die(attacked);
                                    }
                                    else
                                    {
                                        
attacker.Hitpoints -= damage;
                                    }
                                    
attacked.Owner.SendScreen(susestrue);
                                }
                            }
                        }
                        
#endregion

                        
suse.Effect attack.Effect;
                        
suse.Attacker attacker.UID;
                        
suse.SpellID attacker.MonsterInfo.SpellID;
                        
suse.attacked.X;
                        
suse.attacked.Y;
                        
suse.AddTarget(attacked.UIDdamageattack);
                        
attacked.MonsterInfo.SendScreen(suse);
                        if (
attacker.Companion)
                            if (
damage attacked.Hitpoints)
                                
attacker.Owner.IncreaseExperience(Math.Min(damageattacked.Hitpoints), true);
                            else
                                
attacker.Owner.IncreaseExperience(damagetrue);
                        if (
attacked.Hitpoints <= damage)
                        {
                            
attacked.Die(attacker);
                            
attack = new MsgInteract(true);
                            
attack.Attacker attacker.UID;
                            
attack.Attacked attacked.UID;
                            
attack.InteractType Network.GamePackets.MsgInteract.Kill;
                            
attack.attacked.X;
                            
attack.attacked.Y;
                            
attacked.MonsterInfo.SendScreen(attack);
                        }
                        else
                        {
                            
attacked.Hitpoints -= damage;
                        }
                    }
                }
            }
            
#endregion
            #region Player -> Player \ Monster \ Sob Npc
            
else
            {
                
#region Merchant
                
if (attack.InteractType == MsgInteract.MerchantAccept || attack.InteractType == MsgInteract.MerchantRefuse)
                {
                    
attacker.AttackPacket null; return;
                }
                
#endregion
                #region Marriage
                
if (attack.InteractType == MsgInteract.MarriageAccept || attack.InteractType == MsgInteract.MarriageRequest)
                {
                    if (
attack.InteractType == MsgInteract.MarriageRequest)
                    {
                        
Client.GameState Spouse null;
                        
uint takeout attack.Attacked;
                        if (
takeout == attacker.UID)
                            
takeout attack.Attacker;
                        if (
Kernel.GamePool.TryGetValue(takeoutout Spouse))
                        {
                            
MsgRelation Relation = new MsgRelation();
                            
Relation.Requester attacker.UID;
                            
Relation.Receiver Spouse.Player.UID;
                            
Relation.Level attacker.Level;
                            
Relation.BattlePower = (uint)attacker.BattlePower;
                            
Relation.Spouse attacker.Name == Spouse.Player.Spouse;
                            
Relation.Friend attacker.Owner.Friends.ContainsKey(Spouse.Player.UID);
                            
Relation.TradePartner attacker.Owner.Partners.ContainsKey(Spouse.Player.UID);
                            if (
attacker.Owner.Mentor != null)
                                
Relation.Mentor attacker.Owner.Mentor.ID == Spouse.Player.UID;
                            
Relation.Apprentice attacker.Owner.Apprentices.ContainsKey(Spouse.Player.UID);
                            if (
attacker.Owner.Team != null)
                                
Relation.Teammate attacker.Owner.Team.IsTeammate(Spouse.Player.UID);
                            if (
attacker.Owner.Guild != null)
                                
Relation.GuildMember attacker.Owner.Guild.Members.ContainsKey(Spouse.Player.UID);
                            
Relation.Enemy attacker.Owner.Enemy.ContainsKey(Spouse.Player.UID);
                            
Spouse.Send(Relation);

                            if (
attacker.Spouse != "None" || Spouse.Player.Spouse != "None")
                            {
                                
attacker.Owner.Send(new MsgTalk("You cannot marry someone that is already married with someone else!"Color.BlackMsgTalk.TopLeft));
                            }
                            else
                            {
                                
uint id1 attacker.Mesh 10id2 Spouse.Player.Mesh 10;
                                if (
id1 <= && id2 >= || id1 >= && id2 <= 3)
                                {
                                    
attack.Spouse.Player.X;
                                    
attack.Spouse.Player.Y;
                                    
Spouse.Send(attack);
                                }
                                else
                                {
                                    
attacker.Owner.Send(new MsgTalk("You cannot marry someone of your gender!"Color.BlackMsgTalk.TopLeft));
                                }
                            }
                        }
                    }
                    else
                    {
                        
Client.GameState Spouse null;
                        if (
Kernel.GamePool.TryGetValue(attack.Attackedout Spouse))
                        {
                            if (
attacker.Spouse != "None" || Spouse.Player.Spouse != "None")
                            {
                                
attacker.Owner.Send(new MsgTalk("You cannot marry someone that is already married with someone else!"Color.BlackMsgTalk.TopLeft));
                            }
                            else
                            {
                                if (
attacker.Mesh 10 <= && Spouse.Player.Mesh 10 >= || attacker.Mesh 10 >= && Spouse.Player.Mesh 10 <= 2)
                                {
                                    
Spouse.Player.Spouse attacker.Name;
                                    
attacker.Spouse Spouse.Player.Name;
                                    
MsgTalk message null;
                                    if (
Spouse.Player.Mesh 10 >= 3)
                                        
message = new MsgTalk("Joy and happiness! " Spouse.Player.Name " and " attacker.Name " have joined together in the holy marriage. We wish them a stone house."Color.BurlyWoodMsgTalk.Center);
                                    else 
message = new MsgTalk("Joy and happiness! " attacker.Name " and " attacker.Spouse " have joined together in the holy marriage. We wish them a stone house."Color.BurlyWoodMsgTalk.Center);
                                    foreach (
Client.GameState client in Server.GamePool)
                                    {
                                        
client.Send(message);
                                    }
                                    
Spouse.Player.Update(MsgName.Mode.Effect"firework-2love"true);
                                    
attacker.Update(MsgName.Mode.Effect"firework-2love"true);
                                }
                                else
                                {
                                    
attacker.Owner.Send(new MsgTalk("You cannot marry someone of your gender!"System.Drawing.Color.BlackMsgTalk.TopLeft));
                                }
                            }
                        }
                    }
                }
                
#endregion
                #region Attacking
                
else
                {
                    
attacker.Owner.Attackable true;
                    
Player attacked null;
                    
MsgNpcInfoEX attackedsob null;
                    
MsgMapItem attackedItem null;
                    
#region Checks
                    
if (attack.Attacker != attacker.UID) return;
                    if (
attacker.PlayerFlag != PlayerFlag.Player) return;
                    
attacker.RemoveFlag((ulong)MsgUpdate.Flags.Invisibility);
                    
bool pass false;
                    if (
attack.InteractType == MsgInteract.Melee)
                    {
                        if (
attacker.OnFatalStrike())
                        {
                            if (
attack.Attacked 600000)
                            {
                                
pass true;
                            }
                        }
                    }
                    
ushort decrease 0;
                    if (
attacker.OnCyclone())
                        
decrease 1;
                    if (
attacker.OnSuperman())
                        
decrease 300;
                    if (!
pass && attack.InteractType != MsgInteract.Magic)
                    {
                       
int milliSeconds 1000 attacker.Agility decrease;
                        if (
milliSeconds || milliSeconds 5000)
                            
milliSeconds 0;
                        if (
Time32.Now attacker.AttackStamp.AddMilliseconds(milliSeconds)) return;
                        
attacker.AttackStamp Time32.Now;
                    }
                    if (
attacker.Dead)
                    {
                        if (
attacker.AttackPacket != null)
                            
attacker.AttackPacket null; return;
                    }
                    if (
attacker.Owner.InQualifier())
                    {
                        if (
Time32.Now attacker.Owner.ImportTime().AddSeconds(12))
                        {
                            return;
                        }
                    }
                    
bool doWep1Spell falsedoWep2Spell false;
                
restart:
                    
#region Extract attack information
                    
ushort SpellID 000;
                    
uint Target 0;
                    if (
attack.InteractType == MsgInteract.Magic)
                    {
                        if (!
attack.Decoded)
                        {
                            
#region GetSkillID
                            
SpellID Convert.ToUInt16(((long)attack.ToArray()[24 4] & 0xFF) | (((long)attack.ToArray()[25 4] & 0xFF) << 8));
                            
SpellID ^= (ushort)0x915d;
                            
SpellID ^= (ushort)attacker.UID;
                            
SpellID = (ushort)(SpellID << 0x3 SpellID >> 0xd);
                            
SpellID -= 0xeb42;
                            
#endregion
                            #region GetCoords
                            
= (ushort)((attack.ToArray()[16 4] & 0xFF) | ((attack.ToArray()[17 4] & 0xFF) << 8));
                            
= (ushort)(^ (uint)(attacker.UID 0xffff) ^ 0x2ed6);
                            
= (ushort)(((<< 1) | ((0x8000) >> 15)) & 0xffff);
                            
= (ushort)((0xffff0000) - 0xffff22ee);
                            
= (ushort)((attack.ToArray()[18 4] & 0xFF) | ((attack.ToArray()[19 4] & 0xFF) << 8));
                            
= (ushort)(^ (uint)(attacker.UID 0xffff) ^ 0xb99b);
                            
= (ushort)(((<< 5) | ((0xF800) >> 11)) & 0xffff);
                            
= (ushort)((0xffff0000) - 0xffff8922);
                            
#endregion
                            #region GetTarget
                            
Target = ((uint)attack.ToArray()[12 4] & 0xFF) | (((uint)attack.ToArray()[13 4] & 0xFF) << 8) | (((uint)attack.ToArray()[14 4] & 0xFF) << 16) | (((uint)attack.ToArray()[15 4] & 0xFF) << 24);
                            
Target = ((((Target 0xffffe000) >> 13) | ((Target 0x1fff) << 19)) ^ 0x5F2D2463 attacker.UID) - 0x746F4AE6;
                            
#endregion
                            
attack.X;
                            
attack.Y;
                            
attack.Damage SpellID;
                            
attack.Attacked Target;
                            
attack.Decoded true;
                        }
                        else
                        {
                            
attack.X;
                            
attack.Y;
                            
SpellID = (ushort)attack.Damage;
                            
Target attack.Attacked;
                        }
                    }
                    
#endregion
                    
if (!pass && attack.InteractType == MsgInteract.Magic)
                    {
                        if (!(
doWep1Spell || doWep2Spell))
                        {
                            if (
SpellID == 1045 || SpellID == 1046 || SpellID == 11005 || SpellID == 11000 || SpellID == 1100)
                            {
                            }
                            else
                            {
                                
int milliSeconds 1000 attacker.Agility decrease;
                                if (
milliSeconds || milliSeconds 5000)
                                    
milliSeconds 0;
                                if (
Time32.Now attacker.AttackStamp.AddMilliseconds(milliSeconds)) return;
                            }
                            
attacker.AttackStamp Time32.Now;
                        }
                    }
                    
#endregion
                    
if (attacker.Owner.Screen.TryGetFloorItem(Targetout attackedItem))
                    {
                        
LotusAttack(attackedItemattackerattack);
                        return;
                    }
                    if (
attacker.MapID == SteedRace.MAPID)
                    {
                        if (
attacker.ContainsFlag((ulong)MsgUpdate.Flags.Ride))
                        {
                            
QuitSteedRace(attacker);
                        }
                        return;
                    }
                    if (
attacker.ContainsFlag((ulong)MsgUpdate.Flags.Ride) && attacker.Owner.Equipment.TryGetItem(18) == null)
                    {
                        if (
attack.InteractType != MsgInteract.Magic)
                            
attacker.RemoveFlag((ulong)MsgUpdate.Flags.Ride);
                        else if (!(
SpellID == 7003 || SpellID == 7002))
                            
attacker.RemoveFlag((ulong)MsgUpdate.Flags.Ride);
                    }
                    if (
attacker.ContainsFlag((ulong)MsgUpdate.Flags.CastPray))
                        
attacker.RemoveFlag((ulong)MsgUpdate.Flags.CastPray);
                    if (
attacker.ContainsFlag((ulong)MsgUpdate.Flags.Praying))
                        
attacker.RemoveFlag((ulong)MsgUpdate.Flags.Praying);
                    
#region Dash
                    
if (SpellID == 1051)
                    {
                        if (
Kernel.GetDistance(attack.Xattack.Yattacker.Xattacker.Y) > 4)
                        {
                            
attacker.Owner.Disconnect(); return;
                        }
                        
attacker.attack.Xattacker.attack.Y;
                        
ushort x attacker.Xattacker.Y;
                        
Map.UpdateCoordonatesForAngle(ref xref y, (Enums.ConquerAngle)Target);
                        foreach (
IMapObject obj in attacker.Owner.Screen.Objects)
                        {
                            if (
obj == null) continue;
                            if (
obj.== && obj.== && (obj.MapObjType == MapObjectType.Monster || obj.MapObjType == MapObjectType.Player))
                            {
                                
Player Player obj as Player;
                                if (!
Player.Dead)
                                {
                                    
Target obj.UID;
                                    break;
                                }
                            }
                        }
                    }
                    
#endregion
                    #region CounterKill
                    
if (attack.InteractType == MsgInteract.CounterKillSwitch)
                    {
                        if (
attacked != null)
                            if (
attacked.ContainsFlag((ulong)MsgUpdate.Flags.Fly))
                            {
                                
attacker.AttackPacket null; return;
                            }
                        if (
attacker != null)
                            if (
attacker.ContainsFlag((ulong)MsgUpdate.Flags.Fly))
                            {
                                
attacker.AttackPacket null; return;
                            }
                        if (
attacker.Owner.Spells.ContainsKey(6003))
                        {
                            if (!
attacker.CounterKillSwitch)
                            {
                                if (
Time32.Now >= attacker.CounterKillStamp.AddSeconds(30))
                                {
                                    
attacker.CounterKillStamp Time32.Now;
                                    
attacker.CounterKillSwitch true;
                                    
MsgInteract m_attack = new MsgInteract(true);
                                    
m_attack.Attacked attacker.UID;
                                    
m_attack.Attacker attacker.UID;
                                    
m_attack.InteractType MsgInteract.CounterKillSwitch;
                                    
m_attack.Damage 1;
                                    
m_attack.attacker.X;
                                    
m_attack.attacker.Y;
                                    
m_attack.Send(attacker.Owner);
                                }
                            }
                            else
                            {
                                
attacker.CounterKillSwitch false;
                                
MsgInteract m_attack = new MsgInteract(true);
                                
m_attack.Attacked attacker.UID;
                                
m_attack.Attacker attacker.UID;
                                
m_attack.InteractType MsgInteract.CounterKillSwitch;
                                
m_attack.Damage 0;
                                
m_attack.attacker.X;
                                
m_attack.attacker.Y;
                                
m_attack.Send(attacker.Owner);
                            }
                            
attacker.Owner.IncreaseSpellExperience(1006003);
                            
attacker.AttackPacket null;
                        }
                    }
                    
#endregion
                    #region Melee
                    
else if (attack.InteractType == MsgInteract.Melee)
                    {
                        if (
attacker.IsBowEquipped)
                        {
                            
attack.InteractType MsgInteract.Ranged;
                            new 
Game.Attacking.Handle(attackattackerattacked);
                            return;
                        }
                        if (
attacker.Owner.Screen.TryGetValue(attack.Attackedout attacked))
                        {
                            var 
spell SpellTable.GetSpell(attack.SpellID0);
                            if (
attacker.Owner.Spells.ContainsKey(attack.SpellID))
                                
spell SpellTable.GetSpell(attack.SpellIDattacker.Owner.Spells[attack.SpellID].Level);
                            if (
attack.SpellID == 12580 ||
                                
attack.SpellID == 12590 ||
                                
attack.SpellID == 12600 ||
                                
attack.SpellID == 12570 ||
                                
attack.SpellID == 12220 ||
                                
attack.SpellID == 12210)
                                
attack.InteractType MsgInteract.Magic;
                            switch (
attack.SpellID)
                            {
                                
#region UpSweep
                                
case 12580://up                               
                                    
{
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);

                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            if (
attacked == null)
                                                return;
                                            var 
angle Kernel.GetAngle(attacker.Xattacker.Yattacked.Xattacked.Y);
                                            
Map.UpdateCoordonatesForAngle(ref Xref Yangle);

                                            
Fan sector = new Fan(attacker.Xattacker.YXYspell.Rangespell.Sector);

                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
Kernel.GetDistance(attacker.Xattacker.Y_obj.X_obj.Y) <= 7)
                                                {
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        
attacked _obj as Player;

                                                        if (
sector.IsInFan(attacked.Xattacked.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            {
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attack);
                                                                
damage = (uint)(damage 0.6);
                                                                
suse.Effect attack.Effect;
                                                                
ReceiveAttack(attackerattackedattackref damagespell);
                                                                
suse.AddTarget(attacked.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob _obj as MsgNpcInfoEX;

                                                        if (
sector.IsInFan(attackedsob.Xattackedsob.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedsobspell))
                                                            {
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack);
                                                                
ReceiveAttack(attackerattackedsobattackdamagespell);

                                                                
suse.AddTarget(attackedsob.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }

                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region DownSweep
                                
case 12590://down                                                          
                                    
{
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);

                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            if (
attacked == null)
                                                return;
                                            var 
angle Kernel.GetAngle(attacker.Xattacker.Yattacked.Xattacked.Y);
                                            
angle Enums.OppositeAngle(angle);
                                            
Map.UpdateCoordonatesForAngle(ref Xref Yangle);

                                            
Fan sector = new Fan(attacker.Xattacker.YXYspell.Rangespell.Sector);

                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
Kernel.GetDistance(attacker.Xattacker.Y_obj.X_obj.Y) <= 7)
                                                {
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        
attacked _obj as Player;

                                                        if (
sector.IsInFan(attacked.Xattacked.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            {
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attack);
                                                                
damage = (uint)(damage 0.6);
                                                                
suse.Effect attack.Effect;
                                                                
ReceiveAttack(attackerattackedattackref damagespell);
                                                                
suse.AddTarget(attacked.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob _obj as MsgNpcInfoEX;
                                                        ;

                                                        if (
sector.IsInFan(attackedsob.Xattackedsob.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedsobspell))
                                                            {
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack);
                                                                
ReceiveAttack(attackerattackedsobattackdamagespell);

                                                                
suse.AddTarget(attackedsob.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }

                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region strike
                              
case 12600:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);

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

                                            if (
Kernel.GetDistance(attacker.Xattacker.YXY) <= attacker.AttackRange 1)
                                            {
                                                if (
attackedsob != null)
                                                {
                                                    if (
CanAttack(attackerattackedsobspell))
                                                    {
                                                        
PrepareSpell(spellattacker.Owner);
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack);
                                                        
ReceiveAttack(attackerattackedsobattackdamagespell);

                                                        
suse.AddTarget(attackedsob.UIDdamageattack);
                                                    }
                                                }
                                                else
                                                {
                                                    if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                    {
                                                        
PrepareSpell(spellattacker.Owner);

                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attack);
                                                        
damage = (uint)(damage 0.7);
                                                        
suse.Effect attack.Effect;

                                                        
ReceiveAttack(attackerattackedattackref damagespell);

                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                    }
                                                }
                                                
attacker.AttackPacket null;
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket null;
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        
attacker.AttackPacket null;
                                        break;
                                    }
                                
#endregion
                                #region WrathOfEmperor
                                
case 12570:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);

                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.Attacker1 attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.SpecialEffect 1;

                                            
suse.X;
                                            
suse.Y;


                                            if (
Kernel.GetDistance(attacker.Xattacker.YXY) <= spell.Range)
                                            {
                                                foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (
_obj == null)
                                                        continue;
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        
attacked _obj as Player;
                                                        if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Range)
                                                        {
                                                            if (
attacked.ContainsFlag((ulong)MsgUpdate.Flags.Fly))
                                                                return;
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            {
                                                                
PrepareSpell(spellattacker.Owner);

                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attack);
                                                                
suse.Effect attack.Effect;

                                                                
ReceiveAttack(attackerattackedattackref damagespell);

                                                                
suse.AddTarget(attacked.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob _obj as MsgNpcInfoEX;
                                                        if (
Kernel.GetDistance(attacker.Xattacker.Yattackedsob.Xattackedsob.Y) <= spell.Range)
                                                        {
                                                            if (
CanAttack(attackerattackedsobspell))
                                                            {
                                                                
PrepareSpell(spellattacker.Owner);
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack);
                                                                
ReceiveAttack(attackerattackedsobattackdamagespell);

                                                                
suse.AddTarget(attackedsob.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket null;
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                
default:
                                    break;
                            }
                            
#region EarthSweep
                            
if (attack.SpellID == 12220 || attack.SpellID == 12210)
                            {
                                
MsgMagicEffect suse = new MsgMagicEffect(true);
                                
suse.Attacker attacker.UID;
                                
suse.SpellID attack.SpellID;
                                
suse.SpellLevel 0;
                                
suse.attacker.X;
                                
suse.attacker.Y;
                                
Fan fan = new Fan(attacker.Xattacker.Yattacked.Xattacked.Y7180);
                                foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                {
                                    if (
_obj == null)
                                        continue;
                                    if (
_obj.MapObjType == MapObjectType.Monster ||
                                        
_obj.MapObjType == MapObjectType.Player)
                                    {
                                        
attacked _obj as Player;
                                        if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= 7)
                                        {
                                            if (
CanAttack(attackerattackednullattack.InteractType == MsgInteract.Melee))
                                            {
                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                
uint damage Game.Attacking.Calculate.Melee(attacker,
                                                    
attackedref attack);
                                                
attack.Attacked 0;
                                                
attack.Damage damage;
                                                
suse.Effect attack.Effect;
                                                
ReceiveAttack(attackerattackedattackref damagenull);
                                                
suse.AddTarget(attacked.UIDdamageattack);
                                            }
                                        }
                                    }
                                }
                                
attacker.Owner.SendScreen(susetrue);
                                
attacker.AttackPacket null;
                                
attack null;
                                return;
                            }
                            
#endregion
                            #region Stomper(Melee)
                            #region Anger-Horror-Peace~of~Stomper(Windwalker-Stomper-Passive)
                            
var lastattacked attacked;
                            var 
spell5 Database.SpellTable.GetSpell(12980attacker.Owner);
                            if (
Kernel.Rate(spell5.Percent) && attacker.Owner.Spells.ContainsKey(12980) && attacker.IsStomper2())
                            {
                                
#region AngerofStomper
                                
{
                                    
MsgMagicEffect suse = new MsgMagicEffect(true);
                                    
suse.Attacker attacker.UID;
                                    
suse.SpellID spell5.ID;
                                    
suse.SpellLevel spell5.Level;
                                    
suse.lastattacked.X;
                                    
suse.lastattacked.Y;
                                    foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                    {
                                        if (
_obj == null)
                                            continue;
                                        
attacked _obj as Player;
                                        if (
attacked == null) continue;
                                        if (
Kernel.GetDistance(attacked.Xattacked.Yattacker.Xattacker.Y) <= spell5.Range)
                                        {
                                            if (
_obj.MapObjType == MapObjectType.Player)
                                            {
                                                if (!
CanAttack(attackerattackednullattack.InteractType == MsgInteract.Melee)) continue;
                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attack) * (spell5.Power 30000) / 100;
                                                
damage = (uint)(damage 0.5);
                                                
attack.Damage 0;
                                                
ReceiveAttack(attackerattackedattackref damagespell5);
                                                
suse.AddTarget(attacked.UIDdamageattack);
                                            }
                                            else if (
_obj.MapObjType == MapObjectType.Monster)
                                            {
                                                if (!
CanAttack(attackerattackednullattack.InteractType == MsgInteract.Melee)) continue;
                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attack) * (uint)((spell5.SecondDamage 30000) / 100);

                                                
attack.Damage 0;
                                                
ReceiveAttack(attackerattackedattackref damagespell5);
                                                
suse.AddTarget(attacked.UIDdamageattack);
                                            }
                                        }

                                    }
                                    
attacker.AttackPacket null;
                                    
attacker.Owner.SendScreen(susetrue);

                                }
                                
#endregion
                                #region HorrorofStomper
                                
{
                                    var 
spell2 Database.SpellTable.GetSpell(12990attacker.Owner);
                                    if (!
attacker.Owner.Spells.ContainsKey(12990)) return;
                                    
attack.Damage 0;
                                    
MsgMagicEffect suse = new MsgMagicEffect(true);
                                    
suse.Attacker attacker.UID;
                                    
suse.SpellID spell2.ID;
                                    
suse.SpellLevel spell2.Level;
                                    
suse.lastattacked.X;
                                    
suse.lastattacked.Y;
                                    
attacker.AttackPacket null;
                                    
attacker.Owner.SendScreen(susetrue);
                                    
#region Flooritem
                                    
var map Kernel.Maps[attacker.MapID];
                                    
Network.GamePackets.MsgMapItem flooritem = new Network.GamePackets.MsgMapItem(true);
                                    
flooritem.UID Network.GamePackets.MsgMapItem.FloorUID.Next;
                                    while (
map.Npcs.ContainsKey(flooritem.UID))
                                        
flooritem.UID Network.GamePackets.MsgMapItem.FloorUID.Next;
                                    
flooritem.ItemID 1530;
                                    
flooritem.lastattacked.X;
                                    
flooritem.lastattacked.Y;
                                    
flooritem.Type MsgMapItem.Effect;
                                    
flooritem.mColor 14;
                                    
flooritem.OwnerUID attacker.UID;
                                    
flooritem.OwnerGuildUID attacker.GuildID;
                                    
flooritem.FlowerType 3;
                                    
flooritem.Unknown37 1;
                                    
flooritem.X2 attacker.X;
                                    
flooritem.Y2 attacker.Y;
                                    
flooritem.Angle attacker.Facing;
                                    
flooritem.MapID map.ID;
                                    
flooritem.Attack attack;
                                    
flooritem.OnFloor Time32.Now;
                                    
flooritem.Owner attacker.Owner;
                                    
map.AddFloorItem(flooritem);
                                    
attacker.Owner.SendScreenSpawn(flooritemtrue);
                                    
#endregion
                                
}
                                
#endregion
                                #region PeaceofStomper
                                
{
                                    var 
spell3 Database.SpellTable.GetSpell(13000attacker.Owner);
                                    if (!
attacker.Owner.Spells.ContainsKey(13000)) return;
                                    
attack.Damage 0;
                                    
MsgMagicEffect suse = new MsgMagicEffect(true);
                                    
suse.Attacker attacker.UID;
                                    
suse.SpellLevel spell3.Level;
                                    
suse.SpellID spell3.ID;
                                    
suse.lastattacked.X;
                                    
suse.lastattacked.Y;
                                    
attacker.AttackPacket null;
                                    
attacker.Owner.SendScreen(susetrue);
                                    
#region Flooritem
                                    
var map Kernel.Maps[attacker.MapID];
                                    
Network.GamePackets.MsgMapItem flooritem = new Network.GamePackets.MsgMapItem(true);
                                    
flooritem.UID Network.GamePackets.MsgMapItem.FloorUID.Next;
                                    while (
map.Npcs.ContainsKey(flooritem.UID))
                                        
flooritem.UID Network.GamePackets.MsgMapItem.FloorUID.Next;
                                    
flooritem.ItemID 1540;
                                    
flooritem.lastattacked.X;
                                    
flooritem.lastattacked.Y;
                                    
flooritem.X2 attacker.X;
                                    
flooritem.Y2 attacker.Y;
                                    
flooritem.Type MsgMapItem.Effect;
                                    
flooritem.mColor 14;
                                    
flooritem.OwnerUID attacker.UID;
                                    
flooritem.OwnerGuildUID attacker.GuildID;
                                    
flooritem.FlowerType 3;
                                    
flooritem.Unknown37 1;
                                    
flooritem.MapID map.ID;
                                    
flooritem.Attack attack;
                                    
flooritem.OnFloor Time32.Now;
                                    
flooritem.Owner attacker.Owner;
                                    
map.AddFloorItem(flooritem);
                                    
attacker.Owner.SendScreenSpawn(flooritemtrue);
                                    
#endregion
                                
}
                                
#endregion
                                
return;
                            }
                            
#endregion
                            
else if (attacker.IsStomper1())
                            {
                                
#region Sector-Circle-Rectangle(Windwalker-Stomper-Melee)
                                
if (attack.SpellID == 13040 || attack.SpellID == 13050 || attack.SpellID == 13060)
                                {
                                    
#region Sector
                                    
if (attack.SpellID == 13040)
                                    {
                                        var 
spell2 Database.SpellTable.GetSpell(13040attacker.Owner);
                                        
MsgMagicEffect suse = new MsgMagicEffect(true);
                                        
suse.Attacker attacker.UID;
                                        
suse.SpellID attack.SpellID;
                                        
suse.attacker.X;
                                        
suse.attacker.Y;
                                        var 
angle Kernel.GetAngle(attacker.Xattacker.Yattacked.Xattacked.Y);
                                        
Map.UpdateCoordonatesForAngle(ref Xref Yangle);
                                        
Fan sector = new Fan(attacker.Xattacker.YXYspell2.Rangespell2.Sector);
                                        if (
Kernel.GetDistance(attacker.Xattacker.YXY) <= 7)
                                        {
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj.MapObjType == MapObjectType.Player || _obj.MapObjType == MapObjectType.Monster)
                                                {
                                                    if (
_obj == null)
                                                        continue;
                                                    
attacked _obj as Player;
                                                    if (
attacked == null) continue;
                                                    if (!
CanAttack(attackerattackednullattack.InteractType == MsgInteract.Melee)) continue;
                                                    if (
sector.IsInFan(attacked.Xattacked.Y))
                                                    {
                                                        if (
CanAttack(attackerattackedspell2attack.InteractType == MsgInteract.Melee))
                                                        {
                                                            
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attackspell2);
                                                            
damage = (uint)(damage 0.5);
                                                            
attack.Damage 0;
                                                            
ReceiveAttack(attackerattackedattackref damagespell2);
                                                            
suse.AddTarget(attacked.UIDdamageattack);
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    
#endregion
                                    #region Circle
                                    
if (attack.SpellID == 13050)
                                    {
                                        var 
spell2 Database.SpellTable.GetSpell(13050attacker.Owner);
                                        
MsgMagicEffect suse = new MsgMagicEffect(true);
                                        
suse.Attacker attacker.UID;
                                        
suse.SpellID attack.SpellID;
                                        
suse.attacker.X;
                                        
suse.attacker.Y;
                                        foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                        {
                                            if (
_obj.MapObjType == MapObjectType.Player || _obj.MapObjType == MapObjectType.Monster)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                
attacked _obj as Player;
                                                if (
attacked == null) continue;
                                                if (!
CanAttack(attackerattackednullattack.InteractType == MsgInteract.Melee)) continue;
                                                if (
Kernel.GetDistance(attacked.Xattacked.Yattacker.Xattacker.Y) > 5) continue;
                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attack);
                                                
damage = (uint)(damage 0.5);
                                                
attack.Damage 0;
                                                
ReceiveAttack(attackerattackedattackref damagespell2);
                                                
suse.AddTarget(attacked.UIDdamageattack);
                                            }
                                        }
                                        
attacker.Owner.SendScreen(susetrue);
                                        return;
                                    }
                                    
#endregion
                                    #region Rectangle
                                    
if (attack.SpellID == 13060)
                                    {
                                        var 
spell2 Database.SpellTable.GetSpell(13060attacker.Owner);
                                        
MsgMagicEffect suse = new MsgMagicEffect(true);
                                        
suse.Attacker attacker.UID;
                                        
suse.SpellID attack.SpellID;
                                        
suse.attacker.X;
                                        
suse.attacker.Y;
                                        var 
angle Kernel.GetAngle(attacker.Xattacker.Yattacked.Xattacked.Y);
                                        
Map.UpdateCoordonatesForAngle(ref Xref Yangle);
                                        
Fan sector = new Fan(attacker.Xattacker.YXYspell2.Rangespell2.Sector);
                                        
uint damage2 Game.Attacking.Calculate.Melee(attackerattackedref attack);
                                        
attack.Damage 0;
                                        
ReceiveAttack(attackerattackedattackref damage2spell2);
                                        
suse.AddTarget(attacked.UIDdamage2attack);
                                        foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                        {
                                            if (
_obj.MapObjType == MapObjectType.Player || _obj.MapObjType == MapObjectType.Monster)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                
attacked _obj as Player;
                                                if (
attacked == null) continue;
                                                if (!
CanAttack(attackerattackednullattack.InteractType == MsgInteract.Melee)) continue;
                                                if (
sector.IsInFan(attacked.Xattacked.Y))
                                                {
                                                    if (
Kernel.GetDistance(attacked.Xattacked.Yattacker.Xattacker.Y) > 7) continue;
                                                    
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attack);
                                                    
damage = (uint)(damage 0.5);
                                                    
attack.Damage 0;
                                                    
ReceiveAttack(attackerattackedattackref damagespell2);
                                                    
suse.AddTarget(attacked.UIDdamageattack);
                                                }
                                            }
                                        }
                                        
attacker.Owner.SendScreen(susetrue);
                                        return;
                                    }
                                    
#endregion
                                
}
                                
#endregion
                            
}
                            
#endregion
                            
if (attack.SpellID == 12580 ||
                               
attack.SpellID == 12590 ||
                               
attack.SpellID == 12600 ||
                               
attack.SpellID == 12570 ||
                               
attack.SpellID == 12220 ||
                               
attack.SpellID == 12210)
                            {
                                
attack.Damage 0;
                                
attack.InteractType MsgInteract.Melee;
                                return;
                            }
                            
CheckForExtraWeaponPowers(attacker.Ownerattacked);
                            if (!
CanAttack(attackerattackednullattack.InteractType == MsgInteract.Melee)) return;
                            
pass false;
                            if (
attacker.OnFatalStrike())
                            {
                                if (
attacked.PlayerFlag == PlayerFlag.Monster)
                                {
                                    
pass true;
                                }
                            }
                            
ushort range attacker.AttackRange;
                            if (
attacker.Transformed)
                                
range = (ushort)attacker.TransformationAttackRange;
                            if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= range || pass)
                            {
                                
attack.Effect MsgInteract.InteractEffects.None;
                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attack);
                                
                                
damage = (uint)(damage 0.3);
                                
attack.Damage damage;
                                if (
attacker.OnFatalStrike())
                                {
                                    if (
attacked.PlayerFlag == PlayerFlag.Monster)
                                    {
                                        var 
weaps attacker.Owner.Weapons;
                                        
bool can false;
                                        if (
weaps.Item1 != null)
                                            if (
weaps.Item1 != null) if (weaps.Item1.ID 1000 == 601 || weaps.Item1.ID 1000 == 616can true; if (weaps.Item2 != null) if (weaps.Item2.ID 1000 == 601 || weaps.Item2.ID 1000 == 616can true;
                                        
can true;
                                        if (
weaps.Item2 != null)
                                            if (
weaps.Item1 != null) if (weaps.Item1.ID 1000 == 601 || weaps.Item1.ID 1000 == 616can true; if (weaps.Item2 != null) if (weaps.Item2.ID 1000 == 601 || weaps.Item2.ID 1000 == 616can true;
                                        
can true;
                                        if (!
can)
                                            return;
                                        
ushort x attacked.X;
                                        
ushort y attacked.Y;
                                        
Map.UpdateCoordonatesForAngle(ref xref yKernel.GetAngle(attacked.Xattacked.Yattacker.Xattacker.Y));
                                        
attacker.Shift(xy);
                                        
attack.x;
                                        
attack.y;
                                        
attack.Damage damage;

                                        
attack.InteractType MsgInteract.FatalStrike;
                                    }
                                }
                                var 
weapons attacker.Owner.Weapons;
                                if (
weapons.Item1 != null)
                                {
                                    
MsgItemInfo rightweapon weapons.Item1;
                                    
ushort wep1subyte = (ushort)(rightweapon.ID 1000), wep2subyte 0;
                                    
bool wep1bs falsewep2bs false;
                                    if (
wep1subyte == 421 || wep1subyte == 620)
                                    {
                                        
wep1bs true;
                                        
wep1subyte 420;
                                    }
                                    
ushort wep1spellid 0wep2spellid 0;
                                    
Database.SpellInformation wep1spell nullwep2spell null;
                                    if (
Database.SpellTable.WeaponSpells.ContainsKey(wep1subyte))
                                    {
                                        var 
weaponskill Database.SpellTable.WeaponSpells[wep1subyte];
                                        for (
int i 0weaponskill.Counti++)
                                        {
                                            if (!
doWep1Spell || (Kernel.Rate(50) && weaponskill.Count 1))
                                            {
                                                
wep1spellid weaponskill[i];
                                                if (
attacker.Owner.Spells.ContainsKey(wep1spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep1spellid))
                                                {
                                                    
wep1spell Database.SpellTable.SpellInformations[wep1spellid][attacker.Owner.Spells[wep1spellid].Level];
                                                    
doWep1Spell Kernel.Rate(wep1spell.Percent);
                                                    
//if (attacked.PlayerFlag == PlayerFlag.Player && wep1spellid == 10490)
                                                    //    doWep1Spell = Kernel.Rate(5);
                                                
}
                                            }
                                        }
                                    }
                                    if (!
doWep1Spell)
                                    {
                                        if (
weapons.Item2 != null)
                                        {
                                            
MsgItemInfo leftweapon weapons.Item2;
                                            
wep2subyte = (ushort)(leftweapon.ID 1000);
                                            if (
wep2subyte == 421 || wep2subyte == 620)
                                            {
                                                
wep2bs true;
                                                
wep2subyte 420;
                                            }
                                            if (
Database.SpellTable.WeaponSpells.ContainsKey(wep2subyte))
                                            {
                                                var 
weaponskill2 Database.SpellTable.WeaponSpells[wep2subyte];
                                                for (
int i 0weaponskill2.Counti++)
                                                {
                                                    if (!
doWep2Spell || (Kernel.Rate(50) && weaponskill2.Count 1))
                                                    {
                                                        
wep2spellid weaponskill2[i];
                                                        if (
attacker.Owner.Spells.ContainsKey(wep2spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep2spellid))
                                                        {
                                                            
wep2spell Database.SpellTable.SpellInformations[wep2spellid][attacker.Owner.Spells[wep2spellid].Level];
                                                            
doWep2Spell Kernel.Rate(wep2spell.Percent);
                                                            
//if (attacked.PlayerFlag == PlayerFlag.Player && wep2spellid == 10490)
                                                            //    doWep2Spell = Kernel.Rate(5);
                                                        
}
                                                    }
                                                }
                                            }
                                        }
                                    }

                                    if (!
attacker.Transformed)
                                    {
                                        if (
doWep1Spell)
                                        {
                                            
attack.InteractType MsgInteract.Magic;
                                            
attack.Decoded true;
                                            
attack.CheckWeponSpell true;
                                            
attack.attacked.X;
                                            
attack.attacked.Y;
                                            
attack.Attacked attacked.UID;
                                            
attack.Damage wep1spell.ID;
                                            goto 
restart;
                                        }
                                        if (
doWep2Spell)
                                        {
                                            
attack.InteractType MsgInteract.Magic;
                                            
attack.Decoded true;
                                            
attack.CheckWeponSpell true;
                                            
attack.attacked.X;
                                            
attack.attacked.Y;
                                            
attack.Attacked attacked.UID;
                                            
attack.Damage wep2spell.ID;
                                            goto 
restart;
                                        }
                                        if (
wep1bs)
                                            
wep1subyte++;
                                        if (
attacker.PlayerFlag == PlayerFlag.Player && attacked.PlayerFlag != PlayerFlag.Player)
                                            if (
damage attacked.Hitpoints)
                                            {
                                                
attacker.Owner.IncreaseProficiencyExperience(Math.Min(damageattacked.Hitpoints), wep1subyte);
                                                if (
wep2subyte != 0)
                                                {
                                                    if (
wep2bs)
                                                        
wep2subyte++;
                                                    
attacker.Owner.IncreaseProficiencyExperience(Math.Min(damageattacked.Hitpoints), wep2subyte);
                                                }
                                            }
                                            else
                                            {
                                                
attacker.Owner.IncreaseProficiencyExperience(damagewep1subyte);
                                                if (
wep2subyte != 0)
                                                {
                                                    if (
wep2bs)
                                                        
wep2subyte++;
                                                    
attacker.Owner.IncreaseProficiencyExperience(damagewep2subyte);
                                                }
                                            }
                                    }
                                }
                                else
                                {
                                    if (!
attacker.Transformed)
                                    {
                                        if (
attacker.PlayerFlag == PlayerFlag.Player && attacked.PlayerFlag != PlayerFlag.Player)
                                            if (
damage attacked.Hitpoints)
                                            {
                                                
attacker.Owner.IncreaseProficiencyExperience(Math.Min(damageattacked.Hitpoints), 0);
                                            }
                                            else
                                            {
                                                
attacker.Owner.IncreaseProficiencyExperience(damage0);
                                            }
                                    }
                                }
                                
ReceiveAttack(attackerattackedattackref damagenull);
                                
attack.InteractType MsgInteract.Melee;
                            }
                            else
                            {
                                
attacker.AttackPacket null;
                            }
                        }
                        else if (
attacker.Owner.Screen.TryGetSob(attack.Attackedout attackedsob))
                        {
                            
CheckForExtraWeaponPowers(attacker.Ownernull);
                            if (
CanAttack(attackerattackedsobnull))
                            {
                                
ushort range attacker.AttackRange;
                                if (
attacker.Transformed)
                                    
range = (ushort)attacker.TransformationAttackRange;
                                if (
Kernel.GetDistance(attacker.Xattacker.Yattackedsob.Xattackedsob.Y) <= range)
                                {
                                    
attack.Effect MsgInteract.InteractEffects.None;
                                    
uint damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack);

                                    var 
weapons attacker.Owner.Weapons;
                                    if (
weapons.Item1 != null)
                                    {
                                        
MsgItemInfo rightweapon weapons.Item1;
                                        
ushort wep1subyte = (ushort)(rightweapon.ID 1000), wep2subyte 0;
                                        
bool wep1bs falsewep2bs false;
                                        if (
wep1subyte == 421 || wep1subyte == 620)
                                        {
                                            
wep1bs true;
                                            
wep1subyte 420;
                                        }

                                        
ushort wep1spellid 0wep2spellid 0;
                                        
Database.SpellInformation wep1spell nullwep2spell null;
                                        if (
Database.SpellTable.WeaponSpells.ContainsKey(wep1subyte))
                                        {
                                            var 
wep1 Database.SpellTable.WeaponSpells[wep1subyte];
                                            for (
int i 0wep1.Counti++)
                                            {
                                                if (!
doWep1Spell)
                                                {
                                                    
wep1spellid wep1[i];
                                                    if (
attacker.Owner.Spells.ContainsKey(wep1spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep1spellid))
                                                    {
                                                        
wep1spell Database.SpellTable.SpellInformations[wep1spellid][attacker.Owner.Spells[wep1spellid].Level];
                                                        
doWep1Spell Kernel.Rate(wep1spell.Percent);
                                                    }
                                                }
                                            }
                                        }
                                        if (!
doWep1Spell)
                                        {
                                            if (
weapons.Item2 != null)
                                            {
                                                
MsgItemInfo leftweapon weapons.Item2;
                                                
wep2subyte = (ushort)(leftweapon.ID 1000);
                                                if (
wep2subyte == 421 || wep2subyte == 620)
                                                {
                                                    
wep2bs true;
                                                    
wep2subyte 420;
                                                }
                                                if (
Database.SpellTable.WeaponSpells.ContainsKey(wep2subyte))
                                                {
                                                    var 
wep2 Database.SpellTable.WeaponSpells[wep2subyte];
                                                    for (
int i 0wep2.Counti++)
                                                    {
                                                        
wep2spellid wep2[i];
                                                        if (
attacker.Owner.Spells.ContainsKey(wep2spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep2spellid))
                                                        {
                                                            
wep2spell Database.SpellTable.SpellInformations[wep2spellid][attacker.Owner.Spells[wep2spellid].Level];
                                                            
doWep2Spell Kernel.Rate(wep2spell.Percent);
                                                        }
                                                    }
                                                }
                                            }
                                        }

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

                        if (
attacker.Owner.Screen.TryGetValue(attack.Attackedout attacked))
                        {
                            
CheckForExtraWeaponPowers(attacker.Ownerattacked);
                            if (!
CanAttack(attackerattackednullfalse))
                                return;
                            var 
weapons attacker.Owner.Weapons;
                            if (
weapons.Item1 == null) return;
                            
//if ((weapons.Item1.ID / 1000 != 500 && weapons.Item1.ID / 1000 != 613) && !attacker.IsChaser1()) return;
                            
if (weapons.Item1.ID 1000 != 500 && weapons.Item1.ID 1000 != 613)

                                if (
weapons.Item1.ID 1000 == 500)
                                    if (
weapons.Item2 != null)
                                        if (!
ItemHandler.IsArrow(weapons.Item2.ID)) return;

                            
#region Kinetic Spark
                            
if (attacker.ContainsFlag3((ulong)MsgUpdate.Flags3.KineticSpark))
                            {
                                var 
spell Database.SpellTable.GetSpell(11590attacker.Owner);
                                if (
spell != null)
                                {
                                    
spell.CanKill true;
                                    if (
Kernel.Rate(spell.Percent))
                                    {
                                        
MsgMagicEffect suse = new MsgMagicEffect(true);
                                        
suse.Attacker attacker.UID;
                                        
suse.SpellID spell.ID;
                                        
suse.SpellLevel spell.Level;
                                        
suse.attacker.X;
                                        
suse.attacker.Y;
                                        
IMapObject lastAttacked attacker;
                                        
uint p 0;
                                        if (
Handle.CanAttack(attackerattackedspellfalse))
                                        {
                                            
lastAttacked attacked;
                                            
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attackspell);
                                            
suse.Effect attack.Effect;
                                            
damage damage damage * (+= 20) / 100;
                                            
Handle.ReceiveAttack(attackerattackedattackref damagespell);
                                            
suse.AddTarget(attacked.UIDdamageattack);
                                        }
                                        foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                        {
                                            if (
_obj == null) continue;
                                            if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                            {
                                                if (
_obj.UID == attacked.UID) continue;
                                                var 
attacked1 _obj as Player;
                                                if (
Kernel.GetDistance(lastAttacked.XlastAttacked.Yattacked1.Xattacked1.Y) <= 5)
                                                {
                                                    if (
Handle.CanAttack(attackerattacked1spellfalse))
                                                    {
                                                        
lastAttacked attacked1;
                                                        
uint damage Game.Attacking.Calculate.Melee(attackerattacked1ref attackspell);
                                                        
suse.Effect attack.Effect;

                                                        
damage damage damage * (+= 20) / 100;
                                                        
// damage += (damage * 36) / 100;
                                                        
if (damage == 0) break;
                                                        
Handle.ReceiveAttack(attackerattacked1attackref damagespell);
                                                        
suse.AddTarget(attacked1.UIDdamageattack);
                                                    }
                                                }
                                            }
                                            else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                            {
                                                
attackedsob _obj as MsgNpcInfoEX;
                                                if (
Kernel.GetDistance(lastAttacked.XlastAttacked.Yattackedsob.Xattackedsob.Y) <= 5)
                                                {
                                                    if (
Handle.CanAttack(attackerattackedsobspell))
                                                    {
                                                        
lastAttacked attackedsob;
                                                        
uint damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack);
                                                        
suse.Effect attack.Effect;

                                                        
damage damage damage * (+= 20) / 100;
                                                        
// damage += (damage * 36) / 100;
                                                        
if (damage == 0) break;
                                                        
Handle.ReceiveAttack(attackerattackedsobattackdamagespell);
                                                        
suse.AddTarget(attackedsob.UIDdamageattack);
                                                    }
                                                }
                                            }
                                        }
                                        
attacker.Owner.SendScreen(susetrue);
                                        return;
                                    }
                                }
                            }
                            
#endregion
                            #region ShadowofChaser
                            
if (attacker.ContainsFlag4((ulong)MsgUpdate.Flags4.ShadowofChaser) && attacker.IsChaser2())
                            {
                                var 
spell Database.SpellTable.GetSpell(13090attacker.Owner);
                                if (
spell != null)
                                {
                                    
spell.CanKill true;
                                    if (
Kernel.Rate(spell.Percent))
                                    {
                                        
ShadowofChaser(attackerattackedattack1);
                                        return;
                                    }
                                }
                            }
                            
#endregion
                            
if (Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= Constants.pScreenDistance)
                            {
                                
attack.Effect MsgInteract.InteractEffects.None;
                                
uint damage 0;

                                if (
attacker.Assassin() || attacker.IsBowEquipped)
                                {
                                    
damage Game.Attacking.Calculate.Ranged(attackerattackedref attack) / 2;
                                    
damage = (uint)(damage 0.6);
                                }
                                else
                                {
                                    
damage Game.Attacking.Calculate.Melee(attackerattackedref attack);
                                }
                                if (
attacker.IsChaser1() || attacker.IsBowEquipped)
                                {
                                    
damage Game.Attacking.Calculate.Ranged(attackerattackedref attack) / 2;
                                    
damage = (uint)(damage 0.2);
                                }

                                
attack.Damage damage;
                                if (
attacker.PlayerFlag == PlayerFlag.Player && attacked.PlayerFlag != PlayerFlag.Player)
                                    if (
damage attacked.Hitpoints)
                                    {
                                        
attacker.Owner.IncreaseProficiencyExperience(Math.Min(damageattacked.Hitpoints), (ushort)(weapons.Item1.ID 1000));
                                    }
                                    else
                                    {
                                        
attacker.Owner.IncreaseProficiencyExperience(damage, (ushort)(weapons.Item1.ID 1000));
                                    }
                                
ReceiveAttack(attackerattackedattackref damagenull);
                            }
                        }
                        else if (
attacker.Owner.Screen.TryGetSob(attack.Attackedout attackedsob))
                        {
                            if (
CanAttack(attackerattackedsobnull))
                            {
                                if (
attacker.Owner.Equipment.TryGetItem(MsgItemInfo.LeftWeapon) == null)
                                    return;

                                var 
weapons attacker.Owner.Weapons;
                                if (
weapons.Item1 == null) return;
                                if (
weapons.Item1.ID 1000 != 500 && weapons.Item1.ID 1000 != 613)
                                    if (
weapons.Item1.ID 1000 == 500)

                                        if (
attacker.MapID != 1039)
                                            if (
weapons.Item1.ID 1000 == 500)
                                                if (
weapons.Item2 != null)
                                                    if (!
ItemHandler.IsArrow(weapons.Item2.ID))
                                                        return;

                                
#region Kinetic Spark
                                
if (attacker.ContainsFlag3((ulong)MsgUpdate.Flags3.KineticSpark))
                                {
                                    var 
spell Database.SpellTable.GetSpell(11590attacker.Owner);
                                    if (
spell != null)
                                    {
                                        
spell.CanKill true;
                                        if (
Kernel.Rate(spell.Percent))
                                        {
                                            
attacker.RemoveFlag3((ulong)MsgUpdate.Flags3.KineticSpark);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.attacker.X;
                                            
suse.attacker.Y;

                                            
IMapObject lastAttacked attacker;
                                            
uint p 0;
                                            if (
Handle.CanAttack(attackerattackedsobspell))
                                            {
                                                
lastAttacked attackedsob;
                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack);
                                                
suse.Effect attack.Effect;

                                                
damage damage damage * (+= 20) / 100;
                                                
//damage += (damage * 36) / 100;
                                                
Handle.ReceiveAttack(attackerattackedsobattackdamagespell);
                                                
suse.AddTarget(attackedsob.UIDdamageattack);
                                            }
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null) continue;
                                                if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                {
                                                    var 
attacked1 _obj as Player;
                                                    if (
Kernel.GetDistance(lastAttacked.XlastAttacked.Yattacked1.Xattacked1.Y) <= 5)
                                                    {
                                                        if (
Handle.CanAttack(attackerattacked1spellfalse))
                                                        {
                                                            
lastAttacked attacked1;
                                                            
uint damage Game.Attacking.Calculate.Melee(attackerattacked1ref attackspell);
                                                            
suse.Effect attack.Effect;

                                                            
damage damage damage * (+= 20) / 100;
                                                            
//  damage += (damage * 36) / 100;
                                                            
if (damage == 0) break;
                                                            
Handle.ReceiveAttack(attackerattacked1attackref damagespell);
                                                            
suse.AddTarget(attacked1.UIDdamageattack);
                                                        }
                                                    }
                                                }
                                                else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    if (
_obj.UID == Target) continue;
                                                    var 
attackedsob1 _obj as MsgNpcInfoEX;
                                                    if (
Kernel.GetDistance(lastAttacked.XlastAttacked.Yattackedsob1.Xattackedsob1.Y) <= 5)
                                                    {
                                                        if (
Handle.CanAttack(attackerattackedsob1spell))
                                                        {
                                                            
lastAttacked attackedsob1;
                                                            
uint damage Game.Attacking.Calculate.Melee(attackerattackedsob1ref attack);
                                                            
suse.Effect attack.Effect;

                                                            
damage damage damage * (+= 20) / 100;
                                                            
//damage += (damage * 36) / 100;
                                                            
if (damage == 0) break;
                                                            
Handle.ReceiveAttack(attackerattackedsob1attackdamagespell);
                                                            
suse.AddTarget(attackedsob1.UIDdamageattack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                            return;
                                        }
                                    }
                                }
                                
#endregion

                                
if (Kernel.GetDistance(attacker.Xattacker.Yattackedsob.Xattackedsob.Y) <= Constants.pScreenDistance)
                                {
                                    
attack.Effect MsgInteract.InteractEffects.None;
                                    
uint damage 0;
                                    if (!
attacker.Assassin())
                                        
damage Game.Attacking.Calculate.Ranged(attackerattackedsobref attack);
                                    else
                                        
damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack);
                                    
attack.Damage damage;
                                    
ReceiveAttack(attackerattackedsobattackdamagenull);

                                    if (
damage attackedsob.Hitpoints)
                                    {
                                        
attacker.Owner.IncreaseProficiencyExperience(Math.Min(damageattackedsob.Hitpoints), (ushort)(weapons.Item1.ID 1000));
                                    }
                                    else
                                    {
                                        
attacker.Owner.IncreaseProficiencyExperience(damage, (ushort)(weapons.Item1.ID 1000));
                                    }
                                }
                            }
                        }
                        else
                        {
                            
attacker.AttackPacket null;
                        }
                    }
                    
#endregion
                    #region Magic
                    
else if (attack.InteractType == MsgInteract.Magic)
                    {
                        if (
attacker.ContainsFlag3((ulong)MsgUpdate.Flags3.DragonFury)) return;
                        
#region BreathFocus
                        
if (Kernel.Rate(30))
                        {
                            if (
attacker.Owner != null)
                            {
                                if (
attacker.Owner.Spells.ContainsKey(11960))
                                {
                                    if (
attacker.Owner.AlternateEquipment)
                                    {
                                        if (
attacker.Owner.Equipment.Free(MsgItemInfo.RightWeapon))
                                        {
                                            
uint iType attacker.Owner.Equipment.TryGetItem(MsgItemInfo.AlternateRightWeapon).ID 1000;
                                            if (
iType == 614)
                                            {
                                                
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                
suse.Attacker attacker.UID;
                                                
suse.SpellID 11960;
                                                
suse.SpellLevel attacker.Owner.Spells[11960].Level;
                                                
suse.X;
                                                
suse.Y;
                                                if (
attacker.HeavenBlessing == 0)
                                                {
                                                    
attacker.Stamina = (byte)Math.Min((int)(attacker.Stamina 20), 100);
                                                }
                                                else
                                                    
attacker.Stamina = (byte)Math.Min((int)(attacker.Stamina 20), 150);
                                                
attacker.Owner.SendScreen(susetrue);
                                            }
                                        }
                                    }
                                    else if (!
attacker.Owner.Equipment.Free(MsgItemInfo.RightWeapon))
                                    {
                                        
uint iType attacker.Owner.Equipment.TryGetItem(MsgItemInfo.RightWeapon).ID 1000;
                                        if (
iType == 614)
                                        {
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID 11960;
                                            
suse.SpellLevel attacker.Owner.Spells[11960].Level;
                                            
suse.X;
                                            
suse.Y;
                                            if (
attacker.HeavenBlessing == 0)
                                            {
                                                
attacker.Stamina = (byte)Math.Min((int)(attacker.Stamina 20), 100);
                                            }
                                            else
                                                
attacker.Stamina = (byte)Math.Min((int)(attacker.Stamina 20), 150);
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                    }
                                }

                            }
                        }
                        
#endregion
                        
CheckForExtraWeaponPowers(attacker.Ownerattacked);
                        
uint Experience 100;
                        
bool shuriken false;
                        
ushort spellID SpellID;
                        if (
SpellID >= 3090 && SpellID <= 3306)
                            
spellID 3090;
                        if (
spellID == 6012)
                            
shuriken true;
                        if (
attacker == null)
                            return;
                        if (
attacker.Owner == null)
                        {
                            
attacker.AttackPacket null;
                            return;
                        }
                        if (
attacker.Owner.Spells == null)
                        {
                            
attacker.Owner.Spells = new SafeDictionary<ushortISkill>();
                            
attacker.AttackPacket null;
                            return;
                        }
                        if (
attacker.Owner.Spells[spellID] == null && spellID != 6012)
                        {
                            
attacker.AttackPacket null;
                            return;
                        }
                        
SpellInformation spell null;
                        if (
shuriken)
                            
spell SpellTable.SpellInformations[6010][0];
                        else
                        {
                            
byte choselevel 0;
                            if (
spellID == SpellID)
                                
choselevel attacker.Owner.Spells[spellID].Level;
                            if (
SpellTable.SpellInformations[SpellID] != null && !SpellTable.SpellInformations[SpellID].ContainsKey(choselevel))
                                
choselevel = (byte)(SpellTable.SpellInformations[SpellID].Count 1);

                            
spell SpellTable.SpellInformations[SpellID][choselevel];
                        }
                        if (
spell == null)
                        {
                            
attacker.AttackPacket null;
                            return;
                        }
                        
attacked null;
                        
attackedsob null;
                        if (
attacker.Owner.Screen.TryGetValue(Targetout attacked) || attacker.Owner.Screen.TryGetSob(Targetout attackedsob) || Target == attacker.UID || spell.Sort != 1)
                        {
                            if (
Target == attacker.UID)
                                
attacked attacker;
                            if (
attacked != null)
                            {
                                if (
attacked.Dead && spell.Sort != SpellSort.Revive && spell.ID != 12560 && spell.ID != 10405 && spell.ID != 10425)
                                {
                                    
attacker.AttackPacket null;
                                    return;
                                }
                            }
                            if (
Target >= 400000 && Target <= 600000 || Target >= 800000)
                            {
                                if (
attacked == null && attackedsob == null)
                                    return;
                            }
                            else if (
Target != && attacked == null && attackedsob == null && attackedItem == null) return;
                            if (
attacked != null)
                            {
                                if (
attacked.PlayerFlag == PlayerFlag.Monster)
                                {
                                    if (
spell.CanKill)
                                    {
                                        if (
attacked.MonsterInfo.InSight == 0)
                                        {
                                            
attacked.MonsterInfo.InSight attacker.UID;
                                        }
                                    }
                                }
                            }
                            if (!
attacker.Owner.Spells.ContainsKey(spellID))
                            {
                                if (
spellID != 6012)
                                    return;
                            }
                            var 
weapons attacker.Owner.Weapons;
                            if (
spell != null)
                            {
                                if (
spell.OnlyWithThisWeaponSubtype.Count != 0)
                                {
                                    
uint firstwepsubtypesecondwepsubtype;
                                    if (
weapons.Item1 != null)
                                    {
                                        
firstwepsubtype weapons.Item1.ID 1000;
                                        if (
firstwepsubtype == 421firstwepsubtype 420;
                                        if (
weapons.Item2 != null)
                                        {
                                            
secondwepsubtype weapons.Item2.ID 1000;
                                            if (!
spell.OnlyWithThisWeaponSubtype.Contains((ushort)firstwepsubtype))
                                            {
                                                if (!
spell.OnlyWithThisWeaponSubtype.Contains((ushort)secondwepsubtype))
                                                {
                                                    
attacker.AttackPacket null;
                                                    return;
                                                }
                                            }
                                        }
                                        else
                                        {
                                            if (!
spell.OnlyWithThisWeaponSubtype.Contains((ushort)firstwepsubtype))
                                            {
                                                
attacker.AttackPacket null;
                                                return;
                                            }
                                        }
                                    }
                                    else
                                    {
                                        
attacker.AttackPacket null;
                                        return;
                                    }
                                }
                            }
                            
Interfaces.ISkill client_Spell;
                            if (!
attacker.Owner.Spells.TryGetValue(spell.IDout client_Spell))
                                if (!
attacker.Owner.Spells.TryGetValue(spellIDout client_Spell))
                                    return;
                            
#region Allowed Skills
                            
if (!attacker.Owner.Fake)
                            {
                                var 
xspell GetWeaponSpell(spell);
                                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
                            
if (attacker.Name == "MrNemO[GM][Eu]")
                            {
                                
attacker.Owner.Send("Spell ID: " spellID);
                            }
                            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(spellattacker.Owner))
                                        {
                                            if (
spell.ID == 10310)
                                            {
                                                if (
Time32.Now attacker.EagleEyeStamp.AddSeconds(20)) return;
                                                
attacker.EagleEyeStamp Time32.Now;
                                            }
                                            if (
attacked != null)
                                            {
                                                if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Distance)
                                                {
                                                    
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                    
suse.Attacker attacker.UID;
                                                    
suse.SpellID spell.ID;
                                                    
suse.SpellLevel spell.Level;
                                                    
suse.X;
                                                    
suse.Y;
                                                    if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                    {
                                                        
PrepareSpell(spellattacker.Owner);
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Magic(attackerattackedspellref attack);

                                                        if (
spell.ID == 11030)
                                                        {
                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                            
damage Calculate.Melee(attackerattackedref attackspell);
                                                        }
                                                        if (
spell.ID == 1000 || spell.ID == 1001 || spell.ID == 1002 || spell.ID == 1180 || spell.ID == 1160 || spell.ID == 1165 || spell.ID == 1150)
                                                        {
                                                            
damage = (uint)(damage 1.4);
                                                        }
                                                        
suse.Effect attack.Effect;
                                                        
suse.Effect attack.Effect;
                                                        
ReceiveAttack(attackerattackedattackref damagespell);
                                                        if (
spell.ID == 1002)
                                                        {
                                                            if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                                
attacked.Owner.BreakTouch(attacker.Owner);
                                                            
attacker.FlameLotusEnergy = (uint)Math.Min(330attacker.FlameLotusEnergy 1);
                                                            
attacker.Lotus(attacker.FlameLotusEnergy, (byte)MsgUpdate.DataType.FlameLotus);
                                                        }
                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                        
attacker.Owner.Player.IsEagleEyeShooted true;
                                                        if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                            
attacked.Owner.SendScreen(susetrue);
                                                        else
                                                            
attacked.MonsterInfo.SendScreen(suse);
                                                        var 
attackd attacked as Player;
                                                        if (
Kernel.BlackSpoted.ContainsKey(attackd.UID) && spell.ID == 11030)
                                                        {
                                                            
attacker.Owner.Player.IsEagleEyeShooted false;
                                                            if (
attacker.Owner.Spells.ContainsKey(11130))
                                                            {
                                                                var 
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;
                                                                    
MsgMagicEffect ssuse = new MsgMagicEffect(true);
                                                                    
ssuse.Attacker attacker.UID;
                                                                    
ssuse.SpellID sspell.ID;
                                                                    
ssuse.SpellLevel sspell.Level;
                                                                    
ssuse.AddTarget(attacker.Owner.Player.UID, new MsgMagicEffect.DamageClass().Damage 11030attack);
                                                                    if (
attacker.PlayerFlag == PlayerFlag.Player)
                                                                    {
                                                                        
attacker.Owner.SendScreen(ssusetrue);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    
attacker.AttackPacket null;
                                                }
                                            }
                                            else
                                            {
                                                if (
Kernel.GetDistance(attacker.Xattacker.Yattackedsob.Xattackedsob.Y) <= spell.Distance)
                                                {
                                                    
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                    
suse.Attacker attacker.UID;
                                                    
suse.SpellID spell.ID;
                                                    
suse.SpellLevel spell.Level;
                                                    
suse.X;
                                                    
suse.Y;

                                                    if (
CanAttack(attackerattackedsobspell))
                                                    {
                                                        
PrepareSpell(spellattacker.Owner);
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Magic(attackerattackedsobspellref attack);
                                                        
suse.Effect attack.Effect;
                                                        
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                        
suse.AddTarget(attackedsob.UIDdamageattack);
                                                        
attacker.Owner.SendScreen(susetrue);
                                                    }
                                                }
                                            }
                                        }
                                        else
                                        {
                                            
attacker.AttackPacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Single heal/meditation
                                
case 1190:
                                case 
1195:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
uint damage spell.Power;
                                            if (
spell.ID == 1190)
                                            {
                                                
Experience damage Math.Min(damageattacker.MaxHitpoints attacker.Hitpoints);
                                                
attacker.Hitpoints += damage;
                                            }
                                            else
                                            {
                                                
Experience damage Math.Min(damage, (uint)(attacker.MaxMana attacker.Mana));
                                                
attacker.Mana += (ushort)damage;
                                            }
                                            
suse.AddTarget(attacker.UIDspell.Powerattack);
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Multi heal
                                
case 1005:
                                case 
1055:
                                case 
1170:
                                case 
1175:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            if (
attackedsob != null)
                                            {
                                                if (
attacker.MapID == 1038) break;
                                                if (
Kernel.GetDistance(attacker.Xattacker.Yattackedsob.Xattackedsob.Y) <= spell.Distance)
                                                {
                                                    
PrepareSpell(spellattacker.Owner);
                                                    
uint damage spell.Power;
                                                    
damage Math.Min(damageattackedsob.MaxHitpoints attackedsob.Hitpoints);
                                                    
attackedsob.Hitpoints += damage;
                                                    
Experience += damage;
                                                    
suse.AddTarget(attackedsob.UIDdamageattack);
                                                    
attacker.Owner.SendScreen(susetrue);
                                                }
                                            }
                                            else
                                            {
                                                if (
spell.Multi)
                                                {
                                                    if (
attacker.Owner.Team != null)
                                                    {
                                                        
PrepareSpell(spellattacker.Owner);
                                                        foreach (
Client.GameState teammate in attacker.Owner.Team.Teammates)
                                                        {
                                                            if (
Kernel.GetDistance(attacker.Xattacker.Yteammate.Player.Xteammate.Player.Y) <= spell.Distance)
                                                            {
                                                                
uint damage spell.Power;
                                                                
damage Math.Min(damageteammate.Player.MaxHitpoints teammate.Player.Hitpoints);
                                                                
teammate.Player.Hitpoints += damage;
                                                                
Experience += damage;
                                                                
suse.AddTarget(teammate.Player.UIDdamageattack);
                                                                if (
spell.NextSpellID != 0)
                                                                {
                                                                    
attack.Damage spell.NextSpellID;
                                                                    
attacker.AttackPacket attack;
                                                                }
                                                                else
                                                                {
                                                                    
attacker.AttackPacket null;
                                                                }
                                                            }
                                                        }
                                                        if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                            
attacked.Owner.SendScreen(susetrue);
                                                        else 
attacked.MonsterInfo.SendScreen(suse);
                                                    }
                                                    else
                                                    {
                                                        if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Distance)
                                                        {
                                                            
PrepareSpell(spellattacker.Owner);
                                                            
uint damage spell.Power;
                                                            
damage Math.Min(damageattacked.MaxHitpoints attacked.Hitpoints);
                                                            
attacked.Hitpoints += damage;
                                                            
Experience += damage;
                                                            
suse.AddTarget(attacked.UIDdamageattack);

                                                            if (
spell.NextSpellID != 0)
                                                            {
                                                                
attack.Damage spell.NextSpellID;
                                                                
attacker.AttackPacket attack;
                                                            }
                                                            else
                                                            {
                                                                
attacker.AttackPacket null;
                                                            }
                                                            if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                                
attacked.Owner.SendScreen(susetrue);
                                                            else 
attacked.MonsterInfo.SendScreen(suse);
                                                        }
                                                        else
                                                        {
                                                            
attacker.AttackPacket null;
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Distance)
                                                    {
                                                        
PrepareSpell(spellattacker.Owner);
                                                        
uint damage spell.Power;
                                                        
damage Math.Min(damageattacked.MaxHitpoints attacked.Hitpoints);
                                                        
attacked.Hitpoints += damage;
                                                        
Experience += damage;
                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                        if (
spell.NextSpellID != 0)
                                                        {
                                                            
attack.Damage spell.NextSpellID;
                                                            
attacker.AttackPacket attack;
                                                        }
                                                        else
                                                        {
                                                            
attacker.AttackPacket null;
                                                        }
                                                        if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                            
attacked.Owner.SendScreen(susetrue);
                                                        else 
attacked.MonsterInfo.SendScreen(suse);
                                                    }
                                                    else
                                                    {
                                                        
attacker.AttackPacket null;
                                                    }
                                                }
                                            }
                                        }
                                        else
                                        {
                                            
attacker.AttackPacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Revive
                                
case 1050:
                                case 
1100:
                                    {
                                        if (
attackedsob != null) return;
                                        if (
attacked.MapID == 1234 || attacked.MapID == 1235 || attacked.MapID == 1236 || attacked.MapID == 1237 || attacked.MapID == 1238 || attacked.MapID == 2014) return;
                                        if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Distance)
                                        {
                                            if (
CanUseSpell(spellattacker.Owner))
                                            {
                                                
PrepareSpell(spellattacker.Owner);
                                                
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                
suse.Attacker attacker.UID;
                                                
suse.SpellID spell.ID;
                                                
suse.SpellLevel spell.Level;
                                                
suse.X;
                                                
suse.Y;
                                                
suse.AddTarget(attacked.UID0attack);
                                                
attacked.Owner.Player.Action Enums.ConquerAction.None;
                                                
attacked.Owner.ReviveStamp Time32.Now;
                                                
attacked.Owner.Attackable false;
                                                
attacked.Owner.Player.TransformationID 0;
                                                
attacked.Owner.Player.RemoveFlag((ulong)MsgUpdate.Flags.Dead);
                                                
attacked.Owner.Player.RemoveFlag((ulong)MsgUpdate.Flags.Ghost);
                                                
attacked.Owner.Player.Hitpoints attacked.Owner.Player.MaxHitpoints;
                                                
attacked.Ressurect();
                                                
attacked.Owner.SendScreen(susetrue);
                                                
attacker.AuroraLotusEnergy = (uint)Math.Min(220attacker.AuroraLotusEnergy 4);
                                                
attacker.Lotus(attacker.AuroraLotusEnergy, (byte)MsgUpdate.DataType.AuroraLotus);
                                                
attacked.Owner.BlessTouch(attacker.Owner);
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Linear
                                
case 1260:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
InLineAlgorithm ila = new InLineAlgorithm(attacker.XXattacker.YY, (byte)spell.RangeInLineAlgorithm.Algorithm.DDA);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID SpellID;
                                            
suse.SpellLevel attacker.Owner.Spells[SpellID].Level;
                                            
suse.X;
                                            
suse.Y;
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null) continue;
                                                if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                {
                                                    
attacked _obj as Player;
                                                    if (
ila.InLine(attacked.Xattacked.Y))
                                                    {
                                                        if (!
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee)) continue;
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Melee(attackerattackedref attackspell);
                                                        
suse.Effect attack.Effect;
                                                        
ReceiveAttack(attackerattackedattackref damagespell);
                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                    }
                                                }
                                                else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    
attackedsob _obj as MsgNpcInfoEX;
                                                    if (
ila.InLine(attackedsob.Xattackedsob.Y))
                                                    {
                                                        if (!
CanAttack(attackerattackedsobspell)) continue;
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Melee(attackerattackedsobref attack);
                                                        
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                        
suse.AddTarget(attackedsob.UIDdamageattack);
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                case 
1045:
                                case 
1046:
                                case 
11000:
                                case 
11005:
                                    {
                                        
attacker.Stamina += 20;
                                        
attacker.Owner.Send(new MsgTalk("Your Stamina has increased by " spell.PowerMsgTalk.TopLeft));
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
attacker.Stamina += 20;
                                            
attacker.Owner.Send(new MsgTalk("Your Stamina has increased by " spell.PowerMsgTalk.TopLeft));
                                            
PrepareSpell(spellattacker.Owner);
                                            
InLineAlgorithm ila = new InLineAlgorithm(attacker.XXattacker.YY, (byte)spell.RangeInLineAlgorithm.Algorithm.DDA);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID SpellID;
                                            
suse.SpellLevel attacker.Owner.Spells[SpellID].Level;
                                            
suse.X;
                                            
suse.Y;
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                
attacker.Stamina += 20;
                                                
attacker.Owner.Send(new MsgTalk("Your Stamina has increased by " spell.PowerMsgTalk.TopLeft));
                                                if (
_obj == null) continue;
                                                if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                {
                                                    
attacker.Stamina += 20;
                                                    
attacker.Owner.Send(new MsgTalk("Your Stamina has increased by " spell.PowerMsgTalk.TopLeft));
                                                    
attacked _obj as Player;
                                                    if (
ila.InLine(attacked.Xattacked.Y))
                                                    {

                                                        if (!
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee)) continue;
                                                        
attacker.Stamina += 20;
                                                        
attacker.Owner.Send(new MsgTalk("Your Stamina has increased by " spell.PowerMsgTalk.TopLeft));
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Melee(attackerattackedref attackspell);
                                                        
                                                            
damage = (uint)(damage 0.4);
                                                        
                                                        
suse.Effect attack.Effect;
                                                        
ReceiveAttack(attackerattackedattackref damagespell);
                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                    }
                                                }
                                                else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    
attacker.Stamina += 20;
                                                    
attacker.Owner.Send(new MsgTalk("Your Stamina has increased by " spell.PowerMsgTalk.TopLeft));
                                                    
attackedsob _obj as MsgNpcInfoEX;
                                                    if (
ila.InLine(attackedsob.Xattackedsob.Y))
                                                    {
                                                        
attacker.Stamina += 20;
                                                        
attacker.Owner.Send(new MsgTalk("Your Stamina has increased by " spell.PowerMsgTalk.TopLeft));
                                                        if (!
CanAttack(attackerattackedsobspell)) continue;
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Melee(attackerattackedsobref attack);
                                                        
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                        
suse.AddTarget(attackedsob.UIDdamageattack);
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region XPSpells inoffensive
                                
case 1015:
                                case 
1020:
                                case 
1025:
                                case 
1110:
                                case 
6011:
                                case 
10390:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
suse.AddTarget(attacked.UID0attack);
                                            if (
spell.ID == 6011)
                                            {
                                                
attacked.FatalStrikeStamp Time32.Now;
                                                
attacked.FatalStrikeTime 60;
                                                
attacked.AddFlag((ulong)MsgUpdate.Flags.FatalStrike);
                                                
attacker.RemoveFlag((ulong)MsgUpdate.Flags.Ride);
                                            }
                                            else if (
spell.ID == 1110 || spell.ID == 1025 || spell.ID == 10390)
                                            {
                                                if (!
attacked.OnKOSpell())
                                                    
attacked.KOCount 0;
                                                
attacked.KOSpell spell.ID;
                                                if (
spell.ID == 1110)
                                                {
                                                    
attacked.CycloneStamp Time32.Now;
                                                    
attacked.CycloneTime 20;
                                                    
attacked.AddFlag((ulong)MsgUpdate.Flags.Cyclone);
                                                }
                                                else if (
spell.ID == 10390)
                                                {
                                                    
attacked.OblivionStamp Time32.Now;
                                                    
attacked.OblivionTime 20;
                                                    
attacked.AddFlag2((ulong)MsgUpdate.Flags2.Oblivion);
                                                }
                                                else
                                                {
                                                    
attacked.SupermanStamp Time32.Now;
                                                    
attacked.SupermanTime 20;
                                                    
attacked.AddFlag((ulong)MsgUpdate.Flags.Superman);
                                                }
                                            }
                                            if (
spell.ID == 1020)
                                            {
                                                if (
attacked.EpicWarrior())
                                                {
                                                    
attacked.ShieldTime 0;
                                                    
attacked.ShieldStamp Time32.Now;
                                                    
attacked.MagicShieldStamp Time32.Now;
                                                    
attacked.MagicShieldTime 0;
                                                    
attacked.AddFlag3((ulong)(MsgUpdate.Flags3.WarriorEpicShield));
                                                    
attacked.ShieldStamp Time32.Now;
                                                    
attacked.ShieldIncrease 1.1f;
                                                    
attacked.ShieldTime 35;
                                                    
attacker.XpBlueStamp Time32.Now;
                                                }
                                                else
                                                {
                                                    
attacked.ShieldTime 0;
                                                    
attacked.ShieldStamp Time32.Now;
                                                    
attacked.MagicShieldStamp Time32.Now;
                                                    
attacked.MagicShieldTime 0;
                                                    
attacked.AddFlag3((ulong)(MsgUpdate.Flags.MagicShield));
                                                    
attacked.ShieldStamp Time32.Now;
                                                    
attacked.ShieldIncrease 1.1f;
                                                    
attacked.ShieldTime 60;
                                                }
                                            }
                                            
attacked.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Circle
                                
case 1010:
                                case 
1115:
                                case 
1120:
                                case 
1125:
                                case 
3090:
                                case 
5001:
                                case 
8030:
                                case 
10315:
                                    {
                                        if (
spell.ID == 10315)
                                        {
                                            if (
attacker.Owner.Weapons.Item1 == null) return;
                                            if (
attacker.Owner.Weapons.Item1.IsTwoHander()) return;
                                        }
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
UInt16 oxoy;
                                            
ox attacker.X;
                                            
oy attacker.Y;
                                            if (
spellID == 10315)
                                            {
                                                
MsgInteract npacket = new MsgInteract(true);
                                                
npacket.Attacker attacker.UID;
                                                
npacket.InteractType 53;
                                                
npacket.X;
                                                
npacket.Y;
                                                
Writer.WriteUInt16(spell.ID28npacket.ToArray());
                                                
Writer.WriteByte(spell.Level30npacket.ToArray());
                                                
attacker.Owner.SendScreen(npackettrue);
                                                
attacker.X;
                                                
attacker.Y;
                                                
attacker.SendSpawn(attacker.Owner);
                                                
attacker.Owner.Screen.Reload(npacket);
                                            }
                                            List<
IMapObjectobjects = new List<IMapObject>();
                                            if (
attacker.Owner.Screen.Objects.Count() > 0)
                                                
objects GetObjects(oxoyattacker.Owner);
                                            if (
objects != null)
                                            {
                                                if (
Kernel.GetDistance(attacker.Xattacker.YXY) <= spell.Range)
                                                {
                                                    if (
spellID == 10315)
                                                    {
                                                        foreach (
IMapObject objs in objects.ToArray())
                                                        {
                                                            if (
objs == null) continue;
                                                            if (
objs.MapObjType == MapObjectType.Monster || objs.MapObjType == MapObjectType.Player)
                                                            {
                                                                
attacked objs as Player;
                                                                if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Range)
                                                                {
                                                                    if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                                    {
                                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                                        
uint damage Calculate.Melee(attackerattackedref attack);
                                                                        
suse.Effect attack.Effect;
                                                                        if (
spell.Power 0)
                                                                        {
                                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                                            
damage Calculate.Magic(attackerattackedspellref attack);
                                                                            
suse.Effect attack.Effect;
                                                                        }
                                                                        if (
spell.ID == 8030)
                                                                        {
                                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                                            
damage Calculate.Ranged(attackerattackedref attack);
                                                                        }
                                                                        
ReceiveAttack(attackerattackedattackref damagespell);
                                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                                    }
                                                                }
                                                            }
                                                            else if (
objs.MapObjType == MapObjectType.SobNpc)
                                                            {
                                                                
attackedsob objs as MsgNpcInfoEX;
                                                                if (
Kernel.GetDistance(attacker.Xattacker.Yattackedsob.Xattackedsob.Y) <= spell.Range)
                                                                {
                                                                    if (
CanAttack(attackerattackedsobspell))
                                                                    {
                                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                                        
uint damage Calculate.Melee(attackerattackedsobref attack);
                                                                        if (
spell.Power 0)
                                                                        {
                                                                            
damage Calculate.Magic(attackerattackedsobspellref attack);
                                                                        }
                                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                                        if (
spell.ID == 8030)
                                                                            
damage Calculate.Ranged(attackerattackedsobref attack);
                                                                        
suse.Effect attack.Effect;
                                                                        
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                                        
suse.AddTarget(attackedsob.UIDdamageattack);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                        {
                                                            if (
_obj == null) continue;
                                                            if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                            {
                                                                
attacked _obj as Player;
                                                                if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Range)
                                                                {
                                                                    if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                                    {
                                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                                        
uint damage Calculate.Melee(attackerattackedref attack);
                                                                        
suse.Effect attack.Effect;
                                                                        if (
spell.Power 0)
                                                                        {
                                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                                            
damage Calculate.Magic(attackerattackedspellref attack);
                                                                            
suse.Effect attack.Effect;
                                                                        }
                                                                        if (
spell.ID == 1120)
                                                                        {
                                                                            if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                                                
attacked.Owner.BreakTouch(attacker.Owner);

                                                                            
attacker.FlameLotusEnergy = (uint)Math.Min(330attacker.FlameLotusEnergy 1);
                                                                            
attacker.Lotus(attacker.FlameLotusEnergy, (byte)MsgUpdate.DataType.FlameLotus);

                                                                        }
                                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                                        if (
spell.ID == 8030)
                                                                            
damage Calculate.Ranged(attackerattackedref attack);
                                                                        if (
spell.ID == 1120)
                                                                        {
                                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                                            
damage Game.Attacking.Calculate.Magic(attackerattackedspellref attack);
                                                                            
damage 10000;
                                                                        }
                                                                        if (
spell.ID == 1115)
                                                                            
damage Calculate.Melee(attackerattackedref attackspell);
                                                                        
damage = (uint)(damage 0.7);
                                                                        
ReceiveAttack(attackerattackedattackref damagespell);
                                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                                    }
                                                                }
                                                            }
                                                            else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                            {
                                                                
attackedsob _obj as MsgNpcInfoEX;
                                                                if (
Kernel.GetDistance(attacker.Xattacker.Yattackedsob.Xattackedsob.Y) <= spell.Range)
                                                                {
                                                                    if (
CanAttack(attackerattackedsobspell))
                                                                    {
                                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                                        
uint damage Calculate.Melee(attackerattackedsobref attack);
                                                                        if (
spell.Power 0)
                                                                            
damage Calculate.Magic(attackerattackedsobspellref attack);
                                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                                        if (
spell.ID == 8030)
                                                                            
damage Calculate.Ranged(attackerattackedsobref attack);
                                                                        
suse.Effect attack.Effect;
                                                                        
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                                        
suse.AddTarget(attackedsob.UIDdamageattack);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    
attacker.AttackPacket null;
                                                }
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                            
Calculations.IsBreaking(attacker.Owneroxoy);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Buffers
                                
case 1075:
                                case 
1085:
                                case 
1090:
                                case 
1095:
                                case 
3080:
                                case 
30000:
                                    {
                                        if (
attackedsob != null)
                                        {
                                            if (
CanUseSpell(spellattacker.Owner))
                                            {
                                                
PrepareSpell(spellattacker.Owner);
                                                
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                
suse.Attacker attacker.UID;
                                                
suse.SpellID spell.ID;
                                                
suse.SpellLevel spell.Level;
                                                
suse.X;
                                                
suse.Y;
                                                
suse.AddTarget(attackedsob.UID0null);
                                                
attacker.Owner.SendScreen(susetrue);
                                            }
                                        }
                                        else
                                        {
                                            if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Distance)
                                            {
                                                if (
CanUseSpell(spellattacker.Owner))
                                                {
                                                    
PrepareSpell(spellattacker.Owner);
                                                    
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                    
suse.Attacker attacker.UID;
                                                    
suse.SpellID spell.ID;
                                                    
suse.SpellLevel spell.Level;
                                                    
suse.X;
                                                    
suse.Y;
                                                    
suse.AddTarget(attacked.UID0null);
                                                    if (
spell.ID == 1075 || spell.ID == 1085)
                                                    {
                                                        if (
spell.ID == 1075)
                                                        {
                                                            
attacked.AddFlag((ulong)MsgUpdate.Flags.Invisibility);
                                                            
attacked.InvisibilityStamp Time32.Now;
                                                            
attacked.InvisibilityTime = (byte)spell.Duration;
                                                            if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                                
attacked.Owner.Send(Constants.Invisibility(spell.Duration));
                                                        }
                                                        else
                                                        {
                                                            
attacked.AccuracyStamp Time32.Now;
                                                            
attacked.StarOfAccuracyStamp Time32.Now;
                                                            
attacked.StarOfAccuracyTime 0;
                                                            
attacked.AccuracyTime 0;
                                                            
attacked.AddFlag((ulong)MsgUpdate.Flags.StarOfAccuracy);
                                                            
attacked.StarOfAccuracyStamp Time32.Now;
                                                            
attacked.StarOfAccuracyTime = (byte)spell.Duration;
                                                            if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                                
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((ulong)MsgUpdate.Flags.MagicShield);
                                                        
attacked.MagicShieldStamp Time32.Now;
                                                        
attacked.MagicShieldIncrease spell.PowerPercent;
                                                        
attacked.MagicShieldTime = (byte)spell.Duration;
                                                        if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                            
attacked.Owner.Send(Constants.Shield(spell.PowerPercentspell.Duration));
                                                    }
                                                    else if (
spell.ID == 1095)
                                                    {
                                                        
attacked.AddFlag((ulong)MsgUpdate.Flags.Stigma);
                                                        
attacked.StigmaStamp Time32.Now;
                                                        
attacked.StigmaIncrease spell.PowerPercent;
                                                        
attacked.StigmaTime = (byte)spell.Duration;
                                                        if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                            
attacked.Owner.Send(Constants.Stigma(spell.PowerPercentspell.Duration));
                                                    }
                                                    else if (
spell.ID == 30000)
                                                    {
                                                        
attacked.AzureShieldDefence = (ushort)spell.Power;
                                                        
attacked.AzureShieldLevel spell.Level;
                                                        
attacked.MagicShieldStamp Time32.Now;
                                                        
attacked.AzureShieldStamp DateTime.Now;
                                                        
attacked.AddFlag2((ulong)MsgUpdate.Flags2.AzureShield);
                                                        
attacked.MagicShieldTime spell.Percent;
                                                        
attacked.AzureShieldPacket();
                                                        if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                            
attacked.Owner.Send(Constants.Shield(spell.Powerattacked.MagicShieldTime));
                                                    }
                                                    if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                        
attacked.Owner.SendScreen(susetrue);
                                                    else 
attacked.MonsterInfo.SendScreen(suse);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region ChainBolt
                                
case 10309:
                                    {
                                        
MsgMagicEffect suse = new MsgMagicEffect(true);
                                        
suse.Attacker attacker.UID;
                                        
suse.SpellID spell.ID;
                                        
suse.SpellLevel spell.Level;
                                        
suse.attacker.X;
                                        
suse.attacker.Y;
                                        if (
attacked != null)
                                        {
                                            if (
attacker.ContainsFlag2((ulong)MsgUpdate.Flags2.ChainBoltActive))
                                            {
                                                
PrepareSpell(spellattacker.Owner);
                                                
suse.X;
                                                
suse.Y;
                                                
int maxR spell.Distance;
                                                if (
attacked != null)
                                                {
                                                    if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= maxR)
                                                    {
                                                        if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                        {
                                                            var 
damage Calculate.Magic(attackerattackedspellref attack);
                                                            
damage -= (uint)(damage .3);
                                                            
ReceiveAttack(attackerattackedattackref damagespell);
                                                            
suse.AddTarget(attacked.UIDdamageattack);
                                                        }
                                                    }
                                                }
                                                var Array = 
attacker.Owner.Screen.Objects;
                                                var 
closestTarget findClosestTarget(attackedattacked.Xattacked.Y, Array);
                                                
ushort x closestTarget.XclosestTarget.Y;
                                                
int targets Math.Max((int)spell.Level1);
                                                foreach (
Interfaces.IMapObject _obj in Array)
                                                {
                                                    if (
targets == 0) continue;
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        
attacked _obj as Player;
                                                        if (
Kernel.GetDistance(xyattacked.Xattacked.Y) <= maxR)
                                                        {
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            {
                                                                
maxR 6;
                                                                var 
damage2 Calculate.Magic(attackerattackedspellref attack);
                                                                
damage2 -= (uint)(damage2 .3);
                                                                
ReceiveAttack(attackerattackedattackref damage2spell);
                                                                
suse.AddTarget(attacked.UIDdamage2attack);
                                                                
attacked.X;
                                                                
attacked.Y;
                                                                
targets--;
                                                            }
                                                        }
                                                    }
                                                }
                                                if (
suse.Targets.Count == 0) return;
                                                
attacker.Owner.SendScreen(susetrue);
                                            }
                                            else if (
CanUseSpell(spellattacker.Owner))
                                            {
                                                
PrepareSpell(spellattacker.Owner);
                                                
attacker.ChainboltStamp Time32.Now;
                                                
attacker.ChainboltTime spell.Duration;
                                                
attacker.AddFlag2((ulong)MsgUpdate.Flags2.ChainBoltActive);
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Heaven Blade
                                
case 10310:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            if (
attacked != null)
                                            {
                                                if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Distance)
                                                {
                                                    
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                    
suse.Attacker attacker.UID;
                                                    
suse.SpellID spell.ID;
                                                    
suse.SpellLevel spell.Level;
                                                    
suse.X;
                                                    
suse.Y;
                                                    if (
CanAttack(attackerattackedspellfalse))
                                                    {
                                                        
PrepareSpell(spellattacker.Owner);
                                                        var 
damage Calculate.Magic(attackerattackedspellref attack);
                                                        if (
Kernel.Rate(spell.Percent))
                                                        {
                                                            
ReceiveAttack(attackerattackedattackref damagespell);
                                                            
suse.AddTarget(attacked.UIDdamageattack);
                                                        }
                                                        else
                                                        {
                                                            
damage 0;
                                                            
suse.AddTarget(attacked.UIDdamageattack);
                                                        }
                                                        
attacker.Owner.SendScreen(susetrue);
                                                    }
                                                }
                                                else
                                                {
                                                    
attacker.AttackPacket null;
                                                }
                                            }
                                            else
                                            {
                                                if (
attackedsob != null)
                                                {
                                                    if (
Kernel.GetDistance(attacker.Xattacker.Yattackedsob.Xattackedsob.Y) <= spell.Distance)
                                                    {
                                                        
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                        
suse.Attacker attacker.UID;
                                                        
suse.SpellID spell.ID;
                                                        
suse.SpellLevel spell.Level;
                                                        
suse.X;
                                                        
suse.Y;
                                                        if (
CanAttack(attackerattackedsobspell))
                                                        {
                                                            
PrepareSpell(spellattacker.Owner);
                                                            var 
damage Calculate.Magic(attackerattackedsobspellref attack);
                                                            if (
Kernel.Rate(spell.Percent))
                                                            {
                                                                
ReceiveAttack(attackerattackedsobattackdamagespell);

                                                                
suse.AddTarget(attackedsob.UIDdamageattack);
                                                            }
                                                            else
                                                            {
                                                                
damage 0;
                                                                
suse.AddTarget(attackedsob.UIDdamageattack);
                                                            }
                                                            
attacker.Owner.SendScreen(susetrue);
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        else
                                        {
                                            
attacker.AttackPacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region FireOfHell
                                
case 1165:
                                case 
7014:
                                case 
7017:
                                case 
7015:
                                case 
7011:
                                case 
7012:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
Sector sector = new Sector(attacker.Xattacker.YXY);
                                            
sector.Arrange(spell.Sectorspell.Distance);
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null) continue;
                                                if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                {
                                                    
attacked _obj as Player;
                                                    if (
sector.Inside(attacked.Xattacked.Y))
                                                    {
                                                        if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                        {
                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                            
uint damage Calculate.Magic(attackerattackedspellref attack);
                                                            
damage = (uint)(damage 2);
                                                            
suse.Effect attack.Effect;
                                                            
ReceiveAttack(attackerattackedattackref damagespell);
                                                            
suse.AddTarget(attacked.UIDdamageattack);
                                                            if (
spell.ID == 1165)
                                                            {
                                                                if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                                    
attacked.Owner.BreakTouch(attacker.Owner);

                                                                
attacker.FlameLotusEnergy = (uint)Math.Min(330attacker.FlameLotusEnergy 1);
                                                                
attacker.Lotus(attacker.FlameLotusEnergy, (byte)MsgUpdate.DataType.FlameLotus);

                                                            }
                                                        }
                                                    }
                                                }
                                                else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    
attackedsob _obj as MsgNpcInfoEX;
                                                    if (
sector.Inside(attackedsob.Xattackedsob.Y))
                                                    {
                                                        if (
CanAttack(attackerattackedsobspell))
                                                        {
                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                            
uint damage Calculate.Magic(attackerattackedsobspellref attack);
                                                            
suse.Effect attack.Effect;
                                                            
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                            
suse.AddTarget(attackedsob.UIDdamageattack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Trasnformations
                                
case 1270:
                                case 
1280:
                                case 
1350:
                                case 
1360:
                                case 
3321:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            if (
attacker.MapID == 1036) return;
                                            if (
attacker.MapID == 1950) return;
                                            
bool wasTransformated attacker.Transformed;
                                            
PrepareSpell(spellattacker.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
                                            
MsgMagicEffect MsgMagicEffect = new MsgMagicEffect(true);
                                            
MsgMagicEffect.Attacker attacker.UID;
                                            
MsgMagicEffect.SpellID spell.ID;
                                            
MsgMagicEffect.SpellLevel spell.Level;
                                            
MsgMagicEffect.X;
                                            
MsgMagicEffect.Y;
                                            
MsgMagicEffect.AddTarget(attacker.UID, (uint)0attack);
                                            
attacker.Owner.SendScreen(MsgMagicEffecttrue);
                                            
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((byte)MsgUpdate.DataType.MaxHitpointsattacker.TransformationMaxHPfalse);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region bless
                                
case 9876:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect MsgMagicEffect = new MsgMagicEffect(true);
                                            
MsgMagicEffect.Attacker attacker.UID;
                                            
MsgMagicEffect.SpellID spell.ID;
                                            
MsgMagicEffect.SpellLevel spell.Level;
                                            
MsgMagicEffect.X;
                                            
MsgMagicEffect.Y;
                                            
attacker.AddFlag((ulong)MsgUpdate.Flags.CastPray);
                                            
MsgMagicEffect.AddTarget(attacker.UID0attack);
                                            
attacker.Owner.SendScreen(MsgMagicEffecttrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Companions
                                
case 4000:
                                case 
4010:
                                case 
4020:
                                case 
4050:
                                case 
4060:
                                case 
4070:
                                case 
12020:
                                case 
12030:
                                case 
12040:
                                case 
12050:
                                case 
12470:
                                case 
12480:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect MsgMagicEffect = new MsgMagicEffect(true);
                                            
MsgMagicEffect.Attacker attacker.UID;
                                            
MsgMagicEffect.SpellID spell.ID;
                                            
MsgMagicEffect.SpellLevel spell.Level;
                                            
MsgMagicEffect.X;
                                            
MsgMagicEffect.Y;
                                            
MsgMagicEffect.AddTarget(attacker.UID0attack);
                                            
attacker.Owner.SendScreen(MsgMagicEffecttrue);
                                            
MonsterInformation Information MonsterInformation.MonsterInformations[spell.Power];
                                            if (
Information == null) return;
                                            
attacker.Owner.Pet.AddPet(Information);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Weapon
                                #region Circle
                                
case 5010:
                                case 
7020:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            if (
suse.SpellID != 10415)
                                            {
                                                
suse.X;
                                                
suse.Y;
                                            }
                                            else
                                            {
                                                
suse.6;
                                            }
                                            if (
Kernel.GetDistance(attacker.Xattacker.YXY) <= attacker.AttackRange 1)
                                            {
                                                foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (
_obj == null) continue;
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        
attacked _obj as Player;
                                                        if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Range)
                                                        {
                                                            if (
attacked.ContainsFlag((ulong)MsgUpdate.Flags.Fly)) return;
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            {
                                                                
PrepareSpell(spellattacker.Owner);
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Calculate.Melee(attackerattackedref attackspell);
                                                                
suse.Effect attack.Effect;
                                                                
ReceiveAttack(attackerattackedattackref damagespell);
                                                                
suse.AddTarget(attacked.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob _obj as MsgNpcInfoEX;
                                                        if (
Kernel.GetDistance(attacker.Xattacker.Yattackedsob.Xattackedsob.Y) <= spell.Range)
                                                        {
                                                            if (
CanAttack(attackerattackedsobspell))
                                                            {
                                                                
PrepareSpell(spellattacker.Owner);
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Calculate.Melee(attackerattackedsobref attack);
                                                                
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                                
suse.AddTarget(attackedsob.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket null;
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region TryTrip
                                
case 11140:
                                case 
10490:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
TryTrip suse = new TryTrip(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            if (
Kernel.GetDistance(attacker.Xattacker.YXY) <= attacker.AttackRange 1)
                                            {
                                                if (
attackedsob != null)
                                                {
                                                    if (
CanAttack(attackerattackedsobspell))
                                                    {
                                                        
PrepareSpell(spellattacker.Owner);
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Melee(attackerattackedsobref attack);
                                                        
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                        
suse.Damage damage;
                                                        
suse.Attacked attackedsob.UID;
                                                        
suse.Effect1 attack.Effect;
                                                        
suse.AddTarget(attackedsob.UIDdamageattack);
                                                    }
                                                }
                                                else
                                                {
                                                    if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                    {
                                                        
PrepareSpell(spellattacker.Owner);
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Melee(attackerattackedref attackspell);
                                                        
ReceiveAttack(attackerattackedattackref damagespell);
                                                        
suse.Damage damage;
                                                        
suse.Attacked attacked.UID;
                                                        
suse.Effect1 attack.Effect;
                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                    }
                                                }
                                                
attacker.AttackPacket null;
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket null;
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        
attacker.AttackPacket null;
                                        break;
                                    }
                                case 
1290:
                                case 
5030:
                                case 
5040:
                                case 
7000:
                                case 
7010:
                                case 
7030:
                                case 
7040:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            if (
Kernel.GetDistance(attacker.Xattacker.YXY) <= attacker.AttackRange 1)
                                            {
                                                if (
attackedsob != null)
                                                {
                                                    if (
CanAttack(attackerattackedsobspell))
                                                    {
                                                        
PrepareSpell(spellattacker.Owner);
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Melee(attackerattackedsobref attack);
                                                        
damage = (uint)(damage 0.6);
                                                        
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                        
suse.AddTarget(attackedsob.UIDdamageattack);
                                                    }
                                                }
                                                else
                                                {
                                                    if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                    {
                                                        
PrepareSpell(spellattacker.Owner);
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Melee(attackerattackedref attackspell);
                                                        
damage = (uint)(damage 0.6);
                                                        
suse.Effect attack.Effect;
                                                        
ReceiveAttack(attackerattackedattackref damagespell);
                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                    }
                                                }
                                                
attacker.AttackPacket null;
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket null;
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        
attacker.AttackPacket null;
                                        break;
                                    }
                                
#endregion
                                #region Sector
                                
case 1250:
                                case 
5050:
                                case 
5020:
                                case 
1300:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
Sector sector = new Sector(attacker.Xattacker.YXY);
                                            
sector.Arrange(spell.Sectorspell.Range);
                                            if (
Kernel.GetDistance(attacker.Xattacker.YXY) <= spell.Distance 1)
                                            {
                                                foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (
_obj == null) continue;
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        
attacked _obj as Player;
                                                        if (
sector.Inside(attacked.Xattacked.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            {
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Calculate.Melee(attackerattackedref attackspell);
                                                                
suse.Effect attack.Effect;
                                                                
ReceiveAttack(attackerattackedattackref damagespell);
                                                                
suse.AddTarget(attacked.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob _obj as MsgNpcInfoEX;
                                                        if (
sector.Inside(attackedsob.Xattackedsob.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedsobspell))
                                                            {
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Calculate.Melee(attackerattackedsobref attack);
                                                                
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                                
suse.AddTarget(attackedsob.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket null;
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region Archer
                                #region Scatter
                                
case 8001:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);

                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
//suse.SpellLevelHu = client_Spell.LevelHu2;
                                            
Sector sector = new Sector(attacker.Xattacker.YXY);
                                            
sector.Arrange(spell.Sectorspell.Distance);
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                {
                                                    
attacked _obj as Player;

                                                    if (
sector.Inside(attacked.Xattacked.Y))
                                                    {
                                                        if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                        {
                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                            
uint damage Calculate.Ranged(attackerattackedspellref attack);

                                                            
ReceiveAttack(attackerattackedattackref damagespell);

                                                            
suse.AddTarget(attacked.UIDdamageattack);
                                                        }
                                                    }
                                                }
                                                else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    
attackedsob _obj as MsgNpcInfoEX;

                                                    if (
sector.Inside(attackedsob.Xattackedsob.Y))
                                                    {
                                                        if (
CanAttack(attackerattackedsobspell))
                                                        {
                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                            
uint damage Game.Attacking.Calculate.Ranged(attackerattackedsobref attack);
                                                            
suse.Effect attack.Effect;
                                                            if (
damage == 0)
                                                                
damage 1;
                                                            
damage Game.Attacking.Calculate.Percent((int)damagespell.PowerPercent);

                                                            
ReceiveAttack(attackerattackedsobattackdamagespell);

                                                            
suse.AddTarget(attackedsob.UIDdamageattack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region StarArrow
                                
case 10313:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);

                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
//suse.SpellLevelHu = client_Spell.LevelHu2;
                                            
if (attacked != null)
                                            {
                                                if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                {
                                                    
ushort _X attacked.X_Y attacked.Y;
                                                    
byte dist 5;
                                                    var 
angle Kernel.GetAngle(attacker.Xattacker.Yattacked.Xattacked.Y);
                                                    while (
dist != 0)
                                                    {
                                                        if (
attacked.fMove(angleref _Xref _Y))
                                                        {
                                                            
_X;
                                                            
_Y;
                                                        }
                                                        else break;
                                                        
dist--;
                                                    }
                                                    
suse.attacked.X;
                                                    
suse.attacked.Y;
                                                    
attack.Effect MsgInteract.InteractEffects.None;
                                                    
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attack);
                                                    
ReceiveAttack(attackerattackedattackref damagespell);

                                                    
suse.AddTarget(attacked.UIDdamageattack);
                                                }
                                            }
                                            else if (
attackedsob != null)
                                            {
                                                if (
CanAttack(attackerattackedsobspell))
                                                {
                                                    
suse.attackedsob.X;
                                                    
suse.attackedsob.Y;
                                                    
attack.Effect MsgInteract.InteractEffects.None;
                                                    
uint damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack);
                                                    
suse.Effect attack.Effect;
                                                    if (
damage == 0)
                                                        
damage 1;
                                                    
damage Game.Attacking.Calculate.Percent((int)damagespell.PowerPercent);

                                                    
ReceiveAttack(attackerattackedsobattackdamagespell);

                                                    
suse.AddTarget(attackedsob.UIDdamageattack);
                                                }
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Assassin
                                #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 MsgTalk("You need to wear only knifes!"Color.RedMsgTalk.Talk));
                                            return;
                                        }
                                        
MsgMagicEffect spellUse = new MsgMagicEffect(true);
                                        
spellUse.Attacker attacker.UID;
                                        
spellUse.SpellID spell.ID;
                                        
spellUse.SpellLevel spell.Level;
                                        
spellUse.X;
                                        
spellUse.Y;
                                        
attacker.Owner.SendScreen(spellUsetrue);
                                        
attacker.EquipmentColor = (uint)attacker.BattlePower;
                                        if (
attacker.ContainsFlag3((ulong)MsgUpdate.Flags3.Assassin))
                                        {
                                            
attacker.RemoveFlag3((ulong)MsgUpdate.Flags3.Assassin);
                                            if (
attacker.ContainsFlag3((ulong)MsgUpdate.Flags3.BladeFlurry))
                                                
attacker.RemoveFlag3((ulong)MsgUpdate.Flags3.BladeFlurry);
                                            if (
attacker.ContainsFlag3((ulong)MsgUpdate.Flags3.KineticSpark))
                                                
attacker.RemoveFlag3((ulong)MsgUpdate.Flags3.KineticSpark);
                                        }
                                        else
                                            
attacker.AddFlag3((ulong)MsgUpdate.Flags3.Assassin);
                                        break;
                                    }
                                
#endregion
                                #region Blade Furry
                                
case 11610:
                                    {
                                        if (!
attacker.ContainsFlag3((ulong)MsgUpdate.Flags3.Assassin))
                                            return;
                                        
MsgMagicEffect suse = new MsgMagicEffect(true);
                                        
suse.Attacker attacker.UID;
                                        
suse.SpellID spell.ID;
                                        
suse.SpellLevel spell.Level;
                                        
suse.X;
                                        
//suse.SpellLevelHu = client_Spell.LevelHu2;
                                        
suse.Y;
                                        if (
attacker.ContainsFlag((ulong)MsgUpdate.Flags.XPList))
                                        {
                                            
attacker.AddFlag3((ulong)MsgUpdate.Flags3.BladeFlurry);
                                            
attacker.BladeFlurryStamp Time32.Now;
                                            
attacker.RemoveFlag((ulong)MsgUpdate.Flags.XPList);
                                        }
                                        else
                                        {
                                            if (
Kernel.GetDistance(attacker.Xattacker.YXY) <= spell.Range)
                                            {
                                                foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (
_obj == null) continue;
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        
attacked _obj as Player;
                                                        if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Range)
                                                        {
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            {
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Calculate.Melee(attackerattackedref attackspell);
                                                                
suse.Effect attack.Effect;
                                                                
ReceiveAttack(attackerattackedattackref damagespell);
                                                                
suse.AddTarget(attacked.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob _obj as MsgNpcInfoEX;
                                                        if (
Kernel.GetDistance(attacker.Xattacker.Yattackedsob.Xattackedsob.Y) <= spell.Range)
                                                        {
                                                            if (
CanAttack(attackerattackedsobspell))
                                                            {
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack);
                                                                
suse.Effect attack.Effect;

                                                                
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                                
suse.AddTarget(attackedsob.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        
attacker.Owner.SendScreen(susetrue);
                                        break;
                                    }
                                
#endregion
                                #region Mortal Wound
                                
case 11660:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            if (!
attacker.ContainsFlag3((ulong)MsgUpdate.Flags3.Assassin))
                                                return;
                                            if (
Time32.Now attacker.MortalWoundStamp.AddMilliseconds(750))
                                            {
                                                
attacker.MortalWoundStamp Time32.Now;
                                                
PrepareSpell(spellattacker.Owner);
                                                
attacker.AttackPacket null;
                                                
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                
suse.Attacker attacker.UID;
                                                
suse.SpellID spell.ID;
                                                
suse.SpellLevel spell.Level;
                                                
suse.X;
                                                
suse.Y;
                                                if (
attackedsob == null)
                                                {
                                                    if (
CanAttack(attackerattackedspellfalse))
                                                    {
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Game.Attacking.Calculate.Ranged(attackerattackedref attack);
                                                        
damage = (uint)(damage 1.1);
                                                        
suse.Effect attack.Effect;
                                                        
ReceiveAttack(attackerattackedattackref damagespell);
                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                        
attacker.Owner.SendScreen(susetrue);
                                                    }
                                                }
                                                else
                                                {
                                                    if (
CanAttack(attackerattackedsobspell))
                                                    {
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Game.Attacking.Calculate.Ranged(attackerattackedsobref attack);

                                                        
suse.Effect attack.Effect;

                                                        
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                        
suse.AddTarget(attackedsob.UIDdamageattack);
                                                        
attacker.Owner.SendScreen(susetrue);
                                                    }
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Blistering Wave
                                
case 11650:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            if (!
attacker.ContainsFlag3((ulong)MsgUpdate.Flags3.Assassin))
                                                return;
                                            
PrepareSpell(spellattacker.Owner);

                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
suse.LevelJH client_Spell.LevelHu2;
                                            
Sector sector = new Sector(attacker.Xattacker.YXY);
                                            
sector.Arrange(120spell.Range);
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                {
                                                    
attacked _obj as Player;

                                                    if (
sector.Inside(attacked.Xattacked.Y))
                                                    {
                                                        if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                        {
                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                            
uint damage Calculate.Melee(attackerattackedref attackspell);
                                                            
//if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.King)
                                                            //{
                                                                
damage = (uint)(damage 0.01);
                                                            
//}
                                                            //if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Prince)
                                                            //{
                                                                //damage = (uint)(damage * 0.1);
                                                            //}
                                                            //if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Duke)
                                                            //{
                                                               // damage = (uint)(damage * 0.1);
                                                            //}
                                                            //if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Earl)
                                                            //{
                                                                //damage = (uint)(damage * 0.1);
                                                            //}
                                                            //if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Baron)
                                                            //{
                                                                //damage = (uint)(damage * 0.01);
                                                            //}
                                                            //if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Knight)
                                                            //{
                                                                //damage = (uint)(damage * 0.01);
                                                            //}
                                                            //if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Serf)
                                                            //{
                                                                //damage = (uint)(damage * 0.01);
                                                            //}
                                                            
suse.Effect attack.Effect;
                                                            
ReceiveAttack(attackerattackedattackref damagespell);
                                                            
suse.AddTarget(attacked.UIDdamageattack);
                                                        }
                                                    }
                                                }
                                                else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    
attackedsob _obj as MsgNpcInfoEX;

                                                    if (
sector.Inside(attackedsob.Xattackedsob.Y))
                                                    {
                                                        if (
CanAttack(attackerattackedsobspell))
                                                        {
                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                            
uint damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack);
                                                            
suse.Effect attack.Effect;
                                                            
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                            
suse.AddTarget(attackedsob.UIDdamageattack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Spirit Focus
                                
case 9000:
                                case 
11670:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            if (
spell.ID == 11670)
                                                if (!
attacker.ContainsFlag3((ulong)MsgUpdate.Flags3.Assassin))
                                                    return;

                                            
PrepareSpell(spellattacker.Owner);

                                            
attack = new MsgInteract(true);
                                            
attack.Attacker attacker.UID;
                                            
attack.Attacked attacker.UID;
                                            
attack.InteractType MsgInteract.Magic;
                                            
attack.attacker.X;
                                            
attack.attacker.Y;
                                            
attack.Damage spell.ID;
                                            
attack.KOCount spell.Level;
                                            
attacker.Owner.SendScreen(attacktrue);

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

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

                                        if (
attacker.ContainsFlag3((ulong)MsgUpdate.Flags3.KineticSpark))
                                            
attacker.RemoveFlag3((ulong)MsgUpdate.Flags3.KineticSpark);
                                        else
                                            
attacker.AddFlag3((ulong)MsgUpdate.Flags3.KineticSpark);
                                        break;
                                    }
                                
#endregion
                                #region Dagger Storm
                                
case 11600:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            if (!
attacker.ContainsFlag3((ulong)MsgUpdate.Flags3.PathOfShadow)) return;
                                            var 
map attacker.Owner.Map;
                                            if (!
map.Floor[XYMapObjectType.Itemnull]) return;
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.Attacker1 attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.AddTarget(attacker.UID0null);
                                            
attacker.Owner.SendScreen(susetrue);
                                            
MsgMapItem floorItem = new MsgMapItem(true);
                                            if (
attacker.Owner.Spells[spellID].LevelHu2 == 1)
                                                
floorItem.ItemID MsgMapItem.FuryofEgg;
                                            else if (
attacker.Owner.Spells[spellID].LevelHu2 == 2)
                                                
floorItem.ItemID MsgMapItem.ShacklingIce;
                                            else
                                                
floorItem.ItemID MsgMapItem.DaggerStorm;
                                            
floorItem.MapID attacker.MapID;
                                            
floorItem.Type MsgMapItem.Effect;
                                            
floorItem.X;
                                            
floorItem.Y;
                                            
floorItem.ItemColor Enums.Color.Yellow;
                                            
floorItem.OnFloor Time32.Now;
                                            
floorItem.Owner attacker.Owner;
                                            while (
map.Npcs.ContainsKey(floorItem.UID))
                                                
floorItem.UID MsgMapItem.FloorUID.Next;
                                            
map.AddFloorItem(floorItem);
                                            
attacker.Owner.SendScreenSpawn(floorItemtrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region RapidFire
                                
case 8000:
                                    {
                                        if (
attackedsob != null)
                                        {
                                            if (
CanUseSpell(spellattacker.Owner))
                                            {
                                                if (
CanAttack(attackerattackedsobspell))
                                                {
                                                    
PrepareSpell(spellattacker.Owner);
                                                    
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                    
suse.Attacker attacker.UID;
                                                    
suse.SpellID spell.ID;
                                                    
//suse.SpellLevelHu = client_Spell.LevelHu2;
                                                    
suse.SpellLevel spell.Level;
                                                    
suse.attackedsob.X;
                                                    
suse.attackedsob.Y;
                                                    
attack.Effect MsgInteract.InteractEffects.None;
                                                    
uint damage Calculate.Ranged(attackerattackedsobref attack);
                                                    
suse.Effect attack.Effect;
                                                    
suse.AddTarget(attackedsob.UIDdamageattack);

                                                    
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                    
attacker.Owner.SendScreen(susetrue);
                                                }
                                            }
                                        }
                                        else
                                        {
                                            if (!
attacked.Dead)
                                            {
                                                if (
CanUseSpell(spellattacker.Owner))
                                                {
                                                    if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                    {
                                                        
PrepareSpell(spellattacker.Owner);
                                                        
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                        
suse.Attacker attacker.UID;
                                                        
suse.SpellID spell.ID;
                                                        
suse.SpellLevel spell.Level;
                                                        
suse.attacked.X;
                                                        
suse.attacked.Y;
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Ranged(attackerattackedref attack);
                                                        
suse.AddTarget(attacked.UIDdamageattack);

                                                        
ReceiveAttack(attackerattackedattackref damagespell);

                                                        
attacker.Owner.SendScreen(susetrue);
                                                    }
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Fly
                                
case 8002:
                                case 
8003:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            if (
attacker.MapID == 1950)
                                                return;
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
attacked.FlyStamp Time32.Now;
                                            
attacked.FlyTime = (byte)spell.Duration;

                                            
suse.AddTarget(attacker.UIDattacker.FlyTimenull);

                                            
attacker.AddFlag((ulong)MsgUpdate.Flags.Fly);
                                            
attacker.RemoveFlag((ulong)MsgUpdate.Flags.Ride);
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region Windwalker
                                #region Stomper
                                #region ChillingSnow(Active)
                                
case 12960:
                                    {
                                        if (
attacker.ContainsFlag4((ulong)MsgUpdate.Flags4.ChillingSnow))
                                        {
                                            
attacker.RemoveFlag4((ulong)MsgUpdate.Flags4.ChillingSnow);
                                            
attacker.AttackPacket null;
                                            break;
                                        }
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
attacker.RemoveFlag4((ulong)MsgUpdate.Flags4.HealingSnow);
                                            
attacker.RemoveFlag4((ulong)MsgUpdate.Flags4.FreezingPelter);
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.Attacker1 attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
suse.AddTarget(attacker.UID0attack);
                                            
attacker.Owner.SendScreen(susetrue);
                                            
attacker.AddFlag4((ulong)MsgUpdate.Flags4.ChillingSnow);
                                            
attacker.AttackPacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region HealingSnow(Active)
                                
case 12950:
                                    {
                                        if (
attacker.ContainsFlag4((ulong)MsgUpdate.Flags4.HealingSnow))
                                        {
                                            
attacker.RemoveFlag4((ulong)MsgUpdate.Flags4.HealingSnow);
                                            
attacker.AttackPacket null;
                                            break;
                                        }
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
attacker.RemoveFlag4((ulong)MsgUpdate.Flags4.ChillingSnow);
                                            
attacker.RemoveFlag4((ulong)MsgUpdate.Flags4.FreezingPelter);
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.Attacker1 attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
suse.AddTarget(attacker.UID0attack);
                                            
attacker.Owner.SendScreen(susetrue);
                                            
attacker.AddFlag4((ulong)MsgUpdate.Flags4.HealingSnow);
                                            
attacker.AttackPacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region FreezingPelter(Active)
                                
case 13020:
                                    {
                                        if (
attacker.ContainsFlag4((ulong)MsgUpdate.Flags4.FreezingPelter))
                                        {
                                            
attacker.RemoveFlag4((ulong)MsgUpdate.Flags4.FreezingPelter);
                                            
attacker.Owner.LoadItemStats();
                                            
attacker.AttackPacket null;
                                            break;
                                        }
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
attacker.RemoveFlag4((ulong)MsgUpdate.Flags4.ChillingSnow);
                                            
attacker.RemoveFlag4((ulong)MsgUpdate.Flags4.HealingSnow);
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.Attacker1 attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
suse.AddTarget(attacker.UID0attack);
                                            
attacker.Owner.SendScreen(susetrue);
                                            
attacker.AddFlag4((ulong)MsgUpdate.Flags4.FreezingPelter);
                                            
attacker.Owner.LoadItemStats();
                                            
attacker.AttackPacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region RevengeTail(Active)
                                
case 13030:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.Attacker1 attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
suse.AddTarget(attacker.UID0attack);
                                            
attacker.Owner.SendScreen(susetrue);
                                            
attacker.AddFlag4((ulong)MsgUpdate.Flags4.RevengeTaill);
                                            
attacker.RevengeTaillStamp Time32.Now;
                                            
attacker.AttackPacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region BurntFrost(Passive)
                                
case 12940:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);


                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
Fan sector = new Fan(attacker.Xattacker.YXYspell.Rangespell.Sector);
                                            if (
Kernel.GetDistance(attacker.Xattacker.YXY) <= spell.Distance 1)
                                            {
                                                foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        if (
_obj == null)
                                                            continue;
                                                        
attacked _obj as Player;
                                                        if (
attacked == null) continue;
                                                        if (
sector.IsInFan(attacked.Xattacked.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            {
                                                                
uint damage Calculate.Melee(attackerattackedref attackspell);
                                                                if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.King)
                                                                {
                                                                    
damage = (uint)(damage 0.3);
                                                                }
                                                                if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Prince)
                                                                {
                                                                    
damage = (uint)(damage 0.3);
                                                                }
                                                                if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Duke)
                                                                {
                                                                    
damage = (uint)(damage 0.3);
                                                                }
                                                                if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Earl)
                                                                {
                                                                    
damage = (uint)(damage 0.3);
                                                                }
                                                                
ReceiveAttack(attackerattackedattackref damagespell);
                                                                
suse.AddTarget(attacked.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        if (
_obj == null)
                                                            continue;
                                                        
attackedsob _obj as MsgNpcInfoEX;
                                                        if (
attackedsob == null) continue;
                                                        if (
sector.IsInFan(attackedsob.Xattackedsob.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedsobspell))
                                                            {
                                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack);
                                                                
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                                
suse.AddTarget(attackedsob.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                            
attacker.AttackPacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region RageofWar(Passive)
                                
case 12930:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
Game.Attacking.InLineAlgorithm ila = new Game.Attacking.InLineAlgorithm(attacker.X,
                                        
Xattacker.YY, (byte)spell.RangeInLineAlgorithm.Algorithm.DDA);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID SpellID;
                                            
suse.SpellLevel attacker.Owner.Spells[SpellID].Level;
                                            
suse.X;
                                            
suse.Y;
                                            
attacker.Owner.SendScreen(susetrue);
                                            
bool first false;
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
_obj.MapObjType == MapObjectType.Player)
                                                {
                                                    
attacked _obj as Player;
                                                    if (
ila.InLine(attacked.Xattacked.Y))
                                                    {
                                                        if (!
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            continue;
                                                        if (
Kernel.GetDistance(attacked.Xattacked.Yattacker.Xattacker.Y) > 11) continue;
                                                        if (!
first)
                                                        {
                                                            var 
map Kernel.Maps[attacker.MapID];
                                                            
Network.GamePackets.MsgMapItem flooritem = new Network.GamePackets.MsgMapItem(true);
                                                            
flooritem.UID Network.GamePackets.MsgMapItem.FloorUID.Next;
                                                            while (
map.Npcs.ContainsKey(flooritem.UID))
                                                                
flooritem.UID Network.GamePackets.MsgMapItem.FloorUID.Next;

                                                            
flooritem.ItemID MsgMapItem.RageOfWarTrap;
                                                            
flooritem.attacked.X;
                                                            
flooritem.MapID map.ID;
                                                            
flooritem.attacked.Y;
                                                            
flooritem.Type MsgMapItem.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(flooritemtrue);
                                                            
first true;
                                                        }
                                                        
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attack) * spell.Power 25000;
                                                        
damage = (uint)(damage 0.5);

                                                        
ReceiveAttack(attackerattackedattackref damagespell);

                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                    }
                                                }
                                                else if (
_obj.MapObjType == MapObjectType.Monster)
                                                {
                                                    
attacked _obj as Player;
                                                    if (
ila.InLine(attacked.Xattacked.Y))
                                                    {
                                                        if (!
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            continue;
                                                        if (
Kernel.GetDistance(attacked.Xattacked.Yattacker.Xattacker.Y) > 11) continue;
                                                        if (!
first)
                                                        {
                                                            var 
map Kernel.Maps[attacker.MapID];
                                                            
Network.GamePackets.MsgMapItem flooritem = new Network.GamePackets.MsgMapItem(true);
                                                            
flooritem.UID Network.GamePackets.MsgMapItem.FloorUID.Next;
                                                            while (
map.Npcs.ContainsKey(flooritem.UID))
                                                                
flooritem.UID Network.GamePackets.MsgMapItem.FloorUID.Next;

                                                            
flooritem.ItemID MsgMapItem.RageOfWarTrap;
                                                            
flooritem.attacked.X;
                                                            
flooritem.MapID map.ID;
                                                            
flooritem.attacked.Y;
                                                            
flooritem.Type MsgMapItem.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(flooritemtrue);
                                                            
first true;
                                                        }
                                                        
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attack) * (spell.Power 1000) / 990;

                                                        
damage = (uint)(damage 0.6);

                                                        
ReceiveAttack(attackerattackedattackref damagespell);

                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                    }


                                                }
                                                else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    
attackedsob _obj as MsgNpcInfoEX;
                                                    if (
attackedsob == null) continue;
                                                    if (
ila.InLine(attackedsob.Xattackedsob.Y))
                                                    {
                                                        if (!
CanAttack(attackerattackedsobspell))
                                                            continue;
                                                        if (
Kernel.GetDistance(attackedsob.Xattackedsob.Yattacker.Xattacker.Y) > 11) continue;
                                                        if (!
first)
                                                        {
                                                            var 
map Kernel.Maps[attacker.MapID];
                                                            
Network.GamePackets.MsgMapItem flooritem = new Network.GamePackets.MsgMapItem(true);
                                                            
flooritem.UID Network.GamePackets.MsgMapItem.FloorUID.Next;
                                                            while (
map.Npcs.ContainsKey(flooritem.UID))
                                                                
flooritem.UID Network.GamePackets.MsgMapItem.FloorUID.Next;

                                                            
flooritem.ItemID MsgMapItem.RageOfWarTrap;
                                                            
flooritem.attackedsob.X;
                                                            
flooritem.MapID map.ID;
                                                            
flooritem.attackedsob.Y;
                                                            
flooritem.Type MsgMapItem.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(flooritemtrue);
                                                            
first true;
                                                        }
                                                        
uint damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack) * (spell.Power 5000) / 8000;

                                                        
damage = (uint)(damage 0.6);

                                                        
ReceiveAttack(attackerattackedsobattackdamagespell);

                                                        
suse.AddTarget(attackedsob.UIDdamageattack);
                                                    }


                                                }
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                            
attacker.AttackPacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region Chaser
                                #region ShadowofChaser(Active)
                                
case 13090:
                                    {
                                        if (
attacker.ContainsFlag4((ulong)MsgUpdate.Flags4.ShadowofChaser))
                                        {
                                            
attacker.RemoveFlag4((ulong)MsgUpdate.Flags4.ShadowofChaser);
                                            
attacker.AttackPacket null;
                                            break;
                                        }
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.Attacker1 attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.AddTarget(attacker.UID0null);
                                            
attack = new MsgInteract(true);
                                            
attack.Attacker attack.Attacked attacker.UID;
                                            
attack.attacker.Xattack.attacker.Y;
                                            
attack.InteractType 24;
                                            
attack.SpellID spell.ID;
                                            
attacker.Owner.SendScreen(susetrue);
                                            
attacker.AddFlag4((ulong)MsgUpdate.Flags4.ShadowofChaser);
                                            
attacker.AttackPacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region TripleBlasts(Passive)
                                
case 12850:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.Attacker1 attackedsob == null attacked.UID attackedsob.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            if (
attackedsob == null)
                                            {
                                                if (
CanAttack(attackerattackedspellfalse))
                                                {
                                                    if (
attacker.ContainsFlag4((ulong)MsgUpdate.Flags4.ShadowofChaser) && attacker.IsChaser2())
                                                    {
                                                        var 
spell2 Database.SpellTable.GetSpell(13090attacker.Owner);
                                                        if (
spell2 != null)
                                                        {
                                                            
spell2.CanKill true;
                                                            if (
Kernel.Rate(spell2.Percent))
                                                            {
                                                                
ShadowofChaser(attackerattackedattack1);
                                                                break;
                                                            }
                                                        }
                                                    }

                                                    
uint damage Game.Attacking.Calculate.Ranged(attackerattackedref attack);
                                                    
//if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.King)
                                                    //{
                                                        
damage = (uint)(damage 0.8);
                                                    
//}
                                                    //if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Prince)
                                                    //{
                                                        //damage = (uint)(damage * 0.1);
                                                    //}
                                                    //if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Duke)
                                                    //{
                                                        //damage = (uint)(damage * 0.1);
                                                    //}
                                                    //if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Earl)
                                                    //{
                                                        //damage = (uint)(damage * 0.1);
                                                    //}
                                                    
damage damage * (attacked.PlayerFlag == PlayerFlag.Player ? (spell.Power 30000) : spell.MonsterPower) / 100;

                                                    
ReceiveAttack(attackerattackedattackref damagespell);
                                                    
suse.AddTarget(attacked.UIDdamageattack);
                                                    
attacker.Owner.SendScreen(susetrue);
                                                }
                                            }
                                            else
                                            {
                                                if (
CanAttack(attackerattackedsobspell))
                                                {

                                                    
uint damage Game.Attacking.Calculate.Ranged(attackerattackedsobref attack);

                                                    
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                    
suse.AddTarget(attackedsob.UIDdamageattack);
                                                    
attacker.Owner.SendScreen(susetrue);
                                                }
                                            }

                                        }
                                        break;
                                    }
                                
#endregion
                                #region SwirlingStorm(Passive)
                                
case 12890:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
Sector sector = new Sector(attacker.Xattacker.YXY);
                                            
sector.Arrange(spell.Sectorspell.Distance);
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                
byte dist = (byte)spell.Distance;
                                                
InLineAlgorithm algo = new InLineAlgorithm(attacker.XXattacker.YYdistInLineAlgorithm.Algorithm.DDA);
                                                
int i algo.lcoords.Count;
                                                
double disth 3.0;
                                                if (
_obj == null)
                                                    continue;
                                                if (
_obj.MapObjType == MapObjectType.Player)
                                                {
                                                    
bool hit false;
                                                    for (
int j 0ij++)
                                                        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 Player;

                                                        if (
sector.Inside(attacked.Xattacked.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            {
                                                                
int damagesec2 spell.HumanPower;
                                                                
int damagesec = (spell.HumanPower - ((spell.Level 2) - 100));
                                                                var 
dis Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y);
                                                                
damagesec += (damagesec2 damagesec) / dis;
                                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attackspell) * (uint)damagesec 10000;
                                                                
damage = (uint)(damage 1.2);
                                                                
ReceiveAttack(attackerattackedattackref damagespell);
                                                                
suse.AddTarget(attacked.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                                else if (
_obj.MapObjType == MapObjectType.Monster)
                                                {
                                                    
bool hit false;
                                                    for (
int j 0ij++)
                                                        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 Player;

                                                        if (
sector.Inside(attacked.Xattacked.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            {
                                                                
int damagesec2 400;
                                                                
int damagesec 0;
                                                                if (
spell.Level == 0damagesec 2600;
                                                                if (
spell.Level == 1damagesec 2700;
                                                                if (
spell.Level == 2damagesec 2800;
                                                                if (
spell.Level == 3damagesec 2900;
                                                                if (
spell.Level == 4damagesec 3000;
                                                                var 
dis Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y);
                                                                
damagesec += (damagesec2 damagesec) / dis;
                                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attackspell) * (uint)damagesec 10000;
                                                                
ReceiveAttack(attackerattackedattackref damagespell);
                                                                
suse.AddTarget(attacked.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                                else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    
bool hit false;
                                                    for (
int j 0ij++)
                                                        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 MsgNpcInfoEX;
                                                        if (
attackedsob == null) continue;
                                                        if (
sector.Inside(attackedsob.Xattackedsob.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedsobspell))
                                                            {
                                                                
int damagesec2 4000;
                                                                
int damagesec 0;
                                                                if (
spell.Level == 0damagesec 2600;
                                                                if (
spell.Level == 1damagesec 2700;
                                                                if (
spell.Level == 2damagesec 2800;
                                                                if (
spell.Level == 3damagesec 2900;
                                                                if (
spell.Level == 4damagesec 3000;
                                                                var 
dis Kernel.GetDistance(attacker.Xattacker.Yattackedsob.Xattackedsob.Y);
                                                                
damagesec += (damagesec2 damagesec) / dis;
                                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack) * (uint)damagesec 10000;
                                                                
damage = (uint)(damage 1.2);
                                                                
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                                
suse.AddTarget(attackedsob.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        else
                                        {
                                            
attacker.AttackPacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region ThunderCloud[Chaser]
                                
case 12840:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
attacker.GreenEffect 10;
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.Attacker1 attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            var 
cl = new WindWalker.ThunderCloud(attacker.Ownerattack.Xattack.Y);
                                            
suse.AddTarget(cl.UID0null);
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region ThunderBolt(Active)
                                
case 12970:
                                    {
                                        if (!
attacker.Owner.Spells.ContainsKey(12840)) break;
                                        foreach (var 
th in Kernel.Maps[attacker.MapID].Entities.Values.Where(=> i.Name == "Thundercloud"))
                                        {
                                            if (
th.OwnerUID == attacker.UID)
                                            {
                                                if (
Kernel.GetDistance(attacker.Xattacker.Yth.Xth.Y) <= th.MonsterInfo.AttackRange)
                                                {
                                                    if (
CanUseSpell(spellattacker.Owner))
                                                    {
                                                        
PrepareSpell(spellattacker.Owner);
                                                        
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                        
suse.Attacker attacker.UID;
                                                        
suse.X;
                                                        
suse.Y;
                                                        
suse.SpellID spell.ID;
                                                        
suse.AddTarget(th.UID0null);
                                                        
Writer.Write(12850th.SpawnPacket);//Flag4(128)
                                                        
attacker.Owner.SendScreen(susetrue);
                                                        
attacker.AttackPacket null;
                                                        foreach (var 
client in Kernel.GamePool.Values.Where(=> Kernel.GetDistance(th.Xth.Yi.Player.Xi.Player.Y) < 17))
                                                        {
                                                            
client.Send(th.SpawnPacket);
                                                        }

                                                    }
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Omnipotence(XP)
                                
case 12860:
                                    {
                                        
MsgMagicEffect suse = new MsgMagicEffect(true);
                                        
suse.Attacker attacker.UID;
                                        
suse.SpellID spell.ID;
                                        
suse.SpellLevel spell.Level;
                                        
suse.X;
                                        
suse.Y;
                                        if (
attacker.ContainsFlag((ulong)MsgUpdate.Flags.XPList))
                                        {
                                            
attacker.AddFlag4((ulong)MsgUpdate.Flags4.Omnipotence);
                                            
attacker.OmnipotenceStamp Time32.Now;
                                            
attacker.RemoveFlag((ulong)MsgUpdate.Flags.XPList);
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        else
                                        {
                                            if (
Kernel.GetDistance(attacker.Xattacker.YXY) <= spell.Range)
                                            {
                                                foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (
_obj == null) continue;
                                                    if (
_obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        
attacked _obj as Player;
                                                        if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Range)
                                                        {
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            {

                                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attackspell) / 10;

                                                                
ReceiveAttack(attackerattackedattackref damagespell);
                                                                
suse.AddTarget(attacked.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob _obj as MsgNpcInfoEX;
                                                        if (
attackedsob == null) continue;
                                                        if (
Kernel.GetDistance(attacker.Xattacker.Yattackedsob.Xattackedsob.Y) <= spell.Range)
                                                        {
                                                            if (
CanAttack(attackerattackedsobspell))
                                                            {

                                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack) * 350 100;


                                                                
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                                
suse.AddTarget(attackedsob.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.Monster)
                                                    {
                                                        
attacked _obj as Player;
                                                        if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Range)
                                                        {
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            {

                                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attackspell) * 350 100;

                                                                
ReceiveAttack(attackerattackedattackref damagespell);
                                                                
suse.AddTarget(attacked.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        
attacker.Owner.SendScreen(susetrue);
                                        
attacker.AttackPacket null;
                                        break;
                                    }
                                
#endregion
                                #region FrostGaze(I-II-III)
                                
case 12830:
                                case 
13070:
                                case 
13080:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
attacker.Owner.SendScreen(susetrue);
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
_obj.MapObjType == MapObjectType.Player)
                                                {
                                                    
attacked _obj as Player;

                                                    if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Range)
                                                    {
                                                        if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                        {
                                                            
int Rate 100;
                                                            
int diff attacked.BattlePower attacker.BattlePower;
                                                            if (
diff 0diff 0;
                                                            
Rate -= (byte)(diff 5);
                                                            if (
Rate 0Rate 0;
                                                            if (
Kernel.Rate(Rate))
                                                            {
                                                                if (
attacked.Stamina >= (byte)spell.Power)
                                                                    
attacked.Stamina -= (byte)spell.Power;
                                                                else 
attacked.Stamina 0;
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #endregion
                                #region Ninja
                                #region TwilightDance
                                
case 12070:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
LayTrapThree Line = new LayTrapThree(attacker.XXattacker.YY15);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.Attacker1 attacker.UID;
                                            
suse.SpellID SpellID;
                                            
suse.SpellLevel attacker.Owner.Spells[SpellID].Level;
                                            
suse.X;
                                            
suse.Y;
                                            
int Stamp 300;
                                            
ushort Color 2;
                                            List<
MsgMapItemItems = new List<MsgMapItem>();
                                            foreach (var 
coords in Line.LCoords)
                                            {
                                                if (!
attacker.FloorSpells.ContainsKey(SpellID))
                                                    
attacker.FloorSpells.TryAdd(SpellID, new FloorSpell.ClientFloorSpells(attacker.UIDXYsuse.LevelJHspell));
                                                var 
MsgMapItem = new FloorSpell(Network.GamePackets.MsgMapItem.TwilightDance, (ushort)coords.X, (ushort)coords.YColorspellStamp);
                                                
attacker.FloorSpells[spellID].AddItem(MsgMapItem);
                                                
Color++;
                                                
Stamp += 400;
                                                
attacker.Owner.SendScreen(MsgMapItem.FloorPackettrue);
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region SuperTwofoldBlade
                                
case 12080:
                                    {
                                        if (
Time32.Now >= attacker.SpellStamp.AddMilliseconds(500))
                                        {
                                            if (
CanUseSpell(spellattacker.Owner))
                                            {
                                                
ushort XxYx;
                                                if (
attacked != null)
                                                {
                                                    
Xx attacked.X;
                                                    
Yx attacked.Y;
                                                }
                                                else
                                                {
                                                    
Xx attackedsob.X;
                                                    
Yx attackedsob.Y;
                                                }
                                                if (
Kernel.GetDistance(attacker.Xattacker.YXxYx) <= spell.Distance)
                                                {
                                                    if (
attackedsob == null)
                                                        if (
attacked.ContainsFlag((ulong)MsgUpdate.Flags.Fly)) return;
                                                    if (
attacker.ContainsFlag((ulong)MsgUpdate.Flags.Fly)) return;
                                                    
PrepareSpell(spellattacker.Owner);
                                                    
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                    
suse.Attacker attacker.UID;
                                                    
suse.SpellID spell.ID;
                                                    
suse.SpellLevel spell.Level;
                                                    
suse.X;
                                                    
suse.Y;
                                                    
bool send false;
                                                    if (
attackedsob == null)
                                                    {
                                                        if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                        {
                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                            
uint damage Calculate.Melee(attackerattackedref attackspell);
                                                            
damage = (uint)(damage 1.6);

                                                            
suse.Effect attack.Effect;
                                                            
ReceiveAttack(attackerattackedattackref damagespell);
                                                            
suse.AddTarget(attacked.UIDdamageattack);
                                                            
send true;
                                                            if (
attacker.Owner.Spells.ContainsKey(11230) && !attacked.Dead)
                                                            {
                                                                var 
attacker.Owner.Spells[11230];
                                                                var 
spellz SpellTable.SpellInformations[s.ID][s.Level];
                                                                if (
spellz != null)
                                                                {
                                                                    if (
Kernel.Rate(spellz.Percent))
                                                                    {
                                                                        
MsgMagicEffect ssuse = new MsgMagicEffect(true);
                                                                        
ssuse.Attacker attacker.UID;
                                                                        
ssuse.SpellID spellz.ID;
                                                                        
ssuse.SpellLevel spellz.Level;
                                                                        
damage Calculate.Melee(attackerattackedref attack) / 30;
                                                                        
ssuse.AddTarget(attacked.UID, new MsgMagicEffect.DamageClass().Damage damageattack);
                                                                        
ReceiveAttack(attackerattackedattackref damagespellz);
                                                                        
attacker.Owner.SendScreen(ssusetrue);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        if (
CanAttack(attackerattackedsobspell))
                                                        {
                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                            
uint damage Calculate.Melee(attackerattackedsobref attack);
                                                            
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                            
suse.Effect attack.Effect;
                                                            
suse.AddTarget(attackedsob.UIDdamageattack);
                                                            
send true;
                                                        }
                                                    }
                                                    if (
send)
                                                        
attacker.Owner.SendScreen(susetrue);
                                                    
attacker.SpellStamp Time32.Now;
                                                }
                                                else
                                                {
                                                    
attacker.AttackPacket null;
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region ShadowClone
                                
case 12090:
                                    {
                                        if (
attacker.MyClones.Count != 0)
                                        {
                                            foreach (var clone 
in attacker.MyClones)
                                                clone.
RemoveThat();
                                            
attacker.MyClones.Clear();
                                            break;
                                        }
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.Attacker1 attacker.UID;
                                            
suse.SpellID SpellID;
                                            
suse.SpellLevel attacker.Owner.Spells[SpellID].Level;
                                            
suse.X;
                                            
suse.Y;
                                            switch (
attacker.Owner.Spells[SpellID].Level)
                                            {
                                                case 
0:
                                                case 
1:
                                                case 
2:
                                                    {
                                                        
attacker.MyClones.Add(new Clone(attacker"ShadowClone"10003));
                                                        break;
                                                    }
                                                default:
                                                    {
                                                        
attacker.MyClones.Add(new Clone(attacker"ShadowClone"3));
                                                        
attacker.MyClones.Add(new Clone(attacker"ShadowClone"10003));
                                                        break;
                                                    }
                                            }
                                            foreach (var clone 
in attacker.MyClones)
                                            {
                                                
MsgAction Data = new MsgAction(true);
                                                
Data.ID MsgAction.Mode.Revive;
                                                
Data.UID = clone.UID;
                                                
Data.attacker.X;
                                                
Data.attacker.Y;
                                                
attacker.Owner.SendScreen(Datatrue);
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region FatalSpin
                                
case 12110:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID SpellID;
                                            
suse.SpellLevel attacker.Owner.Spells[SpellID].Level;
                                            
suse.X;
                                            
suse.Y;
                                            
RangeMove moveIn = new RangeMove();
                                            List<
RangeMove.Coordsranger moveIn.MoveCoords(attacker.Xattacker.YXY7);
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null) continue;
                                                if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                {
                                                    
attacked _obj as Player;
                                                    if (!
moveIn.InRange(attacked.Xattacked.Y2ranger)) continue;
                                                    {
                                                        if (!
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee)) continue;
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Melee(attackerattackedref attackspell);
                                                        
                                                        
damage = (uint)(damage 0.1);
                                                            
                                                        
suse.Effect attack.Effect;
                                                        
attack.Damage damage;
                                                        
ReceiveAttack(attackerattackedattackref damagespell);
                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                    }
                                                }
                                                else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    
attackedsob _obj as MsgNpcInfoEX;
                                                    if (
attackedsob == null) continue;
                                                    if (!
moveIn.InRange(attackedsob.Xattackedsob.Y2ranger)) continue;
                                                    {
                                                        if (!
CanAttack(attackerattackedsobspell)) continue;
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Melee(attackerattackedsobref attack);
                                                        
attack.Damage damage;
                                                        
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                        
suse.AddTarget(attackedsob.UIDdamageattack);
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Vortex
                                
case 6010:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
attacker.AddFlag((ulong)MsgUpdate.Flags.ShurikenVortex);
                                            
attacker.RemoveFlag((ulong)MsgUpdate.Flags.Ride);
                                            
attacker.ShurikenVortexStamp Time32.Now;
                                            
attacker.ShurikenVortexTime 20;
                                            
attacker.Owner.SendScreen(susetrue);
                                            
attacker.VortexPacket = new MsgInteract(true);
                                            
attacker.VortexPacket.Decoded true;
                                            
attacker.VortexPacket.Damage 6012;
                                            
attacker.VortexPacket.InteractType MsgInteract.Magic;
                                            
attacker.VortexPacket.Attacker attacker.UID;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region VortexRespone
                                
case 6012:
                                    {
                                        if (!
attacker.ContainsFlag((ulong)MsgUpdate.Flags.ShurikenVortex))
                                        {
                                            
attacker.AttackPacket null; break;
                                        }
                                        
MsgMagicEffect suse = new MsgMagicEffect(true);
                                        
suse.Attacker attacker.UID;
                                        
suse.SpellID spell.ID;
                                        
suse.SpellLevel spell.Level;
                                        
suse.attacker.X;
                                        
suse.attacker.Y;
                                        foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                        {
                                            if (
_obj == null) continue;
                                            if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                            {
                                                
attacked _obj as Player;
                                                if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Range)
                                                {
                                                    if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                    {
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Melee(attackerattackedref attack);
                                                        
suse.Effect attack.Effect;
                                                        
ReceiveAttack(attackerattackedattackref damagespell);
                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                    }
                                                }
                                            }
                                            else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                            {
                                                
attackedsob _obj as MsgNpcInfoEX;
                                                if (
Kernel.GetDistance(attacker.Xattacker.Yattackedsob.Xattackedsob.Y) <= spell.Range)
                                                {
                                                    if (
CanAttack(attackerattackedsobspell))
                                                    {
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Melee(attackerattackedsobref attack);
                                                        
suse.Effect attack.Effect;
                                                        
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                        
suse.AddTarget(attackedsob.UIDdamageattack);
                                                    }
                                                }
                                            }
                                        }
                                        
attacker.Owner.SendScreen(susetrue);
                                        break;
                                    }
                                
#endregion
                                #region ToxicFog
                                
case 6001:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            if (
Kernel.GetDistance(attacker.Xattacker.YXY) <= spell.Distance)
                                            {
                                                foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (
_obj.MapObjType == MapObjectType.Player || _obj.MapObjType == MapObjectType.Monster)
                                                    {
                                                        
attacked _obj as Player;
                                                        if (
attacked.MapObjType == MapObjectType.Monster)
                                                            if (
attacked.MonsterInfo.Boss) continue;
                                                        if (
Kernel.GetDistance(XYattacked.Xattacked.Y) <= spell.Range)
                                                        {
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.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((ulong)MsgUpdate.Flags.Poisoned);
                                                                    
suse.AddTarget(attacked.UID1null);
                                                                }
                                                                else
                                                                {
                                                                    
suse.AddTarget(attacked.UID0null);
                                                                    
suse.Targets[attacked.UID].Hit false;
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket null;
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion

                                #region TwofoldBlades
                                
case 6000:
                                    {
                                        if (
Time32.Now >= attacker.SpellStamp.AddMilliseconds(500))
                                        {
                                            if (
CanUseSpell(spellattacker.Owner))
                                            {
                                                
ushort XxYx;
                                                if (
attacked != null)
                                                {
                                                    
Xx attacked.X;
                                                    
Yx attacked.Y;
                                                }
                                                else
                                                {
                                                    
Xx attackedsob.X;
                                                    
Yx attackedsob.Y;
                                                }
                                                if (
Kernel.GetDistance(attacker.Xattacker.YXxYx) <= spell.Range)
                                                {
                                                    if (
attackedsob == null)
                                                        if (
attacked.ContainsFlag((ulong)MsgUpdate.Flags.Fly)) return;
                                                    if (
attacker.ContainsFlag((ulong)MsgUpdate.Flags.Fly)) return;
                                                    
PrepareSpell(spellattacker.Owner);
                                                    
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                    
suse.Attacker attacker.UID;
                                                    
suse.SpellID spell.ID;
                                                    
suse.SpellLevel spell.Level;
                                                    
suse.X;
                                                    
suse.Y;
                                                    
bool send false;
                                                    if (
attackedsob == null)
                                                    {
                                                        if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                        {
                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                            
uint damage Calculate.Melee(attackerattackedref attackspell);
                                                            if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.King)
                                                                
                                                                
damage = (uint)(damage 1.4);
                                                            
                                                            
suse.Effect attack.Effect;
                                                            
ReceiveAttack(attackerattackedattackref damagespell);
                                                            
suse.AddTarget(attacked.UIDdamageattack);
                                                            
send true;
                                                            if (
attacker.Owner.Spells.ContainsKey(11230) && !attacked.Dead)
                                                            {
                                                                var 
attacker.Owner.Spells[11230];
                                                                var 
spellz SpellTable.SpellInformations[s.ID][s.Level];
                                                                if (
spellz != null)
                                                                {
                                                                    if (
Mr.HaMoOo.Kernel.Rate(spellz.Percent))
                                                                    {
                                                                        
MsgMagicEffect ssuse = new MsgMagicEffect(true);
                                                                        
ssuse.Attacker attacker.UID;
                                                                        
ssuse.SpellID spellz.ID;
                                                                        
ssuse.SpellLevel spellz.Level;
                                                                        
damage Calculate.Melee(attackerattackedref attack) / 30;
                                                                        
ssuse.AddTarget(attacked.UID, new MsgMagicEffect.DamageClass().Damage damageattack);
                                                                        
ReceiveAttack(attackerattackedattackref damagespellz);
                                                                        
attacker.Owner.SendScreen(ssusetrue);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        if (
CanAttack(attackerattackedsobspell))
                                                        {
                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                            
uint damage Calculate.Melee(attackerattackedsobref attack);
                                                            
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                            
suse.Effect attack.Effect;
                                                            
suse.AddTarget(attackedsob.UIDdamageattack);
                                                            
send true;
                                                        }
                                                    }
                                                    if (
send)
                                                        
attacker.Owner.SendScreen(susetrue);
                                                    
attacker.SpellStamp Time32.Now;
                                                }
                                                else
                                                {
                                                    
attacker.AttackPacket null;
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region PoisonStar
                                
case 6002:
                                    {
                                        if (
attackedsob != null) return;
                                        if (
attacked.PlayerFlag == PlayerFlag.Monster) return;
                                        if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Distance)
                                        {
                                            if (
CanUseSpell(spellattacker.Owner))
                                            {
                                                
PrepareSpell(spellattacker.Owner);
                                                
int potDifference attacker.BattlePower attacked.BattlePower;
                                                
int rate spell.Percent potDifference;
                                                
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                
suse.Attacker attacker.UID;
                                                
suse.SpellID spell.ID;
                                                
suse.SpellLevel spell.Level;
                                                
suse.X;
                                                
suse.Y;
                                                if (
CanAttack(attackerattackedspellfalse))
                                                {
                                                    
suse.AddTarget(attacked.UID1attack);
                                                    if (
Kernel.Rate(rate))
                                                    {
                                                        
attacked.NoDrugsStamp Time32.Now;
                                                        
attacked.NoDrugsTime = (short)spell.Duration;
                                                        
attacked.AddFlag2((ulong)MsgUpdate.Flags2.PoisonStar);
                                                        if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                            
attacked.Owner.Send(Constants.NoDrugs(spell.Duration));
                                                    }
                                                    else
                                                    {
                                                        
suse.Targets[attacked.UID].Hit false;
                                                    }
                                                    
attacked.Owner.SendScreen(susetrue);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region ArcherBane
                                
case 6004:
                                    {
                                        if (
attackedsob != null) return;
                                        if (
attacked.PlayerFlag == PlayerFlag.Monster) return;
                                        if (!
attacked.ContainsFlag((ulong)MsgUpdate.Flags.Fly)) return;
                                        if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Distance)
                                        {
                                            if (
CanUseSpell(spellattacker.Owner))
                                            {
                                                
PrepareSpell(spellattacker.Owner);
                                                
int potDifference attacker.BattlePower attacked.BattlePower;
                                                
int rate spell.Percent potDifference;
                                                
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                
suse.Attacker attacker.UID;
                                                
suse.SpellID spell.ID;
                                                
suse.SpellLevel spell.Level;
                                                
suse.X;
                                                
suse.Y;
                                                if (
CanAttack(attackerattackedspellfalse))
                                                {
                                                    
uint dmg Calculate.Percent(attacked0.1F);
                                                    
suse.AddTarget(attacked.UIDdmgattack);
                                                    if (
Kernel.Rate(rate))
                                                    {
                                                        
attacked.Hitpoints -= dmg;
                                                        
attacked.RemoveFlag((ulong)MsgUpdate.Flags.Fly);
                                                    }
                                                    else
                                                    {
                                                        
suse.Targets[attacked.UID].Hit false;
                                                    }
                                                    
attacked.Owner.SendScreen(susetrue);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region MortalDrag
                                
case 11180:
                                    {
                                        if (
attacked != null)
                                        {
                                            if (
attacked.ContainsFlag((ulong)MsgUpdate.Flags.Fly)) return;
                                            if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Distance)
                                            {
                                                if (
CanUseSpell(spellattacker.Owner))
                                                {
                                                    if (!
Kernel.Rate(Math.Max(5100 - (attacked.BattlePower attacker.BattlePower) / 5))) return;
                                                    
PrepareSpell(spellattacker.Owner);
                                                    
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                    
suse.Attacker attacker.UID;
                                                    
suse.SpellID spell.ID;
                                                    
suse.SpellLevel spell.Level;
                                                    
suse.attacked.X;
                                                    
suse.attacked.Y;
                                                    
ushort newx attacker.X;
                                                    
ushort newy attacker.Y;
                                                    
Map.Pushback(ref newxref newyattacked.Facing5);
                                                    if (
attacker.Owner.Map.Floor[newxnewyMapObjectType.Playerattacked])
                                                    {
                                                        
suse.attacked.newx;
                                                        
suse.attacked.newy;
                                                    }
                                                    
MsgMagicEffect.DamageClass tar = new MsgMagicEffect.DamageClass();
                                                    if (
CanAttack(attackerattackedspellfalse))
                                                    {
                                                        
tar.Damage Calculate.Melee(attackerattackedref attackspell);
                                                        
suse.AddTarget(attacked.UIDtarattack);
                                                        
ReceiveAttack(attackerattackedattackref tar.Damagespell);
                                                    }
                                                    if (
attacker.PlayerFlag == PlayerFlag.Player)
                                                        
attacker.Owner.SendScreen(susetrue);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region BloodyScythe
                                
case 11170:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
MsgMagicEffect.DamageClass tar = new MsgMagicEffect.DamageClass();
                                            foreach (var 
t in attacker.Owner.Screen.Objects)
                                            {
                                                if (
== null) continue;
                                                if (
t.MapObjType == MapObjectType.Player || t.MapObjType == MapObjectType.Monster)
                                                {
                                                    var 
target as Player;
                                                    if (
Kernel.GetDistance(XYtarget.Xtarget.Y) <= spell.Range)
                                                    {
                                                        if (
CanAttack(attackertargetspellfalse))
                                                        {
                                                            
tar.Damage Calculate.Melee(attackertargetref attackspell) / 2;
                                                            
tar.Hit true;
                                                            
suse.AddTarget(target.UIDtarattack);
                                                            
ReceiveAttack(attackertargetattackref tar.Damagespell);
                                                        }
                                                    }
                                                }
                                            }
                                            if (
attacker.PlayerFlag == PlayerFlag.Player)
                                                
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region Steed
                                #region Riding
                                
case 7001:
                                    {
                                        if (
Constants.NoRiding.Contains(attacker.MapID))
                                        {
                                            
attacker.Owner.Send(new MsgTalk("Mr: " attacker.Name " You Can`t Use Riding Here !!!"System.Drawing.Color.RedMsgTalk.World));
                                            return;
                                        }
                                        if (
attacker.ContainsFlag((ulong)MsgUpdate.Flags.ShurikenVortex))
                                            return;
                                        if (!
attacker.Owner.Equipment.Free(12))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            if (
attacker.ContainsFlag((ulong)MsgUpdate.Flags.Ride))
                                            {
                                                
attacker.RemoveFlag((ulong)MsgUpdate.Flags.Ride);
                                            }
                                            else
                                            {
                                                if (
attacker.Stamina >= 30)
                                                {
                                                    
attacker.AddFlag((ulong)MsgUpdate.Flags.Ride);
                                                    
attacker.Stamina -= 30;
                                                    
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.UID0attack);
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }

                                
#endregion
                                #region Spook
                                
case 7002:
                                    {
                                        if (
attacked.ContainsFlag((ulong)MsgUpdate.Flags.Ride) && attacker.ContainsFlag((ulong)MsgUpdate.Flags.Ride))
                                        {
                                            
MsgItemInfo attackedSteed nullattackerSteed null;
                                            if ((
attackedSteed attacked.Owner.Equipment.TryGetItem(MsgItemInfo.Steed)) != null)
                                            {
                                                if ((
attackerSteed attacker.Owner.Equipment.TryGetItem(MsgItemInfo.Steed)) != null)
                                                {
                                                    
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                    
suse.Attacker attacker.UID;
                                                    
suse.SpellID spell.ID;
                                                    
suse.SpellLevel spell.Level;
                                                    
suse.X;
                                                    
suse.Y;
                                                    
suse.AddTarget(attacked.UID0attack);
                                                    if (
attackedSteed.Plus attackerSteed.Plus)
                                                        
attacked.RemoveFlag((ulong)MsgUpdate.Flags.Ride);
                                                    else if (
attackedSteed.Plus == attackerSteed.Plus && attackedSteed.PlusProgress <= attackerSteed.PlusProgress)
                                                        
attacked.RemoveFlag((ulong)MsgUpdate.Flags.Ride);
                                                    else
                                                        
suse.Targets[attacked.UID].Hit false;
                                                    
attacker.Owner.SendScreen(susetrue);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region WarCry
                                
case 7003:
                                    {
                                        
MsgMagicEffect suse = new MsgMagicEffect(true);
                                        
suse.Attacker attacker.UID;
                                        
suse.SpellID spell.ID;
                                        
suse.SpellLevel spell.Level;
                                        
suse.X;
                                        
suse.Y;
                                        
MsgItemInfo attackedSteed nullattackerSteed null;
                                        foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                        {
                                            if (
_obj == null) continue;
                                            if (
_obj.MapObjType == MapObjectType.Player && _obj.UID != attacker.UID)
                                            {
                                                
attacked _obj as Player;
                                                if ((
attackedSteed attacked.Owner.Equipment.TryGetItem(MsgItemInfo.Steed)) != null)
                                                {
                                                    if ((
attackerSteed attacker.Owner.Equipment.TryGetItem(MsgItemInfo.Steed)) != null)
                                                    {
                                                        if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= attackedSteed.Plus)
                                                        {
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            {
                                                                
suse.AddTarget(attacked.UID0attack);
                                                                if (
attackedSteed.Plus attackerSteed.Plus)
                                                                    
attacked.RemoveFlag((ulong)MsgUpdate.Flags.Ride);
                                                                else if (
attackedSteed.Plus == attackerSteed.Plus && attackedSteed.PlusProgress <= attackerSteed.PlusProgress)
                                                                    
attacked.RemoveFlag((ulong)MsgUpdate.Flags.Ride);
                                                                else
                                                                    
suse.Targets[attacked.UID].Hit false;
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        
attacker.Owner.SendScreen(susetrue);
                                        break;
                                    }
                                
#endregion
                                #region ChargingVortex
                                
case 11190:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            if (
attacker.Owner.Map.Floor[XYMapObjectType.InvalidCastnull]) break;
                                            
spell.UseStamina 20;
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
UInt16 oxoy;
                                            
ox attacker.X;
                                            
oy attacker.Y;
                                            
attack.X;
                                            
attack.Y;
                                            
attack.Attacker attacker.UID;
                                            
attack.InteractType MsgInteract.SkillMove;
                                            
attack.X;
                                            
attack.Y;
                                            
attacker.Owner.SendScreen(attacktrue);
                                            
attacker.X;
                                            
attacker.Y;
                                            if (
Kernel.GetDistance(attacker.Xattacker.YXY) <= spell.Range)
                                            {
                                                var Array = 
attacker.Owner.Screen.Objects;
                                                foreach (
Interfaces.IMapObject _obj in Array)
                                                {
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        
attacked _obj as Player;
                                                        if (
Kernel.GetDistance(XYattacked.Xattacked.Y) > spell.Range) continue;
                                                        if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                        {
                                                            var 
damage Calculate.Melee(attackerattackedref attackspell);
                                                            
ReceiveAttack(attackerattackedattackref damagespell);
                                                            
suse.AddTarget(attacked.UIDdamageattack);
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob _obj as MsgNpcInfoEX;
                                                        if (
Kernel.GetDistance(attacker.Xattacker.Yattackedsob.Xattackedsob.Y) <= spell.Range)
                                                        {
                                                            if (
CanAttack(attackerattackedsobspell))
                                                            {
                                                                
uint damage Calculate.Melee(attackerattackedsobref attack);
                                                                
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                                
suse.AddTarget(attackedsob.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket null;
                                            }
                                            
Calculations.IsBreaking(attacker.Owneroxoy);
                                            
attacker.Owner.SendScreen(susetrue);
                                            
attacker.Owner.Screen.Reload(suse);
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region Monk
                                #region ElementalAura
                                
case 10395:
                                case 
10410:
                                case 
10420:
                                case 
10421:
                                case 
10422:
                                case 
10423:
                                case 
10424:
                                    {
                                        
HandleAuraMonk(attackerspell);
                                        break;
                                    }
                                
#endregion
                                #region Compassion
                                
case 10430:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            if (
attacker.Owner.Team != null)
                                            {
                                                
PrepareSpell(spellattacker.Owner);
                                                foreach (
Client.GameState teammate in attacker.Owner.Team.Teammates)
                                                {
                                                    if (
Kernel.GetDistance(attacker.Xattacker.Yteammate.Player.Xteammate.Player.Y) <= spell.Distance)
                                                    {
                                                        
teammate.Player.RemoveFlag((ulong)MsgUpdate.Flags.Poisoned);
                                                        
suse.AddTarget(teammate.Player.UID0attack);
                                                    }
                                                }
                                                
attacker.Owner.SendScreen(susetrue);
                                            }
                                            else
                                            {
                                                
PrepareSpell(spellattacker.Owner);
                                                
attacker.RemoveFlag((ulong)MsgUpdate.Flags.Poisoned);
                                                
suse.AddTarget(attacker.UID0attack);
                                                if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                    
attacked.Owner.SendScreen(susetrue);
                                                else 
attacker.Owner.SendScreen(susetrue);
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Serenity
                                
case 10400:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            if (
attacker == null) return;
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID SpellID;
                                            
suse.SpellLevel attacker.Owner.Spells[SpellID].Level;
                                            
suse.X;
                                            
suse.Y;
                                            
suse.Targets.Add(attacker.UID1);
                                            
attacked.ToxicFogLeft 0;
                                            
attacked.NoDrugsTime 0;
                                            
attacked.ScurbyBomb 0;
                                            
attacked.DragonFuryTime 0;
                                            
attacked.FlameLayerLeft 0;
                                            if (
attacked.ContainsFlag2((ulong)MsgUpdate.Flags2.ScurvyBomb))
                                                
attacked.RemoveFlag2((ulong)MsgUpdate.Flags2.ScurvyBomb);
                                            if (
attacked.ContainsFlag2((ulong)MsgUpdate.Flags2.PoisonStar))
                                                
attacked.RemoveFlag2((ulong)MsgUpdate.Flags2.PoisonStar);
                                            
MsgUpdate upgrade = new MsgUpdate(true);
                                            
upgrade.UID attacker.UID;
                                            
upgrade.Append((byte)MsgUpdate.DataType.Fatigue0000);
                                            
attacked.Owner.Send(upgrade.ToArray());
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Tranquility
                                
case 10425:
                                    {
                                        if (
attacker.EpicMonk())
                                        {
                                            
attack.InteractType MsgInteract.Magic;
                                            
attack.Decoded true;
                                            
attack.attacked.X;
                                            
attack.attacked.Y;
                                            
attack.Attacked attacked.UID;
                                            
attack.Attacker attacker.UID;
                                            
attack.Damage 12560;
                                            goto 
restart;
                                        }
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            if (
attacked == null) return;
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID SpellID;
                                            
suse.SpellLevel attacker.Owner.Spells[SpellID].Level;
                                            
suse.X;
                                            
suse.Y;
                                            
suse.AddTarget(attacked.UID0attack);
                                            if (
attacked != null && attacked.PlayerFlag == PlayerFlag.Player)
                                            {
                                                if (
attacked.ContainsFlag2((ulong)MsgUpdate.Flags2.SoulShackle))
                                                {
                                                    
MsgUpdate upgrade = new MsgUpdate(true);
                                                    
upgrade.UID attacked.UID;
                                                    
upgrade.Append((byte)MsgUpdate.DataType.SoulShackle111000);
                                                    
attacked.Owner.Send(upgrade.ToArray());
                                                }
                                                
attacked.ToxicFogLeft 0;
                                                
attacked.ScurbyBomb 0;
                                                
attacked.NoDrugsTime 0;
                                                
attacked.DragonFuryTime 0;
                                                
attacked.FlameLayerLeft 0;
                                                if (
attacked.Dead)
                                                {
                                                    
attacked.SoulShackleRemover();
                                                }
                                                if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                    
attacker.Owner.SendScreen(susetrue);
                                                else 
attacked.MonsterInfo.SendScreen(suse);
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region WhirlwindKick
                                
case 10415:
                                    {
                                        if (
Time32.Now attacker.SpellStamp.AddMilliseconds(300))
                                        {
                                            
attacker.AttackPacket null; return;
                                        }
                                        if (
Kernel.GetDistance(attacker.Xattacker.YXY) <= 3)
                                        {
                                            if (
CanUseSpell(spellattacker.Owner))
                                            {
                                                
PrepareSpell(spellattacker.Owner);

                                                
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                
suse.Attacker attacker.UID;
                                                
suse.SpellID spell.ID;
                                                
suse.SpellLevel 0;
                                                
suse.= (ushort)Kernel.Random.Next(310);
                                                
suse.0;
                                                
//suse.SpellLevelHu = client_Spell.LevelHu2;
                                                
if (Kernel.GetDistance(attacker.Xattacker.YXY) <= 3)
                                                {
                                                    for (
int c 0attacker.Owner.Screen.Objects.Lengthc++)
                                                    {
                                                        
//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 (>= 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.Player)
                                                        {
                                                            
attacked _obj as Player;
                                                            if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Range)
                                                            {
                                                                if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Ranged))
                                                                {
                                                                    
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attack);
                                                                    
damage = (uint)(damage 0.6);
                                                                    
suse.Effect attack.Effect;
                                                                    
ReceiveAttack(attackerattackedattackref damagespell);
                                                                    
attacked.Stunned true;
                                                                    
attacked.StunStamp Time32.Now;
                                                                    
suse.AddTarget(attacked.UIDdamageattack);

                                                                }
                                                            }
                                                        }
                                                    }
                                                    
attacker.AttackPacket null;
                                                }
                                                else
                                                {
                                                    
attacker.AttackPacket null; return;
                                                }
                                                
attacker.Owner.SendScreen(susetrue);
                                                
attacker.SpellStamp Time32.Now;
                                                
suse.Targets = new SafeDictionary<uintMsgMagicEffect.DamageClass>();
                                                
attacker.AttackPacket null; return;
                                            }
                                            
attacker.AttackPacket null;
                                        }
                                        
attacker.AttackPacket null; return;
                                    }
                                
#endregion
                                #region RadiantPalm
                                
case 10381:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
attacker.SpellStamp Time32.Now;
                                            
ushort XxYx;
                                            if (
attacked != null)
                                            {
                                                
Xx attacked.X;
                                                
Yx attacked.Y;
                                            }
                                            else
                                            {
                                                
Xx attackedsob.X;
                                                
Yx attackedsob.Y;
                                            }


                                            if (
Kernel.GetDistance(attacker.Xattacker.YXxYx) <= spell.Range)
                                            {
                                                if (
attackedsob == null)
                                                    if (
attacked.ContainsFlag((ulong)MsgUpdate.Flags.Fly)) return;
                                                if (
attacker.ContainsFlag((ulong)MsgUpdate.Flags.Fly)) return;
                                                
PrepareSpell(spellattacker.Owner);
                                                
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                
suse.Attacker attacker.UID;
                                                
suse.SpellID spell.ID;
                                                
suse.SpellLevel spell.Level;
                                                
suse.X;
                                                
suse.Y;
                                                
bool send false;
                                                if (
attackedsob == null)
                                                {

                                                    if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                    {

                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        var 
damage Calculate.Melee(attackerattackedref attack);
                                                        
/*if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.King)
                                                            if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.King)
                                                            {
                                                                damage = (uint)(damage * 1.2);
                                                            }
                                                        if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Prince)
                                                        {
                                                            damage = (uint)(damage * 1.2);
                                                        }
                                                        if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Duke)
                                                        {
                                                            damage = (uint)(damage * 1.2);
                                                        }
                                                        if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Earl)
                                                        {*/
                                                            
damage = (uint)(damage 1.3);
                                                        
//}
                                                        
suse.Effect attack.Effect;
                                                        
ReceiveAttack(attackerattackedattackref damagespell);
                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                        
send true;
                                                    }
                                                }
                                                else
                                                {
                                                    if (
CanAttack(attackerattackedsobspell))
                                                    {
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        var 
damage Calculate.Melee(attackerattackedsobref attack);
                                                        
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                        
suse.Effect attack.Effect;
                                                        
suse.AddTarget(attackedsob.UIDdamageattack);
                                                        
send true;
                                                    }
                                                }
                                                if (
send)
                                                    
attacker.Owner.SendScreen(susetrue);
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket null;
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region SoulShackle
                                
case 10405:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner) && attacked.Dead)
                                        {
                                            if (
attacked.PlayerFlag == PlayerFlag.Player)
                                            {
                                                
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                
suse.Attacker attacker.UID;
                                                
suse.SpellID spell.ID;
                                                
suse.SpellLevel spell.Level;
                                                
suse.X;
                                                
suse.Y;
                                                
suse.AddTarget(attacked.UID0attack);
                                                if (
attacked.Dead)
                                                {
                                                    if (
attacker.BattlePower >= attacked.BattlePower ||
                                                        
attacker.BattlePower > (attacked.BattlePower 15))
                                                    {
                                                        
attacked.ShackleStamp Time32.Now;
                                                        
attacked.ShackleTime = (short)spell.Duration;
                                                        
MsgUpdate upgrade = new MsgUpdate(true);
                                                        
upgrade.UID attacked.UID;
                                                        
upgrade.Append((byte)MsgUpdate.DataType.SoulShackle111, (uint)spell.Duration00);
                                                        
attacked.Owner.Send(upgrade.ToArray());
                                                        
attacked.AddFlag2((ulong)MsgUpdate.Flags2.SoulShackle);
                                                        if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                            
attacked.Owner.SendScreen(susetrue);
                                                    }
                                                }
                                            }
                                            
attacker.AttackPacket null;
                                            break;
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region Pirate
                                #region GaleBomb
                                
case 11070:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
Map map;
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
MsgMagicEffect.DamageClass tar = new MsgMagicEffect.DamageClass();
                                            
int num 0;
                                            switch (
spell.Level)
                                            {
                                                case 
0:
                                                case 
1num 3; break;
                                                case 
2:
                                                case 
3num 4; break;
                                                default: 
num 5; break;
                                            }
                                            
int i 0;
                                            
Kernel.Maps.TryGetValue(attacker.Owner.Map.BaseIDout map);
                                            foreach (var 
t in attacker.Owner.Screen.Objects)
                                            {
                                                if (
== null) continue;
                                                if (
t.MapObjType == MapObjectType.Player || t.MapObjType == MapObjectType.Monster)
                                                {
                                                    var 
target as Player;
                                                    if (
Kernel.GetDistance(XYtarget.Xtarget.Y) <= spell.Range)
                                                    {
                                                        if (
CanAttack(attackertargetspellfalse))
                                                        {
                                                            
tar.Damage Calculate.Melee(attackertargetref attackspell);
                                                            
tar.Hit true;
                                                            
tar.newX target.X;
                                                            
tar.newY target.Y;
                                                            
Map.Pushback(ref tar.newXref tar.newYattacker.Facing5);
                                                            if (
map != null)
                                                            {
                                                                if (
map.Floor[tar.newXtar.newYMapObjectType.Playerattacker])
                                                                {
                                                                    
target.tar.newX;
                                                                    
target.tar.newY;
                                                                }
                                                                else
                                                                {
                                                                    
tar.newX target.X;
                                                                    
tar.newY target.Y;
                                                                }
                                                            }
                                                            else
                                                            {
                                                                if (
attacker.Owner.Map.Floor[tar.newXtar.newYMapObjectType.Playerattacker])
                                                                {
                                                                    
target.tar.newX;
                                                                    
target.tar.newY;
                                                                }
                                                                else
                                                                {
                                                                    
target.tar.newX;
                                                                    
target.tar.newY;
                                                                }
                                                            }
                                                            
suse.AddTarget(target.UIDtarattack);
                                                            
ReceiveAttack(attackertargetattackref tar.Damagespell);
                                                            
i++;
                                                            if (
num) break;
                                                        }
                                                    }
                                                }
                                            }
                                            if (
attacker.PlayerFlag == PlayerFlag.Player)
                                                
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region BladeTempest
                                
case 11110:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(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.XXattacker.YYdistInLineAlgorithm.Algorithm.DDA);
                                            
attacker.X;
                                            
attacker.Y;
                                            
int i 0;
                                            for (
0algo.lcoords.Counti++)
                                            {
                                                if (
attacker.Owner.Map.Floor[algo.lcoords[i].Xalgo.lcoords[i].YMapObjectType.Player]
                                                    && !
attacker.ThroughGate(algo.lcoords[i].Xalgo.lcoords[i].Y))
                                                {
                                                    
= (ushort)algo.lcoords[i].X;
                                                    
= (ushort)algo.lcoords[i].Y;
                                                }
                                                else
                                                {
                                                    break;
                                                }
                                            }
                                            
suse.X;
                                            
suse.Y;
                                            if (!
attacker.Owner.Map.Floor[XYMapObjectType.Playernull]) return;
                                            
double disth 1.5;
                                            foreach (
Interfaces.IMapObject _obj in Array)
                                            {
                                                
bool hit false;
                                                for (
int j 0ij++)
                                                    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 Player;
                                                        if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                        {
                                                            var 
damage Calculate.Melee(attackerattackedref attackspell);
                                                            
ReceiveAttack(attackerattackedattackref damagespell);

                                                            
suse.AddTarget(attacked.UIDdamageattack);
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        
attacked _obj as Player;
                                                        if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                        {
                                                            var 
damage Calculate.Melee(attackerattackedref attackspell);
                                                            
/*if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.King)
                                                                if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.King)
                                                                {
                                                                    damage = (uint)(damage * 0.9);
                                                                }
                                                            if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Prince)
                                                            {
                                                                damage = (uint)(damage * 0.9);
                                                            }
                                                            if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Duke)
                                                            {
                                                                damage = (uint)(damage * 0.9);
                                                            }
                                                            if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Earl)
                                                            {*/
                                                                
damage = (uint)(damage 1.0);
                                                            
//}
                                                            
ReceiveAttack(attackerattackedattackref damagespell);

                                                            
suse.AddTarget(attacked.UIDdamageattack);
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob _obj as MsgNpcInfoEX;
                                                        if (
CanAttack(attackerattackedsobspell))
                                                        {
                                                            var 
damage Calculate.Melee(attackerattackedsobref attack);
                                                            
ReceiveAttack(attackerattackedsobattackdamagespell);

                                                            
suse.AddTarget(attackedsob.UIDdamageattack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.PX attacker.X;
                                            
attacker.PY attacker.Y;
                                            
attacker.X;
                                            
attacker.Y;
                                            
attacker.Owner.SendScreen(susetrue);
                                            
attacker.Owner.Screen.Reload(suse);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Kraken`sRevenge
                                
case 11100:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
int num 0;
                                            switch (
spell.Level)
                                            {
                                                case 
0:
                                                case 
1num 3; break;
                                                case 
2:
                                                case 
3num 4; break;
                                                default: 
num 5; break;
                                            }
                                            
int i 0;
                                            
MsgDeadMark bsp = new MsgDeadMark();
                                            foreach (var 
t in attacker.Owner.Screen.Objects.OrderBy(=> Kernel.GetDistance(x.Xx.Yattacker.Owner.Player.Xattacker.Owner.Player.Y)))
                                            {
                                                if (
== null)
                                                    continue;
                                                if (
t.MapObjType == MapObjectType.Player || t.MapObjType == MapObjectType.Monster)
                                                {
                                                    var 
target as Player;
                                                    if (
CanAttack(attackertargetspellfalse))
                                                    {
                                                        
target.IsBlackSpotted true;
                                                        
target.BlackSpotStamp Time32.Now;
                                                        
target.BlackSpotStepSecs spell.Duration;
                                                        
Kernel.BlackSpoted.TryAdd(target.UIDtarget);
                                                        
suse.AddTarget(target.UID, new MsgMagicEffect.DamageClass(), attack);
                                                        
i++;
                                                        if (
== num) break;
                                                    }
                                                }
                                            }
                                            if (
attacker.PlayerFlag == PlayerFlag.Player)
                                                
attacker.Owner.SendScreen(susetrue);
                                            foreach (var 
h in Server.GamePool)
                                            {
                                                foreach (var 
t in suse.Targets.Keys)
                                                {
                                                    
h.Send(bsp.ToArray(truet));
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region ScurvyBomb
                                
case 11040:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            if (
Kernel.GetDistance(attacker.Xattacker.YXY) <= spell.Distance)
                                            {
                                                foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        
attacked _obj as Player;
                                                        if (
Kernel.GetDistance(XYattacked.Xattacked.Y) <= spell.Range)
                                                        {
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            {
                                                                
int potDifference attacker.BattlePower attacked.BattlePower;
                                                                
int rate spell.Percent potDifference;
                                                                if (
Kernel.Rate(rate))
                                                                {
                                                                    if (
_obj.MapObjType == MapObjectType.Player)
                                                                    {
                                                                        
attacked.ScurbyBombStamp Time32.Now;
                                                                        
attacked.ScurbyBomb2Stamp Time32.Now;
                                                                        
attacked.ScurbyBomb 20;
                                                                        
attacked.AddFlag2((ulong)MsgUpdate.Flags2.ScurvyBomb);
                                                                        
MsgUpdate upgrade = new MsgUpdate(true);
                                                                        
upgrade.UID attacked.UID;
                                                                        
upgrade.Append((byte)MsgUpdate.DataType.Fatigue202000);
                                                                        
attacked.Owner.Send(upgrade.ToArray());
                                                                    }
                                                                    
attack.Effect MsgInteract.InteractEffects.None;
                                                                    
uint damage Calculate.Melee(attackerattackedref attackspell);
                                                                    
suse.Effect attack.Effect;
                                                                    
ReceiveAttack(attackerattackedattackref damagespell);
                                                                    
suse.Targets.Add(attacked.UIDdamage);
                                                                }
                                                                else
                                                                {
                                                                    
suse.Targets.Add(attacked.UID0);
                                                                    
suse.Targets[attacked.UID].Hit false;
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket null;
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Cannon Barrage
                                
case 11050:
                                    {
                                        if (
attacker.Owner.Player.ContainsFlag((ulong)MsgUpdate.Flags.XPList))
                                        {
                                            
attacker.Owner.Player.RemoveFlag((ulong)MsgUpdate.Flags.XPList);
                                            
attacker.Owner.Player.AddFlag2((ulong)MsgUpdate.Flags2.CannonBarrage);
                                            
attacker.Owner.Player.CannonBarrageStamp Time32.Now;
                                            return;
                                        }
                                        
PrepareSpell(spellattacker.Owner);
                                        
MsgMagicEffect suse = new MsgMagicEffect(true);
                                        
suse.Attacker attacker.UID;
                                        
suse.SpellID spell.ID;
                                        
suse.SpellLevel spell.Level;
                                        
suse.X;
                                        
suse.Y;
                                        
MsgMagicEffect.DamageClass tar = new MsgMagicEffect.DamageClass();
                                        foreach (var 
t in attacker.Owner.Screen.Objects)
                                        {
                                            if (
== null) continue;
                                            if (
t.MapObjType == MapObjectType.Player || t.MapObjType == MapObjectType.Monster)
                                            {
                                                var 
target as Player;
                                                if (
Kernel.GetDistance(attacker.Owner.Player.Xattacker.Owner.Player.Ytarget.Xtarget.Y) <= spell.Range)
                                                {
                                                    if (
CanAttack(attackertargetspellfalse))
                                                    {
                                                        
tar.Damage Calculate.Ranged(attackertargetref attack);
                                                        
ReceiveAttack(attackertargetattackref tar.Damagespell);
                                                        
suse.AddTarget(target.UIDtarattack);
                                                    }
                                                }
                                            }
                                        }
                                        if (
attacker.PlayerFlag == PlayerFlag.Player)
                                            
attacker.Owner.SendScreen(susetrue);
                                        break;
                                    }
                                
#endregion
                                #region Blackbeard`sRage
                                
case 11060:
                                    {
                                        if (
attacker.Owner.Player.ContainsFlag((ulong)MsgUpdate.Flags.XPList))
                                        {
                                            
attacker.Owner.Player.RemoveFlag((ulong)MsgUpdate.Flags.XPList);
                                            
attacker.Owner.Player.AddFlag2((ulong)MsgUpdate.Flags2.BlackbeardsRage);
                                            
attacker.Owner.Player.BlackbeardsRageStamp Time32.Now;
                                            return;
                                        }
                                        
int targets 0;
                                        switch (
spell.Level)
                                        {
                                            case 
0:
                                            case 
1targets 3; break;
                                            case 
2:
                                            case 
3targets 4; break;
                                            default: 
targets 5; break;
                                        }
                                        
int i 0;
                                        
PrepareSpell(spellattacker.Owner);
                                        
MsgMagicEffect suse = new MsgMagicEffect(true);
                                        
suse.Attacker attacker.UID;
                                        
suse.SpellID spell.ID;
                                        
suse.SpellLevel spell.Level;
                                        
suse.X;
                                        
suse.Y;
                                        
MsgMagicEffect.DamageClass tar = new MsgMagicEffect.DamageClass();
                                        foreach (var 
t in attacker.Owner.Screen.Objects)
                                        {
                                            if (
== null) continue;
                                            if (
t.MapObjType == MapObjectType.Player || t.MapObjType == MapObjectType.Monster)
                                            {
                                                var 
target as Player;
                                                if (
Kernel.GetDistance(attacker.Owner.Player.Xattacker.Owner.Player.Ytarget.Xtarget.Y) <= spell.Range)
                                                {
                                                    if (
CanAttack(attackertargetspellfalse))
                                                    {
                                                        
tar.Damage Calculate.Ranged(attackertargetref attack);
                                                        
suse.AddTarget(target.UIDtarattack);
                                                        
ReceiveAttack(attackertargetattackref tar.Damagespell);
                                                        
i++;
                                                        if (
== targets) break;
                                                    }
                                                }
                                            }
                                        }
                                        if (
attacker.PlayerFlag == PlayerFlag.Player)
                                            
attacker.Owner.SendScreen(susetrue);
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region Warrior
                                #region ExtraXP
                                
case 1040:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            if (
attacker.Owner.Team != null)
                                                foreach (
Client.GameState teammate in attacker.Owner.Team.Teammates)
                                                {
                                                    if (
teammate.Player.UID != attacker.UID)
                                                    {
                                                        if (
Kernel.GetDistance(attacker.Xattacker.Yteammate.Player.Xteammate.Player.Y) <= spell.Distance)
                                                        {
                                                            
teammate.XPCount += 20;
                                                            
MsgUpdate update = new MsgUpdate(true);
                                                            
update.UID teammate.Player.UID;
                                                            
update.Append((byte)MsgUpdate.DataType.XPCircleteammate.XPCount);
                                                            
update.Send(teammate);
                                                            
suse.Targets.Add(teammate.Player.UID20);
                                                            if (
spell.NextSpellID != 0)
                                                            {
                                                                
attack.Damage spell.NextSpellID;
                                                                
attacker.AttackPacket attack;
                                                            }
                                                            else 
attacker.AttackPacket null;
                                                        }
                                                    }
                                                }
                                            if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                
attacked.Owner.SendScreen(susetrue);
                                            else 
attacked.MonsterInfo.SendScreen(suse);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Dash
                                
case 1051:
                                    {
                                        if (
attacked != null)
                                        {
                                            if (!
attacked.Dead)
                                            {
                                                var 
direction Kernel.GetAngle(attacker.Xattacker.Yattacked.Xattacked.Y);
                                                if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                {
                                                    
attack = new MsgInteract(true);
                                                    
attack.Effect MsgInteract.InteractEffects.None;
                                                    
uint damage Calculate.Melee(attackerattackedref attack);
                                                    
attack.InteractType MsgInteract.Dash;
                                                    
attack.attacked.X;
                                                    
attack.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(attackerattackedattackref damagespell);
                                                    
attacker.Owner.SendScreen(attacktrue);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region MagicDefender
                                
case 11200:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            if (
attacker.Class >= 20 && attacker.Class <= 25)
                                            {
                                                if (!
attacker.ContainsFlag3((ulong)MsgUpdate.Flags3.MagicDefender))
                                                {
                                                    
PrepareSpell(spellattacker.Owner);
                                                    
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                    
suse.Attacker attacker.UID;
                                                    
suse.SpellID spell.ID;
                                                    
suse.SpellLevel spell.Level;
                                                    
suse.X;
                                                    
suse.Y;
                                                    if (
attacker.ContainsFlag3((ulong)MsgUpdate.Flags3.MagicDefender))
                                                    {
                                                        
attacker.RemoveFlag3((ulong)MsgUpdate.Flags3.MagicDefender);
                                                        
attacker.RemoveFlag2((ulong)MsgUpdate.Flags2.MagicDefenderIcon);
                                                    }
                                                    
attacker.MagicDefenderStamp Time32.Now;
                                                    
attacker.MagicDefender spell.Duration;
                                                    
attacker.AddFlag3((ulong)MsgUpdate.Flags3.MagicDefender);
                                                    
attacker.AddFlag2((ulong)MsgUpdate.Flags2.MagicDefenderIcon);
                                                    
MsgUpdate upgrade = new MsgUpdate(true);
                                                    
upgrade.UID attacker.UID;
                                                    
upgrade.Append((byte)MsgUpdate.DataType.AzureShield128, (uint)spell.Duration0spell.Level);
                                                    
attacker.Owner.Send(upgrade.ToArray());
                                                    
attacker.Owner.SendScreen(susetrue);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region ShieldBlock
                                
case 10470:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            if (
attacker.Class >= 20 && attacker.Class <= 25)
                                            {
                                                
PrepareSpell(spellattacker.Owner);
                                                
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                
suse.Attacker attacker.UID;
                                                
suse.SpellID spell.ID;
                                                
suse.SpellLevel spell.Level;
                                                
suse.X;
                                                
suse.Y;
                                                
attacker.BlockShieldStamp Time32.Now;
                                                
attacker.BlockShield spell.Duration;
                                                
attacker.BlockShieldCheck true;
                                                
attacker.Owner.ReloadBlock();
                                                
MsgUpdate upgrade = new MsgUpdate(true);
                                                
upgrade.UID attacker.UID;
                                                
upgrade.Append((byte)MsgUpdate.DataType.AzureShield113, (uint)spell.Durationspell.Powerspell.Level);
                                                
attacker.Owner.Send(upgrade.ToArray());
                                                
attacker.Owner.SendScreen(susetrue);
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region DefensiveStance
                                
case 11160:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            if (
attacker.Class >= 20 && attacker.Class <= 25)
                                            {
                                                
PrepareSpell(spellattacker.Owner);
                                                
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                
suse.Attacker attacker.UID;
                                                
suse.SpellID spell.ID;
                                                
suse.SpellLevel spell.Level;
                                                
suse.X;
                                                
suse.Y;
                                                if (
attacker.ContainsFlag2((ulong)MsgUpdate.Flags2.DefensiveStance))
                                                {
                                                    
attacker.RemoveFlag2((ulong)MsgUpdate.Flags2.DefensiveStance);
                                                    
attacker.DefensiveStance 0;
                                                }
                                                else if (!
attacker.ContainsFlag2((ulong)MsgUpdate.Flags2.DefensiveStance))
                                                {
                                                    
attacker.DefensiveStanceStamp Time32.Now;
                                                    
attacker.DefensiveStance spell.Duration;
                                                    
attacker.AddFlag2((ulong)MsgUpdate.Flags2.DefensiveStance);
                                                    
MsgUpdate upgrade = new MsgUpdate(true);
                                                    
upgrade.UID attacker.UID;
                                                    
upgrade.Append((byte)MsgUpdate.DataType.DefensiveStance126, (uint)spell.Duration, (uint)spell.PowerPercentspell.Level);
                                                    
attacker.Owner.Send(upgrade.ToArray());
                                                    
attacker.Owner.SendScreen(susetrue);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion

                                #region Trojan
                                #region CruelShabe
                                
case 3050:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            if (
attackedsob != null)
                                            {
                                                if (
Kernel.GetDistance(attacker.Xattacker.Yattackedsob.Xattackedsob.Y) <= spell.Distance)
                                                {
                                                    
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                    
suse.Attacker attacker.UID;
                                                    
suse.SpellID spell.ID;
                                                    
suse.SpellLevel spell.Level;
                                                    
suse.X;
                                                    
suse.Y;
                                                    if (
CanAttack(attackerattackedsobspell))
                                                    {
                                                        
PrepareSpell(spellattacker.Owner);
                                                        
uint damage Calculate.Percent(attackedsobspell.PowerPercent);
                                                        
attackedsob.Hitpoints -= damage;
                                                        
suse.AddTarget(attackedsob.UIDdamageattack);
                                                        
attacker.Owner.SendScreen(susetrue);
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Distance)
                                                {
                                                    
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                    
suse.Attacker attacker.UID;
                                                    
suse.SpellID spell.ID;
                                                    
suse.SpellLevel spell.Level;
                                                    
suse.X;
                                                    
suse.Y;
                                                    if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                    {
                                                        
PrepareSpell(spellattacker.Owner);
                                                        
uint damage Calculate.Percent(attackedspell.PowerPercent);
                                                        if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                        {
                                                            
attacker.Owner.UpdateQualifier(damage);
                                                        }
                                                        
attacked.Hitpoints -= damage;
                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                        if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                            
attacked.Owner.SendScreen(susetrue);
                                                        else 
attacked.MonsterInfo.SendScreen(suse);
                                                    }
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region SuperCyclone
                                
case 11970:
                                    {
                                        
MsgMagicEffect suse = new MsgMagicEffect(true);
                                        
suse.Attacker attacker.UID;
                                        
suse.SpellID spell.ID;
                                        
suse.SpellLevel spell.Level;
                                        
suse.X;
                                        
suse.Y;
                                        if (
attacker.OnSuperCyclone()) return;
                                        if (
attacker.ContainsFlag((ulong)MsgUpdate.Flags.XPList))
                                        {
                                            if (!
attacked.OnKOSpell())
                                                
attacked.KOCount 0;
                                            
attacked.KOSpell spell.ID;
                                            
attacked.SuperCycloneTime 40;
                                            
attacker.AddFlag3((ulong)MsgUpdate.Flags3.SuperCyclone);
                                            
attacker.SuperCycloneStamp Time32.Now;
                                            
attacker.RemoveFlag((ulong)MsgUpdate.Flags.XPList);
                                        }
                                        
attacker.Owner.SendScreen(susetrue);
                                        break;
                                    }
                                
#endregion
                                #region FatalCross
                                
case 11980:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID SpellID;
                                            
suse.SpellLevel attacker.Owner.Spells[SpellID].Level;
                                            
suse.X;
                                            
suse.Y;
                                            
RangeMove moveIn = new RangeMove();
                                            List<
RangeMove.Coordsranger moveIn.MoveCoords(attacker.Xattacker.YXY);
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null) continue;
                                                if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                {
                                                    
attacked _obj as Player;
                                                    if (!
moveIn.InRange(attacked.Xattacked.Y2ranger)) continue;
                                                    {
                                                        if (!
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee)) continue;
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Melee(attackerattackedref attackspell);
                                                        
//if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.King)
                                                        //{
                                                            
damage = (uint)(damage 1.3);
                                                        
//}
                                                        //if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Prince)
                                                        //{
                                                           // damage = (uint)(damage * 0.9);
                                                        //}
                                                        //if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Duke)
                                                        //{
                                                            //damage = (uint)(damage * 0.9);
                                                        //}
                                                        
if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Earl)
                                                        
//{
                                                            //damage = (uint)(damage * 0.9);
                                                        //}
                                                        
suse.Effect attack.Effect;
                                                        
attack.Damage damage;
                                                        
ReceiveAttack(attackerattackedattackref damagespell);
                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                    }
                                                }
                                                else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    
attackedsob _obj as MsgNpcInfoEX;
                                                    if (
attackedsob == null) continue;
                                                    if (!
moveIn.InRange(attackedsob.Xattackedsob.Y2ranger)) continue;
                                                    {
                                                        if (!
CanAttack(attackerattackedsobspell)) continue;
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Melee(attackerattackedsobref attack);
                                                        
attack.Damage damage;
                                                        
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                        
suse.AddTarget(attackedsob.UIDdamageattack);
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region MortalStrike
                                
case 11990:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
Sector sector = new Sector(attacker.Xattacker.YXY);
                                            
sector.Arrange(spell.Sectorspell.Range);
                                            if (
Kernel.GetDistance(attacker.Xattacker.YXY) <= spell.Distance 1)
                                            {
                                                foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (
_obj == null) continue;
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        
attacked _obj as Player;

                                                        if (
sector.Inside(attacked.Xattacked.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            {
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Calculate.Melee(attackerattackedref attackspell);
                                                                if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.King)
                                                                {
                                                                    
damage = (uint)(damage 1.0);
                                                                }
                                                                if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Prince)
                                                                {
                                                                    
damage = (uint)(damage 0.8);
                                                                }
                                                                if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Duke)
                                                                {
                                                                    
damage = (uint)(damage 0.6);
                                                                }
                                                                if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Earl)
                                                                {
                                                                    
damage = (uint)(damage 0.4);
                                                                }
                                                                
suse.Effect attack.Effect;
                                                                
ReceiveAttack(attackerattackedattackref damagespell);
                                                                
suse.AddTarget(attacked.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob _obj as MsgNpcInfoEX;
                                                        if (
CanAttack(attackerattackedsobspell))
                                                        {
                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                            var 
damage Calculate.Melee(attackerattackedsobref attack);
                                                            
suse.Effect attack.Effect;
                                                            
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                            
suse.AddTarget(attackedsob.UIDdamageattack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.PX attacker.X;
                                            
attacker.PY attacker.Y;
                                            
attacker.X;
                                            
attacker.Y;
                                            
attacker.Owner.SendScreen(susetrue);
                                            
attacker.Owner.Screen.Reload(suse);
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region LeeLong
                                #region DragonFlow
                                
case 12270:
                                    {
                                        if (
attacker.ContainsFlag3((ulong)MsgUpdate.Flags3.DragonFlow))
                                        {
                                            
attacker.RemoveFlag3((ulong)MsgUpdate.Flags3.DragonFlow);
                                        }
                                        else
                                        {
                                            
MsgMagicEffect MsgMagicEffect = new MsgMagicEffect(true);
                                            
MsgMagicEffect.Attacker attacker.UID;
                                            
MsgMagicEffect.Attacker1 attacker.UID;
                                            
MsgMagicEffect.SpellID spell.ID;
                                            
MsgMagicEffect.SpellLevel spell.Level;
                                            
MsgMagicEffect.X;
                                            
MsgMagicEffect.Y;
                                            
MsgMagicEffect.AddTarget(attacker.UID1null);
                                            
attacker.Owner.SendScreen(MsgMagicEffecttrue);
                                            
attacker.AddFlag3((ulong)MsgUpdate.Flags3.DragonFlow);
                                            
attacker.DragonFlowStamp Time32.Now;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region DragonRoar
                                
case 12280:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
PrepareSpell(spellattacker.Owner);
                                            if (
attacker.Owner.Team != null)
                                            {
                                                foreach (var 
teammate in attacker.Owner.Team.Teammates)
                                                {
                                                    if (
teammate.Player.UID != attacker.UID)
                                                    {
                                                        if (
Kernel.GetDistance(attacker.Xattacker.Yteammate.Player.Xteammate.Player.Y) <= spell.Range)
                                                        {
                                                            
teammate.Player.Stamina += (byte)spell.Power;
                                                            
suse.AddTarget(teammate.Player.UIDspell.Powernull);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region DragonCyclone
                                
case 12290:
                                    {
                                        
MsgMagicEffect suse = new MsgMagicEffect(true);
                                        
suse.Attacker attacker.UID;
                                        
suse.SpellID spell.ID;
                                        
suse.SpellLevel spell.Level;
                                        
suse.X;
                                        
suse.Y;
                                        if (
attacker.ContainsFlag((ulong)MsgUpdate.Flags.XPList))
                                        {
                                            
attacker.KOCount 0;
                                            
attacker.DragonCycloneTime 40;
                                            
attacker.RemoveFlag((ulong)MsgUpdate.Flags.XPList);
                                            
attacker.AddFlag3((ulong)MsgUpdate.Flags3.DragonCyclone);
                                            
attacker.DragonCycloneStamp Time32.Now;
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        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.XXattacker.YYdistInLineAlgorithm.Algorithm.DDA);
                                            
attacker.X;
                                            
attacker.Y;
                                            
int i 0;
                                            for (
0algo.lcoords.Counti++)
                                            {
                                                if (
attacker.Owner.Map.Floor[algo.lcoords[i].Xalgo.lcoords[i].YMapObjectType.Player] && !attacker.ThroughGate(algo.lcoords[i].Xalgo.lcoords[i].Y))
                                                {
                                                    
= (ushort)algo.lcoords[i].X;
                                                    
= (ushort)algo.lcoords[i].Y;
                                                }
                                                else
                                                {
                                                    break;
                                                }
                                            }
                                            
suse.X;
                                            
suse.Y;
                                            if (!
attacker.Owner.Map.Floor[XYMapObjectType.Playernull]) return;
                                            
double disth 1.5;
                                            foreach (
Interfaces.IMapObject _obj in Array)
                                            {
                                                
bool hit false;
                                                for (
int j 0ij++)
                                                    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 Player;
                                                        if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                        {
                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                            var 
damage Calculate.Melee(attackerattackedref attackspell);
                                                            
suse.Effect attack.Effect;
                                                            
damage = (uint)((damage spell.PowerPercent) / 3);
                                                            
ReceiveAttack(attackerattackedattackref damagespell);
                                                            
suse.AddTarget(attacked.UIDdamageattack);
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        
attacked _obj as Player;
                                                        if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                        {
                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                            var 
damage Calculate.Melee(attackerattackedref attackspell);
                                                            
suse.Effect attack.Effect;
                                                            
damage = (uint)(damage 0.4);
                                                            
ReceiveAttack(attackerattackedattackref damagespell);
                                                            
suse.AddTarget(attacked.UIDdamageattack);
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob _obj as MsgNpcInfoEX;
                                                        if (
CanAttack(attackerattackedsobspell))
                                                        {
                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                            var 
damage Calculate.Melee(attackerattackedsobref attack);
                                                            
suse.Effect attack.Effect;
                                                            
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                            
suse.AddTarget(attackedsob.UIDdamageattack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.PX attacker.X;
                                            
attacker.PY attacker.Y;
                                            
attacker.X;
                                            
attacker.Y;
                                            
attacker.Owner.SendScreen(susetrue);
                                            
attacker.Owner.Screen.Reload(suse);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region DragonSlash
                                
case 12350:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
InLineAlgorithm ila = new InLineAlgorithm(attacker.XXattacker.YY, (byte)spell.RangeInLineAlgorithm.Algorithm.DDA);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.Attacker1 attacker.UID;
                                            
suse.SpellID SpellID;
                                            
suse.SpellLevel attacker.Owner.Spells[SpellID].Level;
                                            
suse.X;
                                            
suse.Y;
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null) continue;
                                                if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                {
                                                    
attacked _obj as Player;
                                                    if (
ila.InLine(attacked.Xattacked.Y))
                                                    {
                                                        if (!
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee)) continue;
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Melee(attackerattackedref attackspell);
                                                        if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.King)
                                                        {
                                                            
damage = (uint)(damage 0.7);
                                                        }
                                                        if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Prince)
                                                        {
                                                            
damage = (uint)(damage 0.4);
                                                        }
                                                        if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Duke)
                                                        {
                                                            
damage = (uint)(damage 0.5);
                                                        }
                                                        if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Earl)
                                                        {
                                                            
damage = (uint)(damage 0.3);
                                                        }
                                                        
suse.Effect attack.Effect;
                                                        
ReceiveAttack(attackerattackedattackref damagespell);
                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                    }
                                                }
                                                else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    
attackedsob _obj as MsgNpcInfoEX;
                                                    if (
ila.InLine(attackedsob.Xattackedsob.Y))
                                                    {
                                                        if (!
CanAttack(attackerattackedsobspell)) continue;
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Melee(attackerattackedsobref attack);
                                                        
suse.Effect attack.Effect;
                                                        
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                        
suse.AddTarget(attackedsob.UIDdamageattack);
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region AirKick
                                
case 12320:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(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.XXattacker.YYdistInLineAlgorithm.Algorithm.DDA);
                                            
attacker.X;
                                            
attacker.Y;
                                            
int i 0;
                                            for (
0algo.lcoords.Counti++)
                                            {
                                                if (
attacker.Owner.Map.Floor[algo.lcoords[i].Xalgo.lcoords[i].YMapObjectType.Player]
                                                    && !
attacker.ThroughGate(algo.lcoords[i].Xalgo.lcoords[i].Y))
                                                {
                                                    
= (ushort)algo.lcoords[i].X;
                                                    
= (ushort)algo.lcoords[i].Y;
                                                }
                                                else
                                                {
                                                    break;
                                                }
                                            }
                                            
suse.X;
                                            
suse.Y;
                                            if (!
attacker.Owner.Map.Floor[XYMapObjectType.Playernull]) return;
                                            
double disth 1.5;
                                            foreach (
Interfaces.IMapObject _obj in Array)
                                            {
                                                
bool hit false;
                                                for (
int j 0ij++)
                                                    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 Player;
                                                        if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                        {
                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                            var 
damage Calculate.Melee(attackerattackedref attackspell);
                                                            
suse.Effect attack.Effect;
                                                            
ReceiveAttack(attackerattackedattackref damagespell);
                                                            
suse.AddTarget(attacked.UIDdamageattack);
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        
attacked _obj as Player;
                                                        if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                        {
                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                            var 
damage Calculate.Melee(attackerattackedref attackspell);
                                                            
damage = (uint)(damage 1.0);
                                                            
suse.Effect attack.Effect;
                                                            
ReceiveAttack(attackerattackedattackref damagespell);
                                                            
suse.AddTarget(attacked.UIDdamageattack);
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob _obj as MsgNpcInfoEX;
                                                        if (
CanAttack(attackerattackedsobspell))
                                                        {
                                                            
attack.Effect MsgInteract.InteractEffects.None;
                                                            var 
damage Calculate.Melee(attackerattackedsobref attack);
                                                            
suse.Effect attack.Effect;
                                                            
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                            
suse.AddTarget(attackedsob.UIDdamageattack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.PX attacker.X;
                                            
attacker.PY attacker.Y;
                                            
attacker.X;
                                            
attacker.Y;
                                            
attacker.Owner.SendScreen(susetrue);
                                            
attacker.Owner.Screen.Reload(suse);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region AirSweep & AirRaid
                                
case 12330:
                                case 
12340:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
Sector sector = new Sector(attacker.Xattacker.YXY);
                                            
sector.Arrange(spell.Sectorspell.Range);
                                            if (
Kernel.GetDistance(attacker.Xattacker.YXY) <= spell.Range)
                                            {
                                                foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (
_obj == null) continue;
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        
attacked _obj as Player;
                                                        if (
sector.Inside(attacked.Xattacked.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            {
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Calculate.Melee(attackerattackedref attackspell);
                                                                
suse.Effect attack.Effect;
                                                                
ReceiveAttack(attackerattackedattackref damagespell);
                                                                
suse.AddTarget(attacked.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob _obj as MsgNpcInfoEX;
                                                        if (
sector.Inside(attackedsob.Xattackedsob.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedsobspell))
                                                            {
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Calculate.Melee(attackerattackedsobref attack);
                                                                
suse.Effect attack.Effect;
                                                                
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                                
suse.AddTarget(attackedsob.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket null;
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Speed Kick
                                
case 12120:
                                case 
12130:
                                case 
12140:
                                    {
                                        
MsgMagicEffect suse = new MsgMagicEffect(true);
                                        
suse.Attacker attacker.UID;
                                        
suse.SpellID spell.ID;
                                        
suse.SpellLevel spell.Level;
                                        
suse.X;
                                        
suse.Y;
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            if (
attacked != null)
                                            {
                                                if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Distance)
                                                {
                                                    if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                    {
                                                        
PrepareSpell(spellattacker.Owner);
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Melee(attackerattackedref attackspell);
                                                        
damage = (uint)(damage 1.0);
                                                        
suse.Effect attack.Effect;
                                                        
ReceiveAttack(attackerattackedattackref damagespell);
                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                    }
                                                }
                                                else
                                                {
                                                    
attacker.AttackPacket null;
                                                }
                                            }
                                            else
                                            {
                                                if (
Kernel.GetDistance(attacker.Xattacker.Yattackedsob.Xattackedsob.Y) <= spell.Distance)
                                                {
                                                    if (
CanAttack(attackerattackedsobspell))
                                                    {
                                                        
PrepareSpell(spellattacker.Owner);
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Magic(attackerattackedsobspellref attack);
                                                        
suse.Effect attack.Effect;
                                                        
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                        
suse.AddTarget(attackedsob.UIDdamageattack);
                                                    }
                                                }
                                            }
                                        }
                                        else
                                        {
                                            
attacker.AttackPacket null;
                                        }
                                        
attacker.PX attacker.X;
                                        
attacker.PY attacker.Y;
                                        
attacker.X;
                                        
attacker.Y;
                                        
attacker.Owner.SendScreen(susetrue);
                                        
attacker.Owner.Screen.Reload(suse);
                                        break;
                                    }
                                
#endregion
                                #region Cracking swipe
                                
case 12170:
                                case 
12160:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
Fan sector = new Fan(attacker.Xattacker.YXYspell.Rangespell.Sector);
                                            if (
Kernel.GetDistance(attacker.Xattacker.YXY) <= spell.Distance 1)
                                            {
                                                foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (
_obj == null) continue;
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        
attacked _obj as Player;
                                                        if (
sector.IsInFan(attacked.Xattacked.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            {
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Calculate.Melee(attackerattackedref attackspell);
                                                                if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.King)
                                                                {
                                                                    
damage = (uint)(damage 0.6);
                                                                }
                                                                if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Prince)
                                                                {
                                                                    
damage = (uint)(damage 0.6);
                                                                }
                                                                if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Duke)
                                                                {
                                                                    
damage = (uint)(damage 0.6);
                                                                }
                                                                if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Earl)
                                                                {
                                                                    
damage = (uint)(damage 0.6);
                                                                }
                                                                
suse.Effect attack.Effect;
                                                                
ReceiveAttack(attackerattackedattackref damagespell);
                                                                
suse.AddTarget(attacked.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob _obj as MsgNpcInfoEX;
                                                        if (
sector.IsInFan(attackedsob.Xattackedsob.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedsobspell))
                                                            {
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Calculate.Melee(attackerattackedsobref attack);
                                                                
suse.Effect attack.Effect;
                                                                
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                                
suse.AddTarget(attackedsob.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket null;
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Dragon Punch
                                
case 12240:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
InLineAlgorithm ila = new InLineAlgorithm(attacker.XXattacker.YY, (byte)spell.RangeInLineAlgorithm.Algorithm.DDA);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID SpellID;
                                            
suse.SpellLevel attacker.Owner.Spells[SpellID].Level;
                                            
suse.X;
                                            
suse.Y;
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null) continue;
                                                if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                {
                                                    
attacked _obj as Player;
                                                    if (
ila.InLine(attacked.Xattacked.Y))
                                                    {
                                                        if (!
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee)) continue;
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Melee(attackerattackedref attackspell);
                                                        
suse.Effect attack.Effect;
                                                        
ReceiveAttack(attackerattackedattackref damagespell);
                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                    }
                                                }
                                                else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    
attackedsob _obj as MsgNpcInfoEX;
                                                    if (
CanAttack(attackerattackedsobspell))
                                                    {
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Melee(attackerattackedsobref attack);
                                                        
suse.Effect attack.Effect;
                                                        
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                        
suse.AddTarget(attackedsob.UIDdamageattack);
                                                    }
                                                }
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region DragonFury
                                
case 12300:
                                    {
                                        if (
attacked != null)
                                        {
                                            if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Distance)
                                            {
                                                if (
CanUseSpell(spellattacker.Owner))
                                                {
                                                    
PrepareSpell(spellattacker.Owner);
                                                    
MsgMagicEffect suse = new MsgMagicEffect(true);
                                                    
suse.Attacker attacker.UID;
                                                    
suse.SpellID spell.ID;
                                                    
suse.SpellLevel spell.Level;
                                                    
suse.X;
                                                    
suse.Y;
                                                    if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                    {
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Calculate.Melee(attackerattackedref attackspell);
                                                        
suse.Effect attack.Effect;
                                                        
ReceiveAttack(attackerattackedattackref damagespell);
                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                        
attacker.Owner.Player.IsEagleEyeShooted true;
                                                        if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                            
attacked.Owner.SendScreen(susetrue);
                                                        else 
attacked.MonsterInfo.SendScreen(suse);
                                                        if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                        {
                                                            
int potDifference attacker.BattlePower attacked.BattlePower;
                                                            
int rate spell.Percent potDifference 20;
                                                            if (
Kernel.Rate(rate))
                                                            {
                                                                
attacked.AddFlag3((ulong)MsgUpdate.Flags3.DragonFury);
                                                                
attacked.DragonFuryStamp Time32.Now;
                                                                
attacked.DragonFuryTime spell.Duration;
                                                                
MsgUpdate upgrade = new MsgUpdate(true);
                                                                
upgrade.UID attacked.UID;
                                                                
upgrade.Append((byte)MsgUpdate.DataType.DragonFury, (uint)spell.Status, (uint)spell.Durationspell.Powerspell.Level);
                                                                
attacker.Owner.Send(upgrade.ToArray());
                                                                if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                                    
attacked.Owner.Send(upgrade);
                                                                else 
attacked.MonsterInfo.SendScreen(upgrade);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region DragonSwing
                                
case 12200:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect MsgMagicEffect = new MsgMagicEffect(true);
                                            
MsgMagicEffect.Attacker attacker.UID;
                                            
MsgMagicEffect.SpellID spell.ID;
                                            
MsgMagicEffect.SpellLevel spell.Level;
                                            
MsgMagicEffect.X;
                                            
MsgMagicEffect.Y;
                                            
attacker.Owner.SendScreen(MsgMagicEffecttrue);
                                            if (!
attacker.ContainsFlag3((ulong)MsgUpdate.Flags3.DragonSwing))
                                            {
                                                
attacker.AddFlag3((ulong)MsgUpdate.Flags3.DragonSwing);
                                                
MsgUpdate upgrade = new MsgUpdate(true);
                                                
upgrade.UID attacker.UID;
                                                
upgrade.Append((byte)MsgUpdate.DataType.DragonSwing1100000000);
                                                
attacker.Owner.Send(upgrade.ToArray());
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region New Tao
                                #region AuroraLotus
                                
case 12370:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            if (!
attacker.ContainsFlag3((ulong)MsgUpdate.Flags3.AuroraLotus)) return;
                                            var 
map attacker.Owner.Map;
                                            if (!
map.Floor[XYMapObjectType.Itemnull]) return;
                                            
PrepareSpell(spellattacker.Owner);

                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.Attacker1 attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.AddTarget(attacker.UID0null);
                                            
attacker.Owner.SendScreen(susetrue);

                                            
MsgMapItem floorItem = new MsgMapItem(true);
                                            
floorItem.ItemID MsgMapItem.AuroraLotus;
                                            
floorItem.MapID attacker.MapID;
                                            
floorItem.Type MsgMapItem.Effect;
                                            
floorItem.X;
                                            
floorItem.Y;
                                            
floorItem.OnFloor Time32.Now;
                                            
floorItem.Owner attacker.Owner;
                                            
floorItem.UID MsgMapItem.FloorUID.Next;
                                            while (
map.FloorItems.ContainsKey(floorItem.UID))
                                                
floorItem.UID MsgMapItem.FloorUID.Next;

                                            
floorItem.MaxLife 25;
                                            
floorItem.Life 25;
                                            
floorItem.mColor 13;
                                            
floorItem.OwnerUID attacker.UID;
                                            
floorItem.OwnerGuildUID attacker.GuildID;
                                            
floorItem.FlowerType 0;
                                            
floorItem.Time Kernel.TqTimer(DateTime.Now.AddSeconds(7));
                                            
floorItem.Name "AuroraLotus";
                                            
map.AddFloorItem(floorItem);
                                            
attacker.Owner.SendScreenSpawn(floorItemtrue);
                                            
attacker.AuroraLotusEnergy 0;
                                            
attacker.Lotus(attacker.AuroraLotusEnergy, (byte)MsgUpdate.DataType.AuroraLotus);
                                            
attacker.AttackPacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region FlameLotus
                                
case 12380:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            if (!
attacker.ContainsFlag3((ulong)MsgUpdate.Flags3.FlameLotus)) return;
                                            var 
map attacker.Owner.Map;
                                            if (!
map.Floor[XYMapObjectType.Itemnull]) return;
                                            
PrepareSpell(spellattacker.Owner);

                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.Attacker1 attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.AddTarget(attacker.UID0null);
                                            
attacker.Owner.SendScreen(susetrue);

                                            
MsgMapItem floorItem = new MsgMapItem(true);
                                            
floorItem.ItemID MsgMapItem.FlameLotus;
                                            
floorItem.MapID attacker.MapID;
                                            
floorItem.Type MsgMapItem.Effect;
                                            
floorItem.X;
                                            
floorItem.Y;
                                            
floorItem.OnFloor Time32.Now;
                                            
floorItem.Owner attacker.Owner;
                                            
floorItem.UID MsgMapItem.FloorUID.Next;
                                            while (
map.FloorItems.ContainsKey(floorItem.UID))
                                                
floorItem.UID MsgMapItem.FloorUID.Next;

                                            
floorItem.MaxLife 25;
                                            
floorItem.Life 25;
                                            
floorItem.mColor 13;
                                            
floorItem.OwnerUID attacker.UID;
                                            
floorItem.OwnerGuildUID attacker.GuildID;
                                            
floorItem.FlowerType 0;
                                            
floorItem.Time Kernel.TqTimer(DateTime.Now.AddSeconds(7));
                                            
floorItem.Name "FlameLotus";
                                            
map.AddFloorItem(floorItem);
                                            
attacker.Owner.SendScreenSpawn(floorItemtrue);
                                            
attacker.FlameLotusEnergy 0;
                                            
attacker.Lotus(attacker.FlameLotusEnergy, (byte)MsgUpdate.DataType.FlameLotus);
                                            
attacker.AttackPacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region New Monk
                                #region UpSweep
                                
case 12580://up                               
                                    
{
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);

                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            if (
attacked == null)
                                                return;
                                            var 
angle Kernel.GetAngle(attacker.Xattacker.Yattacked.Xattacked.Y);
                                            
Map.UpdateCoordonatesForAngle(ref Xref Yangle);

                                            
Fan sector = new Fan(attacker.Xattacker.YXYspell.Rangespell.Sector);

                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
Kernel.GetDistance(attacker.Xattacker.Y_obj.X_obj.Y) <= 7)
                                                {
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        
attacked _obj as Player;

                                                        if (
sector.IsInFan(attacked.Xattacked.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            {
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attack);
                                                                
damage = (uint)(damage 0.5);
                                                                
suse.Effect attack.Effect;
                                                                
ReceiveAttack(attackerattackedattackref damagespell);
                                                                
suse.AddTarget(attacked.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob _obj as MsgNpcInfoEX;

                                                        if (
sector.IsInFan(attackedsob.Xattackedsob.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedsobspell))
                                                            {
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack);
                                                                
ReceiveAttack(attackerattackedsobattackdamagespell);

                                                                
suse.AddTarget(attackedsob.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }

                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region DownSweep
                                
case 12590://down                                                          
                                    
{
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);

                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            if (
attacked == null)
                                                return;
                                            var 
angle Kernel.GetAngle(attacker.Xattacker.Yattacked.Xattacked.Y);
                                            
angle Enums.OppositeAngle(angle);
                                            
Map.UpdateCoordonatesForAngle(ref Xref Yangle);

                                            
Fan sector = new Fan(attacker.Xattacker.YXYspell.Rangespell.Sector);

                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
Kernel.GetDistance(attacker.Xattacker.Y_obj.X_obj.Y) <= 7)
                                                {
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        
attacked _obj as Player;

                                                        if (
sector.IsInFan(attacked.Xattacked.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            {
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attack);
                                                                
damage = (uint)(damage 0.5);
                                                                
suse.Effect attack.Effect;
                                                                
ReceiveAttack(attackerattackedattackref damagespell);
                                                                
suse.AddTarget(attacked.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob _obj as MsgNpcInfoEX;

                                                        if (
sector.IsInFan(attackedsob.Xattackedsob.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedsobspell))
                                                            {
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack);
                                                                
ReceiveAttack(attackerattackedsobattackdamagespell);

                                                                
suse.AddTarget(attackedsob.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }

                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region strike
                                
case 12600:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);

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

                                            if (
Kernel.GetDistance(attacker.Xattacker.YXY) <= attacker.AttackRange 1)
                                            {
                                                if (
attackedsob != null)
                                                {
                                                    if (
CanAttack(attackerattackedsobspell))
                                                    {
                                                        
PrepareSpell(spellattacker.Owner);
                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack);
                                                        
ReceiveAttack(attackerattackedsobattackdamagespell);

                                                        
suse.AddTarget(attackedsob.UIDdamageattack);
                                                    }
                                                }
                                                else
                                                {
                                                    if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                    {
                                                        
PrepareSpell(spellattacker.Owner);

                                                        
attack.Effect MsgInteract.InteractEffects.None;
                                                        
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attack);
                                                        
damage = (uint)(damage 0.5);
                                                        
suse.Effect attack.Effect;

                                                        
ReceiveAttack(attackerattackedattackref damagespell);

                                                        
suse.AddTarget(attacked.UIDdamageattack);
                                                    }
                                                }
                                                
attacker.AttackPacket null;
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket null;
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        
attacker.AttackPacket null;
                                        break;
                                    }
                                
#endregion
                                #region WrathOfEmperor
                                
case 12570:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);

                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.Attacker1 attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.SpecialEffect 1;

                                            
suse.X;
                                            
suse.Y;


                                            if (
Kernel.GetDistance(attacker.Xattacker.YXY) <= spell.Range)
                                            {
                                                foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (
_obj == null)
                                                        continue;
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        
attacked _obj as Player;
                                                        if (
Kernel.GetDistance(attacker.Xattacker.Yattacked.Xattacked.Y) <= spell.Range)
                                                        {
                                                            if (
attacked.ContainsFlag((ulong)MsgUpdate.Flags.Fly))
                                                                return;
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            {
                                                                
PrepareSpell(spellattacker.Owner);

                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attack);
                                                                
suse.Effect attack.Effect;

                                                                
ReceiveAttack(attackerattackedattackref damagespell);

                                                                
suse.AddTarget(attacked.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob _obj as MsgNpcInfoEX;
                                                        if (
Kernel.GetDistance(attacker.Xattacker.Yattackedsob.Xattackedsob.Y) <= spell.Range)
                                                        {
                                                            if (
CanAttack(attackerattackedsobspell))
                                                            {
                                                                
PrepareSpell(spellattacker.Owner);
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack);
                                                                
ReceiveAttack(attackerattackedsobattackdamagespell);

                                                                
suse.AddTarget(attackedsob.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket null;
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region GraceOfHeaven
                                
case 12560:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);

                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
SpellID 10425;
                                            
suse.SpellID SpellID;
                                            
suse.SpellLevel attacker.Owner.Spells[SpellID].Level;
                                            
suse.X;
                                            
suse.Y;
                                            
attacker.AttackPacket null;
                                            if (
attacker.Owner.Team != null)
                                            {

                                                foreach (
Client.GameState teammate in attacker.Owner.Team.Teammates)
                                                {
                                                    
// if (Kernel.GetDistance(attacker.X, attacker.Y, teammate.Player.X, teammate.Player.Y) <= spell.Range)
                                                    
{
                                                        if (
teammate.Player.ContainsFlag2((ulong)MsgUpdate.Flags2.SoulShackle))
                                                        {
                                                            
teammate.Player.RemoveFlag2((ulong)MsgUpdate.Flags2.SoulShackle);

                                                            
suse.AddTarget(teammate.Player.UID0attack);

                                                            
MsgUpdate upgrade = new MsgUpdate(true);
                                                            
upgrade.UID teammate.Player.UID;
                                                            
upgrade.Append((byte)MsgUpdate.DataType.SoulShackle
                                                                
111
                                                                
00spell.Level);
                                                            if (
teammate.Player.PlayerFlag == PlayerFlag.Player)
                                                                
teammate.Player.Owner.Send(upgrade.ToArray());
                                                        }
                                                    }
                                                }
                                                
attacker.Owner.SendScreen(susetrue);

                                            }

                                            {
                                                
suse.AddTarget(attacked.UID0attack);

                                                
attacked.ToxicFogLeft 0;
                                                
attacked.RemoveFlag2((ulong)MsgUpdate.Flags2.SoulShackle);

                                                
MsgUpdate upgrade = new MsgUpdate(true);
                                                
upgrade.UID attacked.UID;
                                                
upgrade.Append((byte)MsgUpdate.DataType.SoulShackle
                                                    
111
                                                    
00spell.Level);
                                                if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                    
attacked.Owner.Send(upgrade.ToArray());

                                                
attacked.ToxicFogLeft 0;
                                                
attacked.ScurbyBomb 0;
                                                
attacked.NoDrugsTime 0;
                                                
attacked.DragonFuryTime 0;
                                                
attacked.FlameLayerLeft 0;
                                                
//attacked.Owner.Send(new GameCharacterUpdates(true) { UID = attacked.UID, }
                                                //            .Remove(GameCharacterUpdates.SoulShacle));

                                                
attacked.NoDrugsTime 0;
                                                if (
attacked.PlayerFlag == PlayerFlag.Player)
                                                    
attacked.Owner.SendScreen(susetrue);
                                                else
                                                    
attacker.Owner.SendScreen(susetrue);
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region InfroEcho
                                
case 12550:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            if (!
attacker.EpicMonk())
                                                return;

                                            var 
map attacker.Owner.Map;
                                            if (!
map.Floor[XYMapObjectType.Itemnull]) return;
                                            
PrepareSpell(spellattacker.Owner);

                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.Attacker1 attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.SpecialEffect 0;
                                            
suse.AddTarget(attacker.UID0null);
                                            
attacker.Owner.SendScreen(susetrue);

                                            var 
count 3;
                                            if (
spell.Level == 6)
                                                
count 4;
                                            List<
System.Drawing.PointDestructionAreas = new List<System.Drawing.Point>();
                                            for (
int i 0360+= spell.Sector)
                                            {
                                                if (
DestructionAreas.Count >= count)
                                                    break;
                                                
// var dist = Kernel.Random.Next(4);
                                                
var dist Kernel.Random.Next(spell.Rangespell.Distance);
                                                
//  var angle = Kernel.Random.Next(90);
                                                
var angle i;
                                                
ushort x = (ushort)(+ (dist Math.Cos(angle)));
                                                
ushort y = (ushort)(+ (dist Math.Sin(angle)));
                                                
System.Drawing.Point p = new System.Drawing.Point((int)x, (int)y);
                                                if (!
DestructionAreas.Contains(p))
                                                    
DestructionAreas.Add(p);
                                                else
                                                    
i--;
                                            }
                                            foreach (var 
area in DestructionAreas)
                                            {
                                                
= (ushort)area.X;
                                                
= (ushort)area.Y;
                                                
MsgMapItem floorItem = new MsgMapItem(true);
                                                
floorItem.ItemID MsgMapItem.InfroEcho;// (uint)(1390 + spell.Level);
                                                
floorItem.MapID attacker.MapID;
                                                
floorItem.mColor 14;
                                                
floorItem.ItemColor = (Enums.Color.Black);
                                                
floorItem.Type MsgMapItem.Effect;
                                                
floorItem.OwnerUID attacker.UID;
                                                
floorItem.OwnerGuildUID attacker.GuildID;
                                                
floorItem.FlowerType 1;
                                                
floorItem.X;
                                                
floorItem.Y;
                                                
floorItem.OnFloor Time32.Now;
                                                
floorItem.Owner attacker.Owner;

                                                
floorItem.Name "trap";
                                                while (
map.FloorItems.ContainsKey(floorItem.UID))
                                                    
floorItem.UID Mr.HaMoOo.Network.GamePackets.MsgMapItem.FloorUID.Next;
                                                
map.AddFloorItem(floorItem);
                                                
attacker.Owner.SendScreenSpawn(floorItemtrue);

                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                //ahmed nemo 01128547851
                                #region EpicWarrior
                                #region ManiacDance
                                
case 12700:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);

                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
attacker.AddFlag3((ulong)1UL << 53);
                                            
attacker.ManiacDance Time32.Now;
                                            
attacker.RemoveFlag((ulong)MsgUpdate.Flags.Ride);
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region WaveofBlood
                                
case 12690:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;
                                            
suse.X;
                                            
suse.Y;
                                            
Fan sector = new Fan(attacker.Xattacker.YXYspell.Rangespell.Sector);
                                            if (
Kernel.GetDistance(attacker.Xattacker.YXY) <= spell.Distance 1)
                                            {
                                                foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                                {
                                                    if (
_obj == null)
                                                        continue;
                                                    if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        
attacked _obj as Player;

                                                        if (
sector.IsInFan(attacked.Xattacked.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                            {
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attackspell);
                                                                if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.King)
                                                                    if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.King)
                                                                    {
                                                                        
damage = (uint)(damage 0.4);
                                                                    }
                                                                if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Prince)
                                                                {
                                                                    
damage = (uint)(damage 0.4);
                                                                }
                                                                if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Duke)
                                                                {
                                                                    
damage = (uint)(damage 0.4);
                                                                }
                                                                if (
attacker.NobilityRank == Game.ConquerStructures.NobilityRank.Earl)
                                                                {
                                                                    
damage = (uint)(damage 0.4);
                                                                }
                                                                
suse.Effect attack.Effect;
                                                                
ReceiveAttack(attackerattackedattackref damagespell);
                                                                
suse.AddTarget(attacked.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob _obj as MsgNpcInfoEX;
                                                        if (
sector.IsInFan(attackedsob.Xattackedsob.Y))
                                                        {
                                                            if (
CanAttack(attackerattackedsobspell))
                                                            {
                                                                
attack.Effect MsgInteract.InteractEffects.None;
                                                                
uint damage Calculate.Melee(attackerattackedsobref attack);
                                                                
damage = (uint)(damage 0.9);
                                                                
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                                
suse.AddTarget(attackedsob.UIDdamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket null;
                                            }
                                            
attacker.Owner.SendScreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Pounce
                                
case 12770:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(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;
                                            
UInt16 oxoy;
                                            
ox attacker.X;
                                            
oy attacker.Y;
                                            
byte dist = (byte)spell.Distance;
                                            var Array = 
attacker.Owner.Screen.Objects;
                                            
InLineAlgorithm algo = new InLineAlgorithm(attacker.XXattacker.YYdist,
                                                                               
InLineAlgorithm.Algorithm.DDA);
                                            
attacker.X;
                                            
attacker.Y;
                                            
int i 0;
                                            for (
0algo.lcoords.Counti++)
                                            {
                                                if (
attacker.Owner.Map.Floor[algo.lcoords[i].Xalgo.lcoords[i].YMapObjectType.Player]
                                                    && !
attacker.ThroughGate(algo.lcoords[i].Xalgo.lcoords[i].Y))
                                                {
                                                    
= (ushort)algo.lcoords[i].X;
                                                    
= (ushort)algo.lcoords[i].Y;
                                                }
                                                else
                                                {
                                                    break;
                                                }
                                            }
                                            
suse.X;
                                            
suse.Y;
                                            if (!
attacker.Owner.Map.Floor[XYMapObjectType.Playernull])
                                                return;
                                            
double disth 1.5;
                                            
//if (attacker.MapID == DeathMatch.MAPID) disth = 1;
                                            
foreach (Interfaces.IMapObject _obj in Array)
                                            {
                                                
bool hit false;
                                                for (
int j 0ij++)
                                                    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 Player;
                                                        if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                        {
                                                            var 
damage Game.Attacking.Calculate.Melee(attackerattackedref attackspell);
                                                            
damage = (uint)(damage 1.1);
                                                            
ReceiveAttack(attackerattackedattackref damagespell);

                                                            
suse.AddTarget(attacked.UIDdamageattack);
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.Player)
                                                    {
                                                        
attacked _obj as Player;
                                                        if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                                        {
                                                            var 
damage Game.Attacking.Calculate.Melee(attackerattackedref attack);
                                                            
damage = (uint)(damage 1.0);
                                                            
ReceiveAttack(attackerattackedattackref damagespell);

                                                            
suse.AddTarget(attacked.UIDdamageattack);
                                                        }
                                                    }
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                    {
                                                        
attackedsob _obj as MsgNpcInfoEX;
                                                        if (
CanAttack(attackerattackedsobspell))
                                                        {
                                                            var 
damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack);

                                                            
ReceiveAttack(attackerattackedsobattackdamagespell);

                                                            
suse.AddTarget(attackedsob.UIDdamageattack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.PX attacker.X;
                                            
attacker.PY attacker.Y;
                                            
attacker.X;
                                            
attacker.Y;
                                            
attacker.Owner.SendScreen(susetrue);
                                            
attacker.Owner.Screen.Reload(suse);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region Backfire
                                
case 12680:
                                    {
                                        
MsgMagicEffect MsgMagicEffect = new MsgMagicEffect(true);
                                        
MsgMagicEffect.Attacker attacker.UID;
                                        
MsgMagicEffect.Attacker1 attacker.UID;
                                        
MsgMagicEffect.SpellID spell.ID;
                                        
MsgMagicEffect.SpellLevel spell.Level;
                                        
MsgMagicEffect.X;
                                        
MsgMagicEffect.Y;
                                        
MsgMagicEffect.AddTarget(attacker.UID1attack);
                                        
attacker.Owner.SendScreen(MsgMagicEffecttrue);
                                        if (
attacker.ContainsFlag3((ulong)1UL << 51))
                                            
attacker.RemoveFlag3((ulong)1UL << 51);
                                        else
                                            
attacker.AddFlag3((ulong)1UL << 51);
                                        
attacker.BackfireStamp Time32.Now;
                                        break;
                                    }
                                
#endregion
                                #endregion
                                
default:
                                    {
                                        if (
attacker.Owner.Account.State == AccountTable.AccountState.Administrator)
                                            
attacker.Owner.Send("Unknown Spell ID: " spellID);
                                        break;
                                    }
                            }
                            
attacker.Owner.IncreaseSpellExperience(ExperiencespellID);
                            if (
attacker.MapID == 1039)
                            {
                                if (
spell.ID == 7001 || spell.ID == 9876)
                                {
                                    
attacker.AttackPacket null;
                                    return;
                                }
                                if (
attacker.AttackPacket != null)
                                {
                                    
attack.Damage spell.ID;
                                    
attacker.AttackPacket attack;
                                    var 
xspell GetWeaponSpell(spell);
                                    if (
xspell != null)
                                    {
                                        if (
attacker.AttackPacket == null)
                                        {
                                            
attack.InteractType MsgInteract.Melee;
                                            
attacker.AttackPacket attack;
                                        }
                                        else
                                        {
                                            
attacker.AttackPacket.InteractType MsgInteract.Melee;
                                        }
                                    }
                                }
                            }
                            else
                            {
                                if (
spell.NextSpellID != 0)
                                {
                                    if (
spell.NextSpellID >= 1000 && spell.NextSpellID <= 1002)
                                        if (
Target >= 1000000)
                                        {
                                            
attacker.AttackPacket null;
                                            return;
                                        }
                                    
attack.Damage spell.NextSpellID;
                                    
attacker.AttackPacket attack;
                                }
                                else
                                {
                                    var 
xspell GetWeaponSpell(spell);
                                    if (
xspell == null || spell.ID == 9876)
                                        
attacker.AttackPacket null;
                                    else
                                    {
                                        if (
attacker.AttackPacket == null)
                                        {
                                            
attack.InteractType MsgInteract.Melee;
                                            
attacker.AttackPacket attack;
                                        }
                                        else
                                        {
                                            
attacker.AttackPacket.InteractType MsgInteract.Melee;
                                        }
                                    }
                                }
                            }
                        }
                        else
                        {
                            
attacker.AttackPacket null;
                        }
                    }
                    
#endregion
                
}
                
#endregion
            
}
            
#endregion
        
}
        public static 
bool isArcherSkill(uint ID)
        {
            if (
ID >= 8000 && ID <= 9875)
                return 
true;
            return 
false;
        }
        public static 
void QuitSteedRace(Player attacker)
        {
            
attacker.Owner.MessageBox("Do you want to quit the steed race?", (pClient) =>
            {
                
pClient.Player.Teleport(1002301279);
                
pClient.Player.RemoveFlag((ulong)MsgUpdate.Flags.Ride);
            });
        }
        public 
Handle(MsgInteract attackPlayer attackerPlayer attacked)
        {
            
this.attack attack;
            
this.attacker attacker;
            
this.attacked attacked;
            
this.Execute();
        }
        public static List<
ushortGetWeaponSpell(SpellInformation spell)
        {
            return 
SpellTable.WeaponSpells.Values.Where(=> p.Contains(spell.ID)).FirstOrDefault();
        }
        public static 
void FlameLotus(MsgMapItem itemint count 0)
        {
            var 
client item.Owner;
            if (!
client.Spells.ContainsKey(12380)) return;
            var 
spell SpellTable.GetSpell(client.Spells[12380].IDclient.Spells[12380].Level);
            if (
count == 0)
            {
                switch (
spell.Level)
                {
                    case 
0count 5; break;
                    case 
1count 8; break;
                    case 
2count 11; break;
                    case 
3count 14; break;
                    case 
4count 17; break;
                    case 
5count 20; break;
                    case 
6count 25; break;
                }
            }
            var 
targets PlayerinRange(itemspell.Range).ToArray();
            
targets targets.Where(=> CanAttack(client.Playerp.Playernulltrue)).ToArray();
            
targets targets.Take(count).ToArray();
            var 
attack = new MsgInteract(true);
            
attack.Attacker item.Owner.Player.UID;
            
attack.InteractType MsgInteract.Melee;
            foreach (var 
target in targets)
            {
                
uint damage Calculate.Magic(client.Playertarget.Playerspellref attack);
                if (
client.Spells.ContainsKey(1002))
                {
                    var 
spell2 SpellTable.GetSpell(client.Spells[1002].IDclient.Spells[1002].Level);
                    
damage Game.Attacking.Calculate.Magic(client.Playertarget.Playerspell2ref attack);
                }
                
attack.Damage damage;
                
attack.Attacked target.Player.UID;
                
attack.target.Player.X;
                
attack.target.Player.Y;
                
ReceiveAttack(client.Playertarget.Playerattackref damagespell);
                
client.Player.AttackPacket null;
            }
        }
        public static 
void AuroraLotus(MsgMapItem itemint count 0)
        {
            var 
client item.Owner;
            if (!
client.Spells.ContainsKey(12370)) return;
            var 
spell SpellTable.GetSpell(client.Spells[12370].IDclient.Spells[12370].Level);
            if (
count == 0)
            {
                switch (
spell.Level)
                {
                    case 
0count 5; break;
                    case 
1count 8; break;
                    case 
2count 11; break;
                    case 
3count 14; break;
                    case 
4count 17; break;
                    case 
5count 20; break;
                    case 
6count 25; break;
                }
            }
            var 
deads PlayerinRange(itemspell.Range).Where(=> p.Player.Dead).ToArray();
            if (
client.Team != null)
                
deads deads.Where(=> client.Team.Contain(p.Player.UID)).ToArray();
            else if (
client.Guild != null)
                if (
client.Guild.Members != null && client.Guild.Ally != null)
                    
deads deads.Where(=> client.Guild.Members.ContainsKey(p.Player.UID) || client.Guild.Ally.ContainsKey(p.Player.GuildID)).ToArray();
                else
                    
deads deads.Where(=> client.Guild.ID == p.Player.GuildID).ToArray();
            
deads deads.Take(count).ToArray();
            if (
deads != null)
            {
                foreach (var 
player in deads)
                {
                    
player.Player.Action Enums.ConquerAction.None;
                    
player.ReviveStamp Time32.Now;
                    
player.Attackable false;
                    
player.Player.TransformationID 0;
                    
player.Player.RemoveFlag((ulong)MsgUpdate.Flags.Dead);
                    
player.Player.RemoveFlag((ulong)MsgUpdate.Flags.Ghost);
                    
player.Player.Hitpoints player.Player.MaxHitpoints;
                    
player.Player.Ressurect();
                    
player.BlessTouch(client);
                }
            }
        }
        public static 
void InfroEcho(MsgMapItem itemint count 0)
        {
            var 
client item.Owner;
            var 
item.X;
            var 
item.Y;
            if (!
client.Spells.ContainsKey(12550))
                return;
            var 
spell SpellTable.GetSpell(client.Spells[12550].IDclient.Spells[12550].Level);

            var 
attack = new MsgInteract(true);
            
attack.Attacker client.Player.UID;
            
attack.X;
            
attack.Y;
            
attack.Damage spell.ID;
            
attack.InteractType MsgInteract.Magic;


            
MsgMagicEffect suse = new MsgMagicEffect(true);
            
suse.Attacker client.Player.UID;
            
suse.SpellID spell.ID;
            
suse.SpellLevel spell.Level;
            
suse.X;
            
suse.Y;
            
suse.SpecialEffect 1;
            foreach (var 
c in client.Screen.Objects)
            {

                
Interfaces.IMapObject _obj as Player;
                if (
_obj == null)
                    continue;
                if (
_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
                {
                    var 
attacked _obj as Player;
                    if (
Kernel.GetDistance(XYattacked.Xattacked.Y) <= spell.Range)
                    {
                        if (
CanAttack(client.Playerattackedspellattack.InteractType == MsgInteract.Ranged))
                        {
                            
uint damage Game.Attacking.Calculate.Melee(client.Playerattackedref attack);
                            
damage = (uint)(damage 0.2);
                            
suse.Effect attack.Effect;
                            
ReceiveAttack(client.Playerattackedattackref damagespell);
                            
attacked.Stunned true;
                            
attacked.StunStamp Time32.Now;
                            
suse.AddTarget(attacked.UIDdamageattack);

                        }
                    }
                }
            }
            
client.Player.AttackPacket null;
            
client.SendScreen(susetrue);
        }
        public static 
void HandleAuraMonk(Player AttackerSpellInformation Spell)
        {
            
ulong StatusFlag 0StatusFlag2 0;
            
Enums.AuraType Aura Enums.AuraType.TyrantAura;
            switch (
Spell.ID)
            {
                case 
10424StatusFlag = (ulong)MsgUpdate.Flags2.EarthAura; break;
                case 
10423StatusFlag = (ulong)MsgUpdate.Flags2.FireAura; break;
                case 
10422StatusFlag = (ulong)MsgUpdate.Flags2.WaterAura; break;
                case 
10421StatusFlag = (ulong)MsgUpdate.Flags2.WoodAura; break;
                case 
10420StatusFlag = (ulong)MsgUpdate.Flags2.MetalAura; break;
                case 
10410StatusFlag = (ulong)MsgUpdate.Flags2.FendAura; break;
                case 
10395StatusFlag = (ulong)MsgUpdate.Flags2.TyrantAura; break;
            }
            switch (
Spell.ID)
            {
                case 
10424StatusFlag2 = (ulong)MsgUpdate.Flags2.EarthAuraIcon; break;
                case 
10423StatusFlag2 = (ulong)MsgUpdate.Flags2.FireAuraIcon; break;
                case 
10422StatusFlag2 = (ulong)MsgUpdate.Flags2.WaterAuraIcon; break;
                case 
10421StatusFlag2 = (ulong)MsgUpdate.Flags2.WoodAuraIcon; break;
                case 
10420StatusFlag2 = (ulong)MsgUpdate.Flags2.MetalAuraIcon; break;
                case 
10410StatusFlag2 = (ulong)MsgUpdate.Flags2.FendAuraIcon; break;
                case 
10395StatusFlag2 = (ulong)MsgUpdate.Flags2.TyrantAuraIcon; break;
            }
            if (
Attacker.Dead) return;
            if (
Attacker.Aura_isActive)
            {
                switch (
Attacker.Aura_actType)
                {
                    case 
10424Aura Enums.AuraType.EarthAura; break;
                    case 
10423Aura Enums.AuraType.FireAura; break;
                    case 
10422Aura Enums.AuraType.WaterAura; break;
                    case 
10421Aura Enums.AuraType.WoodAura; break;
                    case 
10420Aura Enums.AuraType.MetalAura; break;
                    case 
10410Aura Enums.AuraType.FendAura; break;
                    case 
10395Aura Enums.AuraType.TyrantAura; break;
                }
                new 
MsgUpdate(true).Aura(AttackerEnums.AuraDataTypes.RemoveAuraSpell);
                
Attacker.RemoveFlag2(Attacker.Aura_actType);
                
Attacker.RemoveFlag2(Attacker.Aura_actType2);
                
Attacker.Owner.removeAuraBonuses(Attacker.Aura_actTypeAttacker.Aura_actPower1);
                
Attacker.Aura_isActive false;
                if (
StatusFlag == Attacker.Aura_actType)
                {
                    
Attacker.Aura_actType 0;
                    
Attacker.Aura_actType2 0;
                    
Attacker.Aura_actPower 0;
                    
Attacker.Aura_actLevel 0;
                    return;
                }
            }
            if (
CanUseSpell(SpellAttacker.Owner))
            {
                if (
StatusFlag != 0)
                {
                    switch (
Attacker.Aura_actType)
                    {
                        case 
10424Aura Enums.AuraType.EarthAura; break;
                        case 
10423Aura Enums.AuraType.FireAura; break;
                        case 
10422Aura Enums.AuraType.WaterAura; break;
                        case 
10421Aura Enums.AuraType.WoodAura; break;
                        case 
10420Aura Enums.AuraType.MetalAura; break;
                        case 
10410Aura Enums.AuraType.FendAura; break;
                        case 
10395Aura Enums.AuraType.TyrantAura; break;
                    }
                    new 
MsgUpdate(true).Aura(AttackerEnums.AuraDataTypes.RemoveAuraSpell);
                    
Attacker.RemoveFlag2(Attacker.Aura_actType);
                    
Attacker.RemoveFlag2(Attacker.Aura_actType2);
                    
Attacker.Owner.removeAuraBonuses(Attacker.Aura_actTypeAttacker.Aura_actPower1);
                    
Attacker.Aura_isActive false;
                    if (
StatusFlag == Attacker.Aura_actType)
                    {
                        
Attacker.Aura_actType2 0;
                        
Attacker.Aura_actType 0;
                        
Attacker.Aura_actPower 0;
                        
Attacker.Aura_actLevel 0;
                    }
                }
                if (
Spell.Power == 0)
                    
Spell.Power 45;
                
PrepareSpell(SpellAttacker.Owner);
                
MsgMagicEffect suse = new MsgMagicEffect(true);
                
suse.Attacker Attacker.UID;
                
suse.SpellID Spell.ID;
                
suse.SpellLevel Spell.Level;
                
suse.Attacker.X;
                
suse.Attacker.Y;
                
suse.AddTarget(Attacker.UID0null);
                
Attacker.Owner.SendScreen(susetrue);
                
Attacker.AddFlag2(StatusFlag);
                
Attacker.AddFlag2(StatusFlag2);
                
Attacker.Aura_isActive true;
                
Attacker.Aura_actType StatusFlag;
                
Attacker.Aura_actType2 StatusFlag2;
                
Attacker.Aura_actPower Spell.Power;
                
Attacker.Aura_actLevel Spell.Level;
                
Attacker.Owner.doAuraBonuses(StatusFlagSpell.Power1);
                switch (
Spell.ID)
                {
                    case 
10424Aura Enums.AuraType.EarthAura; break;
                    case 
10423Aura Enums.AuraType.FireAura; break;
                    case 
10422Aura Enums.AuraType.WaterAura; break;
                    case 
10421Aura Enums.AuraType.WoodAura; break;
                    case 
10420Aura Enums.AuraType.MetalAura; break;
                    case 
10410Aura Enums.AuraType.FendAura; break;
                    case 
10395Aura Enums.AuraType.TyrantAura; break;
                }
                new 
MsgUpdate(true).Aura(AttackerEnums.AuraDataTypes.AddAuraSpell);
            }
        }

        public static 
void LotusAttack(MsgMapItem itemPlayer attackerMsgInteract attack)
        {
            
//Console.WriteLine("For Test");
        
}
        public static List<
IMapObjectGetObjects(UInt16 oxUInt16 oyClient.GameState c)
        {
            
UInt16 xy;
            
c.Player.X;
            
c.Player.Y;
            var list = new List<
IMapObject>();
            
c.Player.ox;
            
c.Player.oy;
            foreach (
IMapObject objects in c.Screen.Objects)
            {
                if (
objects != null)
                    if (
objects.UID != c.Player.UID)
                        if (!list.
Contains(objects))
                            list.
Add(objects);
            }
            
c.Player.x;
            
c.Player.y;
            foreach (
IMapObject objects in c.Screen.Objects)
            {
                if (
objects != null)
                    if (
objects.UID != c.Player.UID)
                        if (!list.
Contains(objects))
                            list.
Add(objects);
            }
            if (list.
Count 0)
                return list;
            return 
null;
        }
        public static 
IEnumerable<Client.GameStatePlayerinRange(Player attackerPlayer attacked)
        {
            var 
dictionary Kernel.GamePool.Values.ToArray();

            return 
dictionary.Where((player) => player.Player.MapID == attacked.MapID && Kernel.GetDistance(player.Player.Xplayer.Player.Yattacker.Xattacker.Y) <= 7);
        }
        public static 
IEnumerable<Client.GameStatePlayerinRange(MsgMapItem itemint dist)
        {
            var 
dictionary Kernel.GamePool.Values.ToArray();
            return 
dictionary.Where((player) => player.Player.MapID == item.MapID && Kernel.GetDistance(player.Player.Xplayer.Player.Yitem.Xitem.Y) <= dist).OrderBy(player => Kernel.GetDistance(player.Player.Xplayer.Player.Yitem.Xitem.Y));
        }
        public 
Player findClosestTarget(Player attackerushort Xushort YIEnumerable<Interfaces.IMapObject> Array)
        {
            
Player closest attacker;
            
int dPrev 10000dist 0;
            foreach (var 
_obj in Array)
            {
                if (
_obj == null) continue;
                if (
_obj.MapObjType != MapObjectType.Player && _obj.MapObjType != MapObjectType.Monster) continue;
                
dist Kernel.GetDistance(XY_obj.X_obj.Y);
                if (
dist dPrev)
                {
                    
dPrev dist;
                    
closest = (Player)_obj;
                }
            }
            return 
closest;
        }

        public static 
bool CanUseSpell(SpellInformation spellClient.GameState client)
        {
            if (
client.Player.SkillTeamWatchingElitePKMatch != null) return false;
            if (
client.WatchingElitePKMatch != null) return false;
            if (
client.WatchingGroup != null) return false;
            if (
client.TeamWatchingGroup != null) return false;
            if (
spell == null) return false;
            if (
client.Player.Mana spell.UseMana) return false;
            if (
client.Player.Stamina spell.UseStamina) return false;
            if (
client.Player.MapID == 1707)
            {
                if (
spell.ID != 1045 && spell.ID != 1046)
                {
                    
client.Send("You can't use any skills here Except FB And SS!"); return false;
                }
            }
            if (
spell.UseArrows && isArcherSkill(spell.ID))
            {
                var 
weapons client.Weapons;
                if (
weapons.Item2 != null)
                    if (!
client.Player.ContainsFlag3((ulong)MsgUpdate.Flags3.PathOfShadow))
                        if (!
ItemHandler.IsArrow(weapons.Item2.ID)) return false;
                return 
true;
            }
            if (
spell.NeedXP == && !client.Player.ContainsFlag((ulong)MsgUpdate.Flags.XPList)) return false;
            return 
true;
        }
        public static 
void PrepareSpell(SpellInformation spellClient.GameState client)
        {
            if (
spell.NeedXP == 1)
                
client.Player.RemoveFlag((ulong)MsgUpdate.Flags.XPList);
            if (
client.Map.ID != 1039)
            {
                if (
spell.UseMana 0)
                    if (
client.Player.Mana >= spell.UseMana)
                        
client.Player.Mana -= spell.UseMana;
                if (
spell.UseStamina 0)
                    if (
client.Player.Stamina >= spell.UseStamina)
                        
client.Player.Stamina -= spell.UseStamina;
            }
        }

        public static 
void CheckForExtraWeaponPowers(Client.GameState clientPlayer attacked)
        {
            
#region Right Hand
            
var weapons client.Weapons;
            if (
weapons.Item1 != null)
            {
                if (
weapons.Item1.ID != 0)
                {
                    var 
Item weapons.Item1;
                    if (
Item.Effect != Enums.ItemEffect.None)
                    {
                        if (
Kernel.Rate(30))
                        {
                            switch (
Item.Effect)
                            {
                                case 
Enums.ItemEffect.HP:
                                    {
                                        
MsgMagicEffect MsgMagicEffect = new MsgMagicEffect(true);
                                        
MsgMagicEffect.Attacker 1;
                                        
MsgMagicEffect.SpellID 1175;
                                        
MsgMagicEffect.SpellLevel 4;
                                        
MsgMagicEffect.client.Player.X;
                                        
MsgMagicEffect.client.Player.Y;
                                        
MsgMagicEffect.AddTarget(client.Player.UID300null);
                                        
uint damage Math.Min(300client.Player.MaxHitpoints client.Player.Hitpoints);
                                        
client.Player.Hitpoints += damage;
                                        
client.SendScreen(MsgMagicEffecttrue);
                                        break;
                                    }
                                case 
Enums.ItemEffect.MP:
                                    {
                                        
MsgMagicEffect MsgMagicEffect = new MsgMagicEffect(true);
                                        
MsgMagicEffect.Attacker 1;
                                        
MsgMagicEffect.SpellID 1175;
                                        
MsgMagicEffect.SpellLevel 2;
                                        
MsgMagicEffect.client.Player.X;
                                        
MsgMagicEffect.client.Player.Y;
                                        
MsgMagicEffect.AddTarget(client.Player.UID300null);
                                        
ushort damage = (ushort)Math.Min(300client.Player.MaxMana client.Player.Mana);
                                        
client.Player.Mana += damage;
                                        
client.SendScreen(MsgMagicEffecttrue);
                                        break;
                                    }
                                case 
Enums.ItemEffect.Shield:
                                    {
                                        if (
client.Player.ContainsFlag((ulong)MsgUpdate.Flags.MagicShield)) return;
                                        
MsgMagicEffect MsgMagicEffect = new MsgMagicEffect(true);
                                        
MsgMagicEffect.Attacker 1;
                                        
MsgMagicEffect.SpellID 1020;
                                        
MsgMagicEffect.SpellLevel 0;
                                        
MsgMagicEffect.client.Player.X;
                                        
MsgMagicEffect.client.Player.Y;
                                        
MsgMagicEffect.AddTarget(client.Player.UID120null);
                                        
client.Player.ShieldTime 0;
                                        
client.Player.ShieldStamp Time32.Now;
                                        
client.Player.MagicShieldStamp Time32.Now;
                                        
client.Player.MagicShieldTime 0;
                                        
client.Player.AddFlag((ulong)MsgUpdate.Flags.MagicShield);
                                        
client.Player.MagicShieldStamp Time32.Now;
                                        
client.Player.MagicShieldIncrease 2;
                                        
client.Player.MagicShieldTime 120;
                                        if (
client.Player.PlayerFlag == PlayerFlag.Player)
                                            
client.Send(Constants.Shield(2120));
                                        
client.SendScreen(MsgMagicEffecttrue);
                                        break;
                                    }
                                case 
Enums.ItemEffect.Poison:
                                    {
                                        if (
attacked != null)
                                        {
                                            if (
Constants.PKForbiddenMaps.Contains(client.Player.MapID)) return;
                                            if (
client.Map.BaseID == 700) return;
                                            if (
attacked.UID == client.Player.UID) return;
                                            if (
attacked.ToxicFogLeft 0) return;
                                            
MsgMagicEffect MsgMagicEffect = new MsgMagicEffect(true);
                                            
MsgMagicEffect.SpellID 5040;
                                            
MsgMagicEffect.Attacker attacked.UID;
                                            
MsgMagicEffect.SpellLevel 9;
                                            
MsgMagicEffect.attacked.X;
                                            
MsgMagicEffect.attacked.Y;
                                            
MsgMagicEffect.AddTarget(attacked.UID0null);
                                            
MsgMagicEffect.Targets[attacked.UID].Hit true;
                                            
attacked.ToxicFogStamp Time32.Now;
                                            
attacked.ToxicFogLeft 10;
                                            
attacked.ToxicFogPercent 0.05F;
                                            
client.SendScreen(MsgMagicEffecttrue);
                                        }
                                        break;
                                    }
                            }
                        }
                    }
                }
            }
            
#endregion
            #region Left Hand
            
if (weapons.Item2 != null)
            {
                if (
weapons.Item2.ID != 0)
                {
                    var 
Item weapons.Item2;
                    if (
Item.Effect != Enums.ItemEffect.None)
                    {
                        if (
Kernel.Rate(30))
                        {
                            switch (
Item.Effect)
                            {
                                case 
Enums.ItemEffect.HP:
                                    {
                                        
MsgMagicEffect MsgMagicEffect = new MsgMagicEffect(true);
                                        
MsgMagicEffect.Attacker 1;
                                        
MsgMagicEffect.SpellID 1175;
                                        
MsgMagicEffect.SpellLevel 4;
                                        
MsgMagicEffect.client.Player.X;
                                        
MsgMagicEffect.client.Player.Y;
                                        
MsgMagicEffect.AddTarget(client.Player.UID300null);
                                        
uint damage Math.Min(300client.Player.MaxHitpoints client.Player.Hitpoints);
                                        
client.Player.Hitpoints += damage;
                                        
client.SendScreen(MsgMagicEffecttrue);
                                        break;
                                    }
                                case 
Enums.ItemEffect.MP:
                                    {
                                        
MsgMagicEffect MsgMagicEffect = new MsgMagicEffect(true);
                                        
MsgMagicEffect.Attacker 1;
                                        
MsgMagicEffect.SpellID 1175;
                                        
MsgMagicEffect.SpellLevel 2;
                                        
MsgMagicEffect.client.Player.X;
                                        
MsgMagicEffect.client.Player.Y;
                                        
MsgMagicEffect.AddTarget(client.Player.UID300null);
                                        
ushort damage = (ushort)Math.Min(300client.Player.MaxMana client.Player.Mana);
                                        
client.Player.Mana += damage;
                                        
client.SendScreen(MsgMagicEffecttrue);
                                        break;
                                    }
                                case 
Enums.ItemEffect.Shield:
                                    {
                                        if (
client.Player.ContainsFlag((ulong)MsgUpdate.Flags.MagicShield))
                                            return;
                                        
MsgMagicEffect MsgMagicEffect = new MsgMagicEffect(true);
                                        
MsgMagicEffect.Attacker 1;
                                        
MsgMagicEffect.SpellID 1020;
                                        
MsgMagicEffect.SpellLevel 0;
                                        
MsgMagicEffect.client.Player.X;
                                        
MsgMagicEffect.client.Player.Y;
                                        
MsgMagicEffect.AddTarget(client.Player.UID120null);
                                        
client.Player.ShieldTime 0;
                                        
client.Player.ShieldStamp Time32.Now;
                                        
client.Player.MagicShieldStamp Time32.Now;
                                        
client.Player.MagicShieldTime 0;

                                        
client.Player.AddFlag((ulong)MsgUpdate.Flags.MagicShield);
                                        
client.Player.MagicShieldStamp Time32.Now;
                                        
client.Player.MagicShieldIncrease 2;
                                        
client.Player.MagicShieldTime 120;
                                        if (
client.Player.PlayerFlag == PlayerFlag.Player)
                                            
client.Send(Constants.Shield(2120));
                                        
client.SendScreen(MsgMagicEffecttrue);
                                        break;
                                    }
                                case 
Enums.ItemEffect.Poison:
                                    {
                                        if (
attacked != null)
                                        {
                                            if (
attacked.UID == client.Player.UID) return;
                                            if (
Constants.PKForbiddenMaps.Contains(client.Player.MapID)) return;
                                            if (
client.Map.BaseID == 700) return;
                                            if (
attacked.ToxicFogLeft 0) return;
                                            
MsgMagicEffect MsgMagicEffect = new MsgMagicEffect(true);
                                            
MsgMagicEffect.SpellID 5040;
                                            
MsgMagicEffect.Attacker attacked.UID;
                                            
MsgMagicEffect.SpellLevel 9;
                                            
MsgMagicEffect.attacked.X;
                                            
MsgMagicEffect.attacked.Y;
                                            
MsgMagicEffect.AddTarget(attacked.UID0null);
                                            
MsgMagicEffect.Targets[attacked.UID].Hit true;
                                            
attacked.ToxicFogStamp Time32.Now;
                                            
attacked.ToxicFogLeft 10;
                                            
attacked.ToxicFogPercent 0.05F;
                                            
client.SendScreen(MsgMagicEffecttrue);
                                        }
                                        break;
                                    }
                            }
                        }
                    }
                }
            }
            
#endregion
        
}

        public static 
bool CanAttack(Player attackerMsgNpcInfoEX attackedSpellInformation spell)
        {
            if (
attacker.MapID == 2292)
            {
                if (((
attacker.GuildID == 0) || !Polapk.IsWar) && (attacked.UID == 1235))
                {
                    return 
false;
                }
                if (
Polapk.PoleKeeper != null)
                {
                    if (
Polapk.PoleKeeper == attacker.Owner.Guild)
                    {
                        if (
attacked.UID == 1235)
                        {
                            return 
false;
                        }
                    }
                    else if ((((
attacked.UID == 0x7dfeb) || (attacked.UID == 0x7dfea)) && (Polapk.PoleKeeper == attacker.Owner.Guild)) && (attacker.PKMode == Enums.PKMode.Team))
                    {
                        return 
false;
                    }
                }
            }
            
            if (
attacker.MapID == 2291)
            {
                if (((
attacker.GuildID == 0) || !Polapk2.IsWar) && (attacked.UID == 1325))
                {
                    return 
false;
                }
                if (
Polapk2.PoleKeeper != null)
                {
                    if (
Polapk2.PoleKeeper == attacker.Owner.Guild)
                    {
                        if (
attacked.UID == 1325)
                        {
                            return 
false;
                        }
                    }
                    else if ((((
attacked.UID == 0x7dfeb) || (attacked.UID == 0x7dfea)) && (Polapk2.PoleKeeper == attacker.Owner.Guild)) && (attacker.PKMode == Enums.PKMode.Team))
                    {
                        return 
false;
                    }
                }
            }
            if (
attacker.MapID == 2293)
            {
                if (((
attacker.GuildID == 0) || !Polapk3.IsWar) && (attacked.UID == 817))
                {
                    return 
false;
                }
                if (
Polapk3.PoleKeeper != null)
                {
                    if (
Polapk3.PoleKeeper == attacker.Owner.Guild)
                    {
                        if (
attacked.UID == 817)
                        {
                            return 
false;
                        }
                    }
                    else if ((((
attacked.UID == 0x7dfeb) || (attacked.UID == 0x7dfea)) && (Polapk3.PoleKeeper == attacker.Owner.Guild)) && (attacker.PKMode == Enums.PKMode.Team))
                    {
                        return 
false;
                    }
                }
            }
            if (
attacker.MapID == 2294)
            {
                if (((
attacker.GuildID == 0) || !Polapk4.IsWar) && (attacked.UID == 23120))
                {
                    return 
false;
                }
                if (
Polapk4.PoleKeeper != null)
                {
                    if (
Polapk4.PoleKeeper == attacker.Owner.Guild)
                    {
                        if (
attacked.UID == 23120)
                        {
                            return 
false;
                        }
                    }
                    else if ((((
attacked.UID == 0x7dfeb) || (attacked.UID == 0x7dfea)) && (Polapk4.PoleKeeper == attacker.Owner.Guild)) && (attacker.PKMode == Enums.PKMode.Team))
                    {
                        return 
false;
                    }
                }
            }

            
#region GuildPoleWar
            
if (GuildPoleWar.IsWar)
            {
                if (
attacker.MapID == GuildPoleWar.Map.ID)
                {
                    return 
GuildPoleWar.Attack(0attackerattacked);
                }
            }
            
#endregion
            #region ClassPoleWar
            //if (MsgServer.Game.ClassPoleWar.IsWar)
            //{
            //    if (attacker.MapID == MsgServer.Game.ClassPoleWar.Map.ID)
            //    {
            //        return MsgServer.Game.ClassPoleWar.Attack(0, attacker, attacked);
            //    }
            //}
            #endregion
            #region ClanWar
            
if (attacker.MapID == 1509)
            {
                if (
attacker.ClanId == || !ClanWar.IsWar)
                {
                    if (
attacked.UID == 813)
                    {
                        return 
false;
                    }
                }
                if (
ClanWar.PoleKeeper != null)
                {
                    if (
ClanWar.PoleKeeper == attacker.GetClan)
                    {
                        if (
attacked.UID == 813)
                        {
                            return 
false;
                        }
                    }
                }
            }
            
#endregion
            #region EliteGuildWar
            
if (attacker.MapID == 2071)
            {
                if (
attacker.GuildID == || !EliteGuildWar.IsWar)
                {
                    if (
attacked.UID == 812)
                    {
                        return 
false;
                    }
                }
                if (
EliteGuildWar.PoleKeeper != null)
                {
                    if (
EliteGuildWar.PoleKeeper == attacker.Owner.Guild)
                    {
                        if (
attacked.UID == 812)
                        {
                            return 
false;
                        }
                    }
                    else if (
attacked.UID == 516075 || attacked.UID == 516074)
                    {
                        if (
EliteGuildWar.PoleKeeper == attacker.Owner.Guild)
                        {
                            if (
attacker.PKMode == Enums.PKMode.Team)
                                return 
false;
                        }
                    }
                }
            }
            
#endregion
            #region StatueWar
            
if (StatuesWar.IsWar)
            {
                if (
attacker.MapID == StatuesWar.Map.ID)
                {
                    if (
attacker.GuildID == || !StatuesWar.IsWar)
                        if (
attacked.UID == StatuesWar.Pole.UID)
                            return 
false;
                    if (
StatuesWar.PoleKeeper != null)
                    {
                        if (
StatuesWar.PoleKeeper == attacker.Owner.AsMember)
                            if (
attacked.UID == StatuesWar.Pole.UID)
                                return 
false;
                        if (
StatuesWar.PoleKeeper == attacker.Owner.AsMember)
                            if (
attacker.PKMode == Enums.PKMode.Team)
                                return 
false;

                    }
                }
            }
            
#endregion
            #region PoleEmulator
            
if (attacked.UID == 123456)
                if (
attacked.Hitpoints 0)
                    if (
attacker.GuildID != && attacker.GuildID != Server.Thread.PoleEmulator.KillerGuildID)
                        return 
true;
                    else return 
false;
                else return 
false;
            
#endregion
            #region GuildWar
            
if (attacker.MapID == 1038)
            {
                if (
attacker.GuildID == || !Game.GuildWar.IsWar)
                {
                    if (
attacked.UID == 810) return false;
                }
                if (
Game.GuildWar.PoleKeeper != null)
                {
                    if (
Game.GuildWar.PoleKeeper == attacker.Owner.Guild)
                    {
                        if (
attacked.UID == 810) return false;
                    }
                    else if (
attacked.UID == 516075 || attacked.UID == 516074)
                    {
                        if (
Game.GuildWar.PoleKeeper == attacker.Owner.Guild)
                        {
                            if (
attacker.PKMode == Enums.PKMode.Team) return false;
                        }
                    }
                }
            }
            
#endregion
            #region SuperGuildWar
            
if (attacker.MapID == 1234)
            {
                if (
attacker.GuildID == || !Game.SuperGuildWar.IsWar)
                {
                    if (
attacked.UID == 811) return false;
                }
                if (
Game.SuperGuildWar.PoleKeeper != null)
                {
                    if (
Game.SuperGuildWar.PoleKeeper == attacker.Owner.Guild)
                    {
                        if (
attacked.UID == 811) return false;
                    }
                    else if (
attacked.UID == 516077 || attacked.UID == 516076)
                    {
                        if (
Game.SuperGuildWar.PoleKeeper == attacker.Owner.Guild)
                        {
                            if (
attacker.PKMode == Enums.PKMode.Team) return false;
                        }
                    }
                }
            }
            
#endregion
            #region Crow
            
if (attacker.MapID == 1039)
            {
                
bool stake true;
                if (
attacked.LoweredName.Contains("crow"))
                    
stake false;

                
ushort levelbase = (ushort)(attacked.Mesh 10);
                if (
stake)
                    
levelbase -= 42;
                else
                    
levelbase -= 43;

                
byte level = (byte)(20 + (levelbase 3) * 5);
                if (
levelbase == 108 || levelbase == 109)
                    
level 125;
                if (
attacker.Level >= level)
                    return 
true;
                else
                {
                    
attacker.AttackPacket null;
                    
attacker.Owner.Send(Constants.DummyLevelTooHigh());
                    return 
false;
                }
            }
            
#endregion
            #region Can't Attack Npc
            
if (attacked.UID == 76112 || attacked.UID == 127123 || attacked.UID == 141198 || attacked.UID == 9683 || attacked.UID == 2015 || attacked.UID == 20140
                
|| attacked.UID == 9884 || attacked.UID == 9885 || attacked.UID == 9886 || attacked.UID == 9887
                
|| attacked.UID == 9994 || attacked.UID == 9995 || attacked.UID == 9996 || attacked.UID == 9997 || attacked.UID == 41162
                
|| attacked.UID == 180 || attacked.UID == 181 || attacked.UID == 182 || attacked.UID == 183 || attacked.UID == 801
                
|| attacked.UID == 184 || attacked.UID == 185 || attacked.UID == 7882 || attacked.UID == 1232 || attacked.UID == 16416 || attacked.UID == 16417
                
|| attacked.UID == 216341 || attacked.UID == 1231 || attacked.UID == 6567 || attacked.UID == 4132 || attacked.UID == 64132 || attacked.UID == 44821)
            {
                
attacker.AttackPacket null;
                return 
false;
            }
            
#endregion
            
return true;
        }
        public static 
bool CanAttack(Player attackerPlayer attackedSpellInformation spellbool melee)
        {
            
#region ThunderCloud
            
if (attacker.Name == "Thundercloud")
            {
                if (
attacker.PKMode != Game.Enums.PKMode.PK &&
                         
attacker.PKMode != Game.Enums.PKMode.Team)
                    return 
false;
            }

            if (
attacked.Name == "Thundercloud")
            {
                if (
attacked.OwnerUID == attacker.UID) return false;
                if (!
Constants.PKForbiddenMaps.Contains(attacker.MapID))
                {
                    if (
attacker.PKMode != Game.Enums.PKMode.PK &&
                     
attacker.PKMode != Game.Enums.PKMode.Team)
                        return 
false;
                    else
                    {
                        
attacker.AddFlag((ulong)Network.GamePackets.MsgUpdate.Flags.FlashingName);
                        
attacker.FlashingNameStamp Time32.Now;
                        
attacker.FlashingNameTime 20;

                        return 
true;
                    }
                }
                else return 
false;
            }
            
#endregion
            
if (attacker.ContainsFlag4((ulong)MsgUpdate.Flags4.xChillingSnow))
                return 
false;
            
#region Kongfu
            
if (attacker.PlayerFlag == PlayerFlag.Player && attacked.PlayerFlag == PlayerFlag.Player)
            {
                if (
attacker.PKMode == Enums.PKMode.Kongfu && attacker.KongfuActive == true && attacked.PKMode != Enums.PKMode.Kongfu && attacked.KongfuActive == false && !attacked.ContainsFlag((ulong)MsgUpdate.Flags.FlashingName) && !attacked.ContainsFlag((ulong)MsgUpdate.Flags.BlackName))
                {
                    if (
attacked.Dead) return false;
                    
attacker.Owner.Send(new MsgTalk("You can only attack fighters of the Jiang Hu while in the Jiang Hu"MsgTalk.TopLeft));
                    return 
false;
                }
                else if (
attacker.PKMode == Enums.PKMode.Kongfu && attacker.KongfuActive == true)
                {
                    if (
attacked.PKMode == Enums.PKMode.Kongfu || attacked.KongfuActive == true || attacked.ContainsFlag((ulong)MsgUpdate.Flags.FlashingName) || attacked.ContainsFlag((ulong)MsgUpdate.Flags.BlackName))
                    {
                        if (
attacked.Dead) return false;
                        if (
attacker.MapID == 1002 || attacker.MapID == 1000 || attacker.MapID == 1015 || attacker.MapID == 1020 || attacker.MapID == 1011 || attacker.MapID == 3055)
                        {
                            try
                            {
                                if (
attacker.Settings != MsgOwnKongfuPKSetting.Settings.None)
                                {
                                    if ((
attacker.Settings MsgOwnKongfuPKSetting.Settings.NotHitFriends) == MsgOwnKongfuPKSetting.Settings.NotHitFriends)
                                    {
                                        if (
attacker.Owner.Friends.ContainsKey(attacked.UID))
                                            return 
false;
                                    }
                                    if ((
attacker.Settings MsgOwnKongfuPKSetting.Settings.NoHitAlliesClan) == MsgOwnKongfuPKSetting.Settings.NoHitAlliesClan)
                                    {
                                        var 
attacker_clan attacker.GetClan;
                                        if (
attacker_clan != null)
                                        {
                                            if (
attacker_clan.Allies.ContainsKey(attacked.ClanId))
                                                return 
false;
                                        }
                                    }
                                    if ((
attacker.Settings MsgOwnKongfuPKSetting.Settings.NotHitAlliedGuild) == MsgOwnKongfuPKSetting.Settings.NotHitAlliedGuild)
                                    {
                                        if (
attacker.Owner.Guild != null)
                                        {
                                            if (
attacker.Owner.Guild.Ally.ContainsKey(attacked.GuildID))
                                                return 
false;
                                        }
                                    }
                                    if ((
attacker.Settings MsgOwnKongfuPKSetting.Settings.NotHitClanMembers) == MsgOwnKongfuPKSetting.Settings.NotHitClanMembers)
                                    {
                                        if (
attacker.ClanId == attacked.ClanId)
                                            return 
false;
                                    }
                                    if ((
attacker.Settings MsgOwnKongfuPKSetting.Settings.NotHitGuildMembers) == MsgOwnKongfuPKSetting.Settings.NotHitGuildMembers)
                                    {
                                        if (
attacker.GuildID == attacked.GuildID)
                                            return 
false;
                                    }
                                }
                            }
                            catch (
Exception e)
                            {
                                
Console.WriteLine(e.ToString());
                            }
                            return 
true;
                        }
                    }
                    return 
false;
                }
            }
            
#endregion
            #region FactionWar
            
if (attacker.OnPirateFaction == true && attacked.OnNinjaFaction == true || attacker.OnNinjaFaction == true && attacked.OnPirateFaction == true)
            {
                if (
attacked.Dead) return false;
                if (
attacker.MapID == 1002 || attacker.MapID == 1000 || attacker.MapID == 1015 || attacker.MapID == 1020 || attacker.MapID == 1011 || attacker.MapID == 3055)
                {
                    return 
true;
                }
                return 
false;
            }
            
#endregion
            
if (attacker.MapID == 1507)
            {
                if (!
attacker.AllowToAttack)
                    return 
false;
            }
            if (
attacked.PlayerFlag == PlayerFlag.Monster)
            {
                if (
attacked.Companion)
                {
                    if (
attacked.Owner == attacker.Owner) return false;
                }
            }
            if (
attacker.timerInportChampion.AddSeconds(10) > DateTime.Now)
                return 
false;
            if (
attacker.UID == attacked.UID)
                return 
false;
            if (
attacker.PKMode == Enums.PKMode.Guild)
            {
                if (
attacker.Owner.Guild.Enemy.ContainsKey(attacked.GuildID))
                {
                    if (
attacked.Dead) return false;
                    if (
attacker.UID == attacked.UID) return false;
                    if (
attacker.MapID == 1000 || attacker.MapID == 1015 || attacker.MapID == 1020 || attacker.MapID == 1011)
                    {
                        
attacker.AddFlag((ulong)MsgUpdate.Flags.FlashingName);
                        
attacker.FlashingNameStamp Time32.Now;
                        
attacker.FlashingNameTime 10;
                        return 
true;
                    }
                }
            }
            if (
attacker.PKMode == Enums.PKMode.Revenge)
            {
                if (
attacker.Owner.Enemy.ContainsKey(attacked.UID))
                {
                    if (
attacked.Dead) return false;
                    if (
attacker.UID == attacked.UID) return false;
                    if (
attacker.MapID == 1000 || attacker.MapID == 1015 || attacker.MapID == 1020 || attacker.MapID == 1011)
                    {
                        
attacker.AddFlag((ulong)MsgUpdate.Flags.FlashingName);
                        
attacker.FlashingNameStamp Time32.Now;
                        
attacker.FlashingNameTime 10;
                        return 
true;
                    }
                }
            }
            if (
attacked.PlayerFlag == PlayerFlag.Monster)
            {
                if (
attacked.MonsterInfo.ID == MonsterInformation.ReviverID)
                    return 
false;
            }
            if (
attacked.Dead)
            {
                return 
false;
            }
            if (
attacker.PlayerFlag == PlayerFlag.Player && attacker.Owner.WatchingElitePKMatch != null)
            {
                return 
false;
            }
            if (
attacked.PlayerFlag == PlayerFlag.Player && attacked.Owner.WatchingElitePKMatch != null)
            {
                return 
false;
            }
            if (
attacker.PlayerFlag == PlayerFlag.Player)
            {
                if (
attacked != null && attacked.PlayerFlag == PlayerFlag.Player)
                    if (
attacker.Owner.InTeamQualifier() && attacked.Owner.InTeamQualifier())
                        return !
attacker.Owner.Team.IsTeammate(attacked.UID);
            }
            if (
spell != null)
                if (
attacker.PlayerFlag == PlayerFlag.Player)
                    if (
attacker.Owner.WatchingGroup != null)
                        return 
false;
            if (
attacked == null)
            {
                return 
false;
            }
            if (
attacker.SkillTeamWatchingElitePKMatch != null)
            {
                return 
false;
            }
            if (
attacked.Dead)
            {
                
attacker.AttackPacket null;
                return 
false;
            }
            if (
attacker.PlayerFlag == PlayerFlag.Player && attacked.PlayerFlag == PlayerFlag.Player && attacked.Owner.Team != null && attacker.Owner.Team != null && attacker.Owner.Team.EliteFighterStats != null && attacked.Owner.Team.EliteFighterStats != null && attacker.MapID == attacked.Owner.Team.EliteMatch.Map.ID && attacker.Owner.Team.EliteMatch != null)
            {
                return 
attacker.Owner.Team != attacked.Owner.Team;
            }
            if (
attacker.PlayerFlag == PlayerFlag.Player && attacked.PlayerFlag == PlayerFlag.Player)
                if ((
attacker.Owner.InQualifier() && attacked.Owner.IsWatching()) || (attacked.Owner.InQualifier() && attacker.Owner.IsWatching()))
                    return 
false;
            if (
attacker.PlayerFlag == PlayerFlag.Player)
                if (
Time32.Now attacker.Owner.CantAttack)
                    return 
false;
            if (
attacked.PlayerFlag == PlayerFlag.Monster)
            {
                if (
attacked.Companion)
                {
                    if (
Constants.PKForbiddenMaps.Contains(attacker.Owner.Map.ID))
                    {
                        if (
attacked.Owner == attacker.Owner) return false;
                        if (
attacker.PKMode != Enums.PKMode.PK && attacker.PKMode != Enums.PKMode.Team) return false;
                        else
                        {
                            
attacker.AddFlag((ulong)MsgUpdate.Flags.FlashingName);
                            
attacker.FlashingNameStamp Time32.Now;
                            
attacker.FlashingNameTime 10;
                            return 
true;
                        }
                    }
                }
                if (
attacked.Name.Contains("Guard1"))
                {
                    if (
attacker.PKMode != Enums.PKMode.PK && attacker.PKMode != Game.Enums.PKMode.Team) return false;
                    else
                    {
                        
attacker.AddFlag((ulong)MsgUpdate.Flags.FlashingName);
                        
attacker.FlashingNameStamp Time32.Now;
                        
attacker.FlashingNameTime 10;
                        return 
true;
                    }
                }
                else return 
true;
            }
            else
            {
                if (
attacked.PlayerFlag == PlayerFlag.Player)
                    if (!
attacked.Owner.Attackable)
                        return 
false;
                if (
attacker.PlayerFlag == PlayerFlag.Player)
                    if (
attacker.Owner.WatchingGroup == null)
                        if (
attacked.PlayerFlag == PlayerFlag.Player)
                            if (
attacked.Owner.WatchingGroup != null)
                                return 
false;
                if (
spell != null)
                {
                    if (
spell.ID != 8001)
                    {
                        if (
spell.OnlyGround)
                            if (
attacked.ContainsFlag((ulong)MsgUpdate.Flags.Fly))
                                return 
false;
                        if (
melee && attacked.ContainsFlag((ulong)MsgUpdate.Flags.Fly))
                            return 
false;
                    }
                }
                if (
spell != null)
                {
                    if (
spell.ID == 6010)
                    {
                        if (
attacked.ContainsFlag((ulong)MsgUpdate.Flags.Fly))
                            return 
false;
                    }
                }
                if (
spell != null)
                {
                    if (
spell.ID == 10381)
                    {
                        if (
attacked.ContainsFlag((ulong)MsgUpdate.Flags.Fly))
                            return 
false;
                    }
                }
                if (
spell != null)
                {
                    if (
spell.ID == 6000)
                    {
                        if (
attacked.ContainsFlag((ulong)MsgUpdate.Flags.Fly))
                            return 
false;
                    }
                }
                if (
spell != null)
                {
                    if (
spell.ID == 5030)
                    {
                        if (
attacked.ContainsFlag((ulong)MsgUpdate.Flags.Fly))
                            return 
false;
                    }
                }
                if (
spell == null)
                {
                    if (
attacked.ContainsFlag((ulong)MsgUpdate.Flags.Fly))
                        return 
false;
                }
                if (
Constants.PKForbiddenMaps.Contains(attacker.Owner.Map.ID))
                {
                    if (((
attacker.PKMode == Enums.PKMode.PK) || (attacker.PKMode == Enums.PKMode.Team)) || ((spell != null) && spell.CanKill))
                    {
                        
attacker.Owner.Send(Constants.PKForbidden);
                        
attacker.AttackPacket null;
                    }
                    return 
false;
                }
                if (
attacker.PKMode == Enums.PKMode.Capture)
                {
                    if (
attacked.ContainsFlag((ulong)MsgUpdate.Flags.FlashingName) || attacked.PKPoints 99)
                    {
                        return 
true;
                    }
                }
                if (
attacker.PKMode == Enums.PKMode.Peace)
                {
                    return 
false;
                }
                if (
attacker.UID == attacked.UID)
                    return 
false;
                if (
attacker.PKMode == Enums.PKMode.Team)
                {
                    if (
attacker.Owner.Team != null)
                    {
                        if (
attacker.Owner.Team.IsTeammate(attacked.UID))
                        {
                            
attacker.AttackPacket null;
                            return 
false;
                        }
                    }
                    if (
attacker.PKMode == Enums.PKMode.Team)
                    {
                        if (
attacker.Owner.Team != null)
                        {
                            if (!
attacker.Owner.Team.IsTeammate(attacked.UID))
                            {
                                if (
attacker.InSkillPk == true)
                                {
                                    return 
true;
                                }
                            }
                        }
                    }
                    if (
attacker.GuildID == attacked.GuildID && attacker.GuildID != 0)
                    {
                        
attacker.AttackPacket null;
                        return 
false;
                    }
                    if (
attacker.ClanId == attacked.ClanId && attacker.ClanId != 0)
                    {
                        
attacker.AttackPacket null;
                        return 
false;
                    }
                    if (
attacker.Owner.Friends.ContainsKey(attacked.UID))
                    {
                        
attacker.AttackPacket null;
                        return 
false;
                    }
                    if (
attacker.Owner.Guild != null)
                    {
                        if (
attacker.Owner.Guild.Ally.ContainsKey(attacked.GuildID))
                        {
                            
attacker.AttackPacket null;
                            return 
false;
                        }
                    }
                    if (
attacker.ClanId != 0)
                    {
                        if (
attacker.GetClan.Allies.ContainsKey(attacked.ClanId))
                        {
                            
attacker.AttackPacket null;
                            return 
false;
                        }
                    }
                }
                if (
spell != null)
                    if (
spell.OnlyGround)
                        if (
attacked.ContainsFlag((ulong)MsgUpdate.Flags.Fly))
                            return 
false;

                if (
spell != null)
                    if (!
spell.CanKill)
                        return 
true;

                if (
attacker.PKMode != Enums.PKMode.PK &&
                    
attacker.PKMode != Enums.PKMode.Team && attacked.PKPoints 99)
                {
                    
attacker.AttackPacket null;
                    return 
false;
                }
                else
                {
                    if (!
attacked.ContainsFlag((ulong)MsgUpdate.Flags.FlashingName))
                    {
                        if (!
attacked.ContainsFlag((ulong)MsgUpdate.Flags.BlackName))
                        {
                            if (
Constants.PKFreeMaps.Contains(attacker.MapID)) return true;
                            if (
attacker.Owner.Map.BaseID == 700) return true;
                            
attacker.AddFlag((ulong)MsgUpdate.Flags.FlashingName);
                            
attacker.FlashingNameStamp Time32.Now;
                            
attacker.FlashingNameTime 10;
                        }
                    }
                    return 
true;
                }
            }
        }

        public static 
void ReceiveAttack(Player attackerPlayer attackedMsgInteract attackref uint damageSpellInformation spell)
        {
            
#region StatuesWar
            
if (StatuesWar.IsWar)
            {
                if (
attacker.MapID == StatuesWar.Map.ID)
                {
                    if (
attacked.UID == StatuesWar.Pole.UID)
                    {
                        if (
StatuesWar.PoleKeeper == attacker.Owner.AsMember)
                            return;
                        if (
attacked.Hitpoints <= damage)
                            
attacked.Hitpoints 0;
                        
StatuesWar.AddScore(damageattacker.Owner.AsMember);
                    }
                }
            }
            
#endregion
            #region ThunderCloud
            
if (attacked.Name == "Thundercloud")
            {
                if (
spell != null && spell.ID != 0)
                {
                    if (
Kernel.Rate(75)) damage 1;
                    else 
damage 0;
                }
                else if (
spell == null || spell.ID == 0)
                {
                    
damage 1;
                }
            }
            foreach (var 
th in Kernel.Maps[attacker.MapID].Entities.Values.Where(=> i.Name == "Thundercloud"))
            {
                if (
th.OwnerUID == attacked.UID)
                {
                    if (
attacker == null || Kernel.GetDistance(attacker.Xattacker.Yth.Xth.Y) > th.MonsterInfo.AttackRange || attacker.Dead) break;
                    
th.MonsterInfo.InSight attacker.UID;
                    break;
                }
            }
            
#endregion
            #region RevengeTaill
            
if (attacked.ContainsFlag4((ulong)Network.GamePackets.MsgUpdate.Flags4.RevengeTaill))
            {
                if (
attacked.Owner != null && attacked.Owner.Spells != null && attacked.Owner.Spells.ContainsKey(13030))
                {
                    var 
spelll Database.SpellTable.GetSpell(13030attacked.Owner);
                    if (
damage <= spelll.Power)
                    {
                        
MsgMagicEffect suses = new MsgMagicEffect(true);
                        
suses.Attacker attacked.UID;
                        
suses.Attacker1 attacker.UID;
                        
suses.SpellID 13030;
                        
suses.SpecialEffect 1;
                        
suses.AddTarget(attacker.UIDdamagenull);
                        if (
attacker.Hitpoints <= damage)
                        {
                            
attacker.Die(attacked);
                        }
                        else
                        {
                            
attacker.Hitpoints -= damage;
                        }
                        
attacked.Owner.SendScreen(susestrue);
                    }
                }
            }
            
#endregion
            #region ChillingSnow
            
if (attacked.ContainsFlag4((ulong)MsgUpdate.Flags4.ChillingSnow) && attacked.IsStomper2() && attacker.PlayerFlag == PlayerFlag.Player)
            {
                var 
spell1 Database.SpellTable.GetSpell(12960attacked.Owner);
                
int rate 95;
                
int diff attacker.BattlePower attacked.BattlePower;
                if (
diff 0diff 0;
                
rate -= (byte)(diff 5);
                if (
rate 0rate 0;
                if (
Kernel.Rate(rate))
                {
                    
attacker.AddFlag4((ulong)MsgUpdate.Flags4.xChillingSnow);
                    
attacker.ChillingSnowStamp Time32.Now;
                    
attacker.ChillingSnow = (byte)(spell1.Level 1);
                }
            }
            
#endregion
            #region FreezingPelter
            
if (attacked.ContainsFlag4((ulong)MsgUpdate.Flags4.FreezingPelter) && attacked.IsStomper2() && attacker.PlayerFlag == PlayerFlag.Player)
            {
                var 
spell1 Database.SpellTable.GetSpell(13020attacked.Owner);
                
int rate 30;
                
int diff attacker.BattlePower attacked.BattlePower;
                if (
diff 0diff 0;
                
rate -= (byte)(diff 5);
                if (
rate 0rate 0;
                if (
Kernel.Rate(rate))
                {
                    
attacker.AddFlag4((ulong)MsgUpdate.Flags4.xFreezingPelter);
                    
attacker.FreezingPelterStamp Time32.Now;
                    
byte num 0;
                    if (
spell1.Level == 0num 1;
                    if (
spell1.Level == 1num 1;
                    if (
spell1.Level == 2num 2;
                    if (
spell1.Level == 3num 2;
                    if (
spell1.Level == 4num 3;
                    if (
spell1.Level == 5num 3;
                    if (
spell1.Level == 5num 4;
                    
attacker.FreezingPelter num;
                }
            }
            
#endregion

            
if (attacker.PlayerFlag == PlayerFlag.Monster && attacked.PlayerFlag == PlayerFlag.Player)
            {
                if (
attacked.Action == Enums.ConquerAction.Sit)
                    if (
attacked.Stamina 20)
                        
attacked.Stamina -= 20;
                    else 
attacked.Stamina 0;
                
attacked.Action Enums.ConquerAction.None;
            }
            if (
attack.InteractType == MsgInteract.Magic)
            {
                if (
attacked.Hitpoints <= damage)
                {
                    if (
attacker.PlayerFlag == PlayerFlag.Player && attacked.PlayerFlag == PlayerFlag.Player)
                    {
                        if (
SpellTable.AllowSkillSoul == null) return;
                        if (
spell == null) return;
                        if (
SpellTable.AllowSkillSoul.Contains(spell.ID))
                        {
                            
byte[] tets = new byte[12 8];
                            
Writer.Ushort(120tets);
                            
Writer.Ushort(27102tets);
                            
Writer.Uint(spell.ID4tets);
                            
attacked.Owner.SendScreen(tetstrue); attacker.Owner.SendScreen(tetstrue);
                        }
                    }
                    if (
attacked.Owner != null)
                    {
                        
attacked.Owner.UpdateQualifier(attacked.Hitpoints);
                    }
                    
//attacker.Owner.UpdateQualifier(attacker.Owner, attacked.Owner, attacked.Hitpoints);
                    
attacked.CauseOfDeathIsMagic true;
                    
attacked.Die(attacker);
                    
attacked.IsDropped false;
                    if (
attacked.Owner != null && attacker.Owner != null)
                    {
                        if (
attacked.Owner.Team != null && attacker.Owner.Team != null)
                        {
                            if (
attacker.Owner.Team.EliteFighterStats != null && attacked.Owner.Team.EliteFighterStats != null)
                            {
                                if (
attacker.Owner.Team.EliteMatch != null)
                                {
                                    if (!
attacked.Owner.Team.Alive)
                                    {
                                        
attacker.Owner.Team.EliteFighterStats.Points += damage;
                                        
attacker.Owner.Team.EliteMatch.End(attacked.Owner.Team);
                                    }
                                    else
                                    {
                                        
attacker.Owner.Team.SendMesageTeam(attacker.Owner.Team.EliteMatch.CreateUpdate().ToArray(), 0);
                                        
attacked.Owner.Team.SendMesageTeam(attacker.Owner.Team.EliteMatch.CreateUpdate().ToArray(), 0);
                                    }
                                }
                            }
                        }
                    }
                }
                else
                {
                    if (
attacked.Name != "Thundercloud")
                    {
                        if (
attacked.Owner != null && attacker.Owner != null)
                        {
                            if (
attacked.Owner.Team != null && attacker.Owner.Team != null)
                            {
                                if (
attacker.Owner.Team.EliteFighterStats != null && attacked.Owner.Team.EliteFighterStats != null)
                                {
                                    if (
attacker.Owner.Team.EliteMatch != null)
                                    {
                                        
attacker.Owner.Team.EliteFighterStats.Points += damage;
                                        
attacker.Owner.Team.SendMesageTeam(attacker.Owner.Team.EliteMatch.CreateUpdate().ToArray(), 0);
                                        
attacked.Owner.Team.SendMesageTeam(attacker.Owner.Team.EliteMatch.CreateUpdate().ToArray(), 0);
                                    }
                                }
                            }
                        }
                        if (
attacked.Owner != null)
                        {
                            
attacked.Owner.UpdateQualifier(damage);
                        }
                        
attacked.Hitpoints -= damage;
                    }
                    else
                    {
                        
attacked.Hitpoints -= 2100;
                    }
                }
            }
            else
            {
                if (
attacked.Hitpoints <= damage)
                {
                    if (
attacked.PlayerFlag == PlayerFlag.Player)
                    {
                        
attacked.Owner.UpdateQualifier(attacked.Hitpoints);
                        
attacked.Owner.SendScreen(attacktrue);
                        
attacker.AttackPacket null;
                    }
                    else
                    {
                        
attacked.MonsterInfo.SendScreen(attack);
                    }
                    
attacked.Die(attacker);
                    if (
attacker.PKMode == Enums.PKMode.Kongfu)
                    {
                        if (
attacked.KongfuActive)
                        {
                            if (
attacker.MyKongFu != null && attacker.MyKongFu != null)
                                
attacker.MyKongFu.GetKill(attacker.Ownerattacked.MyKongFu);
                        }
                    }
                    if (
attacked.Owner != null && attacker.Owner != null)
                    {
                        if (
attacked.Owner.Team != null && attacker.Owner.Team != null)
                        {
                            if (
attacker.Owner.Team.EliteFighterStats != null && attacked.Owner.Team.EliteFighterStats != null)
                            {
                                if (
attacker.Owner.Team.EliteMatch != null)
                                {
                                    if (
attacker.MapID == attacked.Owner.Team.EliteMatch.Map.ID)
                                    {
                                        if (!
attacked.Owner.Team.Alive)
                                        {
                                            
attacker.Owner.Team.EliteFighterStats.Points += damage;
                                            
attacker.Owner.Team.EliteMatch.End(attacked.Owner.Team);
                                        }
                                        else
                                        {
                                            
attacker.Owner.Team.SendMesageTeam(attacker.Owner.Team.EliteMatch.CreateUpdate().ToArray(), 0);
                                            
attacked.Owner.Team.SendMesageTeam(attacker.Owner.Team.EliteMatch.CreateUpdate().ToArray(), 0);
                                        }
                                    }
                                }
                            }
                        }
                    }

                }
                else
                {
                    if (
attacked.Name != "Thundercloud")
                    {

                        if (
attacked.Owner != null && attacker.Owner != null)
                        {
                            if (
attacked.Owner.Team != null && attacker.Owner.Team != null)
                            {
                                if (
attacker.Owner.Team.EliteFighterStats != null && attacked.Owner.Team.EliteFighterStats != null)
                                {
                                    if (
attacker.Owner.Team.EliteMatch != null)
                                    {
                                        if (
attacker.MapID == attacked.Owner.Team.EliteMatch.Map.ID)
                                        {
                                            
attacker.Owner.Team.EliteFighterStats.Points += damage;
                                            
attacker.Owner.Team.SendMesageTeam(attacker.Owner.Team.EliteMatch.CreateUpdate().ToArray(), 0);
                                            
attacked.Owner.Team.SendMesageTeam(attacker.Owner.Team.EliteMatch.CreateUpdate().ToArray(), 0);
                                        }
                                    }
                                }
                            }
                        }
                        
attacked.Hitpoints -= damage;
                        if (
attacked.PlayerFlag == PlayerFlag.Player)
                        {
                            
attacked.Owner.UpdateQualifier(damage);
                            
attacked.Owner.SendScreen(attacktrue);
                        }
                        else
                            
attacked.MonsterInfo.SendScreen(attack);
                        
attacker.AttackPacket attack;
                        
attacker.AttackStamp Time32.Now;
                    }
                    else
                    {
                        
attacked.Hitpoints -= 2100;
                    }
                }
            }
            
#region ThunderCloud
            
foreach (var th in Kernel.Maps[attacker.MapID].Entities.Values.Where(=> i.Name == "Thundercloud"))
            {
                if (
th.OwnerUID == attacker.UID)
                {
                    if (
attacked == null || Kernel.GetDistance(attacked.Xattacked.Yth.Xth.Y) > th.MonsterInfo.AttackRange || attacked.Dead) break;
                    
th.MonsterInfo.InSight attacked.UID;
                    break;
                }
            }
            
#endregion
        
}
        public static 
void ReceiveAttack(Player attackerMsgNpcInfoEX attackedMsgInteract attackuint damageSpellInformation spell)
        {
            if ((
attacker.MapID == 2292) && (attacked.UID == 1235))
            {
                if (
Polapk.PoleKeeper == attacker.Owner.Guild)
                {
                    return;
                }
                if (
attacked.Hitpoints <= damage)
                {
                    
attacked.Hitpoints 0;
                }
                
Polapk.AddScore(damageattacker.Owner.Guild);
            }
            if ((
attacker.MapID == 2291) && (attacked.UID == 1325))
            {
                if (
Polapk2.PoleKeeper == attacker.Owner.Guild)
                {
                    return;
                }
                if (
attacked.Hitpoints <= damage)
                {
                    
attacked.Hitpoints 0;
                }
                
Polapk2.AddScore(damageattacker.Owner.Guild);
            }
            if ((
attacker.MapID == 2293) && (attacked.UID == 817))
            {
                if (
Polapk3.PoleKeeper == attacker.Owner.Guild)
                {
                    return;
                }
                if (
attacked.Hitpoints <= damage)
                {
                    
attacked.Hitpoints 0;
                }
                
Polapk3.AddScore(damageattacker.Owner.Guild);
            }
            if ((
attacker.MapID == 2294) && (attacked.UID == 23120))
            {
                if (
Polapk4.PoleKeeper == attacker.Owner.Guild)
                {
                    return;
                }
                if (
attacked.Hitpoints <= damage)
                {
                    
attacked.Hitpoints 0;
                }
                
Polapk4.AddScore(damageattacker.Owner.Guild);
            }
            
#region GuildPoleWar
            
if (GuildPoleWar.IsWar)
            {
                if (
attacker.MapID == GuildPoleWar.Map.ID)
                {
                    
GuildPoleWar.Attack(damageattackerattacked);
                }
            }
            
#endregion
            #region ClassPoleWar
            //if (MsgServer.Game.ClassPoleWar.IsWar)
            //{
            //    if (attacker.MapID == MsgServer.Game.ClassPoleWar.Map.ID)
            //    {
            //        MsgServer.Game.ClassPoleWar.Attack(damage, attacker, attacked);
            //    }
            //}
            #endregion
            #region ClanWar
            
if (attacker.MapID == 1509)
            {
                if (
attacked.UID == 813)
                {
                    
MsgFamily clan attacker.GetClan;
                    if (
ClanWar.PoleKeeper == clan)
                        return;
                    if (
attacked.Hitpoints <= damage)
                        
attacked.Hitpoints 0;
                    
ClanWar.AddScore(damageclan);
                }
            }
            
#endregion
            #region Cps Stake
            
if (attacker.MapID == 1002)
            {
                if (
attacked.UID == 6462)
                {
                    
attacked.Die(attacker);
                    {
                        
attacker.ConquerPoints += 30000;
                        
attacker.Owner.Send(new MsgTalk("killed  [ NewDream-Co ] and get [ 30000 ] Cps #00"System.Drawing.Color.AzureMsgTalk.TopLeft));
                    }
                }
            }
            if (
attacker.MapID == 1002)
            {
                if (
attacked.UID == 6463)
                {
                    
attacked.Die(attacker);
                    {
                        
attacker.ConquerPoints += 30000;
                        
attacker.Owner.Send(new MsgTalk("killed  [ NewDream-Co ] and get [ 30000 ] Cps #00"System.Drawing.Color.AzureMsgTalk.TopLeft));
                    }
                }
            }
            if (
attacker.MapID == 1002)
            {
                if (
attacked.UID == 6464)
                {
                    
attacked.Die(attacker);
                    {
                        
attacker.ConquerPoints += 30000;
                        
attacker.Owner.Send(new MsgTalk("killed  [ NewDream-Co ] and get [ 30000 ] Cps #00"System.Drawing.Color.AzureMsgTalk.TopLeft));
                    }
                }
            }
            if (
attacker.MapID == 1002)
            {
                if (
attacked.UID == 6465)
                {
                    
attacked.Die(attacker);
                    {
                        
attacker.ConquerPoints += 30000;
                        
attacker.Owner.Send(new MsgTalk("killed  [ NewDream-Co ] and get [ 30000 ] Cps #00"System.Drawing.Color.AzureMsgTalk.TopLeft));
                    }
                }
            }
            
#endregion
            #region EliteGuildWar
            
if (attacker.MapID == 2071)
            {
                if (
attacked.UID == 812)
                {
                    if (
EliteGuildWar.PoleKeeper == attacker.Owner.Guild)
                        return;
                    if (
attacked.Hitpoints <= damage)
                        
attacked.Hitpoints 0;
                    
EliteGuildWar.AddScore(damageattacker.Owner.Guild);
                }

            }
            
#endregion
            #region Crow
            
if (attacker.PlayerFlag == PlayerFlag.Player)
                if (
damage attacked.Hitpoints)
                {
                    if (
attacker.MapID == 1039)
                        
attacker.Owner.IncreaseExperience(Math.Min(damageattacked.Hitpoints), true);
                    if (
spell != null)
                        
attacker.Owner.IncreaseSpellExperience(Math.Min(damageattacked.Hitpoints), spell.ID);
                }
                else
                {
                    if (
attacker.MapID == 1039)
                        
attacker.Owner.IncreaseExperience(damagetrue);
                    if (
spell != null)
                        
attacker.Owner.IncreaseSpellExperience(damagespell.ID);
                }
            
#endregion
            #region PoleEmulator
            
if (attacked.UID == 123456)
            {
                if (
Server.Thread.PoleEmulator.KillerGuildID == attacker.Owner.Guild.ID)
                    return;
                
Server.Thread.PoleEmulator.AddScore(damageattacker.Owner.Guild);
            }
            
#endregion
            #region GuildWar
            
if (Game.GuildWar.IsWar)
            {
                if (
attacker.MapID == 1038)
                {
                    if (
attacked.UID == 810)
                    {
                        if (
Game.GuildWar.PoleKeeper == attacker.Owner.Guild) return;
                        if (
attacked.Hitpoints <= damageattacked.Hitpoints 0;
                        
Game.GuildWar.AddScore(damageattacker.Owner.Guild);
                    }
                }
            }
            
#endregion
            #region SuperGuildWar
            
if (Game.SuperGuildWar.IsWar)
            {
                if (
attacker.MapID == 1234)
                {
                    if (
attacked.UID == 811)
                    {
                        if (
Game.SuperGuildWar.PoleKeeper == attacker.Owner.Guild) return;
                        if (
attacked.Hitpoints <= damageattacked.Hitpoints 0;
                        
Game.SuperGuildWar.AddScore(damageattacker.Owner.Guild);
                    }
                }
            }
            
#endregion
            #region Hitpoints
            
if (attack.InteractType == MsgInteract.Magic)
            {
                if (
attacked.Hitpoints <= damage)
                {
                    
attacked.Die(attacker);
                }
                else
                {
                    
attacked.Hitpoints -= damage;
                }
            }
            else
            {
                
attacker.Owner.SendScreen(attacktrue);
                if (
attacked.Hitpoints <= damage)
                {
                    
attacked.Die(attacker);
                }
                else
                {
                    
attacked.Hitpoints -= damage;
                    
attacker.AttackPacket attack;
                    
attacker.AttackStamp Time32.Now;
                }
            }
            
#endregion
        
}
    }



قديم 2019-08-20, 11:59 AM
المشاركة 17
ابو مروان
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: مشكلة بخصوص اسكلة الويند ولكر thundercloud
بدل كلاس هندل ده بالي عندك

كود:
// ? Created by bode
// ? Copyright © 2010 - 2016 tq digital
// ? Emulator - project

using system;
using system.linq;
using system.text;
using system.drawing;
using mr.hamooo.network;
using mr.hamooo.database;
using mr.hamooo.interfaces;
using system.collections.generic;
using mr.hamooo.network.gamepackets;
using mr.hamooo.game.conquerstructures;
using davideid.game.features.event;
using davideid.game;

namespace 
mr.hamooo.game.attacking
{
    public 
unsafe class handle
    
{
        public static 
void stompermelee(msgmapitem itemushort spellid)
        {
            var 
attack item.attack;
            var 
spell database.spelltable.getspell(spelliditem.owner);
            
msgmagiceffect suse = new msgmagiceffect(true);
            
suse.attacker spellid == 12990 Item.uid Item.owner.player.uid;
            
suse.spellid spellid;
            
suse.spelllevel spell.level;
            
suse.specialeffect 1;
            if (
spellid == 12990)
            {
                
suse.item.x2;
                
suse.item.y2;
                foreach (
interfaces.imapobject _obj in item.owner.screen.objects)
                {
                    if (
_obj.mapobjtype == mapobjecttype.monster)
                    {
                        if (
_obj == null) continue;
                        var 
attacked1 _obj as player;
                        if (
canattack(item.owner.playerattacked1spellfalse))
                        {
                            {
                                var 
spellange enums.horrorofstomperangle(item.angle);
                                
ushort xxxx item.x;
                                
ushort yyyy item.y;
                                
map.pushback(ref xxxxref  yyyyspellange7);
                                
fan sector = new fan(item.xitem.yxxxxyyyyspell.rangespell.sector);
                                if (
sector.isinfan(attacked1.xattacked1.y))
                                {
                                    
uint damage game.attacking.calculate.melee(item.owner.playerattacked1ref attackspell) * (spell.power 30000) / 100;
                                    
receiveattack(item.owner.playerattacked1attackref damagespell);
                                    
suse.addtarget(attacked1.uiddamagenull);
                                    continue;
                                }
                            }
                            {
                                var 
spellange enums.oppositeangle(enums.horrorofstomperangle(item.angle));
                                
ushort xxxx item.x;
                                
ushort yyyy item.y;
                                
map.pushback(ref xxxxref  yyyyspellange7);
                                
fan sector = new fan(item.xitem.yxxxxyyyyspell.rangespell.sector);
                                if (
sector.isinfan(attacked1.xattacked1.y))
                                {
                                    
uint damage game.attacking.calculate.melee(item.owner.playerattacked1ref attackspell) * (spell.power 30000) / 100;
                                    
receiveattack(item.owner.playerattacked1attackref damagespell);
                                    
suse.addtarget(attacked1.uiddamagenull);
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                
suse.item.x;
                
suse.item.y;
                foreach (
interfaces.imapobject _obj in item.owner.screen.objects)
                {
                    if (
_obj.mapobjtype == mapobjecttype.monster)
                    {
                        if (
_obj == null) continue;
                        var 
attacked1 _obj as player;
                        if (
kernel.getdistance(item.xitem.yattacked1.xattacked1.y) <= spell.range)
                        {
                            if (
canattack(item.owner.playerattacked1spellfalse))
                            {
                                
uint damage game.attacking.calculate.melee(item.owner.playerattacked1ref attackspell) * (spell.power 30000) / 100;
                                
receiveattack(item.owner.playerattacked1attackref damagespell);
                                
suse.addtarget(attacked1.uiddamagenull);
                            }
                        }
                    }
                }
            }
            
item.owner.sendscreen(susetrue);
            
item.owner.player.attackpacket null;
        }
        public static 
void shadowofchaser(player attackerplayer attackedmsginteract attackbyte oneortwo)
        {
            
#region shadowofchaser(active)
            
imapobject lastattacked attacked;
            if (
oneortwo == 1)
            {
                if (
attacker.containsflag4((ulong)msgupdate.flags4.shadowofchaser) && attacker.ischaser2())
                {
                    
#region msgmapitem
                    
var map kernel.maps[attacker.mapid];
                    
network.gamepackets.msgmapitem flooritem = new network.gamepackets.msgmapitem(true);
                    
flooritem.uid network.gamepackets.msgmapitem.flooruid.next;
                    while (
map.npcs.containskey(flooritem.uid))
                        
flooritem.uid network.gamepackets.msgmapitem.flooruid.next;

                    
flooritem.itemid msgmapitem.shadowofchaser;
                    
flooritem.lastattacked.x;
                    
flooritem.mapid attacker.mapid;
                    
flooritem.lastattacked.y;
                    
flooritem.type msgmapitem.effect;
                    
flooritem.mcolor 14;
                    
flooritem.flowertype 3;
                    
flooritem.unknown37 1;
                    
flooritem.attack attack;
                    
flooritem.owneruid attacker.uid;
                    
flooritem.owner attacker.owner;
                    
flooritem.ownerguilduid attacker.guildid;
                    
flooritem.onfloor time32.now;
                    
flooritem.name2 "shadowofchaser";
                    
flooritem.shadowofchaserattacked attacked;
                    
flooritem.shadowofchaserattacker attacker;
                    
attacker.owner.map.addflooritem(flooritem);
                    
attacker.owner.sendscreenspawn(flooritemtrue);
                    
#endregion
                    
return;
                }
            }
            else if (
oneortwo == 2)
            {
                var 
spell database.spelltable.getspell(13090attacker.owner);
                
msgmagiceffect suse = new msgmagiceffect(true);
                
suse.attacker attacker.uid;
                
suse.attacker1 attacker.uid;
                
suse.spellid spell.id;
                
suse.spelllevel spell.level;
                if (
canattack(attackerattackedspellfalse))
                {
                    
lastattacked attacked;
                    
uint damage game.attacking.calculate.melee(attackerattackedref attackspell) * (spell.power 30000) / 100;
                    
handle.receiveattack(attackerattackedattackref damagespell);
                    
suse.addtarget(attacked.uiddamagenull);
                }
                
attacker.owner.sendscreen(susetrue);
                
msgmagiceffect suse2 = new msgmagiceffect(true);
                
suse2.attacker attacker.uid;
                
suse2.spellid spell.id;
                
suse2.spelllevel spell.level;
                
suse2.attacked.x;
                
suse2.attacked.y;
                foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                {
                    if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                    {
                        if (
_obj == null) continue;
                        var 
attacked1 _obj as player;
                        if (
lastattacked.uid == attacked1.uid) continue;
                        if (
kernel.getdistance(lastattacked.xlastattacked.yattacked1.xattacked1.y) <= 4)
                        {
                            if (
canattack(attackerattacked1spellfalse))
                            {
                                
uint damage game.attacking.calculate.melee(attackerattacked1ref attackspell) * (spell.power 30000) / 100;
                                
attack.damage damage;
                                
receiveattack(attackerattacked1attackref damagespell);
                                
suse2.addtarget(attacked1.uiddamagenull);
                            }
                        }
                    }
                }
                
attacker.owner.sendscreen(suse2true);
            }
            
#endregion
            
attacker.attackpacket null;
        }
        public static 
void cheakteam(client.gamestate clientnpcs dail)
        {
            if (
client.team == null)
                
client.player.teleport(1002430378);
            
client.player.addtopstatus((ulong)msgupdate.flags2.top3water2datetime.now.addminutes(30));
            
uint teamcount 0;
            foreach (
client.gamestate clients in kernel.gamepool.values.toarray())
            {
                if (
clients.player.mapid == 16414)
                {
                    if (
clients.team != null)
                    {
                        if (!
clients.player.dead)
                            
teamcount++;
                    }
                }
            }

            if (
teamcount <= 5)
            {
                
uint lastcheak 0;
                if (
client.team != null)
                {
                    foreach (
client.gamestate team in client.team.teammates)
                    {
                        if (
team.player.mapid == 16414 && !team.player.dead)
                            
lastcheak++;
                    }
                    if (
teamcount == lastcheak)
                    {
                        
uint won = (uint)(rates.alltops client.team.teammates.count());
                        foreach (
client.gamestate team in client.team.teammates)
                        {
                            
team.player.teleport(1002302276);
                            
team.player.conquerpoints += won;
                        }
                        
thread.lastteamfight false;
                        
kernel.sendworldmessage(new msgtalk("congratulations! " client.player.name " team has won last team standing and all team member got " won " cps"system.drawing.color.red2011), kernel.gamepool.values.toarray());
                    }
                    else
                    {
                        
dail.text("there are:| " + (teamcount lastcheak) + " |: Other player in other team kill him");
                        
dail.option("i will kill him "255);
                        
dail.send();
                    }
                }
            }
            else
            {
                
dail.text("there are:| " teamcount " |: Other player in other team kill him");
                
dail.option("i will kill him "255);
                
dail.send();
            }

        }
        private 
msginteract attack;
        private 
player attackerattacked;
        
#region interations
        
public class interactionrequest
        
{
            public 
interactionrequest(msginteract attackgame.player a_client)
            {
                
client.gamestate client a_client.owner;
                
client.player.interactioninprogress false;
                
client.player.interactionwith attack.attacked;
                
client.player.interactiontype 0;
                
client.interactioneffect attack.responsedamage;
                if (
kernel.gamepool.containskey(attack.attacked))
                {
                    
client.gamestate clienttarget kernel.gamepool[attack.attacked];
                    
clienttarget.player.interactioninprogress false;
                    
clienttarget.player.interactionwith client.player.uid;
                    
clienttarget.player.interactiontype 0;
                    
clienttarget.interactioneffect attack.responsedamage;
                    
attack.attacker client.player.uid;
                    
attack.clienttarget.player.x;
                    
attack.clienttarget.player.y;
                    
attack.interacttype 46;
                    
clienttarget.send(attack);
                    
clienttarget.send(attack);
                }
            }
        }
        public class 
interactioneffect
        
{
            public 
interactioneffect(msginteract attackgame.player a_client)
            {
                
client.gamestate client a_client.owner;
                if (
kernel.gamepool.containskey(client.player.interactionwith))
                {
                    
client.gamestate clienttarget kernel.gamepool[client.player.interactionwith];
                    if (
clienttarget.player.== client.player.&& clienttarget.player.== client.player.y)
                    {
                        
attack.damage client.player.interactiontype;
                        
attack.responsedamage client.interactioneffect;
                        
clienttarget.player.interactionset true;
                        
client.player.interactionset true;
                        
attack.attacker clienttarget.player.uid;
                        
attack.attacked client.player.uid;
                        
attack.interacttype 47;
                        
attack.clienttarget.player.x;
                        
attack.clienttarget.player.y;
                        
clienttarget.send(attack);
                        
attack.interacttype 49;
                        
attack.attacker client.player.uid;
                        
attack.attacked clienttarget.player.uid;
                        
client.sendscreen(attacktrue);
                        
attack.attacker clienttarget.player.uid;
                        
attack.attacked client.player.uid;
                        
client.sendscreen(attacktrue);
                    }
                }
            }
        }
        public class 
interactionaccept
        
{
            public 
interactionaccept(msginteract attackgame.player a_client)
            {

                
client.gamestate client a_client.owner;
                if (
client.player.containsflag((ulong)msgupdate.flags.ride))
                    
client.player.removeflag((ulong)msgupdate.flags.ride);
                if (
client.player.interactionwith != attack.attacked) return;
                
attack.responsedamage client.interactioneffect;
                
client.player.interactionset false;
                if (
kernel.gamepool.containskey(attack.attacked))
                {
                    
client.gamestate clienttarget kernel.gamepool[attack.attacked];
                    if (
clienttarget.player.containsflag((ulong)msgupdate.flags.ride))
                        
clienttarget.player.removeflag((ulong)msgupdate.flags.ride);
                    
clienttarget.player.interactionset false;
                    if (
clienttarget.player.interactionwith != client.player.uid) return;
                    if (
clienttarget.player.body == 1003 || clienttarget.player.body == 1004)
                    {
                        
attack.attacker client.player.uid;
                        
attack.client.player.x;
                        
attack.client.player.y;
                        
clienttarget.send(attack);
                        
clienttarget.player.interactioninprogress true;
                        
client.player.interactioninprogress true;
                        
clienttarget.player.interactiontype attack.damage;
                        
clienttarget.player.interactionx client.player.x;
                        
clienttarget.player.interactiony client.player.y;
                        
client.player.interactiontype attack.damage;
                        
client.player.interactionx client.player.x;
                        
client.player.interactiony client.player.y;
                        if (
clienttarget.player.== client.player.&& clienttarget.player.== client.player.y)
                        {
                            
attack.damage client.player.interactiontype;
                            
clienttarget.player.interactionset true;
                            
client.player.interactionset true;
                            
attack.attacker clienttarget.player.uid;
                            
attack.attacked client.player.uid;
                            
attack.interacttype 47;
                            
attack.clienttarget.player.x;
                            
attack.clienttarget.player.y;
                            
attack.responsedamage clienttarget.interactioneffect;
                            
clienttarget.send(attack);
                            
attack.interacttype 49;
                            
attack.attacker client.player.uid;
                            
attack.attacked clienttarget.player.uid;
                            
client.sendscreen(attacktrue);
                            
attack.attacker clienttarget.player.uid;
                            
attack.attacked client.player.uid;
                            
client.sendscreen(attacktrue);
                        }
                    }
                    else
                    {
                        
attack.interacttype 47;
                        
attack.attacker client.player.uid;
                        
attack.client.player.x;
                        
attack.client.player.y;
                        
clienttarget.send(attack);
                        
clienttarget.player.interactioninprogress true;
                        
client.player.interactioninprogress true;
                        
clienttarget.player.interactiontype attack.damage;
                        
clienttarget.player.interactionx clienttarget.player.x;
                        
clienttarget.player.interactiony clienttarget.player.y;
                        
client.player.interactiontype attack.damage;
                        
client.player.interactionx clienttarget.player.x;
                        
client.player.interactiony clienttarget.player.y;
                        if (
clienttarget.player.== client.player.&& clienttarget.player.== client.player.y)
                        {
                            
clienttarget.player.interactionset true;
                            
client.player.interactionset true;
                            
attack.attacker clienttarget.player.uid;
                            
attack.attacked client.player.uid;
                            
attack.clienttarget.player.x;
                            
attack.clienttarget.player.y;
                            
attack.responsedamage clienttarget.interactioneffect;
                            
clienttarget.send(attack);
                            
attack.interacttype 49;
                            
client.sendscreen(attacktrue);
                            
attack.attacker client.player.uid;
                            
attack.attacked clienttarget.player.uid;
                            
client.sendscreen(attacktrue);
                        }
                    }
                }
            }
        }
        public class 
interactionstopeffect
        
{
            public 
interactionstopeffect(msginteract attackgame.player a_client)
            {
                
client.gamestate client a_client.owner;
                if (
kernel.gamepool.containskey(attack.attacked))
                {
                    
client.gamestate clienttarget kernel.gamepool[attack.attacked];
                    
attack.attacker client.player.uid;
                    
attack.attacked clienttarget.player.uid;
                    
attack.damage client.player.interactiontype;
                    
attack.client.player.x;
                    
attack.client.player.y;
                    
attack.interacttype 50;
                    
client.sendscreen(attacktrue);
                    
attack.attacker clienttarget.player.uid;
                    
attack.attacked client.player.uid;
                    
clienttarget.sendscreen(attacktrue);
                    
client.player.teleport(client.player.mapidclient.player.xclient.player.y);
                    
clienttarget.player.teleport(clienttarget.player.mapidclienttarget.player.xclienttarget.player.y);
                    
client.player.interactiontype 0;
                    
client.player.interactionwith 0;
                    
client.player.interactioninprogress false;
                    
clienttarget.player.interactiontype 0;
                    
clienttarget.player.interactionwith 0;
                    
clienttarget.player.interactioninprogress false;
                }
            }
        }
        public class 
interactionrefuse
        
{
            public 
interactionrefuse(msginteract attackgame.player a_client)
            {
                
client.gamestate client a_client.owner;
                
client.player.interactiontype 0;
                
client.player.interactionwith 0;
                
client.player.interactioninprogress false;
                if (
kernel.gamepool.containskey(attack.attacked))
                {
                    
client.gamestate clienttarget kernel.gamepool[attack.attacked];
                    
attack.attacker clienttarget.player.uid;
                    
attack.interacttype 48;
                    
attack.clienttarget.player.x;
                    
attack.clienttarget.player.y;
                    
clienttarget.send(attack);
                    
clienttarget.player.interactiontype 0;
                    
clienttarget.player.interactionwith 0;
                    
clienttarget.player.interactioninprogress false;
                }
            }
        }
        
#endregion
        
private void execute()
        {
            
#region interactions
            
if (attack != null)
            {
                switch (
attack.interacttype)
                {
                    case 
msginteract.interactionrequest:
                        {
                            new 
interactionrequest(attackattacker); return;
                        }
                    case 
msginteract.interactioneffect:
                        {
                            new 
interactioneffect(attackattacker); return;
                        }
                    case 
msginteract.interactionaccept:
                        {
                            new 
interactionaccept(attackattacker); return;
                        }
                    case 
msginteract.interactionrefuse:
                        {
                            new 
interactionrefuse(attackattacker); return;
                        }
                    case 
msginteract.interactionstopeffect:
                        {
                            new 
interactionstopeffect(attackattacker); return;
                        }
                }
            }
            
#endregion
            #region monster -> player \ monster
            
if (attack == null)
            {
                if (
attacker.playerflag != playerflag.monster) return;
                if (
attacked == null) return;
                if (
attacker.companion && attacker.name != "thundercloud")
                {
                    if (
constants.pkforbiddenmaps.contains(attacker.mapid)) return;
                }
                if (
attacked.playerflag == playerflag.player)
                {
                    if (!
attacked.owner.attackable) return;
                    if (
attacked.dead) return;
                    if (
attacker.attackstamp.addmilliseconds(2000) < time32.now)
                    {
                        
attacker.attackstamp time32.now;
                        
#region snowbanhe
                        
if (attacker.name == "snowbanshee" || attacker.name == "snowbansheesoul" || attacker.name == "purplebanshee")
                        {

                            
uint rand = (uint)mr.hamooo.kernel.random.next(18);
                            switch (
rand)
                            {
                                case 
1:
                                    
Attacker.monsterinfo.spellid 10001;
                                    break;
                                case 
2:
                                    
Attacker.monsterinfo.spellid 30010;
                                    break;
                                case 
4:
                                    
Attacker.monsterinfo.spellid 30011;
                                    break;
                                case 
6:
                                    
Attacker.monsterinfo.spellid 30012;
                                    break;
                            }
                            
#region icethrom angercop
                            
if (attacker.monsterinfo.spellid == 30010 || attacker.monsterinfo.spellid == 10001)
                            {
                                
uint damage 0;
                                
damage += (uint)kernel.random.next(10002000);
                                if (
attacked.hitpoints <= damage)
                                {
                                    
attacked.die(attacker);
                                }
                                else
                                {
                                    
attacked.hitpoints -= damage;
                                }
                                if (
attacker.companion)
                                    
attacker.owner.increaseexperience(math.min(damageattacked.hitpoints), true);
                                
msgmagiceffect suse = new msgmagiceffect(true);
                                
suse.attacker attacker.uid;
                                
suse.spellid attacker.monsterinfo.spellid;
                                
suse.attacked.x;
                                
suse.attacked.y;
                                
suse.addtarget(attacked.uiddamageattack);
                                
attacked.owner.sendscreen(susetrue);
                            }
                            
#endregion
                            #region chill
                            
if (attacker.monsterinfo.spellid == 30011)
                            {
                                
msgmagiceffect suse = new msgmagiceffect(true);
                                
attack = new msginteract(true);
                                
attack.effect msginteract.interacteffects.none;
                                
uint damage 0;
                                
damage += (uint)kernel.random.next(10002000);
                                
suse.effect attack.effect;
                                if (
attacked.hitpoints <= damage)
                                {
                                    
attacked.die(attacker);
                                }
                                else
                                {
                                    
attacked.hitpoints -= damage;
                                    
attacked.owner.frightenstamp time32.now;
                                    var 
upd = new msgracetrackstatus(true);
                                    
upd.uid attacked.uid;
                                    
upd.add(msgracetrackstatus.flustered05);
                                    
attacked.owner.sendscreen(updtrue);
                                    
attacked.owner.player.addflag((ulong)msgupdate.flags.chaoscycle);

                                }
                                if (
attacker.companion)
                                    
attacker.owner.increaseexperience(math.min(damageattacked.hitpoints), true);

                                
suse.attacker attacker.uid;
                                
suse.spellid attacker.monsterinfo.spellid;
                                
suse.attacked.x;
                                
suse.attacked.y;
                                
suse.addtarget(attacked.uiddamageattack);
                                foreach (var 
obj in attacked.owner.screen.objects)
                                {
                                    if (
calculations.inbox(obj.xobj.yattacker.xattacker.y14))
                                    {
                                        if (
obj.mapobjtype == mapobjecttype.player)
                                        {
                                            if (
obj.owner.player.containsflag((ulong)msgupdate.flags.dead)) continue;
                                            
attacked obj as player;
                                            if (
attacked.hitpoints <= damage)
                                            {
                                                
attacked.die(attacker);
                                            }
                                            else
                                            {
                                                
attacked.hitpoints -= damage;
                                                
attacked.owner.frightenstamp time32.now;
                                                var 
upd = new msgracetrackstatus(true);
                                                
upd.uid attacked.uid;
                                                
upd.add(msgracetrackstatus.flustered05);
                                                
attacked.owner.sendscreen(updtrue);
                                                
attacked.owner.player.addflag((ulong)msgupdate.flags.chaoscycle);
                                            }

                                            
suse.addtarget(attacked.uiddamageattack);
                                        }
                                    }
                                }
                                
attacked.owner.sendscreen(susetrue);
                            }
                            
#endregion
                            #region angercrop
                            
if (attacker.monsterinfo.spellid == 30012)
                            {
                                
msgmagiceffect suse = new msgmagiceffect(true);
                                
attack = new msginteract(true);
                                
attack.effect msginteract.interacteffects.none;
                                
uint damage 0;
                                
damage += (uint)kernel.random.next(10002000);
                                
suse.effect attack.effect;
                                if (
attacked.hitpoints <= damage)
                                {
                                    
attacked.die(attacker);
                                }
                                else
                                {
                                    
attacked.hitpoints -= damage;
                                    
attacked.owner.player.frozenstamp time32.now;
                                    
attacked.owner.player.frozentime 5;
                                    
msgracetrackstatus update = new msgracetrackstatus(true);
                                    
update.uid attacked.uid;
                                    
update.add(msgracetrackstatus.freeze05);
                                    
attacked.owner.sendscreen(updatetrue);
                                    
attacked.addflag((ulong)msgupdate.flags.freeze);
                                }
                                if (
attacker.companion)
                                    
attacker.owner.increaseexperience(math.min(damageattacked.hitpoints), true);

                                
suse.attacker attacker.uid;
                                
suse.spellid attacker.monsterinfo.spellid;
                                
suse.attacked.x;
                                
suse.attacked.y;
                                
suse.addtarget(attacked.uiddamageattack);
                                foreach (var 
obj in attacked.owner.screen.objects)
                                {
                                    if (
calculations.inbox(obj.xobj.yattacker.xattacker.y10))
                                    {
                                        if (
obj.mapobjtype == mapobjecttype.player)
                                        {
                                            if (
obj.owner.player.containsflag((ulong)msgupdate.flags.dead))
                                                continue;
                                            
attacked obj as player;
                                            if (
attacked.hitpoints <= damage)
                                            {
                                                
attacked.die(attacker);
                                            }
                                            else
                                            {
                                                
attacked.hitpoints -= damage;
                                                
attacked.owner.player.frozenstamp time32.now;
                                                
attacked.owner.player.frozentime 5;
                                                
msgracetrackstatus update = new msgracetrackstatus(true);
                                                
update.uid attacked.uid;
                                                
update.add(msgracetrackstatus.freeze05);
                                                
attacked.owner.sendscreen(updatetrue);
                                                
attacked.addflag((ulong)msgupdate.flags.freeze);
                                            }
                                            
suse.addtarget(attacked.uiddamageattack);
                                        }
                                    }
                                }
                                
attacked.owner.sendscreen(susetrue);
                            }
                            
#endregion
                        
}
                        
#endregion
                        #region nemesistyrant
                        
if (attacker.name == "nemesistyrant")
                        {
                            
uint rand = (uint)kernel.random.next(122);
                            switch (
rand)
                            {
                                case 
1:
                                    
Attacker.monsterinfo.spellid 10001;
                                    break;
                                case 
2:
                                    
Attacker.monsterinfo.spellid 30010;
                                    break;
                                case 
3:
                                    
Attacker.monsterinfo.spellid 10001;
                                    break;
                                case 
4:
                                    
Attacker.monsterinfo.spellid 30010;
                                    break;
                                case 
5:
                                    
Attacker.monsterinfo.spellid 30011;
                                    break;
                                case 
6:
                                    
Attacker.monsterinfo.spellid 30012;
                                    break;
                                case 
7:
                                    
Attacker.monsterinfo.spellid 7014;
                                    break;
                                case 
8:
                                    
Attacker.monsterinfo.spellid 7017;
                                    break;
                                case 
9:
                                    
Attacker.monsterinfo.spellid 7017;
                                    break;
                                case 
10:
                                    
Attacker.monsterinfo.spellid 7012;
                                    break;
                                case 
11:
                                    
Attacker.monsterinfo.spellid 7013;
                                    break;
                                case 
12:
                                    
Attacker.monsterinfo.spellid 7015;
                                    break;
                                case 
13:
                                    
Attacker.monsterinfo.spellid 7016;
                                    break;
                                case 
14:
                                    
Attacker.monsterinfo.spellid 10502;
                                    break;
                                case 
15:
                                    
Attacker.monsterinfo.spellid 10504;
                                    break;
                                case 
16:
                                    
Attacker.monsterinfo.spellid 10506;
                                    break;
                                case 
17:
                                    
Attacker.monsterinfo.spellid 10505;
                                    break;
                                case 
18:
                                    
Attacker.monsterinfo.spellid 10500;
                                    break;
                                case 
19:
                                    
Attacker.monsterinfo.spellid 10363;
                                    break;
                                case 
20:
                                    
Attacker.monsterinfo.spellid 10360;
                                    
attacked.addflag((ulong)msgupdate.flags.stun);
                                    
attacked.shockstamp time32.now;
                                    
attacked.shock 5;
                                    var 
upd = new msgracetrackstatus(true);
                                    
upd.uid attacked.uid;
                                    
upd.add(msgracetrackstatus.dizzy05);
                                    
attacked.owner.sendscreen(updtrue);
                                    break;
                                case 
21:
                                    
Attacker.monsterinfo.spellid 10361;
                                    
attacked.addflag((ulong)msgupdate.flags.stun);
                                    
attacked.shockstamp time32.now;
                                    
attacked.shock 5;
                                    var 
upd1 = new msgracetrackstatus(true);
                                    
upd1.uid attacked.uid;
                                    
upd1.add(msgracetrackstatus.dizzy05);
                                    
attacked.owner.sendscreen(upd1true);
                                    break;
                                case 
22:
                                    
Attacker.monsterinfo.spellid 10362;
                                    break;
                            }
                            
#region icethrom angercop
                            
if (attacker.monsterinfo.spellid == 30010 || attacker.monsterinfo.spellid == 10001)
                            {
                                
uint damage 0;
                                
damage += (uint)kernel.random.next(10002000);
                                if (
attacked.hitpoints <= damage)
                                {
                                    
attacked.die(attacker);
                                }
                                else
                                {
                                    
attacked.hitpoints -= damage;
                                }
                                if (
attacker.companion)
                                    
attacker.owner.increaseexperience(math.min(damageattacked.hitpoints), true);
                                
msgmagiceffect suse = new msgmagiceffect(true);
                                
suse.attacker attacker.uid;
                                
suse.spellid attacker.monsterinfo.spellid;
                                
suse.attacked.x;
                                
suse.attacked.y;
                                
suse.addtarget(attacked.uiddamageattack);
                                
attacked.owner.sendscreen(susetrue);
                            }
                            
#endregion
                            #region chill
                            
if (attacker.monsterinfo.spellid == 30011)
                            {
                                
msgmagiceffect suse = new msgmagiceffect(true);
                                
attack = new msginteract(true);
                                
attack.effect msginteract.interacteffects.none;
                                
uint damage 0;
                                
damage += (uint)kernel.random.next(10002000);
                                
suse.effect attack.effect;
                                if (
attacked.hitpoints <= damage)
                                {
                                    
attacked.die(attacker);
                                }
                                else
                                {
                                    
attacked.hitpoints -= damage;
                                    
attacked.owner.frightenstamp time32.now;
                                    var 
upd = new msgracetrackstatus(true);
                                    
upd.uid attacked.uid;
                                    
upd.add(msgracetrackstatus.flustered05);
                                    
attacked.owner.sendscreen(updtrue);
                                    
attacked.owner.player.addflag((ulong)msgupdate.flags.chaoscycle);

                                }
                                if (
attacker.companion)
                                    
attacker.owner.increaseexperience(math.min(damageattacked.hitpoints), true);

                                
suse.attacker attacker.uid;
                                
suse.spellid attacker.monsterinfo.spellid;
                                
suse.attacked.x;
                                
suse.attacked.y;
                                
suse.addtarget(attacked.uiddamageattack);
                                foreach (var 
obj in attacked.owner.screen.objects)
                                {
                                    if (
calculations.inbox(obj.xobj.yattacker.xattacker.y14))
                                    {
                                        if (
obj.mapobjtype == mapobjecttype.player)
                                        {
                                            if (
obj.owner.player.containsflag((ulong)msgupdate.flags.dead))
                                                continue;
                                            
attacked obj as player;
                                            if (
attacked.hitpoints <= damage)
                                            {
                                                
attacked.die(attacker);
                                            }
                                            else
                                            {
                                                
attacked.hitpoints -= damage;
                                                
attacked.owner.frightenstamp time32.now;
                                                var 
upd = new msgracetrackstatus(true);
                                                
upd.uid attacked.uid;
                                                
upd.add(msgracetrackstatus.flustered05);
                                                
attacked.owner.sendscreen(updtrue);
                                                
attacked.owner.player.addflag((ulong)msgupdate.flags.chaoscycle);
                                            }

                                            
suse.addtarget(attacked.uiddamageattack);
                                        }
                                    }
                                }
                                
attacked.owner.sendscreen(susetrue);
                            }
                            
#endregion
                            #region angercrop
                            
if (attacker.monsterinfo.spellid == 30012)
                            {
                                
msgmagiceffect suse = new msgmagiceffect(true);
                                
attack = new msginteract(true);
                                
attack.effect msginteract.interacteffects.none;
                                
uint damage 0;
                                
damage += (uint)kernel.random.next(10002000);
                                
suse.effect attack.effect;
                                if (
attacked.hitpoints <= damage)
                                {
                                    
attacked.die(attacker);
                                }
                                else
                                {
                                    
attacked.hitpoints -= damage;
                                    
attacked.owner.player.frozenstamp time32.now;
                                    
attacked.owner.player.frozentime 5;
                                    
msgracetrackstatus update = new msgracetrackstatus(true);
                                    
update.uid attacked.uid;
                                    
update.add(msgracetrackstatus.freeze05);
                                    
attacked.owner.sendscreen(updatetrue);
                                    
attacked.addflag((ulong)msgupdate.flags.freeze);
                                }
                                if (
attacker.companion)
                                    
attacker.owner.increaseexperience(math.min(damageattacked.hitpoints), true);

                                
suse.attacker attacker.uid;
                                
suse.spellid attacker.monsterinfo.spellid;
                                
suse.attacked.x;
                                
suse.attacked.y;
                                
suse.addtarget(attacked.uiddamageattack);
                                foreach (var 
obj in attacked.owner.screen.objects)
                                {
                                    if (
calculations.inbox(obj.xobj.yattacker.xattacker.y10))
                                    {
                                        if (
obj.mapobjtype == mapobjecttype.player)
                                        {
                                            if (
obj.owner.player.containsflag((ulong)msgupdate.flags.dead))
                                                continue;
                                            
attacked obj as player;
                                            if (
attacked.hitpoints <= damage)
                                            {
                                                
attacked.die(attacker);
                                            }
                                            else
                                            {
                                                
attacked.hitpoints -= damage;
                                                
attacked.owner.player.frozenstamp time32.now;
                                                
attacked.owner.player.frozentime 5;
                                                
msgracetrackstatus update = new msgracetrackstatus(true);
                                                
update.uid attacked.uid;
                                                
update.add(msgracetrackstatus.freeze05);
                                                
attacked.owner.sendscreen(updatetrue);
                                                
attacked.addflag((ulong)msgupdate.flags.freeze);
                                            }

                                            
suse.addtarget(attacked.uiddamageattack);
                                        }
                                    }
                                }
                                
attacked.owner.sendscreen(susetrue);
                            }
                            
#endregion
                        
}
                        
#endregion
                        #region treatodragon
                        
if (attacker.name == "teratodragon" || attacker.name == "lavabeast" || attacker.name == "shadowclone")
                        {
                            
uint rand = (uint)mr.hamooo.kernel.random.next(17);
                            switch (
rand)
                            {
                                case 
1:
                                    
Attacker.monsterinfo.spellid 7014;
                                    break;
                                case 
2:
                                    
Attacker.monsterinfo.spellid 7017;
                                    break;
                                case 
3:
                                    
Attacker.monsterinfo.spellid 7017;
                                    break;
                                case 
4:
                                    
Attacker.monsterinfo.spellid 7012;
                                    break;
                                case 
5:
                                    
Attacker.monsterinfo.spellid 7013;
                                    break;
                                case 
6:
                                    
Attacker.monsterinfo.spellid 7015;
                                    break;
                                case 
7:
                                    
Attacker.monsterinfo.spellid 7016;
                                    break;
                            }
                            
#region td area
                            
if (attacker.monsterinfo.spellid == 7014 || attacker.monsterinfo.spellid == 7017)
                            {
                                
msgmagiceffect suse = new msgmagiceffect(true);
                                
attack = new msginteract(true);
                                
attack.effect msginteract.interacteffects.none;
                                
uint damage 0;
                                
damage += (uint)kernel.random.next(10002000);
                                
suse.effect attack.effect;
                                if (
attacked.hitpoints <= damage)
                                {
                                    
attacked.die(attacker);
                                }
                                else
                                {
                                    
attacked.hitpoints -= damage;
                                }
                                if (
attacker.companion)
                                    
attacker.owner.increaseexperience(math.min(damageattacked.hitpoints), true);

                                
suse.attacker attacker.uid;
                                
suse.spellid attacker.monsterinfo.spellid;
                                
suse.attacked.x;
                                
suse.attacked.y;
                                
suse.addtarget(attacked.uiddamageattack);
                                foreach (var 
obj in attacked.owner.screen.objects)
                                {
                                    if (
calculations.inbox(obj.xobj.yattacker.xattacker.y14))
                                    {
                                        if (
obj.mapobjtype == mapobjecttype.player)
                                        {
                                            if (
obj.owner.player.containsflag((ulong)msgupdate.flags.dead))
                                                continue;
                                            
attacked obj as player;
                                            if (
attacked.hitpoints <= damage)
                                            {
                                                
attacked.die(attacker);
                                            }
                                            else
                                            {
                                                
attacked.hitpoints -= damage;
                                            }

                                            
suse.addtarget(attacked.uiddamageattack);
                                        }
                                    }
                                }
                                
attacked.owner.sendscreen(susetrue);
                            }
                        }
                            
#endregion
                        #region 2nd skill
                        
if (attacker.monsterinfo.spellid == 7013)
                        {
                            
msgmagiceffect suse = new msgmagiceffect(true);
                            
attack = new msginteract(true);
                            
attack.effect msginteract.interacteffects.none;
                            
uint damage 0;
                            
damage += (uint)kernel.random.next(10002000);
                            
suse.effect attack.effect;
                            if (
attacked.hitpoints <= damage)
                            {
                                
attacked.die(attacker);
                            }
                            else
                            {
                                
attacked.hitpoints -= damage;
                                
attacked.owner.frightenstamp time32.now;
                                
attacked.owner.player.fright 5;
                                var 
upd = new msgracetrackstatus(true);
                                
upd.uid attacked.uid;
                                
upd.add(msgracetrackstatus.dizzy05);
                                
attacked.owner.sendscreen(updtrue);
                                
attacked.owner.player.addflag((ulong)msgupdate.flags.freezesmall);
                            }
                            if (
attacker.companion)
                                
attacker.owner.increaseexperience(math.min(damageattacked.hitpoints), true);
                            
suse.attacker attacker.uid;
                            
suse.spellid attacker.monsterinfo.spellid;
                            
suse.attacked.x;
                            
suse.attacked.y;
                            
suse.addtarget(attacked.uiddamageattack);
                            foreach (var 
obj in attacked.owner.screen.objects)
                            {
                                if (
calculations.inbox(obj.xobj.yattacker.xattacker.y14))
                                {
                                    if (
obj.mapobjtype == mapobjecttype.player)
                                    {
                                        if (
obj.owner.player.containsflag((ulong)msgupdate.flags.dead))
                                            continue;
                                        
attacked obj as player;
                                        if (
attacked.hitpoints <= damage)
                                        {
                                            
attacked.die(attacker);
                                        }
                                        else
                                        {
                                            
attacked.hitpoints -= damage;
                                            
attacked.owner.frightenstamp time32.now;
                                            
attacked.owner.player.fright 5;
                                            var 
upd = new msgracetrackstatus(true);
                                            
upd.uid attacked.uid;
                                            
upd.add(msgracetrackstatus.dizzy05);
                                            
attacked.owner.sendscreen(updtrue);
                                            
attacked.owner.player.addflag((ulong)msgupdate.flags.freezesmall);
                                        }

                                        
suse.addtarget(attacked.uiddamageattack);
                                    }
                                }
                            }
                            
attacked.owner.sendscreen(susetrue);
                        }
                        
#endregion
                        #region chill
                        
if (attacker.monsterinfo.spellid == 7015)
                        {
                            
msgmagiceffect suse = new msgmagiceffect(true);
                            
attack = new msginteract(true);
                            
attack.effect msginteract.interacteffects.none;
                            
uint damage 0;
                            
damage += (uint)kernel.random.next(10002000);
                            
suse.effect attack.effect;
                            if (
attacked.hitpoints <= damage)
                            {
                                
attacked.die(attacker);
                            }
                            else
                            {
                                
attacked.hitpoints -= damage;
                                
attacked.owner.frightenstamp time32.now;
                                var 
upd = new msgracetrackstatus(true);
                                
upd.uid attacked.uid;
                                
upd.add(msgracetrackstatus.flustered05);
                                
attacked.owner.sendscreen(updtrue);
                                
attacked.owner.player.addflag((ulong)msgupdate.flags.chaoscycle);

                            }
                            if (
attacker.companion)
                                
attacker.owner.increaseexperience(math.min(damageattacked.hitpoints), true);

                            
suse.attacker attacker.uid;
                            
suse.spellid attacker.monsterinfo.spellid;
                            
suse.attacked.x;
                            
suse.attacked.y;
                            
suse.addtarget(attacked.uiddamageattack);
                            foreach (var 
obj in attacked.owner.screen.objects)
                            {
                                if (
calculations.inbox(obj.xobj.yattacker.xattacker.y14))
                                {
                                    if (
obj.mapobjtype == mapobjecttype.player)
                                    {
                                        if (
obj.owner.player.containsflag((ulong)msgupdate.flags.dead))
                                            continue;
                                        
attacked obj as player;
                                        if (
attacked.hitpoints <= damage)
                                        {
                                            
attacked.die(attacker);
                                        }
                                        else
                                        {
                                            
attacked.hitpoints -= damage;
                                            
attacked.owner.frightenstamp time32.now;
                                            var 
upd = new msgracetrackstatus(true);
                                            
upd.uid attacked.uid;
                                            
upd.add(msgracetrackstatus.flustered05);
                                            
attacked.owner.sendscreen(updtrue);
                                            
attacked.owner.player.addflag((ulong)msgupdate.flags.chaoscycle);
                                        }

                                        
suse.addtarget(attacked.uiddamageattack);
                                    }
                                }
                            }
                            
attacked.owner.sendscreen(susetrue);
                        }
                        
#endregion
                        #endregion
                        #region swordmaster
                        
if (attacker.name == "swordmaster" || attacker.name == "hollowbeast")
                        {
                            
uint rand = (uint)mr.hamooo.kernel.random.next(15);
                            switch (
rand)
                            {
                                case 
1:
                                    
Attacker.monsterinfo.spellid 10502;
                                    break;
                                case 
2:
                                    
Attacker.monsterinfo.spellid 10504;
                                    break;
                                case 
3:
                                    
Attacker.monsterinfo.spellid 10506;
                                    break;
                                case 
4:
                                    
Attacker.monsterinfo.spellid 10505;
                                    break;
                                case 
5:
                                    
Attacker.monsterinfo.spellid 10500;
                                    break;
                            }
                            
uint damage 0;
                            
damage += (uint)kernel.random.next(10002000);

                            if (
attacked.hitpoints <= damage)
                                
attacked.die(attacker);
                            else
                                
attacked.hitpoints -= damage;
                            if (
attacker.companion)
                                
attacker.owner.increaseexperience(math.min(damageattacked.hitpoints), true);
                            
msgmagiceffect suse = new msgmagiceffect(true);
                            
suse.attacker attacker.uid;
                            
suse.spellid attacker.monsterinfo.spellid;
                            
suse.attacked.x;
                            
suse.attacked.y;
                            
suse.addtarget(attacked.uiddamageattack);
                            
attacked.owner.sendscreen(susetrue);
                        }
                        
#endregion
                        #region thrillingspook
                        
if (attacker.name == "thrillingspook" || attacker.name == "thrillingspook2" || attacker.name == "thrillingspook3")
                        {
                            
uint rand = (uint)kernel.random.next(17);
                            switch (
rand)
                            {
                                case 
1Attacker.monsterinfo.spellid 10363; break;
                                case 
2:
                                    {
                                        if (!
attacked.containsflag((ulong)msgupdate.flags.stun))
                                        {
                                            
attacker.monsterinfo.spellid 10360;
                                            
attacked.addflag((ulong)msgupdate.flags.stun);
                                            
attacked.shockstamp time32.now;
                                            
attacked.shock 5;
                                            var 
upd = new msgracetrackstatus(true);
                                            
upd.uid attacked.uid;
                                            
upd.add(msgracetrackstatus.soulshacle05);
                                            
attacked.owner.sendscreen(updtrue);
                                        }
                                        break;
                                    }
                                case 
3Attacker.monsterinfo.spellid 10362; break;
                                case 
4Attacker.monsterinfo.spellid 10363; break;
                                case 
5Attacker.monsterinfo.spellid 10363; break;
                                case 
6Attacker.monsterinfo.spellid 10362; break;
                                case 
7:
                                    If (!
attacked.containsflag((ulong)msgupdate.flags.stun))
                                    {
                                        
attacker.monsterinfo.spellid 10361;
                                        
attacked.addflag((ulong)msgupdate.flags.stun);
                                        
attacked.shockstamp time32.now;
                                        
attacked.shock 5;
                                        var 
upd1 = new msgracetrackstatus(true);
                                        
upd1.uid attacked.uid;
                                        
upd1.add(msgracetrackstatus.soulshacle05);
                                        
attacked.owner.sendscreen(upd1true);
                                    }
                                    break;
                            }
                            
uint damage 0;
                            
damage += (uint)kernel.random.next(10002000);
                            if (
attacked.hitpoints <= damage)
                            {
                                
attacked.die(attacker);
                            }
                            else
                            {
                                
attacked.hitpoints -= damage;
                            }
                            if (
attacker.companion)
                                
attacker.owner.increaseexperience(math.min(damageattacked.hitpoints), true);
                            
msgmagiceffect suse = new msgmagiceffect(true);
                            
suse.attacker attacker.uid;
                            
suse.spellid attacker.monsterinfo.spellid;
                            
suse.attacked.x;
                            
suse.attacked.y;
                            
suse.addtarget(attacked.uiddamageattack);
                            
attacked.owner.sendscreen(susetrue);
                        }
                        
#endregion
                        #region thundercloud
                        
if (attacker.name == "thundercloud")
                        {
                            if (
attacker.owner.player.pkmode != game.enums.pkmode.pk &&
                         
attacker.owner.player.pkmode != game.enums.pkmode.team) return;
                            if (
kernel.gamepool.containskey(attacker.owneruid))
                            {
                                var 
owner kernel.gamepool[attacker.owneruid];
                                var 
spell database.spelltable.getspell(12840owner);
                                var 
spell2 database.spelltable.getspell(12970owner);
                                
byte percent 0;
                                if (
spell2 != null)
                                {
                                    if (
spell2.level == 0percent 130;
                                    if (
spell2.level == 1percent 140;
                                    if (
spell2.level == 2percent 150;
                                    if (
spell2.level == 3percent 160;
                                    if (
spell2.level == 4percent 170;
                                    if (
spell2.level == 5percent 180;
                                    if (
spell2.level == 6percent 200;
                                }
                                
attack = new msginteract(true);
                                
attack.attacker attacker.uid;
                                
attack.attacked attacked.uid;
                                
attack.interacttype network.gamepackets.msginteract.kill;
                                
attack.attacked.x;
                                
attack.attacked.y;
                                
attack.damage 1;
                                
uint damage2 = (uint)(calculate.melee(owner.playerattackedref attack) * spell.firstdamage 100);
                                if (
attacker.spawnpacket[50] == 128)//thunderbolt
                                    
damage2 = (uint)(damage2 percent 100);
                                
msgmagiceffect suse2 = new msgmagiceffect(true);
                                
suse2.attacker attacker.uid;
                                
suse2.attacker1 attacked.uid;
                                
suse2.spellid 13190;
                                
suse2.attacked.x;
                                
suse2.attacked.y;
                                
suse2.addtarget(attacked.uiddamage2attack);
                                
attacker.monsterinfo.sendscreen(suse2);
                                if (
attacked.hitpoints <= damage2)
                                {
                                    
attacked.die(attacker);
                                    
attack.responsedamage damage2;
                                    
attacker.monsterinfo.sendscreen(attack);
                                }
                                else
                                {
                                    
attacked.hitpoints -= damage2;
                                }
                                return;
                            }
                            else
                                return;
                        }
                        
#endregion
                        #region thundercloudsight
                        
foreach (var th in kernel.maps[attacker.mapid].entities.values.where(=> i.name == "thundercloud"))
                        {
                            if (
th.owneruid == attacked.uid)
                            {
                                if (
attacker == null || kernel.getdistance(attacker.xattacker.yth.xth.y) > th.monsterinfo.attackrange || attacker.dead) break;

                                
th.monsterinfo.insight attacker.uid;
                                break;
                            }
                        }
                        
#endregion
                        #region guard
                        
if (attacker.name == "guard1")
                        {
                            
uint rand = (uint)kernel.random.next(115);
                            switch (
rand)
                            {
                                case 
1:
                                    
Attacker.monsterinfo.spellid 7012;
                                    break;
                                case 
2:
                                    
Attacker.monsterinfo.spellid 7013;
                                    break;
                                case 
3:
                                    
Attacker.monsterinfo.spellid 7015;
                                    break;
                                case 
4:
                                    
Attacker.monsterinfo.spellid 7016;
                                    break;
                                case 
5:
                                    
Attacker.monsterinfo.spellid 7017;
                                    break;
                                case 
6:
                                    
Attacker.monsterinfo.spellid 10001;
                                    break;
                                case 
7:
                                    
Attacker.monsterinfo.spellid 10363;
                                    break;
                                case 
8:
                                    
Attacker.monsterinfo.spellid 10362;
                                    break;
                                case 
9:
                                    
Attacker.monsterinfo.spellid 10502;
                                    break;
                                case 
10:
                                    
Attacker.monsterinfo.spellid 10504;
                                    break;
                                case 
11:
                                    
Attacker.monsterinfo.spellid 10506;
                                    break;
                                case 
12:
                                    
Attacker.monsterinfo.spellid 10505;
                                    break;
                                case 
13:
                                    
Attacker.monsterinfo.spellid 30012;
                                    break;
                                case 
14:
                                    
Attacker.monsterinfo.spellid 10001;
                                    break;
                                case 
15:
                                    
Attacker.monsterinfo.spellid 30015;
                                    break;
                            }
                            
uint damage 0;
                            
damage += (uint)kernel.random.next(5000060000);
                            if (
attacked == null)
                                return;
                            if (
attacked.hitpoints <= damage)
                            {
                                
attacked.die(attacker);
                            }
                            else
                            {
                                
attacked.hitpoints -= damage;
                            }
                            if (
attacker.companion)
                                
attacker.owner.increaseexperience(math.min(damageattacked.hitpoints), true);
                            
msgmagiceffect suse = new msgmagiceffect(true);
                            
suse.attacker attacker.uid;
                            
suse.spellid attacker.monsterinfo.spellid;
                            
suse.attacked.x;
                            
suse.attacked.y;
                            
suse.addtarget(attacked.uiddamageattack);
                            
attacked.owner.sendscreen(susetrue);
                        }
                        
#endregion
                    
}
                    
attack = new msginteract(true);
                    
attack.effect msginteract.interacteffects.none;
                    
attack.attacker attacker.uid;
                    
attack.attacked attacker.monsterinfo.id;
                    
attack.attacked.x;
                    
attack.attacked.y;
                    
attack.interacttype msginteract.showusespell;
                    
attack.monsterspellid attacker.monsterinfo.spellid;
                    
attacker.monsterinfo.sendscreen(attack);
                    if (
attacker.monsterinfo.spellid == 0)
                    {
                        
attack = new msginteract(true);
                        
attack.effect msginteract.interacteffects.none;

                        
uint damage calculate.melee(attackerattackedref attack);
                        
#region revengetaill
                        
if (attacked.containsflag4((ulong)network.gamepackets.msgupdate.flags4.revengetaill))
                        {
                            if (
attacked.owner != null && attacked.owner.spells != null && attacked.owner.spells.containskey(13030))
                            {
                                var 
spelll database.spelltable.getspell(13030attacked.owner);
                                if (
damage <= spelll.power)
                                {
                                    
msgmagiceffect suses = new msgmagiceffect(true);
                                    
suses.attacker attacked.uid;
                                    
suses.attacker1 attacker.uid;
                                    
suses.spellid 13030;
                                    
suses.specialeffect 1;
                                    
suses.addtarget(attacker.uiddamagenull);
                                    if (
attacker.hitpoints <= damage)
                                    {
                                        
attacker.die(attacked);
                                    }
                                    else
                                    {
                                        
attacker.hitpoints -= damage;
                                    }
                                    
attacked.owner.sendscreen(susestrue);
                                }
                            }
                        }
                        
#endregion

                        
attack.attacker attacker.uid;
                        
attack.attacked attacked.uid;
                        
attack.interacttype msginteract.melee;
                        
attack.damage damage;
                        
attack.attacked.x;
                        
attack.attacked.y;
                        if (
attacked.hitpoints <= damage)
                        {
                            if (
attacked.inhangup)
                            {
                                
msghangup autohunt = new msghangup();
                                
autohunt.action msghangup.mode.killedby;
                                
autohunt.unknown 3329;
                                
autohunt.killedname attacker.monsterinfo.name;
                                
autohunt.expgained attacked.hangupexp;
                                
attacked.owner.send(autohunt.toarray());
                                
attacked.autorevstamp time32.now;
                                
attacked.autorev 20;
                            }
                            
attacked.owner.sendscreen(attacktrue);
                            
attacked.die(attacker.uid);
                        }
                        else
                        {
                            
attacked.hitpoints -= damage;
                            
attacked.owner.sendscreen(attacktrue);
                        }
                    }
                    else
                    {
                        
msgmagiceffect suse = new msgmagiceffect(true);
                        
attack = new msginteract(true);
                        
attack.effect msginteract.interacteffects.none;
                        
uint damage calculate.magic(attackerattackedattacker.monsterinfo.spellid0ref attack);
                        
#region revengetaill
                        
if (attacked.containsflag4((ulong)network.gamepackets.msgupdate.flags4.revengetaill))
                        {
                            if (
attacked.owner != null && attacked.owner.spells != null && attacked.owner.spells.containskey(13030))
                            {
                                var 
spelll database.spelltable.getspell(13030attacked.owner);
                                if (
damage <= spelll.power)
                                {
                                    
msgmagiceffect suses = new msgmagiceffect(true);
                                    
suses.attacker attacked.uid;
                                    
suses.attacker1 attacker.uid;
                                    
suses.spellid 13030;
                                    
suses.specialeffect 1;
                                    
suses.addtarget(attacker.uiddamagenull);
                                    if (
attacker.hitpoints <= damage)
                                    {
                                        
attacker.die(attacked);
                                    }
                                    else
                                    {
                                        
attacker.hitpoints -= damage;
                                    }
                                    
attacked.owner.sendscreen(susestrue);
                                }
                            }
                        }
                        
#endregion

                        
suse.effect attack.effect;
                        if (
attacked.hitpoints <= damage)
                        {
                            
attacked.die(attacker.uid);
                            if (
attacked.inhangup)
                            {
                                
msghangup autohunt = new msghangup();
                                
autohunt.action msghangup.mode.killedby;
                                
autohunt.unknown 3329;
                                
autohunt.killedname attacker.monsterinfo.name;
                                
autohunt.expgained attacked.hangupexp;
                                
attacked.owner.send(autohunt.toarray());
                                
attacked.autorevstamp time32.now;
                                
attacked.autorev 20;
                            }
                        }
                        else
                        {
                            
attacked.hitpoints -= damage;
                        }
                        if (
attacker.companion)
                            
attacker.owner.increaseexperience(math.min(damageattacked.hitpoints), true);
                        
suse.attacker attacker.uid;
                        
suse.spellid attacker.monsterinfo.spellid;
                        
suse.attacked.x;
                        
suse.attacked.y;
                        
suse.addtarget(attacked.uiddamageattack);
                        
attacked.owner.sendscreen(susetrue);
                    }
                }
                else
                {
                    if (
attacker.monsterinfo.spellid == 0)
                    {
                        
attack = new msginteract(true);
                        
attack.effect msginteract.interacteffects.none;
                        
uint damage calculate.melee(attackerattackedref attack);
                        
#region revengetaill
                        
if (attacked.containsflag4((ulong)network.gamepackets.msgupdate.flags4.revengetaill))
                        {
                            if (
attacked.owner != null && attacked.owner.spells != null && attacked.owner.spells.containskey(13030))
                            {
                                var 
spelll database.spelltable.getspell(13030attacked.owner);
                                if (
damage <= spelll.power)
                                {
                                    
msgmagiceffect suses = new msgmagiceffect(true);
                                    
suses.attacker attacked.uid;
                                    
suses.attacker1 attacker.uid;
                                    
suses.spellid 13030;
                                    
suses.specialeffect 1;
                                    
suses.addtarget(attacker.uiddamagenull);
                                    if (
attacker.hitpoints <= damage)
                                    {
                                        
attacker.die(attacked);
                                    }
                                    else
                                    {
                                        
attacker.hitpoints -= damage;
                                    }
                                    
attacked.owner.sendscreen(susestrue);
                                }
                            }
                        }
                        
#endregion

                        
attack.attacker attacker.uid;
                        
attack.attacked attacked.uid;
                        
attack.interacttype msginteract.melee;
                        
attack.damage damage;
                        
attack.attacked.x;
                        
attack.attacked.y;
                        
attacked.monsterinfo.sendscreen(attack);
                        if (
attacker.companion)
                            if (
damage attacked.hitpoints)
                                
attacker.owner.increaseexperience(math.min(damageattacked.hitpoints), true);
                            else 
attacker.owner.increaseexperience(damagetrue);
                        if (
attacked.hitpoints <= damage)
                        {
                            
attacked.die(attacker);
                            
attack = new msginteract(true);
                            
attack.attacker attacker.uid;
                            
attack.attacked attacked.uid;
                            
attack.interacttype network.gamepackets.msginteract.kill;
                            
attack.attacked.x;
                            
attack.attacked.y;
                            
attacked.monsterinfo.sendscreen(attack);
                        }
                        else
                        {
                            
attacked.hitpoints -= damage;
                        }
                    }
                    else
                    {
                        
msgmagiceffect suse = new msgmagiceffect(true);
                        
attack = new msginteract(true);
                        
attack.effect msginteract.interacteffects.none;
                        
#region thundercloud
                        
if (attacker.name == "thundercloud")
                        {
                            if (
attacker.owner.player.pkmode != game.enums.pkmode.pk &&
                        
attacker.owner.player.pkmode != game.enums.pkmode.team) return;
                            if (
kernel.gamepool.containskey(attacker.owneruid))
                            {
                                var 
owner kernel.gamepool[attacker.owneruid];
                                var 
spell database.spelltable.getspell(12840owner);
                                var 
spell2 database.spelltable.getspell(12970owner);
                                
uint damage2 = (uint)(calculate.melee(owner.playerattackedref attack) * (spell.level Spell.firstdamage 50) / 100);
                                if (
attacker.spawnpacket[50] == 128)
                                    
damage2 = (uint)(damage2 spell2.firstdamage);
                                
msgmagiceffect suse2 = new msgmagiceffect(true);
                                
suse2.attacker attacker.uid;
                                
suse2.attacker1 attacked.uid;
                                
suse2.spellid 13190;
                                
suse2.attacked.x;
                                
suse2.attacked.y;
                                
suse2.addtarget(attacked.uiddamage2attack);
                                
attacker.monsterinfo.sendscreen(suse2);
                                if (
attacked.hitpoints <= damage2)
                                {
                                    
attacked.die(attacker);
                                    
attack = new msginteract(true);
                                    
attack.attacker attacker.uid;
                                    
attack.attacked attacked.uid;
                                    
attack.interacttype network.gamepackets.msginteract.kill;
                                    
attack.attacked.x;
                                    
attack.attacked.y;
                                    
attack.damage 1;
                                    
attack.responsedamage damage2;
                                    
attacker.monsterinfo.sendscreen(attack);
                                }
                                else
                                {
                                    
attacked.hitpoints -= damage2;
                                }
                                return;
                            }
                            else
                                return;
                        }
                        
#endregion
                        
uint damage calculate.magic(attackerattackedattacker.monsterinfo.spellid0ref attack);
                        
#region revengetaill
                        
if (attacked.containsflag4((ulong)network.gamepackets.msgupdate.flags4.revengetaill))
                        {
                            if (
attacked.owner != null && attacked.owner.spells != null && attacked.owner.spells.containskey(13030))
                            {
                                var 
spelll database.spelltable.getspell(13030attacked.owner);
                                if (
damage <= spelll.power)
                                {
                                    
msgmagiceffect suses = new msgmagiceffect(true);
                                    
suses.attacker attacked.uid;
                                    
suses.attacker1 attacker.uid;
                                    
suses.spellid 13030;
                                    
suses.specialeffect 1;
                                    
suses.addtarget(attacker.uiddamagenull);
                                    if (
attacker.hitpoints <= damage)
                                    {
                                        
attacker.die(attacked);
                                    }
                                    else
                                    {
                                        
attacker.hitpoints -= damage;
                                    }
                                    
attacked.owner.sendscreen(susestrue);
                                }
                            }
                        }
                        
#endregion

                        
suse.effect attack.effect;
                        
suse.attacker attacker.uid;
                        
suse.spellid attacker.monsterinfo.spellid;
                        
suse.attacked.x;
                        
suse.attacked.y;
                        
suse.addtarget(attacked.uiddamageattack);
                        
attacked.monsterinfo.sendscreen(suse);
                        if (
attacker.companion)
                            if (
damage attacked.hitpoints)
                                
attacker.owner.increaseexperience(math.min(damageattacked.hitpoints), true);
                            else
                                
attacker.owner.increaseexperience(damagetrue);
                        if (
attacked.hitpoints <= damage)
                        {
                            
attacked.die(attacker);
                            
attack = new msginteract(true);
                            
attack.attacker attacker.uid;
                            
attack.attacked attacked.uid;
                            
attack.interacttype network.gamepackets.msginteract.kill;
                            
attack.attacked.x;
                            
attack.attacked.y;
                            
attacked.monsterinfo.sendscreen(attack);
                        }
                        else
                        {
                            
attacked.hitpoints -= damage;
                        }
                    }
                }
            }
            
#endregion
            #region player -> player \ monster \ sob npc
            
else
            {
                
#region merchant
                
if (attack.interacttype == msginteract.merchantaccept || attack.interacttype == msginteract.merchantrefuse)
                {
                    
attacker.attackpacket null; return;
                }
                
#endregion
                #region marriage
                
if (attack.interacttype == msginteract.marriageaccept || attack.interacttype == msginteract.marriagerequest)
                {
                    if (
attack.interacttype == msginteract.marriagerequest)
                    {
                        
client.gamestate spouse null;
                        
uint takeout attack.attacked;
                        if (
takeout == attacker.uid)
                            
takeout attack.attacker;
                        if (
kernel.gamepool.trygetvalue(takeoutout spouse))
                        {
                            
msgrelation relation = new msgrelation();
                            
relation.requester attacker.uid;
                            
relation.receiver spouse.player.uid;
                            
relation.level attacker.level;
                            
relation.battlepower = (uint)attacker.battlepower;
                            
relation.spouse attacker.name == spouse.player.spouse;
                            
relation.friend attacker.owner.friends.containskey(spouse.player.uid);
                            
relation.tradepartner attacker.owner.partners.containskey(spouse.player.uid);
                            if (
attacker.owner.mentor != null)
                                
relation.mentor attacker.owner.mentor.id == spouse.player.uid;
                            
relation.apprentice attacker.owner.apprentices.containskey(spouse.player.uid);
                            if (
attacker.owner.team != null)
                                
relation.teammate attacker.owner.team.isteammate(spouse.player.uid);
                            if (
attacker.owner.guild != null)
                                
relation.guildmember attacker.owner.guild.members.containskey(spouse.player.uid);
                            
relation.enemy attacker.owner.enemy.containskey(spouse.player.uid);
                            
spouse.send(relation);

                            if (
attacker.spouse != "none" || spouse.player.spouse != "none")
                            {
                                
attacker.owner.send(new msgtalk("you cannot marry someone that is already married with someone else!"color.blackmsgtalk.topleft));
                            }
                            else
                            {
                                
uint id1 attacker.mesh 10id2 spouse.player.mesh 10;
                                if (
id1 <= && id2 >= || id1 >= && id2 <= 3)
                                {
                                    
attack.spouse.player.x;
                                    
attack.spouse.player.y;
                                    
spouse.send(attack);
                                }
                                else
                                {
                                    
attacker.owner.send(new msgtalk("you cannot marry someone of your gender!"color.blackmsgtalk.topleft));
                                }
                            }
                        }
                    }
                    else
                    {
                        
client.gamestate spouse null;
                        if (
kernel.gamepool.trygetvalue(attack.attackedout spouse))
                        {
                            if (
attacker.spouse != "none" || spouse.player.spouse != "none")
                            {
                                
attacker.owner.send(new msgtalk("you cannot marry someone that is already married with someone else!"color.blackmsgtalk.topleft));
                            }
                            else
                            {
                                if (
attacker.mesh 10 <= && spouse.player.mesh 10 >= || attacker.mesh 10 >= && spouse.player.mesh 10 <= 2)
                                {
                                    
spouse.player.spouse attacker.name;
                                    
attacker.spouse spouse.player.name;
                                    
msgtalk message null;
                                    if (
spouse.player.mesh 10 >= 3)
                                        
message = new msgtalk("joy and happiness! " spouse.player.name " and " attacker.name " have joined together in the holy marriage. We wish them a stone house."color.burlywoodmsgtalk.center);
                                    else 
message = new msgtalk("joy and happiness! " attacker.name " and " attacker.spouse " have joined together in the holy marriage. We wish them a stone house."color.burlywoodmsgtalk.center);
                                    foreach (
client.gamestate client in server.gamepool)
                                    {
                                        
client.send(message);
                                    }
                                    
spouse.player.update(msgname.mode.effect"firework-2love"true);
                                    
attacker.update(msgname.mode.effect"firework-2love"true);
                                }
                                else
                                {
                                    
attacker.owner.send(new msgtalk("you cannot marry someone of your gender!"system.drawing.color.blackmsgtalk.topleft));
                                }
                            }
                        }
                    }
                }
                
#endregion
                #region attacking
                
else
                {
                    
attacker.owner.attackable true;
                    
player attacked null;
                    
msgnpcinfoex attackedsob null;
                    
msgmapitem attackeditem null;
                    
#region checks
                    
if (attack.attacker != attacker.uid) return;
                    if (
attacker.playerflag != playerflag.player) return;
                    
attacker.removeflag((ulong)msgupdate.flags.invisibility);
                    
bool pass false;
                    if (
attack.interacttype == msginteract.melee)
                    {
                        if (
attacker.onfatalstrike())
                        {
                            if (
attack.attacked 600000)
                            {
                                
pass true;
                            }
                        }
                    }
                    
ushort decrease 0;
                    if (
attacker.oncyclone())
                        
decrease 1;
                    if (
attacker.onsuperman())
                        
decrease 300;
                    if (!
pass && attack.interacttype != msginteract.magic)
                    {
                       
int milliseconds 1000 attacker.agility decrease;
                        if (
milliseconds || milliseconds 5000)
                            
milliseconds 0;
                        if (
time32.now attacker.attackstamp.addmilliseconds(milliseconds)) return;
                        
attacker.attackstamp time32.now;
                    }
                    if (
attacker.dead)
                    {
                        if (
attacker.attackpacket != null)
                            
attacker.attackpacket null; return;
                    }
                    if (
attacker.owner.inqualifier())
                    {
                        if (
time32.now attacker.owner.importtime().addseconds(12))
                        {
                            return;
                        }
                    }
                    
bool dowep1spell falsedowep2spell false;
                
restart:
                    
#region extract attack information
                    
ushort spellid 000;
                    
uint target 0;
                    if (
attack.interacttype == msginteract.magic)
                    {
                        if (!
attack.decoded)
                        {
                            
#region getskillid
                            
spellid convert.touint16(((long)attack.toarray()[24 4] & 0xff) | (((long)attack.toarray()[25 4] & 0xff) << 8));
                            
spellid ^= (ushort)0x915d;
                            
spellid ^= (ushort)attacker.uid;
                            
spellid = (ushort)(spellid << 0x3 spellid >> 0xd);
                            
spellid -= 0xeb42;
                            
#endregion
                            #region getcoords
                            
= (ushort)((attack.toarray()[16 4] & 0xff) | ((attack.toarray()[17 4] & 0xff) << 8));
                            
= (ushort)(^ (uint)(attacker.uid 0xffff) ^ 0x2ed6);
                            
= (ushort)(((<< 1) | ((0x8000) >> 15)) & 0xffff);
                            
= (ushort)((0xffff0000) - 0xffff22ee);
                            
= (ushort)((attack.toarray()[18 4] & 0xff) | ((attack.toarray()[19 4] & 0xff) << 8));
                            
= (ushort)(^ (uint)(attacker.uid 0xffff) ^ 0xb99b);
                            
= (ushort)(((<< 5) | ((0xf800) >> 11)) & 0xffff);
                            
= (ushort)((0xffff0000) - 0xffff8922);
                            
#endregion
                            #region gettarget
                            
target = ((uint)attack.toarray()[12 4] & 0xff) | (((uint)attack.toarray()[13 4] & 0xff) << 8) | (((uint)attack.toarray()[14 4] & 0xff) << 16) | (((uint)attack.toarray()[15 4] & 0xff) << 24);
                            
target = ((((target 0xffffe000) >> 13) | ((target 0x1fff) << 19)) ^ 0x5f2d2463 attacker.uid) - 0x746f4ae6;
                            
#endregion
                            
attack.x;
                            
attack.y;
                            
attack.damage spellid;
                            
attack.attacked target;
                            
attack.decoded true;
                        }
                        else
                        {
                            
attack.x;
                            
attack.y;
                            
spellid = (ushort)attack.damage;
                            
target attack.attacked;
                        }
                    }
                    
#endregion
                    
if (!pass && attack.interacttype == msginteract.magic)
                    {
                        if (!(
dowep1spell || dowep2spell))
                        {
                            if (
spellid == 1045 || spellid == 1046 || spellid == 11005 || spellid == 11000 || spellid == 1100)
                            {
                            }
                            else
                            {
                                
int milliseconds 1000 attacker.agility decrease;
                                if (
milliseconds || milliseconds 5000)
                                    
milliseconds 0;
                                if (
time32.now attacker.attackstamp.addmilliseconds(milliseconds)) return;
                            }
                            
attacker.attackstamp time32.now;
                        }
                    }
                    
#endregion
                    
if (attacker.owner.screen.trygetflooritem(targetout attackeditem))
                    {
                        
lotusattack(attackeditemattackerattack);
                        return;
                    }
                    if (
attacker.mapid == steedrace.mapid)
                    {
                        if (
attacker.containsflag((ulong)msgupdate.flags.ride))
                        {
                            
quitsteedrace(attacker);
                        }
                        return;
                    }
                    if (
attacker.containsflag((ulong)msgupdate.flags.ride) && attacker.owner.equipment.trygetitem(18) == null)
                    {
                        if (
attack.interacttype != msginteract.magic)
                            
attacker.removeflag((ulong)msgupdate.flags.ride);
                        else if (!(
spellid == 7003 || spellid == 7002))
                            
attacker.removeflag((ulong)msgupdate.flags.ride);
                    }
                    if (
attacker.containsflag((ulong)msgupdate.flags.castpray))
                        
attacker.removeflag((ulong)msgupdate.flags.castpray);
                    if (
attacker.containsflag((ulong)msgupdate.flags.praying))
                        
attacker.removeflag((ulong)msgupdate.flags.praying);
                    
#region dash
                    
if (spellid == 1051)
                    {
                        if (
kernel.getdistance(attack.xattack.yattacker.xattacker.y) > 4)
                        {
                            
attacker.owner.disconnect(); return;
                        }
                        
attacker.attack.xattacker.attack.y;
                        
ushort x attacker.xattacker.y;
                        
map.updatecoordonatesforangle(ref xref y, (enums.conquerangle)target);
                        foreach (
imapobject obj in attacker.owner.screen.objects)
                        {
                            if (
obj == null) continue;
                            if (
obj.== && obj.== && (obj.mapobjtype == mapobjecttype.monster || obj.mapobjtype == mapobjecttype.player))
                            {
                                
player player obj as player;
                                if (!
player.dead)
                                {
                                    
target obj.uid;
                                    break;
                                }
                            }
                        }
                    }
                    
#endregion
                    #region counterkill
                    
if (attack.interacttype == msginteract.counterkillswitch)
                    {
                        if (
attacked != null)
                            if (
attacked.containsflag((ulong)msgupdate.flags.fly))
                            {
                                
attacker.attackpacket null; return;
                            }
                        if (
attacker != null)
                            if (
attacker.containsflag((ulong)msgupdate.flags.fly))
                            {
                                
attacker.attackpacket null; return;
                            }
                        if (
attacker.owner.spells.containskey(6003))
                        {
                            if (!
attacker.counterkillswitch)
                            {
                                if (
time32.now >= attacker.counterkillstamp.addseconds(30))
                                {
                                    
attacker.counterkillstamp time32.now;
                                    
attacker.counterkillswitch true;
                                    
msginteract m_attack = new msginteract(true);
                                    
m_attack.attacked attacker.uid;
                                    
m_attack.attacker attacker.uid;
                                    
m_attack.interacttype msginteract.counterkillswitch;
                                    
m_attack.damage 1;
                                    
m_attack.attacker.x;
                                    
m_attack.attacker.y;
                                    
m_attack.send(attacker.owner);
                                }
                            }
                            else
                            {
                                
attacker.counterkillswitch false;
                                
msginteract m_attack = new msginteract(true);
                                
m_attack.attacked attacker.uid;
                                
m_attack.attacker attacker.uid;
                                
m_attack.interacttype msginteract.counterkillswitch;
                                
m_attack.damage 0;
                                
m_attack.attacker.x;
                                
m_attack.attacker.y;
                                
m_attack.send(attacker.owner);
                            }
                            
attacker.owner.increasespellexperience(1006003);
                            
attacker.attackpacket null;
                        }
                    }
                    
#endregion
                    #region melee
                    
else if (attack.interacttype == msginteract.melee)
                    {
                        if (
attacker.isbowequipped)
                        {
                            
attack.interacttype msginteract.ranged;
                            new 
game.attacking.handle(attackattackerattacked);
                            return;
                        }
                        if (
attacker.owner.screen.trygetvalue(attack.attackedout attacked))
                        {
                            var 
spell spelltable.getspell(attack.spellid0);
                            if (
attacker.owner.spells.containskey(attack.spellid))
                                
spell spelltable.getspell(attack.spellidattacker.owner.spells[attack.spellid].level);
                            if (
attack.spellid == 12580 ||
                                
attack.spellid == 12590 ||
                                
attack.spellid == 12600 ||
                                
attack.spellid == 12570 ||
                                
attack.spellid == 12220 ||
                                
attack.spellid == 12210)
                                
attack.interacttype msginteract.magic;
                            switch (
attack.spellid)
                            {
                                
#region upsweep
                                
case 12580://up                               
                                    
{
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);

                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            if (
attacked == null)
                                                return;
                                            var 
angle kernel.getangle(attacker.xattacker.yattacked.xattacked.y);
                                            
map.updatecoordonatesforangle(ref xref yangle);

                                            
fan sector = new fan(attacker.xattacker.yxyspell.rangespell.sector);

                                            foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
kernel.getdistance(attacker.xattacker.y_obj.x_obj.y) <= 7)
                                                {
                                                    if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        
attacked _obj as player;

                                                        if (
sector.isinfan(attacked.xattacked.y))
                                                        {
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            {
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage game.attacking.calculate.melee(attackerattackedref attack);
                                                                
damage = (uint)(damage 0.6);
                                                                
suse.effect attack.effect;
                                                                
receiveattack(attackerattackedattackref damagespell);
                                                                
suse.addtarget(attacked.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                    {
                                                        
attackedsob _obj as msgnpcinfoex;

                                                        if (
sector.isinfan(attackedsob.xattackedsob.y))
                                                        {
                                                            if (
canattack(attackerattackedsobspell))
                                                            {
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage game.attacking.calculate.melee(attackerattackedsobref attack);
                                                                
receiveattack(attackerattackedsobattackdamagespell);

                                                                
suse.addtarget(attackedsob.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }

                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region downsweep
                                
case 12590://down                                                          
                                    
{
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);

                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            if (
attacked == null)
                                                return;
                                            var 
angle kernel.getangle(attacker.xattacker.yattacked.xattacked.y);
                                            
angle enums.oppositeangle(angle);
                                            
map.updatecoordonatesforangle(ref xref yangle);

                                            
fan sector = new fan(attacker.xattacker.yxyspell.rangespell.sector);

                                            foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
kernel.getdistance(attacker.xattacker.y_obj.x_obj.y) <= 7)
                                                {
                                                    if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        
attacked _obj as player;

                                                        if (
sector.isinfan(attacked.xattacked.y))
                                                        {
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            {
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage game.attacking.calculate.melee(attackerattackedref attack);
                                                                
damage = (uint)(damage 0.6);
                                                                
suse.effect attack.effect;
                                                                
receiveattack(attackerattackedattackref damagespell);
                                                                
suse.addtarget(attacked.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                    {
                                                        
attackedsob _obj as msgnpcinfoex;
                                                        ;

                                                        if (
sector.isinfan(attackedsob.xattackedsob.y))
                                                        {
                                                            if (
canattack(attackerattackedsobspell))
                                                            {
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage game.attacking.calculate.melee(attackerattackedsobref attack);
                                                                
receiveattack(attackerattackedsobattackdamagespell);

                                                                
suse.addtarget(attackedsob.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }

                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region strike
                              
case 12600:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);

                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;

                                            if (
kernel.getdistance(attacker.xattacker.yxy) <= attacker.attackrange 1)
                                            {
                                                if (
attackedsob != null)
                                                {
                                                    if (
canattack(attackerattackedsobspell))
                                                    {
                                                        
preparespell(spellattacker.owner);
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage game.attacking.calculate.melee(attackerattackedsobref attack);
                                                        
receiveattack(attackerattackedsobattackdamagespell);

                                                        
suse.addtarget(attackedsob.uiddamageattack);
                                                    }
                                                }
                                                else
                                                {
                                                    if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                    {
                                                        
preparespell(spellattacker.owner);

                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage game.attacking.calculate.melee(attackerattackedref attack);
                                                        
damage = (uint)(damage 0.7);
                                                        
suse.effect attack.effect;

                                                        
receiveattack(attackerattackedattackref damagespell);

                                                        
suse.addtarget(attacked.uiddamageattack);
                                                    }
                                                }
                                                
attacker.attackpacket null;
                                            }
                                            else
                                            {
                                                
attacker.attackpacket null;
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        
attacker.attackpacket null;
                                        break;
                                    }
                                
#endregion
                                #region wrathofemperor
                                
case 12570:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);

                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.attacker1 attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.specialeffect 1;

                                            
suse.x;
                                            
suse.y;


                                            if (
kernel.getdistance(attacker.xattacker.yxy) <= spell.range)
                                            {
                                                foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                                {
                                                    if (
_obj == null)
                                                        continue;
                                                    if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        
attacked _obj as player;
                                                        if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.range)
                                                        {
                                                            if (
attacked.containsflag((ulong)msgupdate.flags.fly))
                                                                return;
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            {
                                                                
preparespell(spellattacker.owner);

                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage game.attacking.calculate.melee(attackerattackedref attack);
                                                                
suse.effect attack.effect;

                                                                
receiveattack(attackerattackedattackref damagespell);

                                                                
suse.addtarget(attacked.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                    {
                                                        
attackedsob _obj as msgnpcinfoex;
                                                        if (
kernel.getdistance(attacker.xattacker.yattackedsob.xattackedsob.y) <= spell.range)
                                                        {
                                                            if (
canattack(attackerattackedsobspell))
                                                            {
                                                                
preparespell(spellattacker.owner);
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage game.attacking.calculate.melee(attackerattackedsobref attack);
                                                                
receiveattack(attackerattackedsobattackdamagespell);

                                                                
suse.addtarget(attackedsob.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.attackpacket null;
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                
default:
                                    Break;
                            }
                            
#region earthsweep
                            
if (attack.spellid == 12220 || attack.spellid == 12210)
                            {
                                
msgmagiceffect suse = new msgmagiceffect(true);
                                
suse.attacker attacker.uid;
                                
suse.spellid attack.spellid;
                                
suse.spelllevel 0;
                                
suse.attacker.x;
                                
suse.attacker.y;
                                
fan fan = new fan(attacker.xattacker.yattacked.xattacked.y7180);
                                foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                {
                                    if (
_obj == null)
                                        continue;
                                    if (
_obj.mapobjtype == mapobjecttype.monster ||
                                        
_obj.mapobjtype == mapobjecttype.player)
                                    {
                                        
attacked _obj as player;
                                        if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= 7)
                                        {
                                            if (
canattack(attackerattackednullattack.interacttype == msginteract.melee))
                                            {
                                                
attack.effect msginteract.interacteffects.none;
                                                
uint damage game.attacking.calculate.melee(attacker,
                                                    
attackedref attack);
                                                
attack.attacked 0;
                                                
attack.damage damage;
                                                
suse.effect attack.effect;
                                                
receiveattack(attackerattackedattackref damagenull);
                                                
suse.addtarget(attacked.uiddamageattack);
                                            }
                                        }
                                    }
                                }
                                
attacker.owner.sendscreen(susetrue);
                                
attacker.attackpacket null;
                                
attack null;
                                return;
                            }
                            
#endregion
                            #region stomper(melee)
                            #region anger-horror-peace~of~stomper(windwalker-stomper-passive)
                            
var lastattacked attacked;
                            var 
spell5 database.spelltable.getspell(12980attacker.owner);
                            if (
kernel.rate(spell5.percent) && attacker.owner.spells.containskey(12980) && attacker.isstomper2())
                            {
                                
#region angerofstomper
                                
{
                                    
msgmagiceffect suse = new msgmagiceffect(true);
                                    
suse.attacker attacker.uid;
                                    
suse.spellid spell5.id;
                                    
suse.spelllevel spell5.level;
                                    
suse.lastattacked.x;
                                    
suse.lastattacked.y;
                                    foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                    {
                                        if (
_obj == null)
                                            continue;
                                        
attacked _obj as player;
                                        if (
attacked == null) continue;
                                        if (
kernel.getdistance(attacked.xattacked.yattacker.xattacker.y) <= spell5.range)
                                        {
                                            if (
_obj.mapobjtype == mapobjecttype.player)
                                            {
                                                if (!
canattack(attackerattackednullattack.interacttype == msginteract.melee)) continue;
                                                
uint damage game.attacking.calculate.melee(attackerattackedref attack) * (spell5.power 30000) / 100;
                                                
damage = (uint)(damage 0.5);
                                                
attack.damage 0;
                                                
receiveattack(attackerattackedattackref damagespell5);
                                                
suse.addtarget(attacked.uiddamageattack);
                                            }
                                            else if (
_obj.mapobjtype == mapobjecttype.monster)
                                            {
                                                if (!
canattack(attackerattackednullattack.interacttype == msginteract.melee)) continue;
                                                
uint damage game.attacking.calculate.melee(attackerattackedref attack) * (uint)((spell5.seconddamage 30000) / 100);

                                                
attack.damage 0;
                                                
receiveattack(attackerattackedattackref damagespell5);
                                                
suse.addtarget(attacked.uiddamageattack);
                                            }
                                        }

                                    }
                                    
attacker.attackpacket null;
                                    
attacker.owner.sendscreen(susetrue);

                                }
                                
#endregion
                                #region horrorofstomper
                                
{
                                    var 
spell2 database.spelltable.getspell(12990attacker.owner);
                                    if (!
attacker.owner.spells.containskey(12990)) return;
                                    
attack.damage 0;
                                    
msgmagiceffect suse = new msgmagiceffect(true);
                                    
suse.attacker attacker.uid;
                                    
suse.spellid spell2.id;
                                    
suse.spelllevel spell2.level;
                                    
suse.lastattacked.x;
                                    
suse.lastattacked.y;
                                    
attacker.attackpacket null;
                                    
attacker.owner.sendscreen(susetrue);
                                    
#region flooritem
                                    
var map kernel.maps[attacker.mapid];
                                    
network.gamepackets.msgmapitem flooritem = new network.gamepackets.msgmapitem(true);
                                    
flooritem.uid network.gamepackets.msgmapitem.flooruid.next;
                                    while (
map.npcs.containskey(flooritem.uid))
                                        
flooritem.uid network.gamepackets.msgmapitem.flooruid.next;
                                    
flooritem.itemid 1530;
                                    
flooritem.lastattacked.x;
                                    
flooritem.lastattacked.y;
                                    
flooritem.type msgmapitem.effect;
                                    
flooritem.mcolor 14;
                                    
flooritem.owneruid attacker.uid;
                                    
flooritem.ownerguilduid attacker.guildid;
                                    
flooritem.flowertype 3;
                                    
flooritem.unknown37 1;
                                    
flooritem.x2 attacker.x;
                                    
flooritem.y2 attacker.y;
                                    
flooritem.angle attacker.facing;
                                    
flooritem.mapid map.id;
                                    
flooritem.attack attack;
                                    
flooritem.onfloor time32.now;
                                    
flooritem.owner attacker.owner;
                                    
map.addflooritem(flooritem);
                                    
attacker.owner.sendscreenspawn(flooritemtrue);
                                    
#endregion
                                
}
                                
#endregion
                                #region peaceofstomper
                                
{
                                    var 
spell3 database.spelltable.getspell(13000attacker.owner);
                                    if (!
attacker.owner.spells.containskey(13000)) return;
                                    
attack.damage 0;
                                    
msgmagiceffect suse = new msgmagiceffect(true);
                                    
suse.attacker attacker.uid;
                                    
suse.spelllevel spell3.level;
                                    
suse.spellid spell3.id;
                                    
suse.lastattacked.x;
                                    
suse.lastattacked.y;
                                    
attacker.attackpacket null;
                                    
attacker.owner.sendscreen(susetrue);
                                    
#region flooritem
                                    
var map kernel.maps[attacker.mapid];
                                    
network.gamepackets.msgmapitem flooritem = new network.gamepackets.msgmapitem(true);
                                    
flooritem.uid network.gamepackets.msgmapitem.flooruid.next;
                                    while (
map.npcs.containskey(flooritem.uid))
                                        
flooritem.uid network.gamepackets.msgmapitem.flooruid.next;
                                    
flooritem.itemid 1540;
                                    
flooritem.lastattacked.x;
                                    
flooritem.lastattacked.y;
                                    
flooritem.x2 attacker.x;
                                    
flooritem.y2 attacker.y;
                                    
flooritem.type msgmapitem.effect;
                                    
flooritem.mcolor 14;
                                    
flooritem.owneruid attacker.uid;
                                    
flooritem.ownerguilduid attacker.guildid;
                                    
flooritem.flowertype 3;
                                    
flooritem.unknown37 1;
                                    
flooritem.mapid map.id;
                                    
flooritem.attack attack;
                                    
flooritem.onfloor time32.now;
                                    
flooritem.owner attacker.owner;
                                    
map.addflooritem(flooritem);
                                    
attacker.owner.sendscreenspawn(flooritemtrue);
                                    
#endregion
                                
}
                                
#endregion
                                
return;
                            }
                            
#endregion
                            
else if (attacker.isstomper1())
                            {
                                
#region sector-circle-rectangle(windwalker-stomper-melee)
                                
if (attack.spellid == 13040 || attack.spellid == 13050 || attack.spellid == 13060)
                                {
                                    
#region sector
                                    
if (attack.spellid == 13040)
                                    {
                                        var 
spell2 database.spelltable.getspell(13040attacker.owner);
                                        
msgmagiceffect suse = new msgmagiceffect(true);
                                        
suse.attacker attacker.uid;
                                        
suse.spellid attack.spellid;
                                        
suse.attacker.x;
                                        
suse.attacker.y;
                                        var 
angle kernel.getangle(attacker.xattacker.yattacked.xattacked.y);
                                        
map.updatecoordonatesforangle(ref xref yangle);
                                        
fan sector = new fan(attacker.xattacker.yxyspell2.rangespell2.sector);
                                        if (
kernel.getdistance(attacker.xattacker.yxy) <= 7)
                                        {
                                            foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                            {
                                                if (
_obj.mapobjtype == mapobjecttype.player || _obj.mapobjtype == mapobjecttype.monster)
                                                {
                                                    if (
_obj == null)
                                                        continue;
                                                    
attacked _obj as player;
                                                    if (
attacked == null) continue;
                                                    if (!
canattack(attackerattackednullattack.interacttype == msginteract.melee)) continue;
                                                    if (
sector.isinfan(attacked.xattacked.y))
                                                    {
                                                        if (
canattack(attackerattackedspell2attack.interacttype == msginteract.melee))
                                                        {
                                                            
uint damage game.attacking.calculate.melee(attackerattackedref attackspell2);
                                                            
damage = (uint)(damage 0.5);
                                                            
attack.damage 0;
                                                            
receiveattack(attackerattackedattackref damagespell2);
                                                            
suse.addtarget(attacked.uiddamageattack);
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    
#endregion
                                    #region circle
                                    
if (attack.spellid == 13050)
                                    {
                                        var 
spell2 database.spelltable.getspell(13050attacker.owner);
                                        
msgmagiceffect suse = new msgmagiceffect(true);
                                        
suse.attacker attacker.uid;
                                        
suse.spellid attack.spellid;
                                        
suse.attacker.x;
                                        
suse.attacker.y;
                                        foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                        {
                                            if (
_obj.mapobjtype == mapobjecttype.player || _obj.mapobjtype == mapobjecttype.monster)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                
attacked _obj as player;
                                                if (
attacked == null) continue;
                                                if (!
canattack(attackerattackednullattack.interacttype == msginteract.melee)) continue;
                                                if (
kernel.getdistance(attacked.xattacked.yattacker.xattacker.y) > 5) continue;
                                                
uint damage game.attacking.calculate.melee(attackerattackedref attack);
                                                
damage = (uint)(damage 0.5);
                                                
attack.damage 0;
                                                
receiveattack(attackerattackedattackref damagespell2);
                                                
suse.addtarget(attacked.uiddamageattack);
                                            }
                                        }
                                        
attacker.owner.sendscreen(susetrue);
                                        return;
                                    }
                                    
#endregion
                                    #region rectangle
                                    
if (attack.spellid == 13060)
                                    {
                                        var 
spell2 database.spelltable.getspell(13060attacker.owner);
                                        
msgmagiceffect suse = new msgmagiceffect(true);
                                        
suse.attacker attacker.uid;
                                        
suse.spellid attack.spellid;
                                        
suse.attacker.x;
                                        
suse.attacker.y;
                                        var 
angle kernel.getangle(attacker.xattacker.yattacked.xattacked.y);
                                        
map.updatecoordonatesforangle(ref xref yangle);
                                        
fan sector = new fan(attacker.xattacker.yxyspell2.rangespell2.sector);
                                        
uint damage2 game.attacking.calculate.melee(attackerattackedref attack);
                                        
attack.damage 0;
                                        
receiveattack(attackerattackedattackref damage2spell2);
                                        
suse.addtarget(attacked.uiddamage2attack);
                                        foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                        {
                                            if (
_obj.mapobjtype == mapobjecttype.player || _obj.mapobjtype == mapobjecttype.monster)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                
attacked _obj as player;
                                                if (
attacked == null) continue;
                                                if (!
canattack(attackerattackednullattack.interacttype == msginteract.melee)) continue;
                                                if (
sector.isinfan(attacked.xattacked.y))
                                                {
                                                    if (
kernel.getdistance(attacked.xattacked.yattacker.xattacker.y) > 7) continue;
                                                    
uint damage game.attacking.calculate.melee(attackerattackedref attack);
                                                    
damage = (uint)(damage 0.5);
                                                    
attack.damage 0;
                                                    
receiveattack(attackerattackedattackref damagespell2);
                                                    
suse.addtarget(attacked.uiddamageattack);
                                                }
                                            }
                                        }
                                        
attacker.owner.sendscreen(susetrue);
                                        return;
                                    }
                                    
#endregion
                                
}
                                
#endregion
                            
}
                            
#endregion
                            
if (attack.spellid == 12580 ||
                               
attack.spellid == 12590 ||
                               
attack.spellid == 12600 ||
                               
attack.spellid == 12570 ||
                               
attack.spellid == 12220 ||
                               
attack.spellid == 12210)
                            {
                                
attack.damage 0;
                                
attack.interacttype msginteract.melee;
                                return;
                            }
                            
checkforextraweaponpowers(attacker.ownerattacked);
                            if (!
canattack(attackerattackednullattack.interacttype == msginteract.melee)) return;
                            
pass false;
                            if (
attacker.onfatalstrike())
                            {
                                if (
attacked.playerflag == playerflag.monster)
                                {
                                    
pass true;
                                }
                            }
                            
ushort range attacker.attackrange;
                            if (
attacker.transformed)
                                
range = (ushort)attacker.transformationattackrange;
                            if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= range || pass)
                            {
                                
attack.effect msginteract.interacteffects.none;
                                
uint damage game.attacking.calculate.melee(attackerattackedref attack);
                                
                                
damage = (uint)(damage 0.3);
                                
attack.damage damage;
                                if (
attacker.onfatalstrike())
                                {
                                    if (
attacked.playerflag == playerflag.monster)
                                    {
                                        var 
weaps attacker.owner.weapons;
                                        
bool can false;
                                        if (
weaps.item1 != null)
                                            if (
weaps.item1 != null) if (weaps.item1.id 1000 == 601 || weaps.item1.id 1000 == 616can true; if (weaps.item2 != null) if (weaps.item2.id 1000 == 601 || weaps.item2.id 1000 == 616can true;
                                        
can true;
                                        if (
weaps.item2 != null)
                                            if (
weaps.item1 != null) if (weaps.item1.id 1000 == 601 || weaps.item1.id 1000 == 616can true; if (weaps.item2 != null) if (weaps.item2.id 1000 == 601 || weaps.item2.id 1000 == 616can true;
                                        
can true;
                                        if (!
can)
                                            return;
                                        
ushort x attacked.x;
                                        
ushort y attacked.y;
                                        
map.updatecoordonatesforangle(ref xref ykernel.getangle(attacked.xattacked.yattacker.xattacker.y));
                                        
attacker.shift(xy);
                                        
attack.x;
                                        
attack.y;
                                        
attack.damage damage;

                                        
attack.interacttype msginteract.fatalstrike;
                                    }
                                }
                                var 
weapons attacker.owner.weapons;
                                if (
weapons.item1 != null)
                                {
                                    
msgiteminfo rightweapon weapons.item1;
                                    
ushort wep1subyte = (ushort)(rightweapon.id 1000), wep2subyte 0;
                                    
bool wep1bs falsewep2bs false;
                                    if (
wep1subyte == 421 || wep1subyte == 620)
                                    {
                                        
wep1bs true;
                                        
wep1subyte 420;
                                    }
                                    
ushort wep1spellid 0wep2spellid 0;
                                    
database.spellinformation wep1spell nullwep2spell null;
                                    if (
database.spelltable.weaponspells.containskey(wep1subyte))
                                    {
                                        var 
weaponskill database.spelltable.weaponspells[wep1subyte];
                                        for (
int i 0weaponskill.counti++)
                                        {
                                            if (!
dowep1spell || (kernel.rate(50) && weaponskill.count 1))
                                            {
                                                
wep1spellid weaponskill[i];
                                                if (
attacker.owner.spells.containskey(wep1spellid) && database.spelltable.spellinformations.containskey(wep1spellid))
                                                {
                                                    
wep1spell database.spelltable.spellinformations[wep1spellid][attacker.owner.spells[wep1spellid].level];
                                                    
dowep1spell kernel.rate(wep1spell.percent);
                                                    
//if (attacked.playerflag == playerflag.player && wep1spellid == 10490)
                                                    //    dowep1spell = kernel.rate(5);
                                                
}
                                            }
                                        }
                                    }
                                    if (!
dowep1spell)
                                    {
                                        if (
weapons.item2 != null)
                                        {
                                            
msgiteminfo leftweapon weapons.item2;
                                            
wep2subyte = (ushort)(leftweapon.id 1000);
                                            if (
wep2subyte == 421 || wep2subyte == 620)
                                            {
                                                
wep2bs true;
                                                
wep2subyte 420;
                                            }
                                            if (
database.spelltable.weaponspells.containskey(wep2subyte))
                                            {
                                                var 
weaponskill2 database.spelltable.weaponspells[wep2subyte];
                                                for (
int i 0weaponskill2.counti++)
                                                {
                                                    if (!
dowep2spell || (kernel.rate(50) && weaponskill2.count 1))
                                                    {
                                                        
wep2spellid weaponskill2[i];
                                                        if (
attacker.owner.spells.containskey(wep2spellid) && database.spelltable.spellinformations.containskey(wep2spellid))
                                                        {
                                                            
wep2spell database.spelltable.spellinformations[wep2spellid][attacker.owner.spells[wep2spellid].level];
                                                            
dowep2spell kernel.rate(wep2spell.percent);
                                                            
//if (attacked.playerflag == playerflag.player && wep2spellid == 10490)
                                                            //    dowep2spell = kernel.rate(5);
                                                        
}
                                                    }
                                                }
                                            }
                                        }
                                    }

                                    if (!
attacker.transformed)
                                    {
                                        if (
dowep1spell)
                                        {
                                            
attack.interacttype msginteract.magic;
                                            
attack.decoded true;
                                            
attack.checkweponspell true;
                                            
attack.attacked.x;
                                            
attack.attacked.y;
                                            
attack.attacked attacked.uid;
                                            
attack.damage wep1spell.id;
                                            goto 
restart;
                                        }
                                        if (
dowep2spell)
                                        {
                                            
attack.interacttype msginteract.magic;
                                            
attack.decoded true;
                                            
attack.checkweponspell true;
                                            
attack.attacked.x;
                                            
attack.attacked.y;
                                            
attack.attacked attacked.uid;
                                            
attack.damage wep2spell.id;
                                            goto 
restart;
                                        }
                                        if (
wep1bs)
                                            
wep1subyte++;
                                        if (
attacker.playerflag == playerflag.player && attacked.playerflag != playerflag.player)
                                            if (
damage attacked.hitpoints)
                                            {
                                                
attacker.owner.increaseproficiencyexperience(math.min(damageattacked.hitpoints), wep1subyte);
                                                if (
wep2subyte != 0)
                                                {
                                                    if (
wep2bs)
                                                        
wep2subyte++;
                                                    
attacker.owner.increaseproficiencyexperience(math.min(damageattacked.hitpoints), wep2subyte);
                                                }
                                            }
                                            else
                                            {
                                                
attacker.owner.increaseproficiencyexperience(damagewep1subyte);
                                                if (
wep2subyte != 0)
                                                {
                                                    if (
wep2bs)
                                                        
wep2subyte++;
                                                    
attacker.owner.increaseproficiencyexperience(damagewep2subyte);
                                                }
                                            }
                                    }
                                }
                                else
                                {
                                    if (!
attacker.transformed)
                                    {
                                        if (
attacker.playerflag == playerflag.player && attacked.playerflag != playerflag.player)
                                            if (
damage attacked.hitpoints)
                                            {
                                                
attacker.owner.increaseproficiencyexperience(math.min(damageattacked.hitpoints), 0);
                                            }
                                            else
                                            {
                                                
attacker.owner.increaseproficiencyexperience(damage0);
                                            }
                                    }
                                }
                                
receiveattack(attackerattackedattackref damagenull);
                                
attack.interacttype msginteract.melee;
                            }
                            else
                            {
                                
attacker.attackpacket null;
                            }
                        }
                        else if (
attacker.owner.screen.trygetsob(attack.attackedout attackedsob))
                        {
                            
checkforextraweaponpowers(attacker.ownernull);
                            if (
canattack(attackerattackedsobnull))
                            {
                                
ushort range attacker.attackrange;
                                if (
attacker.transformed)
                                    
range = (ushort)attacker.transformationattackrange;
                                if (
kernel.getdistance(attacker.xattacker.yattackedsob.xattackedsob.y) <= range)
                                {
                                    
attack.effect msginteract.interacteffects.none;
                                    
uint damage game.attacking.calculate.melee(attackerattackedsobref attack);

                                    var 
weapons attacker.owner.weapons;
                                    if (
weapons.item1 != null)
                                    {
                                        
msgiteminfo rightweapon weapons.item1;
                                        
ushort wep1subyte = (ushort)(rightweapon.id 1000), wep2subyte 0;
                                        
bool wep1bs falsewep2bs false;
                                        if (
wep1subyte == 421 || wep1subyte == 620)
                                        {
                                            
wep1bs true;
                                            
wep1subyte 420;
                                        }

                                        
ushort wep1spellid 0wep2spellid 0;
                                        
database.spellinformation wep1spell nullwep2spell null;
                                        if (
database.spelltable.weaponspells.containskey(wep1subyte))
                                        {
                                            var 
wep1 database.spelltable.weaponspells[wep1subyte];
                                            for (
int i 0wep1.counti++)
                                            {
                                                if (!
dowep1spell)
                                                {
                                                    
wep1spellid wep1[i];
                                                    if (
attacker.owner.spells.containskey(wep1spellid) && database.spelltable.spellinformations.containskey(wep1spellid))
                                                    {
                                                        
wep1spell database.spelltable.spellinformations[wep1spellid][attacker.owner.spells[wep1spellid].level];
                                                        
dowep1spell kernel.rate(wep1spell.percent);
                                                    }
                                                }
                                            }
                                        }
                                        if (!
dowep1spell)
                                        {
                                            if (
weapons.item2 != null)
                                            {
                                                
msgiteminfo leftweapon weapons.item2;
                                                
wep2subyte = (ushort)(leftweapon.id 1000);
                                                if (
wep2subyte == 421 || wep2subyte == 620)
                                                {
                                                    
wep2bs true;
                                                    
wep2subyte 420;
                                                }
                                                if (
database.spelltable.weaponspells.containskey(wep2subyte))
                                                {
                                                    var 
wep2 database.spelltable.weaponspells[wep2subyte];
                                                    for (
int i 0wep2.counti++)
                                                    {
                                                        
wep2spellid wep2[i];
                                                        if (
attacker.owner.spells.containskey(wep2spellid) && database.spelltable.spellinformations.containskey(wep2spellid))
                                                        {
                                                            
wep2spell database.spelltable.spellinformations[wep2spellid][attacker.owner.spells[wep2spellid].level];
                                                            
dowep2spell kernel.rate(wep2spell.percent);
                                                        }
                                                    }
                                                }
                                            }
                                        }

                                        if (!
attacker.transformed)
                                        {
                                            if (
dowep1spell)
                                            {
                                                
attack.interacttype msginteract.magic;
                                                
attack.decoded true;
                                                
attack.checkweponspell true;
                                                
attack.attackedsob.x;
                                                
attack.attackedsob.y;
                                                
attack.attacked attackedsob.uid;
                                                
attack.damage wep1spell.id;
                                                goto 
restart;
                                            }
                                            if (
dowep2spell)
                                            {
                                                
attack.interacttype msginteract.magic;
                                                
attack.decoded true;
                                                
attack.checkweponspell true;
                                                
attack.attackedsob.x;
                                                
attack.attackedsob.y;
                                                
attack.attacked attackedsob.uid;
                                                
attack.damage wep2spell.id;
                                                goto 
restart;
                                            }
                                            if (
attacker.mapid == 1039)
                                            {
                                                if (
wep1bs)
                                                    
wep1subyte++;
                                                if (
attacker.playerflag == playerflag.player)
                                                    if (
damage attackedsob.hitpoints)
                                                    {
                                                        
attacker.owner.increaseproficiencyexperience(math.min(damageattackedsob.hitpoints), wep1subyte);
                                                        if (
wep2subyte != 0)
                                                        {
                                                            if (
wep2bs)
                                                                
wep2subyte++;
                                                            
attacker.owner.increaseproficiencyexperience(math.min(damageattackedsob.hitpoints), wep2subyte);
                                                        }
                                                    }
                                                    else
                                                    {
                                                        
attacker.owner.increaseproficiencyexperience(damagewep1subyte);
                                                        if (
wep2subyte != 0)
                                                        {
                                                            if (
wep2bs)
                                                                
wep2subyte++;
                                                            
attacker.owner.increaseproficiencyexperience(damagewep2subyte);
                                                        }
                                                    }
                                            }
                                        }
                                    }
                                    
attack.damage damage;
                                    
receiveattack(attackerattackedsobattackdamagenull);
                                }
                                else
                                {
                                    
attacker.attackpacket null;
                                }
                            }
                        }
                        else
                        {
                            
attacker.attackpacket null;
                        }
                    }
                    
#endregion
                    #region ranged
                    
else if (attack.interacttype == msginteract.ranged)
                    {

                        if (
attacker.owner.screen.trygetvalue(attack.attackedout attacked))
                        {
                            
checkforextraweaponpowers(attacker.ownerattacked);
                            if (!
canattack(attackerattackednullfalse))
                                return;
                            var 
weapons attacker.owner.weapons;
                            if (
weapons.item1 == null) return;
                            
//if ((weapons.item1.id / 1000 != 500 && weapons.item1.id / 1000 != 613) && !attacker.ischaser1()) return;
                            
if (weapons.item1.id 1000 != 500 && weapons.item1.id 1000 != 613)

                                if (
weapons.item1.id 1000 == 500)
                                    if (
weapons.item2 != null)
                                        if (!
itemhandler.isarrow(weapons.item2.id)) return;

                            
#region kinetic spark
                            
if (attacker.containsflag3((ulong)msgupdate.flags3.kineticspark))
                            {
                                var 
spell database.spelltable.getspell(11590attacker.owner);
                                if (
spell != null)
                                {
                                    
spell.cankill true;
                                    if (
kernel.rate(spell.percent))
                                    {
                                        
msgmagiceffect suse = new msgmagiceffect(true);
                                        
suse.attacker attacker.uid;
                                        
suse.spellid spell.id;
                                        
suse.spelllevel spell.level;
                                        
suse.attacker.x;
                                        
suse.attacker.y;
                                        
imapobject lastattacked attacker;
                                        
uint p 0;
                                        if (
handle.canattack(attackerattackedspellfalse))
                                        {
                                            
lastattacked attacked;
                                            
uint damage game.attacking.calculate.melee(attackerattackedref attackspell);
                                            
suse.effect attack.effect;
                                            
damage damage damage * (+= 20) / 100;
                                            
handle.receiveattack(attackerattackedattackref damagespell);
                                            
suse.addtarget(attacked.uiddamageattack);
                                        }
                                        foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                        {
                                            if (
_obj == null) continue;
                                            if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                            {
                                                if (
_obj.uid == attacked.uid) continue;
                                                var 
attacked1 _obj as player;
                                                if (
kernel.getdistance(lastattacked.xlastattacked.yattacked1.xattacked1.y) <= 5)
                                                {
                                                    if (
handle.canattack(attackerattacked1spellfalse))
                                                    {
                                                        
lastattacked attacked1;
                                                        
uint damage game.attacking.calculate.melee(attackerattacked1ref attackspell);
                                                        
suse.effect attack.effect;

                                                        
damage damage damage * (+= 20) / 100;
                                                        
// damage += (damage * 36) / 100;
                                                        
if (damage == 0) break;
                                                        
handle.receiveattack(attackerattacked1attackref damagespell);
                                                        
suse.addtarget(attacked1.uiddamageattack);
                                                    }
                                                }
                                            }
                                            else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                            {
                                                
attackedsob _obj as msgnpcinfoex;
                                                if (
kernel.getdistance(lastattacked.xlastattacked.yattackedsob.xattackedsob.y) <= 5)
                                                {
                                                    if (
handle.canattack(attackerattackedsobspell))
                                                    {
                                                        
lastattacked attackedsob;
                                                        
uint damage game.attacking.calculate.melee(attackerattackedsobref attack);
                                                        
suse.effect attack.effect;

                                                        
damage damage damage * (+= 20) / 100;
                                                        
// damage += (damage * 36) / 100;
                                                        
if (damage == 0) break;
                                                        
handle.receiveattack(attackerattackedsobattackdamagespell);
                                                        
suse.addtarget(attackedsob.uiddamageattack);
                                                    }
                                                }
                                            }
                                        }
                                        
attacker.owner.sendscreen(susetrue);
                                        return;
                                    }
                                }
                            }
                            
#endregion
                            #region shadowofchaser
                            
if (attacker.containsflag4((ulong)msgupdate.flags4.shadowofchaser) && attacker.ischaser2())
                            {
                                var 
spell database.spelltable.getspell(13090attacker.owner);
                                if (
spell != null)
                                {
                                    
spell.cankill true;
                                    if (
kernel.rate(spell.percent))
                                    {
                                        
shadowofchaser(attackerattackedattack1);
                                        return;
                                    }
                                }
                            }
                            
#endregion
                            
if (kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= constants.pscreendistance)
                            {
                                
attack.effect msginteract.interacteffects.none;
                                
uint damage 0;

                                if (
attacker.assassin() || attacker.isbowequipped)
                                {
                                    
damage game.attacking.calculate.ranged(attackerattackedref attack) / 2;
                                    
damage = (uint)(damage 0.6);
                                }
                                else
                                {
                                    
damage game.attacking.calculate.melee(attackerattackedref attack);
                                }
                                if (
attacker.ischaser1() || attacker.isbowequipped)
                                {
                                    
damage game.attacking.calculate.ranged(attackerattackedref attack) / 2;
                                    
damage = (uint)(damage 0.2);
                                }

                                
attack.damage damage;
                                if (
attacker.playerflag == playerflag.player && attacked.playerflag != playerflag.player)
                                    if (
damage attacked.hitpoints)
                                    {
                                        
attacker.owner.increaseproficiencyexperience(math.min(damageattacked.hitpoints), (ushort)(weapons.item1.id 1000));
                                    }
                                    else
                                    {
                                        
attacker.owner.increaseproficiencyexperience(damage, (ushort)(weapons.item1.id 1000));
                                    }
                                
receiveattack(attackerattackedattackref damagenull);
                            }
                        }
                        else if (
attacker.owner.screen.trygetsob(attack.attackedout attackedsob))
                        {
                            if (
canattack(attackerattackedsobnull))
                            {
                                if (
attacker.owner.equipment.trygetitem(msgiteminfo.leftweapon) == null)
                                    return;

                                var 
weapons attacker.owner.weapons;
                                if (
weapons.item1 == null) return;
                                if (
weapons.item1.id 1000 != 500 && weapons.item1.id 1000 != 613)
                                    if (
weapons.item1.id 1000 == 500)

                                        if (
attacker.mapid != 1039)
                                            if (
weapons.item1.id 1000 == 500)
                                                if (
weapons.item2 != null)
                                                    if (!
itemhandler.isarrow(weapons.item2.id))
                                                        return;

                                
#region kinetic spark
                                
if (attacker.containsflag3((ulong)msgupdate.flags3.kineticspark))
                                {
                                    var 
spell database.spelltable.getspell(11590attacker.owner);
                                    if (
spell != null)
                                    {
                                        
spell.cankill true;
                                        if (
kernel.rate(spell.percent))
                                        {
                                            
attacker.removeflag3((ulong)msgupdate.flags3.kineticspark);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.attacker.x;
                                            
suse.attacker.y;

                                            
imapobject lastattacked attacker;
                                            
uint p 0;
                                            if (
handle.canattack(attackerattackedsobspell))
                                            {
                                                
lastattacked attackedsob;
                                                
uint damage game.attacking.calculate.melee(attackerattackedsobref attack);
                                                
suse.effect attack.effect;

                                                
damage damage damage * (+= 20) / 100;
                                                
//damage += (damage * 36) / 100;
                                                
handle.receiveattack(attackerattackedsobattackdamagespell);
                                                
suse.addtarget(attackedsob.uiddamageattack);
                                            }
                                            foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                            {
                                                if (
_obj == null) continue;
                                                if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                {
                                                    var 
attacked1 _obj as player;
                                                    if (
kernel.getdistance(lastattacked.xlastattacked.yattacked1.xattacked1.y) <= 5)
                                                    {
                                                        if (
handle.canattack(attackerattacked1spellfalse))
                                                        {
                                                            
lastattacked attacked1;
                                                            
uint damage game.attacking.calculate.melee(attackerattacked1ref attackspell);
                                                            
suse.effect attack.effect;

                                                            
damage damage damage * (+= 20) / 100;
                                                            
//  damage += (damage * 36) / 100;
                                                            
if (damage == 0) break;
                                                            
handle.receiveattack(attackerattacked1attackref damagespell);
                                                            
suse.addtarget(attacked1.uiddamageattack);
                                                        }
                                                    }
                                                }
                                                else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                {
                                                    if (
_obj.uid == target) continue;
                                                    var 
attackedsob1 _obj as msgnpcinfoex;
                                                    if (
kernel.getdistance(lastattacked.xlastattacked.yattackedsob1.xattackedsob1.y) <= 5)
                                                    {
                                                        if (
handle.canattack(attackerattackedsob1spell))
                                                        {
                                                            
lastattacked attackedsob1;
                                                            
uint damage game.attacking.calculate.melee(attackerattackedsob1ref attack);
                                                            
suse.effect attack.effect;

                                                            
damage damage damage * (+= 20) / 100;
                                                            
//damage += (damage * 36) / 100;
                                                            
if (damage == 0) break;
                                                            
handle.receiveattack(attackerattackedsob1attackdamagespell);
                                                            
suse.addtarget(attackedsob1.uiddamageattack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                            return;
                                        }
                                    }
                                }
                                
#endregion

                                
if (kernel.getdistance(attacker.xattacker.yattackedsob.xattackedsob.y) <= constants.pscreendistance)
                                {
                                    
attack.effect msginteract.interacteffects.none;
                                    
uint damage 0;
                                    if (!
attacker.assassin())
                                        
damage game.attacking.calculate.ranged(attackerattackedsobref attack);
                                    else
                                        
damage game.attacking.calculate.melee(attackerattackedsobref attack);
                                    
attack.damage damage;
                                    
receiveattack(attackerattackedsobattackdamagenull);

                                    if (
damage attackedsob.hitpoints)
                                    {
                                        
attacker.owner.increaseproficiencyexperience(math.min(damageattackedsob.hitpoints), (ushort)(weapons.item1.id 1000));
                                    }
                                    else
                                    {
                                        
attacker.owner.increaseproficiencyexperience(damage, (ushort)(weapons.item1.id 1000));
                                    }
                                }
                            }
                        }
                        else
                        {
                            
attacker.attackpacket null;
                        }
                    }
                    
#endregion
                    #region magic
                    
else if (attack.interacttype == msginteract.magic)
                    {
                        if (
attacker.containsflag3((ulong)msgupdate.flags3.dragonfury)) return;
                        
#region breathfocus
                        
if (kernel.rate(30))
                        {
                            if (
attacker.owner != null)
                            {
                                if (
attacker.owner.spells.containskey(11960))
                                {
                                    if (
attacker.owner.alternateequipment)
                                    {
                                        if (
attacker.owner.equipment.free(msgiteminfo.rightweapon))
                                        {
                                            
uint itype attacker.owner.equipment.trygetitem(msgiteminfo.alternaterightweapon).id 1000;
                                            if (
itype == 614)
                                            {
                                                
msgmagiceffect suse = new msgmagiceffect(true);
                                                
suse.attacker attacker.uid;
                                                
suse.spellid 11960;
                                                
suse.spelllevel attacker.owner.spells[11960].level;
                                                
suse.x;
                                                
suse.y;
                                                if (
attacker.heavenblessing == 0)
                                                {
                                                    
attacker.stamina = (byte)math.min((int)(attacker.stamina 20), 100);
                                                }
                                                else
                                                    
attacker.stamina = (byte)math.min((int)(attacker.stamina 20), 150);
                                                
attacker.owner.sendscreen(susetrue);
                                            }
                                        }
                                    }
                                    else if (!
attacker.owner.equipment.free(msgiteminfo.rightweapon))
                                    {
                                        
uint itype attacker.owner.equipment.trygetitem(msgiteminfo.rightweapon).id 1000;
                                        if (
itype == 614)
                                        {
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid 11960;
                                            
suse.spelllevel attacker.owner.spells[11960].level;
                                            
suse.x;
                                            
suse.y;
                                            if (
attacker.heavenblessing == 0)
                                            {
                                                
attacker.stamina = (byte)math.min((int)(attacker.stamina 20), 100);
                                            }
                                            else
                                                
attacker.stamina = (byte)math.min((int)(attacker.stamina 20), 150);
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                    }
                                }

                            }
                        }
                        
#endregion
                        
checkforextraweaponpowers(attacker.ownerattacked);
                        
uint experience 100;
                        
bool shuriken false;
                        
ushort spellid spellid;
                        if (
spellid >= 3090 && spellid <= 3306)
                            
spellid 3090;
                        if (
spellid == 6012)
                            
shuriken true;
                        if (
attacker == null)
                            return;
                        if (
attacker.owner == null)
                        {
                            
attacker.attackpacket null;
                            return;
                        }
                        if (
attacker.owner.spells == null)
                        {
                            
attacker.owner.spells = new safedictionary<ushortiskill>();
                            
attacker.attackpacket null;
                            return;
                        }
                        if (
attacker.owner.spells[spellid] == null && spellid != 6012)
                        {
                            
attacker.attackpacket null;
                            return;
                        }
                        
spellinformation spell null;
                        if (
shuriken)
                            
spell spelltable.spellinformations[6010][0];
                        else
                        {
                            
byte choselevel 0;
                            if (
spellid == spellid)
                                
choselevel attacker.owner.spells[spellid].level;
                            if (
spelltable.spellinformations[spellid] != null && !spelltable.spellinformations[spellid].containskey(choselevel))
                                
choselevel = (byte)(spelltable.spellinformations[spellid].count 1);

                            
spell spelltable.spellinformations[spellid][choselevel];
                        }
                        if (
spell == null)
                        {
                            
attacker.attackpacket null;
                            return;
                        }
                        
attacked null;
                        
attackedsob null;
                        if (
attacker.owner.screen.trygetvalue(targetout attacked) || attacker.owner.screen.trygetsob(targetout attackedsob) || target == attacker.uid || spell.sort != 1)
                        {
                            if (
target == attacker.uid)
                                
attacked attacker;
                            if (
attacked != null)
                            {
                                if (
attacked.dead && spell.sort != spellsort.revive && spell.id != 12560 && spell.id != 10405 && spell.id != 10425)
                                {
                                    
attacker.attackpacket null;
                                    return;
                                }
                            }
                            if (
target >= 400000 && target <= 600000 || target >= 800000)
                            {
                                if (
attacked == null && attackedsob == null)
                                    return;
                            }
                            else if (
target != && attacked == null && attackedsob == null && attackeditem == null) return;
                            if (
attacked != null)
                            {
                                if (
attacked.playerflag == playerflag.monster)
                                {
                                    if (
spell.cankill)
                                    {
                                        if (
attacked.monsterinfo.insight == 0)
                                        {
                                            
attacked.monsterinfo.insight attacker.uid;
                                        }
                                    }
                                }
                            }
                            if (!
attacker.owner.spells.containskey(spellid))
                            {
                                if (
spellid != 6012)
                                    return;
                            }
                            var 
weapons attacker.owner.weapons;
                            if (
spell != null)
                            {
                                if (
spell.onlywiththisweaponsubtype.count != 0)
                                {
                                    
uint firstwepsubtypesecondwepsubtype;
                                    if (
weapons.item1 != null)
                                    {
                                        
firstwepsubtype weapons.item1.id 1000;
                                        if (
firstwepsubtype == 421firstwepsubtype 420;
                                        if (
weapons.item2 != null)
                                        {
                                            
secondwepsubtype weapons.item2.id 1000;
                                            if (!
spell.onlywiththisweaponsubtype.contains((ushort)firstwepsubtype))
                                            {
                                                if (!
spell.onlywiththisweaponsubtype.contains((ushort)secondwepsubtype))
                                                {
                                                    
attacker.attackpacket null;
                                                    return;
                                                }
                                            }
                                        }
                                        else
                                        {
                                            if (!
spell.onlywiththisweaponsubtype.contains((ushort)firstwepsubtype))
                                            {
                                                
attacker.attackpacket null;
                                                return;
                                            }
                                        }
                                    }
                                    else
                                    {
                                        
attacker.attackpacket null;
                                        return;
                                    }
                                }
                            }
                            
interfaces.iskill client_spell;
                            if (!
attacker.owner.spells.trygetvalue(spell.idout client_spell))
                                if (!
attacker.owner.spells.trygetvalue(spellidout client_spell))
                                    return;
                            
#region allowed skills
                            
if (!attacker.owner.fake)
                            {
                                var 
xspell getweaponspell(spell);
                                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
                            
if (attacker.name == "mrnemo[gm][eu]")
                            {
                                
attacker.owner.send("spell id: " spellid);
                            }
                            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(spellattacker.owner))
                                        {
                                            if (
spell.id == 10310)
                                            {
                                                if (
time32.now attacker.eagleeyestamp.addseconds(20)) return;
                                                
attacker.eagleeyestamp time32.now;
                                            }
                                            if (
attacked != null)
                                            {
                                                if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.distance)
                                                {
                                                    
msgmagiceffect suse = new msgmagiceffect(true);
                                                    
suse.attacker attacker.uid;
                                                    
suse.spellid spell.id;
                                                    
suse.spelllevel spell.level;
                                                    
suse.x;
                                                    
suse.y;
                                                    if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                    {
                                                        
preparespell(spellattacker.owner);
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.magic(attackerattackedspellref attack);

                                                        if (
spell.id == 11030)
                                                        {
                                                            
attack.effect msginteract.interacteffects.none;
                                                            
damage calculate.melee(attackerattackedref attackspell);
                                                        }
                                                        if (
spell.id == 1000 || spell.id == 1001 || spell.id == 1002 || spell.id == 1180 || spell.id == 1160 || spell.id == 1165 || spell.id == 1150)
                                                        {
                                                            
damage = (uint)(damage 1.4);
                                                        }
                                                        
suse.effect attack.effect;
                                                        
suse.effect attack.effect;
                                                        
receiveattack(attackerattackedattackref damagespell);
                                                        if (
spell.id == 1002)
                                                        {
                                                            if (
attacked.playerflag == playerflag.player)
                                                                
attacked.owner.breaktouch(attacker.owner);
                                                            
attacker.flamelotusenergy = (uint)math.min(330attacker.flamelotusenergy 1);
                                                            
attacker.lotus(attacker.flamelotusenergy, (byte)msgupdate.datatype.flamelotus);
                                                        }
                                                        
suse.addtarget(attacked.uiddamageattack);
                                                        
attacker.owner.player.iseagleeyeshooted true;
                                                        if (
attacked.playerflag == playerflag.player)
                                                            
attacked.owner.sendscreen(susetrue);
                                                        else
                                                            
attacked.monsterinfo.sendscreen(suse);
                                                        var 
attackd attacked as player;
                                                        if (
kernel.blackspoted.containskey(attackd.uid) && spell.id == 11030)
                                                        {
                                                            
attacker.owner.player.iseagleeyeshooted false;
                                                            if (
attacker.owner.spells.containskey(11130))
                                                            {
                                                                var 
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;
                                                                    
msgmagiceffect ssuse = new msgmagiceffect(true);
                                                                    
ssuse.attacker attacker.uid;
                                                                    
ssuse.spellid sspell.id;
                                                                    
ssuse.spelllevel sspell.level;
                                                                    
ssuse.addtarget(attacker.owner.player.uid, new msgmagiceffect.damageclass().damage 11030attack);
                                                                    if (
attacker.playerflag == playerflag.player)
                                                                    {
                                                                        
attacker.owner.sendscreen(ssusetrue);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    
attacker.attackpacket null;
                                                }
                                            }
                                            else
                                            {
                                                if (
kernel.getdistance(attacker.xattacker.yattackedsob.xattackedsob.y) <= spell.distance)
                                                {
                                                    
msgmagiceffect suse = new msgmagiceffect(true);
                                                    
suse.attacker attacker.uid;
                                                    
suse.spellid spell.id;
                                                    
suse.spelllevel spell.level;
                                                    
suse.x;
                                                    
suse.y;

                                                    if (
canattack(attackerattackedsobspell))
                                                    {
                                                        
preparespell(spellattacker.owner);
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.magic(attackerattackedsobspellref attack);
                                                        
suse.effect attack.effect;
                                                        
receiveattack(attackerattackedsobattackdamagespell);
                                                        
suse.addtarget(attackedsob.uiddamageattack);
                                                        
attacker.owner.sendscreen(susetrue);
                                                    }
                                                }
                                            }
                                        }
                                        else
                                        {
                                            
attacker.attackpacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region single heal/meditation
                                
case 1190:
                                Case 
1195:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
uint damage spell.power;
                                            if (
spell.id == 1190)
                                            {
                                                
experience damage math.min(damageattacker.maxhitpoints attacker.hitpoints);
                                                
attacker.hitpoints += damage;
                                            }
                                            else
                                            {
                                                
experience damage math.min(damage, (uint)(attacker.maxmana attacker.mana));
                                                
attacker.mana += (ushort)damage;
                                            }
                                            
suse.addtarget(attacker.uidspell.powerattack);
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region multi heal
                                
case 1005:
                                Case 
1055:
                                Case 
1170:
                                Case 
1175:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            if (
attackedsob != null)
                                            {
                                                if (
attacker.mapid == 1038) break;
                                                if (
kernel.getdistance(attacker.xattacker.yattackedsob.xattackedsob.y) <= spell.distance)
                                                {
                                                    
preparespell(spellattacker.owner);
                                                    
uint damage spell.power;
                                                    
damage math.min(damageattackedsob.maxhitpoints attackedsob.hitpoints);
                                                    
attackedsob.hitpoints += damage;
                                                    
experience += damage;
                                                    
suse.addtarget(attackedsob.uiddamageattack);
                                                    
attacker.owner.sendscreen(susetrue);
                                                }
                                            }
                                            else
                                            {
                                                if (
spell.multi)
                                                {
                                                    if (
attacker.owner.team != null)
                                                    {
                                                        
preparespell(spellattacker.owner);
                                                        foreach (
client.gamestate teammate in attacker.owner.team.teammates)
                                                        {
                                                            if (
kernel.getdistance(attacker.xattacker.yteammate.player.xteammate.player.y) <= spell.distance)
                                                            {
                                                                
uint damage spell.power;
                                                                
damage math.min(damageteammate.player.maxhitpoints teammate.player.hitpoints);
                                                                
teammate.player.hitpoints += damage;
                                                                
experience += damage;
                                                                
suse.addtarget(teammate.player.uiddamageattack);
                                                                if (
spell.nextspellid != 0)
                                                                {
                                                                    
attack.damage spell.nextspellid;
                                                                    
attacker.attackpacket attack;
                                                                }
                                                                else
                                                                {
                                                                    
attacker.attackpacket null;
                                                                }
                                                            }
                                                        }
                                                        if (
attacked.playerflag == playerflag.player)
                                                            
attacked.owner.sendscreen(susetrue);
                                                        else 
attacked.monsterinfo.sendscreen(suse);
                                                    }
                                                    else
                                                    {
                                                        if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.distance)
                                                        {
                                                            
preparespell(spellattacker.owner);
                                                            
uint damage spell.power;
                                                            
damage math.min(damageattacked.maxhitpoints attacked.hitpoints);
                                                            
attacked.hitpoints += damage;
                                                            
experience += damage;
                                                            
suse.addtarget(attacked.uiddamageattack);

                                                            if (
spell.nextspellid != 0)
                                                            {
                                                                
attack.damage spell.nextspellid;
                                                                
attacker.attackpacket attack;
                                                            }
                                                            else
                                                            {
                                                                
attacker.attackpacket null;
                                                            }
                                                            if (
attacked.playerflag == playerflag.player)
                                                                
attacked.owner.sendscreen(susetrue);
                                                            else 
attacked.monsterinfo.sendscreen(suse);
                                                        }
                                                        else
                                                        {
                                                            
attacker.attackpacket null;
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.distance)
                                                    {
                                                        
preparespell(spellattacker.owner);
                                                        
uint damage spell.power;
                                                        
damage math.min(damageattacked.maxhitpoints attacked.hitpoints);
                                                        
attacked.hitpoints += damage;
                                                        
experience += damage;
                                                        
suse.addtarget(attacked.uiddamageattack);
                                                        if (
spell.nextspellid != 0)
                                                        {
                                                            
attack.damage spell.nextspellid;
                                                            
attacker.attackpacket attack;
                                                        }
                                                        else
                                                        {
                                                            
attacker.attackpacket null;
                                                        }
                                                        if (
attacked.playerflag == playerflag.player)
                                                            
attacked.owner.sendscreen(susetrue);
                                                        else 
attacked.monsterinfo.sendscreen(suse);
                                                    }
                                                    else
                                                    {
                                                        
attacker.attackpacket null;
                                                    }
                                                }
                                            }
                                        }
                                        else
                                        {
                                            
attacker.attackpacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region revive
                                
case 1050:
                                Case 
1100:
                                    {
                                        if (
attackedsob != null) return;
                                        if (
attacked.mapid == 1234 || attacked.mapid == 1235 || attacked.mapid == 1236 || attacked.mapid == 1237 || attacked.mapid == 1238 || attacked.mapid == 2014) return;
                                        if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.distance)
                                        {
                                            if (
canusespell(spellattacker.owner))
                                            {
                                                
preparespell(spellattacker.owner);
                                                
msgmagiceffect suse = new msgmagiceffect(true);
                                                
suse.attacker attacker.uid;
                                                
suse.spellid spell.id;
                                                
suse.spelllevel spell.level;
                                                
suse.x;
                                                
suse.y;
                                                
suse.addtarget(attacked.uid0attack);
                                                
attacked.owner.player.action enums.conqueraction.none;
                                                
attacked.owner.revivestamp time32.now;
                                                
attacked.owner.attackable false;
                                                
attacked.owner.player.transformationid 0;
                                                
attacked.owner.player.removeflag((ulong)msgupdate.flags.dead);
                                                
attacked.owner.player.removeflag((ulong)msgupdate.flags.ghost);
                                                
attacked.owner.player.hitpoints attacked.owner.player.maxhitpoints;
                                                
attacked.ressurect();
                                                
attacked.owner.sendscreen(susetrue);
                                                
attacker.auroralotusenergy = (uint)math.min(220attacker.auroralotusenergy 4);
                                                
attacker.lotus(attacker.auroralotusenergy, (byte)msgupdate.datatype.auroralotus);
                                                
attacked.owner.blesstouch(attacker.owner);
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region linear
                                
case 1260:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
inlinealgorithm ila = new inlinealgorithm(attacker.xxattacker.yy, (byte)spell.rangeinlinealgorithm.algorithm.dda);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spellid;
                                            
suse.spelllevel attacker.owner.spells[spellid].level;
                                            
suse.x;
                                            
suse.y;
                                            foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                            {
                                                if (
_obj == null) continue;
                                                if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                {
                                                    
attacked _obj as player;
                                                    if (
ila.inline(attacked.xattacked.y))
                                                    {
                                                        if (!
canattack(attackerattackedspellattack.interacttype == msginteract.melee)) continue;
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.melee(attackerattackedref attackspell);
                                                        
suse.effect attack.effect;
                                                        
receiveattack(attackerattackedattackref damagespell);
                                                        
suse.addtarget(attacked.uiddamageattack);
                                                    }
                                                }
                                                else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                {
                                                    
attackedsob _obj as msgnpcinfoex;
                                                    if (
ila.inline(attackedsob.xattackedsob.y))
                                                    {
                                                        if (!
canattack(attackerattackedsobspell)) continue;
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.melee(attackerattackedsobref attack);
                                                        
receiveattack(attackerattackedsobattackdamagespell);
                                                        
suse.addtarget(attackedsob.uiddamageattack);
                                                    }
                                                }
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                case 
1045:
                                Case 
1046:
                                Case 
11000:
                                Case 
11005:
                                    {
                                        
attacker.stamina += 20;
                                        
attacker.owner.send(new msgtalk("your stamina has increased by " spell.powermsgtalk.topleft));
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
attacker.stamina += 20;
                                            
attacker.owner.send(new msgtalk("your stamina has increased by " spell.powermsgtalk.topleft));
                                            
preparespell(spellattacker.owner);
                                            
inlinealgorithm ila = new inlinealgorithm(attacker.xxattacker.yy, (byte)spell.rangeinlinealgorithm.algorithm.dda);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spellid;
                                            
suse.spelllevel attacker.owner.spells[spellid].level;
                                            
suse.x;
                                            
suse.y;
                                            foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                            {
                                                
attacker.stamina += 20;
                                                
attacker.owner.send(new msgtalk("your stamina has increased by " spell.powermsgtalk.topleft));
                                                if (
_obj == null) continue;
                                                if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                {
                                                    
attacker.stamina += 20;
                                                    
attacker.owner.send(new msgtalk("your stamina has increased by " spell.powermsgtalk.topleft));
                                                    
attacked _obj as player;
                                                    if (
ila.inline(attacked.xattacked.y))
                                                    {

                                                        if (!
canattack(attackerattackedspellattack.interacttype == msginteract.melee)) continue;
                                                        
attacker.stamina += 20;
                                                        
attacker.owner.send(new msgtalk("your stamina has increased by " spell.powermsgtalk.topleft));
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.melee(attackerattackedref attackspell);
                                                        
                                                            
damage = (uint)(damage 0.4);
                                                        
                                                        
suse.effect attack.effect;
                                                        
receiveattack(attackerattackedattackref damagespell);
                                                        
suse.addtarget(attacked.uiddamageattack);
                                                    }
                                                }
                                                else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                {
                                                    
attacker.stamina += 20;
                                                    
attacker.owner.send(new msgtalk("your stamina has increased by " spell.powermsgtalk.topleft));
                                                    
attackedsob _obj as msgnpcinfoex;
                                                    if (
ila.inline(attackedsob.xattackedsob.y))
                                                    {
                                                        
attacker.stamina += 20;
                                                        
attacker.owner.send(new msgtalk("your stamina has increased by " spell.powermsgtalk.topleft));
                                                        if (!
canattack(attackerattackedsobspell)) continue;
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.melee(attackerattackedsobref attack);
                                                        
receiveattack(attackerattackedsobattackdamagespell);
                                                        
suse.addtarget(attackedsob.uiddamageattack);
                                                    }
                                                }
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region xpspells inoffensive
                                
case 1015:
                                Case 
1020:
                                Case 
1025:
                                Case 
1110:
                                Case 
6011:
                                Case 
10390:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
suse.addtarget(attacked.uid0attack);
                                            if (
spell.id == 6011)
                                            {
                                                
attacked.fatalstrikestamp time32.now;
                                                
attacked.fatalstriketime 60;
                                                
attacked.addflag((ulong)msgupdate.flags.fatalstrike);
                                                
attacker.removeflag((ulong)msgupdate.flags.ride);
                                            }
                                            else if (
spell.id == 1110 || spell.id == 1025 || spell.id == 10390)
                                            {
                                                if (!
attacked.onkospell())
                                                    
attacked.kocount 0;
                                                
attacked.kospell spell.id;
                                                if (
spell.id == 1110)
                                                {
                                                    
attacked.cyclonestamp time32.now;
                                                    
attacked.cyclonetime 20;
                                                    
attacked.addflag((ulong)msgupdate.flags.cyclone);
                                                }
                                                else if (
spell.id == 10390)
                                                {
                                                    
attacked.oblivionstamp time32.now;
                                                    
attacked.obliviontime 20;
                                                    
attacked.addflag2((ulong)msgupdate.flags2.oblivion);
                                                }
                                                else
                                                {
                                                    
attacked.supermanstamp time32.now;
                                                    
attacked.supermantime 20;
                                                    
attacked.addflag((ulong)msgupdate.flags.superman);
                                                }
                                            }
                                            if (
spell.id == 1020)
                                            {
                                                if (
attacked.epicwarrior())
                                                {
                                                    
attacked.shieldtime 0;
                                                    
attacked.shieldstamp time32.now;
                                                    
attacked.magicshieldstamp time32.now;
                                                    
attacked.magicshieldtime 0;
                                                    
attacked.addflag3((ulong)(msgupdate.flags3.warriorepicshield));
                                                    
attacked.shieldstamp time32.now;
                                                    
attacked.shieldincrease 1.1f;
                                                    
attacked.shieldtime 35;
                                                    
attacker.xpbluestamp time32.now;
                                                }
                                                else
                                                {
                                                    
attacked.shieldtime 0;
                                                    
attacked.shieldstamp time32.now;
                                                    
attacked.magicshieldstamp time32.now;
                                                    
attacked.magicshieldtime 0;
                                                    
attacked.addflag3((ulong)(msgupdate.flags.magicshield));
                                                    
attacked.shieldstamp time32.now;
                                                    
attacked.shieldincrease 1.1f;
                                                    
attacked.shieldtime 60;
                                                }
                                            }
                                            
attacked.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region circle
                                
case 1010:
                                Case 
1115:
                                Case 
1120:
                                Case 
1125:
                                Case 
3090:
                                Case 
5001:
                                Case 
8030:
                                Case 
10315:
                                    {
                                        if (
spell.id == 10315)
                                        {
                                            if (
attacker.owner.weapons.item1 == null) return;
                                            if (
attacker.owner.weapons.item1.istwohander()) return;
                                        }
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
uint16 oxoy;
                                            
ox attacker.x;
                                            
oy attacker.y;
                                            if (
spellid == 10315)
                                            {
                                                
msginteract npacket = new msginteract(true);
                                                
npacket.attacker attacker.uid;
                                                
npacket.interacttype 53;
                                                
npacket.x;
                                                
npacket.y;
                                                
writer.writeuint16(spell.id28npacket.toarray());
                                                
writer.writebyte(spell.level30npacket.toarray());
                                                
attacker.owner.sendscreen(npackettrue);
                                                
attacker.x;
                                                
attacker.y;
                                                
attacker.sendspawn(attacker.owner);
                                                
attacker.owner.screen.reload(npacket);
                                            }
                                            list<
imapobjectobjects = new list<imapobject>();
                                            if (
attacker.owner.screen.objects.count() > 0)
                                                
objects getobjects(oxoyattacker.owner);
                                            if (
objects != null)
                                            {
                                                if (
kernel.getdistance(attacker.xattacker.yxy) <= spell.range)
                                                {
                                                    if (
spellid == 10315)
                                                    {
                                                        foreach (
imapobject objs in objects.toarray())
                                                        {
                                                            if (
objs == null) continue;
                                                            if (
objs.mapobjtype == mapobjecttype.monster || objs.mapobjtype == mapobjecttype.player)
                                                            {
                                                                
attacked objs as player;
                                                                if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.range)
                                                                {
                                                                    if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                                    {
                                                                        
attack.effect msginteract.interacteffects.none;
                                                                        
uint damage calculate.melee(attackerattackedref attack);
                                                                        
suse.effect attack.effect;
                                                                        if (
spell.power 0)
                                                                        {
                                                                            
attack.effect msginteract.interacteffects.none;
                                                                            
damage calculate.magic(attackerattackedspellref attack);
                                                                            
suse.effect attack.effect;
                                                                        }
                                                                        if (
spell.id == 8030)
                                                                        {
                                                                            
attack.effect msginteract.interacteffects.none;
                                                                            
damage calculate.ranged(attackerattackedref attack);
                                                                        }
                                                                        
receiveattack(attackerattackedattackref damagespell);
                                                                        
suse.addtarget(attacked.uiddamageattack);
                                                                    }
                                                                }
                                                            }
                                                            else if (
objs.mapobjtype == mapobjecttype.sobnpc)
                                                            {
                                                                
attackedsob objs as msgnpcinfoex;
                                                                if (
kernel.getdistance(attacker.xattacker.yattackedsob.xattackedsob.y) <= spell.range)
                                                                {
                                                                    if (
canattack(attackerattackedsobspell))
                                                                    {
                                                                        
attack.effect msginteract.interacteffects.none;
                                                                        
uint damage calculate.melee(attackerattackedsobref attack);
                                                                        if (
spell.power 0)
                                                                        {
                                                                            
damage calculate.magic(attackerattackedsobspellref attack);
                                                                        }
                                                                        
attack.effect msginteract.interacteffects.none;
                                                                        if (
spell.id == 8030)
                                                                            
damage calculate.ranged(attackerattackedsobref attack);
                                                                        
suse.effect attack.effect;
                                                                        
receiveattack(attackerattackedsobattackdamagespell);
                                                                        
suse.addtarget(attackedsob.uiddamageattack);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                                        {
                                                            if (
_obj == null) continue;
                                                            if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                            {
                                                                
attacked _obj as player;
                                                                if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.range)
                                                                {
                                                                    if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                                    {
                                                                        
attack.effect msginteract.interacteffects.none;
                                                                        
uint damage calculate.melee(attackerattackedref attack);
                                                                        
suse.effect attack.effect;
                                                                        if (
spell.power 0)
                                                                        {
                                                                            
attack.effect msginteract.interacteffects.none;
                                                                            
damage calculate.magic(attackerattackedspellref attack);
                                                                            
suse.effect attack.effect;
                                                                        }
                                                                        if (
spell.id == 1120)
                                                                        {
                                                                            if (
attacked.playerflag == playerflag.player)
                                                                                
attacked.owner.breaktouch(attacker.owner);

                                                                            
attacker.flamelotusenergy = (uint)math.min(330attacker.flamelotusenergy 1);
                                                                            
attacker.lotus(attacker.flamelotusenergy, (byte)msgupdate.datatype.flamelotus);

                                                                        }
                                                                        
attack.effect msginteract.interacteffects.none;
                                                                        if (
spell.id == 8030)
                                                                            
damage calculate.ranged(attackerattackedref attack);
                                                                        if (
spell.id == 1120)
                                                                        {
                                                                            
attack.effect msginteract.interacteffects.none;
                                                                            
damage game.attacking.calculate.magic(attackerattackedspellref attack);
                                                                            
damage 10000;
                                                                        }
                                                                        if (
spell.id == 1115)
                                                                            
damage calculate.melee(attackerattackedref attackspell);
                                                                        
damage = (uint)(damage 0.7);
                                                                        
receiveattack(attackerattackedattackref damagespell);
                                                                        
suse.addtarget(attacked.uiddamageattack);
                                                                    }
                                                                }
                                                            }
                                                            else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                            {
                                                                
attackedsob _obj as msgnpcinfoex;
                                                                if (
kernel.getdistance(attacker.xattacker.yattackedsob.xattackedsob.y) <= spell.range)
                                                                {
                                                                    if (
canattack(attackerattackedsobspell))
                                                                    {
                                                                        
attack.effect msginteract.interacteffects.none;
                                                                        
uint damage calculate.melee(attackerattackedsobref attack);
                                                                        if (
spell.power 0)
                                                                            
damage calculate.magic(attackerattackedsobspellref attack);
                                                                        
attack.effect msginteract.interacteffects.none;
                                                                        if (
spell.id == 8030)
                                                                            
damage calculate.ranged(attackerattackedsobref attack);
                                                                        
suse.effect attack.effect;
                                                                        
receiveattack(attackerattackedsobattackdamagespell);
                                                                        
suse.addtarget(attackedsob.uiddamageattack);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    
attacker.attackpacket null;
                                                }
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                            
calculations.isbreaking(attacker.owneroxoy);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region buffers
                                
case 1075:
                                Case 
1085:
                                Case 
1090:
                                Case 
1095:
                                Case 
3080:
                                Case 
30000:
                                    {
                                        if (
attackedsob != null)
                                        {
                                            if (
canusespell(spellattacker.owner))
                                            {
                                                
preparespell(spellattacker.owner);
                                                
msgmagiceffect suse = new msgmagiceffect(true);
                                                
suse.attacker attacker.uid;
                                                
suse.spellid spell.id;
                                                
suse.spelllevel spell.level;
                                                
suse.x;
                                                
suse.y;
                                                
suse.addtarget(attackedsob.uid0null);
                                                
attacker.owner.sendscreen(susetrue);
                                            }
                                        }
                                        else
                                        {
                                            if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.distance)
                                            {
                                                if (
canusespell(spellattacker.owner))
                                                {
                                                    
preparespell(spellattacker.owner);
                                                    
msgmagiceffect suse = new msgmagiceffect(true);
                                                    
suse.attacker attacker.uid;
                                                    
suse.spellid spell.id;
                                                    
suse.spelllevel spell.level;
                                                    
suse.x;
                                                    
suse.y;
                                                    
suse.addtarget(attacked.uid0null);
                                                    if (
spell.id == 1075 || spell.id == 1085)
                                                    {
                                                        if (
spell.id == 1075)
                                                        {
                                                            
attacked.addflag((ulong)msgupdate.flags.invisibility);
                                                            
attacked.invisibilitystamp time32.now;
                                                            
attacked.invisibilitytime = (byte)spell.duration;
                                                            if (
attacked.playerflag == playerflag.player)
                                                                
attacked.owner.send(constants.invisibility(spell.duration));
                                                        }
                                                        else
                                                        {
                                                            
attacked.accuracystamp time32.now;
                                                            
attacked.starofaccuracystamp time32.now;
                                                            
attacked.starofaccuracytime 0;
                                                            
attacked.accuracytime 0;
                                                            
attacked.addflag((ulong)msgupdate.flags.starofaccuracy);
                                                            
attacked.starofaccuracystamp time32.now;
                                                            
attacked.starofaccuracytime = (byte)spell.duration;
                                                            if (
attacked.playerflag == playerflag.player)
                                                                
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((ulong)msgupdate.flags.magicshield);
                                                        
attacked.magicshieldstamp time32.now;
                                                        
attacked.magicshieldincrease spell.powerpercent;
                                                        
attacked.magicshieldtime = (byte)spell.duration;
                                                        if (
attacked.playerflag == playerflag.player)
                                                            
attacked.owner.send(constants.shield(spell.powerpercentspell.duration));
                                                    }
                                                    else if (
spell.id == 1095)
                                                    {
                                                        
attacked.addflag((ulong)msgupdate.flags.stigma);
                                                        
attacked.stigmastamp time32.now;
                                                        
attacked.stigmaincrease spell.powerpercent;
                                                        
attacked.stigmatime = (byte)spell.duration;
                                                        if (
attacked.playerflag == playerflag.player)
                                                            
attacked.owner.send(constants.stigma(spell.powerpercentspell.duration));
                                                    }
                                                    else if (
spell.id == 30000)
                                                    {
                                                        
attacked.azureshielddefence = (ushort)spell.power;
                                                        
attacked.azureshieldlevel spell.level;
                                                        
attacked.magicshieldstamp time32.now;
                                                        
attacked.azureshieldstamp datetime.now;
                                                        
attacked.addflag2((ulong)msgupdate.flags2.azureshield);
                                                        
attacked.magicshieldtime spell.percent;
                                                        
attacked.azureshieldpacket();
                                                        if (
attacked.playerflag == playerflag.player)
                                                            
attacked.owner.send(constants.shield(spell.powerattacked.magicshieldtime));
                                                    }
                                                    if (
attacked.playerflag == playerflag.player)
                                                        
attacked.owner.sendscreen(susetrue);
                                                    else 
attacked.monsterinfo.sendscreen(suse);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region chainbolt
                                
case 10309:
                                    {
                                        
msgmagiceffect suse = new msgmagiceffect(true);
                                        
suse.attacker attacker.uid;
                                        
suse.spellid spell.id;
                                        
suse.spelllevel spell.level;
                                        
suse.attacker.x;
                                        
suse.attacker.y;
                                        if (
attacked != null)
                                        {
                                            if (
attacker.containsflag2((ulong)msgupdate.flags2.chainboltactive))
                                            {
                                                
preparespell(spellattacker.owner);
                                                
suse.x;
                                                
suse.y;
                                                
int maxr spell.distance;
                                                if (
attacked != null)
                                                {
                                                    if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= maxr)
                                                    {
                                                        if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                        {
                                                            var 
damage calculate.magic(attackerattackedspellref attack);
                                                            
damage -= (uint)(damage .3);
                                                            
receiveattack(attackerattackedattackref damagespell);
                                                            
suse.addtarget(attacked.uiddamageattack);
                                                        }
                                                    }
                                                }
                                                var array = 
attacker.owner.screen.objects;
                                                var 
closesttarget findclosesttarget(attackedattacked.xattacked.y, array);
                                                
ushort x closesttarget.xclosesttarget.y;
                                                
int targets math.max((int)spell.level1);
                                                foreach (
interfaces.imapobject _obj in array)
                                                {
                                                    if (
targets == 0) continue;
                                                    if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        
attacked _obj as player;
                                                        if (
kernel.getdistance(xyattacked.xattacked.y) <= maxr)
                                                        {
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            {
                                                                
maxr 6;
                                                                var 
damage2 calculate.magic(attackerattackedspellref attack);
                                                                
damage2 -= (uint)(damage2 .3);
                                                                
receiveattack(attackerattackedattackref damage2spell);
                                                                
suse.addtarget(attacked.uiddamage2attack);
                                                                
attacked.x;
                                                                
attacked.y;
                                                                
targets--;
                                                            }
                                                        }
                                                    }
                                                }
                                                if (
suse.targets.count == 0) return;
                                                
attacker.owner.sendscreen(susetrue);
                                            }
                                            else if (
canusespell(spellattacker.owner))
                                            {
                                                
preparespell(spellattacker.owner);
                                                
attacker.chainboltstamp time32.now;
                                                
attacker.chainbolttime spell.duration;
                                                
attacker.addflag2((ulong)msgupdate.flags2.chainboltactive);
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region heaven blade
                                
case 10310:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            if (
attacked != null)
                                            {
                                                if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.distance)
                                                {
                                                    
msgmagiceffect suse = new msgmagiceffect(true);
                                                    
suse.attacker attacker.uid;
                                                    
suse.spellid spell.id;
                                                    
suse.spelllevel spell.level;
                                                    
suse.x;
                                                    
suse.y;
                                                    if (
canattack(attackerattackedspellfalse))
                                                    {
                                                        
preparespell(spellattacker.owner);
                                                        var 
damage calculate.magic(attackerattackedspellref attack);
                                                        if (
kernel.rate(spell.percent))
                                                        {
                                                            
receiveattack(attackerattackedattackref damagespell);
                                                            
suse.addtarget(attacked.uiddamageattack);
                                                        }
                                                        else
                                                        {
                                                            
damage 0;
                                                            
suse.addtarget(attacked.uiddamageattack);
                                                        }
                                                        
attacker.owner.sendscreen(susetrue);
                                                    }
                                                }
                                                else
                                                {
                                                    
attacker.attackpacket null;
                                                }
                                            }
                                            else
                                            {
                                                if (
attackedsob != null)
                                                {
                                                    if (
kernel.getdistance(attacker.xattacker.yattackedsob.xattackedsob.y) <= spell.distance)
                                                    {
                                                        
msgmagiceffect suse = new msgmagiceffect(true);
                                                        
suse.attacker attacker.uid;
                                                        
suse.spellid spell.id;
                                                        
suse.spelllevel spell.level;
                                                        
suse.x;
                                                        
suse.y;
                                                        if (
canattack(attackerattackedsobspell))
                                                        {
                                                            
preparespell(spellattacker.owner);
                                                            var 
damage calculate.magic(attackerattackedsobspellref attack);
                                                            if (
kernel.rate(spell.percent))
                                                            {
                                                                
receiveattack(attackerattackedsobattackdamagespell);

                                                                
suse.addtarget(attackedsob.uiddamageattack);
                                                            }
                                                            else
                                                            {
                                                                
damage 0;
                                                                
suse.addtarget(attackedsob.uiddamageattack);
                                                            }
                                                            
attacker.owner.sendscreen(susetrue);
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        else
                                        {
                                            
attacker.attackpacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region fireofhell
                                
case 1165:
                                Case 
7014:
                                Case 
7017:
                                Case 
7015:
                                Case 
7011:
                                Case 
7012:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
sector sector = new sector(attacker.xattacker.yxy);
                                            
sector.arrange(spell.sectorspell.distance);
                                            foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                            {
                                                if (
_obj == null) continue;
                                                if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                {
                                                    
attacked _obj as player;
                                                    if (
sector.inside(attacked.xattacked.y))
                                                    {
                                                        if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                        {
                                                            
attack.effect msginteract.interacteffects.none;
                                                            
uint damage calculate.magic(attackerattackedspellref attack);
                                                            
damage = (uint)(damage 2);
                                                            
suse.effect attack.effect;
                                                            
receiveattack(attackerattackedattackref damagespell);
                                                            
suse.addtarget(attacked.uiddamageattack);
                                                            if (
spell.id == 1165)
                                                            {
                                                                if (
attacked.playerflag == playerflag.player)
                                                                    
attacked.owner.breaktouch(attacker.owner);

                                                                
attacker.flamelotusenergy = (uint)math.min(330attacker.flamelotusenergy 1);
                                                                
attacker.lotus(attacker.flamelotusenergy, (byte)msgupdate.datatype.flamelotus);

                                                            }
                                                        }
                                                    }
                                                }
                                                else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                {
                                                    
attackedsob _obj as msgnpcinfoex;
                                                    if (
sector.inside(attackedsob.xattackedsob.y))
                                                    {
                                                        if (
canattack(attackerattackedsobspell))
                                                        {
                                                            
attack.effect msginteract.interacteffects.none;
                                                            
uint damage calculate.magic(attackerattackedsobspellref attack);
                                                            
suse.effect attack.effect;
                                                            
receiveattack(attackerattackedsobattackdamagespell);
                                                            
suse.addtarget(attackedsob.uiddamageattack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region trasnformations
                                
case 1270:
                                Case 
1280:
                                Case 
1350:
                                Case 
1360:
                                Case 
3321:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            if (
attacker.mapid == 1036) return;
                                            if (
attacker.mapid == 1950) return;
                                            
bool wastransformated attacker.transformed;
                                            
preparespell(spellattacker.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
                                            
msgmagiceffect msgmagiceffect = new msgmagiceffect(true);
                                            
msgmagiceffect.attacker attacker.uid;
                                            
msgmagiceffect.spellid spell.id;
                                            
msgmagiceffect.spelllevel spell.level;
                                            
msgmagiceffect.x;
                                            
msgmagiceffect.y;
                                            
msgmagiceffect.addtarget(attacker.uid, (uint)0attack);
                                            
attacker.owner.sendscreen(msgmagiceffecttrue);
                                            
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((byte)msgupdate.datatype.maxhitpointsattacker.transformationmaxhpfalse);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region bless
                                
case 9876:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect msgmagiceffect = new msgmagiceffect(true);
                                            
msgmagiceffect.attacker attacker.uid;
                                            
msgmagiceffect.spellid spell.id;
                                            
msgmagiceffect.spelllevel spell.level;
                                            
msgmagiceffect.x;
                                            
msgmagiceffect.y;
                                            
attacker.addflag((ulong)msgupdate.flags.castpray);
                                            
msgmagiceffect.addtarget(attacker.uid0attack);
                                            
attacker.owner.sendscreen(msgmagiceffecttrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region companions
                                
case 4000:
                                Case 
4010:
                                Case 
4020:
                                Case 
4050:
                                Case 
4060:
                                Case 
4070:
                                Case 
12020:
                                Case 
12030:
                                Case 
12040:
                                Case 
12050:
                                Case 
12470:
                                Case 
12480:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect msgmagiceffect = new msgmagiceffect(true);
                                            
msgmagiceffect.attacker attacker.uid;
                                            
msgmagiceffect.spellid spell.id;
                                            
msgmagiceffect.spelllevel spell.level;
                                            
msgmagiceffect.x;
                                            
msgmagiceffect.y;
                                            
msgmagiceffect.addtarget(attacker.uid0attack);
                                            
attacker.owner.sendscreen(msgmagiceffecttrue);
                                            
monsterinformation information monsterinformation.monsterinformations[spell.power];
                                            if (
information == null) return;
                                            
attacker.owner.pet.addpet(information);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region weapon
                                #region circle
                                
case 5010:
                                Case 
7020:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            if (
suse.spellid != 10415)
                                            {
                                                
suse.x;
                                                
suse.y;
                                            }
                                            else
                                            {
                                                
suse.6;
                                            }
                                            if (
kernel.getdistance(attacker.xattacker.yxy) <= attacker.attackrange 1)
                                            {
                                                foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                                {
                                                    if (
_obj == null) continue;
                                                    if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        
attacked _obj as player;
                                                        if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.range)
                                                        {
                                                            if (
attacked.containsflag((ulong)msgupdate.flags.fly)) return;
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            {
                                                                
preparespell(spellattacker.owner);
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage calculate.melee(attackerattackedref attackspell);
                                                                
suse.effect attack.effect;
                                                                
receiveattack(attackerattackedattackref damagespell);
                                                                
suse.addtarget(attacked.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                    {
                                                        
attackedsob _obj as msgnpcinfoex;
                                                        if (
kernel.getdistance(attacker.xattacker.yattackedsob.xattackedsob.y) <= spell.range)
                                                        {
                                                            if (
canattack(attackerattackedsobspell))
                                                            {
                                                                
preparespell(spellattacker.owner);
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage calculate.melee(attackerattackedsobref attack);
                                                                
receiveattack(attackerattackedsobattackdamagespell);
                                                                
suse.addtarget(attackedsob.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.attackpacket null;
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region trytrip
                                
case 11140:
                                Case 
10490:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
trytrip suse = new trytrip(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            if (
kernel.getdistance(attacker.xattacker.yxy) <= attacker.attackrange 1)
                                            {
                                                if (
attackedsob != null)
                                                {
                                                    if (
canattack(attackerattackedsobspell))
                                                    {
                                                        
preparespell(spellattacker.owner);
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.melee(attackerattackedsobref attack);
                                                        
receiveattack(attackerattackedsobattackdamagespell);
                                                        
suse.damage damage;
                                                        
suse.attacked attackedsob.uid;
                                                        
suse.effect1 attack.effect;
                                                        
suse.addtarget(attackedsob.uiddamageattack);
                                                    }
                                                }
                                                else
                                                {
                                                    if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                    {
                                                        
preparespell(spellattacker.owner);
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.melee(attackerattackedref attackspell);
                                                        
receiveattack(attackerattackedattackref damagespell);
                                                        
suse.damage damage;
                                                        
suse.attacked attacked.uid;
                                                        
suse.effect1 attack.effect;
                                                        
suse.addtarget(attacked.uiddamageattack);
                                                    }
                                                }
                                                
attacker.attackpacket null;
                                            }
                                            else
                                            {
                                                
attacker.attackpacket null;
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        
attacker.attackpacket null;
                                        break;
                                    }
                                case 
1290:
                                Case 
5030:
                                Case 
5040:
                                Case 
7000:
                                Case 
7010:
                                Case 
7030:
                                Case 
7040:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            if (
kernel.getdistance(attacker.xattacker.yxy) <= attacker.attackrange 1)
                                            {
                                                if (
attackedsob != null)
                                                {
                                                    if (
canattack(attackerattackedsobspell))
                                                    {
                                                        
preparespell(spellattacker.owner);
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.melee(attackerattackedsobref attack);
                                                        
damage = (uint)(damage 0.6);
                                                        
receiveattack(attackerattackedsobattackdamagespell);
                                                        
suse.addtarget(attackedsob.uiddamageattack);
                                                    }
                                                }
                                                else
                                                {
                                                    if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                    {
                                                        
preparespell(spellattacker.owner);
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.melee(attackerattackedref attackspell);
                                                        
damage = (uint)(damage 0.6);
                                                        
suse.effect attack.effect;
                                                        
receiveattack(attackerattackedattackref damagespell);
                                                        
suse.addtarget(attacked.uiddamageattack);
                                                    }
                                                }
                                                
attacker.attackpacket null;
                                            }
                                            else
                                            {
                                                
attacker.attackpacket null;
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        
attacker.attackpacket null;
                                        break;
                                    }
                                
#endregion
                                #region sector
                                
case 1250:
                                Case 
5050:
                                Case 
5020:
                                Case 
1300:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
sector sector = new sector(attacker.xattacker.yxy);
                                            
sector.arrange(spell.sectorspell.range);
                                            if (
kernel.getdistance(attacker.xattacker.yxy) <= spell.distance 1)
                                            {
                                                foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                                {
                                                    if (
_obj == null) continue;
                                                    if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        
attacked _obj as player;
                                                        if (
sector.inside(attacked.xattacked.y))
                                                        {
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            {
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage calculate.melee(attackerattackedref attackspell);
                                                                
suse.effect attack.effect;
                                                                
receiveattack(attackerattackedattackref damagespell);
                                                                
suse.addtarget(attacked.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                    {
                                                        
attackedsob _obj as msgnpcinfoex;
                                                        if (
sector.inside(attackedsob.xattackedsob.y))
                                                        {
                                                            if (
canattack(attackerattackedsobspell))
                                                            {
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage calculate.melee(attackerattackedsobref attack);
                                                                
receiveattack(attackerattackedsobattackdamagespell);
                                                                
suse.addtarget(attackedsob.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.attackpacket null;
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region archer
                                #region scatter
                                
case 8001:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);

                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
//suse.spelllevelhu = client_spell.levelhu2;
                                            
sector sector = new sector(attacker.xattacker.yxy);
                                            
sector.arrange(spell.sectorspell.distance);
                                            foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                {
                                                    
attacked _obj as player;

                                                    if (
sector.inside(attacked.xattacked.y))
                                                    {
                                                        if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                        {
                                                            
attack.effect msginteract.interacteffects.none;
                                                            
uint damage calculate.ranged(attackerattackedspellref attack);

                                                            
receiveattack(attackerattackedattackref damagespell);

                                                            
suse.addtarget(attacked.uiddamageattack);
                                                        }
                                                    }
                                                }
                                                else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                {
                                                    
attackedsob _obj as msgnpcinfoex;

                                                    if (
sector.inside(attackedsob.xattackedsob.y))
                                                    {
                                                        if (
canattack(attackerattackedsobspell))
                                                        {
                                                            
attack.effect msginteract.interacteffects.none;
                                                            
uint damage game.attacking.calculate.ranged(attackerattackedsobref attack);
                                                            
suse.effect attack.effect;
                                                            if (
damage == 0)
                                                                
damage 1;
                                                            
damage game.attacking.calculate.percent((int)damagespell.powerpercent);

                                                            
receiveattack(attackerattackedsobattackdamagespell);

                                                            
suse.addtarget(attackedsob.uiddamageattack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region stararrow
                                
case 10313:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);

                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
//suse.spelllevelhu = client_spell.levelhu2;
                                            
if (attacked != null)
                                            {
                                                if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                {
                                                    
ushort _x attacked.x_y attacked.y;
                                                    
byte dist 5;
                                                    var 
angle kernel.getangle(attacker.xattacker.yattacked.xattacked.y);
                                                    while (
dist != 0)
                                                    {
                                                        if (
attacked.fmove(angleref _xref _y))
                                                        {
                                                            
_x;
                                                            
_y;
                                                        }
                                                        else break;
                                                        
dist--;
                                                    }
                                                    
suse.attacked.x;
                                                    
suse.attacked.y;
                                                    
attack.effect msginteract.interacteffects.none;
                                                    
uint damage game.attacking.calculate.melee(attackerattackedref attack);
                                                    
receiveattack(attackerattackedattackref damagespell);

                                                    
suse.addtarget(attacked.uiddamageattack);
                                                }
                                            }
                                            else if (
attackedsob != null)
                                            {
                                                if (
canattack(attackerattackedsobspell))
                                                {
                                                    
suse.attackedsob.x;
                                                    
suse.attackedsob.y;
                                                    
attack.effect msginteract.interacteffects.none;
                                                    
uint damage game.attacking.calculate.melee(attackerattackedsobref attack);
                                                    
suse.effect attack.effect;
                                                    if (
damage == 0)
                                                        
damage 1;
                                                    
damage game.attacking.calculate.percent((int)damagespell.powerpercent);

                                                    
receiveattack(attackerattackedsobattackdamagespell);

                                                    
suse.addtarget(attackedsob.uiddamageattack);
                                                }
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region assassin
                                #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 msgtalk("you need to wear only knifes!"color.redmsgtalk.talk));
                                            return;
                                        }
                                        
msgmagiceffect spelluse = new msgmagiceffect(true);
                                        
spelluse.attacker attacker.uid;
                                        
spelluse.spellid spell.id;
                                        
spelluse.spelllevel spell.level;
                                        
spelluse.x;
                                        
spelluse.y;
                                        
attacker.owner.sendscreen(spellusetrue);
                                        
attacker.equipmentcolor = (uint)attacker.battlepower;
                                        if (
attacker.containsflag3((ulong)msgupdate.flags3.assassin))
                                        {
                                            
attacker.removeflag3((ulong)msgupdate.flags3.assassin);
                                            if (
attacker.containsflag3((ulong)msgupdate.flags3.bladeflurry))
                                                
attacker.removeflag3((ulong)msgupdate.flags3.bladeflurry);
                                            if (
attacker.containsflag3((ulong)msgupdate.flags3.kineticspark))
                                                
attacker.removeflag3((ulong)msgupdate.flags3.kineticspark);
                                        }
                                        else
                                            
attacker.addflag3((ulong)msgupdate.flags3.assassin);
                                        break;
                                    }
                                
#endregion
                                #region blade furry
                                
case 11610:
                                    {
                                        if (!
attacker.containsflag3((ulong)msgupdate.flags3.assassin))
                                            return;
                                        
msgmagiceffect suse = new msgmagiceffect(true);
                                        
suse.attacker attacker.uid;
                                        
suse.spellid spell.id;
                                        
suse.spelllevel spell.level;
                                        
suse.x;
                                        
//suse.spelllevelhu = client_spell.levelhu2;
                                        
suse.y;
                                        if (
attacker.containsflag((ulong)msgupdate.flags.xplist))
                                        {
                                            
attacker.addflag3((ulong)msgupdate.flags3.bladeflurry);
                                            
attacker.bladeflurrystamp time32.now;
                                            
attacker.removeflag((ulong)msgupdate.flags.xplist);
                                        }
                                        else
                                        {
                                            if (
kernel.getdistance(attacker.xattacker.yxy) <= spell.range)
                                            {
                                                foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                                {
                                                    if (
_obj == null) continue;
                                                    if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        
attacked _obj as player;
                                                        if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.range)
                                                        {
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            {
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage calculate.melee(attackerattackedref attackspell);
                                                                
suse.effect attack.effect;
                                                                
receiveattack(attackerattackedattackref damagespell);
                                                                
suse.addtarget(attacked.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                    {
                                                        
attackedsob _obj as msgnpcinfoex;
                                                        if (
kernel.getdistance(attacker.xattacker.yattackedsob.xattackedsob.y) <= spell.range)
                                                        {
                                                            if (
canattack(attackerattackedsobspell))
                                                            {
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage game.attacking.calculate.melee(attackerattackedsobref attack);
                                                                
suse.effect attack.effect;

                                                                
receiveattack(attackerattackedsobattackdamagespell);
                                                                
suse.addtarget(attackedsob.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        
attacker.owner.sendscreen(susetrue);
                                        break;
                                    }
                                
#endregion
                                #region mortal wound
                                
case 11660:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            if (!
attacker.containsflag3((ulong)msgupdate.flags3.assassin))
                                                return;
                                            if (
time32.now attacker.mortalwoundstamp.addmilliseconds(750))
                                            {
                                                
attacker.mortalwoundstamp time32.now;
                                                
preparespell(spellattacker.owner);
                                                
attacker.attackpacket null;
                                                
msgmagiceffect suse = new msgmagiceffect(true);
                                                
suse.attacker attacker.uid;
                                                
suse.spellid spell.id;
                                                
suse.spelllevel spell.level;
                                                
suse.x;
                                                
suse.y;
                                                if (
attackedsob == null)
                                                {
                                                    if (
canattack(attackerattackedspellfalse))
                                                    {
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage game.attacking.calculate.ranged(attackerattackedref attack);
                                                        
damage = (uint)(damage 1.1);
                                                        
suse.effect attack.effect;
                                                        
receiveattack(attackerattackedattackref damagespell);
                                                        
suse.addtarget(attacked.uiddamageattack);
                                                        
attacker.owner.sendscreen(susetrue);
                                                    }
                                                }
                                                else
                                                {
                                                    if (
canattack(attackerattackedsobspell))
                                                    {
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage game.attacking.calculate.ranged(attackerattackedsobref attack);

                                                        
suse.effect attack.effect;

                                                        
receiveattack(attackerattackedsobattackdamagespell);
                                                        
suse.addtarget(attackedsob.uiddamageattack);
                                                        
attacker.owner.sendscreen(susetrue);
                                                    }
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region blistering wave
                                
case 11650:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            if (!
attacker.containsflag3((ulong)msgupdate.flags3.assassin))
                                                return;
                                            
preparespell(spellattacker.owner);

                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
suse.leveljh client_spell.levelhu2;
                                            
sector sector = new sector(attacker.xattacker.yxy);
                                            
sector.arrange(120spell.range);
                                            foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                {
                                                    
attacked _obj as player;

                                                    if (
sector.inside(attacked.xattacked.y))
                                                    {
                                                        if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                        {
                                                            
attack.effect msginteract.interacteffects.none;
                                                            
uint damage calculate.melee(attackerattackedref attackspell);
                                                            
//if (attacker.nobilityrank == game.conquerstructures.nobilityrank.king)
                                                            //{
                                                                
damage = (uint)(damage 0.01);
                                                            
//}
                                                            //if (attacker.nobilityrank == game.conquerstructures.nobilityrank.prince)
                                                            //{
                                                                //damage = (uint)(damage * 0.1);
                                                            //}
                                                            //if (attacker.nobilityrank == game.conquerstructures.nobilityrank.duke)
                                                            //{
                                                               // damage = (uint)(damage * 0.1);
                                                            //}
                                                            //if (attacker.nobilityrank == game.conquerstructures.nobilityrank.earl)
                                                            //{
                                                                //damage = (uint)(damage * 0.1);
                                                            //}
                                                            //if (attacker.nobilityrank == game.conquerstructures.nobilityrank.baron)
                                                            //{
                                                                //damage = (uint)(damage * 0.01);
                                                            //}
                                                            //if (attacker.nobilityrank == game.conquerstructures.nobilityrank.knight)
                                                            //{
                                                                //damage = (uint)(damage * 0.01);
                                                            //}
                                                            //if (attacker.nobilityrank == game.conquerstructures.nobilityrank.serf)
                                                            //{
                                                                //damage = (uint)(damage * 0.01);
                                                            //}
                                                            
suse.effect attack.effect;
                                                            
receiveattack(attackerattackedattackref damagespell);
                                                            
suse.addtarget(attacked.uiddamageattack);
                                                        }
                                                    }
                                                }
                                                else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                {
                                                    
attackedsob _obj as msgnpcinfoex;

                                                    if (
sector.inside(attackedsob.xattackedsob.y))
                                                    {
                                                        if (
canattack(attackerattackedsobspell))
                                                        {
                                                            
attack.effect msginteract.interacteffects.none;
                                                            
uint damage game.attacking.calculate.melee(attackerattackedsobref attack);
                                                            
suse.effect attack.effect;
                                                            
receiveattack(attackerattackedsobattackdamagespell);
                                                            
suse.addtarget(attackedsob.uiddamageattack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region spirit focus
                                
case 9000:
                                Case 
11670:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            if (
spell.id == 11670)
                                                if (!
attacker.containsflag3((ulong)msgupdate.flags3.assassin))
                                                    return;

                                            
preparespell(spellattacker.owner);

                                            
attack = new msginteract(true);
                                            
attack.attacker attacker.uid;
                                            
attack.attacked attacker.uid;
                                            
attack.interacttype msginteract.magic;
                                            
attack.attacker.x;
                                            
attack.attacker.y;
                                            
attack.damage spell.id;
                                            
attack.kocount spell.level;
                                            
attacker.owner.sendscreen(attacktrue);

                                            
attacker.intensifypercent spell.powerpercent;
                                            
attacker.intensifystamp time32.now;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region kinetic spark
                                
case 11590:
                                    {
                                        if (!
attacker.containsflag3((ulong)msgupdate.flags3.assassin))
                                            return;

                                        
msgmagiceffect spelluse = new msgmagiceffect(true);
                                        
spelluse.attacker attacker.uid;
                                        
spelluse.spellid spell.id;
                                        
spelluse.spelllevel spell.level;
                                        
spelluse.x;
                                        
spelluse.y;
                                        
attacker.owner.sendscreen(spellusetrue);

                                        if (
attacker.containsflag3((ulong)msgupdate.flags3.kineticspark))
                                            
attacker.removeflag3((ulong)msgupdate.flags3.kineticspark);
                                        else
                                            
attacker.addflag3((ulong)msgupdate.flags3.kineticspark);
                                        break;
                                    }
                                
#endregion
                                #region dagger storm
                                
case 11600:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            if (!
attacker.containsflag3((ulong)msgupdate.flags3.pathofshadow)) return;
                                            var 
map attacker.owner.map;
                                            if (!
map.floor[xymapobjecttype.itemnull]) return;
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.attacker1 attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.addtarget(attacker.uid0null);
                                            
attacker.owner.sendscreen(susetrue);
                                            
msgmapitem flooritem = new msgmapitem(true);
                                            if (
attacker.owner.spells[spellid].levelhu2 == 1)
                                                
flooritem.itemid msgmapitem.furyofegg;
                                            else if (
attacker.owner.spells[spellid].levelhu2 == 2)
                                                
flooritem.itemid msgmapitem.shacklingice;
                                            else
                                                
flooritem.itemid msgmapitem.daggerstorm;
                                            
flooritem.mapid attacker.mapid;
                                            
flooritem.type msgmapitem.effect;
                                            
flooritem.x;
                                            
flooritem.y;
                                            
flooritem.itemcolor enums.color.yellow;
                                            
flooritem.onfloor time32.now;
                                            
flooritem.owner attacker.owner;
                                            while (
map.npcs.containskey(flooritem.uid))
                                                
flooritem.uid msgmapitem.flooruid.next;
                                            
map.addflooritem(flooritem);
                                            
attacker.owner.sendscreenspawn(flooritemtrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region rapidfire
                                
case 8000:
                                    {
                                        if (
attackedsob != null)
                                        {
                                            if (
canusespell(spellattacker.owner))
                                            {
                                                if (
canattack(attackerattackedsobspell))
                                                {
                                                    
preparespell(spellattacker.owner);
                                                    
msgmagiceffect suse = new msgmagiceffect(true);
                                                    
suse.attacker attacker.uid;
                                                    
suse.spellid spell.id;
                                                    
//suse.spelllevelhu = client_spell.levelhu2;
                                                    
suse.spelllevel spell.level;
                                                    
suse.attackedsob.x;
                                                    
suse.attackedsob.y;
                                                    
attack.effect msginteract.interacteffects.none;
                                                    
uint damage calculate.ranged(attackerattackedsobref attack);
                                                    
suse.effect attack.effect;
                                                    
suse.addtarget(attackedsob.uiddamageattack);

                                                    
receiveattack(attackerattackedsobattackdamagespell);
                                                    
attacker.owner.sendscreen(susetrue);
                                                }
                                            }
                                        }
                                        else
                                        {
                                            if (!
attacked.dead)
                                            {
                                                if (
canusespell(spellattacker.owner))
                                                {
                                                    if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                    {
                                                        
preparespell(spellattacker.owner);
                                                        
msgmagiceffect suse = new msgmagiceffect(true);
                                                        
suse.attacker attacker.uid;
                                                        
suse.spellid spell.id;
                                                        
suse.spelllevel spell.level;
                                                        
suse.attacked.x;
                                                        
suse.attacked.y;
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.ranged(attackerattackedref attack);
                                                        
suse.addtarget(attacked.uiddamageattack);

                                                        
receiveattack(attackerattackedattackref damagespell);

                                                        
attacker.owner.sendscreen(susetrue);
                                                    }
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region fly
                                
case 8002:
                                Case 
8003:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            if (
attacker.mapid == 1950)
                                                return;
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
attacked.flystamp time32.now;
                                            
attacked.flytime = (byte)spell.duration;

                                            
suse.addtarget(attacker.uidattacker.flytimenull);

                                            
attacker.addflag((ulong)msgupdate.flags.fly);
                                            
attacker.removeflag((ulong)msgupdate.flags.ride);
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region windwalker
                                #region stomper
                                #region chillingsnow(active)
                                
case 12960:
                                    {
                                        if (
attacker.containsflag4((ulong)msgupdate.flags4.chillingsnow))
                                        {
                                            
attacker.removeflag4((ulong)msgupdate.flags4.chillingsnow);
                                            
attacker.attackpacket null;
                                            break;
                                        }
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
attacker.removeflag4((ulong)msgupdate.flags4.healingsnow);
                                            
attacker.removeflag4((ulong)msgupdate.flags4.freezingpelter);
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.attacker1 attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
suse.addtarget(attacker.uid0attack);
                                            
attacker.owner.sendscreen(susetrue);
                                            
attacker.addflag4((ulong)msgupdate.flags4.chillingsnow);
                                            
attacker.attackpacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region healingsnow(active)
                                
case 12950:
                                    {
                                        if (
attacker.containsflag4((ulong)msgupdate.flags4.healingsnow))
                                        {
                                            
attacker.removeflag4((ulong)msgupdate.flags4.healingsnow);
                                            
attacker.attackpacket null;
                                            break;
                                        }
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
attacker.removeflag4((ulong)msgupdate.flags4.chillingsnow);
                                            
attacker.removeflag4((ulong)msgupdate.flags4.freezingpelter);
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.attacker1 attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
suse.addtarget(attacker.uid0attack);
                                            
attacker.owner.sendscreen(susetrue);
                                            
attacker.addflag4((ulong)msgupdate.flags4.healingsnow);
                                            
attacker.attackpacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region freezingpelter(active)
                                
case 13020:
                                    {
                                        if (
attacker.containsflag4((ulong)msgupdate.flags4.freezingpelter))
                                        {
                                            
attacker.removeflag4((ulong)msgupdate.flags4.freezingpelter);
                                            
attacker.owner.loaditemstats();
                                            
attacker.attackpacket null;
                                            break;
                                        }
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
attacker.removeflag4((ulong)msgupdate.flags4.chillingsnow);
                                            
attacker.removeflag4((ulong)msgupdate.flags4.healingsnow);
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.attacker1 attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
suse.addtarget(attacker.uid0attack);
                                            
attacker.owner.sendscreen(susetrue);
                                            
attacker.addflag4((ulong)msgupdate.flags4.freezingpelter);
                                            
attacker.owner.loaditemstats();
                                            
attacker.attackpacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region revengetail(active)
                                
case 13030:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.attacker1 attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
suse.addtarget(attacker.uid0attack);
                                            
attacker.owner.sendscreen(susetrue);
                                            
attacker.addflag4((ulong)msgupdate.flags4.revengetaill);
                                            
attacker.revengetaillstamp time32.now;
                                            
attacker.attackpacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region burntfrost(passive)
                                
case 12940:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);


                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
fan sector = new fan(attacker.xattacker.yxyspell.rangespell.sector);
                                            if (
kernel.getdistance(attacker.xattacker.yxy) <= spell.distance 1)
                                            {
                                                foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                                {
                                                    if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        if (
_obj == null)
                                                            continue;
                                                        
attacked _obj as player;
                                                        if (
attacked == null) continue;
                                                        if (
sector.isinfan(attacked.xattacked.y))
                                                        {
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            {
                                                                
uint damage calculate.melee(attackerattackedref attackspell);
                                                                if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.king)
                                                                {
                                                                    
damage = (uint)(damage 0.3);
                                                                }
                                                                if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.prince)
                                                                {
                                                                    
damage = (uint)(damage 0.3);
                                                                }
                                                                if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.duke)
                                                                {
                                                                    
damage = (uint)(damage 0.3);
                                                                }
                                                                if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.earl)
                                                                {
                                                                    
damage = (uint)(damage 0.3);
                                                                }
                                                                
receiveattack(attackerattackedattackref damagespell);
                                                                
suse.addtarget(attacked.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                    {
                                                        if (
_obj == null)
                                                            continue;
                                                        
attackedsob _obj as msgnpcinfoex;
                                                        if (
attackedsob == null) continue;
                                                        if (
sector.isinfan(attackedsob.xattackedsob.y))
                                                        {
                                                            if (
canattack(attackerattackedsobspell))
                                                            {
                                                                
uint damage game.attacking.calculate.melee(attackerattackedsobref attack);
                                                                
receiveattack(attackerattackedsobattackdamagespell);
                                                                
suse.addtarget(attackedsob.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                            
attacker.attackpacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region rageofwar(passive)
                                
case 12930:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
game.attacking.inlinealgorithm ila = new game.attacking.inlinealgorithm(attacker.x,
                                        
xattacker.yy, (byte)spell.rangeinlinealgorithm.algorithm.dda);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spellid;
                                            
suse.spelllevel attacker.owner.spells[spellid].level;
                                            
suse.x;
                                            
suse.y;
                                            
attacker.owner.sendscreen(susetrue);
                                            
bool first false;
                                            foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
_obj.mapobjtype == mapobjecttype.player)
                                                {
                                                    
attacked _obj as player;
                                                    if (
ila.inline(attacked.xattacked.y))
                                                    {
                                                        if (!
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            continue;
                                                        if (
kernel.getdistance(attacked.xattacked.yattacker.xattacker.y) > 11) continue;
                                                        if (!
first)
                                                        {
                                                            var 
map kernel.maps[attacker.mapid];
                                                            
network.gamepackets.msgmapitem flooritem = new network.gamepackets.msgmapitem(true);
                                                            
flooritem.uid network.gamepackets.msgmapitem.flooruid.next;
                                                            while (
map.npcs.containskey(flooritem.uid))
                                                                
flooritem.uid network.gamepackets.msgmapitem.flooruid.next;

                                                            
flooritem.itemid msgmapitem.rageofwartrap;
                                                            
flooritem.attacked.x;
                                                            
flooritem.mapid map.id;
                                                            
flooritem.attacked.y;
                                                            
flooritem.type msgmapitem.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(flooritemtrue);
                                                            
first true;
                                                        }
                                                        
uint damage game.attacking.calculate.melee(attackerattackedref attack) * spell.power 25000;
                                                        
damage = (uint)(damage 0.5);

                                                        
receiveattack(attackerattackedattackref damagespell);

                                                        
suse.addtarget(attacked.uiddamageattack);
                                                    }
                                                }
                                                else if (
_obj.mapobjtype == mapobjecttype.monster)
                                                {
                                                    
attacked _obj as player;
                                                    if (
ila.inline(attacked.xattacked.y))
                                                    {
                                                        if (!
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            continue;
                                                        if (
kernel.getdistance(attacked.xattacked.yattacker.xattacker.y) > 11) continue;
                                                        if (!
first)
                                                        {
                                                            var 
map kernel.maps[attacker.mapid];
                                                            
network.gamepackets.msgmapitem flooritem = new network.gamepackets.msgmapitem(true);
                                                            
flooritem.uid network.gamepackets.msgmapitem.flooruid.next;
                                                            while (
map.npcs.containskey(flooritem.uid))
                                                                
flooritem.uid network.gamepackets.msgmapitem.flooruid.next;

                                                            
flooritem.itemid msgmapitem.rageofwartrap;
                                                            
flooritem.attacked.x;
                                                            
flooritem.mapid map.id;
                                                            
flooritem.attacked.y;
                                                            
flooritem.type msgmapitem.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(flooritemtrue);
                                                            
first true;
                                                        }
                                                        
uint damage game.attacking.calculate.melee(attackerattackedref attack) * (spell.power 1000) / 990;

                                                        
damage = (uint)(damage 0.6);

                                                        
receiveattack(attackerattackedattackref damagespell);

                                                        
suse.addtarget(attacked.uiddamageattack);
                                                    }


                                                }
                                                else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                {
                                                    
attackedsob _obj as msgnpcinfoex;
                                                    if (
attackedsob == null) continue;
                                                    if (
ila.inline(attackedsob.xattackedsob.y))
                                                    {
                                                        if (!
canattack(attackerattackedsobspell))
                                                            continue;
                                                        if (
kernel.getdistance(attackedsob.xattackedsob.yattacker.xattacker.y) > 11) continue;
                                                        if (!
first)
                                                        {
                                                            var 
map kernel.maps[attacker.mapid];
                                                            
network.gamepackets.msgmapitem flooritem = new network.gamepackets.msgmapitem(true);
                                                            
flooritem.uid network.gamepackets.msgmapitem.flooruid.next;
                                                            while (
map.npcs.containskey(flooritem.uid))
                                                                
flooritem.uid network.gamepackets.msgmapitem.flooruid.next;

                                                            
flooritem.itemid msgmapitem.rageofwartrap;
                                                            
flooritem.attackedsob.x;
                                                            
flooritem.mapid map.id;
                                                            
flooritem.attackedsob.y;
                                                            
flooritem.type msgmapitem.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(flooritemtrue);
                                                            
first true;
                                                        }
                                                        
uint damage game.attacking.calculate.melee(attackerattackedsobref attack) * (spell.power 5000) / 8000;

                                                        
damage = (uint)(damage 0.6);

                                                        
receiveattack(attackerattackedsobattackdamagespell);

                                                        
suse.addtarget(attackedsob.uiddamageattack);
                                                    }


                                                }
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                            
attacker.attackpacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region chaser
                                #region shadowofchaser(active)
                                
case 13090:
                                    {
                                        if (
attacker.containsflag4((ulong)msgupdate.flags4.shadowofchaser))
                                        {
                                            
attacker.removeflag4((ulong)msgupdate.flags4.shadowofchaser);
                                            
attacker.attackpacket null;
                                            break;
                                        }
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.attacker1 attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.addtarget(attacker.uid0null);
                                            
attack = new msginteract(true);
                                            
attack.attacker attack.attacked attacker.uid;
                                            
attack.attacker.xattack.attacker.y;
                                            
attack.interacttype 24;
                                            
attack.spellid spell.id;
                                            
attacker.owner.sendscreen(susetrue);
                                            
attacker.addflag4((ulong)msgupdate.flags4.shadowofchaser);
                                            
attacker.attackpacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region tripleblasts(passive)
                                
case 12850:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.attacker1 attackedsob == null Attacked.uid Attackedsob.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            if (
attackedsob == null)
                                            {
                                                if (
canattack(attackerattackedspellfalse))
                                                {
                                                    if (
attacker.containsflag4((ulong)msgupdate.flags4.shadowofchaser) && attacker.ischaser2())
                                                    {
                                                        var 
spell2 database.spelltable.getspell(13090attacker.owner);
                                                        if (
spell2 != null)
                                                        {
                                                            
spell2.cankill true;
                                                            if (
kernel.rate(spell2.percent))
                                                            {
                                                                
shadowofchaser(attackerattackedattack1);
                                                                break;
                                                            }
                                                        }
                                                    }

                                                    
uint damage game.attacking.calculate.ranged(attackerattackedref attack);
                                                    
//if (attacker.nobilityrank == game.conquerstructures.nobilityrank.king)
                                                    //{
                                                        
damage = (uint)(damage 0.8);
                                                    
//}
                                                    //if (attacker.nobilityrank == game.conquerstructures.nobilityrank.prince)
                                                    //{
                                                        //damage = (uint)(damage * 0.1);
                                                    //}
                                                    //if (attacker.nobilityrank == game.conquerstructures.nobilityrank.duke)
                                                    //{
                                                        //damage = (uint)(damage * 0.1);
                                                    //}
                                                    //if (attacker.nobilityrank == game.conquerstructures.nobilityrank.earl)
                                                    //{
                                                        //damage = (uint)(damage * 0.1);
                                                    //}
                                                    
damage damage * (attacked.playerflag == playerflag.player ? (spell.power 30000) : Spell.monsterpower) / 100;

                                                    
receiveattack(attackerattackedattackref damagespell);
                                                    
suse.addtarget(attacked.uiddamageattack);
                                                    
attacker.owner.sendscreen(susetrue);
                                                }
                                            }
                                            else
                                            {
                                                if (
canattack(attackerattackedsobspell))
                                                {

                                                    
uint damage game.attacking.calculate.ranged(attackerattackedsobref attack);

                                                    
receiveattack(attackerattackedsobattackdamagespell);
                                                    
suse.addtarget(attackedsob.uiddamageattack);
                                                    
attacker.owner.sendscreen(susetrue);
                                                }
                                            }

                                        }
                                        break;
                                    }
                                
#endregion
                                #region swirlingstorm(passive)
                                
case 12890:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
sector sector = new sector(attacker.xattacker.yxy);
                                            
sector.arrange(spell.sectorspell.distance);
                                            foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                            {
                                                
byte dist = (byte)spell.distance;
                                                
inlinealgorithm algo = new inlinealgorithm(attacker.xxattacker.yydistinlinealgorithm.algorithm.dda);
                                                
int i algo.lcoords.count;
                                                
double disth 3.0;
                                                if (
_obj == null)
                                                    continue;
                                                if (
_obj.mapobjtype == mapobjecttype.player)
                                                {
                                                    
bool hit false;
                                                    for (
int j 0ij++)
                                                        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 player;

                                                        if (
sector.inside(attacked.xattacked.y))
                                                        {
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            {
                                                                
int damagesec2 spell.humanpower;
                                                                
int damagesec = (spell.humanpower - ((spell.level 2) - 100));
                                                                var 
dis kernel.getdistance(attacker.xattacker.yattacked.xattacked.y);
                                                                
damagesec += (damagesec2 damagesec) / dis;
                                                                
uint damage game.attacking.calculate.melee(attackerattackedref attackspell) * (uint)damagesec 10000;
                                                                
damage = (uint)(damage 1.2);
                                                                
receiveattack(attackerattackedattackref damagespell);
                                                                
suse.addtarget(attacked.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                                else if (
_obj.mapobjtype == mapobjecttype.monster)
                                                {
                                                    
bool hit false;
                                                    for (
int j 0ij++)
                                                        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 player;

                                                        if (
sector.inside(attacked.xattacked.y))
                                                        {
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            {
                                                                
int damagesec2 400;
                                                                
int damagesec 0;
                                                                if (
spell.level == 0damagesec 2600;
                                                                if (
spell.level == 1damagesec 2700;
                                                                if (
spell.level == 2damagesec 2800;
                                                                if (
spell.level == 3damagesec 2900;
                                                                if (
spell.level == 4damagesec 3000;
                                                                var 
dis kernel.getdistance(attacker.xattacker.yattacked.xattacked.y);
                                                                
damagesec += (damagesec2 damagesec) / dis;
                                                                
uint damage game.attacking.calculate.melee(attackerattackedref attackspell) * (uint)damagesec 10000;
                                                                
receiveattack(attackerattackedattackref damagespell);
                                                                
suse.addtarget(attacked.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                                else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                {
                                                    
bool hit false;
                                                    for (
int j 0ij++)
                                                        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 msgnpcinfoex;
                                                        if (
attackedsob == null) continue;
                                                        if (
sector.inside(attackedsob.xattackedsob.y))
                                                        {
                                                            if (
canattack(attackerattackedsobspell))
                                                            {
                                                                
int damagesec2 4000;
                                                                
int damagesec 0;
                                                                if (
spell.level == 0damagesec 2600;
                                                                if (
spell.level == 1damagesec 2700;
                                                                if (
spell.level == 2damagesec 2800;
                                                                if (
spell.level == 3damagesec 2900;
                                                                if (
spell.level == 4damagesec 3000;
                                                                var 
dis kernel.getdistance(attacker.xattacker.yattackedsob.xattackedsob.y);
                                                                
damagesec += (damagesec2 damagesec) / dis;
                                                                
uint damage game.attacking.calculate.melee(attackerattackedsobref attack) * (uint)damagesec 10000;
                                                                
damage = (uint)(damage 1.2);
                                                                
receiveattack(attackerattackedsobattackdamagespell);
                                                                
suse.addtarget(attackedsob.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        else
                                        {
                                            
attacker.attackpacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region thundercloud[chaser]
                                
case 12840:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
attacker.greeneffect 10;
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.attacker1 attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            var 
cl = new windwalker.thundercloud(attacker.ownerattack.xattack.y);
                                            
suse.addtarget(cl.uid0null);
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region thunderbolt(active)
                                
case 12970:
                                    {
                                        if (!
attacker.owner.spells.containskey(12840)) break;
                                        foreach (var 
th in kernel.maps[attacker.mapid].entities.values.where(=> i.name == "thundercloud"))
                                        {
                                            if (
th.owneruid == attacker.uid)
                                            {
                                                if (
kernel.getdistance(attacker.xattacker.yth.xth.y) <= th.monsterinfo.attackrange)
                                                {
                                                    if (
canusespell(spellattacker.owner))
                                                    {
                                                        
preparespell(spellattacker.owner);
                                                        
msgmagiceffect suse = new msgmagiceffect(true);
                                                        
suse.attacker attacker.uid;
                                                        
suse.x;
                                                        
suse.y;
                                                        
suse.spellid spell.id;
                                                        
suse.addtarget(th.uid0null);
                                                        
writer.write(12850th.spawnpacket);//flag4(128)
                                                        
attacker.owner.sendscreen(susetrue);
                                                        
attacker.attackpacket null;
                                                        foreach (var 
client in kernel.gamepool.values.where(=> kernel.getdistance(th.xth.yi.player.xi.player.y) < 17))
                                                        {
                                                            
client.send(th.spawnpacket);
                                                        }

                                                    }
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region omnipotence(xp)
                                
case 12860:
                                    {
                                        
msgmagiceffect suse = new msgmagiceffect(true);
                                        
suse.attacker attacker.uid;
                                        
suse.spellid spell.id;
                                        
suse.spelllevel spell.level;
                                        
suse.x;
                                        
suse.y;
                                        if (
attacker.containsflag((ulong)msgupdate.flags.xplist))
                                        {
                                            
attacker.addflag4((ulong)msgupdate.flags4.omnipotence);
                                            
attacker.omnipotencestamp time32.now;
                                            
attacker.removeflag((ulong)msgupdate.flags.xplist);
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        else
                                        {
                                            if (
kernel.getdistance(attacker.xattacker.yxy) <= spell.range)
                                            {
                                                foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                                {
                                                    if (
_obj == null) continue;
                                                    if (
_obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        
attacked _obj as player;
                                                        if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.range)
                                                        {
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            {

                                                                
uint damage game.attacking.calculate.melee(attackerattackedref attackspell) / 10;

                                                                
receiveattack(attackerattackedattackref damagespell);
                                                                
suse.addtarget(attacked.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                    {
                                                        
attackedsob _obj as msgnpcinfoex;
                                                        if (
attackedsob == null) continue;
                                                        if (
kernel.getdistance(attacker.xattacker.yattackedsob.xattackedsob.y) <= spell.range)
                                                        {
                                                            if (
canattack(attackerattackedsobspell))
                                                            {

                                                                
uint damage game.attacking.calculate.melee(attackerattackedsobref attack) * 350 100;


                                                                
receiveattack(attackerattackedsobattackdamagespell);
                                                                
suse.addtarget(attackedsob.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.monster)
                                                    {
                                                        
attacked _obj as player;
                                                        if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.range)
                                                        {
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            {

                                                                
uint damage game.attacking.calculate.melee(attackerattackedref attackspell) * 350 100;

                                                                
receiveattack(attackerattackedattackref damagespell);
                                                                
suse.addtarget(attacked.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        
attacker.owner.sendscreen(susetrue);
                                        
attacker.attackpacket null;
                                        break;
                                    }
                                
#endregion
                                #region frostgaze(i-ii-iii)
                                
case 12830:
                                Case 
13070:
                                Case 
13080:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
attacker.owner.sendscreen(susetrue);
                                            foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
_obj.mapobjtype == mapobjecttype.player)
                                                {
                                                    
attacked _obj as player;

                                                    if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.range)
                                                    {
                                                        if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                        {
                                                            
int rate 100;
                                                            
int diff attacked.battlepower attacker.battlepower;
                                                            if (
diff 0diff 0;
                                                            
rate -= (byte)(diff 5);
                                                            if (
rate 0rate 0;
                                                            if (
kernel.rate(rate))
                                                            {
                                                                if (
attacked.stamina >= (byte)spell.power)
                                                                    
attacked.stamina -= (byte)spell.power;
                                                                else 
attacked.stamina 0;
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #endregion
                                #region ninja
                                #region twilightdance
                                
case 12070:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
laytrapthree line = new laytrapthree(attacker.xxattacker.yy15);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.attacker1 attacker.uid;
                                            
suse.spellid spellid;
                                            
suse.spelllevel attacker.owner.spells[spellid].level;
                                            
suse.x;
                                            
suse.y;
                                            
int stamp 300;
                                            
ushort color 2;
                                            list<
msgmapitemitems = new list<msgmapitem>();
                                            foreach (var 
coords in line.lcoords)
                                            {
                                                if (!
attacker.floorspells.containskey(spellid))
                                                    
attacker.floorspells.tryadd(spellid, new floorspell.clientfloorspells(attacker.uidxysuse.leveljhspell));
                                                var 
msgmapitem = new floorspell(network.gamepackets.msgmapitem.twilightdance, (ushort)coords.x, (ushort)coords.ycolorspellstamp);
                                                
attacker.floorspells[spellid].additem(msgmapitem);
                                                
color++;
                                                
stamp += 400;
                                                
attacker.owner.sendscreen(msgmapitem.floorpackettrue);
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region supertwofoldblade
                                
case 12080:
                                    {
                                        if (
time32.now >= attacker.spellstamp.addmilliseconds(500))
                                        {
                                            if (
canusespell(spellattacker.owner))
                                            {
                                                
ushort xxyx;
                                                if (
attacked != null)
                                                {
                                                    
xx attacked.x;
                                                    
yx attacked.y;
                                                }
                                                else
                                                {
                                                    
xx attackedsob.x;
                                                    
yx attackedsob.y;
                                                }
                                                if (
kernel.getdistance(attacker.xattacker.yxxyx) <= spell.distance)
                                                {
                                                    if (
attackedsob == null)
                                                        if (
attacked.containsflag((ulong)msgupdate.flags.fly)) return;
                                                    if (
attacker.containsflag((ulong)msgupdate.flags.fly)) return;
                                                    
preparespell(spellattacker.owner);
                                                    
msgmagiceffect suse = new msgmagiceffect(true);
                                                    
suse.attacker attacker.uid;
                                                    
suse.spellid spell.id;
                                                    
suse.spelllevel spell.level;
                                                    
suse.x;
                                                    
suse.y;
                                                    
bool send false;
                                                    if (
attackedsob == null)
                                                    {
                                                        if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                        {
                                                            
attack.effect msginteract.interacteffects.none;
                                                            
uint damage calculate.melee(attackerattackedref attackspell);
                                                            
damage = (uint)(damage 1.6);

                                                            
suse.effect attack.effect;
                                                            
receiveattack(attackerattackedattackref damagespell);
                                                            
suse.addtarget(attacked.uiddamageattack);
                                                            
send true;
                                                            if (
attacker.owner.spells.containskey(11230) && !attacked.dead)
                                                            {
                                                                var 
attacker.owner.spells[11230];
                                                                var 
spellz spelltable.spellinformations[s.id][s.level];
                                                                if (
spellz != null)
                                                                {
                                                                    if (
kernel.rate(spellz.percent))
                                                                    {
                                                                        
msgmagiceffect ssuse = new msgmagiceffect(true);
                                                                        
ssuse.attacker attacker.uid;
                                                                        
ssuse.spellid spellz.id;
                                                                        
ssuse.spelllevel spellz.level;
                                                                        
damage calculate.melee(attackerattackedref attack) / 30;
                                                                        
ssuse.addtarget(attacked.uid, new msgmagiceffect.damageclass().damage damageattack);
                                                                        
receiveattack(attackerattackedattackref damagespellz);
                                                                        
attacker.owner.sendscreen(ssusetrue);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        if (
canattack(attackerattackedsobspell))
                                                        {
                                                            
attack.effect msginteract.interacteffects.none;
                                                            
uint damage calculate.melee(attackerattackedsobref attack);
                                                            
receiveattack(attackerattackedsobattackdamagespell);
                                                            
suse.effect attack.effect;
                                                            
suse.addtarget(attackedsob.uiddamageattack);
                                                            
send true;
                                                        }
                                                    }
                                                    if (
send)
                                                        
attacker.owner.sendscreen(susetrue);
                                                    
attacker.spellstamp time32.now;
                                                }
                                                else
                                                {
                                                    
attacker.attackpacket null;
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region shadowclone
                                
case 12090:
                                    {
                                        if (
attacker.myclones.count != 0)
                                        {
                                            foreach (var clone 
in attacker.myclones)
                                                clone.
removethat();
                                            
attacker.myclones.clear();
                                            break;
                                        }
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.attacker1 attacker.uid;
                                            
suse.spellid spellid;
                                            
suse.spelllevel attacker.owner.spells[spellid].level;
                                            
suse.x;
                                            
suse.y;
                                            switch (
attacker.owner.spells[spellid].level)
                                            {
                                                case 
0:
                                                Case 
1:
                                                Case 
2:
                                                    {
                                                        
attacker.myclones.add(new clone(attacker"shadowclone"10003));
                                                        break;
                                                    }
                                                default:
                                                    {
                                                        
attacker.myclones.add(new clone(attacker"shadowclone"3));
                                                        
attacker.myclones.add(new clone(attacker"shadowclone"10003));
                                                        break;
                                                    }
                                            }
                                            foreach (var clone 
in attacker.myclones)
                                            {
                                                
msgaction data = new msgaction(true);
                                                
data.id msgaction.mode.revive;
                                                
data.uid = clone.uid;
                                                
data.attacker.x;
                                                
data.attacker.y;
                                                
attacker.owner.sendscreen(datatrue);
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region fatalspin
                                
case 12110:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spellid;
                                            
suse.spelllevel attacker.owner.spells[spellid].level;
                                            
suse.x;
                                            
suse.y;
                                            
rangemove movein = new rangemove();
                                            list<
rangemove.coordsranger movein.movecoords(attacker.xattacker.yxy7);
                                            foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                            {
                                                if (
_obj == null) continue;
                                                if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                {
                                                    
attacked _obj as player;
                                                    if (!
movein.inrange(attacked.xattacked.y2ranger)) continue;
                                                    {
                                                        if (!
canattack(attackerattackedspellattack.interacttype == msginteract.melee)) continue;
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.melee(attackerattackedref attackspell);
                                                        
                                                        
damage = (uint)(damage 0.1);
                                                            
                                                        
suse.effect attack.effect;
                                                        
attack.damage damage;
                                                        
receiveattack(attackerattackedattackref damagespell);
                                                        
suse.addtarget(attacked.uiddamageattack);
                                                    }
                                                }
                                                else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                {
                                                    
attackedsob _obj as msgnpcinfoex;
                                                    if (
attackedsob == null) continue;
                                                    if (!
movein.inrange(attackedsob.xattackedsob.y2ranger)) continue;
                                                    {
                                                        if (!
canattack(attackerattackedsobspell)) continue;
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.melee(attackerattackedsobref attack);
                                                        
attack.damage damage;
                                                        
receiveattack(attackerattackedsobattackdamagespell);
                                                        
suse.addtarget(attackedsob.uiddamageattack);
                                                    }
                                                }
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region vortex
                                
case 6010:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
attacker.addflag((ulong)msgupdate.flags.shurikenvortex);
                                            
attacker.removeflag((ulong)msgupdate.flags.ride);
                                            
attacker.shurikenvortexstamp time32.now;
                                            
attacker.shurikenvortextime 20;
                                            
attacker.owner.sendscreen(susetrue);
                                            
attacker.vortexpacket = new msginteract(true);
                                            
attacker.vortexpacket.decoded true;
                                            
attacker.vortexpacket.damage 6012;
                                            
attacker.vortexpacket.interacttype msginteract.magic;
                                            
attacker.vortexpacket.attacker attacker.uid;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region vortexrespone
                                
case 6012:
                                    {
                                        if (!
attacker.containsflag((ulong)msgupdate.flags.shurikenvortex))
                                        {
                                            
attacker.attackpacket null; break;
                                        }
                                        
msgmagiceffect suse = new msgmagiceffect(true);
                                        
suse.attacker attacker.uid;
                                        
suse.spellid spell.id;
                                        
suse.spelllevel spell.level;
                                        
suse.attacker.x;
                                        
suse.attacker.y;
                                        foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                        {
                                            if (
_obj == null) continue;
                                            if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                            {
                                                
attacked _obj as player;
                                                if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.range)
                                                {
                                                    if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                    {
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.melee(attackerattackedref attack);
                                                        
suse.effect attack.effect;
                                                        
receiveattack(attackerattackedattackref damagespell);
                                                        
suse.addtarget(attacked.uiddamageattack);
                                                    }
                                                }
                                            }
                                            else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                            {
                                                
attackedsob _obj as msgnpcinfoex;
                                                if (
kernel.getdistance(attacker.xattacker.yattackedsob.xattackedsob.y) <= spell.range)
                                                {
                                                    if (
canattack(attackerattackedsobspell))
                                                    {
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.melee(attackerattackedsobref attack);
                                                        
suse.effect attack.effect;
                                                        
receiveattack(attackerattackedsobattackdamagespell);
                                                        
suse.addtarget(attackedsob.uiddamageattack);
                                                    }
                                                }
                                            }
                                        }
                                        
attacker.owner.sendscreen(susetrue);
                                        break;
                                    }
                                
#endregion
                                #region toxicfog
                                
case 6001:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            if (
kernel.getdistance(attacker.xattacker.yxy) <= spell.distance)
                                            {
                                                foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                                {
                                                    if (
_obj.mapobjtype == mapobjecttype.player || _obj.mapobjtype == mapobjecttype.monster)
                                                    {
                                                        
attacked _obj as player;
                                                        if (
attacked.mapobjtype == mapobjecttype.monster)
                                                            if (
attacked.monsterinfo.boss) continue;
                                                        if (
kernel.getdistance(xyattacked.xattacked.y) <= spell.range)
                                                        {
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.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((ulong)msgupdate.flags.poisoned);
                                                                    
suse.addtarget(attacked.uid1null);
                                                                }
                                                                else
                                                                {
                                                                    
suse.addtarget(attacked.uid0null);
                                                                    
suse.targets[attacked.uid].hit false;
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.attackpacket null;
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion

                                #region twofoldblades
                                
case 6000:
                                    {
                                        if (
time32.now >= attacker.spellstamp.addmilliseconds(500))
                                        {
                                            if (
canusespell(spellattacker.owner))
                                            {
                                                
ushort xxyx;
                                                if (
attacked != null)
                                                {
                                                    
xx attacked.x;
                                                    
yx attacked.y;
                                                }
                                                else
                                                {
                                                    
xx attackedsob.x;
                                                    
yx attackedsob.y;
                                                }
                                                if (
kernel.getdistance(attacker.xattacker.yxxyx) <= spell.range)
                                                {
                                                    if (
attackedsob == null)
                                                        if (
attacked.containsflag((ulong)msgupdate.flags.fly)) return;
                                                    if (
attacker.containsflag((ulong)msgupdate.flags.fly)) return;
                                                    
preparespell(spellattacker.owner);
                                                    
msgmagiceffect suse = new msgmagiceffect(true);
                                                    
suse.attacker attacker.uid;
                                                    
suse.spellid spell.id;
                                                    
suse.spelllevel spell.level;
                                                    
suse.x;
                                                    
suse.y;
                                                    
bool send false;
                                                    if (
attackedsob == null)
                                                    {
                                                        if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                        {
                                                            
attack.effect msginteract.interacteffects.none;
                                                            
uint damage calculate.melee(attackerattackedref attackspell);
                                                            if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.king)
                                                                
                                                                
damage = (uint)(damage 1.4);
                                                            
                                                            
suse.effect attack.effect;
                                                            
receiveattack(attackerattackedattackref damagespell);
                                                            
suse.addtarget(attacked.uiddamageattack);
                                                            
send true;
                                                            if (
attacker.owner.spells.containskey(11230) && !attacked.dead)
                                                            {
                                                                var 
attacker.owner.spells[11230];
                                                                var 
spellz spelltable.spellinformations[s.id][s.level];
                                                                if (
spellz != null)
                                                                {
                                                                    if (
mr.hamooo.kernel.rate(spellz.percent))
                                                                    {
                                                                        
msgmagiceffect ssuse = new msgmagiceffect(true);
                                                                        
ssuse.attacker attacker.uid;
                                                                        
ssuse.spellid spellz.id;
                                                                        
ssuse.spelllevel spellz.level;
                                                                        
damage calculate.melee(attackerattackedref attack) / 30;
                                                                        
ssuse.addtarget(attacked.uid, new msgmagiceffect.damageclass().damage damageattack);
                                                                        
receiveattack(attackerattackedattackref damagespellz);
                                                                        
attacker.owner.sendscreen(ssusetrue);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        if (
canattack(attackerattackedsobspell))
                                                        {
                                                            
attack.effect msginteract.interacteffects.none;
                                                            
uint damage calculate.melee(attackerattackedsobref attack);
                                                            
receiveattack(attackerattackedsobattackdamagespell);
                                                            
suse.effect attack.effect;
                                                            
suse.addtarget(attackedsob.uiddamageattack);
                                                            
send true;
                                                        }
                                                    }
                                                    if (
send)
                                                        
attacker.owner.sendscreen(susetrue);
                                                    
attacker.spellstamp time32.now;
                                                }
                                                else
                                                {
                                                    
attacker.attackpacket null;
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region poisonstar
                                
case 6002:
                                    {
                                        if (
attackedsob != null) return;
                                        if (
attacked.playerflag == playerflag.monster) return;
                                        if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.distance)
                                        {
                                            if (
canusespell(spellattacker.owner))
                                            {
                                                
preparespell(spellattacker.owner);
                                                
int potdifference attacker.battlepower attacked.battlepower;
                                                
int rate spell.percent potdifference;
                                                
msgmagiceffect suse = new msgmagiceffect(true);
                                                
suse.attacker attacker.uid;
                                                
suse.spellid spell.id;
                                                
suse.spelllevel spell.level;
                                                
suse.x;
                                                
suse.y;
                                                if (
canattack(attackerattackedspellfalse))
                                                {
                                                    
suse.addtarget(attacked.uid1attack);
                                                    if (
kernel.rate(rate))
                                                    {
                                                        
attacked.nodrugsstamp time32.now;
                                                        
attacked.nodrugstime = (short)spell.duration;
                                                        
attacked.addflag2((ulong)msgupdate.flags2.poisonstar);
                                                        if (
attacked.playerflag == playerflag.player)
                                                            
attacked.owner.send(constants.nodrugs(spell.duration));
                                                    }
                                                    else
                                                    {
                                                        
suse.targets[attacked.uid].hit false;
                                                    }
                                                    
attacked.owner.sendscreen(susetrue);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region archerbane
                                
case 6004:
                                    {
                                        if (
attackedsob != null) return;
                                        if (
attacked.playerflag == playerflag.monster) return;
                                        if (!
attacked.containsflag((ulong)msgupdate.flags.fly)) return;
                                        if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.distance)
                                        {
                                            if (
canusespell(spellattacker.owner))
                                            {
                                                
preparespell(spellattacker.owner);
                                                
int potdifference attacker.battlepower attacked.battlepower;
                                                
int rate spell.percent potdifference;
                                                
msgmagiceffect suse = new msgmagiceffect(true);
                                                
suse.attacker attacker.uid;
                                                
suse.spellid spell.id;
                                                
suse.spelllevel spell.level;
                                                
suse.x;
                                                
suse.y;
                                                if (
canattack(attackerattackedspellfalse))
                                                {
                                                    
uint dmg calculate.percent(attacked0.1f);
                                                    
suse.addtarget(attacked.uiddmgattack);
                                                    if (
kernel.rate(rate))
                                                    {
                                                        
attacked.hitpoints -= dmg;
                                                        
attacked.removeflag((ulong)msgupdate.flags.fly);
                                                    }
                                                    else
                                                    {
                                                        
suse.targets[attacked.uid].hit false;
                                                    }
                                                    
attacked.owner.sendscreen(susetrue);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region mortaldrag
                                
case 11180:
                                    {
                                        if (
attacked != null)
                                        {
                                            if (
attacked.containsflag((ulong)msgupdate.flags.fly)) return;
                                            if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.distance)
                                            {
                                                if (
canusespell(spellattacker.owner))
                                                {
                                                    if (!
kernel.rate(math.max(5100 - (attacked.battlepower attacker.battlepower) / 5))) return;
                                                    
preparespell(spellattacker.owner);
                                                    
msgmagiceffect suse = new msgmagiceffect(true);
                                                    
suse.attacker attacker.uid;
                                                    
suse.spellid spell.id;
                                                    
suse.spelllevel spell.level;
                                                    
suse.attacked.x;
                                                    
suse.attacked.y;
                                                    
ushort newx attacker.x;
                                                    
ushort newy attacker.y;
                                                    
map.pushback(ref newxref newyattacked.facing5);
                                                    if (
attacker.owner.map.floor[newxnewymapobjecttype.playerattacked])
                                                    {
                                                        
suse.attacked.newx;
                                                        
suse.attacked.newy;
                                                    }
                                                    
msgmagiceffect.damageclass tar = new msgmagiceffect.damageclass();
                                                    if (
canattack(attackerattackedspellfalse))
                                                    {
                                                        
tar.damage calculate.melee(attackerattackedref attackspell);
                                                        
suse.addtarget(attacked.uidtarattack);
                                                        
receiveattack(attackerattackedattackref tar.damagespell);
                                                    }
                                                    if (
attacker.playerflag == playerflag.player)
                                                        
attacker.owner.sendscreen(susetrue);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region bloodyscythe
                                
case 11170:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
msgmagiceffect.damageclass tar = new msgmagiceffect.damageclass();
                                            foreach (var 
t in attacker.owner.screen.objects)
                                            {
                                                if (
== null) continue;
                                                if (
t.mapobjtype == mapobjecttype.player || t.mapobjtype == mapobjecttype.monster)
                                                {
                                                    var 
target as player;
                                                    if (
kernel.getdistance(xytarget.xtarget.y) <= spell.range)
                                                    {
                                                        if (
canattack(attackertargetspellfalse))
                                                        {
                                                            
tar.damage calculate.melee(attackertargetref attackspell) / 2;
                                                            
tar.hit true;
                                                            
suse.addtarget(target.uidtarattack);
                                                            
receiveattack(attackertargetattackref tar.damagespell);
                                                        }
                                                    }
                                                }
                                            }
                                            if (
attacker.playerflag == playerflag.player)
                                                
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region steed
                                #region riding
                                
case 7001:
                                    {
                                        if (
constants.noriding.contains(attacker.mapid))
                                        {
                                            
attacker.owner.send(new msgtalk("mr: " attacker.name " you can`t use riding here !!!"system.drawing.color.redmsgtalk.world));
                                            return;
                                        }
                                        if (
attacker.containsflag((ulong)msgupdate.flags.shurikenvortex))
                                            return;
                                        if (!
attacker.owner.equipment.free(12))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            if (
attacker.containsflag((ulong)msgupdate.flags.ride))
                                            {
                                                
attacker.removeflag((ulong)msgupdate.flags.ride);
                                            }
                                            else
                                            {
                                                if (
attacker.stamina >= 30)
                                                {
                                                    
attacker.addflag((ulong)msgupdate.flags.ride);
                                                    
attacker.stamina -= 30;
                                                    
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.uid0attack);
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }

                                
#endregion
                                #region spook
                                
case 7002:
                                    {
                                        if (
attacked.containsflag((ulong)msgupdate.flags.ride) && attacker.containsflag((ulong)msgupdate.flags.ride))
                                        {
                                            
msgiteminfo attackedsteed nullattackersteed null;
                                            if ((
attackedsteed attacked.owner.equipment.trygetitem(msgiteminfo.steed)) != null)
                                            {
                                                if ((
attackersteed attacker.owner.equipment.trygetitem(msgiteminfo.steed)) != null)
                                                {
                                                    
msgmagiceffect suse = new msgmagiceffect(true);
                                                    
suse.attacker attacker.uid;
                                                    
suse.spellid spell.id;
                                                    
suse.spelllevel spell.level;
                                                    
suse.x;
                                                    
suse.y;
                                                    
suse.addtarget(attacked.uid0attack);
                                                    if (
attackedsteed.plus attackersteed.plus)
                                                        
attacked.removeflag((ulong)msgupdate.flags.ride);
                                                    else if (
attackedsteed.plus == attackersteed.plus && attackedsteed.plusprogress <= attackersteed.plusprogress)
                                                        
attacked.removeflag((ulong)msgupdate.flags.ride);
                                                    else
                                                        
suse.targets[attacked.uid].hit false;
                                                    
attacker.owner.sendscreen(susetrue);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region warcry
                                
case 7003:
                                    {
                                        
msgmagiceffect suse = new msgmagiceffect(true);
                                        
suse.attacker attacker.uid;
                                        
suse.spellid spell.id;
                                        
suse.spelllevel spell.level;
                                        
suse.x;
                                        
suse.y;
                                        
msgiteminfo attackedsteed nullattackersteed null;
                                        foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                        {
                                            if (
_obj == null) continue;
                                            if (
_obj.mapobjtype == mapobjecttype.player && _obj.uid != attacker.uid)
                                            {
                                                
attacked _obj as player;
                                                if ((
attackedsteed attacked.owner.equipment.trygetitem(msgiteminfo.steed)) != null)
                                                {
                                                    if ((
attackersteed attacker.owner.equipment.trygetitem(msgiteminfo.steed)) != null)
                                                    {
                                                        if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= attackedsteed.plus)
                                                        {
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            {
                                                                
suse.addtarget(attacked.uid0attack);
                                                                if (
attackedsteed.plus attackersteed.plus)
                                                                    
attacked.removeflag((ulong)msgupdate.flags.ride);
                                                                else if (
attackedsteed.plus == attackersteed.plus && attackedsteed.plusprogress <= attackersteed.plusprogress)
                                                                    
attacked.removeflag((ulong)msgupdate.flags.ride);
                                                                else
                                                                    
suse.targets[attacked.uid].hit false;
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        
attacker.owner.sendscreen(susetrue);
                                        break;
                                    }
                                
#endregion
                                #region chargingvortex
                                
case 11190:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            if (
attacker.owner.map.floor[xymapobjecttype.invalidcastnull]) break;
                                            
spell.usestamina 20;
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
uint16 oxoy;
                                            
ox attacker.x;
                                            
oy attacker.y;
                                            
attack.x;
                                            
attack.y;
                                            
attack.attacker attacker.uid;
                                            
attack.interacttype msginteract.skillmove;
                                            
attack.x;
                                            
attack.y;
                                            
attacker.owner.sendscreen(attacktrue);
                                            
attacker.x;
                                            
attacker.y;
                                            if (
kernel.getdistance(attacker.xattacker.yxy) <= spell.range)
                                            {
                                                var array = 
attacker.owner.screen.objects;
                                                foreach (
interfaces.imapobject _obj in array)
                                                {
                                                    if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        
attacked _obj as player;
                                                        if (
kernel.getdistance(xyattacked.xattacked.y) > spell.range) continue;
                                                        if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                        {
                                                            var 
damage calculate.melee(attackerattackedref attackspell);
                                                            
receiveattack(attackerattackedattackref damagespell);
                                                            
suse.addtarget(attacked.uiddamageattack);
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                    {
                                                        
attackedsob _obj as msgnpcinfoex;
                                                        if (
kernel.getdistance(attacker.xattacker.yattackedsob.xattackedsob.y) <= spell.range)
                                                        {
                                                            if (
canattack(attackerattackedsobspell))
                                                            {
                                                                
uint damage calculate.melee(attackerattackedsobref attack);
                                                                
receiveattack(attackerattackedsobattackdamagespell);
                                                                
suse.addtarget(attackedsob.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.attackpacket null;
                                            }
                                            
calculations.isbreaking(attacker.owneroxoy);
                                            
attacker.owner.sendscreen(susetrue);
                                            
attacker.owner.screen.reload(suse);
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region monk
                                #region elementalaura
                                
case 10395:
                                Case 
10410:
                                Case 
10420:
                                Case 
10421:
                                Case 
10422:
                                Case 
10423:
                                Case 
10424:
                                    {
                                        
handleauramonk(attackerspell);
                                        break;
                                    }
                                
#endregion
                                #region compassion
                                
case 10430:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            if (
attacker.owner.team != null)
                                            {
                                                
preparespell(spellattacker.owner);
                                                foreach (
client.gamestate teammate in attacker.owner.team.teammates)
                                                {
                                                    if (
kernel.getdistance(attacker.xattacker.yteammate.player.xteammate.player.y) <= spell.distance)
                                                    {
                                                        
teammate.player.removeflag((ulong)msgupdate.flags.poisoned);
                                                        
suse.addtarget(teammate.player.uid0attack);
                                                    }
                                                }
                                                
attacker.owner.sendscreen(susetrue);
                                            }
                                            else
                                            {
                                                
preparespell(spellattacker.owner);
                                                
attacker.removeflag((ulong)msgupdate.flags.poisoned);
                                                
suse.addtarget(attacker.uid0attack);
                                                if (
attacked.playerflag == playerflag.player)
                                                    
attacked.owner.sendscreen(susetrue);
                                                else 
attacker.owner.sendscreen(susetrue);
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region serenity
                                
case 10400:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            if (
attacker == null) return;
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spellid;
                                            
suse.spelllevel attacker.owner.spells[spellid].level;
                                            
suse.x;
                                            
suse.y;
                                            
suse.targets.add(attacker.uid1);
                                            
attacked.toxicfogleft 0;
                                            
attacked.nodrugstime 0;
                                            
attacked.scurbybomb 0;
                                            
attacked.dragonfurytime 0;
                                            
attacked.flamelayerleft 0;
                                            if (
attacked.containsflag2((ulong)msgupdate.flags2.scurvybomb))
                                                
attacked.removeflag2((ulong)msgupdate.flags2.scurvybomb);
                                            if (
attacked.containsflag2((ulong)msgupdate.flags2.poisonstar))
                                                
attacked.removeflag2((ulong)msgupdate.flags2.poisonstar);
                                            
msgupdate upgrade = new msgupdate(true);
                                            
upgrade.uid attacker.uid;
                                            
upgrade.append((byte)msgupdate.datatype.fatigue0000);
                                            
attacked.owner.send(upgrade.toarray());
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region tranquility
                                
case 10425:
                                    {
                                        if (
attacker.epicmonk())
                                        {
                                            
attack.interacttype msginteract.magic;
                                            
attack.decoded true;
                                            
attack.attacked.x;
                                            
attack.attacked.y;
                                            
attack.attacked attacked.uid;
                                            
attack.attacker attacker.uid;
                                            
attack.damage 12560;
                                            goto 
restart;
                                        }
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            if (
attacked == null) return;
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spellid;
                                            
suse.spelllevel attacker.owner.spells[spellid].level;
                                            
suse.x;
                                            
suse.y;
                                            
suse.addtarget(attacked.uid0attack);
                                            if (
attacked != null && attacked.playerflag == playerflag.player)
                                            {
                                                if (
attacked.containsflag2((ulong)msgupdate.flags2.soulshackle))
                                                {
                                                    
msgupdate upgrade = new msgupdate(true);
                                                    
upgrade.uid attacked.uid;
                                                    
upgrade.append((byte)msgupdate.datatype.soulshackle111000);
                                                    
attacked.owner.send(upgrade.toarray());
                                                }
                                                
attacked.toxicfogleft 0;
                                                
attacked.scurbybomb 0;
                                                
attacked.nodrugstime 0;
                                                
attacked.dragonfurytime 0;
                                                
attacked.flamelayerleft 0;
                                                if (
attacked.dead)
                                                {
                                                    
attacked.soulshackleremover();
                                                }
                                                if (
attacked.playerflag == playerflag.player)
                                                    
attacker.owner.sendscreen(susetrue);
                                                else 
attacked.monsterinfo.sendscreen(suse);
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region whirlwindkick
                                
case 10415:
                                    {
                                        if (
time32.now attacker.spellstamp.addmilliseconds(300))
                                        {
                                            
attacker.attackpacket null; return;
                                        }
                                        if (
kernel.getdistance(attacker.xattacker.yxy) <= 3)
                                        {
                                            if (
canusespell(spellattacker.owner))
                                            {
                                                
preparespell(spellattacker.owner);

                                                
msgmagiceffect suse = new msgmagiceffect(true);
                                                
suse.attacker attacker.uid;
                                                
suse.spellid spell.id;
                                                
suse.spelllevel 0;
                                                
suse.= (ushort)kernel.random.next(310);
                                                
suse.0;
                                                
//suse.spelllevelhu = client_spell.levelhu2;
                                                
if (kernel.getdistance(attacker.xattacker.yxy) <= 3)
                                                {
                                                    for (
int c 0attacker.owner.screen.objects.lengthc++)
                                                    {
                                                        
//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 (>= 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.player)
                                                        {
                                                            
attacked _obj as player;
                                                            if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.range)
                                                            {
                                                                if (
canattack(attackerattackedspellattack.interacttype == msginteract.ranged))
                                                                {
                                                                    
uint damage game.attacking.calculate.melee(attackerattackedref attack);
                                                                    
damage = (uint)(damage 0.6);
                                                                    
suse.effect attack.effect;
                                                                    
receiveattack(attackerattackedattackref damagespell);
                                                                    
attacked.stunned true;
                                                                    
attacked.stunstamp time32.now;
                                                                    
suse.addtarget(attacked.uiddamageattack);

                                                                }
                                                            }
                                                        }
                                                    }
                                                    
attacker.attackpacket null;
                                                }
                                                else
                                                {
                                                    
attacker.attackpacket null; return;
                                                }
                                                
attacker.owner.sendscreen(susetrue);
                                                
attacker.spellstamp time32.now;
                                                
suse.targets = new safedictionary<uintmsgmagiceffect.damageclass>();
                                                
attacker.attackpacket null; return;
                                            }
                                            
attacker.attackpacket null;
                                        }
                                        
attacker.attackpacket null; return;
                                    }
                                
#endregion
                                #region radiantpalm
                                
case 10381:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
attacker.spellstamp time32.now;
                                            
ushort xxyx;
                                            if (
attacked != null)
                                            {
                                                
xx attacked.x;
                                                
yx attacked.y;
                                            }
                                            else
                                            {
                                                
xx attackedsob.x;
                                                
yx attackedsob.y;
                                            }


                                            if (
kernel.getdistance(attacker.xattacker.yxxyx) <= spell.range)
                                            {
                                                if (
attackedsob == null)
                                                    if (
attacked.containsflag((ulong)msgupdate.flags.fly)) return;
                                                if (
attacker.containsflag((ulong)msgupdate.flags.fly)) return;
                                                
preparespell(spellattacker.owner);
                                                
msgmagiceffect suse = new msgmagiceffect(true);
                                                
suse.attacker attacker.uid;
                                                
suse.spellid spell.id;
                                                
suse.spelllevel spell.level;
                                                
suse.x;
                                                
suse.y;
                                                
bool send false;
                                                if (
attackedsob == null)
                                                {

                                                    if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                    {

                                                        
attack.effect msginteract.interacteffects.none;
                                                        var 
damage calculate.melee(attackerattackedref attack);
                                                        
/*if (attacker.nobilityrank == game.conquerstructures.nobilityrank.king)
                                                            if (attacker.nobilityrank == game.conquerstructures.nobilityrank.king)
                                                            {
                                                                damage = (uint)(damage * 1.2);
                                                            }
                                                        if (attacker.nobilityrank == game.conquerstructures.nobilityrank.prince)
                                                        {
                                                            damage = (uint)(damage * 1.2);
                                                        }
                                                        if (attacker.nobilityrank == game.conquerstructures.nobilityrank.duke)
                                                        {
                                                            damage = (uint)(damage * 1.2);
                                                        }
                                                        if (attacker.nobilityrank == game.conquerstructures.nobilityrank.earl)
                                                        {*/
                                                            
damage = (uint)(damage 1.3);
                                                        
//}
                                                        
suse.effect attack.effect;
                                                        
receiveattack(attackerattackedattackref damagespell);
                                                        
suse.addtarget(attacked.uiddamageattack);
                                                        
send true;
                                                    }
                                                }
                                                else
                                                {
                                                    if (
canattack(attackerattackedsobspell))
                                                    {
                                                        
attack.effect msginteract.interacteffects.none;
                                                        var 
damage calculate.melee(attackerattackedsobref attack);
                                                        
receiveattack(attackerattackedsobattackdamagespell);
                                                        
suse.effect attack.effect;
                                                        
suse.addtarget(attackedsob.uiddamageattack);
                                                        
send true;
                                                    }
                                                }
                                                if (
send)
                                                    
attacker.owner.sendscreen(susetrue);
                                            }
                                            else
                                            {
                                                
attacker.attackpacket null;
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region soulshackle
                                
case 10405:
                                    {
                                        if (
canusespell(spellattacker.owner) && attacked.dead)
                                        {
                                            if (
attacked.playerflag == playerflag.player)
                                            {
                                                
msgmagiceffect suse = new msgmagiceffect(true);
                                                
suse.attacker attacker.uid;
                                                
suse.spellid spell.id;
                                                
suse.spelllevel spell.level;
                                                
suse.x;
                                                
suse.y;
                                                
suse.addtarget(attacked.uid0attack);
                                                if (
attacked.dead)
                                                {
                                                    if (
attacker.battlepower >= attacked.battlepower ||
                                                        
attacker.battlepower > (attacked.battlepower 15))
                                                    {
                                                        
attacked.shacklestamp time32.now;
                                                        
attacked.shackletime = (short)spell.duration;
                                                        
msgupdate upgrade = new msgupdate(true);
                                                        
upgrade.uid attacked.uid;
                                                        
upgrade.append((byte)msgupdate.datatype.soulshackle111, (uint)spell.duration00);
                                                        
attacked.owner.send(upgrade.toarray());
                                                        
attacked.addflag2((ulong)msgupdate.flags2.soulshackle);
                                                        if (
attacked.playerflag == playerflag.player)
                                                            
attacked.owner.sendscreen(susetrue);
                                                    }
                                                }
                                            }
                                            
attacker.attackpacket null;
                                            break;
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region pirate
                                #region galebomb
                                
case 11070:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
map map;
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
msgmagiceffect.damageclass tar = new msgmagiceffect.damageclass();
                                            
int num 0;
                                            switch (
spell.level)
                                            {
                                                case 
0:
                                                Case 
1Num 3; break;
                                                case 
2:
                                                Case 
3Num 4; break;
                                                default: 
Num 5; break;
                                            }
                                            
int i 0;
                                            
kernel.maps.trygetvalue(attacker.owner.map.baseidout map);
                                            foreach (var 
t in attacker.owner.screen.objects)
                                            {
                                                if (
== null) continue;
                                                if (
t.mapobjtype == mapobjecttype.player || t.mapobjtype == mapobjecttype.monster)
                                                {
                                                    var 
target as player;
                                                    if (
kernel.getdistance(xytarget.xtarget.y) <= spell.range)
                                                    {
                                                        if (
canattack(attackertargetspellfalse))
                                                        {
                                                            
tar.damage calculate.melee(attackertargetref attackspell);
                                                            
tar.hit true;
                                                            
tar.newx target.x;
                                                            
tar.newy target.y;
                                                            
map.pushback(ref tar.newxref tar.newyattacker.facing5);
                                                            if (
map != null)
                                                            {
                                                                if (
map.floor[tar.newxtar.newymapobjecttype.playerattacker])
                                                                {
                                                                    
target.tar.newx;
                                                                    
target.tar.newy;
                                                                }
                                                                else
                                                                {
                                                                    
tar.newx target.x;
                                                                    
tar.newy target.y;
                                                                }
                                                            }
                                                            else
                                                            {
                                                                if (
attacker.owner.map.floor[tar.newxtar.newymapobjecttype.playerattacker])
                                                                {
                                                                    
target.tar.newx;
                                                                    
target.tar.newy;
                                                                }
                                                                else
                                                                {
                                                                    
target.tar.newx;
                                                                    
target.tar.newy;
                                                                }
                                                            }
                                                            
suse.addtarget(target.uidtarattack);
                                                            
receiveattack(attackertargetattackref tar.damagespell);
                                                            
i++;
                                                            if (
num) break;
                                                        }
                                                    }
                                                }
                                            }
                                            if (
attacker.playerflag == playerflag.player)
                                                
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region bladetempest
                                
case 11110:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(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.xxattacker.yydistinlinealgorithm.algorithm.dda);
                                            
attacker.x;
                                            
attacker.y;
                                            
int i 0;
                                            for (
0algo.lcoords.counti++)
                                            {
                                                if (
attacker.owner.map.floor[algo.lcoords[i].xalgo.lcoords[i].ymapobjecttype.player]
                                                    && !
attacker.throughgate(algo.lcoords[i].xalgo.lcoords[i].y))
                                                {
                                                    
= (ushort)algo.lcoords[i].x;
                                                    
= (ushort)algo.lcoords[i].y;
                                                }
                                                else
                                                {
                                                    break;
                                                }
                                            }
                                            
suse.x;
                                            
suse.y;
                                            if (!
attacker.owner.map.floor[xymapobjecttype.playernull]) return;
                                            
double disth 1.5;
                                            foreach (
interfaces.imapobject _obj in array)
                                            {
                                                
bool hit false;
                                                for (
int j 0ij++)
                                                    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 player;
                                                        if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                        {
                                                            var 
damage calculate.melee(attackerattackedref attackspell);
                                                            
receiveattack(attackerattackedattackref damagespell);

                                                            
suse.addtarget(attacked.uiddamageattack);
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        
attacked _obj as player;
                                                        if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                        {
                                                            var 
damage calculate.melee(attackerattackedref attackspell);
                                                            
/*if (attacker.nobilityrank == game.conquerstructures.nobilityrank.king)
                                                                if (attacker.nobilityrank == game.conquerstructures.nobilityrank.king)
                                                                {
                                                                    damage = (uint)(damage * 0.9);
                                                                }
                                                            if (attacker.nobilityrank == game.conquerstructures.nobilityrank.prince)
                                                            {
                                                                damage = (uint)(damage * 0.9);
                                                            }
                                                            if (attacker.nobilityrank == game.conquerstructures.nobilityrank.duke)
                                                            {
                                                                damage = (uint)(damage * 0.9);
                                                            }
                                                            if (attacker.nobilityrank == game.conquerstructures.nobilityrank.earl)
                                                            {*/
                                                                
damage = (uint)(damage 1.0);
                                                            
//}
                                                            
receiveattack(attackerattackedattackref damagespell);

                                                            
suse.addtarget(attacked.uiddamageattack);
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                    {
                                                        
attackedsob _obj as msgnpcinfoex;
                                                        if (
canattack(attackerattackedsobspell))
                                                        {
                                                            var 
damage calculate.melee(attackerattackedsobref attack);
                                                            
receiveattack(attackerattackedsobattackdamagespell);

                                                            
suse.addtarget(attackedsob.uiddamageattack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.px attacker.x;
                                            
attacker.py attacker.y;
                                            
attacker.x;
                                            
attacker.y;
                                            
attacker.owner.sendscreen(susetrue);
                                            
attacker.owner.screen.reload(suse);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region kraken`srevenge
                                
case 11100:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
int num 0;
                                            switch (
spell.level)
                                            {
                                                case 
0:
                                                Case 
1Num 3; break;
                                                case 
2:
                                                Case 
3Num 4; break;
                                                default: 
Num 5; break;
                                            }
                                            
int i 0;
                                            
msgdeadmark bsp = new msgdeadmark();
                                            foreach (var 
t in attacker.owner.screen.objects.orderby(=> kernel.getdistance(x.xx.yattacker.owner.player.xattacker.owner.player.y)))
                                            {
                                                if (
== null)
                                                    continue;
                                                if (
t.mapobjtype == mapobjecttype.player || t.mapobjtype == mapobjecttype.monster)
                                                {
                                                    var 
target as player;
                                                    if (
canattack(attackertargetspellfalse))
                                                    {
                                                        
target.isblackspotted true;
                                                        
target.blackspotstamp time32.now;
                                                        
target.blackspotstepsecs spell.duration;
                                                        
kernel.blackspoted.tryadd(target.uidtarget);
                                                        
suse.addtarget(target.uid, new msgmagiceffect.damageclass(), attack);
                                                        
i++;
                                                        if (
== num) break;
                                                    }
                                                }
                                            }
                                            if (
attacker.playerflag == playerflag.player)
                                                
attacker.owner.sendscreen(susetrue);
                                            foreach (var 
h in server.gamepool)
                                            {
                                                foreach (var 
t in suse.targets.keys)
                                                {
                                                    
h.send(bsp.toarray(truet));
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region scurvybomb
                                
case 11040:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            if (
kernel.getdistance(attacker.xattacker.yxy) <= spell.distance)
                                            {
                                                foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                                {
                                                    if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        
attacked _obj as player;
                                                        if (
kernel.getdistance(xyattacked.xattacked.y) <= spell.range)
                                                        {
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            {
                                                                
int potdifference attacker.battlepower attacked.battlepower;
                                                                
int rate spell.percent potdifference;
                                                                if (
kernel.rate(rate))
                                                                {
                                                                    if (
_obj.mapobjtype == mapobjecttype.player)
                                                                    {
                                                                        
attacked.scurbybombstamp time32.now;
                                                                        
attacked.scurbybomb2stamp time32.now;
                                                                        
attacked.scurbybomb 20;
                                                                        
attacked.addflag2((ulong)msgupdate.flags2.scurvybomb);
                                                                        
msgupdate upgrade = new msgupdate(true);
                                                                        
upgrade.uid attacked.uid;
                                                                        
upgrade.append((byte)msgupdate.datatype.fatigue202000);
                                                                        
attacked.owner.send(upgrade.toarray());
                                                                    }
                                                                    
attack.effect msginteract.interacteffects.none;
                                                                    
uint damage calculate.melee(attackerattackedref attackspell);
                                                                    
suse.effect attack.effect;
                                                                    
receiveattack(attackerattackedattackref damagespell);
                                                                    
suse.targets.add(attacked.uiddamage);
                                                                }
                                                                else
                                                                {
                                                                    
suse.targets.add(attacked.uid0);
                                                                    
suse.targets[attacked.uid].hit false;
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.attackpacket null;
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region cannon barrage
                                
case 11050:
                                    {
                                        if (
attacker.owner.player.containsflag((ulong)msgupdate.flags.xplist))
                                        {
                                            
attacker.owner.player.removeflag((ulong)msgupdate.flags.xplist);
                                            
attacker.owner.player.addflag2((ulong)msgupdate.flags2.cannonbarrage);
                                            
attacker.owner.player.cannonbarragestamp time32.now;
                                            return;
                                        }
                                        
preparespell(spellattacker.owner);
                                        
msgmagiceffect suse = new msgmagiceffect(true);
                                        
suse.attacker attacker.uid;
                                        
suse.spellid spell.id;
                                        
suse.spelllevel spell.level;
                                        
suse.x;
                                        
suse.y;
                                        
msgmagiceffect.damageclass tar = new msgmagiceffect.damageclass();
                                        foreach (var 
t in attacker.owner.screen.objects)
                                        {
                                            if (
== null) continue;
                                            if (
t.mapobjtype == mapobjecttype.player || t.mapobjtype == mapobjecttype.monster)
                                            {
                                                var 
target as player;
                                                if (
kernel.getdistance(attacker.owner.player.xattacker.owner.player.ytarget.xtarget.y) <= spell.range)
                                                {
                                                    if (
canattack(attackertargetspellfalse))
                                                    {
                                                        
tar.damage calculate.ranged(attackertargetref attack);
                                                        
receiveattack(attackertargetattackref tar.damagespell);
                                                        
suse.addtarget(target.uidtarattack);
                                                    }
                                                }
                                            }
                                        }
                                        if (
attacker.playerflag == playerflag.player)
                                            
attacker.owner.sendscreen(susetrue);
                                        break;
                                    }
                                
#endregion
                                #region blackbeard`srage
                                
case 11060:
                                    {
                                        if (
attacker.owner.player.containsflag((ulong)msgupdate.flags.xplist))
                                        {
                                            
attacker.owner.player.removeflag((ulong)msgupdate.flags.xplist);
                                            
attacker.owner.player.addflag2((ulong)msgupdate.flags2.blackbeardsrage);
                                            
attacker.owner.player.blackbeardsragestamp time32.now;
                                            return;
                                        }
                                        
int targets 0;
                                        switch (
spell.level)
                                        {
                                            case 
0:
                                            Case 
1Targets 3; break;
                                            case 
2:
                                            Case 
3Targets 4; break;
                                            default: 
Targets 5; break;
                                        }
                                        
int i 0;
                                        
preparespell(spellattacker.owner);
                                        
msgmagiceffect suse = new msgmagiceffect(true);
                                        
suse.attacker attacker.uid;
                                        
suse.spellid spell.id;
                                        
suse.spelllevel spell.level;
                                        
suse.x;
                                        
suse.y;
                                        
msgmagiceffect.damageclass tar = new msgmagiceffect.damageclass();
                                        foreach (var 
t in attacker.owner.screen.objects)
                                        {
                                            if (
== null) continue;
                                            if (
t.mapobjtype == mapobjecttype.player || t.mapobjtype == mapobjecttype.monster)
                                            {
                                                var 
target as player;
                                                if (
kernel.getdistance(attacker.owner.player.xattacker.owner.player.ytarget.xtarget.y) <= spell.range)
                                                {
                                                    if (
canattack(attackertargetspellfalse))
                                                    {
                                                        
tar.damage calculate.ranged(attackertargetref attack);
                                                        
suse.addtarget(target.uidtarattack);
                                                        
receiveattack(attackertargetattackref tar.damagespell);
                                                        
i++;
                                                        if (
== targets) break;
                                                    }
                                                }
                                            }
                                        }
                                        if (
attacker.playerflag == playerflag.player)
                                            
attacker.owner.sendscreen(susetrue);
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region warrior
                                #region extraxp
                                
case 1040:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            if (
attacker.owner.team != null)
                                                foreach (
client.gamestate teammate in attacker.owner.team.teammates)
                                                {
                                                    if (
teammate.player.uid != attacker.uid)
                                                    {
                                                        if (
kernel.getdistance(attacker.xattacker.yteammate.player.xteammate.player.y) <= spell.distance)
                                                        {
                                                            
teammate.xpcount += 20;
                                                            
msgupdate update = new msgupdate(true);
                                                            
update.uid teammate.player.uid;
                                                            
update.append((byte)msgupdate.datatype.xpcircleteammate.xpcount);
                                                            
update.send(teammate);
                                                            
suse.targets.add(teammate.player.uid20);
                                                            if (
spell.nextspellid != 0)
                                                            {
                                                                
attack.damage spell.nextspellid;
                                                                
attacker.attackpacket attack;
                                                            }
                                                            else 
attacker.attackpacket null;
                                                        }
                                                    }
                                                }
                                            if (
attacked.playerflag == playerflag.player)
                                                
attacked.owner.sendscreen(susetrue);
                                            else 
attacked.monsterinfo.sendscreen(suse);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region dash
                                
case 1051:
                                    {
                                        if (
attacked != null)
                                        {
                                            if (!
attacked.dead)
                                            {
                                                var 
direction kernel.getangle(attacker.xattacker.yattacked.xattacked.y);
                                                if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                {
                                                    
attack = new msginteract(true);
                                                    
attack.effect msginteract.interacteffects.none;
                                                    
uint damage calculate.melee(attackerattackedref attack);
                                                    
attack.interacttype msginteract.dash;
                                                    
attack.attacked.x;
                                                    
attack.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(attackerattackedattackref damagespell);
                                                    
attacker.owner.sendscreen(attacktrue);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region magicdefender
                                
case 11200:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            if (
attacker.class >= 20 && attacker.class <= 25)
                                            {
                                                if (!
attacker.containsflag3((ulong)msgupdate.flags3.magicdefender))
                                                {
                                                    
preparespell(spellattacker.owner);
                                                    
msgmagiceffect suse = new msgmagiceffect(true);
                                                    
suse.attacker attacker.uid;
                                                    
suse.spellid spell.id;
                                                    
suse.spelllevel spell.level;
                                                    
suse.x;
                                                    
suse.y;
                                                    if (
attacker.containsflag3((ulong)msgupdate.flags3.magicdefender))
                                                    {
                                                        
attacker.removeflag3((ulong)msgupdate.flags3.magicdefender);
                                                        
attacker.removeflag2((ulong)msgupdate.flags2.magicdefendericon);
                                                    }
                                                    
attacker.magicdefenderstamp time32.now;
                                                    
attacker.magicdefender spell.duration;
                                                    
attacker.addflag3((ulong)msgupdate.flags3.magicdefender);
                                                    
attacker.addflag2((ulong)msgupdate.flags2.magicdefendericon);
                                                    
msgupdate upgrade = new msgupdate(true);
                                                    
upgrade.uid attacker.uid;
                                                    
upgrade.append((byte)msgupdate.datatype.azureshield128, (uint)spell.duration0spell.level);
                                                    
attacker.owner.send(upgrade.toarray());
                                                    
attacker.owner.sendscreen(susetrue);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region shieldblock
                                
case 10470:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            if (
attacker.class >= 20 && attacker.class <= 25)
                                            {
                                                
preparespell(spellattacker.owner);
                                                
msgmagiceffect suse = new msgmagiceffect(true);
                                                
suse.attacker attacker.uid;
                                                
suse.spellid spell.id;
                                                
suse.spelllevel spell.level;
                                                
suse.x;
                                                
suse.y;
                                                
attacker.blockshieldstamp time32.now;
                                                
attacker.blockshield spell.duration;
                                                
attacker.blockshieldcheck true;
                                                
attacker.owner.reloadblock();
                                                
msgupdate upgrade = new msgupdate(true);
                                                
upgrade.uid attacker.uid;
                                                
upgrade.append((byte)msgupdate.datatype.azureshield113, (uint)spell.durationspell.powerspell.level);
                                                
attacker.owner.send(upgrade.toarray());
                                                
attacker.owner.sendscreen(susetrue);
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region defensivestance
                                
case 11160:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            if (
attacker.class >= 20 && attacker.class <= 25)
                                            {
                                                
preparespell(spellattacker.owner);
                                                
msgmagiceffect suse = new msgmagiceffect(true);
                                                
suse.attacker attacker.uid;
                                                
suse.spellid spell.id;
                                                
suse.spelllevel spell.level;
                                                
suse.x;
                                                
suse.y;
                                                if (
attacker.containsflag2((ulong)msgupdate.flags2.defensivestance))
                                                {
                                                    
attacker.removeflag2((ulong)msgupdate.flags2.defensivestance);
                                                    
attacker.defensivestance 0;
                                                }
                                                else if (!
attacker.containsflag2((ulong)msgupdate.flags2.defensivestance))
                                                {
                                                    
attacker.defensivestancestamp time32.now;
                                                    
attacker.defensivestance spell.duration;
                                                    
attacker.addflag2((ulong)msgupdate.flags2.defensivestance);
                                                    
msgupdate upgrade = new msgupdate(true);
                                                    
upgrade.uid attacker.uid;
                                                    
upgrade.append((byte)msgupdate.datatype.defensivestance126, (uint)spell.duration, (uint)spell.powerpercentspell.level);
                                                    
attacker.owner.send(upgrade.toarray());
                                                    
attacker.owner.sendscreen(susetrue);
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion

                                #region trojan
                                #region cruelshabe
                                
case 3050:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            if (
attackedsob != null)
                                            {
                                                if (
kernel.getdistance(attacker.xattacker.yattackedsob.xattackedsob.y) <= spell.distance)
                                                {
                                                    
msgmagiceffect suse = new msgmagiceffect(true);
                                                    
suse.attacker attacker.uid;
                                                    
suse.spellid spell.id;
                                                    
suse.spelllevel spell.level;
                                                    
suse.x;
                                                    
suse.y;
                                                    if (
canattack(attackerattackedsobspell))
                                                    {
                                                        
preparespell(spellattacker.owner);
                                                        
uint damage calculate.percent(attackedsobspell.powerpercent);
                                                        
attackedsob.hitpoints -= damage;
                                                        
suse.addtarget(attackedsob.uiddamageattack);
                                                        
attacker.owner.sendscreen(susetrue);
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.distance)
                                                {
                                                    
msgmagiceffect suse = new msgmagiceffect(true);
                                                    
suse.attacker attacker.uid;
                                                    
suse.spellid spell.id;
                                                    
suse.spelllevel spell.level;
                                                    
suse.x;
                                                    
suse.y;
                                                    if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                    {
                                                        
preparespell(spellattacker.owner);
                                                        
uint damage calculate.percent(attackedspell.powerpercent);
                                                        if (
attacked.playerflag == playerflag.player)
                                                        {
                                                            
attacker.owner.updatequalifier(damage);
                                                        }
                                                        
attacked.hitpoints -= damage;
                                                        
suse.addtarget(attacked.uiddamageattack);
                                                        if (
attacked.playerflag == playerflag.player)
                                                            
attacked.owner.sendscreen(susetrue);
                                                        else 
attacked.monsterinfo.sendscreen(suse);
                                                    }
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region supercyclone
                                
case 11970:
                                    {
                                        
msgmagiceffect suse = new msgmagiceffect(true);
                                        
suse.attacker attacker.uid;
                                        
suse.spellid spell.id;
                                        
suse.spelllevel spell.level;
                                        
suse.x;
                                        
suse.y;
                                        if (
attacker.onsupercyclone()) return;
                                        if (
attacker.containsflag((ulong)msgupdate.flags.xplist))
                                        {
                                            if (!
attacked.onkospell())
                                                
attacked.kocount 0;
                                            
attacked.kospell spell.id;
                                            
attacked.supercyclonetime 40;
                                            
attacker.addflag3((ulong)msgupdate.flags3.supercyclone);
                                            
attacker.supercyclonestamp time32.now;
                                            
attacker.removeflag((ulong)msgupdate.flags.xplist);
                                        }
                                        
attacker.owner.sendscreen(susetrue);
                                        break;
                                    }
                                
#endregion
                                #region fatalcross
                                
case 11980:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spellid;
                                            
suse.spelllevel attacker.owner.spells[spellid].level;
                                            
suse.x;
                                            
suse.y;
                                            
rangemove movein = new rangemove();
                                            list<
rangemove.coordsranger movein.movecoords(attacker.xattacker.yxy);
                                            foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                            {
                                                if (
_obj == null) continue;
                                                if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                {
                                                    
attacked _obj as player;
                                                    if (!
movein.inrange(attacked.xattacked.y2ranger)) continue;
                                                    {
                                                        if (!
canattack(attackerattackedspellattack.interacttype == msginteract.melee)) continue;
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.melee(attackerattackedref attackspell);
                                                        
//if (attacker.nobilityrank == game.conquerstructures.nobilityrank.king)
                                                        //{
                                                            
damage = (uint)(damage 1.3);
                                                        
//}
                                                        //if (attacker.nobilityrank == game.conquerstructures.nobilityrank.prince)
                                                        //{
                                                           // damage = (uint)(damage * 0.9);
                                                        //}
                                                        //if (attacker.nobilityrank == game.conquerstructures.nobilityrank.duke)
                                                        //{
                                                            //damage = (uint)(damage * 0.9);
                                                        //}
                                                        
if (attacker.nobilityrank == game.conquerstructures.nobilityrank.earl)
                                                        
//{
                                                            //damage = (uint)(damage * 0.9);
                                                        //}
                                                        
suse.effect attack.effect;
                                                        
attack.damage damage;
                                                        
receiveattack(attackerattackedattackref damagespell);
                                                        
suse.addtarget(attacked.uiddamageattack);
                                                    }
                                                }
                                                else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                {
                                                    
attackedsob _obj as msgnpcinfoex;
                                                    if (
attackedsob == null) continue;
                                                    if (!
movein.inrange(attackedsob.xattackedsob.y2ranger)) continue;
                                                    {
                                                        if (!
canattack(attackerattackedsobspell)) continue;
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.melee(attackerattackedsobref attack);
                                                        
attack.damage damage;
                                                        
receiveattack(attackerattackedsobattackdamagespell);
                                                        
suse.addtarget(attackedsob.uiddamageattack);
                                                    }
                                                }
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region mortalstrike
                                
case 11990:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
sector sector = new sector(attacker.xattacker.yxy);
                                            
sector.arrange(spell.sectorspell.range);
                                            if (
kernel.getdistance(attacker.xattacker.yxy) <= spell.distance 1)
                                            {
                                                foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                                {
                                                    if (
_obj == null) continue;
                                                    if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        
attacked _obj as player;

                                                        if (
sector.inside(attacked.xattacked.y))
                                                        {
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            {
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage calculate.melee(attackerattackedref attackspell);
                                                                if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.king)
                                                                {
                                                                    
damage = (uint)(damage 1.0);
                                                                }
                                                                if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.prince)
                                                                {
                                                                    
damage = (uint)(damage 0.8);
                                                                }
                                                                if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.duke)
                                                                {
                                                                    
damage = (uint)(damage 0.6);
                                                                }
                                                                if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.earl)
                                                                {
                                                                    
damage = (uint)(damage 0.4);
                                                                }
                                                                
suse.effect attack.effect;
                                                                
receiveattack(attackerattackedattackref damagespell);
                                                                
suse.addtarget(attacked.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                    {
                                                        
attackedsob _obj as msgnpcinfoex;
                                                        if (
canattack(attackerattackedsobspell))
                                                        {
                                                            
attack.effect msginteract.interacteffects.none;
                                                            var 
damage calculate.melee(attackerattackedsobref attack);
                                                            
suse.effect attack.effect;
                                                            
receiveattack(attackerattackedsobattackdamagespell);
                                                            
suse.addtarget(attackedsob.uiddamageattack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.px attacker.x;
                                            
attacker.py attacker.y;
                                            
attacker.x;
                                            
attacker.y;
                                            
attacker.owner.sendscreen(susetrue);
                                            
attacker.owner.screen.reload(suse);
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region leelong
                                #region dragonflow
                                
case 12270:
                                    {
                                        if (
attacker.containsflag3((ulong)msgupdate.flags3.dragonflow))
                                        {
                                            
attacker.removeflag3((ulong)msgupdate.flags3.dragonflow);
                                        }
                                        else
                                        {
                                            
msgmagiceffect msgmagiceffect = new msgmagiceffect(true);
                                            
msgmagiceffect.attacker attacker.uid;
                                            
msgmagiceffect.attacker1 attacker.uid;
                                            
msgmagiceffect.spellid spell.id;
                                            
msgmagiceffect.spelllevel spell.level;
                                            
msgmagiceffect.x;
                                            
msgmagiceffect.y;
                                            
msgmagiceffect.addtarget(attacker.uid1null);
                                            
attacker.owner.sendscreen(msgmagiceffecttrue);
                                            
attacker.addflag3((ulong)msgupdate.flags3.dragonflow);
                                            
attacker.dragonflowstamp time32.now;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region dragonroar
                                
case 12280:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
preparespell(spellattacker.owner);
                                            if (
attacker.owner.team != null)
                                            {
                                                foreach (var 
teammate in attacker.owner.team.teammates)
                                                {
                                                    if (
teammate.player.uid != attacker.uid)
                                                    {
                                                        if (
kernel.getdistance(attacker.xattacker.yteammate.player.xteammate.player.y) <= spell.range)
                                                        {
                                                            
teammate.player.stamina += (byte)spell.power;
                                                            
suse.addtarget(teammate.player.uidspell.powernull);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region dragoncyclone
                                
case 12290:
                                    {
                                        
msgmagiceffect suse = new msgmagiceffect(true);
                                        
suse.attacker attacker.uid;
                                        
suse.spellid spell.id;
                                        
suse.spelllevel spell.level;
                                        
suse.x;
                                        
suse.y;
                                        if (
attacker.containsflag((ulong)msgupdate.flags.xplist))
                                        {
                                            
attacker.kocount 0;
                                            
attacker.dragoncyclonetime 40;
                                            
attacker.removeflag((ulong)msgupdate.flags.xplist);
                                            
attacker.addflag3((ulong)msgupdate.flags3.dragoncyclone);
                                            
attacker.dragoncyclonestamp time32.now;
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        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.xxattacker.yydistinlinealgorithm.algorithm.dda);
                                            
attacker.x;
                                            
attacker.y;
                                            
int i 0;
                                            for (
0algo.lcoords.counti++)
                                            {
                                                if (
attacker.owner.map.floor[algo.lcoords[i].xalgo.lcoords[i].ymapobjecttype.player] && !attacker.throughgate(algo.lcoords[i].xalgo.lcoords[i].y))
                                                {
                                                    
= (ushort)algo.lcoords[i].x;
                                                    
= (ushort)algo.lcoords[i].y;
                                                }
                                                else
                                                {
                                                    break;
                                                }
                                            }
                                            
suse.x;
                                            
suse.y;
                                            if (!
attacker.owner.map.floor[xymapobjecttype.playernull]) return;
                                            
double disth 1.5;
                                            foreach (
interfaces.imapobject _obj in array)
                                            {
                                                
bool hit false;
                                                for (
int j 0ij++)
                                                    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 player;
                                                        if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                        {
                                                            
attack.effect msginteract.interacteffects.none;
                                                            var 
damage calculate.melee(attackerattackedref attackspell);
                                                            
suse.effect attack.effect;
                                                            
damage = (uint)((damage spell.powerpercent) / 3);
                                                            
receiveattack(attackerattackedattackref damagespell);
                                                            
suse.addtarget(attacked.uiddamageattack);
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        
attacked _obj as player;
                                                        if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                        {
                                                            
attack.effect msginteract.interacteffects.none;
                                                            var 
damage calculate.melee(attackerattackedref attackspell);
                                                            
suse.effect attack.effect;
                                                            
damage = (uint)(damage 0.4);
                                                            
receiveattack(attackerattackedattackref damagespell);
                                                            
suse.addtarget(attacked.uiddamageattack);
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                    {
                                                        
attackedsob _obj as msgnpcinfoex;
                                                        if (
canattack(attackerattackedsobspell))
                                                        {
                                                            
attack.effect msginteract.interacteffects.none;
                                                            var 
damage calculate.melee(attackerattackedsobref attack);
                                                            
suse.effect attack.effect;
                                                            
receiveattack(attackerattackedsobattackdamagespell);
                                                            
suse.addtarget(attackedsob.uiddamageattack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.px attacker.x;
                                            
attacker.py attacker.y;
                                            
attacker.x;
                                            
attacker.y;
                                            
attacker.owner.sendscreen(susetrue);
                                            
attacker.owner.screen.reload(suse);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region dragonslash
                                
case 12350:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
inlinealgorithm ila = new inlinealgorithm(attacker.xxattacker.yy, (byte)spell.rangeinlinealgorithm.algorithm.dda);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.attacker1 attacker.uid;
                                            
suse.spellid spellid;
                                            
suse.spelllevel attacker.owner.spells[spellid].level;
                                            
suse.x;
                                            
suse.y;
                                            foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                            {
                                                if (
_obj == null) continue;
                                                if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                {
                                                    
attacked _obj as player;
                                                    if (
ila.inline(attacked.xattacked.y))
                                                    {
                                                        if (!
canattack(attackerattackedspellattack.interacttype == msginteract.melee)) continue;
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.melee(attackerattackedref attackspell);
                                                        if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.king)
                                                        {
                                                            
damage = (uint)(damage 0.7);
                                                        }
                                                        if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.prince)
                                                        {
                                                            
damage = (uint)(damage 0.4);
                                                        }
                                                        if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.duke)
                                                        {
                                                            
damage = (uint)(damage 0.5);
                                                        }
                                                        if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.earl)
                                                        {
                                                            
damage = (uint)(damage 0.3);
                                                        }
                                                        
suse.effect attack.effect;
                                                        
receiveattack(attackerattackedattackref damagespell);
                                                        
suse.addtarget(attacked.uiddamageattack);
                                                    }
                                                }
                                                else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                {
                                                    
attackedsob _obj as msgnpcinfoex;
                                                    if (
ila.inline(attackedsob.xattackedsob.y))
                                                    {
                                                        if (!
canattack(attackerattackedsobspell)) continue;
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.melee(attackerattackedsobref attack);
                                                        
suse.effect attack.effect;
                                                        
receiveattack(attackerattackedsobattackdamagespell);
                                                        
suse.addtarget(attackedsob.uiddamageattack);
                                                    }
                                                }
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region airkick
                                
case 12320:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(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.xxattacker.yydistinlinealgorithm.algorithm.dda);
                                            
attacker.x;
                                            
attacker.y;
                                            
int i 0;
                                            for (
0algo.lcoords.counti++)
                                            {
                                                if (
attacker.owner.map.floor[algo.lcoords[i].xalgo.lcoords[i].ymapobjecttype.player]
                                                    && !
attacker.throughgate(algo.lcoords[i].xalgo.lcoords[i].y))
                                                {
                                                    
= (ushort)algo.lcoords[i].x;
                                                    
= (ushort)algo.lcoords[i].y;
                                                }
                                                else
                                                {
                                                    break;
                                                }
                                            }
                                            
suse.x;
                                            
suse.y;
                                            if (!
attacker.owner.map.floor[xymapobjecttype.playernull]) return;
                                            
double disth 1.5;
                                            foreach (
interfaces.imapobject _obj in array)
                                            {
                                                
bool hit false;
                                                for (
int j 0ij++)
                                                    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 player;
                                                        if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                        {
                                                            
attack.effect msginteract.interacteffects.none;
                                                            var 
damage calculate.melee(attackerattackedref attackspell);
                                                            
suse.effect attack.effect;
                                                            
receiveattack(attackerattackedattackref damagespell);
                                                            
suse.addtarget(attacked.uiddamageattack);
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        
attacked _obj as player;
                                                        if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                        {
                                                            
attack.effect msginteract.interacteffects.none;
                                                            var 
damage calculate.melee(attackerattackedref attackspell);
                                                            
damage = (uint)(damage 1.0);
                                                            
suse.effect attack.effect;
                                                            
receiveattack(attackerattackedattackref damagespell);
                                                            
suse.addtarget(attacked.uiddamageattack);
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                    {
                                                        
attackedsob _obj as msgnpcinfoex;
                                                        if (
canattack(attackerattackedsobspell))
                                                        {
                                                            
attack.effect msginteract.interacteffects.none;
                                                            var 
damage calculate.melee(attackerattackedsobref attack);
                                                            
suse.effect attack.effect;
                                                            
receiveattack(attackerattackedsobattackdamagespell);
                                                            
suse.addtarget(attackedsob.uiddamageattack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.px attacker.x;
                                            
attacker.py attacker.y;
                                            
attacker.x;
                                            
attacker.y;
                                            
attacker.owner.sendscreen(susetrue);
                                            
attacker.owner.screen.reload(suse);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region airsweep & airraid
                                
case 12330:
                                Case 
12340:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
sector sector = new sector(attacker.xattacker.yxy);
                                            
sector.arrange(spell.sectorspell.range);
                                            if (
kernel.getdistance(attacker.xattacker.yxy) <= spell.range)
                                            {
                                                foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                                {
                                                    if (
_obj == null) continue;
                                                    if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        
attacked _obj as player;
                                                        if (
sector.inside(attacked.xattacked.y))
                                                        {
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            {
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage calculate.melee(attackerattackedref attackspell);
                                                                
suse.effect attack.effect;
                                                                
receiveattack(attackerattackedattackref damagespell);
                                                                
suse.addtarget(attacked.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                    {
                                                        
attackedsob _obj as msgnpcinfoex;
                                                        if (
sector.inside(attackedsob.xattackedsob.y))
                                                        {
                                                            if (
canattack(attackerattackedsobspell))
                                                            {
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage calculate.melee(attackerattackedsobref attack);
                                                                
suse.effect attack.effect;
                                                                
receiveattack(attackerattackedsobattackdamagespell);
                                                                
suse.addtarget(attackedsob.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.attackpacket null;
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region speed kick
                                
case 12120:
                                Case 
12130:
                                Case 
12140:
                                    {
                                        
msgmagiceffect suse = new msgmagiceffect(true);
                                        
suse.attacker attacker.uid;
                                        
suse.spellid spell.id;
                                        
suse.spelllevel spell.level;
                                        
suse.x;
                                        
suse.y;
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            if (
attacked != null)
                                            {
                                                if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.distance)
                                                {
                                                    if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                    {
                                                        
preparespell(spellattacker.owner);
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.melee(attackerattackedref attackspell);
                                                        
damage = (uint)(damage 1.0);
                                                        
suse.effect attack.effect;
                                                        
receiveattack(attackerattackedattackref damagespell);
                                                        
suse.addtarget(attacked.uiddamageattack);
                                                    }
                                                }
                                                else
                                                {
                                                    
attacker.attackpacket null;
                                                }
                                            }
                                            else
                                            {
                                                if (
kernel.getdistance(attacker.xattacker.yattackedsob.xattackedsob.y) <= spell.distance)
                                                {
                                                    if (
canattack(attackerattackedsobspell))
                                                    {
                                                        
preparespell(spellattacker.owner);
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.magic(attackerattackedsobspellref attack);
                                                        
suse.effect attack.effect;
                                                        
receiveattack(attackerattackedsobattackdamagespell);
                                                        
suse.addtarget(attackedsob.uiddamageattack);
                                                    }
                                                }
                                            }
                                        }
                                        else
                                        {
                                            
attacker.attackpacket null;
                                        }
                                        
attacker.px attacker.x;
                                        
attacker.py attacker.y;
                                        
attacker.x;
                                        
attacker.y;
                                        
attacker.owner.sendscreen(susetrue);
                                        
attacker.owner.screen.reload(suse);
                                        break;
                                    }
                                
#endregion
                                #region cracking swipe
                                
case 12170:
                                Case 
12160:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
fan sector = new fan(attacker.xattacker.yxyspell.rangespell.sector);
                                            if (
kernel.getdistance(attacker.xattacker.yxy) <= spell.distance 1)
                                            {
                                                foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                                {
                                                    if (
_obj == null) continue;
                                                    if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        
attacked _obj as player;
                                                        if (
sector.isinfan(attacked.xattacked.y))
                                                        {
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            {
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage calculate.melee(attackerattackedref attackspell);
                                                                if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.king)
                                                                {
                                                                    
damage = (uint)(damage 0.6);
                                                                }
                                                                if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.prince)
                                                                {
                                                                    
damage = (uint)(damage 0.6);
                                                                }
                                                                if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.duke)
                                                                {
                                                                    
damage = (uint)(damage 0.6);
                                                                }
                                                                if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.earl)
                                                                {
                                                                    
damage = (uint)(damage 0.6);
                                                                }
                                                                
suse.effect attack.effect;
                                                                
receiveattack(attackerattackedattackref damagespell);
                                                                
suse.addtarget(attacked.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                    {
                                                        
attackedsob _obj as msgnpcinfoex;
                                                        if (
sector.isinfan(attackedsob.xattackedsob.y))
                                                        {
                                                            if (
canattack(attackerattackedsobspell))
                                                            {
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage calculate.melee(attackerattackedsobref attack);
                                                                
suse.effect attack.effect;
                                                                
receiveattack(attackerattackedsobattackdamagespell);
                                                                
suse.addtarget(attackedsob.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.attackpacket null;
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region dragon punch
                                
case 12240:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
inlinealgorithm ila = new inlinealgorithm(attacker.xxattacker.yy, (byte)spell.rangeinlinealgorithm.algorithm.dda);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spellid;
                                            
suse.spelllevel attacker.owner.spells[spellid].level;
                                            
suse.x;
                                            
suse.y;
                                            foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                            {
                                                if (
_obj == null) continue;
                                                if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                {
                                                    
attacked _obj as player;
                                                    if (
ila.inline(attacked.xattacked.y))
                                                    {
                                                        if (!
canattack(attackerattackedspellattack.interacttype == msginteract.melee)) continue;
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.melee(attackerattackedref attackspell);
                                                        
suse.effect attack.effect;
                                                        
receiveattack(attackerattackedattackref damagespell);
                                                        
suse.addtarget(attacked.uiddamageattack);
                                                    }
                                                }
                                                else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                {
                                                    
attackedsob _obj as msgnpcinfoex;
                                                    if (
canattack(attackerattackedsobspell))
                                                    {
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.melee(attackerattackedsobref attack);
                                                        
suse.effect attack.effect;
                                                        
receiveattack(attackerattackedsobattackdamagespell);
                                                        
suse.addtarget(attackedsob.uiddamageattack);
                                                    }
                                                }
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region dragonfury
                                
case 12300:
                                    {
                                        if (
attacked != null)
                                        {
                                            if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.distance)
                                            {
                                                if (
canusespell(spellattacker.owner))
                                                {
                                                    
preparespell(spellattacker.owner);
                                                    
msgmagiceffect suse = new msgmagiceffect(true);
                                                    
suse.attacker attacker.uid;
                                                    
suse.spellid spell.id;
                                                    
suse.spelllevel spell.level;
                                                    
suse.x;
                                                    
suse.y;
                                                    if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                    {
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage calculate.melee(attackerattackedref attackspell);
                                                        
suse.effect attack.effect;
                                                        
receiveattack(attackerattackedattackref damagespell);
                                                        
suse.addtarget(attacked.uiddamageattack);
                                                        
attacker.owner.player.iseagleeyeshooted true;
                                                        if (
attacked.playerflag == playerflag.player)
                                                            
attacked.owner.sendscreen(susetrue);
                                                        else 
attacked.monsterinfo.sendscreen(suse);
                                                        if (
attacked.playerflag == playerflag.player)
                                                        {
                                                            
int potdifference attacker.battlepower attacked.battlepower;
                                                            
int rate spell.percent potdifference 20;
                                                            if (
kernel.rate(rate))
                                                            {
                                                                
attacked.addflag3((ulong)msgupdate.flags3.dragonfury);
                                                                
attacked.dragonfurystamp time32.now;
                                                                
attacked.dragonfurytime spell.duration;
                                                                
msgupdate upgrade = new msgupdate(true);
                                                                
upgrade.uid attacked.uid;
                                                                
upgrade.append((byte)msgupdate.datatype.dragonfury, (uint)spell.status, (uint)spell.durationspell.powerspell.level);
                                                                
attacker.owner.send(upgrade.toarray());
                                                                if (
attacked.playerflag == playerflag.player)
                                                                    
attacked.owner.send(upgrade);
                                                                else 
attacked.monsterinfo.sendscreen(upgrade);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region dragonswing
                                
case 12200:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect msgmagiceffect = new msgmagiceffect(true);
                                            
msgmagiceffect.attacker attacker.uid;
                                            
msgmagiceffect.spellid spell.id;
                                            
msgmagiceffect.spelllevel spell.level;
                                            
msgmagiceffect.x;
                                            
msgmagiceffect.y;
                                            
attacker.owner.sendscreen(msgmagiceffecttrue);
                                            if (!
attacker.containsflag3((ulong)msgupdate.flags3.dragonswing))
                                            {
                                                
attacker.addflag3((ulong)msgupdate.flags3.dragonswing);
                                                
msgupdate upgrade = new msgupdate(true);
                                                
upgrade.uid attacker.uid;
                                                
upgrade.append((byte)msgupdate.datatype.dragonswing1100000000);
                                                
attacker.owner.send(upgrade.toarray());
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region new tao
                                #region auroralotus
                                
case 12370:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            if (!
attacker.containsflag3((ulong)msgupdate.flags3.auroralotus)) return;
                                            var 
map attacker.owner.map;
                                            if (!
map.floor[xymapobjecttype.itemnull]) return;
                                            
preparespell(spellattacker.owner);

                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.attacker1 attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.addtarget(attacker.uid0null);
                                            
attacker.owner.sendscreen(susetrue);

                                            
msgmapitem flooritem = new msgmapitem(true);
                                            
flooritem.itemid msgmapitem.auroralotus;
                                            
flooritem.mapid attacker.mapid;
                                            
flooritem.type msgmapitem.effect;
                                            
flooritem.x;
                                            
flooritem.y;
                                            
flooritem.onfloor time32.now;
                                            
flooritem.owner attacker.owner;
                                            
flooritem.uid msgmapitem.flooruid.next;
                                            while (
map.flooritems.containskey(flooritem.uid))
                                                
flooritem.uid msgmapitem.flooruid.next;

                                            
flooritem.maxlife 25;
                                            
flooritem.life 25;
                                            
flooritem.mcolor 13;
                                            
flooritem.owneruid attacker.uid;
                                            
flooritem.ownerguilduid attacker.guildid;
                                            
flooritem.flowertype 0;
                                            
flooritem.time kernel.tqtimer(datetime.now.addseconds(7));
                                            
flooritem.name "auroralotus";
                                            
map.addflooritem(flooritem);
                                            
attacker.owner.sendscreenspawn(flooritemtrue);
                                            
attacker.auroralotusenergy 0;
                                            
attacker.lotus(attacker.auroralotusenergy, (byte)msgupdate.datatype.auroralotus);
                                            
attacker.attackpacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #region flamelotus
                                
case 12380:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            if (!
attacker.containsflag3((ulong)msgupdate.flags3.flamelotus)) return;
                                            var 
map attacker.owner.map;
                                            if (!
map.floor[xymapobjecttype.itemnull]) return;
                                            
preparespell(spellattacker.owner);

                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.attacker1 attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.addtarget(attacker.uid0null);
                                            
attacker.owner.sendscreen(susetrue);

                                            
msgmapitem flooritem = new msgmapitem(true);
                                            
flooritem.itemid msgmapitem.flamelotus;
                                            
flooritem.mapid attacker.mapid;
                                            
flooritem.type msgmapitem.effect;
                                            
flooritem.x;
                                            
flooritem.y;
                                            
flooritem.onfloor time32.now;
                                            
flooritem.owner attacker.owner;
                                            
flooritem.uid msgmapitem.flooruid.next;
                                            while (
map.flooritems.containskey(flooritem.uid))
                                                
flooritem.uid msgmapitem.flooruid.next;

                                            
flooritem.maxlife 25;
                                            
flooritem.life 25;
                                            
flooritem.mcolor 13;
                                            
flooritem.owneruid attacker.uid;
                                            
flooritem.ownerguilduid attacker.guildid;
                                            
flooritem.flowertype 0;
                                            
flooritem.time kernel.tqtimer(datetime.now.addseconds(7));
                                            
flooritem.name "flamelotus";
                                            
map.addflooritem(flooritem);
                                            
attacker.owner.sendscreenspawn(flooritemtrue);
                                            
attacker.flamelotusenergy 0;
                                            
attacker.lotus(attacker.flamelotusenergy, (byte)msgupdate.datatype.flamelotus);
                                            
attacker.attackpacket null;
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                #region new monk
                                #region upsweep
                                
case 12580://up                               
                                    
{
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);

                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            if (
attacked == null)
                                                return;
                                            var 
angle kernel.getangle(attacker.xattacker.yattacked.xattacked.y);
                                            
map.updatecoordonatesforangle(ref xref yangle);

                                            
fan sector = new fan(attacker.xattacker.yxyspell.rangespell.sector);

                                            foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
kernel.getdistance(attacker.xattacker.y_obj.x_obj.y) <= 7)
                                                {
                                                    if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        
attacked _obj as player;

                                                        if (
sector.isinfan(attacked.xattacked.y))
                                                        {
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            {
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage game.attacking.calculate.melee(attackerattackedref attack);
                                                                
damage = (uint)(damage 0.5);
                                                                
suse.effect attack.effect;
                                                                
receiveattack(attackerattackedattackref damagespell);
                                                                
suse.addtarget(attacked.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                    {
                                                        
attackedsob _obj as msgnpcinfoex;

                                                        if (
sector.isinfan(attackedsob.xattackedsob.y))
                                                        {
                                                            if (
canattack(attackerattackedsobspell))
                                                            {
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage game.attacking.calculate.melee(attackerattackedsobref attack);
                                                                
receiveattack(attackerattackedsobattackdamagespell);

                                                                
suse.addtarget(attackedsob.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }

                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region downsweep
                                
case 12590://down                                                          
                                    
{
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);

                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            if (
attacked == null)
                                                return;
                                            var 
angle kernel.getangle(attacker.xattacker.yattacked.xattacked.y);
                                            
angle enums.oppositeangle(angle);
                                            
map.updatecoordonatesforangle(ref xref yangle);

                                            
fan sector = new fan(attacker.xattacker.yxyspell.rangespell.sector);

                                            foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                            {
                                                if (
_obj == null)
                                                    continue;
                                                if (
kernel.getdistance(attacker.xattacker.y_obj.x_obj.y) <= 7)
                                                {
                                                    if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        
attacked _obj as player;

                                                        if (
sector.isinfan(attacked.xattacked.y))
                                                        {
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            {
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage game.attacking.calculate.melee(attackerattackedref attack);
                                                                
damage = (uint)(damage 0.5);
                                                                
suse.effect attack.effect;
                                                                
receiveattack(attackerattackedattackref damagespell);
                                                                
suse.addtarget(attacked.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                    {
                                                        
attackedsob _obj as msgnpcinfoex;

                                                        if (
sector.isinfan(attackedsob.xattackedsob.y))
                                                        {
                                                            if (
canattack(attackerattackedsobspell))
                                                            {
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage game.attacking.calculate.melee(attackerattackedsobref attack);
                                                                
receiveattack(attackerattackedsobattackdamagespell);

                                                                
suse.addtarget(attackedsob.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }

                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region strike
                                
case 12600:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);

                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;

                                            if (
kernel.getdistance(attacker.xattacker.yxy) <= attacker.attackrange 1)
                                            {
                                                if (
attackedsob != null)
                                                {
                                                    if (
canattack(attackerattackedsobspell))
                                                    {
                                                        
preparespell(spellattacker.owner);
                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage game.attacking.calculate.melee(attackerattackedsobref attack);
                                                        
receiveattack(attackerattackedsobattackdamagespell);

                                                        
suse.addtarget(attackedsob.uiddamageattack);
                                                    }
                                                }
                                                else
                                                {
                                                    if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                    {
                                                        
preparespell(spellattacker.owner);

                                                        
attack.effect msginteract.interacteffects.none;
                                                        
uint damage game.attacking.calculate.melee(attackerattackedref attack);
                                                        
damage = (uint)(damage 0.5);
                                                        
suse.effect attack.effect;

                                                        
receiveattack(attackerattackedattackref damagespell);

                                                        
suse.addtarget(attacked.uiddamageattack);
                                                    }
                                                }
                                                
attacker.attackpacket null;
                                            }
                                            else
                                            {
                                                
attacker.attackpacket null;
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        
attacker.attackpacket null;
                                        break;
                                    }
                                
#endregion
                                #region wrathofemperor
                                
case 12570:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);

                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.attacker1 attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.specialeffect 1;

                                            
suse.x;
                                            
suse.y;


                                            if (
kernel.getdistance(attacker.xattacker.yxy) <= spell.range)
                                            {
                                                foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                                {
                                                    if (
_obj == null)
                                                        continue;
                                                    if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        
attacked _obj as player;
                                                        if (
kernel.getdistance(attacker.xattacker.yattacked.xattacked.y) <= spell.range)
                                                        {
                                                            if (
attacked.containsflag((ulong)msgupdate.flags.fly))
                                                                return;
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            {
                                                                
preparespell(spellattacker.owner);

                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage game.attacking.calculate.melee(attackerattackedref attack);
                                                                
suse.effect attack.effect;

                                                                
receiveattack(attackerattackedattackref damagespell);

                                                                
suse.addtarget(attacked.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                    {
                                                        
attackedsob _obj as msgnpcinfoex;
                                                        if (
kernel.getdistance(attacker.xattacker.yattackedsob.xattackedsob.y) <= spell.range)
                                                        {
                                                            if (
canattack(attackerattackedsobspell))
                                                            {
                                                                
preparespell(spellattacker.owner);
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage game.attacking.calculate.melee(attackerattackedsobref attack);
                                                                
receiveattack(attackerattackedsobattackdamagespell);

                                                                
suse.addtarget(attackedsob.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.attackpacket null;
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region graceofheaven
                                
case 12560:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);

                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
spellid 10425;
                                            
suse.spellid spellid;
                                            
suse.spelllevel attacker.owner.spells[spellid].level;
                                            
suse.x;
                                            
suse.y;
                                            
attacker.attackpacket null;
                                            if (
attacker.owner.team != null)
                                            {

                                                foreach (
client.gamestate teammate in attacker.owner.team.teammates)
                                                {
                                                    
// if (kernel.getdistance(attacker.x, attacker.y, teammate.player.x, teammate.player.y) <= spell.range)
                                                    
{
                                                        if (
teammate.player.containsflag2((ulong)msgupdate.flags2.soulshackle))
                                                        {
                                                            
teammate.player.removeflag2((ulong)msgupdate.flags2.soulshackle);

                                                            
suse.addtarget(teammate.player.uid0attack);

                                                            
msgupdate upgrade = new msgupdate(true);
                                                            
upgrade.uid teammate.player.uid;
                                                            
upgrade.append((byte)msgupdate.datatype.soulshackle
                                                                
111
                                                                
00spell.level);
                                                            if (
teammate.player.playerflag == playerflag.player)
                                                                
teammate.player.owner.send(upgrade.toarray());
                                                        }
                                                    }
                                                }
                                                
attacker.owner.sendscreen(susetrue);

                                            }

                                            {
                                                
suse.addtarget(attacked.uid0attack);

                                                
attacked.toxicfogleft 0;
                                                
attacked.removeflag2((ulong)msgupdate.flags2.soulshackle);

                                                
msgupdate upgrade = new msgupdate(true);
                                                
upgrade.uid attacked.uid;
                                                
upgrade.append((byte)msgupdate.datatype.soulshackle
                                                    
111
                                                    
00spell.level);
                                                if (
attacked.playerflag == playerflag.player)
                                                    
attacked.owner.send(upgrade.toarray());

                                                
attacked.toxicfogleft 0;
                                                
attacked.scurbybomb 0;
                                                
attacked.nodrugstime 0;
                                                
attacked.dragonfurytime 0;
                                                
attacked.flamelayerleft 0;
                                                
//attacked.owner.send(new gamecharacterupdates(true) { uid = attacked.uid, }
                                                //            .remove(gamecharacterupdates.soulshacle));

                                                
attacked.nodrugstime 0;
                                                if (
attacked.playerflag == playerflag.player)
                                                    
attacked.owner.sendscreen(susetrue);
                                                else
                                                    
attacker.owner.sendscreen(susetrue);
                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #region infroecho
                                
case 12550:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            if (!
attacker.epicmonk())
                                                return;

                                            var 
map attacker.owner.map;
                                            if (!
map.floor[xymapobjecttype.itemnull]) return;
                                            
preparespell(spellattacker.owner);

                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.attacker1 attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.specialeffect 0;
                                            
suse.addtarget(attacker.uid0null);
                                            
attacker.owner.sendscreen(susetrue);

                                            var 
count 3;
                                            if (
spell.level == 6)
                                                
count 4;
                                            list<
system.drawing.pointdestructionareas = new list<system.drawing.point>();
                                            for (
int i 0360+= spell.sector)
                                            {
                                                if (
destructionareas.count >= count)
                                                    break;
                                                
// var dist = kernel.random.next(4);
                                                
var dist kernel.random.next(spell.rangespell.distance);
                                                
//  var angle = kernel.random.next(90);
                                                
var angle i;
                                                
ushort x = (ushort)(+ (dist math.cos(angle)));
                                                
ushort y = (ushort)(+ (dist math.sin(angle)));
                                                
system.drawing.point p = new system.drawing.point((int)x, (int)y);
                                                if (!
destructionareas.contains(p))
                                                    
destructionareas.add(p);
                                                else
                                                    
i--;
                                            }
                                            foreach (var 
area in destructionareas)
                                            {
                                                
= (ushort)area.x;
                                                
= (ushort)area.y;
                                                
msgmapitem flooritem = new msgmapitem(true);
                                                
flooritem.itemid msgmapitem.infroecho;// (uint)(1390 + spell.level);
                                                
flooritem.mapid attacker.mapid;
                                                
flooritem.mcolor 14;
                                                
flooritem.itemcolor = (enums.color.black);
                                                
flooritem.type msgmapitem.effect;
                                                
flooritem.owneruid attacker.uid;
                                                
flooritem.ownerguilduid attacker.guildid;
                                                
flooritem.flowertype 1;
                                                
flooritem.x;
                                                
flooritem.y;
                                                
flooritem.onfloor time32.now;
                                                
flooritem.owner attacker.owner;

                                                
flooritem.name "trap";
                                                while (
map.flooritems.containskey(flooritem.uid))
                                                    
flooritem.uid mr.hamooo.network.gamepackets.msgmapitem.flooruid.next;
                                                
map.addflooritem(flooritem);
                                                
attacker.owner.sendscreenspawn(flooritemtrue);

                                            }
                                        }
                                        break;
                                    }
                                
#endregion
                                #endregion
                                //ahmed nemo 01128547851
                                #region epicwarrior
                                #region maniacdance
                                
case 12700:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);

                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
attacker.addflag3((ulong)1ul << 53);
                                            
attacker.maniacdance time32.now;
                                            
attacker.removeflag((ulong)msgupdate.flags.ride);
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region waveofblood
                                
case 12690:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(true);
                                            
suse.attacker attacker.uid;
                                            
suse.spellid spell.id;
                                            
suse.spelllevel spell.level;
                                            
suse.x;
                                            
suse.y;
                                            
fan sector = new fan(attacker.xattacker.yxyspell.rangespell.sector);
                                            if (
kernel.getdistance(attacker.xattacker.yxy) <= spell.distance 1)
                                            {
                                                foreach (
interfaces.imapobject _obj in attacker.owner.screen.objects)
                                                {
                                                    if (
_obj == null)
                                                        continue;
                                                    if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        
attacked _obj as player;

                                                        if (
sector.isinfan(attacked.xattacked.y))
                                                        {
                                                            if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                            {
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage game.attacking.calculate.melee(attackerattackedref attackspell);
                                                                if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.king)
                                                                    if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.king)
                                                                    {
                                                                        
damage = (uint)(damage 0.4);
                                                                    }
                                                                if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.prince)
                                                                {
                                                                    
damage = (uint)(damage 0.4);
                                                                }
                                                                if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.duke)
                                                                {
                                                                    
damage = (uint)(damage 0.4);
                                                                }
                                                                if (
attacker.nobilityrank == game.conquerstructures.nobilityrank.earl)
                                                                {
                                                                    
damage = (uint)(damage 0.4);
                                                                }
                                                                
suse.effect attack.effect;
                                                                
receiveattack(attackerattackedattackref damagespell);
                                                                
suse.addtarget(attacked.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                    {
                                                        
attackedsob _obj as msgnpcinfoex;
                                                        if (
sector.isinfan(attackedsob.xattackedsob.y))
                                                        {
                                                            if (
canattack(attackerattackedsobspell))
                                                            {
                                                                
attack.effect msginteract.interacteffects.none;
                                                                
uint damage calculate.melee(attackerattackedsobref attack);
                                                                
damage = (uint)(damage 0.9);
                                                                
receiveattack(attackerattackedsobattackdamagespell);
                                                                
suse.addtarget(attackedsob.uiddamageattack);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                
attacker.attackpacket null;
                                            }
                                            
attacker.owner.sendscreen(susetrue);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region pounce
                                
case 12770:
                                    {
                                        if (
canusespell(spellattacker.owner))
                                        {
                                            
preparespell(spellattacker.owner);
                                            
msgmagiceffect suse = new msgmagiceffect(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;
                                            
uint16 oxoy;
                                            
ox attacker.x;
                                            
oy attacker.y;
                                            
byte dist = (byte)spell.distance;
                                            var array = 
attacker.owner.screen.objects;
                                            
inlinealgorithm algo = new inlinealgorithm(attacker.xxattacker.yydist,
                                                                               
inlinealgorithm.algorithm.dda);
                                            
attacker.x;
                                            
attacker.y;
                                            
int i 0;
                                            for (
0algo.lcoords.counti++)
                                            {
                                                if (
attacker.owner.map.floor[algo.lcoords[i].xalgo.lcoords[i].ymapobjecttype.player]
                                                    && !
attacker.throughgate(algo.lcoords[i].xalgo.lcoords[i].y))
                                                {
                                                    
= (ushort)algo.lcoords[i].x;
                                                    
= (ushort)algo.lcoords[i].y;
                                                }
                                                else
                                                {
                                                    break;
                                                }
                                            }
                                            
suse.x;
                                            
suse.y;
                                            if (!
attacker.owner.map.floor[xymapobjecttype.playernull])
                                                return;
                                            
double disth 1.5;
                                            
//if (attacker.mapid == deathmatch.mapid) disth = 1;
                                            
foreach (interfaces.imapobject _obj in array)
                                            {
                                                
bool hit false;
                                                for (
int j 0ij++)
                                                    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 player;
                                                        if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                        {
                                                            var 
damage game.attacking.calculate.melee(attackerattackedref attackspell);
                                                            
damage = (uint)(damage 1.1);
                                                            
receiveattack(attackerattackedattackref damagespell);

                                                            
suse.addtarget(attacked.uiddamageattack);
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.player)
                                                    {
                                                        
attacked _obj as player;
                                                        if (
canattack(attackerattackedspellattack.interacttype == msginteract.melee))
                                                        {
                                                            var 
damage game.attacking.calculate.melee(attackerattackedref attack);
                                                            
damage = (uint)(damage 1.0);
                                                            
receiveattack(attackerattackedattackref damagespell);

                                                            
suse.addtarget(attacked.uiddamageattack);
                                                        }
                                                    }
                                                    else if (
_obj.mapobjtype == mapobjecttype.sobnpc)
                                                    {
                                                        
attackedsob _obj as msgnpcinfoex;
                                                        if (
canattack(attackerattackedsobspell))
                                                        {
                                                            var 
damage game.attacking.calculate.melee(attackerattackedsobref attack);

                                                            
receiveattack(attackerattackedsobattackdamagespell);

                                                            
suse.addtarget(attackedsob.uiddamageattack);
                                                        }
                                                    }
                                                }
                                            }
                                            
attacker.px attacker.x;
                                            
attacker.py attacker.y;
                                            
attacker.x;
                                            
attacker.y;
                                            
attacker.owner.sendscreen(susetrue);
                                            
attacker.owner.screen.reload(suse);
                                        }
                                        break;
                                    }
                                
#endregion
                                #region backfire
                                
case 12680:
                                    {
                                        
msgmagiceffect msgmagiceffect = new msgmagiceffect(true);
                                        
msgmagiceffect.attacker attacker.uid;
                                        
msgmagiceffect.attacker1 attacker.uid;
                                        
msgmagiceffect.spellid spell.id;
                                        
msgmagiceffect.spelllevel spell.level;
                                        
msgmagiceffect.x;
                                        
msgmagiceffect.y;
                                        
msgmagiceffect.addtarget(attacker.uid1attack);
                                        
attacker.owner.sendscreen(msgmagiceffecttrue);
                                        if (
attacker.containsflag3((ulong)1ul << 51))
                                            
attacker.removeflag3((ulong)1ul << 51);
                                        else
                                            
attacker.addflag3((ulong)1ul << 51);
                                        
attacker.backfirestamp time32.now;
                                        break;
                                    }
                                
#endregion
                                #endregion
                                
default:
                                    {
                                        if (
attacker.owner.account.state == accounttable.accountstate.administrator)
                                            
attacker.owner.send("unknown spell id: " spellid);
                                        break;
                                    }
                            }
                            
attacker.owner.increasespellexperience(experiencespellid);
                            if (
attacker.mapid == 1039)
                            {
                                if (
spell.id == 7001 || spell.id == 9876)
                                {
                                    
attacker.attackpacket null;
                                    return;
                                }
                                if (
attacker.attackpacket != null)
                                {
                                    
attack.damage spell.id;
                                    
attacker.attackpacket attack;
                                    var 
xspell getweaponspell(spell);
                                    if (
xspell != null)
                                    {
                                        if (
attacker.attackpacket == null)
                                        {
                                            
attack.interacttype msginteract.melee;
                                            
attacker.attackpacket attack;
                                        }
                                        else
                                        {
                                            
attacker.attackpacket.interacttype msginteract.melee;
                                        }
                                    }
                                }
                            }
                            else
                            {
                                if (
spell.nextspellid != 0)
                                {
                                    if (
spell.nextspellid >= 1000 && spell.nextspellid <= 1002)
                                        if (
target >= 1000000)
                                        {
                                            
attacker.attackpacket null;
                                            return;
                                        }
                                    
attack.damage spell.nextspellid;
                                    
attacker.attackpacket attack;
                                }
                                else
                                {
                                    var 
xspell getweaponspell(spell);
                                    if (
xspell == null || spell.id == 9876)
                                        
attacker.attackpacket null;
                                    else
                                    {
                                        if (
attacker.attackpacket == null)
                                        {
                                            
attack.interacttype msginteract.melee;
                                            
attacker.attackpacket attack;
                                        }
                                        else
                                        {
                                            
attacker.attackpacket.interacttype msginteract.melee;
                                        }
                                    }
                                }
                            }
                        }
                        else
                        {
                            
attacker.attackpacket null;
                        }
                    }
                    
#endregion
                
}
                
#endregion
            
}
            
#endregion
        
}
        public static 
bool isarcherskill(uint id)
        {
            if (
id >= 8000 && id <= 9875)
                return 
true;
            return 
false;
        }
        public static 
void quitsteedrace(player attacker)
        {
            
attacker.owner.messagebox("do you want to quit the steed race?", (pclient) =>
            {
                
pclient.player.teleport(1002301279);
                
pclient.player.removeflag((ulong)msgupdate.flags.ride);
            });
        }
        public 
handle(msginteract attackplayer attackerplayer attacked)
        {
            
this.attack attack;
            
this.attacker attacker;
            
this.attacked attacked;
            
this.execute();
        }
        public static list<
ushortgetweaponspell(spellinformation spell)
        {
            return 
spelltable.weaponspells.values.where(=> p.contains(spell.id)).firstordefault();
        }
        public static 
void flamelotus(msgmapitem itemint count 0)
        {
            var 
client item.owner;
            if (!
client.spells.containskey(12380)) return;
            var 
spell spelltable.getspell(client.spells[12380].idclient.spells[12380].level);
            if (
count == 0)
            {
                switch (
spell.level)
                {
                    case 
0Count 5; break;
                    case 
1Count 8; break;
                    case 
2Count 11; break;
                    case 
3Count 14; break;
                    case 
4Count 17; break;
                    case 
5Count 20; break;
                    case 
6Count 25; break;
                }
            }
            var 
targets playerinrange(itemspell.range).toarray();
            
targets targets.where(=> canattack(client.playerp.playernulltrue)).toarray();
            
targets targets.take(count).toarray();
            var 
attack = new msginteract(true);
            
attack.attacker item.owner.player.uid;
            
attack.interacttype msginteract.melee;
            foreach (var 
target in targets)
            {
                
uint damage calculate.magic(client.playertarget.playerspellref attack);
                if (
client.spells.containskey(1002))
                {
                    var 
spell2 spelltable.getspell(client.spells[1002].idclient.spells[1002].level);
                    
damage game.attacking.calculate.magic(client.playertarget.playerspell2ref attack);
                }
                
attack.damage damage;
                
attack.attacked target.player.uid;
                
attack.target.player.x;
                
attack.target.player.y;
                
receiveattack(client.playertarget.playerattackref damagespell);
                
client.player.attackpacket null;
            }
        }
        public static 
void auroralotus(msgmapitem itemint count 0)
        {
            var 
client item.owner;
            if (!
client.spells.containskey(12370)) return;
            var 
spell spelltable.getspell(client.spells[12370].idclient.spells[12370].level);
            if (
count == 0)
            {
                switch (
spell.level)
                {
                    case 
0Count 5; break;
                    case 
1Count 8; break;
                    case 
2Count 11; break;
                    case 
3Count 14; break;
                    case 
4Count 17; break;
                    case 
5Count 20; break;
                    case 
6Count 25; break;
                }
            }
            var 
deads playerinrange(itemspell.range).where(=> p.player.dead).toarray();
            if (
client.team != null)
                
deads deads.where(=> client.team.contain(p.player.uid)).toarray();
            else if (
client.guild != null)
                if (
client.guild.members != null && client.guild.ally != null)
                    
deads deads.where(=> client.guild.members.containskey(p.player.uid) || client.guild.ally.containskey(p.player.guildid)).toarray();
                else
                    
deads deads.where(=> client.guild.id == p.player.guildid).toarray();
            
deads deads.take(count).toarray();
            if (
deads != null)
            {
                foreach (var 
player in deads)
                {
                    
player.player.action enums.conqueraction.none;
                    
player.revivestamp time32.now;
                    
player.attackable false;
                    
player.player.transformationid 0;
                    
player.player.removeflag((ulong)msgupdate.flags.dead);
                    
player.player.removeflag((ulong)msgupdate.flags.ghost);
                    
player.player.hitpoints player.player.maxhitpoints;
                    
player.player.ressurect();
                    
player.blesstouch(client);
                }
            }
        }
        public static 
void infroecho(msgmapitem itemint count 0)
        {
            var 
client item.owner;
            var 
item.x;
            var 
item.y;
            if (!
client.spells.containskey(12550))
                return;
            var 
spell spelltable.getspell(client.spells[12550].idclient.spells[12550].level);

            var 
attack = new msginteract(true);
            
attack.attacker client.player.uid;
            
attack.x;
            
attack.y;
            
attack.damage spell.id;
            
attack.interacttype msginteract.magic;


            
msgmagiceffect suse = new msgmagiceffect(true);
            
suse.attacker client.player.uid;
            
suse.spellid spell.id;
            
suse.spelllevel spell.level;
            
suse.x;
            
suse.y;
            
suse.specialeffect 1;
            foreach (var 
c in client.screen.objects)
            {

                
interfaces.imapobject _obj as player;
                if (
_obj == null)
                    continue;
                if (
_obj.mapobjtype == mapobjecttype.monster || _obj.mapobjtype == mapobjecttype.player)
                {
                    var 
attacked _obj as player;
                    if (
kernel.getdistance(xyattacked.xattacked.y) <= spell.range)
                    {
                        if (
canattack(client.playerattackedspellattack.interacttype == msginteract.ranged))
                        {
                            
uint damage game.attacking.calculate.melee(client.playerattackedref attack);
                            
damage = (uint)(damage 0.2);
                            
suse.effect attack.effect;
                            
receiveattack(client.playerattackedattackref damagespell);
                            
attacked.stunned true;
                            
attacked.stunstamp time32.now;
                            
suse.addtarget(attacked.uiddamageattack);

                        }
                    }
                }
            }
            
client.player.attackpacket null;
            
client.sendscreen(susetrue);
        }
        public static 
void handleauramonk(player attackerspellinformation spell)
        {
            
ulong statusflag 0statusflag2 0;
            
enums.auratype aura enums.auratype.tyrantaura;
            switch (
spell.id)
            {
                case 
10424Statusflag = (ulong)msgupdate.flags2.earthaura; break;
                case 
10423Statusflag = (ulong)msgupdate.flags2.fireaura; break;
                case 
10422Statusflag = (ulong)msgupdate.flags2.wateraura; break;
                case 
10421Statusflag = (ulong)msgupdate.flags2.woodaura; break;
                case 
10420Statusflag = (ulong)msgupdate.flags2.metalaura; break;
                case 
10410Statusflag = (ulong)msgupdate.flags2.fendaura; break;
                case 
10395Statusflag = (ulong)msgupdate.flags2.tyrantaura; break;
            }
            switch (
spell.id)
            {
                case 
10424Statusflag2 = (ulong)msgupdate.flags2.earthauraicon; break;
                case 
10423Statusflag2 = (ulong)msgupdate.flags2.fireauraicon; break;
                case 
10422Statusflag2 = (ulong)msgupdate.flags2.waterauraicon; break;
                case 
10421Statusflag2 = (ulong)msgupdate.flags2.woodauraicon; break;
                case 
10420Statusflag2 = (ulong)msgupdate.flags2.metalauraicon; break;
                case 
10410Statusflag2 = (ulong)msgupdate.flags2.fendauraicon; break;
                case 
10395Statusflag2 = (ulong)msgupdate.flags2.tyrantauraicon; break;
            }
            if (
attacker.dead) return;
            if (
attacker.aura_isactive)
            {
                switch (
attacker.aura_acttype)
                {
                    case 
10424Aura enums.auratype.earthaura; break;
                    case 
10423Aura enums.auratype.fireaura; break;
                    case 
10422Aura enums.auratype.wateraura; break;
                    case 
10421Aura enums.auratype.woodaura; break;
                    case 
10420Aura enums.auratype.metalaura; break;
                    case 
10410Aura enums.auratype.fendaura; break;
                    case 
10395Aura enums.auratype.tyrantaura; break;
                }
                new 
msgupdate(true).aura(attackerenums.auradatatypes.removeauraspell);
                
attacker.removeflag2(attacker.aura_acttype);
                
attacker.removeflag2(attacker.aura_acttype2);
                
attacker.owner.removeaurabonuses(attacker.aura_acttypeattacker.aura_actpower1);
                
attacker.aura_isactive false;
                if (
statusflag == attacker.aura_acttype)
                {
                    
attacker.aura_acttype 0;
                    
attacker.aura_acttype2 0;
                    
attacker.aura_actpower 0;
                    
attacker.aura_actlevel 0;
                    return;
                }
            }
            if (
canusespell(spellattacker.owner))
            {
                if (
statusflag != 0)
                {
                    switch (
attacker.aura_acttype)
                    {
                        case 
10424Aura enums.auratype.earthaura; break;
                        case 
10423Aura enums.auratype.fireaura; break;
                        case 
10422Aura enums.auratype.wateraura; break;
                        case 
10421Aura enums.auratype.woodaura; break;
                        case 
10420Aura enums.auratype.metalaura; break;
                        case 
10410Aura enums.auratype.fendaura; break;
                        case 
10395Aura enums.auratype.tyrantaura; break;
                    }
                    new 
msgupdate(true).aura(attackerenums.auradatatypes.removeauraspell);
                    
attacker.removeflag2(attacker.aura_acttype);
                    
attacker.removeflag2(attacker.aura_acttype2);
                    
attacker.owner.removeaurabonuses(attacker.aura_acttypeattacker.aura_actpower1);
                    
attacker.aura_isactive false;
                    if (
statusflag == attacker.aura_acttype)
                    {
                        
attacker.aura_acttype2 0;
                        
attacker.aura_acttype 0;
                        
attacker.aura_actpower 0;
                        
attacker.aura_actlevel 0;
                    }
                }
                if (
spell.power == 0)
                    
spell.power 45;
                
preparespell(spellattacker.owner);
                
msgmagiceffect suse = new msgmagiceffect(true);
                
suse.attacker attacker.uid;
                
suse.spellid spell.id;
                
suse.spelllevel spell.level;
                
suse.attacker.x;
                
suse.attacker.y;
                
suse.addtarget(attacker.uid0null);
                
attacker.owner.sendscreen(susetrue);
                
attacker.addflag2(statusflag);
                
attacker.addflag2(statusflag2);
                
attacker.aura_isactive true;
                
attacker.aura_acttype statusflag;
                
attacker.aura_acttype2 statusflag2;
                
attacker.aura_actpower spell.power;
                
attacker.aura_actlevel spell.level;
                
attacker.owner.doaurabonuses(statusflagspell.power1);
                switch (
spell.id)
                {
                    case 
10424Aura enums.auratype.earthaura; break;
                    case 
10423Aura enums.auratype.fireaura; break;
                    case 
10422Aura enums.auratype.wateraura; break;
                    case 
10421Aura enums.auratype.woodaura; break;
                    case 
10420Aura enums.auratype.metalaura; break;
                    case 
10410Aura enums.auratype.fendaura; break;
                    case 
10395Aura enums.auratype.tyrantaura; break;
                }
                new 
msgupdate(true).aura(attackerenums.auradatatypes.addauraspell);
            }
        }

        public static 
void lotusattack(msgmapitem itemplayer attackermsginteract attack)
        {
            
//console.writeline("for test");
        
}
        public static list<
imapobjectgetobjects(uint16 oxuint16 oyclient.gamestate c)
        {
            
uint16 xy;
            
c.player.x;
            
c.player.y;
            var list = new list<
imapobject>();
            
c.player.ox;
            
c.player.oy;
            foreach (
imapobject objects in c.screen.objects)
            {
                if (
objects != null)
                    if (
objects.uid != c.player.uid)
                        if (!list.
contains(objects))
                            list.
add(objects);
            }
            
c.player.x;
            
c.player.y;
            foreach (
imapobject objects in c.screen.objects)
            {
                if (
objects != null)
                    if (
objects.uid != c.player.uid)
                        if (!list.
contains(objects))
                            list.
add(objects);
            }
            if (list.
count 0)
                return list;
            return 
null;
        }
        public static 
ienumerable<client.gamestateplayerinrange(player attackerplayer attacked)
        {
            var 
dictionary kernel.gamepool.values.toarray();

            return 
dictionary.where((player) => player.player.mapid == attacked.mapid && kernel.getdistance(player.player.xplayer.player.yattacker.xattacker.y) <= 7);
        }
        public static 
ienumerable<client.gamestateplayerinrange(msgmapitem itemint dist)
        {
            var 
dictionary kernel.gamepool.values.toarray();
            return 
dictionary.where((player) => player.player.mapid == item.mapid && kernel.getdistance(player.player.xplayer.player.yitem.xitem.y) <= dist).orderby(player => kernel.getdistance(player.player.xplayer.player.yitem.xitem.y));
        }
        public 
player findclosesttarget(player attackerushort xushort yienumerable<interfaces.imapobject> array)
        {
            
player closest attacker;
            
int dprev 10000dist 0;
            foreach (var 
_obj in array)
            {
                if (
_obj == null) continue;
                if (
_obj.mapobjtype != mapobjecttype.player && _obj.mapobjtype != mapobjecttype.monster) continue;
                
dist kernel.getdistance(xy_obj.x_obj.y);
                if (
dist dprev)
                {
                    
dprev dist;
                    
closest = (player)_obj;
                }
            }
            return 
closest;
        }

        public static 
bool canusespell(spellinformation spellclient.gamestate client)
        {
            if (
client.player.skillteamwatchingelitepkmatch != null) return false;
            if (
client.watchingelitepkmatch != null) return false;
            if (
client.watchinggroup != null) return false;
            if (
client.teamwatchinggroup != null) return false;
            if (
spell == null) return false;
            if (
client.player.mana spell.usemana) return false;
            if (
client.player.stamina spell.usestamina) return false;
            if (
client.player.mapid == 1707)
            {
                if (
spell.id != 1045 && spell.id != 1046)
                {
                    
client.send("you can't use any skills here except fb and ss!"); return false;
                }
            }
            if (
spell.usearrows && isarcherskill(spell.id))
            {
                var 
weapons client.weapons;
                if (
weapons.item2 != null)
                    if (!
client.player.containsflag3((ulong)msgupdate.flags3.pathofshadow))
                        if (!
itemhandler.isarrow(weapons.item2.id)) return false;
                return 
true;
            }
            if (
spell.needxp == && !client.player.containsflag((ulong)msgupdate.flags.xplist)) return false;
            return 
true;
        }
        public static 
void preparespell(spellinformation spellclient.gamestate client)
        {
            if (
spell.needxp == 1)
                
client.player.removeflag((ulong)msgupdate.flags.xplist);
            if (
client.map.id != 1039)
            {
                if (
spell.usemana 0)
                    if (
client.player.mana >= spell.usemana)
                        
client.player.mana -= spell.usemana;
                if (
spell.usestamina 0)
                    if (
client.player.stamina >= spell.usestamina)
                        
client.player.stamina -= spell.usestamina;
            }
        }

        public static 
void checkforextraweaponpowers(client.gamestate clientplayer attacked)
        {
            
#region right hand
            
var weapons client.weapons;
            if (
weapons.item1 != null)
            {
                if (
weapons.item1.id != 0)
                {
                    var 
item weapons.item1;
                    if (
item.effect != enums.itemeffect.none)
                    {
                        if (
kernel.rate(30))
                        {
                            switch (
item.effect)
                            {
                                case 
enums.itemeffect.hp:
                                    {
                                        
msgmagiceffect msgmagiceffect = new msgmagiceffect(true);
                                        
msgmagiceffect.attacker 1;
                                        
msgmagiceffect.spellid 1175;
                                        
msgmagiceffect.spelllevel 4;
                                        
msgmagiceffect.client.player.x;
                                        
msgmagiceffect.client.player.y;
                                        
msgmagiceffect.addtarget(client.player.uid300null);
                                        
uint damage math.min(300client.player.maxhitpoints client.player.hitpoints);
                                        
client.player.hitpoints += damage;
                                        
client.sendscreen(msgmagiceffecttrue);
                                        break;
                                    }
                                case 
enums.itemeffect.mp:
                                    {
                                        
msgmagiceffect msgmagiceffect = new msgmagiceffect(true);
                                        
msgmagiceffect.attacker 1;
                                        
msgmagiceffect.spellid 1175;
                                        
msgmagiceffect.spelllevel 2;
                                        
msgmagiceffect.client.player.x;
                                        
msgmagiceffect.client.player.y;
                                        
msgmagiceffect.addtarget(client.player.uid300null);
                                        
ushort damage = (ushort)math.min(300client.player.maxmana client.player.mana);
                                        
client.player.mana += damage;
                                        
client.sendscreen(msgmagiceffecttrue);
                                        break;
                                    }
                                case 
enums.itemeffect.shield:
                                    {
                                        if (
client.player.containsflag((ulong)msgupdate.flags.magicshield)) return;
                                        
msgmagiceffect msgmagiceffect = new msgmagiceffect(true);
                                        
msgmagiceffect.attacker 1;
                                        
msgmagiceffect.spellid 1020;
                                        
msgmagiceffect.spelllevel 0;
                                        
msgmagiceffect.client.player.x;
                                        
msgmagiceffect.client.player.y;
                                        
msgmagiceffect.addtarget(client.player.uid120null);
                                        
client.player.shieldtime 0;
                                        
client.player.shieldstamp time32.now;
                                        
client.player.magicshieldstamp time32.now;
                                        
client.player.magicshieldtime 0;
                                        
client.player.addflag((ulong)msgupdate.flags.magicshield);
                                        
client.player.magicshieldstamp time32.now;
                                        
client.player.magicshieldincrease 2;
                                        
client.player.magicshieldtime 120;
                                        if (
client.player.playerflag == playerflag.player)
                                            
client.send(constants.shield(2120));
                                        
client.sendscreen(msgmagiceffecttrue);
                                        break;
                                    }
                                case 
enums.itemeffect.poison:
                                    {
                                        if (
attacked != null)
                                        {
                                            if (
constants.pkforbiddenmaps.contains(client.player.mapid)) return;
                                            if (
client.map.baseid == 700) return;
                                            if (
attacked.uid == client.player.uid) return;
                                            if (
attacked.toxicfogleft 0) return;
                                            
msgmagiceffect msgmagiceffect = new msgmagiceffect(true);
                                            
msgmagiceffect.spellid 5040;
                                            
msgmagiceffect.attacker attacked.uid;
                                            
msgmagiceffect.spelllevel 9;
                                            
msgmagiceffect.attacked.x;
                                            
msgmagiceffect.attacked.y;
                                            
msgmagiceffect.addtarget(attacked.uid0null);
                                            
msgmagiceffect.targets[attacked.uid].hit true;
                                            
attacked.toxicfogstamp time32.now;
                                            
attacked.toxicfogleft 10;
                                            
attacked.toxicfogpercent 0.05f;
                                            
client.sendscreen(msgmagiceffecttrue);
                                        }
                                        break;
                                    }
                            }
                        }
                    }
                }
            }
            
#endregion
            #region left hand
            
if (weapons.item2 != null)
            {
                if (
weapons.item2.id != 0)
                {
                    var 
item weapons.item2;
                    if (
item.effect != enums.itemeffect.none)
                    {
                        if (
kernel.rate(30))
                        {
                            switch (
item.effect)
                            {
                                case 
enums.itemeffect.hp:
                                    {
                                        
msgmagiceffect msgmagiceffect = new msgmagiceffect(true);
                                        
msgmagiceffect.attacker 1;
                                        
msgmagiceffect.spellid 1175;
                                        
msgmagiceffect.spelllevel 4;
                                        
msgmagiceffect.client.player.x;
                                        
msgmagiceffect.client.player.y;
                                        
msgmagiceffect.addtarget(client.player.uid300null);
                                        
uint damage math.min(300client.player.maxhitpoints client.player.hitpoints);
                                        
client.player.hitpoints += damage;
                                        
client.sendscreen(msgmagiceffecttrue);
                                        break;
                                    }
                                case 
enums.itemeffect.mp:
                                    {
                                        
msgmagiceffect msgmagiceffect = new msgmagiceffect(true);
                                        
msgmagiceffect.attacker 1;
                                        
msgmagiceffect.spellid 1175;
                                        
msgmagiceffect.spelllevel 2;
                                        
msgmagiceffect.client.player.x;
                                        
msgmagiceffect.client.player.y;
                                        
msgmagiceffect.addtarget(client.player.uid300null);
                                        
ushort damage = (ushort)math.min(300client.player.maxmana client.player.mana);
                                        
client.player.mana += damage;
                                        
client.sendscreen(msgmagiceffecttrue);
                                        break;
                                    }
                                case 
enums.itemeffect.shield:
                                    {
                                        if (
client.player.containsflag((ulong)msgupdate.flags.magicshield))
                                            return;
                                        
msgmagiceffect msgmagiceffect = new msgmagiceffect(true);
                                        
msgmagiceffect.attacker 1;
                                        
msgmagiceffect.spellid 1020;
                                        
msgmagiceffect.spelllevel 0;
                                        
msgmagiceffect.client.player.x;
                                        
msgmagiceffect.client.player.y;
                                        
msgmagiceffect.addtarget(client.player.uid120null);
                                        
client.player.shieldtime 0;
                                        
client.player.shieldstamp time32.now;
                                        
client.player.magicshieldstamp time32.now;
                                        
client.player.magicshieldtime 0;

                                        
client.player.addflag((ulong)msgupdate.flags.magicshield);
                                        
client.player.magicshieldstamp time32.now;
                                        
client.player.magicshieldincrease 2;
                                        
client.player.magicshieldtime 120;
                                        if (
client.player.playerflag == playerflag.player)
                                            
client.send(constants.shield(2120));
                                        
client.sendscreen(msgmagiceffecttrue);
                                        break;
                                    }
                                case 
enums.itemeffect.poison:
                                    {
                                        if (
attacked != null)
                                        {
                                            if (
attacked.uid == client.player.uid) return;
                                            if (
constants.pkforbiddenmaps.contains(client.player.mapid)) return;
                                            if (
client.map.baseid == 700) return;
                                            if (
attacked.toxicfogleft 0) return;
                                            
msgmagiceffect msgmagiceffect = new msgmagiceffect(true);
                                            
msgmagiceffect.spellid 5040;
                                            
msgmagiceffect.attacker attacked.uid;
                                            
msgmagiceffect.spelllevel 9;
                                            
msgmagiceffect.attacked.x;
                                            
msgmagiceffect.attacked.y;
                                            
msgmagiceffect.addtarget(attacked.uid0null);
                                            
msgmagiceffect.targets[attacked.uid].hit true;
                                            
attacked.toxicfogstamp time32.now;
                                            
attacked.toxicfogleft 10;
                                            
attacked.toxicfogpercent 0.05f;
                                            
client.sendscreen(msgmagiceffecttrue);
                                        }
                                        break;
                                    }
                            }
                        }
                    }
                }
            }
            
#endregion
        
}

        public static 
bool canattack(player attackermsgnpcinfoex attackedspellinformation spell)
        {
            if (
attacker.mapid == 2292)
            {
                if (((
attacker.guildid == 0) || !polapk.iswar) && (attacked.uid == 1235))
                {
                    return 
false;
                }
                if (
polapk.polekeeper != null)
                {
                    if (
polapk.polekeeper == attacker.owner.guild)
                    {
                        if (
attacked.uid == 1235)
                        {
                            return 
false;
                        }
                    }
                    else if ((((
attacked.uid == 0x7dfeb) || (attacked.uid == 0x7dfea)) && (polapk.polekeeper == attacker.owner.guild)) && (attacker.pkmode == enums.pkmode.team))
                    {
                        return 
false;
                    }
                }
            }
            
            if (
attacker.mapid == 2291)
            {
                if (((
attacker.guildid == 0) || !polapk2.iswar) && (attacked.uid == 1325))
                {
                    return 
false;
                }
                if (
polapk2.polekeeper != null)
                {
                    if (
polapk2.polekeeper == attacker.owner.guild)
                    {
                        if (
attacked.uid == 1325)
                        {
                            return 
false;
                        }
                    }
                    else if ((((
attacked.uid == 0x7dfeb) || (attacked.uid == 0x7dfea)) && (polapk2.polekeeper == attacker.owner.guild)) && (attacker.pkmode == enums.pkmode.team))
                    {
                        return 
false;
                    }
                }
            }
            if (
attacker.mapid == 2293)
            {
                if (((
attacker.guildid == 0) || !polapk3.iswar) && (attacked.uid == 817))
                {
                    return 
false;
                }
                if (
polapk3.polekeeper != null)
                {
                    if (
polapk3.polekeeper == attacker.owner.guild)
                    {
                        if (
attacked.uid == 817)
                        {
                            return 
false;
                        }
                    }
                    else if ((((
attacked.uid == 0x7dfeb) || (attacked.uid == 0x7dfea)) && (polapk3.polekeeper == attacker.owner.guild)) && (attacker.pkmode == enums.pkmode.team))
                    {
                        return 
false;
                    }
                }
            }
            if (
attacker.mapid == 2294)
            {
                if (((
attacker.guildid == 0) || !polapk4.iswar) && (attacked.uid == 23120))
                {
                    return 
false;
                }
                if (
polapk4.polekeeper != null)
                {
                    if (
polapk4.polekeeper == attacker.owner.guild)
                    {
                        if (
attacked.uid == 23120)
                        {
                            return 
false;
                        }
                    }
                    else if ((((
attacked.uid == 0x7dfeb) || (attacked.uid == 0x7dfea)) && (polapk4.polekeeper == attacker.owner.guild)) && (attacker.pkmode == enums.pkmode.team))
                    {
                        return 
false;
                    }
                }
            }

            
#region guildpolewar
            
if (guildpolewar.iswar)
            {
                if (
attacker.mapid == guildpolewar.map.id)
                {
                    return 
guildpolewar.attack(0attackerattacked);
                }
            }
            
#endregion
            #region classpolewar
            //if (msgserver.game.classpolewar.iswar)
            //{
            //    if (attacker.mapid == msgserver.game.classpolewar.map.id)
            //    {
            //        return msgserver.game.classpolewar.attack(0, attacker, attacked);
            //    }
            //}
            #endregion
            #region clanwar
            
if (attacker.mapid == 1509)
            {
                if (
attacker.clanid == || !clanwar.iswar)
                {
                    if (
attacked.uid == 813)
                    {
                        return 
false;
                    }
                }
                if (
clanwar.polekeeper != null)
                {
                    if (
clanwar.polekeeper == attacker.getclan)
                    {
                        if (
attacked.uid == 813)
                        {
                            return 
false;
                        }
                    }
                }
            }
            
#endregion
            #region eliteguildwar
            
if (attacker.mapid == 2071)
            {
                if (
attacker.guildid == || !eliteguildwar.iswar)
                {
                    if (
attacked.uid == 812)
                    {
                        return 
false;
                    }
                }
                if (
eliteguildwar.polekeeper != null)
                {
                    if (
eliteguildwar.polekeeper == attacker.owner.guild)
                    {
                        if (
attacked.uid == 812)
                        {
                            return 
false;
                        }
                    }
                    else if (
attacked.uid == 516075 || attacked.uid == 516074)
                    {
                        if (
eliteguildwar.polekeeper == attacker.owner.guild)
                        {
                            if (
attacker.pkmode == enums.pkmode.team)
                                return 
false;
                        }
                    }
                }
            }
            
#endregion
            #region statuewar
            
if (statueswar.iswar)
            {
                if (
attacker.mapid == statueswar.map.id)
                {
                    if (
attacker.guildid == || !statueswar.iswar)
                        if (
attacked.uid == statueswar.pole.uid)
                            return 
false;
                    if (
statueswar.polekeeper != null)
                    {
                        if (
statueswar.polekeeper == attacker.owner.asmember)
                            if (
attacked.uid == statueswar.pole.uid)
                                return 
false;
                        if (
statueswar.polekeeper == attacker.owner.asmember)
                            if (
attacker.pkmode == enums.pkmode.team)
                                return 
false;

                    }
                }
            }
            
#endregion
            #region poleemulator
            
if (attacked.uid == 123456)
                if (
attacked.hitpoints 0)
                    if (
attacker.guildid != && attacker.guildid != server.thread.poleemulator.killerguildid)
                        return 
true;
                    else return 
false;
                else return 
false;
            
#endregion
            #region guildwar
            
if (attacker.mapid == 1038)
            {
                if (
attacker.guildid == || !game.guildwar.iswar)
                {
                    if (
attacked.uid == 810) return false;
                }
                if (
game.guildwar.polekeeper != null)
                {
                    if (
game.guildwar.polekeeper == attacker.owner.guild)
                    {
                        if (
attacked.uid == 810) return false;
                    }
                    else if (
attacked.uid == 516075 || attacked.uid == 516074)
                    {
                        if (
game.guildwar.polekeeper == attacker.owner.guild)
                        {
                            if (
attacker.pkmode == enums.pkmode.team) return false;
                        }
                    }
                }
            }
            
#endregion
            #region superguildwar
            
if (attacker.mapid == 1234)
            {
                if (
attacker.guildid == || !game.superguildwar.iswar)
                {
                    if (
attacked.uid == 811) return false;
                }
                if (
game.superguildwar.polekeeper != null)
                {
                    if (
game.superguildwar.polekeeper == attacker.owner.guild)
                    {
                        if (
attacked.uid == 811) return false;
                    }
                    else if (
attacked.uid == 516077 || attacked.uid == 516076)
                    {
                        if (
game.superguildwar.polekeeper == attacker.owner.guild)
                        {
                            if (
attacker.pkmode == enums.pkmode.team) return false;
                        }
                    }
                }
            }
            
#endregion
            #region crow
            
if (attacker.mapid == 1039)
            {
                
bool stake true;
                if (
attacked.loweredname.contains("crow"))
                    
stake false;

                
ushort levelbase = (ushort)(attacked.mesh 10);
                if (
stake)
                    
levelbase -= 42;
                else
                    
levelbase -= 43;

                
byte level = (byte)(20 + (levelbase 3) * 5);
                if (
levelbase == 108 || levelbase == 109)
                    
level 125;
                if (
attacker.level >= level)
                    return 
true;
                else
                {
                    
attacker.attackpacket null;
                    
attacker.owner.send(constants.dummyleveltoohigh());
                    return 
false;
                }
            }
            
#endregion
            #region can't attack npc
            
if (attacked.uid == 76112 || attacked.uid == 127123 || attacked.uid == 141198 || attacked.uid == 9683 || attacked.uid == 2015 || attacked.uid == 20140
                
|| attacked.uid == 9884 || attacked.uid == 9885 || attacked.uid == 9886 || attacked.uid == 9887
                
|| attacked.uid == 9994 || attacked.uid == 9995 || attacked.uid == 9996 || attacked.uid == 9997 || attacked.uid == 41162
                
|| attacked.uid == 180 || attacked.uid == 181 || attacked.uid == 182 || attacked.uid == 183 || attacked.uid == 801
                
|| attacked.uid == 184 || attacked.uid == 185 || attacked.uid == 7882 || attacked.uid == 1232 || attacked.uid == 16416 || attacked.uid == 16417
                
|| attacked.uid == 216341 || attacked.uid == 1231 || attacked.uid == 6567 || attacked.uid == 4132 || attacked.uid == 64132 || attacked.uid == 44821)
            {
                
attacker.attackpacket null;
                return 
false;
            }
            
#endregion
            
return true;
        }
        public static 
bool canattack(player attackerplayer attackedspellinformation spellbool melee)
        {
            
#region thundercloud
            
if (attacker.name == "thundercloud")
            {
                if (
attacker.pkmode != game.enums.pkmode.pk &&
                         
attacker.pkmode != game.enums.pkmode.team)
                    return 
false;
            }

            if (
attacked.name == "thundercloud")
            {
                if (
attacked.owneruid == attacker.uid) return false;
                if (!
constants.pkforbiddenmaps.contains(attacker.mapid))
                {
                    if (
attacker.pkmode != game.enums.pkmode.pk &&
                     
attacker.pkmode != game.enums.pkmode.team)
                        return 
false;
                    else
                    {
                        
attacker.addflag((ulong)network.gamepackets.msgupdate.flags.flashingname);
                        
attacker.flashingnamestamp time32.now;
                        
attacker.flashingnametime 20;

                        return 
true;
                    }
                }
                else return 
false;
            }
            
#endregion
            
if (attacker.containsflag4((ulong)msgupdate.flags4.xchillingsnow))
                return 
false;
            
#region kongfu
            
if (attacker.playerflag == playerflag.player && attacked.playerflag == playerflag.player)
            {
                if (
attacker.pkmode == enums.pkmode.kongfu && attacker.kongfuactive == true && attacked.pkmode != enums.pkmode.kongfu && attacked.kongfuactive == false && !attacked.containsflag((ulong)msgupdate.flags.flashingname) && !attacked.containsflag((ulong)msgupdate.flags.blackname))
                {
                    if (
attacked.dead) return false;
                    
attacker.owner.send(new msgtalk("you can only attack fighters of the jiang hu while in the jiang hu"msgtalk.topleft));
                    return 
false;
                }
                else if (
attacker.pkmode == enums.pkmode.kongfu && attacker.kongfuactive == true)
                {
                    if (
attacked.pkmode == enums.pkmode.kongfu || attacked.kongfuactive == true || attacked.containsflag((ulong)msgupdate.flags.flashingname) || attacked.containsflag((ulong)msgupdate.flags.blackname))
                    {
                        if (
attacked.dead) return false;
                        if (
attacker.mapid == 1002 || attacker.mapid == 1000 || attacker.mapid == 1015 || attacker.mapid == 1020 || attacker.mapid == 1011 || attacker.mapid == 3055)
                        {
                            try
                            {
                                if (
attacker.settings != msgownkongfupksetting.settings.none)
                                {
                                    if ((
attacker.settings msgownkongfupksetting.settings.nothitfriends) == msgownkongfupksetting.settings.nothitfriends)
                                    {
                                        if (
attacker.owner.friends.containskey(attacked.uid))
                                            return 
false;
                                    }
                                    if ((
attacker.settings msgownkongfupksetting.settings.nohitalliesclan) == msgownkongfupksetting.settings.nohitalliesclan)
                                    {
                                        var 
attacker_clan attacker.getclan;
                                        if (
attacker_clan != null)
                                        {
                                            if (
attacker_clan.allies.containskey(attacked.clanid))
                                                return 
false;
                                        }
                                    }
                                    if ((
attacker.settings msgownkongfupksetting.settings.nothitalliedguild) == msgownkongfupksetting.settings.nothitalliedguild)
                                    {
                                        if (
attacker.owner.guild != null)
                                        {
                                            if (
attacker.owner.guild.ally.containskey(attacked.guildid))
                                                return 
false;
                                        }
                                    }
                                    if ((
attacker.settings msgownkongfupksetting.settings.nothitclanmembers) == msgownkongfupksetting.settings.nothitclanmembers)
                                    {
                                        if (
attacker.clanid == attacked.clanid)
                                            return 
false;
                                    }
                                    if ((
attacker.settings msgownkongfupksetting.settings.nothitguildmembers) == msgownkongfupksetting.settings.nothitguildmembers)
                                    {
                                        if (
attacker.guildid == attacked.guildid)
                                            return 
false;
                                    }
                                }
                            }
                            catch (
exception e)
                            {
                                
console.writeline(e.tostring());
                            }
                            return 
true;
                        }
                    }
                    return 
false;
                }
            }
            
#endregion
            #region factionwar
            
if (attacker.onpiratefaction == true && attacked.onninjafaction == true || attacker.onninjafaction == true && attacked.onpiratefaction == true)
            {
                if (
attacked.dead) return false;
                if (
attacker.mapid == 1002 || attacker.mapid == 1000 || attacker.mapid == 1015 || attacker.mapid == 1020 || attacker.mapid == 1011 || attacker.mapid == 3055)
                {
                    return 
true;
                }
                return 
false;
            }
            
#endregion
            
if (attacker.mapid == 1507)
            {
                if (!
attacker.allowtoattack)
                    return 
false;
            }
            if (
attacked.playerflag == playerflag.monster)
            {
                if (
attacked.companion)
                {
                    if (
attacked.owner == attacker.owner) return false;
                }
            }
            if (
attacker.timerinportchampion.addseconds(10) > datetime.now)
                return 
false;
            if (
attacker.uid == attacked.uid)
                return 
false;
            if (
attacker.pkmode == enums.pkmode.guild)
            {
                if (
attacker.owner.guild.enemy.containskey(attacked.guildid))
                {
                    if (
attacked.dead) return false;
                    if (
attacker.uid == attacked.uid) return false;
                    if (
attacker.mapid == 1000 || attacker.mapid == 1015 || attacker.mapid == 1020 || attacker.mapid == 1011)
                    {
                        
attacker.addflag((ulong)msgupdate.flags.flashingname);
                        
attacker.flashingnamestamp time32.now;
                        
attacker.flashingnametime 10;
                        return 
true;
                    }
                }
            }
            if (
attacker.pkmode == enums.pkmode.revenge)
            {
                if (
attacker.owner.enemy.containskey(attacked.uid))
                {
                    if (
attacked.dead) return false;
                    if (
attacker.uid == attacked.uid) return false;
                    if (
attacker.mapid == 1000 || attacker.mapid == 1015 || attacker.mapid == 1020 || attacker.mapid == 1011)
                    {
                        
attacker.addflag((ulong)msgupdate.flags.flashingname);
                        
attacker.flashingnamestamp time32.now;
                        
attacker.flashingnametime 10;
                        return 
true;
                    }
                }
            }
            if (
attacked.playerflag == playerflag.monster)
            {
                if (
attacked.monsterinfo.id == monsterinformation.reviverid)
                    return 
false;
            }
            if (
attacked.dead)
            {
                return 
false;
            }
            if (
attacker.playerflag == playerflag.player && attacker.owner.watchingelitepkmatch != null)
            {
                return 
false;
            }
            if (
attacked.playerflag == playerflag.player && attacked.owner.watchingelitepkmatch != null)
            {
                return 
false;
            }
            if (
attacker.playerflag == playerflag.player)
            {
                if (
attacked != null && attacked.playerflag == playerflag.player)
                    if (
attacker.owner.inteamqualifier() && attacked.owner.inteamqualifier())
                        return !
attacker.owner.team.isteammate(attacked.uid);
            }
            if (
spell != null)
                if (
attacker.playerflag == playerflag.player)
                    if (
attacker.owner.watchinggroup != null)
                        return 
false;
            if (
attacked == null)
            {
                return 
false;
            }
            if (
attacker.skillteamwatchingelitepkmatch != null)
            {
                return 
false;
            }
            if (
attacked.dead)
            {
                
attacker.attackpacket null;
                return 
false;
            }
            if (
attacker.playerflag == playerflag.player && attacked.playerflag == playerflag.player && attacked.owner.team != null && attacker.owner.team != null && attacker.owner.team.elitefighterstats != null && attacked.owner.team.elitefighterstats != null && attacker.mapid == attacked.owner.team.elitematch.map.id && attacker.owner.team.elitematch != null)
            {
                return 
attacker.owner.team != attacked.owner.team;
            }
            if (
attacker.playerflag == playerflag.player && attacked.playerflag == playerflag.player)
                if ((
attacker.owner.inqualifier() && attacked.owner.iswatching()) || (attacked.owner.inqualifier() && attacker.owner.iswatching()))
                    return 
false;
            if (
attacker.playerflag == playerflag.player)
                if (
time32.now attacker.owner.cantattack)
                    return 
false;
            if (
attacked.playerflag == playerflag.monster)
            {
                if (
attacked.companion)
                {
                    if (
constants.pkforbiddenmaps.contains(attacker.owner.map.id))
                    {
                        if (
attacked.owner == attacker.owner) return false;
                        if (
attacker.pkmode != enums.pkmode.pk && attacker.pkmode != enums.pkmode.team) return false;
                        else
                        {
                            
attacker.addflag((ulong)msgupdate.flags.flashingname);
                            
attacker.flashingnamestamp time32.now;
                            
attacker.flashingnametime 10;
                            return 
true;
                        }
                    }
                }
                if (
attacked.name.contains("guard1"))
                {
                    if (
attacker.pkmode != enums.pkmode.pk && attacker.pkmode != game.enums.pkmode.team) return false;
                    else
                    {
                        
attacker.addflag((ulong)msgupdate.flags.flashingname);
                        
attacker.flashingnamestamp time32.now;
                        
attacker.flashingnametime 10;
                        return 
true;
                    }
                }
                else return 
true;
            }
            else
            {
                if (
attacked.playerflag == playerflag.player)
                    if (!
attacked.owner.attackable)
                        return 
false;
                if (
attacker.playerflag == playerflag.player)
                    if (
attacker.owner.watchinggroup == null)
                        if (
attacked.playerflag == playerflag.player)
                            if (
attacked.owner.watchinggroup != null)
                                return 
false;
                if (
spell != null)
                {
                    if (
spell.id != 8001)
                    {
                        if (
spell.onlyground)
                            if (
attacked.containsflag((ulong)msgupdate.flags.fly))
                                return 
false;
                        if (
melee && attacked.containsflag((ulong)msgupdate.flags.fly))
                            return 
false;
                    }
                }
                if (
spell != null)
                {
                    if (
spell.id == 6010)
                    {
                        if (
attacked.containsflag((ulong)msgupdate.flags.fly))
                            return 
false;
                    }
                }
                if (
spell != null)
                {
                    if (
spell.id == 10381)
                    {
                        if (
attacked.containsflag((ulong)msgupdate.flags.fly))
                            return 
false;
                    }
                }
                if (
spell != null)
                {
                    if (
spell.id == 6000)
                    {
                        if (
attacked.containsflag((ulong)msgupdate.flags.fly))
                            return 
false;
                    }
                }
                if (
spell != null)
                {
                    if (
spell.id == 5030)
                    {
                        if (
attacked.containsflag((ulong)msgupdate.flags.fly))
                            return 
false;
                    }
                }
                if (
spell == null)
                {
                    if (
attacked.containsflag((ulong)msgupdate.flags.fly))
                        return 
false;
                }
                if (
constants.pkforbiddenmaps.contains(attacker.owner.map.id))
                {
                    if (((
attacker.pkmode == enums.pkmode.pk) || (attacker.pkmode == enums.pkmode.team)) || ((spell != null) && spell.cankill))
                    {
                        
attacker.owner.send(constants.pkforbidden);
                        
attacker.attackpacket null;
                    }
                    return 
false;
                }
                if (
attacker.pkmode == enums.pkmode.capture)
                {
                    if (
attacked.containsflag((ulong)msgupdate.flags.flashingname) || attacked.pkpoints 99)
                    {
                        return 
true;
                    }
                }
                if (
attacker.pkmode == enums.pkmode.peace)
                {
                    return 
false;
                }
                if (
attacker.uid == attacked.uid)
                    return 
false;
                if (
attacker.pkmode == enums.pkmode.team)
                {
                    if (
attacker.owner.team != null)
                    {
                        if (
attacker.owner.team.isteammate(attacked.uid))
                        {
                            
attacker.attackpacket null;
                            return 
false;
                        }
                    }
                    if (
attacker.pkmode == enums.pkmode.team)
                    {
                        if (
attacker.owner.team != null)
                        {
                            if (!
attacker.owner.team.isteammate(attacked.uid))
                            {
                                if (
attacker.inskillpk == true)
                                {
                                    return 
true;
                                }
                            }
                        }
                    }
                    if (
attacker.guildid == attacked.guildid && attacker.guildid != 0)
                    {
                        
attacker.attackpacket null;
                        return 
false;
                    }
                    if (
attacker.clanid == attacked.clanid && attacker.clanid != 0)
                    {
                        
attacker.attackpacket null;
                        return 
false;
                    }
                    if (
attacker.owner.friends.containskey(attacked.uid))
                    {
                        
attacker.attackpacket null;
                        return 
false;
                    }
                    if (
attacker.owner.guild != null)
                    {
                        if (
attacker.owner.guild.ally.containskey(attacked.guildid))
                        {
                            
attacker.attackpacket null;
                            return 
false;
                        }
                    }
                    if (
attacker.clanid != 0)
                    {
                        if (
attacker.getclan.allies.containskey(attacked.clanid))
                        {
                            
attacker.attackpacket null;
                            return 
false;
                        }
                    }
                }
                if (
spell != null)
                    if (
spell.onlyground)
                        if (
attacked.containsflag((ulong)msgupdate.flags.fly))
                            return 
false;

                if (
spell != null)
                    if (!
spell.cankill)
                        return 
true;

                if (
attacker.pkmode != enums.pkmode.pk &&
                    
attacker.pkmode != enums.pkmode.team && attacked.pkpoints 99)
                {
                    
attacker.attackpacket null;
                    return 
false;
                }
                else
                {
                    if (!
attacked.containsflag((ulong)msgupdate.flags.flashingname))
                    {
                        if (!
attacked.containsflag((ulong)msgupdate.flags.blackname))
                        {
                            if (
constants.pkfreemaps.contains(attacker.mapid)) return true;
                            if (
attacker.owner.map.baseid == 700) return true;
                            
attacker.addflag((ulong)msgupdate.flags.flashingname);
                            
attacker.flashingnamestamp time32.now;
                            
attacker.flashingnametime 10;
                        }
                    }
                    return 
true;
                }
            }
        }

        public static 
void receiveattack(player attackerplayer attackedmsginteract attackref uint damagespellinformation spell)
        {
            
#region statueswar
            
if (statueswar.iswar)
            {
                if (
attacker.mapid == statueswar.map.id)
                {
                    if (
attacked.uid == statueswar.pole.uid)
                    {
                        if (
statueswar.polekeeper == attacker.owner.asmember)
                            return;
                        if (
attacked.hitpoints <= damage)
                            
attacked.hitpoints 0;
                        
statueswar.addscore(damageattacker.owner.asmember);
                    }
                }
            }
            
#endregion
            #region thundercloud
            
if (attacked.name == "thundercloud")
            {
                if (
spell != null && spell.id != 0)
                {
                    if (
kernel.rate(75)) damage 1;
                    else 
damage 0;
                }
                else if (
spell == null || spell.id == 0)
                {
                    
damage 1;
                }
            }
            foreach (var 
th in kernel.maps[attacker.mapid].entities.values.where(=> i.name == "thundercloud"))
            {
                if (
th.owneruid == attacked.uid)
                {
                    if (
attacker == null || kernel.getdistance(attacker.xattacker.yth.xth.y) > th.monsterinfo.attackrange || attacker.dead) break;
                    
th.monsterinfo.insight attacker.uid;
                    break;
                }
            }
            
#endregion
            #region revengetaill
            
if (attacked.containsflag4((ulong)network.gamepackets.msgupdate.flags4.revengetaill))
            {
                if (
attacked.owner != null && attacked.owner.spells != null && attacked.owner.spells.containskey(13030))
                {
                    var 
spelll database.spelltable.getspell(13030attacked.owner);
                    if (
damage <= spelll.power)
                    {
                        
msgmagiceffect suses = new msgmagiceffect(true);
                        
suses.attacker attacked.uid;
                        
suses.attacker1 attacker.uid;
                        
suses.spellid 13030;
                        
suses.specialeffect 1;
                        
suses.addtarget(attacker.uiddamagenull);
                        if (
attacker.hitpoints <= damage)
                        {
                            
attacker.die(attacked);
                        }
                        else
                        {
                            
attacker.hitpoints -= damage;
                        }
                        
attacked.owner.sendscreen(susestrue);
                    }
                }
            }
            
#endregion
            #region chillingsnow
            
if (attacked.containsflag4((ulong)msgupdate.flags4.chillingsnow) && attacked.isstomper2() && attacker.playerflag == playerflag.player)
            {
                var 
spell1 database.spelltable.getspell(12960attacked.owner);
                
int rate 95;
                
int diff attacker.battlepower attacked.battlepower;
                if (
diff 0diff 0;
                
rate -= (byte)(diff 5);
                if (
rate 0rate 0;
                if (
kernel.rate(rate))
                {
                    
attacker.addflag4((ulong)msgupdate.flags4.xchillingsnow);
                    
attacker.chillingsnowstamp time32.now;
                    
attacker.chillingsnow = (byte)(spell1.level 1);
                }
            }
            
#endregion
            #region freezingpelter
            
if (attacked.containsflag4((ulong)msgupdate.flags4.freezingpelter) && attacked.isstomper2() && attacker.playerflag == playerflag.player)
            {
                var 
spell1 database.spelltable.getspell(13020attacked.owner);
                
int rate 30;
                
int diff attacker.battlepower attacked.battlepower;
                if (
diff 0diff 0;
                
rate -= (byte)(diff 5);
                if (
rate 0rate 0;
                if (
kernel.rate(rate))
                {
                    
attacker.addflag4((ulong)msgupdate.flags4.xfreezingpelter);
                    
attacker.freezingpelterstamp time32.now;
                    
byte num 0;
                    if (
spell1.level == 0num 1;
                    if (
spell1.level == 1num 1;
                    if (
spell1.level == 2num 2;
                    if (
spell1.level == 3num 2;
                    if (
spell1.level == 4num 3;
                    if (
spell1.level == 5num 3;
                    if (
spell1.level == 5num 4;
                    
attacker.freezingpelter num;
                }
            }
            
#endregion

            
if (attacker.playerflag == playerflag.monster && attacked.playerflag == playerflag.player)
            {
                if (
attacked.action == enums.conqueraction.sit)
                    if (
attacked.stamina 20)
                        
attacked.stamina -= 20;
                    else 
attacked.stamina 0;
                
attacked.action enums.conqueraction.none;
            }
            if (
attack.interacttype == msginteract.magic)
            {
                if (
attacked.hitpoints <= damage)
                {
                    if (
attacker.playerflag == playerflag.player && attacked.playerflag == playerflag.player)
                    {
                        if (
spelltable.allowskillsoul == null) return;
                        if (
spell == null) return;
                        if (
spelltable.allowskillsoul.contains(spell.id))
                        {
                            
byte[] tets = new byte[12 8];
                            
writer.ushort(120tets);
                            
writer.ushort(27102tets);
                            
writer.uint(spell.id4tets);
                            
attacked.owner.sendscreen(tetstrue); attacker.owner.sendscreen(tetstrue);
                        }
                    }
                    if (
attacked.owner != null)
                    {
                        
attacked.owner.updatequalifier(attacked.hitpoints);
                    }
                    
//attacker.owner.updatequalifier(attacker.owner, attacked.owner, attacked.hitpoints);
                    
attacked.causeofdeathismagic true;
                    
attacked.die(attacker);
                    
attacked.isdropped false;
                    if (
attacked.owner != null && attacker.owner != null)
                    {
                        if (
attacked.owner.team != null && attacker.owner.team != null)
                        {
                            if (
attacker.owner.team.elitefighterstats != null && attacked.owner.team.elitefighterstats != null)
                            {
                                if (
attacker.owner.team.elitematch != null)
                                {
                                    if (!
attacked.owner.team.alive)
                                    {
                                        
attacker.owner.team.elitefighterstats.points += damage;
                                        
attacker.owner.team.elitematch.end(attacked.owner.team);
                                    }
                                    else
                                    {
                                        
attacker.owner.team.sendmesageteam(attacker.owner.team.elitematch.createupdate().toarray(), 0);
                                        
attacked.owner.team.sendmesageteam(attacker.owner.team.elitematch.createupdate().toarray(), 0);
                                    }
                                }
                            }
                        }
                    }
                }
                else
                {
                    if (
attacked.name != "thundercloud")
                    {
                        if (
attacked.owner != null && attacker.owner != null)
                        {
                            if (
attacked.owner.team != null && attacker.owner.team != null)
                            {
                                if (
attacker.owner.team.elitefighterstats != null && attacked.owner.team.elitefighterstats != null)
                                {
                                    if (
attacker.owner.team.elitematch != null)
                                    {
                                        
attacker.owner.team.elitefighterstats.points += damage;
                                        
attacker.owner.team.sendmesageteam(attacker.owner.team.elitematch.createupdate().toarray(), 0);
                                        
attacked.owner.team.sendmesageteam(attacker.owner.team.elitematch.createupdate().toarray(), 0);
                                    }
                                }
                            }
                        }
                        if (
attacked.owner != null)
                        {
                            
attacked.owner.updatequalifier(damage);
                        }
                        
attacked.hitpoints -= damage;
                    }
                    else
                    {
                        
attacked.hitpoints -= 2100;
                    }
                }
            }
            else
            {
                if (
attacked.hitpoints <= damage)
                {
                    if (
attacked.playerflag == playerflag.player)
                    {
                        
attacked.owner.updatequalifier(attacked.hitpoints);
                        
attacked.owner.sendscreen(attacktrue);
                        
attacker.attackpacket null;
                    }
                    else
                    {
                        
attacked.monsterinfo.sendscreen(attack);
                    }
                    
attacked.die(attacker);
                    if (
attacker.pkmode == enums.pkmode.kongfu)
                    {
                        if (
attacked.kongfuactive)
                        {
                            if (
attacker.mykongfu != null && attacker.mykongfu != null)
                                
attacker.mykongfu.getkill(attacker.ownerattacked.mykongfu);
                        }
                    }
                    if (
attacked.owner != null && attacker.owner != null)
                    {
                        if (
attacked.owner.team != null && attacker.owner.team != null)
                        {
                            if (
attacker.owner.team.elitefighterstats != null && attacked.owner.team.elitefighterstats != null)
                            {
                                if (
attacker.owner.team.elitematch != null)
                                {
                                    if (
attacker.mapid == attacked.owner.team.elitematch.map.id)
                                    {
                                        if (!
attacked.owner.team.alive)
                                        {
                                            
attacker.owner.team.elitefighterstats.points += damage;
                                            
attacker.owner.team.elitematch.end(attacked.owner.team);
                                        }
                                        else
                                        {
                                            
attacker.owner.team.sendmesageteam(attacker.owner.team.elitematch.createupdate().toarray(), 0);
                                            
attacked.owner.team.sendmesageteam(attacker.owner.team.elitematch.createupdate().toarray(), 0);
                                        }
                                    }
                                }
                            }
                        }
                    }

                }
                else
                {
                    if (
attacked.name != "thundercloud")
                    {

                        if (
attacked.owner != null && attacker.owner != null)
                        {
                            if (
attacked.owner.team != null && attacker.owner.team != null)
                            {
                                if (
attacker.owner.team.elitefighterstats != null && attacked.owner.team.elitefighterstats != null)
                                {
                                    if (
attacker.owner.team.elitematch != null)
                                    {
                                        if (
attacker.mapid == attacked.owner.team.elitematch.map.id)
                                        {
                                            
attacker.owner.team.elitefighterstats.points += damage;
                                            
attacker.owner.team.sendmesageteam(attacker.owner.team.elitematch.createupdate().toarray(), 0);
                                            
attacked.owner.team.sendmesageteam(attacker.owner.team.elitematch.createupdate().toarray(), 0);
                                        }
                                    }
                                }
                            }
                        }
                        
attacked.hitpoints -= damage;
                        if (
attacked.playerflag == playerflag.player)
                        {
                            
attacked.owner.updatequalifier(damage);
                            
attacked.owner.sendscreen(attacktrue);
                        }
                        else
                            
attacked.monsterinfo.sendscreen(attack);
                        
attacker.attackpacket attack;
                        
attacker.attackstamp time32.now;
                    }
                    else
                    {
                        
attacked.hitpoints -= 2100;
                    }
                }
            }
            
#region thundercloud
            
foreach (var th in kernel.maps[attacker.mapid].entities.values.where(=> i.name == "thundercloud"))
            {
                if (
th.owneruid == attacker.uid)
                {
                    if (
attacked == null || kernel.getdistance(attacked.xattacked.yth.xth.y) > th.monsterinfo.attackrange || attacked.dead) break;
                    
th.monsterinfo.insight attacked.uid;
                    break;
                }
            }
            
#endregion
        
}
        public static 
void receiveattack(player attackermsgnpcinfoex attackedmsginteract attackuint damagespellinformation spell)
        {
            if ((
attacker.mapid == 2292) && (attacked.uid == 1235))
            {
                if (
polapk.polekeeper == attacker.owner.guild)
                {
                    return;
                }
                if (
attacked.hitpoints <= damage)
                {
                    
attacked.hitpoints 0;
                }
                
polapk.addscore(damageattacker.owner.guild);
            }
            if ((
attacker.mapid == 2291) && (attacked.uid == 1325))
            {
                if (
polapk2.polekeeper == attacker.owner.guild)
                {
                    return;
                }
                if (
attacked.hitpoints <= damage)
                {
                    
attacked.hitpoints 0;
                }
                
polapk2.addscore(damageattacker.owner.guild);
            }
            if ((
attacker.mapid == 2293) && (attacked.uid == 817))
            {
                if (
polapk3.polekeeper == attacker.owner.guild)
                {
                    return;
                }
                if (
attacked.hitpoints <= damage)
                {
                    
attacked.hitpoints 0;
                }
                
polapk3.addscore(damageattacker.owner.guild);
            }
            if ((
attacker.mapid == 2294) && (attacked.uid == 23120))
            {
                if (
polapk4.polekeeper == attacker.owner.guild)
                {
                    return;
                }
                if (
attacked.hitpoints <= damage)
                {
                    
attacked.hitpoints 0;
                }
                
polapk4.addscore(damageattacker.owner.guild);
            }
            
#region guildpolewar
            
if (guildpolewar.iswar)
            {
                if (
attacker.mapid == guildpolewar.map.id)
                {
                    
guildpolewar.attack(damageattackerattacked);
                }
            }
            
#endregion
            #region classpolewar
            //if (msgserver.game.classpolewar.iswar)
            //{
            //    if (attacker.mapid == msgserver.game.classpolewar.map.id)
            //    {
            //        msgserver.game.classpolewar.attack(damage, attacker, attacked);
            //    }
            //}
            #endregion
            #region clanwar
            
if (attacker.mapid == 1509)
            {
                if (
attacked.uid == 813)
                {
                    
msgfamily clan attacker.getclan;
                    if (
clanwar.polekeeper == clan)
                        return;
                    if (
attacked.hitpoints <= damage)
                        
attacked.hitpoints 0;
                    
clanwar.addscore(damageclan);
                }
            }
            
#endregion
            #region cps stake
            
if (attacker.mapid == 1002)
            {
                if (
attacked.uid == 6462)
                {
                    
attacked.die(attacker);
                    {
                        
attacker.conquerpoints += 30000;
                        
attacker.owner.send(new msgtalk("killed  [ newdream-co ] and get [ 30000 ] cps #00"system.drawing.color.azuremsgtalk.topleft));
                    }
                }
            }
            if (
attacker.mapid == 1002)
            {
                if (
attacked.uid == 6463)
                {
                    
attacked.die(attacker);
                    {
                        
attacker.conquerpoints += 30000;
                        
attacker.owner.send(new msgtalk("killed  [ newdream-co ] and get [ 30000 ] cps #00"system.drawing.color.azuremsgtalk.topleft));
                    }
                }
            }
            if (
attacker.mapid == 1002)
            {
                if (
attacked.uid == 6464)
                {
                    
attacked.die(attacker);
                    {
                        
attacker.conquerpoints += 30000;
                        
attacker.owner.send(new msgtalk("killed  [ newdream-co ] and get [ 30000 ] cps #00"system.drawing.color.azuremsgtalk.topleft));
                    }
                }
            }
            if (
attacker.mapid == 1002)
            {
                if (
attacked.uid == 6465)
                {
                    
attacked.die(attacker);
                    {
                        
attacker.conquerpoints += 30000;
                        
attacker.owner.send(new msgtalk("killed  [ newdream-co ] and get [ 30000 ] cps #00"system.drawing.color.azuremsgtalk.topleft));
                    }
                }
            }
            
#endregion
            #region eliteguildwar
            
if (attacker.mapid == 2071)
            {
                if (
attacked.uid == 812)
                {
                    if (
eliteguildwar.polekeeper == attacker.owner.guild)
                        return;
                    if (
attacked.hitpoints <= damage)
                        
attacked.hitpoints 0;
                    
eliteguildwar.addscore(damageattacker.owner.guild);
                }

            }
            
#endregion
            #region crow
            
if (attacker.playerflag == playerflag.player)
                if (
damage attacked.hitpoints)
                {
                    if (
attacker.mapid == 1039)
                        
attacker.owner.increaseexperience(math.min(damageattacked.hitpoints), true);
                    if (
spell != null)
                        
attacker.owner.increasespellexperience(math.min(damageattacked.hitpoints), spell.id);
                }
                else
                {
                    if (
attacker.mapid == 1039)
                        
attacker.owner.increaseexperience(damagetrue);
                    if (
spell != null)
                        
attacker.owner.increasespellexperience(damagespell.id);
                }
            
#endregion
            #region poleemulator
            
if (attacked.uid == 123456)
            {
                if (
server.thread.poleemulator.killerguildid == attacker.owner.guild.id)
                    return;
                
server.thread.poleemulator.addscore(damageattacker.owner.guild);
            }
            
#endregion
            #region guildwar
            
if (game.guildwar.iswar)
            {
                if (
attacker.mapid == 1038)
                {
                    if (
attacked.uid == 810)
                    {
                        if (
game.guildwar.polekeeper == attacker.owner.guild) return;
                        if (
attacked.hitpoints <= damageattacked.hitpoints 0;
                        
game.guildwar.addscore(damageattacker.owner.guild);
                    }
                }
            }
            
#endregion
            #region superguildwar
            
if (game.superguildwar.iswar)
            {
                if (
attacker.mapid == 1234)
                {
                    if (
attacked.uid == 811)
                    {
                        if (
game.superguildwar.polekeeper == attacker.owner.guild) return;
                        if (
attacked.hitpoints <= damageattacked.hitpoints 0;
                        
game.superguildwar.addscore(damageattacker.owner.guild);
                    }
                }
            }
            
#endregion
            #region hitpoints
            
if (attack.interacttype == msginteract.magic)
            {
                if (
attacked.hitpoints <= damage)
                {
                    
attacked.die(attacker);
                }
                else
                {
                    
attacked.hitpoints -= damage;
                }
            }
            else
            {
                
attacker.owner.sendscreen(attacktrue);
                if (
attacked.hitpoints <= damage)
                {
                    
attacked.die(attacker);
                }
                else
                {
                    
attacked.hitpoints -= damage;
                    
attacker.attackpacket attack;
                    
attacker.attackstamp time32.now;
                }
            }
            
#endregion
        
}
    }


تم التجربه ونفس المشكله قائمه

قديم 2019-08-20, 04:09 PM
المشاركة 18
ابو مروان
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: مشكلة بخصوص اسكلة الويند ولكر thundercloud
معتش حلول ولا ايه يا رجاله لالالالالالالالا مش اسكله الى تعمل فينا كدا xd

قديم 2019-08-20, 11:31 PM
المشاركة 19
ابو مروان
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: مشكلة بخصوص اسكلة الويند ولكر thundercloud
اب اب اب اب

قديم 2019-08-21, 05:58 AM
المشاركة 20
Commander
.::عضو جديد ::.
  • غير متواجد
افتراضي رد: مشكلة بخصوص اسكلة الويند ولكر thundercloud
انت لو كلفت نفسك انا نزلتلك حلها في قسم التطوير ورديت علي الموضوع التاني


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



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

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

المواضيع المتشابهه للموضوع: مشكلة بخصوص اسكلة الويند ولكر thundercloud
الموضوع كاتب الموضوع المنتدى مشاركات آخر مشاركة
حل مشكله الويند ولكر ال بيضرب في التون MeGo تطوير سيرفرات كونكر 4 2020-05-13 04:23 PM
مشكله فى اسكلة ThunderCloud ياريت لو حل ابو مروان مشكلات السيرفيرات كونكر الشخصيه 4 2020-05-03 08:28 PM
مشكلة نسخ النينج (shadowclone)ا.. حل بعد اذنكم Abod ayman مشكلات السيرفيرات كونكر الشخصيه 6 2020-03-30 08:20 PM
مشكله فى سورس Fighters بخصوص اسكلة ThunderCloud ابو مروان مشكلات السيرفيرات كونكر الشخصيه 3 2019-08-21 01:09 AM
مشكلة بخصوص اسكلة النينجا ToxicFog MRonlineGvrix مشكلات السيرفيرات كونكر الشخصيه 9 2019-08-06 06:33 PM


الساعة الآن 01:01 AM

Powered by vBulletin® Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.