-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathserverinit.js
136 lines (127 loc) · 3.08 KB
/
serverinit.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
const STATS = require('./modules/statsBot.js');
const BOSS = require('./modules/boss.js');
const BOSSCONFIG = require('./config/boss.json');
const AREA = require('./modules/area.js')
const config = require('./App/config.json');
const mongoose = require('mongoose');
mongoose
.connect(config.mongodb, {})
.then(() => console.log(`MongoDB Ready`))
.catch(err => console.error(`MongoDB connection error: ${err}`));
async function initializeServer() {
var statsBot = new STATS({
botID: 899,
numberPlayer: 0,
numberSquad: 0,
amoutCoin: 0,
amoutItem: 0,
amoutMonsterKilled: 0,
boxOpen: 0,
});
await statsBot.save();
var area1 = new AREA({
areaid: 0,
areaname: 'lumby'
})
var area2 = new AREA({
areaid: 1,
areaname: 'fally'
})
var area3 = new AREA({
areaid: 2,
areaname: `highlands`,
})
var area4 = new AREA({
areaid: 3,
areaname: 'astrals'
})
var area5 = new AREA({
areaid: 4,
areaname: 'ethereal'
})
var area6 = new AREA({
areaid: 5,
areaname: 'polyzeal'
})
var area7 = new AREA({
areaid: 6,
areaname: 'underworld'
})
var area8 = new AREA({
areaid: 7,
areaname: 'rektlands'
})
var area9 = new AREA({
areaid: 8,
areaname: 'mountstone'
})
var area10 = new AREA({
areaid: 9,
areaname: 'royalrealm'
})
var area11 = new AREA({
areaid: 10,
areaname: 'goneville'
})
var area12 = new AREA({
areaid: 11,
areaname: 'ascension'
})
var area13 = new AREA({
areaid: 12,
areaname: 'donaldscave'
})
var area14 = new AREA({
areaid: 13,
areaname: 'wilderness'
})
var area15 = new AREA({
areaid: 14,
areaname: 'barrens'
})
var area16 = new AREA({
areaid: 15,
areaname: 'eastlands'
})
var area17 = new AREA({
areaid: 16,
areaname: 'westlands'
})
area1.save()
area2.save()
area3.save()
area4.save()
area5.save()
area6.save()
area7.save()
area8.save()
area9.save()
area10.save()
area11.save()
area12.save()
area13.save()
area14.save()
area15.save()
area16.save()
area17.save()
try {
const boss = await BOSS.findOne({ bossname: 'Thunder Fenrir' });
if (!boss) {
var bossPlayer = new BOSS({
idboss: 5,
bossname: BOSSCONFIG.boss6.name,
stats: {
attack: BOSSCONFIG.boss6.attack,
health: BOSSCONFIG.boss6.health,
},
});
await bossPlayer.save();
console.log('Boss created !');
} else {
console.log('Boss already exists !');
}
} catch (err) {
console.log(err);
}
}
initializeServer();