This repository has been archived by the owner on May 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BuffHorses.cs
61 lines (53 loc) · 1.98 KB
/
BuffHorses.cs
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
using Oxide.Core;
using System;
using Oxide.Core.Plugins;
using Oxide.Game.Rust.Cui;
using System.Linq;
namespace Oxide.Plugins
{
[Info("BuffHorses", "Auro", "1.0.0")]
[Description("Buffs horses' speed and stamina")]
public class BuffHorses : RustPlugin
{
private const string PREFAB_RIDABLE_HORSE = "assets/rust.ai/nextai/testridablehorse.prefab";
private void OnEntitySpawned(RidableHorse ridableHorse)
{
if (ridableHorse != null)
{
ApplyHorseSettings(ridableHorse);
}
}
private void OnServerInitialized()
{
foreach (var ridableHorse in BaseNetworkable.serverEntities.OfType<RidableHorse>())
{
if (ridableHorse != null)
{
ApplyHorseSettings(ridableHorse);
}
}
}
private void ApplyHorseSettings(RidableHorse ridableHorse)
{
ridableHorse.maxSpeed = 25;
ridableHorse.walkSpeed = 3f;
ridableHorse.trotSpeed = 7;
ridableHorse.runSpeed = 18;
ridableHorse.turnSpeed = 100;
ridableHorse.roadSpeedBonus = 1;
Puts(ridableHorse.staminaCoreLossRatio.ToString());
Puts(ridableHorse.staminaCoreSpeedBonus.ToString());
Puts(ridableHorse.staminaReplenishRatioMoving.ToString());
Puts(ridableHorse.staminaReplenishRatioStanding.ToString());
Puts(ridableHorse.staminaSeconds.ToString());
ridableHorse.staminaSeconds = 9999999999;
ridableHorse.maxStaminaSeconds = 9999999999;
ridableHorse.staminaReplenishRatioMoving = 2f;
ridableHorse.staminaReplenishRatioStanding = 2f;
ridableHorse.staminaCoreLossRatio = 0.01f;
ridableHorse.ReplenishStamina(1000000);
ridableHorse.ReplenishStaminaCore(1000000, 1000000);
ridableHorse.SendNetworkUpdate();
}
}
}