void CUser::UserInOut(uint8 bType)
{
	if (GetRegion() == nullptr)
		return;

	Packet result;

	if (bType != INOUT_OUT)
		ResetGMVisibility();

	GetInOut(result, bType);

	if (bType == INOUT_OUT)
		GetRegion()->Remove(this);
	else
		GetRegion()->Add(this);

	SendToRegion(&result, this, GetEventRoom());

	if (bType == INOUT_OUT || !isBlinking())
	{
		result.Initialize(AG_USER_INOUT);
		result.SByte();
		result << bType << GetSocketID() << GetName() << m_curx << m_curz;
		Send_AIServer(&result);
	}
}
Example #2
0
void Unit::InsertRegion(int16 insert_x, int16 insert_z)
{
	ASSERT(GetMap() != nullptr);

	Packet result;
	GetInOut(result, INOUT_IN);
	g_pMain->Send_NewRegions(&result, insert_x, insert_z, GetMap(), GetRegionX(), GetRegionZ());
}
Example #3
0
void Unit::RemoveRegion(int16 del_x, int16 del_z)
{
	ASSERT(GetMap() != nullptr);

	Packet result;
	GetInOut(result, INOUT_OUT);
	g_pMain->Send_OldRegions(&result, del_x, del_z, GetMap(), GetRegionX(), GetRegionZ());
}
Example #4
0
/**
* @brief        Constructs and sends an in/out packet for the NPC.
*
* @param        bType        The type (in or out).
* @param        fX           The x coordinate.
* @param        fZ           The z coordinate.
* @param        fY           The y coordinate.
*/
void CNpc::SendInOut(uint8 bType, float fX, float fZ, float fY)
{
        if (GetRegion() == nullptr)
        {
                SetRegion(GetNewRegionX(), GetNewRegionZ());
                if (GetRegion() == nullptr)
                        return;
        }

        if (bType == INOUT_OUT)
        {
                GetRegion()->Remove(this);
        }
        else        
        {
                GetRegion()->Add(this);
                SetPosition(fX, fY, fZ);
        }

        Packet result;
        GetInOut(result, bType);
        SendToRegion(&result);
}
void CUser::UserInOut(uint8 bType)
{
	if (GetRegion() == NULL)
		return;

	Packet result;
	GetInOut(result, bType);

	if (bType == INOUT_OUT)
		GetRegion()->Remove(this);
	else
		GetRegion()->Add(this);

	SendToRegion(&result, this);

	if (bType == INOUT_OUT || !isBlinking())
	{
		result.Initialize(AG_USER_INOUT);
		result.SByte();
		result << bType << GetSocketID() << m_pUserData.m_id << m_pUserData.m_curx << m_pUserData.m_curz;
		g_pMain->Send_AIServer(&result);
	}
}