ERR_MSG = "You don't have enough tokens to buy this item.";
function Event_Guide(unit, event, player, misc)
unit:GossipCreateMenu(1, player, 0)
unit:GossipMenuAddItem(0, "10 Donations Token Items", 4, 0)
unit:GossipMenuAddItem(0, "20 Donations Token Items", 5, 0)
unit:GossipSendMenu(player)
end
function Event_Submenu(unit, event, player, id, intid, code, misc)
if(intid == 1) then
unit:GossipCreateMenu(16, player, 0)
unit:GossipMenuAddItem(0, "10 Donations Token Items", 4, 0)
unit:GossipMenuAddItem(0, "20 Donations Token Items", 5, 0)
unit:GossipSendMenu(player)
end
--10 token items
if(intid == 4) then
unit:GossipCreateMenu(21, player, 0)
unit:GossipMenuAddItem(0, "Gurubashi Dagger of Annihilation", 24, 0)
unit:GossipMenuAddItem(0, "Gurubashi Spectral glaive", 25, 0)
unit:GossipMenuAddItem(0, "[Back]", 1, 0)
unit:GossipSendMenu(player)
end
if(intid == 24) then
if player:GetItemCount(100001) > 9 then
player:RemoveItem(100001, 10)
player:AddItem(99993, 1)
player:GossipComplete()
else
player:SendChatMessage(12, 0, ERR_MSG)
end
end
if(intid == 25) then
if player:GetItemCount(100001) > 9 then
player:RemoveItem(100001, 10)
player:AddItem(99994, 1)
player:GossipComplete()
else
player:SendChatMessage(12, 0, ERR_MSG)
end
end
--20 token items
if(intid == 5) then
unit:GossipCreateMenu(21, player, 0)
unit:GossipMenuAddItem(0, "Gurubashi Hand of the Ancient", 29, 0)
unit:GossipMenuAddItem(0, "Gurubashi Staff of Destruction", 30, 0)
unit:GossipMenuAddItem(0, "Gurubashi Arcanite Fury", 31, 0)
--unit:GossipMenuAddItem(0, "Item 6", 32, 0)
--unit:GossipMenuAddItem(0, "Item 3", 33, 0)
unit:GossipMenuAddItem(0, "[Back]", 1, 0)
unit:GossipSendMenu(player)
end
if(intid == 29) then
if player:GetItemCount(100001) > 19 then
player:RemoveItem(100001, 20)
player:AddItem(99991, 1)
player:GossipComplete()
else
player:SendChatMessage(12, 0, ERR_MSG)
end
end
if(intid == 30) then
if player:GetItemCount(100001) > 19 then
player:RemoveItem(100001, 20)
player:AddItem(99992, 1)
player:GossipComplete()
else
player:SendChatMessage(12, 0, ERR_MSG)
end
end
if(intid == 31) then
if player:GetItemCount(100001) > 19 then
player:RemoveItem(100001, 20)
player:AddItem(99995, 1)
player:GossipComplete()
else
player:SendChatMessage(12, 0, ERR_MSG)
end
end
end
RegisterUnitGossipEvent(555555, 1, "Event_Guide")
RegisterUnitGossipEvent(555555, 2, "Event_Subme")