Merged with released L2J-Unity files.

This commit is contained in:
mobiusdev
2016-06-12 01:34:09 +00:00
parent e003e87887
commit 635557f5da
18352 changed files with 3245113 additions and 2892959 deletions

View File

@@ -0,0 +1,124 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
package ai.others.CastleMercenaryManager;
import java.util.StringTokenizer;
import com.l2jmobius.gameserver.model.ClanPrivilege;
import com.l2jmobius.gameserver.model.PcCondOverride;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2MerchantInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.Castle;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import ai.AbstractNpcAI;
/**
* Castle Mercenary Manager AI.
* @author malyelfik
*/
public final class CastleMercenaryManager extends AbstractNpcAI
{
// NPCs
private static final int[] NPCS =
{
35102, // Greenspan
35144, // Sanford
35186, // Arvid
35228, // Morrison
35276, // Eldon
35318, // Solinus
35365, // Rowell
35511, // Gompus
35557, // Kendrew
};
private CastleMercenaryManager()
{
addStartNpc(NPCS);
addTalkId(NPCS);
addFirstTalkId(NPCS);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = null;
final StringTokenizer st = new StringTokenizer(event, " ");
switch (st.nextToken())
{
case "limit":
{
final Castle castle = npc.getCastle();
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
if (castle.getName().equalsIgnoreCase("Aden"))
{
html.setHtml(getHtm(player.getHtmlPrefix(), "mercmanager-aden-limit.html"));
}
else if (castle.getName().equalsIgnoreCase("Rune"))
{
html.setHtml(getHtm(player.getHtmlPrefix(), "mercmanager-rune-limit.html"));
}
else
{
html.setHtml(getHtm(player.getHtmlPrefix(), "mercmanager-limit.html"));
}
html.replace("%feud_name%", String.valueOf(1001000 + castle.getResidenceId()));
player.sendPacket(html);
break;
}
case "buy":
{
final int listId = Integer.parseInt(npc.getId() + st.nextToken());
((L2MerchantInstance) npc).showBuyWindow(player, listId, false); // NOTE: Not affected by Castle Taxes, baseTax is 20% (done in merchant buylists)
break;
}
case "main":
{
htmltext = onFirstTalk(npc, player);
break;
}
case "mercmanager-01.html":
{
htmltext = event;
break;
}
}
return htmltext;
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
final String htmltext;
if (player.canOverrideCond(PcCondOverride.CASTLE_CONDITIONS) || ((player.getClanId() == npc.getCastle().getOwnerId()) && player.hasClanPrivilege(ClanPrivilege.CS_MERCENARIES)))
{
htmltext = npc.getCastle().getSiege().isInProgress() ? "mercmanager-siege.html" : "mercmanager.html";
}
else
{
htmltext = "mercmanager-no.html";
}
return htmltext;
}
public static void main(String[] args)
{
new CastleMercenaryManager();
}
}

View File

@@ -0,0 +1,12 @@
<html><body><br>
Sign a contract with me, and I'll give you a certificate stating that my mercenaries are in your employ. Place it wherever you wish to assign them.<br>
Place the certificate on the ground at the beginning of the battle and they will be summoned. They will position themselves wherever you are and in the direction you look. Most importantly, they'll defend you, my lord, to the death!<br>
If you wish to re-position them, simply pick up the certificate and place it where you wish them to be.<br>
You can buy as many certificates as you want, but there is a limit to the number of mercenaries that can be hired.<br>
<a action="bypass -h Quest CastleMercenaryManager limit">View the Mercenary Posting</a><br>
You cannot position the mercenaries too closely together, and they must be assigned inside the castle. Of course, if you place the certificate in other castles, the mercenaries will not be able to come to your aid.<br>
The contract between us will be terminated at the end of the siege. You may use any unused certificates in another battle.<br>
<center>
<button action="bypass -h Quest CastleMercenaryManager main" value="Back" width=80 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF">
</center>
</body></html>

View File

@@ -0,0 +1,31 @@
<html><body>
<font color="LEVEL">[<fstring>%feud_name%</fstring> Castle Mercenary Deployment Limits]</font><br>
<center>
<table border=1 cellspacing=0>
<tr><td align=center width=250>Deployable Personnel</td></tr> <tr><td><font color="LEVEL">Teleporter</font> (Stationary)<br1>
Inner Castle (Eastern/Western/Hall) - Relic Safehouse (1)<br1>
Outer Castle (Eastern/Western/Hall) - Relic Safehouse (1)<br1>
Outer Castle - Inner Castle (Western/Hall) - Relic Safehouse (1)<br1>
Outer Castle - Inner Castle (Eastern/Western) - Relic Safehouse (1)<br1>
Outer Castle - Inner Castle (Eastern/Western/Hall) (1)<br>
</td></tr> <tr><td><font color="LEVEL">Elite Mercenary Guild Members</font> (Stationary/Roving)<br1>
Swordsmen (4/4)<br1>
Pikemen (4/4)<br1>
Archers (10/10)<br1>
Clerics (2/2)<br1>
Wizards (2/2)<br>
<font color="LEVEL">Mercenary Guild Members</font> (Stationary/Roving)<br1>
Swordsmen (10/10)<br1>
Pikemen (6/6)<br1>
Archers (20/20)<br1>
Clerics (4/4)<br1>
Wizards (4/4)<br>
</td></tr>
</table>
<br>
<button action="bypass -h Quest CastleMercenaryManager main" value="Start Screen" width=80 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF">
</center>
<br>
</body></html>

View File

@@ -0,0 +1,30 @@
<html><body><br>
<font color="LEVEL">[<fstring>%feud_name%</fstring> Castle Force Allocation Restrictions]</font><br>
<center>
<table border=1 width=250 cellspacing=0>
<tr><td align=center>Force Assignments</td></tr> <tr><td><br1>
<font color="LEVEL">Teleporter (stationary)</font><br1>
Outer Castle-Inner Castle (1)<br1>
Inner Castle-Sacred Ark (1)<br1>
Outer Castle-Sacred Ark (1)<br>
</td></tr> <tr><td><br1>
<font color="LEVEL">Elite Mercenary Guild Members</font><br1>
Swordsmen (2 stationary/2 mobile)<br1>
Pikemen (2 stationary/2 mobile)<br1>
Archers (5 stationary/5 mobile)<br1>
Clerics (1 stationary/1 mobile)<br1>
Human Wizards (1 stationary/1 mobile)<br>
<font color="LEVEL"> Mercenary Guild Members</font><br1>
Swordsmen (5 stationary/5 mobile)<br1>
Pikemen (3 stationary/3 mobile)<br1>
Archers (10 stationary/10 mobile)<br1>
Clerics (2 stationary/2 mobile)<br1>
Human Wizards (2 stationary/2 mobile)<br>
</td></tr>
</table>
<br><br>
<button action="bypass -h Quest CastleMercenaryManager main" value="Back" width=80 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF">
</center>
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>
Do you wish to join our mercenary guild?
</body></html>

View File

@@ -0,0 +1,31 @@
<html><body>
<font color="LEVEL">[<fstring>%feud_name%</fstring> Castle Mercenary Deployment Limits]</font><br>
<center>
<table border=1 cellspacing=0>
<tr><td align=center width=250>Deployable Personnel</td></tr> <tr><td><font color="LEVEL">Teleporter</font> (Stationary)<br1>
Inner Castle (Eastern/Western/Hall) - Relic Safehouse (1)<br1>
Outer Castle (Eastern/Western/Hall) - Relic Safehouse (1)<br1>
Outer Castle - Inner Castle (Western/Hall) - Relic Safehouse (1)<br1>
Outer Castle - Inner Castle (Eastern/Western) - Relic Safehouse (1)<br1>
Outer Castle - Inner Castle (Eastern/Western/Hall) (1)<br>
</td></tr><tr><td><font color="LEVEL">Elite Mercenary Guild Members</font> (Stationary/Roving)<br1>
Swordsmen (4/4)<br1>
Pikemen (4/4)<br1>
Archers (10/10)<br1>
Clerics (2/2)<br1>
Wizards (2/2)<br>
<font color="LEVEL">Mercenary Guild Members</font> (Stationary/Roving)<br1>
Swordsmen (10/10)<br1>
Pikemen (6/6)<br1>
Archers (20/20)<br1>
Clerics (4/4)<br1>
Wizards (4/4)<br>
</td></tr>
</table>
<br>
<button action="bypass -h Quest CastleMercenaryManager main" value="Back" width=80 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF">
</center>
<br>
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>
It is too late, the war has begun.
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>
I'm sorry, my lord.<br>
You can only hire mercenaries during the seal validation period.<br><br>
<center>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest CastleMercenaryManager main">Back</Button>
</center>
</body></html>

View File

@@ -0,0 +1,10 @@
<html><body>
Greetings, my Lord.<br1>
Would you care to hire mercenaries of our guild?<br><br>
If you wish to know the method of Contract,<br1>
just ask me.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest CastleMercenaryManager mercmanager-01.html">"Tell me about the method of Contract."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest CastleMercenaryManager buy 1">"I want to hire a mercenary."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest CastleMercenaryManager buy 2">"I'd like to hire an Elite Mercenary."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest CastleMercenaryManager buy 3">"I want to hire a teleporter."</Button>
</body></html>