public static string GenerateCond(this Mate e) { return ($"cond 2 {e.MateTransportId} " + $"{(e.HasBuff(BCardType.CardType.SpecialAttack, (byte)AdditionalTypes.SpecialAttack.NoAttack) || e.Loyalty <= 0 ? 1 : 0)} " + $"{(e.HasBuff(BCardType.CardType.Move, (byte)AdditionalTypes.Move.MovementImpossible) || e.Loyalty <= 0 ? 1 : 0)} {e.Speed}"); }
/// <summary> /// ptctl packet /// </summary> /// <param name="packet"></param> public void PetMove(PtCtlPacket packet) { string[] packetsplit = packet.PacketEnd.Split(' '); for (int i = 0; i < packet.Amount * 3; i += 3) { if (packetsplit.Length < packet.Amount * 3) { continue; } if (!int.TryParse(packetsplit[i], out int petId) || !short.TryParse(packetsplit[i + 1], out short positionX) || !short.TryParse(packetsplit[i + 2], out short positionY)) { return; } Mate mate = Session.Character.Mates.FirstOrDefault(s => s.MateTransportId == petId); if (mate == null || mate.HasBuff(BCardType.CardType.Move, (byte)AdditionalTypes.Move.MovementImpossible)) { continue; } mate.PositionX = positionX; mate.PositionY = positionY; Session.CurrentMapInstance.Broadcast($"mv 2 {petId} {positionX} {positionY} {mate.Speed}"); } }