- 0
Help Java Code Gmshop.java
-
Posts
-
Short version: took Vanganth's classic Interlude pack as the starting point and rebuilt the rest on top of the Classic Secret of Empire client (protocol 166). Stuff that got reworked, but not limited to: The AI is the one I'm proudest of. ~600 individual NPC behavior scripts, all parsed and verified against retail. Aggro range, follow logic, target switching, idle pattern, social actions. All behaving the way they do on the official server, not the way "close enough" L2J packs usually do. ~2,5k skills loaded, full enchant tree, soul crystal absorption rules. Every formula in Formulas.java and StatFunctions.java got rewritten to match retail. Geodata is not excluded. NPCs/spawns, 6k+ templates, 28k+ spawns, all raid bosses, all the standard event content (Olympiad, Seven Signs with Festival of Darkness, Castle Sieges, Clan Hall stuff, Fortress sieges, Dimensional Rift, Four Sepulchers, Cardiff Invasion). all quest scripts. The engine itself runs both Interlude (protocol 740–770) and Secret of Empire (166) off the same codebase, opcode-mapped. The thing I want to be clear about: this is as close to PTS as L2J realistically gets. Most, not all, L2J packs out there have approximated formulas, stub AI, patchy geodata, hardcoded raid scripts. We didn't take that route. When can you actually play it: Server most likely opens next year. If I get more dev time over the coming months a beta by end of this year is realistic, possibly earlier. No promises, depends on how much time I can put in. The server is already playable since the most important work is done. So if you'd like to collaborate, you'll be able to test it fairly soon. The server files are really good. You might even want to use them for your own server if we decide to go that route. Server tiers being considered: Low-rate retail - the flagship, most likely first server. Strict PTS. Mid-to-high rate, minimal customs - almost certainly happening as a second server. More accessible but the engine integrity stays. Old L2Finest pride-style (high-rate, heavy customs, the original flavor some of you remember) - very low chance and definitely not soon. It's on the list but well behind the first two. That's where we are. More updates as open beta gets closer.
-
Maybe some NPC is causing the problem for you, if you don't have a custom map, keep a backup of the database and remove the npc 1-1 to see where the problem is coming from. A custom npc is probably the problem. I had this problem before and searched a lot to find it.
-
🔥 L2 REDMOON – INTERLUDE 🔥 🆕 Newly opened – Full players joining! 🌐 Discord: https://discord.gg/5PvP5BrGg 💬 Website: https://L2Redmoon.com ⚔️ Progressive Server • Classic • No Pay To Win 📊 Stage System (Progressive): 🔹 Stage 1: Lv 1–42 | XP x3 | 2 weeks 🔹 Stage 2: Lv 43–60 | XP x4 | 2 weeks 🔹 Stage 3: Lv 61–75 | XP x5 | 10 days 🔹 Endgame: Lv 75–80 | XP x10 💰 General Rates: 💰 Adena x8 💎 Spoil x3 📦 Drop x3 📜 Quest x3 🚫 NO PAY TO WIN ⭐ Premium +30% (Optional) 🛡️ Safe +3 ⚔️ Max +16 🏆 Auto reward max for clans 🔥 ENDGAME – Final competitive phase @everyone
-
-
Topics

Question
L2 Supra
kalispera se olous
aftos einai enas kodikas sto l2jfrozen alla exo bali merika code parapano gia na douleboune
sto community board oste na min xriazete na pigeni kapios stin poli gia na agorasi kati
alla distixos den doulebi to multisell den ksero ti einai epsaksa 5 meres na do ti simbeni
kai gt den doulebi alla den ta katafera oso kai na alaksa ton kodika.. sto html pigenei kanonika
kai sta alla para8ira doulebi kanonika alla otan balo na agoraso den doulebi
dld gia na pas se ena alo html einai aftos o codikas bypass -h custom_doShop Chat 0
kai doulebi an balo afto bypass -h custom_doShop multisell 55370
mou anigi to para8iro dialego to item pou 8elo kai ekei den to pernei kolaei
stin consola den bgazei errors. an mporei kapios kai exei tin kalosini na me boi8isi
na telioso afto 8a anebaso ena oreo community gia l2jfrozen low rate kala protimisi
efxaristo!!
edo einai o kodikas pou exo kai ta simia me kokino einai afta pou exo addari extra
-------------------------------------------------------------------------------------------------------------------------------------------------
/*
* 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 com.l2jfrozen.gameserver.powerpak.gmshop;
import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.cache.HtmCache;
import com.l2jfrozen.gameserver.communitybbs.Manager.BaseBBSManager;
import com.l2jfrozen.gameserver.controllers.GameTimeController;
import com.l2jfrozen.gameserver.handler.IBBSHandler;
import com.l2jfrozen.gameserver.handler.ICustomByPassHandler;
import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
import com.l2jfrozen.gameserver.model.L2Character;
import com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.model.entity.event.CTF;
import com.l2jfrozen.gameserver.model.entity.event.DM;
import com.l2jfrozen.gameserver.model.entity.event.TvT;
import com.l2jfrozen.gameserver.model.entity.olympiad.Olympiad;
import com.l2jfrozen.gameserver.model.multisell.L2Multisell;
import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jfrozen.gameserver.network.serverpackets.SetupGauge;
import com.l2jfrozen.gameserver.powerpak.PowerPakConfig;
import com.l2jfrozen.gameserver.taskmanager.AttackStanceTaskManager;
import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
import com.l2jfrozen.gameserver.util.Broadcast;
/**
* @author L2JFrozen
*/
public class GMShop implements IVoicedCommandHandler, ICustomByPassHandler, IBBSHandler
{
@Override
public String[] getVoicedCommandList()
{
return new String[] {PowerPakConfig.GMSHOP_COMMAND};
}
private boolean checkAllowed(L2PcInstance activeChar)
{
String msg = null;
if(activeChar.isSitting())
msg = "GMShop is not available when you sit";
else if(PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("ALL"))
msg = "GMShop is not available in this area";
else if(PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("CURSED") && activeChar.isCursedWeaponEquiped())
msg = "GMShop is not available with the cursed sword";
else if(PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("ATTACK") && AttackStanceTaskManager.getInstance().getAttackStanceTask(activeChar))
msg = "GMShop is not available during the battle";
else if(PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("DUNGEON") && activeChar.isIn7sDungeon())
msg = "GMShop is not available in the catacombs and necropolis";
else if(PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("RB") && activeChar.isInsideZone(L2Character.ZONE_NOSUMMONFRIEND))
msg = "GMShop is not available in this area";
else if(PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("PVP") && activeChar.isInsideZone(L2Character.ZONE_PVP))
msg = "GMShop is not available in this area";
else if(PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("PEACE") && activeChar.isInsideZone(L2Character.ZONE_PEACE))
msg = "GMShop is not available in this area";
else if(PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("SIEGE") && activeChar.isInsideZone(L2Character.ZONE_SIEGE))
msg = "GMShop is not available in this area";
else if(PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("OLYMPIAD") && (activeChar.isInOlympiadMode() ||
activeChar.isInsideZone(L2Character.ZONE_OLY) || Olympiad.getInstance().isRegistered(activeChar) ||
Olympiad.getInstance().isRegisteredInComp(activeChar)))
msg = "GMShop is not available at Olympiad";
else if(PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("EVENT") &&
(activeChar._inEvent))
msg = "GMShop is not available at the opening event";
else if(PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("TVT") &&
activeChar._inEventTvT && TvT.is_started() )
msg = "GMShop is not available in TVT";
else if(PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("CTF") &&
activeChar._inEventCTF && CTF.is_started() )
msg = "GMShop is not available in CTF";
else if(PowerPakConfig.GMSHOP_EXCLUDE_ON.contains("DM") &&
activeChar._inEventDM && DM.is_started() )
msg = "GMShop is not available in DM";
if(msg!=null)
activeChar.sendMessage(msg);
return msg==null;
}
@Override
public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)
{
if(activeChar==null)
return false;
if(!checkAllowed(activeChar))
return false;
if(command.compareTo(PowerPakConfig.GMSHOP_COMMAND)==0)
{
NpcHtmlMessage htm = new NpcHtmlMessage(activeChar.getLastQuestNpcObject());
String text = HtmCache.getInstance().getHtm("data/html/gmshop/gmshop.htm");
htm.setHtml(text);
activeChar.sendPacket(htm);
}
return false;
}
@Override
public String[] getByPassCommands()
{
// TODO Auto-generated method stub
return new String [] {"doShop" };
}
@Override
public void handleCommand(String command, L2PcInstance player, String parameters)
{
if(player==null)
return;
if(parameters ==null || parameters.length()==0)
return;
if(!checkAllowed(player))
return;
if(!PowerPakConfig.GMSHOP_USEBBS && !PowerPakConfig.GMSHOP_USECOMMAND){
L2NpcInstance gmshopnpc = null;
if(player.getTarget()!=null)
if(player.getTarget() instanceof L2NpcInstance)
{
gmshopnpc = (L2NpcInstance)player.getTarget();
if(gmshopnpc.getTemplate().getNpcId()!=PowerPakConfig.GMSHOP_NPC)
gmshopnpc=null;
}
//Possible fix to Buffer - 1
if (gmshopnpc == null)
return;
//Possible fix to Buffer - 2
if (!player.isInsideRadius(gmshopnpc, L2NpcInstance.INTERACTION_DISTANCE, false, false))
return;
}//else (voice and bbs)
if(parameters.startsWith("multisell"))
{
try
{
L2Multisell.getInstance().SeparateAndSend(Integer.parseInt(parameters.substring(9).trim()), player, false, 0);
}
catch(Exception e)
{
if(Config.ENABLE_ALL_EXCEPTIONS)
e.printStackTrace();
player.sendMessage("This list does not exist");
}
}
String htm = "gmshop";
if(parameters.startsWith("Chat"))
{
htm = htm + "-" + parameters.substring(parameters.indexOf(" ") + 1).trim();
}
if(htm.contains("-0"))
htm = "gmshop";
String text = HtmCache.getInstance().getHtm("data/html/gmshop/" + htm + ".htm");
if(command.startsWith("bbs"))
{
text = text.replace("-h custom_do", "bbs_bbs");
BaseBBSManager.separateAndSend(text, player);
}
else
player.sendPacket(new NpcHtmlMessage(5,text));
return;
}
@Override
public String[] getBBSCommands()
{
return new String [] {"bbsShop" };
}
}
1 answer to this question
Recommended Posts