Jump to content

LearnDefaultSpells problem


Guest xzbbzx

Recommended Posts

Hi there, I'll explain my problem, to see if anyone can help me out.

I compile a private server where we use none-official races (goblins, ogres, etc) with their own racial traits. So, a while ago, there was no problem. We just had to forget the old racial traits, and learn the new ones the first time we logged in, and it stayed like that.

After this, there was a commit where the deafult spells (racial and class specific) where loaded on player load, everytime we accessed the server. So I went to player.cpp and there, to Player::LoadFromDB function and commented out the line learnDefaultSpells(); and no problem. I fixed the issue and could still play with our own traits.

Now, the problem is that the default spells are loaded in memory and not saved to the player, so having this line commented will make NEW PLAYERS (this problem doesn't apply to old players) don't know anything (not even languages. for example, the warrior won't even have the arms tab in the spell book). So, I tryed to uncomment this line, so as to learn all the new spells. Did this, accessed the game, learnt all spells up to level 55, and again, commented the line. The problem was that, once again, when logging in, the player didn't know the default spells that it should know (but it did know the spells learn by trainers or by command). This leads me to thinking (and by having taken a good look at the code) that these default spells are loaded in a map, but aren't saved to the player's data.

Is this intended? What would be a possible solution to my problem?

Thx in advance

Link to comment
Share on other sites

Yeah, the problem is that with the current way the defaults work, you need to apply on every login, otherwise, they won't even know how to speak (because these default spells aren't saved in the player data, strangely). So even though they "learnt" the default spells, they need to learn them every time you login :(

At least, this is what I've made out of what I've seen in-game and in code... but maybe I'm wrong :S

Link to comment
Share on other sites

Just a SQL issue no ?

Table playercreateinfo_spell contains all spells for characters when player creates a new one.

You can use a SQL request to delete from table characters_spell defaults spells

To do it, you can copy table playercreateinfo_spell from mangos db to characters db

and use this into characters db

DELETE FROM character_spell WHERE spell IN (SELECT DISTINCT Spell FROM playercreateinfo_spell);

/!\\CAUTION/!\\ - first time in my life that I use this english word on a forum !

This code delete all defaults spells, including langage, skill...

Link to comment
Share on other sites

Just a SQL issue no ?

Table playercreateinfo_spell contains all spells for characters when player creates a new one.

You can use a SQL request to delete from table characters_spell defaults spells

To do it, you can copy table playercreateinfo_spell from mangos db to characters db

and use this into characters db

DELETE FROM character_spell WHERE spell IN (SELECT DISTINCT Spell FROM playercreateinfo_spell);

/!\\CAUTION/!\\ - first time in my life that I use this english word on a forum !

This code delete all defaults spells, including langage, skill...

Thx, but if I do this wouldn't it make new player not learn their default spells? Because it would be a bit tyring to do this to every new player made.

The ideal thing would be that learnDefaultSpells saved the spells to the character data directly, like every other spell learnt.

Link to comment
Share on other sites

×
×
  • 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