mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-14 16:04:38 +01:00
add various gameplay options
This commit is contained in:
@@ -32,7 +32,11 @@
|
|||||||
},
|
},
|
||||||
"GameplayOptions": {
|
"GameplayOptions": {
|
||||||
"FeaturedWeapons": 1,
|
"FeaturedWeapons": 1,
|
||||||
|
"MaximumNP": 100000,
|
||||||
|
"MaximumRP": 50000,
|
||||||
"DisableLoginBoost": false,
|
"DisableLoginBoost": false,
|
||||||
|
"DisableBoostTime": false,
|
||||||
|
"BoostTimeDuration": 120,
|
||||||
"GuildMealDuration": 60
|
"GuildMealDuration": 60
|
||||||
},
|
},
|
||||||
"Discord": {
|
"Discord": {
|
||||||
|
|||||||
@@ -63,7 +63,11 @@ type SaveDumpOptions struct {
|
|||||||
// GameplayOptions has various gameplay modifiers
|
// GameplayOptions has various gameplay modifiers
|
||||||
type GameplayOptions struct {
|
type GameplayOptions struct {
|
||||||
FeaturedWeapons int // Number of Active Feature weapons to generate daily
|
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
|
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
|
GuildMealDuration int // The number of minutes a Guild Meal can be activated for after cooking
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -259,8 +259,8 @@ func logoutPlayer(s *Session) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
saveData.RP += uint16(rpGained)
|
saveData.RP += uint16(rpGained)
|
||||||
if saveData.RP >= 50000 {
|
if saveData.RP >= s.server.erupeConfig.GameplayOptions.MaximumRP {
|
||||||
saveData.RP = 50000
|
saveData.RP = s.server.erupeConfig.GameplayOptions.MaximumRP
|
||||||
}
|
}
|
||||||
saveData.Save(s)
|
saveData.Save(s)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -207,8 +207,8 @@ func addPointNetcafe(s *Session, p int) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if points+p > 100000 {
|
if points+p > s.server.erupeConfig.GameplayOptions.MaximumNP {
|
||||||
points = 100000
|
points = s.server.erupeConfig.GameplayOptions.MaximumNP
|
||||||
} else {
|
} else {
|
||||||
points += p
|
points += p
|
||||||
}
|
}
|
||||||
@@ -219,7 +219,10 @@ func addPointNetcafe(s *Session, p int) error {
|
|||||||
func handleMsgMhfStartBoostTime(s *Session, p mhfpacket.MHFPacket) {
|
func handleMsgMhfStartBoostTime(s *Session, p mhfpacket.MHFPacket) {
|
||||||
pkt := p.(*mhfpacket.MsgMhfStartBoostTime)
|
pkt := p.(*mhfpacket.MsgMhfStartBoostTime)
|
||||||
bf := byteframe.NewByteFrame()
|
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)
|
s.server.db.Exec("UPDATE characters SET boost_time=$1 WHERE id=$2", boostLimit, s.charID)
|
||||||
bf.WriteUint32(uint32(boostLimit.Unix()))
|
bf.WriteUint32(uint32(boostLimit.Unix()))
|
||||||
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
|
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
|
||||||
|
|||||||
Reference in New Issue
Block a user