/// <summary> /// Sends disconnect info response. /// </summary> /// <param name="client"></param> public static void DisconnectResponse(Client client) { var packet = new MabiPacket(Op.WorldDisconnectR, Id.World); packet.PutByte(0); client.Send(packet); }
/// <summary> /// Simple skill cancel. /// </summary> /// <param name="client"></param> /// <param name="creature"></param> public static void SkillCancel(Client client, MabiCreature creature) { var packet = new MabiPacket(Op.SkillCancel, creature.Id); packet.PutBytes(0, 1); client.Send(packet); }
public static void ItemUpdate(Client client, MabiCreature creature, MabiItem item) { var packet = new MabiPacket(Op.ItemUpdate, creature.Id); packet.AddItemInfo(item, ItemPacketType.Private); client.Send(packet); }
/// <summary> /// Sends item box packet for fixed dyed item to client. /// </summary> /// <param name="client"></param> /// <param name="creature"></param> /// <param name="itemId"></param> public static void AcquireDyedItem(Client client, MabiCreature creature, ulong itemId) { var packet = new MabiPacket(Op.AcquireInfo2, creature.Id); packet.PutString("<xml type='fixed_color_dyeing' objectid='{0}'/>", itemId); packet.PutInt(3000); client.Send(packet); }
/// <summary> /// Fixed dye complete /// </summary> /// <param name="client"></param> /// <param name="creature"></param> /// <param name="skillId"></param> /// <param name="part"></param> public static void DyeSkillComplete(Client client, MabiCreature creature, SkillConst skillId, uint part) { var packet = new MabiPacket(Op.SkillComplete, creature.Id); packet.PutShort((ushort)skillId); packet.PutInt(part); client.Send(packet); }
public static void ChangeTitleResponse(Client client, MabiCreature creature, bool titleSuccess, bool optionTitleSuccess) { var packet = new MabiPacket(Op.ChangeTitleR, creature.Id); packet.PutByte(titleSuccess); packet.PutByte(optionTitleSuccess); client.Send(packet); }
public static void GuildstoneLocation(Client client, MabiCreature creature) { var packet = new MabiPacket(Op.GuildstoneLocation, creature.Id); packet.PutByte(1); packet.PutInts(creature.Guild.Region); packet.PutInts(creature.Guild.X); packet.PutInts(creature.Guild.Y); client.Send(packet); }
/// <summary> /// Sends positive login response. /// </summary> /// <param name="client"></param> /// <param name="creature"></param> public static void LoginResponse(Client client, MabiCreature creature) { var packet = new MabiPacket(Op.WorldLoginR, Id.World); packet.PutByte(true); packet.PutLong(creature.Id); packet.PutLong(MabiTime.Now.DateTime); packet.PutInt(1); packet.PutString(""); client.Send(packet); }
/// <summary> /// Sends character info (5209). Response is negative if character is null. /// </summary> /// <param name="client"></param> /// <param name="character"></param> public static void CharacterInfo(Client client, MabiPC character) { var packet = new MabiPacket(Op.WorldCharInfoRequestR, Id.World); if (character != null) { packet.PutByte(true); packet.AddCreatureInfo(character, CreaturePacketType.Private); } else { packet.PutByte(false); } client.Send(packet); }
/// <summary> /// Sends whisper chat to client. /// </summary> public static void Whisper(Client client, MabiCreature creature, string sender, string format, params object[] args) { var packet = new MabiPacket(Op.WhisperChat, creature.Id); packet.PutStrings(sender); packet.PutString(format, args); client.Send(packet); }
/// <summary> /// Sends dispappear to client. /// </summary> /// <param name="client"></param> /// <param name="entity"></param> public static void EntityDisappears(Client client, MabiEntity entity) { client.Send(GetEntityDisappears(entity)); }
/// <summary> /// Sends list of disappearing entites to client. /// </summary> /// <param name="client"></param> /// <param name="entities"></param> public static void EntitiesDisappear(Client client, IEnumerable<MabiEntity> entities) { var packet = new MabiPacket(Op.EntitiesDisappear, Id.Broadcast); packet.PutShort((ushort)entities.Count()); foreach (var entity in entities) { packet.PutShort(entity.DataType); packet.PutLong(entity.Id); } client.Send(packet); }
public static void MsgBox(Client client, MabiCreature creature, string format, params object[] args) { MsgBox(client, creature, MsgBoxTitle.Notice, MsgBoxButtons.Close, MsgBoxAlign.Center, format, args); }
public static void UseItemResponse(Client client, MabiCreature creature, bool success, uint itemClass) { var packet = new MabiPacket(Op.UseItemR, creature.Id); packet.PutByte(success); if (success) packet.PutInt(itemClass); client.Send(packet); }
public static void GestureResponse(Client client, MabiCreature creature, bool success) { var p = new MabiPacket(Op.UseGestureR, creature.Id); p.PutByte(success); client.Send(p); }
public static void SystemMessage(Client client, MabiCreature target, string from, string format, params object[] args) { var packet = new MabiPacket(Op.Chat, target.Id); packet.PutByte(0); packet.PutString(from); packet.PutString(format, args); packet.PutByte(1); packet.PutSInt(-32640); packet.PutInt(0); packet.PutByte(0); client.Send(packet); }
public static void SystemMessage(Client client, MabiCreature creature, string format, params object[] args) { SystemMessage(client, creature, "<SYSTEM>", format, args); }
public static void Notice(Client client, NoticeType type, uint duration, string format, params object[] args) { client.Send(GetNotice(type, duration, format, args)); }
public static void Notice(Client client, NoticeType type, string format, params object[] args) { Notice(client, type, 0, format, args); }
public static void MsgBox(Client client, MabiCreature creature, string title, MsgBoxButtons buttons, MsgBoxAlign align, string format, params object[] args) { var packet = new MabiPacket(Op.MsgBox, creature.Id); packet.PutString(format, args); // Can be sent with the title enum as byte as well. packet.PutString(title); packet.PutByte((byte)buttons); packet.PutByte((byte)align); client.Send(packet); }
public static void MsgBox(Client client, MabiCreature creature, MsgBoxTitle title, MsgBoxButtons buttons, MsgBoxAlign align, string format, params object[] args) { MsgBox(client, creature, title.ToString(), MsgBoxButtons.Close, MsgBoxAlign.Center, format, args); }
public static void EntitiesAppear(Client client, IEnumerable<MabiEntity> entities) { var packet = new MabiPacket(Op.EntitiesAppear, Id.Broadcast); packet.PutShort((ushort)entities.Count()); foreach (var entity in entities) { var data = new MabiPacket(0, 0); data.AddPublicEntityInfo(entity); var dataBytes = data.Build(false); packet.PutShort(entity.DataType); packet.PutInt((uint)dataBytes.Length); packet.PutBin(dataBytes); } client.Send(packet); }
/// <summary> /// Skill use with a delay? /// </summary> /// <param name="client"></param> /// <param name="creature"></param> /// <param name="skillId"></param> /// <param name="ms"></param> /// <param name="unk"></param> public static void SkillUse(Client client, MabiCreature creature, SkillConst skillId, uint ms, uint unk) { var packet = new MabiPacket(Op.SkillUse, creature.Id); packet.PutShort((ushort)skillId); packet.PutInts(ms, unk); client.Send(packet); }
public static void SkillUse(Client client, MabiCreature creature, SkillConst skillId, ulong targetId, uint unk1, uint unk2) { var packet = new MabiPacket(Op.SkillUse, creature.Id); packet.PutShort((ushort)skillId); if (skillId != SkillConst.None) { packet.PutLong(targetId); packet.PutInt(unk1); packet.PutInt(unk2); } client.Send(packet); }
public static void UnreadMailCount(Client client, MabiCreature creature, uint count) { var packet = new MabiPacket(Op.UnreadMailCount, creature.Id); packet.PutInt(count); client.Send(packet); }
/// <summary> /// Fixed dye use complete. /// </summary> /// <param name="client"></param> /// <param name="creature"></param> /// <param name="skillId"></param> /// <param name="part"></param> /// <param name="unk"></param> public static void SkillUseDye(Client client, MabiCreature creature, SkillConst skillId, uint part, byte unk) { var packet = new MabiPacket(Op.SkillUse, creature.Id); packet.PutShort((ushort)skillId); packet.PutInt(part); packet.PutByte(unk); client.Send(packet); }
public static void TalentInfoUpdate(Client client, MabiCreature creature) { var packet = new MabiPacket(Op.TalentInfoUpdate, creature.Id); packet.PutByte(true); packet.AddPrivateTalentInfo(creature); client.Send(packet); }
/// <summary> /// Character is logged in to a client only region, with one NPC. /// Used for Soul Stream, with Nao ([...]FFF) or Tin ([...]FFE). /// </summary> /// <param name="client"></param> /// <param name="character"></param> public static void SpecialLogin(Client client, MabiPC character, uint region, uint x, uint y, ulong npcId) { var packet = new MabiPacket(Op.SpecialLogin, Id.World); packet.PutByte(true); packet.PutInt(region); packet.PutInt(x); packet.PutInt(y); packet.PutLong(npcId); packet.AddCreatureInfo(character, CreaturePacketType.Private); client.Send(packet); }
public static void CombatMessage(Client client, MabiCreature creature, string format, params object[] args) { SystemMessage(client, creature, "<COMBAT>", format, args); }
public static void SendSkillPrepareFail(Client client, MabiCreature creature) { SkillPrepare(client, creature, SkillConst.None, 0); }