Description:
Creatures do not continue to move after casting a non-instant spell, if player not moves.
Expected behaviour:
After casting non-instanst spells, the mob must continue to move toward the target.
Current behaviour:
Creatures do not continue to move after casting a non-instant spell, if player not moves.
Steps to reproduce the problem:
1) Create a character with the possibility of a distant attack (hunters are best)
2) Inflict damage on the mob, which can cast non-instantaneous spells and is controlled by SmartScript
(for example http://ru.wowhead.com/npc=3197 )
3) Try not to move BEFORE and AFTER the creature spell cast.
4) If items 1-3 are fulfilled, and if this creature is far from you and can not make automatic attacks, then after completing the caste the creature will remain in place until you move (do not move)
Branch(es):
3.3.5
TC rev. hash/commit:
http://www.picshare.ru/view/8774408/
Operating system: Windows 7
Maximize your worldserver.exe console, then press <Enter>
a couple of times and type this command:
TC>
TC>
TC>server debug
post the result in your comment post above, under TC rev. hash/commit:
http://ru.wowhead.com/npc=3197 cast only https://woehead.way-of-elendil.fr/?spell=5262 on itself as a buff, I wasn't able to reproduce the issue even with https://woehead.way-of-elendil.fr/?npc=3198 that use "Burning Blade Apprentice - In Combat CMC - Cast 'Shadow Bolt'"
Pls look for this:
https://drive.google.com/open?id=1k2EOg94l53DCEv7oa79AHbNhYk7w-Y81
To reproduce the issue:
1- .go xyz 1417.5103, -4893.4194, 9.188299 1
2- Focus the Orc on the cavern entrance http://wowhead.com/npc=3197
3- .dam 1 and don't move your char
4- once the npc cast https://woehead.way-of-elendil.fr/?spell=5262 it will stop chasing
5- move your char and notice the npc will resume the chasing
If the npc doesn't cast the spell 5262 start again.
Can you post and check the SAI script?
Classic SAI, In combat cast spell on self
``` sql
INSERT INTO smart_scripts (entryorguid, source_type, id, link, event_type, event_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, event_param5, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_x, target_y, target_z, target_o, comment) VALUES
(3197, 0, 0, 0, 0, 0, 100, 0, 1000, 11000, 16000, 22000, 0, 11, 5262, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Burning Blade Fanatic - In Combat - Cast 'Fanatic Blade"');
It's not related to SAI, but to spells with cast time, if you aggro any npc that's not using any AI or script then .cast self 5262 it will disable the movement.
You can reproduce the issue with any spell that have a cast time like flash heal or shadow bolt:
https://woehead.way-of-elendil.fr/?spell=2061
https://woehead.way-of-elendil.fr/?spell=686
1) In class ChaseMovementGenerator, there are no overridden (MovementGenerator - parent) methods, such as:
virtual void Pause(uint32/* timer = 0/) { } // timer in ms
virtual void Resume(uint32/ overrideTimer = 0*/) { } // timer in ms
and this solution is not the best way:
UP!
Why use Microsoft Word to write a text-only snippet? Notepad/Notepad++ or any other text-only application is better, not to mention you could put the code directly in your comment and use GitHub MarkDown to highlight code syntax :
/* ChaseMovementGenerator.h */
class ChaseMovementGenerator : public MovementGenerator, public AbstractFollower
{
public:
MovementGeneratorType GetMovementGeneratorType() const override { return CHASE_MOTION_TYPE; }
ChaseMovementGenerator(Unit* target, Optional<ChaseRange> range = {}, Optional<ChaseAngle> angle = {});
~ChaseMovementGenerator();
void Initialize(Unit* owner) override;
void Reset(Unit* owner) override { Initialize(owner); }
bool Update(Unit* owner, uint32 diff) override;
void Finalize(Unit* owner) override;
void UnitSpeedChanged() override { _lastTargetPosition.Relocate(0.0f,0.0f,0.0f); }
private:
static constexpr uint32 RANGE_CHECK_INTERVAL = 100; // time (ms) until we attempt to recalculate
Optional<ChaseRange> const _range;
Optional<ChaseAngle> const _angle;
std::unique_ptr<PathGenerator> _path;
Position _lastTargetPosition;
uint32 _rangeCheckTimer = RANGE_CHECK_INTERVAL;
bool _movingTowards = true;
bool _mutualChase = true;
++bool _needCheckAfterCastingSpell = false;
};
BTW, you may be interested in the Pull Request https://github.com/TrinityCore/TrinityCore/pull/21888 [WIP] [3.3.5] Core/Movement: expand Movement Slot implementation by ccrs and possible follow-up work later on.
will be solved with the PR, confirmed
well, this issue is bigger than it seemed, only one part of it was solved by 982643cd96790ffc54e7a3e507469649f3b074d2
Apply patch:
https://github.com/TrinityCore/TrinityCore/issues/20922#issuecomment-406778490
And re-test. The condition that checks if the player is moving or not has been removed in the changes.
ref:
https://gist.github.com/Langerz82/1dbe4acec7fb6bbedf61fb4a44aeece3#file-movementbackandcircle-diff-L472
Most helpful comment
will be solved with the PR, confirmed