diff options
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r-- | src/game/Player.cpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 24c1604fe06..8db30d47e68 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -20861,7 +20861,7 @@ void Player::UpdateCharmedAI() } } -void Player::ConvertRune(uint8 index, uint8 newType) +void Player::ConvertRune(uint8 index, RuneType newType) { SetCurrentRune(index, newType); @@ -20889,6 +20889,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) @@ -20901,9 +20910,9 @@ 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 - SetRuneCooldown(i, 0); // reset cooldowns + SetBaseRune(i, runeSlotTypes[i]); // init base types + SetCurrentRune(i, runeSlotTypes[i]); // init current types + SetRuneCooldown(i, 0); // reset cooldowns m_runes->SetRuneState(i); } @@ -20911,6 +20920,15 @@ void Player::InitRunes() SetFloatValue(PLAYER_RUNE_REGEN_1 + i, 0.1f); } +bool Player::IsBaseRuneSlotsOnCooldown(RuneType runeType) const +{ + for(uint32 i = 0; i < MAX_RUNES; ++i) + if (GetBaseRune(i) == runeType && GetRuneCooldown(i) == 0) + return false; + + return true; +} + void Player::AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store, bool broadcast) { Loot loot; |