-
Notifications
You must be signed in to change notification settings - Fork 8
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
base: master
Are you sure you want to change the base?
Conversation
set normal bless using whispering e.g. "/w paladin !BOK" will set Bless of King for the player who whisp
@@ -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 |
There was a problem hiding this comment.
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
normalBlessText = "" | ||
end | ||
|
||
SendChatMessage(pally .. " -> " .. PallyPower.IDToBless[PallyPower_Assignments[pally][PallyPower.ClassToID[englishClass]]] .. normalBlessText, "WHISPER", "Common", playerName) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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]]) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?") |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
text cannot be nil
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. |
well, tying it to the existing free assign switch would solve that problem |
set normal bless using whispering e.g. "/w paladin !BOK" will set Bless of King for the player who whisp