Here's a Lua script to do it. (Delete the ai_agent)
Code:
local NPCID = 50 -- the id of the npc you want to cast the spell
local FrostBolt = 42842 -- the id of the spell 'frostbolt'
local Timer = 3000 -- The time between each cast (3000 = 3 seconds)
function trash_Combat(pUnit, Event)
pUnit:Root()
pUnit:FullCastSpellOnTarget(FrostBolt, pUnit:GetClosestPlayer())
pUnit:RegisterEvent("Wrath_Spam_Ftw", Timer, 0)
end
function Wrath_Spam_Ftw(pUnit, Event)
pUnit:FullCastSpellOnTarget(FrostBolt, pUnit:GetClosestPlayer())
end
function trash_LeaveCombat(pUnit, Event)
pUnit:RemoveEvents()
end
function trash_Died(pUnit, Event)
pUnit:RemoveEvents()
end
RegisterUnitEvent(NPCID, 1, "trash_Combat")
RegisterUnitEvent(NPCID, 2, "trash_LeaveCombat")
RegisterUnitEvent(NPCID, 4, "trash_Died")