Code:
local MSkillNPC = 4 -- Actual Entry goes here
local plr
function OnSpawn_Define(pUnit,event)
MSN = pUnit -- MSN = Missing Skill NPC
end
RegisterUnitEvent(MSkillNPC,18,"OnSpawn_Define")
function MSN_Gossip(pUnit, event, player)
MSN:GossipCreateMenu(10, player, 0)
MSN:GossipMenuAddItem(0, "Welcome to *******'s
Missing Skill NPC V 4.6 made by AngelSandy", 1, 0)
MSN:GossipMenuAddItem(0, "Please pick your Class
and/or Race below, should you miss any skills.", 2, 0)
MSN:GossipMenuAddItem(3, "Hunter", 3, 0)
MSN:GossipMenuAddItem(3, "Warrior", 4, 0)
MSN:GossipMenuAddItem(3, "Warlock", 5, 0)
MSN:GossipMenuAddItem(3, "Mage", 6, 0)
MSN:GossipMenuAddItem(3, "Paladin", 7, 0)
MSN:GossipMenuAddItem(3, "Rogue", 8, 0)
MSN:GossipMenuAddItem(3, "Priest", 9, 0)
MSN:GossipMenuAddItem(3, "Druid", 10, 0)
MSN:GossipMenuAddItem(3, "Death Knight", 11, 0)
MSN:GossipMenuAddItem(3, "Shaman", 12,0)
MSN:GossipSendMenu(player)
end
function MSN_Select(pUnit, event, player, id, intid, Code)
plr = player:GetClosestPlayer()
if(intid == 3) and player:GetPlayerClass() == 3 then -- Hunter
plr:LearnSpell(1515) -- Tame Beast
plr:LearnSpell(6991) -- Feed Pet
plr:LearnSpell(2641) -- Dismiss Pet
plr:LearnSpell(883) -- Call Pet
plr:LearnSpell(928) -- Revive Pet
plr:GossipComplete()
else
player:SendAreaTriggerMessage("Your are not a Hunter.")
end
if(intid == 4) and player:GetPlayerClass() == 4 then -- Warrior
plr:LearnSpell(71) -- Defensive Stance
plr:LearnSpell(7386) -- Sunder Armor
plr:LearnSpell(355) -- Taunt
plr:LearnSpell(2458) -- Berserker Stance
plr:LearnSpell(2457) -- Battle Stance
plr:GossipComplete()
else
player:SendAreaTriggerMessage("Your are not a Warrior")
end
if(intid == 5) and player:GetPlayerClass() == 5 then -- Warlock
plr:LearnSpell(688) -- Imp
plr:LearnSpell(697) -- Voidwalker
plr:LearnSpell(712) -- Succubus
plr:LearnSpell(691) -- Felhunter
plr:GossipComplete()
else
player:SendAreaTriggerMessage("Your are not a Warlock")
end
if(intid == 6) and player:GetPlayerClass() == 6 then -- Mage
plr:LearnSpell(28272) -- Polymorph (Pig)
plr:LearnSpell(53140) -- Teleport: Dalaran
plr:GossipComplete()
else
player:SendAreaTriggerMessage("Your are not a Mage")
end
if(intid == 7) then and player:GetPlayerClass() == 7 -- Paladin
plr:LearnSpell(7328) -- Redemption Rank 1
plr:GossipComplete()
else
player:SendAreaTriggerMessage("Your are not a Paladin")
end
if(intid == 8) and player:GetPlayerClass() == 8 then -- Rogue
MSN:SendChatMessage(14, 0, "A Rogue you say? I
don't have anything to teach you. Already know it all!")
plr:GossipComplete()
else
player:SendAreaTriggerMessage("Your are not a Rogue")
end
if(intid == 9) and player:GetPlayerClass() == 9 then -- Priest
MSN:SendChatMessage(14, 0, "A Rogue you say? I
don't have anything to teach you. Already know it all!")
plr:GossipComplete()
else
player:SendAreaTriggerMessage("Your are not a Priest")
end
if(intid == 10) and player:GetPlayerClass() == 10 then -- Druid
plr:LearnSpell(5487) -- Bearform
plr:LearnSpell(6795) -- Growl
plr:LearnSpell(6807) -- Maul
plr:LearnSpell(1066) -- Aquatic Form
plr:LearnSpell(8946) -- Cure Poison
plr:LearnSpell(40120) -- Swift Flight Form
plr:GossipComplete()
else
player:SendAreaTriggerMessage("Your are not a Druid")
end
if(intid == 11) and player:GetPlayerClass() == 11 then -- Death
Knight
plr:LearnSpell(48778) -- Archerus Deathcharger
plr:LearnSpell(50977) -- Death Gate
plr:LearnSpell(53428) -- Runeforging
plr:GossipComplete()
else
player:SendAreaTriggerMessage("Your are not a Death Knight")
end
if(intid == 12) and player:GetPlayerClass() == 12 then -- Shaman
plr:LearnSpell(3599) -- Searing Totem
plr:LearnSpell(5394) -- Healing Stream Totem
plr:LearnSpell(8071) -- Stoneskin Totem
plr:GossipComplete()
else
player:SendAreaTriggerMessage("Your are not a Shaman")
end
end
RegisterUnitGossipEvent(MSkillNPC, 1, "MSN_Gossip")
RegisterUnitGossipEvent(MSkillNPC, 2, "MSN_Select")