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

Official Pet Sistem ????


vefamt2

Question

 

Hi friends I want to bring 5 skills instead of 3 skills which are on my pet lonely 4. If you click on the book, you will be able to help the following sample codes.

orjinal kod

bool CNewPetActor::IncreasePetSkill(int skill) {
    if (GetLevel() < 82 && m_dwevolution < 3)
        return false;
    for (int i = 0; i < 3; ++i) { //Itero gli slot per cercare la skill
        if (m_dwskillslot[i] == skill) {  //Se trova la skill o la aumenta oppure e' gi?max
            if (m_dwskill[i] < 20) {
                m_dwskill[i] += 1;
                m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "Sizin Beceri ulaştı!%d", m_dwskill[i]);
                m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetSkill %d %d %d", i, m_dwskillslot[i], m_dwskill[i]);
                return true;
            }
            else {
                m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "Beceri zaten maksimum seviyeye ulasti!");
                return false;
            }
        }
    }

    for (int i = 0; i < 3; ++i) {
        if (m_dwskillslot[i] == 0 || m_dwskillslot[i] == -1) { 
            m_dwskillslot[i] = skill;
            m_dwskill[i] = 1;
            m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "Evcil hayvaniniz yeni bir beceri ogrendi!");
            m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetSkill %d %d %d", i, m_dwskillslot[i], m_dwskill[i]);
            return true;
        }
    }

    /* Qualora il pet non soddisfi le condizioni precedenti
       Allora tutti gli slot sono pieni e quind non pu?
       imparare nuove skill 
    */
    m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "Evcil hayvaniniz diger becerileri ogrenmesi mumkun degil!");
    return false;
}

 

edit kod

bool CNewPetActor::IncreasePetSkill(int skill) {
    if (GetLevel() < 82 && m_dwevolution < 5)
        return false;
    for (int i = 0; i < 5; ++i) { //Itero gli slot per cercare la skill
        if (m_dwskillslot[i] == skill) {  //Se trova la skill o la aumenta oppure e' gi?max
            if (m_dwskill[i] < 20) {
                m_dwskill[i] += 1;
                m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "Sizin Beceri ulaştı!%d", m_dwskill[i]);
                m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetSkill %d %d %d %d %d", i, m_dwskillslot[i], m_dwskill[i]);
                return true;
            }
            else {
                m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "Beceri zaten maksimum seviyeye ulasti!");
                return false;
            }
        }
    }

    for (int i = 0; i < 5; ++i) {
        if (m_dwskillslot[i] == 0 || m_dwskillslot[i] == -1) { 
            m_dwskillslot[i] = skill;
            m_dwskill[i] = 1;
            m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "Evcil hayvaniniz yeni bir beceri ogrendi!");
            m_pkOwner->ChatPacket(CHAT_TYPE_COMMAND, "PetSkill %d %d %d %d %d", i, m_dwskillslot[i], m_dwskill[i]);
            return true;
        }
    }

    /* Qualora il pet non soddisfi le condizioni precedenti
       Allora tutti gli slot sono pieni e quind non pu?
       imparare nuove skill 
    */
    m_pkOwner->ChatPacket(CHAT_TYPE_INFO, "Evcil hayvaniniz diger becerileri ogrenmesi mumkun degil!");
    return false;
}

orjinal kod

const DWORD Pet_SKill_TablePerc[3][20] =
{
	{ 2, 5, 8, 11, 13, 16, 19, 22, 24, 27, 30, 33, 35, 38, 41, 44, 46, 49, 52, 55 },
	{ 2, 5, 7, 10, 12, 15, 17, 20, 23, 25, 27, 30, 32, 35, 37, 40, 42, 45, 47, 50 },
	{ 2, 5, 8, 11, 13, 16, 19, 22, 25, 27, 30, 33, 36, 38, 41, 44, 47, 50, 52, 55 }
};

edit kod

const DWORD Pet_SKill_TablePerc[5][20] =
{
	{ 2, 5, 8, 11, 13, 16, 19, 22, 24, 27, 30, 33, 35, 38, 41, 44, 46, 49, 52, 55 },
	{ 2, 5, 7, 10, 12, 15, 17, 20, 23, 25, 27, 30, 32, 35, 37, 40, 42, 45, 47, 50 },
	{ 2, 5, 8, 11, 13, 16, 19, 22, 25, 27, 30, 33, 36, 38, 41, 44, 47, 50, 52, 55 },
	{ 2, 5, 7, 10, 12, 15, 17, 20, 24, 25, 27, 30, 33, 35, 37, 40, 43, 46, 47, 50 },
	{ 2, 5, 8, 11, 13, 16, 19, 22, 26, 27, 30, 33, 37, 38, 41, 44, 48, 51, 52, 55 },
};

orjinal kod

void CInputMain::BraveRequestPetName(LPCHARACTER ch, const char* c_pData)
{
	if (!ch->GetDesc()) { return; }
	int vid = ch->GetEggVid();
	if (vid == 0) { return; }

	TPacketCGRequestPetName* p = (TPacketCGRequestPetName*)c_pData;

	if (ch->GetGold() < 100000) {
		ch->ChatPacket(CHAT_TYPE_INFO, "[Pet-Kulu?a] 100.000 Yang gerekir");
	}

	if (ch->CountSpecifyItem(vid) > 0 && check_name(p->petname) != 0) {
		DBManager::instance().SendMoneyLog(MONEY_LOG_QUEST, ch->GetPlayerID(), -100000);
		ch->PointChange(POINT_GOLD, -100000, true);
		ch->RemoveSpecifyItem(vid, 1);
		LPITEM item = ch->AutoGiveItem(vid + 300, 1);
		int tmpslot = number(1, 3);
		int tmpskill[3] = { 0, 0, 0 };
		for (int i = 0; i < 3; ++i)
		{
			if (i > tmpslot - 1)
				tmpskill[i] = -1;
		}
		int tmpdur = number(1, 14) * 24 * 60;
		char szQuery1[1024];
		snprintf(szQuery1, sizeof(szQuery1), "INSERT INTO new_petsystem VALUES(%lu,'%s', 1, 0, 0, 0, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d)", item->GetID(), p->petname, number(1, 23), number(1, 23), number(1, 23), tmpskill[0], 0, tmpskill[1], 0, tmpskill[2], 0, tmpdur, tmpdur);
		std::auto_ptr<SQLMsg> pmsg2(DBManager::instance().DirectQuery(szQuery1));
	}
	else {
		ch->ChatPacket(CHAT_TYPE_INFO, "[Pet-Kulu?a] hatal?isim girdiniz");
	}
}

edit kod

void CInputMain::BraveRequestPetName(LPCHARACTER ch, const char* c_pData)
{
	if (!ch->GetDesc()) { return; }
	int vid = ch->GetEggVid();
	if (vid == 0) { return; }

	TPacketCGRequestPetName* p = (TPacketCGRequestPetName*)c_pData;

	if (ch->GetGold() < 100000) {
		ch->ChatPacket(CHAT_TYPE_INFO, "[Pet-Kulu?a] 100.000 Yang gerekir");
	}

	if (ch->CountSpecifyItem(vid) > 0 && check_name(p->petname) != 0) {
		DBManager::instance().SendMoneyLog(MONEY_LOG_QUEST, ch->GetPlayerID(), -100000);
		ch->PointChange(POINT_GOLD, -100000, true);
		ch->RemoveSpecifyItem(vid, 1);
		LPITEM item = ch->AutoGiveItem(vid + 300, 1);
		int tmpslot = number(1, 5);
		int tmpskill[5] = { 0, 0, 0, 0, 0 };
		for (int i = 0; i < 5; ++i)
		{
			if (i > tmpslot - 1)
				tmpskill[i] = -1;
		}
		int tmpdur = number(1, 14) * 24 * 60;
		char szQuery1[1024];
		snprintf(szQuery1, sizeof(szQuery1), "INSERT INTO new_petsystem VALUES(%lu,'%s', 1, 0, 0, 0, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d)", item->GetID(), p->petname, number(1, 23), number(1, 23), number(1, 23), tmpskill[0], 0, tmpskill[1], 0, tmpskill[2], 0, tmpskill[3], 0, tmpskill[4], 0, tmpdur, tmpdur);
		std::auto_ptr<SQLMsg> pmsg2(DBManager::instance().DirectQuery(szQuery1));
	}
	else {
		ch->ChatPacket(CHAT_TYPE_INFO, "[Pet-Kulu?a] hatal?isim girdiniz");
	}
}

 

I have problems with other codes attached to this question, I can not find the codes I have added please help.

Link to comment
  • Answers 0
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

Popular Days

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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

Announcements

  • -15% Discount in Metin2 Dev Store (01/10/2021 => 31/12/2021) => Code => 15_PCT_OCT_TO_DEC_2021


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.