Skip to content

Listen Combat Logs

ρMain edited this page Feb 27, 2018 · 7 revisions

Want to listen combat logs?

It can be simply done calling the function below. Specifiate a spell array you want to listen and the function put as callback gonna be called each time one of these spells are casted in the world map

  • Callback prototype: function(event, type, srcName, targetGuid, targetName, spellId, object, pos);
function ListenSpellsAndThen(spellArray, filters, enabled, callback);

-- Naive Example
-- This function holds a callback in a shared table
-- This callback is gonna Charge a rogue when he tries to be stealth
ListenSpellsAndThen({RogueSpells.VANISH, RogueSpells.STEALTH}, nil, true, -- true to enable the feature
	function(event, type, srcName, targetGuid, targetName, spellId, object, x, y, z)
                if type ~= "SPELL_CAST_SUCCESS" then return end -- check if the cast did not fail

		CastSpellByID(WarriorSpells.CHARGE, object)
	end
)

Clone this wiki locally