mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-13 15:34:38 +01:00
formatting, strip out unknown values
This commit is contained in:
@@ -3,14 +3,10 @@ BEGIN;
|
|||||||
create table if not exists event_quests
|
create table if not exists event_quests
|
||||||
(
|
(
|
||||||
id serial primary key,
|
id serial primary key,
|
||||||
index_value integer,
|
|
||||||
max_players integer,
|
max_players integer,
|
||||||
quest_type integer not null,
|
quest_type integer not null,
|
||||||
quest_id integer not null,
|
quest_id integer not null,
|
||||||
mark integer,
|
mark integer
|
||||||
quest_option integer not null,
|
|
||||||
|
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
ALTER TABLE IF EXISTS public.servers DROP COLUMN IF EXISTS season;
|
ALTER TABLE IF EXISTS public.servers DROP COLUMN IF EXISTS season;
|
||||||
|
|||||||
@@ -119,9 +119,8 @@ func loadQuestFile(s *Session, questId int) []byte {
|
|||||||
func makeEventQuest(s *Session, rows *sql.Rows) ([]byte, error) {
|
func makeEventQuest(s *Session, rows *sql.Rows) ([]byte, error) {
|
||||||
var id, mark uint32
|
var id, mark uint32
|
||||||
var questId int
|
var questId int
|
||||||
var indexValue, maxPlayers, questType uint8
|
var maxPlayers, questType uint8
|
||||||
var questOption uint16
|
rows.Scan(&id, &maxPlayers, &questType, &questId, &mark)
|
||||||
rows.Scan(&id, &indexValue, &maxPlayers, &questType, &questId, &mark, &questOption)
|
|
||||||
|
|
||||||
data := loadQuestFile(s, questId)
|
data := loadQuestFile(s, questId)
|
||||||
if data == nil {
|
if data == nil {
|
||||||
@@ -130,8 +129,8 @@ func makeEventQuest(s *Session, rows *sql.Rows) ([]byte, error) {
|
|||||||
|
|
||||||
bf := byteframe.NewByteFrame()
|
bf := byteframe.NewByteFrame()
|
||||||
bf.WriteUint32(id)
|
bf.WriteUint32(id)
|
||||||
bf.WriteUint32(0) //unk
|
bf.WriteUint32(0) // Unk
|
||||||
bf.WriteUint8(indexValue) // Indexer
|
bf.WriteUint8(0) // Unk
|
||||||
switch questType {
|
switch questType {
|
||||||
case 16:
|
case 16:
|
||||||
bf.WriteUint8(s.server.erupeConfig.GameplayOptions.RegularRavienteMaxPlayers)
|
bf.WriteUint8(s.server.erupeConfig.GameplayOptions.RegularRavienteMaxPlayers)
|
||||||
@@ -152,36 +151,38 @@ func makeEventQuest(s *Session, rows *sql.Rows) ([]byte, error) {
|
|||||||
} else {
|
} else {
|
||||||
bf.WriteBool(true)
|
bf.WriteBool(true)
|
||||||
}
|
}
|
||||||
bf.WriteUint16(0) //unk counter id possibly?
|
bf.WriteUint16(0) // Unk
|
||||||
if _config.ErupeConfig.RealClientMode >= _config.G1 {
|
if _config.ErupeConfig.RealClientMode >= _config.G1 {
|
||||||
bf.WriteUint32(mark)
|
bf.WriteUint32(mark)
|
||||||
}
|
}
|
||||||
bf.WriteUint16(0) //possible padding
|
bf.WriteUint16(0) // Unk
|
||||||
bf.WriteUint16(uint16(len(data)))
|
bf.WriteUint16(uint16(len(data)))
|
||||||
bf.WriteBytes(data)
|
bf.WriteBytes(data)
|
||||||
//Season/RequiredObject Flag Replacement
|
|
||||||
bf.Seek(0x18, 0)
|
// Time Flag Replacement
|
||||||
// Bitset Structure: bit 8 unk, bit 7 required objective,bit 6 unk,bit 5 night,bit 4 day,bit 3 cold,bit 2 warm,bit 1 breeding
|
// Bitset Structure: b8 UNK, b7 Required Objective, b6 UNK, b5 Night, b4 Day, b3 Cold, b2 Warm, b1 Spring
|
||||||
// if the byte is set to 0 the game choses the quest file corresponding to whatever season the game is on
|
// if the byte is set to 0 the game choses the quest file corresponding to whatever season the game is on
|
||||||
|
bf.Seek(25, 0)
|
||||||
|
flagByte := bf.ReadUint8()
|
||||||
|
bf.Seek(25, 0)
|
||||||
if s.server.erupeConfig.GameplayOptions.SeasonOverride {
|
if s.server.erupeConfig.GameplayOptions.SeasonOverride {
|
||||||
bf.WriteUint16(0)
|
bf.WriteUint8(flagByte & 0b11100000)
|
||||||
} else {
|
} else {
|
||||||
bf.WriteUint16(questOption)
|
bf.WriteUint8(flagByte)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bitset Structure Quest Varient 1: bit 8 Hiden, bit 7 Fix HC,bit 6 HC to UL,bit 5 GRank,bit 4 Unk,bit 3 UNK,bit 2 UNK,bit 1 UNK
|
// Bitset Structure Quest Variant 1: b8 UL Fixed, b7 UNK, b6 UNK, b5 UNK, b4 G Rank, b3 HC to UL, b2 Fix HC, b1 Hiden
|
||||||
// Bitset Structure Quest Varient 2: bit 8 UNK, bit 7 No Halk Pots,bit 6 No halk/poogie,bit 5 Timer,bit 4 UNK,bit 3 Fixed Difficulty,bit 2 UNK,bit 1 UNK
|
// Bitset Structure Quest Variant 2: b8 Road, b7 High Conquest, b6 Fixed Difficulty, b5 No Active Feature, b4 Timer, b3 No Cuff, b2 No Halk Pots, b1 Low Conquest
|
||||||
// Bitset Structure Quest Varient 3: bit 8 Disable Reward Skill, bit 7 GSR to GR,bit 6 unk,bit 5 Musou?,bit 4 Zenith,bit 3 Inception,bit 2 UNK,bit 1 UNK
|
// Bitset Structure Quest Variant 3: b8 No Sigils, b7 UNK, b6 Interception, b5 Zenith, b4 No GP Skills, b3 No Simple Mode?, b2 GSR to GR, b1 No Reward Skills
|
||||||
bf.Seek(0xAF, 0)
|
|
||||||
quest_variant_3 := bf.ReadUint8()
|
bf.Seek(175, 0)
|
||||||
quest_variant_3 &= 0b11011111 //disables Inception flag at position 3 for any quests that dont have it set.
|
questVariant3 := bf.ReadUint8()
|
||||||
bf.Seek(0xAF, 0)
|
questVariant3 &= 0b11011111 // disable Interception flag
|
||||||
bf.WriteUint8(quest_variant_3)
|
bf.Seek(175, 0)
|
||||||
|
bf.WriteUint8(questVariant3)
|
||||||
|
|
||||||
ps.Uint8(bf, "", true) // Debug/Notes string for quest
|
ps.Uint8(bf, "", true) // Debug/Notes string for quest
|
||||||
|
|
||||||
return bf.Data(), nil
|
return bf.Data(), nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleMsgMhfEnumerateQuest(s *Session, p mhfpacket.MHFPacket) {
|
func handleMsgMhfEnumerateQuest(s *Session, p mhfpacket.MHFPacket) {
|
||||||
@@ -190,7 +191,7 @@ func handleMsgMhfEnumerateQuest(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
bf := byteframe.NewByteFrame()
|
bf := byteframe.NewByteFrame()
|
||||||
bf.WriteUint16(0)
|
bf.WriteUint16(0)
|
||||||
|
|
||||||
rows, _ := s.server.db.Query("SELECT id, COALESCE(max_players, 4) AS max_players, index_value,quest_type, quest_id,quest_option, COALESCE(mark, 0) AS mark FROM event_quests ORDER BY quest_id")
|
rows, _ := s.server.db.Query("SELECT id, COALESCE(max_players, 4) AS max_players, quest_type, quest_id, COALESCE(mark, 0) AS mark FROM event_quests ORDER BY quest_id")
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
data, err := makeEventQuest(s, rows)
|
data, err := makeEventQuest(s, rows)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user