diff --git a/config.json b/config.json index f844b7e4a..93d820b52 100644 --- a/config.json +++ b/config.json @@ -32,7 +32,11 @@ }, "GameplayOptions": { "FeaturedWeapons": 1, + "MaximumNP": 100000, + "MaximumRP": 50000, "DisableLoginBoost": false, + "DisableBoostTime": false, + "BoostTimeDuration": 120, "GuildMealDuration": 60 }, "Discord": { diff --git a/config/config.go b/config/config.go index 0fd6300d5..c8e2ac789 100644 --- a/config/config.go +++ b/config/config.go @@ -62,9 +62,13 @@ type SaveDumpOptions struct { // GameplayOptions has various gameplay modifiers type GameplayOptions struct { - FeaturedWeapons int // Number of Active Feature weapons to generate daily - DisableLoginBoost bool // Disables the Login Boost system - GuildMealDuration int // The number of minutes a Guild Meal can be activated for after cooking + FeaturedWeapons int // Number of Active Feature weapons to generate daily + MaximumNP int // Maximum number of NP held by a player + MaximumRP uint16 // Maximum number of RP held by a player + DisableLoginBoost bool // Disables the Login Boost system + DisableBoostTime bool // Disables the daily NetCafe Boost Time + BoostTimeDuration int // The number of minutes NetCafe Boost Time lasts for + GuildMealDuration int // The number of minutes a Guild Meal can be activated for after cooking } // Discord holds the discord integration config. diff --git a/server/channelserver/handlers.go b/server/channelserver/handlers.go index b107a401b..5ca89c86d 100644 --- a/server/channelserver/handlers.go +++ b/server/channelserver/handlers.go @@ -259,8 +259,8 @@ func logoutPlayer(s *Session) { return } saveData.RP += uint16(rpGained) - if saveData.RP >= 50000 { - saveData.RP = 50000 + if saveData.RP >= s.server.erupeConfig.GameplayOptions.MaximumRP { + saveData.RP = s.server.erupeConfig.GameplayOptions.MaximumRP } saveData.Save(s) } diff --git a/server/channelserver/handlers_cafe.go b/server/channelserver/handlers_cafe.go index a94032332..9c3789e79 100644 --- a/server/channelserver/handlers_cafe.go +++ b/server/channelserver/handlers_cafe.go @@ -207,8 +207,8 @@ func addPointNetcafe(s *Session, p int) error { if err != nil { return err } - if points+p > 100000 { - points = 100000 + if points+p > s.server.erupeConfig.GameplayOptions.MaximumNP { + points = s.server.erupeConfig.GameplayOptions.MaximumNP } else { points += p } @@ -219,7 +219,10 @@ func addPointNetcafe(s *Session, p int) error { func handleMsgMhfStartBoostTime(s *Session, p mhfpacket.MHFPacket) { pkt := p.(*mhfpacket.MsgMhfStartBoostTime) bf := byteframe.NewByteFrame() - boostLimit := TimeAdjusted().Add(120 * time.Minute) + boostLimit := TimeAdjusted().Add(time.Duration(s.server.erupeConfig.GameplayOptions.BoostTimeDuration) * time.Minute) + if s.server.erupeConfig.GameplayOptions.DisableBoostTime { + boostLimit = time.Time{} + } s.server.db.Exec("UPDATE characters SET boost_time=$1 WHERE id=$2", boostLimit, s.charID) bf.WriteUint32(uint32(boostLimit.Unix())) doAckBufSucceed(s, pkt.AckHandle, bf.Data())