Jump to content
  • 0

TW simply do not know !!


Question

Posted

If you want to receive support we need this info to help you properly.

L2J Revision Number:

L2JDP Revision Number:

 

FULL CODE

 
Index: java.net.sf.l2j.gameserver.handler.admincommandhandlers.AdminTownWar
===================================================================
/*
* 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.handler.admincommandhandlers;

import java.util.Collection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ScheduledFuture;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.Announcements;
import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
import net.sf.l2j.gameserver.instancemanager.TownManager;
import net.sf.l2j.gameserver.model.L2Object;
import net.sf.l2j.gameserver.model.L2World;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.zone.type.L2TownZone;

public class AdminTownWar implements IAdminCommandHandler
{
private static final String[] ADMIN_COMMANDS =
{
	"admin_townwar_start",
	"admin_townwar_end"
};
    public L2Object _activeObject;
    public final L2Object getActiveObject()
   {
       return _activeObject;
   }
public boolean useAdminCommand(String command, L2PcInstance activeChar)
{
	if (command.startsWith("admin_townwar_start"))
	{
		startTW(activeChar);
	}
	if (command.startsWith("admin_townwar_end"))
	{
		endTW(activeChar);
	}
	return true;
}
@SuppressWarnings("deprecation")
private void startTW(L2PcInstance activeChar)
{
	if (Config.TW_ALL_TOWNS)
	{
		TownManager.getInstance().getTown(1).setParameter("isPeaceZone", "false");
		TownManager.getInstance().getTown(2).setParameter("isPeaceZone", "false");
		TownManager.getInstance().getTown(3).setParameter("isPeaceZone", "false");
		TownManager.getInstance().getTown(4).setParameter("isPeaceZone", "false");
		TownManager.getInstance().getTown(5).setParameter("isPeaceZone", "false");
		TownManager.getInstance().getTown(6).setParameter("isPeaceZone", "false");
		TownManager.getInstance().getTown(7).setParameter("isPeaceZone", "false");
		TownManager.getInstance().getTown(8).setParameter("isPeaceZone", "false");
		TownManager.getInstance().getTown(9).setParameter("isPeaceZone", "false");
		TownManager.getInstance().getTown(10).setParameter("isPeaceZone", "false");
		TownManager.getInstance().getTown(11).setParameter("isPeaceZone", "false");
		TownManager.getInstance().getTown(12).setParameter("isPeaceZone", "false");
		TownManager.getInstance().getTown(13).setParameter("isPeaceZone", "false");
		TownManager.getInstance().getTown(14).setParameter("isPeaceZone", "false");
		TownManager.getInstance().getTown(15).setParameter("isPeaceZone", "false");
		TownManager.getInstance().getTown(16).setParameter("isPeaceZone", "false");
		TownManager.getInstance().getTown(17).setParameter("isPeaceZone", "false");
		TownManager.getInstance().getTown(19).setParameter("isPeaceZone", "false");
	}
	if (!Config.TW_ALL_TOWNS && Config.TW_TOWN_ID != 18 && Config.TW_TOWN_ID != 21 && Config.TW_TOWN_ID != 22)
	TownManager.getInstance().getTown(Config.TW_TOWN_ID).setParameter("isPeaceZone", "false");
	Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers();
	{
           int x,y,z;
           L2TownZone Town;
           byte zonaPaz = 1;

         	for (L2PcInstance onlinePlayer : pls)
              if (onlinePlayer.isOnline() == 1 )
                 {
                 	x = onlinePlayer.getX();
                 	y = onlinePlayer.getY();
                 	z = onlinePlayer.getZ();

                 	Town = TownManager.getInstance().getTown(x, y, z);
                 	if (Town != null)
                 	{
                 		if(Town.getTownId() == Config.TW_TOWN_ID && !Config.TW_ALL_TOWNS)
                 		{
                 			onlinePlayer.setInsideZone(zonaPaz, false);
                         		onlinePlayer.revalidateZone(true);
                 		}
                 		else if (Config.TW_ALL_TOWNS)
                 		{
                 			onlinePlayer.setInsideZone(zonaPaz, false);
                         		onlinePlayer.revalidateZone(true);
                 		}
                 	}
				onlinePlayer.setInTw();
                  }	
	}

	if (Config.TW_ALL_TOWNS)
	{
		Announcements.getInstance().announceToAll("All towns have been set war zone by " + activeChar.getName() + ".");
	}
	if (!Config.TW_ALL_TOWNS) 
	{
		Announcements.getInstance().announceToAll(TownManager.getInstance().getTown(Config.TW_TOWN_ID).getName() + " has been set war zone by " + activeChar.getName() + ".");
	}
}


@SuppressWarnings("deprecation")
private void endTW(L2PcInstance activeChar)
{
	if (Config.TW_ALL_TOWNS)
	{
		TownManager.getInstance().getTown(1).setParameter("isPeaceZone", "true");
		TownManager.getInstance().getTown(2).setParameter("isPeaceZone", "true");
		TownManager.getInstance().getTown(3).setParameter("isPeaceZone", "true");
		TownManager.getInstance().getTown(4).setParameter("isPeaceZone", "true");
		TownManager.getInstance().getTown(5).setParameter("isPeaceZone", "true");
		TownManager.getInstance().getTown(6).setParameter("isPeaceZone", "true");
		TownManager.getInstance().getTown(7).setParameter("isPeaceZone", "true");
		TownManager.getInstance().getTown(8).setParameter("isPeaceZone", "true");
		TownManager.getInstance().getTown(9).setParameter("isPeaceZone", "true");
		TownManager.getInstance().getTown(10).setParameter("isPeaceZone", "true");
		TownManager.getInstance().getTown(11).setParameter("isPeaceZone", "true");
		TownManager.getInstance().getTown(12).setParameter("isPeaceZone", "true");
		TownManager.getInstance().getTown(13).setParameter("isPeaceZone", "true");
		TownManager.getInstance().getTown(14).setParameter("isPeaceZone", "true");
		TownManager.getInstance().getTown(15).setParameter("isPeaceZone", "true");
		TownManager.getInstance().getTown(16).setParameter("isPeaceZone", "true");
		TownManager.getInstance().getTown(17).setParameter("isPeaceZone", "true");
		TownManager.getInstance().getTown(19).setParameter("isPeaceZone", "true");
		TownManager.getInstance().getTown(20).setParameter("isPeaceZone", "true");
	}
	if (!Config.TW_ALL_TOWNS && Config.TW_TOWN_ID != 18 && Config.TW_TOWN_ID != 21 && Config.TW_TOWN_ID != 22)
	TownManager.getInstance().getTown(Config.TW_TOWN_ID).setParameter("isPeaceZone", "true");
	Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers();
	{
            int xx,yy,zz;
            L2TownZone Town;
            byte zonaPaz = 1;

           for (L2PcInstance onlinePlayer : pls)
             if (onlinePlayer.isOnline() == 1 )
                 {
                 	xx = onlinePlayer.getX();
                 	yy = onlinePlayer.getY();
                 	zz = onlinePlayer.getZ();

                 	Town = TownManager.getInstance().getTown(xx,yy,zz);
                 	if (Town != null)
                 	{
                 		if(Town.getTownId() == Config.TW_TOWN_ID && !Config.TW_ALL_TOWNS)
                 		{
                 			onlinePlayer.setInsideZone(zonaPaz, true);
                         		onlinePlayer.revalidateZone(true);
                 		}
                 		else if (Config.TW_ALL_TOWNS)
                 		{
                 			onlinePlayer.setInsideZone(zonaPaz, true);
                         		onlinePlayer.revalidateZone(true);
                 		}
                 	}
				onlinePlayer.removeTw();
                 }
           }
	if (Config.TW_ALL_TOWNS)
	{
		Announcements.getInstance().announceToAll("All towns have been set back to normal by " + activeChar.getName() + ".");	
	}
	if (!Config.TW_ALL_TOWNS)
	{
		Announcements.getInstance().announceToAll(TownManager.getInstance().getTown(Config.TW_TOWN_ID).getName() + " has been set back to normal by " + activeChar.getName() + ".");
	}
}

public String[] getAdminCommandList()
{
	return ADMIN_COMMANDS;
}
}

Index: java.net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.java
===================================================================

/** WAR **/
 public boolean	_inTownWar	= false; 

 public void setInTw() 
{ 
	_inTownWar = true; 
	_twEvent.addPlayer(getObjectId()); 
} 
public void removeTw() 
{ 
	_inTownWar = false; 
	_twEvent.removePlayer(getObjectId()); 
} 

Index: java.net.sf.l2j.gameserver.model.entity.events.TownWar.java
===================================================================
/*
* 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.entity.events;

import javolution.util.FastList;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.instancemanager.TownManager;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.zone.type.L2TownZone;

/**
* @author VaGo
* @Rewritten by KidZor
*/
public class TownWar
{
private Log _log = LogFactory.getLog(TownWar.class);
public static TownWar _instance;
public FastList<Integer> _players;

public static TownWar getInstance()
{
	return _instance;
}

public boolean DisableGk(L2PcInstance activeChar)
{
	 if(Config.TW_DISABLE_GK)
	 {
		 int x1,y1,z1;
		 x1 = activeChar.getX();
		 y1 = activeChar.getY();
		 z1 = activeChar.getZ();
		 L2TownZone Town;
		 Town = TownManager.getInstance().getTown(x1,y1,z1);
		 if (Town != null && activeChar.isinTownWar)
		 {
			 if (Town.getTownId() == Config.TW_TOWN_ID && !Config.TW_ALL_TOWNS)
			 {
				 if(Config.DEBUG)
					 _log.info("Town War: GK Blocked in Town Id: "+Config.TW_TOWN_ID+"!");

				 return false;
			 }
			 else if (Config.TW_ALL_TOWNS)
			 {
				 if(Config.DEBUG)
					 _log.info("Town War: GK Blocked in All Towns!");

				 return false;
			 }
		 }
	 }
	return true;
}
public boolean doDie(L2PcInstance activeChar)
{
	if (Config.TW_RESS_ON_DIE)
	{
		int x1,y1,z1;
		x1 = activeChar.getX();
		y1 = activeChar.getY();
		z1 = activeChar.getZ();
		L2TownZone Town;
		Town = TownManager.getInstance().getTown(x1,y1,z1);
		if (Town != null && activeChar.isinTownWar)
		{
			if (Town.getTownId() == Config.TW_TOWN_ID && !Config.TW_ALL_TOWNS)
			{
				activeChar.reviveRequest(activeChar, null, false);
			}
			else if (Config.TW_ALL_TOWNS)
			{
				activeChar.reviveRequest(activeChar, null, false);
			}
		}
		return true;
	}
	return false;
}
public void reward(L2PcInstance activeChar)
{
     	int x,y,z;
   	x = activeChar.getX();
     	y = activeChar.getY();
     	z = activeChar.getZ();
       L2TownZone Town;
     	Town = TownManager.getInstance().getTown(x,y,z);

     	if (Town != null && activeChar.isinTownWar)
     	{
     		if (Town.getTownId() == Config.TW_TOWN_ID && !Config.TW_ALL_TOWNS)
     		{
     			activeChar.addItem("TownWar", Config.TW_ITEM_ID, Config.TW_ITEM_AMOUNT, activeChar, true);
     			activeChar.sendMessage("You received your prize for a town war kill!");
     		}
     		else if (Config.TW_ALL_TOWNS)
     		{
     			activeChar.addItem("TownWar", Config.TW_ITEM_ID, Config.TW_ITEM_AMOUNT, activeChar, true);
     			activeChar.sendMessage("You received your prize for a town war kill!");
     		}
     	}
}
/**
 * @return _players
 */
public int getPlayersCount() {
	return _players.size();
}

/**
 * @param Adds the Players Object Id
 */
public void addPlayer(int playerId) {
	this._players.add(playerId);
}
/**
 * @param Adds the Players Object Id
 */
public void removePlayer(int playerId) {
	this._players.remove(playerId);
}
}

 

I don't have recived any error

 
Buildfile: F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build.xml
clean:
  [delete] Deleting directory F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build
init:
   [mkdir] Created dir: F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build
   [mkdir] Created dir: F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\classes
   [mkdir] Created dir: F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist
   [mkdir] Created dir: F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\login
   [mkdir] Created dir: F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\gameserver
version:
    [exec] Execute failed: java.io.IOException: Cannot run program "svnversion": CreateProcess error=2, The system cannot find the file specified
compile:
   [javac] Compiling 1248 source files to F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\classes
   [javac] Note: F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\java\net\sf\l2j\gameserver\GeoEngine.java uses or overrides a deprecated API.
   [javac] Note: Recompile with -Xlint:deprecation for details.
jar:
     [jar] Building jar: F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\l2jserver.jar
    [copy] Copying 1 file to F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\login
    [copy] Copying 1 file to F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\gameserver
dist:
    [copy] Copying 3 files to F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\login
    [copy] Copying 2 files to F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\gameserver
    [copy] Copying 4 files to F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\login
    [copy] Copying 8 files to F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\gameserver
    [copy] Copying 2 files to F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist
    [copy] Copying 6 files to F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist
    [copy] Copying 7 files to F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\login
    [copy] Copying 3 files to F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\gameserver
   [mkdir] Created dir: F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\gameserver\log
   [mkdir] Created dir: F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\login\log
   [mkdir] Created dir: F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\gameserver\hibernate-mapping
   [mkdir] Created dir: F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\login\config
    [copy] Copying 19 files to F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\gameserver\config
    [copy] Copying 2 files to F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\login\config
   [mkdir] Created dir: F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\gameserver\data
    [copy] Copying 1 file to F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\gameserver\data
   [mkdir] Created dir: F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\gameserver\data\geodata
    [copy] Copying 1 file to F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\gameserver\data\geodata
   [mkdir] Created dir: F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\gameserver\data\pathnode
    [copy] Copying 1 file to F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\dist\gameserver\data\pathnode
     [zip] Building zip: F:\Lineage2\Lineage2\L2Java\L2_GameServer_It\build\l2j-server.zip
BUILD SUCCESSFUL
Total time: 25 seconds

 

When I want to start the event I recived this error.

untitled-7.png

 

 

I don;t know what happens... simply do not know

2 answers to this question

Recommended Posts

  • 0
Posted

Dude honestly, read the error.

Besides that is the ugliest and dumbest code I've ever seen ^^

+1 to that..

 

but u can look int that patch and create 2 loops that sets the zone status and makes the player in war zone + sending the compas info packet... quite easy... check l2pcinstance -> revalidatezone(boolean) method ^^

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

    • Let me give you something for inspiration and get you addicted to bot AI     And a siege 😛    
    • 🚀 Telonyx Contest Platform Telegram Native Giveaway & Contest System for Modern Communities 💎 White-Label • Self-Hosted • Telegram Mini App • Monetization Ready 🧠 Product Overview Telonyx Contest Platform is a production-ready Telegram Mini App system designed for running modern contests, giveaways and engagement campaigns directly inside Telegram. It replaces outdated bot-based mechanics with a fully interactive application experience — no commands, no chat spam, no external websites. Users interact with a clean, fast and mobile-first interface inside Telegram. ⚡ Core Experience Participants can: • 🚀 instantly join contests inside Telegram Mini App • 🎁 view prizes and participation rules • 📊 track real-time contest status • ✅ verify task completion automatically • 🏆 receive winner results and notifications • 💰 participate in free or paid campaigns Everything is fully native to Telegram. 🧩 Key Platform Capabilities 🎯 Contest Engine • advanced contest creation system • multiple winners and reward tiers • scheduled launches and auto-finish logic • contest duplication and templates • real-time participant tracking • flexible rule configuration 📱 Mini App Interface • modern Telegram Mini App UX • mobile-first optimized layout • fast loading and smooth transitions • participant counter & live status • prize showcase system • one-click participation flow 🔎 Task Verification System Automated validation of participation rules: • Telegram channel subscriptions • sponsor channel requirements • multi-channel verification logic • YouTube subscription checks • TikTok task validation ❌ Zero manual moderation required 🛡 Anti-Fraud & Security Layer • duplicate entry prevention • bot detection system • CAPTCHA integration • rule enforcement engine • participation integrity checks 🏆 Automated Winner Selection • fully automated draw system • transparent winner selection logic • instant result publishing • winner notification system • historical archive of all contests 💎 Telegram Stars Monetization • optional paid participation via Telegram Stars • native Telegram checkout integration • flexible entry pricing per campaign • direct monetization of engagement traffic 🌍 Multi-Language Architecture Built with localization in mind. Supported out of the box: • 🇬🇧 English • 🇷🇺 Russian • 🇺🇦 Ukrainian • 🇹🇷 Turkish • 🇪🇸 Spanish • 🇵🇹 Portuguese • ➕ extensible language system for custom localization All UI layers, notifications and admin panel can be fully translated per deployment. 🎯 Ideal Use Cases 🎮 Gaming Projects / Lineage II Servers • pre-launch hype campaigns • donation reward giveaways • VIP / premium account distribution • promo code campaigns • server opening events 🎥 Streamers & Creators • subscriber engagement campaigns • live stream giveaways • audience growth funnels • partnership promotions 🌐 Communities & Brands • automated engagement systems • viral marketing campaigns • audience retention mechanics 🏗 Architecture & Deployment • Telegram Mini App frontend • FastAPI backend architecture • PostgreSQL database layer • Redis caching system • Docker-based deployment • WebSocket real-time updates • REST API integration layer 📦 Self-hosted deployment — full control over infrastructure and data 🎨 White-Label & Customization Each installation can be fully customized: • complete UI/UX rebranding • project-specific visual identity • custom engagement mechanics • referral & viral systems • loyalty & progression systems • seasonal campaign modules • custom API integrations   💡 Why This Platform Traditional contest bots are limited, noisy and inefficient. Telonyx Contest Platform is a modern engagement layer for Telegram ecosystems — combining UX, automation and monetization in one system. ✔ Higher participation rate ✔ Lower friction ✔ Direct revenue via Telegram Stars ✔ Full control via self-hosted deployment 💼 Commercial Model • Single License (Self-Hosted Deployment) • White-Label Branding Rights • Optional Custom Development • Installation & Setup Service 📩 Contact For demo access, licensing details or custom implementation: @se1dhe @telonyx_dev  
    • https://discord.gg/acvqx9rbhy Added intelligent agent that reads scripts and config and provides infos to players regarding gameplay Like where to farm/max enchants etc etc   Added auto translate to En/ES/BR htmls without api
    • The core strength of Novproxy Perfectly unlock overseas AI large models: 100% pure residential IP, perfectly bypassing various strict risk controls such as ChatGPT, Claude, Midjourney, etc. This is an essential tool for parents to train AI on weekends and during work! Available in 195+ countries/regions worldwide: covering an extremely wide range. Whether it's setting up accounts for cross-border e-commerce, conducting overseas web crawling, or conducting network gray-scale tests, it can all be handled easily. Ultra-fast concurrency: Real residential network, stable and non-blocking, high-concurrency business can also run at full capacity.
    • Thanks for your comment. That's what I'm working on, but it takes a lot of planning and getting it to work. I hope I can pull it off. Right now, I'm working on the Party feature, and I'm also working on AI conversations focused solely on Lineage, meaning the AI will only talk about the game. We'll see how it goes. The idea is to develop the system so thoroughly that there are sieges and the Phantom Players are undetectable, making them seem as realistic as possible. I'm sorry, but I don't see it as a useful modification. I'm also doing modifications on request, so if you're interested, you can send me a PM.
  • 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..