Jump to content

Recommended Posts

Posted

Guys, i made an itemhandler (credits to me so don't start saying c/p and and and), that when you double click on gold dragon(3481), cancel augment window pops up, and the item GETS consumed(not 100%). <<I have tested it so give me feedback. I won't explain how to register an itemhandler or how to register it with configs... there are plenty of guides... (MADE IN L2J INTERLUDE)

 

Here you go: Create a file CancelAugPortable.java in java/net/sf/l2j/gameserver/handler/itemhandlers and paste:

/*
* 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 2, 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
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.instance.L2PlayableInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.serverpackets.ExShowVariationMakeWindow;


public class CancelAugPortable implements IItemHandler
{
   private static final int ITEM_IDS[] = 
   {
   	3481
   };

   public void useItem(L2PlayableInstance playable, L2ItemInstance item)
   {
   	if (!(playable instanceof L2PcInstance))
		return;
           L2PcInstance activeChar = (L2PcInstance)playable;                
          if (activeChar.isInCombat())
           	{
           	activeChar.sendMessage("You cant cancel Augment while you are attacking");
           	return;
           	}
           else if (activeChar.isInJail())
           {
           	activeChar.sendMessage("You cant cancel Augment while you are in jail");
           	return;
           }
           else if (activeChar.isInOlympiadMode())
          {
      		activeChar.sendMessage("You cant cancel Augment while you are on olympiad game");
      		return;
          }
           else              
                  activeChar.sendPacket(new ExShowVariationCancelWindow());

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


}

 

Idea was taken from TheEnd's share with portable augment.

Posted

To be honest, nothing special, just:

 

1. Open Eclipse

 

2. Create new class.

 

3. C/p protections (if/else) from other handler

 

4. Insert new packet.

 

Thats all, but anyway, can be useful for someone.

Posted

To be honest, nothing special, just:

 

1. Open Eclipse

 

2. Create new class.

 

3. C/p protections (if/else) from other handler

 

4. Insert new packet.

 

Thats all, but anyway, can be useful for someone.

pwned

anyway gj

Posted

To be honest, nothing special, just:

 

1. Open Eclipse

 

2. Create new class.

 

3. C/p protections (if/else) from other handler

 

4. Insert new packet.

 

Thats all, but anyway, can be useful for someone.

well, i copied the base code from portable aug., but some changes were needed to work... not only the imports, portable aug was made for gracia final...

Posted

Matim is correct

Well.........

well, i copied the base code from portable aug., but some changes were needed to work... not only the imports, portable aug was made for gracia final...

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
Reply to this topic...

×   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

    • relax guys!!! maybe he sold the GOD files, and the vacation will last even longer!
    • This is my attempt to somehow bring the script to be usable. Remembering that the ideal is someone with real capacity to work on it. I'm just trying to improve in my spare time. Changed connection logic to work in php8 Organization of links I added my top rank next to l2jbrasil. My top is 4Team Servers, if you can use it, I would appreciate it!   Download: https://github.com/Sage-BR/icpn-votesystem If you have any bugs, post them here, but as I said, I will try to resolve them or report them to: ICPNetwork    L2JBrasil = The function that generates the playerid generated the incorrect id, now for l2jbrasil it uses "ID + Key" in the VoteAPI menu L2Votes = Now use "ID + Key" GameTOP200 = "Needs testing" Organized new API Hopezone EU = Uses “ID + Key” GameBytes = API fix, (So the API only returns FALSE or TRUE, I added logic using localstorage instead of a cookie to save the moment the API returned "true" and the counter generates it from there) L2Top.co = API fix, (So the API only returns FALSE or TRUE, I added logic using localstorage instead of a cookie to save the moment the API returned "true" and the counter generates it from there) GamingTop100 = API fix GameStop200 = API fix
    • New L2 Logo Faction Interlude Mid Server!  @everyone  BETA SERVER LOGINS ARE ONLINE ENJOY! 📌 Faction Manager Good VS Evil 🏆 Maximum Buffs Slots 24/12 ⚡ Safe Enchant +3 Max +18 💥 Champion System 💥 Vitality System 🔰 GMShop, Buffer & Gatekeeper 🔁 *LOGINS ONLINE * 1st March @ 20:00 GMT+2 🌐 Website: https://l2logo-faction.com/ D ྀི Discord: https://discord.com/invite/SKsDk5yY
    • *LOGINS ONLINE* 21st February @ 15:00 GMT+2   New L2 Logo Faction Interlude Mid Server!  @everyone  Faction Manager Good VS Evil  Maximum Buffs Slots 24/12  Safe Enchant +3 Max +18  Champion System  Vitality System  GMShop, Buffer & Gatekeeper  *LOGINS ONLINE* 21st February @ 15:00 GMT+2  Website: https://l2logo-faction.com/ D ྀི Discord: https://discord.com/invite/SKsDk5yY
    • Here lies Gaytits, the gayest scammer to ever exist... RIP King -- You won't be missed.
  • Topics

×
×
  • Create New...