[Fix] Gender NPC

04/30/2020 16:18 QuietSmoke#1
Hi epvp! I heard that too much guys need help with Male npc, because even at official server its bugged. Then , enjoy it.
I offer you 2 fixes.


[Only registered and activated users can see links. Click Here To Register...]

_Common/ObjSerializeOpt.cpp: function CMover::Serialize
Search
Code:
ar << (u_char)m_dwHairMesh << m_dwHairColor << (u_char)m_dwHeadMesh;
Add below:
Code:
ar << m_bySex;
Search
Code:
ar >> (u_char&)m_dwHairMesh >> m_dwHairColor >> (u_char&)m_dwHeadMesh;
Add below:
Code:
ar >> m_bySex;
The first one :

_Common/WorldFile.cpp: function CWorld::LoadObject
Search
Code:
if( pObj->GetType() == OT_MOVER && lstrlen( static_cast<CMover*>(pObj)->GetCharacter()->m_szKey ) )
{
	LPCHARACTER lpChar = static_cast<CMover*>(pObj)->GetCharacter();
	lpChar->m_dwWorldId = GetID();
	lpChar->m_vPos = pObj->GetPos();
Add below:
Code:
	if(((CMover*)pObj)->m_dwIndex == MI_MALE || ((CMover*)pObj)->m_dwIndex == MI_FEMALE)
	{
		((CMover*)pObj)->m_bySex = ((CMover*)pObj)->m_dwIndex - MI_MALE;
		lpChar->m_dwMoverIdx = ((CMover*)pObj)->m_dwIndex;
	}
The second:
The second working, but if you still empty model
I mean, without world editor settings - you got fail
World editor settings - the string with (MaFl_NPCNAME or something like that)


_Common/WorldFile.cpp: function CWorld::LoadObject
Replace:
Code:
if( pObj->GetType() == OT_MOVER && lstrlen( static_cast<CMover*>(pObj)->GetCharacter()->m_szKey ) )
{
	LPCHARACTER lpChar = static_cast<CMover*>(pObj)->GetCharacter();
	lpChar->m_dwWorldId = GetID();
	lpChar->m_vPos = pObj->GetPos();
}
To:
Code:
if(pObj->GetType() == OT_MOVER)
{
	if(lstrlen(static_cast<CMover*>(pObj)->GetCharacter()->m_szKey))
	{
		LPCHARACTER lpChar = static_cast<CMover*>(pObj)->GetCharacter();
		lpChar->m_dwWorldId = GetID();
		lpChar->m_vPos = pObj->GetPos();
		if(((CMover*)pObj)->m_dwIndex == MI_MALE || ((CMover*)pObj)->m_dwIndex == MI_FEMALE)
		{
			((CMover*)pObj)->m_bySex = ((CMover*)pObj)->m_dwIndex - MI_MALE;
			lpChar->m_dwMoverIdx = ((CMover*)pObj)->m_dwIndex;
		}
	}
	else
	{
		if(pObj->m_dwIndex == MI_MALE || pObj->m_dwIndex == MI_FEMALE)
		{
			if(((CMover*)pObj)->m_dwIndex == MI_MALE || ((CMover*)pObj)->m_dwIndex == MI_FEMALE)
				((CMover*)pObj)->m_bySex = ((CMover*)pObj)->m_dwIndex - MI_MALE;
		}
	}
}
Build Neuz, WordServer and DB server
04/30/2020 16:53 B1ackSnow#2
Good job.
Very useful.
04/30/2020 19:08 gwapingsjericho#3
Not working.
04/30/2020 19:36 QuietSmoke#4
Quote:
Originally Posted by gwapingsjericho View Post
Not working.
Everything is working. Tested on 2 servers
Check

Quote:
Originally Posted by gwapingsjericho View Post
Not working.
I added a second fix, try it.
04/30/2020 20:43 gwapingsjericho#5
Quote:
Originally Posted by QuietSmoke View Post
Everything is working. Tested on 2 servers
Check



I added a second fix, try it.
You try with lookchange?
04/30/2020 20:46 B1ackSnow#6
Quote:
Originally Posted by gwapingsjericho View Post
Not working.
everything work, man
look again, maybe you did something wrong[Only registered and activated users can see links. Click Here To Register...]
04/30/2020 20:46 QuietSmoke#7
Quote:
Originally Posted by gwapingsjericho View Post
You try with lookchange?
Yes. I have a fully working __LOOKCHANGE.