From f8182ca30a8c7006642680a72f3f889c6fa4cce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Correia?= Date: Tue, 14 Apr 2026 00:44:08 +0100 Subject: [PATCH 1/3] Fixing emote announce while in raid --- Roll.lua | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Roll.lua b/Roll.lua index cdfead6..7b368b0 100644 --- a/Roll.lua +++ b/Roll.lua @@ -28,6 +28,20 @@ local function BuildModifierString(modifiers) return table.concat(parts, " ") end +-- Send a message to the given channel, handling EMOTE specially +-- to avoid the message being redirected to raid chat when in a raid group. +local function SendToChannel(msg, channel) + if channel == "EMOTE" then + local editBox = ChatFrame1 and ChatFrame1.editBox or ChatFrame1EditBox + if editBox then + ChatFrame_OpenChat("/e " .. msg, ChatFrame1) + ChatEdit_SendText(editBox) + end + return + end + SendChatMessage(msg, channel) +end + -- Announce the roll result to the selected chat channel local function AnnounceRoll(rollValue, modifiers, total) if not AltSystem.State.announceEnabled then return end @@ -45,7 +59,7 @@ local function AnnounceRoll(rollValue, modifiers, total) msg = name .. " rolled " .. rollValue .. " = " .. total end - SendChatMessage(msg, channelDef.channel) + SendToChannel(msg, channelDef.channel) end -- Perform a roll: triggers the WoW native /roll 20 command @@ -82,7 +96,7 @@ function AltSystem:CalculateAndDisplayResult(rollType, rollValue) if AltSystem.State.announceEnabled then local channelDef = AltSystem.AnnounceChannels[AltSystem.State.announceChannelIndex] if channelDef then - SendChatMessage(GetCharacterName() .. " rolled a Critical Failure!", channelDef.channel) + SendToChannel(GetCharacterName() .. " rolled a Critical Failure!", channelDef.channel) end end return @@ -93,7 +107,7 @@ function AltSystem:CalculateAndDisplayResult(rollType, rollValue) if AltSystem.State.announceEnabled then local channelDef = AltSystem.AnnounceChannels[AltSystem.State.announceChannelIndex] if channelDef then - SendChatMessage(GetCharacterName() .. " rolled a Critical Success!", channelDef.channel) + SendToChannel(GetCharacterName() .. " rolled a Critical Success!", channelDef.channel) end end return From 5a0d0f2ca49948610d8055bfd86cfe37ae1ddf5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Correia?= Date: Tue, 14 Apr 2026 00:45:30 +0100 Subject: [PATCH 2/3] Showing +0 mods in announce message --- Roll.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Roll.lua b/Roll.lua index 7b368b0..9fb29c5 100644 --- a/Roll.lua +++ b/Roll.lua @@ -20,10 +20,8 @@ end local function BuildModifierString(modifiers) local parts = {} for _, mod in ipairs(modifiers) do - if mod.value ~= 0 then - local sign = mod.value >= 0 and "+" or "" - table.insert(parts, sign .. mod.value .. " (" .. mod.name .. ")") - end + local sign = mod.value >= 0 and "+" or "" + table.insert(parts, sign .. mod.value .. " (" .. mod.name .. ")") end return table.concat(parts, " ") end From 865404ffb75d5761fda5c8ac6863fe5cc86c89f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Correia?= Date: Tue, 14 Apr 2026 00:49:04 +0100 Subject: [PATCH 3/3] Add a 'base roll' skill --- Data.lua | 13 +++++++++---- Roll.lua | 14 ++++++++++---- UI.lua | 2 +- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Data.lua b/Data.lua index 38ccf11..6dc2a35 100644 --- a/Data.lua +++ b/Data.lua @@ -12,11 +12,15 @@ AltSystem.Data.SkillLevels = { ["Master"] = 4, } --- The "Inept" entry is always the first (default) skill +-- The "Base roll" entry is always the first (default) skill +local BASE_ROLL_ENTRY = { name = "Base roll", level = "Base", modifier = 0 } + +-- The "Inept" entry is always the second skill local UNSKILLED_ENTRY = { name = "Inept", level = "Inept", modifier = -4 } -- Default/fallback skill list used when no TRP3 profile skills are found local DEFAULT_SKILLS = { + { name = "Base roll", level = "Base", modifier = 0 }, { name = "Inept", level = "Inept", modifier = -4 }, { name = "Novice Skill", level = "Novice", modifier = -2 }, { name = "Adept Skill", level = "Adept", modifier = 0 }, @@ -56,12 +60,13 @@ local function ParseSkillLevel(numericValue) end -- Fetch skills from the current TRP3 profile's personality traits. --- Returns an array of skill entries, always starting with "Inept". +-- Returns an array of skill entries, always starting with "Base roll" and "Inept". -- Falls back to the default list if no profile or no valid skills are found. function AltSystem.Data:RefreshSkills() local skills = {} - -- Always add Inept as the first entry + -- Always add Base roll as the first entry, then Inept + table.insert(skills, { name = BASE_ROLL_ENTRY.name, level = BASE_ROLL_ENTRY.level, modifier = BASE_ROLL_ENTRY.modifier }) table.insert(skills, { name = UNSKILLED_ENTRY.name, level = UNSKILLED_ENTRY.level, modifier = UNSKILLED_ENTRY.modifier }) local foundAny = false @@ -89,7 +94,7 @@ function AltSystem.Data:RefreshSkills() end end - -- If no valid skills were found, use the default fallback list (skip first "Inept" since we already added it) + -- If no valid skills were found, use the default fallback list if not foundAny then skills = {} for _, skill in ipairs(DEFAULT_SKILLS) do diff --git a/Roll.lua b/Roll.lua index 9fb29c5..49e890c 100644 --- a/Roll.lua +++ b/Roll.lua @@ -123,12 +123,16 @@ function AltSystem:CalculateAndDisplayResult(rollType, rollValue) local modifiers = {} + local isBaseRoll = skill and skill.name == "Base roll" + if rollType == "attack" then -- Attack Roll = roll + skill modifier + item modifier total = rollValue + skillMod + itemMod - breakdown = breakdown .. "\nSkill: " .. FormatModifier(skillMod) - table.insert(modifiers, { name = skill and skill.name or "Skill", value = skillMod }) + if not isBaseRoll then + breakdown = breakdown .. "\nSkill: " .. FormatModifier(skillMod) + table.insert(modifiers, { name = skill and skill.name or "Skill", value = skillMod }) + end if itemMod ~= 0 then breakdown = breakdown .. " | Item: " .. FormatModifier(itemMod) table.insert(modifiers, { name = item and item.name or "Item", value = itemMod }) @@ -143,8 +147,10 @@ function AltSystem:CalculateAndDisplayResult(rollType, rollValue) total = rollValue + skillMod + itemMod + defenseMod + shieldMod - breakdown = breakdown .. "\nSkill: " .. FormatModifier(skillMod) - table.insert(modifiers, { name = skill and skill.name or "Skill", value = skillMod }) + if not isBaseRoll then + breakdown = breakdown .. "\nSkill: " .. FormatModifier(skillMod) + table.insert(modifiers, { name = skill and skill.name or "Skill", value = skillMod }) + end if itemMod ~= 0 then breakdown = breakdown .. " | Item: " .. FormatModifier(itemMod) table.insert(modifiers, { name = item and item.name or "Item", value = itemMod }) diff --git a/UI.lua b/UI.lua index 74c45d4..8b7e8d8 100644 --- a/UI.lua +++ b/UI.lua @@ -16,7 +16,7 @@ local function BuildSkillOptions() for _, skill in ipairs(AltSystem.Data.Skills) do local sign = skill.modifier >= 0 and "+" or "" local text - if skill.level == "Inept" then + if skill.level == "Base" or skill.level == "Inept" then text = skill.name .. " (" .. sign .. skill.modifier .. ")" else text = skill.name .. " (" .. skill.level .. " " .. sign .. skill.modifier .. ")"