Jump to content

Recommended Posts

Posted

If you don't know how to compile just don't replay  :D or read the guide of A-Style.

 

This are for l2emu also you can change the imports for another pack.  ;)

 

I only modify the code from l2jfree to l2emu...!!

 

The command for Tvt is .join .leave  Some htlm error's already fixed ... player's in jail ...player's in Olympiad etc..they have some error's wen i compile and fixed !!

 

 

There You go;

 

TVT

/*
* 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.l2emu.gameserver.handler.voicedcommandhandlers;

import com.l2emu.gameserver.handler.IVoicedCommandHandler;
import com.l2emu.gameserver.instancemanager.ZoneManager;
import com.l2emu.gameserver.model.actor.instance.L2PcInstance;
import com.l2emu.gameserver.model.entity.events.TvT;
import com.l2emu.gameserver.model.zone.L2Zone;
import com.l2emu.gameserver.network.serverpackets.NpcHtmlMessage;

public class TvTCmd implements IVoicedCommandHandler
{
private static final String[] VOICED_COMMANDS = { "join", "leave", "tvtinfo" };

public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
{
	if (command.startsWith("join"))
	{
		JoinTvT(activeChar);
	}
	else if(command.startsWith("leave"))
	{
		LeaveTvT(activeChar);
	}

	else if(command.startsWith("tvtinfo"))
	{
		TvTinfo(activeChar);
	}

	return true;
}

public String[] getVoicedCommandList()
{
	return VOICED_COMMANDS;
}

public boolean JoinTvT (L2PcInstance activeChar)
{
	if ( activeChar == null)
	{
		return false;
	}
	NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage( 0 );


	if (!TvT._joining)
	{
		npcHtmlMessage.setHtml("<html><body>There is no TvT Event in progress.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else if (TvT._joining && activeChar._inEventTvT)
	{
		npcHtmlMessage.setHtml("<html><body>You are already registered.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else if ( activeChar.isCursedWeaponEquipped())
	{
		npcHtmlMessage.setHtml("<html><body>You are not allowed to participate to the Event<br>Because you are holding a Cursed Weapon.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else if ( activeChar.isInOlympiadMode())
	{
		npcHtmlMessage.setHtml("<html><body>You are not allowed to participate to the Event<br>Because you are in Olympiad.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else if ( activeChar.isInJail() || activeChar.isInsideZone(L2Zone.FLAG_JAIL)) //check if player is in jail
	{
		npcHtmlMessage.setHtml("<html><body>You are not allowed to participate to the Event<br>Because you are in Jail.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else if (activeChar.getLevel() < TvT._minlvl)
	{
		npcHtmlMessage.setHtml("<html><body>You are not allowed to participate to the Event<br>Because you level is too low.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else if (activeChar.getKarma() > 0)
	{
		npcHtmlMessage.setHtml("<html><body>You are not allowed to participate to the Event<br>Because you have Karma.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else if (TvT._teleport || TvT._started)
	{
		npcHtmlMessage.setHtml("<html><body>TvT Event registration period is over.<br>You can't register now.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else
	{
		npcHtmlMessage.setHtml("<html><body>Your participation in the TvT event has been approved.<br>Prepare to kill your enemies.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		TvT.addPlayer(activeChar,"");
		return false;
	}
}

public boolean LeaveTvT (L2PcInstance activeChar)
{
	if ( activeChar == null)
	{
		return false;
	}

	NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage( 0 );

	if (!TvT._joining)
	{
		npcHtmlMessage.setHtml("<html><body>There is no TvT Event in progress.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else if ((TvT._teleport || TvT._started) && activeChar._inEventTvT)
	{
		npcHtmlMessage.setHtml("<html><body>You can not leave now because TvT event has started.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else if (TvT._joining && !activeChar._inEventTvT)
	{
		npcHtmlMessage.setHtml("<html><body>You aren't registered in the TvT Event.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else
	{
		npcHtmlMessage.setHtml("<html><body>Your participation in the TvT event has been removed.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		TvT.removePlayer(activeChar);
		return true;
	}
}
public boolean TvTinfo (L2PcInstance activeChar)
{
	if ( activeChar == null)
	{
		return false;
	}

	NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage( 0 );

	if (!TvT._joining)
	{
		npcHtmlMessage.setHtml("<html><body>There is no TvT Event in progress.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else if (TvT._teleport || TvT._started)
	{
		npcHtmlMessage.setHtml("<html><body>I can't provide you this info.<br>Command available only in joining period.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else
	{
		if (TvT._playersShuffle.size() == 1)
		{
			npcHtmlMessage.setHtml("<html><body>There is " + TvT._playersShuffle.size() + " player participating in this event.</body></html>");
			activeChar.sendPacket( npcHtmlMessage );
		}
		else
		{
			npcHtmlMessage.setHtml("<html><body>There are " + TvT._playersShuffle.size() + " players participating in this event.</body></html>");
			activeChar.sendPacket( npcHtmlMessage );
		}
		return true;
	}
}
}

 

CTF

 

/*
* 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.l2emu.gameserver.handler.voicedcommandhandlers;

import com.l2emu.gameserver.handler.IVoicedCommandHandler;
import com.l2emu.gameserver.instancemanager.ZoneManager;
import com.l2emu.gameserver.model.actor.instance.L2PcInstance;
import com.l2emu.gameserver.model.entity.events.CTF;
import com.l2emu.gameserver.model.zone.L2Zone;
import com.l2emu.gameserver.network.serverpackets.NpcHtmlMessage;

public class CTFCmd implements IVoicedCommandHandler
{
private static final String[] VOICED_COMMANDS = { "ctfjoin", "ctfleave", "ctfinfo" };

public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
{
	if (command.startsWith("ctfjoin"))
	{
		JoinCTF(activeChar);
	}
	else if(command.startsWith("ctfleave"))
	{
		LeaveCTF(activeChar);
	}

	else if(command.startsWith("ctfinfo"))
	{
		CTFinfo(activeChar);
	}

	return true;
}

public String[] getVoicedCommandList()
{
	return VOICED_COMMANDS;
}

public boolean JoinCTF (L2PcInstance activeChar)
{
	if ( activeChar == null)
	{
		return false;
	}
	NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage( 0 );


	if (!CTF._joining)
	{
		npcHtmlMessage.setHtml("<html><body>There is no CTF Event in progress.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else if (CTF._joining && activeChar._inEventCTF)
	{
		npcHtmlMessage.setHtml("<html><body>You are already registered.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else if ( activeChar.isCursedWeaponEquipped())
	{
		npcHtmlMessage.setHtml("<html><body>You are not allowed to participate to the Event<br>Because you are holding a Cursed Weapon.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else if ( activeChar.isInOlympiadMode())
	{
		npcHtmlMessage.setHtml("<html><body>You are not allowed to participate to the Event<br>Because you are in Olympiad.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else if ( activeChar.isInJail() || activeChar.isInsideZone(L2Zone.FLAG_JAIL)) //check if player is in jail
	{
		npcHtmlMessage.setHtml("<html><body>You are not allowed to participate to the Event<br>Because you are in Jail.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else if (activeChar.getLevel() < CTF._minlvl)
	{
		npcHtmlMessage.setHtml("<html><body>You are not allowed to participate to the Event<br>Because you level is too low.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else if (activeChar.getKarma() > 0)
	{
		npcHtmlMessage.setHtml("<html><body>You are not allowed to participate to the Event<br>Because you have Karma.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else if (CTF._teleport || CTF._started)
	{
		npcHtmlMessage.setHtml("<html><body>CTF Event registration period is over.<br>You can't register now.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else
	{
		npcHtmlMessage.setHtml("<html><body>Your participation in the CTF event has been approved.<br>Prepare to kill your enemies.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		CTF.addPlayer(activeChar,"");
		return false;
	}
}

public boolean LeaveCTF (L2PcInstance activeChar)
{
	if ( activeChar == null)
	{
		return false;
	}

	NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage( 0 );

	if (!CTF._joining)
	{
		npcHtmlMessage.setHtml("<html><body>There is no CTF Event in progress.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else if ((CTF._teleport || CTF._started) && activeChar._inEventCTF)
	{
		npcHtmlMessage.setHtml("<html><body>You can not leave now because CTF event has started.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else if (CTF._joining && !activeChar._inEventCTF)
	{
		npcHtmlMessage.setHtml("<html><body>You aren't registered in the CTF Event.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else
	{
		npcHtmlMessage.setHtml("<html><body>Your participation in the CTF event has been removed.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		CTF.removePlayer(activeChar);
		return true;
	}
}
public boolean CTFinfo (L2PcInstance activeChar)
{
	if ( activeChar == null)
	{
		return false;
	}

	NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage( 0 );

	if (!CTF._joining)
	{
		npcHtmlMessage.setHtml("<html><body>There is no CTF Event in progress.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else if (CTF._teleport || CTF._started)
	{
		npcHtmlMessage.setHtml("<html><body>I can't provide you this info.<br>Command available only in joining period.</body></html>");
		activeChar.sendPacket( npcHtmlMessage );
		return false;
	}
	else
	{
		if (CTF._playersShuffle.size() == 1)
		{
			npcHtmlMessage.setHtml("<html><body>There is " + CTF._playersShuffle.size() + " player participating in this event.</body></html>");
			activeChar.sendPacket( npcHtmlMessage );
		}
		else
		{
			npcHtmlMessage.setHtml("<html><body>There are " + CTF._playersShuffle.size() + " players participating in this event.</body></html>");
			activeChar.sendPacket( npcHtmlMessage );
		}
		return true;
	}
}
}

 

 

This Code made at l2jfree.

 

//done

 

Edit: Link http://www.4shared.com/file/79609345/73b6edfa/Voice_Command_tvtjoin_ctfjoin.html Njoy!

 

 

//End

Posted

Very Well ~Cobra~ but as u say

this made to l2jfree..

u made it or the l2jfree?

Ofc i made it by self ..you can use it on l2emu just change the imports :) Btw try it on l2j only the tvt command bcauz l2j don't have ctf.

 

Just is more easy to make java thinks at l2jfree and ofc at l2j ..l2emu is a little difficult .... :)

Posted

Ofc i made it by self ..you can use it on l2emu just change the imports :) Btw try it on l2j only the tvt command bcauz l2j don't have ctf.

 

Just is more easy to make java thinks at l2jfree and ofc at l2j ..l2emu is a little difficult .... :)

 

yeap! but are 1,2 ctf enginers! so ...he  must apply the patch!

 

l2jfree/l2emu use a FBIAgend Events Enginers with some fixes!

Posted

 

This Code made at l2jfree.

 

 

r u sure u made it yourself?

 

i see the same thing here http://www.l2jfree.com/index.php?topic=4790.msg25524#msg25524

 

good job anyway.

 

And yes i mode it ..lemme tell you something you find somewhere a ready tool ,java code,npc...???

 

I mode it i compile a 3 pack's to see if this work and then i post it.

 

//epic fail ;) 

Posted

Eh....?

 

And btw the patch included in the link i sent is pretty much the same.

 

Anyway i don't want to start a flame or sth, so i just stop.

 

 

 

Ofc i made it by self .... lol ....I take the base code and i modify them ....! Example ..xD..if you take a l2jfree pack and Make a pre pack...what

 

that called?

 

Anyway your opinion...:)

 

 

Posted

Ofc i made it by self .... lol ....I take the base code and i modify them ....! Example ..xD..if you take a l2jfree pack and Make a pre pack...what

 

that called?

 

Anyway your opinion...:)

 

 

if you modify this codes...

so the codes isn't you...

So you must tell us why you modifed they have any error or smt like this?

why u modified...

Fix The 1st post!

Posted

if you modify this codes...

so the codes isn't you...

So you must tell us why you modifed they have any error or smt like this?

why u modified...

Fix The 1st post!

@strike:Yes for my pack's they have some error's ....check the first post.

 

Have some1  try it....?

 

p.s:I hate wen ppl are off topic .... if you have problem with post you can use >>pm<< and solve it...no reason to spam the board. :)

Posted

@strike:Yes for my pack's they have some error's ....check the first post.

 

Have some1 try it....?

 

p.s:I hate wen ppl are off topic .... if you have problem with post you can use >>pm<< and solve it...no reason to spam the board. :)

when u compile with l2j free post i get no errors..

and the codes work perfectly 100%

as you say me u use L2J Emu so if you make it for l2j emu you must fix the 1st post

and edit your title...

-Strike

Posted

as you say me u use L2J Emu so if you make it for l2j emu you must fix the 1st post

and edit your title...

-Strike

 

Yeap i'm using emu pack.

 

First post updated ...!! My Tittle is fine :)

Posted

Yeap i'm using emu pack.

 

First post updated ...!! My Tittle is fine :)

you must edit and Titlte [share]Voice command TvT Ctf L2Emu

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

    • I created a system of FAKES to improve my GeoEngine, but I'm having problems with blocks. I've tried everything to fix it, but a block going from the inside out bugs the player's movement and freezes them. However, the reverse doesn't cause this bug. If I'm outside and click inside, the path is traced normally, but if it's reversed, it bugs at the fence. I've created several debugs and read all kinds of GeoEngine versions, but I haven't had any success. Can someone give me some insight into graphical data?   When fakes spawn, they are given possible routes, but they don't follow them. If there's a target, instead of following the correctly drawn path, it simply uses a straight line.  
    • The legendary L2Elixir you remember from 2008 is officially back — remastered, refreshed, and reborn! Our x3 Interlude server launched on 28 November, and the community is growing every single day.   🔥 Fresh start 🔥 Active players joining daily 🔥 Long-term project — Licensed for over 5 years from PlayINERA. 🔥 True 2008 nostalgia with modern stability & polish   If you were part of the original Elixir family, this is your chance to relive the magic. If you’re new — welcome to a classic Lineage II experience built with passion, not profit.   Join the battles. Join the nostalgia. Join L2Elixir Reborn. Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs
    • still available?  java version? client  salvation?  accept smarguart¡?
    • 🎉 L2NeverPain StuckSub - GRAND OPENING 12 December 2025🎉 After beta, testing, mistakes, laughs and a lot of PvP, the moment has finally come. L2NeverPain StuckSub is officially opening its gates on 12 December 2025.   ⚔️What to expect: ✦Main Class +2 Stuck Sub system ✦Balanced PvP & custom party farm areas ✦Custom events, bosses and strong rewards ✦Competitive clan scene with castle rewards   📌Until the opening: ✦Create your clans and register them in the Clan-Register channel ✦Invite your friends / old parties / CPs ✦Stay tuned for more information (rates, events, siege times, etc.)   Get your setups ready, prepare your macros and your Discord/voice. On 12 December 2025 20:00 GMT+2, we write the first chapter of NeverPain together. 🔥 https://l2neverpain.com/ https://discord.gg/kNP3UXgkmN
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock