mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-09 23:20:00 +00:00
api: use dynamic shortcut for string.gfind
This commit is contained in:
+10
-10
@@ -192,61 +192,61 @@ libcast:SetScript("OnEvent", function()
|
||||
-- Fill database with environmental casts
|
||||
elseif arg1 then
|
||||
-- (.+) begins to cast (.+).
|
||||
for mob, spell in string.gfind(arg1, libcast.SPELL_CAST) do
|
||||
for mob, spell in gfind(arg1, libcast.SPELL_CAST) do
|
||||
libcast:AddAction(mob, spell)
|
||||
return
|
||||
end
|
||||
|
||||
-- (.+) begins to perform (.+).
|
||||
for mob, spell in string.gfind(arg1, libcast.SPELL_PERFORM) do
|
||||
for mob, spell in gfind(arg1, libcast.SPELL_PERFORM) do
|
||||
libcast:AddAction(mob, spell)
|
||||
return
|
||||
end
|
||||
|
||||
-- (.+) gains (.+).
|
||||
for mob, spell in string.gfind(arg1, libcast.SPELL_GAINS) do
|
||||
for mob, spell in gfind(arg1, libcast.SPELL_GAINS) do
|
||||
libcast:RemoveAction(mob, spell)
|
||||
return
|
||||
end
|
||||
|
||||
-- (.+) is afflicted by (.+).
|
||||
for mob, spell in string.gfind(arg1, libcast.SPELL_AFFLICTED) do
|
||||
for mob, spell in gfind(arg1, libcast.SPELL_AFFLICTED) do
|
||||
libcast:RemoveAction(mob, spell)
|
||||
return
|
||||
end
|
||||
|
||||
-- Your (.+) hits (.+) for (%d+).
|
||||
for spell, mob in string.gfind(arg1, libcast.SPELL_HIT) do
|
||||
for spell, mob in gfind(arg1, libcast.SPELL_HIT) do
|
||||
libcast:RemoveAction(mob, spell)
|
||||
return
|
||||
end
|
||||
|
||||
-- Your (.+) crits (.+) for (%d+).
|
||||
for spell, mob in string.gfind(arg1, libcast.SPELL_CRIT) do
|
||||
for spell, mob in gfind(arg1, libcast.SPELL_CRIT) do
|
||||
libcast:RemoveAction(mob, spell)
|
||||
return
|
||||
end
|
||||
|
||||
-- (.+)'s (.+) %a hits (.+) for (%d+).
|
||||
for _, spell, mob in string.gfind(arg1, libcast.OTHER_SPELL_HIT) do
|
||||
for _, spell, mob in gfind(arg1, libcast.OTHER_SPELL_HIT) do
|
||||
libcast:RemoveAction(mob, spell)
|
||||
return
|
||||
end
|
||||
|
||||
-- (.+)'s (.+) %a crits (.+) for (%d+).
|
||||
for _, spell, mob in string.gfind(arg1, libcast.OTHER_SPELL_CRIT) do
|
||||
for _, spell, mob in gfind(arg1, libcast.OTHER_SPELL_CRIT) do
|
||||
libcast:RemoveAction(mob, spell)
|
||||
return
|
||||
end
|
||||
|
||||
-- You interrupt (.+)'s (.+).";
|
||||
for mob, spell in string.gfind(arg1, libcast.SPELL_INTERRUPT) do
|
||||
for mob, spell in gfind(arg1, libcast.SPELL_INTERRUPT) do
|
||||
libcast:RemoveAction(mob, "INTERRUPT")
|
||||
return
|
||||
end
|
||||
|
||||
-- (.+) interrupts (.+)'s (.+).
|
||||
for _, mob, spell in string.gfind(arg1, libcast.OTHER_SPELL_INTERRUPT) do
|
||||
for _, mob, spell in gfind(arg1, libcast.OTHER_SPELL_INTERRUPT) do
|
||||
libcast:RemoveAction(mob, "INTERRUPT")
|
||||
return
|
||||
end
|
||||
|
||||
+3
-3
@@ -179,7 +179,7 @@ libdebuff.pending = {}
|
||||
libdebuff:SetScript("OnEvent", function()
|
||||
-- Add Combat Log
|
||||
if event == "CHAT_MSG_SPELL_PERIODIC_HOSTILEPLAYER_DAMAGE" or event == "CHAT_MSG_SPELL_PERIODIC_CREATURE_DAMAGE" then
|
||||
for unit, effect in string.gfind(arg1, libdebuff.combatlog) do
|
||||
for unit, effect in gfind(arg1, libdebuff.combatlog) do
|
||||
local unitlevel = UnitName("target") == unit and UnitLevel("target") or 0
|
||||
|
||||
if not libdebuff.objects[unit] or not libdebuff.objects[unit][unitlevel] or not libdebuff.objects[unit][unitlevel][effect] then
|
||||
@@ -203,7 +203,7 @@ libdebuff:SetScript("OnEvent", function()
|
||||
elseif event == "CHAT_MSG_SPELL_FAILED_LOCALPLAYER" or event == "CHAT_MSG_SPELL_SELF_DAMAGE" then
|
||||
-- Persist pending Spell
|
||||
for _, msg in pairs(libdebuff.pp) do
|
||||
for effect, _ in string.gfind(arg1, msg) do
|
||||
for effect, _ in gfind(arg1, msg) do
|
||||
libdebuff:PersistPending(effect)
|
||||
return
|
||||
end
|
||||
@@ -211,7 +211,7 @@ libdebuff:SetScript("OnEvent", function()
|
||||
|
||||
-- Remove pending spell
|
||||
for _, msg in pairs(libdebuff.rp) do
|
||||
for effect, _ in string.gfind(arg1, msg) do
|
||||
for effect, _ in gfind(arg1, msg) do
|
||||
libdebuff:RemovePending(effect)
|
||||
return
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user