Removal of hardcoded events and addition of player isOnCustomEvent methods.
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
<html><title>Mods Help</title><body>
|
||||
<table width=260><tr>
|
||||
<td width=40><button value="Main" action="bypass -h admin_admin" width=40 height=15 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
|
||||
<td width=180><center>Mod Help Page</center></td>
|
||||
<td width=40><button value="Back" action="bypass -h admin_admin5" width=40 height=15 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
|
||||
</tr></table>
|
||||
<font color="LEVEL"><table width=260><tr>
|
||||
<td width 90>GM commands page:</td><td><a action="bypass -h admin_html admhelp.htm">Index</a></td><td><a action="bypass -h admin_html help/gmcommands.htm">1</a></td><td><a action="bypass -h admin_html help/gmcommands2.htm">2</a></td><td><a action="bypass -h admin_html help/gmcommands3.htm">3</a></td>
|
||||
</tr></table></font>
|
||||
<br>
|
||||
<font color="FF9933">These are the available settings for this mod.</font><br>
|
||||
(When a parameter is required, it must be written in the quickbox without leading nor trailing spaces)<br1>
|
||||
Mandatory parameters will appear <font color="FF0000"><ike this></font><br1>
|
||||
Optional parameters will appear <font color="00FF00">[like that]</font><br>
|
||||
<!-- Mod writers should change from here -->
|
||||
<font color="LEVEL">Enable</font> - Enable this mod<br>
|
||||
<font color="LEVEL">Interval</font> <font color="FF0000"><minutes></font> - Time between events.<br>
|
||||
<font color="LEVEL">PartTime</font> <font color="FF0000"><minutes></font> - Time allowed for application.<br>
|
||||
<font color="LEVEL">RunnTime</font> <font color="FF0000"><minutes></font> - Event duration<br>
|
||||
<br>
|
||||
<font color="LEVEL">Disable</font> - Disable this mod.<br>
|
||||
<font color="LEVEL">EventNpc</font> <font color="FF0000"><integer></font> - NpcId to be used as event manager.
|
||||
</body></html>
|
||||
@@ -57,20 +57,5 @@
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<font color="LEVEL">TvT EVENT MOD
|
||||
<a action="bypass -h admin_html help/l2jmod/tvt.htm">Help</a></font>
|
||||
<table width=240 border=0 bgcolor="666666">
|
||||
<tr>
|
||||
<td><button value="Enable" action="bypass -h admin_set_mod TvTEventEnabled=true" width=60 height=20 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
|
||||
<td><button value="Interval" action="bypass -h admin_set_mod TvTEventInterval=$qbox" width=60 height=20 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
|
||||
<td><button value="PartTime" action="bypass -h admin_set_mod TvTEventParticipationTime=$qbox" width=60 height=20 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
|
||||
<td><button value="RunnTime" action="bypass -h admin_set_mod TvTEventRunningTime=$qbox" width=60 height=20 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><button value="Disable" action="bypass -h admin_set_mod TvTEventEnabled=false" width=60 height=20 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
|
||||
<td><button value="EventNpc" action="bypass -h admin_set_mod TvTEventParticipationNpcId=$qbox" width=60 height=20 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
</center>
|
||||
</body></html>
|
||||
@@ -1,14 +0,0 @@
|
||||
<html><body scroll="no">
|
||||
<table cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
|
||||
<tr><td valign="top" align="center">
|
||||
<table width=96% cellpadding=0 cellspacing=0>
|
||||
<tr><td height=30></td></tr>
|
||||
<tr><td align=center><font color="LEVEL">%eventName%</font> by %eventCreator%</td></tr>
|
||||
<tr><td height=20></td></tr>
|
||||
<tr><td align=center>%eventInfo%</td></tr>
|
||||
<tr><td height=34></td></tr>
|
||||
<tr><td align=center><button value="Unregister" action="bypass -h npc_%objectId%_event_unregister" width=120 height=32 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td></tr>
|
||||
<tr><td height=34></td></tr>
|
||||
</table>
|
||||
</td></tr></table>
|
||||
</body></html>
|
||||
@@ -1,14 +0,0 @@
|
||||
<html><body scroll="no">
|
||||
<table cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
|
||||
<tr><td valign="top" align="center">
|
||||
<table width=96% cellpadding=0 cellspacing=0>
|
||||
<tr><td height=30></td></tr>
|
||||
<tr><td align=center><font color="LEVEL">%eventName%</font> by %eventCreator%</td></tr>
|
||||
<tr><td height=20></td></tr>
|
||||
<tr><td align=center>%eventInfo%</td></tr>
|
||||
<tr><td height=34></td></tr>
|
||||
<tr><td align=center><button value="Participate" action="bypass -h npc_%objectId%_event_participate" width=120 height=32 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td></tr>
|
||||
<tr><td height=34></td></tr>
|
||||
</table>
|
||||
</td></tr></table>
|
||||
</body></html>
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<instance id="3049" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/instance.xsd">
|
||||
<PvPInstance val="true" />
|
||||
<doorlist>
|
||||
<door id="24190001" />
|
||||
<door id="24190002" />
|
||||
<door id="24190003" />
|
||||
<door id="24190004" />
|
||||
</doorlist>
|
||||
</instance>
|
||||
@@ -95,7 +95,7 @@ public class Warpgate extends AbstractNpcAI
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
final PlayerInstance player = creature.getActingPlayer();
|
||||
if (!canEnter(player) && !player.canOverrideCond(PlayerCondOverride.ZONE_CONDITIONS) && !player.isOnEvent())
|
||||
if (!canEnter(player) && !player.canOverrideCond(PlayerCondOverride.ZONE_CONDITIONS) && !player.isOnCustomEvent())
|
||||
{
|
||||
startQuestTimer("TELEPORT", 1000, null, player);
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TvT Event</title>
|
||||
</head>
|
||||
<body>
|
||||
Cursed weapon holders are not allowed to participate.
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,8 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TvT Event</title>
|
||||
</head>
|
||||
<body>
|
||||
Maximum of %max% participant(s) per IP address is allowed.
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,8 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TvT Event</title>
|
||||
</head>
|
||||
<body>
|
||||
Chaotic players are not allowed to participate.
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,8 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TvT Event</title>
|
||||
</head>
|
||||
<body>
|
||||
Only players from level %min% to level %max% are allowed to participate.
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,8 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TvT Event</title>
|
||||
</head>
|
||||
<body>
|
||||
You can not participate while registered for Olympiad.
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,13 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TvT Event</title>
|
||||
</head>
|
||||
<body>
|
||||
Registration for TvT Event:<br>
|
||||
<center>
|
||||
%playercount% players in.<br>
|
||||
Participation Fee: %fee%<br>
|
||||
<button action="bypass -h Quest TvTManager join" value="Participate" width="200" height="31" back="L2UI_CT1.OlympiadWnd_DF_Apply_Down" fore="L2UI_CT1.OlympiadWnd_DF_Apply">
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,8 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TvT Event</title>
|
||||
</head>
|
||||
<body>
|
||||
You need %fee% for participation.
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,8 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TvT Event</title>
|
||||
</head>
|
||||
<body>
|
||||
You are registered for a TvT Event.
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,13 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
</head><title>TvT Event</title>
|
||||
</head>
|
||||
<body>
|
||||
Cancel registration for TvT Event:<br>
|
||||
You are already registered for this event. Do you wish to cancel your participation in this Event?<br>
|
||||
<center>
|
||||
Participation fee is not returned!<br>
|
||||
<button action="bypass -h Quest TvTManager remove" msg="1480" value="Cancel" width="200" height="31" back="L2UI_CT1.OlympiadWnd_DF_Back_Down" fore="L2UI_CT1.OlympiadWnd_DF_Back">
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,9 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TvT Event</title>
|
||||
</head>
|
||||
<body>
|
||||
<font color="LEVEL">Your team won the event!</font><br>
|
||||
Look in your inventory, there should be your reward.
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,12 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TvT Event</title>
|
||||
</head>
|
||||
<body>
|
||||
Status:<br>
|
||||
<center>
|
||||
%team1name% with %team1playercount% players and %team1points% points.<br>
|
||||
%team2name% with %team2playercount% players and %team2points% points.
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,8 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TvT Event</title>
|
||||
</head>
|
||||
<body>
|
||||
The event is full! Only %max% players are allowed per team.
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,220 +0,0 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 custom.events.TvT.TvTManager;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
|
||||
import org.l2jmobius.gameserver.handler.VoicedCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.TvTEvent;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* TvT Manager AI.
|
||||
* @author Zoey76
|
||||
*/
|
||||
public class TvTManager extends AbstractNpcAI implements IVoicedCommandHandler
|
||||
{
|
||||
private static final int MANAGER_ID = 70010;
|
||||
private static final String[] COMMANDS =
|
||||
{
|
||||
"tvt",
|
||||
"tvtjoin",
|
||||
"tvtleave"
|
||||
};
|
||||
|
||||
public TvTManager()
|
||||
{
|
||||
addFirstTalkId(MANAGER_ID);
|
||||
addTalkId(MANAGER_ID);
|
||||
addStartNpc(MANAGER_ID);
|
||||
|
||||
if (Config.TVT_ALLOW_VOICED_COMMAND)
|
||||
{
|
||||
VoicedCommandHandler.getInstance().registerHandler(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
|
||||
{
|
||||
if ((player == null) || !TvTEvent.isParticipating())
|
||||
{
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
String htmltext = null;
|
||||
switch (event)
|
||||
{
|
||||
case "join":
|
||||
{
|
||||
final int playerLevel = player.getLevel();
|
||||
final int team1Count = TvTEvent.getTeamsPlayerCounts()[0];
|
||||
final int team2Count = TvTEvent.getTeamsPlayerCounts()[1];
|
||||
if (player.isCursedWeaponEquipped())
|
||||
{
|
||||
htmltext = getHtm(player, "CursedWeaponEquipped.html");
|
||||
}
|
||||
else if (Olympiad.getInstance().isRegistered(player))
|
||||
{
|
||||
htmltext = getHtm(player, "Olympiad.html");
|
||||
}
|
||||
else if (player.getKarma() > 0)
|
||||
{
|
||||
htmltext = getHtm(player, "Karma.html");
|
||||
}
|
||||
else if ((playerLevel < Config.TVT_EVENT_MIN_LEVEL) || (playerLevel > Config.TVT_EVENT_MAX_LEVEL))
|
||||
{
|
||||
htmltext = getHtm(player, "Level.html");
|
||||
htmltext = htmltext.replace("%min%", String.valueOf(Config.TVT_EVENT_MIN_LEVEL));
|
||||
htmltext = htmltext.replace("%max%", String.valueOf(Config.TVT_EVENT_MAX_LEVEL));
|
||||
}
|
||||
else if ((team1Count == Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS) && (team2Count == Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS))
|
||||
{
|
||||
htmltext = getHtm(player, "TeamsFull.html");
|
||||
htmltext = htmltext.replace("%max%", String.valueOf(Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS));
|
||||
}
|
||||
else if ((Config.TVT_EVENT_MAX_PARTICIPANTS_PER_IP > 0) && !AntiFeedManager.getInstance().tryAddPlayer(AntiFeedManager.TVT_ID, player, Config.TVT_EVENT_MAX_PARTICIPANTS_PER_IP))
|
||||
{
|
||||
htmltext = getHtm(player, "IPRestriction.html");
|
||||
htmltext = htmltext.replace("%max%", String.valueOf(AntiFeedManager.getInstance().getLimit(player, Config.TVT_EVENT_MAX_PARTICIPANTS_PER_IP)));
|
||||
}
|
||||
else if (TvTEvent.needParticipationFee() && !TvTEvent.hasParticipationFee(player))
|
||||
{
|
||||
htmltext = getHtm(player, "ParticipationFee.html");
|
||||
htmltext = htmltext.replace("%fee%", TvTEvent.getParticipationFee());
|
||||
}
|
||||
else if (TvTEvent.addParticipant(player))
|
||||
{
|
||||
htmltext = getHtm(player, "Registered.html");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "remove":
|
||||
{
|
||||
if (TvTEvent.removeParticipant(player.getObjectId()))
|
||||
{
|
||||
if (Config.TVT_EVENT_MAX_PARTICIPANTS_PER_IP > 0)
|
||||
{
|
||||
AntiFeedManager.getInstance().removePlayer(AntiFeedManager.TVT_ID, player);
|
||||
}
|
||||
htmltext = getHtm(player, "Unregistered.html");
|
||||
}
|
||||
else
|
||||
{
|
||||
player.sendMessage("You cannot unregister to this event.");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(Npc npc, PlayerInstance player)
|
||||
{
|
||||
String htmltext = null;
|
||||
if (TvTEvent.isParticipating())
|
||||
{
|
||||
final boolean isParticipant = TvTEvent.isPlayerParticipant(player.getObjectId());
|
||||
final int[] teamsPlayerCounts = TvTEvent.getTeamsPlayerCounts();
|
||||
htmltext = getHtm(player, (!isParticipant ? "Participation.html" : "RemoveParticipation.html"));
|
||||
htmltext = htmltext.replace("%objectId%", String.valueOf(npc.getObjectId()));
|
||||
htmltext = htmltext.replace("%team1name%", Config.TVT_EVENT_TEAM_1_NAME);
|
||||
htmltext = htmltext.replace("%team1playercount%", String.valueOf(teamsPlayerCounts[0]));
|
||||
htmltext = htmltext.replace("%team2name%", Config.TVT_EVENT_TEAM_2_NAME);
|
||||
htmltext = htmltext.replace("%team2playercount%", String.valueOf(teamsPlayerCounts[1]));
|
||||
htmltext = htmltext.replace("%playercount%", String.valueOf(teamsPlayerCounts[0] + teamsPlayerCounts[1]));
|
||||
if (!isParticipant)
|
||||
{
|
||||
htmltext = htmltext.replace("%fee%", TvTEvent.getParticipationFee());
|
||||
}
|
||||
}
|
||||
else if (TvTEvent.isStarting() || TvTEvent.isStarted())
|
||||
{
|
||||
htmltext = getTvTStatus(player);
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useVoicedCommand(String command, PlayerInstance player, String params)
|
||||
{
|
||||
String html = null;
|
||||
switch (command)
|
||||
{
|
||||
case "tvt":
|
||||
{
|
||||
if (TvTEvent.isStarting() || TvTEvent.isStarted())
|
||||
{
|
||||
html = getTvTStatus(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
html = "The event has not started.";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "tvtjoin":
|
||||
{
|
||||
html = onAdvEvent("join", null, player);
|
||||
break;
|
||||
}
|
||||
case "tvtleave":
|
||||
{
|
||||
html = onAdvEvent("remove", null, player);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (html != null)
|
||||
{
|
||||
player.sendPacket(new NpcHtmlMessage(html));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private String getTvTStatus(PlayerInstance player)
|
||||
{
|
||||
final int[] teamsPlayerCounts = TvTEvent.getTeamsPlayerCounts();
|
||||
final int[] teamsPointsCounts = TvTEvent.getTeamsPoints();
|
||||
String htmltext = getHtm(player, "Status.html");
|
||||
htmltext = htmltext.replace("%team1name%", Config.TVT_EVENT_TEAM_1_NAME);
|
||||
htmltext = htmltext.replace("%team1playercount%", String.valueOf(teamsPlayerCounts[0]));
|
||||
htmltext = htmltext.replace("%team1points%", String.valueOf(teamsPointsCounts[0]));
|
||||
htmltext = htmltext.replace("%team2name%", Config.TVT_EVENT_TEAM_2_NAME);
|
||||
htmltext = htmltext.replace("%team2playercount%", String.valueOf(teamsPlayerCounts[1]));
|
||||
htmltext = htmltext.replace("%team2points%", String.valueOf(teamsPointsCounts[1]));
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getVoicedCommandList()
|
||||
{
|
||||
return COMMANDS;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new TvTManager();
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>TvT Event</title>
|
||||
</head>
|
||||
<body>
|
||||
You have been unregistered from the TvT Event.
|
||||
</body>
|
||||
</html>
|
||||
@@ -72,7 +72,6 @@ import handlers.admincommandhandlers.AdminEditChar;
|
||||
import handlers.admincommandhandlers.AdminEffects;
|
||||
import handlers.admincommandhandlers.AdminElement;
|
||||
import handlers.admincommandhandlers.AdminEnchant;
|
||||
import handlers.admincommandhandlers.AdminEventEngine;
|
||||
import handlers.admincommandhandlers.AdminEvents;
|
||||
import handlers.admincommandhandlers.AdminExpSp;
|
||||
import handlers.admincommandhandlers.AdminFakePlayers;
|
||||
@@ -130,7 +129,6 @@ import handlers.admincommandhandlers.AdminTeleport;
|
||||
import handlers.admincommandhandlers.AdminTerritoryWar;
|
||||
import handlers.admincommandhandlers.AdminTest;
|
||||
import handlers.admincommandhandlers.AdminTransform;
|
||||
import handlers.admincommandhandlers.AdminTvTEvent;
|
||||
import handlers.admincommandhandlers.AdminVitality;
|
||||
import handlers.admincommandhandlers.AdminZone;
|
||||
import handlers.admincommandhandlers.AdminZones;
|
||||
@@ -139,7 +137,6 @@ import handlers.bypasshandlers.Buy;
|
||||
import handlers.bypasshandlers.BuyShadowItem;
|
||||
import handlers.bypasshandlers.ChatLink;
|
||||
import handlers.bypasshandlers.ClanWarehouse;
|
||||
import handlers.bypasshandlers.EventEngine;
|
||||
import handlers.bypasshandlers.Festival;
|
||||
import handlers.bypasshandlers.FindPvP;
|
||||
import handlers.bypasshandlers.Freight;
|
||||
@@ -370,7 +367,6 @@ public class MasterHandler
|
||||
AdminEffects.class,
|
||||
AdminElement.class,
|
||||
AdminEnchant.class,
|
||||
AdminEventEngine.class,
|
||||
AdminEvents.class,
|
||||
AdminExpSp.class,
|
||||
AdminFakePlayers.class,
|
||||
@@ -428,7 +424,6 @@ public class MasterHandler
|
||||
AdminTerritoryWar.class,
|
||||
AdminTest.class,
|
||||
AdminTransform.class,
|
||||
AdminTvTEvent.class,
|
||||
AdminVitality.class,
|
||||
AdminZone.class,
|
||||
},
|
||||
@@ -439,7 +434,6 @@ public class MasterHandler
|
||||
BuyShadowItem.class,
|
||||
ChatLink.class,
|
||||
ClanWarehouse.class,
|
||||
EventEngine.class,
|
||||
Festival.class,
|
||||
FindPvP.class,
|
||||
Freight.class,
|
||||
|
||||
@@ -22,7 +22,6 @@ import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.enums.InstanceType;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.handler.IActionHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
@@ -115,25 +114,19 @@ public class NpcAction implements IActionHandler
|
||||
}
|
||||
|
||||
// Open a chat window on client with the text of the Npc
|
||||
if (npc.isEventMob())
|
||||
if (npc.hasListener(EventType.ON_NPC_QUEST_START))
|
||||
{
|
||||
GameEvent.showEventHtml(player, String.valueOf(target.getObjectId()));
|
||||
player.setLastQuestNpcObject(target.getObjectId());
|
||||
}
|
||||
if (npc.hasListener(EventType.ON_NPC_FIRST_TALK))
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnNpcFirstTalk(npc, player), npc);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (npc.hasListener(EventType.ON_NPC_QUEST_START))
|
||||
{
|
||||
player.setLastQuestNpcObject(target.getObjectId());
|
||||
}
|
||||
if (npc.hasListener(EventType.ON_NPC_FIRST_TALK))
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnNpcFirstTalk(npc, player), npc);
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.showChatWindow(player);
|
||||
}
|
||||
npc.showChatWindow(player);
|
||||
}
|
||||
|
||||
if (Config.PLAYER_MOVEMENT_BLOCK_TIME > 0)
|
||||
{
|
||||
player.updateNotMoveUntil();
|
||||
|
||||
@@ -21,7 +21,6 @@ import org.l2jmobius.gameserver.enums.InstanceType;
|
||||
import org.l2jmobius.gameserver.enums.PrivateStoreType;
|
||||
import org.l2jmobius.gameserver.geoengine.GeoEngine;
|
||||
import org.l2jmobius.gameserver.handler.IActionHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.TvTEvent;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
@@ -51,12 +50,6 @@ public class PlayerInstanceAction implements IActionHandler
|
||||
@Override
|
||||
public boolean action(PlayerInstance player, WorldObject target, boolean interact)
|
||||
{
|
||||
// See description in TvTEvent.java
|
||||
if (!TvTEvent.onAction(player, target.getObjectId()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if the PlayerInstance is confused
|
||||
if (player.isOutOfControl())
|
||||
{
|
||||
|
||||
@@ -1,556 +0,0 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 handlers.admincommandhandlers;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintStream;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.data.xml.AdminData;
|
||||
import org.l2jmobius.gameserver.data.xml.TransformData;
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.GameEvent.EventState;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PlaySound;
|
||||
import org.l2jmobius.gameserver.util.Broadcast;
|
||||
|
||||
/**
|
||||
* This class handles following admin commands: - admin = shows menu
|
||||
* @version $Revision: 1.3.2.1.2.4 $ $Date: 2005/04/11 10:06:06 $
|
||||
*/
|
||||
public class AdminEventEngine implements IAdminCommandHandler
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger(AdminEventEngine.class.getName());
|
||||
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
"admin_event",
|
||||
"admin_event_new",
|
||||
"admin_event_choose",
|
||||
"admin_event_store",
|
||||
"admin_event_set",
|
||||
"admin_event_change_teams_number",
|
||||
"admin_event_announce",
|
||||
"admin_event_panel",
|
||||
"admin_event_control_begin",
|
||||
"admin_event_control_teleport",
|
||||
"admin_add",
|
||||
"admin_event_see",
|
||||
"admin_event_del",
|
||||
"admin_delete_buffer",
|
||||
"admin_event_control_sit",
|
||||
"admin_event_name",
|
||||
"admin_event_control_kill",
|
||||
"admin_event_control_res",
|
||||
"admin_event_control_transform",
|
||||
"admin_event_control_untransform",
|
||||
"admin_event_control_prize",
|
||||
"admin_event_control_chatban",
|
||||
"admin_event_control_kick",
|
||||
"admin_event_control_finish"
|
||||
};
|
||||
|
||||
private static String tempBuffer = "";
|
||||
private static String tempName = "";
|
||||
private static boolean npcsDeleted = false;
|
||||
|
||||
@Override
|
||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
||||
{
|
||||
StringTokenizer st = new StringTokenizer(command);
|
||||
final String actualCommand = st.nextToken();
|
||||
try
|
||||
{
|
||||
if (actualCommand.equals("admin_event"))
|
||||
{
|
||||
if (GameEvent.eventState != EventState.OFF)
|
||||
{
|
||||
showEventControl(activeChar);
|
||||
}
|
||||
else
|
||||
{
|
||||
showMainPage(activeChar);
|
||||
}
|
||||
}
|
||||
|
||||
else if (actualCommand.equals("admin_event_new"))
|
||||
{
|
||||
showNewEventPage(activeChar);
|
||||
}
|
||||
else if (actualCommand.startsWith("admin_add"))
|
||||
{
|
||||
// There is an exception here for not using the ST. We use spaces (ST delim) for the event info.
|
||||
tempBuffer += command.substring(10);
|
||||
showNewEventPage(activeChar);
|
||||
|
||||
}
|
||||
else if (actualCommand.startsWith("admin_event_see"))
|
||||
{
|
||||
// There is an exception here for not using the ST. We use spaces (ST delim) for the event name.
|
||||
final String eventName = command.substring(16);
|
||||
try
|
||||
{
|
||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||
final DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(Config.DATAPACK_ROOT + "/data/events/" + eventName)));
|
||||
final BufferedReader inbr = new BufferedReader(new InputStreamReader(in));
|
||||
adminReply.setFile(null, "data/html/mods/EventEngine/Participation.htm");
|
||||
adminReply.replace("%eventName%", eventName);
|
||||
adminReply.replace("%eventCreator%", inbr.readLine());
|
||||
adminReply.replace("%eventInfo%", inbr.readLine());
|
||||
adminReply.replace("npc_%objectId%_event_participate", "admin_event"); // Weird, but nice hack, isnt it? :)
|
||||
adminReply.replace("button value=\"Participate\"", "button value=\"Back\"");
|
||||
activeChar.sendPacket(adminReply);
|
||||
inbr.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.warning("Problem with AdminEventEngine: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
else if (actualCommand.startsWith("admin_event_del"))
|
||||
{
|
||||
// There is an exception here for not using the ST. We use spaces (ST delim) for the event name.
|
||||
final String eventName = command.substring(16);
|
||||
final File file = new File(Config.DATAPACK_ROOT + "/data/events/" + eventName);
|
||||
file.delete();
|
||||
showMainPage(activeChar);
|
||||
}
|
||||
else if (actualCommand.startsWith("admin_event_name"))
|
||||
{
|
||||
// There is an exception here for not using the ST. We use spaces (ST delim) for the event name.
|
||||
tempName += command.substring(17);
|
||||
showNewEventPage(activeChar);
|
||||
}
|
||||
else if (actualCommand.equalsIgnoreCase("admin_delete_buffer"))
|
||||
{
|
||||
tempBuffer = "";
|
||||
showNewEventPage(activeChar);
|
||||
}
|
||||
else if (actualCommand.startsWith("admin_event_store"))
|
||||
{
|
||||
try
|
||||
{
|
||||
final FileOutputStream file = new FileOutputStream(new File(Config.DATAPACK_ROOT, "data/events/" + tempName));
|
||||
final PrintStream p = new PrintStream(file);
|
||||
p.println(activeChar.getName());
|
||||
p.println(tempBuffer);
|
||||
file.close();
|
||||
p.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.warning("Problem with AdminEventEngine: " + e.getMessage());
|
||||
}
|
||||
|
||||
tempBuffer = "";
|
||||
tempName = "";
|
||||
showMainPage(activeChar);
|
||||
}
|
||||
else if (actualCommand.startsWith("admin_event_set"))
|
||||
{
|
||||
// There is an exception here for not using the ST. We use spaces (ST delim) for the event name.
|
||||
GameEvent._eventName = command.substring(16);
|
||||
showEventParameters(activeChar, 2);
|
||||
}
|
||||
else if (actualCommand.startsWith("admin_event_change_teams_number"))
|
||||
{
|
||||
showEventParameters(activeChar, Integer.parseInt(st.nextToken()));
|
||||
}
|
||||
else if (actualCommand.startsWith("admin_event_panel"))
|
||||
{
|
||||
showEventControl(activeChar);
|
||||
}
|
||||
else if (actualCommand.startsWith("admin_event_announce"))
|
||||
{
|
||||
GameEvent._npcId = Integer.parseInt(st.nextToken());
|
||||
GameEvent._teamsNumber = Integer.parseInt(st.nextToken());
|
||||
String temp = " ";
|
||||
String temp2 = "";
|
||||
while (st.hasMoreElements())
|
||||
{
|
||||
temp += st.nextToken() + " ";
|
||||
}
|
||||
|
||||
st = new StringTokenizer(temp, "-");
|
||||
Integer i = 1;
|
||||
|
||||
while (st.hasMoreElements())
|
||||
{
|
||||
temp2 = st.nextToken();
|
||||
if (!temp2.equals(" "))
|
||||
{
|
||||
GameEvent._teamNames.put(i++, temp2.substring(1, temp2.length() - 1));
|
||||
}
|
||||
}
|
||||
|
||||
activeChar.sendMessage(GameEvent.startEventParticipation());
|
||||
Broadcast.toAllOnlinePlayers(activeChar.getName() + " has started an event. You will find a participation NPC somewhere around you.");
|
||||
|
||||
final PlaySound snd = new PlaySound(1, "B03_F", 0, 0, 0, 0, 0);
|
||||
activeChar.sendPacket(snd);
|
||||
activeChar.broadcastPacket(snd);
|
||||
|
||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||
final String replyMSG = "<html><title>[ EVENT ENGINE ]</title><body><br><center>The event <font color=\"LEVEL\">" + GameEvent._eventName + "</font> has been announced, now you can type //event_panel to see the event panel control</center><br></body></html>";
|
||||
adminReply.setHtml(replyMSG);
|
||||
activeChar.sendPacket(adminReply);
|
||||
}
|
||||
else if (actualCommand.startsWith("admin_event_control_begin"))
|
||||
{
|
||||
// Starts the event and sends a message of the result
|
||||
activeChar.sendMessage(GameEvent.startEvent());
|
||||
showEventControl(activeChar);
|
||||
}
|
||||
else if (actualCommand.startsWith("admin_event_control_finish"))
|
||||
{
|
||||
// Finishes the event and sends a message of the result
|
||||
activeChar.sendMessage(GameEvent.finishEvent());
|
||||
}
|
||||
else if (actualCommand.startsWith("admin_event_control_teleport"))
|
||||
{
|
||||
while (st.hasMoreElements()) // Every next ST should be a team number
|
||||
{
|
||||
final int teamId = Integer.parseInt(st.nextToken());
|
||||
for (PlayerInstance player : GameEvent._teams.get(teamId))
|
||||
{
|
||||
player.setTitle(GameEvent._teamNames.get(teamId));
|
||||
player.teleToLocation(activeChar.getLocation(), true);
|
||||
player.setInstanceId(activeChar.getInstanceId());
|
||||
}
|
||||
}
|
||||
showEventControl(activeChar);
|
||||
}
|
||||
else if (actualCommand.startsWith("admin_event_control_sit"))
|
||||
{
|
||||
while (st.hasMoreElements()) // Every next ST should be a team number
|
||||
{
|
||||
// Integer.parseInt(st.nextToken()) == teamId
|
||||
for (PlayerInstance player : GameEvent._teams.get(Integer.parseInt(st.nextToken())))
|
||||
{
|
||||
if (player.getEventStatus() == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
player.getEventStatus().setSitForced(!player.getEventStatus().isSitForced());
|
||||
if (player.getEventStatus().isSitForced())
|
||||
{
|
||||
player.sitDown();
|
||||
}
|
||||
else
|
||||
{
|
||||
player.standUp();
|
||||
}
|
||||
}
|
||||
}
|
||||
showEventControl(activeChar);
|
||||
}
|
||||
else if (actualCommand.startsWith("admin_event_control_kill"))
|
||||
{
|
||||
while (st.hasMoreElements()) // Every next ST should be a team number
|
||||
{
|
||||
for (PlayerInstance player : GameEvent._teams.get(Integer.parseInt(st.nextToken())))
|
||||
{
|
||||
player.reduceCurrentHp(player.getMaxHp() + player.getMaxCp() + 1, activeChar, null);
|
||||
}
|
||||
}
|
||||
showEventControl(activeChar);
|
||||
}
|
||||
else if (actualCommand.startsWith("admin_event_control_res"))
|
||||
{
|
||||
while (st.hasMoreElements()) // Every next ST should be a team number
|
||||
{
|
||||
for (PlayerInstance player : GameEvent._teams.get(Integer.parseInt(st.nextToken())))
|
||||
{
|
||||
if ((player == null) || !player.isDead())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
player.restoreExp(100.0);
|
||||
player.doRevive();
|
||||
player.setCurrentHpMp(player.getMaxHp(), player.getMaxMp());
|
||||
player.setCurrentCp(player.getMaxCp());
|
||||
}
|
||||
}
|
||||
showEventControl(activeChar);
|
||||
}
|
||||
else if (actualCommand.startsWith("admin_event_control_transform"))
|
||||
{
|
||||
final int teamId = Integer.parseInt(st.nextToken());
|
||||
final int[] transIds = new int[st.countTokens()];
|
||||
int i = 0;
|
||||
while (st.hasMoreElements()) // Every next ST should be a transform ID
|
||||
{
|
||||
transIds[i++] = Integer.parseInt(st.nextToken());
|
||||
}
|
||||
|
||||
for (PlayerInstance player : GameEvent._teams.get(teamId))
|
||||
{
|
||||
final int transId = transIds[Rnd.get(transIds.length)];
|
||||
if (!TransformData.getInstance().transformPlayer(transId, player))
|
||||
{
|
||||
AdminData.getInstance().broadcastMessageToGMs("EventEngine: Unknow transformation id: " + transId);
|
||||
}
|
||||
}
|
||||
showEventControl(activeChar);
|
||||
}
|
||||
else if (actualCommand.startsWith("admin_event_control_untransform"))
|
||||
{
|
||||
while (st.hasMoreElements()) // Every next ST should be a team number
|
||||
{
|
||||
for (PlayerInstance player : GameEvent._teams.get(Integer.parseInt(st.nextToken())))
|
||||
{
|
||||
player.stopTransformation(true);
|
||||
}
|
||||
}
|
||||
showEventControl(activeChar);
|
||||
}
|
||||
else if (actualCommand.startsWith("admin_event_control_kick"))
|
||||
{
|
||||
if (st.hasMoreElements()) // If has next token, it should be player name.
|
||||
{
|
||||
while (st.hasMoreElements())
|
||||
{
|
||||
final PlayerInstance player = World.getInstance().getPlayer(st.nextToken());
|
||||
if (player != null)
|
||||
{
|
||||
GameEvent.removeAndResetPlayer(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((activeChar.getTarget() != null) && (activeChar.getTarget().isPlayer()))
|
||||
{
|
||||
GameEvent.removeAndResetPlayer((PlayerInstance) activeChar.getTarget());
|
||||
}
|
||||
}
|
||||
showEventControl(activeChar);
|
||||
}
|
||||
else if (actualCommand.startsWith("admin_event_control_prize"))
|
||||
{
|
||||
final int[] teamIds = new int[st.countTokens() - 2];
|
||||
int i = 0;
|
||||
while ((st.countTokens() - 2) > 0) // The last 2 tokens are used for "n" and "item id"
|
||||
{
|
||||
teamIds[i++] = Integer.parseInt(st.nextToken());
|
||||
}
|
||||
|
||||
final String[] n = st.nextToken().split("\\*");
|
||||
final int itemId = Integer.parseInt(st.nextToken());
|
||||
for (int teamId : teamIds)
|
||||
{
|
||||
rewardTeam(activeChar, teamId, Integer.parseInt(n[0]), itemId, n.length == 2 ? n[1] : "");
|
||||
}
|
||||
showEventControl(activeChar);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
AdminData.getInstance().broadcastMessageToGMs("EventEngine: Error! Possible blank boxes while executing a command which requires a value in the box?");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAdminCommandList()
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
|
||||
private String showStoredEvents()
|
||||
{
|
||||
final File dir = new File(Config.DATAPACK_ROOT, "/data/events");
|
||||
if (dir.isFile())
|
||||
{
|
||||
return "<font color=\"FF0000\">The directory '" + dir.getAbsolutePath() + "' is a file or is corrupted!</font><br>";
|
||||
}
|
||||
|
||||
String note = "";
|
||||
if (!dir.exists())
|
||||
{
|
||||
note = "<font color=\"FF0000\">The directory '" + dir.getAbsolutePath() + "' does not exist!</font><br><font color=\"0099FF\">Trying to create it now...<br></font><br>";
|
||||
if (dir.mkdirs())
|
||||
{
|
||||
note += "<font color=\"006600\">The directory '" + dir.getAbsolutePath() + "' has been created!</font><br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
note += "<font color=\"FF0000\">The directory '" + dir.getAbsolutePath() + "' hasn't been created!</font><br>";
|
||||
return note;
|
||||
}
|
||||
}
|
||||
|
||||
final String[] files = dir.list();
|
||||
final StringBuilder result = new StringBuilder(files.length * 500);
|
||||
result.append("<table>");
|
||||
for (String fileName : files)
|
||||
{
|
||||
result.append("<tr><td align=center>");
|
||||
result.append(fileName);
|
||||
result.append(" </td></tr><tr><td><table cellspacing=0><tr><td><button value=\"Select Event\" action=\"bypass -h admin_event_set ");
|
||||
result.append(fileName);
|
||||
result.append("\" width=90 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><button value=\"View Event\" action=\"bypass -h admin_event_see ");
|
||||
result.append(fileName);
|
||||
result.append("\" width=90 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><button value=\"Delete Event\" action=\"bypass -h admin_event_del ");
|
||||
result.append(fileName);
|
||||
result.append("\" width=90 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table></td></tr><tr><td> </td></tr><tr><td> </td></tr>");
|
||||
}
|
||||
|
||||
result.append("</table>");
|
||||
|
||||
return note + result;
|
||||
}
|
||||
|
||||
public void showMainPage(PlayerInstance activeChar)
|
||||
{
|
||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||
final String replyMSG = "<html><title>[ L2J EVENT ENGINE ]</title><body><br><center><button value=\"Create NEW event \" action=\"bypass -h admin_event_new\" width=150 height=32 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><center><br><font color=LEVEL>Stored Events:</font><br></center>" + showStoredEvents() + "</body></html>";
|
||||
adminReply.setHtml(replyMSG);
|
||||
activeChar.sendPacket(adminReply);
|
||||
}
|
||||
|
||||
public void showNewEventPage(PlayerInstance activeChar)
|
||||
{
|
||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||
final StringBuilder replyMSG = new StringBuilder(512);
|
||||
replyMSG.append("<html><title>[ L2J EVENT ENGINE ]</title><body><br><br><center><font color=LEVEL>Event name:</font><br>");
|
||||
if (tempName.isEmpty())
|
||||
{
|
||||
replyMSG.append("You can also use //event_name text to insert a new title");
|
||||
replyMSG.append("<center><multiedit var=\"name\" width=260 height=24> <button value=\"Set Event Name\" action=\"bypass -h admin_event_name $name\" width=120 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
|
||||
}
|
||||
else
|
||||
{
|
||||
replyMSG.append(tempName);
|
||||
}
|
||||
|
||||
replyMSG.append("<br><br><font color=LEVEL>Event description:</font><br></center>");
|
||||
if (tempBuffer.isEmpty())
|
||||
{
|
||||
replyMSG.append("You can also use //add text to add text or //delete_buffer to remove the text.");
|
||||
}
|
||||
else
|
||||
{
|
||||
replyMSG.append(tempBuffer);
|
||||
}
|
||||
|
||||
replyMSG.append("<center><multiedit var=\"txt\" width=270 height=100> <button value=\"Add text\" action=\"bypass -h admin_add $txt\" width=120 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
|
||||
replyMSG.append("<button value=\"Remove text\" action=\"bypass -h admin_delete_buffer\" width=120 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
|
||||
if (!(tempName.isEmpty() && tempBuffer.isEmpty()))
|
||||
{
|
||||
replyMSG.append("<br><button value=\"Store Event Data\" action=\"bypass -h admin_event_store\" width=160 height=32 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
|
||||
}
|
||||
|
||||
replyMSG.append("</center></body></html>");
|
||||
|
||||
adminReply.setHtml(replyMSG.toString());
|
||||
activeChar.sendPacket(adminReply);
|
||||
}
|
||||
|
||||
public void showEventParameters(PlayerInstance activeChar, int teamnumbers)
|
||||
{
|
||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append("<html><body><title>[ L2J EVENT ENGINE ]</title><br><center> Current event: <font color=\"LEVEL\">");
|
||||
sb.append(GameEvent._eventName);
|
||||
sb.append("</font></center><br>INFO: To start an event, you must first set the number of teams, then type their names in the boxes and finally type the NPC ID that will be the event manager (can be any existing npc) next to the \"Announce Event!\" button.<br><table width=100%>");
|
||||
sb.append("<tr><td><button value=\"Announce Event!\" action=\"bypass -h admin_event_announce $event_npcid ");
|
||||
sb.append(teamnumbers);
|
||||
sb.append(" ");
|
||||
for (int i = 1; (i - 1) < teamnumbers; i++) // Event announce params
|
||||
{
|
||||
sb.append("$event_teams_name");
|
||||
sb.append(i);
|
||||
sb.append(" - ");
|
||||
}
|
||||
sb.append("\" width=140 height=32 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
|
||||
sb.append("<td><edit var=\"event_npcid\" width=100 height=20></td></tr>");
|
||||
sb.append("<tr><td><button value=\"Set number of teams\" action=\"bypass -h admin_event_change_teams_number $event_teams_number\" width=140 height=32 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>");
|
||||
sb.append("<td><edit var=\"event_teams_number\" width=100 height=20></td></tr>");
|
||||
sb.append("</table><br><center><br><br>");
|
||||
sb.append("<font color=\"LEVEL\">Teams' names:</font><br><table width=100% cellspacing=8>");
|
||||
for (int i = 1; (i - 1) < teamnumbers; i++) // Team names params
|
||||
{
|
||||
sb.append("<tr><td align=center>Team #");
|
||||
sb.append(i);
|
||||
sb.append(" name:</td><td><edit var=\"event_teams_name");
|
||||
sb.append(i);
|
||||
sb.append("\" width=150 height=15></td></tr>");
|
||||
}
|
||||
sb.append("</table></body></html>");
|
||||
|
||||
adminReply.setHtml(sb.toString());
|
||||
activeChar.sendPacket(adminReply);
|
||||
}
|
||||
|
||||
private void showEventControl(PlayerInstance activeChar)
|
||||
{
|
||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append("<html><title>[ EVENT ENGINE ]</title><body><br><center>Current event: <font color=\"LEVEL\">");
|
||||
sb.append(GameEvent._eventName);
|
||||
sb.append("</font></center><br><table cellspacing=-1 width=280><tr><td align=center>Type the team ID(s) that will be affected by the commands. Commands with '*' work with only 1 team ID in the field, while '!' - none.</td></tr><tr><td align=center><edit var=\"team_number\" width=100 height=15></td></tr>");
|
||||
sb.append("<tr><td> </td></tr><tr><td><table width=200>");
|
||||
if (!npcsDeleted)
|
||||
{
|
||||
sb.append("<tr><td><button value=\"Start!\" action=\"bypass -h admin_event_control_begin\" width=100 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><font color=\"LEVEL\">Destroys all event npcs so no more people can't participate now on</font></td></tr>");
|
||||
}
|
||||
|
||||
sb.append("<tr><td> </td></tr><tr><td><button value=\"Teleport\" action=\"bypass -h admin_event_control_teleport $team_number\" width=100 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><font color=\"LEVEL\">Teleports the specified team to your position</font></td></tr><tr><td> </td></tr><tr><td><button value=\"Sit/Stand\" action=\"bypass -h admin_event_control_sit $team_number\" width=100 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><font color=\"LEVEL\">Sits/Stands up the team</font></td></tr><tr><td> </td></tr><tr><td><button value=\"Kill\" action=\"bypass -h admin_event_control_kill $team_number\" width=100 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><font color=\"LEVEL\">Finish with the life of all the players in the selected team</font></td></tr><tr><td> </td></tr><tr><td><button value=\"Resurrect\" action=\"bypass -h admin_event_control_res $team_number\" width=100 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><font color=\"LEVEL\">Resurrect Team's members</font></td></tr><tr><td> </td></tr><tr><td><table cellspacing=-1><tr><td><button value=\"Transform*\" action=\"bypass -h admin_event_control_transform $team_number $transf_id\" width=100 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr><tr><td><edit var=\"transf_id\" width=98 height=15></td></tr></table></td><td><font color=\"LEVEL\">Transforms the team into the transformation with the ID specified. Multiple IDs result in randomly chosen one for each player.</font></td></tr><tr><td> </td></tr><tr><td><button value=\"UnTransform\" action=\"bypass -h admin_event_control_untransform $team_number\" width=100 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><font color=\"LEVEL\">Untransforms the team</font></td></tr><tr><td> </td></tr><tr><td><table cellspacing=-1><tr><td><button value=\"Give Item\" action=\"bypass -h admin_event_control_prize $team_number $n $id\" width=100 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><table><tr><td width=32>Num</td><td><edit var=\"n\" width=60 height=15></td></tr><tr><td>ID</td><td><edit var=\"id\" width=60 height=15></td></tr></table></td><td><font color=\"LEVEL\">Give the specified item id to every single member of the team, you can put 5*level, 5*kills or 5 in the number field for example</font></td></tr><tr><td> </td></tr><tr><td><table cellspacing=-1><tr><td><button value=\"Kick Player\" action=\"bypass -h admin_event_control_kick $player_name\" width=100 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr><tr><td><edit var=\"player_name\" width=98 height=15></td></tr></table></td><td><font color=\"LEVEL\">Kicks the specified player(s) from the event. Blank field kicks target.</font></td></tr><tr><td> </td></tr><tr><td><button value=\"End!\" action=\"bypass -h admin_event_control_finish\" width=100 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><font color=\"LEVEL\">Will finish the event teleporting back all the players</font></td></tr><tr><td> </td></tr></table></td></tr></table></body></html>");
|
||||
adminReply.setHtml(sb.toString());
|
||||
activeChar.sendPacket(adminReply);
|
||||
}
|
||||
|
||||
private void rewardTeam(PlayerInstance activeChar, int team, int n, int id, String type)
|
||||
{
|
||||
int num = n;
|
||||
for (PlayerInstance player : GameEvent._teams.get(team))
|
||||
{
|
||||
if (type.equalsIgnoreCase("level"))
|
||||
{
|
||||
num = n * player.getLevel();
|
||||
}
|
||||
else if (type.equalsIgnoreCase("kills") && (player.getEventStatus() != null))
|
||||
{
|
||||
num = n * player.getEventStatus().getKills().size();
|
||||
}
|
||||
else
|
||||
{
|
||||
num = n;
|
||||
}
|
||||
|
||||
player.addItem("Event", id, num, activeChar, true);
|
||||
|
||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||
adminReply.setHtml("<html><body>CONGRATULATIONS! You should have been rewarded.</body></html>");
|
||||
player.sendPacket(adminReply);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 handlers.admincommandhandlers;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.TvTEvent;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.TvTEventTeleporter;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.TvTManager;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.util.BuilderUtil;
|
||||
|
||||
/**
|
||||
* @author HorridoJoho
|
||||
*/
|
||||
public class AdminTvTEvent implements IAdminCommandHandler
|
||||
{
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
"admin_tvt_add",
|
||||
"admin_tvt_remove",
|
||||
"admin_tvt_advance"
|
||||
};
|
||||
|
||||
@Override
|
||||
public boolean useAdminCommand(String command, PlayerInstance activeChar)
|
||||
{
|
||||
if (command.equals("admin_tvt_add"))
|
||||
{
|
||||
final WorldObject target = activeChar.getTarget();
|
||||
if ((target == null) || !target.isPlayer())
|
||||
{
|
||||
BuilderUtil.sendSysMessage(activeChar, "You should select a player!");
|
||||
return true;
|
||||
}
|
||||
|
||||
add(activeChar, (PlayerInstance) target);
|
||||
}
|
||||
else if (command.equals("admin_tvt_remove"))
|
||||
{
|
||||
final WorldObject target = activeChar.getTarget();
|
||||
if ((target == null) || !target.isPlayer())
|
||||
{
|
||||
BuilderUtil.sendSysMessage(activeChar, "You should select a player!");
|
||||
return true;
|
||||
}
|
||||
|
||||
remove(activeChar, (PlayerInstance) target);
|
||||
}
|
||||
else if (command.equals("admin_tvt_advance"))
|
||||
{
|
||||
TvTManager.getInstance().skipDelay();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAdminCommandList()
|
||||
{
|
||||
return ADMIN_COMMANDS;
|
||||
}
|
||||
|
||||
private void add(PlayerInstance activeChar, PlayerInstance playerInstance)
|
||||
{
|
||||
if (playerInstance.isOnEvent())
|
||||
{
|
||||
BuilderUtil.sendSysMessage(activeChar, "Player already participated in the event!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!TvTEvent.addParticipant(playerInstance))
|
||||
{
|
||||
BuilderUtil.sendSysMessage(activeChar, "Player instance could not be added, it seems to be null!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (TvTEvent.isStarted())
|
||||
{
|
||||
new TvTEventTeleporter(playerInstance, TvTEvent.getParticipantTeamCoordinates(playerInstance.getObjectId()), true, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void remove(PlayerInstance activeChar, PlayerInstance playerInstance)
|
||||
{
|
||||
if (!TvTEvent.removeParticipant(playerInstance.getObjectId()))
|
||||
{
|
||||
BuilderUtil.sendSysMessage(activeChar, "Player is not part of the event!");
|
||||
return;
|
||||
}
|
||||
|
||||
new TvTEventTeleporter(playerInstance, Config.TVT_EVENT_PARTICIPATION_NPC_COORDINATES, true, true);
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* 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 handlers.bypasshandlers;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.IBypassHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
|
||||
public class EventEngine implements IBypassHandler
|
||||
{
|
||||
private static final String[] COMMANDS =
|
||||
{
|
||||
"event_participate",
|
||||
"event_unregister"
|
||||
};
|
||||
|
||||
@Override
|
||||
public boolean useBypass(String command, PlayerInstance player, Creature target)
|
||||
{
|
||||
if (!target.isNpc())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (command.equalsIgnoreCase("event_participate"))
|
||||
{
|
||||
GameEvent.registerPlayer(player);
|
||||
return true;
|
||||
}
|
||||
else if (command.equalsIgnoreCase("event_unregister"))
|
||||
{
|
||||
GameEvent.removeAndResetPlayer(player);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Exception in " + getClass().getSimpleName(), e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getBypassList()
|
||||
{
|
||||
return COMMANDS;
|
||||
}
|
||||
}
|
||||
@@ -100,9 +100,9 @@ public class Observation implements IBypassHandler
|
||||
player.sendPacket(SystemMessageId.YOU_MAY_NOT_OBSERVE_A_SIEGE_WITH_A_PET_OR_SERVITOR_SUMMONED);
|
||||
return false;
|
||||
}
|
||||
if (player.isOnEvent())
|
||||
if (player.isRegisteredOnCustomEvent())
|
||||
{
|
||||
player.sendMessage("Cannot use while current Event");
|
||||
player.sendMessage("Cannot use while registered on an event");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ public class HomeBoard implements IParseBoardHandler
|
||||
break;
|
||||
}
|
||||
}
|
||||
return commandCheck && (player.isCastingNow() || player.isCastingSimultaneouslyNow() || player.isInCombat() || player.isInDuel() || player.isInOlympiadMode() || player.isInsideZone(ZoneId.SIEGE) || player.isInsideZone(ZoneId.PVP) || (player.getPvpFlag() > 0) || player.isAlikeDead() || player.isOnEvent());
|
||||
return commandCheck && (player.isCastingNow() || player.isCastingSimultaneouslyNow() || player.isInCombat() || player.isInDuel() || player.isInOlympiadMode() || player.isInsideZone(ZoneId.SIEGE) || player.isInsideZone(ZoneId.PVP) || (player.getPvpFlag() > 0) || player.isAlikeDead() || player.isOnCustomEvent());
|
||||
};
|
||||
|
||||
private static final Predicate<PlayerInstance> KARMA_CHECK = player -> Config.COMMUNITYBOARD_KARMA_DISABLED && (player.getKarma() > 0);
|
||||
|
||||
@@ -18,7 +18,6 @@ package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.TvTEvent;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
@@ -140,7 +139,7 @@ public class CallPc extends AbstractEffect
|
||||
return false;
|
||||
}
|
||||
|
||||
if (target.isFestivalParticipant() || target.isFlyingMounted() || target.isCombatFlagEquipped() || !TvTEvent.onEscapeUse(target.getObjectId()))
|
||||
if (target.isFestivalParticipant() || target.isFlyingMounted() || target.isCombatFlagEquipped() || !target.isOnCustomEvent())
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING);
|
||||
return false;
|
||||
|
||||
@@ -18,7 +18,6 @@ package handlers.itemhandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.handler.IItemHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.TvTEvent;
|
||||
import org.l2jmobius.gameserver.model.actor.Playable;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
|
||||
@@ -41,7 +40,7 @@ public class ItemSkillsTemplate implements IItemHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!TvTEvent.onScrollUse(playable.getObjectId()))
|
||||
if (playable.isOnCustomEvent())
|
||||
{
|
||||
playable.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return false;
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package handlers.itemhandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.data.xml.PetDataTable;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.TvTEvent;
|
||||
import org.l2jmobius.gameserver.model.PetData;
|
||||
import org.l2jmobius.gameserver.model.actor.Playable;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
@@ -39,7 +38,7 @@ public class SummonItems extends ItemSkillsTemplate
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!TvTEvent.onItemSummon(playable.getObjectId()))
|
||||
if (playable.isOnCustomEvent())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ import org.l2jmobius.commons.util.Chronos;
|
||||
import org.l2jmobius.gameserver.LoginServerThread;
|
||||
import org.l2jmobius.gameserver.cache.HtmCache;
|
||||
import org.l2jmobius.gameserver.handler.IPunishmentHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.TvTEvent;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.tasks.player.TeleportTask;
|
||||
@@ -185,11 +184,6 @@ public class JailHandler implements IPunishmentHandler
|
||||
{
|
||||
player.setInstanceId(0);
|
||||
|
||||
if (!TvTEvent.isInactive() && TvTEvent.isPlayerParticipant(player.getObjectId()))
|
||||
{
|
||||
TvTEvent.removeParticipant(player.getObjectId());
|
||||
}
|
||||
|
||||
if (Olympiad.getInstance().isRegisteredInComp(player))
|
||||
{
|
||||
Olympiad.getInstance().removeDisconnectedCompetitor(player);
|
||||
|
||||
@@ -20,7 +20,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.ITargetTypeHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.TvTEvent;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -101,7 +100,7 @@ public class Clan implements ITargetTypeHandler
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!TvTEvent.checkForTvTSkill(player, obj, skill))
|
||||
if (player.isOnCustomEvent() && obj.isOnCustomEvent() && (player.getTeam() != obj.getTeam()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.ITargetTypeHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.TvTEvent;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -88,7 +87,7 @@ public class CorpseClan implements ITargetTypeHandler
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!TvTEvent.checkForTvTSkill(player, obj, skill))
|
||||
if (player.isOnCustomEvent() && obj.isOnCustomEvent() && (player.getTeam() != obj.getTeam()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.l2jmobius.gameserver.handler.ITargetTypeHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.TvTEvent;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.WorldObject;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -118,7 +117,7 @@ public class PartyClan implements ITargetTypeHandler
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!TvTEvent.checkForTvTSkill(player, obj, skill))
|
||||
if (player.isOnCustomEvent() && obj.isOnCustomEvent() && (player.getTeam() != obj.getTeam()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||
import org.l2jmobius.gameserver.enums.TeleportWhereType;
|
||||
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.TvTEvent;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.skills.Skill;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
@@ -45,8 +44,7 @@ public class Unstuck implements IUserCommandHandler
|
||||
@Override
|
||||
public boolean useUserCommand(int id, PlayerInstance player)
|
||||
{
|
||||
// Thanks nbd
|
||||
if (!TvTEvent.onEscapeUse(player.getObjectId()))
|
||||
if (player.isRegisteredOnCustomEvent())
|
||||
{
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return false;
|
||||
|
||||
@@ -32,8 +32,6 @@ import org.l2jmobius.gameserver.handler.IVoicedCommandHandler;
|
||||
import org.l2jmobius.gameserver.instancemanager.CoupleManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
|
||||
import org.l2jmobius.gameserver.instancemanager.events.TvTEvent;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
@@ -41,7 +39,6 @@ import org.l2jmobius.gameserver.model.sevensigns.SevenSigns;
|
||||
import org.l2jmobius.gameserver.model.skills.AbnormalVisualEffect;
|
||||
import org.l2jmobius.gameserver.model.skills.Skill;
|
||||
import org.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ConfirmDlg;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SetupGauge;
|
||||
@@ -292,9 +289,9 @@ public class Wedding implements IVoicedCommandHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
if (GameEvent.isParticipant(activeChar))
|
||||
if (activeChar.isRegisteredOnCustomEvent())
|
||||
{
|
||||
activeChar.sendMessage("You are in an event.");
|
||||
activeChar.sendMessage("You are registered in an event.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -328,13 +325,6 @@ public class Wedding implements IVoicedCommandHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
// Thanks nbd
|
||||
if (!TvTEvent.onEscapeUse(activeChar.getObjectId()))
|
||||
{
|
||||
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (activeChar.isInsideZone(ZoneId.NO_SUMMON_FRIEND))
|
||||
{
|
||||
activeChar.sendMessage("You are in area which blocks summoning.");
|
||||
@@ -378,9 +368,9 @@ public class Wedding implements IVoicedCommandHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
if (GameEvent.isParticipant(partner))
|
||||
if (partner.isRegisteredOnCustomEvent())
|
||||
{
|
||||
activeChar.sendMessage("Your partner is in an event.");
|
||||
activeChar.sendMessage("Your partner is registered in an event.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -437,12 +427,6 @@ public class Wedding implements IVoicedCommandHandler
|
||||
}
|
||||
}
|
||||
|
||||
if (!TvTEvent.onEscapeUse(partner.getObjectId()))
|
||||
{
|
||||
activeChar.sendMessage("Your partner is in an event.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (partner.isInsideZone(ZoneId.NO_SUMMON_FRIEND))
|
||||
{
|
||||
activeChar.sendMessage("Your partner is in area which blocks summoning.");
|
||||
|
||||
@@ -6,12 +6,6 @@
|
||||
<height normal="23" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="70010" displayId="31606" name="Catrina" usingServerSideName="true" title="TvT Event Manager" usingServerSideTitle="true" type="Npc">
|
||||
<collision>
|
||||
<radius normal="8" />
|
||||
<height normal="15" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="900100" displayId="20432" level="1" name="Elpy" type="EventMonster">
|
||||
<stats str="40" int="21" dex="30" wit="20" con="43" men="20">
|
||||
<vitals hp="40" hpRegen="3" mp="36" mpRegen="1" />
|
||||
|
||||
Reference in New Issue
Block a user