All pastes #166036 Raw Edit

Stuff

public lua v1 · immutable
·published 2006-09-10 14:13 UTC
rendered paste body
local healBonusText = {	"Increases healing done by spells and effects by up to (%d+%.?%d*)%.",	"Increases damage and healing done by magical spells and effects by up to (%d+%.?%d*)%.",	"Healing and Spell Damage [+](%d+)",	"Healing Spells [+](%d+)",	"+(%d+) Healing Spells"}function SquishyHealer:UpdateSpells()	spells.HealAmount = {}	spells.HealAmount["Flash Heal"] = {270, 350, 440, 500, 660, 840, 1020}	spells.HealAmount["Heal"] = {365, 520, 690, 860}	spells.HealAmount["Greater Heal"] = {1150, 1430, 1760, 2140, 2330}	spells.HealAmount["Healing Touch"] = {51, 112, 243, 445, 694, 894, 1120, 1427, 1796, 2230, 2676}	spells.HealAmount["Lesser Healing Wave"] = {186, 281, 381, 514, 705, 928}	spells.HealAmount["Flash of Light"] = {75, 115, 175, 225, 310, 400}	spells.HealAmount["Holy Light"] = {35, 93, 190, 370, 580, 820, 1120, 1480, 1880} --no real rank1?	spells.Duration = {}	spells.Duration["Flash Heal"] = 1.5	spells.Duration["Heal"] = 2.5	spells.Duration["Greater Heal"] = 2.5	spells.Duration["Healing Touch"] = 3	spells.Duration["Lesser Healing Wave"] = 1.5	spells.Duration["Flash of Light"] = 1.5	spells.Duration["Holy Light"] = 2.5	local totalbonus = 0	local scannedSet = false	for i = 1, 15 do		getglobal("SquishyHealer_TooltipTextLeft" .. i):SetText()		getglobal("SquishyHealer_TooltipTextRight" .. i):SetText()	end	for slot = 1, 20 do		if (SquishyHealer_Tooltip:SetInventoryItem("player", slot)) then			for key, healtext in healBonusText do				for line = 2, SquishyHealer_Tooltip:NumLines() do					if getglobal("SquishyHealer_TooltipTextLeft"..line):GetText() then						local itemtext = getglobal("SquishyHealer_TooltipTextLeft"..line):GetText()						local _, _, bonus = string.find(itemtext, healtext)						if bonus then 							if string.find(itemtext, "Set:") then								if not scannedSet then									totalbonus = totalbonus + bonus								else									scannedSet = true								end							else								totalbonus = totalbonus + bonus							end						end					end				end			end		end	end	for spell in spells.HealAmount do		local actualhealbonus = totalbonus * spells.Duration[spell] / 3.5		for rank in spells.HealAmount[spell] do			if spells.HealAmount[spell][rank] > 370 then --easier than checking for rank20				spells.HealAmount[spell][rank] = ( spells.HealAmount[spell][rank] + actualhealbonus ) * 1.10			end		end	end	-- check for max ranks available	for _, spell in healTypes[playerClass] do		spells.NumRanks[spell] = self:GetMaxRank(spell)		spells.MaxRankSpellString[spell] = spell .. "(Rank " .. spells.NumRanks[spell] .. ")"	end	-- XXX fix that, not nice	spells.NumRanks["Heal"] = self:GetMaxRank("Heal")	spells.MaxRankSpellString["Heal"] = "Heal" .. "(Rank " .. spells.NumRanks["Heal"] .. ")"end