Skip to content

Commit

Permalink
Hush Goblin Merrymakers.
Browse files Browse the repository at this point in the history
  • Loading branch information
clanofartisans committed Dec 18, 2024
1 parent 6d295d2 commit e35bd12
Showing 1 changed file with 36 additions and 3 deletions.
39 changes: 36 additions & 3 deletions hush.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

addon.name = 'hush';
addon.author = 'Hugin';
addon.version = '1.5.1';
addon.version = '1.5.2';
addon.desc = 'Hides yells, teleport requests, Eco-Warrior, and other annoying messages.';
addon.link = 'https://github.com/clanofartisans/ashita-hush';

Expand All @@ -43,7 +43,8 @@ local default_settings = T{
fish = false,
allshouts = false,
defeats = false,
cmderror = false
cmderror = false,
merrymaker = false
};

-- Hush Variables
Expand Down Expand Up @@ -370,6 +371,26 @@ local function is_highwind(e)
return false;
end

--[[
* Determines if the message is a Goblin Merrymaker.
*
* @param e - The chat event?
* @return {bool} True if it's a Goblin Merrymaker, otherwise false.
--]]
local function is_merrymaker(e)
local msg = clean_str(e.message_modified);
local k = false;

-- Find the NPC name..
k = (e.message_modified:contains('Goblin Merrymaker'));

if (k) then
return true;
end

return false;
end

--[[
* Prints the addon help information.
*
Expand Down Expand Up @@ -458,7 +479,11 @@ ashita.events.register('d3d_present', 'd3d_present_cb', function ()
hush.settings.defeats = not hush.settings.defeats;
update_settings();
end
if imgui.Checkbox('Hush "command errors" (experimental)##HushDefeatsCheck', { hush.settings.cmderror }) then
if imgui.Checkbox('Hush Goblin Merrymakers##HushMerrymakerCheck', { hush.settings.merrymaker }) then
hush.settings.merrymaker = not hush.settings.merrymaker;
update_settings();
end
if imgui.Checkbox('Hush "command errors" (experimental)##HushCmdErrCheck', { hush.settings.cmderror }) then
hush.settings.cmderror = not hush.settings.cmderror;
update_settings();
end
Expand Down Expand Up @@ -573,6 +598,14 @@ ashita.events.register('text_in', 'text_in_cb', function (e)
end
end

-- Hush Goblin Merrymakers..
if (cm == 142 and hush.settings.merrymaker == true) then
if(is_merrymaker(e)) then
e.blocked = true;
return;
end
end

-- Hush command errors..
if (cm == 157 and hush.settings.cmderror == true) then
if(is_cmd_error(e)) then
Expand Down

0 comments on commit e35bd12

Please sign in to comment.