Skip to content

Commit

Permalink
[10548] Implement missing part spell 47568 functionality.
Browse files Browse the repository at this point in the history
Original patch prowided by False.Genesis.
  • Loading branch information
VladimirMangos committed Sep 26, 2010
1 parent 662cf42 commit e528090
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/game/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20984,16 +20984,20 @@ void Player::ConvertRune(uint8 index, RuneType newType)
GetSession()->SendPacket(&data);
}

void Player::ActivateRunes(RuneType type, uint32 count)
bool Player::ActivateRunes(RuneType type, uint32 count)
{
bool modify = false;
for(uint32 j = 0; count > 0 && j < MAX_RUNES; ++j)
{
if (GetRuneCooldown(j) && GetCurrentRune(j) == type)
{
SetRuneCooldown(j, 0);
--count;
modify = true;
}
}

return modify;
}

void Player::ResyncRunes()
Expand Down
2 changes: 1 addition & 1 deletion src/game/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -2380,7 +2380,7 @@ 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 ActivateRunes(RuneType type, uint32 count);
bool ActivateRunes(RuneType type, uint32 count);
void ResyncRunes();
void AddRunePower(uint8 index);
void InitRunes();
Expand Down
17 changes: 15 additions & 2 deletions src/game/SpellEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2731,6 +2731,19 @@ void Spell::EffectTriggerSpell(SpellEffectIndex effIndex)
pet->CastSpell(pet, 28305, true);
return;
}
// Empower Rune Weapon
case 53258:
{
// remove cooldown of frost/death, undead/blood activated in main spell
if (unitTarget->GetTypeId() == TYPEID_PLAYER)
{
bool res1 = ((Player*)unitTarget)->ActivateRunes(RUNE_FROST, 2);
bool res2 = ((Player*)unitTarget)->ActivateRunes(RUNE_DEATH, 2);
if (res1 || res2)
((Player*)unitTarget)->ResyncRunes();
}
return;
}
}

// normal case
Expand Down Expand Up @@ -7913,8 +7926,8 @@ void Spell::EffectActivateRune(SpellEffectIndex eff_idx)
return;

int32 count = damage; // max amount of reset runes
plr->ActivateRunes(RuneType(m_spellInfo->EffectMiscValue[eff_idx]), count);
plr->ResyncRunes();
if (plr->ActivateRunes(RuneType(m_spellInfo->EffectMiscValue[eff_idx]), count))
plr->ResyncRunes();
}

void Spell::EffectTitanGrip(SpellEffectIndex eff_idx)
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10547"
#define REVISION_NR "10548"
#endif // __REVISION_NR_H__

0 comments on commit e528090

Please sign in to comment.