Files
chuanqi-client-config/batchSetting.js
aixianling ab13acd40d refactor(batchSetting): 更新 SpecialRing.config 配置
- 在 batchSetting.js 中添加新的值和间隔
- 更新 SpecialRingConfig.json 中的配置项
- 移除不必要的属性和冗余代码
2024-12-26 14:09:37 +08:00

24 lines
862 B
JavaScript

const fs = require('fs')
const key = "SpecialRing.config"
const values = [56, 100, 500] // 登记,伤害加倍,元宝花费
const interval = [1, 100, 50]
const num = 45
const start = () => {
const template = `[S1] = {
pos = 4,
lv = S1,
cost = {{type=4,id=4,count=S3},{type=0,id=1018,count=1000}},
attr = {{type=75,value=S2},{type=76,value=428},{type=77,value=536},{type=21,value=55},{type=23,value=55},{type=25,value=55},{type=27,value=55},{type=83,value=5000},},
}`
const getStr = (index) => {
let str = template
values.forEach((v, i) => {
const reg = new RegExp(`S${i + 1}`, 'g')
str = str.replace(reg, v + index * interval[i])
})
return str
}
const content = Array(num).fill(1).map((e, i) => `${getStr(i)}`).join(',')
fs.writeFileSync(`./dist/${key}.txt`, content)
}
start()