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

    • The big systems, such as the Olympiad and sieges, are done. Now it’s time to tackle the smaller stuff.   Fishing, pets, striders, lottery, derby, private shops, and macros are ready.   P.S. If anyone has experience launching projects and would like to try launching a project using my client/server, feel free to message me on Telegram and we can discuss it: @artem_lemeshev
    • That's definitely not the reason why they perform wipes.
    • You are right, and most of them meant it when they said it.   Servers wipe because it is the only tool they have left. Something breaks the economy, a duplication bug or an exploited quest or a bad multisell, and the owner cannot tell which items came out of it. When you cannot find the bad items, the only way to clean the world is to delete the world. That is not dishonesty, it is running out of options.   So the answer is not to promise harder. It is to not need the promise: Backups run daily into three places: this machine, an S3 bucket whose key can write and cannot delete, and a computer that is not the server at all.   A restore test runs weekly and actually restores, into a scratch database, comparing every table against production. I ran it before writing this reply: 119 tables, 0 missing, 0 empty, characters back with their coordinates. Binary logging is on with sync_binlog=1 and fourteen days of retention. Every change is on record, so an item can be traced back to what produced it and removed by itself.   That is what makes "fix the bug and remove what it produced" a real option instead of a slogan. What I will not promise is that the server runs forever. If it ever closes, that is an ending, not a wipe, and you would hear it from me first.   Six months is the only proof that counts. Bookmark the thread.
    • I think it happened when I tried adding an ad banner—it turned out to be an ad injector that scattered ads all over the site and cluttered it up. I’ve removed it now; you either visited right when it was active, or it was just leftover residue. It’s gone now (try Ctrl + Shift + R). I’m fixing the responsiveness right now!
    • A brand-new High Five x5 server built for players, not wallets. Only a week old — the perfect time to start. And this Friday we're running a Double XP Comeback Weekend. 🎉 DOUBLE XP COMEBACK WEEKEND — Friday 21 August, 14:00 → Sunday • x2 XP & SP · x2 Adena & drops · FREE full buffs all weekend 📊 RATES • XP / SP: x5 · Adena & drops: boosted · Chronicle: High Five (L2jMobius, retail-based) ✨ QUALITY OF LIFE • Auto-loot for everyone (adena & items straight to inventory; herbs on ground) • Free buffer in the Community Board (Alt+B) • Offline shops • Champion monsters — passive, extra rewards, drop event medals • Premium earned in-game via medals: +20% XP/SP, gold nickname, up to 6 windows • Multibox: 2 windows free, 6 with Premium • Vote rewards (HopZone, TopZone) 🌐 WEBSITE & COMMUNITY • Full web panel, auction house, referral rewards, 2FA, support tickets • Custom auto-updating launcher • Hands-on GM — real-time bug fixes & support • No RMT, no pay-to-win 🔗 Website: https://nolifer.eu · Discord: https://discord.gg/Z9p4pmXFYx
  • 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..