From ffb4e352dd13897be674e3dc052823371c91ac39 Mon Sep 17 00:00:00 2001 From: Zoey76 <zoey_76@msn.com> Date: Sun, 4 May 2014 20:12:32 +0000 Subject: [PATCH] BETA: Wedding Manager implementation. --- .../game/data/html/mods/Wedding_accepted.htm | 3 - .../game/data/html/mods/Wedding_adena.htm | 3 - .../game/data/html/mods/Wedding_already.htm | 3 - .../dist/game/data/html/mods/Wedding_ask.htm | 7 - .../game/data/html/mods/Wedding_declined.htm | 3 - .../data/html/mods/Wedding_instructions.htm | 8 - .../game/data/html/mods/Wedding_noformal.htm | 4 - .../game/data/html/mods/Wedding_nopartner.htm | 3 - .../game/data/html/mods/Wedding_notfound.htm | 3 - .../game/data/html/mods/Wedding_requested.htm | 3 - .../game/data/html/mods/Wedding_start.htm | 10 - .../data/html/mods/Wedding_waitforpartner.htm | 3 - L2J_DataPack_BETA/dist/game/data/scripts.cfg | 1 + ...Equipped.htm => CursedWeaponEquipped.html} | 0 .../{IPRestriction.htm => IPRestriction.html} | 0 .../TvT/TvTManager/{Karma.htm => Karma.html} | 0 .../TvT/TvTManager/{Level.htm => Level.html} | 0 .../{Olympiad.htm => Olympiad.html} | 0 .../{Participation.htm => Participation.html} | 0 ...icipationFee.htm => ParticipationFee.html} | 0 .../{Registered.htm => Registered.html} | 0 ...icipation.htm => RemoveParticipation.html} | 0 .../TvTManager/{Reward.htm => Reward.html} | 0 .../TvTManager/{Status.htm => Status.html} | 0 .../{TeamsFull.htm => TeamsFull.html} | 0 .../events/TvT/TvTManager/TvTManager.java | 23 +- .../{Unregistered.htm => Unregistered.html} | 0 .../custom/events/Wedding/Accepted.html | 6 + .../scripts/custom/events/Wedding/Adena.html | 7 + .../custom/events/Wedding/Already.html | 6 + .../scripts/custom/events/Wedding/Ask.html | 10 + .../custom/events/Wedding/Declined.html | 6 + .../custom/events/Wedding/Instructions.html | 16 ++ .../custom/events/Wedding/NoFormal.html | 7 + .../custom/events/Wedding/NoPartner.html | 6 + .../custom/events/Wedding/NotFound.html | 6 + .../custom/events/Wedding/Requested.html | 6 + .../scripts/custom/events/Wedding/Start.html | 20 ++ .../custom/events/Wedding/WaitForPartner.html | 6 + .../custom/events/Wedding/Wedding.java | 211 ++++++++++++++++++ .../game/data/stats/npcs/custom/custom.xml | 2 +- 41 files changed, 327 insertions(+), 65 deletions(-) delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_accepted.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_adena.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_already.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_ask.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_declined.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_instructions.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_noformal.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_nopartner.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_notfound.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_requested.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_start.htm delete mode 100644 L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_waitforpartner.htm rename L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/{CursedWeaponEquipped.htm => CursedWeaponEquipped.html} (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/{IPRestriction.htm => IPRestriction.html} (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/{Karma.htm => Karma.html} (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/{Level.htm => Level.html} (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/{Olympiad.htm => Olympiad.html} (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/{Participation.htm => Participation.html} (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/{ParticipationFee.htm => ParticipationFee.html} (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/{Registered.htm => Registered.html} (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/{RemoveParticipation.htm => RemoveParticipation.html} (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/{Reward.htm => Reward.html} (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/{Status.htm => Status.html} (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/{TeamsFull.htm => TeamsFull.html} (100%) rename L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/{Unregistered.htm => Unregistered.html} (100%) create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Accepted.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Adena.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Already.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Ask.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Declined.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Instructions.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/NoFormal.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/NoPartner.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/NotFound.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Requested.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Start.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/WaitForPartner.html create mode 100644 L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Wedding.java diff --git a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_accepted.htm b/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_accepted.htm deleted file mode 100644 index e8f1c50621..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_accepted.htm +++ /dev/null @@ -1,3 +0,0 @@ -<html><body>%npcname%:<br> -Congratulations you are married! -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_adena.htm b/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_adena.htm deleted file mode 100644 index ced17aae20..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_adena.htm +++ /dev/null @@ -1,3 +0,0 @@ -<html><body>%npcname%:<br> -You don't have enough adena for marriage. You need %replace% adena. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_already.htm b/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_already.htm deleted file mode 100644 index cd825c3107..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_already.htm +++ /dev/null @@ -1,3 +0,0 @@ -<html><body>%npcname%:<br> -Go away, you are already married! -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_ask.htm b/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_ask.htm deleted file mode 100644 index 05629438b3..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_ask.htm +++ /dev/null @@ -1,7 +0,0 @@ -<html><body>%npcname%:<br> -Your partner %replace% asked to marry you.<br> -<center> -<a action="bypass -h npc_%objectId%_AcceptWedding">Accept Wedding</a><br> -<a action="bypass -h npc_%objectId%_DeclineWedding">Decline Wedding</a><br> -</center> -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_declined.htm b/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_declined.htm deleted file mode 100644 index f359ccee78..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_declined.htm +++ /dev/null @@ -1,3 +0,0 @@ -<html><body>%npcname%:<br> -The request of marriage was declined. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_instructions.htm b/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_instructions.htm deleted file mode 100644 index d5f7a54a75..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_instructions.htm +++ /dev/null @@ -1,8 +0,0 @@ -<html><body>Andromeda:<br> -In order to get married you first have to be engaged. To get engaged simply target your desired partner and type in the command ".engage" without the quotes. For this to work, you both need to be on each other's friends list. To do this, you need to type "/friendinvite PlayerName" without the quotes where PlayerName is the name of your partner.<br><br> -Once engaged, you ask me to get married. You both have to be wearing Formal wear in order for this to work as well as the wedding will cost 1,000,000,000 (1 Billion) adena.<br><br> -Once married, you can use the command ".gotolove" without the quotes, to teleport to your partner at anytime. If you wish to divorce, simply type the command ".divorce" without the quotes.<br> -<center> -<a action="bypass -h npc_%objectId%_start">Back</a><br> -</center> -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_noformal.htm b/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_noformal.htm deleted file mode 100644 index 1ddd14fc7e..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_noformal.htm +++ /dev/null @@ -1,4 +0,0 @@ -<html><body>%npcname%:<br> -You are not wearing formal wear, go get formal wear and come back later. -If dont know where get it, then <font color="LEVEL">Trader Alexis</font> in Aden town can help you. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_nopartner.htm b/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_nopartner.htm deleted file mode 100644 index aed0ced5c1..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_nopartner.htm +++ /dev/null @@ -1,3 +0,0 @@ -<html><body>%npcname%:<br> -You don't have partner, you need to be engaged before you can marry. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_notfound.htm b/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_notfound.htm deleted file mode 100644 index 586f69c1cc..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_notfound.htm +++ /dev/null @@ -1,3 +0,0 @@ -<html><body>%npcname%:<br> -No partner found, your friend must be online. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_requested.htm b/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_requested.htm deleted file mode 100644 index 9f6d0ed1d8..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_requested.htm +++ /dev/null @@ -1,3 +0,0 @@ -<html><body>%npcname%:<br> -You requested %replace% to marry you. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_start.htm b/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_start.htm deleted file mode 100644 index eee5cd6d4b..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_start.htm +++ /dev/null @@ -1,10 +0,0 @@ -<html><body>Andromeda:<br> -I understand that you want to get married? Marriage is an expensive ceremony! Are you sure you want to go ahead with it ?<br> -<center> -<a action="bypass -h npc_%objectId%_AskWedding">I want to marry</a><br> -</center> -<br>Instructions :<br><br> -In order to get married you first have to be engaged. To get engaged simply target your desired partner and type in the command ".engage" without the quotes. For this to work, you both need to be on each other's friends list. To do this, you need to type "/friendinvite PlayerName" without the quotes where PlayerName is the name of your partner.<br><br> -Once engaged, you ask me to get married. You both have to be wearing Formal wear in order for this to work as well as the wedding will cost %replace% adena.<br><br> -Once married, you can use the command ".gotolove" without the quotes, to teleport to your partner at anytime. If you wish to divorce, simply type the command ".divorce" without the quotes. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_waitforpartner.htm b/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_waitforpartner.htm deleted file mode 100644 index 44d7277d91..0000000000 --- a/L2J_DataPack_BETA/dist/game/data/html/mods/Wedding_waitforpartner.htm +++ /dev/null @@ -1,3 +0,0 @@ -<html><body>%npcname%:<br> -You asked your partner to marry you, wait till your partner accepted or declined your request. -</body></html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts.cfg b/L2J_DataPack_BETA/dist/game/data/scripts.cfg index 94aaeb7859..134bcfa19a 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts.cfg +++ b/L2J_DataPack_BETA/dist/game/data/scripts.cfg @@ -328,6 +328,7 @@ custom/events/Elpies/Elpies.java custom/events/Rabbits/Rabbits.java custom/events/Race/Race.java custom/events/TvT/TvTManager/TvTManager.java +custom/events/Wedding/Wedding.java # Vehicles vehicles/BoatTalkingGludin.java diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/CursedWeaponEquipped.htm b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/CursedWeaponEquipped.html similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/CursedWeaponEquipped.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/CursedWeaponEquipped.html diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/IPRestriction.htm b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/IPRestriction.html similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/IPRestriction.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/IPRestriction.html diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Karma.htm b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Karma.html similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Karma.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Karma.html diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Level.htm b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Level.html similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Level.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Level.html diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Olympiad.htm b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Olympiad.html similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Olympiad.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Olympiad.html diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Participation.htm b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Participation.html similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Participation.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Participation.html diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/ParticipationFee.htm b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/ParticipationFee.html similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/ParticipationFee.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/ParticipationFee.html diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Registered.htm b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Registered.html similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Registered.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Registered.html diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/RemoveParticipation.htm b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/RemoveParticipation.html similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/RemoveParticipation.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/RemoveParticipation.html diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Reward.htm b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Reward.html similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Reward.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Reward.html diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Status.htm b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Status.html similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Status.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Status.html diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/TeamsFull.htm b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/TeamsFull.html similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/TeamsFull.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/TeamsFull.html diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/TvTManager.java b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/TvTManager.java index dca6c28e2e..561ca52985 100644 --- a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/TvTManager.java +++ b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/TvTManager.java @@ -61,40 +61,40 @@ public final class TvTManager extends AbstractNpcAI final int team2Count = TvTEvent.getTeamsPlayerCounts()[1]; if (player.isCursedWeaponEquipped()) { - htmltext = "CursedWeaponEquipped.htm"; + htmltext = "CursedWeaponEquipped.html"; } else if (OlympiadManager.getInstance().isRegistered(player)) { - htmltext = "Olympiad.htm"; + htmltext = "Olympiad.html"; } else if (player.getKarma() > 0) { - htmltext = "Karma.htm"; + htmltext = "Karma.html"; } else if ((playerLevel < Config.TVT_EVENT_MIN_LVL) || (playerLevel > Config.TVT_EVENT_MAX_LVL)) { - htmltext = getHtm(player.getHtmlPrefix(), "Level.htm"); + htmltext = getHtm(player.getHtmlPrefix(), "Level.html"); htmltext = htmltext.replaceAll("%min%", String.valueOf(Config.TVT_EVENT_MIN_LVL)); htmltext = htmltext.replaceAll("%max%", String.valueOf(Config.TVT_EVENT_MAX_LVL)); } else if ((team1Count == Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS) && (team2Count == Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS)) { - htmltext = getHtm(player.getHtmlPrefix(), "TeamsFull.htm"); + htmltext = getHtm(player.getHtmlPrefix(), "TeamsFull.html"); htmltext = htmltext.replaceAll("%max%", String.valueOf(Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS)); } else if ((Config.TVT_EVENT_MAX_PARTICIPANTS_PER_IP > 0) && !AntiFeedManager.getInstance().tryAddPlayer(AntiFeedManager.TVT_ID, player, Config.TVT_EVENT_MAX_PARTICIPANTS_PER_IP)) { - htmltext = getHtm(player.getHtmlPrefix(), "IPRestriction.htm"); + htmltext = getHtm(player.getHtmlPrefix(), "IPRestriction.html"); htmltext = htmltext.replaceAll("%max%", String.valueOf(AntiFeedManager.getInstance().getLimit(player, Config.TVT_EVENT_MAX_PARTICIPANTS_PER_IP))); } else if (TvTEvent.needParticipationFee() && !TvTEvent.hasParticipationFee(player)) { - htmltext = getHtm(player.getHtmlPrefix(), "ParticipationFee.htm"); + htmltext = getHtm(player.getHtmlPrefix(), "ParticipationFee.html"); htmltext = htmltext.replaceAll("%fee%", TvTEvent.getParticipationFee()); } else if (TvTEvent.addParticipant(player)) { - htmltext = "Registered.htm"; + htmltext = "Registered.html"; } break; } @@ -105,7 +105,8 @@ public final class TvTManager extends AbstractNpcAI { AntiFeedManager.getInstance().removePlayer(AntiFeedManager.TVT_ID, player); } - htmltext = "Unregistered.htm"; + htmltext = "Unregistered.html"; + break; } } return htmltext; @@ -119,7 +120,7 @@ public final class TvTManager extends AbstractNpcAI { final boolean isParticipant = TvTEvent.isPlayerParticipant(player.getObjectId()); int[] teamsPlayerCounts = TvTEvent.getTeamsPlayerCounts(); - htmltext = getHtm(player.getHtmlPrefix(), (!isParticipant ? "Participation.htm" : "RemoveParticipation.htm")); + htmltext = getHtm(player.getHtmlPrefix(), (!isParticipant ? "Participation.html" : "RemoveParticipation.html")); htmltext = htmltext.replaceAll("%objectId%", String.valueOf(npc.getObjectId())); htmltext = htmltext.replaceAll("%team1name%", Config.TVT_EVENT_TEAM_1_NAME); htmltext = htmltext.replaceAll("%team1playercount%", String.valueOf(teamsPlayerCounts[0])); @@ -136,7 +137,7 @@ public final class TvTManager extends AbstractNpcAI { int[] teamsPlayerCounts = TvTEvent.getTeamsPlayerCounts(); int[] teamsPointsCounts = TvTEvent.getTeamsPoints(); - htmltext = getHtm(player.getHtmlPrefix(), "Status.htm"); + htmltext = getHtm(player.getHtmlPrefix(), "Status.html"); htmltext = htmltext.replaceAll("%team1name%", Config.TVT_EVENT_TEAM_1_NAME); htmltext = htmltext.replaceAll("%team1playercount%", String.valueOf(teamsPlayerCounts[0])); htmltext = htmltext.replaceAll("%team1points%", String.valueOf(teamsPointsCounts[0])); diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Unregistered.htm b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Unregistered.html similarity index 100% rename from L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Unregistered.htm rename to L2J_DataPack_BETA/dist/game/data/scripts/custom/events/TvT/TvTManager/Unregistered.html diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Accepted.html b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Accepted.html new file mode 100644 index 0000000000..d187bce09e --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Accepted.html @@ -0,0 +1,6 @@ +<html> + <body> + Andromeda:<br> + Congratulations you are married! + </body> +</html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Adena.html b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Adena.html new file mode 100644 index 0000000000..f894f7be6e --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Adena.html @@ -0,0 +1,7 @@ +<html> + <body> + Andromeda:<br> + You don't have enough adena for marriage.<br> + <font color="LEVEL">You need %fee% Adena.</font> + </body> +</html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Already.html b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Already.html new file mode 100644 index 0000000000..74c34be941 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Already.html @@ -0,0 +1,6 @@ +<html> + <body> + Andromeda:<br> + Go away, you are already married! + </body> +</html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Ask.html b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Ask.html new file mode 100644 index 0000000000..cc335c6377 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Ask.html @@ -0,0 +1,10 @@ +<html> + <body> + Andromeda:<br> + Your partner %player% asked to marry you.<br> + <center> + <a action="bypass -h Quest Wedding accept">Accept Wedding</a><br> + <a action="bypass -h Quest Wedding decline">Decline Wedding</a><br> + </center> + </body> +</html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Declined.html b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Declined.html new file mode 100644 index 0000000000..32a429c853 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Declined.html @@ -0,0 +1,6 @@ +<html> + <body> + Andromeda:<br> + The request of marriage was declined. + </body> +</html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Instructions.html b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Instructions.html new file mode 100644 index 0000000000..604fd46185 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Instructions.html @@ -0,0 +1,16 @@ +<html> + <body> + Andromeda:<br> + In order to get married you first have to be engaged.<br> + To get engaged simply target your desired partner and type in the command ".engage" without the quotes.<br> + For this to work, you both need to be on each other's friends list.<br> + To do this, you need to type "/friendinvite PlayerName" without the quotes where PlayerName is the name of your partner.<br> + Once engaged, you ask me to get married.<br> + You both have to be wearing Formal Wear in order for this to work as well as the wedding will cost %fee% Adena.<br> + Once married, you can use the command ".gotolove" without the quotes, to teleport to your partner at anytime.<br> + If you wish to divorce, simply type the command ".divorce" without the quotes.<br> + <center> + <a action="bypass -h Quest Wedding start">Back</a><br> + </center> + </body> +</html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/NoFormal.html b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/NoFormal.html new file mode 100644 index 0000000000..b9f6f44096 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/NoFormal.html @@ -0,0 +1,7 @@ +<html> + <body> + Andromeda:<br> + You are not wearing formal wear, go get formal wear and come back later.<br> + If dont know where get it, then <font color="LEVEL">Trader Alexis</font> in Aden town can help you. + </body> +</html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/NoPartner.html b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/NoPartner.html new file mode 100644 index 0000000000..a4ad7df0e2 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/NoPartner.html @@ -0,0 +1,6 @@ +<html> + <body> + Andromeda:<br> + You don't have partner, you need to be engaged before you can marry. + </body> +</html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/NotFound.html b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/NotFound.html new file mode 100644 index 0000000000..eba79fedba --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/NotFound.html @@ -0,0 +1,6 @@ +<html> + <body> + Andromeda:<br> + No partner found, your friend must be online. + </body> +</html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Requested.html b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Requested.html new file mode 100644 index 0000000000..1020cc1911 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Requested.html @@ -0,0 +1,6 @@ +<html> + <body> + Andromeda:<br> + You requested %player% to marry you. + </body> +</html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Start.html b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Start.html new file mode 100644 index 0000000000..3023b9a034 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Start.html @@ -0,0 +1,20 @@ +<html> + <body> + Andromeda:<br> + I understand that you want to get married? Marriage is an expensive ceremony!<br> + Are you sure you want to go ahead with it?<br> + <center> + <a action="bypass -h Quest Wedding ask">I want to marry</a> + </center> + <br> + Instructions:<br> + In order to get married you first have to be engaged.<br> + To get engaged simply target your desired partner and type in the command ".engage" without the quotes.<br> + For this to work, you both need to be on each other's friends list.<br> + To do this, you need to type "/friendinvite PlayerName" without the quotes where PlayerName is the name of your partner.<br> + Once engaged, you ask me to get married.<br> + You both have to be wearing Formal wear in order for this to work as well as the wedding will cost %fee% Adena.<br> + Once married, you can use the command ".gotolove" without the quotes, to teleport to your partner at anytime.<br> + If you wish to divorce, simply type the command ".divorce" without the quotes. + </body> +</html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/WaitForPartner.html b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/WaitForPartner.html new file mode 100644 index 0000000000..ac9f8c1681 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/WaitForPartner.html @@ -0,0 +1,6 @@ +<html> + <body> + Andromeda:<br> + You asked your partner to marry you, wait till your partner accepted or declined your request. + </body> +</html> \ No newline at end of file diff --git a/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Wedding.java b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Wedding.java new file mode 100644 index 0000000000..ddf0c4e7a6 --- /dev/null +++ b/L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Wedding/Wedding.java @@ -0,0 +1,211 @@ +/* + * Copyright (C) 2004-2014 L2J DataPack + * + * This file is part of L2J DataPack. + * + * L2J DataPack 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. + * + * L2J DataPack is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +package custom.events.Wedding; + +import ai.npc.AbstractNpcAI; + +import com.l2jserver.Config; +import com.l2jserver.gameserver.Announcements; +import com.l2jserver.gameserver.instancemanager.CoupleManager; +import com.l2jserver.gameserver.model.L2World; +import com.l2jserver.gameserver.model.actor.L2Npc; +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; +import com.l2jserver.gameserver.model.entity.Couple; +import com.l2jserver.gameserver.model.items.instance.L2ItemInstance; +import com.l2jserver.gameserver.model.skills.CommonSkill; +import com.l2jserver.gameserver.model.skills.Skill; +import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse; +import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage; + +/** + * Wedding AI. + * @author Zoey76 + */ +public final class Wedding extends AbstractNpcAI +{ + // NPC + private static final int MANAGER_ID = 50007; + // Item + private static final int FORMAL_WEAR = 6408; + + public Wedding() + { + super(Wedding.class.getSimpleName(), "custom/events"); + addFirstTalkId(MANAGER_ID); + addTalkId(MANAGER_ID); + addStartNpc(MANAGER_ID); + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + if (player.getPartnerId() == 0) + { + return "NoPartner.html"; + } + + final L2PcInstance partner = L2World.getInstance().getPlayer(player.getPartnerId()); + if ((partner == null) || !partner.isOnline()) + { + return "NotFound.html"; + } + + if (player.isMarried()) + { + return "Already.html"; + } + + if (player.isMarryAccepted()) + { + return "WaitForPartner.html"; + } + + String htmltext = null; + if (player.isMarryRequest()) + { + if (!isWearingFormalWear(player) || !isWearingFormalWear(partner)) + { + htmltext = sendHtml(partner, "NoFormal.html", null, null); + } + else + { + player.setMarryRequest(false); + partner.setMarryRequest(false); + htmltext = getHtm(player.getHtmlPrefix(), "Ask.html"); + htmltext = htmltext.replaceAll("%player%", partner.getName()); + } + return htmltext; + } + + switch (event) + { + case "ask": + { + if (!isWearingFormalWear(player) || !isWearingFormalWear(partner)) + { + htmltext = sendHtml(partner, "NoFormal.html", null, null); + } + else + { + player.setMarryAccepted(true); + partner.setMarryRequest(true); + + sendHtml(partner, "Ask.html", "%player%", player.getName()); + + htmltext = getHtm(player.getHtmlPrefix(), "Requested.html"); + htmltext = htmltext.replaceAll("%player%", partner.getName()); + } + break; + } + case "accept": + { + if (!isWearingFormalWear(player) || !isWearingFormalWear(partner)) + { + htmltext = sendHtml(partner, "NoFormal.html", null, null); + } + else if ((player.getAdena() < Config.L2JMOD_WEDDING_PRICE) || (partner.getAdena() < Config.L2JMOD_WEDDING_PRICE)) + { + htmltext = sendHtml(partner, "Adena.html", "%fee%", String.valueOf(Config.L2JMOD_WEDDING_PRICE)); + } + else + { + player.reduceAdena("Wedding", Config.L2JMOD_WEDDING_PRICE, player.getLastFolkNPC(), true); + partner.reduceAdena("Wedding", Config.L2JMOD_WEDDING_PRICE, player.getLastFolkNPC(), true); + + // Accept the wedding request + player.setMarryAccepted(true); + Couple couple = CoupleManager.getInstance().getCouple(player.getCoupleId()); + couple.marry(); + + // Messages to the couple + player.sendMessage("Congratulations you are married!"); + player.setMarried(true); + player.setMarryRequest(false); + partner.sendMessage("Congratulations you are married!"); + partner.setMarried(true); + partner.setMarryRequest(false); + + // Wedding march + player.broadcastPacket(new MagicSkillUse(player, player, 2230, 1, 1, 0)); + partner.broadcastPacket(new MagicSkillUse(partner, partner, 2230, 1, 1, 0)); + + // Fireworks + Skill skill = CommonSkill.LARGE_FIREWORK.getSkill(); + if (skill != null) + { + player.doCast(skill); + partner.doCast(skill); + } + + Announcements.getInstance().announceToAll("Congratulations to " + player.getName() + " and " + partner.getName() + "! They have been married."); + + htmltext = sendHtml(partner, "Accepted.html", null, null); + } + break; + } + case "decline": + { + player.setMarryRequest(false); + partner.setMarryRequest(false); + player.setMarryAccepted(false); + partner.setMarryAccepted(false); + + player.sendMessage("You declined your partner's marriage request."); + partner.sendMessage("Your partner declined your marriage request."); + + htmltext = sendHtml(partner, "Declined.html", null, null); + break; + } + } + return htmltext; + } + + @Override + public String onFirstTalk(L2Npc npc, L2PcInstance player) + { + final String htmltext = getHtm(player.getHtmlPrefix(), "Start.html"); + return htmltext.replaceAll("%fee%", String.valueOf(Config.L2JMOD_WEDDING_PRICE)); + } + + private String sendHtml(L2PcInstance player, String fileName, String regex, String replacement) + { + String html = getHtm(player.getHtmlPrefix(), fileName); + if ((regex != null) && (replacement != null)) + { + html = html.replaceAll(regex, replacement); + } + player.sendPacket(new NpcHtmlMessage(html)); + return html; + } + + private static boolean isWearingFormalWear(L2PcInstance player) + { + if (Config.L2JMOD_WEDDING_FORMALWEAR) + { + final L2ItemInstance formalWear = player.getChestArmorInstance(); + return (formalWear != null) && (formalWear.getId() == FORMAL_WEAR); + } + return true; + } + + public static void main(String[] args) + { + new Wedding(); + } +} diff --git a/L2J_DataPack_BETA/dist/game/data/stats/npcs/custom/custom.xml b/L2J_DataPack_BETA/dist/game/data/stats/npcs/custom/custom.xml index a13baf3b44..58a3697be2 100644 --- a/L2J_DataPack_BETA/dist/game/data/stats/npcs/custom/custom.xml +++ b/L2J_DataPack_BETA/dist/game/data/stats/npcs/custom/custom.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/npcs.xsd"> - <npc id="50007" displayId="31324" name="Andromeda" usingServerSideName="true" title="L2J Wedding Manager" usingServerSideTitle="true" type="L2WeddingManager"> + <npc id="50007" displayId="31324" name="Andromeda" usingServerSideName="true" title="Wedding Manager" usingServerSideTitle="true" type="L2Npc"> <collision> <radius normal="8" /> <height normal="23" /> -- GitLab