Jump to content

spell_affect, How do I get the SpellFamilyMask value?


Guest Endlesskiss

Recommended Posts

Hello everybody.

How do I get the value that should be entered in SpellFamilyMask?

for example in order to fix Savage Fury you have to do:

INSERT INTO `spell_affect` VALUES

(16999, 0, 0x1000001000);

INSERT INTO `spell_affect` VALUES

(16999, 2, 0x1000001000);

So, Why it is 0x1000001000? is there a formula\\algorithm that "generates" such a value by some parameters?

Thanks from advance!

Link to comment
Share on other sites

Hello everybody.

How do I get the value that should be entered in SpellFamilyMask?

for example in order to fix Savage Fury you have to do:

INSERT INTO `spell_affect` VALUES

(16999, 0, 0x1000001000);

INSERT INTO `spell_affect` VALUES

(16999, 2, 0x1000001000);

So, Why it is 0x1000001000? is there a formula\\algorithm that "generates" such a value by some parameters?

Thanks from advance!

The last column (by the udbforums wiki) is this (http://wiki.udbforums.org/index.php/Spell_affect)

This field controls what class a spell needs to have to be affected by the modifier. This is the main field that defines which spells are affected by modifiers. For SpellClass see spell.dbc (in WoW-3.0.3 column 211)

Link to comment
Share on other sites

First of all, Thank you for fast respond.

Anyway, I was browsing the DBC Files, I went to column 211 for spell 33876, and it's value was 0....

So, can you extend your explain please? as I understood the value should be stored in Column 211, but it doesn't.

Sorry for ignortantness, and thanks again.

Link to comment
Share on other sites

The spell you should be looking at is 16999 since that is the effect spell, which affects 33876. Note for talents and other modifying spells they are separate from the spell that is affected (ie. talent xyz increases damage of twa, talent xyz is a spell that modifies twa to do more damage).

http://www.wowhead.com/?spell=16999 for example lists that the spell 16999 applies auras that modifiers; what spell_affect does is to say what spell modifies what.

Link to comment
Share on other sites

I went to 16999, none of his columns had the value 0x1000001000 or value 68719480832 [which is the decimal of 0x100000100].

I was looking both on 2.4.2, 2.4.3 and 3.0.9 DBC Files.

I know that's alot but could you please show me for example, How to fix Mark of the Wild? [and ofc, How to fix this, I'm not looking for a fix, I'm looking for a way to fix].

Thanks again! and sorry for my ignorance.

Link to comment
Share on other sites

The reason we have to put the SpellFamilyMask in the table manually is that, the spell affected are not targeted by the spell thus the query is there to add the target.

Mark of the Wild is working fine... and you aren't very specific on what is broken, so I can't show an example

Also a correction to what the database wiki says

   uint32    SpellFamilyName;                              // 211      m_spellClassSet
   uint64    SpellFamilyFlags;                             // 212-213  m_spellClassMask NOTE: size is 12 bytes!!!
   uint32    SpellFamilyFlags2;                            // 214      addition to m_spellClassMask

for 33876 only has a 1024 in any of the values; I'm guessing that what happens is that there are multiple masks that need to be affected and they have been added to make a big mask. Not sure on how the full mask is made but because you have two fields to span for each spell, you may have some weird byte order system I don't know about or the hex value is supposed to be split between the fields with some multiplier. (To me it appears that field 213 has some crazy multiplier on it)

Also to clarify I was wrong about the mask being on the spell 16999 :P

Link to comment
Share on other sites

Just so happens you pick a difficult one; Turns out that the reduction has to be applied to pets via Apply Aura: Flat modifier, which I don't think is supported yet :P

Although I guess, since many pet affecting talents use this call with the value of 8 maybe someone could code to fix it. In SpellAura.cpp this bit breaks the chain, since the code shown will break the function:

void Aura::HandleAddModifier(bool apply, bool Real)
{
   if(m_target->GetTypeId() != TYPEID_PLAYER || !Real)
       return;

So until someone modifies/ tries to fix this well we can't do anything.

NB: I'm not sure if anyone tried to patch out the pet aura fully, I'm not sure if there is another path to cast/ add auras to pets.

Link to comment
Share on other sites

Ok, so umm... something easier...

Cold Blood - it does not affect any spell, it affects the crit, How do you get the value for crits?

and if it's too hard, there's a working spell but I want to know how to get the value for Renew:

Improved Renew

and if it's too hard either, well, Fire Power [which is working btw], would help me, I want to know how to get modifier of few spells from one type [Fire in our case].

Thanks again!

Link to comment
Share on other sites

Hmm, Cold Blood does not work? The mask for the mods is builded out of other values of spell.dbc, so that you normally don't have to add an entry in spell_affect. This is just a remain of older code and maybe something for debug (this table is currently completely empty). So either there is really a bug in the DBC's ore the bug is somewhere else.

Normally it works like that:

There are different kinds of spellmods. Find SpellModOp in the code. There you have the declaration of all mods (that are on wowhead the values in brackets after "Apply Aura: Add Flat Modifier").

For Cold Blood this is 7 (==SPELLMOD_CRITICAL_CHANCE). In fact this modifier also has a mask to match certain spells (so there is nothing that that says "all offensive abilitys" are affected;, simply all rogue spells that are possible are added to the mask). Checkout Aura::HandleAddModifier() if you want to know how the masks are getting builded.

For improved Renew you have SpellModOp 22 (==SPELLMOD_DOT).

Demonic resilence (ChanF07): Pet's don't have any own Spellmods. This spellmod (Effect 2) is added to the owner. But pet will use the owner's spellmods (if it is always reffered by Unit::GetSpellModOwner() in the code, witch will return the owner for a pet). Hunter and Warlock pets have a quite big number of passive auras that are modded by those mods^^ Don't find the one for this Talent right now and also think that the bug here is not the spellmod.

Now to Savage Fury and the masks one more time:

In fact you have three SpellFamilyMask values in spell.dbc. The first two are concluded in SpellEntry to one value of 64bit (SpellEntry::SpellFamilyFlags). The third value remains as it is as SpellEntry::SpellFamilyFlags2. I think this is also a remain from older times (pre 3.x) when the 3rd value did not exist to have only one value for those flags. But with the introduction of the 3rd value they did not revert this or added the 3rd value to one single mask as well (97bit integer.... don't know if this is possible at all^^), so that we now have this a bit confusing way.

So if you want to create a SpellFamilyFlag of SpellEntry out of the 2nd SpellFamilyFlag of the DBC's just shift the binary number 32bits left (or just multiply the decimal number by 2^32).

Be careful when using the DBC Editor to find out the EffectSpellClassMaskX values out of the DBC (that give the affect masks for the spellmod). This editor is not updatet to the current DBC versions and so those values are currently shown as Strings (and so you don't see anything,they are marked as SpellName there). Better way (how I would do this) is just to debug when applying the Spellmod and get the affect mask right in the code.

I'm quite shure that the masks are also correct in this case and the bug is somewhere else again (it's at all very unclear to me why this talent does not work [are you sure]... seems to be a quite usual one for me...).

Hope my answer helps you a bit ;).

Link to comment
Share on other sites

  • 3 weeks later...

*BUMP*

and another question.

as you see a damage modifier [Darkness for example] does not affect the same thing that Improved renew [spell modifier] affects.

but both of them has SPELLMOD_DOT, so why does SpellModsOp so matters?

and when you say "simply get that in the code", which variable\\part of code contains that data?

and as i understood, you don't get the SpellFamilyFlag, you simply collect all the priest's shadow spells, for each family flag you got you << 32 it, and then, after you got all of them, you connect them (first one + 2nd one + 3rd one till you get to the last one).

is that right?

Link to comment
Share on other sites

I don't know what is not working in detail with imp. Kidney Shot. Should normally work as described before: The spellmod is here SPELLMOD_ALL_EFFECTS. So this will affect the base value of all three effects (of kidney shot). First and second effect don't use there basevalues so they could have taken also SPELLMOD_EFFECT3.

Those Spellmods are getting applied in CalculateDamage() (or something like that that... don't have the code here now^^). Start to debug there and try to find out why it does not work ;-)

as you see a damage modifier [Darkness for example] does not affect the same thing that Improved renew [spell modifier] affects.

It does not matter weather it is healing or a damaging over time spell. This is only determined by the family flags. SPELLMOD_DAMAGE is also used for increasing the power of healing spells for example. Maybe the notation is a bit confusing (but do you know a better one?!)

and when you say "simply get that in the code", which variable\\part of code contains that data?

Experience and code-reading :-P Maybe you could try to find all calls of ApplySpellMod() or GetModOwner() to find places where spellmods are apllied.

and as i understood, you don't get the SpellFamilyFlag, you simply collect all the priest's shadow spells, for each family flag you got you << 32 it, and then, after you got all of them, you connect them (first one + 2nd one + 3rd one till you get to the last one).

is that right?

Hmm, one more try:

Lets say you want to create your own spellmod and you need to create the mask for 2 spells with the following spellfamilyflags (1st of the 3 values in the dbc's):

spell1: 0000 1000

spell2: 0010 0000

To create the mask so simply combine them with a logic OR so that you get 0010 1000 as your mask. You have to enter this value in SpellClassMask0 in the SpellAffect table. The same procedure if you have spells with bit(s) the 2nd or 3rd spellfamilyflag field.

The thing with shifting the value by 32 is just to understand how mangos forms the intern used 64bit SpellEntry::SpellFamilyFlag.

But as I said in most cases you don't have to concern about those flags (maybe only if you want to add spellprocevents, but not for spellmods) because they are already stored in the dbc (and "decrypted" :-) )and are correct if blizz did not make a failure^^

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