-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJobQuestClass.cs
86 lines (85 loc) · 2.85 KB
/
JobQuestClass.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace QuestSystem
{
public class JobConfig
{
public List<JobQuestsEntry> All;
public bool HideUnavailableQuests;
public double questmultiplier;
//public List<string> class_list;
public JobConfig()
{ }
public JobConfig(int a)
{
HideUnavailableQuests = true;
questmultiplier = 1.0;
//class_list = new List<string> { "Mage", "Warrior", "Ranger", "Rogue" };
All = new List<JobQuestsEntry> { new JobQuestsEntry(1), new JobQuestsEntry(2) };
}
}
public class JobQuestsEntry
{
//public string DisplayName = "";
public string RequirePermission = "jobquest.admin";
public int Reward = 0;
public bool hardmode = false;
public List<JobSimpleItem> IncludeItems = new List<JobSimpleItem> { };
public JobQuestsEntry() { }
public JobQuestsEntry(int a)
{
if (a == 1)
{
var i1 = new JobSimpleItem(2760);
var i2 = new JobSimpleItem(2761);
var i3 = new JobSimpleItem(2762);
//DisplayName = "ExampleNebula";
RequirePermission = "jobquest.mage";
Reward = 500000;
hardmode = false;
IncludeItems = new List<JobSimpleItem> { i1, i2, i3 };
}
if (a == 2)
{
//DisplayName = "Example2";
Reward = 20;
hardmode = false;
RequirePermission = "jobquest.warrior";
for (int i = 0; i < 10; i++)
{
IncludeItems.Add(new JobSimpleItem(i + 2702));
}
}
if (a == 3)
{
var i1 = new JobSimpleItem(2760);
//DisplayName = "Example3";
RequirePermission = "jobquest.ranger";
Reward = 500000;
hardmode = false;
IncludeItems = new List<JobSimpleItem> { i1 };
}
}
}
public class JobSimpleItem
{
public int netID = 0;
public int stack = 1;
public int prefix = 0;
public string name = "";
public JobSimpleItem() { }
public JobSimpleItem(int a)
{
this.name = TShockAPI.Utils.Instance.GetItemByIdOrName(a.ToString())[0].Name;
this.netID = TShockAPI.Utils.Instance.GetItemByIdOrName(a.ToString())[0].type;
}
public void Full()
{
this.netID = TShockAPI.Utils.Instance.GetItemByIdOrName((netID != 0) ? netID.ToString() : name)[0].type;
this.name = TShockAPI.Utils.Instance.GetItemByIdOrName(netID.ToString())[0].Name;
}
}
}