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;
    }
}

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • You talk too much go open L2Jhellas 😞 
    • 🌟 L2Avalon – Interlude Rework x20 – Grand Opening July 4! 🌟 📅 Server Launch: Open Beta: June 26, 18:00 GMT+3 Grand Opening: July 4, 2025 📦 Chronicle & Client: Reworked Interlude (based on latest High Five features) Custom launcher with up-to-date client support ⚔️ Rates & Progression: EXP/SP: Lv 1–39: x20 Lv 40–52: x15 Lv 52–60: x10 Lv 61–70: x8 Lv 71–75: x5 Lv 76–79: x4 → x3 Lv 80+: x2 Adena: x1 (subject to adjustment) Drop/Spoil/Raid Drop: x5 Quest Drop: custom Party Bonus: up to +290% EXP 🛠️ Core Features: Auto-loot (normal drops) Auto-learn skills up to level 75 High Five-style skill system with full rebalancing Passive MP regen: +1000 MP / 15s Inventory space: 150 slots Weight limit increased Auto CP/HP/MP potions Global chat from level 40 (!), offline shop (.offline), buff selling system (.sellbuff) 🔼 Class Progression: 1st & 2nd class: Free 3rd class: Kill 700 mobs → get 1 Giant Codex Subclass: Custom quest + 4 raid bosses + 1000 B-grade Crystals Noblesse: Either via Caradine's Letter (Lv 65+) or Noblesse box from raid bosses 🏪 NPC Shops & Support: GM Shop: Full D/C gear, Low B gear Luxury Shop: TOP B gear Donation Shop: Cosmetics, premium, etc. NPC Buffer: Save & load buff schemes (premium buffs for Premium Account) Mammon functions via NPC in Giran (unseal, augment, etc.) Offline Traders, Coin of Luck auction system Special blacksmiths and unique item services 💡 Why L2Avalon? Balanced seasonal x20 rates – smooth and long-term growth Quality-of-life systems for casual & hardcore players alike Custom skill system, refined raid rewards, and unique gear upgrades Active community, continuous development, and fair monetization Beta rewards & early start advantage 🔗 Useful Links: 🌐 Website: https://www.l2avalon.net 📘 Full Server Info: https://l2avalon-net.gitbook.io/info 💬 Discord: https://discord.gg/NbM2cXmAem 📝 Join the adventure this July! Prepare your characters during Beta and get rewarded at launch!  
    • You spent over a month calling a lot of people names. I get that you want to change, but it will take a lot more than this for me to believe its sincere. And honestly, for your apology to matter, I'd have to care enough to be offended in the first place.
    • we all love you very much Guytis💖 🤗
    • W/e u smoke there, i want aswell... life has been cruel all this time! Maybe it will help me
  • 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