These scripts are included by default and added when a profile is reset. Since these are defaults, they take up no space in the Saved Variables file.
Achievements
-- $EVENTS ACHIEVEMENT_EARNED -- $DESCRIPTION Earned an achievement TakeScreenshot()
Dueling
NOTE: This also fires if a duel is canceled
-- $EVENTS DUEL_FINISHED -- $DESCRIPTION Takes a picture when finishing a duel TakeScreenshot()
Death
-- $EVENTS PLAYER_DEAD ZONE_CHANGED_NEW_AREA
-- $DESCRIPTION Takes a picture when dead
-- $SETTING InBattleGrounds = "boolean"
-- $SETTING InArena = "boolean"
local event = ...
if "PLAYER_DEAD" == event then
if nil == self.zone then
self.zone = {
inBG = "pvp" == select(2, IsInInstance())
, inArena = "arena" == select(2, IsInInstance())
}
end
if self.zone.inBG and not settings.InBattleGrounds
or self.zone.inArena and not settings.InArena then
return
end
TakeScreenshot()
elseif "ZONE_CHANGED_NEW_AREA" == event then
self.zone = self.zone or {}
self.zone.inBG = "pvp" == select(2, IsInInstance())
self.zone.inArena = "arena" == select(2, IsInInstance())
end
Level up
-- $EVENTS PLAYER_LEVEL_UP -- $DESCRIPTION Take a picture when gaining a level TakeScreenshot()
High Crit
-- $EVENTS COMBAT_LOG_EVENT_UNFILTERED
-- $DESCRIPTION Track high crits
-- $SETTING HighestCrit={type="number", default=3000, label="Highest Crit"}
if not self.COMBAT_EVENTS then
self.COMBAT_EVENTS = {
SWING_DAMAGE = true
, RANGE_DAMAGE = true
, SPELL_DAMAGE = true
, SPELL_PERIODIC_DAMAGE = true
, DAMAGE_SHIELD = true
, DAMAGE_SPLIT = true
}
end
local etype,_,srcName,srcFlags,_,dstName,dstFlags = select(3, ...)
if not (self.COMBAT_EVENTS[ etype ]
and srcName
and CombatLog_Object_IsA(srcFlags, COMBATLOG_FILTER_MINE)) then
return
end
local amount,_,_,_,_,_,crit = select("SWING_DAMAGE" == etype and 10 or 13, ...)
if crit and amount > settings.HighestCrit then
TakeScreenshot()
settings.HighestCrit = amount
end
Killing Blow
NOTE: This does not work yet
-- $EVENTS COMBAT_LOG_EVENT_UNFILTERED ZONE_CHANGED_NEW_AREA
-- $DESCRIPTION Track killing blows
-- $SETTING InBattleGrounds = "boolean"
-- $SETTING InArena = "boolean"
-- $SETTING NameMatch = "string"
local event = ...
if "COMBAT_LOG_EVENT_UNFILTERED" == event then
if not self.COMBAT_EVENTS then
self.COMBAT_EVENTS = {
PARTY_KILL = true
, UNIT_DIED = true
, UNIT_DESTROYED = true
}
end
local etype,_,srcName,srcFlags,_,dstName,dstFlags = select(3, ...)
if not (self.COMBAT_EVENTS[ etype ]
and sourcName
and CombatLog_Object_IsA(srcFlags, COMBATLOG_FILTER_MINE)) then
-- was not a killing blow
return
end
-- Create a filter for hostile players (not mc'd)
if not self.COMBATLOG_PK then
self.COMBATLOG_PK =
bit.bor(COMBATLOG_OBJECT_TYPE_PLAYER
, COMBATLOG_OBJECT_CONTROL_PLAYER
, COMBATLOG_OBJECT_REACTION_HOSTILE
, COMBATLOG_OBJECT_AFFILIATION_OUTSIDER)
end
-- Check if it was a player kill
if not CombatLog_Object_IsA(dstFlags, self.COMBATLOG_PK) then
return
end
-- Initialize self.inBG if nil
if nil == self.zone then
self.zone = {
inBG = "pvp" == select(2, IsInInstance())
, inArena = "arena" == select(2, IsInInstance())
}
end
-- Check if we're disabled
if self.zone.inBG and not settings.InBattleGrounds
or self.zone.inArena and not settings.InArena then
return
end
-- Check if we're trying to match some name
if (settings.NameMatch or "") ~= ""
and not string.find(dstName, settings.NameMatch) then
return
end
TakeScreenshot()
elseif "ZONE_CHANGED_NEW_AREA" == event then
self.zone = self.zone or {}
self.zone.inBG = "pvp" == select(2, IsInInstance())
self.zone.inArena = "arena" == select(2, IsInInstance())
endFacts
- Date created
- 24 Nov 2008