Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Items = {
- [25]={12345,"chests",11291,15},
- [57]={23456,"boots",11291,10},
- [2734]={34567,"heads",11291,5}}
- -- intid and itemid [intid]={itemid, classidtoenchant, itemidtocost, amount}
- ...
- ... your code
- ...
- if Items~=nil then
- for k,l in pairs(Items) do
- local name = WorldDBQuery("SELECT ´name1´ FROM ´items´ WHERE entry = "..Items[v][1]):GetColumn(0):GetString()
- pUnit:GossipMenuAddItem(4, "Create a scroll to enchant your "..Items[l][2]..". (Costs "..Items[l][4].." "..name..".)", Items[k], 0)
- end
- end
- ...
- ... your code
- ...
- if Items~=nil then
- for n,v in pairs(Items) do if intid==n then
- if player:GetItemCount(Items[v][3]) >= Items[v][4] then
- player:CastSpell(32990)
- player:RemoveItem(Items[v][3], Items[v][4])
- player:AddItem(Items[v][1], 1)
- else
- local name = WorldDBQuery("SELECT ´name1´ FROM ´items´ WHERE entry = "..Items[v][1]):GetColumn(0):GetString()
- player:SendBroadcastMessage("You do not have enough "..name..".")
- end
- end end
- end
- So if I would now look at the gossip screen of the NPC, I would see 3 menu items I could pic:
- Create a scroll to enchant your chests. (Costs 15 Wood.) --> adds item 12345
- Create a scroll to enchant your boots. (Costs 10 Wood.) --> adds item 23456
- Create a scroll to enchant your heads. (Costs 5 Wood.) --> adds item 34567
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement