azerothcore-wotlk icon indicating copy to clipboard operation
azerothcore-wotlk copied to clipboard

[ScriptAI] Many boss can't fly when use ScirptAI temporary access to sky

Open kissingers opened this issue 11 months ago • 2 comments

Current Behaviour

Any combination of the following contains with me->SetDisableGravity(true); can not fly or stay on the sky after any action. So many bosses lose the ability to fly, or fly into the air and fall down quickly. It feels like the disable gravity temporary marker is not working.

me->SetCanFly(true); me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); me->SendMovementFlagUpdate();

Expected Blizzlike Behaviour

They can fly at some event until finished the event.

Source

No response

Steps to reproduce the problem

look at boss felmyst,illidan , nightbane,when the sky phase , after they cast spell, they all fall to grand.

Extra Notes

https://github.com/azerothcore/azerothcore-wotlk/issues/15855

AC rev. hash/commit

AzerothCore rev. 9616433b6609+ 2024-03-10 16:52:03 -0300 (master branch) (Unix, RelWithDebInfo, Static)

Operating system

debian12 x64

Custom changes or Modules

No response

kissingers avatar Mar 13 '24 18:03 kissingers

https://github.com/azerothcore/azerothcore-wotlk/issues/18488 https://github.com/azerothcore/azerothcore-wotlk/issues/15855

kissingers avatar Mar 13 '24 18:03 kissingers

It seem when use me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF) after cast any spell or move , it will fall to grand.

kissingers avatar Mar 13 '24 18:03 kissingers

Can you provide an example ? Firstly, SetCanFly uage is completely wrong. This method is often badly used, but it is mainly for players. You should use "SetDisableGravity" for creatures. Then you need to use the right MotionMaster movement.

For example, with Kael'thas issue, it's MotionMaster::MoveTakeoff and not MovePoint (and when flying, cast others spells doesn't break GravityFlag). But I according that the behaviour of MotionMaster seems weird.

Grimdhex avatar Aug 17 '24 09:08 Grimdhex

Can you provide an example ? Firstly, SetCanFly uage is completely wrong. This method is often badly used, but it is mainly for players. You should use "SetDisableGravity" for creatures. Then you need to use the right MotionMaster movement.

For example, with Kael'thas issue, it's MotionMaster::MoveTakeoff and not MovePoint (and when flying, cast others spells doesn't break GravityFlag). But I according that the behaviour of MotionMaster seems weird.

Yes, I find the way to fix the problem for some boss, such as Felmyst like this way: https://github.com/azerothcore/azerothcore-wotlk/commit/46ba1ba6a327db712a219cef8f09d2c24ae7bc5a

and nightbane seems alread ok till now fix. but illidan still will first fly to sky and then drop to ground and run at ground not fly at sky, it seems there is PR to be testing for illidan, might need fix the problem at the PR or later.

kissingers avatar Aug 17 '24 09:08 kissingers

And I find when felmyst at sky fly, if cast spell, will need add flow code again, otherwise will drop to ground and run at ground, it seems cast spell auto stop SetDisableGravity(true) , I think only need update the status once till SetDisableGravity(false) , cast the spell will not stop the status. so it might a problem. me->SetDisableGravity(true); me->SendMovementFlagUpdate();

kissingers avatar Aug 17 '24 09:08 kissingers

I've debug Kael'Thas and you have effectly right. m_movementInfo loose the movement flag after reaching the first DoCastSelf following but the spline flag keep in memory the movement mode. This is why we have such variable situations.

I will try to look depper why this flag is lost when the creature cast (or maybe do) something.

Grimdhex avatar Aug 17 '24 12:08 Grimdhex