mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
Core/Spells: fixed cooldowns of weekly profession spells. The cooldown will now start by the time the item gets created and lasts for a whole week
This commit is contained in:
@@ -1305,6 +1305,23 @@ EmotesTextSoundEntry const* FindTextSoundEmoteFor(uint32 emote, uint32 race, uin
|
||||
return itr != sEmotesTextSoundMap.end() ? itr->second : nullptr;
|
||||
}
|
||||
|
||||
uint32 GetParentSpellCategoryId(uint32 childCategory)
|
||||
{
|
||||
// Weekly profession reset linking
|
||||
switch (childCategory)
|
||||
{
|
||||
case 1278: // Dream of Skywall
|
||||
case 1279: // Dream of Azshara
|
||||
case 1280: // Dream of Ragnaros
|
||||
case 1281: // Dream of Deepholm
|
||||
case 1282: // Dream of Hyjal
|
||||
return 1328;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool IsInArea(uint32 objectAreaId, uint32 areaId)
|
||||
{
|
||||
do
|
||||
|
||||
@@ -89,6 +89,8 @@ TC_GAME_API ResponseCodes ValidateName(std::wstring const& name, LocaleConstant
|
||||
|
||||
TC_GAME_API EmotesTextSoundEntry const* FindTextSoundEmoteFor(uint32 emote, uint32 race, uint32 gender);
|
||||
|
||||
TC_GAME_API uint32 GetParentSpellCategoryId(uint32 childCategory);
|
||||
|
||||
TC_GAME_API extern DBCStorage <AchievementEntry> sAchievementStore;
|
||||
TC_GAME_API extern DBCStorage <AnimKitEntry> sAnimKitStore;
|
||||
TC_GAME_API extern DBCStorage <AchievementCriteriaEntry> sAchievementCriteriaStore;
|
||||
|
||||
@@ -2151,7 +2151,7 @@ struct SpellCategoryEntry
|
||||
{
|
||||
uint32 Id;
|
||||
uint32 Flags;
|
||||
// uint32 unk;
|
||||
uint32 UsesPerWeek;
|
||||
// char* Name;
|
||||
};
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ char const SkillTiersfmt[] = "nxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiii";
|
||||
char const SoundEntriesfmt[] = "nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
char const SpellCastTimefmt[] = "nixx";
|
||||
char const SpellCategoriesEntryfmt[] = "diiiiii";
|
||||
char const SpellCategoryfmt[] = "nixx";
|
||||
char const SpellCategoryfmt[] = "niix";
|
||||
char const SpellDifficultyfmt[] = "niiii";
|
||||
const std::string CustomSpellDifficultyfmt = "ppppp";
|
||||
const std::string CustomSpellDifficultyIndex = "id";
|
||||
|
||||
@@ -350,7 +350,15 @@ void SpellHistory::StartCooldown(SpellInfo const* spellInfo, uint32 itemId, Spel
|
||||
|
||||
SpellCategoryEntry const* categoryEntry = sSpellCategoryStore.AssertEntry(categoryId);
|
||||
if (categoryEntry->Flags & SPELL_CATEGORY_FLAG_COOLDOWN_EXPIRES_AT_DAILY_RESET)
|
||||
categoryCooldown = int32(std::chrono::duration_cast<std::chrono::milliseconds>(Clock::from_time_t(sWorld->GetNextDailyQuestsResetTime()) - Clock::now()).count());
|
||||
{
|
||||
uint32 parentCategoryId = GetParentSpellCategoryId(categoryEntry->Id);
|
||||
SpellCategoryEntry const* parentCategory = sSpellCategoryStore.LookupEntry(parentCategoryId);
|
||||
|
||||
if (parentCategory && parentCategory->UsesPerWeek)
|
||||
categoryCooldown = WEEK * IN_MILLISECONDS;
|
||||
else
|
||||
categoryCooldown = int32(std::chrono::duration_cast<std::chrono::milliseconds>(Clock::from_time_t(sWorld->GetNextDailyQuestsResetTime()) - Clock::now()).count());
|
||||
}
|
||||
}
|
||||
|
||||
// replace negative cooldowns by 0
|
||||
|
||||
Reference in New Issue
Block a user