Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
- index 3a16536..1b148e4 100644
- --- a/src/server/game/Entities/Player/Player.cpp
- +++ b/src/server/game/Entities/Player/Player.cpp
- @@ -2271,8 +2271,52 @@ void Player::RegenerateAll()
- // Runes act as cooldowns, and they don't need to send any data
- if (getClass() == CLASS_DEATH_KNIGHT)
- for (uint32 i = 0; i < MAX_RUNES; ++i)
- - if (uint32 cd = GetRuneCooldown(i))
- - SetRuneCooldown(i, (cd > m_regenTimer) ? cd - m_regenTimer : 0);
- + {
- + switch (GetBaseRune(i))
- + {
- + case RUNE_BLOOD:
- + {
- + uint8 nextslot = (i > 0)? 0: 1;
- + if (GetRuneCooldown(nextslot) && GetRuneCooldown(nextslot) < GetRuneCooldown(i))
- + break;
- + if (uint32 cd = GetRuneCooldown(i))
- + {
- + uint32 _cd = (cd > m_regenTimer) ? cd - m_regenTimer : 0;
- + SetRuneCooldown(i, _cd);
- + }
- + break;
- + }
- + case RUNE_UNHOLY:
- + {
- + uint8 nextslot = (i > 2)? 2: 3;
- + if (GetRuneCooldown(nextslot) && GetRuneCooldown(nextslot) < GetRuneCooldown(i))
- + break;
- + if (uint32 cd = GetRuneCooldown(i))
- + {
- + uint32 _cd = (cd > m_regenTimer) ? cd - m_regenTimer : 0;
- + SetRuneCooldown(i, _cd);
- + }
- + break;
- + }
- + case RUNE_FROST:
- + {
- + uint8 nextslot = (i > 4)? 4: 5;
- + if (GetRuneCooldown(nextslot) && GetRuneCooldown(nextslot) < GetRuneCooldown(i))
- + break;
- + if (uint32 cd = GetRuneCooldown(i))
- + {
- + uint32 _cd = (cd > m_regenTimer) ? cd - m_regenTimer : 0;
- + SetRuneCooldown(i, _cd);
- + }
- + break;
- + }
- + }
- + /*if (uint32 cd = GetRuneCooldown(i))
- + {
- + uint32 _cd = (cd > m_regenTimer) ? cd - m_regenTimer : 0;
- + SetRuneCooldown(i, _cd);
- + }*/
- + }
- if (m_regenTimerCount >= 2000)
- {
- @@ -23328,6 +23373,10 @@ uint32 Player::GetRuneBaseCooldown(uint8 index)
- cooldown = cooldown*(100-(*i)->GetAmount())/100;
- }
- + float haste = GetFloatValue(UNIT_MOD_CAST_SPEED);
- +
- + cooldown -= cooldown * (1 - haste);
- +
- return cooldown;
- }
- @@ -23375,10 +23424,11 @@ void Player::ResyncRunes(uint8 count)
- data << uint32(count);
- for (uint32 i = 0; i < count; ++i)
- {
- - data << uint8(GetCurrentRune(i)); // rune type
- - data << uint8(255 - (GetRuneCooldown(i) * 51)); // passed cooldown time (0-255)
- - }
- - GetSession()->SendPacket(&data);
- + data << uint8(GetCurrentRune(i)); // rune type
- + float baseCd = float(GetRuneBaseCooldown(i));
- + data << uint8((baseCd - float(GetRuneCooldown(i))) / baseCd * 255);
- + }
- + GetSession()->SendPacket(&data);
- }
- void Player::AddRunePower(uint8 index)
- diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
- index e6f7d3d..c38e025 100644
- --- a/src/server/game/Entities/Unit/Unit.cpp
- +++ b/src/server/game/Entities/Unit/Unit.cpp
- @@ -643,8 +643,6 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
- case BASE_ATTACK:
- {
- weaponSpeedHitFactor = uint32(GetAttackTime(cleanDamage->attackType) / 1000.0f * 3.5f);
- - if (cleanDamage->hitOutCome == MELEE_HIT_CRIT)
- - weaponSpeedHitFactor *= 2;
- RewardRage(rage_damage, weaponSpeedHitFactor, true);
- @@ -653,8 +651,6 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
- case OFF_ATTACK:
- {
- weaponSpeedHitFactor = uint32(GetAttackTime(cleanDamage->attackType) / 1000.0f * 1.75f);
- - if (cleanDamage->hitOutCome == MELEE_HIT_CRIT)
- - weaponSpeedHitFactor *= 2;
- RewardRage(rage_damage, weaponSpeedHitFactor, true);
- @@ -7978,6 +7974,34 @@ bool Unit::HandleAuraProc(Unit * pVictim, uint32 damage, Aura * triggeredByAura,
- }
- case SPELLFAMILY_DEATHKNIGHT:
- {
- + //Runic Empowerment
- + if (dummySpell->Id == 81229)
- + {
- + if (GetTypeId() != TYPEID_PLAYER)
- + return false;
- +
- + if (HasAura(51459) || HasAura(51462)) //Runic Corruption (Rank 1&2)
- + CastSpell(this, 51460, true);
- + else
- + {
- + uint32 cooldownrunes[MAX_RUNES];
- + uint8 runescount = 0;
- + for (uint32 j = 0; j < MAX_RUNES; ++j)
- + {
- + if (ToPlayer()->GetRuneCooldown(j))
- + {
- + cooldownrunes[runescount] = j;
- + runescount++;
- + }
- + }
- + if (runescount > 0)
- + {
- + uint8 rndrune = urand(0,runescount-1);
- + ToPlayer()->SetRuneCooldown(cooldownrunes[rndrune], 0);
- + ToPlayer()->ResyncRunes(MAX_RUNES);
- + }
- + }
- + }
- // Blood of the North
- // Reaping
- // Death Rune Mastery
- diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
- index adc6401..e3b8d31 100644
- --- a/src/server/game/Spells/Spell.cpp
- +++ b/src/server/game/Spells/Spell.cpp
- @@ -4152,13 +4153,9 @@ void Spell::SendSpellGo()
- data << uint8(runeMaskAfterCast); // runes state after
- for (uint8 i = 0; i < MAX_RUNES; ++i)
- {
- - uint8 mask = (1 << i);
- - if (mask & runeMaskInitial && !(mask & runeMaskAfterCast)) // usable before andon cooldown now...
- - {
- - // float casts ensure the division is performed on floats as we need float result
- - float baseCd = float(player->GetRuneBaseCooldown(i));
- - data << uint8((baseCd - float(player->GetRuneCooldown(i))) / baseCd * 255); // rune cooldown passed
- - }
- + uint8 mask = (1 << i);
- + float baseCd = float(player->GetRuneBaseCooldown(i));
- + data << uint8((baseCd - float(player->GetRuneCooldown(i))) / baseCd * 255);
- }
- }
- diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
- index c924e21..7eb8580 100644
- --- a/src/server/game/Spells/SpellEffects.cpp
- +++ b/src/server/game/Spells/SpellEffects.cpp
- @@ -7565,6 +7566,7 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex)
- plr->SetRuneCooldown(i, 0);
- }
- }
- + plr->ResyncRunes(MAX_RUNES);
- }
- void Spell::EffectCreateTamedPet(SpellEffIndex effIndex)
Advertisement
Add Comment
Please, Sign In to add comment