Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Bug Reports

Development::Bug Reports Post detailed bug reports and what you would like to see next in the emu here.

Reply
 
Thread Tools Display Modes
  #1  
Old 10-23-2008, 12:08 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default NPC Appearance Breaks When Zoning

The issue is that if you set an NPC to a certain appearance either via quest scripts or command, any player that zones in after the new appearance has been set will still see the NPC as standing normally. So, if you have a script that sets NPCs to lie down, when you zone in, they will all be standing up. I have found a cheap work around for it by setting them on 1 minute timers to stand and lie down again, but that isn't a real fix to the issue.

I think all that needs to be done is to have NPCs send their appearance value to players when they zone. We should just be able to add a SendAppearancePacket to the zoning code. I can't seem to find where exactly this would need to get added. I imagine that it would be directly after sending spawn location information, but I don't see where that is in the code.

Here are the related commands that might be useful for getting this issue resolved:

mob.cpp
Code:
int32 Mob::GetAppearanceValue(EmuAppearance iAppearance) {
	switch (iAppearance) {
		// 0 standing, 1 sitting, 2 ducking, 3 lieing down, 4 looting
		case eaStanding: {
			return ANIM_STAND;
		}
		case eaSitting: {
			return ANIM_SIT;
		}
		case eaCrouching: {
			return ANIM_CROUCH;
		}
		case eaDead: {
			return ANIM_DEATH;
		}
		case eaLooting: {
			return ANIM_LOOT;
		}
		//to shup up compiler:
		case _eaMaxAppearance:
			break;
	}
	return(ANIM_STAND);
}
Code:
void Mob::SendAppearancePacket(int32 type, int32 value, bool WholeZone, bool iIgnoreSelf, Client *specific_target) {
	if (!GetID())
		return;
	EQApplicationPacket* outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
	SpawnAppearance_Struct* appearance = (SpawnAppearance_Struct*)outapp->pBuffer;
	appearance->spawn_id = this->GetID();
	appearance->type = type;
	appearance->parameter = value;
	if (WholeZone)
		entity_list.QueueClients(this, outapp, iIgnoreSelf);
	else if(specific_target != NULL)
		specific_target->QueuePacket(outapp, false, Client::CLIENT_CONNECTED);
	else if (this->IsClient())
		this->CastToClient()->QueuePacket(outapp, false, Client::CLIENT_CONNECTED);
	safe_delete(outapp);
}
I don't think we need to be sending appearance packets all of the time, just when people zone or if the appearance changes. Right now, it only appears to send them if the appearance changes while you are in the zone.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #2  
Old 10-23-2008, 02:17 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

You know what's funny I was actually thinking about this just yesterday "hey maybe I should fix that".
Reply With Quote
  #3  
Old 10-23-2008, 03:42 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Lmao! I swear that every time I mention something, you were already thinking of the same thing :P

I really don't think it will hard to fix, I just don't know where the actual code is that sends the spawn information when a player zones. I figured it would be in zoning.cpp, but I didn't see anything that stood out in there.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 10-23-2008, 04:36 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

I put in a change to send appearance updates when player zones in, from what I can tell it works.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 11:46 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3