Add current state of development

This commit is contained in:
Andrew Miner
2025-09-02 21:23:59 -06:00
parent cd2fd3bea8
commit fb58946028
5 changed files with 609 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
using Oxide.Core.Plugins;
using UnityEngine;
namespace Oxide.Plugins {
[Info("ZombieHorde", "TungstonMiner", "0.1.0")]
[Description("Create a zombie horde at midnight every seventh day")]
public class ZombieHorde : RustPlugin {
private bool isHordeActive = false;
void OnServerInitialized() {
Puts("ZombieHorde loaded!");
timer.Every(10f, () => this.CheckTime());
}
void CheckTime() {
var sky = TOD_Sky.Instance;
var day = sky.Cycle.Day;
var hour = sky.Cycle.Hour;
var isNight = sky.IsNight;
if ((!this.isHordeActive) && (hour < 0.5) && (day % 7 == 0)) {
this.StartHorde();
this.isHordeActive = true;
}
if (this.isHordeActive && !isNight) {
this.EndHorde();
this.isHordeActive = false;
}
}
void StartHorde() {
Puts($"Starting horde at {TOD_Sky.Instance.Cycle.Hour}");
Server.Command("halloween.murdererpopulation 10");
Server.Command("spawn.fill_populations");
}
void EndHorde() {
Puts($"Ending horde at {TOD_Sky.Instance.Cycle.Hour}");
Server.Command("halloween.murdererpopulation 0");
Server.Command("spawn.delete_populations Murderer.Population");
}
}
}