Jump to content

[BUG] Projectiles from casts(like Arcane Missles) bug


Auntie Mangos

Recommended Posts

This happens in master as well

I began to think that I alone here, lol. Thx! This is really good information!

So, now i'm debugging in oregoncore using idea of Valhalla-Project fix(see thread http://getmangos.eu/community/topic/12865/mage-arcane-missiles/):

Channeled casts are just casts, which places DoT aura on target. That means, on DoT tick, m_caster equals player's target, but real caster in m_originalCaster.

One important note: at calling SendSpellGo/Start, in oregoncore, m_caster == m_originalCaster, but not in Mangos.

I can just replace "data << m_caster" by "data << GetAffectiveCaster()" and it'll start work like it must, but... it's just a hack, i think. I mean, in oregoncore, it(m_caster) sets to m_originalCaster it different place. Need to find where it becomes and merge it logic into mangos.

That is my current task.

Link to comment
Share on other sites

  • 41 years later...

Projectiles flying(as animation) from target to itself.

It must be from caster to target, but it flying from caster's target and strikes back to target.

missiles.png

"painted" by sso1 :D

You see? Arcane missles from Colossus hands to Colossos body! But it's my arcane missles!

Mangos from master, SD2 too, DB - MODB(https://github.com/iorlas/MODB).

Now i'm searching whats wrong in Spell.cpp, comparing with oregoncore.

Link to comment
Share on other sites

Something wrong in Spell::WriteSpellGoTargets of spell targets struct. Anyway, it's a way to work. At least, now i know were i can find info about targets, which uses for spell projectiles -_- Thx this paste for idea: http://pastebin.com/qELFxfYL

I see a spell targets: mask == 2 or just TARGET_FLAG_UNIT.

So, i'll try to debug this code part in oregoncore.

Link to comment
Share on other sites

If memory servers, there are two types of arcane missile targeting systems:

1) For player cast arcane missiles:

Dummy Aura on Target, Channeled spell on player

then the channeled spell must cast his arcane missiles every channeled-tick onto his target with dummy aura

2) for npc cast arcane missiles - example http://www.wowhead.com/spell=15790

Periodic Tick Aura on Target, this periodic tick must cast the spells from caster onto target (and not like usual periodic tick from target onto target)

Link to comment
Share on other sites

If memory servers, there are two types of arcane missile targeting systems:

1) For player cast arcane missiles:

Dummy Aura on Target, Channeled spell on player

then the channeled spell must cast his arcane missiles every channeled-tick onto his target with dummy aura

2) for npc cast arcane missiles - example http://www.wowhead.com/spell=15790

Periodic Tick Aura on Target, this periodic tick must cast the spells from caster onto target (and not like usual periodic tick from target onto target)

But anyway, m_originalCaster will be really "original caster"? In first case - player, in second - npc? Does this mean that we can send m_originalCster instead of m_caster if available? I can just replace m_caster with GetAffectiveCaster() in packets creation functions of Spell.cpp(simply, in SendSpellGo/Start), but is it right way?

Link to comment
Share on other sites

no, in my opinion entirely wrong way..

in player's case the spell for arcane missile (42846 - triggered spell = 42845)

in

void Aura::TriggerSpell()

the triggered spell is cast with

triggerTarget->CastSpell(triggerTarget, triggeredSpellInfo, true, NULL, this, casterGUID);

which needs to be replaced in this case.

So, way to go here I think will be:

i) Make Aura::TriggerSpell a bit more clear to support "triggeredCaster->CastSpell(triggeredTarget .."

ii) Add a way to handle all player arcane missiles into one place (possible one of these (for me) mysterious spell masks

iii) support the dummy aura to add "lastArcaneMissileTarget" to Player on apply and clear on remove

iv) use triggeredCaster = aura.caster and triggeredTarget = aura.caster.GetArcaneMissileTarget();

Link to comment
Share on other sites

Yeah, thx for pointing on TriggerSpell.

Make Aura::TriggerSpell a bit more clear to support

What you want? It's clear enough.

Add a way to handle all player arcane missiles into one place (possible one of these (for me) mysterious spell masks

AM is a similar to many spells like Penance. So nothing "special" needed. Or, perhaps, i don't understand your thought.

support the dummy aura to add "lastArcaneMissileTarget" to Player on apply and clear on remove

For what purpose?

use triggeredCaster = aura.caster and triggeredTarget = aura.caster.GetArcaneMissileTarget();

Too complicated. KISS, :D

Anyway, i found a... way.

Let's see a mangos SpellAuras.cpp in func TriggerSpell:

ObjectGuid casterGUID = GetCasterGuid(); //remember! it's always original caster!
Unit* triggerTarget = GetTriggerTarget(); //and this is target
...
//                       Victim,        spellInfo,          triggered, castItem, triggeredByAura, originalCaster ....
triggerTarget->CastSpell(triggerTarget, triggeredSpellInfo, true,      NULL,     this,            casterGUID);

That means, in "default case", caster will be always == victim, which is truth in server inner logic(AM is a aura on victim), but wrong in theory(it's a regular spell A->B).

Let's see a trinity core(oregoncore) in same place:

in constructor init: m_target(target) // m_target = target(from args)
Unit* caster = GetCaster();
Unit* target = GetTriggerTarget();
uint64 originalCasterGUID = GetCasterGUID();

m_target->CastSpell(target, triggeredSpellInfo, true, 0, this, originalCasterGUID);

m_target is target, placed in Aura constructor.

So, let's see what happens on AM spellcast:

It places 2 auras with spellproto id of AM channeled spell(in case of TBC - 38699): with same target and caster pointer and with different target and caster pointers(second effect, with id 38700).

Important thing: in mangos and oregoncore it has same behavior! That means, real problem is betweet constructor calling and CastSpell!

Okay, we in constructor. So whats happend in it?

In oregon: save target into m_target.

In mangos: ... nothing!

Okay, next... In Aura::TriggerSpell():

In oregon: m_target casts AM(aura effect spell 38700) on target. But target is "GetTriggerTarget();"! Just a triggerTarget, in mangos.

In mangos: stupidly triggerTarget casts AM on itself.

Solution: save "target" from Aura constructor arguments, use it as target->CastSpell.

Really simple. Not tested, but all comment and thoughts are welcome.

Link to comment
Share on other sites

no, in my opinion entirely wrong way..

Oh, and one more thing about this but: it appears not only on AM. It appears in many encounters like last boss in MGT, last boss in Underbog. So, we need to fix not only AM, we need to fix this logical bug for many spells. That means we need more general solution, like i showed above.

Link to comment
Share on other sites

yes, and as I am aware of this, I added the needed framework in my post, feel free to use the round ball with phunny ears floating around a bit higher than your chest - this is usally the best way to get something done.

ofc it is possible that there are other and better ways than the one I thought of, but I think I understood enough of the aura-trigger spell problem, to suggest reasonable changes that will be helpfull for many cases.

For what purpose?

" use triggeredCaster = aura.caster and triggeredTarget = aura.caster.GetArcaneMissileTarget(); "

Too complicated. KISS, big_smile

well, the spell-triggering aura should know onto whom to cast the missiles, hence we need to get the target for arcane missiles, this has nothing to do with simple/ complicated, but this is the purpose of the spell (sending missiles from caster onto target of arcane missiles) - ofc if you don't want to care about this ..

Btw, you could edit your subject, because this is a bug of mangos master, too, and you can take the spell-ids I posted, to give a proper bug-report

Edit: Just looked at arcane missile spell again, and from the spell (42846) I think we must use some unexpected code somewhere already..

Link to comment
Share on other sites

yes, and as I am aware of this, I added the needed framework in my post, feel free to use the round ball with phunny ears floating around a bit higher than your chest - this is usally the best way to get something done.

Lol i get it.

ofc it is possible that there are other and better ways than the one I thought of, but I think I understood enough of the aura-trigger spell problem, to suggest reasonable changes that will be helpfull for many cases.

Ofc, any problem has many ways of solutions. Some are dirty, tricky, hacky, some are wrong, some like revolution - wants to rewrite all around, but some are "right". In my opinion, right way is a best way by result/cost.

Mangos needs many and many changes. Mangos must be rewritten in many places. And if i'll be a "fan" of mangos, i'll start some rework in needed order.

But now, i want to choose better solutions for problems, which are not so hacky. I'm using oregoncore as source of tested and working solutions. I'm searching solution of mangos problem in oregon, analyzing it for getting idea how it works and applying it in my fork. If it works, i make a pull request.

well, the spell-triggering aura should know onto whom to cast the missiles, hence we need to get the target for arcane missiles, this has nothing to do with simple/ complicated, but this is the purpose of the spell (sending missiles from caster onto target of arcane missiles) - ofc if you don't want to care about this ..

Yeah, i want it too! Too, but now, i dont want to review huge amount of this code. It's okay for some time:

Unit* triggerTarget = GetTriggerTarget(); //it's a "real" target
Unit* realCaster = GetCaster(); //it's a "real" caster
realCaster->SpellCast(triggerTarget, 38700 ...);

One note: GetCaster() returns m_target from AuraHolder, which is a target from Aura constructor arguments.

Btw, you could edit your subject, because this is a bug of mangos master, too, and you can take the spell-ids I posted, to give a proper bug-report

Removed version tag. Spell ids... it's no matter. This but appears on many spells, not only on AM.

Edit: Just looked at arcane missile spell again, and from the spell (42846) I think we must use some unexpected code somewhere already..

Yes, it is Aura::GetCaster().

Link to comment
Share on other sites

i think this is not related to that but to cast flags / positions... on a TC commit long ago (the one which fixed this) changed the way casts worked (using caster position as source of the triggered spells (in this case the missiles)) cant confirm as im not on my PC atm...

Link to comment
Share on other sites

i think this is not related to that but to cast flags / positions... on a TC commit long ago (the one which fixed this) changed the way casts worked (using caster position as source of the triggered spells (in this case the missiles)) cant confirm as im not on my PC atm...

Not really a caster position. It works same as in mangos, but instead of trigger target, uses m_target as caster of spell:

m_target->CastSpell(target, triggeredSpellInfo, true, 0, this, originalCasterGUID);

That's all difference between mangos and TC(but, maybe it somehow reworked in master TC, i have only oregoncore, which is a TC with backported patches from TC).

Fixed and little bit tested now:

https://github.com/iorlas/one/commit/b5af4633392505b6df07de30acdf8b6739057ca7

Link to comment
Share on other sites

  • 4 weeks later...
Guest
This topic is now 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