⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ct_radebuffs.lua

📁 时间太紧了
💻 LUA
📖 第 1 页 / 共 3 页
字号:
CT_RA_DebuffOptions = { };
CT_RADebuff_CureTable = { [1] = { } };
CT_RADebuff_ActionButtons = { };
CT_RADebuff_NamePriorities = { };
CT_RADebuff_CureSpells = {
	[CT_RA_PRIEST] = { [CT_RA_MAGIC] = CT_RA_DISPELMAGIC, [CT_RA_DISEASE] = { CT_RA_CUREDISEASE, CT_RA_ABOLISHDISEASE } },
	[CT_RA_SHAMAN] = { [CT_RA_DISEASE] = CT_RA_CUREDISEASE, [CT_RA_POISON] = CT_RA_CUREPOISON },
	[CT_RA_DRUID] = { [CT_RA_CURSE] = CT_RA_REMOVECURSE, [CT_RA_POISON] = { CT_RA_CUREPOISON, CT_RA_ABOLISHPOISON } },
	[CT_RA_MAGE] = { [CT_RA_CURSE] = CT_RA_REMOVELESSERCURSE },
	[CT_RA_PALADIN] = { [CT_RA_MAGIC] = CT_RA_CLEANSE, [CT_RA_POISON] = { CT_RA_PURIFY, CT_RA_CLEANSE }, [CT_RA_DISEASE] = { CT_RA_PURIFY, CT_RA_CLEANSE } }
};
CT_RADebuff_IgnoreDebuffs = {
	[CT_RA_DREAMLESSSLEEP] = 1,
	[CT_RA_GREATERDREAMLESSSLEEP] = 1,
	[CT_RA_MINDVISION] = 1
};
CT_RA_DebuffTemplates = {
	[1] = {
		["debuffName"] = "灵魂燃烧",
		["name"] = "灵魂燃烧",
		["debuffDesc"] = ".*",
		["cureOrder"] = {
			[1] = 1,
			[2] = 8,
			[3] = 15,
			[4] = 16,
			[5] = 17,
			[6] = 10,
			[7] = 11,
			[8] = 12,
			[9] = 14,
			[10] = 9,
			[11] = 13,
			[12] = 5,
			[13] = 6,
			[14] = 7,
		},
		["affectClasses"] = {
			["战士"] = 1,
			["圣骑士"] = 1,
			["萨满祭司"] = 1,
			["盗贼"] = 1,
			["法师"] = 1,
			["宠物"] = 1,
			["德鲁伊"] = 1,
			["牧师"] = 1,
			["猎人"] = 1,
			["术士"] = 1,
		},
		["debuffType"] = ".*",
	},
	[2] = {
		["debuffName"] = "卡扎克印记",
		["name"] = "卡扎克印记",
		["debuffDesc"] = ".*",
		["cureOrder"] = {
			[1] = 1,
			[2] = 2,
			[3] = 3,
			[4] = 4,
			[5] = 5,
			[6] = 6,
			[7] = 7,
		},
		["affectClasses"] = {
			["圣骑士"] = 1,
			["萨满祭司"] = 1,
			["法师"] = 1,
			["宠物"] = 1,
			["德鲁伊"] = 1,
			["牧师"] = 1,
			["猎人"] = 1,
			["术士"] = 1,
		},
		["debuffType"] = ".*",
	},
	[3] = {
		["debuffName"] = "扭曲反射",
		["name"] = "扭曲反射",
		["debuffDesc"] = ".*",
		["cureOrder"] = {
			[1] = 1,
			[2] = 2,
			[3] = 3,
			[4] = 4,
			[5] = 5,
			[6] = 6,
			[7] = 7,
		},
		["affectClasses"] = {
			["战士"] = 1,
			["圣骑士"] = 1,
			["萨满祭司"] = 1,
			["盗贼"] = 1,
			["法师"] = 1,
			["宠物"] = 1,
			["德鲁伊"] = 1,
			["牧师"] = 1,
			["猎人"] = 1,
			["术士"] = 1,
		},
		["debuffType"] = ".*",
	},
	[4] = {
		["debuffName"] = "统御意志",
		["name"] = "统御意志",
		["debuffDesc"] = ".*",
		["cureOrder"] = {
			[1] = 8,
			[2] = 9,
			[3] = 1,
			[4] = 2,
			[5] = 3,
			[6] = 4,
			[7] = 5,
			[8] = 6,
			[9] = 7,
		},
		["affectClasses"] = {
			["战士"] = 1,
			["圣骑士"] = 1,
			["萨满祭司"] = 1,
			["盗贼"] = 1,
			["法师"] = 1,
			["宠物"] = 1,
			["德鲁伊"] = 1,
			["牧师"] = 1,
			["猎人"] = 1,
			["术士"] = 1,
		},
		["debuffType"] = ".*",
	},
	[5] = {
		["debuffName"] = "引燃法力",
		["name"] = "引燃法力",
		["debuffDesc"] = ".*",
		["cureOrder"] = {
			[1] = 1,
			[2] = 2,
			[3] = 3,
			[4] = 4,
			[5] = 5,
			[6] = 7,
			[7] = 6,
			[8] = 8,
		},
		["affectClasses"] = {
			["圣骑士"] = 1,
			["萨满祭司"] = 1,
			["法师"] = 1,
			["宠物"] = 1,
			["德鲁伊"] = 1,
			["牧师"] = 1,
			["猎人"] = 1,
			["术士"] = 1,
		},
		["debuffType"] = ".*",
	},
	[6] = {
		["debuffName"] = "心灵控制",
		["name"] = "心灵控制",
		["debuffDesc"] = ".*",
		["cureOrder"] = {
			[1] = 1,
			[2] = 2,
			[3] = 3,
			[4] = 4,
			[5] = 5,
			[6] = 6,
			[7] = 7,
		},
		["affectClasses"] = {
			["战士"] = 1,
			["圣骑士"] = 1,
			["萨满祭司"] = 1,
			["盗贼"] = 1,
			["法师"] = 1,
			["宠物"] = 1,
			["德鲁伊"] = 1,
			["牧师"] = 1,
			["猎人"] = 1,
			["术士"] = 1,
		},
		["debuffType"] = ".*",
	},
	[7] = {
		["debuffName"] = ".*",
		["name"] = "沉默施法",
		["debuffDesc"] = ".*无法施法*",
		["cureOrder"] = {
			[1] = 1,
			[2] = 2,
			[3] = 3,
			[4] = 4,
			[5] = 5,
			[6] = 6,
			[7] = 7,
		},
		["affectClasses"] = {
			["战士"] = 1,
			["圣骑士"] = 1,
			["萨满祭司"] = 1,
			["法师"] = 1,
			["宠物"] = 1,
			["德鲁伊"] = 1,
			["牧师"] = 1,
			["猎人"] = 1,
			["术士"] = 1,
		},
		["debuffType"] = ".*",
	},
	[8] = {
		["debuffName"] = ".*变形术*",
		["name"] = "变形术",
		["debuffDesc"] = ".*",
		["cureOrder"] = {
			[1] = 1,
			[2] = 2,
			[3] = 3,
			[4] = 4,
			[5] = 5,
			[6] = 6,
			[7] = 7,
		},
		["affectClasses"] = {
			["战士"] = 1,
			["圣骑士"] = 1,
			["萨满祭司"] = 1,
			["盗贼"] = 1,
			["法师"] = 1,
			["宠物"] = 1,
			["德鲁伊"] = 1,
			["牧师"] = 1,
			["猎人"] = 1,
			["术士"] = 1,
		},
		["debuffType"] = ".*",
	},
	[9] = {
		["debuffName"] = ".*",
		["name"] = "所有法术",
		["debuffDesc"] = ".*",
		["cureOrder"] = {
			[1] = 1,
			[2] = 2,
			[3] = 3,
			[4] = 8,
			[5] = 4,
			[6] = 5,
			[7] = 6,
			[8] = 7,
		},
		["affectClasses"] = {
			["战士"] = 1,
			["圣骑士"] = 1,
			["萨满祭司"] = 1,
			["盗贼"] = 1,
			["法师"] = 1,
			["宠物"] = 1,
			["德鲁伊"] = 1,
			["牧师"] = 1,
			["猎人"] = 1,
			["术士"] = 1,
		},
		["debuffType"] = ".*",
	},
}
CT_RADebuff_ClassIndexes = {
	[CT_RA_WARRIOR] = 1,
	[CT_RA_DRUID] = 2,
	[CT_RA_MAGE] = 3,
	[CT_RA_WARLOCK] = 4,
	[CT_RA_ROGUE] = 5,
	[CT_RA_HUNTER] = 6,
	[CT_RA_PRIEST] = 7,
	[CT_RA_PALADIN] = 8,
	[CT_RA_SHAMAN] = 9
};
-- Thanks to the author of Decursive for the blacklist idea
CT_RADebuff_Blacklist = { };
CT_RADebuff_BlacklistTime = 3;
CT_RADebuff_Debug = 1;

----------------------------------------------------------------
--                 CT_RADebuff_DebugMsg(msg)                  --
--        Prints a message if the debug flag is enabled.      --
----------------------------------------------------------------

function CT_RADebuff_DebugMsg(msg)
	if ( CT_RADebuff_Debug ) then
		CT_Print(msg);
	end
end

----------------------------------------------------------------
--           CT_RADebuff_ProcessBlacklist(elapsed)            --
--        Processes the blacklist, removing people when       --
--          they have been in there for three seconds.        --
----------------------------------------------------------------

function CT_RADebuff_ProcessBlacklist(elapsed)
	for k, v in CT_RADebuff_Blacklist do
		CT_RADebuff_Blacklist[k] = v - elapsed;
		if ( CT_RADebuff_Blacklist[k] <= 0 ) then
			CT_RADebuff_Blacklist[k] = nil;
		end
	end
	if ( CT_RADebuff_ResetCombat ) then
		CT_RADebuff_ResetCombat = CT_RADebuff_ResetCombat - elapsed;
		if ( CT_RADebuff_ResetCombat <= 0 ) then
			CT_RADebuff_ResetCombat = nil;
			if ( not CT_RADebuff_InCombat ) then
				AttackTarget();
			end
		end
	end
end

----------------------------------------------------------------
--                CT_RADebuff_UpdateCureTable()                --
--          Updates the table holding all the debuffs.         --
----------------------------------------------------------------

function CT_RADebuff_UpdateCureTable()
	CT_RADebuff_CureTable = { };
	if ( UnitExists("target") and ( UnitCanAttack("player", "target") or ( not UnitInRaid("target") and not UnitInParty("target") ) ) ) then
		local useBuffs = UnitDebuff;
		if ( UnitCanAttack("player", "target") and ( not UnitIsCharmed("target") or not UnitIsFriend("player", "target") ) ) then
			useBuffs = UnitBuff;
		end
		local iIndex = 1;
		-- Loop through the debuffs
		while ( useBuffs("target", iIndex) ) do
			-- Clear and set the tooltip
			CT_RATooltipTextLeft1:SetText("");
			CT_RATooltipTextRight1:SetText("");
			CT_RATooltip:SetOwner(WorldFrame, "ANCHOR_NONE");
			if ( useBuffs == UnitBuff ) then
				CT_RATooltip:SetUnitBuff("target", iIndex);
			else
				CT_RATooltip:SetUnitDebuff("target", iIndex);
			end
			-- Control to make sure we have a new debuff
			if ( CT_RATooltipTextLeft1:GetText() ~= "" ) then
			
				-- Fetch the data
				local sName, sType, sDesc, iTblIndex = CT_RATooltipTextLeft1:GetText() or "", CT_RATooltipTextRight1:GetText() or "", CT_RATooltipTextLeft2:GetText() or "", -1;
				if ( sType ~= "" and CT_RADebuff_CanCure(sType) and not CT_RADebuff_IgnoreDebuffs[(sName or "")] ) then
					-- See if we can find the CT_RA_DebuffTemplates index
					for k, v in CT_RA_DebuffTemplates do
					
						-- See if we have a match
						if ( string.find(strlower(sName), strlower(v["debuffName"])) and string.find(strlower(sType), strlower(v["debuffType"])) and string.find(strlower(sDesc), strlower(v["debuffDesc"])) ) then
							iTblIndex = k;
							break;
						end
					end
					
					if ( iTblIndex > 0 and ( not CT_RADebuff_CureTable[2] or CT_RADebuff_CureTable[2] > iTblIndex ) ) then
						-- Clean the table
						CT_RADebuff_CureTable = {
							[1] = {
								{ sName, sType, sDesc, "target", CT_RADebuff_ClassIndexes[UnitClass("target")], UnitHealth("target") }
							},
							[2] = iTblIndex
						};
						
					elseif ( iTblIndex > 0 and iTblIndex == CT_RADebuff_CureTable[2] ) then
						-- Add the data to the table, as well as class, health percentage, if the player is in your party or if the player is you
						tinsert(CT_RADebuff_CureTable[1], { sName, sType, sDesc, "target", CT_RADebuff_ClassIndexes[UnitClass("target")], UnitHealth("target") });
						
					end
				end
			end
			
			iIndex = iIndex + 1;
			
		end
	end
	if ( GetNumRaidMembers() == 0 ) then
		local iIndex = 1;
		
		-- Loop through the debuffs

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -