コード例 #1
0
ファイル: Ability.cs プロジェクト: Necrosummon/WarEmu
        public void SendAbilityDone(ushort TargetOID)
        {
            Log.Success("Ability", "Send Done :" + Info.Entry);

            Player player = this.Caster.GetPlayer();
            PacketOut Out1 = new PacketOut((byte)Opcodes.F_USE_ABILITY);
            Out1.WriteUInt16(0);
            Out1.WriteUInt16(Info.Entry);
            Out1.WriteUInt16(Caster.Oid);
            Out1.WriteHexStringBytes("061022730601000001E601000000");
            player.DispatchPacket(Out1, true);

            PacketOut Out2 = new PacketOut((byte)Opcodes.F_USE_ABILITY);
            Out2.WriteUInt16(0);
            Out2.WriteUInt16(Info.Entry);
            Out2.WriteUInt16(Caster.Oid);
            Out2.WriteHexStringBytes("0610227302010000000001000000");
            player.DispatchPacket(Out2, true);

            PacketOut Out3 = new PacketOut((byte)Opcodes.F_SWITCH_ATTACK_MODE);
            Out3.WriteByte(1);
            Out3.Fill(0, 3);
            player.SendPacket(Out3);

            PacketOut Out4 = new PacketOut((byte)Opcodes.F_SET_ABILITY_TIMER);
            Out4.WriteUInt16(Info.Entry);
            Out4.Fill(0, 10);
            player.SendPacket(Out4);
        }
コード例 #2
0
ファイル: Player.cs プロジェクト: dzikun/WarEmu
        public void SendSniff(string Str)
        {
            string Result = "";
            using (StringReader Reader = new StringReader(Str))
            {
                string Line;
                while ((Line = Reader.ReadLine()) != null)
                {
                    Result+=Line.Substring(1, 48).Replace(" ", string.Empty);
                }
            }

            Result = Result.Remove(0, 4);
            byte Opcode = Convert.ToByte(Result.Substring(0, 2), 16);
            Result = Result.Remove(0, 2);

            PacketOut Out = new PacketOut(Opcode);
            Out.WriteHexStringBytes(Result);
            Out.WritePacketLength();
            SendPacket(Out);
        }