Little help over here :P
Posted: Mon Jul 01, 2013 10:39 pm
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision 6040M:
L2JDP Revision 9776:
Ok guys i tried to fix this problem for hours but unsuccessfully, so now its time to get help from better devs than me lol
i m trying to make some custom castle battle event ( i will contribute it to L2J as soon as its finished )
everything works fine without errors, but the problem is that variable CB_State doesnt change after starting participation, it still says its 1 ( not in progress ). i rly got no idea what more to change to get it working...
thx for your help
[EDIT] : i see that l2()dc string was replaced with *fork* but it isnt from fork, its shortened name of my server.
» Find Revision
L2J Revision 6040M:
L2JDP Revision 9776:
Ok guys i tried to fix this problem for hours but unsuccessfully, so now its time to get help from better devs than me lol

Code: Select all
/* * Copyright (C) 2004-2013 L2J DataPack * * This file is part of L2J DataPack. * * L2J DataPack 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. * * L2J DataPack 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 *fork*.CastleBattle; import java.util.Calendar;import java.util.logging.Logger; import com.l2jserver.gameserver.Announcements;import com.l2jserver.gameserver.ThreadPoolManager;import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage; /** * @author HyperByter * @version Beta * @build 2.7.2013 */ public class CastleBattle{ private static Logger _log = Logger.getLogger("CastleBattle"); private static String htm_path = "data/scripts/*fork*/CastleBattle/"; private static int CB_State = 1; // 0 - Disabled, 1 - Not in progress, 2 - Participation, 3 - Running, 4 - Event ended // Initialize Engine private static void CB_Init() { if (CB_State != 0) { SetStartTime(); } } // Event Loop public static void SetStartTime() { Calendar _nextTime = Calendar.getInstance(); int _m = _nextTime.get(Calendar.MINUTE); int x = 1; while (_m > 5) { _m -= 5; x++; } _nextTime.set(Calendar.MINUTE, x * 5); ThreadPoolManager.getInstance().scheduleGeneral(new CastleBattleLoop(), _nextTime.getTimeInMillis() - System.currentTimeMillis()); } // Allow players to participate in the event public static void StartParticipation() { CB_State = 2; Announcements.getInstance().announceToAll("Castle Battle participation has started."); _log.info("Castle Battle participation has started."); } // Player requests to join event via NPC public static void CB_bypass(String _cmd, L2PcInstance _player) { if (_cmd.startsWith("InitHtmlRequest")) { if (CB_State == 0) { NpcHtmlMessage _html = new NpcHtmlMessage(0); _html.setFile("", htm_path + "CB_Disabled.htm"); _player.sendPacket(_html); } if (CB_State == 1) { NpcHtmlMessage _html = new NpcHtmlMessage(0); _html.setFile("", htm_path + "CB_NotInProgress.htm"); _player.sendPacket(_html); } if (CB_State == 2) { NpcHtmlMessage _html = new NpcHtmlMessage(0); _html.setFile("", htm_path + "CB_Participate.htm"); _player.sendPacket(_html); } } } public static void main(String[] args) { _log.info("# Castle Battle Engine #"); _log.info("Author : HyperByter"); _log.info("Version : Beta"); _log.info("Version : 2.7.2013"); CastleBattle.CB_Init(); } } class CastleBattleLoop implements Runnable{ @Override public void run() { CastleBattle.StartParticipation(); }}
thx for your help

[EDIT] : i see that l2()dc string was replaced with *fork* but it isnt from fork, its shortened name of my server.