Jump to content

[Share]Buffer for aCis


Recommended Posts

Thanks for help to An4rchy

 

Preview:

8989ffbb5283.jpg

 

 

ba7e0e36744c.jpg

 

 

2e565b9591e7.jpg

 

 

 

 

Code:

/*
* 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.model.actor.instance;


import java.util.StringTokenizer;


import net.sf.l2j.gameserver.ai.CtrlIntention;
import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
import net.sf.l2j.gameserver.network.serverpackets.MyTargetSelected;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
import net.sf.l2j.gameserver.network.serverpackets.ValidateLocation;
import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;
import net.sf.l2j.gameserver.templates.chars.L2NpcTemplate;
import net.sf.l2j.util.StringUtil;
import net.sf.l2j.util.Rnd;


/**
*
* @author Leki
*/
public final class L2BufferInstance extends L2NpcInstance
{
    public L2BufferInstance(int objectId, L2NpcTemplate template)
    {
        super(objectId, template);
    }


     @Override
    public void onBypassFeedback(L2PcInstance player, String command)
    {
      StringTokenizer st = new StringTokenizer(command, " ");
      String actualCommand = st.nextToken();


      int buffid = 0;
      int bufflevel = 1;
        String nextWindow = null;
      if (st.countTokens() == 3) {
         buffid = Integer.valueOf(st.nextToken());
         bufflevel = Integer.valueOf(st.nextToken());
            nextWindow = st.nextToken();
      }
      else if (st.countTokens() == 1)
      buffid = Integer.valueOf(st.nextToken());


      if (actualCommand.equalsIgnoreCase("getbuff"))
      {
         if (buffid != 0)
         {
            MagicSkillUse mgc = new MagicSkillUse(this, player, buffid, bufflevel, 5, 0);
            SkillTable.getInstance().getInfo(buffid, bufflevel).getEffects(this, player);
            showMessageWindow(player);
            player.broadcastPacket(mgc);
                showChatWindow(player, nextWindow);
         }
      }
      else if (actualCommand.equalsIgnoreCase("restore")) {
         player.setCurrentHpMp(player.getMaxHp(), player.getMaxMp());
         player.setCurrentCp(player.getMaxCp());
         showMessageWindow(player);
      }
      else if (actualCommand.equalsIgnoreCase("cancel")) {
         player.stopAllEffects();
         showMessageWindow(player);
      }
      else
         super.onBypassFeedback(player, command);
    }


    @Override
    public void onAction(L2PcInstance player)
    {
      if (this != player.getTarget()) {
         player.setTarget(this);
         player.sendPacket(new MyTargetSelected(getObjectId(), player.getLevel() - getLevel()));
         player.sendPacket(new ValidateLocation(this));
      }
      else if (isInsideRadius(player, INTERACTION_DISTANCE, false, false)) {
         SocialAction sa = new SocialAction(this, Rnd.get();
         broadcastPacket(sa);
         player.setCurrentFolkNPC(this);
         showMessageWindow(player);
         player.sendPacket(ActionFailed.STATIC_PACKET);
      }
      else {
         player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this);
         player.sendPacket(ActionFailed.STATIC_PACKET);
      }
    }
   
    private void showMessageWindow(L2PcInstance player)
    {
      String filename = "data/html/buffer/" + getNpcId() + ".htm";
      
      filename = getHtmlPath(getNpcId(), 0);
      NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
      html.setFile(filename);
      html.replace("%objectId%", String.valueOf(getObjectId()));
      html.replace("%npcname%", getName());
      player.sendPacket(html);      
    }
   @Override
   public String getHtmlPath(int npcId, int val)
   {
      String pom = "";
      if (val == 0)
         pom = "" + npcId;
      else
         pom = npcId + "-" + val;
      
      return "data/html/buffer/" + pom + ".htm";
   }   
}

 

 

htmls:

http://www.4shared.com/rar/a1SBGWyx/Buffer.html?

 

 

Copy to data/html/buffer/

 

 

Buffer id 36003

Link to comment
Share on other sites

  • 2 years later...
  • 1 month later...


[javac] C:\Users\ElTyto\workspace\aCis_gameserver\java\net\sf\l2j\gameserver\model\actor\instance\L2BufferInstance.java:1: error: class, interface, or enum expected

[javac] program is free software; you can redistribute it and/or modify

[javac] ^

[javac] C:\Users\ElTyto\workspace\aCis_gameserver\java\net\sf\l2j\gameserver\model\actor\instance\L2BufferInstance.java:1: error: class, interface, or enum expected

[javac] program is free software; you can redistribute it and/or modify

[javac] ^

[javac] C:\Users\ElTyto\workspace\aCis_gameserver\java\net\sf\l2j\gameserver\model\actor\instance\L2BufferInstance.java:3: error: class, interface, or enum expected

[javac] * the Free Software Foundation; either version 2, or (at your option)

[javac] ^

[javac] C:\Users\ElTyto\workspace\aCis_gameserver\java\net\sf\l2j\gameserver\model\actor\instance\L2BufferInstance.java:7: error: class, interface, or enum expected

[javac] * but WITHOUT ANY WARRANTY; without even the implied warranty of

[javac] ^

[javac] C:\Users\ElTyto\workspace\aCis_gameserver\java\net\sf\l2j\gameserver\model\actor\instance\L2BufferInstance.java:12: error: class, interface, or enum expected

[javac] * along with this program; if not, write to the Free Software

[javac] ^

[javac] C:\Users\ElTyto\workspace\aCis_gameserver\java\net\sf\l2j\gameserver\model\actor\instance\L2BufferInstance.java:102: error: ')' expected

[javac] SocialAction sa = new SocialAction(this, Rnd.get();

[javac] ^

[javac] 6 errors

 

BUILD FAILED

 

Link to comment
Share on other sites

5 first errors... If you read it you would realise that its the GNU.

 

About the 6th, you miss )

 

Dont you see errors when you add code?

Edited by SweeTs
Link to comment
Share on other sites

I don't understand some people who, posted errors from the console. What you doing, what Eclipse does not show errors in the project tree? Every second builds the project in console w/o of IDE help? Or NetBeans not highlights the errors?  :dat:

Link to comment
Share on other sites

I don't understand some people who, posted errors from the console. What you doing, what Eclipse does not show errors in the project tree? Every second builds the project in console w/o of IDE help? Or NetBeans not highlights the errors?  :dat:

it highlights tho i cant fix all of them

Link to comment
Share on other sites

Move your cursor on the error, you will know what's wrong and possible solutions.

yeah i dont know java, so i cannot resolve those issues and im pretty sure that you wont help me either 

Link to comment
Share on other sites

  • SweeTs locked this topic
Guest
This topic is now closed to further replies.


  • Posts

    • 🇧🇷🇦🇷🇨🇱🇵🇪🇺🇾🇵🇾 Te esperamos este viernes en L2 Seal Proyecto Hunter . Open : 1/12/23 a las 21:00hs GMT-3 Para cerrar el año,de la mejor manera te esperamos en el servidor mid más grande de habla hispana. 🇩🇪🇨🇦🇫🇷🇬🇷🇮🇹🇪🇸 🇦🇷 !!!Te lo vas a perder!!! Estamos de regreso, con mucho contenido nuevo. Cliente : H5. 🔶 Rates : EXP/SP: x20 Adena: x10 Seal Stones: x4 Raid Boss EXP/SP: x5 Spoil: x10 Keymats Drop/Spoil: x5 Raid Boss Drop: x5 Drop: x8 Manor: x2 Eppaulletes: x5 🔶 Features : NPC Buffer com buffs de 2 hora GM-Shop up to Dynasty Mana Potions (1000 MP, 10 seg. Cooldown) Skills autolearn inclusive los 81/83 Buff Slots: 24 (+4 com Divine Inspiration LVL 4) Auto pickup configurable Offline Shop (Colocar el char en modo store y cerrar el cliente.) Cambio de 1ª classe (10.000 adena) Cambio de 2ª classe (500.000 adena) Cambio de 3ª classe (2.000.000 adena) Sub class No requiere quest items ni quest. Nobless Via quest (H5 Quest) Community con status de Raid Boss Shift + Click para ver a lista de drops (Rate Server) Global Shout / Delay 20 segundos. Max. Clientes/PC: 4 Max. Ventanas de Autofarm 1 por HWID Max. Miembros de clan en Zonas Épicas: Sin Restriccion Allys permitidas (Max. 2 Clanes) Cancellation: 2-4 buff con chance y random. Puedes contactarnos en : 🏃Discord: https://discord.com/invite/hmVaZFrFEy 🦸 Website: www.l2seal.com
    • IL or H5? What's the price?
    • I also noticed you have some great features like API for developers, daily updates, and a no-logs policy, which is essential for privacy-conscious users. Plus, the option for different payment methods, including cryptocurrencies, is a nice touch.
    • Hello Terminal if this source and offer exist I want to have a little chat! Thanks! 
    • you can make it pop up when a player get killed ^^
  • Topics

×
×
  • Create New...