Hovering creature on ground?

Hi,

I’ve been trying to understand how the hovering code works in the core, but without success. I’ve searched a bit in the forums and didn’t find what I’m looking for.

What I’m trying to achieve is to have an NPC that has a HoverHeight > 1, but that cannot actually fly (stays above ground at a specific height), with a movement type == 1 (randomly generated).

When I set the InhabitType=1, MovementType=1 and HoverHeight=5, when the NPC spawn, it looks fine. However, when it start wandering around, it keeps falling on the ground, and back in the air non-stop.

If I set the InhabitType to AIR then the creature doesn’t fall anymore, but then it does not stick at the specified height from the ground (it just flies at random heights).

How can I achieve that?

Thank you!

try with adding hover flag in bytes1

Vincient’s suggestion fully works, as a simple test i used bytes1 setting on Zar’jira because i am currently working the area and she was standing there begging to be my test subject. /emoticons/default_rolleyes.gif

her template is normal properties inhabittype=3, hover=1, i added for test this following querey and she is hovering and not floating up and down.

even considering the wiki has this:

bytes1
The value here overrides the value for the creature’s unit field UNIT_FIELD_BYTES_1.

List of known values and what their visual effects on the creature

[ul]
[li]1 = Sitting[/li][li]3 = Sleep[/li][li]7 = Shows health bar as empty (combine with the state dead emote to make a creature look dead)[/li][li]8 = Makes the mob kneel[/li][li]9 = Submerges the creature below the ground[/li][li]33554432 = Hover mode (NYI in core)[/li]
[/ul]
– test
DELETE FROM creature_template_addon WHERE (entry=38306);
INSERT INTO creature_template_addon (entry,path_id,mount,bytes1,bytes2,emote,auras) VALUES
(38306,0,0,33554432,0,0,‘’);

nice call Vincient!

So, the value was tested and found to not change a thing? Or was a likely outdated web page used to say the value was not yet implemented?

The bytes1 flag UNIT_BYTE1_FLAG_HOVER didn’t fix it. In fact, that flag was already set on my creature.

It works fine if the MovementType=0 (i.e. the creature does not randomly move). But if you set the MovementType to 1 (random movement generator) then its buggy. From what it looks (I haven’t looked at the code yet, about to do so…) it seems when the creature hits a bump on the ground, the code fails to properly set the Z value, thus the creature start poping up and down, sometimes even underground, and back in the air at the hover height that was set. Maybe a bug in the RandomMovementGenerator?

As for the wiki, its outdated, because the flag UNIT_BYTE1_FLAG_HOVER looks properly implemented in core.

Ok so far the conclusion I get is that:

[ol][li]Placing a creature that does not wander around, but that needs to hover, is achieved by setting the HoverHeight, and the hover flag in the bytes1, as mentioned above.[/li] [li]If you need a creature that wanders around above ground, at heights > 1, you should set the inhabit type to air only, and simply spawn it at the desired height. (Don’t use hover mode)[/li][/ol]
For some reasons, it seems the client is causing the issue if you try to mix hover mode with random movement type. I don’t think its fixable server-side.

yes, i paid no attention to it before but i had same issue with bats doing randoms above building, set to 4 only and no hover set movementtype to random in creature and all perfect… too many places to changes settings for same thing… such as rands can be done in creature_template and yet in creature tables and thus other flags as well… this tends to cause issues as you say… they should have been ironed out years ago but are still lingering in the core. maybe it’ll be changed later.