I put it in my script_bin in my Arcemu folder, right? I'm not familiar on how to use lua at all. Normally I just upload sql into my db.
I put it in my script_bin in my Arcemu folder, right? I'm not familiar on how to use lua at all. Normally I just upload sql into my db.
You put it in your "scripts" folder. If you dont have one. Make one.
Where do I put the "scripts" folder? Do I put it in the Arcemu folder or the ArcEmu Source? I'm not too computer savvy when it comes to that kind of stuff.
You make the 'Scripts' folder and put into your your ArcEmu folder. A.K.A. The folder that has your server in it. Then you take his script, plop it into a blank text editor (Notepad), select "Save As". Save it as LUA Skill NPC.lua and put it in your scripts folder. Go into arcemu-world.conf (I think) and enable LUA.Where do I put the "scripts" folder? Do I put it in the Arcemu folder or the ArcEmu Source? I'm not too computer savvy when it comes to that kind of stuff.
It will say something like
Enabling script blah
LUA= 0
Something Else= 0
Change it to
Enabling script blah
LUA= 1
Something Else= 0
Make a NPC that has his flags set to "1", make sure the NPC ID is corresponding with the NPC ID in the LUA code. Restart your server, spawn the NPC and WALA.
Have fun not getting tickets.
Last edited by Sounddead; 09-01-2008 at 12:29 AM.
Nice. +rep from me. I'll use this and maybe tweak it a little for my server. Thanks for sharing.
Nice been looking for 1 of these. +rep
I'm not going to be releasing anything for a while. I'm back on retail for new content.
I followed your instructions on how to set that up but I'm getting these errors in my arcemu_world...
(if you can't see, it says, "scripts\LUA Skill NPC.lua:17: bad argument #2 to 'GossipCreateMenu' (number expected got no value)
I have the npc made in the game. His flag was set to '1' and I'm able to spawn him. So, he's all set except when I try talking to the NPC via game. He has the symbol that npc's get when you can talk to them, but nothing comes up. Any idea to what I did wrong?
Last edited by bras; 09-01-2008 at 03:23 PM.
Code:--[[ SkillNPC.lua This script was written and is protected by the GPL v2. This script was released by Performer/Performa of the Blua Scripting Project. Please give proper accredidations when re-releasing or sharing this script with others in the emulation community. Credits to Nebels for the C++ Version. Thanks to Soundead for fixing an error. ~~End of License Agreement -- Performa, August 25th, 2008. ]] function Skill_Menu (Unit, event, player) Unit:GossipCreateMenu(100, player, 0) Unit:GetPlayerClass() if(Unit:GetPlayerClass() == 1) then Unit:GossipMenuAddItem(0, "What Spells Can Warriors Learn?", 50, 0) elseif(Unit:GetPlayerClass() == 2) then Unit:GossipMenuAddItem(0, "What Spells Can Paladins Learn?", 51, 0) elseif(Unit:GetPlayerClass() == 3) then Unit:GossipMenuAddItem(0, "What Spells Can Hunters Learn?", 52, 0) elseif(Unit:GetPlayerClass() == 4) then Unit:GossipMenuAddItem(0, "What Spells Can Rogues Learn?", 53, 0) elseif(Unit:GetPlayerClass() == 5) then Unit:GossipMenuAddItem(0, "What Spells Can Priests Learn?", 54, 0) elseif(Unit:GetPlayerClass() == 7) then Unit:GossipMenuAddItem(0, "What Spells Can Shamans Learn?", 55, 0) elseif(Unit:GetPlayerClass() == 8) then Unit:GossipMenuAddItem(0, "What Spells Can Mages Learn?", 56, 0) elseif(Unit:GetPlayerClass() == 9) then Unit:GossipMenuAddItem(0, "What Spells Can Warlocks Learn?", 57, 0) elseif(Unit:GetPlayerClass() == 11) then Unit:GossipMenuAddItem(0, "What Spells Can Druids Learn?", 58, 0) Unit:GossipMenuAddItem(5, "Reset Talent Points", 2, 0) Unit:GossipSendMenu(player) end end function Skill_OnSelect (Unit, event, player, id, intid, code) if(intid == 50) then Unit:GossipCreateMenu(99, player) Unit:GossipMenuAddItem(5, "Taunt", 3, 0) Unit:GossipMenuAddItem(5, "Intercept", 4, 0) Unit:GossipMenuAddItem(5, "Mortal Strike", 5, 0) Unit:GossipMenuAddItem(5, "Defensive Stance", 6, 0) Unit:GossipMenuAddItem(5, "Berserker Stance", 7, 0) Unit:GossipMenuAddItem(0, "[Back]", 99, 0) Unit:GossipSendMenu(player) end if(intid == 51) then Unit:GossipCreateMenu(98, player) Unit:GossipMenuAddItem(5, "Redemption", 8, 0) Unit:GossipMenuAddItem(5, "Summon Warhorse", 9, 0) Unit:GossipMenuAddItem(5, "Summon Charger", 10, 0) Unit:GossipMenuAddItem(0, "[Back]", 99, 0) Unit:GossipSendMenu(player) end if(intid == 52) then Unit:GossipCreateMenu(97, player) Unit:GossipMenuAddItem(5, "Pet Spells", 11, 0) Unit:GossipMenuAddItem(0, "[Back]", 99, 0) Unit:GossipSendMenu(player) end if(intid == 53) then Unit:GossipCreateMenu(96, player) Unit:GossipMenuAddItem(0, "[Back]", 99, 0) Unit:GossipSendMenu(player) end if(intid == 54) then Unit:GossipCreateMenu(95, player) Unit:GossipMenuAddItem(0, "[Back]", 99, 0) Unit:GossipSendMenu(player) end if(intid == 55) then Unit:GossipCreateMenu(94, player) Unit:GossipMenuAddItem(0, "[Back]", 99, 0) Unit:GossipSendMenu(player) end if(intid == 56) then Unit:GossipCreateMenu(93, player) Unit:GossipMenuAddItem(5, "Ice Block", 22, 0) Unit:GossipMenuAddItem(0, "[Back]", 99, 0) Unit:GossipSendMenu(player) end if(intid == 57) then Unit:GossipCreateMenu(92, player) Unit:GossipMenuAddItem(5, "Pet Spells", 12, 0) Unit:GossipMenuAddItem(5, "Summon Felsteed", 13, 0) Unit:GossipMenuAddItem(5, "Summon Dreadsteed", 14, 0) Unit:GossipMenuAddItem(0, "[Back]", 99, 0) Unit:GossipSendMenu(player) end if(intid == 58) then Unit:GossipCreateMenu(91, player) Unit:GossipMenuAddItem(5, "Growl", 15, 0) Unit:GossipMenuAddItem(5, "Maul", 16, 0) Unit:GossipMenuAddItem(5, "Bear Form", 17, 0) Unit:GossipMenuAddItem(5, "Dire Bear Form", 18, 0) Unit:GossipMenuAddItem(5, "Aquatic Form", 19, 0) Unit:GossipMenuAddItem(5, "Normal Flight Form", 20, 0) Unit:GossipMenuAddItem(5, "Epic Flight Form", 21, 0) Unit:GossipMenuAddItem(0, "[Back]", 99, 0) Unit:GossipSendMenu(player) end if(intid == 2) then Unit:ResetTalent() end if(intid == 3) then local plr = Unit:GetClosestPlayer() plr:LearnSpell(355) end if(intid == 4) then local plr = Unit:GetClosestPlayer() plr:LearnSpell(25275) end if(intid == 5) then local plr = Unit:GetClosestPlayer() plr:LearnSpell(30330) end if(intid == 6) then local plr = Unit:GetClosestPlayer() plr:LearnSpell(71) end if(intid == 7) then local plr = Unit:GetClosestPlayer() plr:LearnSpell(2458) end if(intid == 8) then local plr = Unit:GetClosestPlayer() plr:LearnSpell(20773) end if(intid == 9) then local plr = Unit:GetClosestPlayer() plr:LearnSpell(13819) end if(intid == 10) then local plr = Unit:GetClosestPlayer() plr:LearnSpell(34767) end if(intid == 11) then local plr = Unit:GetClosestPlayer() plr:LearnSpell(1515) plr:LearnSpell(883) plr:LearnSpell(5149) plr:LearnSpell(982) plr:LearnSpell(6991) end if(intid == 12) then local plr = Unit:GetClosestPlayer() plr:LearnSpell(688) plr:LearnSpell(697) plr:LearnSpell(712) plr:LearnSpell(691) end if(intid == 13) then local plr = Unit:GetClosestPlayer() plr:LearnSpell(5784) end if(intid == 14) then local plr = Unit:GetClosestPlayer() plr:LearnSpell(23161) end if(intid == 15) then local plr = Unit:GetClosestPlayer() plr:LearnSpell(6795) end if(intid == 16) then local plr = Unit:GetClosestPlayer() plr:LearnSpell(26996) end if(intid == 17) then local plr = Unit:GetClosestPlayer() plr:LearnSpell(5487) end if(intid == 18) then local plr = Unit:GetClosestPlayer() plr:LearnSpell(9634) end if(intid == 19) then local plr = Unit:GetClosestPlayer() plr:LearnSpell(1066) end if(intid == 20) then local plr = Unit:GetClosestPlayer() plr:LearnSpell(33943) end if(intid == 21) then local plr = Unit:GetClosestPlayer() plr:LearnSpell(40120) end if(intid == 22) then local plr = Unit:GetClosestPlayer() plr:LearnSpell(45438) end if(intid == 99) then end intid = 0 end RegisterUnitGossipEvent(ENTRYID, 1, "Skill_Menu") RegisterUnitGossipEvent(ENTRYID, 2, "Skill_OnSelect")
Okay, I'm not getting any errors in the arcemu_world anymore. Now I have him spawned but he still won't talk to me but has the symbol like he can talk to you. Could I have one of the settings wrong in the creature_names & creature_proto?
Same here. No GossipMenu will pop up.
Realy need help here i got a Error in the console, It says
Failed. (could not run)
Scripts/skillnpc.lua:204: bad argument #1 to 'RegisterUnitGossipEvent' <number expected, got nil>
Sounddead,
Since there needs to be a '0' added to the end of the GossipCreateMenu unit of the Skill_Menu function, shouldn't there be a '0' at the end of every other GossipCreateMenu unit under the Skill_OnSelect function, as well?
I'm not sure about that. Any ideas?
I think I fixed it, it works for me anyhow. Thanks for the script
Code:--[[ SkillNPC.lua This script was written and is protected by the GPL v2. This script was released by Performer/Performa of the Blua Scripting Project. Please give proper accredidations when re-releasing or sharing this script with others in the emulation community. Credits to Nebels for the C++ Version. Thanks to Soundead for fixing an error. ~~End of License Agreement -- Performa, August 25th, 2008. ]] function Skill_Menu (pUnit, event, player, pMisc) pUnit:GossipCreateMenu(100, player, 0, 0) if player:GetPlayerClass() == 1 then pUnit:GossipMenuAddItem(0, "What Spells Can Warriors Learn?", 50, 0) pUnit:GossipSendMenu(player) elseif player:GetPlayerClass() == 2 then pUnit:GossipMenuAddItem(0, "What Spells Can Paladins Learn?", 51, 0) pUnit:GossipSendMenu(player) elseif player:GetPlayerClass() == 3 then pUnit:GossipMenuAddItem(0, "What Spells Can Hunters Learn?", 52, 0) pUnit:GossipSendMenu(player) elseif player:GetPlayerClass() == 4 then pUnit:GossipMenuAddItem(0, "What Spells Can Rogues Learn?", 53, 0) pUnit:GossipSendMenu(player) elseif player:GetPlayerClass() == 5 then pUnit:GossipMenuAddItem(0, "What Spells Can Priests Learn?", 54, 0) pUnit:GossipSendMenu(player) elseif player:GetPlayerClass() == 7 then pUnit:GossipMenuAddItem(0, "What Spells Can Shamans Learn?", 55, 0) pUnit:GossipSendMenu(player) elseif player:GetPlayerClass() == 8 then pUnit:GossipMenuAddItem(0, "What Spells Can Mages Learn?", 56, 0) pUnit:GossipSendMenu(player) elseif player:GetPlayerClass() == 9 then pUnit:GossipMenuAddItem(0, "What Spells Can Warlocks Learn?", 57, 0) pUnit:GossipSendMenu(player) elseif player:GetPlayerClass() == 11 then pUnit:GossipMenuAddItem(0, "What Spells Can Druids Learn?", 58, 0) pUnit:GossipSendMenu(player) end end function Skill_OnSelect (pUnit, event, player, id, intid, code, pMisc) if(intid == 50) then pUnit:GossipCreateMenu(99, player, 0, 0) pUnit:GossipMenuAddItem(5, "Taunt", 3, 0) pUnit:GossipMenuAddItem(5, "Intercept", 4, 0) pUnit:GossipMenuAddItem(5, "Mortal Strike", 5, 0) pUnit:GossipMenuAddItem(5, "Defensive Stance", 6, 0) pUnit:GossipMenuAddItem(5, "Berserker Stance", 7, 0) pUnit:GossipMenuAddItem(0, "[Back]", 0, 0) pUnit:GossipSendMenu(player) end if(intid == 51) then pUnit:GossipCreateMenu(98, player, 0) pUnit:GossipMenuAddItem(5, "Redemption", 8, 0) pUnit:GossipMenuAddItem(5, "Summon Warhorse", 9, 0) pUnit:GossipMenuAddItem(5, "Summon Charger", 10, 0) pUnit:GossipMenuAddItem(0, "[Back]", 0, 0) pUnit:GossipSendMenu(player) end if(intid == 52) then pUnit:GossipCreateMenu(97, player, 0) pUnit:GossipMenuAddItem(5, "Pet Spells", 11, 0) pUnit:GossipMenuAddItem(0, "[Back]", 0, 0) pUnit:GossipSendMenu(player) end if(intid == 53) then pUnit:GossipCreateMenu(96, player, 0) pUnit:GossipMenuAddItem(0, "[Back]", 0, 0) pUnit:GossipSendMenu(player) end if(intid == 54) then pUnit:GossipCreateMenu(95, player, 0) pUnit:GossipMenuAddItem(0, "[Back]", 0, 0) pUnit:GossipSendMenu(player) end if(intid == 55) then pUnit:GossipCreateMenu(94, player, 0) pUnit:GossipMenuAddItem(0, "[Back]", 0, 0) pUnit:GossipSendMenu(player) end if(intid == 56) then pUnit:GossipCreateMenu(93, player, 0) pUnit:GossipMenuAddItem(5, "Ice Block", 22, 0) pUnit:GossipMenuAddItem(0, "[Back]", 0, 0) pUnit:GossipSendMenu(player) end if(intid == 57) then pUnit:GossipCreateMenu(92, player, 0) pUnit:GossipMenuAddItem(5, "Pet Spells", 12, 0) pUnit:GossipMenuAddItem(5, "Summon Felsteed", 13, 0) pUnit:GossipMenuAddItem(5, "Summon Dreadsteed", 14, 0) pUnit:GossipMenuAddItem(0, "[Back]", 0, 0) pUnit:GossipSendMenu(player) end if(intid == 58) then pUnit:GossipCreateMenu(91, player, 0) pUnit:GossipMenuAddItem(5, "Growl", 15, 0) pUnit:GossipMenuAddItem(5, "Maul", 16, 0) pUnit:GossipMenuAddItem(5, "Bear Form", 17, 0) pUnit:GossipMenuAddItem(5, "Dire Bear Form", 18, 0) pUnit:GossipMenuAddItem(5, "Aquatic Form", 19, 0) pUnit:GossipMenuAddItem(5, "Normal Flight Form", 20, 0) pUnit:GossipMenuAddItem(5, "Epic Flight Form", 21, 0) pUnit:GossipMenuAddItem(0, "[Back]", 0, 0) pUnit:GossipSendMenu(player) end if(intid == 2) then pUnit:ResetTalent() end if(intid == 3) then local plr = pUnit:GetClosestPlayer() plr:LearnSpell(355) end if(intid == 4) then local plr = pUnit:GetClosestPlayer() plr:LearnSpell(25275) end if(intid == 5) then local plr = pUnit:GetClosestPlayer() plr:LearnSpell(30330) end if(intid == 6) then local plr = pUnit:GetClosestPlayer() plr:LearnSpell(71) end if(intid == 7) then local plr = pUnit:GetClosestPlayer() plr:LearnSpell(2458) end if(intid == 8) then local plr = pUnit:GetClosestPlayer() plr:LearnSpell(20773) end if(intid == 9) then local plr = pUnit:GetClosestPlayer() plr:LearnSpell(13819) end if(intid == 10) then local plr = pUnit:GetClosestPlayer() plr:LearnSpell(34767) end if(intid == 11) then local plr = pUnit:GetClosestPlayer() plr:LearnSpell(1515) plr:LearnSpell(883) plr:LearnSpell(5149) plr:LearnSpell(982) plr:LearnSpell(6991) end if(intid == 12) then local plr = pUnit:GetClosestPlayer() plr:LearnSpell(688) plr:LearnSpell(697) plr:LearnSpell(712) plr:LearnSpell(691) end if(intid == 13) then local plr = pUnit:GetClosestPlayer() plr:LearnSpell(5784) end if(intid == 14) then local plr = pUnit:GetClosestPlayer() plr:LearnSpell(23161) end if(intid == 15) then local plr = pUnit:GetClosestPlayer() plr:LearnSpell(6795) end if(intid == 16) then local plr = pUnit:GetClosestPlayer() plr:LearnSpell(26996) end if(intid == 17) then local plr = pUnit:GetClosestPlayer() plr:LearnSpell(5487) end if(intid == 18) then local plr = pUnit:GetClosestPlayer() plr:LearnSpell(9634) end if(intid == 19) then local plr = pUnit:GetClosestPlayer() plr:LearnSpell(1066) end if(intid == 20) then local plr = pUnit:GetClosestPlayer() plr:LearnSpell(33943) end if(intid == 21) then local plr = pUnit:GetClosestPlayer() plr:LearnSpell(40120) end if(intid == 22) then local plr = pUnit:GetClosestPlayer() plr:LearnSpell(45438) end if(intid == 99) then end intid = 0 end RegisterUnitGossipEvent(500021, 1, "Skill_Menu") RegisterUnitGossipEvent(500021, 2, "Skill_OnSelect")
Thanks for working on that bessy. I'll try it out now and see if it works.