diff --git a/src/game/Player.cpp b/src/game/Player.cpp index f291a747c..818e863dd 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -20984,11 +20984,23 @@ void Player::ConvertRune(uint8 index, RuneType newType) GetSession()->SendPacket(&data); } -void Player::ResyncRunes(uint8 count) +void Player::ActivateRunes(RuneType type, uint32 count) { - WorldPacket data(SMSG_RESYNC_RUNES, 4 + count * 2); - data << uint32(count); - for(uint32 i = 0; i < count; ++i) + for(uint32 j = 0; count > 0 && j < MAX_RUNES; ++j) + { + if (GetRuneCooldown(j) && GetCurrentRune(j) == type) + { + SetRuneCooldown(j, 0); + --count; + } + } +} + +void Player::ResyncRunes() +{ + WorldPacket data(SMSG_RESYNC_RUNES, 4 + MAX_RUNES * 2); + data << uint32(MAX_RUNES); + for(uint32 i = 0; i < MAX_RUNES; ++i) { data << uint8(GetCurrentRune(i)); // rune type data << uint8(255 - ((GetRuneCooldown(i) / REGEN_TIME_FULL) * 51)); // passed cooldown time (0-255) diff --git a/src/game/Player.h b/src/game/Player.h index adaec2c4d..1e70f0117 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -2380,7 +2380,8 @@ class MANGOS_DLL_SPEC Player : public Unit 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, RuneType newType); - void ResyncRunes(uint8 count); + void ActivateRunes(RuneType type, uint32 count); + void ResyncRunes(); void AddRunePower(uint8 index); void InitRunes(); diff --git a/src/game/Spell.h b/src/game/Spell.h index e1c1a22ff..481b1426a 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -334,6 +334,7 @@ class Spell void EffectKillCredit(SpellEffectIndex eff_idx); void EffectQuestFail(SpellEffectIndex eff_idx); void EffectActivateRune(SpellEffectIndex eff_idx); + void EffectTeachTaxiNode(SpellEffectIndex eff_idx); void EffectTitanGrip(SpellEffectIndex eff_idx); void EffectEnchantItemPrismatic(SpellEffectIndex eff_idx); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index f4e638164..a5875fdb7 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -7912,13 +7912,9 @@ void Spell::EffectActivateRune(SpellEffectIndex eff_idx) if(plr->getClass() != CLASS_DEATH_KNIGHT) return; - for(uint32 j = 0; j < MAX_RUNES; ++j) - { - if(plr->GetRuneCooldown(j) && plr->GetCurrentRune(j) == RuneType(m_spellInfo->EffectMiscValue[eff_idx])) - { - plr->SetRuneCooldown(j, 0); - } - } + int32 count = damage; // max amount of reset runes + plr->ActivateRunes(RuneType(m_spellInfo->EffectMiscValue[eff_idx]), count); + plr->ResyncRunes(); } void Spell::EffectTitanGrip(SpellEffectIndex eff_idx) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index f9dfe9aee..8bd8b9603 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 "10545" + #define REVISION_NR "10546" #endif // __REVISION_NR_H__