Code:
function DK_OnGossipTalk(pUnit, event, player, pMisc)
pUnit:CreateGossipMenu(100, player, 1)
pUnit:GossipMenuAddItem(0, "DK Gear!", 2, 0)
pUnit:GossipMenuAddItem(0, "DK Spells", 3, 0)
pUnit:RegisterEvent("DK_Class",1000,0)
pUnit:GossipSendMenu(player)
end
function DK_PlayerEnter(pUnit,Event)
pUnit:SendChatMessage(14, 0, Deathknight Equipment here!!")
end
function DK_Class(pUnit,Event)
Choice=math.random(1.10)
if Choice==1 then
if pUnit:GetPlayerClass() == 6 then
pUnit:SendChatMessage(12, 0, "Hello Deathknight")
end
if Choice==2 then
if pUnit:GetPlayerClass() == 1 then
pUnit:FullCastSpellOnTarget(5, pUnit:GetRandomPlayer(0))
pUnit:SendChatMessage(14, 0, "You are not a DeathKnight!!")
end
if Choice==3 then
if pUnit:GetPlayerClass() == 2 then
pUnit:FullCastSpellOnTarget(5, pUnit:GetRandomPlayer(0))
pUnit:SendChatMessage(14, 0, "You are not a DeathKnight!!")
end
if Choice==4 then
if pUnit:GetPlayerClass() == 3 then
pUnit:FullCastSpellOnTarget(5, pUnit:GetRandomPlayer(0))
pUnit:SendChatMessage(14, 0, "You are not a DeathKnight!!")
end
if Choice==5 then
if pUnit:GetPlayerClass() == 4 then
pUnit:FullCastSpellOnTarget(5, pUnit:GetRandomPlayer(0))
pUnit:SendChatMessage(14, 0, "You are not a DeathKnight!!")
end
if Choice==6 then
if pUnit:GetPlayerClass() == 5 then
pUnit:FullCastSpellOnTarget(5, pUnit:GetRandomPlayer(0))
pUnit:SendChatMessage(14, 0, "You are not a DeathKnight!!")
end
if Choice==7 then
if pUnit:GetPlayerClass() == 7 then
pUnit:FullCastSpellOnTarget(5, pUnit:GetRandomPlayer(0))
pUnit:SendChatMessage(14, 0, "You are not a DeathKnight!!")
end
if Choice==8 then
if pUnit:GetPlayerClass() == 8 then
pUnit:FullCastSpellOnTarget(5, pUnit:GetRandomPlayer(0))
pUnit:SendChatMessage(14, 0, "You are not a DeathKnight!!")
end
if Choice==9 then
if pUnit:GetPlayerClass() == 9 then
pUnit:FullCastSpellOnTarget(5, pUnit:GetRandomPlayer(0))
pUnit:SendChatMessage(14, 0," You are not a DeathKnight!!")
end
if Choice==10 then
if pUnit:GetPlayerClass() == 11 then
pUnit:FullCastSpellOnTarget(5, pUnit:GetRandomPlayer(0))
pUnit:SendChatMessage(14, 0, "You are not a DeathKnight!!")
end
end
function Music_OnGossipSelect(pUnit, event, player, id, intid, code, pMisc)
if (intid == 2) then
pUnit:AddItem(34648, 1)
pUnit:AddItem(34649, 1)
pUnit:AddItem(34650, 1)
pUnit:AddItem(34651, 1)
pUnit:AddItem(34652, 1)
pUnit:AddItem(34653, 1)
pUnit:AddItem(34655, 1)
pUnit:AddItem(34656, 1)
pUnit:AddItem(34659, 1)
end
if (intid == 3) then
pUnit:LearnSpell(42650)
pUnit:LearnSpell(51379)
pUnit:LearnSpell(49921)
pUnit:LearnSpell(51411)
pUnit:LearnSpell(55262)
pUnit:LearnSpell(55268)
pUnit:LearnSpell(49924)
pUnit:LearnSpell(49895)
pUnit:LearnSpell(49938)
pUnit:LearnSpell(51328)
pUnit:LearnSpell(49930)
pUnit:LearnSpell(51425)
pUnit:LearnSpell(55271)
pUnit:LearnSpell(57623)
pUnit:LearnSpell(50977)
pUnit:LearnSpell(48778)
end
end
RegisterUnitGossipEvent(234670, 1, "DK_OnGossipTalk")
RegisterUnitGossipEvent(234670, 2, "DK_OnGossipSelect")
RegisterUnitEvent(234670, 10, "DK_PlayerEnter")