Alright, I finished my first script... I went to test it but either I'm not putting it in correctly or I made a mistake in the script. This is it anyways: Code:
function Keleth_SendChatMessage (unit, Event)
Unit:SendChatMessage(11, 0, "It seems that some classes are missing spells... Click on me to get them!")
end
function Keleth_MainMenu (unit, player)
Unit:GossipCreateMenu(1228, player)
Unit:GossipMenuAddItem(player, 4, "Teach me my spells!", 1, 0)
player:GossipSendMenu()
end
function Keleth_OnGossipTalk (unit, event, player)
Keleth_MainMenu(unit, player)
end
function Keleth_GetPlayerClass (unit, player)
local id = Unit:GetPlayerClass()
end
function Keleth_OnGossipSelect (unit, event, player, id, intid, code)
if(id == 11) then
unit:LearnSpell(9634)
unit:LearnSpell(40120)
unit:LearnSpell(26996)
unit:LearnSpell(33745)
unit:LearnSpell(26999)
unit:LearnSpell(26997)
unit:LearnSpell(26998)
unit:LearnSpell(8983)
unit:LearnSpell(1066)
player:GossipComplete()
end
if(intid == 3) then
unit:LearnSpell(5149)
unit:LearnSpell(883)
unit:LearnSpell(2641)
unit:LearnSpell(6991)
unit:LearnSpell(982)
unit:LearnSpell(1515)
player:GossipComplete()
end
if(intid == 2) then
unit:LearnSpell(20773)
unit:LearnSpell(34767)
unit:LearnSpell(23214)
player:GossipComplete()
end
if(intid == 9) then
unit:LearnSpell(688)
unit:LearnSpell(697)
unit:LearnSpell(712)
unit:LearnSpell(691)
unit:LearnSpell(23161)
player:GossipComplete()
end
if(intid == 1) then
unit:LearnSpell(2458)
unit:LearnSpell(355)
unit:LearnSpell(25275)
unit:LearnSpell(71)
end
end
RegisterUnitEvent(100000, 7, "Keleth_SendChatMessage")
RegisterGossipEvent(100000, 7, "Keleth_MainMenu")
RegisterGossipEvent(100000, 7, "Keleth_OnGossipTalk")
RegisterGossipEvent(100000, 7, "Keleth_GetPlayerClass")
RegisterGossipEvent(100000, 7, "Keleth_OnGossipSelect")
The purpose of the script is to get an npc that detects a player's class and gives any missing spells if there are any. So a warrior can click it and get his stances instead of having to do the quests. I don't have all of the missing stuff, so I'll add more when I get it finally working.
I am using SectorSeven's Blizzlike Repack v2. Server works fine, but I don't think I'm putting the code in correctly. It's saved under the lua folder, and I think lua is enabled.
Anyways, any help would be appreciated 