Code:
--[ Made By Ground Zero of MMOwned ]--
-- Start Config
local enable = 1 -- Turn to 0 to Disable
local x1 = 0000 -- Change to the Item ID of Random Reward 1
local x2 = 0000 -- Change to the Item ID of Random Reward 2
local x3 = 0000 -- Change to the Item ID of Random Reward 3
local x4 = 0000 -- Change to the Item ID of Random Reward 4
local x5 = 0000 -- Change to the Item ID of Random Reward 5
local x6 = 0000 -- Change to the Item ID of Random Reward 6
local npcid = 80000
-- End Config
--- Do not Edit beyond this point. --
function Santagossip(pUnit, event, plr)
pUnit:GossipCreateMenu(3429, plr, 0)
pUnit:GossipMenuAddItem(7, "Merry Christmas Santa!", 300, 0)
pUnit:GossipMenuAddItem(1, "Can I have my present please Santa?", 301, 0)
pUnit:GossipMenuAddItem(7, "Goodbye", 302, 0)
pUnit:GossipSendMenu(plr)
end
function Santa_onchat(pUnit, event, plr, id, intid, code)
if (intid == 300) then
pUnit:SendChatMessage(12, 0, "Merry Christmas to you too and have a Happy New Year!")
end
if (intid == 301) then
if (enable == 1) then
local choice = math.random(1.6)
pUnit:SendBroadcastMessage("You have recieved a Christmas Present!")
if choice == 1 then
plr:AddItem(x1, 1)
elseif
choice == 2 then
plr:AddItem(x2, 1)
elseif
choice == 3 then
plr:AddItem(x3, 1)
elseif
choice == 4 then
plr:AddItem(x3, 1)
elseif
choice == 5 then
plr:AddItem(x5, 1)
elseif
choice == 6 then
plr:AddItem(x6, 1)
end
else
pUnit:SendBroadcastMessage("This feature is currently disabled!")
end
end
if (intid == 302) then
plr:GossipComplete()
end
end
RegisterUnitGossipEvent(npcid, 1, "Santagossip")
RegisterUnitGossipEvent(npcid, 2, "Santa_onchat")