[Development] Source Mu Main 1.03.35 [Season 5.1 - Season 5.2]

May I ask, one character can't see the skills of another character
 

Attachments

  • 416adc64-f957-4e68-a806-205aed40c4af - [Development] Source Mu Main 1.03.35 [Season 5.1 - Season 5.2] - RaGEZONE Forums
    416adc64-f957-4e68-a806-205aed40c4af.webp
    272.3 KB · Views: 96
.

.
 

Attachments

  • Screen(10_15-22_32)-0000 - [Development] Source Mu Main 1.03.35 [Season 5.1 - Season 5.2] - RaGEZONE Forums
    Screen(10_15-22_32)-0000.webp
    338.1 KB · Views: 145
  • Screen(10_16-02_28)-0004 - [Development] Source Mu Main 1.03.35 [Season 5.1 - Season 5.2] - RaGEZONE Forums
    Screen(10_16-02_28)-0004.webp
    2.1 MB · Views: 85
  • Screen(10_16-02_27)-0003 - [Development] Source Mu Main 1.03.35 [Season 5.1 - Season 5.2] - RaGEZONE Forums
    Screen(10_16-02_27)-0003.webp
    1.8 MB · Views: 126
  • Screen(10_16-02_36)-0006 - [Development] Source Mu Main 1.03.35 [Season 5.1 - Season 5.2] - RaGEZONE Forums
    Screen(10_16-02_36)-0006.webp
    1.8 MB · Views: 86
  • Screen(10_16-02_38)-0007 - [Development] Source Mu Main 1.03.35 [Season 5.1 - Season 5.2] - RaGEZONE Forums
    Screen(10_16-02_38)-0007.webp
    2.1 MB · Views: 91
  • Screen(10_16-02_39)-0008 - [Development] Source Mu Main 1.03.35 [Season 5.1 - Season 5.2] - RaGEZONE Forums
    Screen(10_16-02_39)-0008.webp
    1.9 MB · Views: 78
  • Screen(10_16-02_45)-0000 - [Development] Source Mu Main 1.03.35 [Season 5.1 - Season 5.2] - RaGEZONE Forums
    Screen(10_16-02_45)-0000.webp
    2.5 MB · Views: 85
Last edited:
You are also working on main 5.2, as I am continuing but with little time.

dsw_pool - [Development] Source Mu Main 1.03.35 [Season 5.1 - Season 5.2] - RaGEZONE Forums
dsw_pool - [Development] Source Mu Main 1.03.35 [Season 5.1 - Season 5.2] - RaGEZONE Forums
 
1761284371882 - [Development] Source Mu Main 1.03.35 [Season 5.1 - Season 5.2] - RaGEZONE Forums
1761284716813 - [Development] Source Mu Main 1.03.35 [Season 5.1 - Season 5.2] - RaGEZONE Forums

almost one week apart. Testing only. but here is my gift:


Code:
if (ms_per_frame > 0.0)
{
    if (g_FPSOverrideActive == 1 && g_FPSOverrideMs > 0.0)
    {
        ms_per_frame = g_FPSOverrideMs;
    }

    const double now_ms = g_pTimer->GetAbsTime();
    const double elapsed_ms = now_ms - last_render_tick_count;
    
    if (elapsed_ms < ms_per_frame)
    {
        double rest_ms = ms_per_frame - elapsed_ms;
        
        if (g_UseOriginal150FPSPipeline)
        {
            // ORIGINAL PIPELINE FIX
            if (rest_ms > 1.0)
            {
                Sleep((DWORD)rest_ms);
            }
        }
        else
        {
            // SLEEP SPIN FOR RECHECK
            // CPU AT TIMING
            constexpr float min_spin_ms = 1.0f;
            constexpr float spin_yield_threshold_ms = 0.5f;
            constexpr float sleep_threshold_ms = 5.0f;
            
            const auto sleep_ms = rest_ms - min_spin_ms;
            
            const auto start_sleep = g_pTimer->GetTimeElapsed();
            if (sleep_ms > sleep_threshold_ms)
            {
                std::this_thread::sleep_for(std::chrono::milliseconds(static_cast<long>(sleep_ms)));
            }
            
            const auto actual_sleep_ms = g_pTimer->GetTimeElapsed() - start_sleep;
            const auto start_spin = g_pTimer->GetTimeElapsed();
            const auto spin_ms = rest_ms - actual_sleep_ms;
            
            // ROT + FRAME COUNT TIMIBNGS
            while (true)
            {
                const auto current = g_pTimer->GetTimeElapsed();
                const auto spinned_ms = current - start_spin;
                if (spinned_ms >= spin_ms) break;
                if (spin_ms - spinned_ms > spin_yield_threshold_ms)
                {
                    std::this_thread::yield();
                }
            }
        }
        current_tick_count += static_cast<int>(rest_ms);
    }
}

IF YOU KNOW, YOU KNEW. #PeakAsWeSpeak
 
Code:
bool CNewUIMyInventory::IsEquipable(int iIndex, ITEM* pItem)
{
    if (pItem == nullptr)
        return false;

    const ITEM_ATTRIBUTE* pAttr = &ItemAttribute[pItem->Type];
    const BYTE baseClass = gCharacterManager.GetBaseClass(Hero->Class);
    const BYTE stepClass = gCharacterManager.GetStepClass(Hero->Class);

    if (!pAttr->RequireClass[baseClass] || pAttr->RequireClass[baseClass] > stepClass)
    {
        return false;
    }

    if (baseClass == CLASS_RAGEFIGHTER)
    {
        if (iIndex == EQUIPMENT_GLOVES)
        {
            return false;
        }

        if (pAttr->m_byItemSlot == EQUIPMENT_WEAPON_RIGHT)
        {
            if (!g_CMonkSystem.RageEquipmentWeapon(iIndex, pItem->Type))
                return false;
        }
    }

    const WORD wStrength = CharacterAttribute->Strength + CharacterAttribute->AddStrength;
    const WORD wDexterity = CharacterAttribute->Dexterity + CharacterAttribute->AddDexterity;
    const WORD wEnergy = CharacterAttribute->Energy + CharacterAttribute->AddEnergy;
    const WORD wVitality = CharacterAttribute->Vitality + CharacterAttribute->AddVitality;
    const WORD wCharisma = CharacterAttribute->Charisma + CharacterAttribute->AddCharisma;
    const WORD wLevel = CharacterAttribute->Level;

    const int iItemLevel = pItem->Level;
    int iDecNeedStrength = 0;
    int iDecNeedDex = 0;

    extern JewelHarmonyInfo* g_pUIJewelHarmonyinfo;
    if (g_pUIJewelHarmonyinfo != nullptr && iItemLevel >= pItem->Jewel_Of_Harmony_OptionLevel)
    {
        StrengthenCapability sc;
        g_pUIJewelHarmonyinfo->GetStrengthenCapability(&sc, pItem, 0);
        if (sc.SI_isNB)
        {
            iDecNeedStrength += sc.SI_NB.SI_force;
            iDecNeedDex += sc.SI_NB.SI_activity;
        }
    }

    if (pItem->SocketCount > 0)
    {
        for (int i = 0; i < pItem->SocketCount; ++i)
        {
            const int seed = pItem->SocketSeedID[i];
            if (seed == 38) 
            {
                iDecNeedStrength += g_SocketItemMgr.GetSocketOptionValue(pItem, i);
            }
            else if (seed == 39) 
            {
                iDecNeedDex += g_SocketItemMgr.GetSocketOptionValue(pItem, i);
            }
        }
    }

    if (pItem->RequireStrength - iDecNeedStrength > wStrength)
        return false;
    if (pItem->RequireDexterity - iDecNeedDex > wDexterity)
        return false;
    if (pItem->RequireEnergy > wEnergy)
        return false;
    if (pItem->RequireVitality > wVitality)
        return false;
    if (pItem->RequireCharisma > wCharisma)
        return false;
    if (pItem->RequireLevel > wLevel)
        return false;

    if (pItem->Type == ITEM_DARK_RAVEN_ITEM)
    {
        const auto pPetInfo = GetPetInfo(pItem);
        if (pPetInfo == nullptr || pPetInfo->m_dwPetType == PET_TYPE_NONE)
            return false;

        const int requiredCharisma = 185 + (pPetInfo->m_wLevel * 15);
        if (requiredCharisma > wCharisma)
            return false;
    }

    if (gMapManager.WorldActive == WORLD7_ATLANS)
    {
        if (pItem->Type >= ITEM_HORN_OF_UNIRIA && pItem->Type <= ITEM_HORN_OF_DINORANT)
        { 
            return false;
        }
    }

    if (gMapManager.WorldActive == WORLD10_ICARUS || g_Direction.m_CKanturu.IsMayaScene())
    {
        if (pItem->Type == ITEM_HORN_OF_UNIRIA)
        { 
            return false;
        }
    }

    if (gMapManager.InChaosCastle() || (Get_State_Only_Elf() && g_isCharacterBuff((&Hero->Object), eBuff_CrywolfHeroContracted)))
    {
        if ((pItem->Type >= ITEM_HORN_OF_UNIRIA && pItem->Type <= ITEM_DARK_RAVEN_ITEM) || pItem->Type == ITEM_HORN_OF_FENRIR)
            return false;
    }
    else
    {
        if (((pItem->Type >= ITEM_HORN_OF_UNIRIA && pItem->Type <= ITEM_DARK_HORSE_ITEM) || pItem->Type == ITEM_HORN_OF_FENRIR)
            && Hero->Object.CurrentAction >= PLAYER_SIT1 && Hero->Object.CurrentAction <= PLAYER_SIT_FEMALE2)
        {
            return false;
        }
    }

    if (iIndex == EQUIPMENT_WEAPON_LEFT || iIndex == EQUIPMENT_WEAPON_RIGHT)
    {
        ITEM* otherWeapon = &CharacterMachine->Equipment[(iIndex == EQUIPMENT_WEAPON_LEFT) ? EQUIPMENT_WEAPON_RIGHT : EQUIPMENT_WEAPON_LEFT];

        if (baseClass == CLASS_ELF)
        {       
            if (pItem->Type != ITEM_ARROWS && pItem->Type != ITEM_BOLT)
            {
                if (otherWeapon->Type != -1)
                {
                    if (pAttr->TwoHand && otherWeapon->TwoHand)
                    {
                        return false;
                    }
                }
            }
            else if ((pItem->Type == ITEM_ARROWS && otherWeapon->Type == ITEM_BOLT) ||
                (pItem->Type == ITEM_BOLT && otherWeapon->Type == ITEM_ARROWS))
            {
                return false;
            }

            return true;
        }
        
        if (otherWeapon->Type != -1)
            {
                if (pAttr->TwoHand || otherWeapon->TwoHand) 
                { 
                    return false;
                }
            }
    }
  
    if (pAttr->m_byItemSlot != iIndex)
    {
        if (
            (iIndex == EQUIPMENT_WEAPON_LEFT || iIndex == EQUIPMENT_WEAPON_RIGHT) &&
            (pAttr->m_byItemSlot == EQUIPMENT_WEAPON_LEFT || pAttr->m_byItemSlot == EQUIPMENT_WEAPON_RIGHT)
            )
        {
            if (pAttr->m_byItemSlot == EQUIPMENT_WEAPON_LEFT && pItem->Type >= ITEM_SHIELD && pItem->Type < ITEM_SHIELD + MAX_ITEM_INDEX)
            {
                return false;
            }

            if(!pAttr->TwoHand)
                return true;        
        }
        if (
               (iIndex == EQUIPMENT_RING_LEFT || iIndex == EQUIPMENT_RING_RIGHT) && 
               (pAttr->m_byItemSlot == EQUIPMENT_RING_LEFT || pAttr->m_byItemSlot == EQUIPMENT_RING_RIGHT)
        )
        {
            return true;
        }
        
        return false;
    }

    return true;
}
 
just testing
Monogame?
View attachment 290641View attachment 290642
almost one week apart. Testing only. but here is my gift:


Code:
if (ms_per_frame > 0.0)
{
    if (g_FPSOverrideActive == 1 && g_FPSOverrideMs > 0.0)
    {
        ms_per_frame = g_FPSOverrideMs;
    }

    const double now_ms = g_pTimer->GetAbsTime();
    const double elapsed_ms = now_ms - last_render_tick_count;
   
    if (elapsed_ms < ms_per_frame)
    {
        double rest_ms = ms_per_frame - elapsed_ms;
       
        if (g_UseOriginal150FPSPipeline)
        {
            // ORIGINAL PIPELINE FIX
            if (rest_ms > 1.0)
            {
                Sleep((DWORD)rest_ms);
            }
        }
        else
        {
            // SLEEP SPIN FOR RECHECK
            // CPU AT TIMING
            constexpr float min_spin_ms = 1.0f;
            constexpr float spin_yield_threshold_ms = 0.5f;
            constexpr float sleep_threshold_ms = 5.0f;
           
            const auto sleep_ms = rest_ms - min_spin_ms;
           
            const auto start_sleep = g_pTimer->GetTimeElapsed();
            if (sleep_ms > sleep_threshold_ms)
            {
                std::this_thread::sleep_for(std::chrono::milliseconds(static_cast<long>(sleep_ms)));
            }
           
            const auto actual_sleep_ms = g_pTimer->GetTimeElapsed() - start_sleep;
            const auto start_spin = g_pTimer->GetTimeElapsed();
            const auto spin_ms = rest_ms - actual_sleep_ms;
           
            // ROT + FRAME COUNT TIMIBNGS
            while (true)
            {
                const auto current = g_pTimer->GetTimeElapsed();
                const auto spinned_ms = current - start_spin;
                if (spinned_ms >= spin_ms) break;
                if (spin_ms - spinned_ms > spin_yield_threshold_ms)
                {
                    std::this_thread::yield();
                }
            }
        }
        current_tick_count += static_cast<int>(rest_ms);
    }
}

IF YOU KNOW, YOU KNEW. #PeakAsWeSpeak
can you share ui bar? Please?
 
Has anyone managed to debug and implement MHP anti-hack protection?
 
So far the hardest part is to get work main frame on 100%. Currently I'm having issues with potions rendering in item slots and also disabling old UI causes zillion crashes so I have to build it "on top" of current UI. This is not a big deal, I mean later will disable it but the main issue is with rendering potions.

Screen(02_10-18-11)-0000 - [Development] Source Mu Main 1.03.35 [Season 5.1 - Season 5.2] - RaGEZONE Forums
 
Back