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 :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Posts

    • @Mobius I only asked you one question! All your previous versions are sh*t and the last version is the best ? Because this is what you said.
    • Close that LOLserver. And change name to L2Wipe&Money.
    • Open Beta January 17th & 21:00 UTC +2 Launch Date January 24th & 21:00 UTC +2 Click Here to Explore Vanilla Gracia Final Low-Rate Server. Join our Discord Community     Following the success of our Vanilla project, we decided to launch it again as Last PlayINERA’s Server! Core Settings *Vanilla will have Strict Botting & Client Limitation Rules and Chronicle Progression from Gracia Final to Gracia Epilogue to H5 in Long term! XP: x4 SP: x4 Adena: x2 Drop: x2 Spoil: x3 Manor: x0.4 (60% reduction) - Festive sweeper enabled! Seal Stones: x2 Herbs: x1 Safe Enchant: +3 Maximum Enchant: Retail Enchant Rate: Dynamic General Settings Auto-loot Can be toggled Buffs Adventurer Guide buffs are free, retail level limit removed. Buff Slots: 20 (+ 4) Summon buffs will remain on re-summoning & on death while Noblesse blessing is applied! (Olympiad excluded) Pet buffs will be saved on relog but not during summon/unsummon. Event Buffer [NEW] Event Buffer is enabled and will spawn randomly between 18:00 ~ 23:00 in Giran for 10 minutes, it will apply Farm Only buffs that are cancelled in PvP, Siege / Epic PvP zones & while in a chaotic state! Duration: 1-hour! Territory Wars every two weeks on Saturday. Castle sieges every two weeks on Sunday Class Transfer 1st Class Transfer: Available for purchase with either Adena or iCoin 2nd Class Transfer: Available for purchase with either Adena or iCoin 3rd Class Transfer: Quest or iCoin (the 3rd class transfer will become available for purchase with iCoin as soon as someone has entered the Hall of Fame for completing the 3rd class transfer quest for the class in question) Hellbound Hellbound Lv. 0-6: ATOD x1 Hellbound Lv. 7-12: ATOD x2 Tiat & Ekimus will become available at Stage 12 Hellbound can only be leveled up by killing monsters. No quests or raids are needed To open Hellbound, a party must kill Baylor in the Crystal Caverns The following items are now tradable: Ancient Tome of the Demon  Hidden First Page  Hidden Second Page  Demon Contract Fragment INERA Hub Library Clan Recruitment System Options Services Milestone Rewards Earn rewards for reaching various daily/one-time goals Client Limit: 1 (+1 with Standard Premium) Shift + Click Information on Monsters SP are required to learn new skills Offline shops Lasts for 15 days Olympiad Olympiad period: 1st and 15th day of the month (14th & Last day of month is the last day) 3 Vs. 3 match disabled Class-based matches will be held over the weekends One registration per HWID (PC) Minimum participants: 9 Party Matching System Earn bonuses for finding a group via the Party Matching system Vote Reward System World Chat No limits for first day! Available from level 20 Raid Bosses Epic Raid Boss zones will turn into a PvP zone while the Epic Raid Boss is alive ( + means Random) Server will start with all grand raids dead. Normal Raids: 12h (+6 hours random). Subclass raids, respawn 12h (+6 hours random). Noblesse Barakiel 12h (+6 hours random, PvP zone). Anakim & Lilith are static 24 hours respawn. Queen Ant: 24 hours (+2 hours random). Core: 40 hours (+2 hours random). Orfen: 32 hours (+2 hours random). Antharas Respawn: 8 Days. Randomly spawns at 19:00 ~ 21:00 Boosted to level 83 on Hellbound stage 7. Valakas Respawn: 10 Days. Randomly spawns at 19:00 ~ 21:00 Baium Respawn: 5 Days. Randomly spawns at 21:00 ~ 23:00 Boosted to level 83 on Hellbound stage 7. Frintezza Respawn: 2 Days. Randomly spawns at 21:00 ~ 23:00 Instanced Zaken Zaken (Day): Monday, Wednesday, Friday at 6:30. Zaken (Day): 9 players, LvL 55-65, 1hr max. Zaken (Night): Wednesday at 6:30 Zaken (Night): 18-45 players, LvL 55-65, 6hr max. Tiat: Saturday at 6:30, 18-36 players, 2 hrs max. Boosted to level 85. Ekimus: 24h at 6:30, 18-27 players, 1hr max. Tully’s Workshop (Darion & Tully): 24h +-1h. Tower of Naia (Beleth): 5 days, 18 min. & 36 max.
  • Topics

×
×
  • Create New...