Jump to content

Recommended Posts

Posted

//check
bool we_are_ingame            = false;
bool is_the_world_edited    = false;

//storage
std::vector<IMaterial*> m_vec_hands; 
std::vector<IMaterial*> m_vec_Map_Textures; 
std::vector<IMaterial*> m_vec_Objects_Textures; 
std::vector<IMaterial*> m_vec_UseLess_Textures; 
std::vector<IMaterial*> m_vec_players_materials; 

//yep
void Add_To_List(char const* pMaterialName,const char*pTextureGroupName,IMaterial* pTemp )
{
    if ( plugin_game_interface::m_pEngine->IsInGame() )
    {
        we_are_ingame = true;            
    } 
    else
    {
        if ( we_are_ingame )
        {
            m_vec_Map_Textures.clear(); 
            m_vec_Objects_Textures.clear(); 
            m_vec_UseLess_Textures.clear(); 
            m_vec_players_materials.clear();
            m_vec_hands.clear();
            we_are_ingame = false; 
        }
        if(!strcmp(pTextureGroupName, "Lightmaps")||
            !strcmp(pTextureGroupName, "Particle textures")||
            !strcmp(pTextureGroupName, "Decal textures")||        
            !strcmp(pTextureGroupName, "CubeMap textures")||
            !strcmp(pTextureGroupName, "Dynamic Indices")||
            !strcmp(pTextureGroupName, "Dynamic Verts")||
            !strcmp(pTextureGroupName, "World Verts")||
            !strcmp(pTextureGroupName, "Lighting Verts"))
        {
            m_vec_UseLess_Textures.push_back( pTemp );
        }
        else if(!strcmp(pTextureGroupName, "World textures"))
        {
            m_vec_Map_Textures.push_back( pTemp );

            if (strstr(pMaterialName,"wood")||
                strstr(pMaterialName,"door")||
                strstr(pMaterialName,"gate")||
                strstr(pMaterialName,"box"))
            {
                m_vec_Objects_Textures.push_back( pTemp ); 
            }
        }
        else if (strstr(pMaterialName,"player" )||
            strstr(pMaterialName,"weapon" )||
            strstr(pMaterialName,"hostage" ) )
        {
            m_vec_players_materials.push_back( pTemp );
        }
        else if (strstr(pMaterialName,"hands"))
        {
            m_vec_hands.push_back( pTemp );
        }
        else
            return;
    }
}

void Ok_We_Make_The_List( void )
{
    //thx for this way :D
    int size    = plugin_game_interface::m_pMaterialSystem->GetNumMaterials();
    int list    = plugin_game_interface::m_pMaterialSystem->FirstMaterial();
    while ( ++list != size ) 
    {
        IMaterial* used_list = plugin_game_interface::m_pMaterialSystem->GetMaterial(list);
        Add_To_List(
            used_list->GetName(),
            used_list->GetTextureGroupName(),
            used_list);
    };
}

//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//ok now edit the stuff
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
void reset_map_texture_to_default()
{
    if ( is_the_world_edited )
    {
        for (int i = 0; i < m_vec_Map_Textures.size(); i++)//set solid
        {
            m_vec_Map_Textures[i]->AlphaModulate( 1.0 ); 
            m_vec_Map_Textures[i]->SetMaterialVarFlag( MATERIAL_VAR_WIREFRAME,false );
        }
        for (int i = 0; i < m_vec_Objects_Textures.size(); i++)
        {    
            m_vec_Objects_Textures[i]->AlphaModulate( 1.0 );
        }
        is_the_world_edited = false;
    }
}

void make_the_map_transparent()
{
    if ( m_pCvars->whmode.GetBool() )
    {
        if ( m_pCvars->whmode.Getint() == 1 )
        {
            if ( is_the_world_edited )
            {
                reset_map_texture_to_default();
            }
            if ( !is_the_world_edited )
            {
                for (int i = 0; i < m_vec_Objects_Textures.size(); i++)
                {    
                    m_vec_Objects_Textures[i]->AlphaModulate( m_pCvars->wallhack.Getfloat() );
                }
                is_the_world_edited = true;
            }
        }
        if ( m_pCvars->whmode.Getint() == 2 )
        {
            if ( is_the_world_edited )
            {
                reset_map_texture_to_default();
            }
            if ( !is_the_world_edited )
            {
                for (int i = 0; i < m_vec_Map_Textures.size(); i++)
                    m_vec_Map_Textures[i]->AlphaModulate( m_pCvars->wallhack.Getfloat() ); 

                is_the_world_edited = true;
            }
        }
        if ( m_pCvars->whmode.Getint() == 3 )
        {  
            if ( is_the_world_edited )
            {
                reset_map_texture_to_default();
            }
            if ( !is_the_world_edited )
            {
                for (int i = 0; i < m_vec_Map_Textures.size(); i++)
                    m_vec_Map_Textures[i]->SetMaterialVarFlag( MATERIAL_VAR_WIREFRAME,true ); 

                is_the_world_edited = true;
            }
        }
    }     
        else
         reset_map_texture_to_default();
}

void make_the_map_fullbright()
{
    static bool fullbright = false;
    if ( m_pCvars->vis_fullbright.GetBool() )
    {
        if ( is_the_world_edited )
        {
            reset_map_texture_to_default();
        }
        if (!fullbright)
        {   
            for (int i = 0; i < m_vec_Map_Textures.size(); i++)
            {
                m_vec_Map_Textures[i]->SetMaterialVarFlag( MATERIAL_VAR_SELFILLUM,true );
            }
            fullbright = true; 
        }
    }
    else//set normal
    {
        if (fullbright)
        {  
            for (int i = 0; i < m_vec_Map_Textures.size(); i++)
            {
                m_vec_Map_Textures[i]->SetMaterialVarFlag( MATERIAL_VAR_SELFILLUM,false );
            }
            fullbright = false;
        }
    }
}

void make_player_and_weapon_xqz()
{
    static bool xqz = false;
    if( m_pCvars->vis_modelhack.GetBool() )//Aequitas
    {
        if (!xqz)
        {
            for( int i = 0; i < m_vec_players_materials.size(); i++ )
            {       
                m_vec_players_materials[i]->SetMaterialVarFlag( MATERIAL_VAR_IGNOREZ, true ); 
                m_vec_players_materials[i]->SetMaterialVarFlag( MATERIAL_VAR_ZNEARER, true ); 
                m_vec_players_materials[i]->SetMaterialVarFlag( MATERIAL_VAR_FLAT, true );
            }
            xqz = true;
        }
    }
    else
    {   
        if (xqz)
        {  
            for( int i = 0; i < m_vec_players_materials.size(); i++ )
            {                     
                m_vec_players_materials[i]->SetMaterialVarFlag( MATERIAL_VAR_IGNOREZ, false ); 
                m_vec_players_materials[i]->SetMaterialVarFlag( MATERIAL_VAR_ZNEARER, false ); 
                m_vec_players_materials[i]->SetMaterialVarFlag( MATERIAL_VAR_FLAT, false );
            }
            xqz = false;
        }
    }
}

void make_player_and_weapon_wireframe()
{
    static bool wire = false;
    if( m_pCvars->vis_wireframe.GetBool() )//Aequitas 
    {
        if (!wire )
        {
            for( int i = 0; i < m_vec_players_materials.size(); i++ )
                m_vec_players_materials[i]->SetMaterialVarFlag( MATERIAL_VAR_WIREFRAME, true );
            wire = true;
        }
    }
    else                                                               
    {
        if (wire)
        {            
            for( int i = 0; i < m_vec_players_materials.size(); i++ )
                m_vec_players_materials[i]->SetMaterialVarFlag( MATERIAL_VAR_WIREFRAME, false );
            wire = false;
        }
    }
}

void make_player_and_weapon_invisible()
{
    static bool hidden = false;
    if( m_pCvars->vis_hide_model.GetBool() )//Aequitas 
    {
        if (!hidden )
        {
            for( int i = 0; i < m_vec_players_materials.size(); i++ )
                m_vec_players_materials[i]->SetMaterialVarFlag( MATERIAL_VAR_NO_DRAW, true );
            hidden = true;
        }
    }
    else                                                               
    {
        if (hidden)
        {            
            for( int i = 0; i < m_vec_players_materials.size(); i++ )
                m_vec_players_materials[i]->SetMaterialVarFlag( MATERIAL_VAR_NO_DRAW, false );
            hidden = false;
        }
    }
}

void make_your_hands_hidden()
{
    static bool no_hands = false;    
    if( m_pCvars->vis_hide_hands.GetBool() )//Aequitas 
    {
        if (!no_hands )
        {
            for( int i = 0; i < m_vec_hands.size(); i++ )
                m_vec_hands[i]->SetMaterialVarFlag( MATERIAL_VAR_NO_DRAW, true );
            no_hands = true;
        }
    }
    else                                                               
    {
        if (no_hands)
        {            
            for( int i = 0; i < m_vec_hands.size(); i++ )
                m_vec_hands[i]->SetMaterialVarFlag( MATERIAL_VAR_NO_DRAW, false );
            no_hands = false;
        }
    }
}

void remove_useless_texture()
{
    static bool removed = false;
    if ( m_pCvars->vis_fpsboost.GetBool() )
    {
        if (!removed)
        {   
            for (int i = 0; i < m_vec_UseLess_Textures.size(); i++)
            {
                m_vec_UseLess_Textures[i]->SetMaterialVarFlag( MATERIAL_VAR_NO_DRAW,true );
            }
            removed = true; 
        }
    }
    else//set normal
    {
        if (removed)
        {  
            for (int i = 0; i < m_vec_UseLess_Textures.size(); i++)
            {
                m_vec_UseLess_Textures[i]->SetMaterialVarFlag( MATERIAL_VAR_NO_DRAW,false );
            }
            removed = false;
        }
    }
}

void call_me_in_your_esp_or_somewhere_else()
{
    Ok_We_Make_The_List();
    //gogogo
    make_the_map_transparent();
    make_the_map_fullbright();
    make_player_and_weapon_xqz();
    make_player_and_weapon_wireframe();
    make_player_and_weapon_invisible();
    make_your_hands_hidden();
    remove_useless_texture();
}

 

i5zvxd.jpg

 

ka0s ; P47R!CK ; PizzaPan ; v3n0m4

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


  • Posts

    • Nice server, bro — 0 online and no crash. 🙂 You keep bragging that it’s online and has people, but in reality there’s nobody there. 😄
    • Wooowww!! Thank you so much bruv!! Really useful!! Thank you for smart solution, work and sharing!!
    • Generate your own. There are tools. 
    • Server Athena x45 C4 is running online since 11 January 2026 without wipe.
    • L2SPIRIT OF LORENA x3 INTERLUDE Discord: Discord SPIRIT OF LORENA < WEBSITE: L2 Spirit of Lorena x3 Interlude WEBSITE: L2-LORENA Network x30 x1200 x5000 PvP GRAND OPENING – 12 JUNE 2026 19:00 UTC+2 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ LONG TERM PROJECT NO WIPE CLASSIC INTERLUDE OLD SCHOOL COMMUNITY REAL PROGRESSION ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ WHY L2SPIRIT OF LORENA? Are you tired of servers that die after a few weeks? L2Spirit of LORENA was created for players who miss the true Interlude feeling: Clan Wars Castle Sieges Epic Bosses Party Farming Real Economy Long Term Progression No shortcuts. No instant endgame. No seasonal wipes. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SERVER INFORMATION 🛡 Chronicle: Interlude Type: Classic Low Rate Server: Long Term International Community ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ RATES EXP/SP x3 Adena x3 Drop x3 Spoil x3 Raid Boss x3 Seal Stones x3 Quest x3 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ DYNAMIC EXP SYSTEM 1-20 = x3.0 20-40 = x2.7 40-52 = x2.4 52-61 = x2.1 61-70 = x1.8 70-76 = x1.5 76-77 = x1.2 77-78 = x1.1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ FEATURES Auto Learn Skills Auto Farm Available 2 Windows Maximum Retail Olympiad Epic Bosses Daily Events Stable Dedicated Server Active Administration ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ WHAT MAKES US DIFFERENT? No Wipe Policy Stable Economy Competitive Olympiad Clan Focused Gameplay Retail Feeling Friendly Community ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ THE JOURNEY MATTERS Every level. Every raid. Every item. Every victory. This is the Interlude experience you remember. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SERVER STATUS TOP L2JBRASIL:Top L2JBrasil de Servidores de Lineage2 - ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ OPENING DAY 12 June 2026 19:00 UTC+2 Prepare your clan. Prepare for war. The adventure begins. SEE YOU IN SPIRIT OF LORENA!
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and 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..