|
|
@@ -3,7 +3,7 @@ import { FrontworkAdmin } from "../src/backend/Admin/Admin";
|
|
3
|
3
|
import { T1 } from "../src/backend/Types/Items";
|
|
4
|
4
|
|
|
5
|
5
|
import { RPCSocket } from "rpclibrary";
|
|
6
|
|
-import { FrontcraftIfc, Auth, User, FrontcraftFeatureIfc, Raid, Character, Rank, Class, Race } from "../src/backend/Types/Types";
|
|
|
6
|
+import { FrontcraftIfc, Auth, User, FrontcraftFeatureIfc, Raid, Character, Rank, Class, Race, SRPriority, Spec } from "../src/backend/Types/Types";
|
|
7
|
7
|
import { SpecT } from "../src/backend/Types/PlayerSpecs";
|
|
8
|
8
|
|
|
9
|
9
|
|
|
|
@@ -227,9 +227,214 @@ describe('Frontcraft', () => {
|
|
227
|
227
|
})
|
|
228
|
228
|
|
|
229
|
229
|
it('calculate priorities', (done)=>{
|
|
|
230
|
+ const makePrio = async (itemname:string, spec?: Spec, race?:Race, mod:number = 0, description:string = "") => {
|
|
|
231
|
+ let specid
|
|
|
232
|
+ if(spec)
|
|
|
233
|
+ specid = await client.CharacterManager.getSpecId(spec.class, <any>spec.specname)
|
|
|
234
|
+
|
|
|
235
|
+ await adminClient.managePriorities.setPriority(itemname, {
|
|
|
236
|
+ specid: specid,
|
|
|
237
|
+ race: race,
|
|
|
238
|
+ modifier: mod,
|
|
|
239
|
+ description: description
|
|
|
240
|
+ })
|
|
|
241
|
+ }
|
|
|
242
|
+
|
|
|
243
|
+
|
|
|
244
|
+ Promise.all([
|
|
|
245
|
+ makePrio(
|
|
|
246
|
+ 'Bracers of Arcane Accuracy',
|
|
|
247
|
+ {class:'Warlock', specname:'Demonology'},
|
|
|
248
|
+ undefined, 2, "hit bias"
|
|
|
249
|
+ ),
|
|
|
250
|
+ makePrio(
|
|
|
251
|
+ 'Bracers of Arcane Accuracy',
|
|
|
252
|
+ {class:'Warlock', specname:'Affliction'},
|
|
|
253
|
+ undefined, 2, "hit bias"
|
|
|
254
|
+ ),
|
|
|
255
|
+ makePrio(
|
|
|
256
|
+ 'Bracers of Arcane Accuracy',
|
|
|
257
|
+ {class:'Warlock', specname:'Destruction'},
|
|
|
258
|
+ undefined, 2, "hit bias"
|
|
|
259
|
+ ),
|
|
|
260
|
+ makePrio(
|
|
|
261
|
+ 'Bracers of Arcane Accuracy',
|
|
|
262
|
+ {class:'Mage', specname:'Arcane'},
|
|
|
263
|
+ undefined, 1, "hit bias"
|
|
|
264
|
+ ),
|
|
|
265
|
+ makePrio(
|
|
|
266
|
+ 'Bracers of Arcane Accuracy',
|
|
|
267
|
+ {class:'Mage', specname:'Frost'},
|
|
|
268
|
+ undefined, 1, "hit bias"
|
|
|
269
|
+ ),
|
|
|
270
|
+ makePrio(
|
|
|
271
|
+ 'Bracers of Arcane Accuracy',
|
|
|
272
|
+ {class:'Mage', specname:'Fire'},
|
|
|
273
|
+ undefined, 1, "hit bias"
|
|
|
274
|
+ ),
|
|
|
275
|
+
|
|
|
276
|
+ makePrio(
|
|
|
277
|
+ 'Maladath, Runed Blade of the Black Flight',
|
|
|
278
|
+ {class:'Warrior', specname:'Fury'},
|
|
|
279
|
+ 'Human', 2, "weapon skill bias"
|
|
|
280
|
+ ),
|
|
|
281
|
+
|
|
|
282
|
+ makePrio(
|
|
|
283
|
+ 'Cloak of Firemaw',
|
|
|
284
|
+ {class:'Rogue', specname:'Assassination'},
|
|
|
285
|
+ undefined, 2, "agi-to-ap bias"
|
|
|
286
|
+ ),
|
|
|
287
|
+ makePrio(
|
|
|
288
|
+ 'Cloak of Firemaw',
|
|
|
289
|
+ {class:'Rogue', specname:'Combat'},
|
|
|
290
|
+ undefined, 2, "agi-to-ap bias"
|
|
|
291
|
+ ),
|
|
|
292
|
+ makePrio(
|
|
|
293
|
+ 'Cloak of Firemaw',
|
|
|
294
|
+ {class:'Rogue', specname:'Subtlety'},
|
|
|
295
|
+ undefined, 2, "agi-to-ap bias"
|
|
|
296
|
+ ),
|
|
|
297
|
+
|
|
|
298
|
+ makePrio(
|
|
|
299
|
+ 'Band of Forced Concentration',
|
|
|
300
|
+ {class:'Warlock', specname:'Demonology'},
|
|
|
301
|
+ undefined, 2, "hit bias"
|
|
|
302
|
+ ),
|
|
|
303
|
+ makePrio(
|
|
|
304
|
+ 'Band of Forced Concentration',
|
|
|
305
|
+ {class:'Warlock', specname:'Affliction'},
|
|
|
306
|
+ undefined, 2, "hit bias"
|
|
|
307
|
+ ),
|
|
|
308
|
+ makePrio(
|
|
|
309
|
+ 'Band of Forced Concentration',
|
|
|
310
|
+ {class:'Warlock', specname:'Destruction'},
|
|
|
311
|
+ undefined, 2, "hit bias"
|
|
|
312
|
+ ),
|
|
|
313
|
+ makePrio(
|
|
|
314
|
+ 'Band of Forced Concentration',
|
|
|
315
|
+ {class:'Mage', specname:'Arcane'},
|
|
|
316
|
+ undefined, 1, "hit bias"
|
|
|
317
|
+ ),
|
|
|
318
|
+ makePrio(
|
|
|
319
|
+ 'Band of Forced Concentration',
|
|
|
320
|
+ {class:'Mage', specname:'Frost'},
|
|
|
321
|
+ undefined, 1, "hit bias"
|
|
|
322
|
+ ),
|
|
|
323
|
+ makePrio(
|
|
|
324
|
+ 'Band of Forced Concentration',
|
|
|
325
|
+ {class:'Mage', specname:'Fire'},
|
|
|
326
|
+ undefined, 1, "hit bias"
|
|
|
327
|
+ ),
|
|
|
328
|
+
|
|
|
329
|
+ makePrio(
|
|
|
330
|
+ 'Drake Fang Talisman',
|
|
|
331
|
+ {class:'Rogue', specname:'Assassination'},
|
|
|
332
|
+ undefined, 4, "hit bias"
|
|
|
333
|
+ ),
|
|
|
334
|
+ makePrio(
|
|
|
335
|
+ 'Drake Fang Talisman',
|
|
|
336
|
+ {class:'Rogue', specname:'Combat'},
|
|
|
337
|
+ undefined, 4, "hit bias"
|
|
|
338
|
+ ),
|
|
|
339
|
+ makePrio(
|
|
|
340
|
+ 'Drake Fang Talisman',
|
|
|
341
|
+ {class:'Rogue', specname:'Subtlety'},
|
|
|
342
|
+ undefined, 4, "hit bias"
|
|
|
343
|
+ ),
|
|
|
344
|
+ makePrio(
|
|
|
345
|
+ 'Drake Fang Talisman',
|
|
|
346
|
+ {class:'Warrior', specname:'Fury'},
|
|
|
347
|
+ undefined, 2, "hit bias"
|
|
|
348
|
+ ),
|
|
|
349
|
+ makePrio(
|
|
|
350
|
+ 'Drake Fang Talisman',
|
|
|
351
|
+ {class:'Druid', specname:'Feral (DPS)'},
|
|
|
352
|
+ undefined, 2, "hit bias"
|
|
|
353
|
+ ),
|
|
|
354
|
+
|
|
|
355
|
+ makePrio(
|
|
|
356
|
+ 'Circle of Applied Force',
|
|
|
357
|
+ {class:'Warrior', specname:'Fury'},
|
|
|
358
|
+ undefined, 2, "str-to-ap bias"
|
|
|
359
|
+ ),
|
|
|
360
|
+ makePrio(
|
|
|
361
|
+ 'Circle of Applied Force',
|
|
|
362
|
+ {class:'Druid', specname:'Feral (DPS)'},
|
|
|
363
|
+ undefined, 2, "str-to-ap bias"
|
|
|
364
|
+ ),
|
|
|
365
|
+
|
|
|
366
|
+ makePrio(
|
|
|
367
|
+ 'Empowered Leggings',
|
|
|
368
|
+ {class:'Paladin', specname:'Holy'},
|
|
|
369
|
+ undefined, 2, "crit bias"
|
|
|
370
|
+ ),
|
|
|
371
|
+
|
|
|
372
|
+ makePrio(
|
|
|
373
|
+ 'Boots of the Shadow Flame',
|
|
|
374
|
+ {class:'Rogue', specname:'Assassination'},
|
|
|
375
|
+ undefined, 2, "hit bias"
|
|
|
376
|
+ ),
|
|
|
377
|
+ makePrio(
|
|
|
378
|
+ 'Boots of the Shadow Flame',
|
|
|
379
|
+ {class:'Rogue', specname:'Combat'},
|
|
|
380
|
+ undefined, 2, "hit bias"
|
|
|
381
|
+ ),
|
|
|
382
|
+ makePrio(
|
|
|
383
|
+ 'Boots of the Shadow Flame',
|
|
|
384
|
+ {class:'Rogue', specname:'Subtlety'},
|
|
|
385
|
+ undefined, 2, "hit bias"
|
|
|
386
|
+ ),
|
|
|
387
|
+ makePrio(
|
|
|
388
|
+ 'Boots of the Shadow Flame',
|
|
|
389
|
+ {class:'Druid', specname:'Feral (DPS)'},
|
|
|
390
|
+ undefined, 2, "hit bias"
|
|
|
391
|
+ ),
|
|
|
392
|
+
|
|
|
393
|
+ makePrio(
|
|
|
394
|
+ 'Neltharion\'s Tear',
|
|
|
395
|
+ {class:'Warlock', specname:'Demonology'},
|
|
|
396
|
+ undefined, 4, "hit bias"
|
|
|
397
|
+ ),
|
|
|
398
|
+ makePrio(
|
|
|
399
|
+ 'Neltharion\'s Tear',
|
|
|
400
|
+ {class:'Warlock', specname:'Affliction'},
|
|
|
401
|
+ undefined, 4, "hit bias"
|
|
|
402
|
+ ),
|
|
|
403
|
+ makePrio(
|
|
|
404
|
+ 'Neltharion\'s Tear',
|
|
|
405
|
+ {class:'Warlock', specname:'Destruction'},
|
|
|
406
|
+ undefined, 4, "hit bias"
|
|
|
407
|
+ ),
|
|
|
408
|
+ makePrio(
|
|
|
409
|
+ 'Neltharion\'s Tear',
|
|
|
410
|
+ {class:'Mage', specname:'Arcane'},
|
|
|
411
|
+ undefined, 2, "hit bias"
|
|
|
412
|
+ ),
|
|
|
413
|
+ makePrio(
|
|
|
414
|
+ 'Neltharion\'s Tear',
|
|
|
415
|
+ {class:'Mage', specname:'Frost'},
|
|
|
416
|
+ undefined, 2, "hit bias"
|
|
|
417
|
+ ),
|
|
|
418
|
+ makePrio(
|
|
|
419
|
+ 'Neltharion\'s Tear',
|
|
|
420
|
+ {class:'Mage', specname:'Fire'},
|
|
|
421
|
+ undefined, 2, "hit bias"
|
|
|
422
|
+ ),
|
|
|
423
|
+
|
|
|
424
|
+ makePrio(
|
|
|
425
|
+ 'Cloak of Draconic Might',
|
|
|
426
|
+ {class:'Warrior', specname:'Fury'},
|
|
|
427
|
+ undefined, 2, "str-to-ap bias"
|
|
|
428
|
+ ),
|
|
|
429
|
+ makePrio(
|
|
|
430
|
+ 'Cloak of Draconic Might',
|
|
|
431
|
+ {class:'Druid', specname:'Feral (DPS)'},
|
|
|
432
|
+ undefined, 2, "str-to-ap bias"
|
|
|
433
|
+ ),
|
|
|
434
|
+ ])
|
|
230
|
435
|
|
|
231
|
|
- const user = Object.values(users)[0]
|
|
232
|
436
|
|
|
|
437
|
+ const user = Object.values(users)[0]
|
|
233
|
438
|
adminClient.managePriorities.setPriority(T1[0], {
|
|
234
|
439
|
race: user.character.race,
|
|
235
|
440
|
specid: user.character.specid,
|