Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Custom Trigger: Damage Text
- function(e, ...)
- --[[
- -- CHEAT SHEET for select (X, ...)
- 1st Param 2nd Param 3rd Param 4th Param 5th Param 6th Param 7th Param 8th Param 9th Param 10th Param 11th Param
- timestamp event hideCaster sourceGUID sourceName sourceFlags sourceRaidFlags destGUID destName destFlags destRaidFlags
- Prefix 1st Parameter (12th) 2nd Parameter (13th) 3rd Parameter (14th)
- SWING
- RANGE spellId spellName spellSchool
- SPELL spellId spellName spellSchool
- SPELL_PERIODIC spellId spellName spellSchool
- SPELL_BUILDING spellId spellName spellSchool
- ENVIRONMENTAL environmentalType
- Suffix 1st Param (15th) 2nd Param (16th) 3rd Param (17th) 4th Param (18th) 5th Param (19th) 6th Param (20st) 7th Param (21nd) 8th Param (22rd) 9th Param (23th) 10th Param (24th) 11th Param (25th)
- _DAMAGE amount overkill school resisted blocked absorbed critical glancing crushing isOffHand multistrike
- --------------------------------------------------
- for i=1, GetNumGroupMembers() do
- local raider = "raid"..i
- if UnitName(raider) == name then
- local x, y = UnitPosition(raider)
- local infoTable = {NAME = name, TIME = GetTime()+30, X = x, Y = y}
- table.insert(aura_env.playerInfo, infoTable)
- break
- end
- end
- for k,v in pairs(aura_env.playerInfo) do
- ------ PET DAMAGE EVENTS
- COMBAT_LOG_EVENT_UNFILTERED 1438429786.334 SPELL_DAMAGE false Creature-0-3779-1153-26215-94852-00003CB250 Fey Moonwing 8465 0 Creature-0-3779-1153-26215-87761-0000BC8478 Dungeoneer's Training Dummy 68136 0 188046 Fey Missile 72 3627 -1 72 nil nil nil false false false false false
- COMBAT_LOG_EVENT_UNFILTERED 1438435929.592 SWING_DAMAGE false Pet-0-3023-1153-23296-93349-0102430CD1 Abbie 4370 0 Creature-0-3020-1153-8717-87761-00003CBDFC Dungeoneer's Training Dummy 68136 128 762 -1 1 nil nil nil false false false false
- SPELL_SUMMON,Player-3723-08161502,"Ogrund-Barthilas",0x511,0x0,Creature-0-3748-1153-8817-92993-0001BCDD2C,"Mirror Image",0x2111,0x0,184274,"Burning Mirror",0x40
- COMBAT_LOG_EVENT_UNFILTERED 1438443700.513 SPELL_SUMMON false Player-3684-08217F54 Krazyito 1297 0 Creature-0-3020-1153-8717-94852-00003CE8B3 Fey Moonwing 2600 0 188083 Fey Moonwing 8
- local myPet = sourceFlags and bit.band(sourceFlags, COMBATLOG_OBJECT_AFFILIATION_MASK) == 1 --check if its MY pet or creature (not others)
- ]]
- local intRing = "Nithramus" -- placeholder text for checking if the event happened
- local strRing = "Thorasus"
- local agiRing = "Maalus"
- local subevent = select(2, ...) -- lazy variables so i dont have to use underscores (thiking about it now way after i did it, this is pretty smart cause fuck trying to count to make sure I got the right one)
- local spellName = select(13, ...)
- local sourceGUID = select(4, ...)
- local destGUID = select(8, ...)
- local sourceName = select(5, ...)
- local name = ""
- local broke = false
- local myPet = false
- local isCreature = string.match(sourceGUID, "Creature") == "Creature"
- local buff = UnitBuff("player", "Nithramus") or UnitBuff("player", "Thorasus") or UnitBuff("player", "Maalus") -- this is a fail safe to try to trigger the aura if the player has the buff
- local function getRingBuff(unitID)
- local one = UnitBuff(unitID, "Nithramus") -- overrides original variable with nil if we do not have the buff
- local two= UnitBuff(unitID, "Thorasus")
- local three = UnitBuff(unitID, "Maalus")
- return one, two, three
- end
- if ((subevent == "SPELL_AURA_APPLIED" and (spellName == intRing or spellName == strRing or spellName == agiRing)) or buff ~= nil )and not aura_env.triggered then -- if the buff is applies to SOMEONE then show the number, make sure to only trigger once as to not reset whole thing
- return true
- --[[
- If the subevent is a 'damaging player event' (SPELL_DAMAGE, SPELL_PERIODIC_DAMAGE, SWING_DAMAGE, SPELL_BUILDING_DAMAGE (player damage to building? idk), or RANGE_DAMAGE)
- ]]
- elseif subevent == "SPELL_SUMMON" then
- if string.match(sourceGUID, "Creature") == "Creature" then
- name = string.gsub(sourceName, "%-[^|]+", "") -- remove realm names, of the source unit, if any. 5 = SourceName
- local infoTable = {GUID = destGUID, OWNER = name}
- table.insert(aura_env.petInfo, infoTable)
- end
- elseif subevent == "SPELL_DAMAGE" or subevent == "SPELL_PERIODIC_DAMAGE" or subevent == "SWING_DAMAGE" or subevent == "SPELL_BUILDING_DAMAGE" or subevent == "RANGE_DAMAGE" then -- if damage events happen
- name = string.gsub(sourceName, "%-[^|]+", "") -- remove realm names, of the source unit, if any. 5 = SourceName
- local isPet
- if string.match(sourceGUID, "Player") ~= "Player" then isPet = true else isPet = false end -- 4 is sourceGUID, check if this is a pet
- if isPet then
- intRing, strRing, agiRing = nil, nil, nil -- pets keep adding damage and ignore all the checks...
- myPet = sourceFlags and bit.band(sourceFlags, COMBATLOG_OBJECT_AFFILIATION_MASK) == 1 --check if its MY pet or creature (not others)
- end
- ---------------------Giant stupid check becasue fuck partys....
- --[[
- Basic idea here is, check if we are solo, in a party or in a raid.
- If one of those are true, find the UnitID of the sourceName (either player, partyN, or raidN, and their pets)
- If we find a macthing UnitID then make sure that UnitID has the Ring buff (if its a pet, check if the owner has the buff)
- If they have the buff, we save the name of the ring just to have a 'true' check (if no buff then its nil)
- ]]
- if GetNumGroupMembers() == 0 then -- not in a party or raid group, look for the players stuff
- if UnitName("player") == name or sourceGUID == UnitGUID("playerpet") or myPet then -- if the event is a player or a creature or the players pet
- intRing, strRing, agiRing = getRingBuff("player")
- end
- elseif GetNumGroupMembers() <= 5 then -- need to check if in a party
- if UnitInRaid("player") == nil then -- if nil, we are in party, so fuck you. This makes it more complicated (have to check 'party1-4' and 'player')
- if UnitName("player") == name or sourceGUID == UnitGUID("playerpet") or myPet then -- the player or his pet casted the spell
- intRing, strRing, agiRing = getRingBuff("player")
- else
- for i=1, GetNumGroupMembers() do
- local raider = "party"..i -- its gonna check for party5, but its nil so fuck it, it may break before then anyway. (there is only party1-4)
- if UnitName(raider) == name or (sourceGUID == UnitGUID(raider.."pet")) then -- UnitName returns only the name in the first parameter (realm in the second), or the units pet
- intRing, strRing, agiRing = getRingBuff(raider)
- break
- elseif isCreature then -- if it is a creature
- for k,v in pairs(aura_env.petInfo) do -- go through our list ofcreatures
- if v.GUID == sourceGUID and v.OWNER == UnitName(raider) then -- if the owner is the player, find his buff
- intRing, strRing, agiRing = getRingBuff(raider)
- broke = true
- break
- end
- end
- end-- end current raider
- if broke then break end -- check if we broke in the inner loop so we dont continue.
- end -- end for loop
- end
- else -- we are in a raid, yay so easy
- for i=1, GetNumGroupMembers() do
- local raider = "raid"..i
- if UnitName(raider) == name or (sourceGUID == UnitGUID(raider.."pet")) then -- UnitName returns only the name in the first parameter (realm in the second), or the units pet
- intRing, strRing, agiRing = getRingBuff(raider)
- break
- elseif isCreature then -- if it is a creature
- for k,v in pairs(aura_env.petInfo) do -- go through our list ofcreatures
- if v.GUID == sourceGUID and v.OWNER == UnitName(raider) then -- if the owner is the player, find his buff
- intRing, strRing, agiRing = getRingBuff(raider)
- broke = true
- break
- end
- end
- end-- end current raider
- if broke then break end -- check if we broke in the inner loop so we dont continue.
- end -- end for loop
- end -- end raid check
- end-- end party / raid check
- ---------------------Giant stupid check becasue fuck partys....
- --[[
- If we have a ring buff, then Check if the damage was a swing or not
- Regardless of what it was, add the damage amount to the total
- ]]
- if intRing ~= nil or strRing ~= nil or agiRing ~= nil then -- if we have the buff
- if subevent == "SWING_DAMAGE" then -- swing has different return postions
- aura_env.amount = aura_env.amount + select(12, ...) -- 12 is SWING_DAMAGE amount
- else -- its any other event we were checking for
- aura_env.amount = aura_env.amount + select(15, ...) -- 15 is SPELL_DAMAGE amount
- end -- end swing check
- end --end buff check
- end --end event checking
- end -- end function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement