• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

Making spells cost percentage of max mana not base.

Status
Not open for further replies.

Vitrex

Moderator
Hello, maybe anyone knows how to make Spells cost % of max mana not % of base which stored in database?
Or anyone know where it's can be and navigate me? :)
I searched in
spellInfo.h
spellinfo.cpp
And maybe didn't find that but there i didn't found what i'm looking for.
 

Vitrex

Moderator
yeah in spell.dbc set % of base mana which stored in db, i wanna make cost of MAX mana not base.
 

FoxGaming

Exalted Member
yeah in spell.dbc set % of base mana which stored in db, i wanna make cost of MAX mana not base.

I'm not sure if this is what you're looking for, but in column 204 or 203 depending on which DBC editor you are using. If your DBC columns start at 0 then it's column 203. That column is the mana percentage cost. Which should take a % of the players total mana. So if a player had 50,000 max mana, and you had 10 in that column then casting that spell would cost 5,000 mana I believe? I may be wrong though.
 

Vitrex

Moderator
I'm not sure if this is what you're looking for, but in column 204 or 203 depending on which DBC editor you are using. If your DBC columns start at 0 then it's column 203. That column is the mana percentage cost. Which should take a % of the players total mana. So if a player had 50,000 max mana, and you had 10 in that column then casting that spell would cost 5,000 mana I believe? I may be wrong though.

You almost right, but that column of % mana using not maximum player mana but Base mana from "player_classlevelstats" table basemana column...
i think i need find the function where it checks that info from db and change to player max mana constant, but i can't find where to do that :/

Sorry, checking right now spell.dbc i think i found it i'll repost in half hour.

4a12b0b1790e03351b7b8673e9fcaaa6407.png


uint32 manaCost; // 42 m_manaCost
uint32 manaCostPerlevel; // 43 m_manaCostPerLevel
ManaCostPercentage; // 204 m_manaCostPct

And yep still uses Base mana not max... :/
 
Last edited:

Tommy

Founder
seems to be more complicated that i thought... :/

Or it can be very simple, who knows. You would think something like this is very difficult, but once you track down how to do it, your reaction: "How could I have missed that!?"

As far as I can tell, it is weird really. Allot of spells have '0' in column 204 and some have other random values. If I had to guess: It is working with another dbc file, client side coded only or it is hardcoded.
 

Vitrex

Moderator
Maybe one of simplest ways can be make script which - the % of max mana when player use any spell.
like if player cast spell which uses mana
player mana - 10% of player max mana
Or something like that but that is dirty solution, but still "way" to do that.
 
Status
Not open for further replies.
Top