Jump to content

Mana Cost Calculation


Recommended Posts

Ok perhaps this will help in the Spell.cpp file I edited the int32 Spell::CalculatePowerCost() function. Specifically the powerType switch. Below is the current code. Now when i edit the POWER_MANA case to something like say

case POWER_MANA:

powerCost +=( m_spellInfo->ManaCostPercentage * m_caster->GetCreateMana() / 100) /2;

break;

The actuall amount of mana spent when the spell is cast is reduced in half, but when mousing over the spell in the game the mana cost has not change and when you have less mana then what is stated when you mouse over the spell you can not cast the spell. Can anyone help me out with this please?

switch (m_spellInfo->powerType)

{

// health as power used

case POWER_HEALTH:

powerCost += m_spellInfo->ManaCostPercentage * m_caster->GetCreateHealth() / 100;

break;

case POWER_MANA:

powerCost += m_spellInfo->ManaCostPercentage * m_caster->GetCreateMana() / 100;

break;

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use