diff options
author | maximius <none@none> | 2009-09-21 12:31:36 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-09-21 12:31:36 -0700 |
commit | 9e5c8db01f792231ecff7e3f60a31ebfea733ff1 (patch) | |
tree | 51a91be79cd07dc18955264bcc3d5944f5b21cad /src/game/Player.cpp | |
parent | f093c18ca105418ff921343c45cc9ac0c77ff455 (diff) |
*[8508] Not assign boolean value to integer variable, expecting to always be 0. Also renaming member variables. Author: NoFantasy
*[8516] Implement spell 53271. Author: Shendor
*[8519] Use RuneType enum where appropriate and more explicit data for rune init. Author: VladimirMangos
Thanks to: Stryker
*[8520] Limit telent 49182 and ranks triggering expected:wq runes cooldown case. Author: Shendor
*Fix Herald Volazj wrongly targeting himself on Shadow Bolt Volley instead of randomly targeting on Shiver, by tlexii.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r-- | src/game/Player.cpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 24c1604fe06..8db30d47e68 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -20861,7 +20861,7 @@ void Player::UpdateCharmedAI() } } -void Player::ConvertRune(uint8 index, uint8 newType) +void Player::ConvertRune(uint8 index, RuneType newType) { SetCurrentRune(index, newType); @@ -20889,6 +20889,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) @@ -20901,9 +20910,9 @@ 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 - SetRuneCooldown(i, 0); // reset cooldowns + SetBaseRune(i, runeSlotTypes[i]); // init base types + SetCurrentRune(i, runeSlotTypes[i]); // init current types + SetRuneCooldown(i, 0); // reset cooldowns m_runes->SetRuneState(i); } @@ -20911,6 +20920,15 @@ void Player::InitRunes() SetFloatValue(PLAYER_RUNE_REGEN_1 + i, 0.1f); } +bool Player::IsBaseRuneSlotsOnCooldown(RuneType runeType) const +{ + for(uint32 i = 0; i < MAX_RUNES; ++i) + if (GetBaseRune(i) == runeType && GetRuneCooldown(i) == 0) + return false; + + return true; +} + void Player::AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store, bool broadcast) { Loot loot; |