Clone of PhatAC @ https://github.com/floaterxk/PhatAC

Attributes.cpp 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #include "StdAfx.h"
  2. #include "attributes.h"
  3. #include "TurbineXPTable.h"
  4. #include "Rules.h"
  5. DWORD GetAttributeXP(DWORD Level)
  6. {
  7. XPTABLE* pXPTable = g_pGameRules->GetXPTable();
  8. if (pXPTable)
  9. return pXPTable->GetAttributeXP(Level);
  10. else
  11. return 0;
  12. }
  13. DWORD GetAttributeLevel(DWORD XP)
  14. {
  15. XPTABLE* pXPTable = g_pGameRules->GetXPTable();
  16. if (pXPTable)
  17. return pXPTable->GetAttributeLevel(XP);
  18. else
  19. return 0;
  20. }
  21. DWORD GetAttributeMax()
  22. {
  23. XPTABLE* pXPTable = g_pGameRules->GetXPTable();
  24. if (pXPTable)
  25. return pXPTable->GetAttributeMax();
  26. else
  27. return 0;
  28. }
  29. DWORD GetAttributeMaxXP()
  30. {
  31. XPTABLE* pXPTable = g_pGameRules->GetXPTable();
  32. if (pXPTable)
  33. return pXPTable->GetAttributeMaxXP();
  34. else
  35. return 0;
  36. }
  37. const char* GetAttributeName(eAttribute index)
  38. {
  39. switch (index)
  40. {
  41. case eStrength: return "Strength";
  42. case eEndurance: return "Endurance";
  43. case eCoordination: return "Coordination";
  44. case eQuickness: return "Quickness";
  45. case eFocus: return "Focus";
  46. case eSelf: return "Self";
  47. default: return "";
  48. }
  49. }
  50. DWORD GetAttributeMax(ATTRIBUTE *pAttrib, float fVitae)
  51. {
  52. return (pAttrib->data.base + pAttrib->data.raises);
  53. }