Пример #1
0
        /// <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);
        }
Пример #2
0
        /// <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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        /// <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);
        }
Пример #5
0
        /// <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);
        }
Пример #6
0
        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);
        }
Пример #7
0
        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);
        }
Пример #8
0
        /// <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);
        }
Пример #9
0
        /// <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);
        }
Пример #10
0
        /// <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);
        }
Пример #11
0
 /// <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));
 }
Пример #12
0
        /// <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);
        }
Пример #13
0
 public static void MsgBox(Client client, MabiCreature creature, string format, params object[] args)
 {
     MsgBox(client, creature, MsgBoxTitle.Notice, MsgBoxButtons.Close, MsgBoxAlign.Center, format, args);
 }
Пример #14
0
        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);
        }
Пример #15
0
 public static void GestureResponse(Client client, MabiCreature creature, bool success)
 {
     var p = new MabiPacket(Op.UseGestureR, creature.Id);
     p.PutByte(success);
     client.Send(p);
 }
Пример #16
0
        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);
        }
Пример #17
0
 public static void SystemMessage(Client client, MabiCreature creature, string format, params object[] args)
 {
     SystemMessage(client, creature, "<SYSTEM>", format, args);
 }
Пример #18
0
 public static void Notice(Client client, NoticeType type, uint duration, string format, params object[] args)
 {
     client.Send(GetNotice(type, duration, format, args));
 }
Пример #19
0
 public static void Notice(Client client, NoticeType type, string format, params object[] args)
 {
     Notice(client, type, 0, format, args);
 }
Пример #20
0
        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);
        }
Пример #21
0
 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);
 }
Пример #22
0
        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);
        }
Пример #23
0
        /// <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);
        }
Пример #24
0
        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);
        }
Пример #25
0
        public static void UnreadMailCount(Client client, MabiCreature creature, uint count)
        {
            var packet = new MabiPacket(Op.UnreadMailCount, creature.Id);
            packet.PutInt(count);

            client.Send(packet);
        }
Пример #26
0
        /// <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);
        }
Пример #27
0
        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);
        }
Пример #28
0
        /// <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);
        }
Пример #29
0
 public static void CombatMessage(Client client, MabiCreature creature, string format, params object[] args)
 {
     SystemMessage(client, creature, "<COMBAT>", format, args);
 }
Пример #30
0
 public static void SendSkillPrepareFail(Client client, MabiCreature creature)
 {
     SkillPrepare(client, creature, SkillConst.None, 0);
 }