Jump to content
Maintenance ×
×
×
  • Create New...
  • 0

bug in NewPetSystem in pet size please help


kingshero

Question

hello all

i have problem in pet size i show now the normal system 

this is normal system 

in level 1:

Spoiler

tlmfdv9.jpg

normal system

in level 82 big size :

Spoiler

nBzSSx5.jpg

but in my server

in level 1:

Spoiler

VMuReTP.png

in my server 

in level 82 same size :

Spoiler

bBaUEa5.png

how to solve this problem please !

Link to comment
Share on other sites

17 answers to this question

Recommended Posts

  • 0
On 8/31/2017 at 2:06 AM, Amok said:

you have sash with scale ? 

yes bro i have sash system with scale and this is my GrpObjectInstance.cpp

Spoiler

#include "StdAfx.h"
#include "GrpObjectInstance.h"
#include "../eterBase/Timer.h"

void CGraphicObjectInstance::OnInitialize()
{
    ZeroMemory(m_abyPortalID, sizeof(m_abyPortalID));
}

void CGraphicObjectInstance::Clear()
{
    if (m_CullingHandle)
    {
        CCullingManager::Instance().Unregister(m_CullingHandle);
        m_CullingHandle = NULL;
    }

    ClearHeightInstance();

    m_isVisible = TRUE;

    m_v3Position.x = m_v3Position.y = m_v3Position.z = 0.0f;
    m_v3Scale.x = m_v3Scale.y = m_v3Scale.z = 0.0f;
    //m_fRotation = 0.0f;
    m_fYaw = m_fPitch = m_fRoll = 0.0f;
    D3DXMatrixIdentity(&m_worldMatrix);
    m_vecScalePos.x = m_vecScalePos.y = m_vecScalePos.z = 0.0f;
    m_vecScaleNew.x = m_vecScaleNew.y = m_vecScaleNew.z = 0.0f;

    D3DXMatrixIdentity(&m_matAbsoluteTrans);
    D3DXMatrixIdentity(&m_matScale);
    D3DXMatrixIdentity(&m_matPositon);
    #ifdef ENABLE_OBJ_SCALLING
    m_v3ScalePosition.x = m_v3ScalePosition.y = m_v3ScalePosition.z = 0.0f;
    D3DXMatrixIdentity(&m_ScaleMatrix);
    D3DXMatrixIdentity(&m_PositionMatrix);
    D3DXMatrixIdentity(&m_TransformMatrix);
    #endif
    
    ZeroMemory(m_abyPortalID, sizeof(m_abyPortalID));

    OnClear();
}

bool CGraphicObjectInstance::Render()
{
    /*
    if (m_CullingHandle)
    {
        SpherePack * ps = m_CullingHandle->GetParent();
        CScreen s;
        s.SetColorOperation();
        //s.SetDiffuseColor(1,isShow()?1:0,0);
        //s.RenderCircle2d(m_CullingHandle->GetCenter().x,m_CullingHandle->GetCenter().y,m_CullingHandle->GetCenter().z,m_CullingHandle->GetRadius());
        s.SetDiffuseColor(1,isShow()?1:0,ps->HasSpherePackFlag(SPF_PARTIAL)?1:0);
        s.RenderCircle2d(ps->GetCenter().x,ps->GetCenter().y,ps->GetCenter().z,ps->GetRadius());
    }
    //*/
    if (!isShow())
        return false;

    OnRender();
    return true;
}

void CGraphicObjectInstance::BlendRender()
{
    if (!isShow())
        return;

    OnBlendRender();
}

void CGraphicObjectInstance::RenderToShadowMap()
{
    if (!isShow())
        return;

    OnRenderToShadowMap();
}

void CGraphicObjectInstance::RenderShadow()
{
    if (!isShow())
        return;

    OnRenderShadow();
}

void CGraphicObjectInstance::RenderPCBlocker()
{
    if (!isShow())
        return;

    OnRenderPCBlocker();
}

void CGraphicObjectInstance::Update()
{
    OnUpdate();

    UpdateBoundingSphere();
}

void CGraphicObjectInstance::Deform()
{
    if (!isShow())
        return;

    OnDeform();
}


/*void CGraphicObjectInstance::Transform()
{
    m_worldMatrix = m_mRotation;

    m_worldMatrix._41    += m_v3Position.x;
    m_worldMatrix._42    += m_v3Position.y;
    m_worldMatrix._43    += m_v3Position.z;
}*/

void CGraphicObjectInstance::Transform()
{
    D3DXMATRIX temp;
    D3DXMatrixMultiply(&temp, &m_matPositon, &m_mRotation);

    m_worldMatrix = temp;

    m_worldMatrix._41 += m_v3Position.x;
    m_worldMatrix._42 += m_v3Position.y;
    m_worldMatrix._43 += m_v3Position.z;

    D3DXMatrixMultiply(&temp, &m_matPositon, &m_matScale);

    D3DXMATRIX temp3;
    D3DXMatrixMultiply(&temp3, &temp, &m_mRotation);

    m_matAbsoluteTrans = temp3;
    m_matAbsoluteTrans._41 = m_vecScalePos.x + m_v3Position.x + m_matAbsoluteTrans._41;
    m_matAbsoluteTrans._42 = m_vecScalePos.y + m_v3Position.y + m_matAbsoluteTrans._42;
    m_matAbsoluteTrans._43 = m_vecScalePos.z + m_v3Position.z + m_matAbsoluteTrans._43;


    D3DXMATRIX temp2;
    D3DXMatrixMultiply(&temp2, &temp, &m_mRotation);

    m_matAbsoluteTrans = temp2;
    m_matAbsoluteTrans._41 = m_vecScalePos.x + m_v3Position.x + m_matAbsoluteTrans._41;
    m_matAbsoluteTrans._42 = m_vecScalePos.y + m_v3Position.y + m_matAbsoluteTrans._42;
    m_matAbsoluteTrans._43 = m_vecScalePos.z + m_v3Position.z + m_matAbsoluteTrans._43;
#endif
#ifndef ENABLE_OBJ_SCALLING
    m_worldMatrix = m_mRotation;
    m_worldMatrix._41 += m_v3Position.x;
    m_worldMatrix._42 += m_v3Position.y;
    m_worldMatrix._43 += m_v3Position.z;
#else
    
    D3DXMATRIX tmp1;
    D3DXMatrixMultiply(&tmp1, &m_PositionMatrix, &m_mRotation);
    
    m_worldMatrix = tmp1;
    m_worldMatrix._41 += m_v3Position.x;
    m_worldMatrix._42 += m_v3Position.y;
    m_worldMatrix._43 += m_v3Position.z;
    D3DXMatrixMultiply(&tmp1, &m_PositionMatrix, &m_ScaleMatrix);
    
    D3DXMATRIX tmp2;
    D3DXMatrixMultiply(&tmp2, &tmp1, &m_mRotation);
    
    m_TransformMatrix = tmp2;
    m_TransformMatrix._41 = m_v3ScalePosition.x + m_v3Position.x + m_TransformMatrix._41;
    m_TransformMatrix._42 = m_v3ScalePosition.y + m_v3Position.y + m_TransformMatrix._42;
    m_TransformMatrix._43 = m_v3ScalePosition.z + m_v3Position.z + m_TransformMatrix._43;
#endif
}

const D3DXVECTOR3 & CGraphicObjectInstance::GetPosition() const
{
    return m_v3Position;
}

const D3DXVECTOR3 & CGraphicObjectInstance::GetScale() const
{
    return m_v3Scale;
}

float CGraphicObjectInstance::GetRotation()
{
    return GetRoll();
}

float CGraphicObjectInstance::GetYaw()
{
    return m_fYaw;
}

float CGraphicObjectInstance::GetPitch()
{
    return m_fPitch;
}

float CGraphicObjectInstance::GetRoll()
{
    return m_fRoll;
}

D3DXMATRIX & CGraphicObjectInstance::GetTransform()
{
    return m_worldMatrix;
}

void CGraphicObjectInstance::SetRotationQuaternion(const D3DXQUATERNION &q)
{
    D3DXMatrixRotationQuaternion(&m_mRotation, &q);
}

void CGraphicObjectInstance::SetRotationMatrix(const D3DXMATRIX & m)
{
    m_mRotation = m;
}

void CGraphicObjectInstance::SetRotation(float fRotation)
{
    m_fYaw = 0;
    m_fPitch = 0;
    m_fRoll = fRotation;

    D3DXMatrixRotationZ(&m_mRotation, D3DXToRadian(fRotation));
}

void CGraphicObjectInstance::SetRotation(float fYaw, float fPitch, float fRoll)
{
    //m_fRotation = fRotation;
    m_fYaw = fYaw;
    m_fPitch = fPitch;
    m_fRoll = fRoll;

    D3DXMatrixRotationYawPitchRoll(&m_mRotation, D3DXToRadian(fYaw), D3DXToRadian(fPitch), D3DXToRadian(fRoll));
}

void CGraphicObjectInstance::SetPosition(float x, float y, float z)
{
    m_v3Position.x = x;
    m_v3Position.y = y;
    m_v3Position.z = z;
}

void CGraphicObjectInstance::SetPosition(const D3DXVECTOR3 & newposition)
{
    m_v3Position = newposition;
}

/*void CGraphicObjectInstance::SetScale(float x, float y, float z)
{
    m_v3Scale.x = x;
    m_v3Scale.y = y;
    m_v3Scale.z = z;
}*/

#ifdef ENABLE_OBJ_SCALLING
void CGraphicObjectInstance::SetScalePosition(float x, float y, float z)
{
    m_v3ScalePosition.x = x;
    m_v3ScalePosition.y = y;
    m_v3ScalePosition.z = z;
    m_vecScalePos.x = x;
    m_vecScalePos.y = y;
    m_vecScalePos.z = z;
}

void CGraphicObjectInstance::SetScale(float x, float y, float z, bool bScaleNow)
#else
void CGraphicObjectInstance::SetScale(float x, float y, float z)
#endif
{
    m_v3Scale.x = x;
    m_v3Scale.y = y;
    m_v3Scale.z = z;
    
    #ifdef ENABLE_OBJ_SCALLING
    if (bScaleNow)
        D3DXMatrixScaling(&m_ScaleMatrix, m_v3Scale.x, m_v3Scale.y, m_v3Scale.z);
    #endif
}


void CGraphicObjectInstance::SetScaleNew(float x, float y, float z)
{
    m_vecScaleNew.x = x;
    m_vecScaleNew.y = y;
    m_vecScaleNew.z = z;
    D3DXMatrixScaling(&m_matScale, x, y, z);
}

void CGraphicObjectInstance::SetScaleNew(const D3DXVECTOR3 & newscale)
{
    m_vecScaleNew = newscale;
    D3DXMatrixScaling(&m_matScale, m_vecScaleNew.x, m_vecScaleNew.y, m_vecScaleNew.z);
}

void CGraphicObjectInstance::SetScalePosition(const D3DXVECTOR3 & newposition)
{
    m_vecScalePos = newposition;
}

void CGraphicObjectInstance::Show()
{
    m_isVisible = true;
}

void CGraphicObjectInstance::Hide()
{
    m_isVisible = false;
}
bool CGraphicObjectInstance::isShow()
{
    return m_isVisible;
}

//

//////////////////////////////////////////////////////////////////////////

D3DXVECTOR4 & CGraphicObjectInstance::GetWTBBoxVertex(const unsigned char & c_rucNumTBBoxVertex)
{
    return m_v4TBBox[c_rucNumTBBoxVertex];
}

bool CGraphicObjectInstance::isIntersect(const CRay & c_rRay, float * pu, float * pv, float * pt)
{
    D3DXVECTOR3 v3Start, v3Dir;
    float fRayRange;
    c_rRay.GetStartPoint(&v3Start);
    c_rRay.GetDirection(&v3Dir, &fRayRange);

    TPosition posVertices[8];

    posVertices[0] = TPosition(m_v3TBBoxMin.x, m_v3TBBoxMin.y, m_v3TBBoxMin.z);
    posVertices[1] = TPosition(m_v3TBBoxMax.x, m_v3TBBoxMin.y, m_v3TBBoxMin.z);
    posVertices[2] = TPosition(m_v3TBBoxMin.x, m_v3TBBoxMax.y, m_v3TBBoxMin.z);
    posVertices[3] = TPosition(m_v3TBBoxMax.x, m_v3TBBoxMax.y, m_v3TBBoxMin.z);
    posVertices[4] = TPosition(m_v3TBBoxMin.x, m_v3TBBoxMin.y, m_v3TBBoxMax.z);
    posVertices[5] = TPosition(m_v3TBBoxMax.x, m_v3TBBoxMin.y, m_v3TBBoxMax.z);
    posVertices[6] = TPosition(m_v3TBBoxMin.x, m_v3TBBoxMax.y, m_v3TBBoxMax.z);
    posVertices[7] = TPosition(m_v3TBBoxMax.x, m_v3TBBoxMax.y, m_v3TBBoxMax.z);

    TIndex Indices[36] = {0, 1, 2, 1, 3, 2,
                          2, 0, 6, 0, 4, 6,
                          0, 1, 4, 1, 5, 4,
                          1, 3, 5, 3, 7, 5,
                          3, 2, 7, 2, 6, 7,
                          4, 5, 6, 5, 7, 6};

    int triCount = 12;
    WORD* pcurIdx = (WORD*)Indices;

    while (triCount--)
    {
        if (IntersectTriangle(v3Start, v3Dir,
            posVertices[pcurIdx[0]],
            posVertices[pcurIdx[1]],
            posVertices[pcurIdx[2]],
            pu, pv, pt))
        {
            return true;
        }

        pcurIdx += 3;
    }

    return false;
}

CGraphicObjectInstance::CGraphicObjectInstance()
{
    m_CullingHandle = 0;
    Initialize();
}

void CGraphicObjectInstance::Initialize()
{
    if (m_CullingHandle)
        CCullingManager::Instance().Unregister(m_CullingHandle);
    m_CullingHandle = 0;

    m_pHeightAttributeInstance = NULL;

    m_isVisible = TRUE;

    m_BlockCamera = false;

    m_v3Position.x = m_v3Position.y = m_v3Position.z = 0.0f;
    //m_v3Scale.x = m_v3Scale.y = m_v3Scale.z = 0.0f;
    #ifdef ENABLE_OBJ_SCALLING
    m_v3Scale.x = m_v3Scale.y = m_v3Scale.z = 0.0f;
    #else
    m_v3Scale.x = m_v3Scale.y = m_v3Scale.z = 1.0f;
    #endif
    m_fYaw = m_fPitch = m_fRoll = 0.0f;

    D3DXMatrixIdentity(&m_worldMatrix);
    D3DXMatrixIdentity(&m_mRotation);
    m_vecScalePos.x = m_vecScalePos.y = m_vecScalePos.z = 0.0f;
    m_vecScaleNew.x = m_vecScaleNew.y = m_vecScaleNew.z = 0.0f;

    D3DXMatrixIdentity(&m_matAbsoluteTrans);
    D3DXMatrixIdentity(&m_matScale);
    D3DXMatrixIdentity(&m_matPositon);
    #ifdef ENABLE_OBJ_SCALLING
    m_v3ScalePosition.x = m_v3ScalePosition.y = m_v3ScalePosition.z = 0.0f;
    
    D3DXMatrixIdentity(&m_ScaleMatrix);
    D3DXMatrixIdentity(&m_PositionMatrix);
    D3DXMatrixIdentity(&m_TransformMatrix);
    #endif

    OnInitialize();
}

CGraphicObjectInstance::~CGraphicObjectInstance()
{
    Initialize();
}

void CGraphicObjectInstance::UpdateBoundingSphere()
{
    if (m_CullingHandle)
    {
        Vector3d center;
        float radius;
        GetBoundingSphere(center,radius);
        if (radius != m_CullingHandle->GetRadius())
            m_CullingHandle->NewPosRadius(center,radius);
        else
            m_CullingHandle->NewPos(center);
    }
}

void CGraphicObjectInstance::RegisterBoundingSphere()
{
    if (m_CullingHandle)
        CCullingManager::Instance().Unregister(m_CullingHandle);

    m_CullingHandle = CCullingManager::Instance().Register(this);
}

void CGraphicObjectInstance::AddCollision(const CStaticCollisionData * pscd, const D3DXMATRIX* pMat)
{
    m_StaticCollisionInstanceVector.push_back(CBaseCollisionInstance::BuildCollisionInstance(pscd, pMat));
}

void CGraphicObjectInstance::ClearCollision()
{
    CCollisionInstanceVector::iterator it;
    for(it = m_StaticCollisionInstanceVector.begin();it!=m_StaticCollisionInstanceVector.end();++it)
    {
        (*it)->Destroy();
    }
    m_StaticCollisionInstanceVector.clear();
}

bool CGraphicObjectInstance::CollisionDynamicSphere(const CDynamicSphereInstance & s) const
{
    CCollisionInstanceVector::const_iterator it;
    for(it = m_StaticCollisionInstanceVector.begin();it!=m_StaticCollisionInstanceVector.end();++it)
    {
        if ((*it)->CollisionDynamicSphere(s))
            return true;
    }
    return false;
}

bool CGraphicObjectInstance::MovementCollisionDynamicSphere(const CDynamicSphereInstance & s) const
{
    CCollisionInstanceVector::const_iterator it;
    for(it = m_StaticCollisionInstanceVector.begin();it!=m_StaticCollisionInstanceVector.end();++it)
    {
        if ((*it)->MovementCollisionDynamicSphere(s))
            return true;
    }
    return false;
}

D3DXVECTOR3 CGraphicObjectInstance::GetCollisionMovementAdjust(const CDynamicSphereInstance & s) const
{
    CCollisionInstanceVector::const_iterator it;
    for(it = m_StaticCollisionInstanceVector.begin();it!=m_StaticCollisionInstanceVector.end();++it)
    {
        if ((*it)->MovementCollisionDynamicSphere(s))
            return (*it)->GetCollisionMovementAdjust(s);
    }

    return D3DXVECTOR3(0.0f,0.0f,0.0f);
}

void CGraphicObjectInstance::UpdateCollisionData(const CStaticCollisionDataVector * pscdVector)
{
    ClearCollision();
    OnUpdateCollisionData(pscdVector);
}

DWORD CGraphicObjectInstance::GetCollisionInstanceCount()
{
    return m_StaticCollisionInstanceVector.size();
}

CBaseCollisionInstance * CGraphicObjectInstance::GetCollisionInstanceData(DWORD dwIndex)
{
    if (dwIndex>m_StaticCollisionInstanceVector.size())
    {
        return 0;
    }
    return m_StaticCollisionInstanceVector[dwIndex];
}

//////////////////////////////////////////////////////////////////////////
// Height

void CGraphicObjectInstance::SetHeightInstance(CAttributeInstance * pAttributeInstance)
{
    m_pHeightAttributeInstance = pAttributeInstance;
}

void CGraphicObjectInstance::ClearHeightInstance()
{
    m_pHeightAttributeInstance = NULL;
}

void CGraphicObjectInstance::UpdateHeightInstance(CAttributeInstance * pAttributeInstance)
{
    ClearHeightInstance();
    OnUpdateHeighInstance(pAttributeInstance);
}

bool CGraphicObjectInstance::IsObjectHeight()
{
    if (m_pHeightAttributeInstance)
        return true;

    return false;
}

bool CGraphicObjectInstance::GetObjectHeight(float fX, float fY, float * pfHeight)
{
    if (!m_pHeightAttributeInstance)
        return false;

    return OnGetObjectHeight(fX, fY, pfHeight);
}

void CGraphicObjectInstance::SetPortal(DWORD dwIndex, int iID)
{
    if (dwIndex >= PORTAL_ID_MAX_NUM)
    {
        assert(dwIndex < PORTAL_ID_MAX_NUM);
        return;
    }

    m_abyPortalID[dwIndex] = iID;
}

int CGraphicObjectInstance::GetPortal(DWORD dwIndex)
{
    if (dwIndex >= PORTAL_ID_MAX_NUM)
    {
        assert(dwIndex < PORTAL_ID_MAX_NUM);
        return 0;
    }

    return m_abyPortalID[dwIndex];
}
 

This is link file in patebin

https://pastebin.com/WhAvXDNk

Link to comment
Share on other sites

  • 0
On 9/6/2017 at 11:42 AM, Xerneas said:

You have to edit  func i  instacebase?

In this func theres a check for this. But i recommed to rewrite the scale func from Sash

Spoiler

    if(m_dwRace == 34241 || m_dwRace == 34245 || m_dwRace == 34249 || m_dwRace == 34253 || m_dwRace == 34257 || m_dwRace == 34261 || m_dwRace == 34242 || m_dwRace == 34246 || m_dwRace == 34250 || m_dwRace == 34254 || m_dwRace == 34258 || m_dwRace == 34262)
    {
        float scale = c_rkCreateData.m_dwLevel * 0.009f + 0.65f;
        m_GraphicThingInstance.SetScaleNew(scale, scale, scale);
    }
    else
        m_GraphicThingInstance.SetScaleNew(1.0f,1.0f,1.0f);

 

Just now, kingshero said:

    if(m_dwRace == 34241 || m_dwRace == 34245 || m_dwRace == 34249 || m_dwRace == 34253 || m_dwRace == 34257 || m_dwRace == 34261 || m_dwRace == 34242 || m_dwRace == 34246 || m_dwRace == 34250 || m_dwRace == 34254 || m_dwRace == 34258 || m_dwRace == 34262)
    {
        float scale = c_rkCreateData.m_dwLevel * 0.009f + 0.65f;
        m_GraphicThingInstance.SetScaleNew(scale, scale, scale);
    }
    else
        m_GraphicThingInstance.SetScaleNew(1.0f,1.0f,1.0f);

this is my func

Link to comment
Share on other sites

  • 0
  • Premium

change

Spoiler

m_GraphicThingInstance.SetScaleNew(scale, scale, scale);

to

Spoiler

m_GraphicThingInstance.SetScale(scale, scale, scale, true);

and

Spoiler

 m_GraphicThingInstance.SetScaleNew(1.0f,1.0f,1.0f);

to

Spoiler

m_GraphicThingInstance.SetScale(1.0f,1.0f,1.0f, true);

 

Link to comment
Share on other sites

  • 0
On 9/7/2017 at 9:21 PM, Mano said:

change

  Reveal hidden contents

m_GraphicThingInstance.SetScaleNew(scale, scale, scale);

to

  Reveal hidden contents

m_GraphicThingInstance.SetScale(scale, scale, scale, true);

and

  Reveal hidden contents

 m_GraphicThingInstance.SetScaleNew(1.0f,1.0f,1.0f);

to

  Reveal hidden contents

m_GraphicThingInstance.SetScale(1.0f,1.0f,1.0f, true);

 

thanks i don't need this fix i need fix the new func SetScaleNew i don't need use the old func you understand me ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Activity

    1. 1

      Metin2 TitleBar Move Frezze

    2. 1

      Metin2 TitleBar Move Frezze

    3. 0

      Navicat "Trial" Reset

    4. 13

      Item ToolTip Width Fix

    5. 0

      Guild icon wrong position

    6. 3

      Monster health

    7. 4

      Luffy Pet

    8. 38

      Core X → Top Metin2 & Metin2 Download → Changelogs

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.