flold

Untitled

Jun 3rd, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.79 KB | None | 0 0
  1.  
  2.     -- Inactive check.  Let's me disable a task for all toons
  3.  
  4.     -- WhiteLists check
  5.     -- If there is a WhiteList for this task, and this toon is not in the WhiteList, return false
  6.  
  7.     -- BlackLists check
  8.  
  9.     -- Faction check
  10.  
  11.     -- Class check
  12.  
  13.     -- Level check
  14.     if Task.MinLevel or Task.MaxLevel then
  15.  
  16.     -- iLevel check
  17.     if Task.MiniLevel or Task.MaxiLevel then
  18.  
  19.     -- Profession check
  20.  
  21.     -- MarkCompletedIfKnowSpellId check
  22.  
  23.     -- Hunter Pet Check
  24.  
  25.     -- Guild Check
  26.  
  27.     -- Dual Spec Check
  28.  
  29.  
  30.     -- Garrison check
  31.     if Task.BuildingName then
  32.         if (not Task.BuildingMinLevel) or (BuildingInfo.rank >= Task.BuildingMinLevel) then
  33.  
  34.     -- Reputation Check
  35.     if Task.Reputation then
  36.         local _, _, rep = DataStore:GetRawReputationInfo(character, Task.Reputation.Faction)
  37.         if not rep or (rep < Task.Reputation.ReputationLevel) then
  38.             return false
  39.         end
  40.     end
  41.  
  42.     -- Shipyard Oil Rig
  43.  
  44.     -- Trade Agreement from  Arakkoa Outcasts
  45.  
  46.     -- The Awakener Ship:  Order of the Awakened
  47.  
  48.     -- Garrison Cache.  Disable if have less than 400 resource to pick up or if already have max that I can carry (got tired of logging in just to pick up resources).
  49.     if EA_Task.taskName == 'Cache Pick Up' then
  50.         local GarrisonResources = DataStore:GetUncollectedResources(character)
  51.         if GarrisonResources < 400 then
  52.             return false
  53.         else
  54.             local GarrisonResourcesID = 824
  55.             local amount, earnedThisWeek, weeklyMax, totalMax = DataStore:GetCurrencyTotals(character, GarrisonResourcesID)
  56.             if amount >= totalMax then
  57.                 return false
  58.             end
  59.         end
  60.     end
  61.  
  62.     -- Equip Heirlooms in all possible slots
  63.     if EA_Task.taskName == "Equip Heirlooms in all possible slots" then
  64.         local MinNumOfHeirloomsForFalse = 10        -- Toon must have at least 10 heirlooms equipped, if not this entry will be true
  65.         if DataStore:GetCharacterClass(character) == 'Rogue' then
  66.             MinNumOfHeirloomsForFalse = 11
  67.         end
  68.  
  69.         -- Count number of equipped heirlooms
  70.         local InventoryItems = DataStore:GetInventory(character)
  71.         local NumHeirloomsEquipped = 0
  72.         for slot, ItemID in pairs(InventoryItems) do
  73.             local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture, itemSellPrice = GetItemInfo(ItemID)
  74.             if itemRarity and (itemRarity == 7) then
  75.                 NumHeirloomsEquipped = NumHeirloomsEquipped + 1
  76.             end
  77.         end
  78.         if NumHeirloomsEquipped >= MinNumOfHeirloomsForFalse then
  79.             return false
  80.         end
  81.     end
  82.  
  83.     -- Follower Check - recruit followers
  84.  
  85.     -- Followers At iLevel675 check
  86.  
  87.     -- Followers At Level100 check
  88.    
  89.     -- LFR Dungeon Check
  90.     if Task.LFR_DungeonID and Task.LFR_EncounterIndex then
  91.         if self:IsBossDead(ToonRealm, Task.LFR_DungeonID, Task.LFR_EncounterIndex) then
  92.             return false
  93.         end
  94.     end
  95.  
  96.     -- if toon passed all the checks, return true so the task will be enabled.
  97.     return true
Advertisement
Add Comment
Please, Sign In to add comment