• HyperFilter | DoS Protection | DDoS Protection | DoS Mitigation | DDoS Mitigation | AntiDoS | AntiDDoS | Proxy Shielding

GUARD'A BOSS KESTİREREK KUTU ALMA BUGUNU FİXLEME | ROK Projects

Nogitsun

Kayıtlı Üye
Katılım
15 Temmuz 2015
Mesajlar
43
Merhabalar,



Çoğu oyunda hala bilinmeyen bir açıktır ve yararlanan kişiler çoktur. Yine kendi projemiz için uyguladığımız fonksiyonu sizlerle paylaşıyorum. Örneğin; eslanttaki bir bossu towna doğru çekip guardlara kestirerek. Hiç bir attak yapmadan kutu oyunculara açılıyordu.



[HIDE-REPLY]AI Server -> Npc.cpp içindeki SendExpToUserList fonksiyonu aşağıdaki ile değişin.



Kod:
{

if (GetMap() == nullptr)            return;









        std::string strMaxDamageUser;

        uint32 nMaxDamage = 0;









        Guard lock(m_damageListLock);

        std::map<Unit *, uint32> filteredDamageList;

        std::map<uint16, CUser *> partyIndex;









        foreach(itr, m_DamagedUserList)

        {

            CUser * pUser = g_pMain->GetUserPtr(itr->first);

            Unit * pNpc = g_pMain->GetUnitPtr(itr->first);

            if (!pNpc->isPlayer()) {

                filteredDamageList[pNpc] = itr->second;

                continue;

            }

            if (pUser == nullptr

                || !isInRangeSlow(pUser, NPC_EXP_RANGE))

                continue;









            // Not in a party, we can add them to the list as a solo attacker.

            if (!pUser->isInParty())

            {

                filteredDamageList[pUser] = itr->second;

                continue;

            }









            // In a party, so check if another party member is already in the list first.

            auto partyItr = partyIndex.find(pUser->GetPartyID());









            

            if (partyItr == partyIndex.end())

            {

                filteredDamageList[pUser] = itr->second;

                partyIndex.insert(std::make_pair(pUser->GetPartyID(), pUser));

            }

            // There is another pf pir party members in the damage list already, so just add 

            // to their damage total.

            else

            {

                filteredDamageList[partyItr->second] += itr->second;

            }

        }





        foreach(itr, filteredDamageList)

        {

            if (itr->first->isPlayer()) {

                CUser * pUser = TO_USER(itr->first);









                Packet result(AG_USER_EXP);

                result << pUser->GetID()

                    << GetID()

                    // target's damage vs total damage dealt to the NPC

                    << itr->second << m_TotalDamage

                    << m_proto->m_iExp << m_proto->m_iLoyalty;

                g_pMain->Send(&result);









                if (itr->second > nMaxDamage)

                {

                    m_sMaxDamageUserid = pUser->GetID();

                    strMaxDamageUser = pUser->GetName();

                    nMaxDamage = itr->second;

                }

            }

            else

            {

                if (itr->second > nMaxDamage)

                {

                    m_sMaxDamageUserid = TO_NPC(itr->first)->GetID();

                    strMaxDamageUser = TO_NPC(itr->first)->GetName();

                    nMaxDamage = itr->second;

                }

            }

        }









        if (g_pMain->m_byBattleEvent == BATTLEZONE_OPEN

            && !strMaxDamageUser.empty()

            && m_bySpecialType >= NpcSpecialTypeKarusWarder1 && m_bySpecialType <= NpcSpecialTypeElmoradKeeper)

        {

            Packet result(AG_BATTLE_EVENT, uint8(BATTLE_EVENT_MAX_USER));









            switch (m_bySpecialType)

            {

            case NpcSpecialTypeKarusWarder1:    result << uint8(3); g_pMain->m_sKillKarusNpc++; break;

            case NpcSpecialTypeKarusWarder2:    result << uint8(4); g_pMain->m_sKillKarusNpc++; break;

            case NpcSpecialTypeElmoradWarder1:    result << uint8(5);    g_pMain->m_sKillElmoNpc++; break;

            case NpcSpecialTypeElmoradWarder2:    result << uint8(6); g_pMain->m_sKillElmoNpc++; break;

            case NpcSpecialTypeKarusKeeper:        result << uint8(7); g_pMain->m_sKillKarusNpc++; break;

            case NpcSpecialTypeElmoradKeeper:    result << uint8(8); g_pMain->m_sKillElmoNpc++; break;

            }









            result.SByte();

            result << strMaxDamageUser;

            g_pMain->Send(&result);









            bool    bKarusComplete = (g_pMain->m_sKillKarusNpc == GetMap()->m_sKarusRoom),

                bElMoradComplete = (g_pMain->m_sKillElmoNpc == GetMap()->m_sElmoradRoom);









            if (bKarusComplete || bElMoradComplete)

            {

                result.clear();

                result << uint8(BATTLE_EVENT_RESULT)

                    << uint8(bKarusComplete ? KARUS : ELMORAD)

                    << strMaxDamageUser;

                g_pMain->Send(&result);

            }

        }

		}



Sorun ortadan kalkacaktır.[/HIDE-REPLY]



İyi çalışmalar...
 
Cevap: GUARD'A BOSS KESTİREREK KUTU ALMA BUGUNU FİXLEME | ROK Projects



soalsın kardeşim
 
Geri
Üst