From 8acc1890e22d6bf9007430b326fa630b1fb020a8 Mon Sep 17 00:00:00 2001
From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com>
Date: Thu, 4 Aug 2022 08:21:23 +0000
Subject: [PATCH] Addition of World Olympiad. Thanks to nasseka and Sero.
---
.../dist/game/config/Olympiad.ini | 84 +--
.../MonumentOfHeroes-weaponListLegend.html | 26 +
.../MonumentOfHeroes/MonumentOfHeroes.java | 49 +-
.../ai/others/OlyBuffer/OlyBuffer.java | 18 +-
.../ai/others/OlyManager/OlyManager.java | 4 +-
.../usercommandhandlers/OlympiadStat.java | 19 +-
.../java/org/l2jmobius/Config.java | 150 ++---
.../gameserver/enums/OlympiadMode.java | 28 +
.../gameserver/model/EffectList.java | 2 +-
.../gameserver/model/actor/Player.java | 28 +-
.../gameserver/model/item/ItemTemplate.java | 2 +-
.../gameserver/model/item/instance/Item.java | 8 +-
.../model/olympiad/AbstractOlympiadGame.java | 99 ++-
.../gameserver/model/olympiad/Hero.java | 47 +-
.../gameserver/model/olympiad/Olympiad.java | 119 ++--
.../model/olympiad/OlympiadGameClassed.java | 11 +-
.../olympiad/OlympiadGameNonClassed.java | 2 +-
.../model/olympiad/OlympiadGameNormal.java | 567 ++++++++++++++++--
.../model/olympiad/OlympiadGameState.java | 6 +
.../model/olympiad/OlympiadGameTask.java | 228 ++++++-
.../model/olympiad/OlympiadManager.java | 24 +-
.../model/olympiad/OlympiadStadium.java | 59 +-
.../gameserver/model/skill/CommonSkill.java | 8 +-
.../gameserver/model/skill/SkillCaster.java | 7 +-
.../gameserver/model/stats/IStatFunction.java | 8 +-
.../model/variables/PlayerVariables.java | 1 +
.../model/zone/type/OlympiadStadiumZone.java | 2 +-
.../gameserver/network/ExIncomingPackets.java | 12 +-
.../network/clientpackets/EnterWorld.java | 8 +
.../olympiad/OlympiadMatchMaking.java | 47 ++
.../olympiad/OlympiadMatchMakingCancel.java | 47 ++
.../clientpackets/olympiad/OlympiadUI.java | 49 ++
.../RequestExOlympiadMatchListRefresh.java | 5 +-
.../olympiad}/RequestOlympiadMatchList.java | 3 +-
.../olympiad}/RequestOlympiadObserverEnd.java | 3 +-
.../network/serverpackets/CharInfo.java | 2 +-
.../network/serverpackets/UserInfo.java | 2 +-
.../olympiad/ExOlympiadInfo.java | 41 ++
.../olympiad}/ExOlympiadMatchEnd.java | 5 +-
.../olympiad/ExOlympiadMatchInfo.java | 57 ++
.../olympiad/ExOlympiadMatchInfoEnd.java | 37 ++
.../olympiad}/ExOlympiadMatchList.java | 8 +-
.../olympiad/ExOlympiadMatchMakingResult.java | 42 ++
.../olympiad}/ExOlympiadMatchResult.java | 18 +-
.../olympiad}/ExOlympiadMode.java | 10 +-
.../olympiad/ExOlympiadRecord.java | 109 ++++
.../olympiad}/ExOlympiadSpelledInfo.java | 8 +-
.../olympiad}/ExOlympiadUserInfo.java | 5 +-
.../dist/game/config/Olympiad.ini | 84 +--
.../MonumentOfHeroes-weaponListLegend.html | 26 +
.../MonumentOfHeroes/MonumentOfHeroes.java | 49 +-
.../ai/others/OlyBuffer/OlyBuffer.java | 18 +-
.../ai/others/OlyManager/OlyManager.java | 4 +-
.../events/RedLibra/Eraton/Eraton.java | 2 +-
.../usercommandhandlers/OlympiadStat.java | 19 +-
.../java/org/l2jmobius/Config.java | 150 ++---
.../gameserver/enums/OlympiadMode.java | 28 +
.../gameserver/model/EffectList.java | 2 +-
.../gameserver/model/actor/Player.java | 28 +-
.../gameserver/model/item/ItemTemplate.java | 2 +-
.../gameserver/model/item/instance/Item.java | 8 +-
.../model/olympiad/AbstractOlympiadGame.java | 99 ++-
.../gameserver/model/olympiad/Hero.java | 47 +-
.../gameserver/model/olympiad/Olympiad.java | 119 ++--
.../model/olympiad/OlympiadGameClassed.java | 11 +-
.../olympiad/OlympiadGameNonClassed.java | 2 +-
.../model/olympiad/OlympiadGameNormal.java | 567 ++++++++++++++++--
.../model/olympiad/OlympiadGameState.java | 6 +
.../model/olympiad/OlympiadGameTask.java | 228 ++++++-
.../model/olympiad/OlympiadManager.java | 24 +-
.../model/olympiad/OlympiadStadium.java | 59 +-
.../gameserver/model/skill/CommonSkill.java | 8 +-
.../gameserver/model/skill/SkillCaster.java | 7 +-
.../gameserver/model/stats/IStatFunction.java | 8 +-
.../model/variables/PlayerVariables.java | 1 +
.../model/zone/type/OlympiadStadiumZone.java | 2 +-
.../gameserver/network/ExIncomingPackets.java | 12 +-
.../network/clientpackets/EnterWorld.java | 8 +
.../olympiad/OlympiadMatchMaking.java | 47 ++
.../olympiad/OlympiadMatchMakingCancel.java | 47 ++
.../clientpackets/olympiad/OlympiadUI.java | 49 ++
.../RequestExOlympiadMatchListRefresh.java | 5 +-
.../olympiad}/RequestOlympiadMatchList.java | 3 +-
.../RequestOlympiadObserverEnd.java | 3 +-
.../network/serverpackets/CharInfo.java | 2 +-
.../network/serverpackets/UserInfo.java | 2 +-
.../olympiad/ExOlympiadInfo.java | 41 ++
.../olympiad}/ExOlympiadMatchEnd.java | 5 +-
.../olympiad/ExOlympiadMatchInfo.java | 57 ++
.../olympiad/ExOlympiadMatchInfoEnd.java | 37 ++
.../olympiad}/ExOlympiadMatchList.java | 8 +-
.../olympiad/ExOlympiadMatchMakingResult.java | 42 ++
.../olympiad}/ExOlympiadMatchResult.java | 18 +-
.../olympiad}/ExOlympiadMode.java | 10 +-
.../olympiad/ExOlympiadRecord.java | 109 ++++
.../olympiad}/ExOlympiadSpelledInfo.java | 8 +-
.../olympiad}/ExOlympiadUserInfo.java | 5 +-
.../dist/game/config/Olympiad.ini | 84 +--
.../MonumentOfHeroes-weaponListLegend.html | 26 +
.../MonumentOfHeroes/MonumentOfHeroes.java | 49 +-
.../ai/others/OlyBuffer/OlyBuffer.java | 18 +-
.../ai/others/OlyManager/OlyManager.java | 4 +-
.../events/RedLibra/Eraton/Eraton.java | 2 +-
.../usercommandhandlers/OlympiadStat.java | 19 +-
.../java/org/l2jmobius/Config.java | 150 ++---
.../gameserver/enums/OlympiadMode.java | 28 +
.../gameserver/model/EffectList.java | 2 +-
.../gameserver/model/actor/Player.java | 28 +-
.../gameserver/model/item/ItemTemplate.java | 2 +-
.../gameserver/model/item/instance/Item.java | 8 +-
.../model/olympiad/AbstractOlympiadGame.java | 99 ++-
.../gameserver/model/olympiad/Hero.java | 47 +-
.../gameserver/model/olympiad/Olympiad.java | 119 ++--
.../model/olympiad/OlympiadGameClassed.java | 11 +-
.../olympiad/OlympiadGameNonClassed.java | 2 +-
.../model/olympiad/OlympiadGameNormal.java | 567 ++++++++++++++++--
.../model/olympiad/OlympiadGameState.java | 6 +
.../model/olympiad/OlympiadGameTask.java | 228 ++++++-
.../model/olympiad/OlympiadManager.java | 24 +-
.../model/olympiad/OlympiadStadium.java | 59 +-
.../gameserver/model/skill/CommonSkill.java | 8 +-
.../gameserver/model/skill/SkillCaster.java | 7 +-
.../gameserver/model/stats/IStatFunction.java | 8 +-
.../model/variables/PlayerVariables.java | 1 +
.../model/zone/type/OlympiadStadiumZone.java | 2 +-
.../gameserver/network/ExIncomingPackets.java | 12 +-
.../network/clientpackets/EnterWorld.java | 8 +
.../olympiad/OlympiadMatchMaking.java | 47 ++
.../olympiad/OlympiadMatchMakingCancel.java | 47 ++
.../clientpackets/olympiad/OlympiadUI.java | 49 ++
.../RequestExOlympiadMatchListRefresh.java | 5 +-
.../RequestOlympiadMatchList.java | 3 +-
.../olympiad}/RequestOlympiadObserverEnd.java | 3 +-
.../network/serverpackets/CharInfo.java | 2 +-
.../network/serverpackets/UserInfo.java | 2 +-
.../olympiad/ExOlympiadInfo.java | 41 ++
.../olympiad}/ExOlympiadMatchEnd.java | 5 +-
.../olympiad/ExOlympiadMatchInfo.java | 57 ++
.../olympiad/ExOlympiadMatchInfoEnd.java | 37 ++
.../olympiad}/ExOlympiadMatchList.java | 8 +-
.../olympiad/ExOlympiadMatchMakingResult.java | 42 ++
.../olympiad}/ExOlympiadMatchResult.java | 18 +-
.../olympiad}/ExOlympiadMode.java | 10 +-
.../olympiad/ExOlympiadRecord.java | 109 ++++
.../olympiad}/ExOlympiadSpelledInfo.java | 8 +-
.../olympiad}/ExOlympiadUserInfo.java | 5 +-
.../dist/game/config/Olympiad.ini | 84 +--
.../MonumentOfHeroes-weaponListLegend.html | 26 +
.../MonumentOfHeroes/MonumentOfHeroes.java | 49 +-
.../ai/others/OlyBuffer/OlyBuffer.java | 18 +-
.../ai/others/OlyManager/OlyManager.java | 4 +-
.../events/RedLibra/Eraton/Eraton.java | 2 +-
.../usercommandhandlers/OlympiadStat.java | 19 +-
.../game/data/stats/skills/34200-34299.xml | 111 +++-
.../java/org/l2jmobius/Config.java | 150 ++---
.../gameserver/enums/OlympiadMode.java | 28 +
.../gameserver/model/EffectList.java | 2 +-
.../gameserver/model/actor/Player.java | 28 +-
.../gameserver/model/item/ItemTemplate.java | 2 +-
.../gameserver/model/item/instance/Item.java | 8 +-
.../model/olympiad/AbstractOlympiadGame.java | 99 ++-
.../gameserver/model/olympiad/Hero.java | 47 +-
.../gameserver/model/olympiad/Olympiad.java | 119 ++--
.../model/olympiad/OlympiadGameClassed.java | 11 +-
.../olympiad/OlympiadGameNonClassed.java | 2 +-
.../model/olympiad/OlympiadGameNormal.java | 561 +++++++++++++++--
.../model/olympiad/OlympiadGameState.java | 6 +
.../model/olympiad/OlympiadGameTask.java | 228 ++++++-
.../model/olympiad/OlympiadManager.java | 24 +-
.../model/olympiad/OlympiadStadium.java | 59 +-
.../gameserver/model/skill/CommonSkill.java | 5 +-
.../gameserver/model/skill/SkillCaster.java | 7 +-
.../gameserver/model/stats/IStatFunction.java | 8 +-
.../model/variables/PlayerVariables.java | 1 +
.../model/zone/type/OlympiadStadiumZone.java | 2 +-
.../gameserver/network/ExIncomingPackets.java | 12 +-
.../network/clientpackets/EnterWorld.java | 8 +
.../olympiad/OlympiadMatchMaking.java | 47 ++
.../olympiad/OlympiadMatchMakingCancel.java | 47 ++
.../clientpackets/olympiad/OlympiadUI.java | 49 ++
.../RequestExOlympiadMatchListRefresh.java | 5 +-
.../RequestOlympiadMatchList.java | 3 +-
.../RequestOlympiadObserverEnd.java | 3 +-
.../network/serverpackets/CharInfo.java | 2 +-
.../network/serverpackets/UserInfo.java | 2 +-
.../olympiad/ExOlympiadInfo.java | 41 ++
.../olympiad}/ExOlympiadMatchEnd.java | 5 +-
.../olympiad/ExOlympiadMatchInfo.java | 57 ++
.../olympiad/ExOlympiadMatchInfoEnd.java | 37 ++
.../{ => olympiad}/ExOlympiadMatchList.java | 8 +-
.../olympiad/ExOlympiadMatchMakingResult.java | 42 ++
.../olympiad}/ExOlympiadMatchResult.java | 18 +-
.../{ => olympiad}/ExOlympiadMode.java | 10 +-
.../olympiad/ExOlympiadRecord.java | 109 ++++
.../{ => olympiad}/ExOlympiadSpelledInfo.java | 8 +-
.../olympiad}/ExOlympiadUserInfo.java | 5 +-
196 files changed, 7261 insertions(+), 1343 deletions(-)
create mode 100644 L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes-weaponListLegend.html
create mode 100644 L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/enums/OlympiadMode.java
create mode 100644 L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java
create mode 100644 L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java
create mode 100644 L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java
rename L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/{ => olympiad}/RequestExOlympiadMatchListRefresh.java (82%)
rename {L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets => L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad}/RequestOlympiadMatchList.java (89%)
rename {L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets => L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad}/RequestOlympiadObserverEnd.java (87%)
create mode 100644 L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java
rename {L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets => L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad}/ExOlympiadMatchEnd.java (86%)
create mode 100644 L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java
create mode 100644 L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java
rename {L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets => L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad}/ExOlympiadMatchList.java (91%)
create mode 100644 L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java
rename {L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets => L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad}/ExOlympiadMatchResult.java (73%)
rename {L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets => L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad}/ExOlympiadMode.java (76%)
create mode 100644 L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java
rename {L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets => L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad}/ExOlympiadSpelledInfo.java (88%)
rename {L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets => L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad}/ExOlympiadUserInfo.java (90%)
create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes-weaponListLegend.html
create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/enums/OlympiadMode.java
create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java
create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java
create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java
rename {L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets => L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad}/RequestExOlympiadMatchListRefresh.java (82%)
rename {L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets => L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad}/RequestOlympiadMatchList.java (89%)
rename L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/{ => olympiad}/RequestOlympiadObserverEnd.java (87%)
create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java
rename {L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets => L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad}/ExOlympiadMatchEnd.java (86%)
create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java
create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java
rename {L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets => L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad}/ExOlympiadMatchList.java (91%)
create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java
rename {L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets => L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad}/ExOlympiadMatchResult.java (73%)
rename {L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets => L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad}/ExOlympiadMode.java (76%)
create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java
rename {L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets => L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad}/ExOlympiadSpelledInfo.java (88%)
rename {L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets => L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad}/ExOlympiadUserInfo.java (90%)
create mode 100644 L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes-weaponListLegend.html
create mode 100644 L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/enums/OlympiadMode.java
create mode 100644 L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java
create mode 100644 L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java
create mode 100644 L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java
rename {L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets => L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad}/RequestExOlympiadMatchListRefresh.java (82%)
rename L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/{ => olympiad}/RequestOlympiadMatchList.java (89%)
rename {L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets => L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad}/RequestOlympiadObserverEnd.java (87%)
create mode 100644 L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java
rename {L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets => L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad}/ExOlympiadMatchEnd.java (86%)
create mode 100644 L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java
create mode 100644 L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java
rename {L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets => L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad}/ExOlympiadMatchList.java (91%)
create mode 100644 L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java
rename {L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets => L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad}/ExOlympiadMatchResult.java (73%)
rename {L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets => L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad}/ExOlympiadMode.java (76%)
create mode 100644 L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java
rename {L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets => L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad}/ExOlympiadSpelledInfo.java (88%)
rename {L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets => L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad}/ExOlympiadUserInfo.java (90%)
create mode 100644 L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes-weaponListLegend.html
create mode 100644 L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/enums/OlympiadMode.java
create mode 100644 L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java
create mode 100644 L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java
create mode 100644 L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java
rename {L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets => L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad}/RequestExOlympiadMatchListRefresh.java (82%)
rename L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/{ => olympiad}/RequestOlympiadMatchList.java (89%)
rename L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/{ => olympiad}/RequestOlympiadObserverEnd.java (87%)
create mode 100644 L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java
rename {L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets => L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad}/ExOlympiadMatchEnd.java (86%)
create mode 100644 L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java
create mode 100644 L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java
rename L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/{ => olympiad}/ExOlympiadMatchList.java (91%)
create mode 100644 L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java
rename {L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets => L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad}/ExOlympiadMatchResult.java (73%)
rename L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/{ => olympiad}/ExOlympiadMode.java (76%)
create mode 100644 L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java
rename L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/{ => olympiad}/ExOlympiadSpelledInfo.java (88%)
rename {L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets => L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad}/ExOlympiadUserInfo.java (90%)
diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/config/Olympiad.ini b/L2J_Mobius_08.2_Homunculus/dist/game/config/Olympiad.ini
index 149a682c5e..34b3a54c33 100644
--- a/L2J_Mobius_08.2_Homunculus/dist/game/config/Olympiad.ini
+++ b/L2J_Mobius_08.2_Homunculus/dist/game/config/Olympiad.ini
@@ -9,141 +9,141 @@
# Also please understand what you are changing before you do so on a live server.
# ---------------------------------------------------------------------------
+# Enable Olympiad.
+# Default: True
+OlympiadEnabled = True
+
# Olympiad Start Time in Military hours Default 8pm (20)
# Default: 20
-AltOlyStartTime = 20
+OlympiadStartTime = 20
# Olympiad Start Time for Min's, Default 00 so at the start of the hour.
# Default: 00
-AltOlyMin = 00
+OlympiadMin = 00
# Olympiad Competition Period, Default 4 hours.
# (If set different, should be increment by 10mins)
# Default: 14400000
-AltOlyCPeriod = 14400000
+OlympiadCPeriod = 14400000
-# Olympiad Battle Period, Default 5 minutes.
-# Default: 300000
-AltOlyBattle = 300000
+# Olympiad Battle Period, Default 100 seconds.
+# Default: 100000
+OlympiadBattle = 100000
# Olympiad Weekly Period, Default 1 week
# Used for adding points to nobles
# Default: 604800000
-AltOlyWPeriod = 604800000
+OlympiadWPeriod = 604800000
# Olympiad Validation Period, Default 24 Hours.
# Default: 86400000
-AltOlyVPeriod = 86400000
+OlympiadVPeriod = 86400000
# Points for reaching Noblesse for the first time
-# Default: 10
-AltOlyStartPoints = 10
-
-# Points every week
-# Default: 10
-AltOlyWeeklyPoints = 10
+# Default: 1000
+OlympiadStartPoints = 1000
# Required number of participants for the class based games
# Default: 20
-AltOlyClassedParticipants = 20
+OlympiadClassedParticipants = 20
# Required number of participants for the non-class based games
# Default: 10
-AltOlyNonClassedParticipants = 10
+OlympiadNonClassedParticipants = 10
# Reward for the winner
# Format: itemId1,itemNum1;itemId2,itemNum2...
# Default: 45584,12
-AltOlyWinReward = 45584,12
+OlympiadWinReward = 45584,12
# Reward for loser
# Format: itemId1,itemNum1;itemId2,itemNum2...
# Default: 45584,7
-AltOlyLoserReward = 45584,7
+OlympiadLoserReward = 45584,7
# ItemId used for exchanging to the points.
# Default: 45584
-AltOlyCompRewItem = 45584
+OlympiadCompRewItem = 45584
# The minimum matches you need to participate to receive point rewards
# Default: 10
-AltOlyMinMatchesForPoints = 10
+OlympiadMinMatchesForPoints = 10
# Rate to exchange points to reward item.
# Default: 20
-AltOlyMarkPerPoint = 20
+OlympiadMarkPerPoint = 20
# Noblesse points awarded to Heroes.
# Default: 30
-AltOlyHeroPoints = 30
+OlympiadHeroPoints = 30
# Noblesse points awarded to Rank 1 members.
# Default: 100
-AltOlyRank1Points = 60
+OlympiadRank1Points = 60
# Noblesse points awarded to Rank 2 members.
# Default: 75
-AltOlyRank2Points = 50
+OlympiadRank2Points = 50
# Noblesse points awarded to Rank 3 members.
# Default: 55
-AltOlyRank3Points = 45
+OlympiadRank3Points = 45
# Noblesse points awarded to Rank 4 members.
# Default: 40
-AltOlyRank4Points = 40
+OlympiadRank4Points = 40
# Noblesse points awarded to Rank 5 members.
# Default: 30
-AltOlyRank5Points = 30
+OlympiadRank5Points = 30
# Maximum points that player can gain/lose on a match.
# Default: 10
-AltOlyMaxPoints = 10
+OlympiadMaxPoints = 10
# Hero tables show last month's winners or current status.
# Default: True
-AltOlyShowMonthlyWinners = True
+OlympiadShowMonthlyWinners = True
# Olympiad Managers announce each start of fight.
# Default: True
-AltOlyAnnounceGames = True
+OlympiadAnnounceGames = True
# Restrict specified items in Olympiad. ItemID's need to be separated with a comma (ex. 1,200,350)
# Equipped items will be moved to inventory during port.
# Default:
-AltOlyRestrictedItems =
+OlympiadRestrictedItems =
# Enchant limit for items during Olympiad battles. Disabled = -1.
# Default: -1
-AltOlyWeaponEnchantLimit = -1
-AltOlyArmorEnchantLimit = -1
+OlympiadWeaponEnchantLimit = -1
+OlympiadArmorEnchantLimit = -1
# Log all Olympiad fights and outcome to olympiad.csv file.
# Default: False
-AltOlyLogFights = False
+OlympiadLogFights = False
# Time to wait before teleported to arena.
# Default: 120
-AltOlyWaitTime = 120
+OlympiadWaitTime = 120
# Divider for points in classed and non-classed games
# Default: 5
-AltOlyDividerClassed = 5
-AltOlyDividerNonClassed = 5
+OlympiadDividerClassed = 5
+OlympiadDividerNonClassed = 5
# Maximum number of matches a Noblesse character can join per week
-# Default: 30
-AltOlyMaxWeeklyMatches = 30
+# Default: 25
+OlympiadMaxWeeklyMatches = 25
# Enable competitions only on specific days. Usage: 1,2,3,4,5,6,7 (SUNDAY,MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,SATURDAY)
# Default: 6,7 (FRIDAY,SATURDAY)
-AltOlyCompetitionDays = 6,7
+OlympiadCompetitionDays = 6,7
# Change the type of delay between two Olympiads.
# Available values: MONTH, WEEK, DAY
# Default: MONTH
-AltOlyPeriod = MONTH
+OlympiadPeriod = MONTH
# Change the Olympiad frequency.
# The value is a multiplier of period type,
@@ -151,4 +151,4 @@ AltOlyPeriod = MONTH
# then Olympiad will occur every 2 months.
# Default: 1
# Note! If type = DAY, multiplier must be >= 7!
-AltOlyPeriodMultiplier = 1
\ No newline at end of file
+OlympiadPeriodMultiplier = 1
\ No newline at end of file
diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes-weaponListLegend.html b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes-weaponListLegend.html
new file mode 100644
index 0000000000..169a6fb06f
--- /dev/null
+++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes-weaponListLegend.html
@@ -0,0 +1,26 @@
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes.java b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes.java
index 53a544ac7f..fe77bb3e49 100644
--- a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes.java
+++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes.java
@@ -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;
}
diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/others/OlyBuffer/OlyBuffer.java b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/others/OlyBuffer/OlyBuffer.java
index 071de9ce6e..4637c7c055 100644
--- a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/others/OlyBuffer/OlyBuffer.java
+++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/others/OlyBuffer/OlyBuffer.java
@@ -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());
}
diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java
index 362eb94e8b..f07fb57f03 100644
--- a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java
+++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java
@@ -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
diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java
index 800d712676..c73d0a5f56 100644
--- a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java
+++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java
@@ -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_GAMES_ARE_NOT_CURRENTLY_IN_PROGRESS);
+ 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;
}
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/Config.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/Config.java
index 2092256f24..bbf6c08e6c 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/Config.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/Config.java
@@ -516,41 +516,41 @@ public class Config
public static int WORLD_CHAT_MIN_LEVEL;
public static int WORLD_CHAT_POINTS_PER_DAY;
public static Duration WORLD_CHAT_INTERVAL;
- public static int ALT_OLY_START_TIME;
- public static int ALT_OLY_MIN;
- public static long ALT_OLY_CPERIOD;
- public static long ALT_OLY_BATTLE;
- public static long ALT_OLY_WPERIOD;
- public static long ALT_OLY_VPERIOD;
- public static int ALT_OLY_START_POINTS;
- public static int ALT_OLY_WEEKLY_POINTS;
- public static int ALT_OLY_CLASSED;
- public static int ALT_OLY_NONCLASSED;
- public static List ALT_OLY_WINNER_REWARD;
- public static List ALT_OLY_LOSER_REWARD;
- public static int ALT_OLY_COMP_RITEM;
- public static int ALT_OLY_MIN_MATCHES;
- public static int ALT_OLY_MARK_PER_POINT;
- public static int ALT_OLY_HERO_POINTS;
- public static int ALT_OLY_RANK1_POINTS;
- public static int ALT_OLY_RANK2_POINTS;
- public static int ALT_OLY_RANK3_POINTS;
- public static int ALT_OLY_RANK4_POINTS;
- public static int ALT_OLY_RANK5_POINTS;
- public static int ALT_OLY_MAX_POINTS;
- public static int ALT_OLY_DIVIDER_CLASSED;
- public static int ALT_OLY_DIVIDER_NON_CLASSED;
- public static int ALT_OLY_MAX_WEEKLY_MATCHES;
- public static boolean ALT_OLY_LOG_FIGHTS;
- public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS;
- public static boolean ALT_OLY_ANNOUNCE_GAMES;
- public static Set LIST_OLY_RESTRICTED_ITEMS = new HashSet<>();
- public static int ALT_OLY_WEAPON_ENCHANT_LIMIT;
- public static int ALT_OLY_ARMOR_ENCHANT_LIMIT;
- public static int ALT_OLY_WAIT_TIME;
- public static String ALT_OLY_PERIOD;
- public static int ALT_OLY_PERIOD_MULTIPLIER;
- public static List ALT_OLY_COMPETITION_DAYS;
+ public static boolean OLYMPIAD_ENABLED;
+ public static int OLYMPIAD_START_TIME;
+ public static int OLYMPIAD_MIN;
+ public static long OLYMPIAD_CPERIOD;
+ public static long OLYMPIAD_BATTLE;
+ public static long OLYMPIAD_WPERIOD;
+ public static long OLYMPIAD_VPERIOD;
+ public static int OLYMPIAD_START_POINTS;
+ public static int OLYMPIAD_CLASSED;
+ public static int OLYMPIAD_NONCLASSED;
+ public static List OLYMPIAD_WINNER_REWARD;
+ public static List OLYMPIAD_LOSER_REWARD;
+ public static int OLYMPIAD_COMP_RITEM;
+ public static int OLYMPIAD_MIN_MATCHES;
+ public static int OLYMPIAD_MARK_PER_POINT;
+ public static int OLYMPIAD_HERO_POINTS;
+ public static int OLYMPIAD_RANK1_POINTS;
+ public static int OLYMPIAD_RANK2_POINTS;
+ public static int OLYMPIAD_RANK3_POINTS;
+ public static int OLYMPIAD_RANK4_POINTS;
+ public static int OLYMPIAD_RANK5_POINTS;
+ public static int OLYMPIAD_MAX_POINTS;
+ public static int OLYMPIAD_DIVIDER_CLASSED;
+ public static int OLYMPIAD_DIVIDER_NON_CLASSED;
+ public static int OLYMPIAD_MAX_WEEKLY_MATCHES;
+ public static boolean OLYMPIAD_LOG_FIGHTS;
+ public static boolean OLYMPIAD_SHOW_MONTHLY_WINNERS;
+ public static boolean OLYMPIAD_ANNOUNCE_GAMES;
+ public static Set OLYMPIAD_RESTRICTED_ITEMS = new HashSet<>();
+ public static int OLYMPIAD_WEAPON_ENCHANT_LIMIT;
+ public static int OLYMPIAD_ARMOR_ENCHANT_LIMIT;
+ public static int OLYMPIAD_WAIT_TIME;
+ public static String OLYMPIAD_PERIOD;
+ public static int OLYMPIAD_PERIOD_MULTIPLIER;
+ public static List OLYMPIAD_COMPETITION_DAYS;
public static int ALT_MANOR_REFRESH_TIME;
public static int ALT_MANOR_REFRESH_MIN;
public static int ALT_MANOR_APPROVE_TIME;
@@ -2396,57 +2396,57 @@ public class Config
// Load Olympiad config file (if exists)
final PropertiesParser olympiadConfig = new PropertiesParser(OLYMPIAD_CONFIG_FILE);
- ALT_OLY_START_TIME = olympiadConfig.getInt("AltOlyStartTime", 20);
- ALT_OLY_MIN = olympiadConfig.getInt("AltOlyMin", 0);
- ALT_OLY_CPERIOD = olympiadConfig.getLong("AltOlyCPeriod", 14400000);
- ALT_OLY_BATTLE = olympiadConfig.getLong("AltOlyBattle", 300000);
- ALT_OLY_WPERIOD = olympiadConfig.getLong("AltOlyWPeriod", 604800000);
- ALT_OLY_VPERIOD = olympiadConfig.getLong("AltOlyVPeriod", 86400000);
- ALT_OLY_START_POINTS = olympiadConfig.getInt("AltOlyStartPoints", 10);
- ALT_OLY_WEEKLY_POINTS = olympiadConfig.getInt("AltOlyWeeklyPoints", 10);
- ALT_OLY_CLASSED = olympiadConfig.getInt("AltOlyClassedParticipants", 10);
- ALT_OLY_NONCLASSED = olympiadConfig.getInt("AltOlyNonClassedParticipants", 20);
- ALT_OLY_WINNER_REWARD = parseItemsList(olympiadConfig.getString("AltOlyWinReward", "45584,12"));
- ALT_OLY_LOSER_REWARD = parseItemsList(olympiadConfig.getString("AltOlyLoserReward", "45584,7"));
- ALT_OLY_COMP_RITEM = olympiadConfig.getInt("AltOlyCompRewItem", 45584);
- ALT_OLY_MIN_MATCHES = olympiadConfig.getInt("AltOlyMinMatchesForPoints", 10);
- ALT_OLY_MARK_PER_POINT = olympiadConfig.getInt("AltOlyMarkPerPoint", 20);
- ALT_OLY_HERO_POINTS = olympiadConfig.getInt("AltOlyHeroPoints", 30);
- ALT_OLY_RANK1_POINTS = olympiadConfig.getInt("AltOlyRank1Points", 60);
- ALT_OLY_RANK2_POINTS = olympiadConfig.getInt("AltOlyRank2Points", 50);
- ALT_OLY_RANK3_POINTS = olympiadConfig.getInt("AltOlyRank3Points", 45);
- ALT_OLY_RANK4_POINTS = olympiadConfig.getInt("AltOlyRank4Points", 40);
- ALT_OLY_RANK5_POINTS = olympiadConfig.getInt("AltOlyRank5Points", 30);
- ALT_OLY_MAX_POINTS = olympiadConfig.getInt("AltOlyMaxPoints", 10);
- ALT_OLY_DIVIDER_CLASSED = olympiadConfig.getInt("AltOlyDividerClassed", 5);
- ALT_OLY_DIVIDER_NON_CLASSED = olympiadConfig.getInt("AltOlyDividerNonClassed", 5);
- ALT_OLY_MAX_WEEKLY_MATCHES = olympiadConfig.getInt("AltOlyMaxWeeklyMatches", 30);
- ALT_OLY_LOG_FIGHTS = olympiadConfig.getBoolean("AltOlyLogFights", false);
- ALT_OLY_SHOW_MONTHLY_WINNERS = olympiadConfig.getBoolean("AltOlyShowMonthlyWinners", true);
- ALT_OLY_ANNOUNCE_GAMES = olympiadConfig.getBoolean("AltOlyAnnounceGames", true);
- final String olyRestrictedItems = olympiadConfig.getString("AltOlyRestrictedItems", "").trim();
+ OLYMPIAD_ENABLED = olympiadConfig.getBoolean("OlympiadEnabled", true);
+ OLYMPIAD_START_TIME = olympiadConfig.getInt("OlympiadStartTime", 20);
+ OLYMPIAD_MIN = olympiadConfig.getInt("OlympiadMin", 0);
+ OLYMPIAD_CPERIOD = olympiadConfig.getLong("OlympiadCPeriod", 14400000);
+ OLYMPIAD_BATTLE = olympiadConfig.getLong("OlympiadBattle", 300000);
+ OLYMPIAD_WPERIOD = olympiadConfig.getLong("OlympiadWPeriod", 604800000);
+ OLYMPIAD_VPERIOD = olympiadConfig.getLong("OlympiadVPeriod", 86400000);
+ OLYMPIAD_START_POINTS = olympiadConfig.getInt("OlympiadStartPoints", 1000);
+ OLYMPIAD_CLASSED = olympiadConfig.getInt("OlympiadClassedParticipants", 10);
+ OLYMPIAD_NONCLASSED = olympiadConfig.getInt("OlympiadNonClassedParticipants", 20);
+ OLYMPIAD_WINNER_REWARD = parseItemsList(olympiadConfig.getString("OlympiadWinReward", "45584,12"));
+ OLYMPIAD_LOSER_REWARD = parseItemsList(olympiadConfig.getString("OlympiadLoserReward", "45584,7"));
+ OLYMPIAD_COMP_RITEM = olympiadConfig.getInt("OlympiadCompRewItem", 45584);
+ OLYMPIAD_MIN_MATCHES = olympiadConfig.getInt("OlympiadMinMatchesForPoints", 10);
+ OLYMPIAD_MARK_PER_POINT = olympiadConfig.getInt("OlympiadMarkPerPoint", 20);
+ OLYMPIAD_HERO_POINTS = olympiadConfig.getInt("OlympiadHeroPoints", 30);
+ OLYMPIAD_RANK1_POINTS = olympiadConfig.getInt("OlympiadRank1Points", 60);
+ OLYMPIAD_RANK2_POINTS = olympiadConfig.getInt("OlympiadRank2Points", 50);
+ OLYMPIAD_RANK3_POINTS = olympiadConfig.getInt("OlympiadRank3Points", 45);
+ OLYMPIAD_RANK4_POINTS = olympiadConfig.getInt("OlympiadRank4Points", 40);
+ OLYMPIAD_RANK5_POINTS = olympiadConfig.getInt("OlympiadRank5Points", 30);
+ OLYMPIAD_MAX_POINTS = olympiadConfig.getInt("OlympiadMaxPoints", 10);
+ OLYMPIAD_DIVIDER_CLASSED = olympiadConfig.getInt("OlympiadDividerClassed", 5);
+ OLYMPIAD_DIVIDER_NON_CLASSED = olympiadConfig.getInt("OlympiadDividerNonClassed", 5);
+ OLYMPIAD_MAX_WEEKLY_MATCHES = olympiadConfig.getInt("OlympiadMaxWeeklyMatches", 25);
+ OLYMPIAD_LOG_FIGHTS = olympiadConfig.getBoolean("OlympiadLogFights", false);
+ OLYMPIAD_SHOW_MONTHLY_WINNERS = olympiadConfig.getBoolean("OlympiadShowMonthlyWinners", true);
+ OLYMPIAD_ANNOUNCE_GAMES = olympiadConfig.getBoolean("OlympiadAnnounceGames", true);
+ final String olyRestrictedItems = olympiadConfig.getString("OlympiadRestrictedItems", "").trim();
if (!olyRestrictedItems.isEmpty())
{
final String[] olyRestrictedItemsSplit = olyRestrictedItems.split(",");
- LIST_OLY_RESTRICTED_ITEMS = new HashSet<>(olyRestrictedItemsSplit.length);
+ OLYMPIAD_RESTRICTED_ITEMS = new HashSet<>(olyRestrictedItemsSplit.length);
for (String id : olyRestrictedItemsSplit)
{
- LIST_OLY_RESTRICTED_ITEMS.add(Integer.parseInt(id));
+ OLYMPIAD_RESTRICTED_ITEMS.add(Integer.parseInt(id));
}
}
else // In case of reload with removal of all items ids.
{
- LIST_OLY_RESTRICTED_ITEMS.clear();
+ OLYMPIAD_RESTRICTED_ITEMS.clear();
}
- ALT_OLY_WEAPON_ENCHANT_LIMIT = olympiadConfig.getInt("AltOlyWeaponEnchantLimit", -1);
- ALT_OLY_ARMOR_ENCHANT_LIMIT = olympiadConfig.getInt("AltOlyArmorEnchantLimit", -1);
- ALT_OLY_WAIT_TIME = olympiadConfig.getInt("AltOlyWaitTime", 60);
- ALT_OLY_PERIOD = olympiadConfig.getString("AltOlyPeriod", "MONTH");
- ALT_OLY_PERIOD_MULTIPLIER = olympiadConfig.getInt("AltOlyPeriodMultiplier", 1);
- ALT_OLY_COMPETITION_DAYS = new ArrayList<>();
- for (String s : olympiadConfig.getString("AltOlyCompetitionDays", "6,7").split(","))
+ OLYMPIAD_WEAPON_ENCHANT_LIMIT = olympiadConfig.getInt("OlympiadWeaponEnchantLimit", -1);
+ OLYMPIAD_ARMOR_ENCHANT_LIMIT = olympiadConfig.getInt("OlympiadArmorEnchantLimit", -1);
+ OLYMPIAD_WAIT_TIME = olympiadConfig.getInt("OlympiadWaitTime", 60);
+ OLYMPIAD_PERIOD = olympiadConfig.getString("OlympiadPeriod", "MONTH");
+ OLYMPIAD_PERIOD_MULTIPLIER = olympiadConfig.getInt("OlympiadPeriodMultiplier", 1);
+ OLYMPIAD_COMPETITION_DAYS = new ArrayList<>();
+ for (String s : olympiadConfig.getString("OlympiadCompetitionDays", "6,7").split(","))
{
- ALT_OLY_COMPETITION_DAYS.add(Integer.parseInt(s));
+ OLYMPIAD_COMPETITION_DAYS.add(Integer.parseInt(s));
}
final File hexIdFile = new File(HEXID_FILE);
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/enums/OlympiadMode.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/enums/OlympiadMode.java
new file mode 100644
index 0000000000..a65f6a86a4
--- /dev/null
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/enums/OlympiadMode.java
@@ -0,0 +1,28 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.enums;
+
+/**
+ * @author NasSeKa
+ */
+public enum OlympiadMode
+{
+ NONE,
+ BLUE,
+ RED,
+ SPECTATOR
+}
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/EffectList.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/EffectList.java
index 1e06e53fdc..a47767be30 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/EffectList.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/EffectList.java
@@ -50,9 +50,9 @@ import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.model.skill.SkillBuffType;
import org.l2jmobius.gameserver.network.serverpackets.AbnormalStatusUpdate;
import org.l2jmobius.gameserver.network.serverpackets.ExAbnormalStatusUpdateFromTarget;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadSpelledInfo;
import org.l2jmobius.gameserver.network.serverpackets.PartySpelled;
import org.l2jmobius.gameserver.network.serverpackets.ShortBuffStatusUpdate;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadSpelledInfo;
/**
* Effect lists.
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Player.java
index e9fef38650..c93a046978 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -97,6 +97,7 @@ import org.l2jmobius.gameserver.enums.ItemGrade;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.enums.MountType;
import org.l2jmobius.gameserver.enums.NextActionType;
+import org.l2jmobius.gameserver.enums.OlympiadMode;
import org.l2jmobius.gameserver.enums.PartyDistributionType;
import org.l2jmobius.gameserver.enums.PartyMessageType;
import org.l2jmobius.gameserver.enums.PartySmallWindowUpdateType;
@@ -303,7 +304,6 @@ import org.l2jmobius.gameserver.network.serverpackets.ExDuelUpdateUserInfo;
import org.l2jmobius.gameserver.network.serverpackets.ExGetBookMarkInfoPacket;
import org.l2jmobius.gameserver.network.serverpackets.ExGetOnAirShip;
import org.l2jmobius.gameserver.network.serverpackets.ExMagicAttackInfo;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMode;
import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCount;
import org.l2jmobius.gameserver.network.serverpackets.ExPrivateStoreSetWholeMsg;
import org.l2jmobius.gameserver.network.serverpackets.ExQuestItemList;
@@ -359,6 +359,7 @@ import org.l2jmobius.gameserver.network.serverpackets.autoplay.ExActivateAutoSho
import org.l2jmobius.gameserver.network.serverpackets.autoplay.ExAutoPlaySettingSend;
import org.l2jmobius.gameserver.network.serverpackets.commission.ExResponseCommissionInfo;
import org.l2jmobius.gameserver.network.serverpackets.friend.FriendStatus;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMode;
import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
import org.l2jmobius.gameserver.taskmanager.AutoPlayTaskManager;
import org.l2jmobius.gameserver.taskmanager.AutoUseTaskManager;
@@ -9272,7 +9273,10 @@ public class Player extends Playable
public void enterObserverMode(Location loc)
{
- setLastLocation();
+ if (!isInOlympiadMode())
+ {
+ setLastLocation();
+ }
// Remove Hide.
getEffectList().stopEffects(AbnormalType.HIDE);
@@ -9325,7 +9329,7 @@ public class Player extends Playable
{
standUp();
}
- if (!_observerMode)
+ if (!_observerMode && !isInOlympiadMode())
{
setLastLocation();
}
@@ -9336,7 +9340,7 @@ public class Player extends Playable
setInvisible(true);
setInstance(OlympiadGameManager.getInstance().getOlympiadTask(id).getStadium().getInstance());
teleToLocation(loc, false);
- sendPacket(new ExOlympiadMode(3));
+ sendPacket(new ExOlympiadMode(OlympiadMode.SPECTATOR));
broadcastUserInfo();
}
@@ -9372,7 +9376,7 @@ public class Player extends Playable
_olympiadGameId = -1;
_observerMode = false;
setTarget(null);
- sendPacket(new ExOlympiadMode(0));
+ sendPacket(new ExOlympiadMode(OlympiadMode.NONE));
setInstance(null);
teleToLocation(_lastLoc, true);
if (!isGM())
@@ -9555,14 +9559,24 @@ public class Player extends Playable
return _olympiadStart;
}
+ public boolean isInOlympiadMode()
+ {
+ return _inOlympiadMode;
+ }
+
public boolean isHero()
{
return _hero;
}
- public boolean isInOlympiadMode()
+ public boolean isLegend()
{
- return _inOlympiadMode;
+ return getVariables().getBoolean(PlayerVariables.IS_LEGEND, false);
+ }
+
+ public void setLegend(boolean legend)
+ {
+ getVariables().set(PlayerVariables.IS_LEGEND, legend);
}
public boolean isInDuel()
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/item/ItemTemplate.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/item/ItemTemplate.java
index a0e189a4a2..613eb765fb 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/item/ItemTemplate.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/item/ItemTemplate.java
@@ -940,7 +940,7 @@ public abstract class ItemTemplate extends ListenersContainer implements IIdenti
public boolean isOlyRestrictedItem()
{
- return _isOlyRestricted || Config.LIST_OLY_RESTRICTED_ITEMS.contains(_itemId);
+ return _isOlyRestricted || Config.OLYMPIAD_RESTRICTED_ITEMS.contains(_itemId);
}
/**
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/item/instance/Item.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/item/instance/Item.java
index 1d440c4a12..0780b9a7ba 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/item/instance/Item.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/item/instance/Item.java
@@ -1995,16 +1995,16 @@ public class Item extends WorldObject
{
if (_itemTemplate.isWeapon())
{
- if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT))
+ if ((Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT))
{
- enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT;
+ enchant = Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT;
}
}
else
{
- if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT))
+ if ((Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT))
{
- enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT;
+ enchant = Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT;
}
}
}
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
index fb239220d0..f06642dc33 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
@@ -22,6 +22,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.ai.CtrlIntention;
+import org.l2jmobius.gameserver.enums.OlympiadMode;
import org.l2jmobius.gameserver.enums.PartyMessageType;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
@@ -39,11 +40,11 @@ import org.l2jmobius.gameserver.model.siege.Castle;
import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.network.SystemMessageId;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMode;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
import org.l2jmobius.gameserver.network.serverpackets.SkillCoolTime;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMode;
/**
* @author godson, GodKratos, Pere, DS
@@ -163,7 +164,7 @@ public abstract class AbstractOlympiadGame
return null;
}
- protected static boolean portPlayerToArena(Participant par, Location loc, int id, Instance instance)
+ protected static boolean portPlayerToArena(Participant par, Location loc, int id, Instance instance, OlympiadMode mode)
{
final Player player = par.getPlayer();
if ((player == null) || !player.isOnline())
@@ -173,6 +174,7 @@ public abstract class AbstractOlympiadGame
try
{
+ player.setPvpFlag(0);
player.setLastLocation();
if (player.isSitting())
{
@@ -185,7 +187,32 @@ public abstract class AbstractOlympiadGame
player.setOlympiadStart(false);
player.setOlympiadSide(par.getSide());
player.teleToLocation(loc, instance);
- player.sendPacket(new ExOlympiadMode(2));
+ player.sendPacket(new ExOlympiadMode(mode));
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ return false;
+ }
+ return true;
+ }
+
+ protected static boolean portPlayerToSpot(Participant par, Location loc, int id)
+ {
+ final Player player = par.getPlayer();
+ if ((player == null) || !player.isOnline())
+ {
+ return false;
+ }
+
+ try
+ {
+ if (player.isSitting())
+ {
+ player.standUp();
+ }
+ player.setTarget(null);
+ player.teleToLocation(loc);
}
catch (Exception e)
{
@@ -299,6 +326,48 @@ public abstract class AbstractOlympiadGame
}
}
+ protected void roundTwoClean(Player player)
+ {
+ try
+ {
+ if (player == null)
+ {
+ return;
+ }
+
+ // Remove Debuffs
+ player.getEffectList().stopEffects(info -> info.getSkill().isDebuff(), true, true);
+
+ // Abort casting if player casting
+ player.abortAttack();
+ player.abortCast();
+
+ // Force the character to be visible
+ player.setInvisible(false);
+
+ // Heal Player fully
+ player.setCurrentCp(player.getMaxCp());
+ player.setCurrentHp(player.getMaxHp());
+ player.setCurrentMp(player.getMaxMp());
+
+ // enable skills with cool time <= 15 minutes
+ for (Skill skill : player.getAllSkills())
+ {
+ if (skill.getReuseDelay() <= 900000)
+ {
+ player.enableSkill(skill);
+ }
+ }
+
+ player.sendSkillList();
+ player.sendPacket(new SkillCoolTime(player));
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+ }
+
protected void cleanEffects(Player player)
{
try
@@ -371,7 +440,8 @@ public abstract class AbstractOlympiadGame
player.setOlympiadStart(false);
player.setOlympiadSide(-1);
player.setOlympiadGameId(-1);
- player.sendPacket(new ExOlympiadMode(0));
+ player.sendPacket(new ExOlympiadMode(OlympiadMode.SPECTATOR));
+ player.sendPacket(new ExOlympiadMode(OlympiadMode.NONE));
// Add Clan Skills
final Clan clan = player.getClan();
@@ -420,6 +490,7 @@ public abstract class AbstractOlympiadGame
{
return;
}
+
final Location loc = player.getLastLocation();
if (loc != null)
{
@@ -481,6 +552,8 @@ public abstract class AbstractOlympiadGame
protected abstract boolean portPlayersToArena(List spawns, Instance instance);
+ protected abstract boolean portPlayersToSpots(List spawns, Instance instance);
+
protected abstract void cleanEffects();
protected abstract void portPlayersBack();
@@ -489,22 +562,40 @@ public abstract class AbstractOlympiadGame
protected abstract void clearPlayers();
+ protected abstract void matchEnd(boolean value);
+
+ protected abstract boolean isMatchEnd();
+
protected abstract void handleDisconnect(Player player);
protected abstract void resetDamage();
+ protected abstract void resetDamageFinal();
+
protected abstract void addDamage(Player player, int damage);
protected abstract boolean checkBattleStatus();
protected abstract boolean haveWinner();
+ protected abstract boolean roundWinner();
+
protected abstract void validateWinner(OlympiadStadium stadium);
+ protected abstract void validateRound1Winner(OlympiadStadium stadium);
+
+ protected abstract void validateRound2Winner(OlympiadStadium stadium);
+
+ protected abstract void validateRound3Winner(OlympiadStadium stadium);
+
protected abstract int getDivider();
protected abstract void healPlayers();
+ protected abstract void buffPlayers();
+
+ protected abstract void roundTwoCleanUp();
+
protected abstract void untransformPlayers();
protected abstract void makePlayersInvul();
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/Hero.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
index 22accd82c3..0164986e0c 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
@@ -40,6 +40,7 @@ import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ClassListData;
import org.l2jmobius.gameserver.data.xml.NpcData;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
+import org.l2jmobius.gameserver.instancemanager.RankManager;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Player;
@@ -71,7 +72,7 @@ public class Hero
private static final String INSERT_HERO = "INSERT INTO heroes (charId, class_id, count, legend_count, played, claimed) VALUES (?,?,?,?,?,?)";
private static final String UPDATE_HERO = "UPDATE heroes SET count = ?, legend_count = ?, played = ?, claimed = ? WHERE charId = ?";
private static final String GET_CLAN_ALLY = "SELECT characters.clanid AS clanid, coalesce(clan_data.ally_Id, 0) AS allyId FROM characters LEFT JOIN clan_data ON clan_data.clan_id = characters.clanid WHERE characters.charId = ?";
- private static final String DELETE_ITEMS = "DELETE FROM items WHERE item_id IN (30392, 30393, 30394, 30395, 30396, 30397, 30398, 30399, 30400, 30401, 30402, 30403, 30404, 30405, 30372, 30373, 6842, 6611, 6612, 6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 9388, 9389, 9390, 48551, 48552) AND owner_id NOT IN (SELECT charId FROM characters WHERE accesslevel > 0)";
+ private static final String DELETE_ITEMS = "DELETE FROM items WHERE item_id IN (30392, 30393, 30394, 30395, 30396, 30397, 30398, 30399, 30400, 30401, 30402, 30403, 30404, 30405, 30372, 30373, 6842, 6611, 6612, 6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 9388, 9389, 9390, 48551, 48552, 48554, 48555, 48556, 48557, 48558, 48559, 48560, 48561, 48562, 48563, 48564, 48565, 48566, 48567) AND owner_id NOT IN (SELECT charId FROM characters WHERE accesslevel > 0)";
private static final Map HEROES = new ConcurrentHashMap<>();
private static final Map COMPLETE_HEROS = new ConcurrentHashMap<>();
@@ -95,7 +96,10 @@ public class Hero
protected Hero()
{
- init();
+ if (Config.OLYMPIAD_ENABLED)
+ {
+ init();
+ }
}
private void init()
@@ -607,6 +611,10 @@ public class Hero
}
player.setHero(false);
+ if (player.isLegend())
+ {
+ player.setLegend(false);
+ }
for (int i = 0; i < Inventory.PAPERDOLL_TOTALSLOTS; i++)
{
@@ -644,19 +652,17 @@ public class Hero
for (StatSet hero : newHeroes)
{
+ final int legendId = RankManager.getInstance().getOlyRankList().get(1).getInt("charId", 0);
final int charId = hero.getInt(Olympiad.CHAR_ID);
if (COMPLETE_HEROS.containsKey(charId))
{
final StatSet oldHero = COMPLETE_HEROS.get(charId);
- if (hero.getInt(LEGEND_COUNT, 0) == 1)
+ final int count = oldHero.getInt(COUNT);
+ oldHero.set(COUNT, count + 1);
+ if (charId == legendId)
{
- final int count = oldHero.getInt(LEGEND_COUNT);
- oldHero.set(LEGEND_COUNT, count + 1);
- }
- else
- {
- final int count = oldHero.getInt(COUNT);
- oldHero.set(COUNT, count + 1);
+ final int legendCount = oldHero.getInt(LEGEND_COUNT);
+ oldHero.set(LEGEND_COUNT, legendCount + 1);
}
oldHero.set(PLAYED, 1);
oldHero.set(CLAIMED, false);
@@ -667,14 +673,11 @@ public class Hero
final StatSet newHero = new StatSet();
newHero.set(Olympiad.CHAR_NAME, hero.getString(Olympiad.CHAR_NAME));
newHero.set(Olympiad.CLASS_ID, hero.getInt(Olympiad.CLASS_ID));
- if (hero.getInt(LEGEND_COUNT, 0) == 1)
+ newHero.set(COUNT, 1);
+ if (charId == legendId)
{
newHero.set(LEGEND_COUNT, 1);
}
- else
- {
- newHero.set(COUNT, 1);
- }
newHero.set(PLAYED, 1);
newHero.set(CLAIMED, false);
HEROES.put(charId, newHero);
@@ -918,6 +921,7 @@ public class Hero
*/
public void claimHero(Player player)
{
+ final int legendId = RankManager.getInstance().getOlyRankList().get(1).getInt("charId", 0);
StatSet hero = HEROES.get(player.getObjectId());
if (hero == null)
{
@@ -938,6 +942,19 @@ public class Hero
}
player.setHero(true);
+ if (player.getObjectId() == legendId)
+ {
+ player.setLegend(true);
+ player.getVariables().set(ALLY_NAME, false);
+ if ((clan != null) && (clan.getLevel() >= 5))
+ {
+ clan.addReputationScore(100000);
+ final SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_MEMBER_C1_WAS_NAMED_A_HERO_S2_POINTS_HAVE_BEEN_ADDED_TO_YOUR_CLAN_REPUTATION);
+ sm.addString(CharNameTable.getInstance().getNameById(player.getObjectId()));
+ sm.addInt(Config.HERO_POINTS);
+ clan.broadcastToOnlineMembers(sm);
+ }
+ }
player.broadcastPacket(new SocialAction(player.getObjectId(), 20016)); // Hero Animation
player.sendPacket(new UserInfo(player));
player.broadcastUserInfo();
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java
index 8864817e16..f8c7c09208 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java
@@ -50,6 +50,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.events.ListenersContainer;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadInfo;
import org.l2jmobius.gameserver.util.Broadcast;
/**
@@ -69,13 +70,13 @@ public class Olympiad extends ListenersContainer
private static final String OLYMPIAD_LOAD_NOBLES = "SELECT olympiad_nobles.charId, olympiad_nobles.class_id, characters.char_name, olympiad_nobles.olympiad_points, olympiad_nobles.competitions_done, olympiad_nobles.competitions_won, olympiad_nobles.competitions_lost, olympiad_nobles.competitions_drawn, olympiad_nobles.competitions_done_week FROM olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId";
private static final String OLYMPIAD_SAVE_NOBLES = "INSERT INTO olympiad_nobles (`charId`,`class_id`,`olympiad_points`,`competitions_done`,`competitions_won`,`competitions_lost`,`competitions_drawn`, `competitions_done_week`) VALUES (?,?,?,?,?,?,?,?)";
private static final String OLYMPIAD_UPDATE_NOBLES = "UPDATE olympiad_nobles SET olympiad_points = ?, competitions_done = ?, competitions_won = ?, competitions_lost = ?, competitions_drawn = ?, competitions_done_week = ? WHERE charId = ?";
- private static final String OLYMPIAD_GET_HEROS = "SELECT olympiad_nobles.charId, characters.char_name FROM olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND olympiad_nobles.class_id = ? AND olympiad_nobles.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " AND olympiad_nobles.competitions_won > 0 ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC";
- private static final String OLYMPIAD_GET_LEGEND = "SELECT olympiad_nobles.charId FROM olympiad_nobles WHERE olympiad_nobles.competitions_done >=" + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC LIMIT 1";
- private static final String GET_ALL_CLASSIFIED_NOBLESS = "SELECT charId from olympiad_nobles_eom WHERE competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_points DESC, competitions_done DESC, competitions_won DESC";
- private static final String GET_EACH_CLASS_LEADER = "SELECT characters.char_name from olympiad_nobles_eom, characters WHERE characters.charId = olympiad_nobles_eom.charId AND olympiad_nobles_eom.class_id = ? AND olympiad_nobles_eom.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles_eom.olympiad_points DESC, olympiad_nobles_eom.competitions_done DESC, olympiad_nobles_eom.competitions_won DESC LIMIT 10";
- private static final String GET_EACH_CLASS_LEADER_CURRENT = "SELECT characters.char_name from olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND olympiad_nobles.class_id = ? AND olympiad_nobles.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC LIMIT 10";
- private static final String GET_EACH_CLASS_LEADER_SOULHOUND = "SELECT characters.char_name from olympiad_nobles_eom, characters WHERE characters.charId = olympiad_nobles_eom.charId AND (olympiad_nobles_eom.class_id = ? OR olympiad_nobles_eom.class_id = 133) AND olympiad_nobles_eom.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles_eom.olympiad_points DESC, olympiad_nobles_eom.competitions_done DESC, olympiad_nobles_eom.competitions_won DESC LIMIT 10";
- private static final String GET_EACH_CLASS_LEADER_CURRENT_SOULHOUND = "SELECT characters.char_name from olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND (olympiad_nobles.class_id = ? OR olympiad_nobles.class_id = 133) AND olympiad_nobles.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC LIMIT 10";
+ private static final String OLYMPIAD_GET_HEROS = "SELECT olympiad_nobles.charId, characters.char_name FROM olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND olympiad_nobles.class_id = ? AND olympiad_nobles.competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " AND olympiad_nobles.competitions_won > 0 ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC";
+ private static final String OLYMPIAD_GET_LEGEND = "SELECT olympiad_nobles.charId FROM olympiad_nobles WHERE olympiad_nobles.competitions_done >=" + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC LIMIT 1";
+ private static final String GET_ALL_CLASSIFIED_NOBLESS = "SELECT charId from olympiad_nobles_eom WHERE competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_points DESC, competitions_done DESC, competitions_won DESC";
+ private static final String GET_EACH_CLASS_LEADER = "SELECT characters.char_name from olympiad_nobles_eom, characters WHERE characters.charId = olympiad_nobles_eom.charId AND olympiad_nobles_eom.class_id = ? AND olympiad_nobles_eom.competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_nobles_eom.olympiad_points DESC, olympiad_nobles_eom.competitions_done DESC, olympiad_nobles_eom.competitions_won DESC LIMIT 10";
+ private static final String GET_EACH_CLASS_LEADER_CURRENT = "SELECT characters.char_name from olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND olympiad_nobles.class_id = ? AND olympiad_nobles.competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC LIMIT 10";
+ private static final String GET_EACH_CLASS_LEADER_SOULHOUND = "SELECT characters.char_name from olympiad_nobles_eom, characters WHERE characters.charId = olympiad_nobles_eom.charId AND (olympiad_nobles_eom.class_id = ? OR olympiad_nobles_eom.class_id = 133) AND olympiad_nobles_eom.competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_nobles_eom.olympiad_points DESC, olympiad_nobles_eom.competitions_done DESC, olympiad_nobles_eom.competitions_won DESC LIMIT 10";
+ private static final String GET_EACH_CLASS_LEADER_CURRENT_SOULHOUND = "SELECT characters.char_name from olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND (olympiad_nobles.class_id = ? OR olympiad_nobles.class_id = 133) AND olympiad_nobles.competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC LIMIT 10";
private static final String REMOVE_UNCLAIMED_POINTS = "DELETE FROM character_variables WHERE charId=? AND var=?";
private static final String INSERT_UNCLAIMED_POINTS = "INSERT INTO character_variables (charId, var, val) VALUES (?, ?, ?)";
@@ -87,14 +88,13 @@ public class Olympiad extends ListenersContainer
private static final Set HERO_IDS = CategoryData.getInstance().getCategoryByType(CategoryType.SIXTH_CLASS_GROUP);
- private static final int COMP_START = Config.ALT_OLY_START_TIME; // 6PM
- private static final int COMP_MIN = Config.ALT_OLY_MIN; // 00 mins
- private static final long COMP_PERIOD = Config.ALT_OLY_CPERIOD; // 6 hours
- protected static final long WEEKLY_PERIOD = Config.ALT_OLY_WPERIOD; // 1 week
- protected static final long VALIDATION_PERIOD = Config.ALT_OLY_VPERIOD; // 24 hours
+ private static final int COMP_START = Config.OLYMPIAD_START_TIME; // 6PM
+ private static final int COMP_MIN = Config.OLYMPIAD_MIN; // 00 mins
+ private static final long COMP_PERIOD = Config.OLYMPIAD_CPERIOD; // 6 hours
+ protected static final long WEEKLY_PERIOD = Config.OLYMPIAD_WPERIOD; // 1 week
+ protected static final long VALIDATION_PERIOD = Config.OLYMPIAD_VPERIOD; // 24 hours
- public static final int DEFAULT_POINTS = Config.ALT_OLY_START_POINTS;
- protected static final int WEEKLY_POINTS = Config.ALT_OLY_WEEKLY_POINTS;
+ public static final int DEFAULT_POINTS = Config.OLYMPIAD_START_POINTS;
public static final String CHAR_ID = "charId";
public static final String CLASS_ID = "class_id";
@@ -131,12 +131,19 @@ public class Olympiad extends ListenersContainer
protected Olympiad()
{
- load();
- AntiFeedManager.getInstance().registerEvent(AntiFeedManager.OLYMPIAD_ID);
-
- if (_period == 0)
+ if (Config.OLYMPIAD_ENABLED)
{
- init();
+ load();
+ AntiFeedManager.getInstance().registerEvent(AntiFeedManager.OLYMPIAD_ID);
+
+ if (_period == 0)
+ {
+ init();
+ }
+ }
+ else
+ {
+ LOGGER.log(Level.INFO, "Disabled.");
}
}
@@ -399,7 +406,7 @@ public class Olympiad extends ListenersContainer
int dayCounter = 0;
for (int i = currentDay; i < 8; i++)
{
- if (Config.ALT_OLY_COMPETITION_DAYS.contains(i))
+ if (Config.OLYMPIAD_COMPETITION_DAYS.contains(i))
{
dayFound = true;
break;
@@ -410,7 +417,7 @@ public class Olympiad extends ListenersContainer
{
for (int i = 1; i < 8; i++)
{
- if (Config.ALT_OLY_COMPETITION_DAYS.contains(i))
+ if (Config.OLYMPIAD_COMPETITION_DAYS.contains(i))
{
break;
}
@@ -514,19 +521,24 @@ public class Olympiad extends ListenersContainer
_scheduledCompStart = ThreadPool.schedule(() ->
{
- if (isOlympiadEnd())
+ if (isOlympiadEnd() || !Config.OLYMPIAD_ENABLED)
{
return;
}
_inCompPeriod = true;
+ for (Player player : World.getInstance().getPlayers())
+ {
+ player.sendPacket(new ExOlympiadInfo(1));
+ }
+
Broadcast.toAllOnlinePlayers(new SystemMessage(SystemMessageId.THE_OLYMPIAD_HAS_BEGAN));
LOGGER.info("Olympiad System: Olympiad Games have started.");
LOGGER_OLYMPIAD.info("Result,Player1,Player2,Player1 HP,Player2 HP,Player1 Damage,Player2 Damage,Points,Classed");
_gameManager = ThreadPool.scheduleAtFixedRate(OlympiadGameManager.getInstance(), 30000, 30000);
- if (Config.ALT_OLY_ANNOUNCE_GAMES)
+ if (Config.OLYMPIAD_ANNOUNCE_GAMES)
{
_gameAnnouncer = ThreadPool.scheduleAtFixedRate(new OlympiadAnnouncer(), 30000, 500);
}
@@ -543,7 +555,14 @@ public class Olympiad extends ListenersContainer
{
return;
}
+
_inCompPeriod = false;
+
+ for (Player player : World.getInstance().getPlayers())
+ {
+ player.sendPacket(new ExOlympiadInfo(0));
+ }
+
Broadcast.toAllOnlinePlayers(new SystemMessage(SystemMessageId.BATTLES_IN_THE_OLYMPIAD_GAMES_ARE_NOW_OVER));
LOGGER.info("Olympiad System: Olympiad games have ended.");
@@ -624,33 +643,33 @@ public class Olympiad extends ListenersContainer
final Calendar nextChange = Calendar.getInstance();
- switch (Config.ALT_OLY_PERIOD)
+ switch (Config.OLYMPIAD_PERIOD)
{
case "DAY":
{
- currentTime.add(Calendar.DAY_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
+ currentTime.add(Calendar.DAY_OF_MONTH, Config.OLYMPIAD_PERIOD_MULTIPLIER);
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
- if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 14)
+ if (Config.OLYMPIAD_PERIOD_MULTIPLIER >= 14)
{
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
}
- else if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 7)
+ else if (Config.OLYMPIAD_PERIOD_MULTIPLIER >= 7)
{
_nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2);
}
else
{
- LOGGER.warning("Invalid config value for Config.ALT_OLY_PERIOD_MULTIPLIER, must be >= 7");
+ LOGGER.warning("Invalid config value for Config.OLYMPIAD_PERIOD_MULTIPLIER, must be >= 7");
}
break;
}
case "WEEK":
{
- currentTime.add(Calendar.WEEK_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
+ currentTime.add(Calendar.WEEK_OF_MONTH, Config.OLYMPIAD_PERIOD_MULTIPLIER);
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
- if (Config.ALT_OLY_PERIOD_MULTIPLIER > 1)
+ if (Config.OLYMPIAD_PERIOD_MULTIPLIER > 1)
{
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
}
@@ -662,7 +681,7 @@ public class Olympiad extends ListenersContainer
}
case "MONTH":
{
- currentTime.add(Calendar.MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
+ currentTime.add(Calendar.MONTH, Config.OLYMPIAD_PERIOD_MULTIPLIER);
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
@@ -719,7 +738,7 @@ public class Olympiad extends ListenersContainer
int dayCounter = 0;
for (int i = currentDay; i < 8; i++)
{
- if (Config.ALT_OLY_COMPETITION_DAYS.contains(i))
+ if (Config.OLYMPIAD_COMPETITION_DAYS.contains(i))
{
dayFound = true;
break;
@@ -730,7 +749,7 @@ public class Olympiad extends ListenersContainer
{
for (int i = 1; i < 8; i++)
{
- if (Config.ALT_OLY_COMPETITION_DAYS.contains(i))
+ if (Config.OLYMPIAD_COMPETITION_DAYS.contains(i))
{
break;
}
@@ -769,8 +788,6 @@ public class Olympiad extends ListenersContainer
{
_scheduledWeeklyTask = ThreadPool.scheduleAtFixedRate(() ->
{
- addWeeklyPoints();
- LOGGER.info("Olympiad System: Added weekly points to nobles");
resetWeeklyMatches();
LOGGER.info("Olympiad System: Reset weekly matches to nobles");
@@ -778,22 +795,6 @@ public class Olympiad extends ListenersContainer
}, getMillisToWeekChange(), WEEKLY_PERIOD);
}
- protected synchronized void addWeeklyPoints()
- {
- if (_period == 1)
- {
- return;
- }
-
- int currentPoints;
- for (StatSet nobleInfo : NOBLES.values())
- {
- currentPoints = nobleInfo.getInt(POINTS);
- currentPoints += WEEKLY_POINTS;
- nobleInfo.set(POINTS, currentPoints);
- }
- }
-
/**
* Resets number of matches, classed matches, non classed matches, team matches done by noble characters in the week.
*/
@@ -1036,7 +1037,7 @@ public class Olympiad extends ListenersContainer
public List getClassLeaderBoard(int classId)
{
final List names = new ArrayList<>();
- final String query = Config.ALT_OLY_SHOW_MONTHLY_WINNERS ? ((classId == 132) ? GET_EACH_CLASS_LEADER_SOULHOUND : GET_EACH_CLASS_LEADER) : ((classId == 132) ? GET_EACH_CLASS_LEADER_CURRENT_SOULHOUND : GET_EACH_CLASS_LEADER_CURRENT);
+ final String query = Config.OLYMPIAD_SHOW_MONTHLY_WINNERS ? ((classId == 132) ? GET_EACH_CLASS_LEADER_SOULHOUND : GET_EACH_CLASS_LEADER) : ((classId == 132) ? GET_EACH_CLASS_LEADER_CURRENT_SOULHOUND : GET_EACH_CLASS_LEADER_CURRENT);
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(query))
{
@@ -1075,33 +1076,33 @@ public class Olympiad extends ListenersContainer
}
// Hero point bonus
- int points = Hero.getInstance().isHero(objectId) || Hero.getInstance().isUnclaimedHero(objectId) ? Config.ALT_OLY_HERO_POINTS : 0;
+ int points = Hero.getInstance().isHero(objectId) || Hero.getInstance().isUnclaimedHero(objectId) ? Config.OLYMPIAD_HERO_POINTS : 0;
// Rank point bonus
switch (NOBLES_RANK.get(objectId))
{
case 1:
{
- points += Config.ALT_OLY_RANK1_POINTS;
+ points += Config.OLYMPIAD_RANK1_POINTS;
break;
}
case 2:
{
- points += Config.ALT_OLY_RANK2_POINTS;
+ points += Config.OLYMPIAD_RANK2_POINTS;
break;
}
case 3:
{
- points += Config.ALT_OLY_RANK3_POINTS;
+ points += Config.OLYMPIAD_RANK3_POINTS;
break;
}
case 4:
{
- points += Config.ALT_OLY_RANK4_POINTS;
+ points += Config.OLYMPIAD_RANK4_POINTS;
break;
}
default:
{
- points += Config.ALT_OLY_RANK5_POINTS;
+ points += Config.OLYMPIAD_RANK5_POINTS;
}
}
@@ -1203,7 +1204,7 @@ public class Olympiad extends ListenersContainer
*/
public int getRemainingWeeklyMatches(int objId)
{
- return Math.max(Config.ALT_OLY_MAX_WEEKLY_MATCHES - getCompetitionDoneWeek(objId), 0);
+ return Math.max(Config.OLYMPIAD_MAX_WEEKLY_MATCHES - getCompetitionDoneWeek(objId), 0);
}
protected void deleteNobles()
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java
index ce206a1675..2eb778a7ee 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java
@@ -41,7 +41,7 @@ public class OlympiadGameClassed extends OlympiadGameNormal
@Override
protected int getDivider()
{
- return Config.ALT_OLY_DIVIDER_CLASSED;
+ return Config.OLYMPIAD_DIVIDER_CLASSED;
}
protected static OlympiadGameClassed createGame(int id, List> classList)
@@ -73,4 +73,13 @@ public class OlympiadGameClassed extends OlympiadGameNormal
}
return null;
}
+
+ /*
+ * (non-Javadoc)
+ * @see org.l2jmobius.gameserver.model.olympiad.AbstractOlympiadGame#validateRound3Winner(org.l2jmobius.gameserver.model.olympiad.OlympiadStadium)
+ */
+ @Override
+ protected void validateRound3Winner(OlympiadStadium stadium)
+ {
+ }
}
\ No newline at end of file
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNonClassed.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNonClassed.java
index ccea7ddce1..cc60cc61fd 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNonClassed.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNonClassed.java
@@ -39,7 +39,7 @@ public class OlympiadGameNonClassed extends OlympiadGameNormal
@Override
protected int getDivider()
{
- return Config.ALT_OLY_DIVIDER_NON_CLASSED;
+ return Config.OLYMPIAD_DIVIDER_NON_CLASSED;
}
protected static OlympiadGameNonClassed createGame(int id, Set list)
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
index e63fbfb564..cf9cd529fa 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
@@ -27,7 +27,9 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Rnd;
+import org.l2jmobius.gameserver.enums.OlympiadMode;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -35,11 +37,14 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.impl.olympiad.OnOlympiadMatchResult;
import org.l2jmobius.gameserver.model.instancezone.Instance;
+import org.l2jmobius.gameserver.model.skill.CommonSkill;
+import org.l2jmobius.gameserver.model.skill.SkillCaster;
import org.l2jmobius.gameserver.network.SystemMessageId;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchResult;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadUserInfo;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchInfo;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchResult;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadUserInfo;
/**
* @author GodKratos, Pere, DS
@@ -48,10 +53,19 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
{
protected int _damageP1 = 0;
protected int _damageP2 = 0;
+ protected int _damageP1Final = 0;
+ protected int _damageP2Final = 0;
protected Participant _playerOne;
protected Participant _playerTwo;
+ String round_1_winner;
+ String round_2_winner;
+ String round_3_winner;
+ int player1Wins = 0;
+ int player2Wins = 0;
+ boolean matchEnd;
+
protected OlympiadGameNormal(int id, Participant[] opponents)
{
super(id);
@@ -162,8 +176,25 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
boolean result = true;
try
{
- result &= portPlayerToArena(_playerOne, spawns.get(0), _stadiumId, instance);
- result &= portPlayerToArena(_playerTwo, spawns.get(spawns.size() / 2), _stadiumId, instance);
+ result &= portPlayerToArena(_playerOne, spawns.get(0), _stadiumId, instance, OlympiadMode.BLUE);
+ result &= portPlayerToArena(_playerTwo, spawns.get(spawns.size() / 2), _stadiumId, instance, OlympiadMode.RED);
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, "", e);
+ return false;
+ }
+ return result;
+ }
+
+ @Override
+ protected final boolean portPlayersToSpots(List spawns, Instance instance)
+ {
+ boolean result = true;
+ try
+ {
+ result &= portPlayerToSpot(_playerOne, spawns.get(0), _stadiumId);
+ result &= portPlayerToSpot(_playerTwo, spawns.get(spawns.size() / 2), _stadiumId);
}
catch (Exception e)
{
@@ -332,6 +363,407 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
return playerOneLost || playerTwoLost;
}
+ @Override
+ public final boolean roundWinner()
+ {
+ if (!checkBattleStatus())
+ {
+ return true;
+ }
+
+ boolean playerOneLost = true;
+ try
+ {
+ if (_playerOne.getPlayer().getOlympiadGameId() == _stadiumId)
+ {
+ playerOneLost = _playerOne.getPlayer().isDead();
+ }
+ }
+ catch (Exception e)
+ {
+ playerOneLost = true;
+ }
+
+ boolean playerTwoLost = true;
+ try
+ {
+ if (_playerTwo.getPlayer().getOlympiadGameId() == _stadiumId)
+ {
+ playerTwoLost = _playerTwo.getPlayer().isDead();
+ }
+ }
+ catch (Exception e)
+ {
+ playerTwoLost = true;
+ }
+
+ return playerOneLost || playerTwoLost;
+ }
+
+ @Override
+ public void matchEnd(boolean value)
+ {
+ matchEnd = value;
+ }
+
+ @Override
+ public boolean isMatchEnd()
+ {
+ return matchEnd;
+ }
+
+ @Override
+ protected void validateRound1Winner(OlympiadStadium stadium)
+ {
+ if (_aborted)
+ {
+ return;
+ }
+
+ SystemMessage sm;
+
+ try
+ {
+ double playerOneHp = 0;
+ if ((_playerOne.getPlayer() != null) && !_playerOne.getPlayer().isDead())
+ {
+ playerOneHp = _playerOne.getPlayer().getCurrentHp() + _playerOne.getPlayer().getCurrentCp();
+ if (playerOneHp < 0.5)
+ {
+ playerOneHp = 0;
+ }
+ }
+
+ double playerTwoHp = 0;
+ if ((_playerTwo.getPlayer() != null) && !_playerTwo.getPlayer().isDead())
+ {
+ playerTwoHp = _playerTwo.getPlayer().getCurrentHp() + _playerTwo.getPlayer().getCurrentCp();
+ if (playerTwoHp < 0.5)
+ {
+ playerTwoHp = 0;
+ }
+ }
+
+ // if players crashed, search if they've relogged
+ _playerOne.updatePlayer();
+ _playerTwo.updatePlayer();
+
+ _damageP1Final += _damageP1;
+ _damageP2Final += _damageP2;
+
+ if (((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline()) && ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline()))
+ {
+ _playerOne.updateStat(COMP_DRAWN, 1);
+ _playerTwo.updateStat(COMP_DRAWN, 1);
+ sm = new SystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
+ stadium.broadcastPacket(sm);
+ }
+ else if ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerOne.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerTwo.getPlayer().setCurrentCp(_playerTwo.getPlayer().getMaxCp() * 0.7);
+ _playerTwo.getPlayer().setCurrentHp(_playerTwo.getPlayer().getMaxHp() * 0.7);
+ _playerTwo.getPlayer().setCurrentMp(_playerTwo.getPlayer().getMaxMp() * 0.7);
+ _playerTwo.getPlayer().sendPacket(loose);
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 0, 1, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 0, 1, 20));
+ ThreadPool.schedule(() ->
+ {
+ SkillCaster.triggerCast(_playerOne.getPlayer(), _playerOne.getPlayer(), CommonSkill.OLYMPIAD_WIN.getSkill());
+ }, 2000);
+ ThreadPool.schedule(() ->
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 0, 1, 100));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 0, 1, 100));
+ }, 20000);
+ round_1_winner = _playerOne.getName();
+ player1Wins += 1;
+ }
+ else if ((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline() || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP2 > _damageP1) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerTwo.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerOne.getPlayer().sendPacket(loose);
+ _playerOne.getPlayer().setCurrentCp(_playerOne.getPlayer().getMaxCp() * 0.7);
+ _playerOne.getPlayer().setCurrentHp(_playerOne.getPlayer().getMaxHp() * 0.7);
+ _playerOne.getPlayer().setCurrentMp(_playerOne.getPlayer().getMaxMp() * 0.7);
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 1, 1, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 1, 1, 20));
+ ThreadPool.schedule(() ->
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 1, 1, 100));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 1, 1, 100));
+ }, 20000);
+ ThreadPool.schedule(() ->
+ {
+ _playerTwo.getPlayer().useMagic(CommonSkill.OLYMPIAD_WIN.getSkill(), null, false, false);
+ }, 2000);
+ round_1_winner = _playerTwo.getName();
+ player2Wins += 1;
+ }
+ else
+ {
+ round_1_winner = null;
+ final SystemMessage _tie = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIE);
+ _playerTwo.getPlayer().broadcastPacket(_tie);
+ _playerOne.getPlayer().broadcastPacket(_tie);
+ }
+ resetDamage();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, "Exception on validateRound1Winner(): " + e.getMessage(), e);
+ }
+ }
+
+ @Override
+ protected void validateRound2Winner(OlympiadStadium stadium)
+ {
+ if (_aborted)
+ {
+ return;
+ }
+
+ SystemMessage sm;
+
+ try
+ {
+ double playerOneHp = 0;
+ if ((_playerOne.getPlayer() != null) && !_playerOne.getPlayer().isDead())
+ {
+ playerOneHp = _playerOne.getPlayer().getCurrentHp() + _playerOne.getPlayer().getCurrentCp();
+ if (playerOneHp < 0.5)
+ {
+ playerOneHp = 0;
+ }
+ }
+
+ double playerTwoHp = 0;
+ if ((_playerTwo.getPlayer() != null) && !_playerTwo.getPlayer().isDead())
+ {
+ playerTwoHp = _playerTwo.getPlayer().getCurrentHp() + _playerTwo.getPlayer().getCurrentCp();
+ if (playerTwoHp < 0.5)
+ {
+ playerTwoHp = 0;
+ }
+ }
+
+ // if players crashed, search if they've relogged
+ _playerOne.updatePlayer();
+ _playerTwo.updatePlayer();
+
+ _damageP1Final += _damageP1;
+ _damageP2Final += _damageP2;
+
+ if (((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline()) && ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline()))
+ {
+ _playerOne.updateStat(COMP_DRAWN, 1);
+ _playerTwo.updateStat(COMP_DRAWN, 1);
+ sm = new SystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
+ stadium.broadcastPacket(sm);
+ }
+ else if ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerOne.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerTwo.getPlayer().sendPacket(loose);
+ round_2_winner = _playerOne.getName();
+ player1Wins += 1;
+
+ if (round_1_winner.toLowerCase().equalsIgnoreCase(_playerOne.getName()))
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 0, 2, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 0, 2, 20));
+ matchEnd(true);
+ }
+ else
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 20));
+ ThreadPool.schedule(() ->
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 100));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 100));
+ }, 20000);
+ }
+ ThreadPool.schedule(() ->
+ {
+ SkillCaster.triggerCast(_playerOne.getPlayer(), _playerOne.getPlayer(), CommonSkill.OLYMPIAD_WIN.getSkill());
+ }, 2000);
+ }
+ else if ((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline() || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP2 > _damageP1) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerTwo.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerOne.getPlayer().sendPacket(loose);
+ round_2_winner = _playerTwo.getName();
+ player2Wins += 1;
+
+ if (round_1_winner.toLowerCase().equalsIgnoreCase(_playerTwo.getName()))
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 2, 2, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 2, 2, 20));
+ matchEnd(true);
+ }
+ else
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 20));
+ ThreadPool.schedule(() ->
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 100));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 100));
+ }, 20000);
+ }
+ ThreadPool.schedule(() ->
+ {
+ _playerTwo.getPlayer().useMagic(CommonSkill.OLYMPIAD_WIN.getSkill(), null, false, false);
+ }, 2000);
+ }
+ else
+ {
+ final SystemMessage _tie = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIE);
+ _playerTwo.getPlayer().broadcastPacket(_tie);
+ _playerOne.getPlayer().broadcastPacket(_tie);
+ }
+ resetDamage();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, "Exception on validateRound2Winner(): " + e.getMessage(), e);
+ }
+ }
+
+ @Override
+ protected void validateRound3Winner(OlympiadStadium stadium)
+ {
+ if (_aborted)
+ {
+ return;
+ }
+
+ SystemMessage sm;
+
+ try
+ {
+ double playerOneHp = 0;
+ if ((_playerOne.getPlayer() != null) && !_playerOne.getPlayer().isDead())
+ {
+ playerOneHp = _playerOne.getPlayer().getCurrentHp() + _playerOne.getPlayer().getCurrentCp();
+ if (playerOneHp < 0.5)
+ {
+ playerOneHp = 0;
+ }
+ }
+
+ double playerTwoHp = 0;
+ if ((_playerTwo.getPlayer() != null) && !_playerTwo.getPlayer().isDead())
+ {
+ playerTwoHp = _playerTwo.getPlayer().getCurrentHp() + _playerTwo.getPlayer().getCurrentCp();
+ if (playerTwoHp < 0.5)
+ {
+ playerTwoHp = 0;
+ }
+ }
+
+ // if players crashed, search if they've relogged
+ _playerOne.updatePlayer();
+ _playerTwo.updatePlayer();
+
+ _damageP1Final += _damageP1;
+ _damageP2Final += _damageP2;
+
+ if (((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline()) && ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline()))
+ {
+ _playerOne.updateStat(COMP_DRAWN, 1);
+ _playerTwo.updateStat(COMP_DRAWN, 1);
+ sm = new SystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
+ stadium.broadcastPacket(sm);
+ }
+ else if ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerOne.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerTwo.getPlayer().sendPacket(loose);
+ round_3_winner = _playerOne.getName();
+ player1Wins += 1;
+ if (round_3_winner.toLowerCase().equalsIgnoreCase(_playerOne.getName()))
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 1, 3, 0));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 1, 3, 0));
+ }
+ else
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 2, 3, 0));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 2, 3, 0));
+ }
+ ThreadPool.schedule(() ->
+ {
+ SkillCaster.triggerCast(_playerOne.getPlayer(), _playerOne.getPlayer(), CommonSkill.OLYMPIAD_WIN.getSkill());
+ }, 2000);
+
+ }
+ else if ((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline() || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP2 > _damageP1) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerTwo.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerOne.getPlayer().sendPacket(loose);
+ round_3_winner = _playerTwo.getName();
+ player2Wins += 1;
+ if (round_3_winner.toLowerCase().equalsIgnoreCase(_playerTwo.getName()))
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 2, 3, 0));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 2, 3, 0));
+ }
+ else
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 1, 3, 0));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 1, 3, 0));
+ }
+ ThreadPool.schedule(() ->
+ {
+ SkillCaster.triggerCast(_playerTwo.getPlayer(), _playerTwo.getPlayer(), CommonSkill.OLYMPIAD_WIN.getSkill());
+ }, 2000);
+ }
+ else
+ {
+ final SystemMessage _tie = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIE);
+ _playerTwo.getPlayer().broadcastPacket(_tie);
+ _playerOne.getPlayer().broadcastPacket(_tie);
+ }
+ resetDamage();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, "Exception on validateRound3Winner(): " + e.getMessage(), e);
+ }
+ }
+
@Override
protected void validateWinner(OlympiadStadium stadium)
{
@@ -342,7 +774,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
ExOlympiadMatchResult result = null;
- boolean tie = false;
+ boolean tie = round_1_winner == null ? true : false;
int winside = 0;
final List list1 = new ArrayList<>(1);
@@ -358,9 +790,9 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
{
pointDiff = 1;
}
- else if (pointDiff > Config.ALT_OLY_MAX_POINTS)
+ else if (pointDiff > Config.OLYMPIAD_MAX_POINTS)
{
- pointDiff = Config.ALT_OLY_MAX_POINTS;
+ pointDiff = Config.OLYMPIAD_MAX_POINTS;
}
int points;
@@ -375,13 +807,13 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
{
try
{
- points = Math.min(playerOnePoints / 3, Config.ALT_OLY_MAX_POINTS);
+ points = Math.min(playerOnePoints / 3, Config.OLYMPIAD_MAX_POINTS);
removePointsFromParticipant(_playerOne, points);
list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints - points, -points));
winside = 2;
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info(_playerOne.getName() + " default," + _playerOne + "," + _playerTwo + ",0,0,0,0," + points + "," + getType());
}
@@ -395,7 +827,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
{
try
{
- points = Math.min(playerTwoPoints / 3, Config.ALT_OLY_MAX_POINTS);
+ points = Math.min(playerTwoPoints / 3, Config.OLYMPIAD_MAX_POINTS);
removePointsFromParticipant(_playerTwo, points);
list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints - points, -points));
@@ -408,7 +840,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
winside = 1;
}
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info(_playerTwo.getName() + " default," + _playerOne + "," + _playerTwo + ",0,0,0,0," + points + "," + getType());
}
@@ -420,11 +852,11 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
}
if (winside == 1)
{
- result = new ExOlympiadMatchResult(tie, winside, list1, list2);
+ result = new ExOlympiadMatchResult(tie, winside, list1, list2, 0, 0, 0);
}
else
{
- result = new ExOlympiadMatchResult(tie, winside, list2, list1);
+ result = new ExOlympiadMatchResult(tie, winside, list2, list1, 0, 0, 0);
}
stadium.broadcastPacket(result);
return;
@@ -449,17 +881,17 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_playerOne.updateStat(COMP_WON, 1);
addPointsToParticipant(_playerOne, pointDiff);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints + pointDiff, pointDiff));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints + pointDiff, pointDiff));
_playerTwo.updateStat(COMP_LOST, 1);
removePointsFromParticipant(_playerTwo, pointDiff);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints - pointDiff, -pointDiff));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints - pointDiff, -pointDiff));
winside = 1;
- rewardParticipant(_playerOne.getPlayer(), Config.ALT_OLY_WINNER_REWARD); // Winner
+ rewardParticipant(_playerOne.getPlayer(), Config.OLYMPIAD_WINNER_REWARD); // Winner
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info(_playerTwo.getName() + " crash," + _playerOne + "," + _playerTwo + ",0,0,0,0," + pointDiff + "," + getType());
}
@@ -475,17 +907,17 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_playerTwo.updateStat(COMP_WON, 1);
addPointsToParticipant(_playerTwo, pointDiff);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints + pointDiff, pointDiff));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints + pointDiff, pointDiff));
_playerOne.updateStat(COMP_LOST, 1);
removePointsFromParticipant(_playerOne, pointDiff);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints - pointDiff, -pointDiff));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints - pointDiff, -pointDiff));
winside = 2;
- rewardParticipant(_playerTwo.getPlayer(), Config.ALT_OLY_WINNER_REWARD); // Winner
+ rewardParticipant(_playerTwo.getPlayer(), Config.OLYMPIAD_WINNER_REWARD); // Winner
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info(_playerOne.getName() + " crash," + _playerOne + "," + _playerTwo + ",0,0,0,0," + pointDiff + "," + getType());
}
@@ -498,15 +930,15 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_playerOne.updateStat(COMP_LOST, 1);
removePointsFromParticipant(_playerOne, pointDiff);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints - pointDiff, -pointDiff));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints - pointDiff, -pointDiff));
_playerTwo.updateStat(COMP_LOST, 1);
removePointsFromParticipant(_playerTwo, pointDiff);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints - pointDiff, -pointDiff));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints - pointDiff, -pointDiff));
tie = true;
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info("both crash," + _playerOne.getName() + "," + _playerOne + ",0,0,0,0," + _playerTwo + "," + pointDiff + "," + getType());
}
@@ -519,11 +951,11 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
if (winside == 1)
{
- result = new ExOlympiadMatchResult(tie, winside, list1, list2);
+ result = new ExOlympiadMatchResult(tie, winside, list1, list2, 0, 0, 0);
}
else
{
- result = new ExOlympiadMatchResult(tie, winside, list2, list1);
+ result = new ExOlympiadMatchResult(tie, winside, list2, list1, 0, 0, 0);
}
stadium.broadcastPacket(result);
@@ -577,7 +1009,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
sm = new SystemMessage(SystemMessageId.THERE_IS_NO_VICTOR_THE_MATCH_ENDS_IN_A_TIE);
stadium.broadcastPacket(sm);
}
- else if ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
+ else if ((player1Wins == 2) || (_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
{
sm = new SystemMessage(SystemMessageId.CONGRATULATIONS_C1_YOU_WIN_THE_MATCH);
sm.addString(_playerOne.getName());
@@ -587,10 +1019,10 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_playerTwo.updateStat(COMP_LOST, 1);
addPointsToParticipant(_playerOne, pointDiff);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints + pointDiff, pointDiff));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints + pointDiff, pointDiff));
removePointsFromParticipant(_playerTwo, pointDiff);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints - pointDiff, -pointDiff));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints - pointDiff, -pointDiff));
winner = _playerOne.getName() + " won";
winside = 1;
@@ -598,13 +1030,13 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
// Save Fight Result
saveResults(_playerOne, _playerTwo, 1, _startTime, _fightTime, getType());
- rewardParticipant(_playerOne.getPlayer(), Config.ALT_OLY_WINNER_REWARD); // Winner
- rewardParticipant(_playerTwo.getPlayer(), Config.ALT_OLY_LOSER_REWARD); // Loser
+ rewardParticipant(_playerOne.getPlayer(), Config.OLYMPIAD_WINNER_REWARD); // Winner
+ rewardParticipant(_playerTwo.getPlayer(), Config.OLYMPIAD_LOSER_REWARD); // Loser
// Notify to scripts
EventDispatcher.getInstance().notifyEventAsync(new OnOlympiadMatchResult(_playerOne, _playerTwo, getType()), Olympiad.getInstance());
}
- else if ((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline() || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
+ else if ((player2Wins == 2) || (_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline() || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
{
sm = new SystemMessage(SystemMessageId.CONGRATULATIONS_C1_YOU_WIN_THE_MATCH);
sm.addString(_playerTwo.getName());
@@ -614,10 +1046,10 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_playerOne.updateStat(COMP_LOST, 1);
addPointsToParticipant(_playerTwo, pointDiff);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints + pointDiff, pointDiff));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints + pointDiff, pointDiff));
removePointsFromParticipant(_playerOne, pointDiff);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints - pointDiff, -pointDiff));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints - pointDiff, -pointDiff));
winner = _playerTwo.getName() + " won";
winside = 2;
@@ -625,8 +1057,8 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
// Save Fight Result
saveResults(_playerOne, _playerTwo, 2, _startTime, _fightTime, getType());
- rewardParticipant(_playerTwo.getPlayer(), Config.ALT_OLY_WINNER_REWARD); // Winner
- rewardParticipant(_playerOne.getPlayer(), Config.ALT_OLY_LOSER_REWARD); // Loser
+ rewardParticipant(_playerTwo.getPlayer(), Config.OLYMPIAD_WINNER_REWARD); // Winner
+ rewardParticipant(_playerOne.getPlayer(), Config.OLYMPIAD_LOSER_REWARD); // Loser
// Notify to scripts
EventDispatcher.getInstance().notifyEventAsync(new OnOlympiadMatchResult(_playerTwo, _playerOne, getType()), Olympiad.getInstance());
@@ -639,14 +1071,14 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
sm = new SystemMessage(SystemMessageId.THERE_IS_NO_VICTOR_THE_MATCH_ENDS_IN_A_TIE);
stadium.broadcastPacket(sm);
- int value = Math.min(playerOnePoints / getDivider(), Config.ALT_OLY_MAX_POINTS);
+ int value = Math.min(playerOnePoints / getDivider(), Config.OLYMPIAD_MAX_POINTS);
removePointsFromParticipant(_playerOne, value);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints - value, -value));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints - value, -value));
- value = Math.min(playerTwoPoints / getDivider(), Config.ALT_OLY_MAX_POINTS);
+ value = Math.min(playerTwoPoints / getDivider(), Config.OLYMPIAD_MAX_POINTS);
removePointsFromParticipant(_playerTwo, value);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints - value, -value));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints - value, -value));
tie = true;
}
@@ -658,15 +1090,16 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
if (winside == 1)
{
- result = new ExOlympiadMatchResult(tie, winside, list1, list2);
+ result = new ExOlympiadMatchResult(tie, winside, list1, list2, round_1_winner.equalsIgnoreCase(_playerOne.getName()) ? 2 : 3, round_2_winner.equalsIgnoreCase(_playerOne.getName()) ? 2 : 3, (round_3_winner != null) && round_3_winner.equalsIgnoreCase(_playerOne.getName()) ? 2 : (round_3_winner == null) ? 0 : 3);
}
else
{
- result = new ExOlympiadMatchResult(tie, winside, list2, list1);
+ result = new ExOlympiadMatchResult(tie, winside, list2, list1, round_1_winner.equalsIgnoreCase(_playerTwo.getName()) ? 3 : 2, round_2_winner.equalsIgnoreCase(_playerTwo.getName()) ? 3 : 2, (round_3_winner != null) && round_3_winner.equalsIgnoreCase(_playerTwo.getName()) ? 3 : (round_3_winner == null) ? 0 : 2);
}
+
stadium.broadcastPacket(result);
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info(winner + "," + _playerOne.getName() + "," + _playerOne + "," + _playerTwo + "," + playerOneHp + "," + playerTwoHp + "," + _damageP1 + "," + _damageP2 + "," + pointDiff + "," + getType());
}
@@ -750,6 +1183,13 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_damageP2 = 0;
}
+ @Override
+ public void resetDamageFinal()
+ {
+ _damageP1Final = 0;
+ _damageP2Final = 0;
+ }
+
protected void saveResults(Participant one, Participant two, int winner, long startTime, long fightTime, CompetitionType type)
{
try (Connection con = DatabaseFactory.getConnection();
@@ -791,6 +1231,47 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
}
}
+ @Override
+ protected void buffPlayers()
+ {
+ final Player player1 = _playerOne.getPlayer();
+ if (player1 != null)
+ {
+ SkillCaster.triggerCast(player1, player1, CommonSkill.OLYMPIAD_HORN_MELODY.getSkill());
+ SkillCaster.triggerCast(player1, player1, CommonSkill.OLYMPIAD_DRUM_MELODY.getSkill());
+ SkillCaster.triggerCast(player1, player1, CommonSkill.OLYMPIAD_PIPE_ORGAN_MELODY.getSkill());
+ SkillCaster.triggerCast(player1, player1, CommonSkill.OLYMPIAD_GUITAR_MELODY.getSkill());
+ SkillCaster.triggerCast(player1, player1, CommonSkill.OLYMPIAD_HARMONY.getSkill());
+ }
+
+ final Player player2 = _playerTwo.getPlayer();
+ if (player2 != null)
+ {
+ SkillCaster.triggerCast(player2, player2, CommonSkill.OLYMPIAD_HORN_MELODY.getSkill());
+ SkillCaster.triggerCast(player2, player2, CommonSkill.OLYMPIAD_DRUM_MELODY.getSkill());
+ SkillCaster.triggerCast(player2, player2, CommonSkill.OLYMPIAD_PIPE_ORGAN_MELODY.getSkill());
+ SkillCaster.triggerCast(player2, player2, CommonSkill.OLYMPIAD_GUITAR_MELODY.getSkill());
+ SkillCaster.triggerCast(player2, player2, CommonSkill.OLYMPIAD_HARMONY.getSkill());
+ }
+ }
+
+ @Override
+ protected void roundTwoCleanUp()
+ {
+ ThreadPool.schedule(() ->
+ {
+ if ((_playerOne.getPlayer() != null) && !_playerOne.isDefaulted() && !_playerOne.isDisconnected() && (_playerOne.getPlayer().getOlympiadGameId() == _stadiumId))
+ {
+ roundTwoClean(_playerOne.getPlayer());
+ }
+
+ if ((_playerTwo.getPlayer() != null) && !_playerTwo.isDefaulted() && !_playerTwo.isDisconnected() && (_playerTwo.getPlayer().getOlympiadGameId() == _stadiumId))
+ {
+ roundTwoClean(_playerTwo.getPlayer());
+ }
+ }, 1000);
+ }
+
@Override
protected void untransformPlayers()
{
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameState.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameState.java
index f5706a922a..074be05d14 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameState.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameState.java
@@ -24,7 +24,13 @@ enum OlympiadGameState
BATTLE_COUNTDOWN_FIRST,
BATTLE_COUNTDOWN_SECOND,
BATTLE_STARTED,
+ ROUND_1,
+ WAIT_TIME_1,
+ ROUND_2,
+ WAIT_TIME_2,
+ ROUND_3,
BATTLE_IN_PROGRESS,
+ ROUND_ENDED,
GAME_STOPPED,
TELEPORT_TO_TOWN,
CLEANUP,
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
index 119ffc6e4b..bc836c6359 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
@@ -23,6 +23,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchInfo;
/**
* @author DS
@@ -116,7 +117,7 @@ public class OlympiadGameTask implements Runnable
public boolean isBattleStarted()
{
- return _state == OlympiadGameState.BATTLE_IN_PROGRESS;
+ return (_state == OlympiadGameState.BATTLE_IN_PROGRESS) || (_state == OlympiadGameState.ROUND_2) || (_state == OlympiadGameState.ROUND_3);
}
public boolean isBattleFinished()
@@ -163,6 +164,8 @@ public class OlympiadGameTask implements Runnable
{
try
{
+ final String player1 = _game.getPlayerNames()[0];
+ final String player2 = _game.getPlayerNames()[1];
int delay = 1; // schedule next call after 1s
switch (_state)
{
@@ -170,7 +173,7 @@ public class OlympiadGameTask implements Runnable
case BEGIN:
{
_state = OlympiadGameState.TELEPORT_TO_ARENA;
- _countDown = Config.ALT_OLY_WAIT_TIME;
+ _countDown = Config.OLYMPIAD_WAIT_TIME;
break;
}
// Teleport to arena countdown
@@ -198,6 +201,7 @@ public class OlympiadGameTask implements Runnable
// Game start, port players to arena
case GAME_STARTED:
{
+ _stadium.makeZonePvPForCharsInside(false);
if (!startGame())
{
_state = OlympiadGameState.GAME_STOPPED;
@@ -215,7 +219,7 @@ public class OlympiadGameTask implements Runnable
{
if (_countDown > 0)
{
- if (_countDown == 55) // 55sec
+ if (_countDown == 50) // 55sec
{
_game.healPlayers();
}
@@ -232,6 +236,7 @@ public class OlympiadGameTask implements Runnable
{
_game.makePlayersInvul();
_game.resetDamage();
+ _game.resetDamageFinal();
_stadium.openDoors();
_state = OlympiadGameState.BATTLE_COUNTDOWN_SECOND;
@@ -255,15 +260,33 @@ public class OlympiadGameTask implements Runnable
{
_state = OlympiadGameState.BATTLE_STARTED;
_game.removePlayersInvul();
- _stadium.broadcastPacket(new SystemMessage(SystemMessageId.HIDDEN_MSG_START_OLYMPIAD));
}
break;
}
// Beginning of the battle
case BATTLE_STARTED:
{
- _countDown = 0;
+ _countDown = (int) Config.OLYMPIAD_BATTLE / 1000;
+
+ _game.broadcastPacket(new ExOlympiadMatchInfo(player1, player2, 0, 0, 1, 100));
+
+ final SystemMessage round1 = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_ROUND_1);
+ _stadium.broadcastPacket(round1);
+ final SystemMessage start = new SystemMessage(SystemMessageId.HIDDEN_MSG_START_OLYMPIAD);
+ _stadium.broadcastPacket(start);
+ _game.broadcastOlympiadInfo(_stadium);
+ _state = OlympiadGameState.ROUND_1; // set state first, used in zone update
+ if (!startBattle())
+ {
+ _state = OlympiadGameState.GAME_STOPPED;
+ }
+ break;
+ }
+ case ROUND_1:
+ {
_state = OlympiadGameState.BATTLE_IN_PROGRESS; // set state first, used in zone update
+ _countDown = (int) Config.OLYMPIAD_BATTLE / 1000;
+ _stadium.makeZonePvPForCharsInside(true);
if (!startBattle())
{
_state = OlympiadGameState.GAME_STOPPED;
@@ -273,8 +296,8 @@ public class OlympiadGameTask implements Runnable
// Checks during battle
case BATTLE_IN_PROGRESS:
{
- _countDown += 1000;
- final int remaining = (int) ((Config.ALT_OLY_BATTLE - _countDown) / 1000);
+ _countDown -= 1;
+ final int remaining = (int) Config.OLYMPIAD_BATTLE / 1000;
for (int announceTime : BATTLE_END_TIME_SECOND)
{
if (announceTime == remaining)
@@ -285,13 +308,122 @@ public class OlympiadGameTask implements Runnable
break;
}
}
-
- if (checkBattle() || (_countDown > Config.ALT_OLY_BATTLE))
+ if (roundCheck() || (_countDown <= 0))
+ {
+ round1();
+ _game.makePlayersInvul();
+ _state = OlympiadGameState.WAIT_TIME_1;
+ _stadium.makeZonePvPForCharsInside(false);
+ _countDown = 20;
+ }
+ else if (checkBattle())
{
_state = OlympiadGameState.GAME_STOPPED;
}
break;
}
+ case WAIT_TIME_1:
+ {
+ _countDown -= 1;
+ if (_countDown == 14)
+ {
+ _game.buffPlayers();
+ _game.portPlayersToSpots(_stadium.getZone().getSpawns(), _stadium.getInstance());
+ _game.broadcastOlympiadInfo(_stadium);
+ }
+ if (_countDown <= 0)
+ {
+ _game.removePlayersInvul();
+ _state = OlympiadGameState.ROUND_2;
+ _countDown = (int) Config.OLYMPIAD_BATTLE / 1000;
+ final SystemMessage round2 = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_ROUND_2);
+ _stadium.broadcastPacket(round2);
+ final SystemMessage start = new SystemMessage(SystemMessageId.HIDDEN_MSG_START_OLYMPIAD);
+ _stadium.broadcastPacket(start);
+ _stadium.makeZonePvPForCharsInside(true);
+ _game.broadcastOlympiadInfo(_stadium);
+ }
+ break;
+ }
+ case ROUND_2:
+ {
+ _countDown -= 1;
+ final int remaining = (int) Config.OLYMPIAD_BATTLE / 1000;
+ for (int announceTime : BATTLE_END_TIME_SECOND)
+ {
+ if (announceTime == remaining)
+ {
+ final SystemMessage sm = new SystemMessage(SystemMessageId.THE_GAME_WILL_END_IN_S1_SECOND_S);
+ sm.addInt(announceTime);
+ _stadium.broadcastPacket(sm);
+ break;
+ }
+ }
+ if (roundCheck() || (_countDown <= 0))
+ {
+ round2();
+ if (_game.isMatchEnd())
+ {
+ _state = OlympiadGameState.GAME_STOPPED;
+ break;
+ }
+ _state = OlympiadGameState.WAIT_TIME_2;
+ _game.makePlayersInvul();
+ _stadium.makeZonePvPForCharsInside(false);
+ _countDown = 20;
+ }
+ else if (checkBattle())
+ {
+ _state = OlympiadGameState.GAME_STOPPED;
+ }
+ break;
+ }
+ case WAIT_TIME_2:
+ {
+ _countDown -= 1;
+ if (_countDown == 14)
+ {
+ _game.buffPlayers();
+ _game.roundTwoCleanUp();
+ _game.broadcastOlympiadInfo(_stadium);
+ _game.portPlayersToSpots(_stadium.getZone().getSpawns(), _stadium.getInstance());
+ }
+ if (_countDown <= 0)
+ {
+ _state = OlympiadGameState.ROUND_3;
+ _game.removePlayersInvul();
+ _countDown = (int) Config.OLYMPIAD_BATTLE / 1000;
+ final SystemMessage round2 = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_ROUND_3);
+ _stadium.broadcastPacket(round2);
+ final SystemMessage start = new SystemMessage(SystemMessageId.HIDDEN_MSG_START_OLYMPIAD);
+ _stadium.broadcastPacket(start);
+ _stadium.makeZonePvPForCharsInside(true);
+ _game.broadcastOlympiadInfo(_stadium);
+ }
+ break;
+ }
+ case ROUND_3:
+ {
+ _countDown -= 1;
+ final int remaining = (int) Config.OLYMPIAD_BATTLE / 1000;
+ for (int announceTime : BATTLE_END_TIME_SECOND)
+ {
+ if (announceTime == remaining)
+ {
+ final SystemMessage sm = new SystemMessage(SystemMessageId.THE_GAME_WILL_END_IN_S1_SECOND_S);
+ sm.addInt(announceTime);
+ _stadium.broadcastPacket(sm);
+ break;
+ }
+ }
+ if (roundCheck() || (_countDown <= 0) || checkBattle())
+ {
+ round3();
+ _game.makePlayersInvul();
+ _stadium.makeZonePvPForCharsInside(false);
+ }
+ break;
+ }
// End of the battle
case GAME_STOPPED:
{
@@ -425,7 +557,7 @@ public class OlympiadGameTask implements Runnable
{
// game successfully started
_game.broadcastOlympiadInfo(_stadium);
- _stadium.broadcastPacket(new SystemMessage(SystemMessageId.THE_MATCH_HAS_STARTED_FIGHT));
+ // _stadium.broadcastPacket(new SystemMessage(SystemMessageId.THE_MATCH_HAS_STARTED_FIGHT));
_stadium.updateZoneStatusForCharactersInside();
return true;
}
@@ -437,6 +569,82 @@ public class OlympiadGameTask implements Runnable
return false;
}
+ private boolean roundCheck()
+ {
+ try
+ {
+ return _game.roundWinner();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+ return true;
+ }
+
+ private void round1()
+ {
+ try
+ {
+ _game.validateRound1Winner(_stadium);
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+ }
+
+ private void round2()
+ {
+ try
+ {
+ _game.validateRound2Winner(_stadium);
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+ }
+
+ private void round3()
+ {
+ try
+ {
+ _game.validateRound3Winner(_stadium);
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+
+ try
+ {
+ _game.makePlayersInvul();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+
+ try
+ {
+ _stadium.updateZoneStatusForCharactersInside();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+
+ try
+ {
+ _state = OlympiadGameState.GAME_STOPPED;
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+ }
+
/**
* Fifth stage: battle is running, returns true if winner found.
* @return
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadManager.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadManager.java
index ccd9b3ab60..350e13e788 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadManager.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadManager.java
@@ -45,11 +45,6 @@ public class OlympiadManager
{
}
- public static OlympiadManager getInstance()
- {
- return SingletonHolder.INSTANCE;
- }
-
public Set getRegisteredNonClassBased()
{
return _nonClassBasedRegisters;
@@ -65,7 +60,7 @@ public class OlympiadManager
List> result = null;
for (Entry> classList : _classBasedRegisters.entrySet())
{
- if ((classList.getValue() != null) && (classList.getValue().size() >= Config.ALT_OLY_CLASSED))
+ if ((classList.getValue() != null) && (classList.getValue().size() >= Config.OLYMPIAD_CLASSED))
{
if (result == null)
{
@@ -80,7 +75,7 @@ public class OlympiadManager
protected final boolean hasEnoughRegisteredNonClassed()
{
- return _nonClassBasedRegisters.size() >= Config.ALT_OLY_NONCLASSED;
+ return _nonClassBasedRegisters.size() >= Config.OLYMPIAD_NONCLASSED;
}
protected final void clearRegistered()
@@ -341,11 +336,6 @@ public class OlympiadManager
return _nonClassBasedRegisters.size() + _classBasedRegisters.size();
}
- private static class SingletonHolder
- {
- protected static final OlympiadManager INSTANCE = new OlympiadManager();
- }
-
private int getClassGroup(Player player)
{
if (player.isInCategory(CategoryType.SIXTH_TIR_GROUP))
@@ -389,4 +379,14 @@ public class OlympiadManager
return player.getBaseClass();
}
}
+
+ public static OlympiadManager getInstance()
+ {
+ return SingletonHolder.INSTANCE;
+ }
+
+ private static class SingletonHolder
+ {
+ protected static final OlympiadManager INSTANCE = new OlympiadManager();
+ }
}
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java
index 187c1f71be..04c582b581 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java
@@ -31,11 +31,9 @@ import org.l2jmobius.gameserver.model.actor.instance.Door;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.model.zone.type.OlympiadStadiumZone;
-import org.l2jmobius.gameserver.network.SystemMessageId;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchEnd;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadUserInfo;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
-import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchEnd;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadUserInfo;
/**
* @author JIV
@@ -127,6 +125,32 @@ public class OlympiadStadium
}
}
+ public void makeZonePvPForCharsInside(boolean value)
+ {
+ if (_task == null)
+ {
+ return;
+ }
+ if (value)
+ {
+ for (Player player : _instance.getPlayers())
+ {
+ player.setInsideZone(ZoneId.PVP, true);
+ player.setOlympiadStart(true);
+ _task.getGame().sendOlympiadInfo(player);
+ }
+ }
+ else
+ {
+ for (Player player : _instance.getPlayers())
+ {
+ player.setInsideZone(ZoneId.PVP, false);
+ player.setOlympiadStart(false);
+ _task.getGame().sendOlympiadInfo(player);
+ }
+ }
+ }
+
public void updateZoneStatusForCharactersInside()
{
if (_task == null)
@@ -135,15 +159,16 @@ public class OlympiadStadium
}
final boolean battleStarted = _task.isBattleStarted();
- final SystemMessage sm;
- if (battleStarted)
- {
- sm = new SystemMessage(SystemMessageId.YOU_HAVE_ENTERED_A_COMBAT_ZONE);
- }
- else
- {
- sm = new SystemMessage(SystemMessageId.YOU_HAVE_LEFT_A_COMBAT_ZONE);
- }
+ final boolean battleEnded = _task.isBattleFinished();
+ // final SystemMessage sm;
+ // if (battleStarted)
+ // {
+ // sm = new SystemMessage(SystemMessageId.YOU_HAVE_ENTERED_A_COMBAT_ZONE);
+ // }
+ // else
+ // {
+ // sm = new SystemMessage(SystemMessageId.YOU_HAVE_LEFT_A_COMBAT_ZONE);
+ // }
for (Player player : _instance.getPlayers())
{
@@ -155,12 +180,16 @@ public class OlympiadStadium
if (battleStarted)
{
player.setInsideZone(ZoneId.PVP, true);
- player.sendPacket(sm);
+ // player.sendPacket(sm);
}
else
{
player.setInsideZone(ZoneId.PVP, false);
- player.sendPacket(sm);
+ // player.sendPacket(sm);
+ // player.sendPacket(ExOlympiadMatchEnd.STATIC_PACKET);
+ }
+ if (battleEnded)
+ {
player.sendPacket(ExOlympiadMatchEnd.STATIC_PACKET);
}
}
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/skill/CommonSkill.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/skill/CommonSkill.java
index c51efcbcf5..d91f30aa5e 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/skill/CommonSkill.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/skill/CommonSkill.java
@@ -70,7 +70,13 @@ public enum CommonSkill
EINHASAD_OVERSEEING_2(29413, 2),
EINHASAD_OVERSEEING_3(29413, 3),
EINHASAD_OVERSEEING_4(29413, 4),
- EINHASAD_CHAINS(29414, 1);
+ EINHASAD_CHAINS(29414, 1),
+ OLYMPIAD_HORN_MELODY(32411, 1),
+ OLYMPIAD_DRUM_MELODY(32412, 1),
+ OLYMPIAD_PIPE_ORGAN_MELODY(32413, 1),
+ OLYMPIAD_GUITAR_MELODY(32414, 1),
+ OLYMPIAD_HARMONY(32415, 1),
+ OLYMPIAD_WIN(32417, 1);
private final SkillHolder _holder;
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/skill/SkillCaster.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/skill/SkillCaster.java
index 84122cf204..5ba066ee5f 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/skill/SkillCaster.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/skill/SkillCaster.java
@@ -130,11 +130,16 @@ public class SkillCaster implements Runnable
*/
public static SkillCaster castSkill(Creature caster, WorldObject target, Skill skill, Item item, SkillCastingType castingType, boolean ctrlPressed, boolean shiftPressed)
{
- // Prevent players from attacking before the Olympiad countdown ends. Olympiad Manager NPC is excluded.
if (caster.isPlayer() && caster.getActingPlayer().isInOlympiadMode() && !caster.getActingPlayer().isOlympiadStart() && skill.isBad() && (target != null) && (target.getId() != 36402))
{
return null;
}
+ // Prevent players from attacking before the Olympiad countdown ends. Olympiad Manager NPC is excluded.
+ if (caster.isPlayer() && caster.getActingPlayer().isInOlympiadMode() && !caster.getActingPlayer().isOlympiadStart() && skill.isBad())
+ {
+ return null;
+ }
+
return castSkill(caster, target, skill, item, castingType, ctrlPressed, shiftPressed, -1);
}
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java
index 292794ad91..3dafff1f02 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java
@@ -133,16 +133,16 @@ public interface IStatFunction
{
if (item.isWeapon())
{
- if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT))
+ if ((Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT))
{
- enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT;
+ enchant = Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT;
}
}
else
{
- if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT))
+ if ((Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT))
{
- enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT;
+ enchant = Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT;
}
}
}
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java
index 34f1dedc0d..bd0614d1c6 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java
@@ -70,6 +70,7 @@ public class PlayerVariables extends AbstractVariables
public static final String HUNTING_ZONE_ENTRY = "HUNTING_ZONE_ENTRY_";
public static final String HUNTING_ZONE_TIME = "HUNTING_ZONE_TIME_";
public static final String HUNTING_ZONE_REMAIN_REFILL = "HUNTING_ZONE_REMAIN_REFILL_";
+ public static final String IS_LEGEND = "IS_LEGEND";
public static final String FAVORITE_TELEPORTS = "FAVORITE_TELEPORTS";
public static final String HOMUNCULUS_HP_POINTS = "HOMUNCULUS_HP_POINTS";
public static final String HOMUNCULUS_SP_POINTS = "HOMUNCULUS_SP_POINTS";
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java
index 1d54eaef7f..6b6bafd8ae 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java
@@ -34,7 +34,7 @@ import org.l2jmobius.gameserver.model.zone.AbstractZoneSettings;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.model.zone.ZoneRespawn;
import org.l2jmobius.gameserver.network.SystemMessageId;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchEnd;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchEnd;
/**
* An olympiad stadium
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java
index e78808ad72..ae0eed606b 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java
@@ -98,6 +98,12 @@ import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeAdd
import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeWaitingList;
import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMentorCancel;
import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMentorList;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.OlympiadMatchMaking;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.OlympiadMatchMakingCancel;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.OlympiadUI;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.RequestExOlympiadMatchListRefresh;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.RequestOlympiadMatchList;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.RequestOlympiadObserverEnd;
import org.l2jmobius.gameserver.network.clientpackets.pk.RequestExPkPenaltyList;
import org.l2jmobius.gameserver.network.clientpackets.pk.RequestExPkPenaltyListOnlyLoc;
import org.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeAnnounce;
@@ -527,8 +533,8 @@ public enum ExIncomingPackets implements IIncomingPackets
EX_PAYBACK_LIST(0x175, null, ConnectionState.IN_GAME),
EX_PAYBACK_GIVE_REWARD(0x176, null, ConnectionState.IN_GAME),
EX_AUTOPLAY_SETTING(0x177, ExAutoPlaySetting::new, ConnectionState.IN_GAME),
- EX_OLYMPIAD_MATCH_MAKING(0x178, null, ConnectionState.IN_GAME),
- EX_OLYMPIAD_MATCH_MAKING_CANCEL(0x179, null, ConnectionState.IN_GAME),
+ EX_OLYMPIAD_MATCH_MAKING(0x178, OlympiadMatchMaking::new, ConnectionState.IN_GAME),
+ EX_OLYMPIAD_MATCH_MAKING_CANCEL(0x179, OlympiadMatchMakingCancel::new, ConnectionState.IN_GAME),
EX_FESTIVAL_BM_INFO(0x17A, null, ConnectionState.IN_GAME),
EX_FESTIVAL_BM_GAME(0x17B, null, ConnectionState.IN_GAME),
EX_GACHA_SHOP_INFO(0x17C, null, ConnectionState.IN_GAME),
@@ -567,7 +573,7 @@ public enum ExIncomingPackets implements IIncomingPackets
EX_CRAFT_RANDOM_MAKE(0x19D, null, ConnectionState.IN_GAME),
EX_MULTI_SELL_LIST(0x19E, null, ConnectionState.IN_GAME),
EX_SAVE_ITEM_ANNOUNCE_SETTING(0x19F, ExSaveItemAnnounceSetting::new, ConnectionState.IN_GAME),
- EX_OLYMPIAD_UI(0x1A0, null, ConnectionState.IN_GAME),
+ EX_OLYMPIAD_UI(0x1A0, OlympiadUI::new, ConnectionState.IN_GAME),
// 270
EX_SHARED_POSITION_SHARING_UI(0x1A1, null, ConnectionState.IN_GAME),
EX_SHARED_POSITION_TELEPORT_UI(0x1A2, null, ConnectionState.IN_GAME),
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
index 379a1519d3..48b77ebbd1 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
@@ -55,6 +55,7 @@ import org.l2jmobius.gameserver.model.item.ItemTemplate;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.item.type.EtcItemType;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
+import org.l2jmobius.gameserver.model.olympiad.Olympiad;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentType;
import org.l2jmobius.gameserver.model.quest.Quest;
@@ -117,6 +118,7 @@ import org.l2jmobius.gameserver.network.serverpackets.friend.L2FriendList;
import org.l2jmobius.gameserver.network.serverpackets.homunculus.ExHomunculusPointInfo;
import org.l2jmobius.gameserver.network.serverpackets.homunculus.ExHomunculusReady;
import org.l2jmobius.gameserver.network.serverpackets.homunculus.ExShowHomunculusBirthInfo;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadInfo;
import org.l2jmobius.gameserver.network.serverpackets.settings.ExItemAnnounceSetting;
import org.l2jmobius.gameserver.util.BuilderUtil;
@@ -635,6 +637,12 @@ public class EnterWorld implements IClientIncomingPacket
player.sendMessage("Experience gain is disabled.");
}
+ // Send packet that olympiad is opened.
+ if (Config.OLYMPIAD_ENABLED && Olympiad.getInstance().inCompPeriod())
+ {
+ player.sendPacket(new ExOlympiadInfo(1));
+ }
+
player.updateSymbolSealSkills();
player.broadcastUserInfo();
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java
new file mode 100644
index 0000000000..5cfad5d67f
--- /dev/null
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java
@@ -0,0 +1,47 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.network.GameClient;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchMakingResult;
+
+public class OlympiadMatchMaking implements IClientIncomingPacket
+{
+ private byte _gameRuleType;
+
+ @Override
+ public boolean read(GameClient client, PacketReader packet)
+ {
+ _gameRuleType = (byte) packet.readC();
+ return true;
+ }
+
+ @Override
+ public void run(GameClient client)
+ {
+ final Player player = client.getPlayer();
+ if (player == null)
+ {
+ return;
+ }
+
+ player.sendPacket(new ExOlympiadMatchMakingResult(_gameRuleType, 1));
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java
new file mode 100644
index 0000000000..e165096e42
--- /dev/null
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java
@@ -0,0 +1,47 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.network.GameClient;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchMakingResult;
+
+public class OlympiadMatchMakingCancel implements IClientIncomingPacket
+{
+ private byte _gameRuleType;
+
+ @Override
+ public boolean read(GameClient client, PacketReader packet)
+ {
+ _gameRuleType = (byte) packet.readC();
+ return true;
+ }
+
+ @Override
+ public void run(GameClient client)
+ {
+ final Player player = client.getPlayer();
+ if (player == null)
+ {
+ return;
+ }
+
+ player.sendPacket(new ExOlympiadMatchMakingResult(_gameRuleType, 0));
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java
new file mode 100644
index 0000000000..d9c5d35f53
--- /dev/null
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java
@@ -0,0 +1,49 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.network.GameClient;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadRecord;
+
+public class OlympiadUI implements IClientIncomingPacket
+{
+ private byte _gameRuleType;
+ private int _type;
+
+ @Override
+ public boolean read(GameClient client, PacketReader packet)
+ {
+ _gameRuleType = (byte) packet.readC();
+ _type = packet.readD();
+ return true;
+ }
+
+ @Override
+ public void run(GameClient client)
+ {
+ final Player player = client.getPlayer();
+ if (player == null)
+ {
+ return;
+ }
+
+ player.sendPacket(new ExOlympiadRecord(player, _gameRuleType, _type));
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestExOlympiadMatchListRefresh.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java
similarity index 82%
rename from L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestExOlympiadMatchListRefresh.java
rename to L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java
index b858084554..5ee47636f7 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestExOlympiadMatchListRefresh.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java
@@ -14,12 +14,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.clientpackets;
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.network.GameClient;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchList;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchList;
/**
* Format: (ch)d d: unknown (always 0?)
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadMatchList.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java
similarity index 89%
rename from L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadMatchList.java
rename to L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java
index 9f3cb709cf..7a9752b083 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadMatchList.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java
@@ -14,13 +14,14 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.clientpackets;
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.handler.BypassHandler;
import org.l2jmobius.gameserver.handler.IBypassHandler;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.network.GameClient;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
/**
* format ch c: (id) 0xD0 h: (subid) 0x13
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadObserverEnd.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java
similarity index 87%
rename from L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadObserverEnd.java
rename to L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java
index 24d5719bd4..255d11e91d 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadObserverEnd.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java
@@ -14,11 +14,12 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.clientpackets;
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.network.GameClient;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
/**
* format ch c: (id) 0xD0 h: (subid) 0x12
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java
index 762e2d3462..8bec7231d2 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java
@@ -196,7 +196,7 @@ public class CharInfo implements IClientOutgoingPacket
packet.writeC(_player.getTeam().getId()); // Confirmed
packet.writeD(_player.getClanCrestLargeId());
packet.writeC(_player.getNobleLevel()); // Confirmed
- packet.writeC(_player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 2 : 0); // 152 - Value for enabled changed to 2?
+ packet.writeC(_player.isLegend() ? 4 : _player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 2 : 0); // 152 - Value for enabled changed to 2? 4 = legend
packet.writeC(_player.isFishing() ? 1 : 0); // Confirmed
final ILocational baitLocation = _player.getFishing().getBaitLocation();
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java
index 2476a2271a..0fe0c9375f 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java
@@ -296,7 +296,7 @@ public class UserInfo extends AbstractMaskPacket
packet.writeC(_player.getPvpFlag());
packet.writeD(_player.getReputation()); // Reputation
packet.writeC(_player.getNobleLevel());
- packet.writeC(_player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 2 : 0); // 152 - Value for enabled changed to 2?
+ packet.writeC(_player.isLegend() ? 4 : _player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 2 : 0); // 152 - Value for enabled changed to 2? 4 = legend
packet.writeC(_player.getPledgeClass());
packet.writeD(_player.getPkKills());
packet.writeD(_player.getPvpKills());
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java
new file mode 100644
index 0000000000..b541ddf502
--- /dev/null
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java
@@ -0,0 +1,41 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+public class ExOlympiadInfo implements IClientOutgoingPacket
+{
+ private static int _open;
+
+ public ExOlympiadInfo(int open)
+ {
+ _open = open;
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_OLYMPIAD_INFO.writeId(packet);
+ packet.writeC(_open);
+ packet.writeD(0); // RemainTime
+ packet.writeC(1); // GameRuleType
+ return true;
+ }
+}
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchEnd.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java
similarity index 86%
rename from L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchEnd.java
rename to L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java
index ba3c0cfeaa..e64d402782 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchEnd.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java
@@ -14,10 +14,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author GodKratos
@@ -36,4 +37,4 @@ public class ExOlympiadMatchEnd implements IClientOutgoingPacket
OutgoingPackets.EX_OLYMPIAD_MATCH_END.writeId(packet);
return true;
}
-}
+}
\ No newline at end of file
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java
new file mode 100644
index 0000000000..25335ef371
--- /dev/null
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java
@@ -0,0 +1,57 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+/**
+ * @author Mobius
+ */
+public class ExOlympiadMatchInfo implements IClientOutgoingPacket
+{
+ private final String _name1;
+ private final String _name2;
+ private final int _wins1;
+ private final int _wins2;
+ private final int _round;
+ private final int _time;
+
+ public ExOlympiadMatchInfo(String name1, String name2, int wins1, int wins2, int round, int time)
+ {
+ _name1 = name1;
+ _name2 = name2;
+ _wins1 = wins1;
+ _wins2 = wins2;
+ _round = round;
+ _time = time;
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_OLYMPIAD_MATCH_INFO.writeId(packet);
+ packet.writeS(String.format("%1$-" + 23 + "s", _name2));
+ packet.writeD(_wins2);
+ packet.writeS(String.format("%1$-" + 23 + "s", _name1));
+ packet.writeD(_wins1);
+ packet.writeD(_round);
+ packet.writeD(_time); // Seconds
+ return true;
+ }
+}
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java
new file mode 100644
index 0000000000..1d7653e028
--- /dev/null
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java
@@ -0,0 +1,37 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+public class ExOlympiadMatchInfoEnd implements IClientOutgoingPacket
+{
+ public static final ExOlympiadMatchInfoEnd STATIC_PACKET = new ExOlympiadMatchInfoEnd();
+
+ private ExOlympiadMatchInfoEnd()
+ {
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_OLYMPIAD_MATCH_INFO.writeId(packet);
+ return true;
+ }
+}
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchList.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java
similarity index 91%
rename from L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchList.java
rename to L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java
index 7ffd5ed3bd..80564627aa 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchList.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java
@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import java.util.ArrayList;
import java.util.List;
@@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.olympiad.OlympiadGameManager;
import org.l2jmobius.gameserver.model.olympiad.OlympiadGameNonClassed;
import org.l2jmobius.gameserver.model.olympiad.OlympiadGameTask;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author mrTJO
@@ -55,15 +56,19 @@ public class ExOlympiadMatchList implements IClientOutgoingPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_RECEIVE_OLYMPIAD.writeId(packet);
+
packet.writeD(0); // Type 0 = Match List, 1 = Match Result
+
packet.writeD(_games.size());
packet.writeD(0);
+
for (OlympiadGameTask curGame : _games)
{
final AbstractOlympiadGame game = curGame.getGame();
if (game != null)
{
packet.writeD(game.getStadiumId()); // Stadium Id (Arena 1 = 0)
+
if (game instanceof OlympiadGameNonClassed)
{
packet.writeD(1);
@@ -76,6 +81,7 @@ public class ExOlympiadMatchList implements IClientOutgoingPacket
{
packet.writeD(0);
}
+
packet.writeD(curGame.isRunning() ? 2 : 1); // (1 = Standby, 2 = Playing)
packet.writeS(game.getPlayerNames()[0]); // Player 1 Name
packet.writeS(game.getPlayerNames()[1]); // Player 2 Name
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java
new file mode 100644
index 0000000000..a72825cad4
--- /dev/null
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java
@@ -0,0 +1,42 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+public class ExOlympiadMatchMakingResult implements IClientOutgoingPacket
+{
+ private final int _gameRuleType;
+ private final int _type;
+
+ public ExOlympiadMatchMakingResult(int cGameRuleType, int type)
+ {
+ _gameRuleType = 0;
+ _type = type;
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_OLYMPIAD_INFO.writeId(packet);
+ packet.writeC(_type);
+ packet.writeD(_gameRuleType);
+ return true;
+ }
+}
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchResult.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java
similarity index 73%
rename from L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchResult.java
rename to L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java
index b387271fba..2c57635a47 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchResult.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java
@@ -14,13 +14,14 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.model.olympiad.OlympiadInfo;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author JIV
@@ -32,8 +33,11 @@ public class ExOlympiadMatchResult implements IClientOutgoingPacket
private int _loseTeam = 2;
private final List _winnerList;
private final List _loserList;
+ private final int _round1winner;
+ private final int _round2winner;
+ private final int _round3winner;
- public ExOlympiadMatchResult(boolean tie, int winTeam, List winnerList, List loserList)
+ public ExOlympiadMatchResult(boolean tie, int winTeam, List winnerList, List loserList, int round1winner, int round2winner, int round3winner)
{
_tie = tie;
_winTeam = winTeam;
@@ -47,13 +51,16 @@ public class ExOlympiadMatchResult implements IClientOutgoingPacket
{
_winTeam = 1;
}
+ _round1winner = round1winner;
+ _round2winner = round2winner;
+ _round3winner = round3winner;
}
@Override
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_RECEIVE_OLYMPIAD.writeId(packet);
- packet.writeD(1); // Type 0 = Match List, 1 = Match Result
+ packet.writeD(2); // Type 0 = Match List, 1 = Match Result, 2 = New Oly look, 3 = 3v3
packet.writeD(_tie ? 1 : 0); // 0 - win, 1 - tie
packet.writeS(_winnerList.get(0).getName());
packet.writeD(_winTeam);
@@ -82,6 +89,11 @@ public class ExOlympiadMatchResult implements IClientOutgoingPacket
packet.writeD(info.getDiffPoints());
packet.writeD(0); // Helios
}
+ packet.writeC(_round1winner); // Round 1 outcome
+ packet.writeC(_round2winner); // Round 2 outcome
+ packet.writeC(_round3winner); // Round 3 outcome
+ packet.writeD(15); // Bonus Reward
+ packet.writeD(0); // Bonus Reward for looser
return true;
}
}
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMode.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java
similarity index 76%
rename from L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMode.java
rename to L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java
index 712b9e06c6..35156532aa 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMode.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java
@@ -14,22 +14,24 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.enums.OlympiadMode;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author godson
*/
public class ExOlympiadMode implements IClientOutgoingPacket
{
- private final int _mode;
+ private final OlympiadMode _mode;
/**
* @param mode (0 = return, 3 = spectate)
*/
- public ExOlympiadMode(int mode)
+ public ExOlympiadMode(OlympiadMode mode)
{
_mode = mode;
}
@@ -38,7 +40,7 @@ public class ExOlympiadMode implements IClientOutgoingPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_OLYMPIAD_MODE.writeId(packet);
- packet.writeC(_mode);
+ packet.writeC(_mode.ordinal());
return true;
}
}
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java
new file mode 100644
index 0000000000..0985a230f5
--- /dev/null
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java
@@ -0,0 +1,109 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Calendar;
+
+import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.instancemanager.RankManager;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.model.olympiad.Olympiad;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.PacketLogger;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+public class ExOlympiadRecord implements IClientOutgoingPacket
+{
+ private static final String GET_PREVIOUS_CYCLE_DATA = "SELECT charId, class_id, olympiad_points, competitions_won, competitions_lost FROM olympiad_nobles_eom WHERE class_id = ? ORDER BY olympiad_points DESC LIMIT " + RankManager.PLAYER_LIMIT;
+
+ private final Player _player;
+ private final int _gameRuleType;
+ private final int _type;
+
+ public ExOlympiadRecord(Player player, int cGameRuleType, int type)
+ {
+ _player = player;
+ _gameRuleType = cGameRuleType;
+ _type = type;
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_OLYMPIAD_RECORD.writeId(packet);
+ packet.writeD(Olympiad.getInstance().getNoblePoints(_player)); // nPoint
+ packet.writeD(Olympiad.getInstance().getCompetitionWon(_player.getObjectId())); // nWinCount
+ packet.writeD(Olympiad.getInstance().getCompetitionLost(_player.getObjectId())); // nLoseCount
+ packet.writeD(Olympiad.getInstance().getRemainingWeeklyMatches(_player.getObjectId())); // nMatchCount
+ // Previous Cycle
+ int previousPlace = 0;
+ int previousWins = 0;
+ int previousLoses = 0;
+ int previousPoints = 0;
+ int previousClass = 0;
+
+ try (Connection con = DatabaseFactory.getConnection();
+ PreparedStatement statement = con.prepareStatement(GET_PREVIOUS_CYCLE_DATA))
+ {
+ statement.setInt(1, _player.getBaseClass());
+ try (ResultSet rset = statement.executeQuery())
+ {
+ int i = 1;
+ while (rset.next())
+ {
+ if (rset.getInt("charId") == _player.getObjectId())
+ {
+ previousPlace = i;
+ previousWins = rset.getInt("competitions_won");
+ previousLoses = rset.getInt("competitions_lost");
+ previousPoints = rset.getInt("olympiad_points");
+ previousClass = rset.getInt("class_id");
+ }
+ i++;
+ }
+ }
+ }
+ catch (SQLException e)
+ {
+ PacketLogger.warning("Olympiad my ranking: Couldnt load data: " + e.getMessage());
+ }
+
+ packet.writeD(previousClass); // nPrevClassType
+ packet.writeD(1); // nPrevRank in all servers
+ packet.writeD(2); // nPrevRankCount number of participants with 25+ matches
+ packet.writeD(previousPlace); // nPrevClassRank in all servers
+ packet.writeD(4); // nPrevClassRankCount number of participants with 25+ matches
+ packet.writeD(5); // nPrevClassRankByServer in current server
+ packet.writeD(6); // nPrevClassRankByServerCount number of participants with 25+ matches
+ packet.writeD(previousPoints); // nPrevPoint
+ packet.writeD(previousWins); // nPrevWinCount
+ packet.writeD(previousLoses); // nPrevLoseCount
+ packet.writeD(previousPlace); // nPrevGrade
+ packet.writeD(Calendar.getInstance().get(Calendar.YEAR)); // nSeasonYear
+ packet.writeD(Calendar.getInstance().get(Calendar.MONTH) + 1); // nSeasonMonth
+ packet.writeC(Olympiad.getInstance().inCompPeriod() ? 1 : 0); // bMatchOpen
+ packet.writeD(Olympiad.getInstance().getCurrentCycle()); // nSeason
+ packet.writeC(_type); // bRegistered
+ packet.writeD(_gameRuleType); // cGameRuleType
+ return true;
+ }
+}
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadSpelledInfo.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java
similarity index 88%
rename from L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadSpelledInfo.java
rename to L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java
index 5b4f2c2523..a5a368a43e 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadSpelledInfo.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java
@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import java.util.ArrayList;
import java.util.List;
@@ -24,6 +24,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.skill.BuffInfo;
import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author godson
@@ -53,6 +54,7 @@ public class ExOlympiadSpelledInfo implements IClientOutgoingPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_OLYMPIAD_SPELLED_INFO.writeId(packet);
+
packet.writeD(_playerId);
packet.writeD(_effects.size() + _effects2.size());
for (BuffInfo info : _effects)
@@ -61,7 +63,7 @@ public class ExOlympiadSpelledInfo implements IClientOutgoingPacket
{
packet.writeD(info.getSkill().getDisplayId());
packet.writeH(info.getSkill().getDisplayLevel());
- packet.writeH(0); // Sub level
+ packet.writeH(0x00); // Sub level
packet.writeD(info.getSkill().getAbnormalType().getClientId());
writeOptionalD(packet, info.getSkill().isAura() ? -1 : info.getTime());
}
@@ -72,7 +74,7 @@ public class ExOlympiadSpelledInfo implements IClientOutgoingPacket
{
packet.writeD(skill.getDisplayId());
packet.writeH(skill.getDisplayLevel());
- packet.writeH(0); // Sub level
+ packet.writeH(0x00); // Sub level
packet.writeD(skill.getAbnormalType().getClientId());
packet.writeH(-1);
}
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadUserInfo.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java
similarity index 90%
rename from L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadUserInfo.java
rename to L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java
index ca473edfcf..1acac0ec7a 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadUserInfo.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java
@@ -14,12 +14,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.olympiad.Participant;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author godson
@@ -76,6 +77,7 @@ public class ExOlympiadUserInfo implements IClientOutgoingPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_OLYMPIAD_USER_INFO.writeId(packet);
+
if (_player != null)
{
packet.writeC(_player.getOlympiadSide());
@@ -90,6 +92,7 @@ public class ExOlympiadUserInfo implements IClientOutgoingPacket
packet.writeS(_par.getName());
packet.writeD(_par.getBaseClass());
}
+
packet.writeD(_curHp);
packet.writeD(_maxHp);
packet.writeD(_curCp);
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Olympiad.ini b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Olympiad.ini
index 149a682c5e..34b3a54c33 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Olympiad.ini
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Olympiad.ini
@@ -9,141 +9,141 @@
# Also please understand what you are changing before you do so on a live server.
# ---------------------------------------------------------------------------
+# Enable Olympiad.
+# Default: True
+OlympiadEnabled = True
+
# Olympiad Start Time in Military hours Default 8pm (20)
# Default: 20
-AltOlyStartTime = 20
+OlympiadStartTime = 20
# Olympiad Start Time for Min's, Default 00 so at the start of the hour.
# Default: 00
-AltOlyMin = 00
+OlympiadMin = 00
# Olympiad Competition Period, Default 4 hours.
# (If set different, should be increment by 10mins)
# Default: 14400000
-AltOlyCPeriod = 14400000
+OlympiadCPeriod = 14400000
-# Olympiad Battle Period, Default 5 minutes.
-# Default: 300000
-AltOlyBattle = 300000
+# Olympiad Battle Period, Default 100 seconds.
+# Default: 100000
+OlympiadBattle = 100000
# Olympiad Weekly Period, Default 1 week
# Used for adding points to nobles
# Default: 604800000
-AltOlyWPeriod = 604800000
+OlympiadWPeriod = 604800000
# Olympiad Validation Period, Default 24 Hours.
# Default: 86400000
-AltOlyVPeriod = 86400000
+OlympiadVPeriod = 86400000
# Points for reaching Noblesse for the first time
-# Default: 10
-AltOlyStartPoints = 10
-
-# Points every week
-# Default: 10
-AltOlyWeeklyPoints = 10
+# Default: 1000
+OlympiadStartPoints = 1000
# Required number of participants for the class based games
# Default: 20
-AltOlyClassedParticipants = 20
+OlympiadClassedParticipants = 20
# Required number of participants for the non-class based games
# Default: 10
-AltOlyNonClassedParticipants = 10
+OlympiadNonClassedParticipants = 10
# Reward for the winner
# Format: itemId1,itemNum1;itemId2,itemNum2...
# Default: 45584,12
-AltOlyWinReward = 45584,12
+OlympiadWinReward = 45584,12
# Reward for loser
# Format: itemId1,itemNum1;itemId2,itemNum2...
# Default: 45584,7
-AltOlyLoserReward = 45584,7
+OlympiadLoserReward = 45584,7
# ItemId used for exchanging to the points.
# Default: 45584
-AltOlyCompRewItem = 45584
+OlympiadCompRewItem = 45584
# The minimum matches you need to participate to receive point rewards
# Default: 10
-AltOlyMinMatchesForPoints = 10
+OlympiadMinMatchesForPoints = 10
# Rate to exchange points to reward item.
# Default: 20
-AltOlyMarkPerPoint = 20
+OlympiadMarkPerPoint = 20
# Noblesse points awarded to Heroes.
# Default: 30
-AltOlyHeroPoints = 30
+OlympiadHeroPoints = 30
# Noblesse points awarded to Rank 1 members.
# Default: 100
-AltOlyRank1Points = 60
+OlympiadRank1Points = 60
# Noblesse points awarded to Rank 2 members.
# Default: 75
-AltOlyRank2Points = 50
+OlympiadRank2Points = 50
# Noblesse points awarded to Rank 3 members.
# Default: 55
-AltOlyRank3Points = 45
+OlympiadRank3Points = 45
# Noblesse points awarded to Rank 4 members.
# Default: 40
-AltOlyRank4Points = 40
+OlympiadRank4Points = 40
# Noblesse points awarded to Rank 5 members.
# Default: 30
-AltOlyRank5Points = 30
+OlympiadRank5Points = 30
# Maximum points that player can gain/lose on a match.
# Default: 10
-AltOlyMaxPoints = 10
+OlympiadMaxPoints = 10
# Hero tables show last month's winners or current status.
# Default: True
-AltOlyShowMonthlyWinners = True
+OlympiadShowMonthlyWinners = True
# Olympiad Managers announce each start of fight.
# Default: True
-AltOlyAnnounceGames = True
+OlympiadAnnounceGames = True
# Restrict specified items in Olympiad. ItemID's need to be separated with a comma (ex. 1,200,350)
# Equipped items will be moved to inventory during port.
# Default:
-AltOlyRestrictedItems =
+OlympiadRestrictedItems =
# Enchant limit for items during Olympiad battles. Disabled = -1.
# Default: -1
-AltOlyWeaponEnchantLimit = -1
-AltOlyArmorEnchantLimit = -1
+OlympiadWeaponEnchantLimit = -1
+OlympiadArmorEnchantLimit = -1
# Log all Olympiad fights and outcome to olympiad.csv file.
# Default: False
-AltOlyLogFights = False
+OlympiadLogFights = False
# Time to wait before teleported to arena.
# Default: 120
-AltOlyWaitTime = 120
+OlympiadWaitTime = 120
# Divider for points in classed and non-classed games
# Default: 5
-AltOlyDividerClassed = 5
-AltOlyDividerNonClassed = 5
+OlympiadDividerClassed = 5
+OlympiadDividerNonClassed = 5
# Maximum number of matches a Noblesse character can join per week
-# Default: 30
-AltOlyMaxWeeklyMatches = 30
+# Default: 25
+OlympiadMaxWeeklyMatches = 25
# Enable competitions only on specific days. Usage: 1,2,3,4,5,6,7 (SUNDAY,MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,SATURDAY)
# Default: 6,7 (FRIDAY,SATURDAY)
-AltOlyCompetitionDays = 6,7
+OlympiadCompetitionDays = 6,7
# Change the type of delay between two Olympiads.
# Available values: MONTH, WEEK, DAY
# Default: MONTH
-AltOlyPeriod = MONTH
+OlympiadPeriod = MONTH
# Change the Olympiad frequency.
# The value is a multiplier of period type,
@@ -151,4 +151,4 @@ AltOlyPeriod = MONTH
# then Olympiad will occur every 2 months.
# Default: 1
# Note! If type = DAY, multiplier must be >= 7!
-AltOlyPeriodMultiplier = 1
\ No newline at end of file
+OlympiadPeriodMultiplier = 1
\ No newline at end of file
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes-weaponListLegend.html b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes-weaponListLegend.html
new file mode 100644
index 0000000000..169a6fb06f
--- /dev/null
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes-weaponListLegend.html
@@ -0,0 +1,26 @@
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes.java
index 53a544ac7f..fe77bb3e49 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes.java
@@ -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;
}
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/OlyBuffer/OlyBuffer.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/OlyBuffer/OlyBuffer.java
index 071de9ce6e..4637c7c055 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/OlyBuffer/OlyBuffer.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/OlyBuffer/OlyBuffer.java
@@ -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());
}
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java
index 362eb94e8b..f07fb57f03 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java
@@ -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
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/RedLibra/Eraton/Eraton.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/RedLibra/Eraton/Eraton.java
index 75118dd09a..b685be6982 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/RedLibra/Eraton/Eraton.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/events/RedLibra/Eraton/Eraton.java
@@ -381,7 +381,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();
}
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java
index 800d712676..c73d0a5f56 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java
@@ -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_GAMES_ARE_NOT_CURRENTLY_IN_PROGRESS);
+ 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;
}
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java
index fa1189ea94..116221fa12 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java
@@ -516,41 +516,41 @@ public class Config
public static int WORLD_CHAT_MIN_LEVEL;
public static int WORLD_CHAT_POINTS_PER_DAY;
public static Duration WORLD_CHAT_INTERVAL;
- public static int ALT_OLY_START_TIME;
- public static int ALT_OLY_MIN;
- public static long ALT_OLY_CPERIOD;
- public static long ALT_OLY_BATTLE;
- public static long ALT_OLY_WPERIOD;
- public static long ALT_OLY_VPERIOD;
- public static int ALT_OLY_START_POINTS;
- public static int ALT_OLY_WEEKLY_POINTS;
- public static int ALT_OLY_CLASSED;
- public static int ALT_OLY_NONCLASSED;
- public static List ALT_OLY_WINNER_REWARD;
- public static List ALT_OLY_LOSER_REWARD;
- public static int ALT_OLY_COMP_RITEM;
- public static int ALT_OLY_MIN_MATCHES;
- public static int ALT_OLY_MARK_PER_POINT;
- public static int ALT_OLY_HERO_POINTS;
- public static int ALT_OLY_RANK1_POINTS;
- public static int ALT_OLY_RANK2_POINTS;
- public static int ALT_OLY_RANK3_POINTS;
- public static int ALT_OLY_RANK4_POINTS;
- public static int ALT_OLY_RANK5_POINTS;
- public static int ALT_OLY_MAX_POINTS;
- public static int ALT_OLY_DIVIDER_CLASSED;
- public static int ALT_OLY_DIVIDER_NON_CLASSED;
- public static int ALT_OLY_MAX_WEEKLY_MATCHES;
- public static boolean ALT_OLY_LOG_FIGHTS;
- public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS;
- public static boolean ALT_OLY_ANNOUNCE_GAMES;
- public static Set LIST_OLY_RESTRICTED_ITEMS = new HashSet<>();
- public static int ALT_OLY_WEAPON_ENCHANT_LIMIT;
- public static int ALT_OLY_ARMOR_ENCHANT_LIMIT;
- public static int ALT_OLY_WAIT_TIME;
- public static String ALT_OLY_PERIOD;
- public static int ALT_OLY_PERIOD_MULTIPLIER;
- public static List ALT_OLY_COMPETITION_DAYS;
+ public static boolean OLYMPIAD_ENABLED;
+ public static int OLYMPIAD_START_TIME;
+ public static int OLYMPIAD_MIN;
+ public static long OLYMPIAD_CPERIOD;
+ public static long OLYMPIAD_BATTLE;
+ public static long OLYMPIAD_WPERIOD;
+ public static long OLYMPIAD_VPERIOD;
+ public static int OLYMPIAD_START_POINTS;
+ public static int OLYMPIAD_CLASSED;
+ public static int OLYMPIAD_NONCLASSED;
+ public static List OLYMPIAD_WINNER_REWARD;
+ public static List OLYMPIAD_LOSER_REWARD;
+ public static int OLYMPIAD_COMP_RITEM;
+ public static int OLYMPIAD_MIN_MATCHES;
+ public static int OLYMPIAD_MARK_PER_POINT;
+ public static int OLYMPIAD_HERO_POINTS;
+ public static int OLYMPIAD_RANK1_POINTS;
+ public static int OLYMPIAD_RANK2_POINTS;
+ public static int OLYMPIAD_RANK3_POINTS;
+ public static int OLYMPIAD_RANK4_POINTS;
+ public static int OLYMPIAD_RANK5_POINTS;
+ public static int OLYMPIAD_MAX_POINTS;
+ public static int OLYMPIAD_DIVIDER_CLASSED;
+ public static int OLYMPIAD_DIVIDER_NON_CLASSED;
+ public static int OLYMPIAD_MAX_WEEKLY_MATCHES;
+ public static boolean OLYMPIAD_LOG_FIGHTS;
+ public static boolean OLYMPIAD_SHOW_MONTHLY_WINNERS;
+ public static boolean OLYMPIAD_ANNOUNCE_GAMES;
+ public static Set OLYMPIAD_RESTRICTED_ITEMS = new HashSet<>();
+ public static int OLYMPIAD_WEAPON_ENCHANT_LIMIT;
+ public static int OLYMPIAD_ARMOR_ENCHANT_LIMIT;
+ public static int OLYMPIAD_WAIT_TIME;
+ public static String OLYMPIAD_PERIOD;
+ public static int OLYMPIAD_PERIOD_MULTIPLIER;
+ public static List OLYMPIAD_COMPETITION_DAYS;
public static int ALT_MANOR_REFRESH_TIME;
public static int ALT_MANOR_REFRESH_MIN;
public static int ALT_MANOR_APPROVE_TIME;
@@ -2432,57 +2432,57 @@ public class Config
// Load Olympiad config file (if exists)
final PropertiesParser olympiadConfig = new PropertiesParser(OLYMPIAD_CONFIG_FILE);
- ALT_OLY_START_TIME = olympiadConfig.getInt("AltOlyStartTime", 20);
- ALT_OLY_MIN = olympiadConfig.getInt("AltOlyMin", 0);
- ALT_OLY_CPERIOD = olympiadConfig.getLong("AltOlyCPeriod", 14400000);
- ALT_OLY_BATTLE = olympiadConfig.getLong("AltOlyBattle", 300000);
- ALT_OLY_WPERIOD = olympiadConfig.getLong("AltOlyWPeriod", 604800000);
- ALT_OLY_VPERIOD = olympiadConfig.getLong("AltOlyVPeriod", 86400000);
- ALT_OLY_START_POINTS = olympiadConfig.getInt("AltOlyStartPoints", 10);
- ALT_OLY_WEEKLY_POINTS = olympiadConfig.getInt("AltOlyWeeklyPoints", 10);
- ALT_OLY_CLASSED = olympiadConfig.getInt("AltOlyClassedParticipants", 10);
- ALT_OLY_NONCLASSED = olympiadConfig.getInt("AltOlyNonClassedParticipants", 20);
- ALT_OLY_WINNER_REWARD = parseItemsList(olympiadConfig.getString("AltOlyWinReward", "45584,12"));
- ALT_OLY_LOSER_REWARD = parseItemsList(olympiadConfig.getString("AltOlyLoserReward", "45584,7"));
- ALT_OLY_COMP_RITEM = olympiadConfig.getInt("AltOlyCompRewItem", 45584);
- ALT_OLY_MIN_MATCHES = olympiadConfig.getInt("AltOlyMinMatchesForPoints", 10);
- ALT_OLY_MARK_PER_POINT = olympiadConfig.getInt("AltOlyMarkPerPoint", 20);
- ALT_OLY_HERO_POINTS = olympiadConfig.getInt("AltOlyHeroPoints", 30);
- ALT_OLY_RANK1_POINTS = olympiadConfig.getInt("AltOlyRank1Points", 60);
- ALT_OLY_RANK2_POINTS = olympiadConfig.getInt("AltOlyRank2Points", 50);
- ALT_OLY_RANK3_POINTS = olympiadConfig.getInt("AltOlyRank3Points", 45);
- ALT_OLY_RANK4_POINTS = olympiadConfig.getInt("AltOlyRank4Points", 40);
- ALT_OLY_RANK5_POINTS = olympiadConfig.getInt("AltOlyRank5Points", 30);
- ALT_OLY_MAX_POINTS = olympiadConfig.getInt("AltOlyMaxPoints", 10);
- ALT_OLY_DIVIDER_CLASSED = olympiadConfig.getInt("AltOlyDividerClassed", 5);
- ALT_OLY_DIVIDER_NON_CLASSED = olympiadConfig.getInt("AltOlyDividerNonClassed", 5);
- ALT_OLY_MAX_WEEKLY_MATCHES = olympiadConfig.getInt("AltOlyMaxWeeklyMatches", 30);
- ALT_OLY_LOG_FIGHTS = olympiadConfig.getBoolean("AltOlyLogFights", false);
- ALT_OLY_SHOW_MONTHLY_WINNERS = olympiadConfig.getBoolean("AltOlyShowMonthlyWinners", true);
- ALT_OLY_ANNOUNCE_GAMES = olympiadConfig.getBoolean("AltOlyAnnounceGames", true);
- final String olyRestrictedItems = olympiadConfig.getString("AltOlyRestrictedItems", "").trim();
+ OLYMPIAD_ENABLED = olympiadConfig.getBoolean("OlympiadEnabled", true);
+ OLYMPIAD_START_TIME = olympiadConfig.getInt("OlympiadStartTime", 20);
+ OLYMPIAD_MIN = olympiadConfig.getInt("OlympiadMin", 0);
+ OLYMPIAD_CPERIOD = olympiadConfig.getLong("OlympiadCPeriod", 14400000);
+ OLYMPIAD_BATTLE = olympiadConfig.getLong("OlympiadBattle", 300000);
+ OLYMPIAD_WPERIOD = olympiadConfig.getLong("OlympiadWPeriod", 604800000);
+ OLYMPIAD_VPERIOD = olympiadConfig.getLong("OlympiadVPeriod", 86400000);
+ OLYMPIAD_START_POINTS = olympiadConfig.getInt("OlympiadStartPoints", 1000);
+ OLYMPIAD_CLASSED = olympiadConfig.getInt("OlympiadClassedParticipants", 10);
+ OLYMPIAD_NONCLASSED = olympiadConfig.getInt("OlympiadNonClassedParticipants", 20);
+ OLYMPIAD_WINNER_REWARD = parseItemsList(olympiadConfig.getString("OlympiadWinReward", "45584,12"));
+ OLYMPIAD_LOSER_REWARD = parseItemsList(olympiadConfig.getString("OlympiadLoserReward", "45584,7"));
+ OLYMPIAD_COMP_RITEM = olympiadConfig.getInt("OlympiadCompRewItem", 45584);
+ OLYMPIAD_MIN_MATCHES = olympiadConfig.getInt("OlympiadMinMatchesForPoints", 10);
+ OLYMPIAD_MARK_PER_POINT = olympiadConfig.getInt("OlympiadMarkPerPoint", 20);
+ OLYMPIAD_HERO_POINTS = olympiadConfig.getInt("OlympiadHeroPoints", 30);
+ OLYMPIAD_RANK1_POINTS = olympiadConfig.getInt("OlympiadRank1Points", 60);
+ OLYMPIAD_RANK2_POINTS = olympiadConfig.getInt("OlympiadRank2Points", 50);
+ OLYMPIAD_RANK3_POINTS = olympiadConfig.getInt("OlympiadRank3Points", 45);
+ OLYMPIAD_RANK4_POINTS = olympiadConfig.getInt("OlympiadRank4Points", 40);
+ OLYMPIAD_RANK5_POINTS = olympiadConfig.getInt("OlympiadRank5Points", 30);
+ OLYMPIAD_MAX_POINTS = olympiadConfig.getInt("OlympiadMaxPoints", 10);
+ OLYMPIAD_DIVIDER_CLASSED = olympiadConfig.getInt("OlympiadDividerClassed", 5);
+ OLYMPIAD_DIVIDER_NON_CLASSED = olympiadConfig.getInt("OlympiadDividerNonClassed", 5);
+ OLYMPIAD_MAX_WEEKLY_MATCHES = olympiadConfig.getInt("OlympiadMaxWeeklyMatches", 25);
+ OLYMPIAD_LOG_FIGHTS = olympiadConfig.getBoolean("OlympiadLogFights", false);
+ OLYMPIAD_SHOW_MONTHLY_WINNERS = olympiadConfig.getBoolean("OlympiadShowMonthlyWinners", true);
+ OLYMPIAD_ANNOUNCE_GAMES = olympiadConfig.getBoolean("OlympiadAnnounceGames", true);
+ final String olyRestrictedItems = olympiadConfig.getString("OlympiadRestrictedItems", "").trim();
if (!olyRestrictedItems.isEmpty())
{
final String[] olyRestrictedItemsSplit = olyRestrictedItems.split(",");
- LIST_OLY_RESTRICTED_ITEMS = new HashSet<>(olyRestrictedItemsSplit.length);
+ OLYMPIAD_RESTRICTED_ITEMS = new HashSet<>(olyRestrictedItemsSplit.length);
for (String id : olyRestrictedItemsSplit)
{
- LIST_OLY_RESTRICTED_ITEMS.add(Integer.parseInt(id));
+ OLYMPIAD_RESTRICTED_ITEMS.add(Integer.parseInt(id));
}
}
else // In case of reload with removal of all items ids.
{
- LIST_OLY_RESTRICTED_ITEMS.clear();
+ OLYMPIAD_RESTRICTED_ITEMS.clear();
}
- ALT_OLY_WEAPON_ENCHANT_LIMIT = olympiadConfig.getInt("AltOlyWeaponEnchantLimit", -1);
- ALT_OLY_ARMOR_ENCHANT_LIMIT = olympiadConfig.getInt("AltOlyArmorEnchantLimit", -1);
- ALT_OLY_WAIT_TIME = olympiadConfig.getInt("AltOlyWaitTime", 60);
- ALT_OLY_PERIOD = olympiadConfig.getString("AltOlyPeriod", "MONTH");
- ALT_OLY_PERIOD_MULTIPLIER = olympiadConfig.getInt("AltOlyPeriodMultiplier", 1);
- ALT_OLY_COMPETITION_DAYS = new ArrayList<>();
- for (String s : olympiadConfig.getString("AltOlyCompetitionDays", "6,7").split(","))
+ OLYMPIAD_WEAPON_ENCHANT_LIMIT = olympiadConfig.getInt("OlympiadWeaponEnchantLimit", -1);
+ OLYMPIAD_ARMOR_ENCHANT_LIMIT = olympiadConfig.getInt("OlympiadArmorEnchantLimit", -1);
+ OLYMPIAD_WAIT_TIME = olympiadConfig.getInt("OlympiadWaitTime", 60);
+ OLYMPIAD_PERIOD = olympiadConfig.getString("OlympiadPeriod", "MONTH");
+ OLYMPIAD_PERIOD_MULTIPLIER = olympiadConfig.getInt("OlympiadPeriodMultiplier", 1);
+ OLYMPIAD_COMPETITION_DAYS = new ArrayList<>();
+ for (String s : olympiadConfig.getString("OlympiadCompetitionDays", "6,7").split(","))
{
- ALT_OLY_COMPETITION_DAYS.add(Integer.parseInt(s));
+ OLYMPIAD_COMPETITION_DAYS.add(Integer.parseInt(s));
}
final File hexIdFile = new File(HEXID_FILE);
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/enums/OlympiadMode.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/enums/OlympiadMode.java
new file mode 100644
index 0000000000..a65f6a86a4
--- /dev/null
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/enums/OlympiadMode.java
@@ -0,0 +1,28 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.enums;
+
+/**
+ * @author NasSeKa
+ */
+public enum OlympiadMode
+{
+ NONE,
+ BLUE,
+ RED,
+ SPECTATOR
+}
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/EffectList.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/EffectList.java
index 4c89f9fa5d..929d62829c 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/EffectList.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/EffectList.java
@@ -50,9 +50,9 @@ import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.model.skill.SkillBuffType;
import org.l2jmobius.gameserver.network.serverpackets.AbnormalStatusUpdate;
import org.l2jmobius.gameserver.network.serverpackets.ExAbnormalStatusUpdateFromTarget;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadSpelledInfo;
import org.l2jmobius.gameserver.network.serverpackets.PartySpelled;
import org.l2jmobius.gameserver.network.serverpackets.ShortBuffStatusUpdate;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadSpelledInfo;
/**
* Effect lists.
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Player.java
index 2fbe6b5ab6..c130b81afd 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -99,6 +99,7 @@ import org.l2jmobius.gameserver.enums.ItemGrade;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.enums.MountType;
import org.l2jmobius.gameserver.enums.NextActionType;
+import org.l2jmobius.gameserver.enums.OlympiadMode;
import org.l2jmobius.gameserver.enums.PartyDistributionType;
import org.l2jmobius.gameserver.enums.PartyMessageType;
import org.l2jmobius.gameserver.enums.PartySmallWindowUpdateType;
@@ -308,7 +309,6 @@ import org.l2jmobius.gameserver.network.serverpackets.ExDuelUpdateUserInfo;
import org.l2jmobius.gameserver.network.serverpackets.ExGetBookMarkInfoPacket;
import org.l2jmobius.gameserver.network.serverpackets.ExGetOnAirShip;
import org.l2jmobius.gameserver.network.serverpackets.ExMagicAttackInfo;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMode;
import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCoinInfo;
import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCount;
import org.l2jmobius.gameserver.network.serverpackets.ExPrivateStoreSetWholeMsg;
@@ -365,6 +365,7 @@ import org.l2jmobius.gameserver.network.serverpackets.autoplay.ExActivateAutoSho
import org.l2jmobius.gameserver.network.serverpackets.autoplay.ExAutoPlaySettingSend;
import org.l2jmobius.gameserver.network.serverpackets.commission.ExResponseCommissionInfo;
import org.l2jmobius.gameserver.network.serverpackets.friend.FriendStatus;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMode;
import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
import org.l2jmobius.gameserver.taskmanager.AutoPlayTaskManager;
import org.l2jmobius.gameserver.taskmanager.AutoUseTaskManager;
@@ -9298,7 +9299,10 @@ public class Player extends Playable
public void enterObserverMode(Location loc)
{
- setLastLocation();
+ if (!isInOlympiadMode())
+ {
+ setLastLocation();
+ }
// Remove Hide.
getEffectList().stopEffects(AbnormalType.HIDE);
@@ -9351,7 +9355,7 @@ public class Player extends Playable
{
standUp();
}
- if (!_observerMode)
+ if (!_observerMode && !isInOlympiadMode())
{
setLastLocation();
}
@@ -9362,7 +9366,7 @@ public class Player extends Playable
setInvisible(true);
setInstance(OlympiadGameManager.getInstance().getOlympiadTask(id).getStadium().getInstance());
teleToLocation(loc, false);
- sendPacket(new ExOlympiadMode(3));
+ sendPacket(new ExOlympiadMode(OlympiadMode.SPECTATOR));
broadcastUserInfo();
}
@@ -9398,7 +9402,7 @@ public class Player extends Playable
_olympiadGameId = -1;
_observerMode = false;
setTarget(null);
- sendPacket(new ExOlympiadMode(0));
+ sendPacket(new ExOlympiadMode(OlympiadMode.NONE));
setInstance(null);
teleToLocation(_lastLoc, true);
if (!isGM())
@@ -9581,14 +9585,24 @@ public class Player extends Playable
return _olympiadStart;
}
+ public boolean isInOlympiadMode()
+ {
+ return _inOlympiadMode;
+ }
+
public boolean isHero()
{
return _hero;
}
- public boolean isInOlympiadMode()
+ public boolean isLegend()
{
- return _inOlympiadMode;
+ return getVariables().getBoolean(PlayerVariables.IS_LEGEND, false);
+ }
+
+ public void setLegend(boolean legend)
+ {
+ getVariables().set(PlayerVariables.IS_LEGEND, legend);
}
public boolean isInDuel()
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/item/ItemTemplate.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/item/ItemTemplate.java
index a0e189a4a2..613eb765fb 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/item/ItemTemplate.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/item/ItemTemplate.java
@@ -940,7 +940,7 @@ public abstract class ItemTemplate extends ListenersContainer implements IIdenti
public boolean isOlyRestrictedItem()
{
- return _isOlyRestricted || Config.LIST_OLY_RESTRICTED_ITEMS.contains(_itemId);
+ return _isOlyRestricted || Config.OLYMPIAD_RESTRICTED_ITEMS.contains(_itemId);
}
/**
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/item/instance/Item.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/item/instance/Item.java
index 1d440c4a12..0780b9a7ba 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/item/instance/Item.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/item/instance/Item.java
@@ -1995,16 +1995,16 @@ public class Item extends WorldObject
{
if (_itemTemplate.isWeapon())
{
- if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT))
+ if ((Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT))
{
- enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT;
+ enchant = Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT;
}
}
else
{
- if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT))
+ if ((Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT))
{
- enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT;
+ enchant = Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT;
}
}
}
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
index fb239220d0..f06642dc33 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
@@ -22,6 +22,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.ai.CtrlIntention;
+import org.l2jmobius.gameserver.enums.OlympiadMode;
import org.l2jmobius.gameserver.enums.PartyMessageType;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
@@ -39,11 +40,11 @@ import org.l2jmobius.gameserver.model.siege.Castle;
import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.network.SystemMessageId;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMode;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
import org.l2jmobius.gameserver.network.serverpackets.SkillCoolTime;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMode;
/**
* @author godson, GodKratos, Pere, DS
@@ -163,7 +164,7 @@ public abstract class AbstractOlympiadGame
return null;
}
- protected static boolean portPlayerToArena(Participant par, Location loc, int id, Instance instance)
+ protected static boolean portPlayerToArena(Participant par, Location loc, int id, Instance instance, OlympiadMode mode)
{
final Player player = par.getPlayer();
if ((player == null) || !player.isOnline())
@@ -173,6 +174,7 @@ public abstract class AbstractOlympiadGame
try
{
+ player.setPvpFlag(0);
player.setLastLocation();
if (player.isSitting())
{
@@ -185,7 +187,32 @@ public abstract class AbstractOlympiadGame
player.setOlympiadStart(false);
player.setOlympiadSide(par.getSide());
player.teleToLocation(loc, instance);
- player.sendPacket(new ExOlympiadMode(2));
+ player.sendPacket(new ExOlympiadMode(mode));
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ return false;
+ }
+ return true;
+ }
+
+ protected static boolean portPlayerToSpot(Participant par, Location loc, int id)
+ {
+ final Player player = par.getPlayer();
+ if ((player == null) || !player.isOnline())
+ {
+ return false;
+ }
+
+ try
+ {
+ if (player.isSitting())
+ {
+ player.standUp();
+ }
+ player.setTarget(null);
+ player.teleToLocation(loc);
}
catch (Exception e)
{
@@ -299,6 +326,48 @@ public abstract class AbstractOlympiadGame
}
}
+ protected void roundTwoClean(Player player)
+ {
+ try
+ {
+ if (player == null)
+ {
+ return;
+ }
+
+ // Remove Debuffs
+ player.getEffectList().stopEffects(info -> info.getSkill().isDebuff(), true, true);
+
+ // Abort casting if player casting
+ player.abortAttack();
+ player.abortCast();
+
+ // Force the character to be visible
+ player.setInvisible(false);
+
+ // Heal Player fully
+ player.setCurrentCp(player.getMaxCp());
+ player.setCurrentHp(player.getMaxHp());
+ player.setCurrentMp(player.getMaxMp());
+
+ // enable skills with cool time <= 15 minutes
+ for (Skill skill : player.getAllSkills())
+ {
+ if (skill.getReuseDelay() <= 900000)
+ {
+ player.enableSkill(skill);
+ }
+ }
+
+ player.sendSkillList();
+ player.sendPacket(new SkillCoolTime(player));
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+ }
+
protected void cleanEffects(Player player)
{
try
@@ -371,7 +440,8 @@ public abstract class AbstractOlympiadGame
player.setOlympiadStart(false);
player.setOlympiadSide(-1);
player.setOlympiadGameId(-1);
- player.sendPacket(new ExOlympiadMode(0));
+ player.sendPacket(new ExOlympiadMode(OlympiadMode.SPECTATOR));
+ player.sendPacket(new ExOlympiadMode(OlympiadMode.NONE));
// Add Clan Skills
final Clan clan = player.getClan();
@@ -420,6 +490,7 @@ public abstract class AbstractOlympiadGame
{
return;
}
+
final Location loc = player.getLastLocation();
if (loc != null)
{
@@ -481,6 +552,8 @@ public abstract class AbstractOlympiadGame
protected abstract boolean portPlayersToArena(List spawns, Instance instance);
+ protected abstract boolean portPlayersToSpots(List spawns, Instance instance);
+
protected abstract void cleanEffects();
protected abstract void portPlayersBack();
@@ -489,22 +562,40 @@ public abstract class AbstractOlympiadGame
protected abstract void clearPlayers();
+ protected abstract void matchEnd(boolean value);
+
+ protected abstract boolean isMatchEnd();
+
protected abstract void handleDisconnect(Player player);
protected abstract void resetDamage();
+ protected abstract void resetDamageFinal();
+
protected abstract void addDamage(Player player, int damage);
protected abstract boolean checkBattleStatus();
protected abstract boolean haveWinner();
+ protected abstract boolean roundWinner();
+
protected abstract void validateWinner(OlympiadStadium stadium);
+ protected abstract void validateRound1Winner(OlympiadStadium stadium);
+
+ protected abstract void validateRound2Winner(OlympiadStadium stadium);
+
+ protected abstract void validateRound3Winner(OlympiadStadium stadium);
+
protected abstract int getDivider();
protected abstract void healPlayers();
+ protected abstract void buffPlayers();
+
+ protected abstract void roundTwoCleanUp();
+
protected abstract void untransformPlayers();
protected abstract void makePlayersInvul();
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/Hero.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
index 22accd82c3..0164986e0c 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
@@ -40,6 +40,7 @@ import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ClassListData;
import org.l2jmobius.gameserver.data.xml.NpcData;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
+import org.l2jmobius.gameserver.instancemanager.RankManager;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Player;
@@ -71,7 +72,7 @@ public class Hero
private static final String INSERT_HERO = "INSERT INTO heroes (charId, class_id, count, legend_count, played, claimed) VALUES (?,?,?,?,?,?)";
private static final String UPDATE_HERO = "UPDATE heroes SET count = ?, legend_count = ?, played = ?, claimed = ? WHERE charId = ?";
private static final String GET_CLAN_ALLY = "SELECT characters.clanid AS clanid, coalesce(clan_data.ally_Id, 0) AS allyId FROM characters LEFT JOIN clan_data ON clan_data.clan_id = characters.clanid WHERE characters.charId = ?";
- private static final String DELETE_ITEMS = "DELETE FROM items WHERE item_id IN (30392, 30393, 30394, 30395, 30396, 30397, 30398, 30399, 30400, 30401, 30402, 30403, 30404, 30405, 30372, 30373, 6842, 6611, 6612, 6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 9388, 9389, 9390, 48551, 48552) AND owner_id NOT IN (SELECT charId FROM characters WHERE accesslevel > 0)";
+ private static final String DELETE_ITEMS = "DELETE FROM items WHERE item_id IN (30392, 30393, 30394, 30395, 30396, 30397, 30398, 30399, 30400, 30401, 30402, 30403, 30404, 30405, 30372, 30373, 6842, 6611, 6612, 6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 9388, 9389, 9390, 48551, 48552, 48554, 48555, 48556, 48557, 48558, 48559, 48560, 48561, 48562, 48563, 48564, 48565, 48566, 48567) AND owner_id NOT IN (SELECT charId FROM characters WHERE accesslevel > 0)";
private static final Map HEROES = new ConcurrentHashMap<>();
private static final Map COMPLETE_HEROS = new ConcurrentHashMap<>();
@@ -95,7 +96,10 @@ public class Hero
protected Hero()
{
- init();
+ if (Config.OLYMPIAD_ENABLED)
+ {
+ init();
+ }
}
private void init()
@@ -607,6 +611,10 @@ public class Hero
}
player.setHero(false);
+ if (player.isLegend())
+ {
+ player.setLegend(false);
+ }
for (int i = 0; i < Inventory.PAPERDOLL_TOTALSLOTS; i++)
{
@@ -644,19 +652,17 @@ public class Hero
for (StatSet hero : newHeroes)
{
+ final int legendId = RankManager.getInstance().getOlyRankList().get(1).getInt("charId", 0);
final int charId = hero.getInt(Olympiad.CHAR_ID);
if (COMPLETE_HEROS.containsKey(charId))
{
final StatSet oldHero = COMPLETE_HEROS.get(charId);
- if (hero.getInt(LEGEND_COUNT, 0) == 1)
+ final int count = oldHero.getInt(COUNT);
+ oldHero.set(COUNT, count + 1);
+ if (charId == legendId)
{
- final int count = oldHero.getInt(LEGEND_COUNT);
- oldHero.set(LEGEND_COUNT, count + 1);
- }
- else
- {
- final int count = oldHero.getInt(COUNT);
- oldHero.set(COUNT, count + 1);
+ final int legendCount = oldHero.getInt(LEGEND_COUNT);
+ oldHero.set(LEGEND_COUNT, legendCount + 1);
}
oldHero.set(PLAYED, 1);
oldHero.set(CLAIMED, false);
@@ -667,14 +673,11 @@ public class Hero
final StatSet newHero = new StatSet();
newHero.set(Olympiad.CHAR_NAME, hero.getString(Olympiad.CHAR_NAME));
newHero.set(Olympiad.CLASS_ID, hero.getInt(Olympiad.CLASS_ID));
- if (hero.getInt(LEGEND_COUNT, 0) == 1)
+ newHero.set(COUNT, 1);
+ if (charId == legendId)
{
newHero.set(LEGEND_COUNT, 1);
}
- else
- {
- newHero.set(COUNT, 1);
- }
newHero.set(PLAYED, 1);
newHero.set(CLAIMED, false);
HEROES.put(charId, newHero);
@@ -918,6 +921,7 @@ public class Hero
*/
public void claimHero(Player player)
{
+ final int legendId = RankManager.getInstance().getOlyRankList().get(1).getInt("charId", 0);
StatSet hero = HEROES.get(player.getObjectId());
if (hero == null)
{
@@ -938,6 +942,19 @@ public class Hero
}
player.setHero(true);
+ if (player.getObjectId() == legendId)
+ {
+ player.setLegend(true);
+ player.getVariables().set(ALLY_NAME, false);
+ if ((clan != null) && (clan.getLevel() >= 5))
+ {
+ clan.addReputationScore(100000);
+ final SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_MEMBER_C1_WAS_NAMED_A_HERO_S2_POINTS_HAVE_BEEN_ADDED_TO_YOUR_CLAN_REPUTATION);
+ sm.addString(CharNameTable.getInstance().getNameById(player.getObjectId()));
+ sm.addInt(Config.HERO_POINTS);
+ clan.broadcastToOnlineMembers(sm);
+ }
+ }
player.broadcastPacket(new SocialAction(player.getObjectId(), 20016)); // Hero Animation
player.sendPacket(new UserInfo(player));
player.broadcastUserInfo();
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java
index 8864817e16..f8c7c09208 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java
@@ -50,6 +50,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.events.ListenersContainer;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadInfo;
import org.l2jmobius.gameserver.util.Broadcast;
/**
@@ -69,13 +70,13 @@ public class Olympiad extends ListenersContainer
private static final String OLYMPIAD_LOAD_NOBLES = "SELECT olympiad_nobles.charId, olympiad_nobles.class_id, characters.char_name, olympiad_nobles.olympiad_points, olympiad_nobles.competitions_done, olympiad_nobles.competitions_won, olympiad_nobles.competitions_lost, olympiad_nobles.competitions_drawn, olympiad_nobles.competitions_done_week FROM olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId";
private static final String OLYMPIAD_SAVE_NOBLES = "INSERT INTO olympiad_nobles (`charId`,`class_id`,`olympiad_points`,`competitions_done`,`competitions_won`,`competitions_lost`,`competitions_drawn`, `competitions_done_week`) VALUES (?,?,?,?,?,?,?,?)";
private static final String OLYMPIAD_UPDATE_NOBLES = "UPDATE olympiad_nobles SET olympiad_points = ?, competitions_done = ?, competitions_won = ?, competitions_lost = ?, competitions_drawn = ?, competitions_done_week = ? WHERE charId = ?";
- private static final String OLYMPIAD_GET_HEROS = "SELECT olympiad_nobles.charId, characters.char_name FROM olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND olympiad_nobles.class_id = ? AND olympiad_nobles.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " AND olympiad_nobles.competitions_won > 0 ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC";
- private static final String OLYMPIAD_GET_LEGEND = "SELECT olympiad_nobles.charId FROM olympiad_nobles WHERE olympiad_nobles.competitions_done >=" + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC LIMIT 1";
- private static final String GET_ALL_CLASSIFIED_NOBLESS = "SELECT charId from olympiad_nobles_eom WHERE competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_points DESC, competitions_done DESC, competitions_won DESC";
- private static final String GET_EACH_CLASS_LEADER = "SELECT characters.char_name from olympiad_nobles_eom, characters WHERE characters.charId = olympiad_nobles_eom.charId AND olympiad_nobles_eom.class_id = ? AND olympiad_nobles_eom.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles_eom.olympiad_points DESC, olympiad_nobles_eom.competitions_done DESC, olympiad_nobles_eom.competitions_won DESC LIMIT 10";
- private static final String GET_EACH_CLASS_LEADER_CURRENT = "SELECT characters.char_name from olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND olympiad_nobles.class_id = ? AND olympiad_nobles.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC LIMIT 10";
- private static final String GET_EACH_CLASS_LEADER_SOULHOUND = "SELECT characters.char_name from olympiad_nobles_eom, characters WHERE characters.charId = olympiad_nobles_eom.charId AND (olympiad_nobles_eom.class_id = ? OR olympiad_nobles_eom.class_id = 133) AND olympiad_nobles_eom.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles_eom.olympiad_points DESC, olympiad_nobles_eom.competitions_done DESC, olympiad_nobles_eom.competitions_won DESC LIMIT 10";
- private static final String GET_EACH_CLASS_LEADER_CURRENT_SOULHOUND = "SELECT characters.char_name from olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND (olympiad_nobles.class_id = ? OR olympiad_nobles.class_id = 133) AND olympiad_nobles.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC LIMIT 10";
+ private static final String OLYMPIAD_GET_HEROS = "SELECT olympiad_nobles.charId, characters.char_name FROM olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND olympiad_nobles.class_id = ? AND olympiad_nobles.competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " AND olympiad_nobles.competitions_won > 0 ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC";
+ private static final String OLYMPIAD_GET_LEGEND = "SELECT olympiad_nobles.charId FROM olympiad_nobles WHERE olympiad_nobles.competitions_done >=" + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC LIMIT 1";
+ private static final String GET_ALL_CLASSIFIED_NOBLESS = "SELECT charId from olympiad_nobles_eom WHERE competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_points DESC, competitions_done DESC, competitions_won DESC";
+ private static final String GET_EACH_CLASS_LEADER = "SELECT characters.char_name from olympiad_nobles_eom, characters WHERE characters.charId = olympiad_nobles_eom.charId AND olympiad_nobles_eom.class_id = ? AND olympiad_nobles_eom.competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_nobles_eom.olympiad_points DESC, olympiad_nobles_eom.competitions_done DESC, olympiad_nobles_eom.competitions_won DESC LIMIT 10";
+ private static final String GET_EACH_CLASS_LEADER_CURRENT = "SELECT characters.char_name from olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND olympiad_nobles.class_id = ? AND olympiad_nobles.competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC LIMIT 10";
+ private static final String GET_EACH_CLASS_LEADER_SOULHOUND = "SELECT characters.char_name from olympiad_nobles_eom, characters WHERE characters.charId = olympiad_nobles_eom.charId AND (olympiad_nobles_eom.class_id = ? OR olympiad_nobles_eom.class_id = 133) AND olympiad_nobles_eom.competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_nobles_eom.olympiad_points DESC, olympiad_nobles_eom.competitions_done DESC, olympiad_nobles_eom.competitions_won DESC LIMIT 10";
+ private static final String GET_EACH_CLASS_LEADER_CURRENT_SOULHOUND = "SELECT characters.char_name from olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND (olympiad_nobles.class_id = ? OR olympiad_nobles.class_id = 133) AND olympiad_nobles.competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC LIMIT 10";
private static final String REMOVE_UNCLAIMED_POINTS = "DELETE FROM character_variables WHERE charId=? AND var=?";
private static final String INSERT_UNCLAIMED_POINTS = "INSERT INTO character_variables (charId, var, val) VALUES (?, ?, ?)";
@@ -87,14 +88,13 @@ public class Olympiad extends ListenersContainer
private static final Set HERO_IDS = CategoryData.getInstance().getCategoryByType(CategoryType.SIXTH_CLASS_GROUP);
- private static final int COMP_START = Config.ALT_OLY_START_TIME; // 6PM
- private static final int COMP_MIN = Config.ALT_OLY_MIN; // 00 mins
- private static final long COMP_PERIOD = Config.ALT_OLY_CPERIOD; // 6 hours
- protected static final long WEEKLY_PERIOD = Config.ALT_OLY_WPERIOD; // 1 week
- protected static final long VALIDATION_PERIOD = Config.ALT_OLY_VPERIOD; // 24 hours
+ private static final int COMP_START = Config.OLYMPIAD_START_TIME; // 6PM
+ private static final int COMP_MIN = Config.OLYMPIAD_MIN; // 00 mins
+ private static final long COMP_PERIOD = Config.OLYMPIAD_CPERIOD; // 6 hours
+ protected static final long WEEKLY_PERIOD = Config.OLYMPIAD_WPERIOD; // 1 week
+ protected static final long VALIDATION_PERIOD = Config.OLYMPIAD_VPERIOD; // 24 hours
- public static final int DEFAULT_POINTS = Config.ALT_OLY_START_POINTS;
- protected static final int WEEKLY_POINTS = Config.ALT_OLY_WEEKLY_POINTS;
+ public static final int DEFAULT_POINTS = Config.OLYMPIAD_START_POINTS;
public static final String CHAR_ID = "charId";
public static final String CLASS_ID = "class_id";
@@ -131,12 +131,19 @@ public class Olympiad extends ListenersContainer
protected Olympiad()
{
- load();
- AntiFeedManager.getInstance().registerEvent(AntiFeedManager.OLYMPIAD_ID);
-
- if (_period == 0)
+ if (Config.OLYMPIAD_ENABLED)
{
- init();
+ load();
+ AntiFeedManager.getInstance().registerEvent(AntiFeedManager.OLYMPIAD_ID);
+
+ if (_period == 0)
+ {
+ init();
+ }
+ }
+ else
+ {
+ LOGGER.log(Level.INFO, "Disabled.");
}
}
@@ -399,7 +406,7 @@ public class Olympiad extends ListenersContainer
int dayCounter = 0;
for (int i = currentDay; i < 8; i++)
{
- if (Config.ALT_OLY_COMPETITION_DAYS.contains(i))
+ if (Config.OLYMPIAD_COMPETITION_DAYS.contains(i))
{
dayFound = true;
break;
@@ -410,7 +417,7 @@ public class Olympiad extends ListenersContainer
{
for (int i = 1; i < 8; i++)
{
- if (Config.ALT_OLY_COMPETITION_DAYS.contains(i))
+ if (Config.OLYMPIAD_COMPETITION_DAYS.contains(i))
{
break;
}
@@ -514,19 +521,24 @@ public class Olympiad extends ListenersContainer
_scheduledCompStart = ThreadPool.schedule(() ->
{
- if (isOlympiadEnd())
+ if (isOlympiadEnd() || !Config.OLYMPIAD_ENABLED)
{
return;
}
_inCompPeriod = true;
+ for (Player player : World.getInstance().getPlayers())
+ {
+ player.sendPacket(new ExOlympiadInfo(1));
+ }
+
Broadcast.toAllOnlinePlayers(new SystemMessage(SystemMessageId.THE_OLYMPIAD_HAS_BEGAN));
LOGGER.info("Olympiad System: Olympiad Games have started.");
LOGGER_OLYMPIAD.info("Result,Player1,Player2,Player1 HP,Player2 HP,Player1 Damage,Player2 Damage,Points,Classed");
_gameManager = ThreadPool.scheduleAtFixedRate(OlympiadGameManager.getInstance(), 30000, 30000);
- if (Config.ALT_OLY_ANNOUNCE_GAMES)
+ if (Config.OLYMPIAD_ANNOUNCE_GAMES)
{
_gameAnnouncer = ThreadPool.scheduleAtFixedRate(new OlympiadAnnouncer(), 30000, 500);
}
@@ -543,7 +555,14 @@ public class Olympiad extends ListenersContainer
{
return;
}
+
_inCompPeriod = false;
+
+ for (Player player : World.getInstance().getPlayers())
+ {
+ player.sendPacket(new ExOlympiadInfo(0));
+ }
+
Broadcast.toAllOnlinePlayers(new SystemMessage(SystemMessageId.BATTLES_IN_THE_OLYMPIAD_GAMES_ARE_NOW_OVER));
LOGGER.info("Olympiad System: Olympiad games have ended.");
@@ -624,33 +643,33 @@ public class Olympiad extends ListenersContainer
final Calendar nextChange = Calendar.getInstance();
- switch (Config.ALT_OLY_PERIOD)
+ switch (Config.OLYMPIAD_PERIOD)
{
case "DAY":
{
- currentTime.add(Calendar.DAY_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
+ currentTime.add(Calendar.DAY_OF_MONTH, Config.OLYMPIAD_PERIOD_MULTIPLIER);
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
- if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 14)
+ if (Config.OLYMPIAD_PERIOD_MULTIPLIER >= 14)
{
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
}
- else if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 7)
+ else if (Config.OLYMPIAD_PERIOD_MULTIPLIER >= 7)
{
_nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2);
}
else
{
- LOGGER.warning("Invalid config value for Config.ALT_OLY_PERIOD_MULTIPLIER, must be >= 7");
+ LOGGER.warning("Invalid config value for Config.OLYMPIAD_PERIOD_MULTIPLIER, must be >= 7");
}
break;
}
case "WEEK":
{
- currentTime.add(Calendar.WEEK_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
+ currentTime.add(Calendar.WEEK_OF_MONTH, Config.OLYMPIAD_PERIOD_MULTIPLIER);
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
- if (Config.ALT_OLY_PERIOD_MULTIPLIER > 1)
+ if (Config.OLYMPIAD_PERIOD_MULTIPLIER > 1)
{
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
}
@@ -662,7 +681,7 @@ public class Olympiad extends ListenersContainer
}
case "MONTH":
{
- currentTime.add(Calendar.MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
+ currentTime.add(Calendar.MONTH, Config.OLYMPIAD_PERIOD_MULTIPLIER);
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
@@ -719,7 +738,7 @@ public class Olympiad extends ListenersContainer
int dayCounter = 0;
for (int i = currentDay; i < 8; i++)
{
- if (Config.ALT_OLY_COMPETITION_DAYS.contains(i))
+ if (Config.OLYMPIAD_COMPETITION_DAYS.contains(i))
{
dayFound = true;
break;
@@ -730,7 +749,7 @@ public class Olympiad extends ListenersContainer
{
for (int i = 1; i < 8; i++)
{
- if (Config.ALT_OLY_COMPETITION_DAYS.contains(i))
+ if (Config.OLYMPIAD_COMPETITION_DAYS.contains(i))
{
break;
}
@@ -769,8 +788,6 @@ public class Olympiad extends ListenersContainer
{
_scheduledWeeklyTask = ThreadPool.scheduleAtFixedRate(() ->
{
- addWeeklyPoints();
- LOGGER.info("Olympiad System: Added weekly points to nobles");
resetWeeklyMatches();
LOGGER.info("Olympiad System: Reset weekly matches to nobles");
@@ -778,22 +795,6 @@ public class Olympiad extends ListenersContainer
}, getMillisToWeekChange(), WEEKLY_PERIOD);
}
- protected synchronized void addWeeklyPoints()
- {
- if (_period == 1)
- {
- return;
- }
-
- int currentPoints;
- for (StatSet nobleInfo : NOBLES.values())
- {
- currentPoints = nobleInfo.getInt(POINTS);
- currentPoints += WEEKLY_POINTS;
- nobleInfo.set(POINTS, currentPoints);
- }
- }
-
/**
* Resets number of matches, classed matches, non classed matches, team matches done by noble characters in the week.
*/
@@ -1036,7 +1037,7 @@ public class Olympiad extends ListenersContainer
public List getClassLeaderBoard(int classId)
{
final List names = new ArrayList<>();
- final String query = Config.ALT_OLY_SHOW_MONTHLY_WINNERS ? ((classId == 132) ? GET_EACH_CLASS_LEADER_SOULHOUND : GET_EACH_CLASS_LEADER) : ((classId == 132) ? GET_EACH_CLASS_LEADER_CURRENT_SOULHOUND : GET_EACH_CLASS_LEADER_CURRENT);
+ final String query = Config.OLYMPIAD_SHOW_MONTHLY_WINNERS ? ((classId == 132) ? GET_EACH_CLASS_LEADER_SOULHOUND : GET_EACH_CLASS_LEADER) : ((classId == 132) ? GET_EACH_CLASS_LEADER_CURRENT_SOULHOUND : GET_EACH_CLASS_LEADER_CURRENT);
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(query))
{
@@ -1075,33 +1076,33 @@ public class Olympiad extends ListenersContainer
}
// Hero point bonus
- int points = Hero.getInstance().isHero(objectId) || Hero.getInstance().isUnclaimedHero(objectId) ? Config.ALT_OLY_HERO_POINTS : 0;
+ int points = Hero.getInstance().isHero(objectId) || Hero.getInstance().isUnclaimedHero(objectId) ? Config.OLYMPIAD_HERO_POINTS : 0;
// Rank point bonus
switch (NOBLES_RANK.get(objectId))
{
case 1:
{
- points += Config.ALT_OLY_RANK1_POINTS;
+ points += Config.OLYMPIAD_RANK1_POINTS;
break;
}
case 2:
{
- points += Config.ALT_OLY_RANK2_POINTS;
+ points += Config.OLYMPIAD_RANK2_POINTS;
break;
}
case 3:
{
- points += Config.ALT_OLY_RANK3_POINTS;
+ points += Config.OLYMPIAD_RANK3_POINTS;
break;
}
case 4:
{
- points += Config.ALT_OLY_RANK4_POINTS;
+ points += Config.OLYMPIAD_RANK4_POINTS;
break;
}
default:
{
- points += Config.ALT_OLY_RANK5_POINTS;
+ points += Config.OLYMPIAD_RANK5_POINTS;
}
}
@@ -1203,7 +1204,7 @@ public class Olympiad extends ListenersContainer
*/
public int getRemainingWeeklyMatches(int objId)
{
- return Math.max(Config.ALT_OLY_MAX_WEEKLY_MATCHES - getCompetitionDoneWeek(objId), 0);
+ return Math.max(Config.OLYMPIAD_MAX_WEEKLY_MATCHES - getCompetitionDoneWeek(objId), 0);
}
protected void deleteNobles()
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java
index ce206a1675..2eb778a7ee 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java
@@ -41,7 +41,7 @@ public class OlympiadGameClassed extends OlympiadGameNormal
@Override
protected int getDivider()
{
- return Config.ALT_OLY_DIVIDER_CLASSED;
+ return Config.OLYMPIAD_DIVIDER_CLASSED;
}
protected static OlympiadGameClassed createGame(int id, List> classList)
@@ -73,4 +73,13 @@ public class OlympiadGameClassed extends OlympiadGameNormal
}
return null;
}
+
+ /*
+ * (non-Javadoc)
+ * @see org.l2jmobius.gameserver.model.olympiad.AbstractOlympiadGame#validateRound3Winner(org.l2jmobius.gameserver.model.olympiad.OlympiadStadium)
+ */
+ @Override
+ protected void validateRound3Winner(OlympiadStadium stadium)
+ {
+ }
}
\ No newline at end of file
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNonClassed.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNonClassed.java
index ccea7ddce1..cc60cc61fd 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNonClassed.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNonClassed.java
@@ -39,7 +39,7 @@ public class OlympiadGameNonClassed extends OlympiadGameNormal
@Override
protected int getDivider()
{
- return Config.ALT_OLY_DIVIDER_NON_CLASSED;
+ return Config.OLYMPIAD_DIVIDER_NON_CLASSED;
}
protected static OlympiadGameNonClassed createGame(int id, Set list)
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
index e63fbfb564..cf9cd529fa 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
@@ -27,7 +27,9 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Rnd;
+import org.l2jmobius.gameserver.enums.OlympiadMode;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -35,11 +37,14 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.impl.olympiad.OnOlympiadMatchResult;
import org.l2jmobius.gameserver.model.instancezone.Instance;
+import org.l2jmobius.gameserver.model.skill.CommonSkill;
+import org.l2jmobius.gameserver.model.skill.SkillCaster;
import org.l2jmobius.gameserver.network.SystemMessageId;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchResult;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadUserInfo;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchInfo;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchResult;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadUserInfo;
/**
* @author GodKratos, Pere, DS
@@ -48,10 +53,19 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
{
protected int _damageP1 = 0;
protected int _damageP2 = 0;
+ protected int _damageP1Final = 0;
+ protected int _damageP2Final = 0;
protected Participant _playerOne;
protected Participant _playerTwo;
+ String round_1_winner;
+ String round_2_winner;
+ String round_3_winner;
+ int player1Wins = 0;
+ int player2Wins = 0;
+ boolean matchEnd;
+
protected OlympiadGameNormal(int id, Participant[] opponents)
{
super(id);
@@ -162,8 +176,25 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
boolean result = true;
try
{
- result &= portPlayerToArena(_playerOne, spawns.get(0), _stadiumId, instance);
- result &= portPlayerToArena(_playerTwo, spawns.get(spawns.size() / 2), _stadiumId, instance);
+ result &= portPlayerToArena(_playerOne, spawns.get(0), _stadiumId, instance, OlympiadMode.BLUE);
+ result &= portPlayerToArena(_playerTwo, spawns.get(spawns.size() / 2), _stadiumId, instance, OlympiadMode.RED);
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, "", e);
+ return false;
+ }
+ return result;
+ }
+
+ @Override
+ protected final boolean portPlayersToSpots(List spawns, Instance instance)
+ {
+ boolean result = true;
+ try
+ {
+ result &= portPlayerToSpot(_playerOne, spawns.get(0), _stadiumId);
+ result &= portPlayerToSpot(_playerTwo, spawns.get(spawns.size() / 2), _stadiumId);
}
catch (Exception e)
{
@@ -332,6 +363,407 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
return playerOneLost || playerTwoLost;
}
+ @Override
+ public final boolean roundWinner()
+ {
+ if (!checkBattleStatus())
+ {
+ return true;
+ }
+
+ boolean playerOneLost = true;
+ try
+ {
+ if (_playerOne.getPlayer().getOlympiadGameId() == _stadiumId)
+ {
+ playerOneLost = _playerOne.getPlayer().isDead();
+ }
+ }
+ catch (Exception e)
+ {
+ playerOneLost = true;
+ }
+
+ boolean playerTwoLost = true;
+ try
+ {
+ if (_playerTwo.getPlayer().getOlympiadGameId() == _stadiumId)
+ {
+ playerTwoLost = _playerTwo.getPlayer().isDead();
+ }
+ }
+ catch (Exception e)
+ {
+ playerTwoLost = true;
+ }
+
+ return playerOneLost || playerTwoLost;
+ }
+
+ @Override
+ public void matchEnd(boolean value)
+ {
+ matchEnd = value;
+ }
+
+ @Override
+ public boolean isMatchEnd()
+ {
+ return matchEnd;
+ }
+
+ @Override
+ protected void validateRound1Winner(OlympiadStadium stadium)
+ {
+ if (_aborted)
+ {
+ return;
+ }
+
+ SystemMessage sm;
+
+ try
+ {
+ double playerOneHp = 0;
+ if ((_playerOne.getPlayer() != null) && !_playerOne.getPlayer().isDead())
+ {
+ playerOneHp = _playerOne.getPlayer().getCurrentHp() + _playerOne.getPlayer().getCurrentCp();
+ if (playerOneHp < 0.5)
+ {
+ playerOneHp = 0;
+ }
+ }
+
+ double playerTwoHp = 0;
+ if ((_playerTwo.getPlayer() != null) && !_playerTwo.getPlayer().isDead())
+ {
+ playerTwoHp = _playerTwo.getPlayer().getCurrentHp() + _playerTwo.getPlayer().getCurrentCp();
+ if (playerTwoHp < 0.5)
+ {
+ playerTwoHp = 0;
+ }
+ }
+
+ // if players crashed, search if they've relogged
+ _playerOne.updatePlayer();
+ _playerTwo.updatePlayer();
+
+ _damageP1Final += _damageP1;
+ _damageP2Final += _damageP2;
+
+ if (((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline()) && ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline()))
+ {
+ _playerOne.updateStat(COMP_DRAWN, 1);
+ _playerTwo.updateStat(COMP_DRAWN, 1);
+ sm = new SystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
+ stadium.broadcastPacket(sm);
+ }
+ else if ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerOne.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerTwo.getPlayer().setCurrentCp(_playerTwo.getPlayer().getMaxCp() * 0.7);
+ _playerTwo.getPlayer().setCurrentHp(_playerTwo.getPlayer().getMaxHp() * 0.7);
+ _playerTwo.getPlayer().setCurrentMp(_playerTwo.getPlayer().getMaxMp() * 0.7);
+ _playerTwo.getPlayer().sendPacket(loose);
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 0, 1, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 0, 1, 20));
+ ThreadPool.schedule(() ->
+ {
+ SkillCaster.triggerCast(_playerOne.getPlayer(), _playerOne.getPlayer(), CommonSkill.OLYMPIAD_WIN.getSkill());
+ }, 2000);
+ ThreadPool.schedule(() ->
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 0, 1, 100));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 0, 1, 100));
+ }, 20000);
+ round_1_winner = _playerOne.getName();
+ player1Wins += 1;
+ }
+ else if ((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline() || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP2 > _damageP1) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerTwo.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerOne.getPlayer().sendPacket(loose);
+ _playerOne.getPlayer().setCurrentCp(_playerOne.getPlayer().getMaxCp() * 0.7);
+ _playerOne.getPlayer().setCurrentHp(_playerOne.getPlayer().getMaxHp() * 0.7);
+ _playerOne.getPlayer().setCurrentMp(_playerOne.getPlayer().getMaxMp() * 0.7);
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 1, 1, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 1, 1, 20));
+ ThreadPool.schedule(() ->
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 1, 1, 100));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 1, 1, 100));
+ }, 20000);
+ ThreadPool.schedule(() ->
+ {
+ _playerTwo.getPlayer().useMagic(CommonSkill.OLYMPIAD_WIN.getSkill(), null, false, false);
+ }, 2000);
+ round_1_winner = _playerTwo.getName();
+ player2Wins += 1;
+ }
+ else
+ {
+ round_1_winner = null;
+ final SystemMessage _tie = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIE);
+ _playerTwo.getPlayer().broadcastPacket(_tie);
+ _playerOne.getPlayer().broadcastPacket(_tie);
+ }
+ resetDamage();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, "Exception on validateRound1Winner(): " + e.getMessage(), e);
+ }
+ }
+
+ @Override
+ protected void validateRound2Winner(OlympiadStadium stadium)
+ {
+ if (_aborted)
+ {
+ return;
+ }
+
+ SystemMessage sm;
+
+ try
+ {
+ double playerOneHp = 0;
+ if ((_playerOne.getPlayer() != null) && !_playerOne.getPlayer().isDead())
+ {
+ playerOneHp = _playerOne.getPlayer().getCurrentHp() + _playerOne.getPlayer().getCurrentCp();
+ if (playerOneHp < 0.5)
+ {
+ playerOneHp = 0;
+ }
+ }
+
+ double playerTwoHp = 0;
+ if ((_playerTwo.getPlayer() != null) && !_playerTwo.getPlayer().isDead())
+ {
+ playerTwoHp = _playerTwo.getPlayer().getCurrentHp() + _playerTwo.getPlayer().getCurrentCp();
+ if (playerTwoHp < 0.5)
+ {
+ playerTwoHp = 0;
+ }
+ }
+
+ // if players crashed, search if they've relogged
+ _playerOne.updatePlayer();
+ _playerTwo.updatePlayer();
+
+ _damageP1Final += _damageP1;
+ _damageP2Final += _damageP2;
+
+ if (((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline()) && ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline()))
+ {
+ _playerOne.updateStat(COMP_DRAWN, 1);
+ _playerTwo.updateStat(COMP_DRAWN, 1);
+ sm = new SystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
+ stadium.broadcastPacket(sm);
+ }
+ else if ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerOne.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerTwo.getPlayer().sendPacket(loose);
+ round_2_winner = _playerOne.getName();
+ player1Wins += 1;
+
+ if (round_1_winner.toLowerCase().equalsIgnoreCase(_playerOne.getName()))
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 0, 2, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 0, 2, 20));
+ matchEnd(true);
+ }
+ else
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 20));
+ ThreadPool.schedule(() ->
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 100));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 100));
+ }, 20000);
+ }
+ ThreadPool.schedule(() ->
+ {
+ SkillCaster.triggerCast(_playerOne.getPlayer(), _playerOne.getPlayer(), CommonSkill.OLYMPIAD_WIN.getSkill());
+ }, 2000);
+ }
+ else if ((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline() || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP2 > _damageP1) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerTwo.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerOne.getPlayer().sendPacket(loose);
+ round_2_winner = _playerTwo.getName();
+ player2Wins += 1;
+
+ if (round_1_winner.toLowerCase().equalsIgnoreCase(_playerTwo.getName()))
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 2, 2, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 2, 2, 20));
+ matchEnd(true);
+ }
+ else
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 20));
+ ThreadPool.schedule(() ->
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 100));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 100));
+ }, 20000);
+ }
+ ThreadPool.schedule(() ->
+ {
+ _playerTwo.getPlayer().useMagic(CommonSkill.OLYMPIAD_WIN.getSkill(), null, false, false);
+ }, 2000);
+ }
+ else
+ {
+ final SystemMessage _tie = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIE);
+ _playerTwo.getPlayer().broadcastPacket(_tie);
+ _playerOne.getPlayer().broadcastPacket(_tie);
+ }
+ resetDamage();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, "Exception on validateRound2Winner(): " + e.getMessage(), e);
+ }
+ }
+
+ @Override
+ protected void validateRound3Winner(OlympiadStadium stadium)
+ {
+ if (_aborted)
+ {
+ return;
+ }
+
+ SystemMessage sm;
+
+ try
+ {
+ double playerOneHp = 0;
+ if ((_playerOne.getPlayer() != null) && !_playerOne.getPlayer().isDead())
+ {
+ playerOneHp = _playerOne.getPlayer().getCurrentHp() + _playerOne.getPlayer().getCurrentCp();
+ if (playerOneHp < 0.5)
+ {
+ playerOneHp = 0;
+ }
+ }
+
+ double playerTwoHp = 0;
+ if ((_playerTwo.getPlayer() != null) && !_playerTwo.getPlayer().isDead())
+ {
+ playerTwoHp = _playerTwo.getPlayer().getCurrentHp() + _playerTwo.getPlayer().getCurrentCp();
+ if (playerTwoHp < 0.5)
+ {
+ playerTwoHp = 0;
+ }
+ }
+
+ // if players crashed, search if they've relogged
+ _playerOne.updatePlayer();
+ _playerTwo.updatePlayer();
+
+ _damageP1Final += _damageP1;
+ _damageP2Final += _damageP2;
+
+ if (((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline()) && ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline()))
+ {
+ _playerOne.updateStat(COMP_DRAWN, 1);
+ _playerTwo.updateStat(COMP_DRAWN, 1);
+ sm = new SystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
+ stadium.broadcastPacket(sm);
+ }
+ else if ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerOne.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerTwo.getPlayer().sendPacket(loose);
+ round_3_winner = _playerOne.getName();
+ player1Wins += 1;
+ if (round_3_winner.toLowerCase().equalsIgnoreCase(_playerOne.getName()))
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 1, 3, 0));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 1, 3, 0));
+ }
+ else
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 2, 3, 0));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 2, 3, 0));
+ }
+ ThreadPool.schedule(() ->
+ {
+ SkillCaster.triggerCast(_playerOne.getPlayer(), _playerOne.getPlayer(), CommonSkill.OLYMPIAD_WIN.getSkill());
+ }, 2000);
+
+ }
+ else if ((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline() || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP2 > _damageP1) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerTwo.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerOne.getPlayer().sendPacket(loose);
+ round_3_winner = _playerTwo.getName();
+ player2Wins += 1;
+ if (round_3_winner.toLowerCase().equalsIgnoreCase(_playerTwo.getName()))
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 2, 3, 0));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 2, 3, 0));
+ }
+ else
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 1, 3, 0));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 1, 3, 0));
+ }
+ ThreadPool.schedule(() ->
+ {
+ SkillCaster.triggerCast(_playerTwo.getPlayer(), _playerTwo.getPlayer(), CommonSkill.OLYMPIAD_WIN.getSkill());
+ }, 2000);
+ }
+ else
+ {
+ final SystemMessage _tie = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIE);
+ _playerTwo.getPlayer().broadcastPacket(_tie);
+ _playerOne.getPlayer().broadcastPacket(_tie);
+ }
+ resetDamage();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, "Exception on validateRound3Winner(): " + e.getMessage(), e);
+ }
+ }
+
@Override
protected void validateWinner(OlympiadStadium stadium)
{
@@ -342,7 +774,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
ExOlympiadMatchResult result = null;
- boolean tie = false;
+ boolean tie = round_1_winner == null ? true : false;
int winside = 0;
final List list1 = new ArrayList<>(1);
@@ -358,9 +790,9 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
{
pointDiff = 1;
}
- else if (pointDiff > Config.ALT_OLY_MAX_POINTS)
+ else if (pointDiff > Config.OLYMPIAD_MAX_POINTS)
{
- pointDiff = Config.ALT_OLY_MAX_POINTS;
+ pointDiff = Config.OLYMPIAD_MAX_POINTS;
}
int points;
@@ -375,13 +807,13 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
{
try
{
- points = Math.min(playerOnePoints / 3, Config.ALT_OLY_MAX_POINTS);
+ points = Math.min(playerOnePoints / 3, Config.OLYMPIAD_MAX_POINTS);
removePointsFromParticipant(_playerOne, points);
list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints - points, -points));
winside = 2;
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info(_playerOne.getName() + " default," + _playerOne + "," + _playerTwo + ",0,0,0,0," + points + "," + getType());
}
@@ -395,7 +827,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
{
try
{
- points = Math.min(playerTwoPoints / 3, Config.ALT_OLY_MAX_POINTS);
+ points = Math.min(playerTwoPoints / 3, Config.OLYMPIAD_MAX_POINTS);
removePointsFromParticipant(_playerTwo, points);
list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints - points, -points));
@@ -408,7 +840,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
winside = 1;
}
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info(_playerTwo.getName() + " default," + _playerOne + "," + _playerTwo + ",0,0,0,0," + points + "," + getType());
}
@@ -420,11 +852,11 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
}
if (winside == 1)
{
- result = new ExOlympiadMatchResult(tie, winside, list1, list2);
+ result = new ExOlympiadMatchResult(tie, winside, list1, list2, 0, 0, 0);
}
else
{
- result = new ExOlympiadMatchResult(tie, winside, list2, list1);
+ result = new ExOlympiadMatchResult(tie, winside, list2, list1, 0, 0, 0);
}
stadium.broadcastPacket(result);
return;
@@ -449,17 +881,17 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_playerOne.updateStat(COMP_WON, 1);
addPointsToParticipant(_playerOne, pointDiff);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints + pointDiff, pointDiff));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints + pointDiff, pointDiff));
_playerTwo.updateStat(COMP_LOST, 1);
removePointsFromParticipant(_playerTwo, pointDiff);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints - pointDiff, -pointDiff));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints - pointDiff, -pointDiff));
winside = 1;
- rewardParticipant(_playerOne.getPlayer(), Config.ALT_OLY_WINNER_REWARD); // Winner
+ rewardParticipant(_playerOne.getPlayer(), Config.OLYMPIAD_WINNER_REWARD); // Winner
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info(_playerTwo.getName() + " crash," + _playerOne + "," + _playerTwo + ",0,0,0,0," + pointDiff + "," + getType());
}
@@ -475,17 +907,17 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_playerTwo.updateStat(COMP_WON, 1);
addPointsToParticipant(_playerTwo, pointDiff);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints + pointDiff, pointDiff));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints + pointDiff, pointDiff));
_playerOne.updateStat(COMP_LOST, 1);
removePointsFromParticipant(_playerOne, pointDiff);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints - pointDiff, -pointDiff));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints - pointDiff, -pointDiff));
winside = 2;
- rewardParticipant(_playerTwo.getPlayer(), Config.ALT_OLY_WINNER_REWARD); // Winner
+ rewardParticipant(_playerTwo.getPlayer(), Config.OLYMPIAD_WINNER_REWARD); // Winner
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info(_playerOne.getName() + " crash," + _playerOne + "," + _playerTwo + ",0,0,0,0," + pointDiff + "," + getType());
}
@@ -498,15 +930,15 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_playerOne.updateStat(COMP_LOST, 1);
removePointsFromParticipant(_playerOne, pointDiff);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints - pointDiff, -pointDiff));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints - pointDiff, -pointDiff));
_playerTwo.updateStat(COMP_LOST, 1);
removePointsFromParticipant(_playerTwo, pointDiff);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints - pointDiff, -pointDiff));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints - pointDiff, -pointDiff));
tie = true;
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info("both crash," + _playerOne.getName() + "," + _playerOne + ",0,0,0,0," + _playerTwo + "," + pointDiff + "," + getType());
}
@@ -519,11 +951,11 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
if (winside == 1)
{
- result = new ExOlympiadMatchResult(tie, winside, list1, list2);
+ result = new ExOlympiadMatchResult(tie, winside, list1, list2, 0, 0, 0);
}
else
{
- result = new ExOlympiadMatchResult(tie, winside, list2, list1);
+ result = new ExOlympiadMatchResult(tie, winside, list2, list1, 0, 0, 0);
}
stadium.broadcastPacket(result);
@@ -577,7 +1009,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
sm = new SystemMessage(SystemMessageId.THERE_IS_NO_VICTOR_THE_MATCH_ENDS_IN_A_TIE);
stadium.broadcastPacket(sm);
}
- else if ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
+ else if ((player1Wins == 2) || (_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
{
sm = new SystemMessage(SystemMessageId.CONGRATULATIONS_C1_YOU_WIN_THE_MATCH);
sm.addString(_playerOne.getName());
@@ -587,10 +1019,10 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_playerTwo.updateStat(COMP_LOST, 1);
addPointsToParticipant(_playerOne, pointDiff);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints + pointDiff, pointDiff));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints + pointDiff, pointDiff));
removePointsFromParticipant(_playerTwo, pointDiff);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints - pointDiff, -pointDiff));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints - pointDiff, -pointDiff));
winner = _playerOne.getName() + " won";
winside = 1;
@@ -598,13 +1030,13 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
// Save Fight Result
saveResults(_playerOne, _playerTwo, 1, _startTime, _fightTime, getType());
- rewardParticipant(_playerOne.getPlayer(), Config.ALT_OLY_WINNER_REWARD); // Winner
- rewardParticipant(_playerTwo.getPlayer(), Config.ALT_OLY_LOSER_REWARD); // Loser
+ rewardParticipant(_playerOne.getPlayer(), Config.OLYMPIAD_WINNER_REWARD); // Winner
+ rewardParticipant(_playerTwo.getPlayer(), Config.OLYMPIAD_LOSER_REWARD); // Loser
// Notify to scripts
EventDispatcher.getInstance().notifyEventAsync(new OnOlympiadMatchResult(_playerOne, _playerTwo, getType()), Olympiad.getInstance());
}
- else if ((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline() || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
+ else if ((player2Wins == 2) || (_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline() || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
{
sm = new SystemMessage(SystemMessageId.CONGRATULATIONS_C1_YOU_WIN_THE_MATCH);
sm.addString(_playerTwo.getName());
@@ -614,10 +1046,10 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_playerOne.updateStat(COMP_LOST, 1);
addPointsToParticipant(_playerTwo, pointDiff);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints + pointDiff, pointDiff));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints + pointDiff, pointDiff));
removePointsFromParticipant(_playerOne, pointDiff);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints - pointDiff, -pointDiff));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints - pointDiff, -pointDiff));
winner = _playerTwo.getName() + " won";
winside = 2;
@@ -625,8 +1057,8 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
// Save Fight Result
saveResults(_playerOne, _playerTwo, 2, _startTime, _fightTime, getType());
- rewardParticipant(_playerTwo.getPlayer(), Config.ALT_OLY_WINNER_REWARD); // Winner
- rewardParticipant(_playerOne.getPlayer(), Config.ALT_OLY_LOSER_REWARD); // Loser
+ rewardParticipant(_playerTwo.getPlayer(), Config.OLYMPIAD_WINNER_REWARD); // Winner
+ rewardParticipant(_playerOne.getPlayer(), Config.OLYMPIAD_LOSER_REWARD); // Loser
// Notify to scripts
EventDispatcher.getInstance().notifyEventAsync(new OnOlympiadMatchResult(_playerTwo, _playerOne, getType()), Olympiad.getInstance());
@@ -639,14 +1071,14 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
sm = new SystemMessage(SystemMessageId.THERE_IS_NO_VICTOR_THE_MATCH_ENDS_IN_A_TIE);
stadium.broadcastPacket(sm);
- int value = Math.min(playerOnePoints / getDivider(), Config.ALT_OLY_MAX_POINTS);
+ int value = Math.min(playerOnePoints / getDivider(), Config.OLYMPIAD_MAX_POINTS);
removePointsFromParticipant(_playerOne, value);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints - value, -value));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints - value, -value));
- value = Math.min(playerTwoPoints / getDivider(), Config.ALT_OLY_MAX_POINTS);
+ value = Math.min(playerTwoPoints / getDivider(), Config.OLYMPIAD_MAX_POINTS);
removePointsFromParticipant(_playerTwo, value);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints - value, -value));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints - value, -value));
tie = true;
}
@@ -658,15 +1090,16 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
if (winside == 1)
{
- result = new ExOlympiadMatchResult(tie, winside, list1, list2);
+ result = new ExOlympiadMatchResult(tie, winside, list1, list2, round_1_winner.equalsIgnoreCase(_playerOne.getName()) ? 2 : 3, round_2_winner.equalsIgnoreCase(_playerOne.getName()) ? 2 : 3, (round_3_winner != null) && round_3_winner.equalsIgnoreCase(_playerOne.getName()) ? 2 : (round_3_winner == null) ? 0 : 3);
}
else
{
- result = new ExOlympiadMatchResult(tie, winside, list2, list1);
+ result = new ExOlympiadMatchResult(tie, winside, list2, list1, round_1_winner.equalsIgnoreCase(_playerTwo.getName()) ? 3 : 2, round_2_winner.equalsIgnoreCase(_playerTwo.getName()) ? 3 : 2, (round_3_winner != null) && round_3_winner.equalsIgnoreCase(_playerTwo.getName()) ? 3 : (round_3_winner == null) ? 0 : 2);
}
+
stadium.broadcastPacket(result);
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info(winner + "," + _playerOne.getName() + "," + _playerOne + "," + _playerTwo + "," + playerOneHp + "," + playerTwoHp + "," + _damageP1 + "," + _damageP2 + "," + pointDiff + "," + getType());
}
@@ -750,6 +1183,13 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_damageP2 = 0;
}
+ @Override
+ public void resetDamageFinal()
+ {
+ _damageP1Final = 0;
+ _damageP2Final = 0;
+ }
+
protected void saveResults(Participant one, Participant two, int winner, long startTime, long fightTime, CompetitionType type)
{
try (Connection con = DatabaseFactory.getConnection();
@@ -791,6 +1231,47 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
}
}
+ @Override
+ protected void buffPlayers()
+ {
+ final Player player1 = _playerOne.getPlayer();
+ if (player1 != null)
+ {
+ SkillCaster.triggerCast(player1, player1, CommonSkill.OLYMPIAD_HORN_MELODY.getSkill());
+ SkillCaster.triggerCast(player1, player1, CommonSkill.OLYMPIAD_DRUM_MELODY.getSkill());
+ SkillCaster.triggerCast(player1, player1, CommonSkill.OLYMPIAD_PIPE_ORGAN_MELODY.getSkill());
+ SkillCaster.triggerCast(player1, player1, CommonSkill.OLYMPIAD_GUITAR_MELODY.getSkill());
+ SkillCaster.triggerCast(player1, player1, CommonSkill.OLYMPIAD_HARMONY.getSkill());
+ }
+
+ final Player player2 = _playerTwo.getPlayer();
+ if (player2 != null)
+ {
+ SkillCaster.triggerCast(player2, player2, CommonSkill.OLYMPIAD_HORN_MELODY.getSkill());
+ SkillCaster.triggerCast(player2, player2, CommonSkill.OLYMPIAD_DRUM_MELODY.getSkill());
+ SkillCaster.triggerCast(player2, player2, CommonSkill.OLYMPIAD_PIPE_ORGAN_MELODY.getSkill());
+ SkillCaster.triggerCast(player2, player2, CommonSkill.OLYMPIAD_GUITAR_MELODY.getSkill());
+ SkillCaster.triggerCast(player2, player2, CommonSkill.OLYMPIAD_HARMONY.getSkill());
+ }
+ }
+
+ @Override
+ protected void roundTwoCleanUp()
+ {
+ ThreadPool.schedule(() ->
+ {
+ if ((_playerOne.getPlayer() != null) && !_playerOne.isDefaulted() && !_playerOne.isDisconnected() && (_playerOne.getPlayer().getOlympiadGameId() == _stadiumId))
+ {
+ roundTwoClean(_playerOne.getPlayer());
+ }
+
+ if ((_playerTwo.getPlayer() != null) && !_playerTwo.isDefaulted() && !_playerTwo.isDisconnected() && (_playerTwo.getPlayer().getOlympiadGameId() == _stadiumId))
+ {
+ roundTwoClean(_playerTwo.getPlayer());
+ }
+ }, 1000);
+ }
+
@Override
protected void untransformPlayers()
{
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameState.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameState.java
index f5706a922a..074be05d14 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameState.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameState.java
@@ -24,7 +24,13 @@ enum OlympiadGameState
BATTLE_COUNTDOWN_FIRST,
BATTLE_COUNTDOWN_SECOND,
BATTLE_STARTED,
+ ROUND_1,
+ WAIT_TIME_1,
+ ROUND_2,
+ WAIT_TIME_2,
+ ROUND_3,
BATTLE_IN_PROGRESS,
+ ROUND_ENDED,
GAME_STOPPED,
TELEPORT_TO_TOWN,
CLEANUP,
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
index 119ffc6e4b..bc836c6359 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
@@ -23,6 +23,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchInfo;
/**
* @author DS
@@ -116,7 +117,7 @@ public class OlympiadGameTask implements Runnable
public boolean isBattleStarted()
{
- return _state == OlympiadGameState.BATTLE_IN_PROGRESS;
+ return (_state == OlympiadGameState.BATTLE_IN_PROGRESS) || (_state == OlympiadGameState.ROUND_2) || (_state == OlympiadGameState.ROUND_3);
}
public boolean isBattleFinished()
@@ -163,6 +164,8 @@ public class OlympiadGameTask implements Runnable
{
try
{
+ final String player1 = _game.getPlayerNames()[0];
+ final String player2 = _game.getPlayerNames()[1];
int delay = 1; // schedule next call after 1s
switch (_state)
{
@@ -170,7 +173,7 @@ public class OlympiadGameTask implements Runnable
case BEGIN:
{
_state = OlympiadGameState.TELEPORT_TO_ARENA;
- _countDown = Config.ALT_OLY_WAIT_TIME;
+ _countDown = Config.OLYMPIAD_WAIT_TIME;
break;
}
// Teleport to arena countdown
@@ -198,6 +201,7 @@ public class OlympiadGameTask implements Runnable
// Game start, port players to arena
case GAME_STARTED:
{
+ _stadium.makeZonePvPForCharsInside(false);
if (!startGame())
{
_state = OlympiadGameState.GAME_STOPPED;
@@ -215,7 +219,7 @@ public class OlympiadGameTask implements Runnable
{
if (_countDown > 0)
{
- if (_countDown == 55) // 55sec
+ if (_countDown == 50) // 55sec
{
_game.healPlayers();
}
@@ -232,6 +236,7 @@ public class OlympiadGameTask implements Runnable
{
_game.makePlayersInvul();
_game.resetDamage();
+ _game.resetDamageFinal();
_stadium.openDoors();
_state = OlympiadGameState.BATTLE_COUNTDOWN_SECOND;
@@ -255,15 +260,33 @@ public class OlympiadGameTask implements Runnable
{
_state = OlympiadGameState.BATTLE_STARTED;
_game.removePlayersInvul();
- _stadium.broadcastPacket(new SystemMessage(SystemMessageId.HIDDEN_MSG_START_OLYMPIAD));
}
break;
}
// Beginning of the battle
case BATTLE_STARTED:
{
- _countDown = 0;
+ _countDown = (int) Config.OLYMPIAD_BATTLE / 1000;
+
+ _game.broadcastPacket(new ExOlympiadMatchInfo(player1, player2, 0, 0, 1, 100));
+
+ final SystemMessage round1 = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_ROUND_1);
+ _stadium.broadcastPacket(round1);
+ final SystemMessage start = new SystemMessage(SystemMessageId.HIDDEN_MSG_START_OLYMPIAD);
+ _stadium.broadcastPacket(start);
+ _game.broadcastOlympiadInfo(_stadium);
+ _state = OlympiadGameState.ROUND_1; // set state first, used in zone update
+ if (!startBattle())
+ {
+ _state = OlympiadGameState.GAME_STOPPED;
+ }
+ break;
+ }
+ case ROUND_1:
+ {
_state = OlympiadGameState.BATTLE_IN_PROGRESS; // set state first, used in zone update
+ _countDown = (int) Config.OLYMPIAD_BATTLE / 1000;
+ _stadium.makeZonePvPForCharsInside(true);
if (!startBattle())
{
_state = OlympiadGameState.GAME_STOPPED;
@@ -273,8 +296,8 @@ public class OlympiadGameTask implements Runnable
// Checks during battle
case BATTLE_IN_PROGRESS:
{
- _countDown += 1000;
- final int remaining = (int) ((Config.ALT_OLY_BATTLE - _countDown) / 1000);
+ _countDown -= 1;
+ final int remaining = (int) Config.OLYMPIAD_BATTLE / 1000;
for (int announceTime : BATTLE_END_TIME_SECOND)
{
if (announceTime == remaining)
@@ -285,13 +308,122 @@ public class OlympiadGameTask implements Runnable
break;
}
}
-
- if (checkBattle() || (_countDown > Config.ALT_OLY_BATTLE))
+ if (roundCheck() || (_countDown <= 0))
+ {
+ round1();
+ _game.makePlayersInvul();
+ _state = OlympiadGameState.WAIT_TIME_1;
+ _stadium.makeZonePvPForCharsInside(false);
+ _countDown = 20;
+ }
+ else if (checkBattle())
{
_state = OlympiadGameState.GAME_STOPPED;
}
break;
}
+ case WAIT_TIME_1:
+ {
+ _countDown -= 1;
+ if (_countDown == 14)
+ {
+ _game.buffPlayers();
+ _game.portPlayersToSpots(_stadium.getZone().getSpawns(), _stadium.getInstance());
+ _game.broadcastOlympiadInfo(_stadium);
+ }
+ if (_countDown <= 0)
+ {
+ _game.removePlayersInvul();
+ _state = OlympiadGameState.ROUND_2;
+ _countDown = (int) Config.OLYMPIAD_BATTLE / 1000;
+ final SystemMessage round2 = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_ROUND_2);
+ _stadium.broadcastPacket(round2);
+ final SystemMessage start = new SystemMessage(SystemMessageId.HIDDEN_MSG_START_OLYMPIAD);
+ _stadium.broadcastPacket(start);
+ _stadium.makeZonePvPForCharsInside(true);
+ _game.broadcastOlympiadInfo(_stadium);
+ }
+ break;
+ }
+ case ROUND_2:
+ {
+ _countDown -= 1;
+ final int remaining = (int) Config.OLYMPIAD_BATTLE / 1000;
+ for (int announceTime : BATTLE_END_TIME_SECOND)
+ {
+ if (announceTime == remaining)
+ {
+ final SystemMessage sm = new SystemMessage(SystemMessageId.THE_GAME_WILL_END_IN_S1_SECOND_S);
+ sm.addInt(announceTime);
+ _stadium.broadcastPacket(sm);
+ break;
+ }
+ }
+ if (roundCheck() || (_countDown <= 0))
+ {
+ round2();
+ if (_game.isMatchEnd())
+ {
+ _state = OlympiadGameState.GAME_STOPPED;
+ break;
+ }
+ _state = OlympiadGameState.WAIT_TIME_2;
+ _game.makePlayersInvul();
+ _stadium.makeZonePvPForCharsInside(false);
+ _countDown = 20;
+ }
+ else if (checkBattle())
+ {
+ _state = OlympiadGameState.GAME_STOPPED;
+ }
+ break;
+ }
+ case WAIT_TIME_2:
+ {
+ _countDown -= 1;
+ if (_countDown == 14)
+ {
+ _game.buffPlayers();
+ _game.roundTwoCleanUp();
+ _game.broadcastOlympiadInfo(_stadium);
+ _game.portPlayersToSpots(_stadium.getZone().getSpawns(), _stadium.getInstance());
+ }
+ if (_countDown <= 0)
+ {
+ _state = OlympiadGameState.ROUND_3;
+ _game.removePlayersInvul();
+ _countDown = (int) Config.OLYMPIAD_BATTLE / 1000;
+ final SystemMessage round2 = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_ROUND_3);
+ _stadium.broadcastPacket(round2);
+ final SystemMessage start = new SystemMessage(SystemMessageId.HIDDEN_MSG_START_OLYMPIAD);
+ _stadium.broadcastPacket(start);
+ _stadium.makeZonePvPForCharsInside(true);
+ _game.broadcastOlympiadInfo(_stadium);
+ }
+ break;
+ }
+ case ROUND_3:
+ {
+ _countDown -= 1;
+ final int remaining = (int) Config.OLYMPIAD_BATTLE / 1000;
+ for (int announceTime : BATTLE_END_TIME_SECOND)
+ {
+ if (announceTime == remaining)
+ {
+ final SystemMessage sm = new SystemMessage(SystemMessageId.THE_GAME_WILL_END_IN_S1_SECOND_S);
+ sm.addInt(announceTime);
+ _stadium.broadcastPacket(sm);
+ break;
+ }
+ }
+ if (roundCheck() || (_countDown <= 0) || checkBattle())
+ {
+ round3();
+ _game.makePlayersInvul();
+ _stadium.makeZonePvPForCharsInside(false);
+ }
+ break;
+ }
// End of the battle
case GAME_STOPPED:
{
@@ -425,7 +557,7 @@ public class OlympiadGameTask implements Runnable
{
// game successfully started
_game.broadcastOlympiadInfo(_stadium);
- _stadium.broadcastPacket(new SystemMessage(SystemMessageId.THE_MATCH_HAS_STARTED_FIGHT));
+ // _stadium.broadcastPacket(new SystemMessage(SystemMessageId.THE_MATCH_HAS_STARTED_FIGHT));
_stadium.updateZoneStatusForCharactersInside();
return true;
}
@@ -437,6 +569,82 @@ public class OlympiadGameTask implements Runnable
return false;
}
+ private boolean roundCheck()
+ {
+ try
+ {
+ return _game.roundWinner();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+ return true;
+ }
+
+ private void round1()
+ {
+ try
+ {
+ _game.validateRound1Winner(_stadium);
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+ }
+
+ private void round2()
+ {
+ try
+ {
+ _game.validateRound2Winner(_stadium);
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+ }
+
+ private void round3()
+ {
+ try
+ {
+ _game.validateRound3Winner(_stadium);
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+
+ try
+ {
+ _game.makePlayersInvul();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+
+ try
+ {
+ _stadium.updateZoneStatusForCharactersInside();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+
+ try
+ {
+ _state = OlympiadGameState.GAME_STOPPED;
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+ }
+
/**
* Fifth stage: battle is running, returns true if winner found.
* @return
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadManager.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadManager.java
index ccd9b3ab60..350e13e788 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadManager.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadManager.java
@@ -45,11 +45,6 @@ public class OlympiadManager
{
}
- public static OlympiadManager getInstance()
- {
- return SingletonHolder.INSTANCE;
- }
-
public Set getRegisteredNonClassBased()
{
return _nonClassBasedRegisters;
@@ -65,7 +60,7 @@ public class OlympiadManager
List> result = null;
for (Entry> classList : _classBasedRegisters.entrySet())
{
- if ((classList.getValue() != null) && (classList.getValue().size() >= Config.ALT_OLY_CLASSED))
+ if ((classList.getValue() != null) && (classList.getValue().size() >= Config.OLYMPIAD_CLASSED))
{
if (result == null)
{
@@ -80,7 +75,7 @@ public class OlympiadManager
protected final boolean hasEnoughRegisteredNonClassed()
{
- return _nonClassBasedRegisters.size() >= Config.ALT_OLY_NONCLASSED;
+ return _nonClassBasedRegisters.size() >= Config.OLYMPIAD_NONCLASSED;
}
protected final void clearRegistered()
@@ -341,11 +336,6 @@ public class OlympiadManager
return _nonClassBasedRegisters.size() + _classBasedRegisters.size();
}
- private static class SingletonHolder
- {
- protected static final OlympiadManager INSTANCE = new OlympiadManager();
- }
-
private int getClassGroup(Player player)
{
if (player.isInCategory(CategoryType.SIXTH_TIR_GROUP))
@@ -389,4 +379,14 @@ public class OlympiadManager
return player.getBaseClass();
}
}
+
+ public static OlympiadManager getInstance()
+ {
+ return SingletonHolder.INSTANCE;
+ }
+
+ private static class SingletonHolder
+ {
+ protected static final OlympiadManager INSTANCE = new OlympiadManager();
+ }
}
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java
index 187c1f71be..04c582b581 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java
@@ -31,11 +31,9 @@ import org.l2jmobius.gameserver.model.actor.instance.Door;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.model.zone.type.OlympiadStadiumZone;
-import org.l2jmobius.gameserver.network.SystemMessageId;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchEnd;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadUserInfo;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
-import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchEnd;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadUserInfo;
/**
* @author JIV
@@ -127,6 +125,32 @@ public class OlympiadStadium
}
}
+ public void makeZonePvPForCharsInside(boolean value)
+ {
+ if (_task == null)
+ {
+ return;
+ }
+ if (value)
+ {
+ for (Player player : _instance.getPlayers())
+ {
+ player.setInsideZone(ZoneId.PVP, true);
+ player.setOlympiadStart(true);
+ _task.getGame().sendOlympiadInfo(player);
+ }
+ }
+ else
+ {
+ for (Player player : _instance.getPlayers())
+ {
+ player.setInsideZone(ZoneId.PVP, false);
+ player.setOlympiadStart(false);
+ _task.getGame().sendOlympiadInfo(player);
+ }
+ }
+ }
+
public void updateZoneStatusForCharactersInside()
{
if (_task == null)
@@ -135,15 +159,16 @@ public class OlympiadStadium
}
final boolean battleStarted = _task.isBattleStarted();
- final SystemMessage sm;
- if (battleStarted)
- {
- sm = new SystemMessage(SystemMessageId.YOU_HAVE_ENTERED_A_COMBAT_ZONE);
- }
- else
- {
- sm = new SystemMessage(SystemMessageId.YOU_HAVE_LEFT_A_COMBAT_ZONE);
- }
+ final boolean battleEnded = _task.isBattleFinished();
+ // final SystemMessage sm;
+ // if (battleStarted)
+ // {
+ // sm = new SystemMessage(SystemMessageId.YOU_HAVE_ENTERED_A_COMBAT_ZONE);
+ // }
+ // else
+ // {
+ // sm = new SystemMessage(SystemMessageId.YOU_HAVE_LEFT_A_COMBAT_ZONE);
+ // }
for (Player player : _instance.getPlayers())
{
@@ -155,12 +180,16 @@ public class OlympiadStadium
if (battleStarted)
{
player.setInsideZone(ZoneId.PVP, true);
- player.sendPacket(sm);
+ // player.sendPacket(sm);
}
else
{
player.setInsideZone(ZoneId.PVP, false);
- player.sendPacket(sm);
+ // player.sendPacket(sm);
+ // player.sendPacket(ExOlympiadMatchEnd.STATIC_PACKET);
+ }
+ if (battleEnded)
+ {
player.sendPacket(ExOlympiadMatchEnd.STATIC_PACKET);
}
}
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/skill/CommonSkill.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/skill/CommonSkill.java
index 079965b961..7f9e28d2cc 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/skill/CommonSkill.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/skill/CommonSkill.java
@@ -71,7 +71,13 @@ public enum CommonSkill
EINHASAD_OVERSEEING_3(29413, 3),
EINHASAD_OVERSEEING_4(29413, 4),
EINHASAD_CHAINS(29414, 1),
- TELEPORTATION_CUBE(39723, 1);
+ TELEPORTATION_CUBE(39723, 1),
+ OLYMPIAD_HORN_MELODY(32411, 1),
+ OLYMPIAD_DRUM_MELODY(32412, 1),
+ OLYMPIAD_PIPE_ORGAN_MELODY(32413, 1),
+ OLYMPIAD_GUITAR_MELODY(32414, 1),
+ OLYMPIAD_HARMONY(32415, 1),
+ OLYMPIAD_WIN(32417, 1);
private final SkillHolder _holder;
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/skill/SkillCaster.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/skill/SkillCaster.java
index 55974d3b0b..71ad62881a 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/skill/SkillCaster.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/skill/SkillCaster.java
@@ -130,11 +130,16 @@ public class SkillCaster implements Runnable
*/
public static SkillCaster castSkill(Creature caster, WorldObject target, Skill skill, Item item, SkillCastingType castingType, boolean ctrlPressed, boolean shiftPressed)
{
- // Prevent players from attacking before the Olympiad countdown ends. Olympiad Manager NPC is excluded.
if (caster.isPlayer() && caster.getActingPlayer().isInOlympiadMode() && !caster.getActingPlayer().isOlympiadStart() && skill.isBad() && (target != null) && (target.getId() != 36402))
{
return null;
}
+ // Prevent players from attacking before the Olympiad countdown ends. Olympiad Manager NPC is excluded.
+ if (caster.isPlayer() && caster.getActingPlayer().isInOlympiadMode() && !caster.getActingPlayer().isOlympiadStart() && skill.isBad())
+ {
+ return null;
+ }
+
return castSkill(caster, target, skill, item, castingType, ctrlPressed, shiftPressed, -1);
}
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java
index 292794ad91..3dafff1f02 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java
@@ -133,16 +133,16 @@ public interface IStatFunction
{
if (item.isWeapon())
{
- if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT))
+ if ((Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT))
{
- enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT;
+ enchant = Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT;
}
}
else
{
- if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT))
+ if ((Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT))
{
- enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT;
+ enchant = Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT;
}
}
}
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java
index 1bd9892a87..2aa14eb946 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java
@@ -71,6 +71,7 @@ public class PlayerVariables extends AbstractVariables
public static final String HUNTING_ZONE_ENTRY = "HUNTING_ZONE_ENTRY_";
public static final String HUNTING_ZONE_TIME = "HUNTING_ZONE_TIME_";
public static final String HUNTING_ZONE_REMAIN_REFILL = "HUNTING_ZONE_REMAIN_REFILL_";
+ public static final String IS_LEGEND = "IS_LEGEND";
public static final String FAVORITE_TELEPORTS = "FAVORITE_TELEPORTS";
public static final String HOMUNCULUS_HP_POINTS = "HOMUNCULUS_HP_POINTS";
public static final String HOMUNCULUS_SP_POINTS = "HOMUNCULUS_SP_POINTS";
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java
index 1d54eaef7f..6b6bafd8ae 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java
@@ -34,7 +34,7 @@ import org.l2jmobius.gameserver.model.zone.AbstractZoneSettings;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.model.zone.ZoneRespawn;
import org.l2jmobius.gameserver.network.SystemMessageId;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchEnd;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchEnd;
/**
* An olympiad stadium
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java
index 6f20378cd0..f72cde3e9c 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java
@@ -108,6 +108,12 @@ import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeAdd
import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeWaitingList;
import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMentorCancel;
import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMentorList;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.OlympiadMatchMaking;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.OlympiadMatchMakingCancel;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.OlympiadUI;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.RequestExOlympiadMatchListRefresh;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.RequestOlympiadMatchList;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.RequestOlympiadObserverEnd;
import org.l2jmobius.gameserver.network.clientpackets.pk.RequestExPkPenaltyList;
import org.l2jmobius.gameserver.network.clientpackets.pk.RequestExPkPenaltyListOnlyLoc;
import org.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeAnnounce;
@@ -537,8 +543,8 @@ public enum ExIncomingPackets implements IIncomingPackets
EX_PAYBACK_LIST(0x175, null, ConnectionState.IN_GAME),
EX_PAYBACK_GIVE_REWARD(0x176, null, ConnectionState.IN_GAME),
EX_AUTOPLAY_SETTING(0x177, ExAutoPlaySetting::new, ConnectionState.IN_GAME),
- EX_OLYMPIAD_MATCH_MAKING(0x178, null, ConnectionState.IN_GAME),
- EX_OLYMPIAD_MATCH_MAKING_CANCEL(0x179, null, ConnectionState.IN_GAME),
+ EX_OLYMPIAD_MATCH_MAKING(0x178, OlympiadMatchMaking::new, ConnectionState.IN_GAME),
+ EX_OLYMPIAD_MATCH_MAKING_CANCEL(0x179, OlympiadMatchMakingCancel::new, ConnectionState.IN_GAME),
EX_FESTIVAL_BM_INFO(0x17A, null, ConnectionState.IN_GAME),
EX_FESTIVAL_BM_GAME(0x17B, null, ConnectionState.IN_GAME),
EX_GACHA_SHOP_INFO(0x17C, null, ConnectionState.IN_GAME),
@@ -577,7 +583,7 @@ public enum ExIncomingPackets implements IIncomingPackets
EX_CRAFT_RANDOM_MAKE(0x19D, null, ConnectionState.IN_GAME),
EX_MULTI_SELL_LIST(0x19E, null, ConnectionState.IN_GAME),
EX_SAVE_ITEM_ANNOUNCE_SETTING(0x19F, ExSaveItemAnnounceSetting::new, ConnectionState.IN_GAME),
- EX_OLYMPIAD_UI(0x1A0, null, ConnectionState.IN_GAME),
+ EX_OLYMPIAD_UI(0x1A0, OlympiadUI::new, ConnectionState.IN_GAME),
// 270
EX_SHARED_POSITION_SHARING_UI(0x1A1, null, ConnectionState.IN_GAME),
EX_SHARED_POSITION_TELEPORT_UI(0x1A2, null, ConnectionState.IN_GAME),
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
index 94423f57ad..9422a2e0ac 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
@@ -55,6 +55,7 @@ import org.l2jmobius.gameserver.model.item.ItemTemplate;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.item.type.EtcItemType;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
+import org.l2jmobius.gameserver.model.olympiad.Olympiad;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentType;
import org.l2jmobius.gameserver.model.quest.Quest;
@@ -119,6 +120,7 @@ import org.l2jmobius.gameserver.network.serverpackets.friend.L2FriendList;
import org.l2jmobius.gameserver.network.serverpackets.homunculus.ExHomunculusPointInfo;
import org.l2jmobius.gameserver.network.serverpackets.homunculus.ExHomunculusReady;
import org.l2jmobius.gameserver.network.serverpackets.homunculus.ExShowHomunculusBirthInfo;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadInfo;
import org.l2jmobius.gameserver.network.serverpackets.settings.ExItemAnnounceSetting;
import org.l2jmobius.gameserver.util.BuilderUtil;
@@ -640,6 +642,12 @@ public class EnterWorld implements IClientIncomingPacket
player.sendMessage("Experience gain is disabled.");
}
+ // Send packet that olympiad is opened.
+ if (Config.OLYMPIAD_ENABLED && Olympiad.getInstance().inCompPeriod())
+ {
+ player.sendPacket(new ExOlympiadInfo(1));
+ }
+
player.updateSymbolSealSkills();
player.broadcastUserInfo();
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java
new file mode 100644
index 0000000000..5cfad5d67f
--- /dev/null
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java
@@ -0,0 +1,47 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.network.GameClient;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchMakingResult;
+
+public class OlympiadMatchMaking implements IClientIncomingPacket
+{
+ private byte _gameRuleType;
+
+ @Override
+ public boolean read(GameClient client, PacketReader packet)
+ {
+ _gameRuleType = (byte) packet.readC();
+ return true;
+ }
+
+ @Override
+ public void run(GameClient client)
+ {
+ final Player player = client.getPlayer();
+ if (player == null)
+ {
+ return;
+ }
+
+ player.sendPacket(new ExOlympiadMatchMakingResult(_gameRuleType, 1));
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java
new file mode 100644
index 0000000000..e165096e42
--- /dev/null
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java
@@ -0,0 +1,47 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.network.GameClient;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchMakingResult;
+
+public class OlympiadMatchMakingCancel implements IClientIncomingPacket
+{
+ private byte _gameRuleType;
+
+ @Override
+ public boolean read(GameClient client, PacketReader packet)
+ {
+ _gameRuleType = (byte) packet.readC();
+ return true;
+ }
+
+ @Override
+ public void run(GameClient client)
+ {
+ final Player player = client.getPlayer();
+ if (player == null)
+ {
+ return;
+ }
+
+ player.sendPacket(new ExOlympiadMatchMakingResult(_gameRuleType, 0));
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java
new file mode 100644
index 0000000000..d9c5d35f53
--- /dev/null
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java
@@ -0,0 +1,49 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.network.GameClient;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadRecord;
+
+public class OlympiadUI implements IClientIncomingPacket
+{
+ private byte _gameRuleType;
+ private int _type;
+
+ @Override
+ public boolean read(GameClient client, PacketReader packet)
+ {
+ _gameRuleType = (byte) packet.readC();
+ _type = packet.readD();
+ return true;
+ }
+
+ @Override
+ public void run(GameClient client)
+ {
+ final Player player = client.getPlayer();
+ if (player == null)
+ {
+ return;
+ }
+
+ player.sendPacket(new ExOlympiadRecord(player, _gameRuleType, _type));
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestExOlympiadMatchListRefresh.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java
similarity index 82%
rename from L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestExOlympiadMatchListRefresh.java
rename to L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java
index b858084554..5ee47636f7 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestExOlympiadMatchListRefresh.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java
@@ -14,12 +14,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.clientpackets;
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.network.GameClient;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchList;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchList;
/**
* Format: (ch)d d: unknown (always 0?)
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadMatchList.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java
similarity index 89%
rename from L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadMatchList.java
rename to L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java
index 9f3cb709cf..7a9752b083 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadMatchList.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java
@@ -14,13 +14,14 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.clientpackets;
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.handler.BypassHandler;
import org.l2jmobius.gameserver.handler.IBypassHandler;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.network.GameClient;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
/**
* format ch c: (id) 0xD0 h: (subid) 0x13
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadObserverEnd.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java
similarity index 87%
rename from L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadObserverEnd.java
rename to L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java
index 24d5719bd4..255d11e91d 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadObserverEnd.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java
@@ -14,11 +14,12 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.clientpackets;
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.network.GameClient;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
/**
* format ch c: (id) 0xD0 h: (subid) 0x12
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java
index 762e2d3462..8bec7231d2 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java
@@ -196,7 +196,7 @@ public class CharInfo implements IClientOutgoingPacket
packet.writeC(_player.getTeam().getId()); // Confirmed
packet.writeD(_player.getClanCrestLargeId());
packet.writeC(_player.getNobleLevel()); // Confirmed
- packet.writeC(_player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 2 : 0); // 152 - Value for enabled changed to 2?
+ packet.writeC(_player.isLegend() ? 4 : _player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 2 : 0); // 152 - Value for enabled changed to 2? 4 = legend
packet.writeC(_player.isFishing() ? 1 : 0); // Confirmed
final ILocational baitLocation = _player.getFishing().getBaitLocation();
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java
index 2476a2271a..0fe0c9375f 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java
@@ -296,7 +296,7 @@ public class UserInfo extends AbstractMaskPacket
packet.writeC(_player.getPvpFlag());
packet.writeD(_player.getReputation()); // Reputation
packet.writeC(_player.getNobleLevel());
- packet.writeC(_player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 2 : 0); // 152 - Value for enabled changed to 2?
+ packet.writeC(_player.isLegend() ? 4 : _player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 2 : 0); // 152 - Value for enabled changed to 2? 4 = legend
packet.writeC(_player.getPledgeClass());
packet.writeD(_player.getPkKills());
packet.writeD(_player.getPvpKills());
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java
new file mode 100644
index 0000000000..b541ddf502
--- /dev/null
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java
@@ -0,0 +1,41 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+public class ExOlympiadInfo implements IClientOutgoingPacket
+{
+ private static int _open;
+
+ public ExOlympiadInfo(int open)
+ {
+ _open = open;
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_OLYMPIAD_INFO.writeId(packet);
+ packet.writeC(_open);
+ packet.writeD(0); // RemainTime
+ packet.writeC(1); // GameRuleType
+ return true;
+ }
+}
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchEnd.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java
similarity index 86%
rename from L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchEnd.java
rename to L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java
index ba3c0cfeaa..e64d402782 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchEnd.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java
@@ -14,10 +14,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author GodKratos
@@ -36,4 +37,4 @@ public class ExOlympiadMatchEnd implements IClientOutgoingPacket
OutgoingPackets.EX_OLYMPIAD_MATCH_END.writeId(packet);
return true;
}
-}
+}
\ No newline at end of file
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java
new file mode 100644
index 0000000000..25335ef371
--- /dev/null
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java
@@ -0,0 +1,57 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+/**
+ * @author Mobius
+ */
+public class ExOlympiadMatchInfo implements IClientOutgoingPacket
+{
+ private final String _name1;
+ private final String _name2;
+ private final int _wins1;
+ private final int _wins2;
+ private final int _round;
+ private final int _time;
+
+ public ExOlympiadMatchInfo(String name1, String name2, int wins1, int wins2, int round, int time)
+ {
+ _name1 = name1;
+ _name2 = name2;
+ _wins1 = wins1;
+ _wins2 = wins2;
+ _round = round;
+ _time = time;
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_OLYMPIAD_MATCH_INFO.writeId(packet);
+ packet.writeS(String.format("%1$-" + 23 + "s", _name2));
+ packet.writeD(_wins2);
+ packet.writeS(String.format("%1$-" + 23 + "s", _name1));
+ packet.writeD(_wins1);
+ packet.writeD(_round);
+ packet.writeD(_time); // Seconds
+ return true;
+ }
+}
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java
new file mode 100644
index 0000000000..1d7653e028
--- /dev/null
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java
@@ -0,0 +1,37 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+public class ExOlympiadMatchInfoEnd implements IClientOutgoingPacket
+{
+ public static final ExOlympiadMatchInfoEnd STATIC_PACKET = new ExOlympiadMatchInfoEnd();
+
+ private ExOlympiadMatchInfoEnd()
+ {
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_OLYMPIAD_MATCH_INFO.writeId(packet);
+ return true;
+ }
+}
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchList.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java
similarity index 91%
rename from L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchList.java
rename to L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java
index 7ffd5ed3bd..80564627aa 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchList.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java
@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import java.util.ArrayList;
import java.util.List;
@@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.olympiad.OlympiadGameManager;
import org.l2jmobius.gameserver.model.olympiad.OlympiadGameNonClassed;
import org.l2jmobius.gameserver.model.olympiad.OlympiadGameTask;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author mrTJO
@@ -55,15 +56,19 @@ public class ExOlympiadMatchList implements IClientOutgoingPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_RECEIVE_OLYMPIAD.writeId(packet);
+
packet.writeD(0); // Type 0 = Match List, 1 = Match Result
+
packet.writeD(_games.size());
packet.writeD(0);
+
for (OlympiadGameTask curGame : _games)
{
final AbstractOlympiadGame game = curGame.getGame();
if (game != null)
{
packet.writeD(game.getStadiumId()); // Stadium Id (Arena 1 = 0)
+
if (game instanceof OlympiadGameNonClassed)
{
packet.writeD(1);
@@ -76,6 +81,7 @@ public class ExOlympiadMatchList implements IClientOutgoingPacket
{
packet.writeD(0);
}
+
packet.writeD(curGame.isRunning() ? 2 : 1); // (1 = Standby, 2 = Playing)
packet.writeS(game.getPlayerNames()[0]); // Player 1 Name
packet.writeS(game.getPlayerNames()[1]); // Player 2 Name
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java
new file mode 100644
index 0000000000..a72825cad4
--- /dev/null
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java
@@ -0,0 +1,42 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+public class ExOlympiadMatchMakingResult implements IClientOutgoingPacket
+{
+ private final int _gameRuleType;
+ private final int _type;
+
+ public ExOlympiadMatchMakingResult(int cGameRuleType, int type)
+ {
+ _gameRuleType = 0;
+ _type = type;
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_OLYMPIAD_INFO.writeId(packet);
+ packet.writeC(_type);
+ packet.writeD(_gameRuleType);
+ return true;
+ }
+}
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchResult.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java
similarity index 73%
rename from L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchResult.java
rename to L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java
index b387271fba..2c57635a47 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchResult.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java
@@ -14,13 +14,14 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.model.olympiad.OlympiadInfo;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author JIV
@@ -32,8 +33,11 @@ public class ExOlympiadMatchResult implements IClientOutgoingPacket
private int _loseTeam = 2;
private final List _winnerList;
private final List _loserList;
+ private final int _round1winner;
+ private final int _round2winner;
+ private final int _round3winner;
- public ExOlympiadMatchResult(boolean tie, int winTeam, List winnerList, List loserList)
+ public ExOlympiadMatchResult(boolean tie, int winTeam, List winnerList, List loserList, int round1winner, int round2winner, int round3winner)
{
_tie = tie;
_winTeam = winTeam;
@@ -47,13 +51,16 @@ public class ExOlympiadMatchResult implements IClientOutgoingPacket
{
_winTeam = 1;
}
+ _round1winner = round1winner;
+ _round2winner = round2winner;
+ _round3winner = round3winner;
}
@Override
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_RECEIVE_OLYMPIAD.writeId(packet);
- packet.writeD(1); // Type 0 = Match List, 1 = Match Result
+ packet.writeD(2); // Type 0 = Match List, 1 = Match Result, 2 = New Oly look, 3 = 3v3
packet.writeD(_tie ? 1 : 0); // 0 - win, 1 - tie
packet.writeS(_winnerList.get(0).getName());
packet.writeD(_winTeam);
@@ -82,6 +89,11 @@ public class ExOlympiadMatchResult implements IClientOutgoingPacket
packet.writeD(info.getDiffPoints());
packet.writeD(0); // Helios
}
+ packet.writeC(_round1winner); // Round 1 outcome
+ packet.writeC(_round2winner); // Round 2 outcome
+ packet.writeC(_round3winner); // Round 3 outcome
+ packet.writeD(15); // Bonus Reward
+ packet.writeD(0); // Bonus Reward for looser
return true;
}
}
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMode.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java
similarity index 76%
rename from L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMode.java
rename to L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java
index 712b9e06c6..35156532aa 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMode.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java
@@ -14,22 +14,24 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.enums.OlympiadMode;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author godson
*/
public class ExOlympiadMode implements IClientOutgoingPacket
{
- private final int _mode;
+ private final OlympiadMode _mode;
/**
* @param mode (0 = return, 3 = spectate)
*/
- public ExOlympiadMode(int mode)
+ public ExOlympiadMode(OlympiadMode mode)
{
_mode = mode;
}
@@ -38,7 +40,7 @@ public class ExOlympiadMode implements IClientOutgoingPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_OLYMPIAD_MODE.writeId(packet);
- packet.writeC(_mode);
+ packet.writeC(_mode.ordinal());
return true;
}
}
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java
new file mode 100644
index 0000000000..0985a230f5
--- /dev/null
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java
@@ -0,0 +1,109 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Calendar;
+
+import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.instancemanager.RankManager;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.model.olympiad.Olympiad;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.PacketLogger;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+public class ExOlympiadRecord implements IClientOutgoingPacket
+{
+ private static final String GET_PREVIOUS_CYCLE_DATA = "SELECT charId, class_id, olympiad_points, competitions_won, competitions_lost FROM olympiad_nobles_eom WHERE class_id = ? ORDER BY olympiad_points DESC LIMIT " + RankManager.PLAYER_LIMIT;
+
+ private final Player _player;
+ private final int _gameRuleType;
+ private final int _type;
+
+ public ExOlympiadRecord(Player player, int cGameRuleType, int type)
+ {
+ _player = player;
+ _gameRuleType = cGameRuleType;
+ _type = type;
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_OLYMPIAD_RECORD.writeId(packet);
+ packet.writeD(Olympiad.getInstance().getNoblePoints(_player)); // nPoint
+ packet.writeD(Olympiad.getInstance().getCompetitionWon(_player.getObjectId())); // nWinCount
+ packet.writeD(Olympiad.getInstance().getCompetitionLost(_player.getObjectId())); // nLoseCount
+ packet.writeD(Olympiad.getInstance().getRemainingWeeklyMatches(_player.getObjectId())); // nMatchCount
+ // Previous Cycle
+ int previousPlace = 0;
+ int previousWins = 0;
+ int previousLoses = 0;
+ int previousPoints = 0;
+ int previousClass = 0;
+
+ try (Connection con = DatabaseFactory.getConnection();
+ PreparedStatement statement = con.prepareStatement(GET_PREVIOUS_CYCLE_DATA))
+ {
+ statement.setInt(1, _player.getBaseClass());
+ try (ResultSet rset = statement.executeQuery())
+ {
+ int i = 1;
+ while (rset.next())
+ {
+ if (rset.getInt("charId") == _player.getObjectId())
+ {
+ previousPlace = i;
+ previousWins = rset.getInt("competitions_won");
+ previousLoses = rset.getInt("competitions_lost");
+ previousPoints = rset.getInt("olympiad_points");
+ previousClass = rset.getInt("class_id");
+ }
+ i++;
+ }
+ }
+ }
+ catch (SQLException e)
+ {
+ PacketLogger.warning("Olympiad my ranking: Couldnt load data: " + e.getMessage());
+ }
+
+ packet.writeD(previousClass); // nPrevClassType
+ packet.writeD(1); // nPrevRank in all servers
+ packet.writeD(2); // nPrevRankCount number of participants with 25+ matches
+ packet.writeD(previousPlace); // nPrevClassRank in all servers
+ packet.writeD(4); // nPrevClassRankCount number of participants with 25+ matches
+ packet.writeD(5); // nPrevClassRankByServer in current server
+ packet.writeD(6); // nPrevClassRankByServerCount number of participants with 25+ matches
+ packet.writeD(previousPoints); // nPrevPoint
+ packet.writeD(previousWins); // nPrevWinCount
+ packet.writeD(previousLoses); // nPrevLoseCount
+ packet.writeD(previousPlace); // nPrevGrade
+ packet.writeD(Calendar.getInstance().get(Calendar.YEAR)); // nSeasonYear
+ packet.writeD(Calendar.getInstance().get(Calendar.MONTH) + 1); // nSeasonMonth
+ packet.writeC(Olympiad.getInstance().inCompPeriod() ? 1 : 0); // bMatchOpen
+ packet.writeD(Olympiad.getInstance().getCurrentCycle()); // nSeason
+ packet.writeC(_type); // bRegistered
+ packet.writeD(_gameRuleType); // cGameRuleType
+ return true;
+ }
+}
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadSpelledInfo.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java
similarity index 88%
rename from L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadSpelledInfo.java
rename to L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java
index 5b4f2c2523..a5a368a43e 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadSpelledInfo.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java
@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import java.util.ArrayList;
import java.util.List;
@@ -24,6 +24,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.skill.BuffInfo;
import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author godson
@@ -53,6 +54,7 @@ public class ExOlympiadSpelledInfo implements IClientOutgoingPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_OLYMPIAD_SPELLED_INFO.writeId(packet);
+
packet.writeD(_playerId);
packet.writeD(_effects.size() + _effects2.size());
for (BuffInfo info : _effects)
@@ -61,7 +63,7 @@ public class ExOlympiadSpelledInfo implements IClientOutgoingPacket
{
packet.writeD(info.getSkill().getDisplayId());
packet.writeH(info.getSkill().getDisplayLevel());
- packet.writeH(0); // Sub level
+ packet.writeH(0x00); // Sub level
packet.writeD(info.getSkill().getAbnormalType().getClientId());
writeOptionalD(packet, info.getSkill().isAura() ? -1 : info.getTime());
}
@@ -72,7 +74,7 @@ public class ExOlympiadSpelledInfo implements IClientOutgoingPacket
{
packet.writeD(skill.getDisplayId());
packet.writeH(skill.getDisplayLevel());
- packet.writeH(0); // Sub level
+ packet.writeH(0x00); // Sub level
packet.writeD(skill.getAbnormalType().getClientId());
packet.writeH(-1);
}
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadUserInfo.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java
similarity index 90%
rename from L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadUserInfo.java
rename to L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java
index ca473edfcf..1acac0ec7a 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadUserInfo.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java
@@ -14,12 +14,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.olympiad.Participant;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author godson
@@ -76,6 +77,7 @@ public class ExOlympiadUserInfo implements IClientOutgoingPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_OLYMPIAD_USER_INFO.writeId(packet);
+
if (_player != null)
{
packet.writeC(_player.getOlympiadSide());
@@ -90,6 +92,7 @@ public class ExOlympiadUserInfo implements IClientOutgoingPacket
packet.writeS(_par.getName());
packet.writeD(_par.getBaseClass());
}
+
packet.writeD(_curHp);
packet.writeD(_maxHp);
packet.writeD(_curCp);
diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/config/Olympiad.ini b/L2J_Mobius_10.1_MasterClass/dist/game/config/Olympiad.ini
index 149a682c5e..34b3a54c33 100644
--- a/L2J_Mobius_10.1_MasterClass/dist/game/config/Olympiad.ini
+++ b/L2J_Mobius_10.1_MasterClass/dist/game/config/Olympiad.ini
@@ -9,141 +9,141 @@
# Also please understand what you are changing before you do so on a live server.
# ---------------------------------------------------------------------------
+# Enable Olympiad.
+# Default: True
+OlympiadEnabled = True
+
# Olympiad Start Time in Military hours Default 8pm (20)
# Default: 20
-AltOlyStartTime = 20
+OlympiadStartTime = 20
# Olympiad Start Time for Min's, Default 00 so at the start of the hour.
# Default: 00
-AltOlyMin = 00
+OlympiadMin = 00
# Olympiad Competition Period, Default 4 hours.
# (If set different, should be increment by 10mins)
# Default: 14400000
-AltOlyCPeriod = 14400000
+OlympiadCPeriod = 14400000
-# Olympiad Battle Period, Default 5 minutes.
-# Default: 300000
-AltOlyBattle = 300000
+# Olympiad Battle Period, Default 100 seconds.
+# Default: 100000
+OlympiadBattle = 100000
# Olympiad Weekly Period, Default 1 week
# Used for adding points to nobles
# Default: 604800000
-AltOlyWPeriod = 604800000
+OlympiadWPeriod = 604800000
# Olympiad Validation Period, Default 24 Hours.
# Default: 86400000
-AltOlyVPeriod = 86400000
+OlympiadVPeriod = 86400000
# Points for reaching Noblesse for the first time
-# Default: 10
-AltOlyStartPoints = 10
-
-# Points every week
-# Default: 10
-AltOlyWeeklyPoints = 10
+# Default: 1000
+OlympiadStartPoints = 1000
# Required number of participants for the class based games
# Default: 20
-AltOlyClassedParticipants = 20
+OlympiadClassedParticipants = 20
# Required number of participants for the non-class based games
# Default: 10
-AltOlyNonClassedParticipants = 10
+OlympiadNonClassedParticipants = 10
# Reward for the winner
# Format: itemId1,itemNum1;itemId2,itemNum2...
# Default: 45584,12
-AltOlyWinReward = 45584,12
+OlympiadWinReward = 45584,12
# Reward for loser
# Format: itemId1,itemNum1;itemId2,itemNum2...
# Default: 45584,7
-AltOlyLoserReward = 45584,7
+OlympiadLoserReward = 45584,7
# ItemId used for exchanging to the points.
# Default: 45584
-AltOlyCompRewItem = 45584
+OlympiadCompRewItem = 45584
# The minimum matches you need to participate to receive point rewards
# Default: 10
-AltOlyMinMatchesForPoints = 10
+OlympiadMinMatchesForPoints = 10
# Rate to exchange points to reward item.
# Default: 20
-AltOlyMarkPerPoint = 20
+OlympiadMarkPerPoint = 20
# Noblesse points awarded to Heroes.
# Default: 30
-AltOlyHeroPoints = 30
+OlympiadHeroPoints = 30
# Noblesse points awarded to Rank 1 members.
# Default: 100
-AltOlyRank1Points = 60
+OlympiadRank1Points = 60
# Noblesse points awarded to Rank 2 members.
# Default: 75
-AltOlyRank2Points = 50
+OlympiadRank2Points = 50
# Noblesse points awarded to Rank 3 members.
# Default: 55
-AltOlyRank3Points = 45
+OlympiadRank3Points = 45
# Noblesse points awarded to Rank 4 members.
# Default: 40
-AltOlyRank4Points = 40
+OlympiadRank4Points = 40
# Noblesse points awarded to Rank 5 members.
# Default: 30
-AltOlyRank5Points = 30
+OlympiadRank5Points = 30
# Maximum points that player can gain/lose on a match.
# Default: 10
-AltOlyMaxPoints = 10
+OlympiadMaxPoints = 10
# Hero tables show last month's winners or current status.
# Default: True
-AltOlyShowMonthlyWinners = True
+OlympiadShowMonthlyWinners = True
# Olympiad Managers announce each start of fight.
# Default: True
-AltOlyAnnounceGames = True
+OlympiadAnnounceGames = True
# Restrict specified items in Olympiad. ItemID's need to be separated with a comma (ex. 1,200,350)
# Equipped items will be moved to inventory during port.
# Default:
-AltOlyRestrictedItems =
+OlympiadRestrictedItems =
# Enchant limit for items during Olympiad battles. Disabled = -1.
# Default: -1
-AltOlyWeaponEnchantLimit = -1
-AltOlyArmorEnchantLimit = -1
+OlympiadWeaponEnchantLimit = -1
+OlympiadArmorEnchantLimit = -1
# Log all Olympiad fights and outcome to olympiad.csv file.
# Default: False
-AltOlyLogFights = False
+OlympiadLogFights = False
# Time to wait before teleported to arena.
# Default: 120
-AltOlyWaitTime = 120
+OlympiadWaitTime = 120
# Divider for points in classed and non-classed games
# Default: 5
-AltOlyDividerClassed = 5
-AltOlyDividerNonClassed = 5
+OlympiadDividerClassed = 5
+OlympiadDividerNonClassed = 5
# Maximum number of matches a Noblesse character can join per week
-# Default: 30
-AltOlyMaxWeeklyMatches = 30
+# Default: 25
+OlympiadMaxWeeklyMatches = 25
# Enable competitions only on specific days. Usage: 1,2,3,4,5,6,7 (SUNDAY,MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,SATURDAY)
# Default: 6,7 (FRIDAY,SATURDAY)
-AltOlyCompetitionDays = 6,7
+OlympiadCompetitionDays = 6,7
# Change the type of delay between two Olympiads.
# Available values: MONTH, WEEK, DAY
# Default: MONTH
-AltOlyPeriod = MONTH
+OlympiadPeriod = MONTH
# Change the Olympiad frequency.
# The value is a multiplier of period type,
@@ -151,4 +151,4 @@ AltOlyPeriod = MONTH
# then Olympiad will occur every 2 months.
# Default: 1
# Note! If type = DAY, multiplier must be >= 7!
-AltOlyPeriodMultiplier = 1
\ No newline at end of file
+OlympiadPeriodMultiplier = 1
\ No newline at end of file
diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes-weaponListLegend.html b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes-weaponListLegend.html
new file mode 100644
index 0000000000..169a6fb06f
--- /dev/null
+++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes-weaponListLegend.html
@@ -0,0 +1,26 @@
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes.java b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes.java
index 53a544ac7f..fe77bb3e49 100644
--- a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes.java
+++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes.java
@@ -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;
}
diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/ai/others/OlyBuffer/OlyBuffer.java b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/ai/others/OlyBuffer/OlyBuffer.java
index 071de9ce6e..4637c7c055 100644
--- a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/ai/others/OlyBuffer/OlyBuffer.java
+++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/ai/others/OlyBuffer/OlyBuffer.java
@@ -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());
}
diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java
index abd483995f..b67f27611e 100644
--- a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java
+++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java
@@ -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
diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/events/RedLibra/Eraton/Eraton.java b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/events/RedLibra/Eraton/Eraton.java
index 292ad9e999..31875c82f5 100644
--- a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/events/RedLibra/Eraton/Eraton.java
+++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/events/RedLibra/Eraton/Eraton.java
@@ -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();
}
diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java
index 800d712676..1f0e698300 100644
--- a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java
+++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java
@@ -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;
}
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/Config.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/Config.java
index 8888f60dc1..995a1b4618 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/Config.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/Config.java
@@ -516,41 +516,41 @@ public class Config
public static int WORLD_CHAT_MIN_LEVEL;
public static int WORLD_CHAT_POINTS_PER_DAY;
public static Duration WORLD_CHAT_INTERVAL;
- public static int ALT_OLY_START_TIME;
- public static int ALT_OLY_MIN;
- public static long ALT_OLY_CPERIOD;
- public static long ALT_OLY_BATTLE;
- public static long ALT_OLY_WPERIOD;
- public static long ALT_OLY_VPERIOD;
- public static int ALT_OLY_START_POINTS;
- public static int ALT_OLY_WEEKLY_POINTS;
- public static int ALT_OLY_CLASSED;
- public static int ALT_OLY_NONCLASSED;
- public static List ALT_OLY_WINNER_REWARD;
- public static List ALT_OLY_LOSER_REWARD;
- public static int ALT_OLY_COMP_RITEM;
- public static int ALT_OLY_MIN_MATCHES;
- public static int ALT_OLY_MARK_PER_POINT;
- public static int ALT_OLY_HERO_POINTS;
- public static int ALT_OLY_RANK1_POINTS;
- public static int ALT_OLY_RANK2_POINTS;
- public static int ALT_OLY_RANK3_POINTS;
- public static int ALT_OLY_RANK4_POINTS;
- public static int ALT_OLY_RANK5_POINTS;
- public static int ALT_OLY_MAX_POINTS;
- public static int ALT_OLY_DIVIDER_CLASSED;
- public static int ALT_OLY_DIVIDER_NON_CLASSED;
- public static int ALT_OLY_MAX_WEEKLY_MATCHES;
- public static boolean ALT_OLY_LOG_FIGHTS;
- public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS;
- public static boolean ALT_OLY_ANNOUNCE_GAMES;
- public static Set LIST_OLY_RESTRICTED_ITEMS = new HashSet<>();
- public static int ALT_OLY_WEAPON_ENCHANT_LIMIT;
- public static int ALT_OLY_ARMOR_ENCHANT_LIMIT;
- public static int ALT_OLY_WAIT_TIME;
- public static String ALT_OLY_PERIOD;
- public static int ALT_OLY_PERIOD_MULTIPLIER;
- public static List ALT_OLY_COMPETITION_DAYS;
+ public static boolean OLYMPIAD_ENABLED;
+ public static int OLYMPIAD_START_TIME;
+ public static int OLYMPIAD_MIN;
+ public static long OLYMPIAD_CPERIOD;
+ public static long OLYMPIAD_BATTLE;
+ public static long OLYMPIAD_WPERIOD;
+ public static long OLYMPIAD_VPERIOD;
+ public static int OLYMPIAD_START_POINTS;
+ public static int OLYMPIAD_CLASSED;
+ public static int OLYMPIAD_NONCLASSED;
+ public static List OLYMPIAD_WINNER_REWARD;
+ public static List OLYMPIAD_LOSER_REWARD;
+ public static int OLYMPIAD_COMP_RITEM;
+ public static int OLYMPIAD_MIN_MATCHES;
+ public static int OLYMPIAD_MARK_PER_POINT;
+ public static int OLYMPIAD_HERO_POINTS;
+ public static int OLYMPIAD_RANK1_POINTS;
+ public static int OLYMPIAD_RANK2_POINTS;
+ public static int OLYMPIAD_RANK3_POINTS;
+ public static int OLYMPIAD_RANK4_POINTS;
+ public static int OLYMPIAD_RANK5_POINTS;
+ public static int OLYMPIAD_MAX_POINTS;
+ public static int OLYMPIAD_DIVIDER_CLASSED;
+ public static int OLYMPIAD_DIVIDER_NON_CLASSED;
+ public static int OLYMPIAD_MAX_WEEKLY_MATCHES;
+ public static boolean OLYMPIAD_LOG_FIGHTS;
+ public static boolean OLYMPIAD_SHOW_MONTHLY_WINNERS;
+ public static boolean OLYMPIAD_ANNOUNCE_GAMES;
+ public static Set OLYMPIAD_RESTRICTED_ITEMS = new HashSet<>();
+ public static int OLYMPIAD_WEAPON_ENCHANT_LIMIT;
+ public static int OLYMPIAD_ARMOR_ENCHANT_LIMIT;
+ public static int OLYMPIAD_WAIT_TIME;
+ public static String OLYMPIAD_PERIOD;
+ public static int OLYMPIAD_PERIOD_MULTIPLIER;
+ public static List OLYMPIAD_COMPETITION_DAYS;
public static int ALT_MANOR_REFRESH_TIME;
public static int ALT_MANOR_REFRESH_MIN;
public static int ALT_MANOR_APPROVE_TIME;
@@ -2432,57 +2432,57 @@ public class Config
// Load Olympiad config file (if exists)
final PropertiesParser olympiadConfig = new PropertiesParser(OLYMPIAD_CONFIG_FILE);
- ALT_OLY_START_TIME = olympiadConfig.getInt("AltOlyStartTime", 20);
- ALT_OLY_MIN = olympiadConfig.getInt("AltOlyMin", 0);
- ALT_OLY_CPERIOD = olympiadConfig.getLong("AltOlyCPeriod", 14400000);
- ALT_OLY_BATTLE = olympiadConfig.getLong("AltOlyBattle", 300000);
- ALT_OLY_WPERIOD = olympiadConfig.getLong("AltOlyWPeriod", 604800000);
- ALT_OLY_VPERIOD = olympiadConfig.getLong("AltOlyVPeriod", 86400000);
- ALT_OLY_START_POINTS = olympiadConfig.getInt("AltOlyStartPoints", 10);
- ALT_OLY_WEEKLY_POINTS = olympiadConfig.getInt("AltOlyWeeklyPoints", 10);
- ALT_OLY_CLASSED = olympiadConfig.getInt("AltOlyClassedParticipants", 10);
- ALT_OLY_NONCLASSED = olympiadConfig.getInt("AltOlyNonClassedParticipants", 20);
- ALT_OLY_WINNER_REWARD = parseItemsList(olympiadConfig.getString("AltOlyWinReward", "45584,12"));
- ALT_OLY_LOSER_REWARD = parseItemsList(olympiadConfig.getString("AltOlyLoserReward", "45584,7"));
- ALT_OLY_COMP_RITEM = olympiadConfig.getInt("AltOlyCompRewItem", 45584);
- ALT_OLY_MIN_MATCHES = olympiadConfig.getInt("AltOlyMinMatchesForPoints", 10);
- ALT_OLY_MARK_PER_POINT = olympiadConfig.getInt("AltOlyMarkPerPoint", 20);
- ALT_OLY_HERO_POINTS = olympiadConfig.getInt("AltOlyHeroPoints", 30);
- ALT_OLY_RANK1_POINTS = olympiadConfig.getInt("AltOlyRank1Points", 60);
- ALT_OLY_RANK2_POINTS = olympiadConfig.getInt("AltOlyRank2Points", 50);
- ALT_OLY_RANK3_POINTS = olympiadConfig.getInt("AltOlyRank3Points", 45);
- ALT_OLY_RANK4_POINTS = olympiadConfig.getInt("AltOlyRank4Points", 40);
- ALT_OLY_RANK5_POINTS = olympiadConfig.getInt("AltOlyRank5Points", 30);
- ALT_OLY_MAX_POINTS = olympiadConfig.getInt("AltOlyMaxPoints", 10);
- ALT_OLY_DIVIDER_CLASSED = olympiadConfig.getInt("AltOlyDividerClassed", 5);
- ALT_OLY_DIVIDER_NON_CLASSED = olympiadConfig.getInt("AltOlyDividerNonClassed", 5);
- ALT_OLY_MAX_WEEKLY_MATCHES = olympiadConfig.getInt("AltOlyMaxWeeklyMatches", 30);
- ALT_OLY_LOG_FIGHTS = olympiadConfig.getBoolean("AltOlyLogFights", false);
- ALT_OLY_SHOW_MONTHLY_WINNERS = olympiadConfig.getBoolean("AltOlyShowMonthlyWinners", true);
- ALT_OLY_ANNOUNCE_GAMES = olympiadConfig.getBoolean("AltOlyAnnounceGames", true);
- final String olyRestrictedItems = olympiadConfig.getString("AltOlyRestrictedItems", "").trim();
+ OLYMPIAD_ENABLED = olympiadConfig.getBoolean("OlympiadEnabled", true);
+ OLYMPIAD_START_TIME = olympiadConfig.getInt("OlympiadStartTime", 20);
+ OLYMPIAD_MIN = olympiadConfig.getInt("OlympiadMin", 0);
+ OLYMPIAD_CPERIOD = olympiadConfig.getLong("OlympiadCPeriod", 14400000);
+ OLYMPIAD_BATTLE = olympiadConfig.getLong("OlympiadBattle", 300000);
+ OLYMPIAD_WPERIOD = olympiadConfig.getLong("OlympiadWPeriod", 604800000);
+ OLYMPIAD_VPERIOD = olympiadConfig.getLong("OlympiadVPeriod", 86400000);
+ OLYMPIAD_START_POINTS = olympiadConfig.getInt("OlympiadStartPoints", 1000);
+ OLYMPIAD_CLASSED = olympiadConfig.getInt("OlympiadClassedParticipants", 10);
+ OLYMPIAD_NONCLASSED = olympiadConfig.getInt("OlympiadNonClassedParticipants", 20);
+ OLYMPIAD_WINNER_REWARD = parseItemsList(olympiadConfig.getString("OlympiadWinReward", "45584,12"));
+ OLYMPIAD_LOSER_REWARD = parseItemsList(olympiadConfig.getString("OlympiadLoserReward", "45584,7"));
+ OLYMPIAD_COMP_RITEM = olympiadConfig.getInt("OlympiadCompRewItem", 45584);
+ OLYMPIAD_MIN_MATCHES = olympiadConfig.getInt("OlympiadMinMatchesForPoints", 10);
+ OLYMPIAD_MARK_PER_POINT = olympiadConfig.getInt("OlympiadMarkPerPoint", 20);
+ OLYMPIAD_HERO_POINTS = olympiadConfig.getInt("OlympiadHeroPoints", 30);
+ OLYMPIAD_RANK1_POINTS = olympiadConfig.getInt("OlympiadRank1Points", 60);
+ OLYMPIAD_RANK2_POINTS = olympiadConfig.getInt("OlympiadRank2Points", 50);
+ OLYMPIAD_RANK3_POINTS = olympiadConfig.getInt("OlympiadRank3Points", 45);
+ OLYMPIAD_RANK4_POINTS = olympiadConfig.getInt("OlympiadRank4Points", 40);
+ OLYMPIAD_RANK5_POINTS = olympiadConfig.getInt("OlympiadRank5Points", 30);
+ OLYMPIAD_MAX_POINTS = olympiadConfig.getInt("OlympiadMaxPoints", 10);
+ OLYMPIAD_DIVIDER_CLASSED = olympiadConfig.getInt("OlympiadDividerClassed", 5);
+ OLYMPIAD_DIVIDER_NON_CLASSED = olympiadConfig.getInt("OlympiadDividerNonClassed", 5);
+ OLYMPIAD_MAX_WEEKLY_MATCHES = olympiadConfig.getInt("OlympiadMaxWeeklyMatches", 25);
+ OLYMPIAD_LOG_FIGHTS = olympiadConfig.getBoolean("OlympiadLogFights", false);
+ OLYMPIAD_SHOW_MONTHLY_WINNERS = olympiadConfig.getBoolean("OlympiadShowMonthlyWinners", true);
+ OLYMPIAD_ANNOUNCE_GAMES = olympiadConfig.getBoolean("OlympiadAnnounceGames", true);
+ final String olyRestrictedItems = olympiadConfig.getString("OlympiadRestrictedItems", "").trim();
if (!olyRestrictedItems.isEmpty())
{
final String[] olyRestrictedItemsSplit = olyRestrictedItems.split(",");
- LIST_OLY_RESTRICTED_ITEMS = new HashSet<>(olyRestrictedItemsSplit.length);
+ OLYMPIAD_RESTRICTED_ITEMS = new HashSet<>(olyRestrictedItemsSplit.length);
for (String id : olyRestrictedItemsSplit)
{
- LIST_OLY_RESTRICTED_ITEMS.add(Integer.parseInt(id));
+ OLYMPIAD_RESTRICTED_ITEMS.add(Integer.parseInt(id));
}
}
else // In case of reload with removal of all items ids.
{
- LIST_OLY_RESTRICTED_ITEMS.clear();
+ OLYMPIAD_RESTRICTED_ITEMS.clear();
}
- ALT_OLY_WEAPON_ENCHANT_LIMIT = olympiadConfig.getInt("AltOlyWeaponEnchantLimit", -1);
- ALT_OLY_ARMOR_ENCHANT_LIMIT = olympiadConfig.getInt("AltOlyArmorEnchantLimit", -1);
- ALT_OLY_WAIT_TIME = olympiadConfig.getInt("AltOlyWaitTime", 60);
- ALT_OLY_PERIOD = olympiadConfig.getString("AltOlyPeriod", "MONTH");
- ALT_OLY_PERIOD_MULTIPLIER = olympiadConfig.getInt("AltOlyPeriodMultiplier", 1);
- ALT_OLY_COMPETITION_DAYS = new ArrayList<>();
- for (String s : olympiadConfig.getString("AltOlyCompetitionDays", "6,7").split(","))
+ OLYMPIAD_WEAPON_ENCHANT_LIMIT = olympiadConfig.getInt("OlympiadWeaponEnchantLimit", -1);
+ OLYMPIAD_ARMOR_ENCHANT_LIMIT = olympiadConfig.getInt("OlympiadArmorEnchantLimit", -1);
+ OLYMPIAD_WAIT_TIME = olympiadConfig.getInt("OlympiadWaitTime", 60);
+ OLYMPIAD_PERIOD = olympiadConfig.getString("OlympiadPeriod", "MONTH");
+ OLYMPIAD_PERIOD_MULTIPLIER = olympiadConfig.getInt("OlympiadPeriodMultiplier", 1);
+ OLYMPIAD_COMPETITION_DAYS = new ArrayList<>();
+ for (String s : olympiadConfig.getString("OlympiadCompetitionDays", "6,7").split(","))
{
- ALT_OLY_COMPETITION_DAYS.add(Integer.parseInt(s));
+ OLYMPIAD_COMPETITION_DAYS.add(Integer.parseInt(s));
}
final File hexIdFile = new File(HEXID_FILE);
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/enums/OlympiadMode.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/enums/OlympiadMode.java
new file mode 100644
index 0000000000..a65f6a86a4
--- /dev/null
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/enums/OlympiadMode.java
@@ -0,0 +1,28 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.enums;
+
+/**
+ * @author NasSeKa
+ */
+public enum OlympiadMode
+{
+ NONE,
+ BLUE,
+ RED,
+ SPECTATOR
+}
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/EffectList.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/EffectList.java
index 4c89f9fa5d..929d62829c 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/EffectList.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/EffectList.java
@@ -50,9 +50,9 @@ import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.model.skill.SkillBuffType;
import org.l2jmobius.gameserver.network.serverpackets.AbnormalStatusUpdate;
import org.l2jmobius.gameserver.network.serverpackets.ExAbnormalStatusUpdateFromTarget;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadSpelledInfo;
import org.l2jmobius.gameserver.network.serverpackets.PartySpelled;
import org.l2jmobius.gameserver.network.serverpackets.ShortBuffStatusUpdate;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadSpelledInfo;
/**
* Effect lists.
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java
index 8150f4a20f..ac2c502111 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -99,6 +99,7 @@ import org.l2jmobius.gameserver.enums.ItemGrade;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.enums.MountType;
import org.l2jmobius.gameserver.enums.NextActionType;
+import org.l2jmobius.gameserver.enums.OlympiadMode;
import org.l2jmobius.gameserver.enums.PartyDistributionType;
import org.l2jmobius.gameserver.enums.PartyMessageType;
import org.l2jmobius.gameserver.enums.PartySmallWindowUpdateType;
@@ -308,7 +309,6 @@ import org.l2jmobius.gameserver.network.serverpackets.ExDuelUpdateUserInfo;
import org.l2jmobius.gameserver.network.serverpackets.ExGetBookMarkInfoPacket;
import org.l2jmobius.gameserver.network.serverpackets.ExGetOnAirShip;
import org.l2jmobius.gameserver.network.serverpackets.ExMagicAttackInfo;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMode;
import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCoinInfo;
import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCount;
import org.l2jmobius.gameserver.network.serverpackets.ExPrivateStoreSetWholeMsg;
@@ -366,6 +366,7 @@ import org.l2jmobius.gameserver.network.serverpackets.autoplay.ExAutoPlaySetting
import org.l2jmobius.gameserver.network.serverpackets.commission.ExResponseCommissionInfo;
import org.l2jmobius.gameserver.network.serverpackets.friend.FriendStatus;
import org.l2jmobius.gameserver.network.serverpackets.limitshop.ExBloodyCoinCount;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMode;
import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
import org.l2jmobius.gameserver.taskmanager.AutoPlayTaskManager;
import org.l2jmobius.gameserver.taskmanager.AutoUseTaskManager;
@@ -9336,7 +9337,10 @@ public class Player extends Playable
public void enterObserverMode(Location loc)
{
- setLastLocation();
+ if (!isInOlympiadMode())
+ {
+ setLastLocation();
+ }
// Remove Hide.
getEffectList().stopEffects(AbnormalType.HIDE);
@@ -9389,7 +9393,7 @@ public class Player extends Playable
{
standUp();
}
- if (!_observerMode)
+ if (!_observerMode && !isInOlympiadMode())
{
setLastLocation();
}
@@ -9400,7 +9404,7 @@ public class Player extends Playable
setInvisible(true);
setInstance(OlympiadGameManager.getInstance().getOlympiadTask(id).getStadium().getInstance());
teleToLocation(loc, false);
- sendPacket(new ExOlympiadMode(3));
+ sendPacket(new ExOlympiadMode(OlympiadMode.SPECTATOR));
broadcastUserInfo();
}
@@ -9436,7 +9440,7 @@ public class Player extends Playable
_olympiadGameId = -1;
_observerMode = false;
setTarget(null);
- sendPacket(new ExOlympiadMode(0));
+ sendPacket(new ExOlympiadMode(OlympiadMode.NONE));
setInstance(null);
teleToLocation(_lastLoc, true);
if (!isGM())
@@ -9619,14 +9623,24 @@ public class Player extends Playable
return _olympiadStart;
}
+ public boolean isInOlympiadMode()
+ {
+ return _inOlympiadMode;
+ }
+
public boolean isHero()
{
return _hero;
}
- public boolean isInOlympiadMode()
+ public boolean isLegend()
{
- return _inOlympiadMode;
+ return getVariables().getBoolean(PlayerVariables.IS_LEGEND, false);
+ }
+
+ public void setLegend(boolean legend)
+ {
+ getVariables().set(PlayerVariables.IS_LEGEND, legend);
}
public boolean isInDuel()
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/item/ItemTemplate.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/item/ItemTemplate.java
index 5b2b98879a..79a34c43fb 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/item/ItemTemplate.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/item/ItemTemplate.java
@@ -940,7 +940,7 @@ public abstract class ItemTemplate extends ListenersContainer implements IIdenti
public boolean isOlyRestrictedItem()
{
- return _isOlyRestricted || Config.LIST_OLY_RESTRICTED_ITEMS.contains(_itemId);
+ return _isOlyRestricted || Config.OLYMPIAD_RESTRICTED_ITEMS.contains(_itemId);
}
/**
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/item/instance/Item.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/item/instance/Item.java
index 1d440c4a12..0780b9a7ba 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/item/instance/Item.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/item/instance/Item.java
@@ -1995,16 +1995,16 @@ public class Item extends WorldObject
{
if (_itemTemplate.isWeapon())
{
- if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT))
+ if ((Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT))
{
- enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT;
+ enchant = Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT;
}
}
else
{
- if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT))
+ if ((Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT))
{
- enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT;
+ enchant = Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT;
}
}
}
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
index 0d9104ee74..191e04ae87 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
@@ -22,6 +22,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.ai.CtrlIntention;
+import org.l2jmobius.gameserver.enums.OlympiadMode;
import org.l2jmobius.gameserver.enums.PartyMessageType;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
@@ -39,11 +40,11 @@ import org.l2jmobius.gameserver.model.siege.Castle;
import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.network.SystemMessageId;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMode;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
import org.l2jmobius.gameserver.network.serverpackets.SkillCoolTime;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMode;
/**
* @author godson, GodKratos, Pere, DS
@@ -163,7 +164,7 @@ public abstract class AbstractOlympiadGame
return null;
}
- protected static boolean portPlayerToArena(Participant par, Location loc, int id, Instance instance)
+ protected static boolean portPlayerToArena(Participant par, Location loc, int id, Instance instance, OlympiadMode mode)
{
final Player player = par.getPlayer();
if ((player == null) || !player.isOnline())
@@ -173,6 +174,7 @@ public abstract class AbstractOlympiadGame
try
{
+ player.setPvpFlag(0);
player.setLastLocation();
if (player.isSitting())
{
@@ -185,7 +187,32 @@ public abstract class AbstractOlympiadGame
player.setOlympiadStart(false);
player.setOlympiadSide(par.getSide());
player.teleToLocation(loc, instance);
- player.sendPacket(new ExOlympiadMode(2));
+ player.sendPacket(new ExOlympiadMode(mode));
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ return false;
+ }
+ return true;
+ }
+
+ protected static boolean portPlayerToSpot(Participant par, Location loc, int id)
+ {
+ final Player player = par.getPlayer();
+ if ((player == null) || !player.isOnline())
+ {
+ return false;
+ }
+
+ try
+ {
+ if (player.isSitting())
+ {
+ player.standUp();
+ }
+ player.setTarget(null);
+ player.teleToLocation(loc);
}
catch (Exception e)
{
@@ -299,6 +326,48 @@ public abstract class AbstractOlympiadGame
}
}
+ protected void roundTwoClean(Player player)
+ {
+ try
+ {
+ if (player == null)
+ {
+ return;
+ }
+
+ // Remove Debuffs
+ player.getEffectList().stopEffects(info -> info.getSkill().isDebuff(), true, true);
+
+ // Abort casting if player casting
+ player.abortAttack();
+ player.abortCast();
+
+ // Force the character to be visible
+ player.setInvisible(false);
+
+ // Heal Player fully
+ player.setCurrentCp(player.getMaxCp());
+ player.setCurrentHp(player.getMaxHp());
+ player.setCurrentMp(player.getMaxMp());
+
+ // enable skills with cool time <= 15 minutes
+ for (Skill skill : player.getAllSkills())
+ {
+ if (skill.getReuseDelay() <= 900000)
+ {
+ player.enableSkill(skill);
+ }
+ }
+
+ player.sendSkillList();
+ player.sendPacket(new SkillCoolTime(player));
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+ }
+
protected void cleanEffects(Player player)
{
try
@@ -371,7 +440,8 @@ public abstract class AbstractOlympiadGame
player.setOlympiadStart(false);
player.setOlympiadSide(-1);
player.setOlympiadGameId(-1);
- player.sendPacket(new ExOlympiadMode(0));
+ player.sendPacket(new ExOlympiadMode(OlympiadMode.SPECTATOR));
+ player.sendPacket(new ExOlympiadMode(OlympiadMode.NONE));
// Add Clan Skills
final Clan clan = player.getClan();
@@ -420,6 +490,7 @@ public abstract class AbstractOlympiadGame
{
return;
}
+
final Location loc = player.getLastLocation();
if (loc != null)
{
@@ -481,6 +552,8 @@ public abstract class AbstractOlympiadGame
protected abstract boolean portPlayersToArena(List spawns, Instance instance);
+ protected abstract boolean portPlayersToSpots(List spawns, Instance instance);
+
protected abstract void cleanEffects();
protected abstract void portPlayersBack();
@@ -489,22 +562,40 @@ public abstract class AbstractOlympiadGame
protected abstract void clearPlayers();
+ protected abstract void matchEnd(boolean value);
+
+ protected abstract boolean isMatchEnd();
+
protected abstract void handleDisconnect(Player player);
protected abstract void resetDamage();
+ protected abstract void resetDamageFinal();
+
protected abstract void addDamage(Player player, int damage);
protected abstract boolean checkBattleStatus();
protected abstract boolean haveWinner();
+ protected abstract boolean roundWinner();
+
protected abstract void validateWinner(OlympiadStadium stadium);
+ protected abstract void validateRound1Winner(OlympiadStadium stadium);
+
+ protected abstract void validateRound2Winner(OlympiadStadium stadium);
+
+ protected abstract void validateRound3Winner(OlympiadStadium stadium);
+
protected abstract int getDivider();
protected abstract void healPlayers();
+ protected abstract void buffPlayers();
+
+ protected abstract void roundTwoCleanUp();
+
protected abstract void untransformPlayers();
protected abstract void makePlayersInvul();
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/Hero.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
index 3396422d6b..5cce74a21c 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
@@ -40,6 +40,7 @@ import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ClassListData;
import org.l2jmobius.gameserver.data.xml.NpcData;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
+import org.l2jmobius.gameserver.instancemanager.RankManager;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Player;
@@ -71,7 +72,7 @@ public class Hero
private static final String INSERT_HERO = "INSERT INTO heroes (charId, class_id, count, legend_count, played, claimed) VALUES (?,?,?,?,?,?)";
private static final String UPDATE_HERO = "UPDATE heroes SET count = ?, legend_count = ?, played = ?, claimed = ? WHERE charId = ?";
private static final String GET_CLAN_ALLY = "SELECT characters.clanid AS clanid, coalesce(clan_data.ally_Id, 0) AS allyId FROM characters LEFT JOIN clan_data ON clan_data.clan_id = characters.clanid WHERE characters.charId = ?";
- private static final String DELETE_ITEMS = "DELETE FROM items WHERE item_id IN (30392, 30393, 30394, 30395, 30396, 30397, 30398, 30399, 30400, 30401, 30402, 30403, 30404, 30405, 30372, 30373, 6842, 6611, 6612, 6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 9388, 9389, 9390, 48551, 48552) AND owner_id NOT IN (SELECT charId FROM characters WHERE accesslevel > 0)";
+ private static final String DELETE_ITEMS = "DELETE FROM items WHERE item_id IN (30392, 30393, 30394, 30395, 30396, 30397, 30398, 30399, 30400, 30401, 30402, 30403, 30404, 30405, 30372, 30373, 6842, 6611, 6612, 6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 9388, 9389, 9390, 48551, 48552, 48554, 48555, 48556, 48557, 48558, 48559, 48560, 48561, 48562, 48563, 48564, 48565, 48566, 48567) AND owner_id NOT IN (SELECT charId FROM characters WHERE accesslevel > 0)";
private static final Map HEROES = new ConcurrentHashMap<>();
private static final Map COMPLETE_HEROS = new ConcurrentHashMap<>();
@@ -95,7 +96,10 @@ public class Hero
protected Hero()
{
- init();
+ if (Config.OLYMPIAD_ENABLED)
+ {
+ init();
+ }
}
private void init()
@@ -607,6 +611,10 @@ public class Hero
}
player.setHero(false);
+ if (player.isLegend())
+ {
+ player.setLegend(false);
+ }
for (int i = 0; i < Inventory.PAPERDOLL_TOTALSLOTS; i++)
{
@@ -644,19 +652,17 @@ public class Hero
for (StatSet hero : newHeroes)
{
+ final int legendId = RankManager.getInstance().getOlyRankList().get(1).getInt("charId", 0);
final int charId = hero.getInt(Olympiad.CHAR_ID);
if (COMPLETE_HEROS.containsKey(charId))
{
final StatSet oldHero = COMPLETE_HEROS.get(charId);
- if (hero.getInt(LEGEND_COUNT, 0) == 1)
+ final int count = oldHero.getInt(COUNT);
+ oldHero.set(COUNT, count + 1);
+ if (charId == legendId)
{
- final int count = oldHero.getInt(LEGEND_COUNT);
- oldHero.set(LEGEND_COUNT, count + 1);
- }
- else
- {
- final int count = oldHero.getInt(COUNT);
- oldHero.set(COUNT, count + 1);
+ final int legendCount = oldHero.getInt(LEGEND_COUNT);
+ oldHero.set(LEGEND_COUNT, legendCount + 1);
}
oldHero.set(PLAYED, 1);
oldHero.set(CLAIMED, false);
@@ -667,14 +673,11 @@ public class Hero
final StatSet newHero = new StatSet();
newHero.set(Olympiad.CHAR_NAME, hero.getString(Olympiad.CHAR_NAME));
newHero.set(Olympiad.CLASS_ID, hero.getInt(Olympiad.CLASS_ID));
- if (hero.getInt(LEGEND_COUNT, 0) == 1)
+ newHero.set(COUNT, 1);
+ if (charId == legendId)
{
newHero.set(LEGEND_COUNT, 1);
}
- else
- {
- newHero.set(COUNT, 1);
- }
newHero.set(PLAYED, 1);
newHero.set(CLAIMED, false);
HEROES.put(charId, newHero);
@@ -918,6 +921,7 @@ public class Hero
*/
public void claimHero(Player player)
{
+ final int legendId = RankManager.getInstance().getOlyRankList().get(1).getInt("charId", 0);
StatSet hero = HEROES.get(player.getObjectId());
if (hero == null)
{
@@ -938,6 +942,19 @@ public class Hero
}
player.setHero(true);
+ if (player.getObjectId() == legendId)
+ {
+ player.setLegend(true);
+ player.getVariables().set(ALLY_NAME, false);
+ if ((clan != null) && (clan.getLevel() >= 5))
+ {
+ clan.addReputationScore(100000);
+ final SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_MEMBER_C1_HAS_BECOME_THE_HERO_CLAN_REPUTATION_POINTS_S2);
+ sm.addString(CharNameTable.getInstance().getNameById(player.getObjectId()));
+ sm.addInt(Config.HERO_POINTS);
+ clan.broadcastToOnlineMembers(sm);
+ }
+ }
player.broadcastPacket(new SocialAction(player.getObjectId(), 20016)); // Hero Animation
player.sendPacket(new UserInfo(player));
player.broadcastUserInfo();
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java
index 8864817e16..f8c7c09208 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java
@@ -50,6 +50,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.events.ListenersContainer;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadInfo;
import org.l2jmobius.gameserver.util.Broadcast;
/**
@@ -69,13 +70,13 @@ public class Olympiad extends ListenersContainer
private static final String OLYMPIAD_LOAD_NOBLES = "SELECT olympiad_nobles.charId, olympiad_nobles.class_id, characters.char_name, olympiad_nobles.olympiad_points, olympiad_nobles.competitions_done, olympiad_nobles.competitions_won, olympiad_nobles.competitions_lost, olympiad_nobles.competitions_drawn, olympiad_nobles.competitions_done_week FROM olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId";
private static final String OLYMPIAD_SAVE_NOBLES = "INSERT INTO olympiad_nobles (`charId`,`class_id`,`olympiad_points`,`competitions_done`,`competitions_won`,`competitions_lost`,`competitions_drawn`, `competitions_done_week`) VALUES (?,?,?,?,?,?,?,?)";
private static final String OLYMPIAD_UPDATE_NOBLES = "UPDATE olympiad_nobles SET olympiad_points = ?, competitions_done = ?, competitions_won = ?, competitions_lost = ?, competitions_drawn = ?, competitions_done_week = ? WHERE charId = ?";
- private static final String OLYMPIAD_GET_HEROS = "SELECT olympiad_nobles.charId, characters.char_name FROM olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND olympiad_nobles.class_id = ? AND olympiad_nobles.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " AND olympiad_nobles.competitions_won > 0 ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC";
- private static final String OLYMPIAD_GET_LEGEND = "SELECT olympiad_nobles.charId FROM olympiad_nobles WHERE olympiad_nobles.competitions_done >=" + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC LIMIT 1";
- private static final String GET_ALL_CLASSIFIED_NOBLESS = "SELECT charId from olympiad_nobles_eom WHERE competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_points DESC, competitions_done DESC, competitions_won DESC";
- private static final String GET_EACH_CLASS_LEADER = "SELECT characters.char_name from olympiad_nobles_eom, characters WHERE characters.charId = olympiad_nobles_eom.charId AND olympiad_nobles_eom.class_id = ? AND olympiad_nobles_eom.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles_eom.olympiad_points DESC, olympiad_nobles_eom.competitions_done DESC, olympiad_nobles_eom.competitions_won DESC LIMIT 10";
- private static final String GET_EACH_CLASS_LEADER_CURRENT = "SELECT characters.char_name from olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND olympiad_nobles.class_id = ? AND olympiad_nobles.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC LIMIT 10";
- private static final String GET_EACH_CLASS_LEADER_SOULHOUND = "SELECT characters.char_name from olympiad_nobles_eom, characters WHERE characters.charId = olympiad_nobles_eom.charId AND (olympiad_nobles_eom.class_id = ? OR olympiad_nobles_eom.class_id = 133) AND olympiad_nobles_eom.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles_eom.olympiad_points DESC, olympiad_nobles_eom.competitions_done DESC, olympiad_nobles_eom.competitions_won DESC LIMIT 10";
- private static final String GET_EACH_CLASS_LEADER_CURRENT_SOULHOUND = "SELECT characters.char_name from olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND (olympiad_nobles.class_id = ? OR olympiad_nobles.class_id = 133) AND olympiad_nobles.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC LIMIT 10";
+ private static final String OLYMPIAD_GET_HEROS = "SELECT olympiad_nobles.charId, characters.char_name FROM olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND olympiad_nobles.class_id = ? AND olympiad_nobles.competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " AND olympiad_nobles.competitions_won > 0 ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC";
+ private static final String OLYMPIAD_GET_LEGEND = "SELECT olympiad_nobles.charId FROM olympiad_nobles WHERE olympiad_nobles.competitions_done >=" + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC LIMIT 1";
+ private static final String GET_ALL_CLASSIFIED_NOBLESS = "SELECT charId from olympiad_nobles_eom WHERE competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_points DESC, competitions_done DESC, competitions_won DESC";
+ private static final String GET_EACH_CLASS_LEADER = "SELECT characters.char_name from olympiad_nobles_eom, characters WHERE characters.charId = olympiad_nobles_eom.charId AND olympiad_nobles_eom.class_id = ? AND olympiad_nobles_eom.competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_nobles_eom.olympiad_points DESC, olympiad_nobles_eom.competitions_done DESC, olympiad_nobles_eom.competitions_won DESC LIMIT 10";
+ private static final String GET_EACH_CLASS_LEADER_CURRENT = "SELECT characters.char_name from olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND olympiad_nobles.class_id = ? AND olympiad_nobles.competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC LIMIT 10";
+ private static final String GET_EACH_CLASS_LEADER_SOULHOUND = "SELECT characters.char_name from olympiad_nobles_eom, characters WHERE characters.charId = olympiad_nobles_eom.charId AND (olympiad_nobles_eom.class_id = ? OR olympiad_nobles_eom.class_id = 133) AND olympiad_nobles_eom.competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_nobles_eom.olympiad_points DESC, olympiad_nobles_eom.competitions_done DESC, olympiad_nobles_eom.competitions_won DESC LIMIT 10";
+ private static final String GET_EACH_CLASS_LEADER_CURRENT_SOULHOUND = "SELECT characters.char_name from olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND (olympiad_nobles.class_id = ? OR olympiad_nobles.class_id = 133) AND olympiad_nobles.competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC LIMIT 10";
private static final String REMOVE_UNCLAIMED_POINTS = "DELETE FROM character_variables WHERE charId=? AND var=?";
private static final String INSERT_UNCLAIMED_POINTS = "INSERT INTO character_variables (charId, var, val) VALUES (?, ?, ?)";
@@ -87,14 +88,13 @@ public class Olympiad extends ListenersContainer
private static final Set HERO_IDS = CategoryData.getInstance().getCategoryByType(CategoryType.SIXTH_CLASS_GROUP);
- private static final int COMP_START = Config.ALT_OLY_START_TIME; // 6PM
- private static final int COMP_MIN = Config.ALT_OLY_MIN; // 00 mins
- private static final long COMP_PERIOD = Config.ALT_OLY_CPERIOD; // 6 hours
- protected static final long WEEKLY_PERIOD = Config.ALT_OLY_WPERIOD; // 1 week
- protected static final long VALIDATION_PERIOD = Config.ALT_OLY_VPERIOD; // 24 hours
+ private static final int COMP_START = Config.OLYMPIAD_START_TIME; // 6PM
+ private static final int COMP_MIN = Config.OLYMPIAD_MIN; // 00 mins
+ private static final long COMP_PERIOD = Config.OLYMPIAD_CPERIOD; // 6 hours
+ protected static final long WEEKLY_PERIOD = Config.OLYMPIAD_WPERIOD; // 1 week
+ protected static final long VALIDATION_PERIOD = Config.OLYMPIAD_VPERIOD; // 24 hours
- public static final int DEFAULT_POINTS = Config.ALT_OLY_START_POINTS;
- protected static final int WEEKLY_POINTS = Config.ALT_OLY_WEEKLY_POINTS;
+ public static final int DEFAULT_POINTS = Config.OLYMPIAD_START_POINTS;
public static final String CHAR_ID = "charId";
public static final String CLASS_ID = "class_id";
@@ -131,12 +131,19 @@ public class Olympiad extends ListenersContainer
protected Olympiad()
{
- load();
- AntiFeedManager.getInstance().registerEvent(AntiFeedManager.OLYMPIAD_ID);
-
- if (_period == 0)
+ if (Config.OLYMPIAD_ENABLED)
{
- init();
+ load();
+ AntiFeedManager.getInstance().registerEvent(AntiFeedManager.OLYMPIAD_ID);
+
+ if (_period == 0)
+ {
+ init();
+ }
+ }
+ else
+ {
+ LOGGER.log(Level.INFO, "Disabled.");
}
}
@@ -399,7 +406,7 @@ public class Olympiad extends ListenersContainer
int dayCounter = 0;
for (int i = currentDay; i < 8; i++)
{
- if (Config.ALT_OLY_COMPETITION_DAYS.contains(i))
+ if (Config.OLYMPIAD_COMPETITION_DAYS.contains(i))
{
dayFound = true;
break;
@@ -410,7 +417,7 @@ public class Olympiad extends ListenersContainer
{
for (int i = 1; i < 8; i++)
{
- if (Config.ALT_OLY_COMPETITION_DAYS.contains(i))
+ if (Config.OLYMPIAD_COMPETITION_DAYS.contains(i))
{
break;
}
@@ -514,19 +521,24 @@ public class Olympiad extends ListenersContainer
_scheduledCompStart = ThreadPool.schedule(() ->
{
- if (isOlympiadEnd())
+ if (isOlympiadEnd() || !Config.OLYMPIAD_ENABLED)
{
return;
}
_inCompPeriod = true;
+ for (Player player : World.getInstance().getPlayers())
+ {
+ player.sendPacket(new ExOlympiadInfo(1));
+ }
+
Broadcast.toAllOnlinePlayers(new SystemMessage(SystemMessageId.THE_OLYMPIAD_HAS_BEGAN));
LOGGER.info("Olympiad System: Olympiad Games have started.");
LOGGER_OLYMPIAD.info("Result,Player1,Player2,Player1 HP,Player2 HP,Player1 Damage,Player2 Damage,Points,Classed");
_gameManager = ThreadPool.scheduleAtFixedRate(OlympiadGameManager.getInstance(), 30000, 30000);
- if (Config.ALT_OLY_ANNOUNCE_GAMES)
+ if (Config.OLYMPIAD_ANNOUNCE_GAMES)
{
_gameAnnouncer = ThreadPool.scheduleAtFixedRate(new OlympiadAnnouncer(), 30000, 500);
}
@@ -543,7 +555,14 @@ public class Olympiad extends ListenersContainer
{
return;
}
+
_inCompPeriod = false;
+
+ for (Player player : World.getInstance().getPlayers())
+ {
+ player.sendPacket(new ExOlympiadInfo(0));
+ }
+
Broadcast.toAllOnlinePlayers(new SystemMessage(SystemMessageId.BATTLES_IN_THE_OLYMPIAD_GAMES_ARE_NOW_OVER));
LOGGER.info("Olympiad System: Olympiad games have ended.");
@@ -624,33 +643,33 @@ public class Olympiad extends ListenersContainer
final Calendar nextChange = Calendar.getInstance();
- switch (Config.ALT_OLY_PERIOD)
+ switch (Config.OLYMPIAD_PERIOD)
{
case "DAY":
{
- currentTime.add(Calendar.DAY_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
+ currentTime.add(Calendar.DAY_OF_MONTH, Config.OLYMPIAD_PERIOD_MULTIPLIER);
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
- if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 14)
+ if (Config.OLYMPIAD_PERIOD_MULTIPLIER >= 14)
{
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
}
- else if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 7)
+ else if (Config.OLYMPIAD_PERIOD_MULTIPLIER >= 7)
{
_nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2);
}
else
{
- LOGGER.warning("Invalid config value for Config.ALT_OLY_PERIOD_MULTIPLIER, must be >= 7");
+ LOGGER.warning("Invalid config value for Config.OLYMPIAD_PERIOD_MULTIPLIER, must be >= 7");
}
break;
}
case "WEEK":
{
- currentTime.add(Calendar.WEEK_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
+ currentTime.add(Calendar.WEEK_OF_MONTH, Config.OLYMPIAD_PERIOD_MULTIPLIER);
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
- if (Config.ALT_OLY_PERIOD_MULTIPLIER > 1)
+ if (Config.OLYMPIAD_PERIOD_MULTIPLIER > 1)
{
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
}
@@ -662,7 +681,7 @@ public class Olympiad extends ListenersContainer
}
case "MONTH":
{
- currentTime.add(Calendar.MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
+ currentTime.add(Calendar.MONTH, Config.OLYMPIAD_PERIOD_MULTIPLIER);
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
@@ -719,7 +738,7 @@ public class Olympiad extends ListenersContainer
int dayCounter = 0;
for (int i = currentDay; i < 8; i++)
{
- if (Config.ALT_OLY_COMPETITION_DAYS.contains(i))
+ if (Config.OLYMPIAD_COMPETITION_DAYS.contains(i))
{
dayFound = true;
break;
@@ -730,7 +749,7 @@ public class Olympiad extends ListenersContainer
{
for (int i = 1; i < 8; i++)
{
- if (Config.ALT_OLY_COMPETITION_DAYS.contains(i))
+ if (Config.OLYMPIAD_COMPETITION_DAYS.contains(i))
{
break;
}
@@ -769,8 +788,6 @@ public class Olympiad extends ListenersContainer
{
_scheduledWeeklyTask = ThreadPool.scheduleAtFixedRate(() ->
{
- addWeeklyPoints();
- LOGGER.info("Olympiad System: Added weekly points to nobles");
resetWeeklyMatches();
LOGGER.info("Olympiad System: Reset weekly matches to nobles");
@@ -778,22 +795,6 @@ public class Olympiad extends ListenersContainer
}, getMillisToWeekChange(), WEEKLY_PERIOD);
}
- protected synchronized void addWeeklyPoints()
- {
- if (_period == 1)
- {
- return;
- }
-
- int currentPoints;
- for (StatSet nobleInfo : NOBLES.values())
- {
- currentPoints = nobleInfo.getInt(POINTS);
- currentPoints += WEEKLY_POINTS;
- nobleInfo.set(POINTS, currentPoints);
- }
- }
-
/**
* Resets number of matches, classed matches, non classed matches, team matches done by noble characters in the week.
*/
@@ -1036,7 +1037,7 @@ public class Olympiad extends ListenersContainer
public List getClassLeaderBoard(int classId)
{
final List names = new ArrayList<>();
- final String query = Config.ALT_OLY_SHOW_MONTHLY_WINNERS ? ((classId == 132) ? GET_EACH_CLASS_LEADER_SOULHOUND : GET_EACH_CLASS_LEADER) : ((classId == 132) ? GET_EACH_CLASS_LEADER_CURRENT_SOULHOUND : GET_EACH_CLASS_LEADER_CURRENT);
+ final String query = Config.OLYMPIAD_SHOW_MONTHLY_WINNERS ? ((classId == 132) ? GET_EACH_CLASS_LEADER_SOULHOUND : GET_EACH_CLASS_LEADER) : ((classId == 132) ? GET_EACH_CLASS_LEADER_CURRENT_SOULHOUND : GET_EACH_CLASS_LEADER_CURRENT);
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(query))
{
@@ -1075,33 +1076,33 @@ public class Olympiad extends ListenersContainer
}
// Hero point bonus
- int points = Hero.getInstance().isHero(objectId) || Hero.getInstance().isUnclaimedHero(objectId) ? Config.ALT_OLY_HERO_POINTS : 0;
+ int points = Hero.getInstance().isHero(objectId) || Hero.getInstance().isUnclaimedHero(objectId) ? Config.OLYMPIAD_HERO_POINTS : 0;
// Rank point bonus
switch (NOBLES_RANK.get(objectId))
{
case 1:
{
- points += Config.ALT_OLY_RANK1_POINTS;
+ points += Config.OLYMPIAD_RANK1_POINTS;
break;
}
case 2:
{
- points += Config.ALT_OLY_RANK2_POINTS;
+ points += Config.OLYMPIAD_RANK2_POINTS;
break;
}
case 3:
{
- points += Config.ALT_OLY_RANK3_POINTS;
+ points += Config.OLYMPIAD_RANK3_POINTS;
break;
}
case 4:
{
- points += Config.ALT_OLY_RANK4_POINTS;
+ points += Config.OLYMPIAD_RANK4_POINTS;
break;
}
default:
{
- points += Config.ALT_OLY_RANK5_POINTS;
+ points += Config.OLYMPIAD_RANK5_POINTS;
}
}
@@ -1203,7 +1204,7 @@ public class Olympiad extends ListenersContainer
*/
public int getRemainingWeeklyMatches(int objId)
{
- return Math.max(Config.ALT_OLY_MAX_WEEKLY_MATCHES - getCompetitionDoneWeek(objId), 0);
+ return Math.max(Config.OLYMPIAD_MAX_WEEKLY_MATCHES - getCompetitionDoneWeek(objId), 0);
}
protected void deleteNobles()
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java
index ce206a1675..2eb778a7ee 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java
@@ -41,7 +41,7 @@ public class OlympiadGameClassed extends OlympiadGameNormal
@Override
protected int getDivider()
{
- return Config.ALT_OLY_DIVIDER_CLASSED;
+ return Config.OLYMPIAD_DIVIDER_CLASSED;
}
protected static OlympiadGameClassed createGame(int id, List> classList)
@@ -73,4 +73,13 @@ public class OlympiadGameClassed extends OlympiadGameNormal
}
return null;
}
+
+ /*
+ * (non-Javadoc)
+ * @see org.l2jmobius.gameserver.model.olympiad.AbstractOlympiadGame#validateRound3Winner(org.l2jmobius.gameserver.model.olympiad.OlympiadStadium)
+ */
+ @Override
+ protected void validateRound3Winner(OlympiadStadium stadium)
+ {
+ }
}
\ No newline at end of file
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNonClassed.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNonClassed.java
index ccea7ddce1..cc60cc61fd 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNonClassed.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNonClassed.java
@@ -39,7 +39,7 @@ public class OlympiadGameNonClassed extends OlympiadGameNormal
@Override
protected int getDivider()
{
- return Config.ALT_OLY_DIVIDER_NON_CLASSED;
+ return Config.OLYMPIAD_DIVIDER_NON_CLASSED;
}
protected static OlympiadGameNonClassed createGame(int id, Set list)
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
index aebeb46ec7..127bf96b48 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
@@ -27,7 +27,9 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Rnd;
+import org.l2jmobius.gameserver.enums.OlympiadMode;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -35,11 +37,14 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.impl.olympiad.OnOlympiadMatchResult;
import org.l2jmobius.gameserver.model.instancezone.Instance;
+import org.l2jmobius.gameserver.model.skill.CommonSkill;
+import org.l2jmobius.gameserver.model.skill.SkillCaster;
import org.l2jmobius.gameserver.network.SystemMessageId;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchResult;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadUserInfo;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchInfo;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchResult;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadUserInfo;
/**
* @author GodKratos, Pere, DS
@@ -48,10 +53,19 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
{
protected int _damageP1 = 0;
protected int _damageP2 = 0;
+ protected int _damageP1Final = 0;
+ protected int _damageP2Final = 0;
protected Participant _playerOne;
protected Participant _playerTwo;
+ String round_1_winner;
+ String round_2_winner;
+ String round_3_winner;
+ int player1Wins = 0;
+ int player2Wins = 0;
+ boolean matchEnd;
+
protected OlympiadGameNormal(int id, Participant[] opponents)
{
super(id);
@@ -162,8 +176,25 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
boolean result = true;
try
{
- result &= portPlayerToArena(_playerOne, spawns.get(0), _stadiumId, instance);
- result &= portPlayerToArena(_playerTwo, spawns.get(spawns.size() / 2), _stadiumId, instance);
+ result &= portPlayerToArena(_playerOne, spawns.get(0), _stadiumId, instance, OlympiadMode.BLUE);
+ result &= portPlayerToArena(_playerTwo, spawns.get(spawns.size() / 2), _stadiumId, instance, OlympiadMode.RED);
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, "", e);
+ return false;
+ }
+ return result;
+ }
+
+ @Override
+ protected final boolean portPlayersToSpots(List spawns, Instance instance)
+ {
+ boolean result = true;
+ try
+ {
+ result &= portPlayerToSpot(_playerOne, spawns.get(0), _stadiumId);
+ result &= portPlayerToSpot(_playerTwo, spawns.get(spawns.size() / 2), _stadiumId);
}
catch (Exception e)
{
@@ -332,6 +363,407 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
return playerOneLost || playerTwoLost;
}
+ @Override
+ public final boolean roundWinner()
+ {
+ if (!checkBattleStatus())
+ {
+ return true;
+ }
+
+ boolean playerOneLost = true;
+ try
+ {
+ if (_playerOne.getPlayer().getOlympiadGameId() == _stadiumId)
+ {
+ playerOneLost = _playerOne.getPlayer().isDead();
+ }
+ }
+ catch (Exception e)
+ {
+ playerOneLost = true;
+ }
+
+ boolean playerTwoLost = true;
+ try
+ {
+ if (_playerTwo.getPlayer().getOlympiadGameId() == _stadiumId)
+ {
+ playerTwoLost = _playerTwo.getPlayer().isDead();
+ }
+ }
+ catch (Exception e)
+ {
+ playerTwoLost = true;
+ }
+
+ return playerOneLost || playerTwoLost;
+ }
+
+ @Override
+ public void matchEnd(boolean value)
+ {
+ matchEnd = value;
+ }
+
+ @Override
+ public boolean isMatchEnd()
+ {
+ return matchEnd;
+ }
+
+ @Override
+ protected void validateRound1Winner(OlympiadStadium stadium)
+ {
+ if (_aborted)
+ {
+ return;
+ }
+
+ SystemMessage sm;
+
+ try
+ {
+ double playerOneHp = 0;
+ if ((_playerOne.getPlayer() != null) && !_playerOne.getPlayer().isDead())
+ {
+ playerOneHp = _playerOne.getPlayer().getCurrentHp() + _playerOne.getPlayer().getCurrentCp();
+ if (playerOneHp < 0.5)
+ {
+ playerOneHp = 0;
+ }
+ }
+
+ double playerTwoHp = 0;
+ if ((_playerTwo.getPlayer() != null) && !_playerTwo.getPlayer().isDead())
+ {
+ playerTwoHp = _playerTwo.getPlayer().getCurrentHp() + _playerTwo.getPlayer().getCurrentCp();
+ if (playerTwoHp < 0.5)
+ {
+ playerTwoHp = 0;
+ }
+ }
+
+ // if players crashed, search if they've relogged
+ _playerOne.updatePlayer();
+ _playerTwo.updatePlayer();
+
+ _damageP1Final += _damageP1;
+ _damageP2Final += _damageP2;
+
+ if (((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline()) && ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline()))
+ {
+ _playerOne.updateStat(COMP_DRAWN, 1);
+ _playerTwo.updateStat(COMP_DRAWN, 1);
+ sm = new SystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
+ stadium.broadcastPacket(sm);
+ }
+ else if ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerOne.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerTwo.getPlayer().setCurrentCp(_playerTwo.getPlayer().getMaxCp() * 0.7);
+ _playerTwo.getPlayer().setCurrentHp(_playerTwo.getPlayer().getMaxHp() * 0.7);
+ _playerTwo.getPlayer().setCurrentMp(_playerTwo.getPlayer().getMaxMp() * 0.7);
+ _playerTwo.getPlayer().sendPacket(loose);
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 0, 1, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 0, 1, 20));
+ ThreadPool.schedule(() ->
+ {
+ SkillCaster.triggerCast(_playerOne.getPlayer(), _playerOne.getPlayer(), CommonSkill.OLYMPIAD_WIN.getSkill());
+ }, 2000);
+ ThreadPool.schedule(() ->
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 0, 1, 100));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 0, 1, 100));
+ }, 20000);
+ round_1_winner = _playerOne.getName();
+ player1Wins += 1;
+ }
+ else if ((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline() || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP2 > _damageP1) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerTwo.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerOne.getPlayer().sendPacket(loose);
+ _playerOne.getPlayer().setCurrentCp(_playerOne.getPlayer().getMaxCp() * 0.7);
+ _playerOne.getPlayer().setCurrentHp(_playerOne.getPlayer().getMaxHp() * 0.7);
+ _playerOne.getPlayer().setCurrentMp(_playerOne.getPlayer().getMaxMp() * 0.7);
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 1, 1, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 1, 1, 20));
+ ThreadPool.schedule(() ->
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 1, 1, 100));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 1, 1, 100));
+ }, 20000);
+ ThreadPool.schedule(() ->
+ {
+ _playerTwo.getPlayer().useMagic(CommonSkill.OLYMPIAD_WIN.getSkill(), null, false, false);
+ }, 2000);
+ round_1_winner = _playerTwo.getName();
+ player2Wins += 1;
+ }
+ else
+ {
+ round_1_winner = null;
+ final SystemMessage _tie = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIE);
+ _playerTwo.getPlayer().broadcastPacket(_tie);
+ _playerOne.getPlayer().broadcastPacket(_tie);
+ }
+ resetDamage();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, "Exception on validateRound1Winner(): " + e.getMessage(), e);
+ }
+ }
+
+ @Override
+ protected void validateRound2Winner(OlympiadStadium stadium)
+ {
+ if (_aborted)
+ {
+ return;
+ }
+
+ SystemMessage sm;
+
+ try
+ {
+ double playerOneHp = 0;
+ if ((_playerOne.getPlayer() != null) && !_playerOne.getPlayer().isDead())
+ {
+ playerOneHp = _playerOne.getPlayer().getCurrentHp() + _playerOne.getPlayer().getCurrentCp();
+ if (playerOneHp < 0.5)
+ {
+ playerOneHp = 0;
+ }
+ }
+
+ double playerTwoHp = 0;
+ if ((_playerTwo.getPlayer() != null) && !_playerTwo.getPlayer().isDead())
+ {
+ playerTwoHp = _playerTwo.getPlayer().getCurrentHp() + _playerTwo.getPlayer().getCurrentCp();
+ if (playerTwoHp < 0.5)
+ {
+ playerTwoHp = 0;
+ }
+ }
+
+ // if players crashed, search if they've relogged
+ _playerOne.updatePlayer();
+ _playerTwo.updatePlayer();
+
+ _damageP1Final += _damageP1;
+ _damageP2Final += _damageP2;
+
+ if (((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline()) && ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline()))
+ {
+ _playerOne.updateStat(COMP_DRAWN, 1);
+ _playerTwo.updateStat(COMP_DRAWN, 1);
+ sm = new SystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
+ stadium.broadcastPacket(sm);
+ }
+ else if ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerOne.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerTwo.getPlayer().sendPacket(loose);
+ round_2_winner = _playerOne.getName();
+ player1Wins += 1;
+
+ if (round_1_winner.toLowerCase().equalsIgnoreCase(_playerOne.getName()))
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 0, 2, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 0, 2, 20));
+ matchEnd(true);
+ }
+ else
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 20));
+ ThreadPool.schedule(() ->
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 100));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 100));
+ }, 20000);
+ }
+ ThreadPool.schedule(() ->
+ {
+ SkillCaster.triggerCast(_playerOne.getPlayer(), _playerOne.getPlayer(), CommonSkill.OLYMPIAD_WIN.getSkill());
+ }, 2000);
+ }
+ else if ((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline() || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP2 > _damageP1) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerTwo.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerOne.getPlayer().sendPacket(loose);
+ round_2_winner = _playerTwo.getName();
+ player2Wins += 1;
+
+ if (round_1_winner.toLowerCase().equalsIgnoreCase(_playerTwo.getName()))
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 2, 2, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 2, 2, 20));
+ matchEnd(true);
+ }
+ else
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 20));
+ ThreadPool.schedule(() ->
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 100));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 100));
+ }, 20000);
+ }
+ ThreadPool.schedule(() ->
+ {
+ _playerTwo.getPlayer().useMagic(CommonSkill.OLYMPIAD_WIN.getSkill(), null, false, false);
+ }, 2000);
+ }
+ else
+ {
+ final SystemMessage _tie = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIE);
+ _playerTwo.getPlayer().broadcastPacket(_tie);
+ _playerOne.getPlayer().broadcastPacket(_tie);
+ }
+ resetDamage();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, "Exception on validateRound2Winner(): " + e.getMessage(), e);
+ }
+ }
+
+ @Override
+ protected void validateRound3Winner(OlympiadStadium stadium)
+ {
+ if (_aborted)
+ {
+ return;
+ }
+
+ SystemMessage sm;
+
+ try
+ {
+ double playerOneHp = 0;
+ if ((_playerOne.getPlayer() != null) && !_playerOne.getPlayer().isDead())
+ {
+ playerOneHp = _playerOne.getPlayer().getCurrentHp() + _playerOne.getPlayer().getCurrentCp();
+ if (playerOneHp < 0.5)
+ {
+ playerOneHp = 0;
+ }
+ }
+
+ double playerTwoHp = 0;
+ if ((_playerTwo.getPlayer() != null) && !_playerTwo.getPlayer().isDead())
+ {
+ playerTwoHp = _playerTwo.getPlayer().getCurrentHp() + _playerTwo.getPlayer().getCurrentCp();
+ if (playerTwoHp < 0.5)
+ {
+ playerTwoHp = 0;
+ }
+ }
+
+ // if players crashed, search if they've relogged
+ _playerOne.updatePlayer();
+ _playerTwo.updatePlayer();
+
+ _damageP1Final += _damageP1;
+ _damageP2Final += _damageP2;
+
+ if (((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline()) && ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline()))
+ {
+ _playerOne.updateStat(COMP_DRAWN, 1);
+ _playerTwo.updateStat(COMP_DRAWN, 1);
+ sm = new SystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
+ stadium.broadcastPacket(sm);
+ }
+ else if ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerOne.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerTwo.getPlayer().sendPacket(loose);
+ round_3_winner = _playerOne.getName();
+ player1Wins += 1;
+ if (round_3_winner.toLowerCase().equalsIgnoreCase(_playerOne.getName()))
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 1, 3, 0));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 1, 3, 0));
+ }
+ else
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 2, 3, 0));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 2, 3, 0));
+ }
+ ThreadPool.schedule(() ->
+ {
+ SkillCaster.triggerCast(_playerOne.getPlayer(), _playerOne.getPlayer(), CommonSkill.OLYMPIAD_WIN.getSkill());
+ }, 2000);
+
+ }
+ else if ((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline() || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP2 > _damageP1) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerTwo.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerOne.getPlayer().sendPacket(loose);
+ round_3_winner = _playerTwo.getName();
+ player2Wins += 1;
+ if (round_3_winner.toLowerCase().equalsIgnoreCase(_playerTwo.getName()))
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 2, 3, 0));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 2, 3, 0));
+ }
+ else
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 1, 3, 0));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 1, 3, 0));
+ }
+ ThreadPool.schedule(() ->
+ {
+ SkillCaster.triggerCast(_playerTwo.getPlayer(), _playerTwo.getPlayer(), CommonSkill.OLYMPIAD_WIN.getSkill());
+ }, 2000);
+ }
+ else
+ {
+ final SystemMessage _tie = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIE);
+ _playerTwo.getPlayer().broadcastPacket(_tie);
+ _playerOne.getPlayer().broadcastPacket(_tie);
+ }
+ resetDamage();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, "Exception on validateRound3Winner(): " + e.getMessage(), e);
+ }
+ }
+
@Override
protected void validateWinner(OlympiadStadium stadium)
{
@@ -342,7 +774,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
ExOlympiadMatchResult result = null;
- boolean tie = false;
+ boolean tie = round_1_winner == null ? true : false;
int winside = 0;
final List list1 = new ArrayList<>(1);
@@ -358,9 +790,9 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
{
pointDiff = 1;
}
- else if (pointDiff > Config.ALT_OLY_MAX_POINTS)
+ else if (pointDiff > Config.OLYMPIAD_MAX_POINTS)
{
- pointDiff = Config.ALT_OLY_MAX_POINTS;
+ pointDiff = Config.OLYMPIAD_MAX_POINTS;
}
int points;
@@ -375,13 +807,13 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
{
try
{
- points = Math.min(playerOnePoints / 3, Config.ALT_OLY_MAX_POINTS);
+ points = Math.min(playerOnePoints / 3, Config.OLYMPIAD_MAX_POINTS);
removePointsFromParticipant(_playerOne, points);
list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints - points, -points));
winside = 2;
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info(_playerOne.getName() + " default," + _playerOne + "," + _playerTwo + ",0,0,0,0," + points + "," + getType());
}
@@ -395,7 +827,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
{
try
{
- points = Math.min(playerTwoPoints / 3, Config.ALT_OLY_MAX_POINTS);
+ points = Math.min(playerTwoPoints / 3, Config.OLYMPIAD_MAX_POINTS);
removePointsFromParticipant(_playerTwo, points);
list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints - points, -points));
@@ -408,7 +840,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
winside = 1;
}
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info(_playerTwo.getName() + " default," + _playerOne + "," + _playerTwo + ",0,0,0,0," + points + "," + getType());
}
@@ -420,11 +852,11 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
}
if (winside == 1)
{
- result = new ExOlympiadMatchResult(tie, winside, list1, list2);
+ result = new ExOlympiadMatchResult(tie, winside, list1, list2, 0, 0, 0);
}
else
{
- result = new ExOlympiadMatchResult(tie, winside, list2, list1);
+ result = new ExOlympiadMatchResult(tie, winside, list2, list1, 0, 0, 0);
}
stadium.broadcastPacket(result);
return;
@@ -449,17 +881,17 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_playerOne.updateStat(COMP_WON, 1);
addPointsToParticipant(_playerOne, pointDiff);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints + pointDiff, pointDiff));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints + pointDiff, pointDiff));
_playerTwo.updateStat(COMP_LOST, 1);
removePointsFromParticipant(_playerTwo, pointDiff);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints - pointDiff, -pointDiff));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints - pointDiff, -pointDiff));
winside = 1;
- rewardParticipant(_playerOne.getPlayer(), Config.ALT_OLY_WINNER_REWARD); // Winner
+ rewardParticipant(_playerOne.getPlayer(), Config.OLYMPIAD_WINNER_REWARD); // Winner
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info(_playerTwo.getName() + " crash," + _playerOne + "," + _playerTwo + ",0,0,0,0," + pointDiff + "," + getType());
}
@@ -475,17 +907,17 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_playerTwo.updateStat(COMP_WON, 1);
addPointsToParticipant(_playerTwo, pointDiff);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints + pointDiff, pointDiff));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints + pointDiff, pointDiff));
_playerOne.updateStat(COMP_LOST, 1);
removePointsFromParticipant(_playerOne, pointDiff);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints - pointDiff, -pointDiff));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints - pointDiff, -pointDiff));
winside = 2;
- rewardParticipant(_playerTwo.getPlayer(), Config.ALT_OLY_WINNER_REWARD); // Winner
+ rewardParticipant(_playerTwo.getPlayer(), Config.OLYMPIAD_WINNER_REWARD); // Winner
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info(_playerOne.getName() + " crash," + _playerOne + "," + _playerTwo + ",0,0,0,0," + pointDiff + "," + getType());
}
@@ -498,15 +930,15 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_playerOne.updateStat(COMP_LOST, 1);
removePointsFromParticipant(_playerOne, pointDiff);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints - pointDiff, -pointDiff));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints - pointDiff, -pointDiff));
_playerTwo.updateStat(COMP_LOST, 1);
removePointsFromParticipant(_playerTwo, pointDiff);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints - pointDiff, -pointDiff));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints - pointDiff, -pointDiff));
tie = true;
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info("both crash," + _playerOne.getName() + "," + _playerOne + ",0,0,0,0," + _playerTwo + "," + pointDiff + "," + getType());
}
@@ -519,11 +951,11 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
if (winside == 1)
{
- result = new ExOlympiadMatchResult(tie, winside, list1, list2);
+ result = new ExOlympiadMatchResult(tie, winside, list1, list2, 0, 0, 0);
}
else
{
- result = new ExOlympiadMatchResult(tie, winside, list2, list1);
+ result = new ExOlympiadMatchResult(tie, winside, list2, list1, 0, 0, 0);
}
stadium.broadcastPacket(result);
@@ -577,7 +1009,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
sm = new SystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
stadium.broadcastPacket(sm);
}
- else if ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
+ else if ((player1Wins == 2) || (_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
{
sm = new SystemMessage(SystemMessageId.CONGRATULATIONS_C1_YOU_WIN_THE_MATCH);
sm.addString(_playerOne.getName());
@@ -587,10 +1019,10 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_playerTwo.updateStat(COMP_LOST, 1);
addPointsToParticipant(_playerOne, pointDiff);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints + pointDiff, pointDiff));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints + pointDiff, pointDiff));
removePointsFromParticipant(_playerTwo, pointDiff);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints - pointDiff, -pointDiff));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints - pointDiff, -pointDiff));
winner = _playerOne.getName() + " won";
winside = 1;
@@ -598,13 +1030,13 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
// Save Fight Result
saveResults(_playerOne, _playerTwo, 1, _startTime, _fightTime, getType());
- rewardParticipant(_playerOne.getPlayer(), Config.ALT_OLY_WINNER_REWARD); // Winner
- rewardParticipant(_playerTwo.getPlayer(), Config.ALT_OLY_LOSER_REWARD); // Loser
+ rewardParticipant(_playerOne.getPlayer(), Config.OLYMPIAD_WINNER_REWARD); // Winner
+ rewardParticipant(_playerTwo.getPlayer(), Config.OLYMPIAD_LOSER_REWARD); // Loser
// Notify to scripts
EventDispatcher.getInstance().notifyEventAsync(new OnOlympiadMatchResult(_playerOne, _playerTwo, getType()), Olympiad.getInstance());
}
- else if ((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline() || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
+ else if ((player2Wins == 2) || (_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline() || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
{
sm = new SystemMessage(SystemMessageId.CONGRATULATIONS_C1_YOU_WIN_THE_MATCH);
sm.addString(_playerTwo.getName());
@@ -614,10 +1046,10 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_playerOne.updateStat(COMP_LOST, 1);
addPointsToParticipant(_playerTwo, pointDiff);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints + pointDiff, pointDiff));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints + pointDiff, pointDiff));
removePointsFromParticipant(_playerOne, pointDiff);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints - pointDiff, -pointDiff));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints - pointDiff, -pointDiff));
winner = _playerTwo.getName() + " won";
winside = 2;
@@ -625,8 +1057,8 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
// Save Fight Result
saveResults(_playerOne, _playerTwo, 2, _startTime, _fightTime, getType());
- rewardParticipant(_playerTwo.getPlayer(), Config.ALT_OLY_WINNER_REWARD); // Winner
- rewardParticipant(_playerOne.getPlayer(), Config.ALT_OLY_LOSER_REWARD); // Loser
+ rewardParticipant(_playerTwo.getPlayer(), Config.OLYMPIAD_WINNER_REWARD); // Winner
+ rewardParticipant(_playerOne.getPlayer(), Config.OLYMPIAD_LOSER_REWARD); // Loser
// Notify to scripts
EventDispatcher.getInstance().notifyEventAsync(new OnOlympiadMatchResult(_playerTwo, _playerOne, getType()), Olympiad.getInstance());
@@ -639,14 +1071,14 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
sm = new SystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
stadium.broadcastPacket(sm);
- int value = Math.min(playerOnePoints / getDivider(), Config.ALT_OLY_MAX_POINTS);
+ int value = Math.min(playerOnePoints / getDivider(), Config.OLYMPIAD_MAX_POINTS);
removePointsFromParticipant(_playerOne, value);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints - value, -value));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints - value, -value));
- value = Math.min(playerTwoPoints / getDivider(), Config.ALT_OLY_MAX_POINTS);
+ value = Math.min(playerTwoPoints / getDivider(), Config.OLYMPIAD_MAX_POINTS);
removePointsFromParticipant(_playerTwo, value);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints - value, -value));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints - value, -value));
tie = true;
}
@@ -658,15 +1090,16 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
if (winside == 1)
{
- result = new ExOlympiadMatchResult(tie, winside, list1, list2);
+ result = new ExOlympiadMatchResult(tie, winside, list1, list2, round_1_winner.equalsIgnoreCase(_playerOne.getName()) ? 2 : 3, round_2_winner.equalsIgnoreCase(_playerOne.getName()) ? 2 : 3, (round_3_winner != null) && round_3_winner.equalsIgnoreCase(_playerOne.getName()) ? 2 : (round_3_winner == null) ? 0 : 3);
}
else
{
- result = new ExOlympiadMatchResult(tie, winside, list2, list1);
+ result = new ExOlympiadMatchResult(tie, winside, list2, list1, round_1_winner.equalsIgnoreCase(_playerTwo.getName()) ? 3 : 2, round_2_winner.equalsIgnoreCase(_playerTwo.getName()) ? 3 : 2, (round_3_winner != null) && round_3_winner.equalsIgnoreCase(_playerTwo.getName()) ? 3 : (round_3_winner == null) ? 0 : 2);
}
+
stadium.broadcastPacket(result);
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info(winner + "," + _playerOne.getName() + "," + _playerOne + "," + _playerTwo + "," + playerOneHp + "," + playerTwoHp + "," + _damageP1 + "," + _damageP2 + "," + pointDiff + "," + getType());
}
@@ -750,6 +1183,13 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_damageP2 = 0;
}
+ @Override
+ public void resetDamageFinal()
+ {
+ _damageP1Final = 0;
+ _damageP2Final = 0;
+ }
+
protected void saveResults(Participant one, Participant two, int winner, long startTime, long fightTime, CompetitionType type)
{
try (Connection con = DatabaseFactory.getConnection();
@@ -791,6 +1231,47 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
}
}
+ @Override
+ protected void buffPlayers()
+ {
+ final Player player1 = _playerOne.getPlayer();
+ if (player1 != null)
+ {
+ SkillCaster.triggerCast(player1, player1, CommonSkill.OLYMPIAD_HORN_MELODY.getSkill());
+ SkillCaster.triggerCast(player1, player1, CommonSkill.OLYMPIAD_DRUM_MELODY.getSkill());
+ SkillCaster.triggerCast(player1, player1, CommonSkill.OLYMPIAD_PIPE_ORGAN_MELODY.getSkill());
+ SkillCaster.triggerCast(player1, player1, CommonSkill.OLYMPIAD_GUITAR_MELODY.getSkill());
+ SkillCaster.triggerCast(player1, player1, CommonSkill.OLYMPIAD_HARMONY.getSkill());
+ }
+
+ final Player player2 = _playerTwo.getPlayer();
+ if (player2 != null)
+ {
+ SkillCaster.triggerCast(player2, player2, CommonSkill.OLYMPIAD_HORN_MELODY.getSkill());
+ SkillCaster.triggerCast(player2, player2, CommonSkill.OLYMPIAD_DRUM_MELODY.getSkill());
+ SkillCaster.triggerCast(player2, player2, CommonSkill.OLYMPIAD_PIPE_ORGAN_MELODY.getSkill());
+ SkillCaster.triggerCast(player2, player2, CommonSkill.OLYMPIAD_GUITAR_MELODY.getSkill());
+ SkillCaster.triggerCast(player2, player2, CommonSkill.OLYMPIAD_HARMONY.getSkill());
+ }
+ }
+
+ @Override
+ protected void roundTwoCleanUp()
+ {
+ ThreadPool.schedule(() ->
+ {
+ if ((_playerOne.getPlayer() != null) && !_playerOne.isDefaulted() && !_playerOne.isDisconnected() && (_playerOne.getPlayer().getOlympiadGameId() == _stadiumId))
+ {
+ roundTwoClean(_playerOne.getPlayer());
+ }
+
+ if ((_playerTwo.getPlayer() != null) && !_playerTwo.isDefaulted() && !_playerTwo.isDisconnected() && (_playerTwo.getPlayer().getOlympiadGameId() == _stadiumId))
+ {
+ roundTwoClean(_playerTwo.getPlayer());
+ }
+ }, 1000);
+ }
+
@Override
protected void untransformPlayers()
{
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameState.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameState.java
index f5706a922a..074be05d14 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameState.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameState.java
@@ -24,7 +24,13 @@ enum OlympiadGameState
BATTLE_COUNTDOWN_FIRST,
BATTLE_COUNTDOWN_SECOND,
BATTLE_STARTED,
+ ROUND_1,
+ WAIT_TIME_1,
+ ROUND_2,
+ WAIT_TIME_2,
+ ROUND_3,
BATTLE_IN_PROGRESS,
+ ROUND_ENDED,
GAME_STOPPED,
TELEPORT_TO_TOWN,
CLEANUP,
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
index 437800a8c3..36763f7f88 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
@@ -23,6 +23,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchInfo;
/**
* @author DS
@@ -116,7 +117,7 @@ public class OlympiadGameTask implements Runnable
public boolean isBattleStarted()
{
- return _state == OlympiadGameState.BATTLE_IN_PROGRESS;
+ return (_state == OlympiadGameState.BATTLE_IN_PROGRESS) || (_state == OlympiadGameState.ROUND_2) || (_state == OlympiadGameState.ROUND_3);
}
public boolean isBattleFinished()
@@ -163,6 +164,8 @@ public class OlympiadGameTask implements Runnable
{
try
{
+ final String player1 = _game.getPlayerNames()[0];
+ final String player2 = _game.getPlayerNames()[1];
int delay = 1; // schedule next call after 1s
switch (_state)
{
@@ -170,7 +173,7 @@ public class OlympiadGameTask implements Runnable
case BEGIN:
{
_state = OlympiadGameState.TELEPORT_TO_ARENA;
- _countDown = Config.ALT_OLY_WAIT_TIME;
+ _countDown = Config.OLYMPIAD_WAIT_TIME;
break;
}
// Teleport to arena countdown
@@ -198,6 +201,7 @@ public class OlympiadGameTask implements Runnable
// Game start, port players to arena
case GAME_STARTED:
{
+ _stadium.makeZonePvPForCharsInside(false);
if (!startGame())
{
_state = OlympiadGameState.GAME_STOPPED;
@@ -215,7 +219,7 @@ public class OlympiadGameTask implements Runnable
{
if (_countDown > 0)
{
- if (_countDown == 55) // 55sec
+ if (_countDown == 50) // 55sec
{
_game.healPlayers();
}
@@ -232,6 +236,7 @@ public class OlympiadGameTask implements Runnable
{
_game.makePlayersInvul();
_game.resetDamage();
+ _game.resetDamageFinal();
_stadium.openDoors();
_state = OlympiadGameState.BATTLE_COUNTDOWN_SECOND;
@@ -255,15 +260,33 @@ public class OlympiadGameTask implements Runnable
{
_state = OlympiadGameState.BATTLE_STARTED;
_game.removePlayersInvul();
- _stadium.broadcastPacket(new SystemMessage(SystemMessageId.HIDDEN_MSG_START_OLYMPIAD));
}
break;
}
// Beginning of the battle
case BATTLE_STARTED:
{
- _countDown = 0;
+ _countDown = (int) Config.OLYMPIAD_BATTLE / 1000;
+
+ _game.broadcastPacket(new ExOlympiadMatchInfo(player1, player2, 0, 0, 1, 100));
+
+ final SystemMessage round1 = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_ROUND_1);
+ _stadium.broadcastPacket(round1);
+ final SystemMessage start = new SystemMessage(SystemMessageId.HIDDEN_MSG_START_OLYMPIAD);
+ _stadium.broadcastPacket(start);
+ _game.broadcastOlympiadInfo(_stadium);
+ _state = OlympiadGameState.ROUND_1; // set state first, used in zone update
+ if (!startBattle())
+ {
+ _state = OlympiadGameState.GAME_STOPPED;
+ }
+ break;
+ }
+ case ROUND_1:
+ {
_state = OlympiadGameState.BATTLE_IN_PROGRESS; // set state first, used in zone update
+ _countDown = (int) Config.OLYMPIAD_BATTLE / 1000;
+ _stadium.makeZonePvPForCharsInside(true);
if (!startBattle())
{
_state = OlympiadGameState.GAME_STOPPED;
@@ -273,8 +296,8 @@ public class OlympiadGameTask implements Runnable
// Checks during battle
case BATTLE_IN_PROGRESS:
{
- _countDown += 1000;
- final int remaining = (int) ((Config.ALT_OLY_BATTLE - _countDown) / 1000);
+ _countDown -= 1;
+ final int remaining = (int) Config.OLYMPIAD_BATTLE / 1000;
for (int announceTime : BATTLE_END_TIME_SECOND)
{
if (announceTime == remaining)
@@ -285,13 +308,122 @@ public class OlympiadGameTask implements Runnable
break;
}
}
-
- if (checkBattle() || (_countDown > Config.ALT_OLY_BATTLE))
+ if (roundCheck() || (_countDown <= 0))
+ {
+ round1();
+ _game.makePlayersInvul();
+ _state = OlympiadGameState.WAIT_TIME_1;
+ _stadium.makeZonePvPForCharsInside(false);
+ _countDown = 20;
+ }
+ else if (checkBattle())
{
_state = OlympiadGameState.GAME_STOPPED;
}
break;
}
+ case WAIT_TIME_1:
+ {
+ _countDown -= 1;
+ if (_countDown == 14)
+ {
+ _game.buffPlayers();
+ _game.portPlayersToSpots(_stadium.getZone().getSpawns(), _stadium.getInstance());
+ _game.broadcastOlympiadInfo(_stadium);
+ }
+ if (_countDown <= 0)
+ {
+ _game.removePlayersInvul();
+ _state = OlympiadGameState.ROUND_2;
+ _countDown = (int) Config.OLYMPIAD_BATTLE / 1000;
+ final SystemMessage round2 = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_ROUND_2);
+ _stadium.broadcastPacket(round2);
+ final SystemMessage start = new SystemMessage(SystemMessageId.HIDDEN_MSG_START_OLYMPIAD);
+ _stadium.broadcastPacket(start);
+ _stadium.makeZonePvPForCharsInside(true);
+ _game.broadcastOlympiadInfo(_stadium);
+ }
+ break;
+ }
+ case ROUND_2:
+ {
+ _countDown -= 1;
+ final int remaining = (int) Config.OLYMPIAD_BATTLE / 1000;
+ for (int announceTime : BATTLE_END_TIME_SECOND)
+ {
+ if (announceTime == remaining)
+ {
+ final SystemMessage sm = new SystemMessage(SystemMessageId.THE_GAME_ENDS_IN_S1_SEC);
+ sm.addInt(announceTime);
+ _stadium.broadcastPacket(sm);
+ break;
+ }
+ }
+ if (roundCheck() || (_countDown <= 0))
+ {
+ round2();
+ if (_game.isMatchEnd())
+ {
+ _state = OlympiadGameState.GAME_STOPPED;
+ break;
+ }
+ _state = OlympiadGameState.WAIT_TIME_2;
+ _game.makePlayersInvul();
+ _stadium.makeZonePvPForCharsInside(false);
+ _countDown = 20;
+ }
+ else if (checkBattle())
+ {
+ _state = OlympiadGameState.GAME_STOPPED;
+ }
+ break;
+ }
+ case WAIT_TIME_2:
+ {
+ _countDown -= 1;
+ if (_countDown == 14)
+ {
+ _game.buffPlayers();
+ _game.roundTwoCleanUp();
+ _game.broadcastOlympiadInfo(_stadium);
+ _game.portPlayersToSpots(_stadium.getZone().getSpawns(), _stadium.getInstance());
+ }
+ if (_countDown <= 0)
+ {
+ _state = OlympiadGameState.ROUND_3;
+ _game.removePlayersInvul();
+ _countDown = (int) Config.OLYMPIAD_BATTLE / 1000;
+ final SystemMessage round2 = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_ROUND_3);
+ _stadium.broadcastPacket(round2);
+ final SystemMessage start = new SystemMessage(SystemMessageId.HIDDEN_MSG_START_OLYMPIAD);
+ _stadium.broadcastPacket(start);
+ _stadium.makeZonePvPForCharsInside(true);
+ _game.broadcastOlympiadInfo(_stadium);
+ }
+ break;
+ }
+ case ROUND_3:
+ {
+ _countDown -= 1;
+ final int remaining = (int) Config.OLYMPIAD_BATTLE / 1000;
+ for (int announceTime : BATTLE_END_TIME_SECOND)
+ {
+ if (announceTime == remaining)
+ {
+ final SystemMessage sm = new SystemMessage(SystemMessageId.THE_GAME_ENDS_IN_S1_SEC);
+ sm.addInt(announceTime);
+ _stadium.broadcastPacket(sm);
+ break;
+ }
+ }
+ if (roundCheck() || (_countDown <= 0) || checkBattle())
+ {
+ round3();
+ _game.makePlayersInvul();
+ _stadium.makeZonePvPForCharsInside(false);
+ }
+ break;
+ }
// End of the battle
case GAME_STOPPED:
{
@@ -425,7 +557,7 @@ public class OlympiadGameTask implements Runnable
{
// game successfully started
_game.broadcastOlympiadInfo(_stadium);
- _stadium.broadcastPacket(new SystemMessage(SystemMessageId.THE_MATCH_HAS_BEGUN_FIGHT));
+ // _stadium.broadcastPacket(new SystemMessage(SystemMessageId.THE_MATCH_HAS_BEGUN_FIGHT));
_stadium.updateZoneStatusForCharactersInside();
return true;
}
@@ -437,6 +569,82 @@ public class OlympiadGameTask implements Runnable
return false;
}
+ private boolean roundCheck()
+ {
+ try
+ {
+ return _game.roundWinner();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+ return true;
+ }
+
+ private void round1()
+ {
+ try
+ {
+ _game.validateRound1Winner(_stadium);
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+ }
+
+ private void round2()
+ {
+ try
+ {
+ _game.validateRound2Winner(_stadium);
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+ }
+
+ private void round3()
+ {
+ try
+ {
+ _game.validateRound3Winner(_stadium);
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+
+ try
+ {
+ _game.makePlayersInvul();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+
+ try
+ {
+ _stadium.updateZoneStatusForCharactersInside();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+
+ try
+ {
+ _state = OlympiadGameState.GAME_STOPPED;
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+ }
+
/**
* Fifth stage: battle is running, returns true if winner found.
* @return
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadManager.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadManager.java
index acc42aff21..3a0949eb9e 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadManager.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadManager.java
@@ -45,11 +45,6 @@ public class OlympiadManager
{
}
- public static OlympiadManager getInstance()
- {
- return SingletonHolder.INSTANCE;
- }
-
public Set getRegisteredNonClassBased()
{
return _nonClassBasedRegisters;
@@ -65,7 +60,7 @@ public class OlympiadManager
List> result = null;
for (Entry> classList : _classBasedRegisters.entrySet())
{
- if ((classList.getValue() != null) && (classList.getValue().size() >= Config.ALT_OLY_CLASSED))
+ if ((classList.getValue() != null) && (classList.getValue().size() >= Config.OLYMPIAD_CLASSED))
{
if (result == null)
{
@@ -80,7 +75,7 @@ public class OlympiadManager
protected final boolean hasEnoughRegisteredNonClassed()
{
- return _nonClassBasedRegisters.size() >= Config.ALT_OLY_NONCLASSED;
+ return _nonClassBasedRegisters.size() >= Config.OLYMPIAD_NONCLASSED;
}
protected final void clearRegistered()
@@ -341,11 +336,6 @@ public class OlympiadManager
return _nonClassBasedRegisters.size() + _classBasedRegisters.size();
}
- private static class SingletonHolder
- {
- protected static final OlympiadManager INSTANCE = new OlympiadManager();
- }
-
private int getClassGroup(Player player)
{
if (player.isInCategory(CategoryType.SIXTH_TIR_GROUP))
@@ -389,4 +379,14 @@ public class OlympiadManager
return player.getBaseClass();
}
}
+
+ public static OlympiadManager getInstance()
+ {
+ return SingletonHolder.INSTANCE;
+ }
+
+ private static class SingletonHolder
+ {
+ protected static final OlympiadManager INSTANCE = new OlympiadManager();
+ }
}
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java
index 187c1f71be..04c582b581 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java
@@ -31,11 +31,9 @@ import org.l2jmobius.gameserver.model.actor.instance.Door;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.model.zone.type.OlympiadStadiumZone;
-import org.l2jmobius.gameserver.network.SystemMessageId;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchEnd;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadUserInfo;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
-import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchEnd;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadUserInfo;
/**
* @author JIV
@@ -127,6 +125,32 @@ public class OlympiadStadium
}
}
+ public void makeZonePvPForCharsInside(boolean value)
+ {
+ if (_task == null)
+ {
+ return;
+ }
+ if (value)
+ {
+ for (Player player : _instance.getPlayers())
+ {
+ player.setInsideZone(ZoneId.PVP, true);
+ player.setOlympiadStart(true);
+ _task.getGame().sendOlympiadInfo(player);
+ }
+ }
+ else
+ {
+ for (Player player : _instance.getPlayers())
+ {
+ player.setInsideZone(ZoneId.PVP, false);
+ player.setOlympiadStart(false);
+ _task.getGame().sendOlympiadInfo(player);
+ }
+ }
+ }
+
public void updateZoneStatusForCharactersInside()
{
if (_task == null)
@@ -135,15 +159,16 @@ public class OlympiadStadium
}
final boolean battleStarted = _task.isBattleStarted();
- final SystemMessage sm;
- if (battleStarted)
- {
- sm = new SystemMessage(SystemMessageId.YOU_HAVE_ENTERED_A_COMBAT_ZONE);
- }
- else
- {
- sm = new SystemMessage(SystemMessageId.YOU_HAVE_LEFT_A_COMBAT_ZONE);
- }
+ final boolean battleEnded = _task.isBattleFinished();
+ // final SystemMessage sm;
+ // if (battleStarted)
+ // {
+ // sm = new SystemMessage(SystemMessageId.YOU_HAVE_ENTERED_A_COMBAT_ZONE);
+ // }
+ // else
+ // {
+ // sm = new SystemMessage(SystemMessageId.YOU_HAVE_LEFT_A_COMBAT_ZONE);
+ // }
for (Player player : _instance.getPlayers())
{
@@ -155,12 +180,16 @@ public class OlympiadStadium
if (battleStarted)
{
player.setInsideZone(ZoneId.PVP, true);
- player.sendPacket(sm);
+ // player.sendPacket(sm);
}
else
{
player.setInsideZone(ZoneId.PVP, false);
- player.sendPacket(sm);
+ // player.sendPacket(sm);
+ // player.sendPacket(ExOlympiadMatchEnd.STATIC_PACKET);
+ }
+ if (battleEnded)
+ {
player.sendPacket(ExOlympiadMatchEnd.STATIC_PACKET);
}
}
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/skill/CommonSkill.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/skill/CommonSkill.java
index 079965b961..7f9e28d2cc 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/skill/CommonSkill.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/skill/CommonSkill.java
@@ -71,7 +71,13 @@ public enum CommonSkill
EINHASAD_OVERSEEING_3(29413, 3),
EINHASAD_OVERSEEING_4(29413, 4),
EINHASAD_CHAINS(29414, 1),
- TELEPORTATION_CUBE(39723, 1);
+ TELEPORTATION_CUBE(39723, 1),
+ OLYMPIAD_HORN_MELODY(32411, 1),
+ OLYMPIAD_DRUM_MELODY(32412, 1),
+ OLYMPIAD_PIPE_ORGAN_MELODY(32413, 1),
+ OLYMPIAD_GUITAR_MELODY(32414, 1),
+ OLYMPIAD_HARMONY(32415, 1),
+ OLYMPIAD_WIN(32417, 1);
private final SkillHolder _holder;
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/skill/SkillCaster.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/skill/SkillCaster.java
index cfd5aaee4a..933360f107 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/skill/SkillCaster.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/skill/SkillCaster.java
@@ -130,11 +130,16 @@ public class SkillCaster implements Runnable
*/
public static SkillCaster castSkill(Creature caster, WorldObject target, Skill skill, Item item, SkillCastingType castingType, boolean ctrlPressed, boolean shiftPressed)
{
- // Prevent players from attacking before the Olympiad countdown ends. Olympiad Manager NPC is excluded.
if (caster.isPlayer() && caster.getActingPlayer().isInOlympiadMode() && !caster.getActingPlayer().isOlympiadStart() && skill.isBad() && (target != null) && (target.getId() != 36402))
{
return null;
}
+ // Prevent players from attacking before the Olympiad countdown ends. Olympiad Manager NPC is excluded.
+ if (caster.isPlayer() && caster.getActingPlayer().isInOlympiadMode() && !caster.getActingPlayer().isOlympiadStart() && skill.isBad())
+ {
+ return null;
+ }
+
return castSkill(caster, target, skill, item, castingType, ctrlPressed, shiftPressed, -1);
}
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java
index 292794ad91..3dafff1f02 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java
@@ -133,16 +133,16 @@ public interface IStatFunction
{
if (item.isWeapon())
{
- if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT))
+ if ((Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT))
{
- enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT;
+ enchant = Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT;
}
}
else
{
- if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT))
+ if ((Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT))
{
- enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT;
+ enchant = Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT;
}
}
}
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java
index 1bd9892a87..2aa14eb946 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java
@@ -71,6 +71,7 @@ public class PlayerVariables extends AbstractVariables
public static final String HUNTING_ZONE_ENTRY = "HUNTING_ZONE_ENTRY_";
public static final String HUNTING_ZONE_TIME = "HUNTING_ZONE_TIME_";
public static final String HUNTING_ZONE_REMAIN_REFILL = "HUNTING_ZONE_REMAIN_REFILL_";
+ public static final String IS_LEGEND = "IS_LEGEND";
public static final String FAVORITE_TELEPORTS = "FAVORITE_TELEPORTS";
public static final String HOMUNCULUS_HP_POINTS = "HOMUNCULUS_HP_POINTS";
public static final String HOMUNCULUS_SP_POINTS = "HOMUNCULUS_SP_POINTS";
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java
index 1d54eaef7f..6b6bafd8ae 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java
@@ -34,7 +34,7 @@ import org.l2jmobius.gameserver.model.zone.AbstractZoneSettings;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.model.zone.ZoneRespawn;
import org.l2jmobius.gameserver.network.SystemMessageId;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchEnd;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchEnd;
/**
* An olympiad stadium
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java
index 97faf0b214..16df949176 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java
@@ -110,6 +110,12 @@ import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeAdd
import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeWaitingList;
import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMentorCancel;
import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMentorList;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.OlympiadMatchMaking;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.OlympiadMatchMakingCancel;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.OlympiadUI;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.RequestExOlympiadMatchListRefresh;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.RequestOlympiadMatchList;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.RequestOlympiadObserverEnd;
import org.l2jmobius.gameserver.network.clientpackets.pk.RequestExPkPenaltyList;
import org.l2jmobius.gameserver.network.clientpackets.pk.RequestExPkPenaltyListOnlyLoc;
import org.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeAnnounce;
@@ -539,8 +545,8 @@ public enum ExIncomingPackets implements IIncomingPackets
EX_PAYBACK_LIST(0x175, null, ConnectionState.IN_GAME),
EX_PAYBACK_GIVE_REWARD(0x176, null, ConnectionState.IN_GAME),
EX_AUTOPLAY_SETTING(0x177, ExAutoPlaySetting::new, ConnectionState.IN_GAME),
- EX_OLYMPIAD_MATCH_MAKING(0x178, null, ConnectionState.IN_GAME),
- EX_OLYMPIAD_MATCH_MAKING_CANCEL(0x179, null, ConnectionState.IN_GAME),
+ EX_OLYMPIAD_MATCH_MAKING(0x178, OlympiadMatchMaking::new, ConnectionState.IN_GAME),
+ EX_OLYMPIAD_MATCH_MAKING_CANCEL(0x179, OlympiadMatchMakingCancel::new, ConnectionState.IN_GAME),
EX_FESTIVAL_BM_INFO(0x17A, null, ConnectionState.IN_GAME),
EX_FESTIVAL_BM_GAME(0x17B, null, ConnectionState.IN_GAME),
EX_GACHA_SHOP_INFO(0x17C, null, ConnectionState.IN_GAME),
@@ -579,7 +585,7 @@ public enum ExIncomingPackets implements IIncomingPackets
EX_CRAFT_RANDOM_MAKE(0x19D, null, ConnectionState.IN_GAME),
EX_MULTI_SELL_LIST(0x19E, null, ConnectionState.IN_GAME),
EX_SAVE_ITEM_ANNOUNCE_SETTING(0x19F, ExSaveItemAnnounceSetting::new, ConnectionState.IN_GAME),
- EX_OLYMPIAD_UI(0x1A0, null, ConnectionState.IN_GAME),
+ EX_OLYMPIAD_UI(0x1A0, OlympiadUI::new, ConnectionState.IN_GAME),
// 270
EX_SHARED_POSITION_SHARING_UI(0x1A1, null, ConnectionState.IN_GAME),
EX_SHARED_POSITION_TELEPORT_UI(0x1A2, null, ConnectionState.IN_GAME),
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
index f55034b49f..b2ea7e22f4 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
@@ -55,6 +55,7 @@ import org.l2jmobius.gameserver.model.item.ItemTemplate;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.item.type.EtcItemType;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
+import org.l2jmobius.gameserver.model.olympiad.Olympiad;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentType;
import org.l2jmobius.gameserver.model.quest.Quest;
@@ -120,6 +121,7 @@ import org.l2jmobius.gameserver.network.serverpackets.homunculus.ExHomunculusPoi
import org.l2jmobius.gameserver.network.serverpackets.homunculus.ExHomunculusReady;
import org.l2jmobius.gameserver.network.serverpackets.homunculus.ExShowHomunculusBirthInfo;
import org.l2jmobius.gameserver.network.serverpackets.limitshop.ExBloodyCoinCount;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadInfo;
import org.l2jmobius.gameserver.network.serverpackets.settings.ExItemAnnounceSetting;
import org.l2jmobius.gameserver.util.BuilderUtil;
@@ -644,6 +646,12 @@ public class EnterWorld implements IClientIncomingPacket
player.sendMessage("Experience gain is disabled.");
}
+ // Send packet that olympiad is opened.
+ if (Config.OLYMPIAD_ENABLED && Olympiad.getInstance().inCompPeriod())
+ {
+ player.sendPacket(new ExOlympiadInfo(1));
+ }
+
player.updateSymbolSealSkills();
player.broadcastUserInfo();
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java
new file mode 100644
index 0000000000..5cfad5d67f
--- /dev/null
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java
@@ -0,0 +1,47 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.network.GameClient;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchMakingResult;
+
+public class OlympiadMatchMaking implements IClientIncomingPacket
+{
+ private byte _gameRuleType;
+
+ @Override
+ public boolean read(GameClient client, PacketReader packet)
+ {
+ _gameRuleType = (byte) packet.readC();
+ return true;
+ }
+
+ @Override
+ public void run(GameClient client)
+ {
+ final Player player = client.getPlayer();
+ if (player == null)
+ {
+ return;
+ }
+
+ player.sendPacket(new ExOlympiadMatchMakingResult(_gameRuleType, 1));
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java
new file mode 100644
index 0000000000..e165096e42
--- /dev/null
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java
@@ -0,0 +1,47 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.network.GameClient;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchMakingResult;
+
+public class OlympiadMatchMakingCancel implements IClientIncomingPacket
+{
+ private byte _gameRuleType;
+
+ @Override
+ public boolean read(GameClient client, PacketReader packet)
+ {
+ _gameRuleType = (byte) packet.readC();
+ return true;
+ }
+
+ @Override
+ public void run(GameClient client)
+ {
+ final Player player = client.getPlayer();
+ if (player == null)
+ {
+ return;
+ }
+
+ player.sendPacket(new ExOlympiadMatchMakingResult(_gameRuleType, 0));
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java
new file mode 100644
index 0000000000..d9c5d35f53
--- /dev/null
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java
@@ -0,0 +1,49 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.network.GameClient;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadRecord;
+
+public class OlympiadUI implements IClientIncomingPacket
+{
+ private byte _gameRuleType;
+ private int _type;
+
+ @Override
+ public boolean read(GameClient client, PacketReader packet)
+ {
+ _gameRuleType = (byte) packet.readC();
+ _type = packet.readD();
+ return true;
+ }
+
+ @Override
+ public void run(GameClient client)
+ {
+ final Player player = client.getPlayer();
+ if (player == null)
+ {
+ return;
+ }
+
+ player.sendPacket(new ExOlympiadRecord(player, _gameRuleType, _type));
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestExOlympiadMatchListRefresh.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java
similarity index 82%
rename from L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestExOlympiadMatchListRefresh.java
rename to L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java
index b858084554..5ee47636f7 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestExOlympiadMatchListRefresh.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java
@@ -14,12 +14,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.clientpackets;
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.network.GameClient;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchList;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchList;
/**
* Format: (ch)d d: unknown (always 0?)
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadMatchList.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java
similarity index 89%
rename from L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadMatchList.java
rename to L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java
index 9f3cb709cf..7a9752b083 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadMatchList.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java
@@ -14,13 +14,14 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.clientpackets;
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.handler.BypassHandler;
import org.l2jmobius.gameserver.handler.IBypassHandler;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.network.GameClient;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
/**
* format ch c: (id) 0xD0 h: (subid) 0x13
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadObserverEnd.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java
similarity index 87%
rename from L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadObserverEnd.java
rename to L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java
index 24d5719bd4..255d11e91d 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadObserverEnd.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java
@@ -14,11 +14,12 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.clientpackets;
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.network.GameClient;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
/**
* format ch c: (id) 0xD0 h: (subid) 0x12
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java
index 09760649cf..d54434b972 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java
@@ -196,7 +196,7 @@ public class CharInfo implements IClientOutgoingPacket
packet.writeC(_player.getTeam().getId()); // Confirmed
packet.writeD(_player.getClanCrestLargeId());
packet.writeC(_player.getNobleLevel()); // Confirmed
- packet.writeC(_player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 2 : 0); // 152 - Value for enabled changed to 2?
+ packet.writeC(_player.isLegend() ? 4 : _player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 2 : 0); // 152 - Value for enabled changed to 2? 4 = legend
packet.writeC(_player.isFishing() ? 1 : 0); // Confirmed
final ILocational baitLocation = _player.getFishing().getBaitLocation();
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java
index 036068c86f..eec03a62d9 100644
--- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java
@@ -298,7 +298,7 @@ public class UserInfo extends AbstractMaskPacket
packet.writeC(_player.getPvpFlag());
packet.writeD(_player.getReputation()); // Reputation
packet.writeC(_player.getNobleLevel());
- packet.writeC(_player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 2 : 0); // 152 - Value for enabled changed to 2?
+ packet.writeC(_player.isLegend() ? 4 : _player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 2 : 0); // 152 - Value for enabled changed to 2? 4 = legend
packet.writeC(_player.getPledgeClass());
packet.writeD(_player.getPkKills());
packet.writeD(_player.getPvpKills());
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java
new file mode 100644
index 0000000000..b541ddf502
--- /dev/null
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java
@@ -0,0 +1,41 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+public class ExOlympiadInfo implements IClientOutgoingPacket
+{
+ private static int _open;
+
+ public ExOlympiadInfo(int open)
+ {
+ _open = open;
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_OLYMPIAD_INFO.writeId(packet);
+ packet.writeC(_open);
+ packet.writeD(0); // RemainTime
+ packet.writeC(1); // GameRuleType
+ return true;
+ }
+}
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchEnd.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java
similarity index 86%
rename from L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchEnd.java
rename to L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java
index ba3c0cfeaa..e64d402782 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchEnd.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java
@@ -14,10 +14,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author GodKratos
@@ -36,4 +37,4 @@ public class ExOlympiadMatchEnd implements IClientOutgoingPacket
OutgoingPackets.EX_OLYMPIAD_MATCH_END.writeId(packet);
return true;
}
-}
+}
\ No newline at end of file
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java
new file mode 100644
index 0000000000..25335ef371
--- /dev/null
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java
@@ -0,0 +1,57 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+/**
+ * @author Mobius
+ */
+public class ExOlympiadMatchInfo implements IClientOutgoingPacket
+{
+ private final String _name1;
+ private final String _name2;
+ private final int _wins1;
+ private final int _wins2;
+ private final int _round;
+ private final int _time;
+
+ public ExOlympiadMatchInfo(String name1, String name2, int wins1, int wins2, int round, int time)
+ {
+ _name1 = name1;
+ _name2 = name2;
+ _wins1 = wins1;
+ _wins2 = wins2;
+ _round = round;
+ _time = time;
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_OLYMPIAD_MATCH_INFO.writeId(packet);
+ packet.writeS(String.format("%1$-" + 23 + "s", _name2));
+ packet.writeD(_wins2);
+ packet.writeS(String.format("%1$-" + 23 + "s", _name1));
+ packet.writeD(_wins1);
+ packet.writeD(_round);
+ packet.writeD(_time); // Seconds
+ return true;
+ }
+}
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java
new file mode 100644
index 0000000000..1d7653e028
--- /dev/null
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java
@@ -0,0 +1,37 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+public class ExOlympiadMatchInfoEnd implements IClientOutgoingPacket
+{
+ public static final ExOlympiadMatchInfoEnd STATIC_PACKET = new ExOlympiadMatchInfoEnd();
+
+ private ExOlympiadMatchInfoEnd()
+ {
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_OLYMPIAD_MATCH_INFO.writeId(packet);
+ return true;
+ }
+}
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchList.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java
similarity index 91%
rename from L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchList.java
rename to L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java
index 7ffd5ed3bd..80564627aa 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchList.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java
@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import java.util.ArrayList;
import java.util.List;
@@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.olympiad.OlympiadGameManager;
import org.l2jmobius.gameserver.model.olympiad.OlympiadGameNonClassed;
import org.l2jmobius.gameserver.model.olympiad.OlympiadGameTask;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author mrTJO
@@ -55,15 +56,19 @@ public class ExOlympiadMatchList implements IClientOutgoingPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_RECEIVE_OLYMPIAD.writeId(packet);
+
packet.writeD(0); // Type 0 = Match List, 1 = Match Result
+
packet.writeD(_games.size());
packet.writeD(0);
+
for (OlympiadGameTask curGame : _games)
{
final AbstractOlympiadGame game = curGame.getGame();
if (game != null)
{
packet.writeD(game.getStadiumId()); // Stadium Id (Arena 1 = 0)
+
if (game instanceof OlympiadGameNonClassed)
{
packet.writeD(1);
@@ -76,6 +81,7 @@ public class ExOlympiadMatchList implements IClientOutgoingPacket
{
packet.writeD(0);
}
+
packet.writeD(curGame.isRunning() ? 2 : 1); // (1 = Standby, 2 = Playing)
packet.writeS(game.getPlayerNames()[0]); // Player 1 Name
packet.writeS(game.getPlayerNames()[1]); // Player 2 Name
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java
new file mode 100644
index 0000000000..a72825cad4
--- /dev/null
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java
@@ -0,0 +1,42 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+public class ExOlympiadMatchMakingResult implements IClientOutgoingPacket
+{
+ private final int _gameRuleType;
+ private final int _type;
+
+ public ExOlympiadMatchMakingResult(int cGameRuleType, int type)
+ {
+ _gameRuleType = 0;
+ _type = type;
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_OLYMPIAD_INFO.writeId(packet);
+ packet.writeC(_type);
+ packet.writeD(_gameRuleType);
+ return true;
+ }
+}
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchResult.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java
similarity index 73%
rename from L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchResult.java
rename to L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java
index b387271fba..2c57635a47 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchResult.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java
@@ -14,13 +14,14 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.model.olympiad.OlympiadInfo;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author JIV
@@ -32,8 +33,11 @@ public class ExOlympiadMatchResult implements IClientOutgoingPacket
private int _loseTeam = 2;
private final List _winnerList;
private final List _loserList;
+ private final int _round1winner;
+ private final int _round2winner;
+ private final int _round3winner;
- public ExOlympiadMatchResult(boolean tie, int winTeam, List winnerList, List loserList)
+ public ExOlympiadMatchResult(boolean tie, int winTeam, List winnerList, List loserList, int round1winner, int round2winner, int round3winner)
{
_tie = tie;
_winTeam = winTeam;
@@ -47,13 +51,16 @@ public class ExOlympiadMatchResult implements IClientOutgoingPacket
{
_winTeam = 1;
}
+ _round1winner = round1winner;
+ _round2winner = round2winner;
+ _round3winner = round3winner;
}
@Override
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_RECEIVE_OLYMPIAD.writeId(packet);
- packet.writeD(1); // Type 0 = Match List, 1 = Match Result
+ packet.writeD(2); // Type 0 = Match List, 1 = Match Result, 2 = New Oly look, 3 = 3v3
packet.writeD(_tie ? 1 : 0); // 0 - win, 1 - tie
packet.writeS(_winnerList.get(0).getName());
packet.writeD(_winTeam);
@@ -82,6 +89,11 @@ public class ExOlympiadMatchResult implements IClientOutgoingPacket
packet.writeD(info.getDiffPoints());
packet.writeD(0); // Helios
}
+ packet.writeC(_round1winner); // Round 1 outcome
+ packet.writeC(_round2winner); // Round 2 outcome
+ packet.writeC(_round3winner); // Round 3 outcome
+ packet.writeD(15); // Bonus Reward
+ packet.writeD(0); // Bonus Reward for looser
return true;
}
}
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMode.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java
similarity index 76%
rename from L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMode.java
rename to L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java
index 712b9e06c6..35156532aa 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMode.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java
@@ -14,22 +14,24 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.enums.OlympiadMode;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author godson
*/
public class ExOlympiadMode implements IClientOutgoingPacket
{
- private final int _mode;
+ private final OlympiadMode _mode;
/**
* @param mode (0 = return, 3 = spectate)
*/
- public ExOlympiadMode(int mode)
+ public ExOlympiadMode(OlympiadMode mode)
{
_mode = mode;
}
@@ -38,7 +40,7 @@ public class ExOlympiadMode implements IClientOutgoingPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_OLYMPIAD_MODE.writeId(packet);
- packet.writeC(_mode);
+ packet.writeC(_mode.ordinal());
return true;
}
}
diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java
new file mode 100644
index 0000000000..0985a230f5
--- /dev/null
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java
@@ -0,0 +1,109 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Calendar;
+
+import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.instancemanager.RankManager;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.model.olympiad.Olympiad;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.PacketLogger;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+public class ExOlympiadRecord implements IClientOutgoingPacket
+{
+ private static final String GET_PREVIOUS_CYCLE_DATA = "SELECT charId, class_id, olympiad_points, competitions_won, competitions_lost FROM olympiad_nobles_eom WHERE class_id = ? ORDER BY olympiad_points DESC LIMIT " + RankManager.PLAYER_LIMIT;
+
+ private final Player _player;
+ private final int _gameRuleType;
+ private final int _type;
+
+ public ExOlympiadRecord(Player player, int cGameRuleType, int type)
+ {
+ _player = player;
+ _gameRuleType = cGameRuleType;
+ _type = type;
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_OLYMPIAD_RECORD.writeId(packet);
+ packet.writeD(Olympiad.getInstance().getNoblePoints(_player)); // nPoint
+ packet.writeD(Olympiad.getInstance().getCompetitionWon(_player.getObjectId())); // nWinCount
+ packet.writeD(Olympiad.getInstance().getCompetitionLost(_player.getObjectId())); // nLoseCount
+ packet.writeD(Olympiad.getInstance().getRemainingWeeklyMatches(_player.getObjectId())); // nMatchCount
+ // Previous Cycle
+ int previousPlace = 0;
+ int previousWins = 0;
+ int previousLoses = 0;
+ int previousPoints = 0;
+ int previousClass = 0;
+
+ try (Connection con = DatabaseFactory.getConnection();
+ PreparedStatement statement = con.prepareStatement(GET_PREVIOUS_CYCLE_DATA))
+ {
+ statement.setInt(1, _player.getBaseClass());
+ try (ResultSet rset = statement.executeQuery())
+ {
+ int i = 1;
+ while (rset.next())
+ {
+ if (rset.getInt("charId") == _player.getObjectId())
+ {
+ previousPlace = i;
+ previousWins = rset.getInt("competitions_won");
+ previousLoses = rset.getInt("competitions_lost");
+ previousPoints = rset.getInt("olympiad_points");
+ previousClass = rset.getInt("class_id");
+ }
+ i++;
+ }
+ }
+ }
+ catch (SQLException e)
+ {
+ PacketLogger.warning("Olympiad my ranking: Couldnt load data: " + e.getMessage());
+ }
+
+ packet.writeD(previousClass); // nPrevClassType
+ packet.writeD(1); // nPrevRank in all servers
+ packet.writeD(2); // nPrevRankCount number of participants with 25+ matches
+ packet.writeD(previousPlace); // nPrevClassRank in all servers
+ packet.writeD(4); // nPrevClassRankCount number of participants with 25+ matches
+ packet.writeD(5); // nPrevClassRankByServer in current server
+ packet.writeD(6); // nPrevClassRankByServerCount number of participants with 25+ matches
+ packet.writeD(previousPoints); // nPrevPoint
+ packet.writeD(previousWins); // nPrevWinCount
+ packet.writeD(previousLoses); // nPrevLoseCount
+ packet.writeD(previousPlace); // nPrevGrade
+ packet.writeD(Calendar.getInstance().get(Calendar.YEAR)); // nSeasonYear
+ packet.writeD(Calendar.getInstance().get(Calendar.MONTH) + 1); // nSeasonMonth
+ packet.writeC(Olympiad.getInstance().inCompPeriod() ? 1 : 0); // bMatchOpen
+ packet.writeD(Olympiad.getInstance().getCurrentCycle()); // nSeason
+ packet.writeC(_type); // bRegistered
+ packet.writeD(_gameRuleType); // cGameRuleType
+ return true;
+ }
+}
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadSpelledInfo.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java
similarity index 88%
rename from L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadSpelledInfo.java
rename to L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java
index 5b4f2c2523..a5a368a43e 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadSpelledInfo.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java
@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import java.util.ArrayList;
import java.util.List;
@@ -24,6 +24,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.skill.BuffInfo;
import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author godson
@@ -53,6 +54,7 @@ public class ExOlympiadSpelledInfo implements IClientOutgoingPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_OLYMPIAD_SPELLED_INFO.writeId(packet);
+
packet.writeD(_playerId);
packet.writeD(_effects.size() + _effects2.size());
for (BuffInfo info : _effects)
@@ -61,7 +63,7 @@ public class ExOlympiadSpelledInfo implements IClientOutgoingPacket
{
packet.writeD(info.getSkill().getDisplayId());
packet.writeH(info.getSkill().getDisplayLevel());
- packet.writeH(0); // Sub level
+ packet.writeH(0x00); // Sub level
packet.writeD(info.getSkill().getAbnormalType().getClientId());
writeOptionalD(packet, info.getSkill().isAura() ? -1 : info.getTime());
}
@@ -72,7 +74,7 @@ public class ExOlympiadSpelledInfo implements IClientOutgoingPacket
{
packet.writeD(skill.getDisplayId());
packet.writeH(skill.getDisplayLevel());
- packet.writeH(0); // Sub level
+ packet.writeH(0x00); // Sub level
packet.writeD(skill.getAbnormalType().getClientId());
packet.writeH(-1);
}
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadUserInfo.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java
similarity index 90%
rename from L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadUserInfo.java
rename to L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java
index ca473edfcf..1acac0ec7a 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadUserInfo.java
+++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java
@@ -14,12 +14,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.olympiad.Participant;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author godson
@@ -76,6 +77,7 @@ public class ExOlympiadUserInfo implements IClientOutgoingPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_OLYMPIAD_USER_INFO.writeId(packet);
+
if (_player != null)
{
packet.writeC(_player.getOlympiadSide());
@@ -90,6 +92,7 @@ public class ExOlympiadUserInfo implements IClientOutgoingPacket
packet.writeS(_par.getName());
packet.writeD(_par.getBaseClass());
}
+
packet.writeD(_curHp);
packet.writeD(_maxHp);
packet.writeD(_curCp);
diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/config/Olympiad.ini b/L2J_Mobius_10.2_MasterClass/dist/game/config/Olympiad.ini
index 149a682c5e..34b3a54c33 100644
--- a/L2J_Mobius_10.2_MasterClass/dist/game/config/Olympiad.ini
+++ b/L2J_Mobius_10.2_MasterClass/dist/game/config/Olympiad.ini
@@ -9,141 +9,141 @@
# Also please understand what you are changing before you do so on a live server.
# ---------------------------------------------------------------------------
+# Enable Olympiad.
+# Default: True
+OlympiadEnabled = True
+
# Olympiad Start Time in Military hours Default 8pm (20)
# Default: 20
-AltOlyStartTime = 20
+OlympiadStartTime = 20
# Olympiad Start Time for Min's, Default 00 so at the start of the hour.
# Default: 00
-AltOlyMin = 00
+OlympiadMin = 00
# Olympiad Competition Period, Default 4 hours.
# (If set different, should be increment by 10mins)
# Default: 14400000
-AltOlyCPeriod = 14400000
+OlympiadCPeriod = 14400000
-# Olympiad Battle Period, Default 5 minutes.
-# Default: 300000
-AltOlyBattle = 300000
+# Olympiad Battle Period, Default 100 seconds.
+# Default: 100000
+OlympiadBattle = 100000
# Olympiad Weekly Period, Default 1 week
# Used for adding points to nobles
# Default: 604800000
-AltOlyWPeriod = 604800000
+OlympiadWPeriod = 604800000
# Olympiad Validation Period, Default 24 Hours.
# Default: 86400000
-AltOlyVPeriod = 86400000
+OlympiadVPeriod = 86400000
# Points for reaching Noblesse for the first time
-# Default: 10
-AltOlyStartPoints = 10
-
-# Points every week
-# Default: 10
-AltOlyWeeklyPoints = 10
+# Default: 1000
+OlympiadStartPoints = 1000
# Required number of participants for the class based games
# Default: 20
-AltOlyClassedParticipants = 20
+OlympiadClassedParticipants = 20
# Required number of participants for the non-class based games
# Default: 10
-AltOlyNonClassedParticipants = 10
+OlympiadNonClassedParticipants = 10
# Reward for the winner
# Format: itemId1,itemNum1;itemId2,itemNum2...
# Default: 45584,12
-AltOlyWinReward = 45584,12
+OlympiadWinReward = 45584,12
# Reward for loser
# Format: itemId1,itemNum1;itemId2,itemNum2...
# Default: 45584,7
-AltOlyLoserReward = 45584,7
+OlympiadLoserReward = 45584,7
# ItemId used for exchanging to the points.
# Default: 45584
-AltOlyCompRewItem = 45584
+OlympiadCompRewItem = 45584
# The minimum matches you need to participate to receive point rewards
# Default: 10
-AltOlyMinMatchesForPoints = 10
+OlympiadMinMatchesForPoints = 10
# Rate to exchange points to reward item.
# Default: 20
-AltOlyMarkPerPoint = 20
+OlympiadMarkPerPoint = 20
# Noblesse points awarded to Heroes.
# Default: 30
-AltOlyHeroPoints = 30
+OlympiadHeroPoints = 30
# Noblesse points awarded to Rank 1 members.
# Default: 100
-AltOlyRank1Points = 60
+OlympiadRank1Points = 60
# Noblesse points awarded to Rank 2 members.
# Default: 75
-AltOlyRank2Points = 50
+OlympiadRank2Points = 50
# Noblesse points awarded to Rank 3 members.
# Default: 55
-AltOlyRank3Points = 45
+OlympiadRank3Points = 45
# Noblesse points awarded to Rank 4 members.
# Default: 40
-AltOlyRank4Points = 40
+OlympiadRank4Points = 40
# Noblesse points awarded to Rank 5 members.
# Default: 30
-AltOlyRank5Points = 30
+OlympiadRank5Points = 30
# Maximum points that player can gain/lose on a match.
# Default: 10
-AltOlyMaxPoints = 10
+OlympiadMaxPoints = 10
# Hero tables show last month's winners or current status.
# Default: True
-AltOlyShowMonthlyWinners = True
+OlympiadShowMonthlyWinners = True
# Olympiad Managers announce each start of fight.
# Default: True
-AltOlyAnnounceGames = True
+OlympiadAnnounceGames = True
# Restrict specified items in Olympiad. ItemID's need to be separated with a comma (ex. 1,200,350)
# Equipped items will be moved to inventory during port.
# Default:
-AltOlyRestrictedItems =
+OlympiadRestrictedItems =
# Enchant limit for items during Olympiad battles. Disabled = -1.
# Default: -1
-AltOlyWeaponEnchantLimit = -1
-AltOlyArmorEnchantLimit = -1
+OlympiadWeaponEnchantLimit = -1
+OlympiadArmorEnchantLimit = -1
# Log all Olympiad fights and outcome to olympiad.csv file.
# Default: False
-AltOlyLogFights = False
+OlympiadLogFights = False
# Time to wait before teleported to arena.
# Default: 120
-AltOlyWaitTime = 120
+OlympiadWaitTime = 120
# Divider for points in classed and non-classed games
# Default: 5
-AltOlyDividerClassed = 5
-AltOlyDividerNonClassed = 5
+OlympiadDividerClassed = 5
+OlympiadDividerNonClassed = 5
# Maximum number of matches a Noblesse character can join per week
-# Default: 30
-AltOlyMaxWeeklyMatches = 30
+# Default: 25
+OlympiadMaxWeeklyMatches = 25
# Enable competitions only on specific days. Usage: 1,2,3,4,5,6,7 (SUNDAY,MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,SATURDAY)
# Default: 6,7 (FRIDAY,SATURDAY)
-AltOlyCompetitionDays = 6,7
+OlympiadCompetitionDays = 6,7
# Change the type of delay between two Olympiads.
# Available values: MONTH, WEEK, DAY
# Default: MONTH
-AltOlyPeriod = MONTH
+OlympiadPeriod = MONTH
# Change the Olympiad frequency.
# The value is a multiplier of period type,
@@ -151,4 +151,4 @@ AltOlyPeriod = MONTH
# then Olympiad will occur every 2 months.
# Default: 1
# Note! If type = DAY, multiplier must be >= 7!
-AltOlyPeriodMultiplier = 1
\ No newline at end of file
+OlympiadPeriodMultiplier = 1
\ No newline at end of file
diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes-weaponListLegend.html b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes-weaponListLegend.html
new file mode 100644
index 0000000000..169a6fb06f
--- /dev/null
+++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes-weaponListLegend.html
@@ -0,0 +1,26 @@
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes.java b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes.java
index 53a544ac7f..fe77bb3e49 100644
--- a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes.java
+++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/others/MonumentOfHeroes/MonumentOfHeroes.java
@@ -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;
}
diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/others/OlyBuffer/OlyBuffer.java b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/others/OlyBuffer/OlyBuffer.java
index 071de9ce6e..80f83d45a9 100644
--- a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/others/OlyBuffer/OlyBuffer.java
+++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/others/OlyBuffer/OlyBuffer.java
@@ -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,10 @@ 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[] 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_HARMONY,
+ CommonSkill.OLYMPIAD_MELODY,
};
private OlyBuffer()
@@ -66,7 +63,7 @@ public class OlyBuffer extends AbstractNpcAI
{
case "buff":
{
- applyBuffs(npc, player, BUFF);
+ applyBuffs(npc, player);
break;
}
}
@@ -75,13 +72,12 @@ 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)
{
- for (SkillHolder holder : BUFFS)
+ for (CommonSkill holder : BUFFS)
{
SkillCaster.triggerCast(npc, player, holder.getSkill());
}
- SkillCaster.triggerCast(npc, player, skill.getSkill());
}
public static void main(String[] args)
diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java
index abd483995f..b67f27611e 100644
--- a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java
+++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/others/OlyManager/OlyManager.java
@@ -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
diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/RedLibra/Eraton/Eraton.java b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/RedLibra/Eraton/Eraton.java
index 292ad9e999..31875c82f5 100644
--- a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/RedLibra/Eraton/Eraton.java
+++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/events/RedLibra/Eraton/Eraton.java
@@ -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();
}
diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java
index 800d712676..1f0e698300 100644
--- a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java
+++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/usercommandhandlers/OlympiadStat.java
@@ -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;
}
diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/34200-34299.xml b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/34200-34299.xml
index 2ea4bc8ed0..1b0cf99e1c 100644
--- a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/34200-34299.xml
+++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/34200-34299.xml
@@ -236,9 +236,116 @@
A1
-
icon.skill0000
- A1
+ 5
+ 600
+ BUFF_SPECIAL_ATTACK
+ 1000
+ A2
+ 700
+ 300
+ 22
+ 105
+ 2000
+ 715
+ NONE
+ 5
+ SELF
+ SINGLE
+
+
+ MULTI_BUFF;IMPROVE_PA_PD_UP;PA_UP;IMPROVE_MA_MD_UP;MD_UP;MA_UP;KAMAEL_SPECIAL;PD_UP;HIT_UP;IMPROVE_HIT_DEFENCE_CRT_RATE_UP;IMPROVE_CRT_RATE_DMG_UP;T_CRT_DMG_DOWN;CRITICAL_DMG_UP;CRITICAL_PROB_UP;IMPROVE_SPEED_AVOID_UP;SPEED_UP;MAX_BREATH_UP;HOLY_ATTACK;AVOID_UP;DECREASE_WEIGHT_PENALTY;RESIST_HOLY_UNHOLY
+ 100
+
+
+ MULTI_BUFF;IMPROVE_PA_PD_UP;PA_UP;IMPROVE_MA_MD_UP;MD_UP;MA_UP;KAMAEL_SPECIAL;PD_UP;HIT_UP;IMPROVE_HIT_DEFENCE_CRT_RATE_UP;IMPROVE_CRT_RATE_DMG_UP;T_CRT_DMG_DOWN;CRITICAL_DMG_UP;CRITICAL_PROB_UP;IMPROVE_SPEED_AVOID_UP;SPEED_UP;MAX_BREATH_UP;HOLY_ATTACK;AVOID_UP;DECREASE_WEIGHT_PENALTY;RESIST_HOLY_UNHOLY
+
+
+ 45
+ PER
+
+
+ 70
+ PER
+
+
+ 45
+ PER
+
+
+ 30
+ PER
+
+
+ 100
+ PER
+
+
+ 35
+ PER
+
+
+ 40
+ PER
+
+
+ 38
+ PER
+
+
+ 34
+ PER
+
+
+ 40
+ DIFF
+
+
+ 64
+ PER
+
+
+ 62
+ PER
+
+
+ -50
+ PER
+
+
+ -10
+ PER
+ 0
+
+
+ -10
+ PER
+ 1
+
+
+ -10
+ PER
+ 2
+
+
+ -10
+ PER
+ 3
+
+
+ 9
+ 30
+
+
+
+ Creature
+ 60
+ SELF
+ 300
+ 11569
+ 1
+
+
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/Config.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/Config.java
index 8888f60dc1..995a1b4618 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/Config.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/Config.java
@@ -516,41 +516,41 @@ public class Config
public static int WORLD_CHAT_MIN_LEVEL;
public static int WORLD_CHAT_POINTS_PER_DAY;
public static Duration WORLD_CHAT_INTERVAL;
- public static int ALT_OLY_START_TIME;
- public static int ALT_OLY_MIN;
- public static long ALT_OLY_CPERIOD;
- public static long ALT_OLY_BATTLE;
- public static long ALT_OLY_WPERIOD;
- public static long ALT_OLY_VPERIOD;
- public static int ALT_OLY_START_POINTS;
- public static int ALT_OLY_WEEKLY_POINTS;
- public static int ALT_OLY_CLASSED;
- public static int ALT_OLY_NONCLASSED;
- public static List ALT_OLY_WINNER_REWARD;
- public static List ALT_OLY_LOSER_REWARD;
- public static int ALT_OLY_COMP_RITEM;
- public static int ALT_OLY_MIN_MATCHES;
- public static int ALT_OLY_MARK_PER_POINT;
- public static int ALT_OLY_HERO_POINTS;
- public static int ALT_OLY_RANK1_POINTS;
- public static int ALT_OLY_RANK2_POINTS;
- public static int ALT_OLY_RANK3_POINTS;
- public static int ALT_OLY_RANK4_POINTS;
- public static int ALT_OLY_RANK5_POINTS;
- public static int ALT_OLY_MAX_POINTS;
- public static int ALT_OLY_DIVIDER_CLASSED;
- public static int ALT_OLY_DIVIDER_NON_CLASSED;
- public static int ALT_OLY_MAX_WEEKLY_MATCHES;
- public static boolean ALT_OLY_LOG_FIGHTS;
- public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS;
- public static boolean ALT_OLY_ANNOUNCE_GAMES;
- public static Set LIST_OLY_RESTRICTED_ITEMS = new HashSet<>();
- public static int ALT_OLY_WEAPON_ENCHANT_LIMIT;
- public static int ALT_OLY_ARMOR_ENCHANT_LIMIT;
- public static int ALT_OLY_WAIT_TIME;
- public static String ALT_OLY_PERIOD;
- public static int ALT_OLY_PERIOD_MULTIPLIER;
- public static List ALT_OLY_COMPETITION_DAYS;
+ public static boolean OLYMPIAD_ENABLED;
+ public static int OLYMPIAD_START_TIME;
+ public static int OLYMPIAD_MIN;
+ public static long OLYMPIAD_CPERIOD;
+ public static long OLYMPIAD_BATTLE;
+ public static long OLYMPIAD_WPERIOD;
+ public static long OLYMPIAD_VPERIOD;
+ public static int OLYMPIAD_START_POINTS;
+ public static int OLYMPIAD_CLASSED;
+ public static int OLYMPIAD_NONCLASSED;
+ public static List OLYMPIAD_WINNER_REWARD;
+ public static List OLYMPIAD_LOSER_REWARD;
+ public static int OLYMPIAD_COMP_RITEM;
+ public static int OLYMPIAD_MIN_MATCHES;
+ public static int OLYMPIAD_MARK_PER_POINT;
+ public static int OLYMPIAD_HERO_POINTS;
+ public static int OLYMPIAD_RANK1_POINTS;
+ public static int OLYMPIAD_RANK2_POINTS;
+ public static int OLYMPIAD_RANK3_POINTS;
+ public static int OLYMPIAD_RANK4_POINTS;
+ public static int OLYMPIAD_RANK5_POINTS;
+ public static int OLYMPIAD_MAX_POINTS;
+ public static int OLYMPIAD_DIVIDER_CLASSED;
+ public static int OLYMPIAD_DIVIDER_NON_CLASSED;
+ public static int OLYMPIAD_MAX_WEEKLY_MATCHES;
+ public static boolean OLYMPIAD_LOG_FIGHTS;
+ public static boolean OLYMPIAD_SHOW_MONTHLY_WINNERS;
+ public static boolean OLYMPIAD_ANNOUNCE_GAMES;
+ public static Set OLYMPIAD_RESTRICTED_ITEMS = new HashSet<>();
+ public static int OLYMPIAD_WEAPON_ENCHANT_LIMIT;
+ public static int OLYMPIAD_ARMOR_ENCHANT_LIMIT;
+ public static int OLYMPIAD_WAIT_TIME;
+ public static String OLYMPIAD_PERIOD;
+ public static int OLYMPIAD_PERIOD_MULTIPLIER;
+ public static List OLYMPIAD_COMPETITION_DAYS;
public static int ALT_MANOR_REFRESH_TIME;
public static int ALT_MANOR_REFRESH_MIN;
public static int ALT_MANOR_APPROVE_TIME;
@@ -2432,57 +2432,57 @@ public class Config
// Load Olympiad config file (if exists)
final PropertiesParser olympiadConfig = new PropertiesParser(OLYMPIAD_CONFIG_FILE);
- ALT_OLY_START_TIME = olympiadConfig.getInt("AltOlyStartTime", 20);
- ALT_OLY_MIN = olympiadConfig.getInt("AltOlyMin", 0);
- ALT_OLY_CPERIOD = olympiadConfig.getLong("AltOlyCPeriod", 14400000);
- ALT_OLY_BATTLE = olympiadConfig.getLong("AltOlyBattle", 300000);
- ALT_OLY_WPERIOD = olympiadConfig.getLong("AltOlyWPeriod", 604800000);
- ALT_OLY_VPERIOD = olympiadConfig.getLong("AltOlyVPeriod", 86400000);
- ALT_OLY_START_POINTS = olympiadConfig.getInt("AltOlyStartPoints", 10);
- ALT_OLY_WEEKLY_POINTS = olympiadConfig.getInt("AltOlyWeeklyPoints", 10);
- ALT_OLY_CLASSED = olympiadConfig.getInt("AltOlyClassedParticipants", 10);
- ALT_OLY_NONCLASSED = olympiadConfig.getInt("AltOlyNonClassedParticipants", 20);
- ALT_OLY_WINNER_REWARD = parseItemsList(olympiadConfig.getString("AltOlyWinReward", "45584,12"));
- ALT_OLY_LOSER_REWARD = parseItemsList(olympiadConfig.getString("AltOlyLoserReward", "45584,7"));
- ALT_OLY_COMP_RITEM = olympiadConfig.getInt("AltOlyCompRewItem", 45584);
- ALT_OLY_MIN_MATCHES = olympiadConfig.getInt("AltOlyMinMatchesForPoints", 10);
- ALT_OLY_MARK_PER_POINT = olympiadConfig.getInt("AltOlyMarkPerPoint", 20);
- ALT_OLY_HERO_POINTS = olympiadConfig.getInt("AltOlyHeroPoints", 30);
- ALT_OLY_RANK1_POINTS = olympiadConfig.getInt("AltOlyRank1Points", 60);
- ALT_OLY_RANK2_POINTS = olympiadConfig.getInt("AltOlyRank2Points", 50);
- ALT_OLY_RANK3_POINTS = olympiadConfig.getInt("AltOlyRank3Points", 45);
- ALT_OLY_RANK4_POINTS = olympiadConfig.getInt("AltOlyRank4Points", 40);
- ALT_OLY_RANK5_POINTS = olympiadConfig.getInt("AltOlyRank5Points", 30);
- ALT_OLY_MAX_POINTS = olympiadConfig.getInt("AltOlyMaxPoints", 10);
- ALT_OLY_DIVIDER_CLASSED = olympiadConfig.getInt("AltOlyDividerClassed", 5);
- ALT_OLY_DIVIDER_NON_CLASSED = olympiadConfig.getInt("AltOlyDividerNonClassed", 5);
- ALT_OLY_MAX_WEEKLY_MATCHES = olympiadConfig.getInt("AltOlyMaxWeeklyMatches", 30);
- ALT_OLY_LOG_FIGHTS = olympiadConfig.getBoolean("AltOlyLogFights", false);
- ALT_OLY_SHOW_MONTHLY_WINNERS = olympiadConfig.getBoolean("AltOlyShowMonthlyWinners", true);
- ALT_OLY_ANNOUNCE_GAMES = olympiadConfig.getBoolean("AltOlyAnnounceGames", true);
- final String olyRestrictedItems = olympiadConfig.getString("AltOlyRestrictedItems", "").trim();
+ OLYMPIAD_ENABLED = olympiadConfig.getBoolean("OlympiadEnabled", true);
+ OLYMPIAD_START_TIME = olympiadConfig.getInt("OlympiadStartTime", 20);
+ OLYMPIAD_MIN = olympiadConfig.getInt("OlympiadMin", 0);
+ OLYMPIAD_CPERIOD = olympiadConfig.getLong("OlympiadCPeriod", 14400000);
+ OLYMPIAD_BATTLE = olympiadConfig.getLong("OlympiadBattle", 300000);
+ OLYMPIAD_WPERIOD = olympiadConfig.getLong("OlympiadWPeriod", 604800000);
+ OLYMPIAD_VPERIOD = olympiadConfig.getLong("OlympiadVPeriod", 86400000);
+ OLYMPIAD_START_POINTS = olympiadConfig.getInt("OlympiadStartPoints", 1000);
+ OLYMPIAD_CLASSED = olympiadConfig.getInt("OlympiadClassedParticipants", 10);
+ OLYMPIAD_NONCLASSED = olympiadConfig.getInt("OlympiadNonClassedParticipants", 20);
+ OLYMPIAD_WINNER_REWARD = parseItemsList(olympiadConfig.getString("OlympiadWinReward", "45584,12"));
+ OLYMPIAD_LOSER_REWARD = parseItemsList(olympiadConfig.getString("OlympiadLoserReward", "45584,7"));
+ OLYMPIAD_COMP_RITEM = olympiadConfig.getInt("OlympiadCompRewItem", 45584);
+ OLYMPIAD_MIN_MATCHES = olympiadConfig.getInt("OlympiadMinMatchesForPoints", 10);
+ OLYMPIAD_MARK_PER_POINT = olympiadConfig.getInt("OlympiadMarkPerPoint", 20);
+ OLYMPIAD_HERO_POINTS = olympiadConfig.getInt("OlympiadHeroPoints", 30);
+ OLYMPIAD_RANK1_POINTS = olympiadConfig.getInt("OlympiadRank1Points", 60);
+ OLYMPIAD_RANK2_POINTS = olympiadConfig.getInt("OlympiadRank2Points", 50);
+ OLYMPIAD_RANK3_POINTS = olympiadConfig.getInt("OlympiadRank3Points", 45);
+ OLYMPIAD_RANK4_POINTS = olympiadConfig.getInt("OlympiadRank4Points", 40);
+ OLYMPIAD_RANK5_POINTS = olympiadConfig.getInt("OlympiadRank5Points", 30);
+ OLYMPIAD_MAX_POINTS = olympiadConfig.getInt("OlympiadMaxPoints", 10);
+ OLYMPIAD_DIVIDER_CLASSED = olympiadConfig.getInt("OlympiadDividerClassed", 5);
+ OLYMPIAD_DIVIDER_NON_CLASSED = olympiadConfig.getInt("OlympiadDividerNonClassed", 5);
+ OLYMPIAD_MAX_WEEKLY_MATCHES = olympiadConfig.getInt("OlympiadMaxWeeklyMatches", 25);
+ OLYMPIAD_LOG_FIGHTS = olympiadConfig.getBoolean("OlympiadLogFights", false);
+ OLYMPIAD_SHOW_MONTHLY_WINNERS = olympiadConfig.getBoolean("OlympiadShowMonthlyWinners", true);
+ OLYMPIAD_ANNOUNCE_GAMES = olympiadConfig.getBoolean("OlympiadAnnounceGames", true);
+ final String olyRestrictedItems = olympiadConfig.getString("OlympiadRestrictedItems", "").trim();
if (!olyRestrictedItems.isEmpty())
{
final String[] olyRestrictedItemsSplit = olyRestrictedItems.split(",");
- LIST_OLY_RESTRICTED_ITEMS = new HashSet<>(olyRestrictedItemsSplit.length);
+ OLYMPIAD_RESTRICTED_ITEMS = new HashSet<>(olyRestrictedItemsSplit.length);
for (String id : olyRestrictedItemsSplit)
{
- LIST_OLY_RESTRICTED_ITEMS.add(Integer.parseInt(id));
+ OLYMPIAD_RESTRICTED_ITEMS.add(Integer.parseInt(id));
}
}
else // In case of reload with removal of all items ids.
{
- LIST_OLY_RESTRICTED_ITEMS.clear();
+ OLYMPIAD_RESTRICTED_ITEMS.clear();
}
- ALT_OLY_WEAPON_ENCHANT_LIMIT = olympiadConfig.getInt("AltOlyWeaponEnchantLimit", -1);
- ALT_OLY_ARMOR_ENCHANT_LIMIT = olympiadConfig.getInt("AltOlyArmorEnchantLimit", -1);
- ALT_OLY_WAIT_TIME = olympiadConfig.getInt("AltOlyWaitTime", 60);
- ALT_OLY_PERIOD = olympiadConfig.getString("AltOlyPeriod", "MONTH");
- ALT_OLY_PERIOD_MULTIPLIER = olympiadConfig.getInt("AltOlyPeriodMultiplier", 1);
- ALT_OLY_COMPETITION_DAYS = new ArrayList<>();
- for (String s : olympiadConfig.getString("AltOlyCompetitionDays", "6,7").split(","))
+ OLYMPIAD_WEAPON_ENCHANT_LIMIT = olympiadConfig.getInt("OlympiadWeaponEnchantLimit", -1);
+ OLYMPIAD_ARMOR_ENCHANT_LIMIT = olympiadConfig.getInt("OlympiadArmorEnchantLimit", -1);
+ OLYMPIAD_WAIT_TIME = olympiadConfig.getInt("OlympiadWaitTime", 60);
+ OLYMPIAD_PERIOD = olympiadConfig.getString("OlympiadPeriod", "MONTH");
+ OLYMPIAD_PERIOD_MULTIPLIER = olympiadConfig.getInt("OlympiadPeriodMultiplier", 1);
+ OLYMPIAD_COMPETITION_DAYS = new ArrayList<>();
+ for (String s : olympiadConfig.getString("OlympiadCompetitionDays", "6,7").split(","))
{
- ALT_OLY_COMPETITION_DAYS.add(Integer.parseInt(s));
+ OLYMPIAD_COMPETITION_DAYS.add(Integer.parseInt(s));
}
final File hexIdFile = new File(HEXID_FILE);
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/enums/OlympiadMode.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/enums/OlympiadMode.java
new file mode 100644
index 0000000000..a65f6a86a4
--- /dev/null
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/enums/OlympiadMode.java
@@ -0,0 +1,28 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.enums;
+
+/**
+ * @author NasSeKa
+ */
+public enum OlympiadMode
+{
+ NONE,
+ BLUE,
+ RED,
+ SPECTATOR
+}
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/EffectList.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/EffectList.java
index 4c89f9fa5d..929d62829c 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/EffectList.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/EffectList.java
@@ -50,9 +50,9 @@ import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.model.skill.SkillBuffType;
import org.l2jmobius.gameserver.network.serverpackets.AbnormalStatusUpdate;
import org.l2jmobius.gameserver.network.serverpackets.ExAbnormalStatusUpdateFromTarget;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadSpelledInfo;
import org.l2jmobius.gameserver.network.serverpackets.PartySpelled;
import org.l2jmobius.gameserver.network.serverpackets.ShortBuffStatusUpdate;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadSpelledInfo;
/**
* Effect lists.
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java
index 3eb2ea2305..d8c9fa6825 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -99,6 +99,7 @@ import org.l2jmobius.gameserver.enums.ItemGrade;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.enums.MountType;
import org.l2jmobius.gameserver.enums.NextActionType;
+import org.l2jmobius.gameserver.enums.OlympiadMode;
import org.l2jmobius.gameserver.enums.PartyDistributionType;
import org.l2jmobius.gameserver.enums.PartyMessageType;
import org.l2jmobius.gameserver.enums.PartySmallWindowUpdateType;
@@ -308,7 +309,6 @@ import org.l2jmobius.gameserver.network.serverpackets.ExDuelUpdateUserInfo;
import org.l2jmobius.gameserver.network.serverpackets.ExGetBookMarkInfoPacket;
import org.l2jmobius.gameserver.network.serverpackets.ExGetOnAirShip;
import org.l2jmobius.gameserver.network.serverpackets.ExMagicAttackInfo;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMode;
import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCoinInfo;
import org.l2jmobius.gameserver.network.serverpackets.ExPledgeCount;
import org.l2jmobius.gameserver.network.serverpackets.ExPrivateStoreSetWholeMsg;
@@ -366,6 +366,7 @@ import org.l2jmobius.gameserver.network.serverpackets.autoplay.ExAutoPlaySetting
import org.l2jmobius.gameserver.network.serverpackets.commission.ExResponseCommissionInfo;
import org.l2jmobius.gameserver.network.serverpackets.friend.FriendStatus;
import org.l2jmobius.gameserver.network.serverpackets.limitshop.ExBloodyCoinCount;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMode;
import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
import org.l2jmobius.gameserver.taskmanager.AutoPlayTaskManager;
import org.l2jmobius.gameserver.taskmanager.AutoUseTaskManager;
@@ -9364,7 +9365,10 @@ public class Player extends Playable
public void enterObserverMode(Location loc)
{
- setLastLocation();
+ if (!isInOlympiadMode())
+ {
+ setLastLocation();
+ }
// Remove Hide.
getEffectList().stopEffects(AbnormalType.HIDE);
@@ -9417,7 +9421,7 @@ public class Player extends Playable
{
standUp();
}
- if (!_observerMode)
+ if (!_observerMode && !isInOlympiadMode())
{
setLastLocation();
}
@@ -9428,7 +9432,7 @@ public class Player extends Playable
setInvisible(true);
setInstance(OlympiadGameManager.getInstance().getOlympiadTask(id).getStadium().getInstance());
teleToLocation(loc, false);
- sendPacket(new ExOlympiadMode(3));
+ sendPacket(new ExOlympiadMode(OlympiadMode.SPECTATOR));
broadcastUserInfo();
}
@@ -9464,7 +9468,7 @@ public class Player extends Playable
_olympiadGameId = -1;
_observerMode = false;
setTarget(null);
- sendPacket(new ExOlympiadMode(0));
+ sendPacket(new ExOlympiadMode(OlympiadMode.NONE));
setInstance(null);
teleToLocation(_lastLoc, true);
if (!isGM())
@@ -9647,14 +9651,24 @@ public class Player extends Playable
return _olympiadStart;
}
+ public boolean isInOlympiadMode()
+ {
+ return _inOlympiadMode;
+ }
+
public boolean isHero()
{
return _hero;
}
- public boolean isInOlympiadMode()
+ public boolean isLegend()
{
- return _inOlympiadMode;
+ return getVariables().getBoolean(PlayerVariables.IS_LEGEND, false);
+ }
+
+ public void setLegend(boolean legend)
+ {
+ getVariables().set(PlayerVariables.IS_LEGEND, legend);
}
public boolean isInDuel()
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/item/ItemTemplate.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/item/ItemTemplate.java
index 5b2b98879a..79a34c43fb 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/item/ItemTemplate.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/item/ItemTemplate.java
@@ -940,7 +940,7 @@ public abstract class ItemTemplate extends ListenersContainer implements IIdenti
public boolean isOlyRestrictedItem()
{
- return _isOlyRestricted || Config.LIST_OLY_RESTRICTED_ITEMS.contains(_itemId);
+ return _isOlyRestricted || Config.OLYMPIAD_RESTRICTED_ITEMS.contains(_itemId);
}
/**
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/item/instance/Item.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/item/instance/Item.java
index 1d440c4a12..0780b9a7ba 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/item/instance/Item.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/item/instance/Item.java
@@ -1995,16 +1995,16 @@ public class Item extends WorldObject
{
if (_itemTemplate.isWeapon())
{
- if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT))
+ if ((Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT))
{
- enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT;
+ enchant = Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT;
}
}
else
{
- if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT))
+ if ((Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT))
{
- enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT;
+ enchant = Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT;
}
}
}
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
index 0d9104ee74..191e04ae87 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/AbstractOlympiadGame.java
@@ -22,6 +22,7 @@ import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.ai.CtrlIntention;
+import org.l2jmobius.gameserver.enums.OlympiadMode;
import org.l2jmobius.gameserver.enums.PartyMessageType;
import org.l2jmobius.gameserver.instancemanager.AntiFeedManager;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
@@ -39,11 +40,11 @@ import org.l2jmobius.gameserver.model.siege.Castle;
import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.network.SystemMessageId;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMode;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
import org.l2jmobius.gameserver.network.serverpackets.SkillCoolTime;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMode;
/**
* @author godson, GodKratos, Pere, DS
@@ -163,7 +164,7 @@ public abstract class AbstractOlympiadGame
return null;
}
- protected static boolean portPlayerToArena(Participant par, Location loc, int id, Instance instance)
+ protected static boolean portPlayerToArena(Participant par, Location loc, int id, Instance instance, OlympiadMode mode)
{
final Player player = par.getPlayer();
if ((player == null) || !player.isOnline())
@@ -173,6 +174,7 @@ public abstract class AbstractOlympiadGame
try
{
+ player.setPvpFlag(0);
player.setLastLocation();
if (player.isSitting())
{
@@ -185,7 +187,32 @@ public abstract class AbstractOlympiadGame
player.setOlympiadStart(false);
player.setOlympiadSide(par.getSide());
player.teleToLocation(loc, instance);
- player.sendPacket(new ExOlympiadMode(2));
+ player.sendPacket(new ExOlympiadMode(mode));
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ return false;
+ }
+ return true;
+ }
+
+ protected static boolean portPlayerToSpot(Participant par, Location loc, int id)
+ {
+ final Player player = par.getPlayer();
+ if ((player == null) || !player.isOnline())
+ {
+ return false;
+ }
+
+ try
+ {
+ if (player.isSitting())
+ {
+ player.standUp();
+ }
+ player.setTarget(null);
+ player.teleToLocation(loc);
}
catch (Exception e)
{
@@ -299,6 +326,48 @@ public abstract class AbstractOlympiadGame
}
}
+ protected void roundTwoClean(Player player)
+ {
+ try
+ {
+ if (player == null)
+ {
+ return;
+ }
+
+ // Remove Debuffs
+ player.getEffectList().stopEffects(info -> info.getSkill().isDebuff(), true, true);
+
+ // Abort casting if player casting
+ player.abortAttack();
+ player.abortCast();
+
+ // Force the character to be visible
+ player.setInvisible(false);
+
+ // Heal Player fully
+ player.setCurrentCp(player.getMaxCp());
+ player.setCurrentHp(player.getMaxHp());
+ player.setCurrentMp(player.getMaxMp());
+
+ // enable skills with cool time <= 15 minutes
+ for (Skill skill : player.getAllSkills())
+ {
+ if (skill.getReuseDelay() <= 900000)
+ {
+ player.enableSkill(skill);
+ }
+ }
+
+ player.sendSkillList();
+ player.sendPacket(new SkillCoolTime(player));
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+ }
+
protected void cleanEffects(Player player)
{
try
@@ -371,7 +440,8 @@ public abstract class AbstractOlympiadGame
player.setOlympiadStart(false);
player.setOlympiadSide(-1);
player.setOlympiadGameId(-1);
- player.sendPacket(new ExOlympiadMode(0));
+ player.sendPacket(new ExOlympiadMode(OlympiadMode.SPECTATOR));
+ player.sendPacket(new ExOlympiadMode(OlympiadMode.NONE));
// Add Clan Skills
final Clan clan = player.getClan();
@@ -420,6 +490,7 @@ public abstract class AbstractOlympiadGame
{
return;
}
+
final Location loc = player.getLastLocation();
if (loc != null)
{
@@ -481,6 +552,8 @@ public abstract class AbstractOlympiadGame
protected abstract boolean portPlayersToArena(List spawns, Instance instance);
+ protected abstract boolean portPlayersToSpots(List spawns, Instance instance);
+
protected abstract void cleanEffects();
protected abstract void portPlayersBack();
@@ -489,22 +562,40 @@ public abstract class AbstractOlympiadGame
protected abstract void clearPlayers();
+ protected abstract void matchEnd(boolean value);
+
+ protected abstract boolean isMatchEnd();
+
protected abstract void handleDisconnect(Player player);
protected abstract void resetDamage();
+ protected abstract void resetDamageFinal();
+
protected abstract void addDamage(Player player, int damage);
protected abstract boolean checkBattleStatus();
protected abstract boolean haveWinner();
+ protected abstract boolean roundWinner();
+
protected abstract void validateWinner(OlympiadStadium stadium);
+ protected abstract void validateRound1Winner(OlympiadStadium stadium);
+
+ protected abstract void validateRound2Winner(OlympiadStadium stadium);
+
+ protected abstract void validateRound3Winner(OlympiadStadium stadium);
+
protected abstract int getDivider();
protected abstract void healPlayers();
+ protected abstract void buffPlayers();
+
+ protected abstract void roundTwoCleanUp();
+
protected abstract void untransformPlayers();
protected abstract void makePlayersInvul();
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/Hero.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
index 3396422d6b..5cce74a21c 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/Hero.java
@@ -40,6 +40,7 @@ import org.l2jmobius.gameserver.data.sql.ClanTable;
import org.l2jmobius.gameserver.data.xml.ClassListData;
import org.l2jmobius.gameserver.data.xml.NpcData;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
+import org.l2jmobius.gameserver.instancemanager.RankManager;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Player;
@@ -71,7 +72,7 @@ public class Hero
private static final String INSERT_HERO = "INSERT INTO heroes (charId, class_id, count, legend_count, played, claimed) VALUES (?,?,?,?,?,?)";
private static final String UPDATE_HERO = "UPDATE heroes SET count = ?, legend_count = ?, played = ?, claimed = ? WHERE charId = ?";
private static final String GET_CLAN_ALLY = "SELECT characters.clanid AS clanid, coalesce(clan_data.ally_Id, 0) AS allyId FROM characters LEFT JOIN clan_data ON clan_data.clan_id = characters.clanid WHERE characters.charId = ?";
- private static final String DELETE_ITEMS = "DELETE FROM items WHERE item_id IN (30392, 30393, 30394, 30395, 30396, 30397, 30398, 30399, 30400, 30401, 30402, 30403, 30404, 30405, 30372, 30373, 6842, 6611, 6612, 6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 9388, 9389, 9390, 48551, 48552) AND owner_id NOT IN (SELECT charId FROM characters WHERE accesslevel > 0)";
+ private static final String DELETE_ITEMS = "DELETE FROM items WHERE item_id IN (30392, 30393, 30394, 30395, 30396, 30397, 30398, 30399, 30400, 30401, 30402, 30403, 30404, 30405, 30372, 30373, 6842, 6611, 6612, 6613, 6614, 6615, 6616, 6617, 6618, 6619, 6620, 6621, 9388, 9389, 9390, 48551, 48552, 48554, 48555, 48556, 48557, 48558, 48559, 48560, 48561, 48562, 48563, 48564, 48565, 48566, 48567) AND owner_id NOT IN (SELECT charId FROM characters WHERE accesslevel > 0)";
private static final Map HEROES = new ConcurrentHashMap<>();
private static final Map COMPLETE_HEROS = new ConcurrentHashMap<>();
@@ -95,7 +96,10 @@ public class Hero
protected Hero()
{
- init();
+ if (Config.OLYMPIAD_ENABLED)
+ {
+ init();
+ }
}
private void init()
@@ -607,6 +611,10 @@ public class Hero
}
player.setHero(false);
+ if (player.isLegend())
+ {
+ player.setLegend(false);
+ }
for (int i = 0; i < Inventory.PAPERDOLL_TOTALSLOTS; i++)
{
@@ -644,19 +652,17 @@ public class Hero
for (StatSet hero : newHeroes)
{
+ final int legendId = RankManager.getInstance().getOlyRankList().get(1).getInt("charId", 0);
final int charId = hero.getInt(Olympiad.CHAR_ID);
if (COMPLETE_HEROS.containsKey(charId))
{
final StatSet oldHero = COMPLETE_HEROS.get(charId);
- if (hero.getInt(LEGEND_COUNT, 0) == 1)
+ final int count = oldHero.getInt(COUNT);
+ oldHero.set(COUNT, count + 1);
+ if (charId == legendId)
{
- final int count = oldHero.getInt(LEGEND_COUNT);
- oldHero.set(LEGEND_COUNT, count + 1);
- }
- else
- {
- final int count = oldHero.getInt(COUNT);
- oldHero.set(COUNT, count + 1);
+ final int legendCount = oldHero.getInt(LEGEND_COUNT);
+ oldHero.set(LEGEND_COUNT, legendCount + 1);
}
oldHero.set(PLAYED, 1);
oldHero.set(CLAIMED, false);
@@ -667,14 +673,11 @@ public class Hero
final StatSet newHero = new StatSet();
newHero.set(Olympiad.CHAR_NAME, hero.getString(Olympiad.CHAR_NAME));
newHero.set(Olympiad.CLASS_ID, hero.getInt(Olympiad.CLASS_ID));
- if (hero.getInt(LEGEND_COUNT, 0) == 1)
+ newHero.set(COUNT, 1);
+ if (charId == legendId)
{
newHero.set(LEGEND_COUNT, 1);
}
- else
- {
- newHero.set(COUNT, 1);
- }
newHero.set(PLAYED, 1);
newHero.set(CLAIMED, false);
HEROES.put(charId, newHero);
@@ -918,6 +921,7 @@ public class Hero
*/
public void claimHero(Player player)
{
+ final int legendId = RankManager.getInstance().getOlyRankList().get(1).getInt("charId", 0);
StatSet hero = HEROES.get(player.getObjectId());
if (hero == null)
{
@@ -938,6 +942,19 @@ public class Hero
}
player.setHero(true);
+ if (player.getObjectId() == legendId)
+ {
+ player.setLegend(true);
+ player.getVariables().set(ALLY_NAME, false);
+ if ((clan != null) && (clan.getLevel() >= 5))
+ {
+ clan.addReputationScore(100000);
+ final SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_MEMBER_C1_HAS_BECOME_THE_HERO_CLAN_REPUTATION_POINTS_S2);
+ sm.addString(CharNameTable.getInstance().getNameById(player.getObjectId()));
+ sm.addInt(Config.HERO_POINTS);
+ clan.broadcastToOnlineMembers(sm);
+ }
+ }
player.broadcastPacket(new SocialAction(player.getObjectId(), 20016)); // Hero Animation
player.sendPacket(new UserInfo(player));
player.broadcastUserInfo();
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java
index 8864817e16..f8c7c09208 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/Olympiad.java
@@ -50,6 +50,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.events.ListenersContainer;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadInfo;
import org.l2jmobius.gameserver.util.Broadcast;
/**
@@ -69,13 +70,13 @@ public class Olympiad extends ListenersContainer
private static final String OLYMPIAD_LOAD_NOBLES = "SELECT olympiad_nobles.charId, olympiad_nobles.class_id, characters.char_name, olympiad_nobles.olympiad_points, olympiad_nobles.competitions_done, olympiad_nobles.competitions_won, olympiad_nobles.competitions_lost, olympiad_nobles.competitions_drawn, olympiad_nobles.competitions_done_week FROM olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId";
private static final String OLYMPIAD_SAVE_NOBLES = "INSERT INTO olympiad_nobles (`charId`,`class_id`,`olympiad_points`,`competitions_done`,`competitions_won`,`competitions_lost`,`competitions_drawn`, `competitions_done_week`) VALUES (?,?,?,?,?,?,?,?)";
private static final String OLYMPIAD_UPDATE_NOBLES = "UPDATE olympiad_nobles SET olympiad_points = ?, competitions_done = ?, competitions_won = ?, competitions_lost = ?, competitions_drawn = ?, competitions_done_week = ? WHERE charId = ?";
- private static final String OLYMPIAD_GET_HEROS = "SELECT olympiad_nobles.charId, characters.char_name FROM olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND olympiad_nobles.class_id = ? AND olympiad_nobles.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " AND olympiad_nobles.competitions_won > 0 ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC";
- private static final String OLYMPIAD_GET_LEGEND = "SELECT olympiad_nobles.charId FROM olympiad_nobles WHERE olympiad_nobles.competitions_done >=" + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC LIMIT 1";
- private static final String GET_ALL_CLASSIFIED_NOBLESS = "SELECT charId from olympiad_nobles_eom WHERE competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_points DESC, competitions_done DESC, competitions_won DESC";
- private static final String GET_EACH_CLASS_LEADER = "SELECT characters.char_name from olympiad_nobles_eom, characters WHERE characters.charId = olympiad_nobles_eom.charId AND olympiad_nobles_eom.class_id = ? AND olympiad_nobles_eom.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles_eom.olympiad_points DESC, olympiad_nobles_eom.competitions_done DESC, olympiad_nobles_eom.competitions_won DESC LIMIT 10";
- private static final String GET_EACH_CLASS_LEADER_CURRENT = "SELECT characters.char_name from olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND olympiad_nobles.class_id = ? AND olympiad_nobles.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC LIMIT 10";
- private static final String GET_EACH_CLASS_LEADER_SOULHOUND = "SELECT characters.char_name from olympiad_nobles_eom, characters WHERE characters.charId = olympiad_nobles_eom.charId AND (olympiad_nobles_eom.class_id = ? OR olympiad_nobles_eom.class_id = 133) AND olympiad_nobles_eom.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles_eom.olympiad_points DESC, olympiad_nobles_eom.competitions_done DESC, olympiad_nobles_eom.competitions_won DESC LIMIT 10";
- private static final String GET_EACH_CLASS_LEADER_CURRENT_SOULHOUND = "SELECT characters.char_name from olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND (olympiad_nobles.class_id = ? OR olympiad_nobles.class_id = 133) AND olympiad_nobles.competitions_done >= " + Config.ALT_OLY_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC LIMIT 10";
+ private static final String OLYMPIAD_GET_HEROS = "SELECT olympiad_nobles.charId, characters.char_name FROM olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND olympiad_nobles.class_id = ? AND olympiad_nobles.competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " AND olympiad_nobles.competitions_won > 0 ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC";
+ private static final String OLYMPIAD_GET_LEGEND = "SELECT olympiad_nobles.charId FROM olympiad_nobles WHERE olympiad_nobles.competitions_done >=" + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC LIMIT 1";
+ private static final String GET_ALL_CLASSIFIED_NOBLESS = "SELECT charId from olympiad_nobles_eom WHERE competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_points DESC, competitions_done DESC, competitions_won DESC";
+ private static final String GET_EACH_CLASS_LEADER = "SELECT characters.char_name from olympiad_nobles_eom, characters WHERE characters.charId = olympiad_nobles_eom.charId AND olympiad_nobles_eom.class_id = ? AND olympiad_nobles_eom.competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_nobles_eom.olympiad_points DESC, olympiad_nobles_eom.competitions_done DESC, olympiad_nobles_eom.competitions_won DESC LIMIT 10";
+ private static final String GET_EACH_CLASS_LEADER_CURRENT = "SELECT characters.char_name from olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND olympiad_nobles.class_id = ? AND olympiad_nobles.competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC LIMIT 10";
+ private static final String GET_EACH_CLASS_LEADER_SOULHOUND = "SELECT characters.char_name from olympiad_nobles_eom, characters WHERE characters.charId = olympiad_nobles_eom.charId AND (olympiad_nobles_eom.class_id = ? OR olympiad_nobles_eom.class_id = 133) AND olympiad_nobles_eom.competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_nobles_eom.olympiad_points DESC, olympiad_nobles_eom.competitions_done DESC, olympiad_nobles_eom.competitions_won DESC LIMIT 10";
+ private static final String GET_EACH_CLASS_LEADER_CURRENT_SOULHOUND = "SELECT characters.char_name from olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND (olympiad_nobles.class_id = ? OR olympiad_nobles.class_id = 133) AND olympiad_nobles.competitions_done >= " + Config.OLYMPIAD_MIN_MATCHES + " ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC LIMIT 10";
private static final String REMOVE_UNCLAIMED_POINTS = "DELETE FROM character_variables WHERE charId=? AND var=?";
private static final String INSERT_UNCLAIMED_POINTS = "INSERT INTO character_variables (charId, var, val) VALUES (?, ?, ?)";
@@ -87,14 +88,13 @@ public class Olympiad extends ListenersContainer
private static final Set HERO_IDS = CategoryData.getInstance().getCategoryByType(CategoryType.SIXTH_CLASS_GROUP);
- private static final int COMP_START = Config.ALT_OLY_START_TIME; // 6PM
- private static final int COMP_MIN = Config.ALT_OLY_MIN; // 00 mins
- private static final long COMP_PERIOD = Config.ALT_OLY_CPERIOD; // 6 hours
- protected static final long WEEKLY_PERIOD = Config.ALT_OLY_WPERIOD; // 1 week
- protected static final long VALIDATION_PERIOD = Config.ALT_OLY_VPERIOD; // 24 hours
+ private static final int COMP_START = Config.OLYMPIAD_START_TIME; // 6PM
+ private static final int COMP_MIN = Config.OLYMPIAD_MIN; // 00 mins
+ private static final long COMP_PERIOD = Config.OLYMPIAD_CPERIOD; // 6 hours
+ protected static final long WEEKLY_PERIOD = Config.OLYMPIAD_WPERIOD; // 1 week
+ protected static final long VALIDATION_PERIOD = Config.OLYMPIAD_VPERIOD; // 24 hours
- public static final int DEFAULT_POINTS = Config.ALT_OLY_START_POINTS;
- protected static final int WEEKLY_POINTS = Config.ALT_OLY_WEEKLY_POINTS;
+ public static final int DEFAULT_POINTS = Config.OLYMPIAD_START_POINTS;
public static final String CHAR_ID = "charId";
public static final String CLASS_ID = "class_id";
@@ -131,12 +131,19 @@ public class Olympiad extends ListenersContainer
protected Olympiad()
{
- load();
- AntiFeedManager.getInstance().registerEvent(AntiFeedManager.OLYMPIAD_ID);
-
- if (_period == 0)
+ if (Config.OLYMPIAD_ENABLED)
{
- init();
+ load();
+ AntiFeedManager.getInstance().registerEvent(AntiFeedManager.OLYMPIAD_ID);
+
+ if (_period == 0)
+ {
+ init();
+ }
+ }
+ else
+ {
+ LOGGER.log(Level.INFO, "Disabled.");
}
}
@@ -399,7 +406,7 @@ public class Olympiad extends ListenersContainer
int dayCounter = 0;
for (int i = currentDay; i < 8; i++)
{
- if (Config.ALT_OLY_COMPETITION_DAYS.contains(i))
+ if (Config.OLYMPIAD_COMPETITION_DAYS.contains(i))
{
dayFound = true;
break;
@@ -410,7 +417,7 @@ public class Olympiad extends ListenersContainer
{
for (int i = 1; i < 8; i++)
{
- if (Config.ALT_OLY_COMPETITION_DAYS.contains(i))
+ if (Config.OLYMPIAD_COMPETITION_DAYS.contains(i))
{
break;
}
@@ -514,19 +521,24 @@ public class Olympiad extends ListenersContainer
_scheduledCompStart = ThreadPool.schedule(() ->
{
- if (isOlympiadEnd())
+ if (isOlympiadEnd() || !Config.OLYMPIAD_ENABLED)
{
return;
}
_inCompPeriod = true;
+ for (Player player : World.getInstance().getPlayers())
+ {
+ player.sendPacket(new ExOlympiadInfo(1));
+ }
+
Broadcast.toAllOnlinePlayers(new SystemMessage(SystemMessageId.THE_OLYMPIAD_HAS_BEGAN));
LOGGER.info("Olympiad System: Olympiad Games have started.");
LOGGER_OLYMPIAD.info("Result,Player1,Player2,Player1 HP,Player2 HP,Player1 Damage,Player2 Damage,Points,Classed");
_gameManager = ThreadPool.scheduleAtFixedRate(OlympiadGameManager.getInstance(), 30000, 30000);
- if (Config.ALT_OLY_ANNOUNCE_GAMES)
+ if (Config.OLYMPIAD_ANNOUNCE_GAMES)
{
_gameAnnouncer = ThreadPool.scheduleAtFixedRate(new OlympiadAnnouncer(), 30000, 500);
}
@@ -543,7 +555,14 @@ public class Olympiad extends ListenersContainer
{
return;
}
+
_inCompPeriod = false;
+
+ for (Player player : World.getInstance().getPlayers())
+ {
+ player.sendPacket(new ExOlympiadInfo(0));
+ }
+
Broadcast.toAllOnlinePlayers(new SystemMessage(SystemMessageId.BATTLES_IN_THE_OLYMPIAD_GAMES_ARE_NOW_OVER));
LOGGER.info("Olympiad System: Olympiad games have ended.");
@@ -624,33 +643,33 @@ public class Olympiad extends ListenersContainer
final Calendar nextChange = Calendar.getInstance();
- switch (Config.ALT_OLY_PERIOD)
+ switch (Config.OLYMPIAD_PERIOD)
{
case "DAY":
{
- currentTime.add(Calendar.DAY_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
+ currentTime.add(Calendar.DAY_OF_MONTH, Config.OLYMPIAD_PERIOD_MULTIPLIER);
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
- if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 14)
+ if (Config.OLYMPIAD_PERIOD_MULTIPLIER >= 14)
{
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
}
- else if (Config.ALT_OLY_PERIOD_MULTIPLIER >= 7)
+ else if (Config.OLYMPIAD_PERIOD_MULTIPLIER >= 7)
{
_nextWeeklyChange = nextChange.getTimeInMillis() + (WEEKLY_PERIOD / 2);
}
else
{
- LOGGER.warning("Invalid config value for Config.ALT_OLY_PERIOD_MULTIPLIER, must be >= 7");
+ LOGGER.warning("Invalid config value for Config.OLYMPIAD_PERIOD_MULTIPLIER, must be >= 7");
}
break;
}
case "WEEK":
{
- currentTime.add(Calendar.WEEK_OF_MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
+ currentTime.add(Calendar.WEEK_OF_MONTH, Config.OLYMPIAD_PERIOD_MULTIPLIER);
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
- if (Config.ALT_OLY_PERIOD_MULTIPLIER > 1)
+ if (Config.OLYMPIAD_PERIOD_MULTIPLIER > 1)
{
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
}
@@ -662,7 +681,7 @@ public class Olympiad extends ListenersContainer
}
case "MONTH":
{
- currentTime.add(Calendar.MONTH, Config.ALT_OLY_PERIOD_MULTIPLIER);
+ currentTime.add(Calendar.MONTH, Config.OLYMPIAD_PERIOD_MULTIPLIER);
currentTime.add(Calendar.DAY_OF_MONTH, -1); // last day is for validation
_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
@@ -719,7 +738,7 @@ public class Olympiad extends ListenersContainer
int dayCounter = 0;
for (int i = currentDay; i < 8; i++)
{
- if (Config.ALT_OLY_COMPETITION_DAYS.contains(i))
+ if (Config.OLYMPIAD_COMPETITION_DAYS.contains(i))
{
dayFound = true;
break;
@@ -730,7 +749,7 @@ public class Olympiad extends ListenersContainer
{
for (int i = 1; i < 8; i++)
{
- if (Config.ALT_OLY_COMPETITION_DAYS.contains(i))
+ if (Config.OLYMPIAD_COMPETITION_DAYS.contains(i))
{
break;
}
@@ -769,8 +788,6 @@ public class Olympiad extends ListenersContainer
{
_scheduledWeeklyTask = ThreadPool.scheduleAtFixedRate(() ->
{
- addWeeklyPoints();
- LOGGER.info("Olympiad System: Added weekly points to nobles");
resetWeeklyMatches();
LOGGER.info("Olympiad System: Reset weekly matches to nobles");
@@ -778,22 +795,6 @@ public class Olympiad extends ListenersContainer
}, getMillisToWeekChange(), WEEKLY_PERIOD);
}
- protected synchronized void addWeeklyPoints()
- {
- if (_period == 1)
- {
- return;
- }
-
- int currentPoints;
- for (StatSet nobleInfo : NOBLES.values())
- {
- currentPoints = nobleInfo.getInt(POINTS);
- currentPoints += WEEKLY_POINTS;
- nobleInfo.set(POINTS, currentPoints);
- }
- }
-
/**
* Resets number of matches, classed matches, non classed matches, team matches done by noble characters in the week.
*/
@@ -1036,7 +1037,7 @@ public class Olympiad extends ListenersContainer
public List getClassLeaderBoard(int classId)
{
final List names = new ArrayList<>();
- final String query = Config.ALT_OLY_SHOW_MONTHLY_WINNERS ? ((classId == 132) ? GET_EACH_CLASS_LEADER_SOULHOUND : GET_EACH_CLASS_LEADER) : ((classId == 132) ? GET_EACH_CLASS_LEADER_CURRENT_SOULHOUND : GET_EACH_CLASS_LEADER_CURRENT);
+ final String query = Config.OLYMPIAD_SHOW_MONTHLY_WINNERS ? ((classId == 132) ? GET_EACH_CLASS_LEADER_SOULHOUND : GET_EACH_CLASS_LEADER) : ((classId == 132) ? GET_EACH_CLASS_LEADER_CURRENT_SOULHOUND : GET_EACH_CLASS_LEADER_CURRENT);
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement ps = con.prepareStatement(query))
{
@@ -1075,33 +1076,33 @@ public class Olympiad extends ListenersContainer
}
// Hero point bonus
- int points = Hero.getInstance().isHero(objectId) || Hero.getInstance().isUnclaimedHero(objectId) ? Config.ALT_OLY_HERO_POINTS : 0;
+ int points = Hero.getInstance().isHero(objectId) || Hero.getInstance().isUnclaimedHero(objectId) ? Config.OLYMPIAD_HERO_POINTS : 0;
// Rank point bonus
switch (NOBLES_RANK.get(objectId))
{
case 1:
{
- points += Config.ALT_OLY_RANK1_POINTS;
+ points += Config.OLYMPIAD_RANK1_POINTS;
break;
}
case 2:
{
- points += Config.ALT_OLY_RANK2_POINTS;
+ points += Config.OLYMPIAD_RANK2_POINTS;
break;
}
case 3:
{
- points += Config.ALT_OLY_RANK3_POINTS;
+ points += Config.OLYMPIAD_RANK3_POINTS;
break;
}
case 4:
{
- points += Config.ALT_OLY_RANK4_POINTS;
+ points += Config.OLYMPIAD_RANK4_POINTS;
break;
}
default:
{
- points += Config.ALT_OLY_RANK5_POINTS;
+ points += Config.OLYMPIAD_RANK5_POINTS;
}
}
@@ -1203,7 +1204,7 @@ public class Olympiad extends ListenersContainer
*/
public int getRemainingWeeklyMatches(int objId)
{
- return Math.max(Config.ALT_OLY_MAX_WEEKLY_MATCHES - getCompetitionDoneWeek(objId), 0);
+ return Math.max(Config.OLYMPIAD_MAX_WEEKLY_MATCHES - getCompetitionDoneWeek(objId), 0);
}
protected void deleteNobles()
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java
index ce206a1675..2eb778a7ee 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameClassed.java
@@ -41,7 +41,7 @@ public class OlympiadGameClassed extends OlympiadGameNormal
@Override
protected int getDivider()
{
- return Config.ALT_OLY_DIVIDER_CLASSED;
+ return Config.OLYMPIAD_DIVIDER_CLASSED;
}
protected static OlympiadGameClassed createGame(int id, List> classList)
@@ -73,4 +73,13 @@ public class OlympiadGameClassed extends OlympiadGameNormal
}
return null;
}
+
+ /*
+ * (non-Javadoc)
+ * @see org.l2jmobius.gameserver.model.olympiad.AbstractOlympiadGame#validateRound3Winner(org.l2jmobius.gameserver.model.olympiad.OlympiadStadium)
+ */
+ @Override
+ protected void validateRound3Winner(OlympiadStadium stadium)
+ {
+ }
}
\ No newline at end of file
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNonClassed.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNonClassed.java
index ccea7ddce1..cc60cc61fd 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNonClassed.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNonClassed.java
@@ -39,7 +39,7 @@ public class OlympiadGameNonClassed extends OlympiadGameNormal
@Override
protected int getDivider()
{
- return Config.ALT_OLY_DIVIDER_NON_CLASSED;
+ return Config.OLYMPIAD_DIVIDER_NON_CLASSED;
}
protected static OlympiadGameNonClassed createGame(int id, Set list)
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
index aebeb46ec7..c4b70f9346 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameNormal.java
@@ -27,7 +27,9 @@ import java.util.logging.Level;
import org.l2jmobius.Config;
import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Rnd;
+import org.l2jmobius.gameserver.enums.OlympiadMode;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Creature;
@@ -35,11 +37,14 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.events.EventDispatcher;
import org.l2jmobius.gameserver.model.events.impl.olympiad.OnOlympiadMatchResult;
import org.l2jmobius.gameserver.model.instancezone.Instance;
+import org.l2jmobius.gameserver.model.skill.CommonSkill;
+import org.l2jmobius.gameserver.model.skill.SkillCaster;
import org.l2jmobius.gameserver.network.SystemMessageId;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchResult;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadUserInfo;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchInfo;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchResult;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadUserInfo;
/**
* @author GodKratos, Pere, DS
@@ -48,10 +53,19 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
{
protected int _damageP1 = 0;
protected int _damageP2 = 0;
+ protected int _damageP1Final = 0;
+ protected int _damageP2Final = 0;
protected Participant _playerOne;
protected Participant _playerTwo;
+ String round_1_winner;
+ String round_2_winner;
+ String round_3_winner;
+ int player1Wins = 0;
+ int player2Wins = 0;
+ boolean matchEnd;
+
protected OlympiadGameNormal(int id, Participant[] opponents)
{
super(id);
@@ -162,8 +176,25 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
boolean result = true;
try
{
- result &= portPlayerToArena(_playerOne, spawns.get(0), _stadiumId, instance);
- result &= portPlayerToArena(_playerTwo, spawns.get(spawns.size() / 2), _stadiumId, instance);
+ result &= portPlayerToArena(_playerOne, spawns.get(0), _stadiumId, instance, OlympiadMode.BLUE);
+ result &= portPlayerToArena(_playerTwo, spawns.get(spawns.size() / 2), _stadiumId, instance, OlympiadMode.RED);
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, "", e);
+ return false;
+ }
+ return result;
+ }
+
+ @Override
+ protected final boolean portPlayersToSpots(List spawns, Instance instance)
+ {
+ boolean result = true;
+ try
+ {
+ result &= portPlayerToSpot(_playerOne, spawns.get(0), _stadiumId);
+ result &= portPlayerToSpot(_playerTwo, spawns.get(spawns.size() / 2), _stadiumId);
}
catch (Exception e)
{
@@ -332,6 +363,407 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
return playerOneLost || playerTwoLost;
}
+ @Override
+ public final boolean roundWinner()
+ {
+ if (!checkBattleStatus())
+ {
+ return true;
+ }
+
+ boolean playerOneLost = true;
+ try
+ {
+ if (_playerOne.getPlayer().getOlympiadGameId() == _stadiumId)
+ {
+ playerOneLost = _playerOne.getPlayer().isDead();
+ }
+ }
+ catch (Exception e)
+ {
+ playerOneLost = true;
+ }
+
+ boolean playerTwoLost = true;
+ try
+ {
+ if (_playerTwo.getPlayer().getOlympiadGameId() == _stadiumId)
+ {
+ playerTwoLost = _playerTwo.getPlayer().isDead();
+ }
+ }
+ catch (Exception e)
+ {
+ playerTwoLost = true;
+ }
+
+ return playerOneLost || playerTwoLost;
+ }
+
+ @Override
+ public void matchEnd(boolean value)
+ {
+ matchEnd = value;
+ }
+
+ @Override
+ public boolean isMatchEnd()
+ {
+ return matchEnd;
+ }
+
+ @Override
+ protected void validateRound1Winner(OlympiadStadium stadium)
+ {
+ if (_aborted)
+ {
+ return;
+ }
+
+ SystemMessage sm;
+
+ try
+ {
+ double playerOneHp = 0;
+ if ((_playerOne.getPlayer() != null) && !_playerOne.getPlayer().isDead())
+ {
+ playerOneHp = _playerOne.getPlayer().getCurrentHp() + _playerOne.getPlayer().getCurrentCp();
+ if (playerOneHp < 0.5)
+ {
+ playerOneHp = 0;
+ }
+ }
+
+ double playerTwoHp = 0;
+ if ((_playerTwo.getPlayer() != null) && !_playerTwo.getPlayer().isDead())
+ {
+ playerTwoHp = _playerTwo.getPlayer().getCurrentHp() + _playerTwo.getPlayer().getCurrentCp();
+ if (playerTwoHp < 0.5)
+ {
+ playerTwoHp = 0;
+ }
+ }
+
+ // if players crashed, search if they've relogged
+ _playerOne.updatePlayer();
+ _playerTwo.updatePlayer();
+
+ _damageP1Final += _damageP1;
+ _damageP2Final += _damageP2;
+
+ if (((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline()) && ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline()))
+ {
+ _playerOne.updateStat(COMP_DRAWN, 1);
+ _playerTwo.updateStat(COMP_DRAWN, 1);
+ sm = new SystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
+ stadium.broadcastPacket(sm);
+ }
+ else if ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerOne.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerTwo.getPlayer().setCurrentCp(_playerTwo.getPlayer().getMaxCp() * 0.7);
+ _playerTwo.getPlayer().setCurrentHp(_playerTwo.getPlayer().getMaxHp() * 0.7);
+ _playerTwo.getPlayer().setCurrentMp(_playerTwo.getPlayer().getMaxMp() * 0.7);
+ _playerTwo.getPlayer().sendPacket(loose);
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 0, 1, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 0, 1, 20));
+ ThreadPool.schedule(() ->
+ {
+ SkillCaster.triggerCast(_playerOne.getPlayer(), _playerOne.getPlayer(), CommonSkill.OLYMPIAD_WIN.getSkill());
+ }, 2000);
+ ThreadPool.schedule(() ->
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 0, 1, 100));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 0, 1, 100));
+ }, 20000);
+ round_1_winner = _playerOne.getName();
+ player1Wins += 1;
+ }
+ else if ((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline() || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP2 > _damageP1) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerTwo.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerOne.getPlayer().sendPacket(loose);
+ _playerOne.getPlayer().setCurrentCp(_playerOne.getPlayer().getMaxCp() * 0.7);
+ _playerOne.getPlayer().setCurrentHp(_playerOne.getPlayer().getMaxHp() * 0.7);
+ _playerOne.getPlayer().setCurrentMp(_playerOne.getPlayer().getMaxMp() * 0.7);
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 1, 1, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 1, 1, 20));
+ ThreadPool.schedule(() ->
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 1, 1, 100));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 1, 1, 100));
+ }, 20000);
+ ThreadPool.schedule(() ->
+ {
+ _playerTwo.getPlayer().useMagic(CommonSkill.OLYMPIAD_WIN.getSkill(), null, false, false);
+ }, 2000);
+ round_1_winner = _playerTwo.getName();
+ player2Wins += 1;
+ }
+ else
+ {
+ round_1_winner = null;
+ final SystemMessage _tie = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIE);
+ _playerTwo.getPlayer().broadcastPacket(_tie);
+ _playerOne.getPlayer().broadcastPacket(_tie);
+ }
+ resetDamage();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, "Exception on validateRound1Winner(): " + e.getMessage(), e);
+ }
+ }
+
+ @Override
+ protected void validateRound2Winner(OlympiadStadium stadium)
+ {
+ if (_aborted)
+ {
+ return;
+ }
+
+ SystemMessage sm;
+
+ try
+ {
+ double playerOneHp = 0;
+ if ((_playerOne.getPlayer() != null) && !_playerOne.getPlayer().isDead())
+ {
+ playerOneHp = _playerOne.getPlayer().getCurrentHp() + _playerOne.getPlayer().getCurrentCp();
+ if (playerOneHp < 0.5)
+ {
+ playerOneHp = 0;
+ }
+ }
+
+ double playerTwoHp = 0;
+ if ((_playerTwo.getPlayer() != null) && !_playerTwo.getPlayer().isDead())
+ {
+ playerTwoHp = _playerTwo.getPlayer().getCurrentHp() + _playerTwo.getPlayer().getCurrentCp();
+ if (playerTwoHp < 0.5)
+ {
+ playerTwoHp = 0;
+ }
+ }
+
+ // if players crashed, search if they've relogged
+ _playerOne.updatePlayer();
+ _playerTwo.updatePlayer();
+
+ _damageP1Final += _damageP1;
+ _damageP2Final += _damageP2;
+
+ if (((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline()) && ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline()))
+ {
+ _playerOne.updateStat(COMP_DRAWN, 1);
+ _playerTwo.updateStat(COMP_DRAWN, 1);
+ sm = new SystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
+ stadium.broadcastPacket(sm);
+ }
+ else if ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerOne.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerTwo.getPlayer().sendPacket(loose);
+ round_2_winner = _playerOne.getName();
+ player1Wins += 1;
+
+ if (round_1_winner.toLowerCase().equalsIgnoreCase(_playerOne.getName()))
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 0, 2, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 0, 2, 20));
+ matchEnd(true);
+ }
+ else
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 20));
+ ThreadPool.schedule(() ->
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 100));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 100));
+ }, 20000);
+ }
+ ThreadPool.schedule(() ->
+ {
+ SkillCaster.triggerCast(_playerOne.getPlayer(), _playerOne.getPlayer(), CommonSkill.OLYMPIAD_WIN.getSkill());
+ }, 2000);
+ }
+ else if ((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline() || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP2 > _damageP1) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerTwo.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerOne.getPlayer().sendPacket(loose);
+ round_2_winner = _playerTwo.getName();
+ player2Wins += 1;
+
+ if (round_1_winner.toLowerCase().equalsIgnoreCase(_playerTwo.getName()))
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 2, 2, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 0, 2, 2, 20));
+ matchEnd(true);
+ }
+ else
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 20));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 20));
+ ThreadPool.schedule(() ->
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 100));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 1, 2, 100));
+ }, 20000);
+ }
+ ThreadPool.schedule(() ->
+ {
+ _playerTwo.getPlayer().useMagic(CommonSkill.OLYMPIAD_WIN.getSkill(), null, false, false);
+ }, 2000);
+ }
+ else
+ {
+ final SystemMessage _tie = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIE);
+ _playerTwo.getPlayer().broadcastPacket(_tie);
+ _playerOne.getPlayer().broadcastPacket(_tie);
+ }
+ resetDamage();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, "Exception on validateRound2Winner(): " + e.getMessage(), e);
+ }
+ }
+
+ @Override
+ protected void validateRound3Winner(OlympiadStadium stadium)
+ {
+ if (_aborted)
+ {
+ return;
+ }
+
+ SystemMessage sm;
+
+ try
+ {
+ double playerOneHp = 0;
+ if ((_playerOne.getPlayer() != null) && !_playerOne.getPlayer().isDead())
+ {
+ playerOneHp = _playerOne.getPlayer().getCurrentHp() + _playerOne.getPlayer().getCurrentCp();
+ if (playerOneHp < 0.5)
+ {
+ playerOneHp = 0;
+ }
+ }
+
+ double playerTwoHp = 0;
+ if ((_playerTwo.getPlayer() != null) && !_playerTwo.getPlayer().isDead())
+ {
+ playerTwoHp = _playerTwo.getPlayer().getCurrentHp() + _playerTwo.getPlayer().getCurrentCp();
+ if (playerTwoHp < 0.5)
+ {
+ playerTwoHp = 0;
+ }
+ }
+
+ // if players crashed, search if they've relogged
+ _playerOne.updatePlayer();
+ _playerTwo.updatePlayer();
+
+ _damageP1Final += _damageP1;
+ _damageP2Final += _damageP2;
+
+ if (((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline()) && ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline()))
+ {
+ _playerOne.updateStat(COMP_DRAWN, 1);
+ _playerTwo.updateStat(COMP_DRAWN, 1);
+ sm = new SystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
+ stadium.broadcastPacket(sm);
+ }
+ else if ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerOne.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerTwo.getPlayer().sendPacket(loose);
+ round_3_winner = _playerOne.getName();
+ player1Wins += 1;
+ if (round_3_winner.toLowerCase().equalsIgnoreCase(_playerOne.getName()))
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 1, 3, 0));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 1, 3, 0));
+ }
+ else
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 2, 3, 0));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 2, 3, 0));
+ }
+ ThreadPool.schedule(() ->
+ {
+ SkillCaster.triggerCast(_playerOne.getPlayer(), _playerOne.getPlayer(), CommonSkill.OLYMPIAD_WIN.getSkill());
+ }, 2000);
+
+ }
+ else if ((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline() || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
+ {
+ final SystemMessage KO = new SystemMessage(((_damageP2 > _damageP1) && (playerTwoHp != 0) && (playerOneHp != 0)) ? SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIME_OVER : SystemMessageId.HIDDEN_MSG_OLYMPIAD_KNOCK_DOWN);
+ _playerOne.getPlayer().sendPacket(KO);
+ _playerTwo.getPlayer().sendPacket(KO);
+ final SystemMessage win = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_VICTORY);
+ _playerTwo.getPlayer().sendPacket(win);
+ final SystemMessage loose = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_DEFEAT);
+ _playerOne.getPlayer().sendPacket(loose);
+ round_3_winner = _playerTwo.getName();
+ player2Wins += 1;
+ if (round_3_winner.toLowerCase().equalsIgnoreCase(_playerTwo.getName()))
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 2, 3, 0));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 1, 2, 3, 0));
+ }
+ else
+ {
+ _playerOne.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 1, 3, 0));
+ _playerTwo.getPlayer().sendPacket(new ExOlympiadMatchInfo(_playerOne.getName(), _playerTwo.getName(), 2, 1, 3, 0));
+ }
+ ThreadPool.schedule(() ->
+ {
+ SkillCaster.triggerCast(_playerTwo.getPlayer(), _playerTwo.getPlayer(), CommonSkill.OLYMPIAD_WIN.getSkill());
+ }, 2000);
+ }
+ else
+ {
+ final SystemMessage _tie = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_TIE);
+ _playerTwo.getPlayer().broadcastPacket(_tie);
+ _playerOne.getPlayer().broadcastPacket(_tie);
+ }
+ resetDamage();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, "Exception on validateRound3Winner(): " + e.getMessage(), e);
+ }
+ }
+
@Override
protected void validateWinner(OlympiadStadium stadium)
{
@@ -342,7 +774,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
ExOlympiadMatchResult result = null;
- boolean tie = false;
+ boolean tie = round_1_winner == null ? true : false;
int winside = 0;
final List list1 = new ArrayList<>(1);
@@ -358,9 +790,9 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
{
pointDiff = 1;
}
- else if (pointDiff > Config.ALT_OLY_MAX_POINTS)
+ else if (pointDiff > Config.OLYMPIAD_MAX_POINTS)
{
- pointDiff = Config.ALT_OLY_MAX_POINTS;
+ pointDiff = Config.OLYMPIAD_MAX_POINTS;
}
int points;
@@ -375,13 +807,13 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
{
try
{
- points = Math.min(playerOnePoints / 3, Config.ALT_OLY_MAX_POINTS);
+ points = Math.min(playerOnePoints / 3, Config.OLYMPIAD_MAX_POINTS);
removePointsFromParticipant(_playerOne, points);
list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints - points, -points));
winside = 2;
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info(_playerOne.getName() + " default," + _playerOne + "," + _playerTwo + ",0,0,0,0," + points + "," + getType());
}
@@ -395,7 +827,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
{
try
{
- points = Math.min(playerTwoPoints / 3, Config.ALT_OLY_MAX_POINTS);
+ points = Math.min(playerTwoPoints / 3, Config.OLYMPIAD_MAX_POINTS);
removePointsFromParticipant(_playerTwo, points);
list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints - points, -points));
@@ -408,7 +840,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
winside = 1;
}
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info(_playerTwo.getName() + " default," + _playerOne + "," + _playerTwo + ",0,0,0,0," + points + "," + getType());
}
@@ -420,11 +852,11 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
}
if (winside == 1)
{
- result = new ExOlympiadMatchResult(tie, winside, list1, list2);
+ result = new ExOlympiadMatchResult(tie, winside, list1, list2, 0, 0, 0);
}
else
{
- result = new ExOlympiadMatchResult(tie, winside, list2, list1);
+ result = new ExOlympiadMatchResult(tie, winside, list2, list1, 0, 0, 0);
}
stadium.broadcastPacket(result);
return;
@@ -449,17 +881,17 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_playerOne.updateStat(COMP_WON, 1);
addPointsToParticipant(_playerOne, pointDiff);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints + pointDiff, pointDiff));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints + pointDiff, pointDiff));
_playerTwo.updateStat(COMP_LOST, 1);
removePointsFromParticipant(_playerTwo, pointDiff);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints - pointDiff, -pointDiff));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints - pointDiff, -pointDiff));
winside = 1;
- rewardParticipant(_playerOne.getPlayer(), Config.ALT_OLY_WINNER_REWARD); // Winner
+ rewardParticipant(_playerOne.getPlayer(), Config.OLYMPIAD_WINNER_REWARD); // Winner
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info(_playerTwo.getName() + " crash," + _playerOne + "," + _playerTwo + ",0,0,0,0," + pointDiff + "," + getType());
}
@@ -475,17 +907,17 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_playerTwo.updateStat(COMP_WON, 1);
addPointsToParticipant(_playerTwo, pointDiff);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints + pointDiff, pointDiff));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints + pointDiff, pointDiff));
_playerOne.updateStat(COMP_LOST, 1);
removePointsFromParticipant(_playerOne, pointDiff);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints - pointDiff, -pointDiff));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints - pointDiff, -pointDiff));
winside = 2;
- rewardParticipant(_playerTwo.getPlayer(), Config.ALT_OLY_WINNER_REWARD); // Winner
+ rewardParticipant(_playerTwo.getPlayer(), Config.OLYMPIAD_WINNER_REWARD); // Winner
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info(_playerOne.getName() + " crash," + _playerOne + "," + _playerTwo + ",0,0,0,0," + pointDiff + "," + getType());
}
@@ -498,15 +930,15 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_playerOne.updateStat(COMP_LOST, 1);
removePointsFromParticipant(_playerOne, pointDiff);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints - pointDiff, -pointDiff));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints - pointDiff, -pointDiff));
_playerTwo.updateStat(COMP_LOST, 1);
removePointsFromParticipant(_playerTwo, pointDiff);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints - pointDiff, -pointDiff));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints - pointDiff, -pointDiff));
tie = true;
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info("both crash," + _playerOne.getName() + "," + _playerOne + ",0,0,0,0," + _playerTwo + "," + pointDiff + "," + getType());
}
@@ -519,11 +951,11 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
if (winside == 1)
{
- result = new ExOlympiadMatchResult(tie, winside, list1, list2);
+ result = new ExOlympiadMatchResult(tie, winside, list1, list2, 0, 0, 0);
}
else
{
- result = new ExOlympiadMatchResult(tie, winside, list2, list1);
+ result = new ExOlympiadMatchResult(tie, winside, list2, list1, 0, 0, 0);
}
stadium.broadcastPacket(result);
@@ -577,7 +1009,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
sm = new SystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
stadium.broadcastPacket(sm);
}
- else if ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
+ else if ((player1Wins == 2) || (_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
{
sm = new SystemMessage(SystemMessageId.CONGRATULATIONS_C1_YOU_WIN_THE_MATCH);
sm.addString(_playerOne.getName());
@@ -587,10 +1019,10 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_playerTwo.updateStat(COMP_LOST, 1);
addPointsToParticipant(_playerOne, pointDiff);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints + pointDiff, pointDiff));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints + pointDiff, pointDiff));
removePointsFromParticipant(_playerTwo, pointDiff);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints - pointDiff, -pointDiff));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints - pointDiff, -pointDiff));
winner = _playerOne.getName() + " won";
winside = 1;
@@ -598,13 +1030,13 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
// Save Fight Result
saveResults(_playerOne, _playerTwo, 1, _startTime, _fightTime, getType());
- rewardParticipant(_playerOne.getPlayer(), Config.ALT_OLY_WINNER_REWARD); // Winner
- rewardParticipant(_playerTwo.getPlayer(), Config.ALT_OLY_LOSER_REWARD); // Loser
+ rewardParticipant(_playerOne.getPlayer(), Config.OLYMPIAD_WINNER_REWARD); // Winner
+ rewardParticipant(_playerTwo.getPlayer(), Config.OLYMPIAD_LOSER_REWARD); // Loser
// Notify to scripts
EventDispatcher.getInstance().notifyEventAsync(new OnOlympiadMatchResult(_playerOne, _playerTwo, getType()), Olympiad.getInstance());
}
- else if ((_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline() || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
+ else if ((player2Wins == 2) || (_playerOne.getPlayer() == null) || !_playerOne.getPlayer().isOnline() || ((playerOneHp == 0) && (playerTwoHp != 0)) || ((_damageP2 > _damageP1) && (playerOneHp != 0) && (playerTwoHp != 0)))
{
sm = new SystemMessage(SystemMessageId.CONGRATULATIONS_C1_YOU_WIN_THE_MATCH);
sm.addString(_playerTwo.getName());
@@ -614,10 +1046,10 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_playerOne.updateStat(COMP_LOST, 1);
addPointsToParticipant(_playerTwo, pointDiff);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints + pointDiff, pointDiff));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints + pointDiff, pointDiff));
removePointsFromParticipant(_playerOne, pointDiff);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints - pointDiff, -pointDiff));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints - pointDiff, -pointDiff));
winner = _playerTwo.getName() + " won";
winside = 2;
@@ -625,8 +1057,8 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
// Save Fight Result
saveResults(_playerOne, _playerTwo, 2, _startTime, _fightTime, getType());
- rewardParticipant(_playerTwo.getPlayer(), Config.ALT_OLY_WINNER_REWARD); // Winner
- rewardParticipant(_playerOne.getPlayer(), Config.ALT_OLY_LOSER_REWARD); // Loser
+ rewardParticipant(_playerTwo.getPlayer(), Config.OLYMPIAD_WINNER_REWARD); // Winner
+ rewardParticipant(_playerOne.getPlayer(), Config.OLYMPIAD_LOSER_REWARD); // Loser
// Notify to scripts
EventDispatcher.getInstance().notifyEventAsync(new OnOlympiadMatchResult(_playerTwo, _playerOne, getType()), Olympiad.getInstance());
@@ -639,14 +1071,14 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
sm = new SystemMessage(SystemMessageId.THE_DUEL_HAS_ENDED_IN_A_TIE);
stadium.broadcastPacket(sm);
- int value = Math.min(playerOnePoints / getDivider(), Config.ALT_OLY_MAX_POINTS);
+ int value = Math.min(playerOnePoints / getDivider(), Config.OLYMPIAD_MAX_POINTS);
removePointsFromParticipant(_playerOne, value);
- list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1, playerOnePoints - value, -value));
+ list1.add(new OlympiadInfo(_playerOne.getName(), _playerOne.getClanName(), _playerOne.getClanId(), _playerOne.getBaseClass(), _damageP1Final, playerOnePoints - value, -value));
- value = Math.min(playerTwoPoints / getDivider(), Config.ALT_OLY_MAX_POINTS);
+ value = Math.min(playerTwoPoints / getDivider(), Config.OLYMPIAD_MAX_POINTS);
removePointsFromParticipant(_playerTwo, value);
- list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2, playerTwoPoints - value, -value));
+ list2.add(new OlympiadInfo(_playerTwo.getName(), _playerTwo.getClanName(), _playerTwo.getClanId(), _playerTwo.getBaseClass(), _damageP2Final, playerTwoPoints - value, -value));
tie = true;
}
@@ -658,15 +1090,16 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
if (winside == 1)
{
- result = new ExOlympiadMatchResult(tie, winside, list1, list2);
+ result = new ExOlympiadMatchResult(tie, winside, list1, list2, round_1_winner.equalsIgnoreCase(_playerOne.getName()) ? 2 : 3, round_2_winner.equalsIgnoreCase(_playerOne.getName()) ? 2 : 3, (round_3_winner != null) && round_3_winner.equalsIgnoreCase(_playerOne.getName()) ? 2 : (round_3_winner == null) ? 0 : 3);
}
else
{
- result = new ExOlympiadMatchResult(tie, winside, list2, list1);
+ result = new ExOlympiadMatchResult(tie, winside, list2, list1, round_1_winner.equalsIgnoreCase(_playerTwo.getName()) ? 3 : 2, round_2_winner.equalsIgnoreCase(_playerTwo.getName()) ? 3 : 2, (round_3_winner != null) && round_3_winner.equalsIgnoreCase(_playerTwo.getName()) ? 3 : (round_3_winner == null) ? 0 : 2);
}
+
stadium.broadcastPacket(result);
- if (Config.ALT_OLY_LOG_FIGHTS)
+ if (Config.OLYMPIAD_LOG_FIGHTS)
{
LOGGER_OLYMPIAD.info(winner + "," + _playerOne.getName() + "," + _playerOne + "," + _playerTwo + "," + playerOneHp + "," + playerTwoHp + "," + _damageP1 + "," + _damageP2 + "," + pointDiff + "," + getType());
}
@@ -750,6 +1183,13 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
_damageP2 = 0;
}
+ @Override
+ public void resetDamageFinal()
+ {
+ _damageP1Final = 0;
+ _damageP2Final = 0;
+ }
+
protected void saveResults(Participant one, Participant two, int winner, long startTime, long fightTime, CompetitionType type)
{
try (Connection con = DatabaseFactory.getConnection();
@@ -791,6 +1231,41 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
}
}
+ @Override
+ protected void buffPlayers()
+ {
+ final Player player1 = _playerOne.getPlayer();
+ if (player1 != null)
+ {
+ SkillCaster.triggerCast(player1, player1, CommonSkill.OLYMPIAD_HARMONY.getSkill());
+ SkillCaster.triggerCast(player1, player1, CommonSkill.OLYMPIAD_MELODY.getSkill());
+ }
+
+ final Player player2 = _playerTwo.getPlayer();
+ if (player2 != null)
+ {
+ SkillCaster.triggerCast(player2, player2, CommonSkill.OLYMPIAD_HARMONY.getSkill());
+ SkillCaster.triggerCast(player2, player2, CommonSkill.OLYMPIAD_MELODY.getSkill());
+ }
+ }
+
+ @Override
+ protected void roundTwoCleanUp()
+ {
+ ThreadPool.schedule(() ->
+ {
+ if ((_playerOne.getPlayer() != null) && !_playerOne.isDefaulted() && !_playerOne.isDisconnected() && (_playerOne.getPlayer().getOlympiadGameId() == _stadiumId))
+ {
+ roundTwoClean(_playerOne.getPlayer());
+ }
+
+ if ((_playerTwo.getPlayer() != null) && !_playerTwo.isDefaulted() && !_playerTwo.isDisconnected() && (_playerTwo.getPlayer().getOlympiadGameId() == _stadiumId))
+ {
+ roundTwoClean(_playerTwo.getPlayer());
+ }
+ }, 1000);
+ }
+
@Override
protected void untransformPlayers()
{
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameState.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameState.java
index f5706a922a..074be05d14 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameState.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameState.java
@@ -24,7 +24,13 @@ enum OlympiadGameState
BATTLE_COUNTDOWN_FIRST,
BATTLE_COUNTDOWN_SECOND,
BATTLE_STARTED,
+ ROUND_1,
+ WAIT_TIME_1,
+ ROUND_2,
+ WAIT_TIME_2,
+ ROUND_3,
BATTLE_IN_PROGRESS,
+ ROUND_ENDED,
GAME_STOPPED,
TELEPORT_TO_TOWN,
CLEANUP,
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
index 437800a8c3..36763f7f88 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadGameTask.java
@@ -23,6 +23,7 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchInfo;
/**
* @author DS
@@ -116,7 +117,7 @@ public class OlympiadGameTask implements Runnable
public boolean isBattleStarted()
{
- return _state == OlympiadGameState.BATTLE_IN_PROGRESS;
+ return (_state == OlympiadGameState.BATTLE_IN_PROGRESS) || (_state == OlympiadGameState.ROUND_2) || (_state == OlympiadGameState.ROUND_3);
}
public boolean isBattleFinished()
@@ -163,6 +164,8 @@ public class OlympiadGameTask implements Runnable
{
try
{
+ final String player1 = _game.getPlayerNames()[0];
+ final String player2 = _game.getPlayerNames()[1];
int delay = 1; // schedule next call after 1s
switch (_state)
{
@@ -170,7 +173,7 @@ public class OlympiadGameTask implements Runnable
case BEGIN:
{
_state = OlympiadGameState.TELEPORT_TO_ARENA;
- _countDown = Config.ALT_OLY_WAIT_TIME;
+ _countDown = Config.OLYMPIAD_WAIT_TIME;
break;
}
// Teleport to arena countdown
@@ -198,6 +201,7 @@ public class OlympiadGameTask implements Runnable
// Game start, port players to arena
case GAME_STARTED:
{
+ _stadium.makeZonePvPForCharsInside(false);
if (!startGame())
{
_state = OlympiadGameState.GAME_STOPPED;
@@ -215,7 +219,7 @@ public class OlympiadGameTask implements Runnable
{
if (_countDown > 0)
{
- if (_countDown == 55) // 55sec
+ if (_countDown == 50) // 55sec
{
_game.healPlayers();
}
@@ -232,6 +236,7 @@ public class OlympiadGameTask implements Runnable
{
_game.makePlayersInvul();
_game.resetDamage();
+ _game.resetDamageFinal();
_stadium.openDoors();
_state = OlympiadGameState.BATTLE_COUNTDOWN_SECOND;
@@ -255,15 +260,33 @@ public class OlympiadGameTask implements Runnable
{
_state = OlympiadGameState.BATTLE_STARTED;
_game.removePlayersInvul();
- _stadium.broadcastPacket(new SystemMessage(SystemMessageId.HIDDEN_MSG_START_OLYMPIAD));
}
break;
}
// Beginning of the battle
case BATTLE_STARTED:
{
- _countDown = 0;
+ _countDown = (int) Config.OLYMPIAD_BATTLE / 1000;
+
+ _game.broadcastPacket(new ExOlympiadMatchInfo(player1, player2, 0, 0, 1, 100));
+
+ final SystemMessage round1 = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_ROUND_1);
+ _stadium.broadcastPacket(round1);
+ final SystemMessage start = new SystemMessage(SystemMessageId.HIDDEN_MSG_START_OLYMPIAD);
+ _stadium.broadcastPacket(start);
+ _game.broadcastOlympiadInfo(_stadium);
+ _state = OlympiadGameState.ROUND_1; // set state first, used in zone update
+ if (!startBattle())
+ {
+ _state = OlympiadGameState.GAME_STOPPED;
+ }
+ break;
+ }
+ case ROUND_1:
+ {
_state = OlympiadGameState.BATTLE_IN_PROGRESS; // set state first, used in zone update
+ _countDown = (int) Config.OLYMPIAD_BATTLE / 1000;
+ _stadium.makeZonePvPForCharsInside(true);
if (!startBattle())
{
_state = OlympiadGameState.GAME_STOPPED;
@@ -273,8 +296,8 @@ public class OlympiadGameTask implements Runnable
// Checks during battle
case BATTLE_IN_PROGRESS:
{
- _countDown += 1000;
- final int remaining = (int) ((Config.ALT_OLY_BATTLE - _countDown) / 1000);
+ _countDown -= 1;
+ final int remaining = (int) Config.OLYMPIAD_BATTLE / 1000;
for (int announceTime : BATTLE_END_TIME_SECOND)
{
if (announceTime == remaining)
@@ -285,13 +308,122 @@ public class OlympiadGameTask implements Runnable
break;
}
}
-
- if (checkBattle() || (_countDown > Config.ALT_OLY_BATTLE))
+ if (roundCheck() || (_countDown <= 0))
+ {
+ round1();
+ _game.makePlayersInvul();
+ _state = OlympiadGameState.WAIT_TIME_1;
+ _stadium.makeZonePvPForCharsInside(false);
+ _countDown = 20;
+ }
+ else if (checkBattle())
{
_state = OlympiadGameState.GAME_STOPPED;
}
break;
}
+ case WAIT_TIME_1:
+ {
+ _countDown -= 1;
+ if (_countDown == 14)
+ {
+ _game.buffPlayers();
+ _game.portPlayersToSpots(_stadium.getZone().getSpawns(), _stadium.getInstance());
+ _game.broadcastOlympiadInfo(_stadium);
+ }
+ if (_countDown <= 0)
+ {
+ _game.removePlayersInvul();
+ _state = OlympiadGameState.ROUND_2;
+ _countDown = (int) Config.OLYMPIAD_BATTLE / 1000;
+ final SystemMessage round2 = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_ROUND_2);
+ _stadium.broadcastPacket(round2);
+ final SystemMessage start = new SystemMessage(SystemMessageId.HIDDEN_MSG_START_OLYMPIAD);
+ _stadium.broadcastPacket(start);
+ _stadium.makeZonePvPForCharsInside(true);
+ _game.broadcastOlympiadInfo(_stadium);
+ }
+ break;
+ }
+ case ROUND_2:
+ {
+ _countDown -= 1;
+ final int remaining = (int) Config.OLYMPIAD_BATTLE / 1000;
+ for (int announceTime : BATTLE_END_TIME_SECOND)
+ {
+ if (announceTime == remaining)
+ {
+ final SystemMessage sm = new SystemMessage(SystemMessageId.THE_GAME_ENDS_IN_S1_SEC);
+ sm.addInt(announceTime);
+ _stadium.broadcastPacket(sm);
+ break;
+ }
+ }
+ if (roundCheck() || (_countDown <= 0))
+ {
+ round2();
+ if (_game.isMatchEnd())
+ {
+ _state = OlympiadGameState.GAME_STOPPED;
+ break;
+ }
+ _state = OlympiadGameState.WAIT_TIME_2;
+ _game.makePlayersInvul();
+ _stadium.makeZonePvPForCharsInside(false);
+ _countDown = 20;
+ }
+ else if (checkBattle())
+ {
+ _state = OlympiadGameState.GAME_STOPPED;
+ }
+ break;
+ }
+ case WAIT_TIME_2:
+ {
+ _countDown -= 1;
+ if (_countDown == 14)
+ {
+ _game.buffPlayers();
+ _game.roundTwoCleanUp();
+ _game.broadcastOlympiadInfo(_stadium);
+ _game.portPlayersToSpots(_stadium.getZone().getSpawns(), _stadium.getInstance());
+ }
+ if (_countDown <= 0)
+ {
+ _state = OlympiadGameState.ROUND_3;
+ _game.removePlayersInvul();
+ _countDown = (int) Config.OLYMPIAD_BATTLE / 1000;
+ final SystemMessage round2 = new SystemMessage(SystemMessageId.HIDDEN_MSG_OLYMPIAD_ROUND_3);
+ _stadium.broadcastPacket(round2);
+ final SystemMessage start = new SystemMessage(SystemMessageId.HIDDEN_MSG_START_OLYMPIAD);
+ _stadium.broadcastPacket(start);
+ _stadium.makeZonePvPForCharsInside(true);
+ _game.broadcastOlympiadInfo(_stadium);
+ }
+ break;
+ }
+ case ROUND_3:
+ {
+ _countDown -= 1;
+ final int remaining = (int) Config.OLYMPIAD_BATTLE / 1000;
+ for (int announceTime : BATTLE_END_TIME_SECOND)
+ {
+ if (announceTime == remaining)
+ {
+ final SystemMessage sm = new SystemMessage(SystemMessageId.THE_GAME_ENDS_IN_S1_SEC);
+ sm.addInt(announceTime);
+ _stadium.broadcastPacket(sm);
+ break;
+ }
+ }
+ if (roundCheck() || (_countDown <= 0) || checkBattle())
+ {
+ round3();
+ _game.makePlayersInvul();
+ _stadium.makeZonePvPForCharsInside(false);
+ }
+ break;
+ }
// End of the battle
case GAME_STOPPED:
{
@@ -425,7 +557,7 @@ public class OlympiadGameTask implements Runnable
{
// game successfully started
_game.broadcastOlympiadInfo(_stadium);
- _stadium.broadcastPacket(new SystemMessage(SystemMessageId.THE_MATCH_HAS_BEGUN_FIGHT));
+ // _stadium.broadcastPacket(new SystemMessage(SystemMessageId.THE_MATCH_HAS_BEGUN_FIGHT));
_stadium.updateZoneStatusForCharactersInside();
return true;
}
@@ -437,6 +569,82 @@ public class OlympiadGameTask implements Runnable
return false;
}
+ private boolean roundCheck()
+ {
+ try
+ {
+ return _game.roundWinner();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+ return true;
+ }
+
+ private void round1()
+ {
+ try
+ {
+ _game.validateRound1Winner(_stadium);
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+ }
+
+ private void round2()
+ {
+ try
+ {
+ _game.validateRound2Winner(_stadium);
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+ }
+
+ private void round3()
+ {
+ try
+ {
+ _game.validateRound3Winner(_stadium);
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+
+ try
+ {
+ _game.makePlayersInvul();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+
+ try
+ {
+ _stadium.updateZoneStatusForCharactersInside();
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+
+ try
+ {
+ _state = OlympiadGameState.GAME_STOPPED;
+ }
+ catch (Exception e)
+ {
+ LOGGER.log(Level.WARNING, e.getMessage(), e);
+ }
+ }
+
/**
* Fifth stage: battle is running, returns true if winner found.
* @return
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadManager.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadManager.java
index acc42aff21..3a0949eb9e 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadManager.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadManager.java
@@ -45,11 +45,6 @@ public class OlympiadManager
{
}
- public static OlympiadManager getInstance()
- {
- return SingletonHolder.INSTANCE;
- }
-
public Set getRegisteredNonClassBased()
{
return _nonClassBasedRegisters;
@@ -65,7 +60,7 @@ public class OlympiadManager
List> result = null;
for (Entry> classList : _classBasedRegisters.entrySet())
{
- if ((classList.getValue() != null) && (classList.getValue().size() >= Config.ALT_OLY_CLASSED))
+ if ((classList.getValue() != null) && (classList.getValue().size() >= Config.OLYMPIAD_CLASSED))
{
if (result == null)
{
@@ -80,7 +75,7 @@ public class OlympiadManager
protected final boolean hasEnoughRegisteredNonClassed()
{
- return _nonClassBasedRegisters.size() >= Config.ALT_OLY_NONCLASSED;
+ return _nonClassBasedRegisters.size() >= Config.OLYMPIAD_NONCLASSED;
}
protected final void clearRegistered()
@@ -341,11 +336,6 @@ public class OlympiadManager
return _nonClassBasedRegisters.size() + _classBasedRegisters.size();
}
- private static class SingletonHolder
- {
- protected static final OlympiadManager INSTANCE = new OlympiadManager();
- }
-
private int getClassGroup(Player player)
{
if (player.isInCategory(CategoryType.SIXTH_TIR_GROUP))
@@ -389,4 +379,14 @@ public class OlympiadManager
return player.getBaseClass();
}
}
+
+ public static OlympiadManager getInstance()
+ {
+ return SingletonHolder.INSTANCE;
+ }
+
+ private static class SingletonHolder
+ {
+ protected static final OlympiadManager INSTANCE = new OlympiadManager();
+ }
}
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java
index 187c1f71be..04c582b581 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/olympiad/OlympiadStadium.java
@@ -31,11 +31,9 @@ import org.l2jmobius.gameserver.model.actor.instance.Door;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.model.zone.type.OlympiadStadiumZone;
-import org.l2jmobius.gameserver.network.SystemMessageId;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchEnd;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadUserInfo;
import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
-import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchEnd;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadUserInfo;
/**
* @author JIV
@@ -127,6 +125,32 @@ public class OlympiadStadium
}
}
+ public void makeZonePvPForCharsInside(boolean value)
+ {
+ if (_task == null)
+ {
+ return;
+ }
+ if (value)
+ {
+ for (Player player : _instance.getPlayers())
+ {
+ player.setInsideZone(ZoneId.PVP, true);
+ player.setOlympiadStart(true);
+ _task.getGame().sendOlympiadInfo(player);
+ }
+ }
+ else
+ {
+ for (Player player : _instance.getPlayers())
+ {
+ player.setInsideZone(ZoneId.PVP, false);
+ player.setOlympiadStart(false);
+ _task.getGame().sendOlympiadInfo(player);
+ }
+ }
+ }
+
public void updateZoneStatusForCharactersInside()
{
if (_task == null)
@@ -135,15 +159,16 @@ public class OlympiadStadium
}
final boolean battleStarted = _task.isBattleStarted();
- final SystemMessage sm;
- if (battleStarted)
- {
- sm = new SystemMessage(SystemMessageId.YOU_HAVE_ENTERED_A_COMBAT_ZONE);
- }
- else
- {
- sm = new SystemMessage(SystemMessageId.YOU_HAVE_LEFT_A_COMBAT_ZONE);
- }
+ final boolean battleEnded = _task.isBattleFinished();
+ // final SystemMessage sm;
+ // if (battleStarted)
+ // {
+ // sm = new SystemMessage(SystemMessageId.YOU_HAVE_ENTERED_A_COMBAT_ZONE);
+ // }
+ // else
+ // {
+ // sm = new SystemMessage(SystemMessageId.YOU_HAVE_LEFT_A_COMBAT_ZONE);
+ // }
for (Player player : _instance.getPlayers())
{
@@ -155,12 +180,16 @@ public class OlympiadStadium
if (battleStarted)
{
player.setInsideZone(ZoneId.PVP, true);
- player.sendPacket(sm);
+ // player.sendPacket(sm);
}
else
{
player.setInsideZone(ZoneId.PVP, false);
- player.sendPacket(sm);
+ // player.sendPacket(sm);
+ // player.sendPacket(ExOlympiadMatchEnd.STATIC_PACKET);
+ }
+ if (battleEnded)
+ {
player.sendPacket(ExOlympiadMatchEnd.STATIC_PACKET);
}
}
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/skill/CommonSkill.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/skill/CommonSkill.java
index 079965b961..def733177d 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/skill/CommonSkill.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/skill/CommonSkill.java
@@ -71,7 +71,10 @@ public enum CommonSkill
EINHASAD_OVERSEEING_3(29413, 3),
EINHASAD_OVERSEEING_4(29413, 4),
EINHASAD_CHAINS(29414, 1),
- TELEPORTATION_CUBE(39723, 1);
+ TELEPORTATION_CUBE(39723, 1),
+ OLYMPIAD_MELODY(34247, 1),
+ OLYMPIAD_HARMONY(32415, 1),
+ OLYMPIAD_WIN(32417, 1);
private final SkillHolder _holder;
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/skill/SkillCaster.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/skill/SkillCaster.java
index b6eb20451e..ad780eb6a8 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/skill/SkillCaster.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/skill/SkillCaster.java
@@ -130,11 +130,16 @@ public class SkillCaster implements Runnable
*/
public static SkillCaster castSkill(Creature caster, WorldObject target, Skill skill, Item item, SkillCastingType castingType, boolean ctrlPressed, boolean shiftPressed)
{
- // Prevent players from attacking before the Olympiad countdown ends. Olympiad Manager NPC is excluded.
if (caster.isPlayer() && caster.getActingPlayer().isInOlympiadMode() && !caster.getActingPlayer().isOlympiadStart() && skill.isBad() && (target != null) && (target.getId() != 36402))
{
return null;
}
+ // Prevent players from attacking before the Olympiad countdown ends. Olympiad Manager NPC is excluded.
+ if (caster.isPlayer() && caster.getActingPlayer().isInOlympiadMode() && !caster.getActingPlayer().isOlympiadStart() && skill.isBad())
+ {
+ return null;
+ }
+
return castSkill(caster, target, skill, item, castingType, ctrlPressed, shiftPressed, -1);
}
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java
index 292794ad91..3dafff1f02 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/IStatFunction.java
@@ -133,16 +133,16 @@ public interface IStatFunction
{
if (item.isWeapon())
{
- if ((Config.ALT_OLY_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_WEAPON_ENCHANT_LIMIT))
+ if ((Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT >= 0) && (enchant > Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT))
{
- enchant = Config.ALT_OLY_WEAPON_ENCHANT_LIMIT;
+ enchant = Config.OLYMPIAD_WEAPON_ENCHANT_LIMIT;
}
}
else
{
- if ((Config.ALT_OLY_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.ALT_OLY_ARMOR_ENCHANT_LIMIT))
+ if ((Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT >= 0) && (enchant > Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT))
{
- enchant = Config.ALT_OLY_ARMOR_ENCHANT_LIMIT;
+ enchant = Config.OLYMPIAD_ARMOR_ENCHANT_LIMIT;
}
}
}
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java
index 1bd9892a87..2aa14eb946 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java
@@ -71,6 +71,7 @@ public class PlayerVariables extends AbstractVariables
public static final String HUNTING_ZONE_ENTRY = "HUNTING_ZONE_ENTRY_";
public static final String HUNTING_ZONE_TIME = "HUNTING_ZONE_TIME_";
public static final String HUNTING_ZONE_REMAIN_REFILL = "HUNTING_ZONE_REMAIN_REFILL_";
+ public static final String IS_LEGEND = "IS_LEGEND";
public static final String FAVORITE_TELEPORTS = "FAVORITE_TELEPORTS";
public static final String HOMUNCULUS_HP_POINTS = "HOMUNCULUS_HP_POINTS";
public static final String HOMUNCULUS_SP_POINTS = "HOMUNCULUS_SP_POINTS";
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java
index 1d54eaef7f..6b6bafd8ae 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/zone/type/OlympiadStadiumZone.java
@@ -34,7 +34,7 @@ import org.l2jmobius.gameserver.model.zone.AbstractZoneSettings;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.model.zone.ZoneRespawn;
import org.l2jmobius.gameserver.network.SystemMessageId;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchEnd;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchEnd;
/**
* An olympiad stadium
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java
index c0e3e1e6a5..b538ee8f98 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java
@@ -122,6 +122,12 @@ import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeAdd
import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMenteeWaitingList;
import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMentorCancel;
import org.l2jmobius.gameserver.network.clientpackets.mentoring.RequestMentorList;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.OlympiadMatchMaking;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.OlympiadMatchMakingCancel;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.OlympiadUI;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.RequestExOlympiadMatchListRefresh;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.RequestOlympiadMatchList;
+import org.l2jmobius.gameserver.network.clientpackets.olympiad.RequestOlympiadObserverEnd;
import org.l2jmobius.gameserver.network.clientpackets.pk.RequestExPkPenaltyList;
import org.l2jmobius.gameserver.network.clientpackets.pk.RequestExPkPenaltyListOnlyLoc;
import org.l2jmobius.gameserver.network.clientpackets.pledgeV2.RequestExPledgeAnnounce;
@@ -557,8 +563,8 @@ public enum ExIncomingPackets implements IIncomingPackets
EX_PAYBACK_LIST(0x175, null, ConnectionState.IN_GAME),
EX_PAYBACK_GIVE_REWARD(0x176, null, ConnectionState.IN_GAME),
EX_AUTOPLAY_SETTING(0x177, ExAutoPlaySetting::new, ConnectionState.IN_GAME),
- EX_OLYMPIAD_MATCH_MAKING(0x178, null, ConnectionState.IN_GAME),
- EX_OLYMPIAD_MATCH_MAKING_CANCEL(0x179, null, ConnectionState.IN_GAME),
+ EX_OLYMPIAD_MATCH_MAKING(0x178, OlympiadMatchMaking::new, ConnectionState.IN_GAME),
+ EX_OLYMPIAD_MATCH_MAKING_CANCEL(0x179, OlympiadMatchMakingCancel::new, ConnectionState.IN_GAME),
EX_FESTIVAL_BM_INFO(0x17A, null, ConnectionState.IN_GAME),
EX_FESTIVAL_BM_GAME(0x17B, null, ConnectionState.IN_GAME),
EX_GACHA_SHOP_INFO(0x17C, null, ConnectionState.IN_GAME),
@@ -597,7 +603,7 @@ public enum ExIncomingPackets implements IIncomingPackets
EX_CRAFT_RANDOM_MAKE(0x19D, null, ConnectionState.IN_GAME),
EX_MULTI_SELL_LIST(0x19E, null, ConnectionState.IN_GAME),
EX_SAVE_ITEM_ANNOUNCE_SETTING(0x19F, ExSaveItemAnnounceSetting::new, ConnectionState.IN_GAME),
- EX_OLYMPIAD_UI(0x1A0, null, ConnectionState.IN_GAME),
+ EX_OLYMPIAD_UI(0x1A0, OlympiadUI::new, ConnectionState.IN_GAME),
// 270
EX_SHARED_POSITION_SHARING_UI(0x1A1, null, ConnectionState.IN_GAME),
EX_SHARED_POSITION_TELEPORT_UI(0x1A2, null, ConnectionState.IN_GAME),
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
index f55034b49f..b2ea7e22f4 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java
@@ -55,6 +55,7 @@ import org.l2jmobius.gameserver.model.item.ItemTemplate;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.item.type.EtcItemType;
import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
+import org.l2jmobius.gameserver.model.olympiad.Olympiad;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentType;
import org.l2jmobius.gameserver.model.quest.Quest;
@@ -120,6 +121,7 @@ import org.l2jmobius.gameserver.network.serverpackets.homunculus.ExHomunculusPoi
import org.l2jmobius.gameserver.network.serverpackets.homunculus.ExHomunculusReady;
import org.l2jmobius.gameserver.network.serverpackets.homunculus.ExShowHomunculusBirthInfo;
import org.l2jmobius.gameserver.network.serverpackets.limitshop.ExBloodyCoinCount;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadInfo;
import org.l2jmobius.gameserver.network.serverpackets.settings.ExItemAnnounceSetting;
import org.l2jmobius.gameserver.util.BuilderUtil;
@@ -644,6 +646,12 @@ public class EnterWorld implements IClientIncomingPacket
player.sendMessage("Experience gain is disabled.");
}
+ // Send packet that olympiad is opened.
+ if (Config.OLYMPIAD_ENABLED && Olympiad.getInstance().inCompPeriod())
+ {
+ player.sendPacket(new ExOlympiadInfo(1));
+ }
+
player.updateSymbolSealSkills();
player.broadcastUserInfo();
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java
new file mode 100644
index 0000000000..5cfad5d67f
--- /dev/null
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMaking.java
@@ -0,0 +1,47 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.network.GameClient;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchMakingResult;
+
+public class OlympiadMatchMaking implements IClientIncomingPacket
+{
+ private byte _gameRuleType;
+
+ @Override
+ public boolean read(GameClient client, PacketReader packet)
+ {
+ _gameRuleType = (byte) packet.readC();
+ return true;
+ }
+
+ @Override
+ public void run(GameClient client)
+ {
+ final Player player = client.getPlayer();
+ if (player == null)
+ {
+ return;
+ }
+
+ player.sendPacket(new ExOlympiadMatchMakingResult(_gameRuleType, 1));
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java
new file mode 100644
index 0000000000..e165096e42
--- /dev/null
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadMatchMakingCancel.java
@@ -0,0 +1,47 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.network.GameClient;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchMakingResult;
+
+public class OlympiadMatchMakingCancel implements IClientIncomingPacket
+{
+ private byte _gameRuleType;
+
+ @Override
+ public boolean read(GameClient client, PacketReader packet)
+ {
+ _gameRuleType = (byte) packet.readC();
+ return true;
+ }
+
+ @Override
+ public void run(GameClient client)
+ {
+ final Player player = client.getPlayer();
+ if (player == null)
+ {
+ return;
+ }
+
+ player.sendPacket(new ExOlympiadMatchMakingResult(_gameRuleType, 0));
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java
new file mode 100644
index 0000000000..d9c5d35f53
--- /dev/null
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/OlympiadUI.java
@@ -0,0 +1,49 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketReader;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.network.GameClient;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadRecord;
+
+public class OlympiadUI implements IClientIncomingPacket
+{
+ private byte _gameRuleType;
+ private int _type;
+
+ @Override
+ public boolean read(GameClient client, PacketReader packet)
+ {
+ _gameRuleType = (byte) packet.readC();
+ _type = packet.readD();
+ return true;
+ }
+
+ @Override
+ public void run(GameClient client)
+ {
+ final Player player = client.getPlayer();
+ if (player == null)
+ {
+ return;
+ }
+
+ player.sendPacket(new ExOlympiadRecord(player, _gameRuleType, _type));
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/RequestExOlympiadMatchListRefresh.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java
similarity index 82%
rename from L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/RequestExOlympiadMatchListRefresh.java
rename to L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java
index b858084554..5ee47636f7 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/RequestExOlympiadMatchListRefresh.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestExOlympiadMatchListRefresh.java
@@ -14,12 +14,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.clientpackets;
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.network.GameClient;
-import org.l2jmobius.gameserver.network.serverpackets.ExOlympiadMatchList;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
+import org.l2jmobius.gameserver.network.serverpackets.olympiad.ExOlympiadMatchList;
/**
* Format: (ch)d d: unknown (always 0?)
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadMatchList.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java
similarity index 89%
rename from L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadMatchList.java
rename to L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java
index 9f3cb709cf..7a9752b083 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadMatchList.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadMatchList.java
@@ -14,13 +14,14 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.clientpackets;
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.handler.BypassHandler;
import org.l2jmobius.gameserver.handler.IBypassHandler;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.network.GameClient;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
/**
* format ch c: (id) 0xD0 h: (subid) 0x13
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadObserverEnd.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java
similarity index 87%
rename from L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadObserverEnd.java
rename to L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java
index 24d5719bd4..255d11e91d 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/RequestOlympiadObserverEnd.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/olympiad/RequestOlympiadObserverEnd.java
@@ -14,11 +14,12 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.clientpackets;
+package org.l2jmobius.gameserver.network.clientpackets.olympiad;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.network.GameClient;
+import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
/**
* format ch c: (id) 0xD0 h: (subid) 0x12
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java
index de94e9c9d0..6481c24b32 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java
@@ -196,7 +196,7 @@ public class CharInfo implements IClientOutgoingPacket
packet.writeC(_player.getTeam().getId()); // Confirmed
packet.writeD(_player.getClanCrestLargeId());
packet.writeC(_player.getNobleLevel()); // Confirmed
- packet.writeC(_player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 2 : 0); // 152 - Value for enabled changed to 2?
+ packet.writeC(_player.isLegend() ? 4 : _player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 2 : 0); // 152 - Value for enabled changed to 2? 4 = legend
packet.writeC(_player.isFishing() ? 1 : 0); // Confirmed
final ILocational baitLocation = _player.getFishing().getBaitLocation();
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java
index 7a5d760f1f..dd13ffe90e 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java
@@ -298,7 +298,7 @@ public class UserInfo extends AbstractMaskPacket
packet.writeC(_player.getPvpFlag());
packet.writeD(_player.getReputation()); // Reputation
packet.writeC(_player.getNobleLevel());
- packet.writeC(_player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 2 : 0); // 152 - Value for enabled changed to 2?
+ packet.writeC(_player.isLegend() ? 4 : _player.isHero() || (_player.isGM() && Config.GM_HERO_AURA) ? 2 : 0); // 152 - Value for enabled changed to 2? 4 = legend
packet.writeC(_player.getPledgeClass());
packet.writeD(_player.getPkKills());
packet.writeD(_player.getPvpKills());
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java
new file mode 100644
index 0000000000..b541ddf502
--- /dev/null
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadInfo.java
@@ -0,0 +1,41 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+public class ExOlympiadInfo implements IClientOutgoingPacket
+{
+ private static int _open;
+
+ public ExOlympiadInfo(int open)
+ {
+ _open = open;
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_OLYMPIAD_INFO.writeId(packet);
+ packet.writeC(_open);
+ packet.writeD(0); // RemainTime
+ packet.writeC(1); // GameRuleType
+ return true;
+ }
+}
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchEnd.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java
similarity index 86%
rename from L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchEnd.java
rename to L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java
index ba3c0cfeaa..e64d402782 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchEnd.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchEnd.java
@@ -14,10 +14,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author GodKratos
@@ -36,4 +37,4 @@ public class ExOlympiadMatchEnd implements IClientOutgoingPacket
OutgoingPackets.EX_OLYMPIAD_MATCH_END.writeId(packet);
return true;
}
-}
+}
\ No newline at end of file
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java
new file mode 100644
index 0000000000..25335ef371
--- /dev/null
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfo.java
@@ -0,0 +1,57 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+/**
+ * @author Mobius
+ */
+public class ExOlympiadMatchInfo implements IClientOutgoingPacket
+{
+ private final String _name1;
+ private final String _name2;
+ private final int _wins1;
+ private final int _wins2;
+ private final int _round;
+ private final int _time;
+
+ public ExOlympiadMatchInfo(String name1, String name2, int wins1, int wins2, int round, int time)
+ {
+ _name1 = name1;
+ _name2 = name2;
+ _wins1 = wins1;
+ _wins2 = wins2;
+ _round = round;
+ _time = time;
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_OLYMPIAD_MATCH_INFO.writeId(packet);
+ packet.writeS(String.format("%1$-" + 23 + "s", _name2));
+ packet.writeD(_wins2);
+ packet.writeS(String.format("%1$-" + 23 + "s", _name1));
+ packet.writeD(_wins1);
+ packet.writeD(_round);
+ packet.writeD(_time); // Seconds
+ return true;
+ }
+}
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java
new file mode 100644
index 0000000000..1d7653e028
--- /dev/null
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchInfoEnd.java
@@ -0,0 +1,37 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+public class ExOlympiadMatchInfoEnd implements IClientOutgoingPacket
+{
+ public static final ExOlympiadMatchInfoEnd STATIC_PACKET = new ExOlympiadMatchInfoEnd();
+
+ private ExOlympiadMatchInfoEnd()
+ {
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_OLYMPIAD_MATCH_INFO.writeId(packet);
+ return true;
+ }
+}
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchList.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java
similarity index 91%
rename from L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchList.java
rename to L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java
index 7ffd5ed3bd..80564627aa 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchList.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchList.java
@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import java.util.ArrayList;
import java.util.List;
@@ -26,6 +26,7 @@ import org.l2jmobius.gameserver.model.olympiad.OlympiadGameManager;
import org.l2jmobius.gameserver.model.olympiad.OlympiadGameNonClassed;
import org.l2jmobius.gameserver.model.olympiad.OlympiadGameTask;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author mrTJO
@@ -55,15 +56,19 @@ public class ExOlympiadMatchList implements IClientOutgoingPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_RECEIVE_OLYMPIAD.writeId(packet);
+
packet.writeD(0); // Type 0 = Match List, 1 = Match Result
+
packet.writeD(_games.size());
packet.writeD(0);
+
for (OlympiadGameTask curGame : _games)
{
final AbstractOlympiadGame game = curGame.getGame();
if (game != null)
{
packet.writeD(game.getStadiumId()); // Stadium Id (Arena 1 = 0)
+
if (game instanceof OlympiadGameNonClassed)
{
packet.writeD(1);
@@ -76,6 +81,7 @@ public class ExOlympiadMatchList implements IClientOutgoingPacket
{
packet.writeD(0);
}
+
packet.writeD(curGame.isRunning() ? 2 : 1); // (1 = Standby, 2 = Playing)
packet.writeS(game.getPlayerNames()[0]); // Player 1 Name
packet.writeS(game.getPlayerNames()[1]); // Player 2 Name
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java
new file mode 100644
index 0000000000..a72825cad4
--- /dev/null
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchMakingResult.java
@@ -0,0 +1,42 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
+
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+public class ExOlympiadMatchMakingResult implements IClientOutgoingPacket
+{
+ private final int _gameRuleType;
+ private final int _type;
+
+ public ExOlympiadMatchMakingResult(int cGameRuleType, int type)
+ {
+ _gameRuleType = 0;
+ _type = type;
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_OLYMPIAD_INFO.writeId(packet);
+ packet.writeC(_type);
+ packet.writeD(_gameRuleType);
+ return true;
+ }
+}
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchResult.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java
similarity index 73%
rename from L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchResult.java
rename to L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java
index b387271fba..2c57635a47 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMatchResult.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMatchResult.java
@@ -14,13 +14,14 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import java.util.List;
import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.model.olympiad.OlympiadInfo;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author JIV
@@ -32,8 +33,11 @@ public class ExOlympiadMatchResult implements IClientOutgoingPacket
private int _loseTeam = 2;
private final List _winnerList;
private final List _loserList;
+ private final int _round1winner;
+ private final int _round2winner;
+ private final int _round3winner;
- public ExOlympiadMatchResult(boolean tie, int winTeam, List winnerList, List loserList)
+ public ExOlympiadMatchResult(boolean tie, int winTeam, List winnerList, List loserList, int round1winner, int round2winner, int round3winner)
{
_tie = tie;
_winTeam = winTeam;
@@ -47,13 +51,16 @@ public class ExOlympiadMatchResult implements IClientOutgoingPacket
{
_winTeam = 1;
}
+ _round1winner = round1winner;
+ _round2winner = round2winner;
+ _round3winner = round3winner;
}
@Override
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_RECEIVE_OLYMPIAD.writeId(packet);
- packet.writeD(1); // Type 0 = Match List, 1 = Match Result
+ packet.writeD(2); // Type 0 = Match List, 1 = Match Result, 2 = New Oly look, 3 = 3v3
packet.writeD(_tie ? 1 : 0); // 0 - win, 1 - tie
packet.writeS(_winnerList.get(0).getName());
packet.writeD(_winTeam);
@@ -82,6 +89,11 @@ public class ExOlympiadMatchResult implements IClientOutgoingPacket
packet.writeD(info.getDiffPoints());
packet.writeD(0); // Helios
}
+ packet.writeC(_round1winner); // Round 1 outcome
+ packet.writeC(_round2winner); // Round 2 outcome
+ packet.writeC(_round3winner); // Round 3 outcome
+ packet.writeD(15); // Bonus Reward
+ packet.writeD(0); // Bonus Reward for looser
return true;
}
}
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMode.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java
similarity index 76%
rename from L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMode.java
rename to L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java
index 712b9e06c6..35156532aa 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadMode.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadMode.java
@@ -14,22 +14,24 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.enums.OlympiadMode;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author godson
*/
public class ExOlympiadMode implements IClientOutgoingPacket
{
- private final int _mode;
+ private final OlympiadMode _mode;
/**
* @param mode (0 = return, 3 = spectate)
*/
- public ExOlympiadMode(int mode)
+ public ExOlympiadMode(OlympiadMode mode)
{
_mode = mode;
}
@@ -38,7 +40,7 @@ public class ExOlympiadMode implements IClientOutgoingPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_OLYMPIAD_MODE.writeId(packet);
- packet.writeC(_mode);
+ packet.writeC(_mode.ordinal());
return true;
}
}
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java
new file mode 100644
index 0000000000..0985a230f5
--- /dev/null
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadRecord.java
@@ -0,0 +1,109 @@
+/*
+ * 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 .
+ */
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Calendar;
+
+import org.l2jmobius.commons.database.DatabaseFactory;
+import org.l2jmobius.commons.network.PacketWriter;
+import org.l2jmobius.gameserver.instancemanager.RankManager;
+import org.l2jmobius.gameserver.model.actor.Player;
+import org.l2jmobius.gameserver.model.olympiad.Olympiad;
+import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.PacketLogger;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
+
+public class ExOlympiadRecord implements IClientOutgoingPacket
+{
+ private static final String GET_PREVIOUS_CYCLE_DATA = "SELECT charId, class_id, olympiad_points, competitions_won, competitions_lost FROM olympiad_nobles_eom WHERE class_id = ? ORDER BY olympiad_points DESC LIMIT " + RankManager.PLAYER_LIMIT;
+
+ private final Player _player;
+ private final int _gameRuleType;
+ private final int _type;
+
+ public ExOlympiadRecord(Player player, int cGameRuleType, int type)
+ {
+ _player = player;
+ _gameRuleType = cGameRuleType;
+ _type = type;
+ }
+
+ @Override
+ public boolean write(PacketWriter packet)
+ {
+ OutgoingPackets.EX_OLYMPIAD_RECORD.writeId(packet);
+ packet.writeD(Olympiad.getInstance().getNoblePoints(_player)); // nPoint
+ packet.writeD(Olympiad.getInstance().getCompetitionWon(_player.getObjectId())); // nWinCount
+ packet.writeD(Olympiad.getInstance().getCompetitionLost(_player.getObjectId())); // nLoseCount
+ packet.writeD(Olympiad.getInstance().getRemainingWeeklyMatches(_player.getObjectId())); // nMatchCount
+ // Previous Cycle
+ int previousPlace = 0;
+ int previousWins = 0;
+ int previousLoses = 0;
+ int previousPoints = 0;
+ int previousClass = 0;
+
+ try (Connection con = DatabaseFactory.getConnection();
+ PreparedStatement statement = con.prepareStatement(GET_PREVIOUS_CYCLE_DATA))
+ {
+ statement.setInt(1, _player.getBaseClass());
+ try (ResultSet rset = statement.executeQuery())
+ {
+ int i = 1;
+ while (rset.next())
+ {
+ if (rset.getInt("charId") == _player.getObjectId())
+ {
+ previousPlace = i;
+ previousWins = rset.getInt("competitions_won");
+ previousLoses = rset.getInt("competitions_lost");
+ previousPoints = rset.getInt("olympiad_points");
+ previousClass = rset.getInt("class_id");
+ }
+ i++;
+ }
+ }
+ }
+ catch (SQLException e)
+ {
+ PacketLogger.warning("Olympiad my ranking: Couldnt load data: " + e.getMessage());
+ }
+
+ packet.writeD(previousClass); // nPrevClassType
+ packet.writeD(1); // nPrevRank in all servers
+ packet.writeD(2); // nPrevRankCount number of participants with 25+ matches
+ packet.writeD(previousPlace); // nPrevClassRank in all servers
+ packet.writeD(4); // nPrevClassRankCount number of participants with 25+ matches
+ packet.writeD(5); // nPrevClassRankByServer in current server
+ packet.writeD(6); // nPrevClassRankByServerCount number of participants with 25+ matches
+ packet.writeD(previousPoints); // nPrevPoint
+ packet.writeD(previousWins); // nPrevWinCount
+ packet.writeD(previousLoses); // nPrevLoseCount
+ packet.writeD(previousPlace); // nPrevGrade
+ packet.writeD(Calendar.getInstance().get(Calendar.YEAR)); // nSeasonYear
+ packet.writeD(Calendar.getInstance().get(Calendar.MONTH) + 1); // nSeasonMonth
+ packet.writeC(Olympiad.getInstance().inCompPeriod() ? 1 : 0); // bMatchOpen
+ packet.writeD(Olympiad.getInstance().getCurrentCycle()); // nSeason
+ packet.writeC(_type); // bRegistered
+ packet.writeD(_gameRuleType); // cGameRuleType
+ return true;
+ }
+}
diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadSpelledInfo.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java
similarity index 88%
rename from L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadSpelledInfo.java
rename to L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java
index 5b4f2c2523..a5a368a43e 100644
--- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadSpelledInfo.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadSpelledInfo.java
@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import java.util.ArrayList;
import java.util.List;
@@ -24,6 +24,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.skill.BuffInfo;
import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author godson
@@ -53,6 +54,7 @@ public class ExOlympiadSpelledInfo implements IClientOutgoingPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_OLYMPIAD_SPELLED_INFO.writeId(packet);
+
packet.writeD(_playerId);
packet.writeD(_effects.size() + _effects2.size());
for (BuffInfo info : _effects)
@@ -61,7 +63,7 @@ public class ExOlympiadSpelledInfo implements IClientOutgoingPacket
{
packet.writeD(info.getSkill().getDisplayId());
packet.writeH(info.getSkill().getDisplayLevel());
- packet.writeH(0); // Sub level
+ packet.writeH(0x00); // Sub level
packet.writeD(info.getSkill().getAbnormalType().getClientId());
writeOptionalD(packet, info.getSkill().isAura() ? -1 : info.getTime());
}
@@ -72,7 +74,7 @@ public class ExOlympiadSpelledInfo implements IClientOutgoingPacket
{
packet.writeD(skill.getDisplayId());
packet.writeH(skill.getDisplayLevel());
- packet.writeH(0); // Sub level
+ packet.writeH(0x00); // Sub level
packet.writeD(skill.getAbnormalType().getClientId());
packet.writeH(-1);
}
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadUserInfo.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java
similarity index 90%
rename from L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadUserInfo.java
rename to L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java
index ca473edfcf..1acac0ec7a 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/ExOlympiadUserInfo.java
+++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/network/serverpackets/olympiad/ExOlympiadUserInfo.java
@@ -14,12 +14,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package org.l2jmobius.gameserver.network.serverpackets;
+package org.l2jmobius.gameserver.network.serverpackets.olympiad;
import org.l2jmobius.commons.network.PacketWriter;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.olympiad.Participant;
import org.l2jmobius.gameserver.network.OutgoingPackets;
+import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
/**
* @author godson
@@ -76,6 +77,7 @@ public class ExOlympiadUserInfo implements IClientOutgoingPacket
public boolean write(PacketWriter packet)
{
OutgoingPackets.EX_OLYMPIAD_USER_INFO.writeId(packet);
+
if (_player != null)
{
packet.writeC(_player.getOlympiadSide());
@@ -90,6 +92,7 @@ public class ExOlympiadUserInfo implements IClientOutgoingPacket
packet.writeS(_par.getName());
packet.writeD(_par.getBaseClass());
}
+
packet.writeD(_curHp);
packet.writeD(_maxHp);
packet.writeD(_curCp);