Returns the level range in which a quest below the player's level still rewards XP. If a quest's level is up to range levels below the player's level, the quest is considered easy but still rewards experience points upon completion; these quests are colored green in the default UI's quest log. (Quests more than range levels below the player's are colored gray in the default UI and reward no XP.)


See also Quest functions.

Signature:

range = GetQuestGreenRange()

Returns:

  • range - Maximum difference between player level and a lower quest level for a quest to reward experience (number)

Examples:

-- function used to color quest log entries in the default UI
function GetDifficultyColor(level)
  local levelDiff = level - UnitLevel("player");
  local color
  if ( levelDiff >= 5 ) then
    color = QuestDifficultyColor["impossible"];
  elseif ( levelDiff >= 3 ) then
    color = QuestDifficultyColor["verydifficult"];
  elseif ( levelDiff >= -2 ) then
    color = QuestDifficultyColor["difficult"];
  elseif ( -levelDiff <= GetQuestGreenRange() ) then
    color = QuestDifficultyColor["standard"];
  else
    color = QuestDifficultyColor["trivial"];
  end
  return color;
end