Addition of World Olympiad.

Thanks to nasseka and Sero.
This commit is contained in:
MobiusDevelopment
2022-08-04 08:21:23 +00:00
parent 22ebdb3e82
commit 8acc1890e2
196 changed files with 7261 additions and 1343 deletions

View File

@@ -0,0 +1,26 @@
<html><body>
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
<tr><td height=34></td></tr>
<tr><td align=center>Select a weapon that suits you.</td></tr>
<tr><td height=30></td></tr>
<tr><td align=center>
<a action="bypass -h Quest MonumentOfHeroes give_48554" msg="1484">Legend's Infinity Shaper (Dagger)</a><br>
<a action="bypass -h Quest MonumentOfHeroes give_48555" msg="1484">Legend's Infinity Cutter (1-H Sword)</a><br>
<a action="bypass -h Quest MonumentOfHeroes give_48556" msg="1484">Legend's Infinity Slasher (2-H Sword)</a><br>
<a action="bypass -h Quest MonumentOfHeroes give_48557" msg="1484">Legend's Infinity Avenger (1-H Blunt Weapon)</a><br>
<a action="bypass -h Quest MonumentOfHeroes give_48558" msg="1484">Legend's Infinity Fighter (Fist)</a><br>
<a action="bypass -h Quest MonumentOfHeroes give_48559" msg="1484">Legend's Infinity Stormer (Polearm)</a><br>
<a action="bypass -h Quest MonumentOfHeroes give_48560" msg="1484">Legend's Infinity Thrower (Bow)</a><br>
<a action="bypass -h Quest MonumentOfHeroes give_48561" msg="1484">Legend's Infinity Shooter (Crossbow)</a><br>
<a action="bypass -h Quest MonumentOfHeroes give_48562" msg="1484">Legend's Infinity Buster (Magic Sword)</a><br>
<a action="bypass -h Quest MonumentOfHeroes give_48563" msg="1484">Legend's Infinity Caster (Magic Blunt Weapon)</a><br>
<a action="bypass -h Quest MonumentOfHeroes give_48564" msg="1484">Legend's Infinity Retributer (Two-handed Magic Blunt Weapon)</a><br>
<a action="bypass -h Quest MonumentOfHeroes give_48565" msg="1484">Legend's Infinity Dual Sword (Dual Swords)</a><br>
<a action="bypass -h Quest MonumentOfHeroes give_48566" msg="1484">Legend's Infinity Dual Dagger (Dual Daggers)</a><br>
<a action="bypass -h Quest MonumentOfHeroes give_48567" msg="1484">Legend's Infinity Dual Blunt Weapon (Dual Blunt Weapon)</a><br>
</td></tr>
<tr><td height=34></td></tr>
<tr><td align=center><button action="bypass -h Quest MonumentOfHeroes 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=30></td></tr>
</table>
</body></html>

View File

@@ -67,6 +67,23 @@ public class MonumentOfHeroes extends AbstractNpcAI
30404, // Infinity Dual Dagger (Dual Daggers)
30405, // Infinity Dual Blunt Weapon (Dual Blunt Weapon)
};
private static final int[] WEAPONS_LEGEND =
{
48554, // Legend's Infinity Shaper (dagger)
48555, // Legend's Infinity Cutter (1-H Sword)
48556, // Legend's Infinity Slasher (2-H Sword)
48557, // Legend's Infinity Avenger (1-H Blunt Weapon)
48558, // Legend's Infinity Fighter (Fist)
48559, // Legend's Infinity Stormer (Polearm)
48560, // Legend's Infinity Thrower (bow)
48561, // Legend's Infinity Guardian (crossbow)
48562, // Legend's Infinity Buster (magic sword)
48563, // Legend's Infinity Caster (magic blunt weapon)
48564, // Legend's Infinity Retributer (two-handed magic blunt weapon)
48565, // Legend's Infinity Dual Sword (Dual Swords)
48566, // Legend's Infinity Dual Dagger (Dual Daggers)
48567, // Legend's Infinity Dual Blunt Weapon (Dual Blunt Weapon)
};
private MonumentOfHeroes()
{
@@ -143,7 +160,18 @@ public class MonumentOfHeroes extends AbstractNpcAI
}
case "heroWeapon":
{
if (Hero.getInstance().isHero(player.getObjectId()))
if (player.isLegend())
{
if (player.isInventoryUnder80(false))
{
htmltext = hasAtLeastOneQuestItem(player, WEAPONS_LEGEND) || hasAtLeastOneQuestItem(player, WEAPONS) ? "MonumentOfHeroes-weaponHave.html" : "MonumentOfHeroes-weaponListLegend.html";
}
else
{
player.sendPacket(SystemMessageId.NOT_ENOUGH_SPACE_IN_THE_INVENTORY_UNABLE_TO_PROCESS_THIS_REQUEST_UNTIL_YOUR_INVENTORY_S_WEIGHT_AND_SLOT_COUNT_ARE_LESS_THAN_80_PERCENT_OF_CAPACITY);
}
}
else if (Hero.getInstance().isHero(player.getObjectId()))
{
if (player.isInventoryUnder80(false))
{
@@ -270,6 +298,25 @@ public class MonumentOfHeroes extends AbstractNpcAI
giveItems(player, weaponId, 1);
break;
}
case "give_48554": // Infinity Shaper (dagger)
case "give_48555": // Infinity Cutter (1-H Sword)
case "give_48556": // Infinity Slasher (2-H Sword)
case "give_48557": // Infinity Avenger (1-H Blunt Weapon)
case "give_48558": // Infinity Fighter (Fist)
case "give_48559": // Infinity Stormer (Polearm)
case "give_48560": // Infinity Thrower (bow)
case "give_48561": // Infinity Shooter (crossbow)
case "give_48562": // Infinity Buster (magic sword)
case "give_48563": // Infinity Caster (magic blunt weapon)
case "give_48564": // Infinity Retributer (two-handed magic blunt weapon)
case "give_48565": // Infinity Dual Sword (Dual Swords)
case "give_48566": // Infinity Dual Dagger (Dual Daggers)
case "give_48567": // Infinity Dual Blunt Weapon (Dual Blunt Weapon)
{
final int weaponId = Integer.parseInt(event.replace("give_", ""));
giveItems(player, weaponId, 1);
break;
}
}
return htmltext;
}

View File

@@ -18,7 +18,7 @@ package ai.others.OlyBuffer;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.skill.CommonSkill;
import org.l2jmobius.gameserver.model.skill.SkillCaster;
import ai.AbstractNpcAI;
@@ -32,13 +32,13 @@ public class OlyBuffer extends AbstractNpcAI
// NPC
private static final int OLYMPIAD_BUFFER = 36402;
// Skills
private static final SkillHolder BUFF = new SkillHolder(32415, 1); // Fantasia Harmony
private static final SkillHolder[] BUFFS =
private static final CommonSkill BUFF = CommonSkill.OLYMPIAD_HARMONY;
private static final CommonSkill[] BUFFS =
{
new SkillHolder(32411, 1), // Olympiad - Horn Melody
new SkillHolder(32412, 1), // Olympiad - Drum Melody
new SkillHolder(32413, 1), // Olympiad - Pipe Organ Melody
new SkillHolder(32414, 1), // Olympiad - Guitar Melody
CommonSkill.OLYMPIAD_HORN_MELODY,
CommonSkill.OLYMPIAD_DRUM_MELODY,
CommonSkill.OLYMPIAD_PIPE_ORGAN_MELODY,
CommonSkill.OLYMPIAD_GUITAR_MELODY,
};
private OlyBuffer()
@@ -75,9 +75,9 @@ public class OlyBuffer extends AbstractNpcAI
return "olympiad_master003.htm";
}
private void applyBuffs(Npc npc, Player player, SkillHolder skill)
private void applyBuffs(Npc npc, Player player, CommonSkill skill)
{
for (SkillHolder holder : BUFFS)
for (CommonSkill holder : BUFFS)
{
SkillCaster.triggerCast(npc, player, holder.getSkill());
}

View File

@@ -42,7 +42,7 @@ import org.l2jmobius.gameserver.model.olympiad.OlympiadGameManager;
import org.l2jmobius.gameserver.model.olympiad.OlympiadGameTask;
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchList;
import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchList;
import ai.AbstractNpcAI;
@@ -188,7 +188,7 @@ public class OlyManager extends AbstractNpcAI implements IBypassHandler
if (tradePoints > 0)
{
player.getVariables().remove(Olympiad.UNCLAIMED_OLYMPIAD_POINTS_VAR);
giveItems(player, Config.ALT_OLY_COMP_RITEM, tradePoints * Config.ALT_OLY_MARK_PER_POINT);
giveItems(player, Config.OLYMPIAD_COMP_RITEM, tradePoints * Config.OLYMPIAD_MARK_PER_POINT);
}
}
else

View File

@@ -386,7 +386,7 @@ public class Eraton extends AbstractNpcAI
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE olympiad_nobles SET olympiad_points=?, class_id=? WHERE charId='" + player.getObjectId() + "'"))
{
ps.setInt(1, Config.ALT_OLY_START_POINTS);
ps.setInt(1, Config.OLYMPIAD_START_POINTS);
ps.setInt(2, classId);
ps.executeUpdate();
}

View File

@@ -16,12 +16,15 @@
*/
package handlers.usercommandhandlers;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.handler.IUserCommandHandler;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.olympiad.Olympiad;
import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadRecord;
/**
* Olympiad Stat user command.
@@ -37,14 +40,25 @@ public class OlympiadStat implements IUserCommandHandler
@Override
public boolean useUserCommand(int id, Player player)
{
if (!Config.OLYMPIAD_ENABLED)
{
player.sendPacket(SystemMessageId.THE_OLYMPIAD_IS_NOT_HELD_RIGHT_NOW);
return false;
}
if (id != COMMAND_IDS[0])
{
return false;
}
final int nobleObjId = player.getObjectId();
final WorldObject target = player.getTarget();
if ((target == null) || !target.isPlayer() || (target.getActingPlayer().getNobleLevel() == 0))
WorldObject target = player.getTarget();
if ((target == null) || !target.isPlayer())
{
player.sendPacket(new ExOlympiadRecord(player, 1, OlympiadManager.getInstance().isRegistered(player) ? 1 : 0));
return true;
}
else if ((target.getActingPlayer().getNobleLevel() == 0))
{
player.sendPacket(SystemMessageId.THIS_COMMAND_CAN_ONLY_BE_USED_WHEN_THE_TARGET_IS_AN_AWAKENED_NOBLESSE_EXALTED);
return false;
@@ -60,6 +74,7 @@ public class OlympiadStat implements IUserCommandHandler
final SystemMessage sm2 = new SystemMessage(SystemMessageId.THIS_WEEK_YOU_CAN_PARTICIPATE_IN_A_TOTAL_OF_S1_MATCHES);
sm2.addInt(Olympiad.getInstance().getRemainingWeeklyMatches(nobleObjId));
player.sendPacket(sm2);
player.sendPacket(new ExOlympiadRecord(player, 1, OlympiadManager.getInstance().isRegistered(player) ? 1 : 0));
return true;
}