Jump to content
  • 0

Help fix ScrollDonate code for acis 388


Question

Posted

Here's the code.

package net.sf.l2j.gameserver.handler.itemhandlers;

import net.sf.l2j.gameserver.data.SkillTable;
import net.sf.l2j.gameserver.handler.IItemHandler;
import net.sf.l2j.gameserver.handler.ItemHandler;
import net.sf.l2j.gameserver.model.actor.Playable;
import net.sf.l2j.gameserver.model.actor.Player;
import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
import net.sf.l2j.gameserver.network.SystemMessageId;
import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;

import java.util.HashMap;

public class DonateScrolls implements IItemHandler
{
    private final static HashMap<Integer, Integer[]> SCROLLS = new HashMap<Integer, Integer[]>();
    private static int[] ITEM_IDS = null;

    public DonateScrolls()
    {
        /**
		  * SCROLLS.put(item_id, new Integer[] { id_buffa, buffa level, id_skilla_animation, animation duration(ms)), take the item(1 yes, 0 no)) });
          */
        SCROLLS.put(11986, new Integer[] { 8001, 1, 7038, 1, 1 });
        SCROLLS.put(11987, new Integer[] { 8002, 1, 7038, 1, 1 });
        SCROLLS.put(11988, new Integer[] { 8003, 1, 7038, 1, 1 });
        SCROLLS.put(11989, new Integer[] { 8004, 1, 7038, 1, 1 });
        SCROLLS.put(11469, new Integer[] { 11510, 1, 7038, 1, 0 });
        SCROLLS.put(11470, new Integer[] { 11510, 2, 7038, 1, 0 });
        SCROLLS.put(11471, new Integer[] { 11510, 3, 7038, 1, 0 });
        SCROLLS.put(11472, new Integer[] { 11510, 4, 7038, 1, 0 });
        SCROLLS.put(11473, new Integer[] { 11510, 5, 7038, 1, 0 });
        SCROLLS.put(11474, new Integer[] { 11515, 1, 7038, 1, 0 });
        SCROLLS.put(11475, new Integer[] { 11515, 2, 7038, 1, 0 });
        SCROLLS.put(11476, new Integer[] { 11515, 3, 7038, 1, 0 });
        SCROLLS.put(11477, new Integer[] { 11515, 4, 7038, 1, 0 });
        SCROLLS.put(11478, new Integer[] { 11515, 5, 7038, 1, 0 });
        SCROLLS.put(11479, new Integer[] { 11520, 1, 7038, 1, 0 });
        SCROLLS.put(11480, new Integer[] { 11520, 2, 7038, 1, 0 });
        SCROLLS.put(11481, new Integer[] { 11520, 3, 7038, 1, 0 });
        SCROLLS.put(11482, new Integer[] { 11520, 4, 7038, 1, 0 });
        SCROLLS.put(11483, new Integer[] { 11520, 5, 7038, 1, 0 });
        SCROLLS.put(11484, new Integer[] { 11525, 1, 7038, 1, 0 });
        SCROLLS.put(11485, new Integer[] { 11525, 2, 7038, 1, 0 });
        SCROLLS.put(11486, new Integer[] { 11525, 3, 7038, 1, 0 });
        SCROLLS.put(11487, new Integer[] { 11525, 4, 7038, 1, 0 });
        SCROLLS.put(11488, new Integer[] { 11525, 5, 7038, 1, 0 });
        SCROLLS.put(11489, new Integer[] { 11530, 1, 7038, 1, 0 });
        SCROLLS.put(11490, new Integer[] { 11530, 2, 7038, 1, 0 });
        SCROLLS.put(11491, new Integer[] { 11530, 3, 7038, 1, 0 });
        SCROLLS.put(11492, new Integer[] { 11530, 4, 7038, 1, 0 });
        SCROLLS.put(11493, new Integer[] { 11530, 5, 7038, 1, 0 });
        SCROLLS.put(11494, new Integer[] { 11535, 1, 7038, 1, 0 });
        SCROLLS.put(11495, new Integer[] { 11535, 2, 7038, 1, 0 });
        SCROLLS.put(11496, new Integer[] { 11535, 3, 7038, 1, 0 });
        SCROLLS.put(11497, new Integer[] { 11535, 4, 7038, 1, 0 });
        SCROLLS.put(11498, new Integer[] { 11535, 5, 7038, 1, 0 });
        SCROLLS.put(11499, new Integer[] { 11540, 1, 7038, 1, 0 });
        SCROLLS.put(11500, new Integer[] { 11540, 2, 7038, 1, 0 });
        SCROLLS.put(11501, new Integer[] { 11540, 3, 7038, 1, 0 });
        SCROLLS.put(11502, new Integer[] { 11540, 4, 7038, 1, 0 });
        SCROLLS.put(11503, new Integer[] { 11540, 5, 7038, 1, 0 });

        //
        Integer[] tmp_ids = (Integer[]) SCROLLS.keySet().toArray(new Integer[SCROLLS.size()]);
        ITEM_IDS = toIntArray(tmp_ids);
        tmp_ids = null;
        ItemHandler.getInstance().getHandler(null);
    }

    public static void main (String... arguments )
    {
        new DonateScrolls();
    }

    public void useItem(Playable playable, ItemInstance item, boolean forceUse)
    {
        if (playable instanceof Player)
            return;

        Player player = (Player) playable;
        if (player.isAllSkillsDisabled())
        {
            player.sendMessage("");
            return;
        }

        if (player.isInOlympiadMode())
        {
            player.sendPacket(SystemMessageId.THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT);
            player.sendMessage("");
            return;
        }

        Integer[] data = SCROLLS.get(item.getItemId());
        if(data != null)
        {
            player.stopSkillEffects(data[0]);
            SkillTable.getInstance().getInfo(data[0], data[1]).getEffects(player, player);
            player.broadcastPacket(new MagicSkillUse(player, player, data[2], 1, data[3], 0));
            if (data[4] == 1) {
                player.destroyItem("Consume", item.getObjectId(), 1, null, false);
            }
        }
    }

    private int[] toIntArray(Integer[] arr)
    {
        int[] ret = new int[arr.length];
        int i = 0;
        for (Integer e : arr)
            ret[i++] = e.intValue();
        return ret;
    }

    public int[] getItemIds()
    {
        return ITEM_IDS;
    }
}

Here are some xml items

should remain in inventory
	<item id="11469" type="EtcItem" name="MIGHT1">
		<set name="default_action" val="capsule" />
		<set name="material" val="PAPER" />
		<set name="weight" val="100" />
		<set name="is_stackable" val="true" />
		<set name="is_oly_restricted" val="true" />
		<set name="handler" val="DonateScrolls" />
		<set name="item_skill" val="11510-1" />
	</item>
this one should disappear.
	<item id="11987" type="EtcItem" name="Speed">
		<set name="default_action" val="capsule" />
		<set name="material" val="PAPER" />
		<set name="weight" val="100" />
		<set name="is_stackable" val="true" />
		<set name="is_oly_restricted" val="true" />
		<set name="handler" val="DonateScrolls" />
		<set name="item_skill" val="8002-1" />
	</item>

 

This code must make the object constant which lies in the inventory and, when using it, imposes a buffer if the value 0 is set in the code. If the value is set to 1, the item puts a buffer and disappears. How to make the code work. You need help.

4 answers to this question

Recommended Posts

  • 0
Posted

If i am not wrong,  you want player use that scrolls like others. So copy xml from might buff for exemple, and make a second xml skill for scroll with scroll image. Or simple edit with status existing scrolls.

  • 0
Posted (edited)

Copy xml from original scroll, if you make that xml for scroll. 
open L2-file edit and search in ItemName-e.dat "Scroll of Might" And copy or edit that xml. Just change Item_Skill with your skill id.

Also check this line if you have. i don;t work with aCis.

 


 <set name="default_action" val="SKILL_REDUCE" />

 

Edited by 0flee

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

    • GoldRush launches tomorrow! July 18 16:00 GMT+3 Europe / International Register your account in the website, connect wallet and be ready to dominate!
    • 🏰 L2EXALTA LEGACY — Interlude x45 📅 Grand Opening: 31/07/2026 — 21:30 (GMT+3) 🌐 Website: https://l2exalta.org/ 💬 Discord: https://discord.gg/zNTCZD4AcT 📌 Wiki: https://l2exalta.org/en/wiki.html#progression   ⚙️ MAIN INFO Chronicle : Interlude Rates : x45 Adena : x50 Spoil : x1 Drop : x5 Safe Enchant : +3 Files : L2OFF   💰 ECONOMY EX Coin : dynamic market currency, mined from monsters, Raid Bosses and Grand Bosses value fluctuates over time Exalta Vouchers : premium currency used for store, donations and EX Coin exchange Exchange : convert EX Coin into Exalta Vouchers Investment options : choose safer or riskier market strategies with EX Coin   ⚔️ PROGRESSION & GEAR Exalta Armors : signature top-tier gear line Forge System : upgrade weapons, armor and jewels with risk/reward mechanics Raid Boss progression tied to materials and prestige   🤖 AUTOFARM Access : Auto Hunting button, bottom-right UI Duration : controlled via tickets or in-game currency Route Mode : record custom farm routes Support Mode : healer/support builds auto-follow, heal and assist party Smart targeting logic with class-specific behavior (mage/archer/melee/support) Captcha designed not to interrupt legitimate AutoFarm sessions   🧪 BUFFER Exalta Buffer NPC/interface Scheme Buffer : save multiple buff loadouts Class presets for mage, fighter, support, PvP   🛠️ SMART GADGETS / QOL Autoloot filter Drop value tracker Boss timer tools Farm stats tracker Auto-consume system In-game server assistant   🗺️ DUNGEON FINDER / PVE Party matching with roles (Tank / Healer / DPS) Ready-check before teleport Monastery of Silence custom PvE zone Party-based reward structure   🎟️ DAILY PROGRESS / EXALTA PASS Daily and weekly tasks (farm, PvP, boss, check-in) Premium Pass track with extra rewards Monastery Daily Quest Reward boards for claiming progress   🏠 HOUSING & EXPEDITIONS Player residences with service NPCs Exalta Spirit Expeditions to themed territories Rewards vary by territory Owner-only access   🏆 PVP / TOURNAMENT Scheduled Tournament system Ranking points from wins/participation Spectator Mode for watching live matches PvP Statues for top-ranked players Anti-feed protections   🛡️ CLAN CONTENT Clan Civil War battlefield event Clan Dungeon Raid content DPS Meter for contribution tracking Support Credit system Classic siege/clan politics preserved   🏪 AUCTION / SHOPS Auction House with seller fee Black Market Dealer (limited-time special offers) Custom shops and multisells Confirmation prompts on purchases/sales   💳 DONATIONS / VIP Donation rewards linked to Exalta Vouchers VIP tiers with comfort/cosmetic bonuses Premium store Gift/promo codes for events   🎥 STREAMER / COMMUNITY Streamer Panel with visible stream links Viewer rewards system Streamer Points for cosmetics/vouchers In-game voice chat (global/party/clan/alliance/command)   🔒 FAIR PLAY Strong Anti-Bot protection Reward protection tied to valid client state Captcha on suspicious activity Staff investigation tools No bots, packet tools or modified clients allowed   👑 GRANDBOSS SPAWNS Orfen : 1 day + 1h random Core : 1 day + 1h random Queen Ant : 1 day 6h + 1h random Zaken : 2 days 12h + 1h random Baium : 5 days + 1h random Antharas : 8 days + 1h random Valakas : 11 days + 1h random   🏅 OLYMPIAD Runs Thursday, Friday, Saturday Heroes change monthly Balanced and fair matchmaking
    • yup basically another one just in case https://drive.google.com/file/d/1UtccbD9e50x3WEnQBab2PTZnBHwpcGYM/view?usp=sharing LineageWarrior.FMagic (CollideActors = True; > False) LineageWarrior.FOrc (CollideActors = True; > False) LineageWarrior.FShaman (CollideActors = True; > False) LineageWarrior.MDarkElf (CollideActors = True; > False) LineageWarrior.MDwarf (CollideActors = True; > False) LineageWarrior.MElf (CollideActors = True; > False) LineageWarrior.MFighter (CollideActors = True; > False) LineageWarrior.MMagic (CollideActors = True; > False) LineageWarrior.MOrc (CollideActors = True; > False) LineageWarrior.MShaman (CollideActors = True; > False) LineageWarrior.FDwarf (CollideActors = True; > False) LineageWarrior.FElf (CollideActors = True; > False) LineageWarrior.FFighter (CollideActors = True; > False)
    • @l2naylondev Requiring a player to log in just for the sake of logging  seems exploitable. Someone could log in only to claim the reward and immediately leave, or repeatedly change their ip. So i guess  are there are additional protections in place ? such as locking the reward by account, character , and ip. It would also be useful to add a playtime requirement. For example, after logging in, the player would need to remain active for at least x playtime  before getting the reward or other parameters configurable by the xml.  I suggest improving the system before selling it. 
  • 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..