Advertisement
BlackMetalz

Untitled

Jan 13th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.39 KB | None | 0 0
  1. diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
  2. index 84ae300..0ec9529 100644
  3. --- a/src/server/game/DataStores/DBCStores.cpp
  4. +++ b/src/server/game/DataStores/DBCStores.cpp
  5. @@ -214,6 +214,7 @@ DBCStorage <SpellEquippedItemsEntry> sSpellEquippedItemsStore(SpellEquippedItems
  6. DBCStorage <SpellClassOptionsEntry> sSpellClassOptionsStore(SpellClassOptionsEntryfmt);
  7. DBCStorage <SpellCooldownsEntry> sSpellCooldownsStore(SpellCooldownsEntryfmt);
  8. DBCStorage <SpellAuraOptionsEntry> sSpellAuraOptionsStore(SpellAuraOptionsEntryfmt);
  9. +std::map<uint32, std::vector<SpellProcsPerMinuteModEntry const*>> sSpellProcsPerMinuteMods;
  10. DBCStorage <SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore(SpellAuraRestrictionsEntryfmt);
  11. DBCStorage <SpellCastingRequirementsEntry> sSpellCastingRequirementsStore(SpellCastingRequirementsEntryfmt);
  12.  
  13. @@ -1241,3 +1242,12 @@ uint32 GetPowerIndexByClass(uint32 powerType, uint32 classId)
  14. {
  15. return PowersByClass[classId][powerType];
  16. }
  17. +
  18. +std::vector<SpellProcsPerMinuteModEntry const*> GetSpellProcsPerMinuteMods(uint32 spellprocsPerMinuteId)
  19. +{
  20. + auto itr = sSpellProcsPerMinuteMods.find(spellprocsPerMinuteId);
  21. + if (itr != sSpellProcsPerMinuteMods.end())
  22. + return itr->second;
  23. +
  24. + return std::vector<SpellProcsPerMinuteModEntry const*>();
  25. +}
  26. \ No newline at end of file
  27. diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h
  28. index e5d467f..99eb611 100644
  29. --- a/src/server/game/DataStores/DBCStores.h
  30. +++ b/src/server/game/DataStores/DBCStores.h
  31. @@ -32,6 +32,7 @@ char const* GetPetName(uint32 petfamily, uint32 dbclang);
  32. SpellEffectEntry const* GetSpellEffectEntry(uint32 spellId, uint32 effect, uint32 difficulty);
  33. SpellEffectScalingEntry const* GetSpellEffectScalingEntry(uint32 effectId);
  34. SpellTotemsEntry const* GetSpellTotemEntry(uint32 spellId, uint8 totem);
  35. +std::vector<SpellProcsPerMinuteModEntry const*> GetSpellProcsPerMinuteMods(uint32 spellprocsPerMinuteId);
  36.  
  37. int32 GetAreaFlagByAreaID(uint32 area_id); // -1 if not found
  38. AreaTableEntry const* GetAreaEntryByAreaID(uint32 area_id);
  39. @@ -205,6 +206,7 @@ extern DBCStorage <SpellShapeshiftEntry> sSpellShapeshiftStore;
  40. extern DBCStorage <SpellShapeshiftFormEntry> sSpellShapeshiftFormStore;
  41. extern DBCStorage <SpellEntry> sSpellStore;
  42. extern DBCStorage <SpellAuraOptionsEntry> sSpellAuraOptionsStore;
  43. +extern DBCStorage <SpellProcsPerMinuteEntry> sSpellProcsPerMinuteStore;
  44. extern DBCStorage <SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore;
  45. extern DBCStorage <SpellCastingRequirementsEntry> sSpellCastingRequirementsStore;
  46. extern DBCStorage <SpellCategoriesEntry> sSpellCategoriesStore;
  47. diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h
  48. index aa35cc2..67a2627 100644
  49. --- a/src/server/game/DataStores/DBCStructure.h
  50. +++ b/src/server/game/DataStores/DBCStructure.h
  51. @@ -2474,6 +2474,24 @@ struct SpellAuraOptionsEntry
  52. uint32 spellProcsPerMinuteId; // 8
  53. };
  54.  
  55. +// SpellProcsPerMinute.dbc
  56. +struct SpellProcsPerMinuteEntry
  57. +{
  58. + uint32 Id; // 0 m_ID
  59. + float ProcsPerMinute; // 1 m_procsPerMinute
  60. + uint32 Flags; // 2
  61. +};
  62. +
  63. +// SpellProcsPerMinute.dbc
  64. +struct SpellProcsPerMinuteModEntry
  65. +{
  66. + uint32 Id; // 0
  67. + uint32 Type; // 1
  68. + uint32 Param; // 2
  69. + float Coeff; // 3
  70. + uint32 SpellProcsPerMinuteID; // 4
  71. +};
  72. +
  73. // SpellAuraRestrictions.dbc/
  74. // @author Selenium: 5.4 valid
  75. struct SpellAuraRestrictionsEntry
  76. diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
  77. index 0326af5..fb85559 100644
  78. --- a/src/server/game/Spells/SpellInfo.cpp
  79. +++ b/src/server/game/Spells/SpellInfo.cpp
  80. @@ -936,10 +936,14 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, uint32 difficulty)
  81.  
  82. // SpellAuraOptionsEntry
  83. SpellAuraOptionsEntry const* _options = GetSpellAuraOptions();
  84. + SpellProcsPerMinuteEntry const* _ppm = _options ? sSpellProcsPerMinuteStore.LookupEntry(_options->spellProcsPerMinuteId) : nullptr;
  85. ProcFlags = _options ? _options->procFlags : 0;
  86. ProcChance = _options ? _options->procChance : 0;
  87. ProcCharges = _options ? _options->procCharges : 0;
  88. StackAmount = _options ? _options->StackAmount : 0;
  89. + ProcsPerMinute = _ppm ? _ppm->ProcsPerMinute : 0.0f;
  90. + if (_options)
  91. + ProcPPMMods = GetSpellProcsPerMinuteMods(_options->spellProcsPerMinuteId);
  92.  
  93. // SpellAuraRestrictionsEntry
  94. SpellAuraRestrictionsEntry const* _aura = GetSpellAuraRestrictions();
  95. diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h
  96. index f58a3ea..dd9a2b1 100644
  97. --- a/src/server/game/Spells/SpellInfo.h
  98. +++ b/src/server/game/Spells/SpellInfo.h
  99. @@ -348,6 +348,8 @@ public:
  100. SpellRangeEntry const* RangeEntry;
  101. float Speed;
  102. uint32 StackAmount;
  103. + float ProcsPerMinute;
  104. + std::vector<SpellProcsPerMinuteModEntry const*> ProcPPMMods;
  105. uint32 Totem[2];
  106. int32 Reagent[MAX_SPELL_REAGENTS];
  107. uint32 ReagentCount[MAX_SPELL_REAGENTS];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement