/PartyHardy
local version = 0.11 |
local version = 0.13 |
if not PartyHardyDB then PartyHardyDB = {} end |
if not PartyHardyDB.whitelist then PartyHardyDB.whitelist = { [string.lower(UnitName("player"))] = true, } end |
SetLootMethod("group") |
elseif a == "!ml" and IsPartyLeader() and PartyHardyDB.whitelist[name] then |
SetLootMethod("master", UnitName("player")) |
elseif a == "!pl" and PartyHardyDB.whitelist[name] then |
if b == "on" then |
SetOptOutOfLoot(1) |
SendChatMessage("Passing loot: Yes.", "PARTY", (UnitFactionGroup("player") == "Horde" and "Orcish" or "Common")) |
elseif b == "off" then |
SetOptOutOfLoot(nil) |
SendChatMessage("Passing loot: No.", "PARTY", (UnitFactionGroup("player") == "Horde" and "Orcish" or "Common")) |
end |
elseif a == "!leader" and IsPartyLeader() and PartyHardyDB.whitelist[name] then |
PromoteToLeader(name) |
elseif a == "!invite" and IsPartyLeader() and PartyHardyDB.whitelist[name] then |
local function EndFollow(timed) |
if follow and PartyHardyDB.whitelist[follow] then |
SendAddonMessage("PARTYHARDYFOLLOWOFF", nil, "WHISPER", follow) |
SendAddonMessage("PHF_OFF", nil, "WHISPER", follow) |
PartyHardy:UnregisterEvent("AUTOFOLLOW_END") |
if timed then |
ChatFrame1:AddMessage(orange.."PartyHardy: "..follow.." is propably stuck.") |
end |
follow = nil |
end |
end |
AutoFollowStatus:SetScript("OnShow", function() |
if AutoFollowStatus.unit then |
follow = string.lower(AutoFollowStatus.unit) |
SendAddonMessage("PARTYHARDYFOLLOWON", nil, "WHISPER", follow) |
SendAddonMessage("PHF_ON", nil, "WHISPER", follow) |
end |
end) |
AutoFollowStatus:SetScript("OnHide", function() |
EndFollow(true) |
EndFollow() |
end) |
function PartyHardy:PLAYER_REGEN_ENABLED() |
SendAddonMessage("TNLWHISPER", GetXP(), "WHISPER", name) |
elseif prefix == "TNLWHISPER" then |
ChatFrame1:AddMessage(name..": "..message) |
elseif prefix == "PARTYHARDYFOLLOWON" then |
elseif prefix == "PHF_ON" then |
ChatFrame1:AddMessage(orange.."PartyHardy: "..name.." is following you.") |
elseif prefix == "PARTYHARDYFOLLOWOFF" then |
elseif prefix == "PHF_OFF" then |
ChatFrame1:AddMessage(orange.."PartyHardy: "..name.." is no longer following you.") |
end |
end |