-
Notifications
You must be signed in to change notification settings - Fork 2
/
ZSCRIPT.zsc
60 lines (53 loc) · 1.28 KB
/
ZSCRIPT.zsc
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
version "4.5"
#include "ZSCRIPT.SpellBrain.zsc"
#include "ZSCRIPT.ArcanumSpell.zsc"
#include "ZSCRIPT.ArcanumSigil.zsc"
#include "ZSCRIPT.ArcanumTome.zsc"
#include "ZSCRIPT.ManaBarrel.zsc"
class ArcanumHandler : EventHandler
{
override void CheckReplacement(ReplaceEvent e)
{
if (!e.Replacement)
{
return;
}
switch (e.Replacement.GetClassName())
{
case 'Lumberjack':
if (random[arcanrand]() <= 64)
{
e.Replacement = 'HDArcanumTome';
}
break;
case 'HDBarrel':
{
if (random[arcanrand]() <= AceCore.GetScaledChance(4, 16, acl_spawnscale_min, acl_spawnscale_max))
{
e.Replacement = 'ManaBarrel';
}
break;
}
}
}
override void PlayerEntered(PlayerEvent e)
{
ArcanumSpellBrain brain = ArcanumSpellBrain.Get(e.PlayerNumber);
brain.InitSpells(false); // [Ace] Because PostBeginPlay seems to be called a bit too late on it. In fact, it doesn't seem to be called at all.
}
override void NetworkProcess(ConsoleEvent e)
{
if (e.Name ~== "ARC_ReInitSpells")
{
ArcanumSpellBrain brain = ArcanumSpellBrain.Get(e.Player);
brain.InitSpells(e.Args[0]);
}
}
}
// --------------------------------------------------
// DEBUG & MISC
// --------------------------------------------------
class ArcanumMath
{
const Pi = 3.14159;
}