Exposed EnumEvent

This commit is contained in:
stratic-dev
2024-05-08 20:19:40 +01:00
parent b8be6e7aa8
commit 9ee132eb41
3 changed files with 23 additions and 6 deletions

View File

@@ -102,7 +102,13 @@
"EnableHiganjimaEvent": false, "EnableHiganjimaEvent": false,
"EnableNierEvent": false, "EnableNierEvent": false,
"DisableRoad": false, "DisableRoad": false,
"SeasonOverride": false "SeasonOverride": false,
"EnumerateEvent": {
"Enabled":false,
"EventID":8,
"Duration":172800,
"QuestIDs": [20001, 20004, 20005, 20006, 20011, 20012, 20013, 20018, 20019, 20020, 20021, 20022, 20023, 20024, 20025, 20026, 20027, 20028, 20029]
}
}, },
"Discord": { "Discord": {
"Enabled": false, "Enabled": false,

View File

@@ -139,6 +139,13 @@ type CapLinkOptions struct {
Port int Port int
} }
type EnumerateEventOptions struct {
QuestIDs []uint16
EventID uint16
Enabled bool
Duration int
}
// GameplayOptions has various gameplay modifiers // GameplayOptions has various gameplay modifiers
type GameplayOptions struct { type GameplayOptions struct {
MinFeatureWeapons int // Minimum number of Active Feature weapons to generate daily MinFeatureWeapons int // Minimum number of Active Feature weapons to generate daily
@@ -193,6 +200,7 @@ type GameplayOptions struct {
EnableNierEvent bool // Enables the Nier event in the Rasta Bar EnableNierEvent bool // Enables the Nier event in the Rasta Bar
DisableRoad bool // Disables the Hunting Road DisableRoad bool // Disables the Hunting Road
SeasonOverride bool // Overrides the Quest Season with the current Mezeporta Season SeasonOverride bool // Overrides the Quest Season with the current Mezeporta Season
EnumerateEvent EnumerateEventOptions
} }
// Discord holds the discord integration config. // Discord holds the discord integration config.

View File

@@ -11,13 +11,13 @@ import (
) )
type Event struct { type Event struct {
EventType uint16 EventType uint16 //0 Nothing //1 or 2 "An Acient Dragon has attacked the fort"
Unk1 uint16 Unk1 uint16
Unk2 uint16 Unk2 uint16
Unk3 uint16 Unk3 uint16
Unk4 uint16 Unk4 uint16
Unk5 uint32 StartTime time.Time
Unk6 uint32 EndTime time.Time
QuestFileIDs []uint16 QuestFileIDs []uint16
} }
@@ -26,6 +26,9 @@ func handleMsgMhfEnumerateEvent(s *Session, p mhfpacket.MHFPacket) {
bf := byteframe.NewByteFrame() bf := byteframe.NewByteFrame()
events := []Event{} events := []Event{}
if s.server.erupeConfig.GameplayOptions.EnumerateEvent.Enabled {
events = append(events, Event{s.server.erupeConfig.GameplayOptions.EnumerateEvent.EventID, 0, 0, 0, 0, TimeWeekNext().Add(-time.Duration(s.server.erupeConfig.GameplayOptions.EnumerateEvent.Duration) * time.Second), TimeWeekNext(), s.server.erupeConfig.GameplayOptions.EnumerateEvent.QuestIDs})
}
bf.WriteUint8(uint8(len(events))) bf.WriteUint8(uint8(len(events)))
for _, event := range events { for _, event := range events {
@@ -34,8 +37,8 @@ func handleMsgMhfEnumerateEvent(s *Session, p mhfpacket.MHFPacket) {
bf.WriteUint16(event.Unk2) bf.WriteUint16(event.Unk2)
bf.WriteUint16(event.Unk3) bf.WriteUint16(event.Unk3)
bf.WriteUint16(event.Unk4) bf.WriteUint16(event.Unk4)
bf.WriteUint32(event.Unk5) bf.WriteUint32(uint32(event.StartTime.Unix()))
bf.WriteUint32(event.Unk6) bf.WriteUint32(uint32(event.EndTime.Unix()))
if event.EventType == 2 { if event.EventType == 2 {
bf.WriteUint8(uint8(len(event.QuestFileIDs))) bf.WriteUint8(uint8(len(event.QuestFileIDs)))
for _, qf := range event.QuestFileIDs { for _, qf := range event.QuestFileIDs {