From e44f5c6f9189fe716104eb71582b140b9772cd85 Mon Sep 17 00:00:00 2001 From: Xinhuan Date: Sat, 1 Nov 2008 04:07:02 +0800 Subject: [PATCH] Add option to ignore player pets to display threat info on (Default: On). Yes, player pets have aggro tables too! --- Localization/deDE.lua | 10 ++++++++++ Localization/enUS.lua | 10 ++++++++++ Localization/frFR.lua | 10 ++++++++++ Localization/koKR.lua | 10 ++++++++++ Localization/ruRU.lua | 10 ++++++++++ Localization/zhCN.lua | 10 ++++++++++ Localization/zhTW.lua | 10 ++++++++++ Omen.lua | 23 ++++++++++++++++++----- 8 files changed, 88 insertions(+), 5 deletions(-) diff --git a/Localization/deDE.lua b/Localization/deDE.lua index 8e151cd..6f7f220 100644 --- a/Localization/deDE.lua +++ b/Localization/deDE.lua @@ -40,6 +40,16 @@ L["Lock Omen"] = "Omen verankern" L["Locks Omen in place and prevents it from being dragged or resized."] = "Verankert Omen um zu verhindern, dass es verschoben oder die Größe geändert wird." L["Show minimap button"] = "Zeige Minimap Icon" L["Show the Omen minimap button"] = "Zeige das Omen Minimap Icon" +L["Ignore Player Pets"] = true +L["IGNORE_PLAYER_PETS_DESC"] = [[ +Tells Omen to skip enemy player pets when determining which unit to display threat data on. + +Player pets maintain a threat table when in |cffffff78Aggressive|r or |cffffff78Defensive|r mode and behave just like normal mobs, attacking the target with the highest threat. If the pet is instructed to attack a specific target, the pet still maintains the threat table, but sticks on the assigned target which by definition has 100% threat. Player pets can be taunted to force them to attack you. + +However, player pets on |cffffff78Passive|r mode do not have a threat table, and taunt does not work on them. They only attack their assigned target when instructed and do so without any threat table. + +When a player pet is instructed to |cffffff78Follow|r, the pet's threat table is wiped immediately and stops attacking, although it may immediately reacquire a target based on its Aggressive/Defensive mode. +]] L["Autocollapse"] = "Automatisches Zusammenklappen" L["Autocollapse Options"] = "Optionen für das automatische Zusammenklappen" L["Grow bars upwards"] = "Balken nach oben aufbauen" diff --git a/Localization/enUS.lua b/Localization/enUS.lua index 5a9a171..48374e9 100644 --- a/Localization/enUS.lua +++ b/Localization/enUS.lua @@ -40,6 +40,16 @@ L["Lock Omen"] = true L["Locks Omen in place and prevents it from being dragged or resized."] = true L["Show minimap button"] = true L["Show the Omen minimap button"] = true +L["Ignore Player Pets"] = true +L["IGNORE_PLAYER_PETS_DESC"] = [[ +Tells Omen to skip enemy player pets when determining which unit to display threat data on. + +Player pets maintain a threat table when in |cffffff78Aggressive|r or |cffffff78Defensive|r mode and behave just like normal mobs, attacking the target with the highest threat. If the pet is instructed to attack a specific target, the pet still maintains the threat table, but sticks on the assigned target which by definition has 100% threat. Player pets can be taunted to force them to attack you. + +However, player pets on |cffffff78Passive|r mode do not have a threat table, and taunt does not work on them. They only attack their assigned target when instructed and do so without any threat table. + +When a player pet is instructed to |cffffff78Follow|r, the pet's threat table is wiped immediately and stops attacking, although it may immediately reacquire a target based on its Aggressive/Defensive mode. +]] L["Autocollapse"] = true L["Autocollapse Options"] = true L["Grow bars upwards"] = true diff --git a/Localization/frFR.lua b/Localization/frFR.lua index fe83983..0cd2332 100644 --- a/Localization/frFR.lua +++ b/Localization/frFR.lua @@ -40,6 +40,16 @@ L["Lock Omen"] = "Verrouiller Omen" L["Locks Omen in place and prevents it from being dragged or resized."] = "Verrouille Omen afin d'empêcher tout déplacement ou redimensionnement de la fenêtre." L["Show minimap button"] = "Bouton de la minicarte" L["Show the Omen minimap button"] = "Affiche le bouton de Omen sur la minicarte." +L["Ignore Player Pets"] = true +L["IGNORE_PLAYER_PETS_DESC"] = [[ +Tells Omen to skip enemy player pets when determining which unit to display threat data on. + +Player pets maintain a threat table when in |cffffff78Aggressive|r or |cffffff78Defensive|r mode and behave just like normal mobs, attacking the target with the highest threat. If the pet is instructed to attack a specific target, the pet still maintains the threat table, but sticks on the assigned target which by definition has 100% threat. Player pets can be taunted to force them to attack you. + +However, player pets on |cffffff78Passive|r mode do not have a threat table, and taunt does not work on them. They only attack their assigned target when instructed and do so without any threat table. + +When a player pet is instructed to |cffffff78Follow|r, the pet's threat table is wiped immediately and stops attacking, although it may immediately reacquire a target based on its Aggressive/Defensive mode. +]] L["Autocollapse"] = "Réduire auto." L["Autocollapse Options"] = "Options de la réduction automatique" L["Grow bars upwards"] = "Ajouter vers le haut" diff --git a/Localization/koKR.lua b/Localization/koKR.lua index eee8d8a..3a54637 100644 --- a/Localization/koKR.lua +++ b/Localization/koKR.lua @@ -40,6 +40,16 @@ L["Lock Omen"] = "Omen 잠금" L["Locks Omen in place and prevents it from being dragged or resized."] = "Omen의 위치나 크기를 조절하지 못하도록 잠급니다." L["Show minimap button"] = "미니맵 버튼 표시" L["Show the Omen minimap button"] = "Omen 미니맵 버튼을 표시합니다." +L["Ignore Player Pets"] = true +L["IGNORE_PLAYER_PETS_DESC"] = [[ +Tells Omen to skip enemy player pets when determining which unit to display threat data on. + +Player pets maintain a threat table when in |cffffff78Aggressive|r or |cffffff78Defensive|r mode and behave just like normal mobs, attacking the target with the highest threat. If the pet is instructed to attack a specific target, the pet still maintains the threat table, but sticks on the assigned target which by definition has 100% threat. Player pets can be taunted to force them to attack you. + +However, player pets on |cffffff78Passive|r mode do not have a threat table, and taunt does not work on them. They only attack their assigned target when instructed and do so without any threat table. + +When a player pet is instructed to |cffffff78Follow|r, the pet's threat table is wiped immediately and stops attacking, although it may immediately reacquire a target based on its Aggressive/Defensive mode. +]] L["Autocollapse"] = "자동 접기" L["Autocollapse Options"] = "자동 접기 옵션" L["Grow bars upwards"] = "바 위로 확장" diff --git a/Localization/ruRU.lua b/Localization/ruRU.lua index 02e1f3b..eb9f281 100644 --- a/Localization/ruRU.lua +++ b/Localization/ruRU.lua @@ -40,6 +40,16 @@ L["Lock Omen"] = "Зафиксировать Омен" L["Locks Omen in place and prevents it from being dragged or resized."] = "Фиксирует Омен на месте и не позволяет менять размер или перетаскивать его." L["Show minimap button"] = "Кнопка у мини-карты" L["Show the Omen minimap button"] = "Поместить кнопку Омена у мини-карты" +L["Ignore Player Pets"] = true +L["IGNORE_PLAYER_PETS_DESC"] = [[ +Tells Omen to skip enemy player pets when determining which unit to display threat data on. + +Player pets maintain a threat table when in |cffffff78Aggressive|r or |cffffff78Defensive|r mode and behave just like normal mobs, attacking the target with the highest threat. If the pet is instructed to attack a specific target, the pet still maintains the threat table, but sticks on the assigned target which by definition has 100% threat. Player pets can be taunted to force them to attack you. + +However, player pets on |cffffff78Passive|r mode do not have a threat table, and taunt does not work on them. They only attack their assigned target when instructed and do so without any threat table. + +When a player pet is instructed to |cffffff78Follow|r, the pet's threat table is wiped immediately and stops attacking, although it may immediately reacquire a target based on its Aggressive/Defensive mode. +]] L["Autocollapse"] = "Авто-сворачивание" L["Autocollapse Options"] = "Настройки авто-сворачивания" L["Grow bars upwards"] = "Возрастание полос вверх" diff --git a/Localization/zhCN.lua b/Localization/zhCN.lua index 809a391..5a7188f 100644 --- a/Localization/zhCN.lua +++ b/Localization/zhCN.lua @@ -40,6 +40,16 @@ L["Lock Omen"] = "锁定 Omen" L["Locks Omen in place and prevents it from being dragged or resized."] = "锁定 Omen,使其无法移动或拉伸。" L["Show minimap button"] = true L["Show the Omen minimap button"] = true +L["Ignore Player Pets"] = true +L["IGNORE_PLAYER_PETS_DESC"] = [[ +Tells Omen to skip enemy player pets when determining which unit to display threat data on. + +Player pets maintain a threat table when in |cffffff78Aggressive|r or |cffffff78Defensive|r mode and behave just like normal mobs, attacking the target with the highest threat. If the pet is instructed to attack a specific target, the pet still maintains the threat table, but sticks on the assigned target which by definition has 100% threat. Player pets can be taunted to force them to attack you. + +However, player pets on |cffffff78Passive|r mode do not have a threat table, and taunt does not work on them. They only attack their assigned target when instructed and do so without any threat table. + +When a player pet is instructed to |cffffff78Follow|r, the pet's threat table is wiped immediately and stops attacking, although it may immediately reacquire a target based on its Aggressive/Defensive mode. +]] L["Autocollapse"] = "自动收起" L["Autocollapse Options"] = "自动收起选项" L["Grow bars upwards"] = "计量条向上生长" diff --git a/Localization/zhTW.lua b/Localization/zhTW.lua index af4aa48..ba1309f 100644 --- a/Localization/zhTW.lua +++ b/Localization/zhTW.lua @@ -40,6 +40,16 @@ L["Lock Omen"] = "鎖定Omen" L["Locks Omen in place and prevents it from being dragged or resized."] = "鎖定Omen, 使其無法移動或拉伸." L["Show minimap button"] = true L["Show the Omen minimap button"] = true +L["Ignore Player Pets"] = true +L["IGNORE_PLAYER_PETS_DESC"] = [[ +Tells Omen to skip enemy player pets when determining which unit to display threat data on. + +Player pets maintain a threat table when in |cffffff78Aggressive|r or |cffffff78Defensive|r mode and behave just like normal mobs, attacking the target with the highest threat. If the pet is instructed to attack a specific target, the pet still maintains the threat table, but sticks on the assigned target which by definition has 100% threat. Player pets can be taunted to force them to attack you. + +However, player pets on |cffffff78Passive|r mode do not have a threat table, and taunt does not work on them. They only attack their assigned target when instructed and do so without any threat table. + +When a player pet is instructed to |cffffff78Follow|r, the pet's threat table is wiped immediately and stops attacking, although it may immediately reacquire a target based on its Aggressive/Defensive mode. +]] L["Autocollapse"] = "自動收起" L["Autocollapse Options"] = "自動收起設定" L["Grow bars upwards"] = "計量條向上成長" diff --git a/Omen.lua b/Omen.lua index 0f787ba..1772753 100644 --- a/Omen.lua +++ b/Omen.lua @@ -56,7 +56,7 @@ LSM:Register("sound", "Omen: Aoogah!", [[Interface\AddOns\Omen\aoogah.ogg]]) local floor, format = floor, format local tinsert, tremove, next, sort, wipe = tinsert, tremove, next, sort, wipe local UnitDetailedThreatSituation = UnitDetailedThreatSituation -local UnitExists, UnitGUID, UnitName, UnitClass = UnitExists, UnitGUID, UnitName, UnitClass +local UnitExists, UnitGUID, UnitName, UnitClass, UnitHealth = UnitExists, UnitGUID, UnitName, UnitClass, UnitHealth local UnitIsPlayer, UnitPlayerControlled, UnitCanAttack = UnitIsPlayer, UnitPlayerControlled, UnitCanAttack local GetNumRaidMembers, GetNumPartyMembers = GetNumRaidMembers, GetNumPartyMembers @@ -78,6 +78,7 @@ local defaults = { VGrip1 = 85, VGrip2 = 115, UseFocus = false, + IgnorePlayerPets = true, Background = { Texture = "Blizzard Parchment", BorderTexture = "Blizzard Dialog", @@ -1205,10 +1206,12 @@ function Omen:FindThreatMob() name2 = UnitName(mob) guidNameLookup[UnitGUID(mob)] = name2 if not name then name = name2 end - if not UnitIsPlayer(mob) and not UnitPlayerControlled(mob) and UnitCanAttack("player", mob) and UnitHealth(mob) > 0 then - self.TitleText:SetText(name2) - self.unitID = mob - return mob + if not UnitIsPlayer(mob) and UnitCanAttack("player", mob) and UnitHealth(mob) > 0 then + if not db.IgnorePlayerPets or not UnitPlayerControlled(mob) then + self.TitleText:SetText(name2) + self.unitID = mob + return mob + end end end end @@ -1721,6 +1724,16 @@ local options = { if value then LDBIcon:Show("Omen") else LDBIcon:Hide("Omen") end end, }, + IgnorePlayerPets = { + type = "toggle", + name = L["Ignore Player Pets"], + desc = L["IGNORE_PLAYER_PETS_DESC"], + order = 11, + set = function(info, value) + db.IgnorePlayerPets = value + Omen:UpdateBars() + end, + }, Autocollapse = { type = "toggle", name = L["Autocollapse"],