-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathInit.lua
174 lines (168 loc) · 4.13 KB
/
Init.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
CreateFrame("Frame", "MPOWA", UIParent)
MPOWA.Build = 64
MPOWA.Cloaded = false
MPOWA.loaded = false
MPOWA.selected = 1
MPOWA.CurEdit = 1
MPOWA.Page = 1
MPOWA.frames = {}
MPOWA.auras = {}
MPOWA.groupByNames = {}
MPOWA.groupByUnit = {}
MPOWA.NumBuffs = 0
MPOWA.NeedUpdate = {}
MPOWA.RaidGroupMembers = {}
MPOWA.testall = false
MPOWA.active = {}
MPOWA.mounted = false
MPOWA.party = false
MPOWA.bg = false
MPOWA.instance = false
MPOWA.SOUND = {
[0] = "None",
[1] = "LEVELUP",
[2] = "LOOTWINDOWCOINMPOWA:SOUND",
[3] = "MapPing",
[4] = "HumanExploration",
[5] = "QUESTADDED",
[6] = "QUESTCOMPLETED",
[7] = "WriteQuest",
[8] = "Fishing Reel in",
[9] = "igPVPUpdate",
[10] = "ReadyCheck",
[11] = "RaidWarning",
[12] = "AuctionWindowOpen",
[13] = "AuctionWindowClose",
[14] = "TellMessage",
[15] = "igBackPackOpen",
[16] = "aggro.ogg",
[17] = "bam.ogg",
[18] = "cat2.ogg",
[19] = "cookie.ogg",
[20] = "moan.ogg",
[21] = "phone.ogg",
[22] = "shot.ogg",
[23] = "sonar.ogg",
[24] = "splash.ogg",
[25] = "wilhelm.ogg",
[26] = "huh_1.ogg",
[27] = "bear_polar.ogg",
[28] = "bigkiss.ogg",
[29] = "BITE.ogg",
[30] = "PUNCH.ogg",
[31] = "burp4.ogg",
[32] = "chimes.ogg",
[33] = "Gasp.ogg",
[34] = "hic3.ogg",
[35] = "hurricane.ogg",
[35] = "hyena.ogg",
[36] = "Squeakypig.ogg",
[37] = "panther1.ogg",
[38] = "rainroof.ogg",
[39] = "snakeatt.ogg",
[40] = "sneeze.ogg",
[41] = "thunder.ogg",
[42] = "wickedmalelaugh1.ogg",
[43] = "wlaugh.ogg",
[44] = "wolf5.ogg",
[45] = "swordecho.ogg",
[46] = "throwknife.ogg",
[47] = "yeehaw.ogg",
[48] = "Fireball.ogg",
[49] = "rocket.ogg",
[50] = "Arrow_Swoosh.ogg",
[51] = "ESPARK1.ogg",
[52] = "chant4.ogg",
[53] = "chant2.ogg",
[54] = "shipswhistle.ogg",
[55] = "kaching.ogg",
[56] = "heartbeat.ogg",
[57] = "Hit1.ogg", -- Thanks to Sillywet!
[58] = "Hit2.ogg", -- Thanks to Sillywet!
[59] = "Hit3.ogg", -- Thanks to Sillywet!
[60] = "Hit4.ogg", -- Thanks to Sillywet!
[61] = "Hit5.ogg", -- Thanks to Sillywet!
[62] = "Hit6.ogg", -- Thanks to Sillywet!
[63] = "Hit7.ogg", -- Thanks to Sillywet!
[64] = "Hit8.ogg", -- Thanks to Sillywet!
}
local function copy(t, inner)
if type(t) ~= "table" then
error("table expected, got "..type(t), 2)
end
local new = {}
if inner then
for i,s in next,t do
if type(s) == "table" then
new[i] = copy(s, true)
else
new[i] = s
end
end
else
for i,s in next,t do
new[i] = s
end
end
return new
end
table.copy = copy
MPOWA.SAVE = table.copy(MPOWA_SAVE or {}, true)
function MPOWA:OnEvent(event, arg1)
if self.loaded then
if event == "UNIT_AURA" then
if arg1 == "target" or self.groupByUnit[arg1] then
self:Iterate(arg1)
end
elseif event == "PLAYER_TARGET_CHANGED" then
for c, v in pairs(self.auras) do
if v then
for cat, val in pairs(v) do
if self.active[val] or self.frames[val][1]:IsVisible() then
local p = self.SAVE[val]
if p["enemytarget"] or p["friendlytarget"] then
self.active[val] = false
self:FHide(val)
self.frames[val][3]:Hide()
self.frames[val][1]:SetAlpha(p["alpha"])
end
end
end
end
end
self:Iterate("target")
elseif event == "RAID_ROSTER_UPDATE" or event == "PARTY_MEMBERS_CHANGED" then
self:GetGroup()
elseif event == "UNIT_MANA" or event == "UNIT_RAGE" or event == "UNIT_ENERGY" then
if arg1 then
local unit = arg1
if (unit == "target") then
self:Push("unitpower", unit, 45, false)
elseif (string.find(unit,"raid")) then
local st = string.sub(unit, 5)
if st and tonumber(st) then
self:Push("unitpower", unit, (tonumber(st) or 0)+45, false)
end
elseif (string.find(unit,"party")) then
local st = string.sub(unit, 6)
if st and tonumber(st) then
self:Push("unitpower", unit, (tonumber(st) or 0)+45, false)
end
end
end
elseif event == "PLAYER_LOGOUT" then
--for key, val in self.SAVE do
-- for ke, va in val do
-- MPOWA_SAVE[key][ke] = va;
-- end
--end
MPOWA_SAVE = table.copy(self.SAVE, true)
else
self:Iterate("player")
end
else
self:Init()
self:GetGroup()
self.loaded = true
end
end