Added some pallone support

This commit is contained in:
stratic-dev
2024-06-30 00:28:58 +01:00
parent 40095574d1
commit b481e73673
7 changed files with 231 additions and 59 deletions

View File

@@ -40,6 +40,29 @@ type Ryoudama struct {
Score []int32
}
type CaravanMyScore struct {
Unk0 int32
MyScore int32
Unk2 int32
Unk3 int32
}
type CaravanMyRank struct {
Unk0 int32
Unk1 int32
Unk2 int32
}
type CaravanRyoudanRanking struct {
Score int32
HuntingGroupId uint32
Name string
}
type CaravanPersonalRanking struct {
Score int32
Name string
}
func handleMsgMhfGetRyoudama(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfGetRyoudama)
var data []*byteframe.ByteFrame
@@ -101,39 +124,93 @@ func handleMsgMhfPostTinyBin(s *Session, p mhfpacket.MHFPacket) {
func handleMsgMhfCaravanMyScore(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfCaravanMyScore)
ryoudama := []CaravanMyScore{{6, 60900, 6, 6}}
var data []*byteframe.ByteFrame
/*
bf.WriteInt32(0)
bf.WriteInt32(0)
bf.WriteInt32(0)
bf.WriteInt32(0)
*/
for _, score := range ryoudama {
bf := byteframe.NewByteFrame()
bf.WriteInt32(score.Unk0)
bf.WriteInt32(score.MyScore)
bf.WriteInt32(score.Unk2)
bf.WriteInt32(score.Unk3)
data = append(data, bf)
}
doAckEarthSucceed(s, pkt.AckHandle, data)
}
func handleMsgMhfCaravanRanking(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfCaravanRanking)
var data []*byteframe.ByteFrame
/* RYOUDAN
bf.WriteInt32(1)
bf.WriteUint32(2)
bf.WriteBytes(stringsupport.PaddedString("Test", 26, true))
*/
/* PERSONAL
bf.WriteInt32(1)
bf.WriteBytes(stringsupport.PaddedString("Test", 14, true))
*/
// 1 = Top 100 when this Unk2 is the
// 4 = Guild Score
// 5 = Guild Team Individual Score
// 2 = Personal Score
switch pkt.Operation {
case 1:
personalRanking := []CaravanPersonalRanking{{60900, "Hunter 0"}, {20, "Hunter a"}, {4, "Hunter b"}, {4, "Hunter c"}, {2, "Hunter d"}, {1, "Hunter e"}}
for _, score := range personalRanking {
bf := byteframe.NewByteFrame()
bf.WriteInt32(score.Score)
bf.WriteBytes(stringsupport.PaddedString(score.Name, 14, true))
data = append(data, bf)
}
case 2:
personalRanking := []CaravanPersonalRanking{{60900, "Hunter 0"}, {20, "Hunter a"}, {4, "Hunter b"}, {4, "Hunter c"}, {2, "Hunter d"}, {1, "Hunter e"}}
for _, score := range personalRanking {
bf := byteframe.NewByteFrame()
bf.WriteInt32(score.Score)
bf.WriteBytes(stringsupport.PaddedString(score.Name, 14, true))
data = append(data, bf)
}
case 3:
ryoudama := []CaravanRyoudanRanking{{5, 1, "Clan a"}, {4, 2, "Clan b"}, {3, 3, "Clan c"}, {2, 4, "Clan d"}, {1, 5, "Clan e"}, {0, 6, "Clan f"}}
for _, score := range ryoudama {
bf := byteframe.NewByteFrame()
bf.WriteInt32(score.Score)
bf.WriteUint32(score.HuntingGroupId)
bf.WriteBytes(stringsupport.PaddedString(score.Name, 26, true))
data = append(data, bf)
}
case 4:
ryoudama := []CaravanRyoudanRanking{{5, 1, "Clan a"}, {4, 2, "Clan b"}, {3, 3, "Clan c"}, {2, 4, "Clan d"}, {1, 5, "Clan e"}, {0, 6, "Clan f"}}
for _, score := range ryoudama {
bf := byteframe.NewByteFrame()
bf.WriteInt32(score.Score)
bf.WriteUint32(score.HuntingGroupId)
bf.WriteBytes(stringsupport.PaddedString(score.Name, 26, true))
data = append(data, bf)
}
case 5:
//Unk2 is Hunting Team ID
//Having more than 5 in array stops loading
// Do Select ... Where HunterTeamID = pkt.unk2
personalRanking := []CaravanPersonalRanking{{10, "Clan Hunter 1"}, {9, "Clan Hunter 2"}, {8, "Clan Hunter 3"}, {7, "Clan Hunter 4"}, {6, "Clan Hunter 5"}}
for _, score := range personalRanking {
bf := byteframe.NewByteFrame()
bf.WriteInt32(score.Score)
bf.WriteBytes(stringsupport.PaddedString(score.Name, 14, true))
data = append(data, bf)
}
}
doAckEarthSucceed(s, pkt.AckHandle, data)
}
func handleMsgMhfCaravanMyRank(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfCaravanMyRank)
// if value 1 is 0 ! on the route
unk := []CaravanMyRank{{6, 6, 6}}
//Personal - General Unk 1 : 1
var data []*byteframe.ByteFrame
/*
bf.WriteInt32(0)
bf.WriteInt32(0)
bf.WriteInt32(0)
*/
for _, unkData := range unk {
bf := byteframe.NewByteFrame()
bf.WriteInt32(unkData.Unk0)
bf.WriteInt32(unkData.Unk1)
bf.WriteInt32(unkData.Unk2)
data = append(data, bf)
}
doAckEarthSucceed(s, pkt.AckHandle, data)
}

View File

@@ -16,28 +16,96 @@ func handleMsgMhfGetBreakSeibatuLevelReward(s *Session, p mhfpacket.MHFPacket) {
}
type WeeklySeibatuRankingReward struct {
Unk0 int32
Unk1 int32
Unk2 uint32
Unk3 int32
Unk4 int32
Unk5 int32
Unk0 int32 //Place Start
Unk1 int32 //Place Finish
Unk2 uint32 // UNK
Unk3 int32 //Type
Unk4 int32 //ID
Unk5 int32 // Value
}
func handleMsgMhfGetWeeklySeibatuRankingReward(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfGetWeeklySeibatuRankingReward)
var data []*byteframe.ByteFrame
weeklySeibatuRankingRewards := []WeeklySeibatuRankingReward{
{0, 0, 0, 0, 0, 0},
var weeklySeibatuRankingRewards []WeeklySeibatuRankingReward
switch pkt.Operation {
case 3:
weeklySeibatuRankingRewards = []WeeklySeibatuRankingReward{
//Route 0
{0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0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{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0},
//Route 9
{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0},
//Route 10
{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0},
}
// 0 = Max 7 Routes so value 6
//ZZ looks like it only works up to Route 2
case 5:
// Unk1 = 5 and unk2 = 240001
//unk2 = 243400 = Route 0
//unk3 = 243401 = Route 1
//Tower 260001 260003
switch pkt.ID {
case 240031:
weeklySeibatuRankingRewards = []WeeklySeibatuRankingReward{
{2, 5, 5, 5, 5, 5}, {0, 0, 0, 0, 0, 0}}
case 240041:
weeklySeibatuRankingRewards = []WeeklySeibatuRankingReward{
{2, 5, 5, 5, 5, 5}, {0, 0, 0, 0, 0, 0}}
case 240042:
weeklySeibatuRankingRewards = []WeeklySeibatuRankingReward{
{2, 5, 5, 5, 5, 5}, {0, 0, 0, 0, 0, 0}}
case 240051:
weeklySeibatuRankingRewards = []WeeklySeibatuRankingReward{
{2, 5, 5, 5, 5, 5}, {0, 0, 0, 0, 0, 0}}
case 260001:
weeklySeibatuRankingRewards = []WeeklySeibatuRankingReward{
{2, 5, 5, 5, 5, 5}, {0, 0, 0, 0, 0, 0}}
case 260003:
weeklySeibatuRankingRewards = []WeeklySeibatuRankingReward{
{2, 5, 5, 5, 5, 5}, {0, 0, 0, 0, 0, 0}}
default: //Covers all Pallone Requests... for now
weeklySeibatuRankingRewards = []WeeklySeibatuRankingReward{
// To do figure out values 3-5 its some sort of item structure
{1, 0, 7, 7, 7, 10000}, {1, 1, 0, 0, 0, 30}, {1, 1, 0, 0, 0, 18}, {1, 1, 0, 0, 0, 18}, //1st
{2, 3, 0, 0, 0, 6000}, {2, 3, 0, 0, 0, 15}, {2, 3, 0, 0, 0, 9}, {2, 3, 0, 0, 0, 9}, //2nd - 3rd
{4, 10, 0, 0, 0, 5500}, {4, 10, 0, 0, 0, 12}, {4, 10, 0, 0, 0, 9}, //4th -10th
}
}
}
for _, reward := range weeklySeibatuRankingRewards {
for _, rank := range weeklySeibatuRankingRewards {
bf := byteframe.NewByteFrame()
bf.WriteInt32(reward.Unk0)
bf.WriteInt32(reward.Unk1)
bf.WriteUint32(reward.Unk2)
bf.WriteInt32(reward.Unk3)
bf.WriteInt32(reward.Unk4)
bf.WriteInt32(reward.Unk5)
bf.WriteInt32(rank.Unk0)
bf.WriteInt32(rank.Unk1)
bf.WriteUint32(rank.Unk2)
bf.WriteInt32(rank.Unk3)
bf.WriteInt32(rank.Unk4)
bf.WriteInt32(rank.Unk5)
data = append(data, bf)
}
doAckEarthSucceed(s, pkt.AckHandle, data)

View File

@@ -389,25 +389,40 @@ func handleMsgMhfPostTenrouirai(s *Session, p mhfpacket.MHFPacket) {
}
}
type PresentBox struct {
Unk0 uint32
Unk1 int32
Unk2 int32
Unk3 int32
Unk4 int32
Unk5 int32
Unk6 int32
Unk7 int32
Unk8 int32
Unk9 int32
Unk10 int32
}
func handleMsgMhfPresentBox(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfPresentBox)
var data []*byteframe.ByteFrame
/*
presents := []PresentBox{{7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}, {7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}, {7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}}
for _, present := range presents {
bf := byteframe.NewByteFrame()
bf.WriteUint32(0)
bf.WriteInt32(0)
bf.WriteInt32(0)
bf.WriteInt32(0)
bf.WriteInt32(0)
bf.WriteInt32(0)
bf.WriteInt32(0)
bf.WriteInt32(0)
bf.WriteInt32(0)
bf.WriteInt32(0)
bf.WriteInt32(0)
bf.WriteUint32(present.Unk0)
bf.WriteInt32(present.Unk1)
bf.WriteInt32(present.Unk2)
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)
}