PSO2SERVER/Server/Protocol/Handlers/03-ServerHandler/03-16-CampshipTeleportDown.cs
2024-12-10 23:22:43 +08:00

43 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PSO2SERVER.Models;
using PSO2SERVER.Zone;
using static PSO2SERVER.Protocol.Handlers.TeleportCasinoToLobby;
namespace PSO2SERVER.Protocol.Handlers
{
[PacketHandlerAttr(0x03, 0x16)]
public class CampshipTeleportDown : PacketHandler
{
public struct CampshipDownPacket
{
public uint zone_id;
public uint unk2;
public uint unk3;
public uint unk4;
}
public override void HandlePacket(Client context, byte flags, byte[] data, uint position, uint size)
{
if (context.currentParty.currentQuest == null)
return;
var reader = new PacketReader(data, position, size);
var pkt = reader.ReadStruct<CampshipDownPacket>();
Logger.Write($"zone_id {pkt.zone_id} unk2 {pkt.unk2} unk3 {pkt.unk3} unk4 {pkt.unk4}");
// TODO: WTF terribad hax?
if (context.CurrentLocation.PosZ >= 20)
{
var instanceName = String.Format("{0}-{1}", context.currentParty.currentQuest.name, context._account.Nickname);
Map forest = ZoneManager.Instance.MapFromInstance("area1", instanceName);
forest.SpawnClient(context, new PSOLocation(0, 1, 0, -0, -37, 0.314f, 145.5f));
}
}
}
}