- 0
[Help] TvT Commands
-
Posts
-
This update resaves 25_25 from the original (with sounds) (without the cave below) Some emitter fixes (removed waterfalls with high-poly meshes) The geodata is old, but it works Everything else is unchanged Download P.S. The effect files are taken from the high client for Interlude, so if you're experiencing critical skills, use the default ones for your Version.
-
GX-Ext Which file of the svn files should i edit to make blow skills to have 100% chance so i can add the settings in the IlExt.ini? because when im changing it from the skilldata.txt it just helps
-
我们感谢您的 反馈 并希望让服务变得更加 优秀! 如果您使用过我们的服务并愿意分享您的体验(任何体验——积极或建设性),请在Trustpilot上留下评价,并获得$1作为感谢。 链接: https://www.trustpilot.com/review/socnet.pro 如何获得奖励: 1. 前往Trustpilot并留下您的评价 2. 向我们发送发布确认截图,以及带有与评价用户名一致的授权账户截图。 3. 指定哪个商店应收到这 $1 奖励。根据商店不同,可能需要您的用户名/电子邮箱。 您的反馈帮助我们成长,并让项目对社区中的每一位成员变得更好。感谢您与我们同行! 条款: 此活动仅适用于一个唯一用户。不允许多账号行为。 项目有效链接: 数字商品商店(网站): 前往 商店 Telegram 机器人: 前往 – 通过 Telegram 方便访问商店。 虚拟号码服务: 前往 用于购买 Telegram Stars 的 Telegram 机器人: 前往 – 在 Telegram 中快捷且优惠地购买 Stars。 SMM 面板: 前往 – 推广您的社交媒体账户。 我们想向您展示当前的 促销和特别优惠列表 用于购买我们提供的产品与服务: 1. 您可在首次购买时使用优惠码:SOCNET(15% 折扣) 2. 获得 $1 商店余额或 10–20% 折扣——只需在我们网站注册后,按照模板填写您的用户名:“SEND ME BONUS, MY USERNAME IS...”并在我们的论坛主题中发布! 3. 首次启动 SMM 面板可获得 $1:只需在我们的网站(Support)提交主题为 “Get Trial Bonus” 的工单。 4. 我们的 Telegram 频道以及 Stars 购买机器人中每周都有 Telegram Stars 抽奖! 新闻: ➡ Telegram 频道: https://t.me/accsforyou_shop ➡ WhatsApp 频道: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器: https://discord.gg/y9AStFFsrh 联系方式与支持: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
-
我们感谢您的 反馈 并希望让服务变得更加 优秀! 如果您使用过我们的服务并愿意分享您的体验(任何体验——积极或建设性),请在Trustpilot上留下评价,并获得$1作为感谢。 链接: https://www.trustpilot.com/review/socnet.pro 如何获得奖励: 1. 前往Trustpilot并留下您的评价 2. 向我们发送发布确认截图,以及带有与评价用户名一致的授权账户截图。 3. 指定哪个商店应收到这 $1 奖励。根据商店不同,可能需要您的用户名/电子邮箱。 您的反馈帮助我们成长,并让项目对社区中的每一位成员变得更好。感谢您与我们同行! 条款: 此活动仅适用于一个唯一用户。不允许多账号行为。 项目有效链接: 数字商品商店(网站): 前往 商店 Telegram 机器人: 前往 – 通过 Telegram 方便访问商店。 虚拟号码服务: 前往 用于购买 Telegram Stars 的 Telegram 机器人: 前往 – 在 Telegram 中快捷且优惠地购买 Stars。 SMM 面板: 前往 – 推广您的社交媒体账户。 我们想向您展示当前的 促销和特别优惠列表 用于购买我们提供的产品与服务: 1. 您可在首次购买时使用优惠码:SOCNET(15% 折扣) 2. 获得 $1 商店余额或 10–20% 折扣——只需在我们网站注册后,按照模板填写您的用户名:“SEND ME BONUS, MY USERNAME IS...”并在我们的论坛主题中发布! 3. 首次启动 SMM 面板可获得 $1:只需在我们的网站(Support)提交主题为 “Get Trial Bonus” 的工单。 4. 我们的 Telegram 频道以及 Stars 购买机器人中每周都有 Telegram Stars 抽奖! 新闻: ➡ Telegram 频道: https://t.me/accsforyou_shop ➡ WhatsApp 频道: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器: https://discord.gg/y9AStFFsrh 联系方式与支持: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
-
-
Topics

Question
FFs
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 = FalseDP 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
4 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now