diff --git a/src/game/Player.cpp b/src/game/Player.cpp index a6c3fe136..e6f38020f 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -19599,7 +19599,7 @@ void Player::SetTitle(CharTitlesEntry const* title, bool lost) GetSession()->SendPacket(&data); } -void Player::ConvertRune(uint8 index, uint8 newType) +void Player::ConvertRune(uint8 index, RuneType newType) { SetCurrentRune(index, newType); @@ -19627,6 +19627,15 @@ void Player::AddRunePower(uint8 index) GetSession()->SendPacket(&data); } +static RuneType runeSlotTypes[MAX_RUNES] = { + /*0*/ RUNE_BLOOD, + /*1*/ RUNE_BLOOD, + /*2*/ RUNE_UNHOLY, + /*3*/ RUNE_UNHOLY, + /*4*/ RUNE_FROST, + /*5*/ RUNE_FROST +}; + void Player::InitRunes() { if(getClass() != CLASS_DEATH_KNIGHT) @@ -19638,8 +19647,8 @@ void Player::InitRunes() for(uint32 i = 0; i < MAX_RUNES; ++i) { - SetBaseRune(i, i / 2); // init base types - SetCurrentRune(i, i / 2); // init current types + SetBaseRune(i, runeSlotTypes[i]); // init base types + SetCurrentRune(i, runeSlotTypes[i]); // init current types SetRuneCooldown(i, 0); // reset cooldowns m_runes->SetRuneState(i); } diff --git a/src/game/Player.h b/src/game/Player.h index f9a16aaec..59bd8fd49 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -2206,13 +2206,13 @@ class MANGOS_DLL_SPEC Player : public Unit DeclinedName const* GetDeclinedNames() const { return m_declinedname; } uint8 GetRunesState() const { return m_runes->runeState; } - uint8 GetBaseRune(uint8 index) const { return m_runes->runes[index].BaseRune; } - uint8 GetCurrentRune(uint8 index) const { return m_runes->runes[index].CurrentRune; } + RuneType GetBaseRune(uint8 index) const { return RuneType(m_runes->runes[index].BaseRune); } + RuneType GetCurrentRune(uint8 index) const { return RuneType(m_runes->runes[index].CurrentRune); } uint16 GetRuneCooldown(uint8 index) const { return m_runes->runes[index].Cooldown; } - void SetBaseRune(uint8 index, uint8 baseRune) { m_runes->runes[index].BaseRune = baseRune; } - void SetCurrentRune(uint8 index, uint8 currentRune) { m_runes->runes[index].CurrentRune = currentRune; } + 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, uint16 cooldown) { m_runes->runes[index].Cooldown = cooldown; m_runes->SetRuneState(index, (cooldown == 0) ? true : false); } - void ConvertRune(uint8 index, uint8 newType); + void ConvertRune(uint8 index, RuneType newType); void ResyncRunes(uint8 count); void AddRunePower(uint8 index); void InitRunes(); diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 9a3d39adf..978eb47c4 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -3540,7 +3540,7 @@ SpellCastResult Spell::CheckRuneCost(uint32 runeCostID) for(uint32 i = 0; i < MAX_RUNES; ++i) { - uint8 rune = plr->GetCurrentRune(i); + RuneType rune = plr->GetCurrentRune(i); if((plr->GetRuneCooldown(i) == 0) && (runeCost[rune] > 0)) runeCost[rune]--; } @@ -3583,7 +3583,7 @@ void Spell::TakeRunePower() for(uint32 i = 0; i < MAX_RUNES; ++i) { - uint8 rune = plr->GetCurrentRune(i); + RuneType rune = plr->GetCurrentRune(i); if((plr->GetRuneCooldown(i) == 0) && (runeCost[rune] > 0)) { plr->SetRuneCooldown(i, RUNE_COOLDOWN); // 5*2=10 sec @@ -3597,7 +3597,7 @@ void Spell::TakeRunePower() { for(uint32 i = 0; i < MAX_RUNES; ++i) { - uint8 rune = plr->GetCurrentRune(i); + RuneType rune = plr->GetCurrentRune(i); if((plr->GetRuneCooldown(i) == 0) && (rune == RUNE_DEATH)) { plr->SetRuneCooldown(i, RUNE_COOLDOWN); // 5*2=10 sec diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index ccd81025d..91927bb5e 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -7280,13 +7280,13 @@ void Aura::HandleAuraConvertRune(bool apply, bool Real) { if(!plr->GetRuneCooldown(i)) { - plr->ConvertRune(i, GetSpellProto()->EffectMiscValueB[m_effIndex]); + plr->ConvertRune(i, RuneType(GetSpellProto()->EffectMiscValueB[m_effIndex])); break; } } else { - if(plr->GetCurrentRune(i) == GetSpellProto()->EffectMiscValueB[m_effIndex]) + if(plr->GetCurrentRune(i) == RuneType(GetSpellProto()->EffectMiscValueB[m_effIndex])) { plr->ConvertRune(i, plr->GetBaseRune(i)); break; diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 537b15823..af978d288 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -6881,7 +6881,7 @@ void Spell::EffectActivateRune(uint32 eff_idx) for(uint32 j = 0; j < MAX_RUNES; ++j) { - if(plr->GetRuneCooldown(j) && plr->GetCurrentRune(j) == m_spellInfo->EffectMiscValue[eff_idx]) + if(plr->GetRuneCooldown(j) && plr->GetCurrentRune(j) == RuneType(m_spellInfo->EffectMiscValue[eff_idx])) { plr->SetRuneCooldown(j, 0); } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index a268ba1dc..61a379546 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8518" + #define REVISION_NR "8519" #endif // __REVISION_NR_H__