A Project for Chronicle 4 based on L2JServer.


    [Share] Core Buffer for your server. (java)

    Share
    avatar
    mystogan64

    Posts : 51
    Join date : 2013-10-04

    [Share] Core Buffer for your server. (java)

    Post  mystogan64 on 6th October 2013, 18:32

    Hello to everybody, this is my 1st share in this forum so i hope you like it.
    I had a core buffer for interlude pack so i though "why not to try adapting for c4" and here is the result Smile
    So you have to do few changes in the project . Before you scroll down and start , let me show you a screenshot and a video how that buffer looks, so you will know what you going to have after adding the code.

    http://prntscr.com/1vmu5y
    http://prntscr.com/1vmuhj




    First of all go to net.sf.l2j.util and create new .java file and name it StringUtil.java , inside paste the below code.

    Code:
    /*
     * $Header$
     *
    * $Author: fordfrog $ $Date$ $Revision$ $Log$
     *
    *
    * 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.util;

    import javolution.text.TextBuilder;

    /**
     * String utilities optimized for the best performance. <h1>How to Use It</h1> <h2>concat() or append()</h2> If concatenating strings in single call, use StringUtil.concat(), otherwise use StringUtil.append() and its variants. <h2>Minimum Calls</h2> Bad:
     *
    * <pre>
     * final StringBuilder sbString = new StringBuilder();
     * StringUtil.append(sbString, &quot;text 1&quot;, String.valueOf(npcId));
     * StringUtil.append(&quot;text 2&quot;);
     * </pre>
     *
    * Good:
     *
    * <pre>
     * final StringBuilder sbString = new StringBuilder();
     * StringUtil.append(sbString, &quot;text 1&quot;, String.valueOf(npcId), &quot;text 2&quot;);
     * </pre>
     *
    * Why?<br/>
     * Because the less calls you do, the less memory re-allocations have to be done so the whole text fits into the memory and less array copy tasks has to be performed. So if using less calls, less memory is used and string concatenation is faster. <h2>Size Hints for Loops</h2> Bad:
     *
    * <pre>
     * final StringBuilder sbString = new StringBuilder();
     * StringUtil.append(sbString, &quot;header start&quot;, someText, &quot;header end&quot;);
     * for (int i = 0; i &lt; 50; i++)
     * {
     * StringUtil.append(sbString, &quot;text 1&quot;, stringArray[i], &quot;text 2&quot;);
     * }
     * </pre>
     *
    * Good:
     *
    * <pre>
     * final StringBuilder sbString = StringUtil.startAppend(1300, &quot;header start&quot;, someText, &quot;header end&quot;);
     * for (int i = 0; i &lt; 50; i++)
     * {
     * StringUtil.append(sbString, &quot;text 1&quot;, stringArray[i], &quot;text 2&quot;);
     * }
     * </pre>
     *
    * Why?<br/>
     * When using StringUtil.append(), memory is only allocated to fit in the strings in method argument. So on each loop new memory for the string has to be allocated and old string has to be copied to the new string. With size hint, even if the size hint is above the needed memory, memory is saved
     * because new memory has not to be allocated on each cycle. Also it is much faster if no string copy tasks has to be performed. So if concatenating strings in a loop, count approximately the size and set it as the hint for the string builder size. It's better to make the size hint little bit larger
     * rather than smaller.<br/>
     * In case there is no text appended before the cycle, just use <code>new
     * StringBuilder(1300)</code>. <h2>Concatenation and Constants</h2> Bad:
     *
    * <pre>
     * StringUtil.concat(&quot;text 1 &quot;, &quot;text 2&quot;, String.valueOf(npcId));
     * </pre>
     *
    * Good:
     *
    * <pre>
     * StringUtil.concat(&quot;text 1 &quot; + &quot;text 2&quot;, String.valueOf(npcId));
     * </pre>
     *
    * or
     *
    * <pre>
     * StringUtil.concat(&quot;text 1 text 2&quot;, String.valueOf(npcId));
     * </pre>
     *
    * Why?<br/>
     * It saves some cycles when determining size of memory that needs to be allocated because less strings are passed to concat() method. But do not use + for concatenation of non-constant strings, that degrades performance and makes extra memory allocations needed. <h2>Concatenation and Constant
     * Variables</h2> Bad:
     *
    * <pre>
     * String glue = &quot;some glue&quot;;
     * StringUtil.concat(&quot;text 1&quot;, glue, &quot;text 2&quot;, glue, String.valueOf(npcId));
     * </pre>
     *
    * Good:
     *
    * <pre>
     * final String glue = &quot;some glue&quot;;
     * StringUtil.concat(&quot;text 1&quot; + glue + &quot;text2&quot; + glue, String.valueOf(npcId));
     * </pre>
     *
    * Why? Because when using <code>final</code> keyword, the <code>glue</code> is marked as constant string and compiler treats it as a constant string so it is able to create string "text1some gluetext2some glue" during the compilation. But this only works in case the value is known at compilation
     * time, so this cannot be used for cases like <code>final String objectIdString =
     * String.valueOf(getObjectId)</code>. <h2>StringBuilder Reuse</h2> Bad:
     *
    * <pre>
     * final StringBuilder sbString1 = new StringBuilder();
     * StringUtil.append(sbString1, &quot;text 1&quot;, String.valueOf(npcId), &quot;text 2&quot;);
     * ... // output of sbString1, it is no more needed
     * final StringBuilder sbString2 = new StringBuilder();
     * StringUtil.append(sbString2, &quot;text 3&quot;, String.valueOf(npcId), &quot;text 4&quot;);
     * </pre>
     *
    * Good:
     *
    * <pre>
     * final StringBuilder sbString = new StringBuilder();
     * StringUtil.append(sbString, &quot;text 1&quot;, String.valueOf(npcId), &quot;text 2&quot;);
     * ... // output of sbString, it is no more needed
     * sbString.setLength(0);
     * StringUtil.append(sbString, &quot;text 3&quot;, String.valueOf(npcId), &quot;text 4&quot;);
     * </pre>
     *
    * Why?</br> In first case, new memory has to be allocated for the second string. In second case already allocated memory is reused, but only in case the new string is not longer than the previously allocated string. Anyway, the second way is better because the string either fits in the memory and
     * some memory is saved, or it does not fit in the memory, and in that case it works as in the first case. <h2>Primitives to Strings</h2> To convert primitives to string, use String.valueOf(). <h2>How much faster is it?</h2> Here are some results of my tests. Count is number of strings concatenated.
     * Don't take the numbers as 100% true as the numbers are affected by other programs running on my computer at the same time. Anyway, from the results it is obvious that using StringBuilder with predefined size is the fastest (and also most memory efficient) solution. It is about 5 times faster when
     * concatenating 7 strings, compared to TextBuilder. Also, with more strings concatenated, the difference between StringBuilder and TextBuilder gets larger. In code, there are many cases, where there are concatenated 50+ strings so the time saving is even greater.
     *
    * <pre>
     * Count: 2
     * TextBuilder: 1893
     * TextBuilder with size: 1703
     * String: 1033
     * StringBuilder: 993
     * StringBuilder with size: 1024
     * Count: 3
     * TextBuilder: 1973
     * TextBuilder with size: 1872
     * String: 2583
     * StringBuilder: 1633
     * StringBuilder with size: 1156
     * Count: 4
     * TextBuilder: 2188
     * TextBuilder with size: 2229
     * String: 4207
     * StringBuilder: 1816
     * StringBuilder with size: 1444
     * Count: 5
     * TextBuilder: 9185
     * TextBuilder with size: 9464
     * String: 6937
     * StringBuilder: 2745
     * StringBuilder with size: 1882
     * Count: 6
     * TextBuilder: 9785
     * TextBuilder with size: 10082
     * String: 9471
     * StringBuilder: 2889
     * StringBuilder with size: 1857
     * Count: 7
     * TextBuilder: 10169
     * TextBuilder with size: 10528
     * String: 12746
     * StringBuilder: 3081
     * StringBuilder with size: 2139
     * </pre>
     * @author fordfrog
     */
    public final class StringUtil
    {
     
    private StringUtil()
     {
     }
     
    /**
     * Concatenates strings.
     * @param strings strings to be concatenated
     * @return concatenated string
     * @see StringUtil
     */
     public static String concat(final String... strings)
     {
     final TextBuilder sbString = TextBuilder.newInstance();
     
    for (final String string : strings)
     {
     sbString.append(string);
     }
     
    String result = sbString.toString();
     TextBuilder.recycle(sbString);
     return result;
     }
     
    /**
     * Creates new string builder with size initializated to <code>sizeHint</code>, unless total length of strings is greater than <code>sizeHint</code>.
     * @param sizeHint hint for string builder size allocation
     * @param strings strings to be appended
     * @return created string builder
     * @see StringUtil
     */
     public static StringBuilder startAppend(final int sizeHint, final String... strings)
     {
     final int length = getLength(strings);
     final StringBuilder sbString = new StringBuilder(sizeHint > length ? sizeHint : length);
     
    for (final String string : strings)
     {
     sbString.append(string);
     }
     
    return sbString;
     }
     
    /**
     * Appends strings to existing string builder.
     * @param sbString string builder
     * @param strings strings to be appended
     * @see StringUtil
     */
     public static void append(final StringBuilder sbString, final String... strings)
     {
     sbString.ensureCapacity(sbString.length() + getLength(strings));
     
    for (final String string : strings)
     {
     sbString.append(string);
     }
     }
     
    /**
     * Counts total length of all the strings.
     * @param strings array of strings
     * @return total length of all the strings
     */
     private static int getLength(final String[] strings)
     {
     int length = 0;
     
    for (final String string : strings)
     {
     if (string == null)
     {
     length += 4;
     }
     else
     {
     length += string.length();
     }
     }
     
    return length;
     }
     
    public static String getTraceString(StackTraceElement[] trace)
     {
     final TextBuilder sbString = TextBuilder.newInstance();
     for (final StackTraceElement element : trace)
     {
     sbString.append(element.toString()).append('\n');
     }
     
    String result = sbString.toString();
     TextBuilder.recycle(sbString);
     return result;
     }
    }
    After that you have to go in net.sf.l2j.gameserver.model.actor.instance and create .java file with the name L2BufferInstance.java
    Paste the below code inside.

    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.lib.Rnd;
    import net.sf.l2j.gameserver.serverpackets.ActionFailed;
    import net.sf.l2j.gameserver.serverpackets.MagicSkillUser;
    import net.sf.l2j.gameserver.serverpackets.MyTargetSelected;
    import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;
    import net.sf.l2j.gameserver.serverpackets.SocialAction;
    import net.sf.l2j.gameserver.serverpackets.ValidateLocation;
    import net.sf.l2j.gameserver.templates.L2NpcTemplate;
    import net.sf.l2j.util.StringUtil;

    /**
     * @author DarthVader
     * @version 1.3
     */
    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;
     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)
     {
     MagicSkillUser mgc = new MagicSkillUser(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></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_1\" 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><td><font color=\"ff9900\">Special</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 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><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></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);
     }
    }
    Alright then, now lets fix the errors Smile

    Go in net.sf.l2j.gameserver.serverpackets and open SocialAction.java

    Import :
    Code:

    import net.sf.l2j.gameserver.model.actor.instance.L2BufferInstance;
    Find these lines

    Code:

    public SocialAction(int playerId, int actionId)
     {
     _playerId = playerId;
     _actionId = actionId;
     }
    and paste this below.

    Code:

    /**
     * @param l2BufferInstance
     * @param actionId
     */
     public SocialAction(L2BufferInstance l2BufferInstance, int actionId)
     {
     // TODO Auto-generated constructor stub
     }
    Next go in net.sf.l2j.gameserver.serverpackets and open the file ActionFailed.java , find this line.

    Code:

    private static final String _S__35_ACTIONFAILED = "[S] 25 ActionFailed";
    Paste this line below.

    Code:

    public static final ActionFailed STATIC_PACKET = new ActionFailed();
    Last step , go in net.sf.l2j.gameserver.model.actor.instance open the file L2PcInstance.java

    Find these lines.

    Code:

    {
     sendMessage("TvT Participants cannot register to the Grand Olympiad Games.");
     return false;
     }
     
    return true;
     }
    Paste below.

    Code:

    /**
     * @param l2BufferInstance
     */
     public void setCurrentFolkNPC(L2BufferInstance l2BufferInstance)
     {
     // TODO Auto-generated method stub
     
    }



    P.S: If there is any mistake , please let me know it. Have fun!

      Current date/time is 19th November 2017, 18:16