Chest Drop Rate Plugin menu

Shout-Out

User Tag List

Results 1 to 1 of 1
  1. #1
    xblade2k7's Avatar Active Member
    Reputation
    50
    Join Date
    Jun 2009
    Posts
    283
    Thanks G/R
    101/34
    Trade Feedback
    0 (0%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Chest Drop Rate Plugin

    # ChestDropRatePlugin for TurboHUD LightningMOD

    ## Overview

    This plugin for TurboHUD LightningMOD displays drop chance percentages for legendary and set items on various chest types in Diablo III, based on the current game difficulty. It provides visual indicators directly in the game world and includes debugging features to help verify proper functionality.

    ## Features

    ### 1. **Chest Detection & Visualization**
    - **Normal Chests**: Yellow text labels with format "XX% L / YY% S"
    - **Resplendent Chests**: Brighter yellow, larger text with same format
    - **Special Chests** (like a2dun_Swr_Chest): Turquoise text for easy identification
    - **Any chest-containing names**: Falls back to normal chest styling

    ### 2. **Difficulty-Based Calculations**
    The plugin calculates drop rates based on Torment difficulty levels:
    - **Torment I**: Baseline rates
    - **Torment VI**: Increased rates
    - **Torment XVI**: Highest rates
    - **Intermediate Torment levels**: Progressive scaling between T1-T16

    ### 3. **Visual Feedback System**
    - Green status text in top-left corner showing plugin activity
    - Console messages (Ctrl+L) for debugging
    - Periodic chest count updates every 5 seconds

    ### 4. **Special Chest Handling**//ONLY FOR DEBUG
    Specific handling for "a2dun_Swr_Chest" with custom drop rates:
    - Higher base chances than normal chests
    - Unique turquoise-colored indicators
    - Progressive scaling across difficulty levels

    ## Installation

    1. Save the code as `ChestDropRatePlugin.cs` in `TurboHUD\Plugins\User\`
    2. Restart TurboHUD LightningMOD completely
    3. The plugin will auto-compile on startup

    ## Usage

    ### In-Game Indicators
    - **Green status text** (top-left): Confirms plugin is running
    - **Colored labels near chests**: Show drop percentages based on chest type:
    - Yellow: Normal chests
    - Bright yellow: Resplendent chests
    - Turquoise: Special chests (a2dun_Swr_Chest)//DEBUG ONLY

    ### Debug Information
    Press `Ctrl+L` to view console messages showing:
    - Plugin loading status
    - Chest detection counts
    - Specific chest names found in current area

    ### Supported Environments
    - **Works in**: Dungeons, adventure zones
    - **Disabled in**: Towns (Hud.Game.IsInTown)
    - **Requires**: Torment difficulty (T1-T16) for accurate rates

    ## Technical Details

    ### Rate Calculation
    Drop chances increase progressively with Torment level:
    - **Normal Chests**: 10-50% legendary, 5-25% set items
    - **Resplendent Chests**: 25-100% legendary, 15-50% set items
    - **Special Chests**: 30-120% legendary, 20-60% set items

    ### Error Handling
    - Compilation errors appear in `TurboHUD\logs\exceptions.txt`
    - Null-safe checks for actor names
    - Graceful fallbacks for unexpected chest types

    ## Customization

    The plugin can be modified to:
    - Add new chest types by extending the switch statement
    - Adjust drop rates by modifying values in GetDropRates()
    - Change visual styles by modifying the WorldDecoratorCollections
    - Add new difficulty handling if needed

    ## Compatibility

    - Designed specifically for TurboHUD LightningMOD
    - Uses LightningMOD's API conventions
    - Compatible with current Diablo III game version
    - No known conflicts with other plugins

    This plugin provides valuable information for efficient farming by helping players identify which chests are most worth opening based on current difficulty level and chest type.

    Code:
    using System;
    using Turbo.Plugins;
    using Turbo.Plugins.Default;
    using System.Globalization;
    using System.Linq;
    
    namespace Turbo.Plugins.Custom
    {
        public class ChestDropRatePlugin : BasePlugin, IInGameWorldPainter
        {
            public WorldDecoratorCollection NormalChestDecorator { get; set; }
            public WorldDecoratorCollection ResplendentChestDecorator { get; set; }
            public WorldDecoratorCollection SpecialChestDecorator { get; set; }
            
            // Para el indicador visual de carga
            private bool _pluginLoadedNotificationShown = false;
            private DateTime _lastDebugCheck = DateTime.MinValue;
            private string _statusText = "Cargando...";
            private IFont _statusFont;
    
            public ChestDropRatePlugin()
            {
                Enabled = true;
            }
    
            public override void Load(IController hud)
            {
                base.Load(hud);
                
                // Crear font para el texto de estado
                _statusFont = Hud.Render.CreateFont("tahoma", 10, 255, 0, 255, 0, true, false, false);
                
                // Mostrar notificación de carga en consola
                Hud.TextLog.Log("ChestDropRatePlugin", "Plugin cargado correctamente", true, false);
                
                // Decorador para cofres normales
                NormalChestDecorator = new WorldDecoratorCollection(
                    new MapShapeDecorator(Hud)
                    {
                        Brush = Hud.Render.CreateBrush(255, 255, 255, 0, 2),
                        ShapePainter = new CircleShapePainter(Hud),
                        Radius = 1f
                    },
                    new GroundLabelDecorator(Hud)
                    {
                        BackgroundBrush = Hud.Render.CreateBrush(255, 0, 0, 0, 0),
                        TextFont = Hud.Render.CreateFont("tahoma", 6.5f, 255, 255, 255, 0, false, false, false)
                    }
                );
    
                // Decorador para cofres resplandecientes
                ResplendentChestDecorator = new WorldDecoratorCollection(
                    new MapShapeDecorator(Hud)
                    {
                        Brush = Hud.Render.CreateBrush(255, 255, 215, 0, 2),
                        ShapePainter = new CircleShapePainter(Hud),
                        Radius = 1.5f
                    },
                    new GroundLabelDecorator(Hud)
                    {
                        BackgroundBrush = Hud.Render.CreateBrush(255, 0, 0, 0, 0),
                        TextFont = Hud.Render.CreateFont("tahoma", 7f, 255, 255, 215, 0, true, false, false)
                    }
                );
    
                // Decorador para cofres especiales (como a2dun_Swr_Chest)
                SpecialChestDecorator = new WorldDecoratorCollection(
                    new MapShapeDecorator(Hud)
                    {
                        Brush = Hud.Render.CreateBrush(255, 0, 255, 255, 2),
                        ShapePainter = new CircleShapePainter(Hud),
                        Radius = 1.2f
                    },
                    new GroundLabelDecorator(Hud)
                    {
                        BackgroundBrush = Hud.Render.CreateBrush(255, 0, 0, 0, 0),
                        TextFont = Hud.Render.CreateFont("tahoma", 7f, 255, 0, 255, 255, true, false, false)
                    }
                );
                
                _statusText = "Plugin ACTIVO - Buscando cofres";
            }
    
            public void PaintWorld(WorldLayer layer)
            {
                // Solo procesar en la capa de suelo
                if (layer != WorldLayer.Ground) return;
                
                // Dibujar indicador de estado en la esquina superior izquierda
                _statusFont.DrawText(_statusText, 50, 50);
                
                // Mostrar notificación de carga una vez
                if (!_pluginLoadedNotificationShown)
                {
                    Hud.TextLog.Log("ChestDropRatePlugin", "Plugin iniciado - Visualizando probabilidades de cofres", true, false);
                    _pluginLoadedNotificationShown = true;
                }
                
                // Información de depuración periódica
                if ((DateTime.Now - _lastDebugCheck).TotalSeconds > 5)
                {
                    _lastDebugCheck = DateTime.Now;
                    var chestCount = Hud.Game.Actors.Count(x => x.SnoActor.Kind == ActorKind.Chest);
                    Hud.TextLog.Log("ChestDropRatePlugin", $"{chestCount} cofres detectados en el área", true, false);
                    
                    // Actualizar texto de estado
                    _statusText = $"Plugin ACTIVO - {chestCount} cofres detectados";
                }
    
                if (Hud.Game.IsInTown) return;
    
                var chests = Hud.Game.Actors.Where(x => x.SnoActor.Kind == ActorKind.Chest).ToList();
                
                foreach (var chest in chests)
                {
                    // Debug: registrar nombres de cofres para verificar
                    Hud.TextLog.Log("ChestDebug", $"Cofre detectado: {chest.SnoActor.NameEnglish}", true, false);
                    
                    var chestName = chest.SnoActor.NameEnglish?.ToLower();
                    
                    switch (chestName)
                    {
                        case "normal chest":
                            NormalChestDecorator.Paint(layer, chest, chest.FloorCoordinate, GetDropRates(chest));
                            break;
                        case "resplendent chest":
                            ResplendentChestDecorator.Paint(layer, chest, chest.FloorCoordinate, GetDropRates(chest));
                            break;
                        case "a2dun_swr_chest": // Cofre especial de fallas
                            SpecialChestDecorator.Paint(layer, chest, chest.FloorCoordinate, GetDropRates(chest));
                            break;
                        default:
                            // Para otros cofres no identificados, usar decorador normal
                            if (chestName != null && chestName.Contains("chest"))
                            {
                                NormalChestDecorator.Paint(layer, chest, chest.FloorCoordinate, GetDropRates(chest));
                            }
                            break;
                    }
                }
            }
    
            private string GetDropRates(IActor chest)
            {
                GameDifficulty difficulty = Hud.Game.GameDifficulty;
                bool isResplendent = chest.SnoActor.NameEnglish?.ToLower().Contains("resplendent") ?? false;
                bool isSpecialChest = chest.SnoActor.NameEnglish?.ToLower().Contains("a2dun_swr") ?? false;
    
                double legendaryChance = 0;
                double setChance = 0;
    
                if (isResplendent)
                {
                    switch (difficulty)
                    {
                        case GameDifficulty.t1:
                            legendaryChance = 0.25;
                            setChance = 0.15;
                            break;
                        case GameDifficulty.t6:
                            legendaryChance = 0.50;
                            setChance = 0.30;
                            break;
                        case GameDifficulty.t16:
                            legendaryChance = 1.00;
                            setChance = 0.50;
                            break;
                        default:
                            if (difficulty >= GameDifficulty.t7 && difficulty <= GameDifficulty.t15)
                            {
                                int tormentLevel = (int)difficulty - 3;
                                legendaryChance = 0.25 + (0.05 * (tormentLevel - 1));
                                setChance = 0.15 + (0.03 * (tormentLevel - 1));
                            }
                            else
                            {
                                legendaryChance = 0.10;
                                setChance = 0.05;
                            }
                            break;
                    }
                }
                else if (isSpecialChest)
                {
                    // Probabilidades específicas para cofres especiales como a2dun_Swr_Chest
                    switch (difficulty)
                    {
                        case GameDifficulty.t1:
                            legendaryChance = 0.30;
                            setChance = 0.20;
                            break;
                        case GameDifficulty.t6:
                            legendaryChance = 0.60;
                            setChance = 0.35;
                            break;
                        case GameDifficulty.t16:
                            legendaryChance = 1.20; // Puede ser mayor que 100% para indicar múltiples legendarios
                            setChance = 0.60;
                            break;
                        default:
                            if (difficulty >= GameDifficulty.t7 && difficulty <= GameDifficulty.t15)
                            {
                                int tormentLevel = (int)difficulty - 3;
                                legendaryChance = 0.30 + (0.06 * (tormentLevel - 1));
                                setChance = 0.20 + (0.04 * (tormentLevel - 1));
                            }
                            else
                            {
                                legendaryChance = 0.15;
                                setChance = 0.10;
                            }
                            break;
                    }
                }
                else
                {
                    // Cofres normales
                    switch (difficulty)
                    {
                        case GameDifficulty.t1:
                            legendaryChance = 0.10;
                            setChance = 0.05;
                            break;
                        case GameDifficulty.t6:
                            legendaryChance = 0.25;
                            setChance = 0.12;
                            break;
                        case GameDifficulty.t16:
                            legendaryChance = 0.50;
                            setChance = 0.25;
                            break;
                        default:
                            if (difficulty >= GameDifficulty.t7 && difficulty <= GameDifficulty.t15)
                            {
                                int tormentLevel = (int)difficulty - 3;
                                legendaryChance = 0.10 + (0.03 * (tormentLevel - 1));
                                setChance = 0.05 + (0.02 * (tormentLevel - 1));
                            }
                            else
                            {
                                legendaryChance = 0.05;
                                setChance = 0.02;
                            }
                            break;
                    }
                }
    
                return $"{legendaryChance:P0} L / {setChance:P0} S";
            }
        }
    }
    Sin título.jpg
    Sin título2.jpg



    Last edited by xblade2k7; 2 Days Ago at 12:48 PM.

    Chest Drop Rate Plugin

Similar Threads

  1. How to make Chest drop what you want YES THIS POST SAY CHEST :D
    By Dee2001 in forum WoW EMU Guides & Tutorials
    Replies: 7
    Last Post: 12-02-2007, 11:42 AM
  2. increase rare drop rate by allot
    By rpgmaster in forum World of Warcraft Exploits
    Replies: 15
    Last Post: 10-27-2007, 02:42 PM
  3. Change the Drop Rate
    By erebos in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 09-22-2007, 03:12 AM
  4. Incrase drop rates
    By Kazzin100 in forum World of Warcraft Guides
    Replies: 13
    Last Post: 04-18-2007, 04:41 AM
  5. Damn drop rate
    By LightWave in forum World of Warcraft General
    Replies: 3
    Last Post: 10-20-2006, 03:36 PM
All times are GMT -5. The time now is 03:50 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search