Code:
function BugReport_OnTrigger(item, event, player)
BugReportMenu(item, player)
end
function BugReportMenu(item, player)
item:GossipCreateMenu(57003, player, 0)
item:GossipMenuAddItem(0, "Report bug. !The first code box asks for the KIND of bug!", 1, 1)
item:GossipMenuAddItem(0, "Never mind.", 2, 0)
item:GossipSendMenu(player)
end
function BugReport_OnSelect(item, event, player, id, intid, Code)
if (intid == 1) then
BUG_KIND = Code
item:GossipCreateMenu(57003, player, 0)
item:GossipMenuAddItem(0, "Description of the bug.", 3, 1)
item:GossipMenuAddItem(0, "Never mind.", 2, 0)
item:GossipSendMenu(player)
end
if (intid == 2) then
player:GossipComplete()
end
if (intid == 3) then
BUG_DESCRIPTION = Code
item:GossipCreateMenu(57003, player, 0)
item:GossipMenuAddItem(0, "Send bug report.", 4, 0)
item:GossipMenuAddItem(0, "Never mind.", 2, 0)
item:GossipSendMenu(player)
end
if (intid == 4) then
BugPlayerInfo(player)
print(BPlayerClass, BPlayerRace, BPlayerName)
if BUG_DESCRIPTION ~= nil and BUG_KIND ~= nil then
Execute(1, "INSERT INTO bug_report (`#`,`bugkind`,`description`,`date`,`time`,`class`,`race`,`name`) VALUES ('0','"..BUG_KIND.."','"..BUG_DESCRIPTION.."','"..os.date("%x").."','"..os.date("%X").."','"..BPlayerClass.."','"..BPlayerRace.."','"..BPlayerName.."');")
else
Execute(1, "INSERT INTO bug_report (`#`,`bugkind`,`description`,`date`,`time`,`class`,`race`,`name`) VALUES ('0','no information available','no information available','"..os.date("%x").."','"..os.date("%X").."','"..BPlayerClass.."','"..BPlayerRace.."','"..BPlayerName.."');")
end
player:GossipComplete()
end
end
RegisterItemGossipEvent(57010, 1, "BugReport_OnTrigger")
RegisterItemGossipEvent(57010, 2, "BugReport_OnSelect")
function BugPlayerInfo(player)
BPlayerClass = player:GetPlayerClass()
BPlayerRace = player:GetPlayerRace()
BPlayerName = player:GetName()
return BPlayerClass, BPlayerRace, BPlayerName
end