Base for present type

This commit is contained in:
stratic-dev
2024-07-05 02:39:44 +01:00
parent 9330555820
commit bd58dccfb6
3 changed files with 237 additions and 107 deletions

View File

@@ -11,15 +11,15 @@ import (
// MsgMhfPresentBox represents the MSG_MHF_PRESENT_BOX // MsgMhfPresentBox represents the MSG_MHF_PRESENT_BOX
type MsgMhfPresentBox struct { type MsgMhfPresentBox struct {
AckHandle uint32 AckHandle uint32
Unk0 uint32 Unk0 uint32
Unk1 uint32 Operation uint32
Unk2 uint32 PresentCount uint32
Unk3 uint32 Unk3 uint32
Unk4 uint32 Unk4 uint32
Unk5 uint32 Unk5 uint32
Unk6 uint32 Unk6 uint32
Unk7 []uint32 PresentType []uint32
} }
// Opcode returns the ID associated with this packet type. // Opcode returns the ID associated with this packet type.
@@ -31,18 +31,18 @@ func (m *MsgMhfPresentBox) Opcode() network.PacketID {
func (m *MsgMhfPresentBox) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { func (m *MsgMhfPresentBox) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32() m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint32() m.Unk0 = bf.ReadUint32()
m.Unk1 = bf.ReadUint32() m.Operation = bf.ReadUint32()
m.Unk2 = bf.ReadUint32() m.PresentCount = bf.ReadUint32()
m.Unk3 = bf.ReadUint32() m.Unk3 = bf.ReadUint32()
m.Unk4 = bf.ReadUint32() m.Unk4 = bf.ReadUint32()
m.Unk5 = bf.ReadUint32() m.Unk5 = bf.ReadUint32()
m.Unk6 = bf.ReadUint32() m.Unk6 = bf.ReadUint32()
for i := uint32(0); i < m.Unk2; i++ { for i := uint32(0); i < m.PresentCount; i++ {
m.Unk7 = append(m.Unk7, bf.ReadUint32()) m.PresentType = append(m.PresentType, bf.ReadUint32())
} }
fmt.Printf("MsgMhfPresentBox: Unk0:[%d] Unk1:[%d] Unk2:[%d] Unk3:[%d] Unk4:[%d] Unk5:[%d] Unk6:[%d] \n\n", m.Unk0, m.Unk1, m.Unk2, m.Unk3, m.Unk4, m.Unk5, m.Unk6) fmt.Printf("MsgMhfPresentBox: Unk0:[%d] Unk1:[%d] Unk2:[%d] Unk3:[%d] Unk4:[%d] Unk5:[%d] Unk6:[%d] \n\n", m.Unk0, m.Operation, m.PresentCount, m.Unk3, m.Unk4, m.Unk5, m.Unk6)
for _, mdata := range m.Unk7 { for _, mdata := range m.PresentType {
fmt.Printf("MsgMhfPresentBox: Unk7: [%d] \n", mdata) fmt.Printf("MsgMhfPresentBox: PresentType: [%d] \n", mdata)
} }
return nil return nil

View File

@@ -393,55 +393,183 @@ func handleMsgMhfGetWeeklySeibatuRankingReward(s *Session, p mhfpacket.MHFPacket
{0, 0, 2, 7201, 12075, 1}, {0, 0, 2, 7201, 12075, 1},
{0, 0, 2, 7201, 12076, 1}, {0, 0, 2, 7201, 12076, 1},
{0, 0, 2, 7201, 12077, 1}, {0, 0, 2, 7201, 12077, 1},
// Left in because i think its funny the planned 4 and we got 2
{0, 0, 3, 7201, 12068, 1},
{0, 0, 3, 7201, 12069, 1},
{0, 0, 3, 7201, 12070, 1},
{0, 0, 3, 7201, 12071, 1},
{0, 0, 3, 7201, 12072, 1},
{0, 0, 3, 7201, 12073, 1},
{0, 0, 3, 7201, 12074, 1},
{0, 0, 3, 7201, 12075, 1},
{0, 0, 3, 7201, 12076, 1},
{0, 0, 3, 7201, 12077, 1},
{0, 0, 4, 7201, 12068, 1},
{0, 0, 4, 7201, 12069, 1},
{0, 0, 4, 7201, 12070, 1},
{0, 0, 4, 7201, 12071, 1},
{0, 0, 4, 7201, 12072, 1},
{0, 0, 4, 7201, 12073, 1},
{0, 0, 4, 7201, 12074, 1},
{0, 0, 4, 7201, 12075, 1},
{0, 0, 4, 7201, 12076, 1},
{0, 0, 4, 7201, 12077, 1},
} }
case 260003: case 260003:
weeklySeibatuRankingRewards = []WeeklySeibatuRankingReward0{ weeklySeibatuRankingRewards = []WeeklySeibatuRankingReward0{
//Adjust Floors done in database to make blue ?? Possible value here for dist //Adjust Floors done in database to make blue ?? Possible value here for dist
//{Floor,unk,unk,seiabtuType,ItemID,Value} //{Floor,unk,unk,seiabtuType,ItemID,Value}
{1, 0, 0, 7201, 12068, 1}, {1, 0, 0, 7201, 11158, 1},
{2, 0, 0, 7201, 12069, 3}, {2, 0, 0, 7201, 11173, 1},
{2, 0, 0, 7201, 12070, 1}, {3, 0, 0, 7201, 10813, 3},
{4, 0, 0, 7201, 12071, 3}, {4, 0, 0, 7201, 11163, 1},
{5, 0, 0, 7201, 12072, 6}, {5, 0, 0, 7201, 11164, 1},
{6, 0, 0, 7201, 12073, 1}, {6, 0, 0, 7201, 11389, 3},
{7, 0, 0, 7201, 12068, 1}, {6, 0, 0, 7201, 11381, 1},
{8, 0, 0, 7201, 12069, 1}, {7, 0, 0, 7201, 11384, 1},
{9, 0, 0, 7201, 12070, 2}, {8, 0, 0, 7201, 11159, 10},
{10, 0, 0, 7201, 12071, 1}, {9, 0, 0, 7201, 11160, 10},
{10, 0, 0, 7201, 12072, 1}, {10, 0, 0, 7201, 11161, 10},
{10, 0, 0, 7201, 12073, 6}, {11, 0, 0, 7201, 11265, 2},
{11, 0, 0, 7201, 7279, 2},
{11, 0, 0, 7201, 12072, 1}, {12, 0, 0, 7201, 11381, 1},
{12, 0, 0, 7201, 12073, 1}, {13, 0, 0, 7201, 11384, 1},
{13, 0, 0, 7201, 12068, 6}, {14, 0, 0, 7201, 11381, 1},
{14, 0, 0, 7201, 12069, 6}, {15, 0, 0, 7201, 11384, 1},
{15, 0, 0, 7201, 12070, 1}, {15, 0, 0, 7201, 11464, 1},
{16, 0, 0, 7201, 12071, 1}, {16, 0, 0, 7201, 11381, 1},
{16, 0, 0, 7201, 12072, 2}, {17, 0, 0, 7201, 11384, 1},
{18, 0, 0, 7201, 12073, 1}, {18, 0, 0, 7201, 11381, 1},
{19, 0, 0, 7201, 11384, 1},
{20, 0, 0, 7201, 10778, 3},
{21, 0, 0, 7201, 11265, 2},
{21, 0, 0, 7201, 7279, 2},
{22, 0, 0, 7201, 11381, 1},
{23, 0, 0, 7201, 11384, 1},
{24, 0, 0, 7201, 11381, 1},
{25, 0, 0, 7201, 11389, 3},
{25, 0, 0, 7201, 11286, 4},
{26, 0, 0, 7201, 11384, 1},
{27, 0, 0, 7201, 11381, 1},
{28, 0, 0, 7201, 11384, 1},
{29, 0, 0, 7201, 11381, 1},
{30, 0, 0, 7201, 11209, 3},
{31, 0, 0, 7201, 11265, 2},
{31, 0, 0, 7201, 7279, 2},
{32, 0, 0, 7201, 11159, 10},
{33, 0, 0, 7201, 11463, 1},
{34, 0, 0, 7201, 11160, 10},
{35, 0, 0, 7201, 11286, 4},
{36, 0, 0, 7201, 11161, 10},
{38, 0, 0, 7201, 11384, 1},
{39, 0, 0, 7201, 11164, 1},
{40, 0, 0, 7201, 10813, 3},
{41, 0, 0, 7201, 11265, 2},
{41, 0, 0, 7201, 7280, 2},
{43, 0, 0, 7201, 11381, 1},
{45, 0, 0, 7201, 11286, 4},
{47, 0, 0, 7201, 11384, 1},
{48, 0, 0, 7201, 11358, 1},
{50, 0, 0, 7201, 11356, 1},
{51, 0, 0, 7201, 11265, 2},
{51, 0, 0, 7201, 7280, 2},
{53, 0, 0, 7201, 11381, 2},
{55, 0, 0, 7201, 11357, 1},
{57, 0, 0, 7201, 11384, 1},
{60, 0, 0, 7201, 11286, 4},
{61, 0, 0, 7201, 11265, 2},
{61, 0, 0, 7201, 7280, 2},
{63, 0, 0, 7201, 11381, 2},
{66, 0, 0, 7201, 11463, 1},
{67, 0, 0, 7201, 11384, 1},
{70, 0, 0, 7201, 11286, 4},
{71, 0, 0, 7201, 11265, 2},
{71, 0, 0, 7201, 7280, 2},
{73, 0, 0, 7201, 11381, 2},
{77, 0, 0, 7201, 11384, 1},
{79, 0, 0, 7201, 11164, 1},
{80, 0, 0, 7201, 11286, 6},
{81, 0, 0, 7201, 11265, 2},
{81, 0, 0, 7201, 7281, 1},
{83, 0, 0, 7201, 11381, 2},
{85, 0, 0, 7201, 11464, 1},
{87, 0, 0, 7201, 11384, 1},
{90, 0, 0, 7201, 11286, 6},
{91, 0, 0, 7201, 11265, 2},
{91, 0, 0, 7201, 7281, 1},
{93, 0, 0, 7201, 11381, 2},
{95, 0, 0, 7201, 10778, 3},
{97, 0, 0, 7201, 11384, 1},
{99, 0, 0, 7201, 11463, 1},
{100, 0, 0, 7201, 11286, 6},
{101, 0, 0, 7201, 11265, 2},
{101, 0, 0, 7201, 7281, 1},
{103, 0, 0, 7201, 11381, 2},
{107, 0, 0, 7201, 11384, 1},
{110, 0, 0, 7201, 11286, 6},
{113, 0, 0, 7201, 11381, 2},
{115, 0, 0, 7201, 11164, 1},
{117, 0, 0, 7201, 11384, 1},
{120, 0, 0, 7201, 11286, 12},
{123, 0, 0, 7201, 11381, 2},
{127, 0, 0, 7201, 11384, 1},
{130, 0, 0, 7201, 11286, 12},
{132, 0, 0, 7201, 11381, 2},
{134, 0, 0, 7201, 11384, 1},
{136, 0, 0, 7201, 11381, 2},
{138, 0, 0, 7201, 11384, 1},
{140, 0, 0, 7201, 11286, 12},
{142, 0, 0, 7201, 11382, 1},
{144, 0, 0, 7201, 11385, 1},
{145, 0, 0, 7201, 11464, 1},
{146, 0, 0, 7201, 11382, 1},
{148, 0, 0, 7201, 11385, 1},
{150, 0, 0, 7201, 11164, 1},
{155, 0, 0, 7201, 11382, 1},
{160, 0, 0, 7201, 11209, 3},
{165, 0, 0, 7201, 11385, 1},
{170, 0, 0, 7201, 11159, 10},
{175, 0, 0, 7201, 11382, 1},
{180, 0, 0, 7201, 11160, 10},
{185, 0, 0, 7201, 11385, 1},
{190, 0, 0, 7201, 11161, 10},
{195, 0, 0, 7201, 11382, 1},
{200, 0, 0, 7201, 11159, 15},
{210, 0, 0, 7201, 11160, 15},
{220, 0, 0, 7201, 11385, 1},
{235, 0, 0, 7201, 11382, 2},
{250, 0, 0, 7201, 11161, 15},
{265, 0, 0, 7201, 11159, 20},
{280, 0, 0, 7201, 11385, 1},
{300, 0, 0, 7201, 11160, 20},
{315, 0, 0, 7201, 11382, 2},
{330, 0, 0, 7201, 11385, 1},
{350, 0, 0, 7201, 11161, 20},
{365, 0, 0, 7201, 11382, 2},
{380, 0, 0, 7201, 11385, 1},
{400, 0, 0, 7201, 11159, 25},
{415, 0, 0, 7201, 11382, 2},
{430, 0, 0, 7201, 11385, 1},
{450, 0, 0, 7201, 11160, 25},
{465, 0, 0, 7201, 11382, 2},
{480, 0, 0, 7201, 11385, 1},
{500, 0, 0, 7201, 11161, 25},
{525, 0, 0, 7201, 11382, 2},
{550, 0, 0, 7201, 11385, 1},
{575, 0, 0, 7201, 11159, 25},
{600, 0, 0, 7201, 11382, 2},
{625, 0, 0, 7201, 11385, 1},
{650, 0, 0, 7201, 11160, 25},
{675, 0, 0, 7201, 11382, 2},
{700, 0, 0, 7201, 11385, 1},
{725, 0, 0, 7201, 11161, 25},
{750, 0, 0, 7201, 11382, 2},
{775, 0, 0, 7201, 11385, 1},
{800, 0, 0, 7201, 11159, 25},
{825, 0, 0, 7201, 11382, 2},
{850, 0, 0, 7201, 11385, 1},
{875, 0, 0, 7201, 11160, 25},
{900, 0, 0, 7201, 11382, 2},
{925, 0, 0, 7201, 11385, 1},
{950, 0, 0, 7201, 11161, 25},
{975, 0, 0, 7201, 11382, 2},
{1000, 0, 0, 7201, 11385, 1},
{1025, 0, 0, 7201, 11159, 25},
{1050, 0, 0, 7201, 11382, 2},
{1075, 0, 0, 7201, 11385, 1},
{1100, 0, 0, 7201, 11160, 25},
{1125, 0, 0, 7201, 11382, 2},
{1150, 0, 0, 7201, 11385, 1},
{1200, 0, 0, 7201, 11161, 25},
{1235, 0, 0, 7201, 11382, 2},
{1270, 0, 0, 7201, 11385, 1},
{1305, 0, 0, 7201, 11159, 25},
{1340, 0, 0, 7201, 11382, 2},
{1375, 0, 0, 7201, 11385, 1},
{1410, 0, 0, 7201, 11160, 25},
{1445, 0, 0, 7201, 11382, 2},
{1480, 0, 0, 7201, 11385, 1},
{1500, 0, 0, 7201, 11161, 25},
} }
default: //Covers all Pallone Requests... for now default: //Covers all Pallone Requests... for now
weeklySeibatuRankingRewards = []WeeklySeibatuRankingReward0{ weeklySeibatuRankingRewards = []WeeklySeibatuRankingReward0{

View File

@@ -390,64 +390,66 @@ func handleMsgMhfPostTenrouirai(s *Session, p mhfpacket.MHFPacket) {
} }
type PresentBox struct { type PresentBox struct {
Unk0 uint32 Unk0 uint32 // Populates Unk7 in second call
Unk1 int32 PresentType int32
Unk2 int32 Unk2 int32
Unk3 int32 Unk3 int32
Unk4 int32 Unk4 int32
Unk5 int32 Unk5 int32
Unk6 int32 Unk6 int32
Unk7 int32 Unk7 int32
Unk8 int32 //SeiabtuType SeiabtuType int32 //7201:Item 7202:N Points 7203:Guild Contribution Points
Unk9 int32 //Item Item int32
Unk10 int32 //Amount Amount int32
} }
func handleMsgMhfPresentBox(s *Session, p mhfpacket.MHFPacket) { func handleMsgMhfPresentBox(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfPresentBox) pkt := p.(*mhfpacket.MsgMhfPresentBox)
var data []*byteframe.ByteFrame var data []*byteframe.ByteFrame
var presents []PresentBox
//On Open Operation 1 and 3
//On Accept Operation 1 and 2 (Stop player from reclaiming)
if pkt.Operation == 1 || pkt.Operation == 2 {
for _, presentType := range pkt.PresentType {
//Placed it in a dynamic array for now
//Empty Array shows the No Items to claim message!
//Gift Type in [0] and [1] works...[1] Controlls what gets shown [0] is for second request Unk7 Population...
presents = []PresentBox{
{presentType, int32(presentType), 0, 0, 0, 0, 0, 0, 7201, 12893, 1},
{presentType, int32(presentType), 0, 0, 0, 0, 0, 0, 7201, 12893, 1},
{presentType, int32(presentType), 0, 0, 0, 0, 0, 0, 7201, 12893, 1},
{presentType, int32(presentType), 0, 0, 0, 0, 0, 0, 7201, 12893, 1},
{presentType, int32(presentType), 0, 0, 0, 0, 0, 0, 7201, 12895, 8},
{presentType, int32(presentType), 0, 0, 0, 0, 0, 0, 7202, 12893, 1},
{presentType, int32(presentType), 0, 0, 0, 0, 0, 0, 7203, 12895, 8},
}
}
//PresentCommunicator for _, present := range presents {
// ON Request for PALLONE! bf := byteframe.NewByteFrame()
//3301 3302 3303 bf.WriteUint32(present.Unk0) //Palone::PresentCommunicator::sort Index Maybe
// ON Request for TOWER! bf.WriteInt32(present.PresentType)
//Unk0:[0] Unk1:[1] Unk2:[2] Unk3:[0] Unk4:[0] Unk5:[0] Unk6:[0] bf.WriteInt32(present.Unk2)
//260003 260001 bf.WriteInt32(present.Unk3)
//Unk0:[0] Unk1:[3] Unk2:[2] Unk3:[0] Unk4:[0] Unk5:[0] Unk6:[0] bf.WriteInt32(present.Unk4)
//260003 260001 bf.WriteInt32(present.Unk5)
bf.WriteInt32(present.Unk6)
bf.WriteInt32(present.Unk7)
bf.WriteInt32(present.SeiabtuType)
bf.WriteInt32(present.Item)
bf.WriteInt32(present.Amount)
data = append(data, bf)
}
//Gets called for Case 1 but not 2???? doAckEarthSucceed(s, pkt.AckHandle, data)
//Palone::PresentCommunicator::sort((void)) 0239E988 } else if pkt.Operation == 3 {
presents := []PresentBox{
{1, 3201, 1, 12068, 1, 12068, 12068, 12068, 12068, 12068, 1},
{2, 3202, 2, 12068, 1, 12068, 12068, 12068, 12068, 12068, 1},
{3, 3203, 3, 12068, 1, 12068, 12068, 12068, 12068, 12068, 1},
{4, 3204, 4, 12068, 1, 12068, 12068, 12068, 12068, 12068, 1},
{5, 3301, 5, 12068, 1, 12068, 12068, 12068, 12068, 12068, 1},
{6, 3302, 6, 12068, 1, 12068, 12068, 12068, 12068, 12068, 1},
{7, 3303, 7, 12068, 1, 12068, 12068, 12068, 12068, 12068, 1},
{6, 260001, 6, 12068, 1, 12068, 12068, 12068, 12068, 12068, 1},
{7, 260003, 7, 12068, 1, 12068, 12068, 12068, 12068, 12068, 1},
}
for _, present := range presents {
bf := byteframe.NewByteFrame() bf := byteframe.NewByteFrame()
bf.WriteUint32(present.Unk0) //Palone::PresentCommunicator::sort Index Maybe doAckBufSucceed(s, pkt.AckHandle, bf.Data())
bf.WriteInt32(present.Unk1) } else {
bf.WriteInt32(present.Unk2) s.logger.Info("request for unknown type", zap.Uint32("Unk1", pkt.Operation))
bf.WriteInt32(present.Unk3)
bf.WriteInt32(present.Unk4)
bf.WriteInt32(present.Unk5)
bf.WriteInt32(present.Unk6)
bf.WriteInt32(present.Unk7)
bf.WriteInt32(present.Unk8)
bf.WriteInt32(present.Unk9)
bf.WriteInt32(present.Unk10)
data = append(data, bf)
} }
doAckEarthSucceed(s, pkt.AckHandle, data)
} }
type GemInfo struct { type GemInfo struct {