|
المشاركات 1,372 |
+التقييم 0.67 |
تاريخ التسجيل Apr 2019 |
الاقامة شرقيه/زقازيق |
نظام التشغيل |
رقم العضوية 30 |
public void SpawnElitePKBot(
public void SpawnElitePKBot(uint UID)
{
if (!Kernel.GamePool.ContainsKey(UID))
{
ReadyToPlay();
this.Account = new Database.AccountTable(null);
this.Account.EntityID = UID;
{
#region Load Entity
this.Entity = new Game.Entity(EntityFlag.Entity, false);
this.Entity.Name = "ElitePK`Bot";
this.Entity.Owner = this;
this.Entity.UID = UID;
this.Entity.Body = EliteBody();
this.Entity.Face = (ushort)Kernel.Random.Next(1, 50);
byte Color = (byte)Kernel.Random.Next(4, 8);
this.Entity.HairStyle = (ushort)(Color * 100 + 10 + (byte)Kernel.Random.Next(4, 9));
this.Entity.Level = 140;
this.Entity.Class = 55;
this.Entity.Reborn = 2;
this.Entity.Titles = new System.Collections.Concurrent.ConcurrentDictionary<TitlePacket.Titles, DateTime>();
this.Entity.MyTitle = (TitlePacket.Titles)16;
this.Entity.MapID = ElitePKTournament.WaitingAreaID;
if (this.VendingDisguise == 0)
this.VendingDisguise = 0xdf;
this.Entity.X = 50;
this.Entity.Y = 50;
uint WeaponR = 601439;
uint WeaponL = 601439;
uint Armor = 135309;
uint Head = 123309;
uint Garment = 192685;
this.ElitePKStats = new ElitePK.FighterStats(this.Entity.UID, this.Entity.Name, this.Entity.Mesh);
if (!Game.ConquerStructures.Nobility.Board.TryGetValue(this.Entity.UID, out this.NobilityInformation))
{
this.NobilityInformation = new NobilityInformation();
this.NobilityInformation.EntityUID = this.Entity.UID;
this.NobilityInformation.Name = this.Entity.Name;
this.NobilityInformation.Donation = 0L;
this.NobilityInformation.Rank = NobilityRank.Serf;
this.NobilityInformation.Position = -1;
this.NobilityInformation.Gender = 1;
this.NobilityInformation.Mesh = this.Entity.Mesh;
if ((this.Entity.Body % 10) >= 3)
{
this.NobilityInformation.Gender = 0;
}
}
else
{
this.Entity.NobilityRank = this.NobilityInformation.Rank;
}
Arena.ArenaStatistics.TryGetValue(this.Entity.UID, out this.ArenaStatistic);
if ((this.ArenaStatistic == null) || (this.ArenaStatistic.EntityID == 0))
{
this.ArenaStatistic = new ArenaStatistic(true);
this.ArenaStatistic.EntityID = this.Entity.UID;
this.ArenaStatistic.Name = this.Entity.Name;
this.ArenaStatistic.Level = this.Entity.Level;
this.ArenaStatistic.Class = this.Entity.Class;
this.ArenaStatistic.Model = this.Entity.Mesh;
this.ArenaStatistic.ArenaPoints = Database.ArenaTable.ArenaPointFill(this.Entity.Level);
this.ArenaStatistic.LastArenaPointFill = DateTime.Now;
Database.ArenaTable.InsertArenaStatistic(this);
this.ArenaStatistic.Status = 0;
Arena.ArenaStatistics.Add(this.Entity.UID, this.ArenaStatistic);
}
else
{
this.ArenaStatistic.Level = this.Entity.Level;
this.ArenaStatistic.Class = this.Entity.Class;
this.ArenaStatistic.Model = this.Entity.Mesh;
if (DateTime.Now.DayOfYear != this.ArenaStatistic.LastArenaPointFill.DayOfYear)
{
this.ArenaStatistic.LastSeasonArenaPoints = this.ArenaStatistic.ArenaPoints;
this.ArenaStatistic.LastSeasonWin = this.ArenaStatistic.TodayWin;
this.ArenaStatistic.LastSeasonLose = this.ArenaStatistic.TodayBattles - this.ArenaStatistic.TodayWin;
this.ArenaStatistic.ArenaPoints = Database.ArenaTable.ArenaPointFill(this.Entity.Level);
this.ArenaStatistic.LastArenaPointFill = DateTime.Now;
this.ArenaStatistic.TodayWin = 0;
this.ArenaStatistic.TodayBattles = 0;
Arena.Sort();
Arena.YesterdaySort();
}
}
TeamArena.ArenaStatistics.TryGetValue(this.Entity.UID, out this.TeamArenaStatistic);
if (this.TeamArenaStatistic == null)
{
this.TeamArenaStatistic = new TeamArenaStatistic(true);
this.TeamArenaStatistic.EntityID = this.Entity.UID;
this.TeamArenaStatistic.Name = this.Entity.Name;
this.TeamArenaStatistic.Level = this.Entity.Level;
this.TeamArenaStatistic.Class = this.Entity.Class;
this.TeamArenaStatistic.Model = this.Entity.Mesh;
Database.TeamArenaTable.InsertArenaStatistic(this);
this.TeamArenaStatistic.Status = 0;
if (TeamArena.ArenaStatistics.ContainsKey(this.Entity.UID))
{
TeamArena.ArenaStatistics.Remove(this.Entity.UID);
}
TeamArena.ArenaStatistics.Add(this.Entity.UID, this.TeamArenaStatistic);
}
else if (this.TeamArenaStatistic.EntityID == 0)
{
this.TeamArenaStatistic = new TeamArenaStatistic(true);
this.TeamArenaStatistic.EntityID = this.Entity.UID;
this.TeamArenaStatistic.Name = this.Entity.Name;
this.TeamArenaStatistic.Level = this.Entity.Level;
this.TeamArenaStatistic.Class = this.Entity.Class;
this.TeamArenaStatistic.Model = this.Entity.Mesh;
Database.TeamArenaTable.InsertArenaStatistic(this);
this.TeamArenaStatistic.Status = 0;
if (TeamArena.ArenaStatistics.ContainsKey(this.Entity.UID))
{
TeamArena.ArenaStatistics.Remove(this.Entity.UID);
}
TeamArena.ArenaStatistics.Add(this.Entity.UID, this.TeamArenaStatistic);
}
else
{
this.TeamArenaStatistic.Level = this.Entity.Level;
this.TeamArenaStatistic.Class = this.Entity.Class;
this.TeamArenaStatistic.Model = this.Entity.Mesh;
this.TeamArenaStatistic.Name = this.Entity.Name;
}
Database.DetainedItemTable.LoadDetainedItems(this);
Database.ClaimItemTable.LoadClaimableItems(this);
this.Entity.LoadTopStatus();
this.Entity.FullyLoaded = true;
#endregion
if (this.Entity.FullyLoaded)
{
VariableVault variables;
Database.EntityVariableTable.Load(this.Account.EntityID, out variables);
this.Variables = variables;
if (this.BackupArmorLook != 0)
this.SetNewArmorLook(this.BackupArmorLook);
else
this.SetNewArmorLook(this.ArmorLook);
this.SetNewHeadgearLook(this.HeadgearLook);
this.BackupArmorLook = 0;
this.LoadData(true);
if (this.Entity.GuildID != 0)
this.Entity.GuildBattlePower = this.Guild.GetSharedBattlepower(this.Entity.GuildRank);
this.ReviewMentor();
Network.PacketHandler.LoginMessages(this);
#region Equip
ConquerItem item7 = null;
ClientEquip equip = null;
if (WeaponR > 0)
{
Database.ConquerItemBaseInformation CIBI = Database.ConquerItemInformation.BaseInformations[WeaponR];
if (CIBI == null) return;
item7 = new ConquerItem(true);
item7.ID = WeaponR;
item7.UID = AuthClient.nextID;
AuthClient.nextID++;
item7.Position = 4;
item7.Durability = CIBI.Durability;
item7.MaximDurability = CIBI.Durability;
this.Equipment.Remove(4);
if (this.Equipment.Objects[3] != null)
{
this.Equipment.Objects[3] = null;
}
this.Equipment.Add(item7);
item7.Mode = Enums.ItemMode.Update;
item7.Send(this);
equip = new ClientEquip();
equip.DoEquips(this);
this.Send(equip);
this.Equipment.UpdateEntityPacket();
}
if (WeaponL > 0)
{
Database.ConquerItemBaseInformation CIBI = Database.ConquerItemInformation.BaseInformations[WeaponL];
if (CIBI == null) return;
item7 = new ConquerItem(true);
item7.ID = WeaponL;
item7.UID = AuthClient.nextID;
AuthClient.nextID++;
item7.Position = 5;
item7.Durability = CIBI.Durability;
item7.MaximDurability = CIBI.Durability;
this.Equipment.Remove(5);
if (this.Equipment.Objects[4] != null)
{
this.Equipment.Objects[4] = null;
}
this.Equipment.Add(item7);
item7.Mode = Enums.ItemMode.Update;
item7.Send(this);
equip = new ClientEquip();
equip.DoEquips(this);
this.Send(equip);
this.Equipment.UpdateEntityPacket();
}
if (Armor > 0)
{
Database.ConquerItemBaseInformation CIBI = Database.ConquerItemInformation.BaseInformations[Armor];
if (CIBI == null) return;
item7 = new ConquerItem(true);
item7.ID = Armor;
item7.UID = AuthClient.nextID;
AuthClient.nextID++;
item7.Position = 3;
item7.Durability = CIBI.Durability;
item7.MaximDurability = CIBI.Durability;
this.Equipment.Remove(3);
if (this.Equipment.Objects[2] != null)
{
this.Equipment.Objects[2] = null;
}
this.Equipment.Add(item7);
item7.Mode = Enums.ItemMode.Update;
item7.Send(this);
equip = new ClientEquip();
equip.DoEquips(this);
this.Send(equip);
this.Equipment.UpdateEntityPacket();
}
if (Head > 0)
{
Database.ConquerItemBaseInformation CIBI = Database.ConquerItemInformation.BaseInformations[Head];
if (CIBI == null) return;
item7 = new ConquerItem(true);
item7.ID = Head;
item7.UID = AuthClient.nextID;
AuthClient.nextID++;
item7.Position = 1;
item7.Durability = CIBI.Durability;
item7.MaximDurability = CIBI.Durability;
this.Equipment.Remove(1);
if (this.Equipment.Objects[0] != null)
{
this.Equipment.Objects[0] = null;
}
this.Equipment.Add(item7);
item7.Mode = Enums.ItemMode.Update;
item7.Send(this);
equip = new ClientEquip();
equip.DoEquips(this);
this.Send(equip);
this.Equipment.UpdateEntityPacket();
}
if (Garment > 0)
{
Database.ConquerItemBaseInformation CIBI = Database.ConquerItemInformation.BaseInformations[Garment];
if (CIBI == null) return;
item7 = new ConquerItem(true);
item7.ID = Garment;
item7.UID = AuthClient.nextID;
AuthClient.nextID++;
item7.Position = 9;
item7.Durability = CIBI.Durability;
item7.MaximDurability = CIBI.Durability;
this.Equipment.Remove(9);
if (this.Equipment.Objects[8] != null)
{
this.Equipment.Objects[8] = null;
}
this.Equipment.Add(item7);
item7.Mode = Enums.ItemMode.Update;
item7.Send(this);
equip = new ClientEquip();
equip.DoEquips(this);
this.Send(equip);
this.Equipment.UpdateEntityPacket();
}
#endregion Equip
Program.World.Register(this);
Kernel.GamePool.Add(Entity.UID, this);
FakeLoaded = true;
LoggedIn = true;
Entity.NobilityRank = NobilityInformation.Rank;
this.Entity.MinAttack = 20000;
this.Entity.MaxAttack = 23200;
this.Attackable = true;
}
}
}
}
#region Attack
#region Attack
if (Now > client.Entity.AttackStamp.AddSeconds(1))
{
if (SomailProject.MyMath.Success(ai.ShootChance))
{
var dist = Kernel.GetDistance(Bot.Entity.X, Bot.Entity.Y, Target.X, Target.Y);
var spelldist = SpellTable.SpellInformations[spell.ID][spell.Level].Range;
if (dist < spelldist)
{
var interact = new Attack(true);
interact.AttackType = Attack.Magic;
interact.MagicType = spell.ID;
interact.Attacker = Bot.Entity.UID;
interact.Attacked = Target.UID;
interact.MagicLevel = spell.Level;
interact.Decoded = true;
if (SomailProject.MyMath.Success(ai.Accuracy))
{
interact.X = Target.X;
interact.Y = Target.Y;
}
else
{
interact.X = (ushort)(Target.X + 1);
interact.Y = (ushort)(Target.Y + 1);
}
Bot.Entity.MinAttack = 5000;
Bot.Entity.MaxAttack = 7300;
Bot.Entity.AttackPacket = interact;
interact.Damage = 7000;
new SomailProject.Game.Attacking.Handle(interact, Bot.Entity, Target);
}
//if (dist < 2)
//{
// var interact = new Attack(true);
// interact.AttackType = Attack.Melee;
// interact.Attacker = Bot.Entity.UID;
// interact.Attacked = Target.UID;
// if (Kernel.ChanceSuccess(ai.Accuracy))
// {
// interact.X = Target.X;
// interact.Y = Target.Y;
// }
// else
// {
// interact.X = (ushort)(Target.X + 1);
// interact.Y = (ushort)(Target.Y + 1);
// }
// Bot.Entity.AttackPacket = interact;
// new SomailProject.Game.Attacking.Handle(interact, Bot.Entity, Target);
//}
}
}
#endregion
public void SpawnElitePKBot(
public void SpawnElitePKBot(uint UID)
{
if (!Kernel.GamePool.ContainsKey(UID))
{
ReadyToPlay();
this.Account = new Database.AccountTable(null);
this.Account.EntityID = UID;
{
#region Load Entity
this.Entity = new Game.Entity(EntityFlag.Entity, false);
this.Entity.Name = "ElitePK`Bot";
this.Entity.Owner = this;
this.Entity.UID = UID;
this.Entity.Body = EliteBody();
this.Entity.Face = (ushort)Kernel.Random.Next(1, 50);
byte Color = (byte)Kernel.Random.Next(4, 8);
this.Entity.HairStyle = (ushort)(Color * 100 + 10 + (byte)Kernel.Random.Next(4, 9));
this.Entity.Level = 140;
this.Entity.Class = 55;
this.Entity.Reborn = 2;
this.Entity.Titles = new System.Collections.Concurrent.ConcurrentDictionary<TitlePacket.Titles, DateTime>();
this.Entity.MyTitle = (TitlePacket.Titles)16;
this.Entity.MapID = ElitePKTournament.WaitingAreaID;
if (this.VendingDisguise == 0)
this.VendingDisguise = 0xdf;
this.Entity.X = 50;
this.Entity.Y = 50;
uint WeaponR = 601439;
uint WeaponL = 601439;
uint Armor = 135309;
uint Head = 123309;
uint Garment = 192685;
this.ElitePKStats = new ElitePK.FighterStats(this.Entity.UID, this.Entity.Name, this.Entity.Mesh);
if (!Game.ConquerStructures.Nobility.Board.TryGetValue(this.Entity.UID, out this.NobilityInformation))
{
this.NobilityInformation = new NobilityInformation();
this.NobilityInformation.EntityUID = this.Entity.UID;
this.NobilityInformation.Name = this.Entity.Name;
this.NobilityInformation.Donation = 0L;
this.NobilityInformation.Rank = NobilityRank.Serf;
this.NobilityInformation.Position = -1;
this.NobilityInformation.Gender = 1;
this.NobilityInformation.Mesh = this.Entity.Mesh;
if ((this.Entity.Body % 10) >= 3)
{
this.NobilityInformation.Gender = 0;
}
}
else
{
this.Entity.NobilityRank = this.NobilityInformation.Rank;
}
Arena.ArenaStatistics.TryGetValue(this.Entity.UID, out this.ArenaStatistic);
if ((this.ArenaStatistic == null) || (this.ArenaStatistic.EntityID == 0))
{
this.ArenaStatistic = new ArenaStatistic(true);
this.ArenaStatistic.EntityID = this.Entity.UID;
this.ArenaStatistic.Name = this.Entity.Name;
this.ArenaStatistic.Level = this.Entity.Level;
this.ArenaStatistic.Class = this.Entity.Class;
this.ArenaStatistic.Model = this.Entity.Mesh;
this.ArenaStatistic.ArenaPoints = Database.ArenaTable.ArenaPointFill(this.Entity.Level);
this.ArenaStatistic.LastArenaPointFill = DateTime.Now;
Database.ArenaTable.InsertArenaStatistic(this);
this.ArenaStatistic.Status = 0;
Arena.ArenaStatistics.Add(this.Entity.UID, this.ArenaStatistic);
}
else
{
this.ArenaStatistic.Level = this.Entity.Level;
this.ArenaStatistic.Class = this.Entity.Class;
this.ArenaStatistic.Model = this.Entity.Mesh;
if (DateTime.Now.DayOfYear != this.ArenaStatistic.LastArenaPointFill.DayOfYear)
{
this.ArenaStatistic.LastSeasonArenaPoints = this.ArenaStatistic.ArenaPoints;
this.ArenaStatistic.LastSeasonWin = this.ArenaStatistic.TodayWin;
this.ArenaStatistic.LastSeasonLose = this.ArenaStatistic.TodayBattles - this.ArenaStatistic.TodayWin;
this.ArenaStatistic.ArenaPoints = Database.ArenaTable.ArenaPointFill(this.Entity.Level);
this.ArenaStatistic.LastArenaPointFill = DateTime.Now;
this.ArenaStatistic.TodayWin = 0;
this.ArenaStatistic.TodayBattles = 0;
Arena.Sort();
Arena.YesterdaySort();
}
}
TeamArena.ArenaStatistics.TryGetValue(this.Entity.UID, out this.TeamArenaStatistic);
if (this.TeamArenaStatistic == null)
{
this.TeamArenaStatistic = new TeamArenaStatistic(true);
this.TeamArenaStatistic.EntityID = this.Entity.UID;
this.TeamArenaStatistic.Name = this.Entity.Name;
this.TeamArenaStatistic.Level = this.Entity.Level;
this.TeamArenaStatistic.Class = this.Entity.Class;
this.TeamArenaStatistic.Model = this.Entity.Mesh;
Database.TeamArenaTable.InsertArenaStatistic(this);
this.TeamArenaStatistic.Status = 0;
if (TeamArena.ArenaStatistics.ContainsKey(this.Entity.UID))
{
TeamArena.ArenaStatistics.Remove(this.Entity.UID);
}
TeamArena.ArenaStatistics.Add(this.Entity.UID, this.TeamArenaStatistic);
}
else if (this.TeamArenaStatistic.EntityID == 0)
{
this.TeamArenaStatistic = new TeamArenaStatistic(true);
this.TeamArenaStatistic.EntityID = this.Entity.UID;
this.TeamArenaStatistic.Name = this.Entity.Name;
this.TeamArenaStatistic.Level = this.Entity.Level;
this.TeamArenaStatistic.Class = this.Entity.Class;
this.TeamArenaStatistic.Model = this.Entity.Mesh;
Database.TeamArenaTable.InsertArenaStatistic(this);
this.TeamArenaStatistic.Status = 0;
if (TeamArena.ArenaStatistics.ContainsKey(this.Entity.UID))
{
TeamArena.ArenaStatistics.Remove(this.Entity.UID);
}
TeamArena.ArenaStatistics.Add(this.Entity.UID, this.TeamArenaStatistic);
}
else
{
this.TeamArenaStatistic.Level = this.Entity.Level;
this.TeamArenaStatistic.Class = this.Entity.Class;
this.TeamArenaStatistic.Model = this.Entity.Mesh;
this.TeamArenaStatistic.Name = this.Entity.Name;
}
Database.DetainedItemTable.LoadDetainedItems(this);
Database.ClaimItemTable.LoadClaimableItems(this);
this.Entity.LoadTopStatus();
this.Entity.FullyLoaded = true;
#endregion
if (this.Entity.FullyLoaded)
{
VariableVault variables;
Database.EntityVariableTable.Load(this.Account.EntityID, out variables);
this.Variables = variables;
if (this.BackupArmorLook != 0)
this.SetNewArmorLook(this.BackupArmorLook);
else
this.SetNewArmorLook(this.ArmorLook);
this.SetNewHeadgearLook(this.HeadgearLook);
this.BackupArmorLook = 0;
this.LoadData(true);
if (this.Entity.GuildID != 0)
this.Entity.GuildBattlePower = this.Guild.GetSharedBattlepower(this.Entity.GuildRank);
this.ReviewMentor();
Network.PacketHandler.LoginMessages(this);
#region Equip
ConquerItem item7 = null;
ClientEquip equip = null;
if (WeaponR > 0)
{
Database.ConquerItemBaseInformation CIBI = Database.ConquerItemInformation.BaseInformations[WeaponR];
if (CIBI == null) return;
item7 = new ConquerItem(true);
item7.ID = WeaponR;
item7.UID = AuthClient.nextID;
AuthClient.nextID++;
item7.Position = 4;
item7.Durability = CIBI.Durability;
item7.MaximDurability = CIBI.Durability;
this.Equipment.Remove(4);
if (this.Equipment.Objects[3] != null)
{
this.Equipment.Objects[3] = null;
}
this.Equipment.Add(item7);
item7.Mode = Enums.ItemMode.Update;
item7.Send(this);
equip = new ClientEquip();
equip.DoEquips(this);
this.Send(equip);
this.Equipment.UpdateEntityPacket();
}
if (WeaponL > 0)
{
Database.ConquerItemBaseInformation CIBI = Database.ConquerItemInformation.BaseInformations[WeaponL];
if (CIBI == null) return;
item7 = new ConquerItem(true);
item7.ID = WeaponL;
item7.UID = AuthClient.nextID;
AuthClient.nextID++;
item7.Position = 5;
item7.Durability = CIBI.Durability;
item7.MaximDurability = CIBI.Durability;
this.Equipment.Remove(5);
if (this.Equipment.Objects[4] != null)
{
this.Equipment.Objects[4] = null;
}
this.Equipment.Add(item7);
item7.Mode = Enums.ItemMode.Update;
item7.Send(this);
equip = new ClientEquip();
equip.DoEquips(this);
this.Send(equip);
this.Equipment.UpdateEntityPacket();
}
if (Armor > 0)
{
Database.ConquerItemBaseInformation CIBI = Database.ConquerItemInformation.BaseInformations[Armor];
if (CIBI == null) return;
item7 = new ConquerItem(true);
item7.ID = Armor;
item7.UID = AuthClient.nextID;
AuthClient.nextID++;
item7.Position = 3;
item7.Durability = CIBI.Durability;
item7.MaximDurability = CIBI.Durability;
this.Equipment.Remove(3);
if (this.Equipment.Objects[2] != null)
{
this.Equipment.Objects[2] = null;
}
this.Equipment.Add(item7);
item7.Mode = Enums.ItemMode.Update;
item7.Send(this);
equip = new ClientEquip();
equip.DoEquips(this);
this.Send(equip);
this.Equipment.UpdateEntityPacket();
}
if (Head > 0)
{
Database.ConquerItemBaseInformation CIBI = Database.ConquerItemInformation.BaseInformations[Head];
if (CIBI == null) return;
item7 = new ConquerItem(true);
item7.ID = Head;
item7.UID = AuthClient.nextID;
AuthClient.nextID++;
item7.Position = 1;
item7.Durability = CIBI.Durability;
item7.MaximDurability = CIBI.Durability;
this.Equipment.Remove(1);
if (this.Equipment.Objects[0] != null)
{
this.Equipment.Objects[0] = null;
}
this.Equipment.Add(item7);
item7.Mode = Enums.ItemMode.Update;
item7.Send(this);
equip = new ClientEquip();
equip.DoEquips(this);
this.Send(equip);
this.Equipment.UpdateEntityPacket();
}
if (Garment > 0)
{
Database.ConquerItemBaseInformation CIBI = Database.ConquerItemInformation.BaseInformations[Garment];
if (CIBI == null) return;
item7 = new ConquerItem(true);
item7.ID = Garment;
item7.UID = AuthClient.nextID;
AuthClient.nextID++;
item7.Position = 9;
item7.Durability = CIBI.Durability;
item7.MaximDurability = CIBI.Durability;
this.Equipment.Remove(9);
if (this.Equipment.Objects[8] != null)
{
this.Equipment.Objects[8] = null;
}
this.Equipment.Add(item7);
item7.Mode = Enums.ItemMode.Update;
item7.Send(this);
equip = new ClientEquip();
equip.DoEquips(this);
this.Send(equip);
this.Equipment.UpdateEntityPacket();
}
#endregion Equip
Program.World.Register(this);
Kernel.GamePool.Add(Entity.UID, this);
FakeLoaded = true;
LoggedIn = true;
Entity.NobilityRank = NobilityInformation.Rank;
this.Entity.MinAttack = 20000;
this.Entity.MaxAttack = 23200;
this.Attackable = true;
}
}
}
}
#region Attack
#region Attack
if (Now > client.Entity.AttackStamp.AddSeconds(1))
{
if (SomailProject.MyMath.Success(ai.ShootChance))
{
var dist = Kernel.GetDistance(Bot.Entity.X, Bot.Entity.Y, Target.X, Target.Y);
var spelldist = SpellTable.SpellInformations[spell.ID][spell.Level].Range;
if (dist < spelldist)
{
var interact = new Attack(true);
interact.AttackType = Attack.Magic;
interact.MagicType = spell.ID;
interact.Attacker = Bot.Entity.UID;
interact.Attacked = Target.UID;
interact.MagicLevel = spell.Level;
interact.Decoded = true;
if (SomailProject.MyMath.Success(ai.Accuracy))
{
interact.X = Target.X;
interact.Y = Target.Y;
}
else
{
interact.X = (ushort)(Target.X + 1);
interact.Y = (ushort)(Target.Y + 1);
}
Bot.Entity.MinAttack = 5000;
Bot.Entity.MaxAttack = 7300;
Bot.Entity.AttackPacket = interact;
interact.Damage = 7000;
new SomailProject.Game.Attacking.Handle(interact, Bot.Entity, Target);
}
//if (dist < 2)
//{
// var interact = new Attack(true);
// interact.AttackType = Attack.Melee;
// interact.Attacker = Bot.Entity.UID;
// interact.Attacked = Target.UID;
// if (Kernel.ChanceSuccess(ai.Accuracy))
// {
// interact.X = Target.X;
// interact.Y = Target.Y;
// }
// else
// {
// interact.X = (ushort)(Target.X + 1);
// interact.Y = (ushort)(Target.Y + 1);
// }
// Bot.Entity.AttackPacket = interact;
// new SomailProject.Game.Attacking.Handle(interact, Bot.Entity, Target);
//}
}
}
#endregion
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
أدوات الموضوع | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
مشكلة فى Teampk and skillTeamPK | body2020 | مشكلات السيرفيرات كونكر الشخصيه | 2 | 2022-04-09 10:56 AM |