I run an private server using ArcEmu so the scripts i write are in Lua.I wanted to script a Death Knight (16146 ID) so he can do my spells:
Code:
function DeathKnight_OnCombat(Unit, Event)
Unit:SendChatMessage(12, 7, "We will destroy Stormwind and everyone that stand in our way!")
Unit:RegisterEvent("DeathKnight_Spell1", 5000, 1)
end
function DeathKnight_Spell1(Unit, Event)
Unit:FullCastSpellOnTarget(51425, Unit:GetRandomPlayer(0))
end
function DeathKnight_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
function DeathKnight_OnKilledTarget(Unit, Event)
Unit:SendChat Message(12, 7, "Another win for the Scourge!")
end
function DeathKnight_OnDied(Unit, Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(16146, 1, "DeathKnight_OnCombat")
RegisterUnitEvent(16146, 2, "DeathKnight_Spell1")
RegisterUnitEvent(16146, 3, "DeathKnight_OnLeaveCombat")
RegisterUnitEvent(16146, 4, "DeathKnight_OnKilledTarget")
RegisterUnitEvent(16146, 5, "DeathKnight_OnDied")
i think i scripted them very good. Isaved the DeathKnight.lua (using notepad++) in scripts folder. But when i try to fight them to test the script their are using the old naxx scripting spells(blood aura death coil and all those kind of stuffs instead of my spell(s).What can i do to make them cast my spell? Please help.