Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow players to set their own Blessing assignments by whispering #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

icyz
Copy link

@icyz icyz commented Apr 16, 2022

set normal bless using whispering e.g. "/w paladin !BOK" will set Bless of King for the player who whisp

icyz added 3 commits April 16, 2022 22:54
set normal bless using whispering e.g. "/w paladin !BOK" will set Bless of King for the player who whisp
@Treeston Treeston changed the title Whisper Allow players to set their own Blessing assignments by whispering Apr 16, 2022
@@ -1618,6 +1619,78 @@ function PallyPower:CHAT_MSG_SYSTEM(event, text)
end
end

-- set normal bless using whispering e.g. "/w paladin !BOK" will set Bless of King for the player who whisp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also add a message filter (cf. ChatFrame_AddMessageEventFilter) to hide these whispers and the auto-replies

PallyPowerValues.lua Show resolved Hide resolved
normalBlessText = ""
end

SendChatMessage(pally .. " -> " .. PallyPower.IDToBless[PallyPower_Assignments[pally][PallyPower.ClassToID[englishClass]]] .. normalBlessText, "WHISPER", "Common", playerName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arg3 = nil for default language, don't hardcode Common, this won't work for horde

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also do we need a separate chat message for each paladin in the raid? concatenate this into a single reply, otherwise you'll quickly get spam filtered if many raiders use this (and you have lots of paladins in vanilla)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also this line of code is very unreadable, split it up

-- self:Print(playerGuid)

if playerGuid then
local localizedClass, englishClass, localizedRace, englishRace, sex, playerName, realm = GetPlayerInfoByGUID(playerGuid)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we almost definitely already have this data somewhere; check the roster functions

text = string.upper(text)
local blessID, blessName

if sfind(text, "!WISDOM") then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use text:find("^%s*!WISDOM") to only match at start of string

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also localization concerns once again, what about players not playing in english?


blessName = PallyPower.IDToBless[blessID]

if blessID > 0 then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just return out

for pally in pairs(AllPallys) do

if PallyPower_Assignments[pally][PallyPower.ClassToID[englishClass]] then
-- self:Print(PallyPower_Assignments[pally][PallyPower.ClassToID[englishClass]])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get rid of your debug comments please

SetNormalBlessings(PallyPower.player, PallyPower.ClassToID[englishClass], playerName, blessID)

self:Print(playerName .. " has now assigned " .. blessName .. " bless (small)")
SendChatMessage("You have now assigned " .. blessName .. " bless (small)", "WHISPER", "Common", playerName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as before, don't hardcode arg3

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also localization concerns here

self:Print(playerName .. " has now assigned " .. blessName .. " bless (small)")
SendChatMessage("You have now assigned " .. blessName .. " bless (small)", "WHISPER", "Common", playerName)
else
self:Print("Player not found. Is he/she in your group?")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if a player is shown this message, what are they supposed to do about it?

either silently discard or error reply to the sender, don't show anything to user

@@ -1618,6 +1619,78 @@ function PallyPower:CHAT_MSG_SYSTEM(event, text)
end
end

-- set normal bless using whispering e.g. "/w paladin !BOK" will set Bless of King for the player who whisp
function PallyPower:CHAT_MSG_WHISPER(event, text, a, b, c, wguid)
if text then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text cannot be nil

@Slivo-fr
Copy link

Slivo-fr commented Jul 20, 2022

I'm skeptical about this, there will be loads of raiders that will ask the wrong pally to switch assignment or override intended blessing by the raid leaders. I think there is a reason why PallyPower require a raid assist role to mess with assignments.
For example I don't want my warrior to silently self remove their salvation for BOK or AP.

@Treeston
Copy link
Contributor

well, tying it to the existing free assign switch would solve that problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants