Jump to content

[fix] spell target type 77


Auntie Mangos

Recommended Posts

Now, when I think about it: You mean the bug, that you can not cast mind flay on low level targets? I already tried this here: http://getmangos.eu/community/showthread.php?9246-[fix]-isPositiveEffect-periodic-triggering-auras (you can at least read about the problem there :P) There was also a core patch as you can read. Don't know anymore what it really did one more. Maybe I should investigate that one more. But at least I know the this Problem was quite wired :-/

Link to comment
Share on other sites

  • 39 years later...

Hey Guys,

I discovered the following problem e.g. with "Penance" (http://www.wowhead.com/?spell=47758). Just some examples in short form, to understand what's that about:

  • * target yourself and use "the hand" to cast penance at another friendly or unfriendly unit -> you will damage or heal yourself (ok, worked only in 3.0.9 because now you are abled to cast penance on yourself)
    * select a friendly or unfriendly unit and use e.g. the healbot (addon) to heal any of your party members -> you will heal whatever you have in your target selection currently
    * don't select anything and try the thing with the hand, healbot... whatever -> spell will channel but nothing triggers

Problem: All periodic, aura triggered spells have the target type 77 (currently called TARGET_SINGLE_ENEMY). Auras triggering such spells are handeled as SingleEnemyTargetAura. They store the guid of the current selection of a player when this aura gets applied. This guid is used, to get the correct unit target in the triggering methods in Aura.

Sollution: I discovered that class spells using this construct (so spells casted by players) always provide a second dummy aura, that is casted at the real, client-provided target. To get acces to the target I linked those dummy auras to the caster.

Other of those auras, that are no class skills (so mainly casted by mobs or used by quest items) cast the triggering aura directly on their target. The triggered spells simply have the same target as the triggering aura in this case, so that a dummy aura is not needed for target selection.

Update 30.07.09:

I rechecked the advices of thenecromancer and made it possible , that different dummy auras can stack on the target now. I also added SPELL_AURA_PERIODIC_TRIGGER_SPELL, SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH VALUE. This makes it possible, that also periodic triggering auras, that are directly casted on the victim (not on the caster, mostly those are spells used by creatures, e.g. http://www.wowhead.com/?spell=60906), are possible to stack.

http://github.com/pasdVn/mangos/commit/0210751587c9038ed9c40d428f364c55b961bca6.patch

In adition I discovered, that the hunters "tame beast" spell, that also uses this spell mechanic, won't work with this patch, because in CheckCast() the target of the trigger spell is checked (what is still the caster himself before the target map is filled). I just moved this check to the original channeling spell.

http://github.com/pasdVn/mangos/commit/62c1ba1f2110fea1dc6f3023180f2c8c7cbfa7e1.patch

Update 16.02.2010:

Updatet links. Patches rebased on [9397]. I'm not sure about the the second part with the tame pet effect. In fact it's a kind of hack, but as there is just one real spell with those effect it does not matter for now. Don't discovered how other implicit targets are handle in checkcast (target map is filled after checkcast() call).

pasdVn

Link to comment
Share on other sites

Nice, but it is not as simple.

You did forget about stacking more similar effects by multiple units, this includes for example two mages casting missiles on one target.

So you still have to:

* make sure that all dummy targeting auras stack

* check for caster guids as well

* ultimately, dirty solution might be to use channelling target instead ( this target is used only for channeling spells when it has dummy aura, right? )

Link to comment
Share on other sites

It is a guid stored and sent as unit value at time of channeling start ( unit field, do not know what enum it has assigned but you should figure it without much efforts ), but I'm afraid it might be unsafe, you should test it.

( for AE spells you can also use original casting coordinates ), this is just a timesafer, because your original idea is interesting but they did not make it easy ...

Link to comment
Share on other sites

Would be in fact a very easy sollution. I found this unit field (UNIT_FIELD_CHANNEL_OBJECT) but it will also be problematic. This guid is always set to the target of the first spell effect (see Spell::SendChannelStart). In general this is not always the target we want (especially only Mind Flay, where the dummy, that targets the victim is the 3rd effect, maybe this is also the problem why mind flay has some other bugs "level of target tot low" or anything similar).

Also possible that we change the code there a bit... I'll keep you up to date ;-)

Link to comment
Share on other sites

  • 1 month later...

Updatet first post and added necromancers advises :-) I'm just not sure, where and why I need to check the guid of the caster...

I kept may way for now (via dummy aura). Maybe I will try the thing with the channeling target later.

Edit: Sorry, I posted wrong links yesterday. Now the patches should be the correct version.

Link to comment
Share on other sites

  • 1 month later...

Yes, that is in fact still a problem and would require some more work :-/ (btw. I think that only delayed spells can get reflected^^). I'm also unshure about that, or if it is -maybe- really better to use the channeling target. But it is conspicous, that every of those kind of spells have a dummy aura, that get's applied to the client provided unit target...

Link to comment
Share on other sites

  • 1 month later...

The original spell is just an aura, that is castet on the caster itself. This aura periodically triggers the "real" spells (dmg/healing, whatever). This original target is not stored in the aura anywhere. That is why we have to get it from somewhere else (this dummy aura in this case).

I anyway have to update the patch, but don't have musch time currently, sorry :-(

Link to comment
Share on other sites

  • 3 months later...
thank you. will it solve the problem with the priest's Mind Flay spell? i mean the 'invalid target' bug, which occured when targetting a hostile target.
No, that is another problem :-/
In

void Aura::HandleAuraDummy(bool apply, bool Real) you are not checking caster pointer to NULL what can cause possible crashes.

Thanks! I already discovered that (or in fact it was hunuza^^) but did not update yet. I'm gonna do that soon.

Edit: Links updated.

Link to comment
Share on other sites

yep, i've seen that thread long ago and as you say that issue should be solved, but.. this bug is quite different. The notification 'invalid target' is shown even on higher level mobs or players. let me describe it a bit.. you as a shadow priest have lets say a heroic dungeon boss in your target, you apply your dots, cast mind blast everything goes fine to the point you want to cast mind flay. You have clearly in your target hostile mob(in this case boss) but mind flay refuses to shoot and you get the 'invalid target' message instead. and to this day no core patch fixed that issue. What is most strange.. i discussed it with other priests and some have this problem and some don't.. so one can just guess what is the real problem..

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

Du you use also the 2nd part? Patch is anyway outdatet. It was a nice idea, but also does not work corect in every case. I'm using another sollution currently on 'my' server. Maybe I'm going to provide it here and update this thread.

Link to comment
Share on other sites

  • 2 weeks later...
  • 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