void Awake() { RustAI = GetComponent <NPCAI>(); RustAI.ServerDestroy(); RustMetabolism = GetComponent <NPCMetabolism>(); Base = GetComponent <BaseNPC>(); lastTick = Time.time; targetpoint = Vector3.zero; action = Act.None; hungerLose = RustMetabolism.calories.max * 2 / 12000; thristyLose = RustMetabolism.hydration.max * 3 / 12000; sleepLose = RustMetabolism.sleep.max / 12000; inventory = new ItemContainer(); inventory.ServerInitialize(null, 6); Base.enableSaving = false; BaseEntity.saveList.Remove(Base); Base.InitializeHealth(Base.health * HealthModificator, Base.MaxHealth() * HealthModificator); Base.locomotion.gallopSpeed *= SpeedModificator; Base.locomotion.trotSpeed *= SpeedModificator; Base.locomotion.acceleration *= SpeedModificator; }
void OnDestroy() { Base.InitializeHealth(Base.health / HealthModificator, Base.MaxHealth() / HealthModificator); Base.locomotion.gallopSpeed /= SpeedModificator; Base.locomotion.trotSpeed /= SpeedModificator; Base.locomotion.acceleration /= SpeedModificator; DropUtil.DropItems(inventory, transform.position); SaveNpcList.Remove(owner.owner.userID.ToString()); RustAI.ServerInit(); }
void OnDestroy() { DropUtil.DropItems(inventory, transform.position); SaveNpcList.Remove(owner.owner.userID); RustAI.ServerInit(); if (Base.health <= 0) { return; } Base.enableSaving = true; BaseEntity.saveList.Add(Base); Base.InitializeHealth(Base.health / HealthModificator, Base.MaxHealth() / HealthModificator); Base.locomotion.gallopSpeed /= SpeedModificator; Base.locomotion.trotSpeed /= SpeedModificator; Base.locomotion.acceleration /= SpeedModificator; }