Addition of Training Camp.
Adapted from: L2jUnity free files.
This commit is contained in:
4
L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Recruiter/4378-01.htm
vendored
Normal file
4
L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Recruiter/4378-01.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Recruiter:<br>
|
||||
Sorry, but you can't enter the camp unless you're on a premium subscription.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest Recruiter 4378.htm">Back</Button>
|
||||
</body></html>
|
6
L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Recruiter/4378-02.htm
vendored
Normal file
6
L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Recruiter/4378-02.htm
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Recruiter:<br>
|
||||
If you're on Premium subscription, and reached Lv. 18, you can request to enter the Training Camp through a recruiter in any town.<br1>Don't worry about the severity of the training, though. Our systematic training will guarantee your growth no matter what.<br1>
|
||||
Remember, time will continue to pass while training, so <font color="LEVEL">the clock is ticking on your buffs and enchants</font>. Also, items that affect XP such as <font color="LEVEL">Runes and Agathions </font> have no effect there.<br>
|
||||
The training is limited to 5 hours a day, so no need to push yourself beyond that. Also, feel free to leave and come back to fill up the rest of the 5 hours!<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest Recruiter 4378.htm">Back</Button>
|
||||
</body></html>
|
5
L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Recruiter/4378-03.htm
vendored
Normal file
5
L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Recruiter/4378-03.htm
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Recruiter:<br>
|
||||
Not a minute goes wasted in the Royal Training Camp. All training is recorded, and you check how much XP and SP you gained by using the camp button. Results will vary by your level upon entry, but rest assured that your training will be adjusted to your level as you become stronger.<br>
|
||||
After 5 hours, or upon your desired exit, you will get your training results calculated into points. Talk to the recruiters and they will help you with it.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest Recruiter 4378.htm">Back</Button>
|
||||
</body></html>
|
10
L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Recruiter/4378-04.htm
vendored
Normal file
10
L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Recruiter/4378-04.htm
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<html><body> Recruiter:<br>
|
||||
Let me check your training history for you.<br1>
|
||||
If you want XP and SP for your training so far, let me know.<br><br>
|
||||
Start Level: <font color="LEVEL">%training_level%</font><br>
|
||||
Training Duration: <font color="LEVEL">%training_time% min.</font><br>
|
||||
XP Earned: <font color="LEVEL">%training_exp%</font><br>
|
||||
SP Earned: <font color="LEVEL">%training_sp%</font><br><br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Recruiter calculate">"Can you calculate my points?"</Button>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest Recruiter 4378.htm">Back</Button>
|
||||
</body></html>
|
4
L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Recruiter/4378-05.htm
vendored
Normal file
4
L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Recruiter/4378-05.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Recruiter:<br>
|
||||
It seems you haven't done much training since you joined. Get some training and then come check your results.<br>
|
||||
<button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest Recruiter 4378.htm">Back</button>
|
||||
</body></html>
|
4
L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Recruiter/4378-06.htm
vendored
Normal file
4
L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Recruiter/4378-06.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Recruiter:<br>
|
||||
There is a report on your training. Look at the results and come back to practice more.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest Recruiter 4378.htm">Back</Button>
|
||||
</body></html>
|
4
L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Recruiter/4378-07.htm
vendored
Normal file
4
L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Recruiter/4378-07.htm
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Recruiter:<br>
|
||||
I hasten to inform you that if you are not a user of a premium subscription, get training in camp will not work.<br>
|
||||
<button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest Recruiter 4378-02.htm">Back</button>
|
||||
</body></html>
|
42
L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Recruiter/4378.htm
vendored
Normal file
42
L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Recruiter/4378.htm
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<html><body scroll="no">
|
||||
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
|
||||
<tr>
|
||||
<td valign="top" align="center">
|
||||
<table border=0 cellpadding=0 cellspacing=0>
|
||||
<tr>
|
||||
<td align=center width=185 height=185 background="BranchSys3.icon2.ArmyTrainingEmblem"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border=0 cellpadding=0 cellspacing=0>
|
||||
<tr>
|
||||
<td align=center>Welcome to the Royal Training Camp!</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height=10></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>Training is the key to strengthening yourself.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height=19></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>
|
||||
<button action="bypass -h Quest Recruiter enter" value="Let me enter." width=200 height=31 back="BranchSys3.icon2.ArmyTrainingBtn_down" fore="BranchSys3.icon2.ArmyTrainingBtn">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>
|
||||
<button action="bypass -h Quest Recruiter info" value="Tell me about this place." width=200 height=31 back="BranchSys3.icon2.ArmyTrainingInfo_down" fore="BranchSys3.icon2.ArmyTrainingInfo">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>
|
||||
<button action="bypass -h Quest Recruiter 4378-04.htm" value="Calculate my points." width=200 height=31 back="L2UI_CT1.HtmlWnd_DF_Awake_Down" fore="L2UI_CT1.HtmlWnd_DF_Awake">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body></html>
|
366
L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Recruiter/Recruiter.java
vendored
Normal file
366
L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/Recruiter/Recruiter.java
vendored
Normal file
@@ -0,0 +1,366 @@
|
||||
/*
|
||||
* 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 ai.others.Recruiter;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.ExperienceData;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
|
||||
import com.l2jmobius.gameserver.model.events.EventType;
|
||||
import com.l2jmobius.gameserver.model.events.ListenerRegisterType;
|
||||
import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
|
||||
import com.l2jmobius.gameserver.model.events.annotations.RegisterType;
|
||||
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLogin;
|
||||
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLogout;
|
||||
import com.l2jmobius.gameserver.model.holders.TrainingHolder;
|
||||
import com.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import com.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.training.ExTrainingZone_Admission;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.training.ExTrainingZone_Leaving;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Recruiter AI.
|
||||
* @author Gladicek
|
||||
*/
|
||||
public final class Recruiter extends AbstractNpcAI
|
||||
{
|
||||
// NPC
|
||||
private static final int RECRUITER = 4378;
|
||||
// Misc
|
||||
private static final Location TRAINING_LOCATION = new Location(-56516, 135938, -2672);
|
||||
|
||||
private Recruiter()
|
||||
{
|
||||
addStartNpc(RECRUITER);
|
||||
addFirstTalkId(RECRUITER);
|
||||
addTalkId(RECRUITER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = null;
|
||||
|
||||
if (!Config.TRAINING_CAMP_ENABLE || !checkConditions(player))
|
||||
{
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
switch (event)
|
||||
{
|
||||
case "4378.htm":
|
||||
case "4378-02.htm":
|
||||
{
|
||||
htmltext = event;
|
||||
break;
|
||||
}
|
||||
case "info":
|
||||
{
|
||||
if (player.hasPremiumStatus() || !Config.TRAINING_CAMP_PREMIUM_ONLY)
|
||||
{
|
||||
htmltext = "4378-02.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "4378-07.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "enter":
|
||||
{
|
||||
final long trainingCampDuration = player.getTraingCampDuration();
|
||||
if (trainingCampDuration >= Config.TRAINING_CAMP_MAX_DURATION)
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_HAVE_COMPLETED_THE_DAY_S_TRAINING);
|
||||
}
|
||||
else if (player.hasPremiumStatus() || !Config.TRAINING_CAMP_PREMIUM_ONLY)
|
||||
{
|
||||
TrainingHolder holder = player.getTraingCampInfo();
|
||||
if ((holder != null) && (holder.getTrainingTime(TimeUnit.MINUTES) < 1))
|
||||
{
|
||||
holder = null;
|
||||
}
|
||||
if (holder == null)
|
||||
{
|
||||
player.disableAutoShotsAll();
|
||||
player.setLastLocation();
|
||||
player.disableAllSkills();
|
||||
player.setIsInvul(true);
|
||||
player.setInvisible(true);
|
||||
player.teleToLocation(TRAINING_LOCATION);
|
||||
player.setIsImmobilized(true);
|
||||
// @Sdw: Here we are supposed to send ExUserInfoEquipSlot with a fake equip of a SLS, feels ugly to me, not doing it.
|
||||
player.setTraingCampInfo(new TrainingHolder(player.getObjectId(), player.getClassIndex(), player.getLevel(), System.currentTimeMillis(), -1));
|
||||
final long timeRemaining = Config.TRAINING_CAMP_MAX_DURATION - trainingCampDuration;
|
||||
if (trainingCampDuration > 0)
|
||||
{
|
||||
player.sendPacket(new ExTrainingZone_Admission(player.getLevel(), 0L, timeRemaining));
|
||||
}
|
||||
else
|
||||
{
|
||||
player.sendPacket(new ExTrainingZone_Admission(player));
|
||||
}
|
||||
|
||||
startQuestTimer("finish", TimeUnit.SECONDS.toMillis(timeRemaining), npc, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "4378-06.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "4378-01.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "4378-04.htm":
|
||||
{
|
||||
final TrainingHolder holder = player.getTraingCampInfo();
|
||||
if ((holder != null) && (holder.getObjectId() == player.getObjectId()))
|
||||
{
|
||||
if (holder.getClassIndex() == player.getClassIndex())
|
||||
{
|
||||
final long trainingTime = Math.max(0, holder.getTrainingTime(TimeUnit.MINUTES));
|
||||
if (trainingTime > 0)
|
||||
{
|
||||
long expGained = 0;
|
||||
long spGained = 0;
|
||||
expGained = (long) ((trainingTime * (ExperienceData.getInstance().getExpForLevel(holder.getLevel()) * ExperienceData.getInstance().getTrainingRate(holder.getLevel()))) / TrainingHolder.getTrainingDivider());
|
||||
spGained = expGained / 250L;
|
||||
String html = getHtm(player.getHtmlPrefix(), "4378-04.htm");
|
||||
html = html.replace("%training_level%", String.valueOf(holder.getLevel()));
|
||||
html = html.replace("%training_time%", String.valueOf(trainingTime));
|
||||
html = html.replace("%training_exp%", String.valueOf(expGained));
|
||||
html = html.replace("%training_sp%", String.valueOf(spGained));
|
||||
htmltext = html;
|
||||
}
|
||||
else
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_CANNOT_RECEIVE_REWARDS_FOR_TRAINING_IF_YOU_HAVE_TRAINED_FOR_LESS_THAN_1_MINUTE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_CAN_ONLY_BE_REWARDED_AS_THE_CLASS_IN_WHICH_YOU_ENTERED_THE_TRAINING_CAMP);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "4378-05.htm";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "calculate":
|
||||
{
|
||||
final TrainingHolder holder = player.getTraingCampInfo();
|
||||
if ((holder != null) && (holder.getObjectId() == player.getObjectId()))
|
||||
{
|
||||
if (holder.getClassIndex() == player.getClassIndex())
|
||||
{
|
||||
final long trainingTime = holder.getTrainingTime(TimeUnit.MINUTES);
|
||||
if (trainingTime > 0)
|
||||
{
|
||||
player.sendPacket(SystemMessageId.CALCULATING_XP_AND_SP_OBTAINED_FROM_TRAINING);
|
||||
|
||||
final long expGained = (long) (trainingTime * (ExperienceData.getInstance().getExpForLevel(player.getLevel()) * ExperienceData.getInstance().getTrainingRate(player.getLevel()))) / TrainingHolder.getTrainingDivider();
|
||||
final long spGained = expGained / 250;
|
||||
player.addExpAndSp(expGained, spGained);
|
||||
|
||||
final SystemMessage sysMsg = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_COMPLETED_TRAINING_IN_THE_ROYAL_TRAINING_CAMP_AND_OBTAINED_S1_XP_AND_S2_SP);
|
||||
sysMsg.addLong(expGained);
|
||||
sysMsg.addLong(spGained);
|
||||
player.sendPacket(sysMsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_CANNOT_RECEIVE_REWARDS_FOR_TRAINING_IF_YOU_HAVE_TRAINED_FOR_LESS_THAN_1_MINUTE);
|
||||
}
|
||||
player.setTraingCampDuration(player.getTraingCampDuration() + holder.getTrainingTime(TimeUnit.SECONDS));
|
||||
player.removeTraingCampInfo();
|
||||
}
|
||||
else
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_CAN_ONLY_BE_REWARDED_AS_THE_CLASS_IN_WHICH_YOU_ENTERED_THE_TRAINING_CAMP);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "finish":
|
||||
{
|
||||
final TrainingHolder holder = player.getTraingCampInfo();
|
||||
if ((holder != null) && (holder.getObjectId() == player.getObjectId()))
|
||||
{
|
||||
holder.setEndTime(System.currentTimeMillis());
|
||||
player.enableAllSkills();
|
||||
player.setIsInvul(false);
|
||||
player.setInvisible(false);
|
||||
player.setIsImmobilized(false);
|
||||
player.teleToLocation(player.getLastLocation());
|
||||
player.unsetLastLocation();
|
||||
player.sendPacket(ExTrainingZone_Leaving.STATIC_PACKET);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
return "4378.htm";
|
||||
}
|
||||
|
||||
private boolean checkConditions(L2PcInstance player)
|
||||
{
|
||||
if (player.getLevel() <= Config.TRAINING_CAMP_MIN_LEVEL)
|
||||
{
|
||||
final SystemMessage sysMsg = SystemMessage.getSystemMessage(SystemMessageId.LV_S1_OR_ABOVE).addInt(Config.TRAINING_CAMP_MIN_LEVEL);
|
||||
player.sendPacket(sysMsg);
|
||||
return false;
|
||||
}
|
||||
else if (player.getLevel() >= Config.TRAINING_CAMP_MAX_LEVEL)
|
||||
{
|
||||
final SystemMessage sysMsg = SystemMessage.getSystemMessage(SystemMessageId.LV_S1_OR_BELOW).addInt(Config.TRAINING_CAMP_MAX_LEVEL);
|
||||
player.sendPacket(sysMsg);
|
||||
return false;
|
||||
}
|
||||
else if (player.isFlyingMounted() || player.isTransformed())
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_CANNOT_ENTER_THE_TRAINING_CAMP_WITH_A_MOUNT_OR_IN_A_TRANSFORMED_STATE);
|
||||
return false;
|
||||
}
|
||||
final TrainingHolder holder = player.getTraingCampInfo();
|
||||
if ((holder != null) && (holder.getObjectId() != player.getObjectId()))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.ONLY_ONE_CHARACTER_PER_ACCOUNT_MAY_ENTER_AT_ANY_TIME);
|
||||
return false;
|
||||
}
|
||||
else if (player.isInParty())
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_CANNOT_ENTER_THE_TRAINING_CAMP_WHILE_IN_A_PARTY_OR_USING_THE_AUTOMATIC_REPLACEMENT_SYSTEM);
|
||||
return false;
|
||||
}
|
||||
else if (player.isCursedWeaponEquipped() || (player.getReputation() < 0))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (player.isInDuel())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (player.isInOlympiadMode() || OlympiadManager.getInstance().isRegistered(player))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (player.isOnEvent(CeremonyOfChaosEvent.class) || (player.getBlockCheckerArena() > -1)) // TODO underground coliseum and kratei checks.
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (player.isOnEvent()) // custom event message
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (player.isInInstance())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (player.isInSiege())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (player.isInsideZone(ZoneId.SIEGE))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (player.isFishing())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (player.hasServitors())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@RegisterEvent(EventType.ON_PLAYER_LOGIN)
|
||||
@RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
|
||||
public void OnPlayerLogin(OnPlayerLogin event)
|
||||
{
|
||||
final L2PcInstance player = event.getActiveChar();
|
||||
final TrainingHolder holder = player.getTraingCampInfo();
|
||||
if (holder == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (holder.isValid(player) && holder.isTraining())
|
||||
{
|
||||
final long elapsedTime = holder.getElapsedTime(System.currentTimeMillis(), TimeUnit.SECONDS);
|
||||
if (elapsedTime < Config.TRAINING_CAMP_MAX_DURATION)
|
||||
{
|
||||
player.setLastLocation();
|
||||
player.disableAllSkills();
|
||||
player.setIsInvul(true);
|
||||
player.setInvisible(true);
|
||||
player.teleToLocation(TRAINING_LOCATION);
|
||||
player.setIsImmobilized(true);
|
||||
final long remainingDuration = Config.TRAINING_CAMP_MAX_DURATION - player.getTraingCampDuration() - elapsedTime;
|
||||
player.sendPacket(new ExTrainingZone_Admission(holder.getLevel(), TimeUnit.SECONDS.toMinutes(elapsedTime), remainingDuration));
|
||||
startQuestTimer("finish", TimeUnit.SECONDS.toMillis(remainingDuration), null, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
holder.setEndTime(holder.getStartTime() + (Config.TRAINING_CAMP_MAX_DURATION * 1000));
|
||||
player.setTraingCampInfo(holder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@RegisterEvent(EventType.ON_PLAYER_LOGOUT)
|
||||
@RegisterType(ListenerRegisterType.GLOBAL)
|
||||
public void OnPlayerLogout(OnPlayerLogout event)
|
||||
{
|
||||
final L2PcInstance player = event.getActiveChar();
|
||||
final TrainingHolder holder = player.getTraingCampInfo();
|
||||
if (holder == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (holder.isValid(player) && holder.isTraining())
|
||||
{
|
||||
cancelQuestTimer("finish", null, player);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Recruiter();
|
||||
}
|
||||
}
|
@@ -125,7 +125,7 @@ public final class CallPc extends AbstractEffect
|
||||
return false;
|
||||
}
|
||||
|
||||
if (target.isFlyingMounted() || target.isCombatFlagEquipped())
|
||||
if (target.isFlyingMounted() || target.isCombatFlagEquipped() || target.isInTraingCamp())
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.YOU_CANNOT_USE_SUMMONING_OR_TELEPORTING_IN_THIS_AREA);
|
||||
return false;
|
||||
|
@@ -86,7 +86,7 @@ public class TeleportToPlayer extends AbstractEffect
|
||||
return;
|
||||
}
|
||||
|
||||
if (target.isFlyingMounted() || target.isCombatFlagEquipped())
|
||||
if (target.isFlyingMounted() || target.isCombatFlagEquipped() || target.isInTraingCamp())
|
||||
{
|
||||
effector.sendPacket(SystemMessageId.YOU_CANNOT_USE_SUMMONING_OR_TELEPORTING_IN_THIS_AREA);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user