2 Commits

Author SHA1 Message Date
stratic-dev
2d0cce719b Added seiabatu cross event pkt 2024-07-31 18:06:32 +01:00
stratic-dev
c6fdf47779 Added earth 2024-07-31 14:56:34 +01:00
7 changed files with 724 additions and 101 deletions

View File

@@ -22,9 +22,8 @@
"CommandPrefix": "!",
"AutoCreateAccount": true,
"DefaultCourses": [1, 23, 24],
"EarthStatus": 0,
"EarthID": 0,
"EarthMonsters": [0, 0, 0, 0],
"EarthDebug": false,
"EarthMonsters": [116, 107, 2, 36],
"SaveDumps": {
"Enabled": true,
"RawEnabled": false,

View File

@@ -82,8 +82,7 @@ type Config struct {
CommandPrefix string // The prefix for commands
AutoCreateAccount bool // Automatically create accounts if they don't exist
DefaultCourses []uint16
EarthStatus int32
EarthID int32
EarthDebug bool
EarthMonsters []int32
SaveDumps SaveDumpOptions
Screenshots ScreenshotsOptions

View File

@@ -2,6 +2,7 @@ package mhfpacket
import (
"errors"
"fmt"
"erupe-ce/common/byteframe"
"erupe-ce/network"
@@ -10,11 +11,11 @@ import (
// MsgMhfGetWeeklySeibatuRankingReward represents the MSG_MHF_GET_WEEKLY_SEIBATU_RANKING_REWARD
type MsgMhfGetWeeklySeibatuRankingReward struct {
AckHandle uint32
Unk0 uint32
Unk1 uint32
Unk2 uint32
Unk3 uint32
AckHandle uint32
Unk0 uint32
Operation uint32
ID uint32
EarthMonster uint32
}
// Opcode returns the ID associated with this packet type.
@@ -26,9 +27,10 @@ func (m *MsgMhfGetWeeklySeibatuRankingReward) Opcode() network.PacketID {
func (m *MsgMhfGetWeeklySeibatuRankingReward) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint32()
m.Unk1 = bf.ReadUint32()
m.Unk2 = bf.ReadUint32()
m.Unk3 = bf.ReadUint32()
m.Operation = bf.ReadUint32()
m.ID = bf.ReadUint32()
m.EarthMonster = bf.ReadUint32()
fmt.Printf("MsgMhfGetWeeklySeibatuRankingReward: Unk0:[%d] Operation:[%d] ID:[%d] EarthMonster:[%d]\n\n", m.Unk0, m.Operation, m.ID, m.EarthMonster)
return nil
}

View File

@@ -0,0 +1,6 @@
BEGIN;
-- Add 'earth' to the event_type ENUM type
ALTER TYPE event_type ADD VALUE 'earth';
END;

View File

@@ -30,18 +30,6 @@ func stubEnumerateNoResults(s *Session, ackHandle uint32) {
doAckBufSucceed(s, ackHandle, enumBf.Data())
}
func doAckEarthSucceed(s *Session, ackHandle uint32, data []*byteframe.ByteFrame) {
bf := byteframe.NewByteFrame()
bf.WriteUint32(uint32(s.server.erupeConfig.EarthID))
bf.WriteUint32(0)
bf.WriteUint32(0)
bf.WriteUint32(uint32(len(data)))
for i := range data {
bf.WriteBytes(data[i].Data())
}
doAckBufSucceed(s, ackHandle, bf.Data())
}
func doAckBufSucceed(s *Session, ackHandle uint32, data []byte) {
s.QueueSendMHF(&mhfpacket.MsgSysAck{
AckHandle: ackHandle,
@@ -1115,66 +1103,8 @@ func handleMsgMhfUnreserveSrg(s *Session, p mhfpacket.MHFPacket) {
func handleMsgMhfKickExportForce(s *Session, p mhfpacket.MHFPacket) {}
func handleMsgMhfGetEarthStatus(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfGetEarthStatus)
bf := byteframe.NewByteFrame()
bf.WriteUint32(uint32(TimeWeekStart().Unix())) // Start
bf.WriteUint32(uint32(TimeWeekNext().Unix())) // End
bf.WriteInt32(s.server.erupeConfig.EarthStatus)
bf.WriteInt32(s.server.erupeConfig.EarthID)
for i, m := range s.server.erupeConfig.EarthMonsters {
if _config.ErupeConfig.RealClientMode <= _config.G9 {
if i == 3 {
break
}
}
if i == 4 {
break
}
bf.WriteInt32(m)
}
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
}
func handleMsgMhfRegistSpabiTime(s *Session, p mhfpacket.MHFPacket) {}
func handleMsgMhfGetEarthValue(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfGetEarthValue)
type EarthValues struct {
Value []uint32
}
var earthValues []EarthValues
switch pkt.ReqType {
case 1:
earthValues = []EarthValues{
{[]uint32{1, 312, 0, 0, 0, 0}},
{[]uint32{2, 99, 0, 0, 0, 0}},
}
case 2:
earthValues = []EarthValues{
{[]uint32{1, 5771, 0, 0, 0, 0}},
{[]uint32{2, 1847, 0, 0, 0, 0}},
}
case 3:
earthValues = []EarthValues{
{[]uint32{1001, 36, 0, 0, 0, 0}},
{[]uint32{9001, 3, 0, 0, 0, 0}},
{[]uint32{9002, 10, 300, 0, 0, 0}},
}
}
var data []*byteframe.ByteFrame
for _, i := range earthValues {
bf := byteframe.NewByteFrame()
for _, j := range i.Value {
bf.WriteUint32(j)
}
data = append(data, bf)
}
doAckEarthSucceed(s, pkt.AckHandle, data)
}
func handleMsgMhfDebugPostValue(s *Session, p mhfpacket.MHFPacket) {}
func handleMsgMhfGetRandFromTable(s *Session, p mhfpacket.MHFPacket) {

View File

@@ -0,0 +1,172 @@
package channelserver
import (
"erupe-ce/common/byteframe"
_config "erupe-ce/config"
"erupe-ce/network/mhfpacket"
"log"
"time"
)
func doAckEarthSucceed(s *Session, ackHandle uint32, data []*byteframe.ByteFrame) {
bf := byteframe.NewByteFrame()
bf.WriteUint32(0)
bf.WriteUint32(0)
bf.WriteUint32(0)
bf.WriteUint32(uint32(len(data)))
for i := range data {
bf.WriteBytes(data[i].Data())
}
doAckBufSucceed(s, ackHandle, bf.Data())
}
func handleMsgMhfGetEarthValue(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfGetEarthValue)
type EarthValues struct {
Value []uint32
}
var earthValues []EarthValues
switch pkt.ReqType {
case 1:
earthValues = []EarthValues{
// {Block, DureSlays, Unk, Unk, Unk, Unk}
{[]uint32{1, 100, 0, 0, 0, 0}},
{[]uint32{2, 100, 0, 0, 0, 0}},
}
case 2:
earthValues = []EarthValues{
// {Block, Floors?, Unk, Unk, Unk, Unk}
{[]uint32{1, 5771, 0, 0, 0, 0}},
{[]uint32{2, 1847, 0, 0, 0, 0}},
}
case 3:
earthValues = []EarthValues{
{[]uint32{1001, 36, 0, 0, 0, 0}}, //getTouhaHistory
{[]uint32{9001, 3, 0, 0, 0, 0}}, //getKohouhinDropStopFlag // something to do with ttcSetDisableFlag?
{[]uint32{9002, 10, 300, 0, 0, 0}}, //getKohouhinForceValue
}
}
var data []*byteframe.ByteFrame
for _, i := range earthValues {
bf := byteframe.NewByteFrame()
for _, j := range i.Value {
bf.WriteUint32(j)
}
data = append(data, bf)
}
doAckEarthSucceed(s, pkt.AckHandle, data)
}
func cleanupEarthStatus(s *Session) {
s.server.db.Exec(`DELETE FROM events WHERE event_type='earth'`)
}
func generateEarthStatusTimestamps(s *Session, start uint32, debug bool) []uint32 {
timestamps := make([]uint32, 4)
midnight := TimeMidnight()
if start == 0 || TimeAdjusted().Unix() > int64(start)+1814400 {
cleanupEarthStatus(s)
start = uint32(midnight.Add(24 * time.Hour).Unix())
s.server.db.Exec("INSERT INTO events (event_type, start_time) VALUES ('earth', to_timestamp($1)::timestamp without time zone)", start)
}
if debug {
timestamps[0] = uint32(TimeWeekStart().Unix())
timestamps[1] = uint32(TimeWeekNext().Unix())
timestamps[2] = uint32(TimeWeekNext().Add(time.Duration(7) * time.Hour * 24).Unix())
timestamps[3] = uint32(TimeWeekNext().Add(time.Duration(14) * time.Hour * 24).Unix())
} else {
timestamps[0] = start
timestamps[1] = timestamps[0] + 604800
timestamps[2] = timestamps[1] + 604800
timestamps[3] = timestamps[2] + 604800
}
return timestamps
}
func handleMsgMhfGetEarthStatus(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgMhfGetEarthStatus)
bf := byteframe.NewByteFrame()
var earthTimestamps []uint32
var debug = s.server.erupeConfig.EarthDebug
earthId, earthStart := int32(0x01BEEFEE), uint32(0)
rows, _ := s.server.db.Queryx("SELECT id, (EXTRACT(epoch FROM start_time)::int) as start_time FROM events WHERE event_type='earth'")
if rows == nil {
log.Println("No rows found")
} else {
for rows.Next() {
rows.Scan(&earthId, &earthStart)
}
}
earthTimestamps = generateEarthStatusTimestamps(s, earthStart, debug)
// Conquest
if uint32(TimeAdjusted().Unix()) > earthTimestamps[0] {
bf.WriteUint32(earthTimestamps[0]) // Start
bf.WriteUint32(earthTimestamps[1]) // End
bf.WriteInt32(1) //Conquest Earth Status ID //1 and 2 UNK the difference
bf.WriteInt32(earthId) //ID
} else {
bf.WriteUint32(earthTimestamps[1]) // Start
bf.WriteUint32(earthTimestamps[2]) // End
bf.WriteInt32(2) //Conquest Earth Status ID //1 and 2 UNK the difference
bf.WriteInt32(earthId) //ID
}
for i, m := range s.server.erupeConfig.EarthMonsters {
//Changed from G9 to G8 to get conquest working in g9.1
if _config.ErupeConfig.RealClientMode <= _config.G8 {
if i == 3 {
break
}
}
if i == 4 {
break
}
bf.WriteInt32(m)
}
// Pallone
if uint32(TimeAdjusted().Unix()) > earthTimestamps[1] {
bf.WriteUint32(earthTimestamps[1]) // Start
bf.WriteUint32(earthTimestamps[2]) // End
bf.WriteInt32(11) //Pallone Earth Status ID //11 is Fest //12 is Reward
bf.WriteInt32(earthId + 1) //ID
} else {
bf.WriteUint32(earthTimestamps[2]) // Start
bf.WriteUint32(earthTimestamps[3]) // End
bf.WriteInt32(12) //Pallone Earth Status ID //11 is Fest //12 is Reward
bf.WriteInt32(earthId + 1) //ID
}
for i, m := range s.server.erupeConfig.EarthMonsters {
//Changed from G9 to G8 to get conquest working in g9.1
if _config.ErupeConfig.RealClientMode <= _config.G8 {
if i == 3 {
break
}
}
if i == 4 {
break
}
bf.WriteInt32(m)
}
// Tower
if uint32(TimeAdjusted().Unix()) > earthTimestamps[2] {
bf.WriteUint32(earthTimestamps[2]) // Start
bf.WriteUint32(earthTimestamps[3]) // End
bf.WriteInt32(21) //Tower Earth Status ID
bf.WriteInt32(earthId + 2) //ID
for i, m := range s.server.erupeConfig.EarthMonsters {
if _config.ErupeConfig.RealClientMode <= _config.G8 {
if i == 3 {
break
}
}
if i == 4 {
break
}
bf.WriteInt32(m)
}
}
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
}

View File

@@ -15,31 +15,546 @@ func handleMsgMhfGetBreakSeibatuLevelReward(s *Session, p mhfpacket.MHFPacket) {
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
}
type WeeklySeibatuRankingReward struct {
Unk0 int32
Unk1 int32
Unk2 uint32
Unk3 int32
Unk4 int32
Unk5 int32
type WeeklySeibatuRankingRewardData struct {
Index0 int32 //Place Start
Index1 int32 //Place Finish
Index2 uint32 // UNK
DistributionType int32 //Type 7201:Item 7202:N Points 7203:Guild Contribution Points
ItemID int32
Amount int32
}
type WeeklySeibatuRankingRewards struct {
Unk0 int32
ItemID int32
Amount uint32
PlaceFrom int32
PlaceTo int32
}
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 []WeeklySeibatuRankingRewards
var weeklySeibatuRankingRewardsData []WeeklySeibatuRankingRewardData
switch pkt.Operation {
case 1:
//Conquest Data
switch pkt.ID { // Seems to align with EarthStatus 1 and 2 for Conquest
case 1:
switch pkt.EarthMonster {
case 116:
weeklySeibatuRankingRewards = []WeeklySeibatuRankingRewards{
{0, 2, 3, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 15, 1, 100},
{0, 2, 15, 1, 100},
{0, 2, 25, 1, 100},
{0, 2, 2, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 9, 101, 1000},
{0, 2, 9, 101, 1000},
{0, 2, 30, 101, 1000},
{0, 2, 2, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 6, 1000, 1001},
{0, 2, 6, 1000, 1001},
}
case 107:
weeklySeibatuRankingRewards = []WeeklySeibatuRankingRewards{
{0, 2, 3, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 15, 1, 100},
{0, 2, 15, 1, 100},
{0, 2, 25, 1, 100},
{0, 2, 2, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 9, 101, 1000},
{0, 2, 9, 101, 1000},
{0, 2, 30, 101, 1000},
{0, 2, 2, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 6, 1000, 1001},
{0, 2, 6, 1000, 1001},
}
case 2:
weeklySeibatuRankingRewards = []WeeklySeibatuRankingRewards{
{0, 2, 3, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 15, 1, 100},
{0, 2, 15, 1, 100},
{0, 2, 25, 1, 100},
{0, 2, 2, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 9, 101, 1000},
{0, 2, 9, 101, 1000},
{0, 2, 30, 101, 1000},
{0, 2, 2, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 6, 1000, 1001},
{0, 2, 6, 1000, 1001},
}
case 36:
weeklySeibatuRankingRewards = []WeeklySeibatuRankingRewards{
{0, 2, 3, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 15, 1, 100},
{0, 2, 15, 1, 100},
{0, 2, 25, 1, 100},
{0, 2, 2, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 9, 101, 1000},
{0, 2, 9, 101, 1000},
{0, 2, 30, 101, 1000},
{0, 2, 2, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 6, 1000, 1001},
{0, 2, 6, 1000, 1001},
}
}
case 2:
switch pkt.EarthMonster {
case 116:
weeklySeibatuRankingRewards = []WeeklySeibatuRankingRewards{
{0, 2, 3, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 15, 1, 100},
{0, 2, 15, 1, 100},
{0, 2, 25, 1, 100},
{0, 2, 2, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 9, 101, 1000},
{0, 2, 9, 101, 1000},
{0, 2, 30, 101, 1000},
{0, 2, 2, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 6, 1000, 1001},
{0, 2, 6, 1000, 1001},
}
case 107:
weeklySeibatuRankingRewards = []WeeklySeibatuRankingRewards{
{0, 2, 3, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 15, 1, 100},
{0, 2, 15, 1, 100},
{0, 2, 25, 1, 100},
{0, 2, 2, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 9, 101, 1000},
{0, 2, 9, 101, 1000},
{0, 2, 30, 101, 1000},
{0, 2, 2, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 6, 1000, 1001},
{0, 2, 6, 1000, 1001},
}
case 2:
weeklySeibatuRankingRewards = []WeeklySeibatuRankingRewards{
{0, 2, 3, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 15, 1, 100},
{0, 2, 15, 1, 100},
{0, 2, 25, 1, 100},
{0, 2, 2, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 9, 101, 1000},
{0, 2, 9, 101, 1000},
{0, 2, 30, 101, 1000},
{0, 2, 2, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 6, 1000, 1001},
{0, 2, 6, 1000, 1001},
}
case 36:
weeklySeibatuRankingRewards = []WeeklySeibatuRankingRewards{
{0, 2, 3, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 6, 1, 100},
{0, 2, 15, 1, 100},
{0, 2, 15, 1, 100},
{0, 2, 25, 1, 100},
{0, 2, 2, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 4, 101, 1000},
{0, 2, 9, 101, 1000},
{0, 2, 9, 101, 1000},
{0, 2, 30, 101, 1000},
{0, 2, 2, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 4, 1000, 1001},
{0, 2, 6, 1000, 1001},
{0, 2, 6, 1000, 1001},
}
}
}
case 3:
//Pallone Festival Data
weeklySeibatuRankingRewardsData = []WeeklySeibatuRankingRewardData{
//Unk0
//Unk1
//Unk2
//Unk3,
//ROUTE, (Crashes if it doesnt exist be careful with values )
//Status 1 = Only Now ! 2= Unk 3= Disabled}
//Route 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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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:
//Event Reward Data
switch pkt.ID {
//243400 = Route 0
//243401 = Route 1
//I have a sneaky suspicion that the above massive array is feeding into this somehow....
case 240031:
weeklySeibatuRankingRewardsData = []WeeklySeibatuRankingRewardData{
{1, 1, 1, 7201, 12068, 1}}
case 240041:
weeklySeibatuRankingRewardsData = []WeeklySeibatuRankingRewardData{
{0, 0, 1, 7201, 12068, 1}}
case 240042:
weeklySeibatuRankingRewardsData = []WeeklySeibatuRankingRewardData{
{0, 0, 2, 7201, 12068, 1}}
case 240051:
weeklySeibatuRankingRewardsData = []WeeklySeibatuRankingRewardData{
{0, 0, 1, 7201, 12068, 1}}
case 240052:
weeklySeibatuRankingRewardsData = []WeeklySeibatuRankingRewardData{
{1, 1, 1, 7201, 12068, 1},
}
case 260001:
//Tower Dure Kill Reward
weeklySeibatuRankingRewardsData = []WeeklySeibatuRankingRewardData{
//Can only have 10 in each dist (It disapears otherwise) Looks like up to dist 4 is implemented
//This is claimable for every Dure Kill, Make cliamable in bulk or mandatory claim per kill
//{unk,unk,dist,seiabtuType,ItemID,Value}
{0, 0, 1, 7201, 11463, 1},
{0, 0, 1, 7201, 11464, 1},
{0, 0, 1, 7201, 11163, 1},
{0, 0, 1, 7201, 11159, 5},
{0, 0, 1, 7201, 11160, 5},
{0, 0, 1, 7201, 11161, 5},
{0, 0, 2, 7201, 12506, 1},
{0, 0, 2, 7201, 10355, 1},
{0, 0, 2, 7201, 11163, 1},
{0, 0, 2, 7201, 11159, 5},
{0, 0, 2, 7201, 11160, 5},
{0, 0, 2, 7201, 11161, 5},
}
case 260003:
//Tower Floor Reward
weeklySeibatuRankingRewardsData = []WeeklySeibatuRankingRewardData{
//Adjust Floors done in database to make blue
//This is claimable for every Floor Climbed across dist 1 and 2
//{Floor,unk,unk,seiabtuType,ItemID,Value}
{1, 0, 0, 7201, 11158, 1},
{2, 0, 0, 7201, 11173, 1},
{3, 0, 0, 7201, 10813, 3},
{4, 0, 0, 7201, 11163, 1},
{5, 0, 0, 7201, 11164, 1},
{6, 0, 0, 7201, 11389, 3},
{6, 0, 0, 7201, 11381, 1},
{7, 0, 0, 7201, 11384, 1},
{8, 0, 0, 7201, 11159, 10},
{9, 0, 0, 7201, 11160, 10},
{10, 0, 0, 7201, 11161, 10},
{11, 0, 0, 7201, 11265, 2},
{11, 0, 0, 7201, 7279, 2},
{12, 0, 0, 7201, 11381, 1},
{13, 0, 0, 7201, 11384, 1},
{14, 0, 0, 7201, 11381, 1},
{15, 0, 0, 7201, 11384, 1},
{15, 0, 0, 7201, 11464, 1},
{16, 0, 0, 7201, 11381, 1},
{17, 0, 0, 7201, 11384, 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
weeklySeibatuRankingRewardsData = []WeeklySeibatuRankingRewardData{
//1st
{1, 0, 0, 7202, 10, 10000},
{1, 1, 0, 7201, 10, 30},
{1, 1, 0, 7201, 10, 18},
{1, 1, 0, 7201, 10, 18},
//2nd - 3rd
{2, 3, 0, 7202, 10, 6000},
{2, 3, 0, 7201, 10, 15},
{2, 3, 0, 7201, 10, 9},
{2, 3, 0, 7201, 10, 9},
//4th -10th
{4, 10, 0, 7202, 10, 5500},
{4, 10, 0, 7201, 10, 12},
{4, 10, 0, 7201, 10, 9},
}
}
}
for _, reward := 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)
data = append(data, bf)
if pkt.Operation == 1 {
for _, seibatuData := range weeklySeibatuRankingRewards {
bf := byteframe.NewByteFrame()
bf.WriteInt32(seibatuData.Unk0)
bf.WriteInt32(seibatuData.ItemID)
bf.WriteUint32(seibatuData.Amount)
bf.WriteInt32(seibatuData.PlaceFrom)
bf.WriteInt32(seibatuData.PlaceTo)
data = append(data, bf)
}
} else {
for _, seibatuData := range weeklySeibatuRankingRewardsData {
bf := byteframe.NewByteFrame()
bf.WriteInt32(seibatuData.Index0)
bf.WriteInt32(seibatuData.Index1)
bf.WriteUint32(seibatuData.Index2)
bf.WriteInt32(seibatuData.DistributionType)
bf.WriteInt32(seibatuData.ItemID)
bf.WriteInt32(seibatuData.Amount)
data = append(data, bf)
}
}
doAckEarthSucceed(s, pkt.AckHandle, data)
}