MichaelCrow

Untitled

Sep 28th, 2012
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  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. if (talentInfo->Row > 0)
  12. {
  13. uint32 numRows = sTalentStore.GetNumRows();
  14. for (uint32 i = 0; i < numRows; i++) // Loop through all talents.
  15. {
  16. // Someday, someone needs to revamp
  17. const TalentEntry* tmpTalent = sTalentStore.LookupEntry(i);
  18. if (tmpTalent) // the way talents are tracked
  19. {
  20. if (tmpTalent->TalentTab == tTab)
  21. {
  22. for (uint8 rank = 0; rank < MAX_TALENT_RANK; rank++)
  23. {
  24. if (tmpTalent->RankID[rank] != 0)
  25. {
  26. if (pPlayer->HasSpell(tmpTalent->RankID[rank]))
  27. {
  28. points += (rank + 1);
  29. }
  30. }
  31. }
  32. }
  33. }
  34. }
  35. }
  36. if (points > 11)
  37. return true;
  38. return false;
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment