-
Posts
259 -
Joined
-
Last visited
Never -
Feedback
0%
Content Type
Articles
Profiles
Forums
Store
Everything posted by FFs
-
Nice share FighterBoss :D
-
Sorry, my mistake, i edited the post. The current file is tvtvoiceinfo.java
-
Tested on: 16/06/11 and working perfectly.
-
Hi people! Thats my first share. I made commands to register, leave and to know the status of the TvT Event. Manual Setup: Core Patch: In: "java/com/l2jserver/Config.java" Search: public static boolean TVT_ALLOW_VOICED_COMMAND; And put this code below: public static boolean TVT_ALLOW_REGISTER_VOICED_COMMAND; After that search this code: TVT_ALLOW_VOICED_COMMAND = Boolean.parseBoolean(L2JModSettings.getProperty("TvTAllowVoicedInfoCommand", "false")); And put this code below: TVT_ALLOW_REGISTER_VOICED_COMMAND = Boolean.parseBoolean(L2JModSettings.getProperty("TvTAllowRegisterVoicedCommand", "false")); In: "java/config/l2jmods.properties" Find this lines: TvTEventTeam2Coordinates = 149999,46728,-3414 And put this others lines below: +#Allow Voiced .join / .leave / .tvt commands +TvTAllowRegisterVoicedCommand = True DP Patch: In: "data/scripts/handlers/voicedcommandhandlers/TvTVoicedInfo.java" Search this line: private static final String[] _voicedCommands = { "tvt" }; And delete it, and put this lines in the same place: private static final String[] _voicedCommands = { "tvt", "tvtjoin", "tvtleave" }; Search in the same code: activeChar.sendPacket(ActionFailed.STATIC_PACKET); } } And below put this lines: else if(command.equalsIgnoreCase("tvtjoin")) { if(Config.TVT_ALLOW_REGISTER_VOICED_COMMAND) TvTEvent.onBypass("tvt_event_participation", activeChar); else activeChar.sendMessage("Command disabled"); } else if(command.equalsIgnoreCase("tvtleave")) { if(Config.TVT_ALLOW_REGISTER_VOICED_COMMAND) TvTEvent.onBypass("tvt_event_remove_participation", activeChar); else activeChar.sendMessage("Command disabled"); } Patch Download: Core: http://www.mediafire.com/?44ogclf453iuft7 DP: http://www.mediafire.com/?t3d1rgze70u73y9 Chronicle: Freya Pack: L2JServer (Last Rev - 16/06/11) Credits: FFs
-
You have right, thanx a lot. And FighterBoss, thanx for the information.
-
UP! No1 can help me?
-
Really cool to make some events :D Thanx for share :)
-
[Help] Need coordinates for locations high five.
FFs replied to slipk9's question in Request Server Development Help [L2J]
Look at the Olimpiad stadium teleport menu. These places are new stadiums. -
Core Part: Index: java/com/l2jserver/Config.java =================================================================== --- java/com/l2jserver/Config.java (revision 4011) +++ java/com/l2jserver/Config.java (working copy) @@ -625,6 +630,9 @@ public static TIntIntHashMap TVT_EVENT_FIGHTER_BUFFS; public static TIntIntHashMap TVT_EVENT_MAGE_BUFFS; public static boolean TVT_ALLOW_VOICED_COMMAND; + public static boolean TVT_ALLOW_REGISTER_VOICED_COMMAND; + public static boolean TVT_RESTORE_PLAYER_POS; @@ -2009,6 +2017,16 @@ TVT_EVENT_START_LEAVE_TELEPORT_DELAY = Integer.parseInt(L2JModSettings.getProperty("TvTEventStartLeaveTeleportDelay", "20")); TVT_EVENT_EFFECTS_REMOVAL = Integer.parseInt(L2JModSettings.getProperty("TvTEventEffectsRemoval", "0")); TVT_ALLOW_VOICED_COMMAND = Boolean.parseBoolean(L2JModSettings.getProperty("TvTAllowVoicedInfoCommand", "false")); + TVT_ALLOW_REGISTER_VOICED_COMMAND = Boolean.parseBoolean(L2JModSettings.getProperty("TvTAllowRegisterVoicedCommand", "false")); + TVT_DISALLOW_DUALBOX = Boolean.parseBoolean(L2JModSettings.getProperty("TvTEnableDualBoxProtection", "false")); + TVT_RESTORE_PLAYER_POS = Boolean.parseBoolean(L2JModSettings.getProperty("TvTRestorePlayerOldPosition", "false")); Index: java/com/l2jserver/gameserver/model/entity/TvTEvent.java =================================================================== --- java/com/l2jserver/gameserver/model/entity/TvTEvent.java (revision 4011) +++ java/com/l2jserver/gameserver/model/entity/TvTEvent.java (working copy) @@ -28,6 +29,7 @@ import com.l2jserver.gameserver.instancemanager.InstanceManager; import com.l2jserver.gameserver.model.L2Skill; import com.l2jserver.gameserver.model.L2Spawn; +import com.l2jserver.gameserver.model.L2World; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.L2Summon; @@ -91,8 +94,22 @@ */ public static void init() { + + if(Config.TVT_RESTORE_PLAYER_POS) + TvTEventTeleporter.initializeRestoreMap(); + } @@ -459,6 +464,12 @@ } } + if(Config.TVT_RESTORE_PLAYER_POS) + TvTEventTeleporter.clearRestoreMap(); + @@ -1136,7 +1291,7 @@ */ public static int[] getParticipantTeamCoordinates(int playerObjectId) { - return _teams[0].containsPlayer(playerObjectId) ? _teams[0].getCoordinates() : (_teams[1].containsPlayer(playerObjectId) ? _teams[1].getCoordinates() : null); + return getParticipantTeam(playerObjectId).getCoordinates(); } /** @@ -1152,7 +1307,7 @@ return false; } - return _teams[0].containsPlayer(playerObjectId) || _teams[1].containsPlayer(playerObjectId); + return getParticipantTeam(playerObjectId) != null; Index: java/com/l2jserver/gameserver/model/entity/TvTEventTeleporter.java =================================================================== --- java/com/l2jserver/gameserver/model/entity/TvTEventTeleporter.java (revision 4011) +++ java/com/l2jserver/gameserver/model/entity/TvTEventTeleporter.java (working copy) @@ -14,6 +14,8 @@ */ package com.l2jserver.gameserver.model.entity; +import javolution.util.FastMap; + import com.l2jserver.Config; import com.l2jserver.gameserver.ThreadPoolManager; import com.l2jserver.gameserver.model.actor.L2Summon; @@ -28,6 +30,22 @@ private int[] _coordinates = new int[3]; /** Admin removed this player from event */ private boolean _adminRemove = false; + /** Old Player Coordinates */ + private static FastMap<Integer, Integer[]> _oldPlayerPos; + /** Color name identifier per Team */ + private static final int[] _colorNames = + { + // White + 16777215, + // Blue + 26367, + // Red + 16711680, + // Green + 3407718, + // Yellow + 16776960 + }; /** * Initialize the teleporter and start the delayed task<br><br> @@ -94,13 +112,55 @@ _playerInstance.doRevive(); - _playerInstance.teleToLocation( _coordinates[ 0 ] + Rnd.get(101)-50, _coordinates[ 1 ] + Rnd.get(101)-50, _coordinates[ 2 ], false ); + int objId = _playerInstance.getObjectId(); + if(Config.TVT_RESTORE_PLAYER_POS && TvTEvent.isStarted() && !_adminRemove) + { + final Integer[] oldCoords = + { + _playerInstance.getX(), + _playerInstance.getY(), + _playerInstance.getZ() + }; + + _oldPlayerPos.put(objId, oldCoords); + } + + if(Config.TVT_RESTORE_PLAYER_POS && !TvTEvent.isStarted()) + { + Integer[] coor = _oldPlayerPos.get(objId); + + if(coor != null) + { + _playerInstance.teleToLocation(coor[0], coor[1], coor[2], false); + } + else + { + _playerInstance.teleToLocation( _coordinates[ 0 ] + Rnd.get(101)-50, _coordinates[ 1 ] + Rnd.get(101)-50, _coordinates[ 2 ], false ); + } + } + else + _playerInstance.teleToLocation( _coordinates[ 0 ] + Rnd.get(101)-50, _coordinates[ 1 ] + Rnd.get(101)-50, _coordinates[ 2 ], false ); if (TvTEvent.isStarted() && !_adminRemove) - _playerInstance.setTeam(TvTEvent.getParticipantTeamId(_playerInstance.getObjectId()) + 1); + { + int team = TvTEvent.getParticipantTeamId(_playerInstance.getObjectId()) + 1; + + if(Config.TVT_TEAMS_COUNT == 2) + _playerInstance.setTeam(team); + else + _playerInstance.getAppearance().setNameColor(_colorNames[team]); + } else - _playerInstance.setTeam(0); + { + if(Config.TVT_TEAMS_COUNT == 2) + _playerInstance.setTeam(0); + else + _playerInstance.getAppearance().setNameColor(_colorNames[0]); + } + if(_oldPlayerPos.containsKey(objId)) + _oldPlayerPos.remove(objId); + _playerInstance.setCurrentCp(_playerInstance.getMaxCp()); _playerInstance.setCurrentHp(_playerInstance.getMaxHp()); _playerInstance.setCurrentMp(_playerInstance.getMaxMp()); @@ -108,4 +168,22 @@ _playerInstance.broadcastStatusUpdate(); _playerInstance.broadcastUserInfo(); } + + /** + * Initializes the map where the player position + * will be stored + */ + public static void initializeRestoreMap() + { + if(_oldPlayerPos == null) + _oldPlayerPos = new FastMap<Integer, Integer[]>(); + } + + /** + * Clear all containing data for a new event + */ + public static void clearRestoreMap() + { + _oldPlayerPos.clear(); + } } Index: java/config/l2jmods.properties =================================================================== --- java/config/l2jmods.properties (revision 4011) +++ java/config/l2jmods.properties (working copy) @@ -172,6 +175,15 @@ TvTEventTeam2Name = Team2 TvTEventTeam2Coordinates = 149999,46728,-3414 +#Restore previous char position when TvT ends +TvTRestorePlayerOldPosition = False DP Part: Index: data/scripts/handlers/MasterHandler.java =================================================================== --- data/scripts/handlers/MasterHandler.java (revision 7189) +++ data/scripts/handlers/MasterHandler.java (working copy) @@ -265,8 +265,8 @@ VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Wedding()); if (Config.BANKING_SYSTEM_ENABLED) VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Banking()); - if (Config.TVT_ALLOW_VOICED_COMMAND) - VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new TvTVoicedInfo()); + if (Config.TVT_ALLOW_VOICED_COMMAND || Config.TVT_ALLOW_REGISTER_VOICED_COMMAND) + VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new TvTVoiced()); Index: data/scripts/handlers/voicedcommandhandlers/TvTVoiced.java =================================================================== --- data/scripts/handlers/voicedcommandhandlers/TvTVoiced.java (revision 7189) +++ data/scripts/handlers/voicedcommandhandlers/TvTVoiced.java (working copy) @@ -27,40 +27,72 @@ * * @author denser */ -public class TvTVoicedInfo implements IVoicedCommandHandler +public class TvTVoiced implements IVoicedCommandHandler { - private static final String[] _voicedCommands = { "tvt" }; + private static final String[] _voicedCommands = + { + "tvt", + "tvtjoin", + "tvtleave" + }; @@ -74,6 +106,20 @@ activeChar.sendPacket(ActionFailed.STATIC_PACKET); } } + else if(command.equalsIgnoreCase("tvtjoin")) + { + if(Config.TVT_ALLOW_REGISTER_VOICED_COMMAND) + TvTEvent.onBypass("tvt_event_participation", activeChar); + else + activeChar.sendMessage("Command disabled"); + } + else if(command.equalsIgnoreCase("tvtleave")) + { + if(Config.TVT_ALLOW_REGISTER_VOICED_COMMAND) + TvTEvent.onBypass("tvt_event_remove_participation", activeChar); + else + activeChar.sendMessage("Command disabled"); + } That's my code and i need help to finish it. Its my first code so... i dont know if it is good coded, so i need some1 who tell me if it is good or will not work, and why, what else need the code. Well, thats all. Thanx
-
[question] Which the project gracia freya?
FFs replied to Rzeszut's question in Request Server Development Help [L2J]
L2JServer 4 ever. I know L2JServer have lots of bugs and lots of work to do, but its fully configurable and easy to work with. I recommend it, and if you have question just make a post! (sure, in the correct section) -
Not working for L2JServer Freya last rev, needs lot of changes and the codes are very different. I'll try to adapt it and later i'll make a post sharing it.
-
[share] L2J Dialog Maker 1.011 beta 7
FFs replied to szponiasty's topic in Server Development Discussion [L2J]
Cool men, thanx a lot. But i cant make tables :/ -
[Guide] for enchanting ! Droneth
FFs replied to Droneth's topic in Server Development Discussion [L2J]
I like it :D -
[Share] Online players vcmd via html page
FFs replied to Voqus's topic in Server Shares & Files [L2J]
Is not useless, if you want to see the players online without the community board because it makes lag, so, thats a light code who dont make lag and its useful for me. Any1 haves a different way to use it. -
That code works?
-
I'll test on L2JFrozen...
-
You can adapt it, so it will work
-
Nice share men :D I like the Enchant Simulator Program :D
-
[Help]How do you make a downloadable system file
FFs replied to Marlin's question in Request Server Development Help [L2J]
Here you are: http://maxcheaters.com/forum/index.php?topic=205917.0 -
[Collection][Share]AIO Freya Npc's
FFs replied to `NeverMore's topic in Server Development Discussion [L2J]
Great work NeverMore, thanx a lot! -
Very pretty exaH, i like the template :) Keep sharing
-
[Question] Non Crashing pack?
FFs replied to [DEV]DjSt3rios's question in Request Server Development Help [L2J]
With aCis dont will happen that, be quiet using aCis -
[Help]How do you make a downloadable system file
FFs replied to Marlin's question in Request Server Development Help [L2J]
Yup, or anyone you want -
[Question] Non Crashing pack?
FFs replied to [DEV]DjSt3rios's question in Request Server Development Help [L2J]
L2JFrozen have lots of mods but is equal than any other project. I read a lot of post about aCis and i think is one of the best projects running these days. If you have questions just test aCis pack... -
[Help]How do you make a downloadable system file
FFs replied to Marlin's question in Request Server Development Help [L2J]
Try this system: http://www.maxcheaters.com/forum/index.php?topic=179093.0