Jump to content

Question

15 answers to this question

Recommended Posts

  • 0
Posted (edited)

He was not serious.. That was a sarcasm.

 

 

Easy task.
PM me with your offer.

Seriously.. :not bad:

 

 

Here you go, without any checks.

/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package net.sf.l2j.gameserver.handler.itemhandlers;

import net.sf.l2j.gameserver.handler.IItemHandler;
import net.sf.l2j.gameserver.model.L2ItemInstance;
import net.sf.l2j.gameserver.model.actor.L2Playable;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;


/**
 * @author SweeTs
 */

public class HeroItem implements IItemHandler
{
   @Override
   public void useItem(L2Playable playable, L2ItemInstance item, boolean forceUse)
   {
      if (!(playable instanceof L2PcInstance))
         return;
      
      L2PcInstance activeChar = (L2PcInstance)playable;
      
      int itemId = item.getItemId();
      
      if (itemId == 57) // Item to become hero
      {
         activeChar.setHero(true);
         activeChar.broadcastUserInfo();
      }
   }
}

Xml part

<set name="handler" val="HeroItem" />

and don't forget the register the HeroItem into the ItemHandler.java

Edited by SweeTs
  • 0
Posted (edited)

You don't even need the itemid check, as handler is specified only for that particular item. You would need itemid if the handler was specifying different behaviors for similar items using the same handler.

   @Override
   public void useItem(L2Playable playable, L2ItemInstance item, boolean forceUse)
   {
      if (!(playable instanceof L2PcInstance))
         return;
      
      (L2PcInstance)playable.setHero(true);
      (L2PcInstance)playable.broadcastUserInfo();
   }
Edited by Tryskell
  • 0
Posted (edited)

Actually that's what you need:

@Override
public void useItem(L2Playable playable, L2ItemInstance item, boolean forceUse)
{
          if (!(playable instanceof L2PcInstance))
             return;
        
          ((L2PcInstance)playable).destroyItem("", item, null, true);
          ((L2PcInstance)playable).setHero(true);
          ((L2PcInstance)playable).broadcastUserInfo();
}
Edited by An4rchy
  • 0
Posted

 

 

smth wrong wich this code))

 

Maybe you forgot to register the Item on ItemHandler.java

 

 

Index: java/net/sf/l2j/gameserver/handler/ItemHandler.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/ItemHandler.java (revision 1)
+++ java/net/sf/l2j/gameserver/handler/ItemHandler.java (working copy)
@@ -27,6 +27,7 @@
 import net.sf.l2j.gameserver.handler.itemhandlers.Harvester;
+import net.sf.l2j.gameserver.handler.itemhandlers.HeroItem;
 import net.sf.l2j.gameserver.handler.itemhandlers.ItemSkills;
@@ -66,6 +67,7 @@
  registerItemHandler(new Harvester());
+ registerItemHandler(new HeroItem());
  registerItemHandler(new ItemSkills());

Guest
This topic is now closed to further replies.


  • Posts

    • Some new features that we added: - 2 new quests - PvP Arena (to get hero status) Olympiad is disabled - Love Event - Dressme for armor/weapons/accessories - HWID Protection - More monsters - New farm zone - New autofarm system (works almost like adrenaline) - Auto enchant - Auto augment - 3 levels of armors - 3 levels of weapons - Anti KS System - Rebirth Manager - 30 days checking rewards - Small event (daily checking with small reward for all online players)
    • Added FloodProtector utility to prevent packet flooding for actions like item use and dice rolling. Integrated flood protection checks in relevant client packet handlers and registered/removal hooks in player lifecycle. Updated movement logic in L2PcInstance for improved position synchronization and geodata handling. Minor fixes and refactoring in attack logic, private store handling, and admin NPC editing. Refactored AI classes to enhance movement, attack, and skill usage logic for characters and mobs. Improved distance checks, attack range calculations, and skill casting conditions. Removed unused intention command logic from L2CharacterAI. Updated configuration to enable CellPathFinding. Minor code cleanups and bug fixes for more reliable AI behavior. Enhanced GeoPathFinding with detailed debug and error messages for region loading, including success/failure counts and file checks. Refactored L2AttackableAI and L2CharacterAI to improve attack range tolerance, immediate attack behavior, and added safety checks for missing targets. Updated configuration to disable CellPathFinding by default and added a new ShowRedName option for aggressive mobs. Minor config and log updates included. Applied TCP socket optimizations (e.g., TCP_NODELAY, buffer sizes, keepalive) in ClientThread, Connection, and SelectorThread to reduce latency and improve throughput. Enhanced L2AttackableAI with better random walk, aggro, and attack logic, including silent move checks, quest monster handling, and improved faction/raid/minion behavior. Added silent move support to L2PlayableInstance and quest monster flag to L2NpcTemplate/L2NpcInstance. These changes aim to improve server responsiveness, AI realism, and overall stability.
    • I’ve been using this Escape from Tarkov Hack for about a week now with no issues at all. ESP works great without any lag, and the aimbot is smooth and doesn't feel obvious. Had a quick setup with the loader, and support answered my questions right away. The HWID spoofer also did its job without messing with my system. So far, the cheat's staying undetected on my side.
  • 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