-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEightRealmsAssistant.lua
More file actions
124 lines (114 loc) · 4.09 KB
/
Copy pathEightRealmsAssistant.lua
File metadata and controls
124 lines (114 loc) · 4.09 KB
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
local _, EightRealms = ...
local frame = CreateFrame("Frame")
-- 副本ID与名称映射
local dungeonIDs = {
[2579] = "驭雷栖巢",
[2580] = "暗焰裂口",
[2581] = "燧酿酒庄",
[2582] = "圣焰隐修院",
[2583] = "麦卡贡车间",
[2584] = "暴富矿区",
[2585] = "水闸行动",
[2586] = "伤逝剧场"
}
-- BOSS提示信息
local bossGuides = {
["驭雷栖巢"] = {
["凯里欧斯"] = "闪电链分散站位,能量满时躲射线",
["雷卫戈伦"] = "传染病需传递,黑暗引力快跑开",
["虚空石畸体"] = "集火破盾易伤,点名蓝圈消石柱"
},
["暗焰裂口"] = {
["老蜡须"] = "优先转火矿车,冲锋引导至柱子",
["布雷炙孔"] = "远程点燃蜡烛,保留3根防AOE",
["燎烛王"] = "躲直线技能,紫圈消除蜡像",
["黑暗之主"] = "专人处理蜡油,暗影期集合光线区"
},
["燧酿酒庄"] = {
["阿德里尔"] = "5人分配喂酒,躲避锥形响嗝",
["艾帕"] = "角落放置料汁,控制击杀小怪",
["本克·呜蜂"] = "转火击杀蜜蜂,注意蜂蜜池走位",
["戈尔迪·底爵"] = "T躲钞能炮,保留酒桶防AOE"
},
["圣焰隐修院"] = {
["戴尔克莱上尉"] = "打断狂啸技能,近战注意分散",
["布朗派克男爵"] = "躲避飞锤,增伤期开减伤",
["穆普雷"] = "背对盲目之光,15秒破盾进二楼"
},
["麦卡贡车间"] = {
["机械巨臂"] = "同步击杀小怪,冲锋引导至墙",
["炸弹处理者"] = "AOE躲在箱后,飞扑远离箱子",
["磁力吸附BOSS"] = "射线点名不动,注意躲避球路径"
},
["暴富矿区"] = {
["踢球BOSS"] = "注意踢球易伤,T拉离金币区",
["元素BOSS"] = "风筝小怪走位,集火变大元素"
},
["水闸行动"] = {
["无人机BOSS"] = "及时转火飞机,T注意开减伤",
["连线BOSS"] = "集合分摊伤害,电火花引导水"
},
["伤逝剧场"] = {
["抽取灵魂BOSS"] = "全员集合等待,及时转火傀儡",
["决斗BOSS"] = "低DPS主动死,及时转火旗子"
}
}
-- 创建提示框架
local tipFrame = CreateFrame("Frame", "EightRealmsTipFrame", UIParent, "BackdropTemplate")
tipFrame:SetSize(300, 100)
tipFrame:SetPoint("CENTER", 0, 200)
tipFrame:SetBackdrop({
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
edgeSize = 16,
insets = { left = 4, right = 4, top = 4, bottom = 4 }
})
tipFrame:SetBackdropColor(0, 0, 0, 0.8)
tipFrame:SetMovable(true)
tipFrame:EnableMouse(true)
tipFrame:RegisterForDrag("LeftButton")
tipFrame:SetScript("OnDragStart", tipFrame.StartMoving)
tipFrame:SetScript("OnDragStop", tipFrame.StopMovingOrSizing)
tipFrame:Hide()
-- 创建文本框
local tipText = tipFrame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
tipText:SetPoint("CENTER", tipFrame, "CENTER", 0, 0)
tipText:SetWidth(280)
tipText:SetJustifyH("LEFT")
-- 注册事件
frame:RegisterEvent("PLAYER_TARGET_CHANGED")
frame:RegisterEvent("ZONE_CHANGED_NEW_AREA")
-- 事件处理函数
frame:SetScript("OnEvent", function(self, event)
-- 获取当前副本ID
local _, _, _, _, _, _, _, instanceID = GetInstanceInfo()
if not dungeonIDs[instanceID] then
tipFrame:Hide()
return
end
if event == "PLAYER_TARGET_CHANGED" then
local targetName = UnitName("target")
if not targetName then
tipFrame:Hide()
return
end
-- 检查目标是否是已知BOSS
for _, bosses in pairs(bossGuides) do
if bosses[targetName] then
tipText:SetText(targetName .. ":\n" .. bosses[targetName])
tipFrame:Show()
return
end
end
end
end)
-- 添加斜杠命令
SLASH_ERA1 = "/era"
SLASH_ERA2 = "/8realms"
SlashCmdList["ERA"] = function(msg)
if tipFrame:IsShown() then
tipFrame:Hide()
else
tipFrame:Show()
end
end