local function OnSpellCast(_, player, spell, _)
local reagents = spell:GetReagentCost()
player:SendBroadcastMessage("You just cast " .. spell:GetEntry() .. " with the following reagents:")
for reagent, count in pairs(reagents) do
player:SendBroadcastMessage(string.format("%d x %s", count, reagent:GetName()))
end
return false
end
RegisterPlayerEvent(PLAYER_EVENT_ON_SPELL_CAST, OnSpellCast)
Returns a table containing the reagent cost of the spell in the format
Example usage: