Traits.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. EQ2Emulator: Everquest II Server Emulator
  3. Copyright (C) 2007 EQ2EMulator Development Team (http://www.eq2emulator.net)
  4. This file is part of EQ2Emulator.
  5. EQ2Emulator is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. EQ2Emulator is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with EQ2Emulator. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifndef __Traits__
  17. #define __Traits__
  18. #include <vector>
  19. #include "../../common/types.h"
  20. #include "../../common/EQPacket.h"
  21. #include "../client.h"
  22. struct TraitData
  23. {
  24. int32 spellID ;
  25. int8 level;
  26. int8 classReq;
  27. int8 raceReq;
  28. bool isTrait;
  29. bool isInate;
  30. bool isFocusEffect;
  31. bool isTraining;
  32. int8 tier;
  33. int8 group;
  34. };
  35. #define TRAITS_ATTRIBUTES 0
  36. #define TRAITS_COMBAT 1
  37. #define TRAITS_NONCOMBAT 2
  38. #define TRAITS_POOLS 3
  39. #define TRAITS_RESIST 4
  40. #define TRAITS_TRADESKILL 5
  41. class MasterTraitList
  42. {
  43. public:
  44. MasterTraitList();
  45. ~MasterTraitList();
  46. /// <summary>Sorts the traits for the given client and creats and sends the trait packet.</summary>
  47. /// <param name='client'>The Client calling this function</param>
  48. /// <returns>EQ2Packet*</returns>
  49. EQ2Packet* GetTraitListPacket(Client* client);
  50. /// <summary>Add trait data to the global list.</summary>
  51. /// <param name='data'>The trait data to add.</param>
  52. void AddTrait(TraitData* data);
  53. /// <summary>Get the total number of traits in the global list.</summary>
  54. int Size();
  55. /// <summary>Get the trait data for the given spell.</summary>
  56. /// <param name='spellID'>Spell ID to get trait data for.</param>
  57. TraitData* GetTrait(int32 spellID);
  58. /// <summary>Empties the master trait list</summary>
  59. void DestroyTraits();
  60. private:
  61. vector <TraitData*> TraitList;
  62. Mutex MMasterTraitList;
  63. };
  64. #endif