مشاهدة النسخة كاملة : مشكلة مش عارف في الوحش ولة في الاكونت
مشكلة في كل الاكونتات لمة بيجي يضرب في الوحش مش بيفضل يضرب ع طول لا لزم انا الي افضل اضرب ارجو الحل بعد ازنكو
انا عايز الحل او حد شيرح ازاي اعملو و انا عاملو عادي
عفواً لايمكن عرض الروابط في الإرشيف
شكران مقدمة ♥
World.cs
ابحث عن AutoAttackCallback
و بدله ب ده
private void AutoAttackCallback(GameState client, int time)
{
if (!Valid(client)) return;
Time32 Now = new Time32(time);
#region WaniacDance
if (client.Player.EpicWarrior() && client.Player.ContainsFlag3(Update.Flags3.WaniacDa nce))
{
var spell = Database.SpellTable.GetSpell(12700, client);
SpellUse suse = new SpellUse(true);
suse.Attacker = client.Player.UID;
suse.SpellID = 12700;
suse.X = client.Player.X;
suse.Y = client.Player.Y;
foreach (var obj in client.Screen.Objects)
{
if (obj == null) continue;
var attacked = obj as Entity;
if (attacked == null) continue;
if (Kernel.GetDistance(client.Player.X, client.Player.Y, attacked.X, attacked.Y) < 6)
{
if (Game.Attacking.Handle.CanAttack(client.Player, attacked, null, true))
{
var attack = new Attack(true);
attack.Attacker = client.Player.UID;
attack.Attacked = attacked.UID;
uint damage = Game.Attacking.Calculate.Melee(client.Player, attacked, spell, ref attack);
attack.Damage = damage;
attack.SpellID = 12700;
suse.Effect1 = attack.Effect1;
Game.Attacking.Handle.ReceiveAttack(client.Player, attacked, attack, ref damage, spell);
suse.AddTarget(attacked, damage, attack);
}
}
}
client.SendScreen(suse, true);
}
#endregion
if (client.Player.AttackPacket != null || client.Player.VortexPacket != null)
{
try
{
if (client.Player.ContainsFlag(Network.GamePackets.Up date.Flags.ShurikenVortex))
{
if (client.Player.VortexPacket != null && client.Player.VortexPacket.ToArray() != null)
{
if (Now > client.Player.VortexAttackStamp.AddMilliseconds(1) )
{
client.Player.VortexAttackStamp = Now;
client.Player.VortexPacket.AttackType = Attack.Magic;
new Game.Attacking.Handle(client.Player.VortexPacket, client.Player, null);
}
}
}
else
{
var AttackPacket = client.Player.AttackPacket;
if (AttackPacket != null && AttackPacket.ToArray() != null)
{
uint AttackType = AttackPacket.AttackType;
if (AttackType == Network.GamePackets.Attack.Magic || AttackType == Network.GamePackets.Attack.Melee || AttackType == Network.GamePackets.Attack.Ranged)
{
if (AttackType == Network.GamePackets.Attack.Magic)
{
if (Now > client.Player.AttackStamp.AddSeconds(2))
{
if (AttackPacket.Damage != 12160 &&
AttackPacket.Damage != 12170 &&
AttackPacket.Damage != 12120 &&
AttackPacket.Damage != 12130 &&
AttackPacket.Damage != 12140 &&
AttackPacket.Damage != 12320 &&
AttackPacket.Damage != 12330 &&
AttackPacket.Damage != 12340 &&
AttackPacket.Damage != 12570 &&
AttackPacket.Damage != 12210)
{
new Game.Attacking.Handle(AttackPacket, client.Player, null);
}
}
}
else
{
int decrease = -300;
if (client.Player.ContainsFlag4(Update.Flags4.xFreezi ngPelter)) decrease += 1000;
if (client.Player.OnCyclone())
decrease = 700;
if (client.Player.OnSuperman())
decrease = 200;
if (Now > client.Player.AttackStamp.AddMilliseconds((1000 - client.Player.Agility - decrease) * (int)(AttackType == Network.GamePackets.Attack.Ranged ? 1 : 1)))
{
new Game.Attacking.Handle(AttackPacket, client.Player, null);
}
}
}
}
}
}
catch (Exception e)
{
Program.SaveException(e);
client.Player.AttackPacket = null;
client.Player.VortexPacket = null;
}
}
}
World.cs
ابحث عن AutoAttackCallback
و بدله ب ده
private void AutoAttackCallback(GameState client, int time)
{
if (!Valid(client)) return;
Time32 Now = new Time32(time);
#region WaniacDance
if (client.Player.EpicWarrior() && client.Player.ContainsFlag3(Update.Flags3.WaniacDa nce))
{
var spell = Database.SpellTable.GetSpell(12700, client);
SpellUse suse = new SpellUse(true);
suse.Attacker = client.Player.UID;
suse.SpellID = 12700;
suse.X = client.Player.X;
suse.Y = client.Player.Y;
foreach (var obj in client.Screen.Objects)
{
if (obj == null) continue;
var attacked = obj as Entity;
if (attacked == null) continue;
if (Kernel.GetDistance(client.Player.X, client.Player.Y, attacked.X, attacked.Y) < 6)
{
if (Game.Attacking.Handle.CanAttack(client.Player, attacked, null, true))
{
var attack = new Attack(true);
attack.Attacker = client.Player.UID;
attack.Attacked = attacked.UID;
uint damage = Game.Attacking.Calculate.Melee(client.Player, attacked, spell, ref attack);
attack.Damage = damage;
attack.SpellID = 12700;
suse.Effect1 = attack.Effect1;
Game.Attacking.Handle.ReceiveAttack(client.Player, attacked, attack, ref damage, spell);
suse.AddTarget(attacked, damage, attack);
}
}
}
client.SendScreen(suse, true);
}
#endregion
if (client.Player.AttackPacket != null || client.Player.VortexPacket != null)
{
try
{
if (client.Player.ContainsFlag(Network.GamePackets.Up date.Flags.ShurikenVortex))
{
if (client.Player.VortexPacket != null && client.Player.VortexPacket.ToArray() != null)
{
if (Now > client.Player.VortexAttackStamp.AddMilliseconds(1) )
{
client.Player.VortexAttackStamp = Now;
client.Player.VortexPacket.AttackType = Attack.Magic;
new Game.Attacking.Handle(client.Player.VortexPacket, client.Player, null);
}
}
}
else
{
var AttackPacket = client.Player.AttackPacket;
if (AttackPacket != null && AttackPacket.ToArray() != null)
{
uint AttackType = AttackPacket.AttackType;
if (AttackType == Network.GamePackets.Attack.Magic || AttackType == Network.GamePackets.Attack.Melee || AttackType == Network.GamePackets.Attack.Ranged)
{
if (AttackType == Network.GamePackets.Attack.Magic)
{
if (Now > client.Player.AttackStamp.AddSeconds(2))
{
if (AttackPacket.Damage != 12160 &&
AttackPacket.Damage != 12170 &&
AttackPacket.Damage != 12120 &&
AttackPacket.Damage != 12130 &&
AttackPacket.Damage != 12140 &&
AttackPacket.Damage != 12320 &&
AttackPacket.Damage != 12330 &&
AttackPacket.Damage != 12340 &&
AttackPacket.Damage != 12570 &&
AttackPacket.Damage != 12210)
{
new Game.Attacking.Handle(AttackPacket, client.Player, null);
}
}
}
else
{
int decrease = -300;
if (client.Player.ContainsFlag4(Update.Flags4.xFreezi ngPelter)) decrease += 1000;
if (client.Player.OnCyclone())
decrease = 700;
if (client.Player.OnSuperman())
decrease = 200;
if (Now > client.Player.AttackStamp.AddMilliseconds((1000 - client.Player.Agility - decrease) * (int)(AttackType == Network.GamePackets.Attack.Ranged ? 1 : 1)))
{
new Game.Attacking.Handle(AttackPacket, client.Player, null);
}
}
}
}
}
}
catch (Exception e)
{
Program.SaveException(e);
client.Player.AttackPacket = null;
client.Player.VortexPacket = null;
}
}
}
بس انا سورس Msg سورس ابو جميل عشان انا لمة ضيفت دة جبلي مشاكل كتير
جرب ده
private void AutoAttackCallback(GameState client, int time)
{
try
{
if (client == null || !client.Entity.FullyLoaded || client.Entity == null)
return;
if (client.Entity.Alive == false)
{
if (DateTime.Now > client.Entity.GhostStamp)
{
if (client.Entity.Hitpoints == 0 && client.Entity.ContainFlag(Game.MsgServer.MsgUpdate .Flags.Dead) && !client.Entity.ContainFlag(MsgUpdate.Flags.Ghost))
{
client.Entity.AddFlag(Game.MsgServer.MsgUpdate.Fla gs.Ghost, Role.StatusFlagsBigVector32.PermanentFlag, true);
if (client.Entity.Body % 10 < 3)
client.Entity.TransformationID = 99;
else
client.Entity.TransformationID = 98;
}
}
}
ServerProject.MsgServer.Time32 timer = ServerProject.MsgServer.Time32.Now;
if (client.OnAutoAttack && client.Entity.Alive)
{
if (client.Entity.ContainFlag(Game.MsgServer.MsgUpdat e.Flags.Dizzy))
{
client.OnAutoAttack = false;
return;
}
InteractQuery action = new InteractQuery();
action = InteractQuery.ShallowCopy(client.AutoAttack);
client.Entity.RandomSpell = action.SpellID;
MsgAttackPacket.Process(client, action);
//MsgAttackPacket.ProcessAttack.Enqueue(new MsgAttackPacket.AttackObj() { User = client, Attack = action });
}
/* if (client.PrepareAttack != null)//&& client.TryAttacking > 0)
{
// client.TryAttacking--;
InteractQuery action = new InteractQuery();
action = InteractQuery.ShallowCopy(client.PrepareAttack.Att ack);
MsgAttackPacket.Process(client, action);
}*/
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
}
vBulletin® v3.8.8 Beta 1, Copyright ©2000-2024, TranZ by code