Added actor:IsFriendlyNpc()

This commit is contained in:
Tercio Jose
2021-03-01 16:19:00 -03:00
parent 2daf700d02
commit b1dd10f166
8 changed files with 97 additions and 8 deletions
+16
View File
@@ -91,6 +91,8 @@
local tooltip_temp_table = {}
local OBJECT_TYPE_FRIENDLY_NPC = 0x00000A18
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> exported functions
@@ -205,6 +207,20 @@
end
return false
end
function Details:IsFriendlyNpc()
local flag = self.flag_original
if (flag) then
if (bit.band(flag, 0x00000008) ~= 0) then
if (bit.band(flag, 0x00000010) ~= 0) then
if (bit.band(flag, 0x00000800) ~= 0) then
return true
end
end
end
end
return false
end
--[[ exported]] function Details:IsEnemy()
if (self.flag_original) then
+20
View File
@@ -117,6 +117,26 @@ function atributo_heal:NovaTabela (serial, nome, link)
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> npc healing taken
--local npchealingtaken_tooltip_background = {value = 100, color = {0.1960, 0.1960, 0.1960, 0.9097}, texture = [[Interface\AddOns\Details\images\bar_background2]]}
--tooltip function
local function RefreshNpcHealingTakenBar(tabela, barra, instancia)
atributo_damage:UpdateNpcHealingTaken(tabela, tabela.minha_barra, barra.colocacao, instancia)
end
local on_switch_NHT_show = function(instance) --npc healing taken
instance:TrocaTabela(instance, true, 1, 8)
return true
end
--local NHT_search_code = [[]]
function _detalhes.SortGroupHeal (container, keyName2)
keyName = keyName2
return _table_sort (container, _detalhes.SortKeyGroupHeal)
+1 -1
View File
@@ -605,7 +605,7 @@ function atributo_misc:DeadAtualizarBarra (morte, whichRowLine, colocacao, insta
esta_barra.icone_classe:SetTexCoord (_unpack (_detalhes.class_specs_coords [spec]))
else
esta_barra.icone_classe:SetTexture (instancia.row_info.icon_file)
esta_barra.icone_classe:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [morte[4]]))
esta_barra.icone_classe:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [morte[4]])) --no tcoords on morte[4]
end
else
esta_barra.icone_classe:SetTexture (instancia.row_info.icon_file)
+8
View File
@@ -74,6 +74,9 @@
local TheNightfallen = GetFactionInfoByID (1859) or "1"
local TheWardens = GetFactionInfoByID (1894) or "1"
local SPELLID_SANGUINE_HEAL = 226510
local sanguineActorName = GetSpellInfo(SPELLID_SANGUINE_HEAL)
local IsFactionNpc = {
[KirinTor] = true,
[Valarjar] = true,
@@ -700,6 +703,11 @@
end
--sanguine affix
if (nome == sanguineActorName) then
novo_objeto.grupo = true
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- grava o objeto no mapa do container
local size = #self._ActorTable+1
+16 -7
View File
@@ -274,6 +274,8 @@
local SPELLID_KYRIAN_DRUID_HEAL = 327149
local SPELLID_KYRIAN_DRUID_TANK = 327037
local SPELLID_SANGUINE_HEAL = 226510
local SPELLID_BARGAST_DEBUFF = 334695 --REMOVE ON 10.0
local bargastBuffs = {}
@@ -1601,7 +1603,7 @@
end
-----------------------------------------------------------------------------------------------------------------------------------------
--> HEALING serach key: ~heal |
--> HEALING serach key: ~healing |
-----------------------------------------------------------------------------------------------------------------------------------------
@@ -1834,10 +1836,16 @@
este_jogador.last_event = _tempo
------------------------------------------------------------------------------------------------
--> an enemy healing enemy or an player actor healing a enemy
if (_bit_band (alvo_flags, REACTION_FRIENDLY) == 0 and not _detalhes.is_in_arena and not _detalhes.is_in_battleground) then
if (spellid == SPELLID_SANGUINE_HEAL) then --sanguine ichor (heal enemies)
who_name = GetSpellInfo(SPELLID_SANGUINE_HEAL)
who_flags = 0x518
este_jogador.grupo = true
elseif (_bit_band (alvo_flags, REACTION_FRIENDLY) == 0 and not _detalhes.is_in_arena and not _detalhes.is_in_battleground) then
if (not este_jogador.heal_enemy [spellid]) then
este_jogador.heal_enemy [spellid] = cura_efetiva
else
@@ -2766,7 +2774,7 @@ SPELL_HEAL,Player-3209-0A79112C,"Symantec-Azralon",0x511,0x0,Player-3209-065BAED
--local name, texture, count, debuffType, duration, expirationTime, caster, canStealOrPurge, nameplateShowPersonal, spellId = UnitAura (alvo_name, spellname, nil, "HARMFUL")
--UnitAura ("Kastfall", "Gulp Frog Toxin", nil, "HARMFUL")
--> record death log
if (not necro_cheat_deaths[alvo_serial]) then --remove on 10.0
local t = last_events_cache [alvo_name]
@@ -3061,9 +3069,6 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
------------------------------------------------------------------------------------------------
--> early checks and fixes
--print (who_name, alvo_name, spellid, spellname, spelltype, amount, powertype)
if (not who_name) then
who_name = "[*] "..spellname
elseif (not alvo_name) then
@@ -3282,7 +3287,6 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
return spell_misc_func (spell, alvo_serial, alvo_name, alvo_flags, who_name, token, "BUFF_OR_DEBUFF", "COOLDOWN")
end
--serach key: ~interrupts
function parser:interrupt (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool)
@@ -3290,6 +3294,11 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
------------------------------------------------------------------------------------------------
--> early checks and fixes
--quake affix from mythic+
if (spellid == 240448) then
return
end
if (not who_name) then
who_name = "[*] "..spellname
elseif (not alvo_name) then
+26
View File
@@ -4977,6 +4977,32 @@ do
end
Details.options.UpdateAutoHideSettings(currentInstance)
--> profile by spec
--[=[]]
local spec1Table = {}
local playerSpecs = DF.ClassSpecIds [select (2, UnitClass("player"))]
for specID, _ in pairs (playerSpecs) do
local spec_id, specName, spec_description, spec_icon = GetSpecializationInfoByID(specID)
tinsert (spec1Table, {
type = "select",
get = function()
local specProfile = Details.profile_by_spec[specID]
return specProfile
end,
values = function()
local t = {}
for profileName in pairs (__profiles) do
t[#t+1] = profileName
end
return t
end,
name = specName,
desc = specName,
})
end
--]=]
end
tinsert(Details.optionsSection, buildSection)
+6
View File
@@ -106,6 +106,12 @@ do
function _detalhes:GetName (actor)
return self.nome or actor and actor.nome
end
function _detalhes:GetNameNoRealm(actor)
local name = self.nome or actor and actor.nome
return Details:GetOnlyName(name)
end
function _detalhes:GetDisplayName (actor)
return self.displayName or actor and actor.displayName
end
+4
View File
@@ -11,6 +11,10 @@ do
local _unpack = unpack
local unknown_class_coords = {0.75, 1, 0.75, 1}
function Details:GetUnknownClassIcon()
return [[Interface\AddOns\Details\images\classes_small]], unpack(unknown_class_coords)
end
function _detalhes:GetIconTexture (iconType, withAlpha)
iconType = string.lower (iconType)