Advertisement
Parranoia

HasSpec

Oct 25th, 2012
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bool HasSpec(Player* pPlayer, uint32 talentID)
  2. {
  3.  TalentEntry const* talentInfo = sTalentStore.LookupEntry(talentID);
  4.  
  5.     if (!talentInfo) // You gave me the wrong ID
  6.         return false;
  7.  
  8.  uint32 points = 0;
  9.  
  10.  uint32 tTab = talentInfo->TalentTab;
  11.  
  12.  uint32 numRows = sTalentStore.GetNumRows();
  13.  for (uint32 i = 0; i < numRows; i++)          // Loop through all talents.
  14. {
  15.     // Someday, someone needs to revamp
  16.     const TalentEntry* tmpTalent = sTalentStore.LookupEntry(i);
  17.     if (tmpTalent)                                  // the way talents are tracked
  18.     {
  19.         if (tmpTalent->TalentTab == tTab)
  20.          {
  21.              for (uint8 rank = 0; rank < MAX_TALENT_RANK; rank++)
  22.             {
  23.                 if (tmpTalent->RankID[rank] != 0)
  24.                  {
  25.                      if (pPlayer->HasSpell(tmpTalent->RankID[rank]))
  26.                      {
  27.                          points += (rank + 1);
  28.                      }
  29.                  }
  30.              }
  31.          }
  32.      }
  33.  }
  34.  if (points > 5)
  35.      return true;
  36.  return false;
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement