Jump to content
  • We are looking for staff for the Wiki area!
    If interested please
    click here and select "Documentation Team"

  • spell_affect


    antz
     Share

     NOTE:  This page is auto-generated from the MAGNET DBDocs module,
                 Any changes made directly to this page will be lost when it is regenerated.

    Description of the 'spell_affect' table for MaNGOSOne

    This table holds information on what spells are affected by what spell mods.

    All spells in this table need to apply an aura that either adds a flat modifier to other spells or adds a percent modifier to other spells.

    Also, a single row in this table only holds information on a single spell effect that applies the aura.

    Therefore since a spell may have up to three effects, a maximum of 3 rows per spell is allowed. However, only the spell effects that apply the flat or percent auras will be used.

    Table Notes

    This table uses the 'MyISAM' DB Engine

    The Field definitions follow:

    Field Name Field Type Nullable Key Default Value Attributes Notes
    entry smallint(5) unsigned NO PRI '0'   Spell ID [See Spell.dbc].
    effectId tinyint(3) unsigned NO PRI '0'   Effect ID [See Spell.dbc].
    SpellFamilyMask bigint(20) unsigned NO '0'   SpellFamilyFlags [See Spell.dbc].

    Description of the fields

    entry smallint(5) unsigned

    Spell ID [See Spell.dbc]. The spell should apply an aura of any type from: SPELL_AURA_ADD_FLAT_MODIFIER, SPELL_AURA_ADD_PCT_MODIFIER, SPELL_AURA_ADD_TARGET_TRIGGER, SPELL_AURA_OVERRIDE_CLASS_SCRIPTS.

    effectId tinyint(3) unsigned

    ID of the effect of the spell, see Spell.dbc. Numbered from 0, so equals 0 to 2.

    SpellFamilyMask bigint(20) unsigned

    SpellFamilyFlags, see Spell.dbc and struct SpellEntry in DBCStructure.h. This is 64-bit value.

    Example usage

    We have the spell 11242 (Improved Arcane Explosion Rank 1).
    The first and only aura effect of this spell is SPELL_AURA_ADD_FLAT_MODIFIER, increasing the critical strike chance by 2%. Since this spell is lacking the information in the Spell.dbc (EffectItemType) which tells us what spells are affected by this spell we must add the information ourselves.

    The spell which we would like to be affected is of course Arcane Explosion.
    When looking up 1449 (Arcane Explosion Rank 1) in the Spell.dbc we find that it has a SpellFamilyFlags value of 4096. All ranks of Arcane Explosion have this SpellFamilyFlags value.
    Because spells have ranks we need some sort of shared key across these ranks so that all ranks will be affected by a single spell, or talent in our case. SpellFamilyFlags is this shared key.

    Looking up 11242 (Improved Arcane Explosion Rank 1) in the database table spell_affect we indeed find the value 4096 as SpellFamilyMask there for effect 0.

    Say for example we would want to change spell 11242 to not affect Arcane Explosion but affect Fireball instead we would change the value 4096 to 1073741825.
    To change this value in the database you need a decimal to hexadecimal converter.
    In our update query we would write the hexadecimal value of 1073741825, which is 0x0000000040000001.
    If we want spell 11242 to affect both Arcane Explosion and Fireball we need only to add 4096 to 1073741825: 1073745921 and put the hexadecimal value of this in the database.

    Additional Notes

    The SpellFamilyName along with SpellFamilyMask are used to define the classes of spells, avoiding enumeration of all ranks, like it was done at the end of this commit. In the Spell.dbc, EffectItemType is 32-bit field, while SpellFamilyMask is kept in two 32-bit fields. Of total 1309 vanilla SpellEffects applying SpellMod auras (which corresponds to slightly less than 1309 spells), only 225 have no EffectItemType data. This table is needed when either the data is missing, or the higher 4 bytes of it are required to define the SpellFamilyMask. So, it must be not much of missing data in the table.

    The lower 32-bit part of SpellFamilyMask of affecting (spellmod) auras is contained in the Spell.dbc, while the higher 32-bit part is not.
    The spell override table looks usually untractable even with its own structure and no additions. The same applies to the spell_threat, spell_target_position and few other present spell-related tables also.


    auto-generated by the getMaNGOS.eu MAGNET dbdocs module

    Edited by Antz

     Share


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

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