+
\ No newline at end of file
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
new file mode 100644
index 0000000000..1b789e7c9a
--- /dev/null
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
@@ -0,0 +1,9 @@
+
+[Manage Clan Hall]
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
index 81e8fd76e2..f6816515d7 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
@@ -62,6 +62,7 @@ public class ClanHallManager extends AbstractNpcAI
36721, 36723, 36725, 36727, // Gludio Outskirts
36729, 36731, 36733, 36735, // Dion Outskirts
36737, 36739, // Floran Village
+ 33360, // Talking Island
};
// @formatter:on
// Misc
@@ -118,7 +119,21 @@ public class ClanHallManager extends AbstractNpcAI
{
case "index":
{
- htmltext = isOwningClan(player, npc) ? "ClanHallManager-01.html" : "ClanHallManager-03.html";
+ if (isOwningClan(player, npc))
+ {
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
+ {
+ htmltext = "ClanHallManager-01.html";
+ }
+ }
+ else
+ {
+ htmltext = "ClanHallManager-03.html";
+ }
break;
}
case "manageDoors":
@@ -257,7 +272,14 @@ public class ClanHallManager extends AbstractNpcAI
case 2:
case 3:
{
- ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(clanHall.getResidenceId() + "0" + (itemLevel - 1)));
+ }
+ else
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ }
break;
}
default:
@@ -289,7 +311,14 @@ public class ClanHallManager extends AbstractNpcAI
{
if (!st.hasMoreTokens())
{
- htmltext = "ClanHallManager-11.html";
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-11b.html";
+ }
+ else
+ {
+ htmltext = "ClanHallManager-11.html";
+ }
}
else
{
@@ -435,7 +464,11 @@ public class ClanHallManager extends AbstractNpcAI
final ClanHall clanHall = npc.getClanHall();
if (isOwningClan(player, npc))
{
- if (clanHall.getCostFailDay() == 0)
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
{
htmltext = "ClanHallManager-01.html";
}
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
new file mode 100644
index 0000000000..84a177d7d4
--- /dev/null
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
@@ -0,0 +1,13 @@
+
+Ah, hello!
+I am the Clan Hall Gatekeeper, Kerry. It's an honor to serve you.
+Do you need help with the Provisional Clan Hall?
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
new file mode 100644
index 0000000000..509b7ff9eb
--- /dev/null
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
@@ -0,0 +1,12 @@
+
+
+
+Participant,
+
+Aw, sorry, but you didn't win a Provisional Clan Hall.
+The auction takes place every 2 weeks,
+between 00:01 Saturday and 23:59 Sunday.
+
+
+Better luck at the next auction!
+
\ No newline at end of file
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
new file mode 100644
index 0000000000..33ec4e8c92
--- /dev/null
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
@@ -0,0 +1,6 @@
+
+The Provisional Clan Hall will cost you 50.000.000 adena, are you sure?
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
new file mode 100644
index 0000000000..2cb3848ff5
--- /dev/null
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -0,0 +1,199 @@
+/*
+ * 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 ai.others.ProvisionalHalls;
+
+import java.util.Calendar;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.l2jmobius.gameserver.data.xml.impl.ClanHallData;
+import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
+import org.l2jmobius.gameserver.model.Location;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
+import org.l2jmobius.gameserver.model.entity.ClanHall;
+
+import ai.AbstractNpcAI;
+
+/**
+ * Custom implementation for Provisional Clan Halls.
+ * @author Mobius
+ */
+public class ProvisionalHalls extends AbstractNpcAI
+{
+ // NPCs
+ private static final int KERRY = 33359;
+ private static final int MAID = 33360;
+ // Misc
+ private static final int HALL_PRICE = 50000000;
+ private static final long TWO_WEEKS = 1209600000;
+ private static final Map CLAN_HALLS = new LinkedHashMap<>();
+ static
+ {
+ CLAN_HALLS.put(187, new Location(-122200, -116552, -5798, 1779));
+ CLAN_HALLS.put(186, new Location(-122264, -122392, -5870, 15229));
+ CLAN_HALLS.put(188, new Location(-121864, -111240, -6014, 30268));
+ CLAN_HALLS.put(190, new Location(-117080, -116551, -5771, 1779));
+ CLAN_HALLS.put(189, new Location(-117000, -122052, -5845, 15229));
+ CLAN_HALLS.put(191, new Location(-117074, -111237, -5989, 30268));
+ CLAN_HALLS.put(193, new Location(-111717, -116550, -5773, 1779));
+ CLAN_HALLS.put(192, new Location(-111726, -122378, -5845, 15229));
+ CLAN_HALLS.put(194, new Location(-111158, -111230, -5989, 30268));
+ }
+ private static final String HALL_OWNER_VAR = "PCH_OWNER_";
+ private static final String HALL_TIME_VAR = "PCH_TIME_";
+ private static final String HALL_RESET_VAR = "PCH_RESET_";
+ private static final String HALL_RETURN_VAR = "PCH_RETURN";
+ private static final Object LOCK = new Object();
+
+ private ProvisionalHalls()
+ {
+ addStartNpc(KERRY);
+ addFirstTalkId(KERRY);
+ addTalkId(KERRY);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ final long resetTime = GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0);
+ if (resetTime > 0)
+ {
+ cancelQuestTimers(HALL_RESET_VAR + id);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ }
+ }
+ }
+
+ @Override
+ public String onAdvEvent(String event, Npc npc, PlayerInstance player)
+ {
+ if ((npc.getId() != KERRY) && (npc.getId() != MAID))
+ {
+ return null;
+ }
+
+ String htmltext = null;
+ if (event.equals("33359-01.html") || event.equals("33359-02.html") || event.equals("33359-03.html"))
+ {
+ htmltext = event;
+ }
+ else if (event.equals("buy"))
+ {
+ synchronized (LOCK)
+ {
+ final Calendar calendar = Calendar.getInstance();
+ final int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+ if ((player.getClan() == null) || (player.getClan().getLeaderId() != player.getObjectId()))
+ {
+ player.sendMessage("You need to be a clan leader in order to proceed.");
+ }
+ else if ((player.getClan().getHideoutId() > 0))
+ {
+ player.sendMessage("You already own a hideout.");
+ }
+ else if ((dayOfWeek != Calendar.SATURDAY) && (dayOfWeek != Calendar.SUNDAY))
+ {
+ htmltext = "33359-02.html";
+ }
+ else if (player.getAdena() < HALL_PRICE)
+ {
+ player.sendMessage("You need " + HALL_PRICE + " adena in order to proceed.");
+ }
+ else
+ {
+ if (dayOfWeek != Calendar.SATURDAY)
+ {
+ calendar.add(Calendar.DAY_OF_WEEK, -1);
+ }
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
+ calendar.set(Calendar.MINUTE, 1);
+ calendar.set(Calendar.SECOND, 0);
+ calendar.set(Calendar.MILLISECOND, 0);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ {
+ player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
+ GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
+ GlobalVariablesManager.getInstance().set(HALL_TIME_VAR + id, calendar.getTimeInMillis());
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(id);
+ if (clanHall != null)
+ {
+ clanHall.setOwner(player.getClan());
+ }
+ player.sendMessage("Congratulations! You now own a provisional clan hall!");
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ return null;
+ }
+ }
+ player.sendMessage("I am sorry, all halls have been taken.");
+ }
+ }
+ }
+ else if (event.equals("enter"))
+ {
+ final int playerClanId = player.getClanId();
+ for (Entry hall : CLAN_HALLS.entrySet())
+ {
+ if (playerClanId == GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + hall.getKey(), -1))
+ {
+ player.getVariables().set(HALL_RETURN_VAR, player.getX() + "," + player.getY() + "," + player.getZ() + "," + player.getHeading());
+ player.teleToLocation(hall.getValue());
+ return null;
+ }
+ }
+ htmltext = "33359-02.html";
+ }
+ else if (event.equals("leave"))
+ {
+ final String[] location = player.getVariables().getString(HALL_RETURN_VAR, "-112574,256057,-1449,-1").split(",");
+ player.teleToLocation(Integer.parseInt(location[0]), Integer.parseInt(location[1]), Integer.parseInt(location[2]), Integer.parseInt(location[3]));
+ }
+ else if (event.startsWith(HALL_RESET_VAR))
+ {
+ final String id = event.replace(HALL_RESET_VAR, "");
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ {
+ final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
+ if (clanId > 0)
+ {
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(Integer.parseInt(id));
+ if (clanHall != null)
+ {
+ clanHall.setOwner(null);
+ }
+ }
+ GlobalVariablesManager.getInstance().remove(HALL_TIME_VAR + id);
+ GlobalVariablesManager.getInstance().remove(HALL_OWNER_VAR + id);
+ }
+ }
+
+ return htmltext;
+ }
+
+ @Override
+ public String onFirstTalk(Npc npc, PlayerInstance player)
+ {
+ return npc.getId() + "-01.html";
+ }
+
+ public static void main(String[] args)
+ {
+ new ProvisionalHalls();
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/spawns/Others/ProvisionalClanHalls.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
new file mode 100644
index 0000000000..59c1750c2c
--- /dev/null
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/npcs/33300-33399.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/npcs/33300-33399.xml
index 90dc939a18..52dc648467 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/npcs/33300-33399.xml
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/npcs/33300-33399.xml
@@ -1995,7 +1995,7 @@
-
+
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/teleporters/clanhall/TalkingIsland/ProvisionalHalls.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/teleporters/clanhall/TalkingIsland/ProvisionalHalls.xml
new file mode 100644
index 0000000000..be6162081f
--- /dev/null
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/teleporters/clanhall/TalkingIsland/ProvisionalHalls.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/xsd/clanHall.xsd b/L2J_Mobius_1.0_Ertheia/dist/game/data/xsd/clanHall.xsd
index 59b2e7adbe..18373ddc54 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/xsd/clanHall.xsd
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/xsd/clanHall.xsd
@@ -70,7 +70,7 @@
-
+
diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/zones/clan_hall.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/zones/clan_hall.xml
index 07d0ab4b6a..a80f54cbde 100644
--- a/L2J_Mobius_1.0_Ertheia/dist/game/data/zones/clan_hall.xml
+++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/zones/clan_hall.xml
@@ -418,4 +418,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Npc.java
index de4fec440e..61677550a5 100644
--- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Npc.java
+++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Npc.java
@@ -85,6 +85,8 @@ import org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.model.variables.NpcVariables;
import org.l2jmobius.gameserver.model.zone.ZoneId;
+import org.l2jmobius.gameserver.model.zone.ZoneType;
+import org.l2jmobius.gameserver.model.zone.type.ClanHallZone;
import org.l2jmobius.gameserver.model.zone.type.TaxZone;
import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.SystemMessageId;
@@ -552,6 +554,20 @@ public class Npc extends Creature
public ClanHall getClanHall()
{
+ if (getId() == 33360) // Provisional Hall Manager
+ {
+ for (ZoneType zone : ZoneManager.getInstance().getZones(this))
+ {
+ if (zone instanceof ClanHallZone)
+ {
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(((ClanHallZone) zone).getResidenceId());
+ if (clanHall != null)
+ {
+ return clanHall;
+ }
+ }
+ }
+ }
return ClanHallData.getInstance().getClanHallByNpcId(getId());
}
diff --git a/L2J_Mobius_1.0_Ertheia/readme.txt b/L2J_Mobius_1.0_Ertheia/readme.txt
index 53cb82106c..315e24034b 100644
--- a/L2J_Mobius_1.0_Ertheia/readme.txt
+++ b/L2J_Mobius_1.0_Ertheia/readme.txt
@@ -120,4 +120,3 @@ Others:
TODO:
-Modify all skill levels/sublevels based on client
--Provisional Clan Halls
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18600.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18600.xml
new file mode 100644
index 0000000000..b9300749f7
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18600.xml
@@ -0,0 +1,9 @@
+
+
+
+ 33360
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18601.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18601.xml
new file mode 100644
index 0000000000..be12e516de
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18601.xml
@@ -0,0 +1,14 @@
+
+
+
+ 33360
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18602.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18602.xml
new file mode 100644
index 0000000000..6ea606ac01
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18602.xml
@@ -0,0 +1,46 @@
+
+
+
+ 33360
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18700.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18700.xml
new file mode 100644
index 0000000000..b9300749f7
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18700.xml
@@ -0,0 +1,9 @@
+
+
+
+ 33360
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18701.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18701.xml
new file mode 100644
index 0000000000..be12e516de
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18701.xml
@@ -0,0 +1,14 @@
+
+
+
+ 33360
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18702.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18702.xml
new file mode 100644
index 0000000000..6ea606ac01
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18702.xml
@@ -0,0 +1,46 @@
+
+
+
+ 33360
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18800.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18800.xml
new file mode 100644
index 0000000000..b9300749f7
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18800.xml
@@ -0,0 +1,9 @@
+
+
+
+ 33360
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18801.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18801.xml
new file mode 100644
index 0000000000..be12e516de
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18801.xml
@@ -0,0 +1,14 @@
+
+
+
+ 33360
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18802.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18802.xml
new file mode 100644
index 0000000000..6ea606ac01
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18802.xml
@@ -0,0 +1,46 @@
+
+
+
+ 33360
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18900.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18900.xml
new file mode 100644
index 0000000000..b9300749f7
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18900.xml
@@ -0,0 +1,9 @@
+
+
+
+ 33360
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18901.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18901.xml
new file mode 100644
index 0000000000..be12e516de
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18901.xml
@@ -0,0 +1,14 @@
+
+
+
+ 33360
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18902.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18902.xml
new file mode 100644
index 0000000000..6ea606ac01
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/18902.xml
@@ -0,0 +1,46 @@
+
+
+
+ 33360
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19000.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19000.xml
new file mode 100644
index 0000000000..b9300749f7
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19000.xml
@@ -0,0 +1,9 @@
+
+
+
+ 33360
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19001.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19001.xml
new file mode 100644
index 0000000000..be12e516de
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19001.xml
@@ -0,0 +1,14 @@
+
+
+
+ 33360
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19002.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19002.xml
new file mode 100644
index 0000000000..6ea606ac01
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19002.xml
@@ -0,0 +1,46 @@
+
+
+
+ 33360
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19100.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19100.xml
new file mode 100644
index 0000000000..b9300749f7
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19100.xml
@@ -0,0 +1,9 @@
+
+
+
+ 33360
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19101.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19101.xml
new file mode 100644
index 0000000000..be12e516de
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19101.xml
@@ -0,0 +1,14 @@
+
+
+
+ 33360
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19102.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19102.xml
new file mode 100644
index 0000000000..6ea606ac01
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19102.xml
@@ -0,0 +1,46 @@
+
+
+
+ 33360
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19200.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19200.xml
new file mode 100644
index 0000000000..b9300749f7
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19200.xml
@@ -0,0 +1,9 @@
+
+
+
+ 33360
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19201.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19201.xml
new file mode 100644
index 0000000000..be12e516de
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19201.xml
@@ -0,0 +1,14 @@
+
+
+
+ 33360
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19202.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19202.xml
new file mode 100644
index 0000000000..6ea606ac01
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19202.xml
@@ -0,0 +1,46 @@
+
+
+
+ 33360
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19300.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19300.xml
new file mode 100644
index 0000000000..b9300749f7
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19300.xml
@@ -0,0 +1,9 @@
+
+
+
+ 33360
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19301.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19301.xml
new file mode 100644
index 0000000000..be12e516de
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19301.xml
@@ -0,0 +1,14 @@
+
+
+
+ 33360
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19302.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19302.xml
new file mode 100644
index 0000000000..6ea606ac01
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19302.xml
@@ -0,0 +1,46 @@
+
+
+
+ 33360
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19400.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19400.xml
new file mode 100644
index 0000000000..b9300749f7
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19400.xml
@@ -0,0 +1,9 @@
+
+
+
+ 33360
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19401.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19401.xml
new file mode 100644
index 0000000000..be12e516de
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19401.xml
@@ -0,0 +1,14 @@
+
+
+
+ 33360
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19402.xml b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19402.xml
new file mode 100644
index 0000000000..6ea606ac01
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/buylists/19402.xml
@@ -0,0 +1,46 @@
+
+
+
+ 33360
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/ElliaHall1.xml b/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/ElliaHall1.xml
new file mode 100644
index 0000000000..6fe70f20a7
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/ElliaHall1.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/ElliaHall2.xml b/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/ElliaHall2.xml
new file mode 100644
index 0000000000..8bf69ef206
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/ElliaHall2.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/ElliaHall3.xml b/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/ElliaHall3.xml
new file mode 100644
index 0000000000..f7f1f440f8
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/ElliaHall3.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/LaurellHall1.xml b/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/LaurellHall1.xml
new file mode 100644
index 0000000000..1753480a5d
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/LaurellHall1.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/LaurellHall2.xml b/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/LaurellHall2.xml
new file mode 100644
index 0000000000..717e047bb4
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/LaurellHall2.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/LaurellHall3.xml b/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/LaurellHall3.xml
new file mode 100644
index 0000000000..62a668008c
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/LaurellHall3.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/OrchidHall1.xml b/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/OrchidHall1.xml
new file mode 100644
index 0000000000..c02e175b86
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/OrchidHall1.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/OrchidHall2.xml b/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/OrchidHall2.xml
new file mode 100644
index 0000000000..f24b5f329a
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/OrchidHall2.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/OrchidHall3.xml b/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/OrchidHall3.xml
new file mode 100644
index 0000000000..fc73cbc54e
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/residences/clanHalls/TalkingIsland/OrchidHall3.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-01b.html b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-01b.html
new file mode 100644
index 0000000000..e636a9ddf7
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-01b.html
@@ -0,0 +1,10 @@
+Greetings, my lord.
+I am at your service.
+
+Expel an outsider
+Clan Hall function
+Clan Warehouse
+Manage Clan Hall
+See you later
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
new file mode 100644
index 0000000000..1b789e7c9a
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
@@ -0,0 +1,9 @@
+
+[Manage Clan Hall]
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
index 81e8fd76e2..f6816515d7 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
@@ -62,6 +62,7 @@ public class ClanHallManager extends AbstractNpcAI
36721, 36723, 36725, 36727, // Gludio Outskirts
36729, 36731, 36733, 36735, // Dion Outskirts
36737, 36739, // Floran Village
+ 33360, // Talking Island
};
// @formatter:on
// Misc
@@ -118,7 +119,21 @@ public class ClanHallManager extends AbstractNpcAI
{
case "index":
{
- htmltext = isOwningClan(player, npc) ? "ClanHallManager-01.html" : "ClanHallManager-03.html";
+ if (isOwningClan(player, npc))
+ {
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
+ {
+ htmltext = "ClanHallManager-01.html";
+ }
+ }
+ else
+ {
+ htmltext = "ClanHallManager-03.html";
+ }
break;
}
case "manageDoors":
@@ -257,7 +272,14 @@ public class ClanHallManager extends AbstractNpcAI
case 2:
case 3:
{
- ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(clanHall.getResidenceId() + "0" + (itemLevel - 1)));
+ }
+ else
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ }
break;
}
default:
@@ -289,7 +311,14 @@ public class ClanHallManager extends AbstractNpcAI
{
if (!st.hasMoreTokens())
{
- htmltext = "ClanHallManager-11.html";
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-11b.html";
+ }
+ else
+ {
+ htmltext = "ClanHallManager-11.html";
+ }
}
else
{
@@ -435,7 +464,11 @@ public class ClanHallManager extends AbstractNpcAI
final ClanHall clanHall = npc.getClanHall();
if (isOwningClan(player, npc))
{
- if (clanHall.getCostFailDay() == 0)
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
{
htmltext = "ClanHallManager-01.html";
}
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
new file mode 100644
index 0000000000..84a177d7d4
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
@@ -0,0 +1,13 @@
+
+Ah, hello!
+I am the Clan Hall Gatekeeper, Kerry. It's an honor to serve you.
+Do you need help with the Provisional Clan Hall?
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
new file mode 100644
index 0000000000..509b7ff9eb
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
@@ -0,0 +1,12 @@
+
+
+
+Participant,
+
+Aw, sorry, but you didn't win a Provisional Clan Hall.
+The auction takes place every 2 weeks,
+between 00:01 Saturday and 23:59 Sunday.
+
+
+Better luck at the next auction!
+
\ No newline at end of file
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
new file mode 100644
index 0000000000..33ec4e8c92
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
@@ -0,0 +1,6 @@
+
+The Provisional Clan Hall will cost you 50.000.000 adena, are you sure?
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
new file mode 100644
index 0000000000..2cb3848ff5
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -0,0 +1,199 @@
+/*
+ * 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 ai.others.ProvisionalHalls;
+
+import java.util.Calendar;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.l2jmobius.gameserver.data.xml.impl.ClanHallData;
+import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
+import org.l2jmobius.gameserver.model.Location;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
+import org.l2jmobius.gameserver.model.entity.ClanHall;
+
+import ai.AbstractNpcAI;
+
+/**
+ * Custom implementation for Provisional Clan Halls.
+ * @author Mobius
+ */
+public class ProvisionalHalls extends AbstractNpcAI
+{
+ // NPCs
+ private static final int KERRY = 33359;
+ private static final int MAID = 33360;
+ // Misc
+ private static final int HALL_PRICE = 50000000;
+ private static final long TWO_WEEKS = 1209600000;
+ private static final Map CLAN_HALLS = new LinkedHashMap<>();
+ static
+ {
+ CLAN_HALLS.put(187, new Location(-122200, -116552, -5798, 1779));
+ CLAN_HALLS.put(186, new Location(-122264, -122392, -5870, 15229));
+ CLAN_HALLS.put(188, new Location(-121864, -111240, -6014, 30268));
+ CLAN_HALLS.put(190, new Location(-117080, -116551, -5771, 1779));
+ CLAN_HALLS.put(189, new Location(-117000, -122052, -5845, 15229));
+ CLAN_HALLS.put(191, new Location(-117074, -111237, -5989, 30268));
+ CLAN_HALLS.put(193, new Location(-111717, -116550, -5773, 1779));
+ CLAN_HALLS.put(192, new Location(-111726, -122378, -5845, 15229));
+ CLAN_HALLS.put(194, new Location(-111158, -111230, -5989, 30268));
+ }
+ private static final String HALL_OWNER_VAR = "PCH_OWNER_";
+ private static final String HALL_TIME_VAR = "PCH_TIME_";
+ private static final String HALL_RESET_VAR = "PCH_RESET_";
+ private static final String HALL_RETURN_VAR = "PCH_RETURN";
+ private static final Object LOCK = new Object();
+
+ private ProvisionalHalls()
+ {
+ addStartNpc(KERRY);
+ addFirstTalkId(KERRY);
+ addTalkId(KERRY);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ final long resetTime = GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0);
+ if (resetTime > 0)
+ {
+ cancelQuestTimers(HALL_RESET_VAR + id);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ }
+ }
+ }
+
+ @Override
+ public String onAdvEvent(String event, Npc npc, PlayerInstance player)
+ {
+ if ((npc.getId() != KERRY) && (npc.getId() != MAID))
+ {
+ return null;
+ }
+
+ String htmltext = null;
+ if (event.equals("33359-01.html") || event.equals("33359-02.html") || event.equals("33359-03.html"))
+ {
+ htmltext = event;
+ }
+ else if (event.equals("buy"))
+ {
+ synchronized (LOCK)
+ {
+ final Calendar calendar = Calendar.getInstance();
+ final int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+ if ((player.getClan() == null) || (player.getClan().getLeaderId() != player.getObjectId()))
+ {
+ player.sendMessage("You need to be a clan leader in order to proceed.");
+ }
+ else if ((player.getClan().getHideoutId() > 0))
+ {
+ player.sendMessage("You already own a hideout.");
+ }
+ else if ((dayOfWeek != Calendar.SATURDAY) && (dayOfWeek != Calendar.SUNDAY))
+ {
+ htmltext = "33359-02.html";
+ }
+ else if (player.getAdena() < HALL_PRICE)
+ {
+ player.sendMessage("You need " + HALL_PRICE + " adena in order to proceed.");
+ }
+ else
+ {
+ if (dayOfWeek != Calendar.SATURDAY)
+ {
+ calendar.add(Calendar.DAY_OF_WEEK, -1);
+ }
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
+ calendar.set(Calendar.MINUTE, 1);
+ calendar.set(Calendar.SECOND, 0);
+ calendar.set(Calendar.MILLISECOND, 0);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ {
+ player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
+ GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
+ GlobalVariablesManager.getInstance().set(HALL_TIME_VAR + id, calendar.getTimeInMillis());
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(id);
+ if (clanHall != null)
+ {
+ clanHall.setOwner(player.getClan());
+ }
+ player.sendMessage("Congratulations! You now own a provisional clan hall!");
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ return null;
+ }
+ }
+ player.sendMessage("I am sorry, all halls have been taken.");
+ }
+ }
+ }
+ else if (event.equals("enter"))
+ {
+ final int playerClanId = player.getClanId();
+ for (Entry hall : CLAN_HALLS.entrySet())
+ {
+ if (playerClanId == GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + hall.getKey(), -1))
+ {
+ player.getVariables().set(HALL_RETURN_VAR, player.getX() + "," + player.getY() + "," + player.getZ() + "," + player.getHeading());
+ player.teleToLocation(hall.getValue());
+ return null;
+ }
+ }
+ htmltext = "33359-02.html";
+ }
+ else if (event.equals("leave"))
+ {
+ final String[] location = player.getVariables().getString(HALL_RETURN_VAR, "-112574,256057,-1449,-1").split(",");
+ player.teleToLocation(Integer.parseInt(location[0]), Integer.parseInt(location[1]), Integer.parseInt(location[2]), Integer.parseInt(location[3]));
+ }
+ else if (event.startsWith(HALL_RESET_VAR))
+ {
+ final String id = event.replace(HALL_RESET_VAR, "");
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ {
+ final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
+ if (clanId > 0)
+ {
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(Integer.parseInt(id));
+ if (clanHall != null)
+ {
+ clanHall.setOwner(null);
+ }
+ }
+ GlobalVariablesManager.getInstance().remove(HALL_TIME_VAR + id);
+ GlobalVariablesManager.getInstance().remove(HALL_OWNER_VAR + id);
+ }
+ }
+
+ return htmltext;
+ }
+
+ @Override
+ public String onFirstTalk(Npc npc, PlayerInstance player)
+ {
+ return npc.getId() + "-01.html";
+ }
+
+ public static void main(String[] args)
+ {
+ new ProvisionalHalls();
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/spawns/Others/ProvisionalClanHalls.xml b/L2J_Mobius_2.5_Underground/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
new file mode 100644
index 0000000000..59c1750c2c
--- /dev/null
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/npcs/33300-33399.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/npcs/33300-33399.xml
index 90dc939a18..52dc648467 100644
--- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/npcs/33300-33399.xml
+++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/npcs/33300-33399.xml
@@ -1995,7 +1995,7 @@
+Expel an outsider
+Clan Hall function
+Clan Warehouse
+Manage Clan Hall
+See you later
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
new file mode 100644
index 0000000000..1b789e7c9a
--- /dev/null
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
@@ -0,0 +1,9 @@
+
+[Manage Clan Hall]
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
index 81e8fd76e2..f6816515d7 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
@@ -62,6 +62,7 @@ public class ClanHallManager extends AbstractNpcAI
36721, 36723, 36725, 36727, // Gludio Outskirts
36729, 36731, 36733, 36735, // Dion Outskirts
36737, 36739, // Floran Village
+ 33360, // Talking Island
};
// @formatter:on
// Misc
@@ -118,7 +119,21 @@ public class ClanHallManager extends AbstractNpcAI
{
case "index":
{
- htmltext = isOwningClan(player, npc) ? "ClanHallManager-01.html" : "ClanHallManager-03.html";
+ if (isOwningClan(player, npc))
+ {
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
+ {
+ htmltext = "ClanHallManager-01.html";
+ }
+ }
+ else
+ {
+ htmltext = "ClanHallManager-03.html";
+ }
break;
}
case "manageDoors":
@@ -257,7 +272,14 @@ public class ClanHallManager extends AbstractNpcAI
case 2:
case 3:
{
- ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(clanHall.getResidenceId() + "0" + (itemLevel - 1)));
+ }
+ else
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ }
break;
}
default:
@@ -289,7 +311,14 @@ public class ClanHallManager extends AbstractNpcAI
{
if (!st.hasMoreTokens())
{
- htmltext = "ClanHallManager-11.html";
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-11b.html";
+ }
+ else
+ {
+ htmltext = "ClanHallManager-11.html";
+ }
}
else
{
@@ -435,7 +464,11 @@ public class ClanHallManager extends AbstractNpcAI
final ClanHall clanHall = npc.getClanHall();
if (isOwningClan(player, npc))
{
- if (clanHall.getCostFailDay() == 0)
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
{
htmltext = "ClanHallManager-01.html";
}
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
new file mode 100644
index 0000000000..84a177d7d4
--- /dev/null
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
@@ -0,0 +1,13 @@
+
+Ah, hello!
+I am the Clan Hall Gatekeeper, Kerry. It's an honor to serve you.
+Do you need help with the Provisional Clan Hall?
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
new file mode 100644
index 0000000000..509b7ff9eb
--- /dev/null
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
@@ -0,0 +1,12 @@
+
+
+
+Participant,
+
+Aw, sorry, but you didn't win a Provisional Clan Hall.
+The auction takes place every 2 weeks,
+between 00:01 Saturday and 23:59 Sunday.
+
+
+Better luck at the next auction!
+
\ No newline at end of file
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
new file mode 100644
index 0000000000..33ec4e8c92
--- /dev/null
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
@@ -0,0 +1,6 @@
+
+The Provisional Clan Hall will cost you 50.000.000 adena, are you sure?
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
new file mode 100644
index 0000000000..2cb3848ff5
--- /dev/null
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -0,0 +1,199 @@
+/*
+ * 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 ai.others.ProvisionalHalls;
+
+import java.util.Calendar;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.l2jmobius.gameserver.data.xml.impl.ClanHallData;
+import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
+import org.l2jmobius.gameserver.model.Location;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
+import org.l2jmobius.gameserver.model.entity.ClanHall;
+
+import ai.AbstractNpcAI;
+
+/**
+ * Custom implementation for Provisional Clan Halls.
+ * @author Mobius
+ */
+public class ProvisionalHalls extends AbstractNpcAI
+{
+ // NPCs
+ private static final int KERRY = 33359;
+ private static final int MAID = 33360;
+ // Misc
+ private static final int HALL_PRICE = 50000000;
+ private static final long TWO_WEEKS = 1209600000;
+ private static final Map CLAN_HALLS = new LinkedHashMap<>();
+ static
+ {
+ CLAN_HALLS.put(187, new Location(-122200, -116552, -5798, 1779));
+ CLAN_HALLS.put(186, new Location(-122264, -122392, -5870, 15229));
+ CLAN_HALLS.put(188, new Location(-121864, -111240, -6014, 30268));
+ CLAN_HALLS.put(190, new Location(-117080, -116551, -5771, 1779));
+ CLAN_HALLS.put(189, new Location(-117000, -122052, -5845, 15229));
+ CLAN_HALLS.put(191, new Location(-117074, -111237, -5989, 30268));
+ CLAN_HALLS.put(193, new Location(-111717, -116550, -5773, 1779));
+ CLAN_HALLS.put(192, new Location(-111726, -122378, -5845, 15229));
+ CLAN_HALLS.put(194, new Location(-111158, -111230, -5989, 30268));
+ }
+ private static final String HALL_OWNER_VAR = "PCH_OWNER_";
+ private static final String HALL_TIME_VAR = "PCH_TIME_";
+ private static final String HALL_RESET_VAR = "PCH_RESET_";
+ private static final String HALL_RETURN_VAR = "PCH_RETURN";
+ private static final Object LOCK = new Object();
+
+ private ProvisionalHalls()
+ {
+ addStartNpc(KERRY);
+ addFirstTalkId(KERRY);
+ addTalkId(KERRY);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ final long resetTime = GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0);
+ if (resetTime > 0)
+ {
+ cancelQuestTimers(HALL_RESET_VAR + id);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ }
+ }
+ }
+
+ @Override
+ public String onAdvEvent(String event, Npc npc, PlayerInstance player)
+ {
+ if ((npc.getId() != KERRY) && (npc.getId() != MAID))
+ {
+ return null;
+ }
+
+ String htmltext = null;
+ if (event.equals("33359-01.html") || event.equals("33359-02.html") || event.equals("33359-03.html"))
+ {
+ htmltext = event;
+ }
+ else if (event.equals("buy"))
+ {
+ synchronized (LOCK)
+ {
+ final Calendar calendar = Calendar.getInstance();
+ final int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+ if ((player.getClan() == null) || (player.getClan().getLeaderId() != player.getObjectId()))
+ {
+ player.sendMessage("You need to be a clan leader in order to proceed.");
+ }
+ else if ((player.getClan().getHideoutId() > 0))
+ {
+ player.sendMessage("You already own a hideout.");
+ }
+ else if ((dayOfWeek != Calendar.SATURDAY) && (dayOfWeek != Calendar.SUNDAY))
+ {
+ htmltext = "33359-02.html";
+ }
+ else if (player.getAdena() < HALL_PRICE)
+ {
+ player.sendMessage("You need " + HALL_PRICE + " adena in order to proceed.");
+ }
+ else
+ {
+ if (dayOfWeek != Calendar.SATURDAY)
+ {
+ calendar.add(Calendar.DAY_OF_WEEK, -1);
+ }
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
+ calendar.set(Calendar.MINUTE, 1);
+ calendar.set(Calendar.SECOND, 0);
+ calendar.set(Calendar.MILLISECOND, 0);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ {
+ player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
+ GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
+ GlobalVariablesManager.getInstance().set(HALL_TIME_VAR + id, calendar.getTimeInMillis());
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(id);
+ if (clanHall != null)
+ {
+ clanHall.setOwner(player.getClan());
+ }
+ player.sendMessage("Congratulations! You now own a provisional clan hall!");
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ return null;
+ }
+ }
+ player.sendMessage("I am sorry, all halls have been taken.");
+ }
+ }
+ }
+ else if (event.equals("enter"))
+ {
+ final int playerClanId = player.getClanId();
+ for (Entry hall : CLAN_HALLS.entrySet())
+ {
+ if (playerClanId == GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + hall.getKey(), -1))
+ {
+ player.getVariables().set(HALL_RETURN_VAR, player.getX() + "," + player.getY() + "," + player.getZ() + "," + player.getHeading());
+ player.teleToLocation(hall.getValue());
+ return null;
+ }
+ }
+ htmltext = "33359-02.html";
+ }
+ else if (event.equals("leave"))
+ {
+ final String[] location = player.getVariables().getString(HALL_RETURN_VAR, "-112574,256057,-1449,-1").split(",");
+ player.teleToLocation(Integer.parseInt(location[0]), Integer.parseInt(location[1]), Integer.parseInt(location[2]), Integer.parseInt(location[3]));
+ }
+ else if (event.startsWith(HALL_RESET_VAR))
+ {
+ final String id = event.replace(HALL_RESET_VAR, "");
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ {
+ final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
+ if (clanId > 0)
+ {
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(Integer.parseInt(id));
+ if (clanHall != null)
+ {
+ clanHall.setOwner(null);
+ }
+ }
+ GlobalVariablesManager.getInstance().remove(HALL_TIME_VAR + id);
+ GlobalVariablesManager.getInstance().remove(HALL_OWNER_VAR + id);
+ }
+ }
+
+ return htmltext;
+ }
+
+ @Override
+ public String onFirstTalk(Npc npc, PlayerInstance player)
+ {
+ return npc.getId() + "-01.html";
+ }
+
+ public static void main(String[] args)
+ {
+ new ProvisionalHalls();
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/spawns/Others/ProvisionalClanHalls.xml b/L2J_Mobius_3.0_Helios/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
new file mode 100644
index 0000000000..59c1750c2c
--- /dev/null
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/npcs/33300-33399.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/npcs/33300-33399.xml
index 90dc939a18..52dc648467 100644
--- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/npcs/33300-33399.xml
+++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/npcs/33300-33399.xml
@@ -1995,7 +1995,7 @@
+Expel an outsider
+Clan Hall function
+Clan Warehouse
+Manage Clan Hall
+See you later
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
new file mode 100644
index 0000000000..1b789e7c9a
--- /dev/null
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
@@ -0,0 +1,9 @@
+
+[Manage Clan Hall]
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
index 81e8fd76e2..f6816515d7 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
@@ -62,6 +62,7 @@ public class ClanHallManager extends AbstractNpcAI
36721, 36723, 36725, 36727, // Gludio Outskirts
36729, 36731, 36733, 36735, // Dion Outskirts
36737, 36739, // Floran Village
+ 33360, // Talking Island
};
// @formatter:on
// Misc
@@ -118,7 +119,21 @@ public class ClanHallManager extends AbstractNpcAI
{
case "index":
{
- htmltext = isOwningClan(player, npc) ? "ClanHallManager-01.html" : "ClanHallManager-03.html";
+ if (isOwningClan(player, npc))
+ {
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
+ {
+ htmltext = "ClanHallManager-01.html";
+ }
+ }
+ else
+ {
+ htmltext = "ClanHallManager-03.html";
+ }
break;
}
case "manageDoors":
@@ -257,7 +272,14 @@ public class ClanHallManager extends AbstractNpcAI
case 2:
case 3:
{
- ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(clanHall.getResidenceId() + "0" + (itemLevel - 1)));
+ }
+ else
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ }
break;
}
default:
@@ -289,7 +311,14 @@ public class ClanHallManager extends AbstractNpcAI
{
if (!st.hasMoreTokens())
{
- htmltext = "ClanHallManager-11.html";
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-11b.html";
+ }
+ else
+ {
+ htmltext = "ClanHallManager-11.html";
+ }
}
else
{
@@ -435,7 +464,11 @@ public class ClanHallManager extends AbstractNpcAI
final ClanHall clanHall = npc.getClanHall();
if (isOwningClan(player, npc))
{
- if (clanHall.getCostFailDay() == 0)
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
{
htmltext = "ClanHallManager-01.html";
}
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
new file mode 100644
index 0000000000..84a177d7d4
--- /dev/null
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
@@ -0,0 +1,13 @@
+
+Ah, hello!
+I am the Clan Hall Gatekeeper, Kerry. It's an honor to serve you.
+Do you need help with the Provisional Clan Hall?
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
new file mode 100644
index 0000000000..509b7ff9eb
--- /dev/null
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
@@ -0,0 +1,12 @@
+
+
+
+Participant,
+
+Aw, sorry, but you didn't win a Provisional Clan Hall.
+The auction takes place every 2 weeks,
+between 00:01 Saturday and 23:59 Sunday.
+
+
+Better luck at the next auction!
+
\ No newline at end of file
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
new file mode 100644
index 0000000000..33ec4e8c92
--- /dev/null
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
@@ -0,0 +1,6 @@
+
+The Provisional Clan Hall will cost you 50.000.000 adena, are you sure?
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
new file mode 100644
index 0000000000..2cb3848ff5
--- /dev/null
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -0,0 +1,199 @@
+/*
+ * 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 ai.others.ProvisionalHalls;
+
+import java.util.Calendar;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.l2jmobius.gameserver.data.xml.impl.ClanHallData;
+import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
+import org.l2jmobius.gameserver.model.Location;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
+import org.l2jmobius.gameserver.model.entity.ClanHall;
+
+import ai.AbstractNpcAI;
+
+/**
+ * Custom implementation for Provisional Clan Halls.
+ * @author Mobius
+ */
+public class ProvisionalHalls extends AbstractNpcAI
+{
+ // NPCs
+ private static final int KERRY = 33359;
+ private static final int MAID = 33360;
+ // Misc
+ private static final int HALL_PRICE = 50000000;
+ private static final long TWO_WEEKS = 1209600000;
+ private static final Map CLAN_HALLS = new LinkedHashMap<>();
+ static
+ {
+ CLAN_HALLS.put(187, new Location(-122200, -116552, -5798, 1779));
+ CLAN_HALLS.put(186, new Location(-122264, -122392, -5870, 15229));
+ CLAN_HALLS.put(188, new Location(-121864, -111240, -6014, 30268));
+ CLAN_HALLS.put(190, new Location(-117080, -116551, -5771, 1779));
+ CLAN_HALLS.put(189, new Location(-117000, -122052, -5845, 15229));
+ CLAN_HALLS.put(191, new Location(-117074, -111237, -5989, 30268));
+ CLAN_HALLS.put(193, new Location(-111717, -116550, -5773, 1779));
+ CLAN_HALLS.put(192, new Location(-111726, -122378, -5845, 15229));
+ CLAN_HALLS.put(194, new Location(-111158, -111230, -5989, 30268));
+ }
+ private static final String HALL_OWNER_VAR = "PCH_OWNER_";
+ private static final String HALL_TIME_VAR = "PCH_TIME_";
+ private static final String HALL_RESET_VAR = "PCH_RESET_";
+ private static final String HALL_RETURN_VAR = "PCH_RETURN";
+ private static final Object LOCK = new Object();
+
+ private ProvisionalHalls()
+ {
+ addStartNpc(KERRY);
+ addFirstTalkId(KERRY);
+ addTalkId(KERRY);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ final long resetTime = GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0);
+ if (resetTime > 0)
+ {
+ cancelQuestTimers(HALL_RESET_VAR + id);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ }
+ }
+ }
+
+ @Override
+ public String onAdvEvent(String event, Npc npc, PlayerInstance player)
+ {
+ if ((npc.getId() != KERRY) && (npc.getId() != MAID))
+ {
+ return null;
+ }
+
+ String htmltext = null;
+ if (event.equals("33359-01.html") || event.equals("33359-02.html") || event.equals("33359-03.html"))
+ {
+ htmltext = event;
+ }
+ else if (event.equals("buy"))
+ {
+ synchronized (LOCK)
+ {
+ final Calendar calendar = Calendar.getInstance();
+ final int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+ if ((player.getClan() == null) || (player.getClan().getLeaderId() != player.getObjectId()))
+ {
+ player.sendMessage("You need to be a clan leader in order to proceed.");
+ }
+ else if ((player.getClan().getHideoutId() > 0))
+ {
+ player.sendMessage("You already own a hideout.");
+ }
+ else if ((dayOfWeek != Calendar.SATURDAY) && (dayOfWeek != Calendar.SUNDAY))
+ {
+ htmltext = "33359-02.html";
+ }
+ else if (player.getAdena() < HALL_PRICE)
+ {
+ player.sendMessage("You need " + HALL_PRICE + " adena in order to proceed.");
+ }
+ else
+ {
+ if (dayOfWeek != Calendar.SATURDAY)
+ {
+ calendar.add(Calendar.DAY_OF_WEEK, -1);
+ }
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
+ calendar.set(Calendar.MINUTE, 1);
+ calendar.set(Calendar.SECOND, 0);
+ calendar.set(Calendar.MILLISECOND, 0);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ {
+ player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
+ GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
+ GlobalVariablesManager.getInstance().set(HALL_TIME_VAR + id, calendar.getTimeInMillis());
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(id);
+ if (clanHall != null)
+ {
+ clanHall.setOwner(player.getClan());
+ }
+ player.sendMessage("Congratulations! You now own a provisional clan hall!");
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ return null;
+ }
+ }
+ player.sendMessage("I am sorry, all halls have been taken.");
+ }
+ }
+ }
+ else if (event.equals("enter"))
+ {
+ final int playerClanId = player.getClanId();
+ for (Entry hall : CLAN_HALLS.entrySet())
+ {
+ if (playerClanId == GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + hall.getKey(), -1))
+ {
+ player.getVariables().set(HALL_RETURN_VAR, player.getX() + "," + player.getY() + "," + player.getZ() + "," + player.getHeading());
+ player.teleToLocation(hall.getValue());
+ return null;
+ }
+ }
+ htmltext = "33359-02.html";
+ }
+ else if (event.equals("leave"))
+ {
+ final String[] location = player.getVariables().getString(HALL_RETURN_VAR, "-112574,256057,-1449,-1").split(",");
+ player.teleToLocation(Integer.parseInt(location[0]), Integer.parseInt(location[1]), Integer.parseInt(location[2]), Integer.parseInt(location[3]));
+ }
+ else if (event.startsWith(HALL_RESET_VAR))
+ {
+ final String id = event.replace(HALL_RESET_VAR, "");
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ {
+ final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
+ if (clanId > 0)
+ {
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(Integer.parseInt(id));
+ if (clanHall != null)
+ {
+ clanHall.setOwner(null);
+ }
+ }
+ GlobalVariablesManager.getInstance().remove(HALL_TIME_VAR + id);
+ GlobalVariablesManager.getInstance().remove(HALL_OWNER_VAR + id);
+ }
+ }
+
+ return htmltext;
+ }
+
+ @Override
+ public String onFirstTalk(Npc npc, PlayerInstance player)
+ {
+ return npc.getId() + "-01.html";
+ }
+
+ public static void main(String[] args)
+ {
+ new ProvisionalHalls();
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/spawns/Others/ProvisionalClanHalls.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
new file mode 100644
index 0000000000..59c1750c2c
--- /dev/null
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/npcs/33300-33399.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/npcs/33300-33399.xml
index 0377c0409c..1f75a8832b 100644
--- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/npcs/33300-33399.xml
+++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/npcs/33300-33399.xml
@@ -1995,7 +1995,7 @@
+Expel an outsider
+Clan Hall function
+Clan Warehouse
+Manage Clan Hall
+See you later
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
new file mode 100644
index 0000000000..1b789e7c9a
--- /dev/null
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
@@ -0,0 +1,9 @@
+
+[Manage Clan Hall]
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
index 655b32f8c8..a55a147eb8 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
@@ -62,6 +62,7 @@ public class ClanHallManager extends AbstractNpcAI
36721, 36723, 36725, 36727, // Gludio Outskirts
36729, 36731, 36733, 36735, // Dion Outskirts
36737, 36739, // Floran Village
+ 33360, // Talking Island
};
// @formatter:on
// Misc
@@ -116,7 +117,21 @@ public class ClanHallManager extends AbstractNpcAI
{
case "index":
{
- htmltext = isOwningClan(player, npc) ? "ClanHallManager-01.html" : "ClanHallManager-03.html";
+ if (isOwningClan(player, npc))
+ {
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
+ {
+ htmltext = "ClanHallManager-01.html";
+ }
+ }
+ else
+ {
+ htmltext = "ClanHallManager-03.html";
+ }
break;
}
case "manageDoors":
@@ -255,7 +270,14 @@ public class ClanHallManager extends AbstractNpcAI
case 2:
case 3:
{
- ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(clanHall.getResidenceId() + "0" + (itemLevel - 1)));
+ }
+ else
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ }
break;
}
default:
@@ -287,7 +309,14 @@ public class ClanHallManager extends AbstractNpcAI
{
if (!st.hasMoreTokens())
{
- htmltext = "ClanHallManager-11.html";
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-11b.html";
+ }
+ else
+ {
+ htmltext = "ClanHallManager-11.html";
+ }
}
else
{
@@ -433,7 +462,11 @@ public class ClanHallManager extends AbstractNpcAI
final ClanHall clanHall = npc.getClanHall();
if (isOwningClan(player, npc))
{
- if (clanHall.getCostFailDay() == 0)
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
{
htmltext = "ClanHallManager-01.html";
}
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
new file mode 100644
index 0000000000..84a177d7d4
--- /dev/null
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
@@ -0,0 +1,13 @@
+
+Ah, hello!
+I am the Clan Hall Gatekeeper, Kerry. It's an honor to serve you.
+Do you need help with the Provisional Clan Hall?
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
new file mode 100644
index 0000000000..509b7ff9eb
--- /dev/null
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
@@ -0,0 +1,12 @@
+
+
+
+Participant,
+
+Aw, sorry, but you didn't win a Provisional Clan Hall.
+The auction takes place every 2 weeks,
+between 00:01 Saturday and 23:59 Sunday.
+
+
+Better luck at the next auction!
+
\ No newline at end of file
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
new file mode 100644
index 0000000000..33ec4e8c92
--- /dev/null
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
@@ -0,0 +1,6 @@
+
+The Provisional Clan Hall will cost you 50.000.000 adena, are you sure?
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
new file mode 100644
index 0000000000..2cb3848ff5
--- /dev/null
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -0,0 +1,199 @@
+/*
+ * 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 ai.others.ProvisionalHalls;
+
+import java.util.Calendar;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.l2jmobius.gameserver.data.xml.impl.ClanHallData;
+import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
+import org.l2jmobius.gameserver.model.Location;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
+import org.l2jmobius.gameserver.model.entity.ClanHall;
+
+import ai.AbstractNpcAI;
+
+/**
+ * Custom implementation for Provisional Clan Halls.
+ * @author Mobius
+ */
+public class ProvisionalHalls extends AbstractNpcAI
+{
+ // NPCs
+ private static final int KERRY = 33359;
+ private static final int MAID = 33360;
+ // Misc
+ private static final int HALL_PRICE = 50000000;
+ private static final long TWO_WEEKS = 1209600000;
+ private static final Map CLAN_HALLS = new LinkedHashMap<>();
+ static
+ {
+ CLAN_HALLS.put(187, new Location(-122200, -116552, -5798, 1779));
+ CLAN_HALLS.put(186, new Location(-122264, -122392, -5870, 15229));
+ CLAN_HALLS.put(188, new Location(-121864, -111240, -6014, 30268));
+ CLAN_HALLS.put(190, new Location(-117080, -116551, -5771, 1779));
+ CLAN_HALLS.put(189, new Location(-117000, -122052, -5845, 15229));
+ CLAN_HALLS.put(191, new Location(-117074, -111237, -5989, 30268));
+ CLAN_HALLS.put(193, new Location(-111717, -116550, -5773, 1779));
+ CLAN_HALLS.put(192, new Location(-111726, -122378, -5845, 15229));
+ CLAN_HALLS.put(194, new Location(-111158, -111230, -5989, 30268));
+ }
+ private static final String HALL_OWNER_VAR = "PCH_OWNER_";
+ private static final String HALL_TIME_VAR = "PCH_TIME_";
+ private static final String HALL_RESET_VAR = "PCH_RESET_";
+ private static final String HALL_RETURN_VAR = "PCH_RETURN";
+ private static final Object LOCK = new Object();
+
+ private ProvisionalHalls()
+ {
+ addStartNpc(KERRY);
+ addFirstTalkId(KERRY);
+ addTalkId(KERRY);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ final long resetTime = GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0);
+ if (resetTime > 0)
+ {
+ cancelQuestTimers(HALL_RESET_VAR + id);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ }
+ }
+ }
+
+ @Override
+ public String onAdvEvent(String event, Npc npc, PlayerInstance player)
+ {
+ if ((npc.getId() != KERRY) && (npc.getId() != MAID))
+ {
+ return null;
+ }
+
+ String htmltext = null;
+ if (event.equals("33359-01.html") || event.equals("33359-02.html") || event.equals("33359-03.html"))
+ {
+ htmltext = event;
+ }
+ else if (event.equals("buy"))
+ {
+ synchronized (LOCK)
+ {
+ final Calendar calendar = Calendar.getInstance();
+ final int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+ if ((player.getClan() == null) || (player.getClan().getLeaderId() != player.getObjectId()))
+ {
+ player.sendMessage("You need to be a clan leader in order to proceed.");
+ }
+ else if ((player.getClan().getHideoutId() > 0))
+ {
+ player.sendMessage("You already own a hideout.");
+ }
+ else if ((dayOfWeek != Calendar.SATURDAY) && (dayOfWeek != Calendar.SUNDAY))
+ {
+ htmltext = "33359-02.html";
+ }
+ else if (player.getAdena() < HALL_PRICE)
+ {
+ player.sendMessage("You need " + HALL_PRICE + " adena in order to proceed.");
+ }
+ else
+ {
+ if (dayOfWeek != Calendar.SATURDAY)
+ {
+ calendar.add(Calendar.DAY_OF_WEEK, -1);
+ }
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
+ calendar.set(Calendar.MINUTE, 1);
+ calendar.set(Calendar.SECOND, 0);
+ calendar.set(Calendar.MILLISECOND, 0);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ {
+ player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
+ GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
+ GlobalVariablesManager.getInstance().set(HALL_TIME_VAR + id, calendar.getTimeInMillis());
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(id);
+ if (clanHall != null)
+ {
+ clanHall.setOwner(player.getClan());
+ }
+ player.sendMessage("Congratulations! You now own a provisional clan hall!");
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ return null;
+ }
+ }
+ player.sendMessage("I am sorry, all halls have been taken.");
+ }
+ }
+ }
+ else if (event.equals("enter"))
+ {
+ final int playerClanId = player.getClanId();
+ for (Entry hall : CLAN_HALLS.entrySet())
+ {
+ if (playerClanId == GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + hall.getKey(), -1))
+ {
+ player.getVariables().set(HALL_RETURN_VAR, player.getX() + "," + player.getY() + "," + player.getZ() + "," + player.getHeading());
+ player.teleToLocation(hall.getValue());
+ return null;
+ }
+ }
+ htmltext = "33359-02.html";
+ }
+ else if (event.equals("leave"))
+ {
+ final String[] location = player.getVariables().getString(HALL_RETURN_VAR, "-112574,256057,-1449,-1").split(",");
+ player.teleToLocation(Integer.parseInt(location[0]), Integer.parseInt(location[1]), Integer.parseInt(location[2]), Integer.parseInt(location[3]));
+ }
+ else if (event.startsWith(HALL_RESET_VAR))
+ {
+ final String id = event.replace(HALL_RESET_VAR, "");
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ {
+ final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
+ if (clanId > 0)
+ {
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(Integer.parseInt(id));
+ if (clanHall != null)
+ {
+ clanHall.setOwner(null);
+ }
+ }
+ GlobalVariablesManager.getInstance().remove(HALL_TIME_VAR + id);
+ GlobalVariablesManager.getInstance().remove(HALL_OWNER_VAR + id);
+ }
+ }
+
+ return htmltext;
+ }
+
+ @Override
+ public String onFirstTalk(Npc npc, PlayerInstance player)
+ {
+ return npc.getId() + "-01.html";
+ }
+
+ public static void main(String[] args)
+ {
+ new ProvisionalHalls();
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/spawns/Others/ProvisionalClanHalls.xml b/L2J_Mobius_5.0_Salvation/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
new file mode 100644
index 0000000000..59c1750c2c
--- /dev/null
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/npcs/33300-33399.xml b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/npcs/33300-33399.xml
index 0377c0409c..1f75a8832b 100644
--- a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/npcs/33300-33399.xml
+++ b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/npcs/33300-33399.xml
@@ -1995,7 +1995,7 @@
+Expel an outsider
+Clan Hall function
+Clan Warehouse
+Manage Clan Hall
+See you later
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
new file mode 100644
index 0000000000..1b789e7c9a
--- /dev/null
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
@@ -0,0 +1,9 @@
+
+[Manage Clan Hall]
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
index 655b32f8c8..a55a147eb8 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
@@ -62,6 +62,7 @@ public class ClanHallManager extends AbstractNpcAI
36721, 36723, 36725, 36727, // Gludio Outskirts
36729, 36731, 36733, 36735, // Dion Outskirts
36737, 36739, // Floran Village
+ 33360, // Talking Island
};
// @formatter:on
// Misc
@@ -116,7 +117,21 @@ public class ClanHallManager extends AbstractNpcAI
{
case "index":
{
- htmltext = isOwningClan(player, npc) ? "ClanHallManager-01.html" : "ClanHallManager-03.html";
+ if (isOwningClan(player, npc))
+ {
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
+ {
+ htmltext = "ClanHallManager-01.html";
+ }
+ }
+ else
+ {
+ htmltext = "ClanHallManager-03.html";
+ }
break;
}
case "manageDoors":
@@ -255,7 +270,14 @@ public class ClanHallManager extends AbstractNpcAI
case 2:
case 3:
{
- ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(clanHall.getResidenceId() + "0" + (itemLevel - 1)));
+ }
+ else
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ }
break;
}
default:
@@ -287,7 +309,14 @@ public class ClanHallManager extends AbstractNpcAI
{
if (!st.hasMoreTokens())
{
- htmltext = "ClanHallManager-11.html";
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-11b.html";
+ }
+ else
+ {
+ htmltext = "ClanHallManager-11.html";
+ }
}
else
{
@@ -433,7 +462,11 @@ public class ClanHallManager extends AbstractNpcAI
final ClanHall clanHall = npc.getClanHall();
if (isOwningClan(player, npc))
{
- if (clanHall.getCostFailDay() == 0)
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
{
htmltext = "ClanHallManager-01.html";
}
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
new file mode 100644
index 0000000000..84a177d7d4
--- /dev/null
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
@@ -0,0 +1,13 @@
+
+Ah, hello!
+I am the Clan Hall Gatekeeper, Kerry. It's an honor to serve you.
+Do you need help with the Provisional Clan Hall?
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
new file mode 100644
index 0000000000..509b7ff9eb
--- /dev/null
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
@@ -0,0 +1,12 @@
+
+
+
+Participant,
+
+Aw, sorry, but you didn't win a Provisional Clan Hall.
+The auction takes place every 2 weeks,
+between 00:01 Saturday and 23:59 Sunday.
+
+
+Better luck at the next auction!
+
\ No newline at end of file
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
new file mode 100644
index 0000000000..33ec4e8c92
--- /dev/null
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
@@ -0,0 +1,6 @@
+
+The Provisional Clan Hall will cost you 50.000.000 adena, are you sure?
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
new file mode 100644
index 0000000000..2cb3848ff5
--- /dev/null
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -0,0 +1,199 @@
+/*
+ * 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 ai.others.ProvisionalHalls;
+
+import java.util.Calendar;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.l2jmobius.gameserver.data.xml.impl.ClanHallData;
+import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
+import org.l2jmobius.gameserver.model.Location;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
+import org.l2jmobius.gameserver.model.entity.ClanHall;
+
+import ai.AbstractNpcAI;
+
+/**
+ * Custom implementation for Provisional Clan Halls.
+ * @author Mobius
+ */
+public class ProvisionalHalls extends AbstractNpcAI
+{
+ // NPCs
+ private static final int KERRY = 33359;
+ private static final int MAID = 33360;
+ // Misc
+ private static final int HALL_PRICE = 50000000;
+ private static final long TWO_WEEKS = 1209600000;
+ private static final Map CLAN_HALLS = new LinkedHashMap<>();
+ static
+ {
+ CLAN_HALLS.put(187, new Location(-122200, -116552, -5798, 1779));
+ CLAN_HALLS.put(186, new Location(-122264, -122392, -5870, 15229));
+ CLAN_HALLS.put(188, new Location(-121864, -111240, -6014, 30268));
+ CLAN_HALLS.put(190, new Location(-117080, -116551, -5771, 1779));
+ CLAN_HALLS.put(189, new Location(-117000, -122052, -5845, 15229));
+ CLAN_HALLS.put(191, new Location(-117074, -111237, -5989, 30268));
+ CLAN_HALLS.put(193, new Location(-111717, -116550, -5773, 1779));
+ CLAN_HALLS.put(192, new Location(-111726, -122378, -5845, 15229));
+ CLAN_HALLS.put(194, new Location(-111158, -111230, -5989, 30268));
+ }
+ private static final String HALL_OWNER_VAR = "PCH_OWNER_";
+ private static final String HALL_TIME_VAR = "PCH_TIME_";
+ private static final String HALL_RESET_VAR = "PCH_RESET_";
+ private static final String HALL_RETURN_VAR = "PCH_RETURN";
+ private static final Object LOCK = new Object();
+
+ private ProvisionalHalls()
+ {
+ addStartNpc(KERRY);
+ addFirstTalkId(KERRY);
+ addTalkId(KERRY);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ final long resetTime = GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0);
+ if (resetTime > 0)
+ {
+ cancelQuestTimers(HALL_RESET_VAR + id);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ }
+ }
+ }
+
+ @Override
+ public String onAdvEvent(String event, Npc npc, PlayerInstance player)
+ {
+ if ((npc.getId() != KERRY) && (npc.getId() != MAID))
+ {
+ return null;
+ }
+
+ String htmltext = null;
+ if (event.equals("33359-01.html") || event.equals("33359-02.html") || event.equals("33359-03.html"))
+ {
+ htmltext = event;
+ }
+ else if (event.equals("buy"))
+ {
+ synchronized (LOCK)
+ {
+ final Calendar calendar = Calendar.getInstance();
+ final int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+ if ((player.getClan() == null) || (player.getClan().getLeaderId() != player.getObjectId()))
+ {
+ player.sendMessage("You need to be a clan leader in order to proceed.");
+ }
+ else if ((player.getClan().getHideoutId() > 0))
+ {
+ player.sendMessage("You already own a hideout.");
+ }
+ else if ((dayOfWeek != Calendar.SATURDAY) && (dayOfWeek != Calendar.SUNDAY))
+ {
+ htmltext = "33359-02.html";
+ }
+ else if (player.getAdena() < HALL_PRICE)
+ {
+ player.sendMessage("You need " + HALL_PRICE + " adena in order to proceed.");
+ }
+ else
+ {
+ if (dayOfWeek != Calendar.SATURDAY)
+ {
+ calendar.add(Calendar.DAY_OF_WEEK, -1);
+ }
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
+ calendar.set(Calendar.MINUTE, 1);
+ calendar.set(Calendar.SECOND, 0);
+ calendar.set(Calendar.MILLISECOND, 0);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ {
+ player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
+ GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
+ GlobalVariablesManager.getInstance().set(HALL_TIME_VAR + id, calendar.getTimeInMillis());
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(id);
+ if (clanHall != null)
+ {
+ clanHall.setOwner(player.getClan());
+ }
+ player.sendMessage("Congratulations! You now own a provisional clan hall!");
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ return null;
+ }
+ }
+ player.sendMessage("I am sorry, all halls have been taken.");
+ }
+ }
+ }
+ else if (event.equals("enter"))
+ {
+ final int playerClanId = player.getClanId();
+ for (Entry hall : CLAN_HALLS.entrySet())
+ {
+ if (playerClanId == GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + hall.getKey(), -1))
+ {
+ player.getVariables().set(HALL_RETURN_VAR, player.getX() + "," + player.getY() + "," + player.getZ() + "," + player.getHeading());
+ player.teleToLocation(hall.getValue());
+ return null;
+ }
+ }
+ htmltext = "33359-02.html";
+ }
+ else if (event.equals("leave"))
+ {
+ final String[] location = player.getVariables().getString(HALL_RETURN_VAR, "-112574,256057,-1449,-1").split(",");
+ player.teleToLocation(Integer.parseInt(location[0]), Integer.parseInt(location[1]), Integer.parseInt(location[2]), Integer.parseInt(location[3]));
+ }
+ else if (event.startsWith(HALL_RESET_VAR))
+ {
+ final String id = event.replace(HALL_RESET_VAR, "");
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ {
+ final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
+ if (clanId > 0)
+ {
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(Integer.parseInt(id));
+ if (clanHall != null)
+ {
+ clanHall.setOwner(null);
+ }
+ }
+ GlobalVariablesManager.getInstance().remove(HALL_TIME_VAR + id);
+ GlobalVariablesManager.getInstance().remove(HALL_OWNER_VAR + id);
+ }
+ }
+
+ return htmltext;
+ }
+
+ @Override
+ public String onFirstTalk(Npc npc, PlayerInstance player)
+ {
+ return npc.getId() + "-01.html";
+ }
+
+ public static void main(String[] args)
+ {
+ new ProvisionalHalls();
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/spawns/Others/ProvisionalClanHalls.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
new file mode 100644
index 0000000000..59c1750c2c
--- /dev/null
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/npcs/33300-33399.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/npcs/33300-33399.xml
index 0377c0409c..1f75a8832b 100644
--- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/npcs/33300-33399.xml
+++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/npcs/33300-33399.xml
@@ -1995,7 +1995,7 @@
+Expel an outsider
+Clan Hall function
+Clan Warehouse
+Manage Clan Hall
+See you later
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
new file mode 100644
index 0000000000..1b789e7c9a
--- /dev/null
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
@@ -0,0 +1,9 @@
+
+[Manage Clan Hall]
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
index 655b32f8c8..a55a147eb8 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
@@ -62,6 +62,7 @@ public class ClanHallManager extends AbstractNpcAI
36721, 36723, 36725, 36727, // Gludio Outskirts
36729, 36731, 36733, 36735, // Dion Outskirts
36737, 36739, // Floran Village
+ 33360, // Talking Island
};
// @formatter:on
// Misc
@@ -116,7 +117,21 @@ public class ClanHallManager extends AbstractNpcAI
{
case "index":
{
- htmltext = isOwningClan(player, npc) ? "ClanHallManager-01.html" : "ClanHallManager-03.html";
+ if (isOwningClan(player, npc))
+ {
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
+ {
+ htmltext = "ClanHallManager-01.html";
+ }
+ }
+ else
+ {
+ htmltext = "ClanHallManager-03.html";
+ }
break;
}
case "manageDoors":
@@ -255,7 +270,14 @@ public class ClanHallManager extends AbstractNpcAI
case 2:
case 3:
{
- ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(clanHall.getResidenceId() + "0" + (itemLevel - 1)));
+ }
+ else
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ }
break;
}
default:
@@ -287,7 +309,14 @@ public class ClanHallManager extends AbstractNpcAI
{
if (!st.hasMoreTokens())
{
- htmltext = "ClanHallManager-11.html";
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-11b.html";
+ }
+ else
+ {
+ htmltext = "ClanHallManager-11.html";
+ }
}
else
{
@@ -433,7 +462,11 @@ public class ClanHallManager extends AbstractNpcAI
final ClanHall clanHall = npc.getClanHall();
if (isOwningClan(player, npc))
{
- if (clanHall.getCostFailDay() == 0)
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
{
htmltext = "ClanHallManager-01.html";
}
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
new file mode 100644
index 0000000000..84a177d7d4
--- /dev/null
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
@@ -0,0 +1,13 @@
+
+Ah, hello!
+I am the Clan Hall Gatekeeper, Kerry. It's an honor to serve you.
+Do you need help with the Provisional Clan Hall?
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
new file mode 100644
index 0000000000..509b7ff9eb
--- /dev/null
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
@@ -0,0 +1,12 @@
+
+
+
+Participant,
+
+Aw, sorry, but you didn't win a Provisional Clan Hall.
+The auction takes place every 2 weeks,
+between 00:01 Saturday and 23:59 Sunday.
+
+
+Better luck at the next auction!
+
\ No newline at end of file
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
new file mode 100644
index 0000000000..33ec4e8c92
--- /dev/null
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
@@ -0,0 +1,6 @@
+
+The Provisional Clan Hall will cost you 50.000.000 adena, are you sure?
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
new file mode 100644
index 0000000000..2cb3848ff5
--- /dev/null
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -0,0 +1,199 @@
+/*
+ * 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 ai.others.ProvisionalHalls;
+
+import java.util.Calendar;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.l2jmobius.gameserver.data.xml.impl.ClanHallData;
+import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
+import org.l2jmobius.gameserver.model.Location;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
+import org.l2jmobius.gameserver.model.entity.ClanHall;
+
+import ai.AbstractNpcAI;
+
+/**
+ * Custom implementation for Provisional Clan Halls.
+ * @author Mobius
+ */
+public class ProvisionalHalls extends AbstractNpcAI
+{
+ // NPCs
+ private static final int KERRY = 33359;
+ private static final int MAID = 33360;
+ // Misc
+ private static final int HALL_PRICE = 50000000;
+ private static final long TWO_WEEKS = 1209600000;
+ private static final Map CLAN_HALLS = new LinkedHashMap<>();
+ static
+ {
+ CLAN_HALLS.put(187, new Location(-122200, -116552, -5798, 1779));
+ CLAN_HALLS.put(186, new Location(-122264, -122392, -5870, 15229));
+ CLAN_HALLS.put(188, new Location(-121864, -111240, -6014, 30268));
+ CLAN_HALLS.put(190, new Location(-117080, -116551, -5771, 1779));
+ CLAN_HALLS.put(189, new Location(-117000, -122052, -5845, 15229));
+ CLAN_HALLS.put(191, new Location(-117074, -111237, -5989, 30268));
+ CLAN_HALLS.put(193, new Location(-111717, -116550, -5773, 1779));
+ CLAN_HALLS.put(192, new Location(-111726, -122378, -5845, 15229));
+ CLAN_HALLS.put(194, new Location(-111158, -111230, -5989, 30268));
+ }
+ private static final String HALL_OWNER_VAR = "PCH_OWNER_";
+ private static final String HALL_TIME_VAR = "PCH_TIME_";
+ private static final String HALL_RESET_VAR = "PCH_RESET_";
+ private static final String HALL_RETURN_VAR = "PCH_RETURN";
+ private static final Object LOCK = new Object();
+
+ private ProvisionalHalls()
+ {
+ addStartNpc(KERRY);
+ addFirstTalkId(KERRY);
+ addTalkId(KERRY);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ final long resetTime = GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0);
+ if (resetTime > 0)
+ {
+ cancelQuestTimers(HALL_RESET_VAR + id);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ }
+ }
+ }
+
+ @Override
+ public String onAdvEvent(String event, Npc npc, PlayerInstance player)
+ {
+ if ((npc.getId() != KERRY) && (npc.getId() != MAID))
+ {
+ return null;
+ }
+
+ String htmltext = null;
+ if (event.equals("33359-01.html") || event.equals("33359-02.html") || event.equals("33359-03.html"))
+ {
+ htmltext = event;
+ }
+ else if (event.equals("buy"))
+ {
+ synchronized (LOCK)
+ {
+ final Calendar calendar = Calendar.getInstance();
+ final int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+ if ((player.getClan() == null) || (player.getClan().getLeaderId() != player.getObjectId()))
+ {
+ player.sendMessage("You need to be a clan leader in order to proceed.");
+ }
+ else if ((player.getClan().getHideoutId() > 0))
+ {
+ player.sendMessage("You already own a hideout.");
+ }
+ else if ((dayOfWeek != Calendar.SATURDAY) && (dayOfWeek != Calendar.SUNDAY))
+ {
+ htmltext = "33359-02.html";
+ }
+ else if (player.getAdena() < HALL_PRICE)
+ {
+ player.sendMessage("You need " + HALL_PRICE + " adena in order to proceed.");
+ }
+ else
+ {
+ if (dayOfWeek != Calendar.SATURDAY)
+ {
+ calendar.add(Calendar.DAY_OF_WEEK, -1);
+ }
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
+ calendar.set(Calendar.MINUTE, 1);
+ calendar.set(Calendar.SECOND, 0);
+ calendar.set(Calendar.MILLISECOND, 0);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ {
+ player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
+ GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
+ GlobalVariablesManager.getInstance().set(HALL_TIME_VAR + id, calendar.getTimeInMillis());
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(id);
+ if (clanHall != null)
+ {
+ clanHall.setOwner(player.getClan());
+ }
+ player.sendMessage("Congratulations! You now own a provisional clan hall!");
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ return null;
+ }
+ }
+ player.sendMessage("I am sorry, all halls have been taken.");
+ }
+ }
+ }
+ else if (event.equals("enter"))
+ {
+ final int playerClanId = player.getClanId();
+ for (Entry hall : CLAN_HALLS.entrySet())
+ {
+ if (playerClanId == GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + hall.getKey(), -1))
+ {
+ player.getVariables().set(HALL_RETURN_VAR, player.getX() + "," + player.getY() + "," + player.getZ() + "," + player.getHeading());
+ player.teleToLocation(hall.getValue());
+ return null;
+ }
+ }
+ htmltext = "33359-02.html";
+ }
+ else if (event.equals("leave"))
+ {
+ final String[] location = player.getVariables().getString(HALL_RETURN_VAR, "-112574,256057,-1449,-1").split(",");
+ player.teleToLocation(Integer.parseInt(location[0]), Integer.parseInt(location[1]), Integer.parseInt(location[2]), Integer.parseInt(location[3]));
+ }
+ else if (event.startsWith(HALL_RESET_VAR))
+ {
+ final String id = event.replace(HALL_RESET_VAR, "");
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ {
+ final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
+ if (clanId > 0)
+ {
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(Integer.parseInt(id));
+ if (clanHall != null)
+ {
+ clanHall.setOwner(null);
+ }
+ }
+ GlobalVariablesManager.getInstance().remove(HALL_TIME_VAR + id);
+ GlobalVariablesManager.getInstance().remove(HALL_OWNER_VAR + id);
+ }
+ }
+
+ return htmltext;
+ }
+
+ @Override
+ public String onFirstTalk(Npc npc, PlayerInstance player)
+ {
+ return npc.getId() + "-01.html";
+ }
+
+ public static void main(String[] args)
+ {
+ new ProvisionalHalls();
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/spawns/Others/ProvisionalClanHalls.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
new file mode 100644
index 0000000000..59c1750c2c
--- /dev/null
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/npcs/33300-33399.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/npcs/33300-33399.xml
index 0377c0409c..1f75a8832b 100644
--- a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/npcs/33300-33399.xml
+++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/npcs/33300-33399.xml
@@ -1995,7 +1995,7 @@
+Expel an outsider
+Clan Hall function
+Clan Warehouse
+Manage Clan Hall
+See you later
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
new file mode 100644
index 0000000000..1b789e7c9a
--- /dev/null
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
@@ -0,0 +1,9 @@
+
+[Manage Clan Hall]
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
index 655b32f8c8..a55a147eb8 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
@@ -62,6 +62,7 @@ public class ClanHallManager extends AbstractNpcAI
36721, 36723, 36725, 36727, // Gludio Outskirts
36729, 36731, 36733, 36735, // Dion Outskirts
36737, 36739, // Floran Village
+ 33360, // Talking Island
};
// @formatter:on
// Misc
@@ -116,7 +117,21 @@ public class ClanHallManager extends AbstractNpcAI
{
case "index":
{
- htmltext = isOwningClan(player, npc) ? "ClanHallManager-01.html" : "ClanHallManager-03.html";
+ if (isOwningClan(player, npc))
+ {
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
+ {
+ htmltext = "ClanHallManager-01.html";
+ }
+ }
+ else
+ {
+ htmltext = "ClanHallManager-03.html";
+ }
break;
}
case "manageDoors":
@@ -255,7 +270,14 @@ public class ClanHallManager extends AbstractNpcAI
case 2:
case 3:
{
- ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(clanHall.getResidenceId() + "0" + (itemLevel - 1)));
+ }
+ else
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ }
break;
}
default:
@@ -287,7 +309,14 @@ public class ClanHallManager extends AbstractNpcAI
{
if (!st.hasMoreTokens())
{
- htmltext = "ClanHallManager-11.html";
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-11b.html";
+ }
+ else
+ {
+ htmltext = "ClanHallManager-11.html";
+ }
}
else
{
@@ -433,7 +462,11 @@ public class ClanHallManager extends AbstractNpcAI
final ClanHall clanHall = npc.getClanHall();
if (isOwningClan(player, npc))
{
- if (clanHall.getCostFailDay() == 0)
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
{
htmltext = "ClanHallManager-01.html";
}
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
new file mode 100644
index 0000000000..84a177d7d4
--- /dev/null
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
@@ -0,0 +1,13 @@
+
+Ah, hello!
+I am the Clan Hall Gatekeeper, Kerry. It's an honor to serve you.
+Do you need help with the Provisional Clan Hall?
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
new file mode 100644
index 0000000000..509b7ff9eb
--- /dev/null
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
@@ -0,0 +1,12 @@
+
+
+
+Participant,
+
+Aw, sorry, but you didn't win a Provisional Clan Hall.
+The auction takes place every 2 weeks,
+between 00:01 Saturday and 23:59 Sunday.
+
+
+Better luck at the next auction!
+
\ No newline at end of file
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
new file mode 100644
index 0000000000..33ec4e8c92
--- /dev/null
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
@@ -0,0 +1,6 @@
+
+The Provisional Clan Hall will cost you 50.000.000 adena, are you sure?
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
new file mode 100644
index 0000000000..2cb3848ff5
--- /dev/null
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -0,0 +1,199 @@
+/*
+ * 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 ai.others.ProvisionalHalls;
+
+import java.util.Calendar;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.l2jmobius.gameserver.data.xml.impl.ClanHallData;
+import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
+import org.l2jmobius.gameserver.model.Location;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
+import org.l2jmobius.gameserver.model.entity.ClanHall;
+
+import ai.AbstractNpcAI;
+
+/**
+ * Custom implementation for Provisional Clan Halls.
+ * @author Mobius
+ */
+public class ProvisionalHalls extends AbstractNpcAI
+{
+ // NPCs
+ private static final int KERRY = 33359;
+ private static final int MAID = 33360;
+ // Misc
+ private static final int HALL_PRICE = 50000000;
+ private static final long TWO_WEEKS = 1209600000;
+ private static final Map CLAN_HALLS = new LinkedHashMap<>();
+ static
+ {
+ CLAN_HALLS.put(187, new Location(-122200, -116552, -5798, 1779));
+ CLAN_HALLS.put(186, new Location(-122264, -122392, -5870, 15229));
+ CLAN_HALLS.put(188, new Location(-121864, -111240, -6014, 30268));
+ CLAN_HALLS.put(190, new Location(-117080, -116551, -5771, 1779));
+ CLAN_HALLS.put(189, new Location(-117000, -122052, -5845, 15229));
+ CLAN_HALLS.put(191, new Location(-117074, -111237, -5989, 30268));
+ CLAN_HALLS.put(193, new Location(-111717, -116550, -5773, 1779));
+ CLAN_HALLS.put(192, new Location(-111726, -122378, -5845, 15229));
+ CLAN_HALLS.put(194, new Location(-111158, -111230, -5989, 30268));
+ }
+ private static final String HALL_OWNER_VAR = "PCH_OWNER_";
+ private static final String HALL_TIME_VAR = "PCH_TIME_";
+ private static final String HALL_RESET_VAR = "PCH_RESET_";
+ private static final String HALL_RETURN_VAR = "PCH_RETURN";
+ private static final Object LOCK = new Object();
+
+ private ProvisionalHalls()
+ {
+ addStartNpc(KERRY);
+ addFirstTalkId(KERRY);
+ addTalkId(KERRY);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ final long resetTime = GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0);
+ if (resetTime > 0)
+ {
+ cancelQuestTimers(HALL_RESET_VAR + id);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ }
+ }
+ }
+
+ @Override
+ public String onAdvEvent(String event, Npc npc, PlayerInstance player)
+ {
+ if ((npc.getId() != KERRY) && (npc.getId() != MAID))
+ {
+ return null;
+ }
+
+ String htmltext = null;
+ if (event.equals("33359-01.html") || event.equals("33359-02.html") || event.equals("33359-03.html"))
+ {
+ htmltext = event;
+ }
+ else if (event.equals("buy"))
+ {
+ synchronized (LOCK)
+ {
+ final Calendar calendar = Calendar.getInstance();
+ final int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+ if ((player.getClan() == null) || (player.getClan().getLeaderId() != player.getObjectId()))
+ {
+ player.sendMessage("You need to be a clan leader in order to proceed.");
+ }
+ else if ((player.getClan().getHideoutId() > 0))
+ {
+ player.sendMessage("You already own a hideout.");
+ }
+ else if ((dayOfWeek != Calendar.SATURDAY) && (dayOfWeek != Calendar.SUNDAY))
+ {
+ htmltext = "33359-02.html";
+ }
+ else if (player.getAdena() < HALL_PRICE)
+ {
+ player.sendMessage("You need " + HALL_PRICE + " adena in order to proceed.");
+ }
+ else
+ {
+ if (dayOfWeek != Calendar.SATURDAY)
+ {
+ calendar.add(Calendar.DAY_OF_WEEK, -1);
+ }
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
+ calendar.set(Calendar.MINUTE, 1);
+ calendar.set(Calendar.SECOND, 0);
+ calendar.set(Calendar.MILLISECOND, 0);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ {
+ player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
+ GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
+ GlobalVariablesManager.getInstance().set(HALL_TIME_VAR + id, calendar.getTimeInMillis());
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(id);
+ if (clanHall != null)
+ {
+ clanHall.setOwner(player.getClan());
+ }
+ player.sendMessage("Congratulations! You now own a provisional clan hall!");
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ return null;
+ }
+ }
+ player.sendMessage("I am sorry, all halls have been taken.");
+ }
+ }
+ }
+ else if (event.equals("enter"))
+ {
+ final int playerClanId = player.getClanId();
+ for (Entry hall : CLAN_HALLS.entrySet())
+ {
+ if (playerClanId == GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + hall.getKey(), -1))
+ {
+ player.getVariables().set(HALL_RETURN_VAR, player.getX() + "," + player.getY() + "," + player.getZ() + "," + player.getHeading());
+ player.teleToLocation(hall.getValue());
+ return null;
+ }
+ }
+ htmltext = "33359-02.html";
+ }
+ else if (event.equals("leave"))
+ {
+ final String[] location = player.getVariables().getString(HALL_RETURN_VAR, "-112574,256057,-1449,-1").split(",");
+ player.teleToLocation(Integer.parseInt(location[0]), Integer.parseInt(location[1]), Integer.parseInt(location[2]), Integer.parseInt(location[3]));
+ }
+ else if (event.startsWith(HALL_RESET_VAR))
+ {
+ final String id = event.replace(HALL_RESET_VAR, "");
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ {
+ final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
+ if (clanId > 0)
+ {
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(Integer.parseInt(id));
+ if (clanHall != null)
+ {
+ clanHall.setOwner(null);
+ }
+ }
+ GlobalVariablesManager.getInstance().remove(HALL_TIME_VAR + id);
+ GlobalVariablesManager.getInstance().remove(HALL_OWNER_VAR + id);
+ }
+ }
+
+ return htmltext;
+ }
+
+ @Override
+ public String onFirstTalk(Npc npc, PlayerInstance player)
+ {
+ return npc.getId() + "-01.html";
+ }
+
+ public static void main(String[] args)
+ {
+ new ProvisionalHalls();
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/spawns/Others/ProvisionalClanHalls.xml b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
new file mode 100644
index 0000000000..59c1750c2c
--- /dev/null
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/npcs/33300-33399.xml b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/npcs/33300-33399.xml
index 0377c0409c..1f75a8832b 100644
--- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/npcs/33300-33399.xml
+++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/npcs/33300-33399.xml
@@ -1995,7 +1995,7 @@
+Expel an outsider
+Clan Hall function
+Clan Warehouse
+Manage Clan Hall
+See you later
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
new file mode 100644
index 0000000000..1b789e7c9a
--- /dev/null
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
@@ -0,0 +1,9 @@
+
+[Manage Clan Hall]
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
index 833cfdd30b..31b529fae1 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
@@ -62,6 +62,7 @@ public class ClanHallManager extends AbstractNpcAI
36721, 36723, 36725, 36727, // Gludio Outskirts
36729, 36731, 36733, 36735, // Dion Outskirts
36737, 36739, // Floran Village
+ 33360, // Talking Island
};
// @formatter:on
// Misc
@@ -109,7 +110,21 @@ public class ClanHallManager extends AbstractNpcAI
{
case "index":
{
- htmltext = isOwningClan(player, npc) ? "ClanHallManager-01.html" : "ClanHallManager-03.html";
+ if (isOwningClan(player, npc))
+ {
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
+ {
+ htmltext = "ClanHallManager-01.html";
+ }
+ }
+ else
+ {
+ htmltext = "ClanHallManager-03.html";
+ }
break;
}
case "manageDoors":
@@ -248,7 +263,14 @@ public class ClanHallManager extends AbstractNpcAI
case 2:
case 3:
{
- ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(clanHall.getResidenceId() + "0" + (itemLevel - 1)));
+ }
+ else
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ }
break;
}
default:
@@ -280,7 +302,14 @@ public class ClanHallManager extends AbstractNpcAI
{
if (!st.hasMoreTokens())
{
- htmltext = "ClanHallManager-11.html";
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-11b.html";
+ }
+ else
+ {
+ htmltext = "ClanHallManager-11.html";
+ }
}
else
{
@@ -426,7 +455,11 @@ public class ClanHallManager extends AbstractNpcAI
final ClanHall clanHall = npc.getClanHall();
if (isOwningClan(player, npc))
{
- if (clanHall.getCostFailDay() == 0)
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
{
htmltext = "ClanHallManager-01.html";
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
new file mode 100644
index 0000000000..84a177d7d4
--- /dev/null
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
@@ -0,0 +1,13 @@
+
+Ah, hello!
+I am the Clan Hall Gatekeeper, Kerry. It's an honor to serve you.
+Do you need help with the Provisional Clan Hall?
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
new file mode 100644
index 0000000000..509b7ff9eb
--- /dev/null
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
@@ -0,0 +1,12 @@
+
+
+
+Participant,
+
+Aw, sorry, but you didn't win a Provisional Clan Hall.
+The auction takes place every 2 weeks,
+between 00:01 Saturday and 23:59 Sunday.
+
+
+Better luck at the next auction!
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
new file mode 100644
index 0000000000..33ec4e8c92
--- /dev/null
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
@@ -0,0 +1,6 @@
+
+The Provisional Clan Hall will cost you 50.000.000 adena, are you sure?
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
new file mode 100644
index 0000000000..ce896dd04d
--- /dev/null
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -0,0 +1,199 @@
+/*
+ * 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 ai.others.ProvisionalHalls;
+
+import java.util.Calendar;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.l2jmobius.gameserver.data.xml.impl.ClanHallData;
+import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
+import org.l2jmobius.gameserver.model.Location;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
+import org.l2jmobius.gameserver.model.entity.ClanHall;
+
+import ai.AbstractNpcAI;
+
+/**
+ * Custom implementation for Provisional Clan Halls.
+ * @author Mobius
+ */
+public class ProvisionalHalls extends AbstractNpcAI
+{
+ // NPCs
+ private static final int KERRY = 33359;
+ private static final int MAID = 33360;
+ // Misc
+ private static final int HALL_PRICE = 50000000;
+ private static final long TWO_WEEKS = 1209600000;
+ private static final Map CLAN_HALLS = new LinkedHashMap<>();
+ static
+ {
+ CLAN_HALLS.put(187, new Location(-122200, -116552, -5798, 1779));
+ CLAN_HALLS.put(186, new Location(-122264, -122392, -5870, 15229));
+ CLAN_HALLS.put(188, new Location(-121864, -111240, -6014, 30268));
+ CLAN_HALLS.put(190, new Location(-117080, -116551, -5771, 1779));
+ CLAN_HALLS.put(189, new Location(-117000, -122052, -5845, 15229));
+ CLAN_HALLS.put(191, new Location(-117074, -111237, -5989, 30268));
+ CLAN_HALLS.put(193, new Location(-111717, -116550, -5773, 1779));
+ CLAN_HALLS.put(192, new Location(-111726, -122378, -5845, 15229));
+ CLAN_HALLS.put(194, new Location(-111158, -111230, -5989, 30268));
+ }
+ private static final String HALL_OWNER_VAR = "PCH_OWNER_";
+ private static final String HALL_TIME_VAR = "PCH_TIME_";
+ private static final String HALL_RESET_VAR = "PCH_RESET_";
+ private static final String HALL_RETURN_VAR = "PCH_RETURN";
+ private static final Object LOCK = new Object();
+
+ private ProvisionalHalls()
+ {
+ addStartNpc(KERRY);
+ addFirstTalkId(KERRY);
+ addTalkId(KERRY);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ final long resetTime = GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0);
+ if (resetTime > 0)
+ {
+ cancelQuestTimers(HALL_RESET_VAR + id);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ }
+ }
+ }
+
+ @Override
+ public String onAdvEvent(String event, Npc npc, PlayerInstance player)
+ {
+ if ((npc.getId() != KERRY) && (npc.getId() != MAID))
+ {
+ return null;
+ }
+
+ String htmltext = null;
+ if (event.equals("33359-01.html") || event.equals("33359-02.html") || event.equals("33359-03.html"))
+ {
+ htmltext = event;
+ }
+ else if (event.equals("buy"))
+ {
+ synchronized (LOCK)
+ {
+ final Calendar calendar = Calendar.getInstance();
+ final int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+ if ((player.getClan() == null) || (player.getClan().getLeaderId() != player.getObjectId()))
+ {
+ player.sendMessage("You need to be a clan leader in order to proceed.");
+ }
+ else if ((player.getClan().getHideoutId() > 0))
+ {
+ player.sendMessage("You already own a hideout.");
+ }
+ else if ((dayOfWeek != Calendar.SATURDAY) && (dayOfWeek != Calendar.SUNDAY))
+ {
+ htmltext = "33359-02.html";
+ }
+ else if (player.getAdena() < HALL_PRICE)
+ {
+ player.sendMessage("You need " + HALL_PRICE + " adena in order to proceed.");
+ }
+ else
+ {
+ if (dayOfWeek != Calendar.SATURDAY)
+ {
+ calendar.add(Calendar.DAY_OF_WEEK, -1);
+ }
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
+ calendar.set(Calendar.MINUTE, 1);
+ calendar.set(Calendar.SECOND, 0);
+ calendar.set(Calendar.MILLISECOND, 0);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ {
+ player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
+ GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
+ GlobalVariablesManager.getInstance().set(HALL_TIME_VAR + id, calendar.getTimeInMillis());
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(id);
+ if (clanHall != null)
+ {
+ clanHall.setOwner(player.getClan());
+ }
+ player.sendMessage("Congratulations! You now own a provisional clan hall!");
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ return null;
+ }
+ }
+ player.sendMessage("I am sorry, all halls have been taken.");
+ }
+ }
+ }
+ else if (event.equals("enter"))
+ {
+ final int playerClanId = player.getClanId();
+ for (Entry hall : CLAN_HALLS.entrySet())
+ {
+ if (playerClanId == GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + hall.getKey(), -1))
+ {
+ player.getVariables().set(HALL_RETURN_VAR, player.getX() + "," + player.getY() + "," + player.getZ() + "," + player.getHeading());
+ player.teleToLocation(hall.getValue());
+ return null;
+ }
+ }
+ htmltext = "33359-02.html";
+ }
+ else if (event.equals("leave"))
+ {
+ final String[] location = player.getVariables().getString(HALL_RETURN_VAR, "-83246,242118,-3730,-1").split(",");
+ player.teleToLocation(Integer.parseInt(location[0]), Integer.parseInt(location[1]), Integer.parseInt(location[2]), Integer.parseInt(location[3]));
+ }
+ else if (event.startsWith(HALL_RESET_VAR))
+ {
+ final String id = event.replace(HALL_RESET_VAR, "");
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ {
+ final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
+ if (clanId > 0)
+ {
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(Integer.parseInt(id));
+ if (clanHall != null)
+ {
+ clanHall.setOwner(null);
+ }
+ }
+ GlobalVariablesManager.getInstance().remove(HALL_TIME_VAR + id);
+ GlobalVariablesManager.getInstance().remove(HALL_OWNER_VAR + id);
+ }
+ }
+
+ return htmltext;
+ }
+
+ @Override
+ public String onFirstTalk(Npc npc, PlayerInstance player)
+ {
+ return npc.getId() + "-01.html";
+ }
+
+ public static void main(String[] args)
+ {
+ new ProvisionalHalls();
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/spawns/Others/ProvisionalClanHalls.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
new file mode 100644
index 0000000000..59c1750c2c
--- /dev/null
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/npcs/33300-33399.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/npcs/33300-33399.xml
index ac447ec5ff..20b2b3601c 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/npcs/33300-33399.xml
+++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/npcs/33300-33399.xml
@@ -29,7 +29,7 @@
+Expel an outsider
+Clan Hall function
+Clan Warehouse
+Manage Clan Hall
+See you later
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
new file mode 100644
index 0000000000..1b789e7c9a
--- /dev/null
+++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
@@ -0,0 +1,9 @@
+
+[Manage Clan Hall]
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
index 833cfdd30b..31b529fae1 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
@@ -62,6 +62,7 @@ public class ClanHallManager extends AbstractNpcAI
36721, 36723, 36725, 36727, // Gludio Outskirts
36729, 36731, 36733, 36735, // Dion Outskirts
36737, 36739, // Floran Village
+ 33360, // Talking Island
};
// @formatter:on
// Misc
@@ -109,7 +110,21 @@ public class ClanHallManager extends AbstractNpcAI
{
case "index":
{
- htmltext = isOwningClan(player, npc) ? "ClanHallManager-01.html" : "ClanHallManager-03.html";
+ if (isOwningClan(player, npc))
+ {
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
+ {
+ htmltext = "ClanHallManager-01.html";
+ }
+ }
+ else
+ {
+ htmltext = "ClanHallManager-03.html";
+ }
break;
}
case "manageDoors":
@@ -248,7 +263,14 @@ public class ClanHallManager extends AbstractNpcAI
case 2:
case 3:
{
- ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(clanHall.getResidenceId() + "0" + (itemLevel - 1)));
+ }
+ else
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ }
break;
}
default:
@@ -280,7 +302,14 @@ public class ClanHallManager extends AbstractNpcAI
{
if (!st.hasMoreTokens())
{
- htmltext = "ClanHallManager-11.html";
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-11b.html";
+ }
+ else
+ {
+ htmltext = "ClanHallManager-11.html";
+ }
}
else
{
@@ -426,7 +455,11 @@ public class ClanHallManager extends AbstractNpcAI
final ClanHall clanHall = npc.getClanHall();
if (isOwningClan(player, npc))
{
- if (clanHall.getCostFailDay() == 0)
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
{
htmltext = "ClanHallManager-01.html";
}
diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
new file mode 100644
index 0000000000..84a177d7d4
--- /dev/null
+++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
@@ -0,0 +1,13 @@
+
+Ah, hello!
+I am the Clan Hall Gatekeeper, Kerry. It's an honor to serve you.
+Do you need help with the Provisional Clan Hall?
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
new file mode 100644
index 0000000000..509b7ff9eb
--- /dev/null
+++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
@@ -0,0 +1,12 @@
+
+
+
+Participant,
+
+Aw, sorry, but you didn't win a Provisional Clan Hall.
+The auction takes place every 2 weeks,
+between 00:01 Saturday and 23:59 Sunday.
+
+
+Better luck at the next auction!
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
new file mode 100644
index 0000000000..33ec4e8c92
--- /dev/null
+++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
@@ -0,0 +1,6 @@
+
+The Provisional Clan Hall will cost you 50.000.000 adena, are you sure?
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
new file mode 100644
index 0000000000..ce896dd04d
--- /dev/null
+++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -0,0 +1,199 @@
+/*
+ * 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 ai.others.ProvisionalHalls;
+
+import java.util.Calendar;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.l2jmobius.gameserver.data.xml.impl.ClanHallData;
+import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
+import org.l2jmobius.gameserver.model.Location;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
+import org.l2jmobius.gameserver.model.entity.ClanHall;
+
+import ai.AbstractNpcAI;
+
+/**
+ * Custom implementation for Provisional Clan Halls.
+ * @author Mobius
+ */
+public class ProvisionalHalls extends AbstractNpcAI
+{
+ // NPCs
+ private static final int KERRY = 33359;
+ private static final int MAID = 33360;
+ // Misc
+ private static final int HALL_PRICE = 50000000;
+ private static final long TWO_WEEKS = 1209600000;
+ private static final Map CLAN_HALLS = new LinkedHashMap<>();
+ static
+ {
+ CLAN_HALLS.put(187, new Location(-122200, -116552, -5798, 1779));
+ CLAN_HALLS.put(186, new Location(-122264, -122392, -5870, 15229));
+ CLAN_HALLS.put(188, new Location(-121864, -111240, -6014, 30268));
+ CLAN_HALLS.put(190, new Location(-117080, -116551, -5771, 1779));
+ CLAN_HALLS.put(189, new Location(-117000, -122052, -5845, 15229));
+ CLAN_HALLS.put(191, new Location(-117074, -111237, -5989, 30268));
+ CLAN_HALLS.put(193, new Location(-111717, -116550, -5773, 1779));
+ CLAN_HALLS.put(192, new Location(-111726, -122378, -5845, 15229));
+ CLAN_HALLS.put(194, new Location(-111158, -111230, -5989, 30268));
+ }
+ private static final String HALL_OWNER_VAR = "PCH_OWNER_";
+ private static final String HALL_TIME_VAR = "PCH_TIME_";
+ private static final String HALL_RESET_VAR = "PCH_RESET_";
+ private static final String HALL_RETURN_VAR = "PCH_RETURN";
+ private static final Object LOCK = new Object();
+
+ private ProvisionalHalls()
+ {
+ addStartNpc(KERRY);
+ addFirstTalkId(KERRY);
+ addTalkId(KERRY);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ final long resetTime = GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0);
+ if (resetTime > 0)
+ {
+ cancelQuestTimers(HALL_RESET_VAR + id);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ }
+ }
+ }
+
+ @Override
+ public String onAdvEvent(String event, Npc npc, PlayerInstance player)
+ {
+ if ((npc.getId() != KERRY) && (npc.getId() != MAID))
+ {
+ return null;
+ }
+
+ String htmltext = null;
+ if (event.equals("33359-01.html") || event.equals("33359-02.html") || event.equals("33359-03.html"))
+ {
+ htmltext = event;
+ }
+ else if (event.equals("buy"))
+ {
+ synchronized (LOCK)
+ {
+ final Calendar calendar = Calendar.getInstance();
+ final int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+ if ((player.getClan() == null) || (player.getClan().getLeaderId() != player.getObjectId()))
+ {
+ player.sendMessage("You need to be a clan leader in order to proceed.");
+ }
+ else if ((player.getClan().getHideoutId() > 0))
+ {
+ player.sendMessage("You already own a hideout.");
+ }
+ else if ((dayOfWeek != Calendar.SATURDAY) && (dayOfWeek != Calendar.SUNDAY))
+ {
+ htmltext = "33359-02.html";
+ }
+ else if (player.getAdena() < HALL_PRICE)
+ {
+ player.sendMessage("You need " + HALL_PRICE + " adena in order to proceed.");
+ }
+ else
+ {
+ if (dayOfWeek != Calendar.SATURDAY)
+ {
+ calendar.add(Calendar.DAY_OF_WEEK, -1);
+ }
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
+ calendar.set(Calendar.MINUTE, 1);
+ calendar.set(Calendar.SECOND, 0);
+ calendar.set(Calendar.MILLISECOND, 0);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ {
+ player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
+ GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
+ GlobalVariablesManager.getInstance().set(HALL_TIME_VAR + id, calendar.getTimeInMillis());
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(id);
+ if (clanHall != null)
+ {
+ clanHall.setOwner(player.getClan());
+ }
+ player.sendMessage("Congratulations! You now own a provisional clan hall!");
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ return null;
+ }
+ }
+ player.sendMessage("I am sorry, all halls have been taken.");
+ }
+ }
+ }
+ else if (event.equals("enter"))
+ {
+ final int playerClanId = player.getClanId();
+ for (Entry hall : CLAN_HALLS.entrySet())
+ {
+ if (playerClanId == GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + hall.getKey(), -1))
+ {
+ player.getVariables().set(HALL_RETURN_VAR, player.getX() + "," + player.getY() + "," + player.getZ() + "," + player.getHeading());
+ player.teleToLocation(hall.getValue());
+ return null;
+ }
+ }
+ htmltext = "33359-02.html";
+ }
+ else if (event.equals("leave"))
+ {
+ final String[] location = player.getVariables().getString(HALL_RETURN_VAR, "-83246,242118,-3730,-1").split(",");
+ player.teleToLocation(Integer.parseInt(location[0]), Integer.parseInt(location[1]), Integer.parseInt(location[2]), Integer.parseInt(location[3]));
+ }
+ else if (event.startsWith(HALL_RESET_VAR))
+ {
+ final String id = event.replace(HALL_RESET_VAR, "");
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ {
+ final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
+ if (clanId > 0)
+ {
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(Integer.parseInt(id));
+ if (clanHall != null)
+ {
+ clanHall.setOwner(null);
+ }
+ }
+ GlobalVariablesManager.getInstance().remove(HALL_TIME_VAR + id);
+ GlobalVariablesManager.getInstance().remove(HALL_OWNER_VAR + id);
+ }
+ }
+
+ return htmltext;
+ }
+
+ @Override
+ public String onFirstTalk(Npc npc, PlayerInstance player)
+ {
+ return npc.getId() + "-01.html";
+ }
+
+ public static void main(String[] args)
+ {
+ new ProvisionalHalls();
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/spawns/Others/ProvisionalClanHalls.xml b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
new file mode 100644
index 0000000000..59c1750c2c
--- /dev/null
+++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/npcs/33300-33399.xml b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/npcs/33300-33399.xml
index ac447ec5ff..20b2b3601c 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/npcs/33300-33399.xml
+++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/npcs/33300-33399.xml
@@ -29,7 +29,7 @@
+Expel an outsider
+Clan Hall function
+Clan Warehouse
+Manage Clan Hall
+See you later
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
new file mode 100644
index 0000000000..1b789e7c9a
--- /dev/null
+++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
@@ -0,0 +1,9 @@
+
+[Manage Clan Hall]
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
index 833cfdd30b..31b529fae1 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
@@ -62,6 +62,7 @@ public class ClanHallManager extends AbstractNpcAI
36721, 36723, 36725, 36727, // Gludio Outskirts
36729, 36731, 36733, 36735, // Dion Outskirts
36737, 36739, // Floran Village
+ 33360, // Talking Island
};
// @formatter:on
// Misc
@@ -109,7 +110,21 @@ public class ClanHallManager extends AbstractNpcAI
{
case "index":
{
- htmltext = isOwningClan(player, npc) ? "ClanHallManager-01.html" : "ClanHallManager-03.html";
+ if (isOwningClan(player, npc))
+ {
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
+ {
+ htmltext = "ClanHallManager-01.html";
+ }
+ }
+ else
+ {
+ htmltext = "ClanHallManager-03.html";
+ }
break;
}
case "manageDoors":
@@ -248,7 +263,14 @@ public class ClanHallManager extends AbstractNpcAI
case 2:
case 3:
{
- ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(clanHall.getResidenceId() + "0" + (itemLevel - 1)));
+ }
+ else
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ }
break;
}
default:
@@ -280,7 +302,14 @@ public class ClanHallManager extends AbstractNpcAI
{
if (!st.hasMoreTokens())
{
- htmltext = "ClanHallManager-11.html";
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-11b.html";
+ }
+ else
+ {
+ htmltext = "ClanHallManager-11.html";
+ }
}
else
{
@@ -426,7 +455,11 @@ public class ClanHallManager extends AbstractNpcAI
final ClanHall clanHall = npc.getClanHall();
if (isOwningClan(player, npc))
{
- if (clanHall.getCostFailDay() == 0)
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
{
htmltext = "ClanHallManager-01.html";
}
diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
new file mode 100644
index 0000000000..84a177d7d4
--- /dev/null
+++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
@@ -0,0 +1,13 @@
+
+Ah, hello!
+I am the Clan Hall Gatekeeper, Kerry. It's an honor to serve you.
+Do you need help with the Provisional Clan Hall?
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
new file mode 100644
index 0000000000..509b7ff9eb
--- /dev/null
+++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
@@ -0,0 +1,12 @@
+
+
+
+Participant,
+
+Aw, sorry, but you didn't win a Provisional Clan Hall.
+The auction takes place every 2 weeks,
+between 00:01 Saturday and 23:59 Sunday.
+
+
+Better luck at the next auction!
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
new file mode 100644
index 0000000000..33ec4e8c92
--- /dev/null
+++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
@@ -0,0 +1,6 @@
+
+The Provisional Clan Hall will cost you 50.000.000 adena, are you sure?
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
new file mode 100644
index 0000000000..ce896dd04d
--- /dev/null
+++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -0,0 +1,199 @@
+/*
+ * 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 ai.others.ProvisionalHalls;
+
+import java.util.Calendar;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.l2jmobius.gameserver.data.xml.impl.ClanHallData;
+import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
+import org.l2jmobius.gameserver.model.Location;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
+import org.l2jmobius.gameserver.model.entity.ClanHall;
+
+import ai.AbstractNpcAI;
+
+/**
+ * Custom implementation for Provisional Clan Halls.
+ * @author Mobius
+ */
+public class ProvisionalHalls extends AbstractNpcAI
+{
+ // NPCs
+ private static final int KERRY = 33359;
+ private static final int MAID = 33360;
+ // Misc
+ private static final int HALL_PRICE = 50000000;
+ private static final long TWO_WEEKS = 1209600000;
+ private static final Map CLAN_HALLS = new LinkedHashMap<>();
+ static
+ {
+ CLAN_HALLS.put(187, new Location(-122200, -116552, -5798, 1779));
+ CLAN_HALLS.put(186, new Location(-122264, -122392, -5870, 15229));
+ CLAN_HALLS.put(188, new Location(-121864, -111240, -6014, 30268));
+ CLAN_HALLS.put(190, new Location(-117080, -116551, -5771, 1779));
+ CLAN_HALLS.put(189, new Location(-117000, -122052, -5845, 15229));
+ CLAN_HALLS.put(191, new Location(-117074, -111237, -5989, 30268));
+ CLAN_HALLS.put(193, new Location(-111717, -116550, -5773, 1779));
+ CLAN_HALLS.put(192, new Location(-111726, -122378, -5845, 15229));
+ CLAN_HALLS.put(194, new Location(-111158, -111230, -5989, 30268));
+ }
+ private static final String HALL_OWNER_VAR = "PCH_OWNER_";
+ private static final String HALL_TIME_VAR = "PCH_TIME_";
+ private static final String HALL_RESET_VAR = "PCH_RESET_";
+ private static final String HALL_RETURN_VAR = "PCH_RETURN";
+ private static final Object LOCK = new Object();
+
+ private ProvisionalHalls()
+ {
+ addStartNpc(KERRY);
+ addFirstTalkId(KERRY);
+ addTalkId(KERRY);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ final long resetTime = GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0);
+ if (resetTime > 0)
+ {
+ cancelQuestTimers(HALL_RESET_VAR + id);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ }
+ }
+ }
+
+ @Override
+ public String onAdvEvent(String event, Npc npc, PlayerInstance player)
+ {
+ if ((npc.getId() != KERRY) && (npc.getId() != MAID))
+ {
+ return null;
+ }
+
+ String htmltext = null;
+ if (event.equals("33359-01.html") || event.equals("33359-02.html") || event.equals("33359-03.html"))
+ {
+ htmltext = event;
+ }
+ else if (event.equals("buy"))
+ {
+ synchronized (LOCK)
+ {
+ final Calendar calendar = Calendar.getInstance();
+ final int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+ if ((player.getClan() == null) || (player.getClan().getLeaderId() != player.getObjectId()))
+ {
+ player.sendMessage("You need to be a clan leader in order to proceed.");
+ }
+ else if ((player.getClan().getHideoutId() > 0))
+ {
+ player.sendMessage("You already own a hideout.");
+ }
+ else if ((dayOfWeek != Calendar.SATURDAY) && (dayOfWeek != Calendar.SUNDAY))
+ {
+ htmltext = "33359-02.html";
+ }
+ else if (player.getAdena() < HALL_PRICE)
+ {
+ player.sendMessage("You need " + HALL_PRICE + " adena in order to proceed.");
+ }
+ else
+ {
+ if (dayOfWeek != Calendar.SATURDAY)
+ {
+ calendar.add(Calendar.DAY_OF_WEEK, -1);
+ }
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
+ calendar.set(Calendar.MINUTE, 1);
+ calendar.set(Calendar.SECOND, 0);
+ calendar.set(Calendar.MILLISECOND, 0);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ {
+ player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
+ GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
+ GlobalVariablesManager.getInstance().set(HALL_TIME_VAR + id, calendar.getTimeInMillis());
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(id);
+ if (clanHall != null)
+ {
+ clanHall.setOwner(player.getClan());
+ }
+ player.sendMessage("Congratulations! You now own a provisional clan hall!");
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ return null;
+ }
+ }
+ player.sendMessage("I am sorry, all halls have been taken.");
+ }
+ }
+ }
+ else if (event.equals("enter"))
+ {
+ final int playerClanId = player.getClanId();
+ for (Entry hall : CLAN_HALLS.entrySet())
+ {
+ if (playerClanId == GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + hall.getKey(), -1))
+ {
+ player.getVariables().set(HALL_RETURN_VAR, player.getX() + "," + player.getY() + "," + player.getZ() + "," + player.getHeading());
+ player.teleToLocation(hall.getValue());
+ return null;
+ }
+ }
+ htmltext = "33359-02.html";
+ }
+ else if (event.equals("leave"))
+ {
+ final String[] location = player.getVariables().getString(HALL_RETURN_VAR, "-83246,242118,-3730,-1").split(",");
+ player.teleToLocation(Integer.parseInt(location[0]), Integer.parseInt(location[1]), Integer.parseInt(location[2]), Integer.parseInt(location[3]));
+ }
+ else if (event.startsWith(HALL_RESET_VAR))
+ {
+ final String id = event.replace(HALL_RESET_VAR, "");
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ {
+ final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
+ if (clanId > 0)
+ {
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(Integer.parseInt(id));
+ if (clanHall != null)
+ {
+ clanHall.setOwner(null);
+ }
+ }
+ GlobalVariablesManager.getInstance().remove(HALL_TIME_VAR + id);
+ GlobalVariablesManager.getInstance().remove(HALL_OWNER_VAR + id);
+ }
+ }
+
+ return htmltext;
+ }
+
+ @Override
+ public String onFirstTalk(Npc npc, PlayerInstance player)
+ {
+ return npc.getId() + "-01.html";
+ }
+
+ public static void main(String[] args)
+ {
+ new ProvisionalHalls();
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/spawns/Others/ProvisionalClanHalls.xml b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
new file mode 100644
index 0000000000..59c1750c2c
--- /dev/null
+++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/npcs/33300-33399.xml b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/npcs/33300-33399.xml
index ac447ec5ff..20b2b3601c 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/npcs/33300-33399.xml
+++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/npcs/33300-33399.xml
@@ -29,7 +29,7 @@
+Expel an outsider
+Clan Hall function
+Clan Warehouse
+Manage Clan Hall
+See you later
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
new file mode 100644
index 0000000000..1b789e7c9a
--- /dev/null
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
@@ -0,0 +1,9 @@
+
+[Manage Clan Hall]
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
index 7d23c341e6..157b7170bb 100644
--- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
@@ -62,6 +62,7 @@ public class ClanHallManager extends AbstractNpcAI
36721, 36723, 36725, 36727, // Gludio Outskirts
36729, 36731, 36733, 36735, // Dion Outskirts
36737, 36739, // Floran Village
+ 33360, // Talking Island
};
// @formatter:on
// Misc
@@ -109,7 +110,21 @@ public class ClanHallManager extends AbstractNpcAI
{
case "index":
{
- htmltext = isOwningClan(player, npc) ? "ClanHallManager-01.html" : "ClanHallManager-03.html";
+ if (isOwningClan(player, npc))
+ {
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
+ {
+ htmltext = "ClanHallManager-01.html";
+ }
+ }
+ else
+ {
+ htmltext = "ClanHallManager-03.html";
+ }
break;
}
case "manageDoors":
@@ -248,7 +263,14 @@ public class ClanHallManager extends AbstractNpcAI
case 2:
case 3:
{
- ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(clanHall.getResidenceId() + "0" + (itemLevel - 1)));
+ }
+ else
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ }
break;
}
default:
@@ -280,7 +302,14 @@ public class ClanHallManager extends AbstractNpcAI
{
if (!st.hasMoreTokens())
{
- htmltext = "ClanHallManager-11.html";
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-11b.html";
+ }
+ else
+ {
+ htmltext = "ClanHallManager-11.html";
+ }
}
else
{
@@ -426,7 +455,11 @@ public class ClanHallManager extends AbstractNpcAI
final ClanHall clanHall = npc.getClanHall();
if (isOwningClan(player, npc))
{
- if (clanHall.getCostFailDay() == 0)
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
{
htmltext = "ClanHallManager-01.html";
}
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
new file mode 100644
index 0000000000..84a177d7d4
--- /dev/null
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
@@ -0,0 +1,13 @@
+
+Ah, hello!
+I am the Clan Hall Gatekeeper, Kerry. It's an honor to serve you.
+Do you need help with the Provisional Clan Hall?
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
new file mode 100644
index 0000000000..509b7ff9eb
--- /dev/null
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
@@ -0,0 +1,12 @@
+
+
+
+Participant,
+
+Aw, sorry, but you didn't win a Provisional Clan Hall.
+The auction takes place every 2 weeks,
+between 00:01 Saturday and 23:59 Sunday.
+
+
+Better luck at the next auction!
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
new file mode 100644
index 0000000000..33ec4e8c92
--- /dev/null
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
@@ -0,0 +1,6 @@
+
+The Provisional Clan Hall will cost you 50.000.000 adena, are you sure?
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
new file mode 100644
index 0000000000..ce896dd04d
--- /dev/null
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -0,0 +1,199 @@
+/*
+ * 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 ai.others.ProvisionalHalls;
+
+import java.util.Calendar;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.l2jmobius.gameserver.data.xml.impl.ClanHallData;
+import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
+import org.l2jmobius.gameserver.model.Location;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
+import org.l2jmobius.gameserver.model.entity.ClanHall;
+
+import ai.AbstractNpcAI;
+
+/**
+ * Custom implementation for Provisional Clan Halls.
+ * @author Mobius
+ */
+public class ProvisionalHalls extends AbstractNpcAI
+{
+ // NPCs
+ private static final int KERRY = 33359;
+ private static final int MAID = 33360;
+ // Misc
+ private static final int HALL_PRICE = 50000000;
+ private static final long TWO_WEEKS = 1209600000;
+ private static final Map CLAN_HALLS = new LinkedHashMap<>();
+ static
+ {
+ CLAN_HALLS.put(187, new Location(-122200, -116552, -5798, 1779));
+ CLAN_HALLS.put(186, new Location(-122264, -122392, -5870, 15229));
+ CLAN_HALLS.put(188, new Location(-121864, -111240, -6014, 30268));
+ CLAN_HALLS.put(190, new Location(-117080, -116551, -5771, 1779));
+ CLAN_HALLS.put(189, new Location(-117000, -122052, -5845, 15229));
+ CLAN_HALLS.put(191, new Location(-117074, -111237, -5989, 30268));
+ CLAN_HALLS.put(193, new Location(-111717, -116550, -5773, 1779));
+ CLAN_HALLS.put(192, new Location(-111726, -122378, -5845, 15229));
+ CLAN_HALLS.put(194, new Location(-111158, -111230, -5989, 30268));
+ }
+ private static final String HALL_OWNER_VAR = "PCH_OWNER_";
+ private static final String HALL_TIME_VAR = "PCH_TIME_";
+ private static final String HALL_RESET_VAR = "PCH_RESET_";
+ private static final String HALL_RETURN_VAR = "PCH_RETURN";
+ private static final Object LOCK = new Object();
+
+ private ProvisionalHalls()
+ {
+ addStartNpc(KERRY);
+ addFirstTalkId(KERRY);
+ addTalkId(KERRY);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ final long resetTime = GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0);
+ if (resetTime > 0)
+ {
+ cancelQuestTimers(HALL_RESET_VAR + id);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ }
+ }
+ }
+
+ @Override
+ public String onAdvEvent(String event, Npc npc, PlayerInstance player)
+ {
+ if ((npc.getId() != KERRY) && (npc.getId() != MAID))
+ {
+ return null;
+ }
+
+ String htmltext = null;
+ if (event.equals("33359-01.html") || event.equals("33359-02.html") || event.equals("33359-03.html"))
+ {
+ htmltext = event;
+ }
+ else if (event.equals("buy"))
+ {
+ synchronized (LOCK)
+ {
+ final Calendar calendar = Calendar.getInstance();
+ final int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+ if ((player.getClan() == null) || (player.getClan().getLeaderId() != player.getObjectId()))
+ {
+ player.sendMessage("You need to be a clan leader in order to proceed.");
+ }
+ else if ((player.getClan().getHideoutId() > 0))
+ {
+ player.sendMessage("You already own a hideout.");
+ }
+ else if ((dayOfWeek != Calendar.SATURDAY) && (dayOfWeek != Calendar.SUNDAY))
+ {
+ htmltext = "33359-02.html";
+ }
+ else if (player.getAdena() < HALL_PRICE)
+ {
+ player.sendMessage("You need " + HALL_PRICE + " adena in order to proceed.");
+ }
+ else
+ {
+ if (dayOfWeek != Calendar.SATURDAY)
+ {
+ calendar.add(Calendar.DAY_OF_WEEK, -1);
+ }
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
+ calendar.set(Calendar.MINUTE, 1);
+ calendar.set(Calendar.SECOND, 0);
+ calendar.set(Calendar.MILLISECOND, 0);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ {
+ player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
+ GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
+ GlobalVariablesManager.getInstance().set(HALL_TIME_VAR + id, calendar.getTimeInMillis());
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(id);
+ if (clanHall != null)
+ {
+ clanHall.setOwner(player.getClan());
+ }
+ player.sendMessage("Congratulations! You now own a provisional clan hall!");
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ return null;
+ }
+ }
+ player.sendMessage("I am sorry, all halls have been taken.");
+ }
+ }
+ }
+ else if (event.equals("enter"))
+ {
+ final int playerClanId = player.getClanId();
+ for (Entry hall : CLAN_HALLS.entrySet())
+ {
+ if (playerClanId == GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + hall.getKey(), -1))
+ {
+ player.getVariables().set(HALL_RETURN_VAR, player.getX() + "," + player.getY() + "," + player.getZ() + "," + player.getHeading());
+ player.teleToLocation(hall.getValue());
+ return null;
+ }
+ }
+ htmltext = "33359-02.html";
+ }
+ else if (event.equals("leave"))
+ {
+ final String[] location = player.getVariables().getString(HALL_RETURN_VAR, "-83246,242118,-3730,-1").split(",");
+ player.teleToLocation(Integer.parseInt(location[0]), Integer.parseInt(location[1]), Integer.parseInt(location[2]), Integer.parseInt(location[3]));
+ }
+ else if (event.startsWith(HALL_RESET_VAR))
+ {
+ final String id = event.replace(HALL_RESET_VAR, "");
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ {
+ final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
+ if (clanId > 0)
+ {
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(Integer.parseInt(id));
+ if (clanHall != null)
+ {
+ clanHall.setOwner(null);
+ }
+ }
+ GlobalVariablesManager.getInstance().remove(HALL_TIME_VAR + id);
+ GlobalVariablesManager.getInstance().remove(HALL_OWNER_VAR + id);
+ }
+ }
+
+ return htmltext;
+ }
+
+ @Override
+ public String onFirstTalk(Npc npc, PlayerInstance player)
+ {
+ return npc.getId() + "-01.html";
+ }
+
+ public static void main(String[] args)
+ {
+ new ProvisionalHalls();
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/spawns/Others/ProvisionalClanHalls.xml b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
new file mode 100644
index 0000000000..59c1750c2c
--- /dev/null
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/npcs/33300-33399.xml b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/npcs/33300-33399.xml
index ac447ec5ff..20b2b3601c 100644
--- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/npcs/33300-33399.xml
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/npcs/33300-33399.xml
@@ -29,7 +29,7 @@
+Expel an outsider
+Clan Hall function
+Clan Warehouse
+Manage Clan Hall
+See you later
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
new file mode 100644
index 0000000000..1b789e7c9a
--- /dev/null
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
@@ -0,0 +1,9 @@
+
+[Manage Clan Hall]
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
index 7d23c341e6..157b7170bb 100644
--- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
@@ -62,6 +62,7 @@ public class ClanHallManager extends AbstractNpcAI
36721, 36723, 36725, 36727, // Gludio Outskirts
36729, 36731, 36733, 36735, // Dion Outskirts
36737, 36739, // Floran Village
+ 33360, // Talking Island
};
// @formatter:on
// Misc
@@ -109,7 +110,21 @@ public class ClanHallManager extends AbstractNpcAI
{
case "index":
{
- htmltext = isOwningClan(player, npc) ? "ClanHallManager-01.html" : "ClanHallManager-03.html";
+ if (isOwningClan(player, npc))
+ {
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
+ {
+ htmltext = "ClanHallManager-01.html";
+ }
+ }
+ else
+ {
+ htmltext = "ClanHallManager-03.html";
+ }
break;
}
case "manageDoors":
@@ -248,7 +263,14 @@ public class ClanHallManager extends AbstractNpcAI
case 2:
case 3:
{
- ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(clanHall.getResidenceId() + "0" + (itemLevel - 1)));
+ }
+ else
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ }
break;
}
default:
@@ -280,7 +302,14 @@ public class ClanHallManager extends AbstractNpcAI
{
if (!st.hasMoreTokens())
{
- htmltext = "ClanHallManager-11.html";
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-11b.html";
+ }
+ else
+ {
+ htmltext = "ClanHallManager-11.html";
+ }
}
else
{
@@ -426,7 +455,11 @@ public class ClanHallManager extends AbstractNpcAI
final ClanHall clanHall = npc.getClanHall();
if (isOwningClan(player, npc))
{
- if (clanHall.getCostFailDay() == 0)
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
{
htmltext = "ClanHallManager-01.html";
}
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
new file mode 100644
index 0000000000..84a177d7d4
--- /dev/null
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
@@ -0,0 +1,13 @@
+
+Ah, hello!
+I am the Clan Hall Gatekeeper, Kerry. It's an honor to serve you.
+Do you need help with the Provisional Clan Hall?
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
new file mode 100644
index 0000000000..509b7ff9eb
--- /dev/null
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
@@ -0,0 +1,12 @@
+
+
+
+Participant,
+
+Aw, sorry, but you didn't win a Provisional Clan Hall.
+The auction takes place every 2 weeks,
+between 00:01 Saturday and 23:59 Sunday.
+
+
+Better luck at the next auction!
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
new file mode 100644
index 0000000000..33ec4e8c92
--- /dev/null
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
@@ -0,0 +1,6 @@
+
+The Provisional Clan Hall will cost you 50.000.000 adena, are you sure?
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
new file mode 100644
index 0000000000..ce896dd04d
--- /dev/null
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -0,0 +1,199 @@
+/*
+ * 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 ai.others.ProvisionalHalls;
+
+import java.util.Calendar;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.l2jmobius.gameserver.data.xml.impl.ClanHallData;
+import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
+import org.l2jmobius.gameserver.model.Location;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
+import org.l2jmobius.gameserver.model.entity.ClanHall;
+
+import ai.AbstractNpcAI;
+
+/**
+ * Custom implementation for Provisional Clan Halls.
+ * @author Mobius
+ */
+public class ProvisionalHalls extends AbstractNpcAI
+{
+ // NPCs
+ private static final int KERRY = 33359;
+ private static final int MAID = 33360;
+ // Misc
+ private static final int HALL_PRICE = 50000000;
+ private static final long TWO_WEEKS = 1209600000;
+ private static final Map CLAN_HALLS = new LinkedHashMap<>();
+ static
+ {
+ CLAN_HALLS.put(187, new Location(-122200, -116552, -5798, 1779));
+ CLAN_HALLS.put(186, new Location(-122264, -122392, -5870, 15229));
+ CLAN_HALLS.put(188, new Location(-121864, -111240, -6014, 30268));
+ CLAN_HALLS.put(190, new Location(-117080, -116551, -5771, 1779));
+ CLAN_HALLS.put(189, new Location(-117000, -122052, -5845, 15229));
+ CLAN_HALLS.put(191, new Location(-117074, -111237, -5989, 30268));
+ CLAN_HALLS.put(193, new Location(-111717, -116550, -5773, 1779));
+ CLAN_HALLS.put(192, new Location(-111726, -122378, -5845, 15229));
+ CLAN_HALLS.put(194, new Location(-111158, -111230, -5989, 30268));
+ }
+ private static final String HALL_OWNER_VAR = "PCH_OWNER_";
+ private static final String HALL_TIME_VAR = "PCH_TIME_";
+ private static final String HALL_RESET_VAR = "PCH_RESET_";
+ private static final String HALL_RETURN_VAR = "PCH_RETURN";
+ private static final Object LOCK = new Object();
+
+ private ProvisionalHalls()
+ {
+ addStartNpc(KERRY);
+ addFirstTalkId(KERRY);
+ addTalkId(KERRY);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ final long resetTime = GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0);
+ if (resetTime > 0)
+ {
+ cancelQuestTimers(HALL_RESET_VAR + id);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ }
+ }
+ }
+
+ @Override
+ public String onAdvEvent(String event, Npc npc, PlayerInstance player)
+ {
+ if ((npc.getId() != KERRY) && (npc.getId() != MAID))
+ {
+ return null;
+ }
+
+ String htmltext = null;
+ if (event.equals("33359-01.html") || event.equals("33359-02.html") || event.equals("33359-03.html"))
+ {
+ htmltext = event;
+ }
+ else if (event.equals("buy"))
+ {
+ synchronized (LOCK)
+ {
+ final Calendar calendar = Calendar.getInstance();
+ final int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+ if ((player.getClan() == null) || (player.getClan().getLeaderId() != player.getObjectId()))
+ {
+ player.sendMessage("You need to be a clan leader in order to proceed.");
+ }
+ else if ((player.getClan().getHideoutId() > 0))
+ {
+ player.sendMessage("You already own a hideout.");
+ }
+ else if ((dayOfWeek != Calendar.SATURDAY) && (dayOfWeek != Calendar.SUNDAY))
+ {
+ htmltext = "33359-02.html";
+ }
+ else if (player.getAdena() < HALL_PRICE)
+ {
+ player.sendMessage("You need " + HALL_PRICE + " adena in order to proceed.");
+ }
+ else
+ {
+ if (dayOfWeek != Calendar.SATURDAY)
+ {
+ calendar.add(Calendar.DAY_OF_WEEK, -1);
+ }
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
+ calendar.set(Calendar.MINUTE, 1);
+ calendar.set(Calendar.SECOND, 0);
+ calendar.set(Calendar.MILLISECOND, 0);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ {
+ player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
+ GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
+ GlobalVariablesManager.getInstance().set(HALL_TIME_VAR + id, calendar.getTimeInMillis());
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(id);
+ if (clanHall != null)
+ {
+ clanHall.setOwner(player.getClan());
+ }
+ player.sendMessage("Congratulations! You now own a provisional clan hall!");
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ return null;
+ }
+ }
+ player.sendMessage("I am sorry, all halls have been taken.");
+ }
+ }
+ }
+ else if (event.equals("enter"))
+ {
+ final int playerClanId = player.getClanId();
+ for (Entry hall : CLAN_HALLS.entrySet())
+ {
+ if (playerClanId == GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + hall.getKey(), -1))
+ {
+ player.getVariables().set(HALL_RETURN_VAR, player.getX() + "," + player.getY() + "," + player.getZ() + "," + player.getHeading());
+ player.teleToLocation(hall.getValue());
+ return null;
+ }
+ }
+ htmltext = "33359-02.html";
+ }
+ else if (event.equals("leave"))
+ {
+ final String[] location = player.getVariables().getString(HALL_RETURN_VAR, "-83246,242118,-3730,-1").split(",");
+ player.teleToLocation(Integer.parseInt(location[0]), Integer.parseInt(location[1]), Integer.parseInt(location[2]), Integer.parseInt(location[3]));
+ }
+ else if (event.startsWith(HALL_RESET_VAR))
+ {
+ final String id = event.replace(HALL_RESET_VAR, "");
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ {
+ final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
+ if (clanId > 0)
+ {
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(Integer.parseInt(id));
+ if (clanHall != null)
+ {
+ clanHall.setOwner(null);
+ }
+ }
+ GlobalVariablesManager.getInstance().remove(HALL_TIME_VAR + id);
+ GlobalVariablesManager.getInstance().remove(HALL_OWNER_VAR + id);
+ }
+ }
+
+ return htmltext;
+ }
+
+ @Override
+ public String onFirstTalk(Npc npc, PlayerInstance player)
+ {
+ return npc.getId() + "-01.html";
+ }
+
+ public static void main(String[] args)
+ {
+ new ProvisionalHalls();
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/spawns/Others/ProvisionalClanHalls.xml b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
new file mode 100644
index 0000000000..59c1750c2c
--- /dev/null
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/npcs/33300-33399.xml b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/npcs/33300-33399.xml
index ac447ec5ff..20b2b3601c 100644
--- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/npcs/33300-33399.xml
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/npcs/33300-33399.xml
@@ -29,7 +29,7 @@
+Expel an outsider
+Clan Hall function
+Clan Warehouse
+Manage Clan Hall
+See you later
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
new file mode 100644
index 0000000000..1b789e7c9a
--- /dev/null
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager-11b.html
@@ -0,0 +1,9 @@
+
+[Manage Clan Hall]
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
index 7d23c341e6..157b7170bb 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/others/ClanHallManager/ClanHallManager.java
@@ -62,6 +62,7 @@ public class ClanHallManager extends AbstractNpcAI
36721, 36723, 36725, 36727, // Gludio Outskirts
36729, 36731, 36733, 36735, // Dion Outskirts
36737, 36739, // Floran Village
+ 33360, // Talking Island
};
// @formatter:on
// Misc
@@ -109,7 +110,21 @@ public class ClanHallManager extends AbstractNpcAI
{
case "index":
{
- htmltext = isOwningClan(player, npc) ? "ClanHallManager-01.html" : "ClanHallManager-03.html";
+ if (isOwningClan(player, npc))
+ {
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
+ {
+ htmltext = "ClanHallManager-01.html";
+ }
+ }
+ else
+ {
+ htmltext = "ClanHallManager-03.html";
+ }
break;
}
case "manageDoors":
@@ -248,7 +263,14 @@ public class ClanHallManager extends AbstractNpcAI
case 2:
case 3:
{
- ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(clanHall.getResidenceId() + "0" + (itemLevel - 1)));
+ }
+ else
+ {
+ ((MerchantInstance) npc).showBuyWindow(player, Integer.parseInt(npc.getId() + "0" + (itemLevel - 1)));
+ }
break;
}
default:
@@ -280,7 +302,14 @@ public class ClanHallManager extends AbstractNpcAI
{
if (!st.hasMoreTokens())
{
- htmltext = "ClanHallManager-11.html";
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-11b.html";
+ }
+ else
+ {
+ htmltext = "ClanHallManager-11.html";
+ }
}
else
{
@@ -426,7 +455,11 @@ public class ClanHallManager extends AbstractNpcAI
final ClanHall clanHall = npc.getClanHall();
if (isOwningClan(player, npc))
{
- if (clanHall.getCostFailDay() == 0)
+ if (npc.getId() == 33360) // Provisional Hall Manager
+ {
+ htmltext = "ClanHallManager-01b.html";
+ }
+ else if (clanHall.getCostFailDay() == 0)
{
htmltext = "ClanHallManager-01.html";
}
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
new file mode 100644
index 0000000000..84a177d7d4
--- /dev/null
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-01.html
@@ -0,0 +1,13 @@
+
+Ah, hello!
+I am the Clan Hall Gatekeeper, Kerry. It's an honor to serve you.
+Do you need help with the Provisional Clan Hall?
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
new file mode 100644
index 0000000000..509b7ff9eb
--- /dev/null
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-02.html
@@ -0,0 +1,12 @@
+
+
+
+Participant,
+
+Aw, sorry, but you didn't win a Provisional Clan Hall.
+The auction takes place every 2 weeks,
+between 00:01 Saturday and 23:59 Sunday.
+
+
+Better luck at the next auction!
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
new file mode 100644
index 0000000000..33ec4e8c92
--- /dev/null
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/others/ProvisionalHalls/33359-03.html
@@ -0,0 +1,6 @@
+
+The Provisional Clan Hall will cost you 50.000.000 adena, are you sure?
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
new file mode 100644
index 0000000000..ce896dd04d
--- /dev/null
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/ai/others/ProvisionalHalls/ProvisionalHalls.java
@@ -0,0 +1,199 @@
+/*
+ * 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 ai.others.ProvisionalHalls;
+
+import java.util.Calendar;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.l2jmobius.gameserver.data.xml.impl.ClanHallData;
+import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
+import org.l2jmobius.gameserver.model.Location;
+import org.l2jmobius.gameserver.model.actor.Npc;
+import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
+import org.l2jmobius.gameserver.model.entity.ClanHall;
+
+import ai.AbstractNpcAI;
+
+/**
+ * Custom implementation for Provisional Clan Halls.
+ * @author Mobius
+ */
+public class ProvisionalHalls extends AbstractNpcAI
+{
+ // NPCs
+ private static final int KERRY = 33359;
+ private static final int MAID = 33360;
+ // Misc
+ private static final int HALL_PRICE = 50000000;
+ private static final long TWO_WEEKS = 1209600000;
+ private static final Map CLAN_HALLS = new LinkedHashMap<>();
+ static
+ {
+ CLAN_HALLS.put(187, new Location(-122200, -116552, -5798, 1779));
+ CLAN_HALLS.put(186, new Location(-122264, -122392, -5870, 15229));
+ CLAN_HALLS.put(188, new Location(-121864, -111240, -6014, 30268));
+ CLAN_HALLS.put(190, new Location(-117080, -116551, -5771, 1779));
+ CLAN_HALLS.put(189, new Location(-117000, -122052, -5845, 15229));
+ CLAN_HALLS.put(191, new Location(-117074, -111237, -5989, 30268));
+ CLAN_HALLS.put(193, new Location(-111717, -116550, -5773, 1779));
+ CLAN_HALLS.put(192, new Location(-111726, -122378, -5845, 15229));
+ CLAN_HALLS.put(194, new Location(-111158, -111230, -5989, 30268));
+ }
+ private static final String HALL_OWNER_VAR = "PCH_OWNER_";
+ private static final String HALL_TIME_VAR = "PCH_TIME_";
+ private static final String HALL_RESET_VAR = "PCH_RESET_";
+ private static final String HALL_RETURN_VAR = "PCH_RETURN";
+ private static final Object LOCK = new Object();
+
+ private ProvisionalHalls()
+ {
+ addStartNpc(KERRY);
+ addFirstTalkId(KERRY);
+ addTalkId(KERRY);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ final long resetTime = GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0);
+ if (resetTime > 0)
+ {
+ cancelQuestTimers(HALL_RESET_VAR + id);
+ startQuestTimer(HALL_RESET_VAR + id, Math.max(1000, (TWO_WEEKS - (System.currentTimeMillis() - resetTime) - 30000)), null, null);
+ }
+ }
+ }
+
+ @Override
+ public String onAdvEvent(String event, Npc npc, PlayerInstance player)
+ {
+ if ((npc.getId() != KERRY) && (npc.getId() != MAID))
+ {
+ return null;
+ }
+
+ String htmltext = null;
+ if (event.equals("33359-01.html") || event.equals("33359-02.html") || event.equals("33359-03.html"))
+ {
+ htmltext = event;
+ }
+ else if (event.equals("buy"))
+ {
+ synchronized (LOCK)
+ {
+ final Calendar calendar = Calendar.getInstance();
+ final int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+ if ((player.getClan() == null) || (player.getClan().getLeaderId() != player.getObjectId()))
+ {
+ player.sendMessage("You need to be a clan leader in order to proceed.");
+ }
+ else if ((player.getClan().getHideoutId() > 0))
+ {
+ player.sendMessage("You already own a hideout.");
+ }
+ else if ((dayOfWeek != Calendar.SATURDAY) && (dayOfWeek != Calendar.SUNDAY))
+ {
+ htmltext = "33359-02.html";
+ }
+ else if (player.getAdena() < HALL_PRICE)
+ {
+ player.sendMessage("You need " + HALL_PRICE + " adena in order to proceed.");
+ }
+ else
+ {
+ if (dayOfWeek != Calendar.SATURDAY)
+ {
+ calendar.add(Calendar.DAY_OF_WEEK, -1);
+ }
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
+ calendar.set(Calendar.MINUTE, 1);
+ calendar.set(Calendar.SECOND, 0);
+ calendar.set(Calendar.MILLISECOND, 0);
+
+ for (int id : CLAN_HALLS.keySet())
+ {
+ if ((GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0) == 0) && ((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) < System.currentTimeMillis()))
+ {
+ player.reduceAdena("ProvisionalHall", HALL_PRICE, player, true);
+ GlobalVariablesManager.getInstance().set(HALL_OWNER_VAR + id, player.getClanId());
+ GlobalVariablesManager.getInstance().set(HALL_TIME_VAR + id, calendar.getTimeInMillis());
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(id);
+ if (clanHall != null)
+ {
+ clanHall.setOwner(player.getClan());
+ }
+ player.sendMessage("Congratulations! You now own a provisional clan hall!");
+ startQuestTimer("RESET_ORCHID_HALL", TWO_WEEKS - (System.currentTimeMillis() - calendar.getTimeInMillis()), null, null);
+ return null;
+ }
+ }
+ player.sendMessage("I am sorry, all halls have been taken.");
+ }
+ }
+ }
+ else if (event.equals("enter"))
+ {
+ final int playerClanId = player.getClanId();
+ for (Entry hall : CLAN_HALLS.entrySet())
+ {
+ if (playerClanId == GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + hall.getKey(), -1))
+ {
+ player.getVariables().set(HALL_RETURN_VAR, player.getX() + "," + player.getY() + "," + player.getZ() + "," + player.getHeading());
+ player.teleToLocation(hall.getValue());
+ return null;
+ }
+ }
+ htmltext = "33359-02.html";
+ }
+ else if (event.equals("leave"))
+ {
+ final String[] location = player.getVariables().getString(HALL_RETURN_VAR, "-83246,242118,-3730,-1").split(",");
+ player.teleToLocation(Integer.parseInt(location[0]), Integer.parseInt(location[1]), Integer.parseInt(location[2]), Integer.parseInt(location[3]));
+ }
+ else if (event.startsWith(HALL_RESET_VAR))
+ {
+ final String id = event.replace(HALL_RESET_VAR, "");
+ if (((GlobalVariablesManager.getInstance().getLong(HALL_TIME_VAR + id, 0) + TWO_WEEKS) - 60000) <= System.currentTimeMillis())
+ {
+ final int clanId = GlobalVariablesManager.getInstance().getInt(HALL_OWNER_VAR + id, 0);
+ if (clanId > 0)
+ {
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(Integer.parseInt(id));
+ if (clanHall != null)
+ {
+ clanHall.setOwner(null);
+ }
+ }
+ GlobalVariablesManager.getInstance().remove(HALL_TIME_VAR + id);
+ GlobalVariablesManager.getInstance().remove(HALL_OWNER_VAR + id);
+ }
+ }
+
+ return htmltext;
+ }
+
+ @Override
+ public String onFirstTalk(Npc npc, PlayerInstance player)
+ {
+ return npc.getId() + "-01.html";
+ }
+
+ public static void main(String[] args)
+ {
+ new ProvisionalHalls();
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/spawns/Others/ProvisionalClanHalls.xml b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
new file mode 100644
index 0000000000..59c1750c2c
--- /dev/null
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/spawns/Others/ProvisionalClanHalls.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/npcs/33300-33399.xml b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/npcs/33300-33399.xml
index ac447ec5ff..20b2b3601c 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/npcs/33300-33399.xml
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/npcs/33300-33399.xml
@@ -29,7 +29,7 @@
-
+
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/teleporters/clanhall/TalkingIsland/ProvisionalHalls.xml b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/teleporters/clanhall/TalkingIsland/ProvisionalHalls.xml
new file mode 100644
index 0000000000..8673cd65c8
--- /dev/null
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/teleporters/clanhall/TalkingIsland/ProvisionalHalls.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/xsd/clanHall.xsd b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/xsd/clanHall.xsd
index 59b2e7adbe..18373ddc54 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/xsd/clanHall.xsd
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/xsd/clanHall.xsd
@@ -70,7 +70,7 @@
-
+
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/zones/clan_hall.xml b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/zones/clan_hall.xml
index 07d0ab4b6a..a80f54cbde 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/zones/clan_hall.xml
+++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/zones/clan_hall.xml
@@ -418,4 +418,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Npc.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Npc.java
index 43d7a7f608..9c8cf5fe7f 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Npc.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Npc.java
@@ -86,6 +86,8 @@ import org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate;
import org.l2jmobius.gameserver.model.stats.Formulas;
import org.l2jmobius.gameserver.model.variables.NpcVariables;
import org.l2jmobius.gameserver.model.zone.ZoneId;
+import org.l2jmobius.gameserver.model.zone.ZoneType;
+import org.l2jmobius.gameserver.model.zone.type.ClanHallZone;
import org.l2jmobius.gameserver.model.zone.type.TaxZone;
import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.SystemMessageId;
@@ -553,6 +555,20 @@ public class Npc extends Creature
public ClanHall getClanHall()
{
+ if (getId() == 33360) // Provisional Hall Manager
+ {
+ for (ZoneType zone : ZoneManager.getInstance().getZones(this))
+ {
+ if (zone instanceof ClanHallZone)
+ {
+ final ClanHall clanHall = ClanHallData.getInstance().getClanHallById(((ClanHallZone) zone).getResidenceId());
+ if (clanHall != null)
+ {
+ return clanHall;
+ }
+ }
+ }
+ }
return ClanHallData.getInstance().getClanHallByNpcId(getId());
}
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/readme.txt b/L2J_Mobius_Classic_3.0_TheKamael/readme.txt
index b28b4b7457..ae2fa0ff4b 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/readme.txt
+++ b/L2J_Mobius_Classic_3.0_TheKamael/readme.txt
@@ -115,6 +115,3 @@ Customs:
-Newbie Helper buff support until 40 level
-Test Server Helper NPCs
-Fake players engine
-
-TODO:
--Provisional Clan Halls