h1z1-server 0.45.2-0 → 0.45.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,6 +14,9 @@ server:
14
14
  isFirstPersonOnly: false
15
15
  isNoBuildInPois: true
16
16
  baseConstructionDamage: 34000
17
+ damageWeapons: true # Damage weapons on firing
18
+ disablePOIManager: false # Disables the POI messages
19
+ disableMapBoundsCheck: false # Disables inboundscheck
17
20
 
18
21
  # Rcon
19
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "h1z1-server",
3
- "version": "0.45.2-0",
3
+ "version": "0.45.2",
4
4
  "description": "Library for emulating h1z1 servers",
5
5
  "author": "Quentin Gruber <quentingruber@gmail.com> (http://github.com/quentingruber)",
6
6
  "license": "GPL-3.0-only",
@@ -2436,7 +2436,19 @@ export const basePackets: PacketStructures = [
2436
2436
  ["Acquaintance", 0x2b, {}],
2437
2437
  ["ClientServerShuttingDown", 0x2c, {}],
2438
2438
 
2439
- ["Broadcast", 0x2e, {}],
2439
+ [
2440
+ "Broadcast",
2441
+ 0x2e0000,
2442
+ {
2443
+ fields: [
2444
+ { name: "identity", type: "schema", fields: identitySchema },
2445
+ { name: "unknownString1", type: "string", defaultValue: "" },
2446
+ { name: "unknownDword1", type: "uint32", defaultValue: 0 },
2447
+ { name: "unknownBoolean1", type: "boolean", defaultValue: false },
2448
+ { name: "unknownBoolean2", type: "boolean", defaultValue: false }
2449
+ ]
2450
+ }
2451
+ ],
2440
2452
  ["ClientKickedFromServer", 0x2f, {}],
2441
2453
  [
2442
2454
  "UpdateClientSessionData",
@@ -3590,11 +3602,11 @@ export const basePackets: PacketStructures = [
3590
3602
  "Animation.Request",
3591
3603
  0xf801,
3592
3604
  {
3593
- fields: [{ name: "animationId", type: "uint32", defaultValue: 0 }]
3605
+ fields: [{ name: "itemDefinitionId", type: "uint32", defaultValue: 0 }]
3594
3606
  }
3595
3607
  ],
3596
3608
  [
3597
- "AnimationBase",
3609
+ "Animation.Play",
3598
3610
  0xf802,
3599
3611
  {
3600
3612
  fields: [
@@ -37,9 +37,41 @@ export const chatPackets: PacketStructures = [
37
37
  ]
38
38
  }
39
39
  ],
40
- ["Chat.EnterArea", 0x060200, {}],
41
- ["Chat.DebugChat", 0x060300, {}],
42
- ["Chat.FromStringId", 0x060400, {}],
40
+ [
41
+ "Chat.EnterArea",
42
+ 0x060200,
43
+ {
44
+ fields: [{ name: "unknownDword1", type: "uint32", defaultValue: 1 }]
45
+ }
46
+ ],
47
+ [
48
+ "Chat.DebugChat",
49
+ 0x060300,
50
+ {
51
+ fields: [
52
+ { name: "message", type: "string", defaultValue: "" },
53
+ { name: "unknownBoolean1", type: "boolean", defaultValue: false },
54
+ { name: "unknownDword1", type: "uint32", defaultValue: 0x40000 }
55
+ ]
56
+ }
57
+ ],
58
+ [
59
+ "Chat.FromStringId",
60
+ 0x060400,
61
+ {
62
+ fields: [
63
+ { name: "unknownQword1", type: "uint64string", defaultValue: "" },
64
+ { name: "stringId", type: "uint32", defaultValue: 1 },
65
+ { name: "hidden", type: "boolean", defaultValue: false },
66
+ { name: "unknownBoolean2", type: "boolean", defaultValue: false },
67
+ { name: "unknownBoolean3", type: "boolean", defaultValue: false },
68
+ { name: "unknownDword2", type: "uint32", defaultValue: 0 },
69
+ { name: "unknownQword2", type: "uint64string", defaultValue: "" },
70
+ { name: "unknownQword3", type: "uint64string", defaultValue: "" },
71
+ { name: "unknownDword3", type: "uint32", defaultValue: 0 }
72
+ ]
73
+ }
74
+ ],
43
75
  //["Chat.TellEcho", 0x060500, {}],
44
76
  [
45
77
  "Chat.ChatText",
@@ -50,8 +82,8 @@ export const chatPackets: PacketStructures = [
50
82
  { name: "unknownDword1", type: "uint32", defaultValue: 0 },
51
83
  { name: "color", type: "bytes", length: 4 },
52
84
  { name: "unknownDword2", type: "uint32", defaultValue: 0 },
53
- { name: "unknownByte3", type: "uint8", defaultValue: 0 },
54
- { name: "unknownByte4", type: "uint8", defaultValue: 0 }
85
+ { name: "unknownBoolean1", type: "boolean", defaultValue: false },
86
+ { name: "unknownBoolean2", type: "boolean", defaultValue: false }
55
87
  ]
56
88
  }
57
89
  ]
@@ -60,19 +60,19 @@ export const gamemodePackets: PacketStructures = [
60
60
  }
61
61
  ],
62
62
  [
63
- "GameMode.Unk9",
63
+ "GameMode.PlayersRemaining",
64
64
  0xcf0900,
65
65
  {
66
- fields: [{ name: "unknownDword1", type: "uint32", defaultValue: 0 }]
66
+ fields: [{ name: "players", type: "uint32", defaultValue: 0 }]
67
67
  }
68
68
  ],
69
69
  [
70
- "GameMode.Unk10",
70
+ "GameMode.TeamsRemaining",
71
71
  0xcf0a00,
72
72
  {
73
73
  fields: [
74
- { name: "unknownDword1", type: "uint32", defaultValue: 0 },
75
- { name: "unknownDword2", type: "uint32", defaultValue: 0 }
74
+ { name: "players", type: "uint32", defaultValue: 0 },
75
+ { name: "teams", type: "uint32", defaultValue: 0 }
76
76
  ]
77
77
  }
78
78
  ],
@@ -38,7 +38,16 @@ export const uiPackets: PacketStructures = [
38
38
  ["Ui.ResetTimer", 0x1a0a, {}],
39
39
  ["Ui.ObjectiveTargetUpdate", 0x1a0d, {}],
40
40
  ["Ui.Message", 0x1a0e, {}],
41
- ["Ui.CinematicStartLookAt", 0x1a0f, {}],
41
+ [
42
+ "Ui.CinematicStartLookAt",
43
+ 0x1a0f,
44
+ {
45
+ fields: [
46
+ { name: "unknownDword1", type: "uint32", defaultValue: 0 },
47
+ { name: "unknownBoolean1", type: "boolean", defaultValue: false }
48
+ ]
49
+ }
50
+ ],
42
51
  [
43
52
  "Ui.WeaponHitFeedback",
44
53
  0x1a10,
@@ -48,5 +48,12 @@ export const voicePackets: PacketStructures = [
48
48
  ]
49
49
  }
50
50
  ],
51
- ["Voice.LeaveRadio", 0x8208, { fields: [] }]
51
+ ["Voice.LeaveRadio", 0x8208, { fields: [] }],
52
+ [
53
+ "Voice.Unk9", // Related to Gamemode.Unk21
54
+ 0x8209,
55
+ {
56
+ fields: [{ name: "unknownByte1", type: "uint8", defaultValue: 0 }]
57
+ }
58
+ ]
52
59
  ];
@@ -497,6 +497,376 @@ export const smeltingData: { [recipeId: number]: smeltRecipe } = {
497
497
  requiredAmount: 1
498
498
  }
499
499
  ]
500
+ },
501
+ 43: {
502
+ filterId: FilterIds.FURNACE,
503
+ rewardId: Items.METAL_BAR,
504
+ components: [
505
+ {
506
+ itemDefinitionId: Items.WEAPON_R380,
507
+ requiredAmount: 1
508
+ }
509
+ ]
510
+ },
511
+ 44: {
512
+ filterId: FilterIds.FURNACE,
513
+ rewardId: Items.METAL_BAR,
514
+ components: [
515
+ {
516
+ itemDefinitionId: Items.WEAPON_GREENWOOD_SNIPER,
517
+ requiredAmount: 1
518
+ }
519
+ ]
520
+ },
521
+ 45: {
522
+ filterId: FilterIds.FURNACE,
523
+ rewardId: Items.METAL_BAR,
524
+ components: [
525
+ {
526
+ itemDefinitionId: Items.WEAPON_PATRIOTIC_SNIPER,
527
+ requiredAmount: 1
528
+ }
529
+ ]
530
+ },
531
+ 46: {
532
+ filterId: FilterIds.FURNACE,
533
+ rewardId: Items.METAL_BAR,
534
+ components: [
535
+ {
536
+ itemDefinitionId: Items.WEAPON_H1EMU_SNIPER,
537
+ requiredAmount: 1
538
+ }
539
+ ]
540
+ },
541
+ 47: {
542
+ filterId: FilterIds.FURNACE,
543
+ rewardId: Items.METAL_BAR,
544
+ components: [
545
+ {
546
+ itemDefinitionId: Items.WEAPON_H1EMU_AR,
547
+ requiredAmount: 1
548
+ }
549
+ ]
550
+ },
551
+ 48: {
552
+ filterId: FilterIds.FURNACE,
553
+ rewardId: Items.METAL_BAR,
554
+ components: [
555
+ {
556
+ itemDefinitionId: Items.WEAPON_ROSEGARDEN_SHOTGUN,
557
+ requiredAmount: 1
558
+ }
559
+ ]
560
+ },
561
+ 49: {
562
+ filterId: FilterIds.FURNACE,
563
+ rewardId: Items.METAL_BAR,
564
+ components: [
565
+ {
566
+ itemDefinitionId: 2593,
567
+ requiredAmount: 1
568
+ }
569
+ ]
570
+ },
571
+ 50: {
572
+ filterId: FilterIds.FURNACE,
573
+ rewardId: Items.METAL_BAR,
574
+ components: [
575
+ {
576
+ itemDefinitionId: 3586,
577
+ requiredAmount: 1
578
+ }
579
+ ]
580
+ },
581
+ 51: {
582
+ filterId: FilterIds.FURNACE,
583
+ rewardId: Items.METAL_BAR,
584
+ components: [
585
+ {
586
+ itemDefinitionId: 2592,
587
+ requiredAmount: 1
588
+ }
589
+ ]
590
+ },
591
+ 52: {
592
+ filterId: FilterIds.FURNACE,
593
+ rewardId: Items.METAL_BAR,
594
+ components: [
595
+ {
596
+ itemDefinitionId: 2586,
597
+ requiredAmount: 1
598
+ }
599
+ ]
600
+ },
601
+ 53: {
602
+ filterId: FilterIds.FURNACE,
603
+ rewardId: Items.METAL_BAR,
604
+ components: [
605
+ {
606
+ itemDefinitionId: 3720,
607
+ requiredAmount: 1
608
+ }
609
+ ]
610
+ },
611
+ 54: {
612
+ filterId: FilterIds.FURNACE,
613
+ rewardId: Items.METAL_BAR,
614
+ components: [
615
+ {
616
+ itemDefinitionId: 3550,
617
+ requiredAmount: 1
618
+ }
619
+ ]
620
+ },
621
+ 55: {
622
+ filterId: FilterIds.FURNACE,
623
+ rewardId: Items.METAL_BAR,
624
+ components: [
625
+ {
626
+ itemDefinitionId: 3584,
627
+ requiredAmount: 1
628
+ }
629
+ ]
630
+ },
631
+ 56: {
632
+ filterId: FilterIds.FURNACE,
633
+ rewardId: Items.METAL_BAR,
634
+ components: [
635
+ {
636
+ itemDefinitionId: 3172,
637
+ requiredAmount: 1
638
+ }
639
+ ]
640
+ },
641
+ 57: {
642
+ filterId: FilterIds.FURNACE,
643
+ rewardId: Items.METAL_BAR,
644
+ components: [
645
+ {
646
+ itemDefinitionId: 3165,
647
+ requiredAmount: 1
648
+ }
649
+ ]
650
+ },
651
+ 58: {
652
+ filterId: FilterIds.FURNACE,
653
+ rewardId: Items.METAL_BAR,
654
+ components: [
655
+ {
656
+ itemDefinitionId: 3179,
657
+ requiredAmount: 1
658
+ }
659
+ ]
660
+ },
661
+ 59: {
662
+ filterId: FilterIds.FURNACE,
663
+ rewardId: Items.METAL_BAR,
664
+ components: [
665
+ {
666
+ itemDefinitionId: 2789,
667
+ requiredAmount: 1
668
+ }
669
+ ]
670
+ },
671
+ 60: {
672
+ filterId: FilterIds.FURNACE,
673
+ rewardId: Items.METAL_BAR,
674
+ components: [
675
+ {
676
+ itemDefinitionId: 2834,
677
+ requiredAmount: 1
678
+ }
679
+ ]
680
+ },
681
+ 61: {
682
+ filterId: FilterIds.FURNACE,
683
+ rewardId: Items.METAL_BAR,
684
+ components: [
685
+ {
686
+ itemDefinitionId: 3475,
687
+ requiredAmount: 1
688
+ }
689
+ ]
690
+ },
691
+ 62: {
692
+ filterId: FilterIds.FURNACE,
693
+ rewardId: Items.METAL_BAR,
694
+ components: [
695
+ {
696
+ itemDefinitionId: 3477,
697
+ requiredAmount: 1
698
+ }
699
+ ]
700
+ },
701
+ 63: {
702
+ filterId: FilterIds.FURNACE,
703
+ rewardId: Items.METAL_BAR,
704
+ components: [
705
+ {
706
+ itemDefinitionId: 3381,
707
+ requiredAmount: 1
708
+ }
709
+ ]
710
+ },
711
+ 64: {
712
+ filterId: FilterIds.FURNACE,
713
+ rewardId: Items.METAL_BAR,
714
+ components: [
715
+ {
716
+ itemDefinitionId: 3495,
717
+ requiredAmount: 1
718
+ }
719
+ ]
720
+ },
721
+ 65: {
722
+ filterId: FilterIds.FURNACE,
723
+ rewardId: Items.METAL_BAR,
724
+ components: [
725
+ {
726
+ itemDefinitionId: 3489,
727
+ requiredAmount: 1
728
+ }
729
+ ]
730
+ },
731
+ 66: {
732
+ filterId: FilterIds.FURNACE,
733
+ rewardId: Items.METAL_BAR,
734
+ components: [
735
+ {
736
+ itemDefinitionId: 3481,
737
+ requiredAmount: 1
738
+ }
739
+ ]
740
+ },
741
+ 67: {
742
+ filterId: FilterIds.FURNACE,
743
+ rewardId: Items.METAL_BAR,
744
+ components: [
745
+ {
746
+ itemDefinitionId: 2909,
747
+ requiredAmount: 1
748
+ }
749
+ ]
750
+ },
751
+ 68: {
752
+ filterId: FilterIds.FURNACE,
753
+ rewardId: Items.METAL_BAR,
754
+ components: [
755
+ {
756
+ itemDefinitionId: 3055,
757
+ requiredAmount: 1
758
+ }
759
+ ]
760
+ },
761
+ 69: {
762
+ filterId: FilterIds.FURNACE,
763
+ rewardId: Items.METAL_BAR,
764
+ components: [
765
+ {
766
+ itemDefinitionId: 3056,
767
+ requiredAmount: 1
768
+ }
769
+ ]
770
+ },
771
+ 70: {
772
+ filterId: FilterIds.FURNACE,
773
+ rewardId: Items.METAL_BAR,
774
+ components: [
775
+ {
776
+ itemDefinitionId: 3057,
777
+ requiredAmount: 1
778
+ }
779
+ ]
780
+ },
781
+ 71: {
782
+ filterId: FilterIds.FURNACE,
783
+ rewardId: Items.METAL_BAR,
784
+ components: [
785
+ {
786
+ itemDefinitionId: 2906,
787
+ requiredAmount: 1
788
+ }
789
+ ]
790
+ },
791
+ 72: {
792
+ filterId: FilterIds.FURNACE,
793
+ rewardId: Items.METAL_BAR,
794
+ components: [
795
+ {
796
+ itemDefinitionId: 3123,
797
+ requiredAmount: 1
798
+ }
799
+ ]
800
+ },
801
+ 73: {
802
+ filterId: FilterIds.FURNACE,
803
+ rewardId: Items.METAL_BAR,
804
+ components: [
805
+ {
806
+ itemDefinitionId: 3401,
807
+ requiredAmount: 1
808
+ }
809
+ ]
810
+ },
811
+ 74: {
812
+ filterId: FilterIds.FURNACE,
813
+ rewardId: Items.METAL_BAR,
814
+ components: [
815
+ {
816
+ itemDefinitionId: 3585,
817
+ requiredAmount: 1
818
+ }
819
+ ]
820
+ },
821
+ 75: {
822
+ filterId: FilterIds.FURNACE,
823
+ rewardId: Items.METAL_BAR,
824
+ components: [
825
+ {
826
+ itemDefinitionId: 2494,
827
+ requiredAmount: 1
828
+ }
829
+ ]
830
+ },
831
+ 76: {
832
+ filterId: FilterIds.FURNACE,
833
+ rewardId: Items.METAL_BAR,
834
+ components: [
835
+ {
836
+ itemDefinitionId: 2483,
837
+ requiredAmount: 1
838
+ }
839
+ ]
840
+ },
841
+ 77: {
842
+ filterId: FilterIds.FURNACE,
843
+ rewardId: Items.METAL_BAR,
844
+ components: [
845
+ {
846
+ itemDefinitionId: 2480,
847
+ requiredAmount: 1
848
+ }
849
+ ]
850
+ },
851
+ 78: {
852
+ filterId: FilterIds.FURNACE,
853
+ rewardId: Items.METAL_BAR,
854
+ components: [
855
+ {
856
+ itemDefinitionId: 2446,
857
+ requiredAmount: 1
858
+ }
859
+ ]
860
+ },
861
+ 79: {
862
+ filterId: FilterIds.FURNACE,
863
+ rewardId: Items.METAL_BAR,
864
+ components: [
865
+ {
866
+ itemDefinitionId: 2781,
867
+ requiredAmount: 1
868
+ }
869
+ ]
500
870
  }
501
871
  };
502
872
 
@@ -2567,5 +2937,32 @@ export const recipes: { [recipeId: number]: Recipe } = {
2567
2937
  requiredAmount: 8
2568
2938
  }
2569
2939
  ]
2940
+ },
2941
+ [Items.AIO_COLD_MEDICINE]: {
2942
+ filterId: FilterIds.SURVIVAL,
2943
+ components: [
2944
+ {
2945
+ itemDefinitionId: Items.VITAMINS,
2946
+ requiredAmount: 2
2947
+ },
2948
+ {
2949
+ itemDefinitionId: Items.IMMUNITY_BOOSTERS,
2950
+ requiredAmount: 2
2951
+ },
2952
+ {
2953
+ itemDefinitionId: Items.ANTIBIOTICS,
2954
+ requiredAmount: 2
2955
+ }
2956
+ ]
2957
+ },
2958
+ [Items.GUN_PART]: {
2959
+ filterId: FilterIds.WEAPONS,
2960
+ components: [
2961
+ {
2962
+ itemDefinitionId: Items.WEAPON_1911,
2963
+ requiredAmount: 1
2964
+ }
2965
+ ],
2966
+ requireWeaponWorkbench: true
2570
2967
  }
2571
2968
  };
@@ -2666,6 +2666,14 @@ export const containerLootSpawners: {
2666
2666
  spawnChance: 100,
2667
2667
  maxItems: 3,
2668
2668
  items: [
2669
+ {
2670
+ item: Items.AIO_COLD_MEDICINE,
2671
+ weight: 45,
2672
+ spawnCount: {
2673
+ min: 1,
2674
+ max: 2
2675
+ }
2676
+ },
2669
2677
  {
2670
2678
  item: Items.ANTIBIOTICS,
2671
2679
  weight: 45,
@@ -1707,7 +1707,7 @@ export class Character2016 extends BaseFullCharacter {
1707
1707
  server.applyCharacterEffect(
1708
1708
  this,
1709
1709
  Effects.PFX_Fire_Person_loop,
1710
- 500,
1710
+ 400,
1711
1711
  10000
1712
1712
  );
1713
1713
  break;
@@ -178,11 +178,13 @@ export class Npc extends BaseFullCharacter {
178
178
  this.flags.knockedOut = 1;
179
179
  server.worldObjectManager.createLootbag(server, this);
180
180
  if (client) {
181
- server.challengeManager.registerChallengeProgression(
182
- client,
183
- ChallengeType.BRAIN_DEAD,
184
- 1
185
- );
181
+ if (this.npcId === NpcIds.ZOMBIE) {
182
+ server.challengeManager.registerChallengeProgression(
183
+ client,
184
+ ChallengeType.BRAIN_DEAD,
185
+ 1
186
+ );
187
+ }
186
188
  if (!server._soloMode) {
187
189
  logClientActionToMongo(
188
190
  server._db.collection(DB_COLLECTIONS.KILLS),
@@ -447,7 +447,7 @@ export const commands: Array<Command> = [
447
447
  server.sendDataToAllWithSpawnedEntity(
448
448
  server._characters,
449
449
  client.character.characterId,
450
- "AnimationBase",
450
+ "Animation.Play",
451
451
  {
452
452
  characterId: client.character.characterId,
453
453
  animationId: animationId
@@ -1700,36 +1700,14 @@ export const commands: Array<Command> = [
1700
1700
  return;
1701
1701
  }
1702
1702
 
1703
- const actingClient = targetClient ?? client;
1704
- const characterId = server.generateGuid(),
1705
- loc = new Float32Array([
1706
- actingClient.character.state.position[0],
1707
- actingClient.character.state.position[1] + 700,
1708
- actingClient.character.state.position[2],
1709
- actingClient.character.state.position[3]
1710
- ]),
1711
- vehicle = new Vehicle2016(
1712
- characterId,
1713
- server.getTransientId(characterId),
1714
- 9374,
1715
- loc,
1716
- actingClient.character.state.rotation,
1717
- server,
1718
- getCurrentServerTimeWrapper().getTruncatedU32(),
1719
- VehicleIds.PARACHUTE
1720
- );
1721
- server.worldObjectManager.createVehicle(server, vehicle, true);
1722
- server.sendData(actingClient, "ClientUpdate.UpdateLocation", {
1723
- position: loc,
1724
- triggerLoadingScreen: true
1725
- });
1726
- vehicle.onReadyCallback = (clientTriggered: Client) => {
1727
- // doing anything with vehicle before client gets fullvehicle packet breaks it
1728
- server.mountVehicle(clientTriggered, characterId);
1729
- // todo: when vehicle takeover function works, delete assignManagedObject call
1730
- server.assignManagedObject(clientTriggered, vehicle);
1731
- clientTriggered.vehicle.mountedVehicle = characterId;
1732
- };
1703
+ if (targetClient) {
1704
+ targetClient.character.state.position[1] += 700;
1705
+ server.sendData(targetClient, "ClientUpdate.UpdateLocation", {
1706
+ position: targetClient.character.state.position,
1707
+ triggerLoadingScreen: true
1708
+ });
1709
+ server.deployParachute(targetClient);
1710
+ }
1733
1711
  }
1734
1712
  },
1735
1713
  {
@@ -664,7 +664,7 @@ const dev: any = {
664
664
  server.sendDataToAllWithSpawnedEntity(
665
665
  server._characters,
666
666
  client.character.characterId,
667
- "AnimationBase",
667
+ "Animation.Play",
668
668
  {
669
669
  characterId: client.character.characterId,
670
670
  unknownDword1: args[1]
@@ -336,6 +336,10 @@ export class ChallengeManager {
336
336
  }
337
337
 
338
338
  async finishChallenge(client: ZoneClient2016) {
339
+ if (client.character.currentChallenge === ChallengeType.NONE) {
340
+ return;
341
+ }
342
+ client.character.currentChallenge = ChallengeType.NONE;
339
343
  const query = {
340
344
  status: ChallengeStatus.CURRENT,
341
345
  serverId: this.server._worldId,