08-23-2011, 09:29 AM
Нужно реализовать магазин в Альт + В
Вставил в ядро все нормально работает только одна проблема, обычный чар не может ничего купить хотя все открывается. Где нужно в ядре подправить чтобы и обычный чар без прав мог покупать в магазине?
Код:
Index: /java/com/l2jserver/Config.java
===================================================================
--- /java/com/l2jserver/Config.java (revision 4510)
+++ /java/com/l2jserver/Config.java (working copy)
@@ -80,6 +80,7 @@
public static final String COMMUNITY_CONFIGURATION_FILE = "./config/CommunityServer.properties";
public static final String GRANDBOSS_CONFIG_FILE = "./config/Grandboss.properties";
public static final String GRACIASEEDS_CONFIG_FILE = "./config/GraciaSeeds.properties";
+ public static final String COMMUNITY_BOARD_PVP = "./config/CommunityBoardPvP.properties";
public static final String CHAT_FILTER_FILE = "./config/chatfilter.txt";
@@ -600,6 +601,13 @@
//--------------------------------------------------
+ // Community Board PvP
+ //--------------------------------------------------
+ public static boolean BUFF_PEACE;
+ public static boolean MANI_BUFF;
+
+
+ //--------------------------------------------------
// FloodProtector Settings
//--------------------------------------------------
public static FloodProtectorConfig FLOOD_PROTECTOR_USE_ITEM;
@@ -2690,6 +2698,23 @@
throw new Error("Failed to Load " + GRANDBOSS_CONFIG_FILE + " File.");
}
+ // Community Board PvP
+ try
+ {
+ L2Properties CommunityBoardPvPSettings = new L2Properties();
+ is = new FileInputStream(new File(COMMUNITY_BOARD_PVP));
+ CommunityBoardPvPSettings.load(is);
+
+ BUFF_PEACE = Boolean.parseBoolean(CommunityBoardPvPSettings.getProperty("PeaceZone", "true"));
+ MANI_BUFF = Boolean.parseBoolean(CommunityBoardPvPSettings.getProperty("ManiBuff", "true"));
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ throw new Error("Failed to Load " + COMMUNITY_BOARD_PVP + " File.");
+ }
+
// Gracia Seeds
try
{
Код:
Index: /java/com/l2jserver/gameserver/communitybbs/CommunityBoard.java
===================================================================
--- /java/com/l2jserver/gameserver/communitybbs/CommunityBoard.java (revision 4502)
+++ /java/com/l2jserver/gameserver/communitybbs/CommunityBoard.java (working copy)
@@ -1,26 +1,18 @@
-/*
- * 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 com.l2jserver.gameserver.communitybbs;
+import java.util.StringTokenizer;
+
import com.l2jserver.Config;
+import com.l2jserver.gameserver.communitybbs.Manager.BuffBBSManager;
import com.l2jserver.gameserver.communitybbs.Manager.ClanBBSManager;
import com.l2jserver.gameserver.communitybbs.Manager.PostBBSManager;
import com.l2jserver.gameserver.communitybbs.Manager.RegionBBSManager;
+import com.l2jserver.gameserver.communitybbs.Manager.TeleportBBSManager;
import com.l2jserver.gameserver.communitybbs.Manager.TopBBSManager;
import com.l2jserver.gameserver.communitybbs.Manager.TopicBBSManager;
+import com.l2jserver.gameserver.datatables.MultiSell;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.entity.TvTEvent;
import com.l2jserver.gameserver.network.L2GameClient;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.ShowBoard;
@@ -73,6 +65,26 @@
{
TopBBSManager.getInstance().parsecmd(command, activeChar);
}
+ else if (command.startsWith("_bbsteleport;"))
+ {
+ TeleportBBSManager.getInstance().parsecmd(command, activeChar);
+ }
+ else if (command.startsWith("_bbs_buff"))
+ {
+ BuffBBSManager.getInstance().parsecmd(command, activeChar);
+ }
+ else if (command.startsWith("_bbsmultisell;"))
+ {
+ if(activeChar.isDead() || activeChar.isAlikeDead() || TvTEvent.isStarted() || activeChar.isInSiege() || activeChar.isCastingNow() || activeChar.isInCombat() || activeChar.isAttackingNow() || activeChar.isInOlympiadMode() || activeChar.isInJail() || activeChar.isFlying() || activeChar.getKarma() > 0 || activeChar.isInDuel()){
+ activeChar.sendMessage("В данных условиях шоп запрещен");
+ return;
+ }
+ StringTokenizer st = new StringTokenizer(command, ";");
+ st.nextToken();
+ TopBBSManager.getInstance().parsecmd("_bbstop;" + st.nextToken(), activeChar);
+ int multisell = Integer.parseInt(st.nextToken());
+ MultiSell.getInstance().separateAndSend(multisell, activeChar, null, false);
+ }
else if (command.startsWith("_bbshome"))
{
TopBBSManager.getInstance().parsecmd(command, activeChar);