mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-15 08:25:09 +01:00
add min and max Feature Weapons
This commit is contained in:
@@ -46,7 +46,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"GameplayOptions": {
|
"GameplayOptions": {
|
||||||
"FeaturedWeapons": 1,
|
"MinFeatureWeapons": 0,
|
||||||
|
"MaxFeatureWeapons": 1,
|
||||||
"MaximumNP": 100000,
|
"MaximumNP": 100000,
|
||||||
"MaximumRP": 50000,
|
"MaximumRP": 50000,
|
||||||
"MaximumFP": 120000,
|
"MaximumFP": 120000,
|
||||||
|
|||||||
@@ -132,7 +132,8 @@ type CapLinkOptions 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
|
MinFeatureWeapons int // Minimum number of Active Feature weapons to generate daily
|
||||||
|
MaxFeatureWeapons int // Maximum number of Active Feature weapons to generate daily
|
||||||
MaximumNP int // Maximum number of NP held by a player
|
MaximumNP int // Maximum number of NP held by a player
|
||||||
MaximumRP uint16 // Maximum number of RP held by a player
|
MaximumRP uint16 // Maximum number of RP held by a player
|
||||||
MaximumFP uint32 // Maximum number of FP held by a player
|
MaximumFP uint32 // Maximum number of FP held by a player
|
||||||
|
|||||||
@@ -66,7 +66,8 @@ func handleMsgMhfGetWeeklySchedule(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
var temp activeFeature
|
var temp activeFeature
|
||||||
err := s.server.db.QueryRowx(`SELECT start_time, featured FROM feature_weapon WHERE start_time=$1`, t).StructScan(&temp)
|
err := s.server.db.QueryRowx(`SELECT start_time, featured FROM feature_weapon WHERE start_time=$1`, t).StructScan(&temp)
|
||||||
if err != nil || temp.StartTime.IsZero() {
|
if err != nil || temp.StartTime.IsZero() {
|
||||||
temp = generateFeatureWeapons(s.server.erupeConfig.GameplayOptions.FeaturedWeapons)
|
weapons := token.RNG.Intn(s.server.erupeConfig.GameplayOptions.MaxFeatureWeapons-s.server.erupeConfig.GameplayOptions.MinFeatureWeapons+1) + s.server.erupeConfig.GameplayOptions.MinFeatureWeapons
|
||||||
|
temp = generateFeatureWeapons(weapons)
|
||||||
temp.StartTime = t
|
temp.StartTime = t
|
||||||
s.server.db.Exec(`INSERT INTO feature_weapon VALUES ($1, $2)`, temp.StartTime, temp.ActiveFeatures)
|
s.server.db.Exec(`INSERT INTO feature_weapon VALUES ($1, $2)`, temp.StartTime, temp.ActiveFeatures)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user