Jump to content
  • 0

Old Version Buffer Acis To New.


Question

Posted (edited)

Hi. I found old buffer for acis pack, but i can't fix 2 error more.

/*
 * 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.model.actor.template.NpcTemplate;
import net.sf.l2j.commons.lang.StringUtil;
import net.sf.l2j.commons.random.Rnd;

/**
*
* @author DarthVader
* @version 1.3
*/
public final class L2BufferInstance extends L2NpcInstance
{
    public L2BufferInstance(int objectId, NpcTemplate 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;
		if (st.countTokens() == 2) {
			buffid = Integer.valueOf(st.nextToken());
			bufflevel = Integer.valueOf(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);
			}
		}
		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(8));
			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)
    {
		NpcHtmlMessage html = new NpcHtmlMessage(1);
		final StringBuilder strBuffer = StringUtil.startAppend( 3500, "<html><title>CLAW Magician</title><body><center>");

        if (player.isSitting()) {
        	player.sendMessage("You can't use buffer while you're sitting.");
		    strBuffer.append("Stand up, <font color=\"LEVEL\">%charname%</font>!<br>");
		    strBuffer.append("How dare you to talk with me while you're sitting?!<br>");
		}
        else if (player.isAlikeDead()) {
        	player.sendMessage("You can't use buffer while you're dead or using fake death.");
		    strBuffer.append("Sadly, <font color=\"LEVEL\">%charname%</font>, you're dead.<br>");
		    strBuffer.append("I can't offer any support effect for dead people...<br>");
        }
        else if (player.isInCombat()) {
        	player.sendMessage("You can't use buffer while you're in combat.");
		    strBuffer.append("Sadly, <font color=\"LEVEL\">%charname%</font>, I can't serve you.<br>");
		    strBuffer.append("Came back when you will not be in a combat.<br>");
        }
        else {
		    strBuffer.append("Welcome, <font color=\"LEVEL\">%charname%</font>!<br>");
		    strBuffer.append("Here is the list of all available effects:<br>");
			strBuffer.append("<img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32 align=left>");
			strBuffer.append("<table width=300>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_getbuff 1204 2\">Wind Walk</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 1040 3\">Shield</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 1243 6\">Bless Shield</a></td></tr>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_getbuff 1068 3\">Might</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 1036 2\">Magic Barrier</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 1259 4\">Resist Shock</a></td></tr>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_getbuff 1035 4\">Mental Shield</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 1045 6\">Blessed Body</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 1304 3\">Advanced Block</a></td></tr>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_getbuff 1048 6\">Blessed Soul</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 1062 2\">Berserker Spirit</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 1189 3\">Resist Wind</a></td></tr>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_getbuff 1086 2\">Haste</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 1240 3\">Guidance</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 1393 3\">Unholy Resistance</a></td></tr>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_getbuff 1242 3\">Death Whisper</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 1077 3\">Focus</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 1033 3\">Resist Poison</a></td></tr>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_getbuff 1268 4\">Vampiric Rage</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 1087 3\">Agility</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 1191 3\">Resist Fire</a></td></tr>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_getbuff 1085 3\">Acumen</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 1059 3\">Empower</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 1182 3\">Resist Aqua</a></td></tr>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_getbuff 1303 2\">Wild Magic</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 1078 6\">Concentration</a></td><td><a action=\"bypass -h npc_%objectId%_getbuff 1352 1\">Elemental Protection</a></td></tr>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_getbuff 1353 1\">Divine Protection</a></td><td><a action=\"bypass -h npc_%objectId%_getbuff 1397 3\">Clarity</a></td><td><a action=\"bypass -h npc_%objectId%_getbuff 1392 3\">Holy Resistance</a></td></tr>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_getbuff 1043 1\">Holy Weapon</a></td><td><a action=\"bypass -h npc_%objectId%_getbuff 1032 3\">Invigor</a></td><td><a action=\"bypass -h npc_%objectId%_getbuff 1044 3\">Regeneration</a></td></tr>");
			strBuffer.append("<tr><td></td></tr>");
			strBuffer.append("<tr><td><font color=\"ff9900\">Dances:</font></td></tr>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_getbuff 275 1\">Fury</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 273 1\">Mystic</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 365 1\">Siren's</a></td></tr>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_getbuff 274 1\">Fire</a></td>  <td><a action=\"bypass -h npc_%objectId%_getbuff 276 1\">Concentration</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 310 1\">Vampire</a></td></tr>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_getbuff 271 1\">Warrior</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 277 1\">Light</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 272 1\">Inspiration</a></td></tr>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_getbuff 311 1\">Protection</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 309 1\">Earth Guard</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 307 1\">Aqua Guard</a></td></tr>");
			strBuffer.append("<tr><td></td></tr>");
			strBuffer.append("<tr><td><font color=\"ff9900\">Songs:</font></td></tr>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_getbuff 264 1\">Earth</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 269 1\">Hunter</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 270 1\">Invocation</a></td></tr>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_getbuff 266 1\">Water</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 267 1\">Warding</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 304 1\">Vitality</a></td></tr>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_getbuff 268 1\">Wind</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 364 1\">Champion</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 349 1\">Renewal</a></td></tr>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_getbuff 265 1\">Life</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 363 1\">Meditation</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 305 1\">Vengeance</a></td></tr>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_getbuff 308 1\">Storm Guard</a></td> <td><a action=\"bypass -h npc_%objectId%_getbuff 306 1\">Flame Guard</a></td></tr>");
			strBuffer.append("<tr><td></td></tr>");
			strBuffer.append("<tr><td><font color=\"ff9900\">Other:</font></td></tr>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_cancel\"><font color=\"ffffff\">Cancel</font></a></td><td><a action=\"bypass -h npc_%objectId%_getbuff 1388 3\">Greater Might</a></td><td><a action=\"bypass -h npc_%objectId%_getbuff 1389 3\">Greater Shield</a></td></tr>");
			strBuffer.append("<tr><td><a action=\"bypass -h npc_%objectId%_restore\"><font color=\"ffffff\">Restore</font></a></td><td><a action=\"bypass -h npc_%objectId%_getbuff 1363 1\">Chant of Victory</a></td><td><a action=\"bypass -h npc_%objectId%_getbuff 1356 1\">Prophecy of Fire</a></td></tr>");
			strBuffer.append("<tr><td></td><td><a action=\"bypass -h npc_%objectId%_getbuff 1355 1\">Prophecy of Water</a></td><td><a action=\"bypass -h npc_%objectId%_getbuff 1357 1\">Prophecy of Wind</a></td></tr>");
			strBuffer.append("<tr><td></td><td><a action=\"bypass -h npc_%objectId%_getbuff 1413 1\">Magnus' Chant</a></td><td></td></tr>");
			strBuffer.append("</table><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32 align=left>");
        }
		strBuffer.append("</center></body></html>");
		html.setHtml(strBuffer.toString());
		html.replace("%objectId%", String.valueOf(getObjectId()));
		html.replace("%charname%", player.getName());
		player.sendPacket(html);
    }
}

First error with AI_INTENTION_INTERACT, should i change to just INTERACT ? : http://imgur.com/a/iXvwF

 

Second error with StringUtil(import net.sf.l2j.commons.lang.StringUtil;), there is no  "startAppend" function, i found in StringUtil function Append, but it's not working what's wrong ? http://imgur.com/RyUaLKi

Edited by Nvision

1 answer to this question

Recommended Posts

  • 0
Posted (edited)

1 - yes

2 - new StringBuilder("<html><title>CLAW Magician</title><body><center>"); or even keep it empty () and below add line strBuffer.append("<html><title>CLAW Magician</title><body><center>");

Edited by SweeTs

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

    • Introducing: Cloud Hosting and Stream Rewards!   Hey everyone, I'm excited to share something big on top of the recent NimeraCP V2 update I announced a few days ago. We're introducing Cloud Hosting and Stream Rewards!   Starting at 30 euros per month, subscribing to NimeraCP will give you access to deploy your own instance directly through your dashboard on nimeracp.com. This is a huge upgrade for our ecosystem, offering a much more affordable option than self-hosting and simplifying the entire installation process. No more wasting hours setting things up, buying separate dedicated hosts or VPSs, just deploy on our infrastructure and relax.     Currently these packs are available for Cloud Hosting:   aCis r382 aCis r401 aCis r409 L2Scripts Vanguard   More are coming soon as development progresses. If you need your pack to be added, please reach out to us.   On top of that, we've rolled out an update that introduces Stream Rewards. Now, players can link their Kick, Twitch or Trovo accounts to NimeraCP, stream, and earn rewards. Admins can create reward campaigns, set a required streaming time, and when a streamer meets the requirements, they can instantly transfer the reward to their game character.     As I mentioned in our last update, big things are coming, and this is just the beginning.   Best, Splicho
    • There were a few minor hiccups along the way, but the problem was eventually resolved. Overall, he is a very experienced, skilled, and trustworthy developer, and I will definitely continue to use his services in the future. thank yuo .   this topic can be locked please . thank you  
    • 99.99% of the people you 'sell' this to will not see any meaning on any sort of code, as simple or complicated as it may be, so i suggest the video. would be much better for practical reasons. good luck though
    • I've completely decompiled, replicated, and devirtualized the Gamear DLL file. You can see it there; otherwise, wait a day or two and I'll make a video myself. Best regards. static int __fastcall hkAEmitter_Tick_Impl(void* this_, void* /*edx*/, float dt, int levelTick) {     // Ares: if (IsA(this, AEmitter))     if (this_ && g_UClass_Emitter && GX_IsA(this_, g_UClass_Emitter))     {         // Ares: v7 = sub_1300CAA0()         void* v7 = g_localPawn;         if (v7)         {             // Ares: if IsA(v7, APawn) && lvl in (0,8)             if (g_UClass_APawn && GX_IsA(v7, g_UClass_APawn))             {                 const int lvl = (int)InterlockedCompareExchange((volatile LONG*)&g_skipLevel, 0, 0);                 if (lvl > 0 && lvl < 😎                 {                     // Ares: v6 = sub_13026800(this, v7)                     const float v6 = GX_Distance3D(this_, v7);                     // Live-tuning (debug): aplica overrides en runtime                     GX_LiveApply_Tick(this_, v6); Today I'll see how the classic client works on the Eris server. If it works well, I'll proceed to decompile the dll for classic as well. GG.. 🙂
  • 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..