Jump to content

bdebaere

Recommended Posts

Hello,

I would like some help solving the issue at https://www.getmangos.eu/issue.php?issueid=1007

The aura 112 SPELL_AURA_OVERRIDE_CLASS_SCRIPTS is handled by HandleOverrideClassScriptAuraProc. There are already several spells in this function.

Does that mean I need to add an id to the switch?

switch (scriptId)
{
case 4415:
break;
}

I have no idea how to proceed. Is it a question now of finding the right spell in the dbc and having the code look like this?

switch (scriptId)
{
case 4415:
triggered_spell_id = <spell_id which increases rejuv>;
break;
}

Link to comment
Share on other sites

Hi!

The aura 112 SPELL_AURA_OVERRIDE_CLASS_SCRIPTS is handled by HandleOverrideClassScriptAuraProc.

This is not the case. In SpellAuras.cpp, we read:

&Aura::HandleNoImmediateEffect,                         // 112 SPELL_AURA_OVERRIDE_CLASS_SCRIPTS implemented in diff functions.

It is a complicated case because the auraeffect is implemented as a "correction" in several methods. So, we need to browse over all references to SPELL_AURA_OVERRIDE_CLASS_SCRIPTS and find the relevant code patch, which is in Unit:SpellHealingBonusDone. (Additional (though weak) argument to skip HandleOverrideClassScriptAuraProc is procFlags=0 for the 27853 spell.) Moreover, the MiscValue 4415 is already present there, so the case is handled. The only cause for the avoiding that code is isAffectedOnSpell(spellProto) method returning false. Here is the same spell influence mechanic used as in the proc system: spelleffect mask of the casted spell (see SpellEntry::SpellFamilyFlags) must intersect (binary AND > 0) with the aura spellmask. The aura spellmask can be contained in SpellEntry::EffectItemType (don't ask me why the field, containing data of either type, has such name) or, additionally, in the spell_affect World DB table. So, with no deeper investigation, my guess is the missing aura 27853 spellmask, to be defined in the spell_affect. The mask must be the same as for Rejuvenation spell.

Link to comment
Share on other sites

The line was indeed missing in spell_affect. I inserted the it in the table and restarted the server, but it did not have the desired effect. The healing done by Rejuvenation is not increased.

INSERT INTO spell_affect VALUES(27853, 0, 16)

How do I proceed further?

Link to comment
Share on other sites

Cannot say for sure, but I would check about lo/hi word of spellmask and then go to straight debugging in order to learn the execution path.

Will look at the issue later, this evening.

Would you be so kind as to write down the steps you take so I can follow and learn, thank you! :)

Link to comment
Share on other sites

Hm, I used your SQL query exactly, and since that I'm unable to reproduce the issue.

idol_rej.png

UPD. Well, the code line adding the whole spellvalue (50) rather than dice 1 to spellvalue is wrong/not blizzlike, but this is a simpler issue. Ideally, the other case in the mentioned method needs to be checked and if it is wrong too (requires random addition but not constant), the single code line must be changed appropriately.

idol_rej.png.81bee6b8b54f038b554981fe300

Link to comment
Share on other sites

Hm, I used your SQL query exactly, and since that I'm unable to reproduce the issue.

[ATTACH=CONFIG]315[/ATTACH]

UPD. Well, the code line adding the whole spellvalue (50) rather than dice 1 to spellvalue is wrong/not blizzlike, but this is a simpler issue. Ideally, the other case in the mentioned method needs to be checked and if it is wrong too (requires random addition but not constant), the single code line must be changed appropriately.

Yes I tested it on release20 and not develop21. There must have been some changes there. I updated to develop21 this week and after testing can confirm it is working.

Indeed, I also see it is adding the flat value of 50 to each spell. Which should not be the case as it now makes rank 1 extremely powerful for very little mana.

How would one continue from here? :)

Link to comment
Share on other sites

The most important task is finding the correct formula. Should the bonus be 1) completely random number 1 to 50; 2) a constant value depending on the Rejuvenation level; 3) a random range with mean value depending on the Rejuvenation level?

Since this is settled, and we have seemingly found the line of the code implementing the effect in the Unit::SpellHealingBonusDone, it's not hard to correct it.

We might face problems like spellpower dependence of the bonus due to

 DoneTotal = SpellBonusWithCoeffs(this, spellProto, DoneTotal, DoneAdvertisedBenefit, 0, damagetype, true);

This particular one is iirc solvable in the DB too.

Link to comment
Share on other sites

The most important task is finding the correct formula. Should the bonus be 1) completely random number 1 to 50; 2) a constant value depending on the Rejuvenation level; 3) a random range with mean value depending on the Rejuvenation level?

Since this is settled, and we have seemingly found the line of the code implementing the effect in the Unit::SpellHealingBonusDone, it's not hard to correct it.

We might face problems like spellpower dependence of the bonus due to

 DoneTotal = SpellBonusWithCoeffs(this, spellProto, DoneTotal, DoneAdvertisedBenefit, 0, damagetype, true);

This particular one is iirc solvable in the DB too.

How would one go about finding the correct formula? Are there sources available or is this a community question?

Why would there be problems to face with the spellpower dependence of the bonus?

What do you mean by "this particular one is solvable in the DB too"?

Link to comment
Share on other sites

How would one go about finding the correct formula? Are there sources available or is this a community question?

I've not enough experience preferring to ask the community. I could point for two great resources: wiki and wowhead. Wiki has the history of page changes, so the information about older versions may be recovered more or less reliably. Wowhead tries to keep the info up to date, but the user comments are sometimes extremely useful. Note that the helpful comment may be related to the item, spell, - virtually to any page.

Why would there be problems to face with the spellpower dependence of the bonus?

What do you mean by "this particular one is solvable in the DB too"?

I underlined that the plain addition does not give the final result because of consequent application of the method mentioned (which I was too lazy to read ;)). Dependence on spellpower of a particular spell may be controlled via the DB table `spell_bonus_data`.

Link to comment
Share on other sites

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