|
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.Flags.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.MsgUpdate.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.Attack);
MsgAttackPacket.Process(client, action);
}*/
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
}