Jump to content

Thelasthero

Members
  • Posts

    1,486
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by Thelasthero

  1. eh..... Check that in the code:

                   activeChar.teleToLocation(leaderx, leadery, leaderz);
         activeChar.sendMessage("You have been teleported to your leader!");
        activeChar.getInventory().destroyItemByItemId("RessSystem", 3470, 1, activeChar, activeChar.getTarget());
        activeChar.sendMessage("One GoldBar has dissapeared! Thank you!");
    

    RessSystem?? xexe. Anyway very usefull like .ch thanks.

  2. 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...

  3. 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.

  4. Now it does, because

    activeChar.getInventory().destroyItemByItemId("GoldDragon", Config.HERO_ITEM_ID, Config.HERO_ITEM_COUNT, activeChar, activeChar.getTarget());

     

    And yes it is a C/P, otherwise you wouldn't add useless protections..

    dude please don't continue this, we are both spamming. it isn't copy paste man really, i am not so noob, i can make a simple code.

  5. No it doesn't.

    I hate it when ppl c/p stuff that don't even know to read.

     

    Let's take a closer look.

    if(activeChar.getInventory().getItemByItemId(Config.HERO_ITEM_ID) != null && activeChar.getInventory().getItemByItemId(Config.HERO_ITEM_ID).getCount() >= Config.HERO_ITEM_COUNT)

     

    Here you say:

    If the X item isn't null (null = 0) at the inv of the player and

    if there are more or equal items at the inv

    {

    bla bla

    }

     

    So what do we have here?

    A failure >_< You make almost the same check twice, and what's more, the item doesn't even get consumed.

     

    This means, that the player can be hero for ever, if he has just 1 item.

     

    Do you need a guide to press right click, team, create patch?

    well sorry, i forgot 1 line. added. about the creating a patch, 1000 sorries i didn't see that...

     

    actually not, it gets consumed normally i didn't forget something. AND IT IS NOT c/p .

×
×
  • 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