Skip to content

Instantly share code, notes, and snippets.

@wfarr
Created October 27, 2015 21:08
Show Gist options
  • Save wfarr/07088c8cbae9fa946784 to your computer and use it in GitHub Desktop.
Save wfarr/07088c8cbae9fa946784 to your computer and use it in GitHub Desktop.
drillSergeantAddOn = {
inRaid=false,
roleLines={
"damage"={
"It's impressive how bad your DPS is with that gear.",
},
"healing"={
"You call that healing?",
"If you're not careful, both tanks might outheal you there."
},
"tanking"={
"Do you think it'd be possible to take more unnecessary damage?",
"Maybe try popping a cooldown?",
},
}
};
local dsa = drillSergeantAddOn;
-- Checks if in raid group
dsa.inRaid = IsInRaid();
if (dsa.inRaid == true) then
-- grab the number of members in the raid
dsa.raidSize = GetNumGroupMembers();
-- select a random player
index = math.random(dsa.raidSize)
-- get information about that player
-- role appears to only be MAINTANK or TANK...
name, rank, subgroup, level, class, fileName, zone, online, isDead, role, isML = GetRaidRosterInfo(index)
-- using player name, we'll want to target the player
-- get that player's specialization, and grab the global ID for the spec
-- use GetSpecializationRoleByID(int) to figure out if it's tank/dps/hps
playerSpecRole = "tanking"
-- grab a phrase
j = length(dsa["roleLines"][playerSpecRole])
phrase = dsa["roleLines"][playerSpecRole][rand(0, j-1)]
SendChatMessage("Hey there, " .. name .. "! " .. phrase, "PARTY")
else
message("Not in a raid. Sorry there, chief.");
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment