New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Core/Script/Spell: Fix bug when Mirror Images could not start attack standin… #14896
Conversation
Hello Ofinka \o |
I think that all images should to attack same target if they detect him, and if owner start attacking another target, they should to switch target and attack owner's target. |
@Keader : if you read the code, it is written to do only 1 of 2 things; either attack owner's victim ( |
ye guys i realize victim choosing of this code is based on gargoyle targeting system.. i dont know why did I think it is right to do that this way. I will try to update this PR asap with threat victim finding if I find some way how to do that effectively.. It is a problem do it like a spellscript because i dont know how to make threat list for owner yet.. maybe if someone can give me some hint it would be faster :D |
The real problem is that sometimes you own target, use the spell and 1 or 2 images attack other random target. If we ever attack the mage target maybe the prejudice "not to attack the first in the list of threat" goes unnoticed. You can test this next giving Duel in a player near the NPCs another faction |
Some informations from wowwiki:
Other informations from forums:
|
AnyUnfriendlyUnitInObjectRangeCheck function isn't good solution for this problem at all because they shouldn't attack random unit. They just should to attack your target once you start attacking him, and they shouldn't stop attacking that target unless you CC him or switch on new target. |
try this update pls, any feedback is welcomed the main idea is choosing target based on threat after summon like references above, then changing targets with owner.. this update should also solve problem with interrupting cc after summon in #14877 |
@Ofinka The CC mechanics are without work. Whenever you are in CC they attack, totally ignoring the mechanics. Polymorph First : https://youtu.be/SZzK6eTL4bk Mirror Image First: https://youtu.be/OpgsWbl1IVc |
works for me |
Work for me too 👍 |
does Init() need to be called also in the reset? (asking) |
|
||
std::list<Unit*> targets; | ||
Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(me, me, 30.0f); | ||
Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(me, targets, u_check); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(!targets.empty())
{
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not necessary
@mik1893 I dont see calling Init() fn in reset() |
is this complete, tested and ready to be merged ? |
@jackpoz Ye, I think so.. |
any news? @jackpoz ? |
I've been testing this for days on cc685ac with players and they are ginving me only positive feedback about it. I think it may be merged. |
// Prioritize units with threat referenced to owner | ||
if (highestThreat > 0.0f && highestThreatUnit) | ||
me->Attack(highestThreatUnit, false); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this empty line is not needed
thank you for the fix |
(cherry picked from commit 263f127)
fixes problem with attack to standing characters #14877