Skip to content

Instantly share code, notes, and snippets.

@eXhausted
Created September 13, 2024 12:54
Show Gist options
  • Save eXhausted/f57142f29354f5785425ed646a7fe7d2 to your computer and use it in GitHub Desktop.
Save eXhausted/f57142f29354f5785425ed646a7fe7d2 to your computer and use it in GitHub Desktop.
{
"d": {
"actions": {
"finish": [],
"init": {
"custom": "local e = aura_env\n\nlocal message_locale = {}\nmessage_locale[\"zhCN\"] = {}\nlocal L = message_locale[\"zhCN\"] \nL[\"9_龙\"] = \"9_龙\"\nL[\"10_龙\"] = \"10_龙\"\nL[\"11_花\"] = \"11_花\"\nL[\"14_蛙\"] = \"14_蛙\"\nL[\"15_蛙\"] = \"15_蛙\"\nL[\"仙林迷宫全自动导航已加载,版本:\"] = \"仙林迷宫全自动导航已加载,版本:\"\nL[\"显示/隐藏导航\"] = \"显示/隐藏导航\"\nL[\"假\"] = \"假\"\nL[\"入口\"] = \"入口\"\nL[\"出口\"] = \"出口\"\nL[\"出口:\"] = \"出口:\"\nL[\"进入房间:%s, 勾怪:%s\"] = \"进入房间:%s, 勾怪:%s\"\nL[\"进入房间:%s\"] = \"进入房间:%s\"\nL[\"可能解:%s\"] = \"可能解:%s\"\nL[\"找到唯一路线!! %s\"] = \"找到唯一路线!! %s\"\nL[\"%s | 结束:%.2f%%\"] = \"%s | 结束:%.2f%%\"\nL[\"%d个房间后傲慢 \"] = \"%d个房间后傲慢 \"\nL[\"傲慢!傲慢!傲慢! \"] = \"傲慢!傲慢!傲慢! \"\nL[\"没傲慢了 \"] = \"没傲慢了 \"\nL[\"结束:%.2f%%\"] = \"结束:%.2f%%\"\nL[\"仙林迷宫导航\\n请勿移动\\n保持在屏幕中心\"] = \"仙林迷宫导航\\n请勿移动\\n保持在屏幕中心\"\nL[\"←左边←\"] = \"←左边←\"\nL[\"→右起第1个→\"] = \"→右起第1个→\"\nL[\"↖对面↖\"] = \"↖对面↖\"\nL[\"↑对面↑\"] = \"↑对面↑\"\nL[\"↙左起第1个↙\"] = \"↙左起第1个↙\"\nL[\"↖左前方(左起第2个)↖\"] = \"↖左前方(左起第2个)↖\"\nL[\"←左起第1个←\"] = \"←左起第1个←\"\nL[\"↗右前方(右起第2个)↗\"] = \"↗右前方(右起第2个)↗\"\nL[\"↑正对面(最右边)↑\"] = \"↑正对面(最右边)↑\"\nL[\"↖左前方(右起第2个)↖\"] = \"↖左前方(右起第2个)↖\"\nL[\"↗对面,右前方↗\"] = \"↗对面,右前方↗\"\nL[\"↗右前方↗\"] = \"↗右前方↗\"\nL[\"↗右前方(右起第1个)↗\"] = \"↗右前方(右起第1个)↗\"\nL[\"↑正对面↑\"] = \"↑正对面↑\"\nL[\"↑没迷宫,冲冲冲↑\"] = \"↑没迷宫,冲冲冲↑\"\nL[\"↑对面(右起第1个)↑\"] = \"↑对面(右起第1个)↑\"\nL[\"↖左边第2个↖\"] = \"↖左边第2个↖\"\nL[\"↙左边第1个↙\"] = \"↙左边第1个↙\"\nL[\"↗右起第1个↗\"] = \"↗右起第1个↗\"\nL[\"↖左边↖\"] = \"↖左边↖\"\nL[\"←左边第1个←\"] = \"←左边第1个←\"\nL[\"↗对面,偏右↗\"] = \"↗对面,偏右↗\"\nL[\"↘入口旁边↘\"] = \"↘入口旁边↘\"\n\nmessage_locale[\"zhTW\"] = {}\nL = message_locale[\"zhTW\"]\nL[\"9_龙\"] = \"9_龍\"\nL[\"10_龙\"] = \"10_龍\"\nL[\"11_花\"] = \"11_花\"\nL[\"14_蛙\"] = \"14_蛙\"\nL[\"15_蛙\"] = \"15_蛙\"\nL[\"仙林迷宫全自动导航已加载,版本:\"] = \"特拉希迷宮全自動導航已加載,版本:\"\nL[\"显示/隐藏导航\"] = \"顯示/隱藏導航\"\nL[\"假\"] = \"假\"\nL[\"入口\"] = \"入口\"\nL[\"出口\"] = \"出口\"\nL[\"出口:\"] = \"出口:\"\nL[\"进入房间:%s, 勾怪:%s\"] = \"進入房間:%s, 勾怪:%s\"\nL[\"进入房间:%s\"] = \"進入房間:%s\"\nL[\"可能解:%s\"] = \"可能解:%s\"\nL[\"找到唯一路线!! %s\"] = \"找到唯一路線!! %s\"\nL[\"%s | 结束:%.2f%%\"] = \"%s | 結束:%.2f%%\"\nL[\"%d个房间后傲慢 \"] = \"%d個房間后傲慢 \"\nL[\"傲慢!傲慢!傲慢! \"] = \"傲慢!傲慢!傲慢! \"\nL[\"没傲慢了 \"] = \"沒傲慢了 \"\nL[\"结束:%.2f%%\"] = \"結束:%.2f%%\"\nL[\"仙林迷宫导航\\n请勿移动\\n保持在屏幕中心\"] = \"特拉希迷宮導航\\n請勿移動\\n保持在螢幕中心\"\nL[\"←左边←\"] = \"←左邊←\"\nL[\"→右起第1个→\"] = \"→右起第1個→\"\nL[\"↖对面↖\"] = \"↖對面↖\"\nL[\"↑对面↑\"] = \"↑對面↑\"\nL[\"↙左起第1个↙\"] = \"↙左起第1個↙\"\nL[\"↖左前方(左起第2个)↖\"] = \"↖左前方(左起第2個)↖\"\nL[\"←左起第1个←\"] = \"←左起第1個←\"\nL[\"↗右前方(右起第2个)↗\"] = \"↗右前方(右起第2個)↗\"\nL[\"↑正对面(最右边)↑\"] = \"↑正對面(最右邊)↑\"\nL[\"↖左前方(右起第2个)↖\"] = \"↖左前方(右起第2個)↖\"\nL[\"↗对面,右前方↗\"] = \"↗對面,右前方↗\"\nL[\"↗右前方↗\"] = \"↗右前方↗\"\nL[\"↗右前方(右起第1个)↗\"] = \"↗右前方(右起第1個)↗\"\nL[\"↑正对面↑\"] = \"↑正對面↑\"\nL[\"↑没迷宫,冲冲冲↑\"] = \"↑沒迷宮,衝衝衝↑\"\nL[\"↑对面(右起第1个)↑\"] = \"↑對面(右起第1個)↑\"\nL[\"↖左边第2个↖\"] = \"↖左邊第2個↖\"\nL[\"↙左边第1个↙\"] = \"↙左邊第1個↙\"\nL[\"↗右起第1个↗\"] = \"↗右起第1個↗\"\nL[\"↖左边↖\"] = \"↖左邊↖\"\nL[\"←左边第1个←\"] = \"←左邊第1個←\"\nL[\"↗对面,偏右↗\"] = \"↗對面,偏右↗\"\nL[\"↘入口旁边↘\"] = \"↘入口旁邊↘\"\n\nmessage_locale[\"enUS\"] = {}\nL = message_locale[\"enUS\"]\nL[\"9_龙\"] = \"9_Dragon\"\nL[\"10_龙\"] = \"10_Dragon\"\nL[\"11_花\"] = \"11_Blossom\"\nL[\"14_蛙\"] = \"14_Frog\"\nL[\"15_蛙\"] = \"15_Frog\"\nL[\"仙林迷宫全自动导航已加载,版本:\"] = \"MoTS Maze Automatic Navigator Loaded, Version: \"\nL[\"显示/隐藏导航\"] = \"Show/Hide Navigator\"\nL[\"假\"] = \"Fake\"\nL[\"入口\"] = \"Entrance\"\nL[\"出口\"] = \"Exit\"\nL[\"出口:\"] = \"Exit: \"\nL[\"进入房间:%s, 勾怪:%s\"] = \"Enter room: %s, Combine with: %s\"\nL[\"进入房间:%s\"] = \"Enter room: %s\"\nL[\"可能解:%s\"] = \"Possible Routes: %s\"\nL[\"找到唯一路线!! %s\"] = \"Route Found!! %s\"\nL[\"%s | 结束:%.2f%%\"] = \"%s | End: %.2f%%\"\nL[\"%d个房间后傲慢 \"] = \"Pride in next %d room \"\nL[\"傲慢!傲慢!傲慢! \"] = \"Pride!! Pride!! Pride!! \"\nL[\"没傲慢了 \"] = \"No more Pride \"\nL[\"结束:%.2f%%\"] = \"End: %.2f%%\"\nL[\"仙林迷宫导航\\n请勿移动\\n保持在屏幕中心\"] = \"Automatic Tirna Maze Navigator\\nDo Not Move\\nKeep in Screen Center\"\nL[\"←左边←\"] = \"← LEFT ←\"\nL[\"→右起第1个→\"] = \"→ 1st RIGHT →\"\nL[\"↖对面↖\"] = \"↖ FRONT ↖\"\nL[\"↑对面↑\"] = \"↑ FRONT ↑\"\nL[\"↙左起第1个↙\"] = \"↙ 1st LEFT ↙\"\nL[\"↖左前方(左起第2个)↖\"] = \"↖ LEFT FRONT (2nd LEFT) ↖\"\nL[\"←左起第1个←\"] = \"← 1st LEFT ←\"\nL[\"↗右前方(右起第2个)↗\"] = \"↗ RIGHT FRONT (2nd RIGHT) ↗\"\nL[\"↑正对面(最右边)↑\"] = \"↑ FRONT (1st RIGHT) ↑\"\nL[\"↖左前方(右起第2个)↖\"] = \"↖ LEFT FRONT (2nd RIGHT) ↖\"\nL[\"↗对面,右前方↗\"] = \"↗ RIGHT FRONT ↗\"\nL[\"↗右前方↗\"] = \"↗ RIGHT FRONT ↗\"\nL[\"↗右前方(右起第1个)↗\"] = \"↗ RIGHT FRONT (1st RIGHT) ↗\"\nL[\"↑正对面↑\"] = \"↑ FRONT ↑\"\nL[\"↑没迷宫,冲冲冲↑\"] = \"↑ No Maze, GOGOGO! ↑\"\nL[\"↑对面(右起第1个)↑\"] = \"↑ FRONT(1st RIGHT) ↑\"\nL[\"↖左边第2个↖\"] = \"↖ 2nd LEFT ↖\"\nL[\"↙左边第1个↙\"] = \"↙ 1st LEFT ↙\"\nL[\"↗右起第1个↗\"] = \"↗ 1st RIGHT ↗\"\nL[\"↖左边↖\"] = \"↖ LEFT ↖\"\nL[\"←左边第1个←\"] = \"← 1st LEFT ←\"\nL[\"↗对面,偏右↗\"] = \"↗ RIGHT FRONT ↗\"\nL[\"↘入口旁边↘\"] = \"↘ Near Entrance ↘\"\n\nlocal author_options_locale = {}\nauthor_options_locale[\"zhCN\"] = {\n { text =\"仙林迷宫全自动导航系统\", }, \n { text =\"\\n|cffffd100Author: |r 陽光 - 死亡之翼\\n|cffffd100Version: |r1.0.8\\n\\n\", }, \n { text =\"显示选项\", }, \n { name = \"只在找到唯一路线时显示 \", desc = \"一般3次之后可以找到路线\",}, \n { name = \"显示导向线\", desc = \"显示从入口到出口的导向线\",}, \n { values = {\"战斗中正常显示 \", \"战斗中只显示5秒\", \"战斗中不显示\", }, name = \"战斗显示\", }, \n { values = {\"战斗后自动显示\",\"战斗后保持原隐藏状态\",},name = \"战斗后显示\",}, \n { name = \"显示大小\",}, \n { text = \"中央文字选项\",}, \n { name = \"显示路线\",}, \n { name = \"路线显示傲慢位置\",}, \n { name = \"显示结束进度\",}, \n { name = \"显示出口文字指示\",}, \n { text = \"队伍通告选项\",}, \n { name = \"出口位置\",}, \n { name = \"版本信息\",}, \n { name = \"傲慢所在房间\",}, \n { name = \"迷宫结束进度\",}, \n { text = \"其他选项\", }, \n { name = \"信息输出在屏幕中间\", desc = \"如不勾选,则输出在聊天框架\",}, \n { name = \"输出所有可能路线\", desc = \"每进入一个房间,将后续所有可能路线列出\", }, \n}\n\nauthor_options_locale[\"zhTW\"] = {\n { text = \"特拉希迷宮全自動導航系統\",}, \n { text = \"\\n|cffffd100Author: |r 陽光 - 死亡之翼(CN)\\n|cffffd100Version: |r1.0.8\\n\\n\", }, \n { text = \"顯示選項\", }, \n { name = \"只在找到唯一路線時顯示\", desc = \"一般3次之后可以找到路線\",}, \n { name = \"顯示導向線\", desc = \"顯示從入口到出口的導向線\", }, \n { values = {\"戰鬥中正常顯示\", \"戰鬥中只顯示5秒\", \"戰鬥中不顯示\",}, name = \"戰鬥顯示\",}, \n { values = {\"戰鬥后自動顯示\", \"戰鬥后保持原隱藏狀態\", }, name = \"戰鬥后顯示\",}, \n { name = \"顯示大小\", }, \n { text = \"中間文字選項\", }, \n { name = \"显示路線\", }, \n { name = \"路線顯示傲慢位置\", }, \n { name = \"顯示結束進度\", }, \n { name = \"顯示出口文字指示\", }, \n { text = \"隊伍通告選項\", }, \n { name = \"出口位置\", }, \n { name = \"版本信息\", }, \n { name = \"傲慢所在房間\", }, \n { name = \"迷宮結束進度\", }, \n { text = \"其他選項\", }, \n { name = \"信息輸出在螢幕中間\", desc = \"如不勾選,則輸出在聊天框架\", }, \n { name = \"輸出所有可能路線\", desc = \"每進入一個房間,將后續所有可能的路線列出\", }, \n}\n\nauthor_options_locale[\"enUS\"] = {\n { text = \"MoTS Maze Automatic Navigator\",}, \n { text = \"\\n|cffffd100Author: |r 陽光 - 死亡之翼(CN)\\n|cffffd100Version: |r1.0.8\\n\\n\", }, \n { text = \"Display Options\", }, \n { name = \"Show only after solution found\", desc = \"Typically find solution after 3 rooms\",}, \n { name = \"Show guide lines\", desc = \"Show guide lines from Entrance to Exit\", }, \n { values = {\"Show in combat\", \"Show only 5 sec in combat\", \"Not show in combat\",}, name = \"show in combat\",}, \n { values = {\"Force show after combat\", \"Keep hide/show after combat\", }, name = \"show after combat\",}, \n { name = \"Display size\", }, \n { text = \"Center Text Options\", }, \n { name = \"Show routes\", }, \n { name = \"Show pride room\", }, \n { name = \"Show end progress of maze\", }, \n { name = \"Show guide text for Exit\", }, \n { text = \"Party Announcement Options\", }, \n { name = \"Exit position\", }, \n { name = \"Version\", }, \n { name = \"Pride room \", }, \n { name = \"End progress\", }, \n { text = \"Other Options\", }, \n { name = \"Output infomation in Error Frame\", desc = \"Otherwise it will be show in ChatFrame\", }, \n { name = \"Output all possible routes\", desc = \"Output all possible routes when enter the room\", }, \n}\n\nlocal locale = GetLocale()\nlocal L_options\nif message_locale[locale] then L = message_locale[locale] else L = message_locale[\"enUS\"] end\nif author_options_locale[locale] then L_options = author_options_locale[locale] else L_options = author_options_locale[\"enUS\"] end\n\nfunction e:Init()\n --self.saved = WeakAurasSaved.displays[e.id]\n if (aura_env.saved == nil) then aura_env.saved = {} end\n self.saved = aura_env.saved\n self.addon_name = \"WA_MIST_NAV\"\n self.version = \"1.0.8\"\n self:InitAuthorOptionsLocale()\n self:InitData()\n self.combat = self.combat or 1\n self.player_in_combat = UnitAffectingCombat(\"player\")\n self.mob_record = self.mob_record or {}\n self.mobs_seen = self.mobs_seen or {}\n self:CheckPlayerMapZone()\n self.is_pride_affix = self:IsPrideAffix()\n self.display_button = self.display_button or self:CreateDisplayButton()\n self.display_button:Hide()\n self.room_button_pool = self.room_button_pool or CreateFramePool(\"Button\", self.display_button, \"UIPanelButtonTemplate\")\n self.room_buttons = {}\n self.direction_line = self.direction_line or self:CreateDirectionLine()\n self:InitSolutionCurrent()\n self.not_move_string = L[\"仙林迷宫导航\\n请勿移动\\n保持在屏幕中心\"]\nend\n\nfunction e:InitData()\n self.mobs_list = { --\"name\" will not be used, it is just an annotation\n [166276]= {name = \"守护\", progress = 4, }, \n [166275]= {name = \"塑形\", progress = 4, },\n [163058]= {name = \"防御\", progress = 4, },\n [171772]= {name = \"首波防御\", progress = 4, },\n [166301]= {name = \"追猎\", progress = 4, },\n [166304]= {name = \"钉刺\", progress = 4, },\n [166299]= {name = \"照看\", progress = 4, },\n [173655]= {name = \"龙母\", progress = 16, },\n [173714]= {name = \"夜花\", progress = 16, },\n [173720]= {name = \"噬喉\", progress = 16, },\n }\n self.room_mob_list = {\n [1] = { [171772] = 2 },\n [2] = { [163058] = 1, [166276] = 1, [166275] = 1, [166301] = 1, },\n [3] = { [163058] = 2, [166301] = 2, },\n [4] = { [163058] = 2, [166304] = 1, [166299] = 1, },\n [5] = { [163058] = 2, [166301] = 1, [166304] = 1, },\n [6] = { [163058] = 2, [166299] = 2, },\n [7] = { [163058] = 2, [166301] = 1, [166299] = 1, },\n [8] = { [163058] = 1, [166276] = 1, [166304] = 1, [166301] = 1, },\n [\"9_龙\"] = { [173655] = 1, },\n [10] = { [163058] = 1, [166276] = 1, [166275] = 1, [166299] = 1, },\n [\"10_龙\"] = { [173655] = 1, },\n [11] = { [163058] = 1, [166276] = 1, [166304] = 1, [166299] = 1, },\n [\"11_花\"] = { [173714] = 1, },\n --[12] = { [166304] = 1, [166276] = 1, [166275] = 1, [166299] = 1, },\n [12] = { [166276] = 2, [166304] = 1, [166299] = 1, },\n [13] = { [166304] = 1, [166276] = 1, [166275] = 1, [166299] = 1, [166301] = 1, },\n [14] = { [163058] = 1, [166276] = 1, [166275] = 1, [166299] = 1, },\n [\"14_蛙\"] = { [173720] = 1, },\n [\"15_蛙\"] = { [173720] = 1, },\n [16] = { [163058] = 1, [166276] = 1, [166301] = 1, [166304] = 1, },\n [17] = { [166276] = 2, [166275] = 1, [166301] = 1, [166299] = 1, },\n [18] = { [163058] = 2, [166276] = 1, [166299] = 1, [166275] = 1, },\n [19] = { [166276] = 2, [166275] = 1, [166301] = 1, [166304] = 1, },\n [20] = { [166276] = 1, [163058] = 1, [166299] = 1, [166275] = 1, [166304] = 1, },\n }\n self.combine_pull = {\n [1] = {2},\n [16] = {17},\n [\"14_蛙\"] = {\"15_蛙\"},\n }\n self.maze_solutions = {\n {1,3,7 ,12,\"11_花\",18},\n {1,3,7 ,12,\"14_蛙\",20,19},\n {1,3,7 ,6 ,\"10_龙\",17}, \n {1,3,8 ,12,\"11_花\",19}, \n {1,3,8 ,13,\"15_蛙\",20}, \n {1,6,\"10_龙\",18,19,20}, \n {1,6,7 ,12,\"14_蛙\",20,19}, \n {1,6,11,12,\"14_蛙\",20}, \n {1,2,5 ,\"9_龙\" ,16,17,18}, \n {1,2,5 ,10,6 ,\"11_花\",18}, \n {1,2,5 ,\"10_龙\",18,17}, \n {1,2,4 ,\"9_龙\" ,16,17}, \n }\n self.room_info = {\n --[\"room_in room_from\"] = {angle = 0, next_room = 1}\n [\"0100\"] = {\n [0] = { angle = 0, next_room = 6 },\n [1] = { angle = 90, next_room = 2 },\n [2] = { angle = 180, next_room = 0, entrance = true, block = true, },\n [3] = { angle = 270, next_room = 3 },\n },\n [\"0201\"] = {\n [0] = { angle = 340, next_room = 4 },\n [1] = { angle = 200, next_room = 5 },\n [2] = { angle = 161, next_room = 1, entrance = true, block = true, },\n [3] = { angle = 45, next_room = nil, block = true, },\n },\n [\"0301\"] = {\n [0] = { angle = 0, next_room = 8 },\n [1] = { angle = 50, next_room = 7 },\n [2] = { angle = 180, next_room = 1, entrance = true, block = true, },\n [3] = { angle = 275, next_room = nil, block = true, },\n },\n [\"0402\"] = {\n [0] = { angle = 35, next_room = nil, block = true, },\n [1] = { angle = 180, next_room = 2, entrance = true, block = true, },\n [2] = { angle = 275, next_room = 9, message = L[\"←左边←\"] },\n [3] = { angle = 335, next_room = L[\"假\"], block = true, },\n },\n [\"0502\"] = {\n [0] = { angle = 45, next_room = 9 },\n [1] = { angle = 110, next_room = nil, block = true, },\n [2] = { angle = 180, next_room = 2, entrance = true, block = true, },\n [3] = { angle = 315, next_room = 10 },\n },\n [\"0601\"] = {\n [0] = { angle = 335, next_room = 11 },\n [1] = { angle = 40, next_room = 10 },\n [2] = { angle = 180, next_room = 1, entrance = true, block = true, },\n [3] = { angle = 255, next_room = 7 },\n },\n [\"0610\"] = {\n [0] = { angle = 15, next_room = 7 },\n [1] = { angle = 90, next_room = 11, message = L[\"→右起第1个→\"] },\n [2] = { angle = 180, next_room = 10, entrance = true, block = true, },\n [3] = { angle = 295, next_room = 1, block = true, },\n },\n [\"0607\"] = {\n [0] = { angle = 180, next_room = 7, entrance = true, block = true, },\n [1] = { angle = 250, next_room = 11 },\n [2] = { angle = 345, next_room = 10, message = L[\"↖对面↖\"] },\n [3] = { angle = 110, next_room = 1, block = true, },\n },\n [\"0703\"] = {\n [0] = { angle = 10, next_room = nil, block = true, },\n [1] = { angle = 90, next_room = 6 },\n [2] = { angle = 180, next_room = 3, entrance = true, block = true, },\n [3] = { angle = 270, next_room = 12 },\n },\n [\"0706\"] = {\n [0] = { angle = 30, next_room = 12, message = L[\"↑对面↑\"] },\n [1] = { angle = 110, next_room = nil, block = true, },\n [2] = { angle = 180, next_room = 6, entrance = true, block = true, },\n [3] = { angle = 290, next_room = 3, block = true, },\n },\n [\"0803\"] = {\n [0] = { angle = 0, next_room = 13 },\n [1] = { angle = 35, next_room = 12 },\n [2] = { angle = 180, next_room = 3, entrance = true, block = true, },\n [3] = { angle = 305, next_room = nil, block = true, },\n },\n [\"0904\"] = {\n [0] = { angle = 0, next_room = 16 , message = L[\"↑对面↑\"]},\n [1] = { angle = 80, next_room = L[\"假\"], block = true, },\n [2] = { angle = 180, next_room = 4, entrance = true, block = true, },\n [3] = { angle = 265, next_room = 5, block = true, },\n },\n [\"0905\"] = {\n [0] = { angle = 20, next_room = L[\"假\"], block = true, },\n [1] = { angle = 95, next_room = 4, block = true, },\n [2] = { angle = 180, next_room = 5, entrance = true, block = true, },\n [3] = { angle = 285, next_room = 16, message = L[\"←左边←\"] },\n },\n [\"1005\"] = {\n [0] = { angle = 10, next_room = 17 },\n [1] = { angle = 180, next_room = 5, entrance = true, block = true, },\n [2] = { angle = 250, next_room = 6, message = L[\"↙左起第1个↙\"] },\n [3] = { angle = 320, next_room = 18, message = L[\"↖左前方(左起第2个)↖\"] },\n },\n [\"1006\"] = {\n [0] = { angle = 95, next_room = 5, block = true, },\n [1] = { angle = 180, next_room = 6, entrance = true, block = true, },\n [2] = { angle = 260, next_room = 18, message = L[\"←左起第1个←\"] },\n [3] = { angle = 325, next_room = 17, message = L[\"↑对面↑\"] },\n },\n [\"1106\"] = {\n [0] = { angle = 0, next_room = 14, block = true, },\n [1] = { angle = 45, next_room = 19, message = L[\"↗右前方(右起第2个)↗\"] },\n [2] = { angle = 90, next_room = 18, message = L[\"→右起第1个→\"] },\n [3] = { angle = 315, next_room = 12, message = L[\"←左起第1个←\"] },\n [4] = { angle = 180, next_room = 6, entrance = true, block = true, no_icon = true, },\n },\n [\"1112\"] = {\n [0] = { angle = 0, next_room = 18, message = L[\"↑正对面(最右边)↑\"] },\n [1] = { angle = 180, next_room = 12, entrance = true, block = true, },\n [2] = { angle = 255, next_room = 14, block = true, },\n [3] = { angle = 315, next_room = 19 , message = L[\"↖左前方(右起第2个)↖\"] },\n },\n [\"1207\"] = {\n [0] = { angle = 20, next_room = 14, message = L[\"↗对面,右前方↗\"] },\n [1] = { angle = 100, next_room = 11, message = L[\"→右起第1个→\"] },\n [2] = { angle = 180, next_room = 7, entrance = true, block = true, },\n [3] = { angle = 270, next_room = 8, block = true, },\n },\n [\"1208\"] = {\n [0] = { angle = 20, next_room = 11, message = L[\"↗右前方↗\"] },\n [1] = { angle = 90, next_room = 7, block = true, },\n [2] = { angle = 180, next_room = 8, entrance = true, block = true, },\n [3] = { angle = 310, next_room = 14 },\n },\n [\"1211\"] = {\n [0] = { angle = 75, next_room = 14, message = L[\"→右起第1个→\"] },\n [1] = { angle = 180, next_room = 11, entrance = true, block = true, },\n [2] = { angle = 245, next_room = 7, block = true, },\n [3] = { angle = 350, next_room = 8, block = true, },\n },\n [\"1308\"] = {\n [0] = { angle = 45, next_room = 15, message = L[\"↗右前方(右起第1个)↗\"] },\n [1] = { angle = 180, next_room = 8, entrance = true, block = true, },\n [2] = { angle = 270, next_room = nil, block = true, },\n [3] = { angle = 350, next_room = L[\"假\"], block = true, },\n },\n [\"1412\"] = {\n [0] = { angle = 0, next_room = 20, message = L[\"↑正对面↑\"] },\n [1] = { angle = 90, next_room = 11, block = true, },\n [2] = { angle = 180, next_room = 12, entrance = true, block = true, },\n [3] = { angle = 270, next_room = nil, block = true, },\n },\n [\"1513\"] = {\n [0] = { angle = 40, next_room = 20, message = L[\"↗右前方↗\"] },\n [1] = { angle = 180, next_room = 13, entrance = true, block = true, },\n [2] = { angle = 240, next_room = nil, block = true, },\n [3] = { angle = 315, next_room = L[\"假\"], block = true, },\n },\n [\"1609\"] = {\n [0] = { angle = 0, next_room = 17, message = L[\"↑没迷宫,冲冲冲↑\"] },\n [1] = { angle = 180, next_room = 9, entrance = true, no_icon = true, },\n },\n [\"1716\"] = {\n [0] = { angle = 25, next_room = \"BOSS\", message = L[\"↑对面(右起第1个)↑\"] },\n [1] = { angle = 180, next_room = 16, entrance = true, block = true, },\n [2] = { angle = 265, next_room = 10, block = true, },\n [3] = { angle = 330, next_room = 18, message = L[\"↖左边第2个↖\"] },\n },\n [\"1710\"] = {\n [0] = { angle = 105, next_room = 16, block = true, },\n [1] = { angle = 180, next_room = 10, entrance = true, block = true, },\n [2] = { angle = 260, next_room = 18 },\n [3] = { angle = 330, next_room = \"BOSS\", message = L[\"↑对面↑\"] },\n },\n [\"1718\"] = {\n [0] = { angle = 45, next_room = 16, block = true, },\n [1] = { angle = 120, next_room = 10, block = true, },\n [2] = { angle = 180, next_room = 18, entrance = true, block = true, },\n [3] = { angle = 245, next_room = \"BOSS\", message = L[\"↙左边第1个↙\"] },\n },\n [\"1817\"] = {\n [0] = { angle = 30, next_room = 19 },\n [1] = { angle = 95, next_room = \"BOSS\", message = L[\"→右起第1个→\"] },\n [2] = { angle = 180, next_room = 17, entrance = true, block = true, },\n [3] = { angle = 250, next_room = 10, block = true, },\n },\n [\"1810\"] = {\n [0] = { angle = 20, next_room = \"BOSS\" },\n [2] = { angle = 90, next_room = 17, message = L[\"↗右起第1个↗\"] },\n [1] = { angle = 180, next_room = 10, entrance = true, block = true, },\n [3] = { angle = 325, next_room = 19, message = L[\"↖左边↖\"]},\n },\n [\"1811\"] = {\n [0] = { angle = 30, next_room = 10, block = true, },\n [1] = { angle = 80, next_room = 11, block = true, },\n [2] = { angle = 240, next_room = 19 },\n [3] = { angle = 320, next_room = \"BOSS\", message = L[\"↖左边第2个↖\"] },\n [4] = { angle = 180, next_room = 14, entrance = true, block = true, no_icon = true, },\n },\n [\"1819\"] = {\n [0] = { angle = 30, next_room = 10, block = true, },\n [1] = { angle = 180, next_room = 19, entrance = true, block = true, },\n [2] = { angle = 270, next_room = \"BOSS\" },\n [3] = { angle = 330, next_room = 17 },\n },\n [\"1918\"] = {\n [0] = { angle = 0, next_room = 20, message = L[\"↑正对面↑\"] },\n [1] = { angle = 130, next_room = \"BOSS\", message = L[\"→右起第1个→\"] },\n [2] = { angle = 180, next_room = 18, entrance = true, block = true, },\n [3] = { angle = 235, next_room = 11, block = true, },\n },\n [\"1920\"] = {\n [0] = { angle = 35, next_room = 11, block = true, },\n [1] = { angle = 180, next_room = 20, entrance = true, block = true, },\n [2] = { angle = 310, next_room = \"BOSS\", message = L[\"←左边第1个←\"] },\n [3] = { angle = 350, next_room = 18 },\n },\n [\"1911\"] = {\n [0] = { angle = 40, next_room = \"BOSS\", message = L[\"↗对面,偏右↗\"] },\n [1] = { angle = 110, next_room = 18 },\n [2] = { angle = 180, next_room = 11, entrance = true, block = true, },\n [3] = { angle = 305, next_room = 20 },\n },\n [\"2014\"] = {\n [0] = { angle = 55, next_room = \"BOSS\", message = L[\"↗右前方↗\"] },\n [1] = { angle = 135, next_room = 19, message = L[\"↘入口旁边↘\"] },\n [2] = { angle = 240, next_room = 15, block = true, },\n [3] = { angle = 345, next_room = L[\"假\"], block = true, },\n [4] = { angle = 180, next_room = 14, entrance = true, block = true, no_icon = true, },\n },\n [\"2015\"] = {\n [0] = { angle = 10, next_room = \"BOSS\", message = L[\"↑正对面↑\"], },\n [1] = { angle = 100, next_room = 19 },\n [2] = { angle = 180, next_room = 15, entrance = true, block = true, },\n [3] = { angle = 270, next_room = L[\"假\"], block = true, },\n },\n [\"2019\"] = {\n [0] = { angle = 45, next_room = \"BOSS\", message = L[\"→右起第1个→\"], },\n [2] = { angle = 180, next_room = 19, entrance = true, block = true, },\n [1] = { angle = 230, next_room = 15, block = true, },\n [3] = { angle = 325, next_room = L[\"假\"], block = true, },\n },\n }\n self.localized_zone_name = {\n [\"enUS\"] = \"Mistveil Tangle\",\n [\"koKR\"] = \"안개장막 덩굴숲\",\n [\"frFR\"] = \"Maquis Voile-de-Brume\",\n [\"deDE\"] = \"Nebelschleierdickicht\",\n [\"zhCN\"] = \"纱雾迷结\",\n [\"esES\"] = \"Espesura Velo de Niebla\",\n [\"zhTW\"] = \"霧紗密林\",\n [\"esMX\"] = \"Espesura Veloniebla\",\n [\"ruRU\"] = \"Туманная чащоба\",\n [\"ptBR\"] = \"Enleio do Véu da Névoa\",\n [\"itIT\"] = \"Intrico Velofosco\",\n [\"ptPT\"] = \"Enleio do Véu da Névoa\",\n }\nend\n\nfunction e:InitAuthorOptionsLocale()\n if (self.saved.authorOptions == nil) then self.saved.authorOptions = {} end\n local options = CopyTable(self.saved.authorOptions)\n local translation = CopyTable(L_options)\n for i = 1, #options do\n for k, v in pairs(translation[i]) do options[i][k] = v end\n end\n self.saved.authorOptions = options\nend\n\n--COMBAT_LOG_EVENT_UNFILTERED, WA_MIST_NAV, PLAYER_REGEN_DISABLED, PLAYER_REGEN_ENABLED, ZONE_CHANGED, ZONE_CHANGED_INDOORS, PLAYER_ENTERING_WORLD,ENCOUNTER_START,ENCOUNTER_END,BOSS_KILL,WA_MIST_NAV_DEBUG\nfunction e:ON_EVENT(allstates, event, sub_event, ...)\n if event == \"WA_MIST_NAV_DEBUG\" then\n self.debug = true\n event = sub_event\n return self:_ON_EVENT(allstates, event, ...)\n else\n self.debug = false\n return self:_ON_EVENT(allstates, event, sub_event, ...)\n end\nend\n\nfunction e:_ON_EVENT(allstates, event, ...)\n if (self.player_in_maze or self.debug) and event == \"COMBAT_LOG_EVENT_UNFILTERED\" then\n local _,sub_event,_,_,_,_,_,destGUID,destName = CombatLogGetCurrentEventInfo()\n if self.debug then\n sub_event, destGUID = ...\n self.player_in_maze = true \n end\n if sub_event == \"UNIT_DIED\" then\n return self:ON_UNIT_DIED(destGUID)\n elseif sub_event ~= \"SPELL_DAMAGE\" then\n return nil\n end\n local guid = destGUID\n if not guid or self.mobs_seen[guid] then return nil end\n self.mobs_seen[guid] = true\n self:PrintDebugMessage(guid)\n local mob_id = select(6, strsplit(\"-\",guid))\n mob_id = tonumber(mob_id)\n if not (mob_id and self:IsSpecialMob(mob_id)) then return nil end\n local name = destName\n local combat = self.combat\n self.mob_record[combat] = self.mob_record[combat] or {}\n local info = self.mob_record[combat][mob_id]\n if not info then\n self.mob_record[combat][mob_id] = {name = name, guids = {[guid] = true}, count = 1}\n elseif not info.guids[guid] then\n info.guids[guid] = true\n info.count = info.count + 1\n else\n return nil\n end\n self:MapHide(allstates)\n self.room_map_show_cache = nil\n self.player_in_combat = true\n self:LocatePlayerRoom()\n self:FindSolution()\n return true\n elseif event == \"ZONE_CHANGED\" or event == \"ZONE_CHANGED_INDOORS\" or event == \"PLAYER_ENTERING_WORLD\" then\n self:CheckPlayerMapZone()\n elseif event == \"ENCOUNTER_START\" then\n local encounter_id = ...\n if encounter_id == 2392 then\n self:PrintDebugMessage(\"MAZE_RESET_BOSS2\")\n self:MazeReset(allstates)\n end\n return true\n elseif event == \"BOSS_KILL\" then\n local encounter_id = ...\n if encounter_id == 2397 then\n self:PrintDebugMessage(\"MAZE_RESET_BOSS1\")\n C_Timer.After(8, function () e:ReportVersion() end)\n self:MazeReset(allstates)\n end\n elseif event == \"PLAYER_REGEN_ENABLED\" then\n self.player_in_combat = false\n if (not self.room_map_show) and self.config.show_out_combat == 1 then self:DisplayButtonClick() end\n self:GoToNextRoom()\n -- elseif event == \"PLAYER_REGEN_DISABLED\" then\n -- self.player_in_combat = true\n elseif event == self.addon_name then\n local sub_event = ...\n if sub_event == \"ShowRoom\" then\n self:MapHide(allstates)\n local room_in, room_from, room_to, solution_info = select(2, ...)\n \n if self.config.announce_direction then\n self:AnnounceDirection(room_in, room_from, room_to, solution_info)\n end\n \n local solution_string = self:GetSolutionString(solution_info)\n self.display_button:Show()\n self.room_map_show_cache = {room_in = room_in, room_from = room_from, room_to = room_to, solution_string = solution_string}\n \n if self.player_in_combat then\n if self.config.show_in_combat ~= 3 then\n WeakAuras.ScanEvents(self.addon_name, \"MapShow\", room_in, room_from, room_to, solution_string)\n if self.config.show_in_combat == 2 then C_Timer.After(5, function () e:AutoHideInCombat() end) end\n end\n else\n WeakAuras.ScanEvents(self.addon_name, \"MapShow\", room_in, room_from, room_to, solution_string)\n end\n elseif sub_event == \"MapShow\" then\n self:MapHide(allstates)\n local room_in, room_from, room_to, solution_string = select(2, ...)\n self:MapShow(allstates, room_in, room_from, room_to, solution_string)\n return true\n elseif sub_event == \"MapHide\" then\n self:MapHide(allstates)\n return true\n end\n end\nend\n\nfunction e:CheckPlayerMapZone()\n local minimap_zone = GetMinimapZoneText()\n local locale = GetLocale()\n local maze_name = self.localized_zone_name[locale]\n if minimap_zone and maze_name and minimap_zone == maze_name then self.player_in_maze = true else self.player_in_maze = false end\nend\n\nfunction e:IsPrideAffix()\n local affixes = C_ChallengeMode.IsChallengeModeActive() and select(2, C_ChallengeMode.GetActiveKeystoneInfo())\n if affixes and tContains(affixes, 121) then return true else return false end\nend\n\n\nfunction e:ON_UNIT_DIED(died_guid)\n if not died_guid then return nil end\n local mob_record = self.mob_record[self.combat]\n if not mob_record then return nil end\n local mob_id = select(6, strsplit(\"-\",died_guid))\n mob_id = tonumber(mob_id)\n if not (mob_id and mob_record[mob_id]) then return nil end\n local mob_guids = mob_record[mob_id].guids\n if not mob_guids then return nil end\n if mob_guids[died_guid] then \n mob_guids[died_guid] = \"DEAD\" \n end\n local mob_remain = false\n for _, info in pairs(mob_record) do\n for _, value in pairs(info.guids) do\n if value ~= \"DEAD\" then mob_remain = true end\n end\n end\n if not mob_remain then \n self.player_in_combat = false\n self:PrintDebugMessage(\"OUT_OF_COMBAT\")\n if (not self.room_map_show) and self.config.show_out_combat == 1 then self:DisplayButtonClick() end\n self:GoToNextRoom() \n end\nend\n\nfunction e:GoToNextRoom()\n if self.cur_room then\n self.cur_room = nil\n self.last_solution_current = self.solution_current\n self.combat = self.combat + 1\n end\nend\n\nfunction e:ReportVersion()\n if self.config.announce_version then\n if IsInGroup(LE_PARTY_CATEGORY_HOME) then \n SendChatMessage(L[\"仙林迷宫全自动导航已加载,版本:\"] .. self.version, \"PARTY\")\n elseif IsInGroup(LE_PARTY_CATEGORY_INSTANCE) then \n SendChatMessage(L[\"仙林迷宫全自动导航已加载,版本:\"] .. self.version, \"INSTANCE_CHAT\")\n end\n end\nend\n\nfunction e:MazeReset(allstates)\n self:MapHide(allstates)\n self.combat = 1\n self.is_pride_affix = self:IsPrideAffix()\n self.room_map_show_cache = nil\n self.display_button:Hide()\n wipe(self.mob_record)\n wipe(self.mobs_seen)\n self:InitSolutionCurrent()\nend\n\nfunction e:CreateDisplayButton()\n local button = CreateFrame(\"Button\", self.addon_name..\"_Button\", UIParent, \"UIPanelButtonTemplate\")\n button:SetSize(150, 32)\n button:SetText(L[\"显示/隐藏导航\"])\n button:SetScript(\"OnClick\", function() e:DisplayButtonClick() end)\n button:SetFrameStrata(\"TOOLTIP\")\n button:SetPoint(\"TOP\",UIParent,\"TOP\",0,-100)\n button:RegisterForDrag(\"LeftButton\")\n button:SetScript(\"OnDragStart\", button.StartMoving)\n button:SetScript(\"OnDragStop\", button.StopMovingOrSizing)\n button:SetMovable(true)\n button:EnableMouse(true)\n return button\nend\n\n\nfunction e:DisplayButtonClick()\n if self.room_map_show then\n WeakAuras.ScanEvents(self.addon_name, \"MapHide\")\n elseif not self.room_map_show and self.room_map_show_cache then\n local cache = self.room_map_show_cache\n WeakAuras.ScanEvents(self.addon_name, \"MapShow\", cache.room_in, cache.room_from, cache.room_to, cache.solution_string)\n end\nend\n\nfunction e:CreateDirectionLine()\n local parent = WeakAuras.GetRegion(self.id)\n local direction_line = CreateFrame(\"Frame\", self.addon_name..\"_DirectionLine\", UIParent)\n direction_line:SetPoint(\"CENTER\", parent, \"CENTER\", 0, 0)\n direction_line:SetSize(1000,1000)\n local positions = {\"start\", \"turn\", \"end\", \"arrow_left\", \"arrow_right\"}\n local lines = {}\n for _, pos in pairs(positions) do\n lines[pos] = direction_line:CreateLine()\n lines[pos]:SetColorTexture(0,1,0.28,0.4)\n lines[pos]:SetThickness(8)\n end\n direction_line.lines = lines\n direction_line:Hide()\n return direction_line\nend\n\nfunction e:SetDirectionLine(end_angle, start_angle)\n if not end_angle then return nil end\n start_angle = start_angle or 180\n local radius = self.config.radius or 300\n local lines = self.direction_line.lines\n local angle = start_angle\n local x = 0.9 * radius * math.sin(angle / 180 * math.pi)\n local y = 0.9 * radius * math.cos(angle / 180 * math.pi)\n lines.start:SetStartPoint(\"CENTER\",x,y)\n x = 0.5 * radius * math.sin(angle / 180 * math.pi)\n y = 0.5 * radius * math.cos(angle / 180 * math.pi)\n lines.start:SetEndPoint(\"CENTER\",x,y)\n lines.turn:SetStartPoint(\"CENTER\",x,y)\n angle = end_angle\n x = 0.5 * radius * math.sin(angle / 180 * math.pi)\n y = 0.5 * radius * math.cos(angle / 180 * math.pi)\n lines.turn:SetEndPoint(\"CENTER\",x,y)\n lines[\"end\"]:SetStartPoint(\"CENTER\",x,y)\n x = 0.9 * radius * math.sin(angle / 180 * math.pi)\n y = 0.9 * radius * math.cos(angle / 180 * math.pi)\n lines[\"end\"]:SetEndPoint(\"CENTER\",x,y)\n lines.arrow_left:SetStartPoint(\"CENTER\",x,y)\n lines.arrow_right:SetStartPoint(\"CENTER\",x,y)\n local arrow_angle = end_angle + 30\n arrow_angle = (arrow_angle < 0 and (360 + arrow_angle)) or (arrow_angle >= 360 and (arrow_angle - 360)) or arrow_angle\n local arrow_x = x - radius * 0.2 * math.sin(arrow_angle / 180 * math.pi)\n local arrow_y = y - radius * 0.2 * math.cos(arrow_angle / 180 * math.pi)\n lines.arrow_left:SetEndPoint(\"CENTER\",arrow_x,arrow_y)\n arrow_angle = end_angle - 30\n arrow_angle = (arrow_angle < 0 and (360 + arrow_angle)) or (arrow_angle >= 360 and (arrow_angle - 360)) or arrow_angle\n arrow_x = x - radius * 0.2 * math.sin(arrow_angle / 180 * math.pi)\n arrow_y = y - radius * 0.2 * math.cos(arrow_angle / 180 * math.pi)\n lines.arrow_right:SetEndPoint(\"CENTER\",arrow_x,arrow_y)\n self.direction_line:Show()\nend\n\nfunction e:AutoHideInCombat()\n if self.room_map_show and self.player_in_combat then\n WeakAuras.ScanEvents(self.addon_name, \"MapHide\")\n end\nend\n\nfunction e:MapShow(allstates, room_in, room_from, room_to, solution_string)\n room_to = self:RoomStringformat(room_to)\n local room_info = self:GetRoomInfo(room_in, room_from)\n if not room_info then return true end\n local exit_message\n local has_exit\n local radius = self.config.radius or 300\n local direction_line_angle_start, direction_line_angle_end\n for _, stone in pairs(room_info) do\n --local x = self.saved.xOffset + radius * math.sin(stone.angle / 180 * math.pi)\n --local y = self.saved.yOffset + radius * math.cos(stone.angle / 180 * math.pi)\n local x = radius * math.sin(stone.angle / 180 * math.pi)\n local y = radius * math.cos(stone.angle / 180 * math.pi)\n local block = stone.block or false\n local entrance = stone.entrance or false\n local exit = room_to and stone.next_room and room_to == stone.next_room\n if entrance then direction_line_angle_start = stone.angle end\n if exit then\n has_exit = true\n exit_message = stone.message \n direction_line_angle_end = stone.angle\n end\n local name = (type(stone.next_room) == \"number\" or type(stone.next_room) == \"string\") and stone.next_room or \"\"\n local texture\n if stone.no_icon then texture = \"\" else texture = self.saved.texture end\n local sub_text = (entrance and L[\"入口\"]) or (exit and L[\"出口\"])\n local state = {\n show = true,\n changed = true,\n block = block,\n entrance = entrance,\n exit = exit,\n texture = texture,\n name = name,\n sub_text = sub_text,\n x = x,\n y = y,\n }\n allstates[#allstates+1] = state\n end\n \n if has_exit then\n for _, state in pairs(allstates) do\n if not state.exit then state.block = true end\n end\n end\n \n local message = \"\"\n if solution_string and self.config.show_solution then message = message .. solution_string .. \"\\n\" end\n if exit_message and self.config.show_direction then message = message .. L[\"出口:\"] .. exit_message.. \"\\n\" end --出口位置说明\n local state = {\n show = true,\n changed = true,\n name = message,\n texture = \"\",\n is_message = true,\n x = 0,\n y = radius * 0.6,\n }\n allstates[#allstates+1] = state\n self.room_map_show = true\n if self.config.show_direction_line then self:SetDirectionLine(direction_line_angle_end, direction_line_angle_start) end\n return true\nend\n\nfunction e:MapHide(allstates)\n for _, state in pairs(allstates) do\n state.show = false\n state.changed = true\n end\n self.room_map_show = false\n self.direction_line:Hide()\n return true\nend\n\nfunction e:ON_SHOW(aura_env_clone)\n local state = aura_env_clone.state\n local region = aura_env_clone.region\n region:SetOffset(state.x, state.y)\nend\n\nfunction e:MobsCombine(...)\n local result = {}\n for _, room_index in ipairs({...}) do\n local mobs = self.room_mob_list[room_index]\n if mobs then\n for mob_id, count in pairs(mobs) do\n result[mob_id] = result[mob_id] and result[mob_id] + count or count\n end\n end\n end\n return result\nend\n\nfunction e:IsSpecialMob(mob_id)\n if self.mobs_list[mob_id] then return true else return false end\nend\n\nfunction e:LocatePlayerRoom()\n if not self.combat then return nil end\n self.cur_room = nil\n local possible_next_list = self:GetPossibleNext()\n for _, room_index in pairs(possible_next_list) do\n local data = self.room_mob_list[room_index]\n local record = self.mob_record[self.combat]\n if self:MobsMatch(record, data) then self:AddCurrentRoom(room_index) end\n --combine pull\n local possible_combines = self.combine_pull[room_index]\n if possible_combines then\n for _, combine_pull in pairs(possible_combines) do\n data = self:MobsCombine(room_index, combine_pull)\n if self:MobsMatch(record, data) then self:AddCurrentRoom(room_index, combine_pull) end\n end\n end\n end\nend\n\nfunction e:MobsMatch(record, data)\n for mob_id, info in pairs(record) do\n if data[mob_id] ~= info.count then return false end\n end\n for mob_id, count in pairs(data) do\n if not (record[mob_id] and record[mob_id].count == count) then return false end\n end\n return true\nend\n\nfunction e:InitSolutionCurrent()\n local solution_current = {}\n for _, solution in pairs(self.maze_solutions) do\n solution_current[solution] = 0\n end\n self.last_solution_current = solution_current\nend\n\nfunction e:GetPossibleNext()\n local possible_next_list = {}\n for solution, current in pairs(self.last_solution_current) do\n local next_room = solution[current+1]\n if next_room and not tContains(possible_next_list, next_room) then \n table.insert(possible_next_list, next_room) \n end\n end\n return possible_next_list\nend\n\nfunction e:AddCurrentRoom(room_index,combine_pull)\n self.cur_room = self.cur_room or {}\n if combine_pull then\n local combine = {room_index, combine_pull}\n local match = false\n for _, room in pairs(self.cur_room) do\n if type(room) == \"table\" and table.concat(room,\",\") == table.concat(combine,\",\") then match = true end \n end\n if not match then \n table.insert(self.cur_room, combine)\n self:PrintMessage(string.format(L[\"进入房间:%s, 勾怪:%s\"], tostring(self:GetLocalizedRoom(room_index)), tostring(self:GetLocalizedRoom(combine_pull))))\n end\n else\n if not tContains(self.cur_room, room_index) then \n table.insert(self.cur_room, room_index) \n self:PrintMessage(string.format(L[\"进入房间:%s\"], tostring(self:GetLocalizedRoom(room_index))))\n end\n end\nend\n\nfunction e:FindSolution()\n if not self.cur_room then return nil end\n self.show_infos = {}\n local solution_current = {}\n for solution, current in pairs(self.last_solution_current) do\n for _, cur_room in pairs(self.cur_room) do\n if type(cur_room) == \"table\" then\n local solution_next_room1 = solution[current+1]\n local solution_next_room2 = solution[current+2]\n if solution_next_room1 == cur_room[1] and solution_next_room2 == cur_room[2] then\n solution_current[solution] = current+2\n self:ShowInfoAdd(solution, current+1)\n self:ShowInfoAdd(solution, current+2)\n elseif solution_next_room1 == cur_room[1] then\n solution_current[solution] = current+1\n self:ShowInfoAdd(solution, current+1)\n end\n else\n local solution_next_room = solution[current+1]\n if solution_next_room == cur_room then\n solution_current[solution] = current+1\n self:ShowInfoAdd(solution, current+1)\n end\n end\n end\n end\n self.solution_current = solution_current\n \n local possible_solutions = {}\n for solution, _ in pairs(solution_current) do\n table.insert(possible_solutions, solution)\n end\n \n if #possible_solutions > 0 then\n --print all possible\n if self.config.print_all_possible then\n if #possible_solutions > 1 then\n for _, solution in pairs(possible_solutions) do\n local solution_string = self:GetSolutionString({solution = solution})\n self:PrintMessage(string.format(L[\"可能解:%s\"], solution_string))\n end\n end\n end\n --show zone map\n if #possible_solutions == 1 then\n local solution = possible_solutions[1]\n local solution_string = self:GetSolutionString({solution = solution})\n self:PrintMessage(string.format(L[\"找到唯一路线!! %s\"], solution_string)) \n self:ShowInfo(true)\n elseif not self.config.show_only_solution then\n self:ShowInfo(false)\n end\n end\nend\n\nfunction e:ShowInfoAdd(solution, current)\n local room_in = solution[current]\n local room_from = solution[current-1] or 0\n local room_to = solution[current+1] or \"BOSS\"\n local solution_info = self:GetSolutionInfo(solution, current)\n local room_string = table.concat({room_in, room_from}, \", \")\n local match = false\n for _, show_info in pairs(self.show_infos) do\n local show_info_string = table.concat({show_info.room_in, show_info.room_from}, \", \")\n if show_info_string == room_string then match = true break end \n end\n \n if not match then table.insert(self.show_infos, {room_in = room_in, room_from = room_from, room_to = room_to, solution_info = solution_info}) end\nend\n\nfunction e:GetSolutionInfo(solution, current)\n local info = {}\n info.solution = CopyTable(solution)\n info.current = current\n info.end_progress, info.pride_room = self:CalculatePride(solution, current)\n return info\nend\n\nfunction e:GetSolutionString(solution_info)\n if not solution_info then return nil end\n local solution_copy = CopyTable(solution_info.solution)\n for i = 1, #solution_copy do \n solution_copy[i] = self:GetLocalizedRoom(solution_copy[i]) \n end\n local current = solution_info.current\n local current_texture = \"\\124T132147:16\\124t\"\n if current then\n solution_copy[current] = string.format(\"%s%s\", current_texture, tostring(solution_copy[current]))\n end\n \n local pride_texture = \"\\124T3528307:16\\124t\"\n local end_progress, pride_room = solution_info.end_progress, solution_info.pride_room\n if end_progress and self.config.show_pride_room then\n for room, has_pride in pairs(pride_room) do\n if has_pride then solution_copy[room] = string.format(\"\\124cFFFF0000%s\\124r%s\", tostring(solution_copy[room]), pride_texture) end\n end\n end \n local solution_string = table.concat(solution_copy, \" > \")\n if end_progress and self.config.show_end_progress then solution_string = string.format(L[\"%s | 结束:%.2f%%\"], solution_string, end_progress * 100) end\n return solution_string\nend\n\nfunction e:ShowInfo(unique)\n self.display_button:Show()\n self.room_button_pool:ReleaseAll()\n wipe(self.room_buttons)\n local total = #self.show_infos\n for i, show_info in pairs(self.show_infos) do\n local x_offset = (i - (total+ 1)/2) * total * 32\n local button = self.room_button_pool:Acquire()\n button.index = i\n button:SetSize(64, 32)\n button:SetText(show_info.room_in)\n button:SetScript(\"OnClick\", function() e.room_button_highlighted=i e:RoomButtonClick(i, unique) end)\n button:SetFrameStrata(\"TOOLTIP\")\n button:SetPoint(\"TOP\",self.display_button,\"BOTTOM\",x_offset,-10)\n if total > 1 then button:Show() else button:Hide() end\n if i == total then button:LockHighlight() else button:UnlockHighlight() end\n table.insert(self.room_buttons, button)\n end\n local show_info = self.show_infos[total]\n if unique then\n WeakAuras.ScanEvents(self.addon_name, \"ShowRoom\", show_info.room_in, show_info.room_from, show_info.room_to, show_info.solution_info)\n else\n WeakAuras.ScanEvents(self.addon_name, \"ShowRoom\", show_info.room_in, show_info.room_from)\n end\nend\n\nfunction e:RoomButtonClick(index, unique)\n for _, button in pairs(self.room_buttons) do\n if button.index == index then button:LockHighlight() else button:UnlockHighlight() end\n end\n local show_info = self.show_infos[index]\n if unique then\n local solution_string = self:GetSolutionString(show_info.solution_info)\n WeakAuras.ScanEvents(self.addon_name, \"MapShow\", show_info.room_in, show_info.room_from, show_info.room_to, solution_string)\n else\n WeakAuras.ScanEvents(self.addon_name, \"MapShow\", show_info.room_in, show_info.room_from)\n end\nend\n\n\nfunction e:GetLocalizedRoom(room)\n if type(room) ~= \"string\" or not L[room] then \n return room\n else\n return L[room]\n end\nend\n\nfunction e:RoomStringformat(room)\n if type(room) ~= \"string\" then return room end\n local post = string.find(room, \"_\")\n if post then room = string.sub(room, 1, post-1) end\n post = string.find(room, \"&\")\n if post then room = string.sub(room, 1, post-1) end\n return tonumber(room) or room\nend\n\nfunction e:GetRoomInfo(room_in, room_from)\n room_in = self:RoomStringformat(room_in)\n room_from = self:RoomStringformat(room_from)\n local room_in_string = tostring(room_in)\n local room_from_string = tostring(room_from)\n room_in_string = #room_in_string >= 2 and room_in_string or \"0\" .. room_in_string\n room_from_string = #room_from_string >= 2 and room_from_string or \"0\" .. room_from_string\n local room_string = strjoin(\"\",room_in_string,room_from_string)\n local room_info = self.room_info[room_string]\n if room_info then return room_info end\nend\n\nfunction e:AnnounceDirection(room_in, room_from, room_to, solution_info) --队伍通告\n local room_info = self:GetRoomInfo(room_in, room_from)\n room_to = self:RoomStringformat(room_to)\n if not room_info then return nil end\n local exit_message\n for _, stone in pairs(room_info) do\n if room_to and stone.next_room and room_to == stone.next_room then exit_message = stone.message break end\n end\n if not exit_message then return nil end\n local channel\n if IsInGroup(LE_PARTY_CATEGORY_HOME) then \n channel = \"PARTY\"\n elseif IsInGroup(LE_PARTY_CATEGORY_INSTANCE) then \n channel = \"INSTANCE_CHAT\"\n end\n if channel then\n local message = self:GetProgressMessage(solution_info)\n if message then C_Timer.After(5, function () SendChatMessage(message, channel) end) end\n SendChatMessage(L[\"出口:\"] .. exit_message, channel) \n else\n local message = self:GetProgressMessage(solution_info)\n if message then print(message) end\n print(L[\"出口:\"] .. exit_message)\n end\nend\n\nfunction e:GetProgressMessage(solution_info) --队伍进度信息\n local solution = CopyTable(solution_info.solution)\n local current, end_progress, pride_room = solution_info.current, solution_info.end_progress, solution_info.pride_room\n if not end_progress then return nil end\n \n local message = \"\"\n if self.config.announce_pride_room then\n local count = 0\n local next_pride_room\n for i = current, #solution do\n if pride_room[i] then next_pride_room = solution[i] break end\n count = count + 1\n end\n if next_pride_room then\n if count > 0 then\n message = message .. string.format(L[\"%d个房间后傲慢 \"], count)\n elseif count == 0 then\n message = message .. L[\"傲慢!傲慢!傲慢! \"]\n end\n else\n message = message .. L[\"没傲慢了 \"]\n end\n end\n if self.config.announce_end_progress then\n message = message .. string.format(L[\"结束:%.2f%%\"], end_progress * 100)\n end\n return message\nend\n\nfunction e:CalculatePride(solution, current)\n local current_progress = self:GetCurrentProgress()\n local current_combat_progress = self:GetMobProgressCurrentCombat()\n local room_left_progress = self:GetMobProgressForRoomLeft(solution, current)\n if current_progress and current_combat_progress and room_left_progress then\n local pride_room = {}\n local total = 260\n local pre_progress = current_progress\n local post_progress = current_progress + current_combat_progress / total\n if self:IsPrideInRoom(pre_progress, post_progress) then pride_room[current] = true end\n for i = current + 1, #solution do\n pre_progress = post_progress\n post_progress = post_progress + room_left_progress[i] / total\n if self:IsPrideInRoom(pre_progress, post_progress) then pride_room[i] = true end\n end\n return post_progress, pride_room\n end\nend\n\nfunction e:IsPrideInRoom(pre_progress, post_progress)\n if not self.is_pride_affix then return false end\n local pre_count = math.floor(pre_progress / 0.2)\n local post_count = math.floor(post_progress / 0.2)\n if post_count > pre_count then return true else return false end\nend\n\nfunction e:GetCurrentProgress()\n local _,_,steps = C_Scenario.GetStepInfo()\n if not steps or steps <= 0 then\n return\n end\n local percent\n local _, _, _, _, total, _, _, current = C_ScenarioInfo.GetCriteriaInfo(steps)\n if current then\n current = tonumber(string.sub(current, 1, string.len(current) - 1)) or 0\n percent = current / total\n if percent then\n percent = (percent <= 0 and 0) or (percent > 100 and 100) or percent\n return percent\n end\n end\n return false\nend\n\nfunction e:GetMobProgressCurrentCombat()\n local mob_record = self.mob_record[self.combat]\n if not mob_record then return nil end\n local progress = 0\n for mob_id, info in pairs(mob_record) do\n for _, value in pairs(info.guids) do\n if value ~= \"DEAD\" then \n progress = progress + self.mobs_list[mob_id].progress\n end\n end\n end\n return progress\nend\n\nfunction e:GetMobProgressForRoomLeft(solution, current)\n local progress = {}\n for i = current + 1, #solution do\n local room = solution[i]\n local mobs = self.room_mob_list[room]\n local room_progress = 0\n for mob_id, count in pairs(mobs) do\n room_progress = room_progress + self.mobs_list[mob_id].progress * count\n end\n progress[i] = room_progress\n end\n return progress\nend\n\nfunction e:PrintMessage(message)\n if not message then return nil end\n if self.config.print_in_errorframe then\n UIErrorsFrame:AddMessage(message, 1.0, 1.0, 1.0, 53, 10);\n else\n print(message)\n end\nend\n\nfunction e:PrintDebugMessage(message)\n if not message then return nil end\n if self.config.debug_mode then\n print(message) \n end\nend\n\ne:Init()",
"do_custom": true
},
"start": {
"custom": "aura_env:ON_SHOW(aura_env)",
"do_custom": true
}
},
"alpha": 0.68,
"anchorFrameType": "SCREEN",
"anchorPoint": "CENTER",
"animation": {
"finish": {
"duration_type": "seconds",
"easeStrength": 3,
"easeType": "none",
"preset": "grow",
"type": "preset"
},
"main": {
"alpha": 0,
"colorA": 1,
"colorB": 1,
"colorG": 1,
"colorR": 1,
"duration_type": "seconds",
"easeStrength": 3,
"easeType": "none",
"rotate": 0,
"scaleFunc": "function(progress, startX, startY, scaleX, scaleY)\n if not aura_env.state.exit then return startX,startY end\n local angle = (progress * 2 * math.pi) - (math.pi / 2)\n return startX + (((math.sin(angle) + 1)/2) * (scaleX - 1)), startY + (((math.sin(angle) + 1)/2) * (scaleY - 1))\nend",
"scaleType": "custom",
"scalex": 1.5,
"scaley": 1.5,
"type": "custom",
"use_scale": true,
"x": 0,
"y": 0
},
"start": {
"duration_type": "seconds",
"easeStrength": 3,
"easeType": "none",
"preset": "grow",
"type": "preset"
}
},
"authorOptions": [
{
"fontSize": "large",
"text": "Automatic Tirna Maze Navigation",
"type": "description",
"width": 1
},
{
"fontSize": "medium",
"text": "\n|cffffd100Author: |r陽光 - 死亡之翼\n|cffffd100Translation: |rFlorsan-Blackhand\n|cffffd100Version: |r1.0.11 (orig. 1.0.8)\n\n",
"type": "description",
"width": 1
},
{
"noMerge": false,
"text": "Display options",
"type": "header",
"useName": true,
"width": 1
},
{
"default": true,
"desc": "Usually you can find the route after 3 rooms",
"key": "show_only_solution",
"name": "Only show when a unique route is found",
"type": "toggle",
"useDesc": true,
"width": 1
},
{
"default": true,
"desc": "Show the guide line from the entrance to the exit",
"key": "show_direction_line",
"name": "Show a guide line",
"type": "toggle",
"useDesc": true,
"width": 1
},
{
"default": 1,
"key": "show_in_combat",
"name": "Display in battle",
"type": "select",
"useDesc": false,
"values": [
"Normal display during battle",
"Display showing for 5 seconds in battle",
"No display during battle"
],
"width": 1
},
{
"default": 2,
"key": "show_out_combat",
"name": "Display after battle",
"type": "select",
"useDesc": false,
"values": [
"Automatically display after battle",
"Keep the original hidden state after the battle"
],
"width": 1
},
{
"bigStep": 1,
"default": 300,
"key": "radius",
"max": 1200,
"min": 0,
"name": "Display size",
"softMax": 600,
"softMin": 0,
"step": 1,
"type": "range",
"useDesc": false,
"width": 2
},
{
"noMerge": false,
"text": "Text options",
"type": "header",
"useName": true,
"width": 1
},
{
"default": true,
"key": "show_solution",
"name": "Show route",
"type": "toggle",
"useDesc": false,
"width": 1
},
{
"default": true,
"key": "show_pride_room",
"name": "Route shows pride room",
"type": "toggle",
"useDesc": false,
"width": 1
},
{
"default": true,
"key": "show_end_progress",
"name": "Show end progress",
"type": "toggle",
"useDesc": false,
"width": 1
},
{
"default": false,
"key": "show_direction",
"name": "Display export text instructions",
"type": "toggle",
"useDesc": false,
"width": 1
},
{
"noMerge": false,
"text": "Other options",
"type": "header",
"useName": true,
"width": 1
},
{
"default": 3,
"key": "announce_direction_type",
"name": "Announce direction in chat",
"type": "select",
"useDesc": false,
"values": [
"No announcement",
"Only announce if party leader",
"Always announce"
],
"width": 2
},
{
"default": false,
"desc": "If unchecked, the output will be in the chat frame",
"key": "print_in_errorframe",
"name": "Print information in the middle of the screen",
"type": "toggle",
"useDesc": true,
"width": 1
},
{
"default": false,
"desc": "Every time you enter a new room, list all possible routes",
"key": "print_all_possible",
"name": "Output all possible routes",
"type": "toggle",
"useDesc": true,
"width": 1
},
{
"default": false,
"desc": "Enables debug mode, with many messages in ingame chat. Should only be used for debugging.",
"key": "debug_mode",
"name": "Debug Mode",
"type": "toggle",
"useDesc": true,
"width": 1
}
],
"blendMode": "ADD",
"color": [
0.96862745098039,
1,
1,
1
],
"conditions": [
{
"changes": [
{
"property": "color",
"value": [
1,
0,
0.047058823529412,
1
]
}
],
"check": {
"trigger": 1,
"value": 1,
"variable": "block"
}
},
{
"changes": [
{
"property": "color",
"value": [
0,
1,
0.27843137254902,
1
]
}
],
"check": {
"trigger": 1,
"value": 1,
"variable": "exit"
}
},
{
"changes": [
{
"property": "sub.2.text_fontSize",
"value": 20
}
],
"check": {
"trigger": 1,
"value": 1,
"variable": "is_message"
}
}
],
"config": {
"announce_direction_type": 3,
"debug_mode": false,
"print_all_possible": false,
"print_in_errorframe": false,
"radius": 300,
"show_direction": false,
"show_direction_line": true,
"show_end_progress": true,
"show_in_combat": 1,
"show_only_solution": true,
"show_out_combat": 2,
"show_pride_room": true,
"show_solution": true
},
"customText": "--function ()\n-- local name = aura_env.state.name or \"\"\n-- local sub_text\n-- if WeakAuras.IsOptionsOpen() then\n-- sub_text = \"仙林迷宫导航\\n请勿移动\\n保持在屏幕中心\"\n-- else\n-- sub_text = aura_env.state.sub_text or \"\"\n-- end\n-- return name, sub_text\n--end\n\nfunction ()\n local name = aura_env.state.name or \"\"\n local sub_text\n if WeakAuras.IsOptionsOpen() then\n sub_text = aura_env.not_move_string\n else\n sub_text = aura_env.state.sub_text or \"\"\n end\n --return name, sub_text\n return name, sub_text\nend",
"desaturate": false,
"discrete_rotation": 0,
"frameStrata": 1,
"height": 64,
"id": "Automatic Tirna Maze Navigator",
"information": {
"forceEvents": true,
"ignoreOptionsEventErrors": true
},
"internalVersion": 77,
"load": {
"class": {
"multi": []
},
"size": {
"multi": []
},
"spec": {
"multi": []
},
"talent": {
"multi": []
},
"use_zone": false,
"use_zoneIds": true,
"zoneIds": "1669"
},
"mirror": false,
"regionType": "texture",
"rotate": false,
"rotation": 0,
"selfPoint": "CENTER",
"semver": "1.0.11",
"source": "import",
"subRegions": [
{
"type": "subbackground"
},
{
"anchorXOffset": 0,
"anchorYOffset": 0,
"rotateText": "NONE",
"text_anchorPoint": "CENTER",
"text_automaticWidth": "Auto",
"text_color": [
1,
1,
1,
1
],
"text_fixedWidth": 64,
"text_font": "聊天",
"text_fontSize": 33,
"text_fontType": "THICKOUTLINE",
"text_justify": "CENTER",
"text_selfPoint": "AUTO",
"text_shadowColor": [
0,
0,
0,
1
],
"text_shadowXOffset": 1,
"text_shadowYOffset": -1,
"text_text": "%c1",
"text_text_format_c1_format": "none",
"text_text_format_n_format": "none",
"text_visible": true,
"text_wordWrap": "WordWrap",
"type": "subtext"
},
{
"anchorXOffset": 0,
"anchorYOffset": 0,
"rotateText": "NONE",
"text_anchorPoint": "BOTTOM",
"text_anchorYOffset": -5,
"text_automaticWidth": "Auto",
"text_color": [
1,
1,
1,
1
],
"text_fixedWidth": 64,
"text_font": "聊天",
"text_fontSize": 26,
"text_fontType": "THICKOUTLINE",
"text_justify": "CENTER",
"text_selfPoint": "TOP",
"text_shadowColor": [
0,
0,
0,
1
],
"text_shadowXOffset": 1,
"text_shadowYOffset": -1,
"text_text": "%c2",
"text_text_format_c2_format": "none",
"text_text_format_n_format": "none",
"text_visible": true,
"text_wordWrap": "WordWrap",
"type": "subtext"
}
],
"texture": "Interface\\AddOns\\WeakAuras\\Media\\Textures\\Ring_40px.tga",
"textureWrapMode": "CLAMPTOBLACKADDITIVE",
"tocversion": 110002,
"triggers": {
"1": {
"trigger": {
"check": "event",
"custom": "function (...) return aura_env:ON_EVENT(...) end",
"customVariables": "{\n entrance = \"bool\",\n exit = \"bool\",\n is_message = \"bool\",\n block = \"bool\",\n}",
"custom_type": "stateupdate",
"debuffType": "HELPFUL",
"event": "Chat Message",
"events": "CLEU:UNIT_DIED, CLEU:SPELL_DAMAGE, WA_MIST_NAV, PLAYER_REGEN_DISABLED, PLAYER_REGEN_ENABLED, ZONE_CHANGED, ZONE_CHANGED_INDOORS, PLAYER_ENTERING_WORLD, ENCOUNTER_START, ENCOUNTER_END, WA_MIST_NAV_DEBUG, BOSS_KILL",
"names": [],
"spellIds": [],
"subeventPrefix": "SPELL",
"subeventSuffix": "_CAST_START",
"type": "custom",
"unit": "player"
},
"untrigger": []
},
"activeTriggerMode": -10
},
"uid": "6r8CIVttJVT",
"url": "https://wago.io/04YHZsxIO/12",
"version": 12,
"wagoID": "04YHZsxIO",
"width": 64,
"xOffset": 0,
"yOffset": 0
},
"m": "d",
"s": "5.17.1",
"v": 1421,
"wagoID": "04YHZsxIO"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment