This commit is contained in:
mobius
2015-01-01 20:02:50 +00:00
parent eeae660458
commit a6a3718849
17894 changed files with 2818932 additions and 0 deletions

View File

@@ -0,0 +1,119 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ai.npc.CastleWarehouse;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
/**
* Castle Warehouse Keeper AI.
* @author malyelfik
*/
public final class CastleWarehouse extends AbstractNpcAI
{
// NPCs
private static final int[] NPCS =
{
35099, // Warehouse Keeper (Gludio)
35141, // Warehouse Keeper (Dion)
35183, // Warehouse Keeper (Giran)
35225, // Warehouse Keeper (Oren)
35273, // Warehouse Keeper (Aden)
35315, // Warehouse Keeper (Inadril)
35362, // Warehouse Keeper (Goddard)
35508, // Warehouse Keeper (Rune)
35554, // Warehouse Keeper (Schuttgart)
};
// Items
private static final int BLOOD_OATH = 9910;
private static final int BLOOD_ALLIANCE = 9911;
private CastleWarehouse()
{
super(CastleWarehouse.class.getSimpleName(), "ai/npc");
addStartNpc(NPCS);
addTalkId(NPCS);
addFirstTalkId(NPCS);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = event;
switch (event)
{
case "warehouse-01.html":
case "warehouse-02.html":
case "warehouse-03.html":
break;
case "warehouse-04.html":
htmltext = (!npc.isMyLord(player)) ? "warehouse-no.html" : getHtm(player.getHtmlPrefix(), "warehouse-04.html").replace("%blood%", Integer.toString(player.getClan().getBloodAllianceCount()));
break;
case "Receive":
if (!npc.isMyLord(player))
{
htmltext = "warehouse-no.html";
}
else if (player.getClan().getBloodAllianceCount() == 0)
{
htmltext = "warehouse-05.html";
}
else
{
giveItems(player, BLOOD_ALLIANCE, player.getClan().getBloodAllianceCount());
player.getClan().resetBloodAllianceCount();
htmltext = "warehouse-06.html";
}
break;
case "Exchange":
if (!npc.isMyLord(player))
{
htmltext = "warehouse-no.html";
}
else if (!hasQuestItems(player, BLOOD_ALLIANCE))
{
htmltext = "warehouse-08.html";
}
else
{
takeItems(player, BLOOD_ALLIANCE, 1);
giveItems(player, BLOOD_OATH, 30);
htmltext = "warehouse-07.html";
}
break;
default:
htmltext = null;
break;
}
return htmltext;
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
return "warehouse-01.html";
}
public static void main(String[] args)
{
new CastleWarehouse();
}
}

View File

@@ -0,0 +1,8 @@
<html><body>Warehouse Keeper:<br>
Welcome! What can I do for you today? It costs only 30 Adena to store items. If you are a manager, please let me know in advance and I will give you an item that will help the clan's development.<br><br>
<center>
<a action="bypass -h Quest CastleWarehouse warehouse-02.html">Private Warehouse.</a><br>
<a action="bypass -h Quest CastleWarehouse warehouse-03.html">Clan Warehouse.</a><br>
<a action="bypass -h Quest CastleWarehouse warehouse-04.html">Check honorary item.</a>
</center>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Warehouse Keeper:<br>
<center>
<a action="bypass -h npc_%objectId%_DepositP">Deposit an item. (Private Warehouse)</a><br>
<a action="bypass -h npc_%objectId%_WithdrawP">Withdraw an item. (Private Warehouse)</a><br><br>
<a action="bypass -h Quest CastleWarehouse warehouse-01.html">Back</a>
</center>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Warehouse Keeper:<br>
<center>
<a action="bypass -h npc_%objectId%_DepositC" msg="1039">Deposit an item. (Clan Warehouse)</a><br>
<a action="bypass -h npc_%objectId%_WithdrawC">Withdraw an item. (Clan Warehouse)</a><br><br>
<a action="bypass -h Quest CastleWarehouse warehouse-01.html">Back</a>
</center>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Warehouse Keeper:<br>
You can earn a total of <font color="LEVEL">%blood%</font> "Blood Alliances" through a successful siege.<br><br>
<a action="bypass -h Quest CastleWarehouse Receive">Receive "Blood Alliance."</a><br>
<a action="bypass -h Quest CastleWarehouse Exchange">Exchange a "Blood Alliance" for 30 "Blood Oaths."</a><br>
<a action="bypass -h Quest CastleWarehouse warehouse-01.html">Back.</a>
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Warehouse Keeper:<br>
There are no items currently being stored here.
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Warehouse Keeper:<br>
You have made your payment.
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Warehouse Keeper:<br>
Exchanged.
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Warehouse Keeper:<br>
You do not have enough "Blood Alliances."
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Warehouse Keeper:<br>
You do not have the authority to access that account.
</body></html>