[8519] Use RuneType enum where appropriate and more explicit data for rune init.

This commit is contained in:
VladimirMangos 2009-09-21 12:11:28 +04:00
parent e4ed2ce29c
commit 1c59403b39
6 changed files with 24 additions and 15 deletions

View file

@ -19599,7 +19599,7 @@ void Player::SetTitle(CharTitlesEntry const* title, bool lost)
GetSession()->SendPacket(&data);
}
void Player::ConvertRune(uint8 index, uint8 newType)
void Player::ConvertRune(uint8 index, RuneType newType)
{
SetCurrentRune(index, newType);
@ -19627,6 +19627,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)
@ -19638,8 +19647,8 @@ 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
SetBaseRune(i, runeSlotTypes[i]); // init base types
SetCurrentRune(i, runeSlotTypes[i]); // init current types
SetRuneCooldown(i, 0); // reset cooldowns
m_runes->SetRuneState(i);
}