Training Camp improvements.

This commit is contained in:
MobiusDev
2017-11-17 23:15:03 +00:00
parent cef624e6cd
commit 3d903d2c8f
41 changed files with 107 additions and 99 deletions

View File

@@ -1,4 +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>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</Button>
</body></html>

View File

@@ -2,5 +2,5 @@
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 &nbsp;<font color="LEVEL">the clock is ticking on your buffs and enchants</font>. Also, items that affect XP such as &nbsp;<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>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</Button>
</body></html>

View File

@@ -1,5 +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>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</Button>
</body></html>

View File

@@ -5,6 +5,6 @@ Start Level: &nbsp;<font color="LEVEL">%training_level%</font><br>
Training Duration: &nbsp;<font color="LEVEL">%training_time%&nbsp;min.</font><br>
XP Earned: &nbsp;<font color="LEVEL">%training_exp%</font><br>
SP Earned: &nbsp;<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>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest TrainingCamp calculate">"Can you calculate my points?"</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</Button>
</body></html>

View File

@@ -1,4 +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>
<button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</button>
</body></html>

View File

@@ -1,4 +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>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</Button>
</body></html>

View File

@@ -1,4 +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>
<button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378-02.htm">Back</button>
</body></html>

View File

@@ -22,17 +22,17 @@
</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">
<button action="bypass -h Quest TrainingCamp 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">
<button action="bypass -h Quest TrainingCamp 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">
<button action="bypass -h Quest TrainingCamp 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>

View File

@@ -14,7 +14,7 @@
* 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;
package ai.others.TrainingCamp;
import java.util.concurrent.TimeUnit;
@@ -41,17 +41,17 @@ import com.l2jmobius.gameserver.network.serverpackets.training.ExTrainingZone_Le
import ai.AbstractNpcAI;
/**
* Recruiter AI.
* @author Gladicek
* TrainingCamp AI.
* @author Gladicek, Mobius
*/
public final class Recruiter extends AbstractNpcAI
public final class TrainingCamp extends AbstractNpcAI
{
// NPC
private static final int RECRUITER = 4378;
// Misc
private static final Location TRAINING_LOCATION = new Location(-56516, 135938, -2672);
private Recruiter()
private TrainingCamp()
{
addStartNpc(RECRUITER);
addFirstTalkId(RECRUITER);
@@ -312,8 +312,9 @@ public final class Recruiter extends AbstractNpcAI
if (holder.isValid(player) && holder.isTraining())
{
final long elapsedTime = holder.getElapsedTime(System.currentTimeMillis(), TimeUnit.SECONDS);
if (elapsedTime < Config.TRAINING_CAMP_MAX_DURATION)
final long elapsedTime = holder.getElapsedTime();
final long remainingPlayerTime = Config.TRAINING_CAMP_MAX_DURATION - player.getTraingCampDuration();
if (elapsedTime < remainingPlayerTime)
{
player.setLastLocation();
player.disableAllSkills();
@@ -321,14 +322,15 @@ public final class Recruiter extends AbstractNpcAI
player.setInvisible(true);
player.teleToLocation(TRAINING_LOCATION);
player.setIsImmobilized(true);
final long remainingDuration = Config.TRAINING_CAMP_MAX_DURATION - player.getTraingCampDuration() - elapsedTime;
final long remainingDuration = remainingPlayerTime - 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));
holder.setEndTime(holder.getStartTime() + (remainingPlayerTime * 1000));
player.setTraingCampInfo(holder);
player.sendPacket(SystemMessageId.YOU_HAVE_COMPLETED_THE_DAY_S_TRAINING);
}
}
}
@@ -352,6 +354,6 @@ public final class Recruiter extends AbstractNpcAI
public static void main(String[] args)
{
new Recruiter();
new TrainingCamp();
}
}

View File

@@ -83,14 +83,14 @@ public class TrainingHolder implements Serializable
return Config.TRAINING_CAMP_ENABLE && (player.getObjectId() == _objectId) && (player.getClassIndex() == _classIndex);
}
public long getElapsedTime(long time, TimeUnit unit)
public long getElapsedTime()
{
return unit.convert(time - _startTime, TimeUnit.MILLISECONDS);
return TimeUnit.SECONDS.convert(System.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
}
public long getRemainingTime()
{
return TimeUnit.SECONDS.toMinutes(Config.TRAINING_CAMP_MAX_DURATION - getElapsedTime(System.currentTimeMillis(), TimeUnit.SECONDS));
return TimeUnit.SECONDS.toMinutes(Config.TRAINING_CAMP_MAX_DURATION - getElapsedTime());
}
public long getRemainingTime(long time)

View File

@@ -1,4 +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>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</Button>
</body></html>

View File

@@ -2,5 +2,5 @@
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 &nbsp;<font color="LEVEL">the clock is ticking on your buffs and enchants</font>. Also, items that affect XP such as &nbsp;<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>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</Button>
</body></html>

View File

@@ -1,5 +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>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</Button>
</body></html>

View File

@@ -5,6 +5,6 @@ Start Level: &nbsp;<font color="LEVEL">%training_level%</font><br>
Training Duration: &nbsp;<font color="LEVEL">%training_time%&nbsp;min.</font><br>
XP Earned: &nbsp;<font color="LEVEL">%training_exp%</font><br>
SP Earned: &nbsp;<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>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest TrainingCamp calculate">"Can you calculate my points?"</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</Button>
</body></html>

View File

@@ -1,4 +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>
<button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</button>
</body></html>

View File

@@ -1,4 +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>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</Button>
</body></html>

View File

@@ -1,4 +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>
<button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378-02.htm">Back</button>
</body></html>

View File

@@ -22,17 +22,17 @@
</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">
<button action="bypass -h Quest TrainingCamp 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">
<button action="bypass -h Quest TrainingCamp 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">
<button action="bypass -h Quest TrainingCamp 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>

View File

@@ -14,7 +14,7 @@
* 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;
package ai.others.TrainingCamp;
import java.util.concurrent.TimeUnit;
@@ -41,17 +41,17 @@ import com.l2jmobius.gameserver.network.serverpackets.training.ExTrainingZone_Le
import ai.AbstractNpcAI;
/**
* Recruiter AI.
* @author Gladicek
* TrainingCamp AI.
* @author Gladicek, Mobius
*/
public final class Recruiter extends AbstractNpcAI
public final class TrainingCamp extends AbstractNpcAI
{
// NPC
private static final int RECRUITER = 4378;
// Misc
private static final Location TRAINING_LOCATION = new Location(-56516, 135938, -2672);
private Recruiter()
private TrainingCamp()
{
addStartNpc(RECRUITER);
addFirstTalkId(RECRUITER);
@@ -312,8 +312,9 @@ public final class Recruiter extends AbstractNpcAI
if (holder.isValid(player) && holder.isTraining())
{
final long elapsedTime = holder.getElapsedTime(System.currentTimeMillis(), TimeUnit.SECONDS);
if (elapsedTime < Config.TRAINING_CAMP_MAX_DURATION)
final long elapsedTime = holder.getElapsedTime();
final long remainingPlayerTime = Config.TRAINING_CAMP_MAX_DURATION - player.getTraingCampDuration();
if (elapsedTime < remainingPlayerTime)
{
player.setLastLocation();
player.disableAllSkills();
@@ -321,14 +322,15 @@ public final class Recruiter extends AbstractNpcAI
player.setInvisible(true);
player.teleToLocation(TRAINING_LOCATION);
player.setIsImmobilized(true);
final long remainingDuration = Config.TRAINING_CAMP_MAX_DURATION - player.getTraingCampDuration() - elapsedTime;
final long remainingDuration = remainingPlayerTime - 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));
holder.setEndTime(holder.getStartTime() + (remainingPlayerTime * 1000));
player.setTraingCampInfo(holder);
player.sendPacket(SystemMessageId.YOU_HAVE_COMPLETED_THE_DAY_S_TRAINING);
}
}
}
@@ -352,6 +354,6 @@ public final class Recruiter extends AbstractNpcAI
public static void main(String[] args)
{
new Recruiter();
new TrainingCamp();
}
}

View File

@@ -83,14 +83,14 @@ public class TrainingHolder implements Serializable
return Config.TRAINING_CAMP_ENABLE && (player.getObjectId() == _objectId) && (player.getClassIndex() == _classIndex);
}
public long getElapsedTime(long time, TimeUnit unit)
public long getElapsedTime()
{
return unit.convert(time - _startTime, TimeUnit.MILLISECONDS);
return TimeUnit.SECONDS.convert(System.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
}
public long getRemainingTime()
{
return TimeUnit.SECONDS.toMinutes(Config.TRAINING_CAMP_MAX_DURATION - getElapsedTime(System.currentTimeMillis(), TimeUnit.SECONDS));
return TimeUnit.SECONDS.toMinutes(Config.TRAINING_CAMP_MAX_DURATION - getElapsedTime());
}
public long getRemainingTime(long time)

View File

@@ -1,4 +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>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</Button>
</body></html>

View File

@@ -2,5 +2,5 @@
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 &nbsp;<font color="LEVEL">the clock is ticking on your buffs and enchants</font>. Also, items that affect XP such as &nbsp;<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>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</Button>
</body></html>

View File

@@ -1,5 +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>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</Button>
</body></html>

View File

@@ -5,6 +5,6 @@ Start Level: &nbsp;<font color="LEVEL">%training_level%</font><br>
Training Duration: &nbsp;<font color="LEVEL">%training_time%&nbsp;min.</font><br>
XP Earned: &nbsp;<font color="LEVEL">%training_exp%</font><br>
SP Earned: &nbsp;<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>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest TrainingCamp calculate">"Can you calculate my points?"</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</Button>
</body></html>

View File

@@ -1,4 +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>
<button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</button>
</body></html>

View File

@@ -1,4 +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>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</Button>
</body></html>

View File

@@ -1,4 +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>
<button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378-02.htm">Back</button>
</body></html>

View File

@@ -22,17 +22,17 @@
</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">
<button action="bypass -h Quest TrainingCamp 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">
<button action="bypass -h Quest TrainingCamp 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">
<button action="bypass -h Quest TrainingCamp 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>

View File

@@ -14,7 +14,7 @@
* 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;
package ai.others.TrainingCamp;
import java.util.concurrent.TimeUnit;
@@ -41,17 +41,17 @@ import com.l2jmobius.gameserver.network.serverpackets.training.ExTrainingZone_Le
import ai.AbstractNpcAI;
/**
* Recruiter AI.
* @author Gladicek
* TrainingCamp AI.
* @author Gladicek, Mobius
*/
public final class Recruiter extends AbstractNpcAI
public final class TrainingCamp extends AbstractNpcAI
{
// NPC
private static final int RECRUITER = 4378;
// Misc
private static final Location TRAINING_LOCATION = new Location(-56516, 135938, -2672);
private Recruiter()
private TrainingCamp()
{
addStartNpc(RECRUITER);
addFirstTalkId(RECRUITER);
@@ -312,8 +312,9 @@ public final class Recruiter extends AbstractNpcAI
if (holder.isValid(player) && holder.isTraining())
{
final long elapsedTime = holder.getElapsedTime(System.currentTimeMillis(), TimeUnit.SECONDS);
if (elapsedTime < Config.TRAINING_CAMP_MAX_DURATION)
final long elapsedTime = holder.getElapsedTime();
final long remainingPlayerTime = Config.TRAINING_CAMP_MAX_DURATION - player.getTraingCampDuration();
if (elapsedTime < remainingPlayerTime)
{
player.setLastLocation();
player.disableAllSkills();
@@ -321,14 +322,15 @@ public final class Recruiter extends AbstractNpcAI
player.setInvisible(true);
player.teleToLocation(TRAINING_LOCATION);
player.setIsImmobilized(true);
final long remainingDuration = Config.TRAINING_CAMP_MAX_DURATION - player.getTraingCampDuration() - elapsedTime;
final long remainingDuration = remainingPlayerTime - 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));
holder.setEndTime(holder.getStartTime() + (remainingPlayerTime * 1000));
player.setTraingCampInfo(holder);
player.sendPacket(SystemMessageId.YOU_HAVE_COMPLETED_THE_DAY_S_TRAINING);
}
}
}
@@ -352,6 +354,6 @@ public final class Recruiter extends AbstractNpcAI
public static void main(String[] args)
{
new Recruiter();
new TrainingCamp();
}
}

View File

@@ -83,14 +83,14 @@ public class TrainingHolder implements Serializable
return Config.TRAINING_CAMP_ENABLE && (player.getObjectId() == _objectId) && (player.getClassIndex() == _classIndex);
}
public long getElapsedTime(long time, TimeUnit unit)
public long getElapsedTime()
{
return unit.convert(time - _startTime, TimeUnit.MILLISECONDS);
return TimeUnit.SECONDS.convert(System.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
}
public long getRemainingTime()
{
return TimeUnit.SECONDS.toMinutes(Config.TRAINING_CAMP_MAX_DURATION - getElapsedTime(System.currentTimeMillis(), TimeUnit.SECONDS));
return TimeUnit.SECONDS.toMinutes(Config.TRAINING_CAMP_MAX_DURATION - getElapsedTime());
}
public long getRemainingTime(long time)

View File

@@ -1,4 +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>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</Button>
</body></html>

View File

@@ -2,5 +2,5 @@
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 &nbsp;<font color="LEVEL">the clock is ticking on your buffs and enchants</font>. Also, items that affect XP such as &nbsp;<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>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</Button>
</body></html>

View File

@@ -1,5 +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>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</Button>
</body></html>

View File

@@ -5,6 +5,6 @@ Start Level: &nbsp;<font color="LEVEL">%training_level%</font><br>
Training Duration: &nbsp;<font color="LEVEL">%training_time%&nbsp;min.</font><br>
XP Earned: &nbsp;<font color="LEVEL">%training_exp%</font><br>
SP Earned: &nbsp;<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>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest TrainingCamp calculate">"Can you calculate my points?"</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</Button>
</body></html>

View File

@@ -1,4 +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>
<button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</button>
</body></html>

View File

@@ -1,4 +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>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378.htm">Back</Button>
</body></html>

View File

@@ -1,4 +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>
<button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest TrainingCamp 4378-02.htm">Back</button>
</body></html>

View File

@@ -22,17 +22,17 @@
</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">
<button action="bypass -h Quest TrainingCamp 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">
<button action="bypass -h Quest TrainingCamp 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">
<button action="bypass -h Quest TrainingCamp 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>

View File

@@ -14,7 +14,7 @@
* 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;
package ai.others.TrainingCamp;
import java.util.concurrent.TimeUnit;
@@ -41,17 +41,17 @@ import com.l2jmobius.gameserver.network.serverpackets.training.ExTrainingZone_Le
import ai.AbstractNpcAI;
/**
* Recruiter AI.
* @author Gladicek
* TrainingCamp AI.
* @author Gladicek, Mobius
*/
public final class Recruiter extends AbstractNpcAI
public final class TrainingCamp extends AbstractNpcAI
{
// NPC
private static final int RECRUITER = 4378;
// Misc
private static final Location TRAINING_LOCATION = new Location(-56516, 135938, -2672);
private Recruiter()
private TrainingCamp()
{
addStartNpc(RECRUITER);
addFirstTalkId(RECRUITER);
@@ -312,8 +312,9 @@ public final class Recruiter extends AbstractNpcAI
if (holder.isValid(player) && holder.isTraining())
{
final long elapsedTime = holder.getElapsedTime(System.currentTimeMillis(), TimeUnit.SECONDS);
if (elapsedTime < Config.TRAINING_CAMP_MAX_DURATION)
final long elapsedTime = holder.getElapsedTime();
final long remainingPlayerTime = Config.TRAINING_CAMP_MAX_DURATION - player.getTraingCampDuration();
if (elapsedTime < remainingPlayerTime)
{
player.setLastLocation();
player.disableAllSkills();
@@ -321,14 +322,15 @@ public final class Recruiter extends AbstractNpcAI
player.setInvisible(true);
player.teleToLocation(TRAINING_LOCATION);
player.setIsImmobilized(true);
final long remainingDuration = Config.TRAINING_CAMP_MAX_DURATION - player.getTraingCampDuration() - elapsedTime;
final long remainingDuration = remainingPlayerTime - 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));
holder.setEndTime(holder.getStartTime() + (remainingPlayerTime * 1000));
player.setTraingCampInfo(holder);
player.sendPacket(SystemMessageId.YOU_HAVE_COMPLETED_THE_DAY_S_TRAINING);
}
}
}
@@ -352,6 +354,6 @@ public final class Recruiter extends AbstractNpcAI
public static void main(String[] args)
{
new Recruiter();
new TrainingCamp();
}
}

View File

@@ -83,14 +83,14 @@ public class TrainingHolder implements Serializable
return Config.TRAINING_CAMP_ENABLE && (player.getObjectId() == _objectId) && (player.getClassIndex() == _classIndex);
}
public long getElapsedTime(long time, TimeUnit unit)
public long getElapsedTime()
{
return unit.convert(time - _startTime, TimeUnit.MILLISECONDS);
return TimeUnit.SECONDS.convert(System.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
}
public long getRemainingTime()
{
return TimeUnit.SECONDS.toMinutes(Config.TRAINING_CAMP_MAX_DURATION - getElapsedTime(System.currentTimeMillis(), TimeUnit.SECONDS));
return TimeUnit.SECONDS.toMinutes(Config.TRAINING_CAMP_MAX_DURATION - getElapsedTime());
}
public long getRemainingTime(long time)

View File

@@ -83,14 +83,14 @@ public class TrainingHolder implements Serializable
return Config.TRAINING_CAMP_ENABLE && (player.getObjectId() == _objectId) && (player.getClassIndex() == _classIndex);
}
public long getElapsedTime(long time, TimeUnit unit)
public long getElapsedTime()
{
return unit.convert(time - _startTime, TimeUnit.MILLISECONDS);
return TimeUnit.SECONDS.convert(System.currentTimeMillis() - _startTime, TimeUnit.MILLISECONDS);
}
public long getRemainingTime()
{
return TimeUnit.SECONDS.toMinutes(Config.TRAINING_CAMP_MAX_DURATION - getElapsedTime(System.currentTimeMillis(), TimeUnit.SECONDS));
return TimeUnit.SECONDS.toMinutes(Config.TRAINING_CAMP_MAX_DURATION - getElapsedTime());
}
public long getRemainingTime(long time)