Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

PET HP Edit

Status
Not open for further replies.
Newbie Spellweaver
Joined
Nov 3, 2019
Messages
23
Reaction score
1
What is a simple way to remove pet HP or keep it from draining? I'm looking to make Raised Pets live forever. Thanks in advance! I'm using Ketchup's v15 source, just incase that helps.
 
One word! Im Fawkin Pro!
Loyal Member
Joined
Jul 1, 2010
Messages
1,254
Reaction score
359
If you look in void CMover::processPetEnergy( void )
you will find this code.

Code:
CItemElem* pItemElem	= GetPetItem();
	// ±â·ÂÀÌ 0ÀÌÇϸé, »ý¸í 1 °¨¼Ò
	int nEnergy		= (int)pPet->GetEnergy();
	if( --nEnergy <= 0 )
	{
		int nLife	= (int)pPet->GetLife();
		if( --nLife >= 0 )
		{
			// »ý¸íÀÌ 0 ÀÌ»óÀ̸é, ºÎÈ°
			pPet->SetLife( nLife );
			pPet->SetEnergy( CPetProperty::GetInstance()->GetMaxEnergy( pPet->GetLevel() ) );
//			pPet->SetExp( 0 );
			
			g_dpDBClient.CalluspPetLog( m_idPlayer, pItemElem->GetSerialNumber(), 0, PETLOGTYPE_DEATH, pPet );
		}
		else
		{
			// »ý¸íÀÌ 0 ¹Ì¸¸À̸é, ¿ÏÀü ¼Ò¸ê
			pPet->SetLife( 0 );
			pPet->SetEnergy( 0 );
			pPet->SetExp( 0 );
			// ¸¸·á ¾ÆÀÌÅÛÀÇ °æ¿ì, ¾ËÀÌ¸é »ç¸ÁÀ̶ó°í Ç¥½Ã
			pItemElem->SetFlag( CItemElem::expired );
			UpdateItem( (BYTE)( pItemElem->m_dwObjId ), UI_FLAG, MAKELONG( pItemElem->m_dwObjIndex, pItemElem->m_byFlag ) );

			g_dpDBClient.CalluspPetLog( m_idPlayer, pItemElem->GetSerialNumber(), 0, PETLOGTYPE_DEATH, pPet );

			// Æê ¼Òȯ ÇØÁ¦
			PetRelease();
		}
	}
	else
	{
		pPet->SetEnergy( nEnergy );
	}
	( (CUser*)this )->AddPetState( pItemElem->m_dwObjId , pPet->GetLife(), pPet->GetEnergy(), pPet->GetExp() );
}

You simply need to remove -- from
Code:
if( [B][COLOR="#FF0000"]--[/COLOR][/B]nEnergy <= 0 )
and from
Code:
if( [B][COLOR="#FF0000"]--[/COLOR][/B]nLife >= 0 )

So it should look like this:

Code:
if( nEnergy <= 0 )
	{
		int nLife	= (int)pPet->GetLife();
		if( nLife >= 0 )
		{
 
Upvote 0
Newbie Spellweaver
Joined
Nov 3, 2019
Messages
23
Reaction score
1
If you look in void CMover::processPetEnergy( void )
you will find this code.

Code:
CItemElem* pItemElem    = GetPetItem();
    // ±â·ÂÀÌ 0ÀÌÇϸé, »ý¸í 1 °¨¼Ò
    int nEnergy        = (int)pPet->GetEnergy();
    if( --nEnergy <= 0 )
    {
        int nLife    = (int)pPet->GetLife();
        if( --nLife >= 0 )
        {
            // »ý¸íÀÌ 0 ÀÌ»óÀ̸é, ºÎÈ°
            pPet->SetLife( nLife );
            pPet->SetEnergy( CPetProperty::GetInstance()->GetMaxEnergy( pPet->GetLevel() ) );
//            pPet->SetExp( 0 );
            
            g_dpDBClient.CalluspPetLog( m_idPlayer, pItemElem->GetSerialNumber(), 0, PETLOGTYPE_DEATH, pPet );
        }
        else
        {
            // »ý¸íÀÌ 0 ¹Ì¸¸À̸é, ¿ÏÀü ¼Ò¸ê
            pPet->SetLife( 0 );
            pPet->SetEnergy( 0 );
            pPet->SetExp( 0 );
            // ¸¸·á ¾ÆÀÌÅÛÀÇ °æ¿ì, ¾ËÀÌ¸é »ç¸ÁÀ̶ó°í Ç¥½Ã
            pItemElem->SetFlag( CItemElem::expired );
            UpdateItem( (BYTE)( pItemElem->m_dwObjId ), UI_FLAG, MAKELONG( pItemElem->m_dwObjIndex, pItemElem->m_byFlag ) );

            g_dpDBClient.CalluspPetLog( m_idPlayer, pItemElem->GetSerialNumber(), 0, PETLOGTYPE_DEATH, pPet );

            // Æê ¼Òȯ ÇØÁ¦
            PetRelease();
        }
    }
    else
    {
        pPet->SetEnergy( nEnergy );
    }
    ( (CUser*)this )->AddPetState( pItemElem->m_dwObjId , pPet->GetLife(), pPet->GetEnergy(), pPet->GetExp() );
}

You simply need to remove -- from
Code:
if( [B][COLOR=#FF0000]--[/COLOR][/B]nEnergy <= 0 )
and from
Code:
if( [B][COLOR=#FF0000]--[/COLOR][/B]nLife >= 0 )

So it should look like this:

Code:
if( nEnergy <= 0 )
    {
        int nLife    = (int)pPet->GetLife();
        if( nLife >= 0 )
        {

Thank you so much for the reply! I'm at work but I'll confirm this when I'm home ❤

EDIT: This works flawlessly! Thank you!
 
Last edited:
Upvote 0
Status
Not open for further replies.
Back
Top