forked from homo-programmatis/CatRotationHelper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPackageDruid.lua
151 lines (127 loc) · 5.65 KB
/
PackageDruid.lua
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
145
146
147
148
149
150
151
local THIS_ADDON_NAME=...;
local g_Addon = getfenv(0)[THIS_ADDON_NAME];
local g_Consts = g_Addon.Constants;
local function GetPackage_DruidCat(a_Flags)
local newPackage =
{
GetComboPoints = function()
return UnitPower("player", Enum.PowerType.ComboPoints);
end,
LogicLists =
{
{},
{},
{},
},
};
local logicList;
-- Main box
logicList = newPackage.LogicLists[1];
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_TigersFury);
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_SavageRoar);
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_Rake);
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_LunarInspiration);
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_Rip);
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_PredatorySwiftness_Bloodtalons);
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_Bloodtalons);
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_Thrash_Cat);
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_BrutalSlash);
g_Addon.Logic_AddUnused (logicList, a_Flags, 5);
-- Events box
logicList = newPackage.LogicLists[2];
g_Addon.Logic_AddFirstGood(logicList, a_Flags, g_Addon.Logics.Druid_Incarnation_Cat, g_Addon.Logics.Druid_Berserk, g_Addon.Logics.Druid_Incarnation_Bear); -- BearIncarnation - In case of Guardian in cat form
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_AshamanesFrenzy);
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_ElunesGuidance);
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_WildCharge);
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_PredatorySwiftness);
-- Survival box
logicList = newPackage.LogicLists[3];
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_SurvivalInstincts);
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_RageOfTheSleeper); -- In case of Guardian in cat form
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_Barkskin); -- In case of Guardian in cat form
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_Renewal);
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_LunarBeam); -- In case of Guardian in cat form
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_BristlingFur); -- In case of Guardian in cat form
return newPackage;
end
local function GetPackage_DruidBear(a_Flags)
local newPackage =
{
GetComboPoints = function()
local stacks, expTime = g_Addon.GetTargetDebuffInfo(g_Addon.Logics.Druid_Thrash_Bear_Debuff.SpellID, true);
if (stacks == nil) then
return 0;
end
return stacks;
end,
LogicLists =
{
{},
{},
{},
},
};
local logicList;
-- Main box
logicList = newPackage.LogicLists[1];
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_Mangle_Bear);
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_Thrash_Bear);
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_Pulverize);
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_GalacticGuardian);
g_Addon.Logic_AddUnused (logicList, a_Flags, 3);
-- Events box
logicList = newPackage.LogicLists[2];
g_Addon.Logic_AddFirstGood(logicList, a_Flags, g_Addon.Logics.Druid_Incarnation_Bear, g_Addon.Logics.Druid_Incarnation_Cat, g_Addon.Logics.Druid_Berserk); -- CatIncarnation/Berserk - in case of Feral in bear form
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_AshamanesFrenzy); -- In case of Feral in bear form
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_ElunesGuidance); -- In case of Feral in bear form
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_WildCharge);
-- Survival box
logicList = newPackage.LogicLists[3];
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_SurvivalInstincts);
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_RageOfTheSleeper);
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_Barkskin);
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_Renewal); -- In case of Feral in bear form
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_LunarBeam);
g_Addon.Logic_AddIfItsGood(logicList, a_Flags, g_Addon.Logics.Druid_BristlingFur);
return newPackage;
end
local function GetPackage_DruidOther(a_Flags)
local newPackage =
{
GetComboPoints = function()
return 0;
end,
LogicLists =
{
{},
{},
{},
},
};
return newPackage;
end
-- Figure which shapeshift icons to use for configuring frame positions
local function GetSettingsShapeshift()
local spec = GetSpecialization();
if (g_Consts.SPEC_DRUID_FERAL == spec) then
-- Feral's primary shapeshift is Cat
return g_Consts.SHAPE_DRUID_CAT;
elseif (g_Consts.SPEC_DRUID_GUARDIAN == spec) then
-- Guardian's primary shapeshift is Bear
return g_Consts.SHAPE_DRUID_BEAR;
end
return 0;
end
g_Addon.GetPackage["DRUID"] = function(a_Flags)
local shapeshiftForm = GetShapeshiftForm();
if (a_Flags and a_Flags.IsSettings) then
shapeshiftForm = GetSettingsShapeshift();
end
if (g_Consts.SHAPE_DRUID_BEAR == shapeshiftForm) then
return GetPackage_DruidBear(a_Flags);
elseif (g_Consts.SHAPE_DRUID_CAT == shapeshiftForm) then
return GetPackage_DruidCat(a_Flags);
else
return GetPackage_DruidOther(a_Flags);
end
end