forked from TorannD/ValheimLegends
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVL_Console.cs
144 lines (140 loc) · 5.34 KB
/
VL_Console.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace ValheimLegends
{
public static class VL_Console
{
public static bool CheatRaiseSkill(Skills skill_instance, string name, float value, Player player)
{
foreach(Skills.SkillDef skill in ValheimLegends.legendsSkills)
{
if (skill.m_skill.ToString() == "781" && name.ToLower() == "discipline")
{
player.RaiseSkill(skill.m_skill, value);
return true;
}
else if (skill.m_skill.ToString() == "791" && name.ToLower() == "abjuration")
{
player.RaiseSkill(skill.m_skill, value);
return true;
}
else if (skill.m_skill.ToString() == "792" && name.ToLower() == "alteration")
{
player.RaiseSkill(skill.m_skill, value);
return true;
}
else if (skill.m_skill.ToString() == "793" && name.ToLower() == "conjuration")
{
player.RaiseSkill(skill.m_skill, value);
return true;
}
else if (skill.m_skill.ToString() == "794" && name.ToLower() == "evocation")
{
player.RaiseSkill(skill.m_skill, value);
return true;
}
else if (skill.m_skill.ToString() == "795" && name.ToLower() == "illusion")
{
player.RaiseSkill(skill.m_skill, value);
return true;
}
}
return false;
}
public static void CheatChangeClass(string className)
{
bool flag = false;
if (className.ToLower() == "berserker")
{
ValheimLegends.vl_player.vl_class = ValheimLegends.PlayerClass.Berserker;
flag = true;
}
else if (className.ToLower() == "druid")
{
ValheimLegends.vl_player.vl_class = ValheimLegends.PlayerClass.Druid;
flag = true;
}
else if (className.ToLower() == "mage")
{
ValheimLegends.vl_player.vl_class = ValheimLegends.PlayerClass.Mage;
flag = true;
}
else if (className.ToLower() == "priest")
{
ValheimLegends.vl_player.vl_class = ValheimLegends.PlayerClass.Priest;
flag = true;
}
//else if (className.ToLower() == "necromancer")
//{
// ValheimLegends.vl_player.vl_class = ValheimLegends.PlayerClass.Necromancer;
// flag = true;
//}
else if (className.ToLower() == "monk")
{
ValheimLegends.vl_player.vl_class = ValheimLegends.PlayerClass.Monk;
flag = true;
}
else if (className.ToLower() == "duelist")
{
ValheimLegends.vl_player.vl_class = ValheimLegends.PlayerClass.Duelist;
flag = true;
}
else if (className.ToLower() == "enchanter")
{
ValheimLegends.vl_player.vl_class = ValheimLegends.PlayerClass.Enchanter;
flag = true;
}
else if (className.ToLower() == "rogue")
{
ValheimLegends.vl_player.vl_class = ValheimLegends.PlayerClass.Rogue;
flag = true;
}
else if (className.ToLower() == "ranger")
{
ValheimLegends.vl_player.vl_class = ValheimLegends.PlayerClass.Ranger;
flag = true;
}
else if (className.ToLower() == "shaman")
{
ValheimLegends.vl_player.vl_class = ValheimLegends.PlayerClass.Shaman;
flag = true;
}
else if (className.ToLower() == "valkyrie")
{
ValheimLegends.vl_player.vl_class = ValheimLegends.PlayerClass.Valkyrie;
flag = true;
}
else if (className.ToLower() == "metavoker")
{
ValheimLegends.vl_player.vl_class = ValheimLegends.PlayerClass.Metavoker;
flag = true;
}
else if (className.ToLower() == "none")
{
ValheimLegends.vl_player.vl_class = ValheimLegends.PlayerClass.None;
flag = true;
}
if (flag)
{
Console.instance.Print("Class changed to " + className);
ValheimLegends.UpdateVLPlayer(Player.m_localPlayer);
ValheimLegends.NameCooldowns();
if (ValheimLegends.abilitiesStatus != null)
{
foreach (RectTransform ability in ValheimLegends.abilitiesStatus)
{
if (ability.gameObject != null)
{
UnityEngine.Object.Destroy(ability.gameObject);
}
}
ValheimLegends.abilitiesStatus.Clear();
}
}
}
}
}