- framework update.
- fix for friendly fire cleanup on the previous commit.
This commit is contained in:
+187
-1
@@ -1,5 +1,5 @@
|
||||
|
||||
local dversion = 109
|
||||
local dversion = 111
|
||||
local major, minor = "DetailsFramework-1.0", dversion
|
||||
local DF, oldminor = LibStub:NewLibrary (major, minor)
|
||||
|
||||
@@ -2457,5 +2457,191 @@ function DF_CALC_PERFORMANCE()
|
||||
end)
|
||||
end
|
||||
|
||||
DF.ClassFileNameToIndex = {
|
||||
["DEATHKNIGHT"] = 6,
|
||||
["WARRIOR"] = 1,
|
||||
["ROGUE"] = 4,
|
||||
["MAGE"] = 8,
|
||||
["PRIEST"] = 5,
|
||||
["HUNTER"] = 3,
|
||||
["WARLOCK"] = 9,
|
||||
["DEMONHUNTER"] = 12,
|
||||
["SHAMAN"] = 7,
|
||||
["DRUID"] = 11,
|
||||
["MONK"] = 10,
|
||||
["PALADIN"] = 2,
|
||||
}
|
||||
DF.ClassCache = {}
|
||||
|
||||
function DF:GetClassList()
|
||||
|
||||
if (next (DF.ClassCache)) then
|
||||
return DF.ClassCache
|
||||
end
|
||||
|
||||
for className, classIndex in pairs (DF.ClassFileNameToIndex) do
|
||||
local classTable = C_CreatureInfo.GetClassInfo (classIndex)
|
||||
local t = {
|
||||
ID = classIndex,
|
||||
Name = classTable.className,
|
||||
Texture = [[Interface\GLUES\CHARACTERCREATE\UI-CharacterCreate-Classes]],
|
||||
TexCoord = CLASS_ICON_TCOORDS [className],
|
||||
FileString = className,
|
||||
}
|
||||
tinsert (DF.ClassCache, t)
|
||||
end
|
||||
|
||||
return DF.ClassCache
|
||||
|
||||
end
|
||||
|
||||
--hardcoded race list
|
||||
DF.RaceList = {
|
||||
[1] = "Human",
|
||||
[2] = "Orc",
|
||||
[3] = "Dwarf",
|
||||
[4] = "NightElf",
|
||||
[5] = "Scourge",
|
||||
[6] = "Tauren",
|
||||
[7] = "Gnome",
|
||||
[8] = "Troll",
|
||||
[9] = "Goblin",
|
||||
[10] = "BloodElf",
|
||||
[11] = "Draenei",
|
||||
[22] = "Worgen",
|
||||
[24] = "Pandaren",
|
||||
}
|
||||
|
||||
DF.AlliedRaceList = {
|
||||
[27] = "Nightborne",
|
||||
[29] = "HighmountainTauren",
|
||||
[31] = "VoidElf",
|
||||
[33] = "LightforgedDraenei",
|
||||
[35] = "ZandalariTroll",
|
||||
[36] = "KulTiran",
|
||||
[38] = "DarkIronDwarf",
|
||||
[40] = "Vulpera",
|
||||
[41] = "MagharOrc",
|
||||
}
|
||||
|
||||
--> store and return a list of character races, always return the non-localized value
|
||||
DF.RaceCache = {}
|
||||
function DF:GetCharacterRaceList (fullList)
|
||||
if (next (DF.RaceCache)) then
|
||||
return DF.RaceCache
|
||||
end
|
||||
|
||||
for i = 1, 100 do
|
||||
local raceInfo = C_CreatureInfo.GetRaceInfo (i)
|
||||
if (raceInfo and DF.RaceList [raceInfo.raceID]) then
|
||||
tinsert (DF.RaceCache, {Name = raceInfo.raceName, FileString = raceInfo.clientFileString})
|
||||
end
|
||||
|
||||
local alliedRaceInfo = C_AlliedRaces.GetRaceInfoByID (i)
|
||||
if (alliedRaceInfo and DF.AlliedRaceList [alliedRaceInfo.raceID]) then
|
||||
tinsert (DF.RaceCache, {Name = alliedRaceInfo.name, FileString = alliedRaceInfo.raceFileString})
|
||||
end
|
||||
end
|
||||
|
||||
return DF.RaceCache
|
||||
end
|
||||
|
||||
--get a list of talents for the current spec the player is using
|
||||
--if onlySelected return an index table with only the talents the character has selected
|
||||
--if onlySelectedHash return a hash table with [spelID] = true
|
||||
function DF:GetCharacterTalents (onlySelected, onlySelectedHash)
|
||||
local talentList = {}
|
||||
|
||||
for i = 1, 7 do
|
||||
for o = 1, 3 do
|
||||
local talentID, name, texture, selected, available = GetTalentInfo (i, o, 1)
|
||||
if (onlySelectedHash) then
|
||||
if (selected) then
|
||||
talentList [talentID] = true
|
||||
break
|
||||
end
|
||||
elseif (onlySelected) then
|
||||
if (selected) then
|
||||
tinsert (talentList, {Name = name, ID = talentID, Texture = texture, IsSelected = selected})
|
||||
break
|
||||
end
|
||||
else
|
||||
tinsert (talentList, {Name = name, ID = talentID, Texture = texture, IsSelected = selected})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return talentList
|
||||
end
|
||||
|
||||
function DF:GetCharacterPvPTalents (onlySelected, onlySelectedHash)
|
||||
if (onlySelected or onlySelectedHash) then
|
||||
local talentsSelected = C_SpecializationInfo.GetAllSelectedPvpTalentIDs()
|
||||
local talentList = {}
|
||||
for _, talentID in ipairs (talentsSelected) do
|
||||
local _, talentName, texture = GetPvpTalentInfoByID (talentID)
|
||||
if (onlySelectedHash) then
|
||||
talentList [talentID] = true
|
||||
else
|
||||
tinsert (talentList, {Name = talentName, ID = talentID, Texture = texture, IsSelected = true})
|
||||
end
|
||||
end
|
||||
return talentList
|
||||
|
||||
else
|
||||
local alreadyAdded = {}
|
||||
local talentList = {}
|
||||
for i = 1, 4 do --4 slots - get talents available in each one
|
||||
local slotInfo = C_SpecializationInfo.GetPvpTalentSlotInfo (i)
|
||||
if (slotInfo) then
|
||||
for _, talentID in ipairs (slotInfo.availableTalentIDs) do
|
||||
if (not alreadyAdded [talentID]) then
|
||||
local _, talentName, texture, selected = GetPvpTalentInfoByID (talentID)
|
||||
tinsert (talentList, {Name = talentName, ID = talentID, Texture = texture, IsSelected = selected})
|
||||
alreadyAdded [talentID] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return talentList
|
||||
end
|
||||
end
|
||||
|
||||
DF.GroupTypes = {
|
||||
{Name = "Arena", ID = "arena"},
|
||||
{Name = "Battleground", ID = "pvp"},
|
||||
{Name = "Raid", ID = "raid"},
|
||||
{Name = "Dungeon", ID = "party"},
|
||||
{Name = "Scenario", ID = "scenario"},
|
||||
{Name = "Open World", ID = "none"},
|
||||
}
|
||||
function DF:GetGroupTypes()
|
||||
return DF.GroupTypes
|
||||
end
|
||||
|
||||
DF.RoleTypes = {
|
||||
{Name = _G.DAMAGER, ID = "DAMAGER", Texture = _G.INLINE_DAMAGER_ICON},
|
||||
{Name = _G.HEALER, ID = "HEALER", Texture = _G.INLINE_HEALER_ICON},
|
||||
{Name = _G.TANK, ID = "TANK", Texture = _G.INLINE_TANK_ICON},
|
||||
}
|
||||
function DF:GetRoleTypes()
|
||||
return DF.RoleTypes
|
||||
end
|
||||
|
||||
DF.CLEncounterID = {
|
||||
{ID = 2144, Name = "Taloc"},
|
||||
{ID = 2141, Name = "MOTHER"},
|
||||
{ID = 2128, Name = "Fetid Devourer"},
|
||||
{ID = 2136, Name = "Zek'voz"},
|
||||
{ID = 2134, Name = "Vectis"},
|
||||
{ID = 2145, Name = "Zul"},
|
||||
{ID = 2135, Name = "Mythrax the Unraveler"},
|
||||
{ID = 2122, Name = "G'huun"},
|
||||
}
|
||||
|
||||
function DF:GetCLEncounterIDs()
|
||||
return DF.CLEncounterID
|
||||
end
|
||||
|
||||
--doo elsee
|
||||
--was doing double loops due to not enought height
|
||||
|
||||
+1015
-3
File diff suppressed because it is too large
Load Diff
+5
-1
@@ -881,6 +881,10 @@ local switch_enable = function (self)
|
||||
return _rawset (self, "lockdown", false)
|
||||
end
|
||||
|
||||
local set_switch_func = function (self, newFunction)
|
||||
self.OnSwitch = newFunction
|
||||
end
|
||||
|
||||
local set_as_checkbok = function (self)
|
||||
local checked = self:CreateTexture (self:GetName() .. "CheckTexture", "overlay")
|
||||
checked:SetTexture ([[Interface\Buttons\UI-CheckBox-Check]])
|
||||
@@ -938,7 +942,6 @@ function DF:NewSwitch (parent, container, name, member, w, h, ltext, rtext, defa
|
||||
rtext = rtext or "ON"
|
||||
|
||||
--> build frames
|
||||
|
||||
w = w or 60
|
||||
h = h or 20
|
||||
|
||||
@@ -954,6 +957,7 @@ function DF:NewSwitch (parent, container, name, member, w, h, ltext, rtext, defa
|
||||
slider.Enable = switch_enable
|
||||
slider.SetAsCheckBox = set_as_checkbok
|
||||
slider.SetTemplate = DFSliderMetaFunctions.SetTemplate
|
||||
slider.SetSwitchFunction = set_switch_func
|
||||
|
||||
if (member) then
|
||||
parent [member] = slider
|
||||
|
||||
+6
-15
@@ -506,6 +506,9 @@
|
||||
if (absorbed) then
|
||||
amount = absorbed + (amount or 0)
|
||||
end
|
||||
if (overkill and overkill > 0) then
|
||||
amount = amount - overkill
|
||||
end
|
||||
|
||||
if (este_jogador.grupo and not este_jogador.arena_enemy and not este_jogador.enemy) then --> source = friendly player and not an enemy player
|
||||
--dano to adversario estava caindo aqui por nao estar checando .enemy
|
||||
@@ -658,25 +661,13 @@
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--> firendly fire
|
||||
--> firendly fire ~friendlyfire
|
||||
if (
|
||||
--removed deprecated friendly fire rules (25/09/2018)
|
||||
--general rules for friendly fire
|
||||
(
|
||||
--rule 1: if the source and target are friedly to each other
|
||||
(_bit_band (alvo_flags, REACTION_FRIENDLY) ~= 0 and _bit_band (who_flags, REACTION_FRIENDLY) ~= 0) --or --ajdt d' brx
|
||||
--rule 2
|
||||
--(raid_members_cache [alvo_serial] and raid_members_cache [who_serial] and alvo_serial:find ("Player") and who_serial:find ("Player")) --amrl
|
||||
)
|
||||
--rule 3
|
||||
and
|
||||
(
|
||||
true
|
||||
--> if the target isn't a pvp duel target
|
||||
--not jogador_alvo.enemy and not este_jogador.enemy
|
||||
--> specific rules for encounters
|
||||
--_current_encounter_id ~= 2113 and --Waycrest Manor HeartsbaneTriad boss (it has mind control)
|
||||
--_current_encounter_id ~= 2132 -- Shrine of the Storms Lord Stormsong (it has mind control)
|
||||
(_bit_band (alvo_flags, REACTION_FRIENDLY) ~= 0 and _bit_band (who_flags, REACTION_FRIENDLY) ~= 0) or
|
||||
(raid_members_cache [who_serial] and _bit_band (who_flags, OBJECT_TYPE_ENEMY) ~= 0 and _bit_band (alvo_flags, REACTION_FRIENDLY) ~= 0)
|
||||
)
|
||||
) then
|
||||
|
||||
|
||||
@@ -282,8 +282,6 @@ function _G._detalhes:Start()
|
||||
self.listener:RegisterEvent ("PLAYER_SPECIALIZATION_CHANGED")
|
||||
self.listener:RegisterEvent ("PLAYER_TALENT_UPDATE")
|
||||
|
||||
self.listener:RegisterEvent ("PLAYER_SPECIALIZATION_CHANGED")
|
||||
|
||||
--test immersion stuff
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user