Treat rune cooldowns as timers and not as remaining tick counts

Implement support for modifiers changing rune regeneration rate
Apply all spells from Improved Unholy Aura

--HG--
branch : trunk
This commit is contained in:
thenecromancer
2010-02-18 01:06:47 +01:00
parent 54d8411eb9
commit cedf706f29
5 changed files with 31 additions and 17 deletions
+5 -4
View File
@@ -281,7 +281,7 @@ struct Areas
};
#define MAX_RUNES 6
#define RUNE_COOLDOWN 5 // 5*2=10 sec
#define RUNE_COOLDOWN 10000
enum RuneType
{
@@ -296,7 +296,7 @@ struct RuneInfo
{
uint8 BaseRune;
uint8 CurrentRune;
uint8 Cooldown;
uint32 Cooldown;
AuraEffect const * ConvertAura;
};
@@ -2259,13 +2259,14 @@ class Player : public Unit, public GridObject<Player>
uint8 GetRunesState() const { return m_runes->runeState; }
RuneType GetBaseRune(uint8 index) const { return RuneType(m_runes->runes[index].BaseRune); }
RuneType GetCurrentRune(uint8 index) const { return RuneType(m_runes->runes[index].CurrentRune); }
uint8 GetRuneCooldown(uint8 index) const { return m_runes->runes[index].Cooldown; }
uint32 GetRuneCooldown(uint8 index) const { return m_runes->runes[index].Cooldown; }
uint32 GetRuneBaseCooldown(uint8 index);
bool IsBaseRuneSlotsOnCooldown(RuneType runeType) const;
RuneType GetLastUsedRune() { return m_runes->lastUsedRune; }
void SetLastUsedRune(RuneType type) { m_runes->lastUsedRune = type; }
void SetBaseRune(uint8 index, RuneType baseRune) { m_runes->runes[index].BaseRune = baseRune; }
void SetCurrentRune(uint8 index, RuneType currentRune) { m_runes->runes[index].CurrentRune = currentRune; }
void SetRuneCooldown(uint8 index, uint8 cooldown) { m_runes->runes[index].Cooldown = cooldown; m_runes->SetRuneState(index, (cooldown == 0) ? true : false); }
void SetRuneCooldown(uint8 index, uint32 cooldown) { m_runes->runes[index].Cooldown = cooldown; m_runes->SetRuneState(index, (cooldown == 0) ? true : false); }
void SetRuneConvertAura(uint8 index, AuraEffect const * aura) { m_runes->runes[index].ConvertAura = aura; }
void AddRuneByAuraEffect(uint8 index, RuneType newType, AuraEffect const * aura) { SetRuneConvertAura(index, aura); ConvertRune(index, newType); }
void RemoveRunesByAuraEffect(AuraEffect const * aura);