WoWInterface SVN AutoReply

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 15 to Rev 14
    Reverse comparison

Rev 15 → Rev 14

trunk/AutoReply.toc
1,7 → 1,7
## Interface: 40300
## Author: Animor
## Title: Animor's AutoReply
## Version: 0.9.04
## Version: 0.9.03
## Notes: Auto reply whispers in specific combat related situations.
## OptionalDeps: Ace3, Recount, LibDataBroker-1.1
## X-Embeds: Ace3, LibDataBroker-1.1
trunk/BossFight.lua
60,19 → 60,6
end
end
 
-------------------------------------------------
-- Boss engage event - check for start/kill/wipe
-------------------------------------------------
function AutoReply:INSTANCE_ENCOUNTER_ENGAGE_UNIT()
if self.db.profile.raidEn or self.db.profile.dungeonEn then
if not self.bossEngaged then
self:CheckBossFightStart()
else
self:CheckBossKill("INSTANCE_ENCOUNTER_ENGAGE_UNIT")
end
end
end
 
----------------------------------------
-- Check if boss fight started
----------------------------------------
83,6 → 70,7
-- self:Print("boss fight start")
self.bossEngaged = true
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
self:RegisterEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT", "CheckBossKill")
self:RegisterEvent("CHAT_MSG_MONSTER_YELL", "CheckBossKill")
self:RegisterEvent("CHAT_MSG_MONSTER_EMOTE", "CheckBossKill")
self:RegisterEvent("RAID_BOSS_EMOTE", "CheckBossKill")
128,6 → 116,7
self.bossID = nil
self.bossName = "Unknown"
self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
self:UnregisterEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT")
self:UnregisterEvent("CHAT_MSG_MONSTER_YELL")
self:UnregisterEvent("CHAT_MSG_MONSTER_EMOTE")
self:UnregisterEvent("RAID_BOSS_EMOTE")
187,7 → 176,7
end
end
 
return allBossesDead, bossFound
return allBossesDead
end
 
----------------------------------------
195,10 → 184,10
----------------------------------------
function AutoReply:CheckBossKill(eventname)
-- self:Print(eventname)
if self.bossEngaged and (not UnitAffectingCombat("player")) and (self.db.profile.raidEn or self.db.profile.dungeonEn) then
if self.bossEngaged and (self.db.profile.raidEn or self.db.profile.dungeonEn) then
-- self:Print("CheckBossKill")
local allBossesDead, bossFound = self:AllBossesDead()
if allBossesDead or (self:GroupSurvived() and not bossFound) then
-- if self:AllBossesDead() or self:GroupSurvived() then
if self:AllBossesDead() then
-- self:Print("boss fight: kill")
self.numKilledBosses = self.numKilledBosses + 1
self:ReplyAllMissedBoss("kill")
225,19 → 214,24
-- Check if group is alive
----------------------------------------
function AutoReply:GroupSurvived()
if not IsInInstance() then return false end -- Do not check if player is not in instance (return false).
local playerInInstance = IsInInstance()
local posX, posY = nil
local playerSurvived = false
local unitId = ((GetNumRaidMembers() == 0) and "party") or "raid"
SetMapToCurrentZone() -- Sets the current world map continent and zone to be the zone the player is currently in.
for i = 0, math.max(GetNumRaidMembers(), GetNumPartyMembers()) do
local id = (i == 0 and "player") or unitId..i
-- Check if player is out of combat and didn't use any feign death ability to reset the boss.
-- Check in addition if player is in 100 yard range.
if UnitIsVisible(id) and not (UnitAffectingCombat(id) or UnitIsDeadOrGhost(id) or UnitIsFeignDeath(id) or
if not (UnitAffectingCombat(id) or UnitIsDeadOrGhost(id) or UnitIsFeignDeath(id) or
UnitAura(id, "Vanish") or UnitAura(id, "Invisibility") or UnitAura(id, "Shadowmeld")) then
-- self:Print(UnitName(id))
return true
-- Check if player is in the instance
posX, posY = GetPlayerMapPosition(id)
if (posX ~= 0 and posY ~= 0 and playerInInstance) or (posX == 0 and posY == 0 and not playerInInstance) then
playerSurvived = true
end
end
end
return false
return playerSurvived
end
 
---------------------------------------------
trunk/Core.lua
698,13 → 698,8
-- Get initial dungeon progress
----------------------------------------
function AutoReply:LFG_PROPOSAL_SHOW()
local _, id, _, _, instanceName, _, _, _, _, completedEncounters = GetLFGProposal()
local _, _, _, _, _, _, _, _, totalEncounters, completedEncounters = GetLFGProposal()
self.numKilledBosses = completedEncounters
if id == 416 or id == 417 then -- Siege of Wyrmrest Temple or Fall of Deathwing
self.locationName = "Dragon Soul"
else
self.locationName = instanceName
end
end
 
--======================================
794,7 → 789,7
 
-- Send to missed senders list
for sender in pairs(self.missedSenders) do
if type(sender) == "number" or IsInInstance() or not sender:find("-") then -- Do not reply cross-realm whisperes when out of instance
if IsInInstance() or not sender:find("-") then -- Do not reply cross-realm whisperes when out of instance
self:SendReply(replyMsg, sender)
end
end
947,7 → 942,6
self:RegisterEvent("CHAT_MSG_BN_WHISPER")
self:RegisterEvent("LFG_PROPOSAL_SHOW")
self:RegisterEvent("PLAYER_REGEN_DISABLED")
self:RegisterEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT")
self:RegisterEvent("PLAYER_REGEN_ENABLED")
self:RegisterEvent("ZONE_CHANGED_NEW_AREA")
self:RegisterEvent("PLAYER_LOGOUT")
960,7 → 954,6
self:UnregisterEvent("CHAT_MSG_BN_WHISPER")
self:UnregisterEvent("LFG_PROPOSAL_SHOW")
self:UnregisterEvent("PLAYER_REGEN_DISABLED")
self:UnregisterEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT")
self:UnregisterEvent("PLAYER_REGEN_ENABLED")
self:UnregisterEvent("ZONE_CHANGED_NEW_AREA")
self:UnregisterEvent("PLAYER_LOGOUT")