projecteq-projecteqquests/akanon/clockwork_scrubber.lua

29 lines
741 B
Lua

-- Converted to .lua by Speedz
-- items: 12164, 12162, 12167
local miner628 = 0;
function event_spawn(e)
local random_result = math.random(100);
if(random_result <= 5) then
miner628 = 1;
end
end
function event_say(e)
if (e.message:findi("628") and miner628 == 1) then
e.self:Emote(".wizz.click.628.");
end
end
function event_trade(e)
local item_lib = require("items");
if (miner628 == 1 and item_lib.check_turn_in(e.trade, {item1 = 12164})) then -- Scrubber Key
e.self:Emote(".wizz.click.628.");
e.other:Faction(695,-10,0); -- Clockwork Gnome
e.other:Ding();
e.other:AddEXP(500);
e.other:SummonItem(eq.ChooseRandom(12162,12167)); -- Gnome Take (Good or Bad)
end
item_lib.return_items(e.self, e.other, e.trade)
end