Core/Spells: Implemented profession daily cooldowns

Closes #10883
This commit is contained in:
Shauren
2013-10-27 15:15:20 +01:00
parent 54cc7dcb41
commit 73e02597b6
2 changed files with 10 additions and 1 deletions
+2 -1
View File
@@ -430,7 +430,8 @@ enum MountFlags
enum SpellCategoryFlags
{
SPELL_CATEGORY_FLAG_COOLDOWN_SCALES_WITH_WEAPON_SPEED = 0x01, // unused
SPELL_CATEGORY_FLAG_COOLDOWN_STARTS_ON_EVENT = 0x04
SPELL_CATEGORY_FLAG_COOLDOWN_STARTS_ON_EVENT = 0x04,
SPELL_CATEGORY_FLAG_COOLDOWN_EXPIRES_AT_MIDNIGHT = 0x08
};
enum TotemCategoryType
@@ -22289,6 +22289,14 @@ void Player::AddSpellAndCategoryCooldowns(SpellInfo const* spellInfo, uint32 ite
if (catrec > 0)
catrec += categoryModifier;
}
SpellCategoryEntry const* categoryEntry = sSpellCategoryStore.LookupEntry(cat);
ASSERT(categoryEntry);
if (categoryEntry->Flags & SPELL_CATEGORY_FLAG_COOLDOWN_EXPIRES_AT_MIDNIGHT)
{
struct tm date = *localtime(&curTime);
catrec = catrec * DAY - (date.tm_hour * HOUR + date.tm_min * MINUTE + date.tm_sec) * IN_MILLISECONDS;
}
}
// replace negative cooldowns by 0