Core/Players: Fixed DK runes and runic power

Closes #19595
This commit is contained in:
Shauren
2017-11-12 02:42:06 +01:00
parent bf0ae32d18
commit 331c70e695
9 changed files with 89 additions and 140 deletions

View File

@@ -1006,13 +1006,6 @@ public:
return false;
Player* target = handler->getSelectedPlayerOrSelf();
if (!target)
{
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
handler->SetSentErrorMessage(true);
return false;
}
if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
return false;

View File

@@ -91,11 +91,12 @@ public:
{
if (Unit* caster = eventInfo.GetActor())
{
if (caster->GetTypeId() != TYPEID_PLAYER || caster->getClass() != CLASS_DEATH_KNIGHT)
Player* player = caster->ToPlayer();
if (!player || caster->getClass() != CLASS_DEATH_KNIGHT)
return false;
for (uint8 i = 0; i < MAX_RUNES; ++i)
if (caster->ToPlayer()->GetRuneCooldown(i) == 0)
for (uint8 i = 0; i < player->GetMaxPower(POWER_RUNES); ++i)
if (player->GetRuneCooldown(i) == 0)
return false;
return true;