Jump to content

Some guidance required


Guest markg85

Recommended Posts

Hello all,

I just got mangos working here and having fun with the GM commands :)

Now i made a mage, made it lvl 70, put all talents in arcane with the intention to find bugged talents and fix them. The first one i found was: Arcane Fortitude which should increase your armor by 100% of your intellect. So if you have 2200 armor (common for a mage) and you have 700 intellect (also common for a mage) your armor will get 2200 + 700 = 2900. And if you do the intellect buf on it with 40 intellect the total intellect is 740 thus the sum gets: 2200 + 700 + 40 = 2940

Now the issue i'm facing is that i simply don't know where to start.. i can't find the arcane fortitude spell id anywhere in the code (or the name itself) so i'm wondering where i need to start with this.

I know a fair amount of c++ so i'm not expecting a lot of issues there... i only need some guidance to get the locations where i need to code right.

And a slightly off topic question: Where is the code that handles the "Mark of the Wild" buff spell? i searched for that based on the spell id's as well but i could not find it.. just wondering that particular one because it increases all stats.

I hope someone can put me in the right direction.

Thanx,

Mark

Link to comment
Share on other sites

I believe you have to get the opcode for that spell. the client doesn't send spells by name or id to the server. i could be wrong as i've never really messed with spell handling.

And how can i do that opcode stuff?

Some more in depth information about this would be welcome.

Link to comment
Share on other sites

In SpellEffects.cpp there is a function called: EffectDummy.

I think that's the one you meant..

Inside that function there is a part called:

case SPELLFAMILY_MAGE:

Now my guess is that i need to add the spellid of "Arcane Fortitude" in there and add stuff to get it working..

To do that i need to know a few other things (the code is hard to figure out)

- How do i look up if the talent point for that passive spell is set?

- How do i get the current intellect

- How do i get the current armor

And last but not least.. are those sLog.* log messages saves in a log file? if yes. which one and how to enable them? i did change all log levels to 3 but simple can't find any messages. World.log has a lot but none (or so it seems) of sLog.

Link to comment
Share on other sites

In SpellEffects.cpp there is a function called: EffectDummy.

- How do i look up if the talent point for that passive spell is set?

- How do i get the current intellect

- How do i get the current armor

I really doubt someone will lead you here step-by-step on every simple thing. I'm also interested in the spell system, since I don't know too much about it (spell_affect table connection to c++ code for example), but for example armor can be easily found out in the source, so search in src/game/* ...

Link to comment
Share on other sites

i am searching my ass off!

and it would be a shame is no one is gonna help me guide through this. The start to get this going is hard, but after you've fixed your first spell you can expand it a bit and fix another one.. and so forth

Also if you know something then just TELL it. do NOT tell me to search there or there because your not willing to share it directly with me.. then just say nothing.

Link to comment
Share on other sites

i am searching my ass off!

and it would be a shame is no one is gonna help me guide through this. The start to get this going is hard, but after you've fixed your first spell you can expand it a bit and fix another one.. and so forth

Also if you know something then just TELL it. do NOT tell me to search there or there because your not willing to share it directly with me.. then just say nothing.

I'd say "RTFM", unfortunatelly, there's no official Mangos manual.

Well the start was hard for me as well, but as I searched the thing around, starting from custom commands, through packet handling "hacks", ..., I got the basic idea of what is where and how to do it.

ontopic: Most of the spells is from DBC, only spell effects are generally handled (AFAIK).

Link to comment
Share on other sites

Just an example of what i looked for but can simply not find in the code:

- Improved fireball (definitely works, but what makes it work)

- Arcane Focus

- Arcane Concentration

- Arcane Fortitude

... i just can't find them.

It would be nice if someone could explain (in understandable terms) how this whole spell system is working and where i need to be if i want to fix a passive spell, a talent or just a spell....

Comments like "look in file blablabla.cpp" are not gonna work with a project this big. Might work in some cases but don't count on it.

Link to comment
Share on other sites

Just an example of what i looked for but can simply not find in the code:

- Improved fireball (definitely works, but what makes it work)

- Arcane Focus

- Arcane Concentration

- Arcane Fortitude

... i just can't find them.

It would be nice if someone could explain (in understandable terms) how this whole spell system is working and where i need to be if i want to fix a passive spell, a talent or just a spell....

Comments like "look in file blablabla.cpp" are not gonna work with a project this big. Might work in some cases but don't count on it.

i have never worked with the spell system so this is just to show you that with a little research you can find what you are looking for.

if you go to the opcodes.cpp in under the game dir (game/server if using VS with filters) you will find the opcode CMSG_CAST_SPELL (client message cast spell) and you will see that it is handled by WorldSession::HandleCastSpellOpcode(). Now if you will find that in the SpellHandler.cpp file and if you look in that code you will see that the packet is taken and then it is translated to a spellid by calling the LookupEntry of the SpellStore singleton and stores it in spellinfo. The code then does some other checks and finally at the bottom you can see where a Spell object is created and used.

if you see the code you can confirm what freghar said in that the spell info is extracted from dbc info and the code in Spell.cpp refered to before handles special cases/effects.

now a more experienced dev please correct my logic if any of what i just said is incorrect.

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