当前位置: 首页>>代码示例>>C#>>正文


C# MabiPacket类代码示例

本文整理汇总了C#中MabiPacket的典型用法代码示例。如果您正苦于以下问题:C# MabiPacket类的具体用法?C# MabiPacket怎么用?C# MabiPacket使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MabiPacket类属于命名空间,在下文中一共展示了MabiPacket类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PvPInformation

        /// <summary>
        /// Broadcasts pvp information for creature in range.
        /// </summary>
        /// <param name="client"></param>
        /// <param name="creature"></param>
        public static void PvPInformation(MabiCreature creature)
        {
            var packet = new MabiPacket(Op.PvPInformation, creature.Id);
            packet.AddPvPInfo(creature);

            WorldManager.Instance.Broadcast(packet, SendTargets.Range, creature);
        }
开发者ID:Fuhhue,项目名称:aura_legacy,代码行数:12,代码来源:Send.PvP.cs

示例2: QuestUpdate

        public static void QuestUpdate(MabiCreature creature, MabiQuest quest)
        {
            var packet = new MabiPacket(Op.QuestUpdate, creature.Id);
            packet.AddQuestProgress(quest);

            creature.Client.Send(packet);
        }
开发者ID:Fuhhue,项目名称:aura_legacy,代码行数:7,代码来源:Send.Quest.cs

示例3: QuestNew

        public static void QuestNew(MabiPC character, MabiQuest quest)
        {
            var packet = new MabiPacket(Op.QuestNew, character.Id);
            packet.AddQuest(quest);

            character.Client.Send(packet);
        }
开发者ID:Fuhhue,项目名称:aura_legacy,代码行数:7,代码来源:Send.Quest.cs

示例4: SkillCancel

        /// <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);
        }
开发者ID:Fuhhue,项目名称:aura_legacy,代码行数:12,代码来源:Send.Skill.cs

示例5: Prepare

        public override SkillResults Prepare(MabiCreature creature, MabiSkill skill, MabiPacket packet, uint castTime)
        {
            Send.Flash(creature);
            Send.SkillPrepare(creature.Client, creature, skill.Id, castTime);

            return SkillResults.Okay;
        }
开发者ID:nvrlcky,项目名称:aura,代码行数:7,代码来源:MagnumShotHandler.cs

示例6: ItemUpdate

        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);
        }
开发者ID:pjm0616,项目名称:aura,代码行数:7,代码来源:Send.Item.cs

示例7: AcquireAp

 public static MabiPacket AcquireAp(MabiCreature creature, uint amount)
 {
     var p = new MabiPacket(Op.AcquireInfo, creature.Id);
     p.PutString("<xml type='ap' value='{0}' simple='true' onlyLog='false' />", amount);
     p.PutInt(3000);
     return p;
 }
开发者ID:nvrlcky,项目名称:aura,代码行数:7,代码来源:PacketCreator.cs

示例8: DisconnectResponse

        /// <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);
        }
开发者ID:Fuhhue,项目名称:aura_legacy,代码行数:11,代码来源:Send.Misc.cs

示例9: PlaySound

        /// <summary>
        /// Plays sound in range of source.
        /// </summary>
        /// <param name="file">e.g. "data/sound/Glasgavelen_blowaway_endure.wav"</param>
        public static void PlaySound(string file, MabiEntity source)
        {
            var packet = new MabiPacket(Op.PlaySound, source.Id);
            packet.PutString(file);

            WorldManager.Instance.Broadcast(packet, SendTargets.Range, source);
        }
开发者ID:Fuhhue,项目名称:aura_legacy,代码行数:11,代码来源:Send.Sound.cs

示例10: AgeIncrease

        /// <summary>
        /// Sends Age Increase Packet
        /// </summary>
        /// <param name="client"></param>
        /// <param name="creature"></param>
        /// <param name="age"></param>
        public static void AgeIncrease(WorldClient client, MabiPC player, ushort age)
        {
            var p = new MabiPacket(Op.AgeIncrease, player.Id);
            p.PutShort(age);

            client.Send(p);
        }
开发者ID:Fuhhue,项目名称:aura_legacy,代码行数:13,代码来源:Send.Character.cs

示例11: Use

        public override SkillResults Use(MabiCreature creature, MabiSkill skill, MabiPacket packet)
        {
            var targetId = packet.GetLong();
            var target = WorldManager.Instance.GetCreatureById(targetId);
            if (target == null)
                return SkillResults.InvalidTarget;

            if (creature != target && !WorldManager.InRange(creature, target, 1000))
                return SkillResults.OutOfRange;

            // Reduce Stamina equal to healing amount if a player
            // is using the skill on himself.
            if (creature == target && creature is MabiPC)
            {
                var amount = Math.Min(skill.RankInfo.Var1, creature.LifeInjured - creature.Life);
                if (creature.Stamina < amount)
                    return SkillResults.InsufficientStamina;

                creature.Stamina -= amount;
            }

            target.Life += skill.RankInfo.Var1;
            WorldManager.Instance.CreatureStatsUpdate(target);

            SkillHelper.DecStack(creature, skill);

            WorldManager.Instance.Broadcast(new MabiPacket(Op.Effect, creature.Id).PutInt(Effect.UseMagic).PutString("healing").PutLong(target.Id), SendTargets.Range, creature);
            WorldManager.Instance.Broadcast(new MabiPacket(Op.Effect, creature.Id).PutInt(Effect.StackUpdate).PutString("healing_stack").PutBytes(creature.ActiveSkillStacks, 0), SendTargets.Range, creature);

            SkillHelper.GiveSkillExp(creature, skill, 20);

            Send.SkillUse(creature.Client, creature, skill.Id, targetId);

            return SkillResults.Okay;
        }
开发者ID:nvrlcky,项目名称:aura,代码行数:35,代码来源:HealHandler.cs

示例12: AcquireItem

 public static MabiPacket AcquireItem(MabiCreature creature, uint cls, uint amount)
 {
     var p = new MabiPacket(Op.AcquireInfo, creature.Id);
     p.PutString("<xml type='item' classid='{0}' value='{1}'/>", cls, amount);
     p.PutInt(3000);
     return p;
 }
开发者ID:nvrlcky,项目名称:aura,代码行数:7,代码来源:PacketCreator.cs

示例13: AcquireStat

 public static MabiPacket AcquireStat(MabiCreature creature, string statName, double amount)
 {
     var p = new MabiPacket(Op.AcquireInfo, creature.Id);
     p.PutString("<xml type='{0}' value='{1}' simple='true' onlyLog='false' />", statName, (uint)amount);
     p.PutInt(3000);
     return p;
 }
开发者ID:Fuhhue,项目名称:aura_legacy,代码行数:7,代码来源:PacketCreator.cs

示例14: GuildDonateR

        /// <summary>
        /// Sends GuildDonateR to creature's client.
        /// </summary>
        public static void GuildDonateR(MabiCreature creature, bool success)
        {
            var packet = new MabiPacket(Op.GuildDonateR, creature.Id);
            packet.PutByte(success);

            creature.Client.Send(packet);
        }
开发者ID:Fuhhue,项目名称:aura_legacy,代码行数:10,代码来源:Send.Guild.cs

示例15: ConvertGpConfirmR

        /// <summary>
        /// Sends ConvertGpConfirmR to creature's client.
        /// </summary>
        public static void ConvertGpConfirmR(MabiCreature creature, bool success)
        {
            var packet = new MabiPacket(Op.ConvertGpConfirmR, creature.Id);
            packet.PutByte(success);

            creature.Client.Send(packet);
        }
开发者ID:Fuhhue,项目名称:aura_legacy,代码行数:10,代码来源:Send.Guild.cs


注:本文中的MabiPacket类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。