Jump to content
  • 0

Create a Rune of Drop


Question

6 answers to this question

Recommended Posts

  • 0
Posted
14 hours ago, barao45 said:

Hi People! Does anyone know how I can create an object that increases the percentage of the character's drop?. I'm using L2jSunrise.

Drop chance or quantity? Also what kind of object? java object? ingame object like item/skill?

  • 0
Posted

I made a stat that increased Drop chance/amount, you can add that stat to items, skills, etc. Post your drop related files (all multiplierstrategies.java) to see if its compatible with the one I made (I use l2jmaster files)

 

  • 0
Posted

Not a working code, but maybe can help you out to start. 
 

public class RuneOfDrop extends ItemInstance
{
    private static final int RUNE_OF_DROP_ITEM_ID = 12345; // Replace with your desired item ID
    private static final int DROP_BONUS_PERCENTAGE = 25; // Increase drop by 25%

    public RuneOfDrop(int objectId, Item template)
    {
        super(objectId, template);
    }

    @Override
    public void onEquip(Player player)
    {
        applyDropBonus(player);
    }

    @Override
    public void onUnequip(Player player)
    {
        removeDropBonus(player);
    }

    private void applyDropBonus(Player player)
    {
        double dropBonus = DROP_BONUS_PERCENTAGE / 100.0;
        player.getStat().mergeAdd(ModifierType.DROP, dropBonus);
    }

    private void removeDropBonus(Player player)
    {
        double dropBonus = DROP_BONUS_PERCENTAGE / 100.0;
        player.getStat().mergeRemove(ModifierType.DROP, dropBonus);
    }

    @Override
    public void onLogout(Player player)
    {
        if (!player.getInventory().hasItemId(RUNE_OF_DROP_ITEM_ID))
        {
            removeDropBonus(player);
        }
    }

    public static Item createInstance(int objectId, int count)
    {
        Item template = new Item(RUNE_OF_DROP_ITEM_ID);
        template.setName("Rune of Drop"); // Replace with your desired name
        template.setType2(ItemType.TYPE2_OTHER); // Adjust the item type as needed
        template.setEtcItemType(EtcItemType.RUNE); // Adjust the item type as needed
        template.setWeight(10); // Set the desired weight
        template.setReuseDelay(0); // Set the desired reuse delay
        template.setCrystalType(CrystalGrade.C); // Adjust the crystal grade as needed
        template.setBodyPart(0); // Set the desired body part

        // Set the weapon type if applicable, or remove the line if not a weapon
        template.setWeaponType(WeaponType.SWORD);

        template.setMaterial(ItemMaterialType.MAGIC; // Adjust the material type as needed

        ItemInstance instance = new RuneOfDrop(objectId, template);
        instance.setCount(count); // Set the desired count

        return instance;
    }
}

 

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

    • Vesper Noble heavy set (RAR) 1800 att - 150e Eternal Core Dualsword +6 300 att 130e Ring of Baium 130e AQ ring 100e Antharas Earring 200e   Paypal payments only DM in discord narttu123
    • L2REBORN x10 - 1gb - 4.2$ l2reborn x1 ( signature ) - 1kk - 1.3$ LU4 - 1kk - 2.3$ MASTERWORRK - 1kk - 3.8kk  discord - adver745645
    • Hello, Skill Activation: The activation options from the Alt+K window work perfectly. However, when activating them from the skill bar, there is still a delay of approximately 1 second. I need to remove that delay
    • --- Interlude Faction/GvE PvP grand opening 2025-11-15 19:00 GMT+2 ---   Gameplay: Chronicle: Interlude Type: Faction/GvE (Angels vs Nature vs Demons) GM Shop: B-S grade Buff slots: 20+4 Starting level: 74 + rebirth system   New Features: Client: Modern interface based on Essence Balance: New class skills for better balance Achievement Rewards: Daily, Weekly, One-time TOP rankings: PvP, Event PvP, Map PvP, Clan PvP, Event MvP, Map MvP Zones: 70 different PvP zones,  18 different events (8 map events | 10 main events) 12 Grand/raid bosses. Castle siege Olympiad Clan Hall challenge Custom Enchant System: Dynamic success chance (greater enchant level or item grade less enchanting success chance) Enchant rate: Blessed scrolls dynamic from 100% to 25%. Crystal Scrolls: 100%; Max enchant weapon +12 Max enchant armor +8 Safe point enchant system Extra Features: PvP items with level upgrade Weapon/Armor upgrade (from B grade to S) system Attributes system   Website: https://l2cygnus.com Community: Discord Facebook: https://www.facebook.com/l2cygnus Youtube:   
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock