If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number:3803
L2JDP Revision Number:6680
I`d like to know if there is anyway to make it so that the players, after TVT return to their original position. For exemple if a player is in fields of silence, and gets ported to tvt, after tvt is over, he gets back to fields of silence, and not to the tvt manager position specified in l2jmods?
is it possible?
TVT question...
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
- BiggBoss
- L2j Veteran
- Posts: 1104
- Joined: Wed Apr 15, 2009 3:11 pm
- Location: Spain
Re: TVT question...
yes, just by using a Map
Map<L2PcInstance, Integer[]> = new FastMap<L2PcInstance, Integer[]>
where Integer[] should be a 3 positions array to hold their old coordinates.
Map<L2PcInstance, Integer[]> = new FastMap<L2PcInstance, Integer[]>
where Integer[] should be a 3 positions array to hold their old coordinates.
-
- Posts: 575
- Joined: Wed Dec 02, 2009 7:59 pm
Re: TVT question...
B1ggBoss wrote:yes, just by using a Map
Map<L2PcInstance, Integer[]> = new FastMap<L2PcInstance, Integer[]>
where Integer[] should be a 3 positions array to hold their old coordinates.
thank you very much, i d appreciate it if u d told me where to add those lines? :/
- BiggBoss
- L2j Veteran
- Posts: 1104
- Joined: Wed Apr 15, 2009 3:11 pm
- Location: Spain
Re: TVT question...
Untested
for core 3839
for core 3839
Code: Select all
Index: java/com/l2jserver/Config.java===================================================================--- java/com/l2jserver/Config.java (revision 3839)+++ java/com/l2jserver/Config.java (working copy)@@ -622,6 +622,7 @@ 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_RESTORE_PLAYER_POS; public static boolean L2JMOD_ALLOW_WEDDING; public static int L2JMOD_WEDDING_PRICE; public static boolean L2JMOD_WEDDING_PUNISH_INFIDELITY;@@ -1980,6 +1981,7 @@ 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_RESTORE_PLAYER_POS = Boolean.parseBoolean(L2JModSettings.getProperty("TvTRestorePlayerPosition", "false")); TVT_EVENT_TEAM_1_NAME = L2JModSettings.getProperty("TvTEventTeam1Name", "Team1"); propertySplit = L2JModSettings.getProperty("TvTEventTeam1Coordinates", "0,0,0").split(","); if (propertySplit.length < 3)Index: java/com/l2jserver/gameserver/model/entity/TvTEvent.java===================================================================--- java/com/l2jserver/gameserver/model/entity/TvTEvent.java (revision 3839)+++ java/com/l2jserver/gameserver/model/entity/TvTEvent.java (working copy)@@ -454,7 +454,14 @@ // Check for nullpointer if (playerInstance != null) {- new TvTEventTeleporter(playerInstance, Config.TVT_EVENT_PARTICIPATION_NPC_COORDINATES, false, false);+ if(Config.TVT_RESTORE_PLAYER_POS)+ {+ new TvTEventTeleporter(playerInstance, TvTEventTeleporter._oldCoordinates.get(playerInstance), false, false);+ }+ else+ {+ new TvTEventTeleporter(playerInstance, Config.TVT_EVENT_PARTICIPATION_NPC_COORDINATES, false, false);+ } } } }Index: java/com/l2jserver/gameserver/model/entity/TvTEventTeleporter.java===================================================================--- java/com/l2jserver/gameserver/model/entity/TvTEventTeleporter.java (revision 3839)+++ 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,8 @@ private int[] _coordinates = new int[3]; /** Admin removed this player from event */ private boolean _adminRemove = false;+ /** Old player position */+ protected static FastMap<L2PcInstance, int[]> _oldCoordinates = new FastMap<L2PcInstance, int[]>(); /** * Initialize the teleporter and start the delayed task<br><br>@@ -94,6 +98,27 @@ _playerInstance.doRevive(); + if(Config.TVT_RESTORE_PLAYER_POS)+ {+ if(TvTEvent.isStarted())+ {+ int[] currentPlayerPos = + {+ _playerInstance.getX(),+ _playerInstance.getY(),+ _playerInstance.getZ()+ };+ + if(!_oldCoordinates.containsKey(_playerInstance))+ {+ _oldCoordinates.put(_playerInstance, currentPlayerPos);+ }+ }+ else+ {+ _oldCoordinates.remove(_playerInstance);+ }+ } _playerInstance.teleToLocation( _coordinates[ 0 ] + Rnd.get(101)-50, _coordinates[ 1 ] + Rnd.get(101)-50, _coordinates[ 2 ], false ); if (TvTEvent.isStarted() && !_adminRemove)Index: java/config/l2jmods.properties===================================================================--- java/config/l2jmods.properties (revision 3839)+++ java/config/l2jmods.properties (working copy)@@ -211,6 +211,9 @@ # Voiced command (.tvt) working during TVT event to get information about event status TvTAllowVoicedInfoCommand = false +# Port players back to the position where they was when the TvT called them+TvTRestorePlayerPosition = true+ # --------------------------------------------------------------------------- # L2J Banking System # ---------------------------------------------------------------------------