Jump to content
  • 0

niemal

Question

Posted

Can anyone point me to the way/part-of-code, which dictates the way class spells react?

For example, Rogue's Gouge spell is broken and I want to fix it. Where is the code responsible for its behavior? If not with code then how?

Thank you for your input.

2 answers to this question

Recommended Posts

Posted

Well, this all is not too hard but requires much reading, mostly C++ code :)

At beginning, one has to be aquantied with the spell structure. See struct SpellEntry. The spells are defined in Spell.dbc file. I use Spell.dbc converted into sql and imported into a DB.

The class spell differs from any other spell mostly in that its cast is being requested by the client, and they have SpellFamilyName > 0 according to the character class.

The general cast scheme is sketched here for TC 3.3.5 corresponding to Mangos Two, though exact C++ class structure is somewhat different there (this better structure Le Froid tried to port in the Rel20_SpellRewrite branch). The most interest attracts the spell prepare phase, where the possibility of a spellcast is checked by the client and then by the server in CheckCast() method.

SpellEffects (Effect1-3) are handled by spelleffect handlers.

A special attention require SPELL_EFFECT_DUMMY, SPELL_EFFECT_SCRIPT_EFFECT and auras SPELL_AURA_DUMMY, SPELL_AURA_PERIODIC_DUMMY. These have no default implementation and should be implemented somewhere.

Several spells are "not completely defined" in the Spell.dbc from our point of view (it usually means that we do not understand some mechanics). Parameters like effect radius (many ICC spells), effect target type, maximum number of targets so on can be not defined (equal to zero). Such spells are "corrected" after DBC loading (cannot just find the respective method in Two, but in Zero it's SpellMgr::ModDBCSpellAttributes).

Why my favorite spell does not work? There may be a hundred plus one causes for that. For class spells, the set is narrower but nevertheless. For example: missing another spell and binding to them via spell_linked_spell, not implemented dummy part, wrong/missing spell_proc_event or spell_threat entry, missing spell_bonus_data. Rarely enough others are encountered: not fully understood spell structure, spell attributes inconsistent with our understanding of them, a bug in spelleffect handler. I'm sure I missed many possibilities here.

Posted
Well, this all is not too hard but requires much reading, mostly C++ code :)

At beginning, one has to be aquantied with the spell structure. See struct SpellEntry. The spells are defined in Spell.dbc file. I use Spell.dbc converted into sql and imported into a DB.

The class spell differs from any other spell mostly in that its cast is being requested by the client, and they have SpellFamilyName > 0 according to the character class.

The general cast scheme is sketched here for TC 3.3.5 corresponding to Mangos Two, though exact C++ class structure is somewhat different there (this better structure Le Froid tried to port in the Rel20_SpellRewrite branch). The most interest attracts the spell prepare phase, where the possibility of a spellcast is checked by the client and then by the server in CheckCast() method.

SpellEffects (Effect1-3) are handled by spelleffect handlers.

A special attention require SPELL_EFFECT_DUMMY, SPELL_EFFECT_SCRIPT_EFFECT and auras SPELL_AURA_DUMMY, SPELL_AURA_PERIODIC_DUMMY. These have no default implementation and should be implemented somewhere.

Several spells are "not completely defined" in the Spell.dbc from our point of view (it usually means that we do not understand some mechanics). Parameters like effect radius (many ICC spells), effect target type, maximum number of targets so on can be not defined (equal to zero). Such spells are "corrected" after DBC loading (cannot just find the respective method in Two, but in Zero it's SpellMgr::ModDBCSpellAttributes).

Why my favorite spell does not work? There may be a hundred plus one causes for that. For class spells, the set is narrower but nevertheless. For example: missing another spell and binding to them via spell_linked_spell, not implemented dummy part, wrong/missing spell_proc_event or spell_threat entry, missing spell_bonus_data. Rarely enough others are encountered: not fully understood spell structure, spell attributes inconsistent with our understanding of them, a bug in spelleffect handler. I'm sure I missed many possibilities here.

That answers my question, thank you.

Archived

This topic is now archived and is closed to further replies.

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