diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 5fd97a769..f5f4bc45b 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -18896,11 +18896,11 @@ void Player::InitRunes() for(uint32 i = 0; i < MAX_RUNES; ++i) { - SetBaseRune(i, i / 2); - SetCurrentRune(i, i / 2); - SetRuneCooldown(i, 0); + SetBaseRune(i, i / 2); // init base types + SetCurrentRune(i, i / 2); // init current types + SetRuneCooldown(i, 0); // reset cooldowns } - for(uint32 i = 0; i < NUM_RUNES; ++i) + for(uint32 i = 0; i < NUM_RUNE_TYPES; ++i) SetFloatValue(PLAYER_RUNE_REGEN_1 + i, 0.1f); } diff --git a/src/game/Player.h b/src/game/Player.h index 7f1844e96..f46b8796e 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -224,15 +224,16 @@ struct Areas float y2; }; -#define MAX_RUNES 6 +#define MAX_RUNES 6 +#define RUNE_COOLDOWN 5 // 5*2=10 sec enum RuneType { - RUNE_BLOOD = 0, - RUNE_FROST = 1, - RUNE_UNHOLY = 2, - RUNE_DEATH = 3, - NUM_RUNES = 4 + RUNE_BLOOD = 0, + RUNE_FROST = 1, + RUNE_UNHOLY = 2, + RUNE_DEATH = 3, + NUM_RUNE_TYPES = 4 }; struct RuneInfo diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 4ee734d57..e1646f14e 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -3157,7 +3157,7 @@ uint8 Spell::CheckRuneCost(uint32 runeCostID) if(src->NoRuneCost()) return 0; - int32 runeCost[NUM_RUNES]; // blood, frost, unholy, death + int32 runeCost[NUM_RUNE_TYPES]; // blood, frost, unholy, death for(uint32 i = 0; i < RUNE_DEATH; ++i) runeCost[i] = src->RuneCost[i]; @@ -3193,7 +3193,7 @@ void Spell::TakeRunePower() if(!src || (src->NoRuneCost() && src->NoRunicPowerGain())) return; - int32 runeCost[NUM_RUNES]; // blood, frost, unholy, death + int32 runeCost[NUM_RUNE_TYPES]; // blood, frost, unholy, death for(uint32 i = 0; i < RUNE_DEATH; ++i) runeCost[i] = src->RuneCost[i]; @@ -3207,7 +3207,7 @@ void Spell::TakeRunePower() uint8 rune = plr->GetCurrentRune(i); if(runeCost[rune] > 0) { - plr->SetRuneCooldown(i, 5); // 5*2=10 sec + plr->SetRuneCooldown(i, RUNE_COOLDOWN); // 5*2=10 sec runeCost[rune]--; } } @@ -3221,7 +3221,7 @@ void Spell::TakeRunePower() { if(!plr->GetRuneCooldown(i) && plr->GetCurrentRune(i) == RUNE_DEATH) { - plr->SetRuneCooldown(i, 5); // 5*2=10 sec + plr->SetRuneCooldown(i, RUNE_COOLDOWN); // 5*2=10 sec runeCost[plr->GetCurrentRune(i)]--; uint8 base = plr->GetBaseRune(i); plr->SetCurrentRune(i, base); @@ -3232,10 +3232,10 @@ void Spell::TakeRunePower() } } + // you can gain some runic power when use runes float rp = src->runePowerGain;; rp *= sWorld.getRate(RATE_POWER_RUNICPOWER_INCOME); - rp += plr->GetPower(POWER_RUNIC_POWER); - plr->SetPower(POWER_RUNIC_POWER, (uint32)rp); + plr->ModifyPower(POWER_RUNIC_POWER, (int32)rp) } void Spell::TakeReagents()