Thread Tools Display Modes
01-10-10, 11:39 PM   #1
xenios
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Feb 2008
Posts: 13
LibHealComm-4.0 Intergration

I started playing again a week ago and I got tired of not seeing anyones heals as they have all moved away from RDX. So I updated the libHealComm integration, enjoy. It should work problem free. Replace all code in LibHealcomm_Integration.lua with the code below.

Code:
-- LibHealcomm_Integration.lua

--------------------------------------------------------------------
-- LibHealComm-4.0 Intergration
-- OpenRDX - Xenios
--------------------------------------------------------------------

local HealComm;
local HealMask;

local function InitAceHealComm()
	local RDXHealComm = {};
	
	function RDXHealComm:HealComm_HealStarted(event, casterGUID, spellID, healType, endTime, ...)
		self:UpdateHeals(casterGUID, healType, endTime, ...)
	end

	function RDXHealComm:HealComm_HealDelayed(event, casterGUID, spellID, healType, endTime, ...)
		self:UpdateHeals(casterGUID, healType, endTime, ...)
	end

	function RDXHealComm:HealComm_HealUpdated(event, casterGUID, spellID, healType, endTime, ...)
		self:UpdateHeals(casterGUID, healType, endTime, ...)
	end

	function RDXHealComm:HealComm_HealStopped(event, casterGUID, spellID, healType, endTime, ...)
		local origin = RDX.GetUnitByGuid(casterGUID);
		if (not origin) or (not origin:IsValid()) then return; end

		for i=1,select('#', ...) do
			local targetGUID = select(i, ...);
			local targetUnit = RDX.GetUnitByGuid(targetGUID);
			if targetUnit then
				targetUnit:_StopIncHeal(origin);
			end
		end
	end

	function RDXHealComm:UpdateHeals(casterGUID, healType, endTime, ...)
		local origin = RDX.GetUnitByGuid(casterGUID);
		if (not origin) or (not origin:IsValid()) then return; end
		
		for i=1,select('#', ...) do
			local targetGUID = select(i, ...);
			local targetUnit = RDX.GetUnitByGuid(targetGUID);
			local incoming=HealComm:GetHealAmount(targetGUID, HealMask, nil, casterGUID)
			if incoming and incoming > 0 then 
				local healSize = incoming * HealComm:GetHealModifier(targetGUID);
				if targetUnit then
					targetUnit:_AddIncHeal(origin, healSize, endTime, nil);
				end
			end
		end
	end

	HealComm.RegisterCallback(RDXHealComm, "HealComm_HealStarted");
	HealComm.RegisterCallback(RDXHealComm, "HealComm_HealDelayed");
	HealComm.RegisterCallback(RDXHealComm, "HealComm_HealUpdated");
	HealComm.RegisterCallback(RDXHealComm, "HealComm_HealStopped");
	RDX.print("LibHealComm-4.0 integration enabled.");
end

-----------------------------------------------------------
-- INIT
-----------------------------------------------------------
RDXEvents:Bind("INIT_POST_VARIABLES_LOADED", nil, function()
	if not LibStub then return; end
	HealComm = LibStub:GetLibrary("LibHealComm-4.0", true);
	HealMask=bit.bor(HealComm.BOMB_HEALS,HealComm.CASTED_HEALS)
	if (not HealComm) then return; end
	RDX.print(i18n("LibHealComm-4.0 integration activated."));
	InitAceHealComm();
end);
__________________
http://www.brethren-guild.org
  Reply With Quote
01-11-10, 02:24 AM   #2
unlimit
Lookin' Good
 
unlimit's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 484
Thank's a ton xenios!
__________________


kúdan: im playing pantheon
JRCapablanca: no youre not
** Pantheon has been Banned. **
  Reply With Quote

WoWInterface » Featured Projects » OpenRDX » OpenRDX Community » OpenRDX: Community Chat » LibHealComm-4.0 Intergration


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off