PSO2SERVER/Server/Protocol/Packets/0E-PartyPacket/0E-31-PartySetQuestPacket.cs

48 lines
1.5 KiB
C#
Raw Normal View History

2024-12-06 03:42:25 +08:00
using System;
using System.Runtime.InteropServices;
using PSO2SERVER.Json;
2024-12-06 03:42:25 +08:00
using PSO2SERVER.Models;
namespace PSO2SERVER.Protocol.Packets
{
class PartySetQuestPacket : Packet
{
public uint Name { get; set; }
public uint Difficulty { get; set; }
public QuestType QuestType { get; set; }
public QuestDef QuestDefiniton { get; set; }
public QuestDiff QuestDifficulty { get; set; }
2024-12-06 03:42:25 +08:00
public ObjectHeader Player { get; set; }
public ushort unk1 { get; set; } = 0;
public ushort unk2 { get; set; } = 0;
public PartySetQuestPacket(uint name, uint difficulty, QuestData questDate, uint player_id)
2024-12-06 03:42:25 +08:00
{
Name = name;
Difficulty = difficulty;
QuestDefiniton = questDate.QuestDefiniton;
QuestDifficulty = questDate.Difficulty;
Player = new ObjectHeader(player_id, ObjectType.Player);
2024-12-06 03:42:25 +08:00
}
public override byte[] Build()
{
PacketWriter pkt = new PacketWriter();
pkt.Write(Name); // Unknown
pkt.Write(Difficulty); // Unknown
pkt.Write((uint)QuestType);
QuestDefiniton.WriteToStream(pkt);
QuestDifficulty.WriteToStream(pkt);
pkt.WriteObjectHeader(Player);
pkt.Write(unk1);
pkt.Write(unk2);
return pkt.ToArray();
2024-12-06 03:42:25 +08:00
}
public override PacketHeader GetHeader()
{
return new PacketHeader(0x0E, 0x31, PacketFlags.None);
}
}
}