Skip to content

Commit

Permalink
Fix gossip code box.
Browse files Browse the repository at this point in the history
  • Loading branch information
ratkosrb committed Apr 26, 2022
1 parent 42f89b1 commit abb044a
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 2 deletions.
9 changes: 8 additions & 1 deletion HermesProxy/World/Client/PacketHandlers/CharacterHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,14 @@ void HandleLoginVerifyWorld(WorldPacket packet)
}
SendPacketToClient(info);

LoadCUFProfiles cuf = new LoadCUFProfiles();
SetAllTaskProgress tasks = new();
SendPacketToClient(tasks);

InitialSetup setup = new();
setup.ServerExpansionLevel = (byte)(LegacyVersion.GetExpansionVersion() - 1);
SendPacketToClient(setup);

LoadCUFProfiles cuf = new();
cuf.Data = GetSession().AccountDataMgr.LoadCUFProfiles();
SendPacketToClient(cuf);
}
Expand Down
2 changes: 1 addition & 1 deletion HermesProxy/World/Client/PacketHandlers/NPCHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void HandleGossipmessage(WorldPacket packet)
ClientGossipOption option = new ClientGossipOption();
option.OptionIndex = packet.ReadInt32();
option.OptionIcon = packet.ReadUInt8();
bool hasBox = packet.ReadBool();
option.OptionFlags = (byte)(packet.ReadBool() ? 1 : 0); // Code Box

if (LegacyVersion.AddedInVersion(ClientVersionBuild.V2_0_1_6180))
option.OptionCost = packet.ReadInt32();
Expand Down
47 changes: 47 additions & 0 deletions HermesProxy/World/Server/Packets/MiscPackets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,53 @@ public override void Write()
public uint? InstanceGroupSize;
}

public class SetAllTaskProgress : ServerPacket
{
public SetAllTaskProgress() : base(Opcode.SMSG_SET_ALL_TASK_PROGRESS, ConnectionType.Instance) { }

public override void Write()
{
_worldPacket.WriteInt32(Tasks.Count);
foreach (var task in Tasks)
task.Write(_worldPacket);
}

public List<TaskProgress> Tasks = new List<TaskProgress>();
}

public class TaskProgress
{
public void Write(WorldPacket data)
{
data.WriteUInt32(TaskID);
data.WriteUInt32(FailureTime);
data.WriteUInt32(Flags);
data.WriteUInt32(Unk);
data.WriteInt32(Progress.Count);
foreach (ushort progress in Progress)
data.WriteUInt16(progress);
}
public uint TaskID;
public uint FailureTime;
public uint Flags;
public uint Unk;
public List<ushort> Progress = new List<ushort>();
}

public class InitialSetup : ServerPacket
{
public InitialSetup() : base(Opcode.SMSG_INITIAL_SETUP, ConnectionType.Instance) { }

public override void Write()
{
_worldPacket.WriteUInt8(ServerExpansionLevel);
_worldPacket.WriteUInt8(ServerExpansionTier);
}

public byte ServerExpansionLevel;
public byte ServerExpansionTier;
}

public class RepopRequest : ClientPacket
{
public RepopRequest(WorldPacket packet) : base(packet) { }
Expand Down

0 comments on commit abb044a

Please sign in to comment.