Olympiad rework.
Contributed by facab.
This commit is contained in:
@@ -17,14 +17,14 @@ AltOlyStartTime = 20
|
||||
# Default: 00
|
||||
AltOlyMin = 00
|
||||
|
||||
# Olympiad Competition Period, Default 6 hours.
|
||||
# Olympiad Competition Period, Default 4 hours.
|
||||
# (If set different, should be increment by 10mins)
|
||||
# Default: 14400000
|
||||
AltOlyCPeriod = 14400000
|
||||
|
||||
# Olympiad Battle Period, Default 6 minutes.
|
||||
# Default: 360000
|
||||
AltOlyBattle = 360000
|
||||
# Olympiad Battle Period, Default 5 minutes.
|
||||
# Default: 300000
|
||||
AltOlyBattle = 300000
|
||||
|
||||
# Olympiad Weekly Period, Default 1 week
|
||||
# Used for adding points to nobles
|
||||
@@ -51,11 +51,6 @@ AltOlyClassedParticipants = 20
|
||||
# Default: 10
|
||||
AltOlyNonClassedParticipants = 10
|
||||
|
||||
# Number used for displaying amount of registered participants, messages "Fewer than ..." or "More than ...".
|
||||
# 0 for displaying digits instead of text phrase (old style).
|
||||
# Default: 100
|
||||
AltOlyRegistrationDisplayNumber = 100
|
||||
|
||||
# Reward for the winner
|
||||
# Format: itemId1,itemNum1;itemId2,itemNum2...
|
||||
# Default: 45584,12
|
||||
@@ -133,7 +128,8 @@ AltOlyWaitTime = 120
|
||||
|
||||
# Divider for points in classed and non-classed games
|
||||
# Default: 5
|
||||
AltOlyDivider = 5
|
||||
AltOlyDividerClassed = 5
|
||||
AltOlyDividerNonClassed = 5
|
||||
|
||||
# Maximum number of matches a Noblesse character can join per week
|
||||
# Default: 30
|
||||
@@ -143,18 +139,6 @@ AltOlyMaxWeeklyMatches = 30
|
||||
# Default: 6,7 (FRIDAY,SATURDAY)
|
||||
AltOlyCompetitionDays = 6,7
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Custom Olympiad period settings
|
||||
# ---------------------------------------------------------------------------
|
||||
# Example for Olympiad every 2 weeks:
|
||||
# AltOlyUseCustomPeriodSettings = True
|
||||
# AltOlyPeriod = WEEK
|
||||
# AltOlyPeriodMultiplier = 2
|
||||
# ---------------------------------------------------------------------------
|
||||
# Enable/disable custom period settings.
|
||||
# Default: False
|
||||
AltOlyUseCustomPeriodSettings = False
|
||||
|
||||
# Change the type of delay between two Olympiads.
|
||||
# Available values: MONTH, WEEK, DAY
|
||||
# Default: MONTH
|
||||
|
||||
@@ -19,7 +19,6 @@ package ai.others.OlyBuffer;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import org.l2jmobius.gameserver.model.skills.Skill;
|
||||
import org.l2jmobius.gameserver.model.skills.SkillCaster;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
@@ -66,41 +65,37 @@ public final class OlyBuffer extends AbstractNpcAI
|
||||
@Override
|
||||
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
|
||||
{
|
||||
String htmltext = null;
|
||||
|
||||
switch (event)
|
||||
{
|
||||
case "guardian":
|
||||
{
|
||||
htmltext = applyBuffs(npc, player, KNIGHT.getSkill());
|
||||
applyBuffs(npc, player, KNIGHT);
|
||||
break;
|
||||
}
|
||||
case "berserker":
|
||||
{
|
||||
htmltext = applyBuffs(npc, player, WARRIOR.getSkill());
|
||||
applyBuffs(npc, player, WARRIOR);
|
||||
break;
|
||||
}
|
||||
case "magician":
|
||||
{
|
||||
htmltext = applyBuffs(npc, player, WIZARD.getSkill());
|
||||
applyBuffs(npc, player, WIZARD);
|
||||
break;
|
||||
}
|
||||
}
|
||||
npc.setScriptValue(1);
|
||||
htmltext = "olympiad_master003.htm";
|
||||
getTimers().addTimer("DELETE_ME", 5000, evnt -> npc.deleteMe());
|
||||
|
||||
return htmltext;
|
||||
return "olympiad_master003.htm";
|
||||
}
|
||||
|
||||
private String applyBuffs(Npc npc, PlayerInstance player, Skill skill)
|
||||
private void applyBuffs(Npc npc, PlayerInstance player, SkillHolder skill)
|
||||
{
|
||||
for (SkillHolder holder : BUFFS)
|
||||
{
|
||||
SkillCaster.triggerCast(npc, player, holder.getSkill());
|
||||
}
|
||||
SkillCaster.triggerCast(npc, player, skill);
|
||||
return null;
|
||||
SkillCaster.triggerCast(npc, player, skill.getSkill());
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<tr><td height=15></td></tr>
|
||||
<tr><td align=center><font color="bea27b">(Round %olympiad_round%, Week %olympiad_week%, Number of current participants: %olympiad_participant%)</font></td></tr>
|
||||
<tr><td height=34></td></tr>
|
||||
<tr><td align=center><button action="bypass -h Quest OlyManager register1v1class" msg="1481" value="1 vs 1 Match" width=200 height=31 back="L2UI_CT1.OlympiadWnd_DF_Fight1None_Down" fore="L2UI_CT1.OlympiadWnd_DF_Fight1None"></td></tr>
|
||||
<tr><td align=center><button action="bypass -h Quest OlyManager register1v1" msg="1481" value="1 vs 1 Match" width=200 height=31 back="L2UI_CT1.OlympiadWnd_DF_Fight1None_Down" fore="L2UI_CT1.OlympiadWnd_DF_Fight1None"></td></tr>
|
||||
<tr><td align=center><button action="bypass -h Quest OlyManager index" value="Back" width=200 height=31 back="L2UI_CT1.OlympiadWnd_DF_Back_Down" fore="L2UI_CT1.OlympiadWnd_DF_Back"></td></tr>
|
||||
<tr><td height=80></td></tr>
|
||||
</table>
|
||||
|
||||
@@ -116,18 +116,16 @@ public final class OlyManager extends AbstractNpcAI implements IBypassHandler
|
||||
{
|
||||
switch (LocalDate.now().get(WeekFields.of(DayOfWeek.MONDAY, 7).weekOfMonth()))
|
||||
{
|
||||
case 1:
|
||||
case 2:
|
||||
case 3: // First 3 weeks of month is 1v1 + 1v1 class matches
|
||||
{
|
||||
htmltext = getHtm(player, "OlyManager-joinMatch.html");
|
||||
break;
|
||||
}
|
||||
default:// Rest is only 1v1 class matches
|
||||
case 1: // First week is class and non-class battles
|
||||
{
|
||||
htmltext = getHtm(player, "OlyManager-joinMatchClass.html");
|
||||
break;
|
||||
}
|
||||
default:// Rest is only 1v1 non-class matches
|
||||
{
|
||||
htmltext = getHtm(player, "OlyManager-joinMatch.html");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
htmltext = htmltext.replace("%olympiad_round%", String.valueOf(Olympiad.getInstance().getPeriod()));
|
||||
@@ -159,10 +157,11 @@ public final class OlyManager extends AbstractNpcAI implements IBypassHandler
|
||||
{
|
||||
OlympiadManager.getInstance().registerNoble(player, CompetitionType.NON_CLASSED);
|
||||
}
|
||||
else
|
||||
else if (LocalDate.now().get(WeekFields.of(DayOfWeek.MONDAY, 7).weekOfMonth()) == 1) // Only first week is class match possible
|
||||
{
|
||||
OlympiadManager.getInstance().registerNoble(player, CompetitionType.CLASSED);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case "unregister":
|
||||
|
||||
Reference in New Issue
Block a user