Page 1 of 1

Uh oh

Posted: Sat Jul 23, 2016 1:18 pm
by Gangrenous
Small issue. I am doing a few new quest, one involves sparrow hawks. The issue is the corpse does not drop to the ground, they are staying up in the upper axis, not dropping down.

Re: Uh oh

Posted: Sat Jul 23, 2016 2:33 pm
by Jabantiz
Their location is on the ground with the y_offset making them appear in the air right? If so the client should handle all this on its own.

Re: Uh oh

Posted: Sat Jul 23, 2016 3:28 pm
by Gangrenous
Visually the body is at the same Y as where the mob died. Since these are birds, in the air, the body is in the air. This proposes a problem.

Re: Uh oh

Posted: Sun Jul 24, 2016 9:38 am
by Gangrenous
Hopefully this will help explain it. When the elevated spawn dies, it keeps the same Y axis. Could this be a thing with states? My memory of live is vague but didn't the birds dive during combat? If they are supposed to dive during combat maybe that is what brings them down on the Y axis. The more I think about that though, it probably would not work. As I notice the birds do dive if they have to come to you. I think we need something like a GetBestYAxis. I am not sure a solution to this but it does need to get fixed. I also know it is not just zone related to the one I am working on, Antonica. I set the same NPC up in South Qeynos and the problem persisted. Kind of thinking of it, this is somewhat similar to the "chest" problem I had before.

I searched the forums for quite a while and this thread does mention the y-offset a tad. But from what I know of these offsets they are random....right? So how does that help. If you set the y-offset to a value, you cannot always guarantee it will be above ground. Setting the hawk to ground level and the y-offset to something like 20, and killing the hawk..the body still stayed in the air.

Re: Uh oh

Posted: Sun Jul 24, 2016 12:50 pm
by xinux
If i had to guess I would say setting the mobs initial_state from 49156 to say 16512 when it dies will probably bring it down to the ground.

Re: Uh oh

Posted: Sun Jul 24, 2016 3:30 pm
by Gangrenous
Agreed, but what do we need to do it via script? That seems a bit kludgy. I agree that will work. Do you have a list of all of the states? The ones i have do not see complete.

Re: Uh oh

Posted: Sun Jul 24, 2016 4:12 pm
by xinux
I would do it in the code not via lua script personally. Jabantiz would know better since it has been years since I've looked at it along with the list of states.

Re: Uh oh

Posted: Sun Jul 24, 2016 5:08 pm
by Gangrenous
Would it be messy to have a field in the database called "death state" and change the state in the function called up death? The various states are new to me, just experiencing them now.

Re: Uh oh

Posted: Sun Jul 24, 2016 5:19 pm
by xinux
To me that just seems abit much since this really only needs to be done with flying mobs unless you are seeing it in other situations.

Re: Uh oh

Posted: Sun Jul 24, 2016 5:23 pm
by Jabantiz
initial_states mostly come from packet collects, there is no list that I am aware of. You could add to the code to set the initial_State to 16512 for all spawns on death, don't think that would have an ill effect on others but not sure. There is also no way for the server to determine accurate locations as it does not have knowledge of the level geometry, best that could be done is guess based off of players current y but that will still result in odd behavior most of the time.

Re: Uh oh

Posted: Sun Jul 24, 2016 7:02 pm
by Gangrenous
I can do that....rockin.

Re: Uh oh

Posted: Sun Jul 24, 2016 9:09 pm
by Gangrenous
That worked guys. I am going to clean up my code a bit and I will post what I put in my SVN some time tomorrow.

Re: Uh oh

Posted: Mon Jul 25, 2016 5:27 am
by Gangrenous
Anywhere in a

Code: Select all

if (dead->IsNPC() && !dead->IsPet()) {
in zoneserver.cpp, around line 3996 or so....

add

Code: Select all

dead->SetInitialState(16512, false); // This will make aerial npc's fall after death

Re: Uh oh

Posted: Sun Jun 24, 2018 9:18 pm
by Cynnar
Do we need to add this to the code, or is this resolved?