Jump to content

FFs

Members
  • Posts

    259
  • Joined

  • Last visited

    Never
  • Feedback

    0%

Everything posted by FFs

  1. Nice share FighterBoss :D
  2. Sorry, my mistake, i edited the post. The current file is tvtvoiceinfo.java
  3. Tested on: 16/06/11 and working perfectly.
  4. 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
  5. You have right, thanx a lot. And FighterBoss, thanx for the information.
  6. UP! No1 can help me?
  7. Really cool to make some events :D Thanx for share :)
  8. Look at the Olimpiad stadium teleport menu. These places are new stadiums.
  9. 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
  10. 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)
  11. 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.
  12. Cool men, thanx a lot. But i cant make tables :/
  13. 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.
  14. That code works?
  15. I'll test on L2JFrozen...
  16. You can adapt it, so it will work
  17. Nice share men :D I like the Enchant Simulator Program :D
  18. Here you are: http://maxcheaters.com/forum/index.php?topic=205917.0
  19. Great work NeverMore, thanx a lot!
  20. Very pretty exaH, i like the template :) Keep sharing
  21. With aCis dont will happen that, be quiet using aCis
  22. 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...
  23. Try this system: http://www.maxcheaters.com/forum/index.php?topic=179093.0
×
×
  • 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