Small fix

This commit is contained in:
tomrus88 2008-11-30 14:59:35 +03:00
parent 59fb246652
commit 54c1585cdf
3 changed files with 17 additions and 16 deletions

View file

@ -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);
}

View file

@ -225,6 +225,7 @@ struct Areas
};
#define MAX_RUNES 6
#define RUNE_COOLDOWN 5 // 5*2=10 sec
enum RuneType
{
@ -232,7 +233,7 @@ enum RuneType
RUNE_FROST = 1,
RUNE_UNHOLY = 2,
RUNE_DEATH = 3,
NUM_RUNES = 4
NUM_RUNE_TYPES = 4
};
struct RuneInfo

View file

@ -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()