PSO2SERVER/Server/Protocol/Packets/0B-QuestPacket/0B-1A-QuestDifficultyPacket.cs

66 lines
2.0 KiB
C#
Raw Normal View History

2024-09-10 00:31:40 +08:00
using System;
using System.Runtime.InteropServices;
2024-09-10 01:13:20 +08:00
using PSO2SERVER.Models;
2024-09-10 00:31:40 +08:00
namespace PSO2SERVER.Protocol.Packets
2024-09-10 00:31:40 +08:00
{
class QuestDifficultyPacket : Packet
{
private QuestDifficulty[] questdiffs;
public QuestDifficultyPacket(QuestDifficulty[] questdiffs)
{
// Setup dummy difficulty entries
for (int i = 0; i < questdiffs.Length; i++)
{
QuestDifficultyEntry difficulty = new QuestDifficultyEntry
{
2024-10-23 20:44:09 +08:00
ReqLevel = 1,
SubClassReqLevel = 0,
MonsterLevel = 1,
Unk1 = 1,
AbilityAdj = 0,
DmgLimit = 0,
TimeLimit = 0,
TimeLimit2 = 0,
SuppTarget = 0xFFFFFFFF,
Unk2 = 7,
Enemy1 = 0xFFFFFFFF,
Unk3 = 3,
Enemy2 = 0xFFFFFFFF,
Unk4 = 3
2024-09-10 00:31:40 +08:00
};
questdiffs[i].difficulty1 = difficulty;
questdiffs[i].difficulty2 = difficulty;
questdiffs[i].difficulty3 = difficulty;
questdiffs[i].difficulty4 = difficulty;
questdiffs[i].difficulty5 = difficulty;
questdiffs[i].difficulty6 = difficulty;
questdiffs[i].difficulty7 = difficulty;
questdiffs[i].difficulty8 = difficulty;
}
this.questdiffs = questdiffs;
}
public override byte[] Build()
{
PacketWriter writer = new PacketWriter();
writer.WriteMagic((uint)questdiffs.Length, 0x292C, 0x5B);
foreach (QuestDifficulty d in questdiffs)
{
writer.WriteStruct(d);
}
return writer.ToArray();
}
public override PacketHeader GetHeader()
{
2024-10-23 20:44:09 +08:00
return new PacketHeader(0x0B, 0x1A, PacketFlags.PACKED);
2024-09-10 00:31:40 +08:00
}
}
}