Dropped some unusable AI scripts.
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
<html><body>Black Marketeer of Mammon:<br>
|
||||
<font color="LEVEL">[Exchange Ancient Adena for Adena]</font><br>
|
||||
Enter the amount of Ancient Adena you wish to exchange.<br>
|
||||
<td align=left><edit var="data1" width=100></td>
|
||||
<button value="Exchange" action="bypass -h Quest BlackMarketeerOfMammon exchange $data1" back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF" width=80 height=27>
|
||||
</body></html>
|
@@ -1,5 +0,0 @@
|
||||
<html><head><body>Black Marketeer of Mammon:<br>
|
||||
<font color="FF0000">[Exchange failure]</font><br>
|
||||
You've entered an invalid value. Please input a correct amount.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest BlackMarketeerOfMammon 31092-01.html">Back</Button>
|
||||
</body></html>
|
@@ -1,5 +0,0 @@
|
||||
<html><head><body>Black Marketeer of Mammon:<br>
|
||||
<font color="FF0000">[Exchange failure]</font><br>
|
||||
You don't have enough of the item that you're trying to exchange.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest BlackMarketeerOfMammon 31092-01.html">Back</Button>
|
||||
</body></html>
|
@@ -1,5 +0,0 @@
|
||||
<html><body>Black Marketeer of Mammon:<br>
|
||||
<FONT color="LEVEL">[Exchange success]</FONT><br>
|
||||
Thank you! There you go! Are you satisfied now? Or do you want to exchange something else?<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="Quest BlackMarketeerOfMammon 31092-01.html">Back</Button>
|
||||
</body></html>
|
@@ -1,11 +0,0 @@
|
||||
<html><body>Black Marketeer of Mammon:<br>
|
||||
The Lords of Dawn and the Revolutionary Troops of Dusk use <font color="LEVEL">Ancient Adena</font> as their currency, following in the old empire's tradition.<br>
|
||||
Tradition and customs are important but they are so old... If you were to go to the market with that money in this day and age, you couldn't buy a thing.<br>
|
||||
Do you have any ancient adena that you don't know what to do with? If you do, I'll exchange them for adena.<br>
|
||||
Also, if your weapon has a special ability that you do not want, I can remove that, too. I dont't know why you would want to take off a special ability that's been bestowed on your weapon, but we'll do anything for adena.<br>
|
||||
I have also obtained some rare goods, so stop by some time - these items aren't easy to obtain!<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest BlackMarketeerOfMammon 31092-01.html">"I want to exchange Ancient Adena for Adena."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_multisell 310922002">"Can I trade black market goods?"</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_exc_multisell 310922001">"I want to remove special abilities from my weapon."</Button>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
@@ -1,91 +0,0 @@
|
||||
/*
|
||||
* 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.BlackMarketeerOfMammon;
|
||||
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Black Marketeer of Mammon AI.
|
||||
* @author St3eT
|
||||
*/
|
||||
public final class BlackMarketeerOfMammon extends AbstractNpcAI
|
||||
{
|
||||
// NPC
|
||||
private static final int BLACK_MARKETEER = 31092;
|
||||
|
||||
private BlackMarketeerOfMammon()
|
||||
{
|
||||
addStartNpc(BLACK_MARKETEER);
|
||||
addTalkId(BLACK_MARKETEER);
|
||||
addFirstTalkId(BLACK_MARKETEER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (event.equals("31092-01.html"))
|
||||
{
|
||||
return event;
|
||||
}
|
||||
else if (event.startsWith("exchange"))
|
||||
{
|
||||
final StringTokenizer st = new StringTokenizer(event, " ");
|
||||
event = st.nextToken();
|
||||
|
||||
if (!st.hasMoreElements())
|
||||
{
|
||||
return "31092-02.html";
|
||||
}
|
||||
|
||||
final String value = st.nextToken();
|
||||
if (!Util.isDigit(value))
|
||||
{
|
||||
return "31092-02.html";
|
||||
}
|
||||
|
||||
final long count = Integer.parseInt(value);
|
||||
final long AAcount = player.getAncientAdena();
|
||||
|
||||
if (count < 1)
|
||||
{
|
||||
return "31092-02.html";
|
||||
}
|
||||
|
||||
if (count > AAcount)
|
||||
{
|
||||
return "31092-03.html";
|
||||
|
||||
}
|
||||
takeItems(player, Inventory.ANCIENT_ADENA_ID, count);
|
||||
giveAdena(player, count, false);
|
||||
return "31092-04.html";
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new BlackMarketeerOfMammon();
|
||||
}
|
||||
}
|
@@ -1,3 +0,0 @@
|
||||
<html><body>
|
||||
Can't you see that I am busy? Continue to bother me and you'll finish your days as a toad in the castle pond!<br><br>
|
||||
</body></html>
|
@@ -1,3 +0,0 @@
|
||||
<html><body>
|
||||
I can even shoot an arrow and hit a bird at 100 meters!
|
||||
</body></html>
|
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* 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.FortressArcherCaptain;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Fortress Archer Captain AI.
|
||||
* @author St3eT
|
||||
*/
|
||||
public final class FortressArcherCaptain extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int[] ARCHER_CAPTAIN =
|
||||
{
|
||||
35661, // Shanty Fortress
|
||||
35692, // Southern Fortress
|
||||
35730, // Hive Fortress
|
||||
35761, // Valley Fortress
|
||||
35799, // Ivory Fortress
|
||||
35830, // Narsell Fortress
|
||||
35861, // Bayou Fortress
|
||||
35899, // White Sands Fortress
|
||||
35930, // Borderland Fortress
|
||||
35968, // Swamp Fortress
|
||||
36006, // Archaic Fortress
|
||||
36037, // Floran Fortress
|
||||
36075, // Cloud Mountain
|
||||
36113, // Tanor Fortress
|
||||
36144, // Dragonspine Fortress
|
||||
36175, // Antharas's Fortress
|
||||
36213, // Western Fortress
|
||||
36251, // Hunter's Fortress
|
||||
36289, // Aaru Fortress
|
||||
36320, // Demon Fortress
|
||||
36358, // Monastic Fortress
|
||||
};
|
||||
|
||||
private FortressArcherCaptain()
|
||||
{
|
||||
addStartNpc(ARCHER_CAPTAIN);
|
||||
addFirstTalkId(ARCHER_CAPTAIN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
final int fortOwner = npc.getFort().getOwnerClan() == null ? 0 : npc.getFort().getOwnerClan().getId();
|
||||
return ((player.getClan() != null) && (player.getClanId() == fortOwner)) ? "FortressArcherCaptain.html" : "FortressArcherCaptain-01.html";
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new FortressArcherCaptain();
|
||||
}
|
||||
}
|
@@ -1,5 +0,0 @@
|
||||
<html><body>
|
||||
Are you curious why I'm here in front of this fortress owned by the <font color="LEVEL">%clanName%</font> clan selling my wares, instead of in a nice, safe village?<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_multisell 90001000">"No. Please show me items I can use on the battlefield."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest FortressSiegeManager FortressSiegeManager-11.html">"Yes, I'm a little curious."</Button>
|
||||
</body></html>
|
@@ -1,3 +0,0 @@
|
||||
<html><body>
|
||||
Whoa -- no need to be suspicious of me, friend. It's a nice day and I'm just out taking a walk to get a breath of fresh air. Don't mind me!
|
||||
</body></html>
|
@@ -1,3 +0,0 @@
|
||||
<html><body>
|
||||
We are mercenary soldiers ready to fight if the money is right. We don't take charity cases, though.
|
||||
</body></html>
|
@@ -1,4 +0,0 @@
|
||||
<html><body>
|
||||
Hmm... No offense, but my gut tells me that I shouldn't trust you. Sorry, friend.<br>
|
||||
(A clan must be clan level 4 or above to register for a Fortress Battle.)
|
||||
</body></html>
|
@@ -1,3 +0,0 @@
|
||||
<html><body>
|
||||
All right, then! Let's show these villains who's boss by combining our power. Allow me to call my associates...
|
||||
</body></html>
|
@@ -1,4 +0,0 @@
|
||||
<html><body>
|
||||
Your attempt to register for the fortress battle has failed.<br>
|
||||
(Unless a castle siege is in progress, only clans that are level 4 or higher and do not possess a castle may register. You may only register for one fortress battle at a time.)
|
||||
</body></html>
|
@@ -1,3 +0,0 @@
|
||||
<html><body>
|
||||
This is not a good time. I will examine the area; come see me again later.
|
||||
</body></html>
|
@@ -1,3 +0,0 @@
|
||||
<html><body>
|
||||
I'm afraid that there's nothing we can do to help right now. Please come back after you've had a chance to freshen up.
|
||||
</body></html>
|
@@ -1,3 +0,0 @@
|
||||
<html><body>
|
||||
Who are you? You seem to have listened to some very inaccurate rumors about me... Ha!
|
||||
</body></html>
|
@@ -1,3 +0,0 @@
|
||||
<html><body>
|
||||
This battle is not some streetgang fight; it is a serious business, with rules and traditions. I don't know your intentions, but I think you'd best bring your senior officer here immediately.
|
||||
</body></html>
|
@@ -1,7 +0,0 @@
|
||||
<html><body>I'll tell you why. You may be surprised to learn that I am a member of the Tactics Corps. You see this fortress? Places just like it used to protect the people of this land from Monsters and foreign armies. And now? Greedy, grasping fools have occupied the fortress, using its might to extort money from the area residents... So I'm guarding this area, searching for someone worthy to defeat that band of bandits and occupy the fortress on behalf of the citizens here.<br>
|
||||
You seem a likely candidate... What do you say? You could hire our mercenaries, and with our help I'm sure you'd be able to capture the fortress. Do you want to try?<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest FortressSiegeManager register">"I'd like to register for fortress siege warfare."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest FortressSiegeManager cancel">"I want to cancel my registration."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest FortressSiegeManager warInfo">"Can you tell me about fortress siege warfare?"</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest FortressSiegeManager FortressSiegeManager-13.html">"Tell me more about the fortress."</Button></body>
|
||||
</html>
|
@@ -1,3 +0,0 @@
|
||||
<html><body>
|
||||
Well... Member of the clan <font color="LEVEL">%clanName%</font> of repute! What I just told you was simply mimicking the story I heard from a stranger that I met in the village armor store. Don't take it the wrong way!
|
||||
</body></html>
|
@@ -1,5 +0,0 @@
|
||||
<html><body>
|
||||
Listen carefully. My lord does not trust the clan currently in possession of this fortress <20> you can see the effort and expense he has gone to assemble this mercenary force as a counterweight. Were you to expel the current owners and capture the fortress, I am sure he would be most grateful. (Of course, that probably won't last long -- it's not called a "3-day reign" for nothing...)<br><br>
|
||||
Oh, forgive my muttering -- just talking to myself, you know. In any event, let me explain a little about the two types of fortresses.<br><br>Territorial fortresses are built within a territory to defend against monster attacks, while border fortresses are established along the boundary between two territories. If you have a map, take a look for yourself and you'll see what I mean. Blue flags indicate territorial fortresses, whereas red flags indicate border fortresses.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest FortressSiegeManager FortressSiegeManager-14.html">"What should I do to conquer a fortress?"</Button>
|
||||
</body></html>
|
@@ -1,5 +0,0 @@
|
||||
<html><body>
|
||||
Knowing a fortress' layout can help you turn the battle to your advantage. Each fortress is essentially a residential area consisting of a large central command post surrounded by several barracks.<br><br>
|
||||
There are 5 types of barracks: defense barracks, archer barracks, support barracks, officer's barracks and a control room. The number of barracks varies depending on the size of the fortress. Each barracks has a commander who must be defeated in order for you to conquer that barracks. Note that the control center must have a Warsmith or a Maestro in order to handle the machinery.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest FortressSiegeManager FortressSiegeManager-15.html">"What happens if I conquer the barracks?"</Button>
|
||||
</body></html>
|
@@ -1,5 +0,0 @@
|
||||
<html><body>
|
||||
If you conquer all of the barracks, weakening your opponents' defensive system, the command gate will open. Entering the command post, you will find a Combat Flag on the first floor that symbolizes the authority of the fort. You can end the battle by hanging it from the flag pole on the very highest floor.<br><br>
|
||||
Be warned, though, that you must conquer the fortress within 10 minutes or all of the barracks' functions will return to normal.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest FortressSiegeManager FortressSiegeManager-16.html">"As a mercenary, what do you..."</Button>
|
||||
</body></html>
|
@@ -1,4 +0,0 @@
|
||||
<html><body>
|
||||
Uh-huh. I occasionally earn a few Adena as mercenary... A single mission earns me 250,000 Adena. Not a particularly expensive fee, considering that I put my life on the line!<br><br>But I get your point. If there is an enemy clan controlling the fortress, I'll escort our mercenary captain there. He can open the central command gate, so be sure to guard him carefully!<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest FortressSiegeManager FortressSiegeManager-11.html">Back</Button>
|
||||
</body></html>
|
@@ -1,3 +0,0 @@
|
||||
<html><body>
|
||||
A clan that possesses a castle in a different region cannot register.
|
||||
</body></html>
|
@@ -1,3 +0,0 @@
|
||||
<html><body>
|
||||
You cannot register for a fortress war while the castle in your possession is allied with the fortress.
|
||||
</body></html>
|
@@ -1,4 +0,0 @@
|
||||
<html><body>
|
||||
Hmm... I feel a strange energy near the fortress. Be on your guard! I believe that the rebels who once held this place will soon attempt to seize it again!<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest FortressSiegeManager FortressSiegeManager-11.html">Back</Button>
|
||||
</body></html>
|
@@ -1,4 +0,0 @@
|
||||
<html><body>
|
||||
We don't have any clients at the moment, so we're searching for opportunities. If someone needs us, we can be ready in less than an hour. How about your clan? A mere 250,000 Adena secures our services!<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest FortressSiegeManager FortressSiegeManager-11.html">Back</Button>
|
||||
</body></html>
|
@@ -1,4 +0,0 @@
|
||||
<html><body>
|
||||
Ah, we've already been hired by another clan. If you make a request now, we will register your clan to the battle, but don't give us a hard time. I'll return to our headquarters to prepare. Get ready! The battle will begin in 10 minutes.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest FortressSiegeManager FortressSiegeManager-11.html">Back</Button>
|
||||
</body></html>
|
@@ -1,4 +0,0 @@
|
||||
<html><body>Are you curious why I am selling here, since it's not a village?<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_multisell 90001000">"No. Please show me items I can use on the battlefield."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest FortressSiegeManager FortressSiegeManager-11.html">"Yes, I'm a little curious."</Button>
|
||||
</body></html>
|
@@ -1,218 +0,0 @@
|
||||
/*
|
||||
* 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.FortressSiegeManager;
|
||||
|
||||
import com.l2jmobius.gameserver.instancemanager.FortSiegeManager;
|
||||
import com.l2jmobius.gameserver.model.ClanPrivilege;
|
||||
import com.l2jmobius.gameserver.model.L2Clan;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.entity.Castle;
|
||||
import com.l2jmobius.gameserver.model.entity.Fort;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Fortress Siege Manager AI.
|
||||
* @author St3eT
|
||||
*/
|
||||
public final class FortressSiegeManager extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int[] MANAGERS =
|
||||
{
|
||||
35659, // Shanty Fortress
|
||||
35690, // Southern Fortress
|
||||
35728, // Hive Fortress
|
||||
35759, // Valley Fortress
|
||||
35797, // Ivory Fortress
|
||||
35828, // Narsell Fortress
|
||||
35859, // Bayou Fortress
|
||||
35897, // White Sands Fortress
|
||||
35928, // Borderland Fortress
|
||||
35966, // Swamp Fortress
|
||||
36004, // Archaic Fortress
|
||||
36035, // Floran Fortress
|
||||
36073, // Cloud Mountain
|
||||
36111, // Tanor Fortress
|
||||
36142, // Dragonspine Fortress
|
||||
36173, // Antharas's Fortress
|
||||
36211, // Western Fortress
|
||||
36249, // Hunter's Fortress
|
||||
36287, // Aaru Fortress
|
||||
36318, // Demon Fortress
|
||||
36356, // Monastic Fortress
|
||||
};
|
||||
|
||||
private FortressSiegeManager()
|
||||
{
|
||||
addStartNpc(MANAGERS);
|
||||
addTalkId(MANAGERS);
|
||||
addFirstTalkId(MANAGERS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = null;
|
||||
switch (event)
|
||||
{
|
||||
case "FortressSiegeManager-11.html":
|
||||
case "FortressSiegeManager-13.html":
|
||||
case "FortressSiegeManager-14.html":
|
||||
case "FortressSiegeManager-15.html":
|
||||
case "FortressSiegeManager-16.html":
|
||||
{
|
||||
return htmltext = event;
|
||||
}
|
||||
case "register":
|
||||
{
|
||||
if (player.getClan() == null)
|
||||
{
|
||||
htmltext = "FortressSiegeManager-02.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
final L2Clan clan = player.getClan();
|
||||
final Fort fortress = npc.getFort();
|
||||
final Castle castle = npc.getCastle();
|
||||
|
||||
if (clan.getFortId() == fortress.getResidenceId())
|
||||
{
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
|
||||
html.setHtml(getHtm(player.getHtmlPrefix(), "FortressSiegeManager-12.html"));
|
||||
html.replace("%clanName%", fortress.getOwnerClan().getName());
|
||||
return html.getHtml();
|
||||
}
|
||||
else if (!player.hasClanPrivilege(ClanPrivilege.CS_MANAGE_SIEGE))
|
||||
{
|
||||
htmltext = "FortressSiegeManager-10.html";
|
||||
}
|
||||
else if ((clan.getLevel() < FortSiegeManager.getInstance().getSiegeClanMinLevel()))
|
||||
{
|
||||
htmltext = "FortressSiegeManager-04.html";
|
||||
}
|
||||
else if ((player.getClan().getCastleId() == castle.getResidenceId()) && (fortress.getFortState() == 2))
|
||||
{
|
||||
htmltext = "FortressSiegeManager-18.html";
|
||||
}
|
||||
else if ((clan.getCastleId() != 0) && (clan.getCastleId() != castle.getResidenceId()) && FortSiegeManager.getInstance().canRegisterJustTerritory())
|
||||
{
|
||||
htmltext = "FortressSiegeManager-17.html";
|
||||
}
|
||||
else if ((fortress.getTimeTillRebelArmy() > 0) && (fortress.getTimeTillRebelArmy() <= 7200))
|
||||
{
|
||||
htmltext = "FortressSiegeManager-19.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (npc.getFort().getSiege().addAttacker(player, true))
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
htmltext = "FortressSiegeManager-03.html";
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
htmltext = "FortressSiegeManager-07.html";
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
htmltext = "FortressSiegeManager-06.html";
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOUR_CLAN_HAS_BEEN_REGISTERED_TO_S1_S_FORTRESS_BATTLE);
|
||||
sm.addString(npc.getFort().getName());
|
||||
player.sendPacket(sm);
|
||||
htmltext = "FortressSiegeManager-05.html";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "cancel":
|
||||
{
|
||||
if (player.getClan() == null)
|
||||
{
|
||||
htmltext = "FortressSiegeManager-02.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
final L2Clan clan = player.getClan();
|
||||
final Fort fortress = npc.getFort();
|
||||
|
||||
if (clan.getFortId() == fortress.getResidenceId())
|
||||
{
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
|
||||
html.setHtml(getHtm(player.getHtmlPrefix(), "FortressSiegeManager-12.html"));
|
||||
html.replace("%clanName%", fortress.getOwnerClan().getName());
|
||||
return html.getHtml();
|
||||
}
|
||||
else if (!player.hasClanPrivilege(ClanPrivilege.CS_MANAGE_SIEGE))
|
||||
{
|
||||
htmltext = "FortressSiegeManager-10.html";
|
||||
}
|
||||
else if (!FortSiegeManager.getInstance().checkIsRegistered(clan, fortress.getResidenceId()))
|
||||
{
|
||||
htmltext = "FortressSiegeManager-09.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
fortress.getSiege().removeAttacker(player.getClan());
|
||||
htmltext = "FortressSiegeManager-08.html";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "warInfo":
|
||||
{
|
||||
htmltext = npc.getFort().getSiege().getAttackerClans().isEmpty() ? "FortressSiegeManager-20.html" : "FortressSiegeManager-21.html";
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
final Fort fortress = npc.getFort();
|
||||
final int fortOwner = fortress.getOwnerClan() == null ? 0 : fortress.getOwnerClan().getId();
|
||||
if (fortOwner == 0)
|
||||
{
|
||||
return "FortressSiegeManager.html";
|
||||
}
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
|
||||
html.setHtml(getHtm(player.getHtmlPrefix(), "FortressSiegeManager-01.html"));
|
||||
html.replace("%clanName%", fortress.getOwnerClan().getName());
|
||||
html.replace("%objectId%", npc.getObjectId());
|
||||
return html.getHtml();
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new FortressSiegeManager();
|
||||
}
|
||||
}
|
@@ -1,18 +0,0 @@
|
||||
<html><head><body scroll="no">
|
||||
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
|
||||
<tr><td valign="top" align="center">
|
||||
<!-- Invitation Emblem -->
|
||||
<table border=0 cellpadding=0 cellspacing=0>
|
||||
<tr><td width=256 height=185 background="L2UI_CT1.HtmlWnd_DF_TextureBeautyShop"></td></tr>
|
||||
</table>
|
||||
<!-- //Invitation Emblem -->
|
||||
<table border=0 cellpadding=0 cellspacing=0 width="272">
|
||||
<tr><td align="center">You will be moved to the Beauty Shop.</td></tr>
|
||||
<tr><td height="30"></td></tr>
|
||||
<tr><td align="center">
|
||||
<button action="bypass -h Quest LaVieEnRose beauty-change" value="OK" width="160" height="31" back="L2UI_CT1.Button_DF_Calculator_Down" fore="L2UI_CT1.Button_DF_Calculator">
|
||||
<button action="bypass -h Quest LaVieEnRose cancel" value="Cancel" width="160" height="31" back="L2UI_CT1.Button_DF_Calculator_Down" fore="L2UI_CT1.Button_DF_Calculator">
|
||||
</td></tr>
|
||||
</table>
|
||||
</td></tr></table>
|
||||
</body></html>
|
@@ -1,18 +0,0 @@
|
||||
<html><head><body scroll="no">
|
||||
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
|
||||
<tr><td valign="top" align="center">
|
||||
<!-- Invitation Emblem -->
|
||||
<table border=0 cellpadding=0 cellspacing=0>
|
||||
<tr><td width=256 height=185 background="L2UI_CT1.HtmlWnd_DF_TextureBeautyShop"></td></tr>
|
||||
</table>
|
||||
<!-- //Invitation Emblem -->
|
||||
<table border=0 cellpadding=0 cellspacing=0 width="272">
|
||||
<tr><td align="center">You will be moved to the Beauty Shop.</td></tr>
|
||||
<tr><td height="30"></td></tr>
|
||||
<tr><td align="center">
|
||||
<button action="bypass -h Quest LaVieEnRose beauty-restore" value="OK" width="160" height="31" back="L2UI_CT1.Button_DF_Calculator_Down" fore="L2UI_CT1.Button_DF_Calculator">
|
||||
<button action="bypass -h Quest LaVieEnRose cancel" value="Cancel" width="160" height="31" back="L2UI_CT1.Button_DF_Calculator_Down" fore="L2UI_CT1.Button_DF_Calculator">
|
||||
</td></tr>
|
||||
</table>
|
||||
</td></tr></table>
|
||||
</body></html>
|
@@ -1,19 +0,0 @@
|
||||
<html><head><body scroll="no">
|
||||
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
|
||||
<tr><td valign="top" align="center">
|
||||
<!-- Invitation Emblem -->
|
||||
<table border=0 cellpadding=0 cellspacing=0>
|
||||
<tr><td width=256 height=185 background="L2UI_CT1.HtmlWnd_DF_TextureBeautyShop"></td></tr>
|
||||
</table>
|
||||
<!-- //Invitation Emblem -->
|
||||
<table border=0 cellpadding=0 cellspacing=0 width="266" scroll="yes">
|
||||
<tr><td height="20"><font color="af9878">Use Beauty Shop</font></td></tr>
|
||||
<tr><td align="center">Change up your face and hair whenever you want! We can even hold your purchases here at the shop.<br></td></tr>
|
||||
<tr><td height="20"><font color="af9878">Hair Color</font></td></tr>
|
||||
<tr><td align="center">Hair colors are unique to hairdos, so be sure to buy a new hair color for a new hairdo even if you have the same color for a previous hairdo!<br></td></tr>
|
||||
<tr><td height="20"><font color="af9878">Hair Accessory On/Off Button</font></td></tr>
|
||||
<tr><td align="center">Don't forget that hair styles are visible only when the hair accessory button in your inventory is off!<br></td></tr>
|
||||
</table>
|
||||
</td></tr></table>
|
||||
<br><br>
|
||||
</body></html>
|
@@ -1,17 +0,0 @@
|
||||
<html><head><body scroll="no">
|
||||
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
|
||||
<tr><td valign="top" align="center">
|
||||
<!-- Invitation Emblem -->
|
||||
<table border=0 cellpadding=0 cellspacing=0>
|
||||
<tr><td width=256 height=185 background="L2UI_CT1.HtmlWnd_DF_TextureBeautyShop"></td></tr>
|
||||
</table>
|
||||
<!-- //Invitation Emblem -->
|
||||
<table border=0 cellpadding=0 cellspacing=0 width="272">
|
||||
<tr><td align="center" height="30"><font color="af9878">I'm sorry.</font></td></tr>
|
||||
<tr><td align="center">That's only available for characters <br> who have had their appearance changed at the Beauty Shop.</td></tr>
|
||||
<tr><td height="30"></td></tr>
|
||||
<tr><td align="center">
|
||||
<button action="bypass -h menu_select?ask=-81588&reply=6" value="OK" width="160" height="31" back="L2UI_CT1.Button_DF_Calculator_Down" fore="L2UI_CT1.Button_DF_Calculator"></td></tr>
|
||||
</table>
|
||||
</td></tr></table>
|
||||
</body></html>
|
@@ -1,22 +0,0 @@
|
||||
<html><head><body scroll="no">
|
||||
<table border=0 cellpadding=0 cellspacing=0 width=292 height=358 background="L2UI_CH3.refinewnd_back_Pattern">
|
||||
<tr><td valign="top" align="center">
|
||||
<!-- Invitation Emblem -->
|
||||
<table border=0 cellpadding=0 cellspacing=0>
|
||||
<tr><td width=256 height=175 background="L2UI_CT1.HtmlWnd_DF_TextureBeautyShop"></td></tr>
|
||||
</table>
|
||||
<!-- //Invitation Emblem -->
|
||||
<table border=0 cellpadding=0 cellspacing=0 width="272">
|
||||
<tr><td align="center" height="30"><font color="af9878">Welcome to our Beauty Shop.</font></td></tr>
|
||||
<tr><td align="center">We can change your hairstyle, or give you a completely new look.<br1>
|
||||
What do you say?</td></tr>
|
||||
<tr><td height="10"></td></tr>
|
||||
<tr><td align="center"><button action="bypass -h Quest LaVieEnRose 33825-1.html" value="Use Beauty Shop" width="200" height="31" back="L2UI_CT1.HtmlWnd_DF_BeautyShop_Down" fore="L2UI_CT1.HtmlWnd_DF_BeautyShop"></td></tr>
|
||||
<tr><td height="10"></td></tr>
|
||||
<tr><td align="center"><button action="bypass -h Quest LaVieEnRose restore_appearance" value="Restore Appearance" width="200" height="31" back="L2UI_CT1.HtmlWnd_DF_Reset_Down" fore="L2UI_CT1.HtmlWnd_DF_Reset"></td></tr>
|
||||
<tr><td height="10"></td></tr>
|
||||
<tr><td align="center"><button action="bypass -h Quest LaVieEnRose 33825-help.html" value="Help" width="200" height="31" back="L2UI_CT1.OlympiadWnd_DF_Info_Down" fore="L2UI_CT1.OlympiadWnd_DF_Info"></td></tr>
|
||||
<tr><td height="10"></td></tr>
|
||||
</table>
|
||||
</td></tr></table>
|
||||
</body></html>
|
@@ -1,154 +0,0 @@
|
||||
/*
|
||||
* 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.LaVieEnRose;
|
||||
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.ceremonyofchaos.CeremonyOfChaosEvent;
|
||||
import com.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExResponseBeautyList;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExResponseResetList;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExShowBeautyMenu;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* La Vie En Rose AI.
|
||||
* @author Sdw
|
||||
*/
|
||||
public final class LaVieEnRose extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private static final int LA_VIE_EN_ROSE = 33825;
|
||||
private static final int BEAUTY_SHOP_HELPER = 33854;
|
||||
|
||||
private LaVieEnRose()
|
||||
{
|
||||
addStartNpc(LA_VIE_EN_ROSE);
|
||||
addTalkId(LA_VIE_EN_ROSE);
|
||||
addFirstTalkId(LA_VIE_EN_ROSE);
|
||||
addSpawnId(BEAUTY_SHOP_HELPER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = null;
|
||||
switch (event)
|
||||
{
|
||||
case "33825.html":
|
||||
case "33825-1.html":
|
||||
case "33825-2.html":
|
||||
case "33825-help.html":
|
||||
{
|
||||
htmltext = event;
|
||||
break;
|
||||
}
|
||||
case "restore_appearance":
|
||||
{
|
||||
if (canUseBeautyShop(player))
|
||||
{
|
||||
if (player.getVariables().hasVariable("visualHairId") || player.getVariables().hasVariable("visualFaceId") || player.getVariables().hasVariable("visualHairColorId"))
|
||||
{
|
||||
htmltext = "33825-2.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "33825-norestore.html";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "beauty-change":
|
||||
{
|
||||
if (canUseBeautyShop(player))
|
||||
{
|
||||
player.sendPacket(new ExShowBeautyMenu(player, ExShowBeautyMenu.MODIFY_APPEARANCE));
|
||||
player.sendPacket(new ExResponseBeautyList(player, ExResponseBeautyList.SHOW_FACESHAPE));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "beauty-restore":
|
||||
{
|
||||
if (canUseBeautyShop(player))
|
||||
{
|
||||
player.sendPacket(new ExShowBeautyMenu(player, ExShowBeautyMenu.RESTORE_APPEARANCE));
|
||||
player.sendPacket(new ExResponseResetList(player));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "SPAM_TEXT":
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_BEAUTY_SHOP_IS_OPEN_COME_ON_IN);
|
||||
startQuestTimer("SPAM_TEXT2", 2500, npc, null);
|
||||
break;
|
||||
}
|
||||
case "SPAM_TEXT2":
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_CAN_LOOK_GOOD_TOO_BUDDY_COME_ON_COME_ON);
|
||||
startQuestTimer("SPAM_TEXT3", 2500, npc, null);
|
||||
break;
|
||||
}
|
||||
case "SPAM_TEXT3":
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EVERYONE_COME_ON_LET_S_GO_GANGNAM_STYLE);
|
||||
break;
|
||||
}
|
||||
case "cancel":
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
private boolean canUseBeautyShop(L2PcInstance player)
|
||||
{
|
||||
if (player.isInOlympiadMode() || OlympiadManager.getInstance().isRegistered(player))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_CANNOT_USE_THE_BEAUTY_SHOP_WHILE_REGISTERED_IN_THE_OLYMPIAD);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (player.isOnEvent(CeremonyOfChaosEvent.class))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_CANNOT_USE_THE_BEAUTY_SHOP_WHILE_REGISTERED_IN_THE_CEREMONY_OF_CHAOS);
|
||||
return false;
|
||||
}
|
||||
|
||||
// player.sendPacket(SystemMessageId.YOU_CANNOT_USE_THE_BEAUTY_SHOP_AS_THE_NPC_SERVER_IS_CURRENTLY_NOT_IN_FUNCTION);
|
||||
// player.sendPacket(SystemMessageId.YOU_CANNOT_USE_THE_BEAUTY_SHOP_WHILE_USING_THE_AUTOMATIC_REPLACEMENT);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
startQuestTimer("SPAM_TEXT", (5 * 60 * 1000), npc, null, true);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new LaVieEnRose();
|
||||
}
|
||||
}
|
@@ -1,159 +0,0 @@
|
||||
/*
|
||||
* 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.ManorManager;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.gameserver.instancemanager.CastleManorManager;
|
||||
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.events.EventType;
|
||||
import com.l2jmobius.gameserver.model.events.ListenerRegisterType;
|
||||
import com.l2jmobius.gameserver.model.events.annotations.Id;
|
||||
import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
|
||||
import com.l2jmobius.gameserver.model.events.annotations.RegisterType;
|
||||
import com.l2jmobius.gameserver.model.events.impl.character.npc.OnNpcManorBypass;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.BuyListSeed;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExShowCropInfo;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExShowManorDefaultInfo;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExShowProcureCropDetail;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExShowSeedInfo;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExShowSellCropList;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Manor manager AI.
|
||||
* @author malyelfik
|
||||
*/
|
||||
public final class ManorManager extends AbstractNpcAI
|
||||
{
|
||||
private static final int[] NPC =
|
||||
{
|
||||
35644,
|
||||
35645,
|
||||
35319,
|
||||
35366,
|
||||
36456,
|
||||
35512,
|
||||
35558,
|
||||
35229,
|
||||
35230,
|
||||
35231,
|
||||
35277,
|
||||
35103,
|
||||
35145,
|
||||
35187
|
||||
};
|
||||
|
||||
public ManorManager()
|
||||
{
|
||||
addStartNpc(NPC);
|
||||
addFirstTalkId(NPC);
|
||||
addTalkId(NPC);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = null;
|
||||
switch (event)
|
||||
{
|
||||
case "manager-help-01.htm":
|
||||
case "manager-help-02.htm":
|
||||
case "manager-help-03.htm":
|
||||
htmltext = event;
|
||||
break;
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if (Config.ALLOW_MANOR)
|
||||
{
|
||||
final int castleId = npc.getParameters().getInt("manor_id", -1);
|
||||
if (!player.canOverrideCond(PcCondOverride.CASTLE_CONDITIONS) && player.isClanLeader() && (castleId == player.getClan().getCastleId()))
|
||||
{
|
||||
return "manager-lord.htm";
|
||||
}
|
||||
return "manager.htm";
|
||||
}
|
||||
return getHtm(player.getHtmlPrefix(), "data/html/npcdefault.htm");
|
||||
}
|
||||
|
||||
// @formatter:off
|
||||
@RegisterEvent(EventType.ON_NPC_MANOR_BYPASS)
|
||||
@RegisterType(ListenerRegisterType.NPC)
|
||||
@Id({35644, 35645, 35319, 35366, 36456, 35512, 35558, 35229, 35230, 35231, 35277, 35103, 35145, 35187})
|
||||
// @formatter:on
|
||||
public final void onNpcManorBypass(OnNpcManorBypass evt)
|
||||
{
|
||||
final L2PcInstance player = evt.getActiveChar();
|
||||
if (CastleManorManager.getInstance().isUnderMaintenance())
|
||||
{
|
||||
player.sendPacket(SystemMessageId.THE_MANOR_SYSTEM_IS_CURRENTLY_UNDER_MAINTENANCE);
|
||||
return;
|
||||
}
|
||||
|
||||
final L2Npc npc = evt.getTarget();
|
||||
final int templateId = npc.getParameters().getInt("manor_id", -1);
|
||||
final int castleId = (evt.getManorId() == -1) ? templateId : evt.getManorId();
|
||||
switch (evt.getRequest())
|
||||
{
|
||||
case 1: // Seed purchase
|
||||
{
|
||||
if (templateId != castleId)
|
||||
{
|
||||
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.HERE_YOU_CAN_BUY_ONLY_SEEDS_OF_S1_MANOR).addCastleId(templateId));
|
||||
return;
|
||||
}
|
||||
player.sendPacket(new BuyListSeed(player.getAdena(), castleId));
|
||||
break;
|
||||
}
|
||||
case 2: // Crop sales
|
||||
player.sendPacket(new ExShowSellCropList(player.getInventory(), castleId));
|
||||
break;
|
||||
case 3: // Seed info
|
||||
player.sendPacket(new ExShowSeedInfo(castleId, evt.isNextPeriod(), false));
|
||||
break;
|
||||
case 4: // Crop info
|
||||
player.sendPacket(new ExShowCropInfo(castleId, evt.isNextPeriod(), false));
|
||||
break;
|
||||
case 5: // Basic info
|
||||
player.sendPacket(new ExShowManorDefaultInfo(false));
|
||||
break;
|
||||
case 6: // Buy harvester
|
||||
((L2MerchantInstance) npc).showBuyWindow(player, 300000 + npc.getId());
|
||||
break;
|
||||
case 9: // Edit sales (Crop sales)
|
||||
player.sendPacket(new ExShowProcureCropDetail(evt.getManorId()));
|
||||
break;
|
||||
default:
|
||||
_log.warning(getClass().getSimpleName() + ": Player " + player.getName() + " (" + player.getObjectId() + ") send unknown request id " + evt.getRequest() + "!");
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new ManorManager();
|
||||
}
|
||||
}
|
@@ -1,13 +0,0 @@
|
||||
<html><body>
|
||||
A manor refers to any property owned by the lord. Anything produced within its confines remains the exclusive property of the lord.<br>
|
||||
If you wish to be an agricultural producer, first you must buy a<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ManorManager manager-help-02.htm">seed</Button>
|
||||
and place it onto a monster. This can be easily accomplished while targeting.<br>
|
||||
When the monster, dies you will harvest a crop from its body. To harvest a crop, just target the corpse and use the harvester - if you don't have one, I'll happily sell you one! These crops are important to the manor, so after you've harvested them, bring the<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ManorManager manager-help-03.htm">crops</Button>
|
||||
to me!<br>
|
||||
I will then appraise them and give you an appropriate reward! I'll tell you about the rewards later...<br>
|
||||
<center>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
|
||||
</center>
|
||||
</body></html>
|
@@ -1,11 +0,0 @@
|
||||
<html><body>
|
||||
There are both regular and alternative types of seeds. If you plant a regular seed, a monster will hide an item and give you a crop of equivalent value instead.<br>
|
||||
When you plant alternative seed, you will receive a crop approximately half of the time, and an item the other half of the time.<br>
|
||||
The lord established this system to give people more choice in what to plan in a manor.<br>
|
||||
There are four kinds of seed--coda, cobol, codran and coba, available at different levels. Coda seeds are most appropriate for level 10 - 30 farmers, relatively low levels. Cobol seeds are for farmers between level 31 and 48. Codran seeds are best for level 49 - 64 farmers. Coba seeds are reserved for high level farmers of level 65 or above.<br>
|
||||
Obviously, different seeds grow different crops, and work better with certain monsters. A weak monster will produce a disappointing crop, but, on the other hand, if it is too strong, it may damage the crop.<br>
|
||||
One secret of a successful crop is to pick a monster with approximately the same power as the sower. Trying to sow a seed on a non-compliant monster can have disastrous consequences.<br>
|
||||
You may purchase any seed at any time, but the lord reserves the right not to purchase any crop at his discretion. You should always check to make sure that your crop is currently in demand.<br>
|
||||
Oh, and keep this part a secret, but I hear that other castles also buy crops, as long as that same crop can be purchased there. That's my backup plan in case the Lord changes his mind.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest ManorManager manager-help-01.htm">Back</Button>
|
||||
</body></html>
|
@@ -1,8 +0,0 @@
|
||||
<html><body>
|
||||
When a seed germinates inside a monster it becomes a crop. The best crops are harvested from monsters of a level similar to the sower.<br>
|
||||
Bring your harvested crops to me and you will be rewarded. The lord usually compensates farmers with items, some much more valuable than the crops.<br>
|
||||
Of course, you should be willing to gamble a little, right?<br>
|
||||
<center>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest ManorManager manager-help-01.htm">Back</Button>
|
||||
</center>
|
||||
</body></html>
|
@@ -1,5 +0,0 @@
|
||||
<html><body>
|
||||
My Lord! To what do I owe the honor of a personal visit?<br>
|
||||
I serve at your pleasure, my Lord!<br>
|
||||
I would never even think of stealing from you! Please believe me!<br>
|
||||
</body></html>
|
@@ -1,16 +0,0 @@
|
||||
<html><body>
|
||||
I'm a merchant dispatched by the Lord in order to sell Seeds from the Manor and purchase Special Products.<br>
|
||||
The seeds I'm selling can be sowed only in the Manor. But the Special Products can be sold in any castle. When selling to another castle, I will sell to another Manor on your behalf for a small fee.<br>
|
||||
The buying and selling of seeds for Special Products begin each day at 8 pm. Prepare in advance by referring to the Manor information begins to be displayed from 4:30 am, and come back at 8 pm. If you don't hurry, items can be sold out. Huh Huh<br>
|
||||
If you also have Special Products, sell them to me. The Lord will be glad.<br>
|
||||
If you perhaps don't know what the Manor or Special Product is, ask me anytime -- I will explain them to you in detail.<br>
|
||||
<center>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass manor_menu_select?ask=1&state=-1&time=0">Purchase Seeds</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass manor_menu_select?ask=2&state=-1&time=0">Settle Special Products</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass manor_menu_select?ask=3&state=-1&time=0">View the Manor information</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass manor_menu_select?ask=5&state=-1&time=0">View the basic Seed information</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass manor_menu_select?ask=6&state=-1&time=0">Purchase a Harvester</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_TerritoryStatus">Ask about the territory's current status</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ManorManager manager-help-01.htm">Listen</Button>
|
||||
</center>
|
||||
</body></html>
|
@@ -1,12 +0,0 @@
|
||||
<html><body>Mentor Guide:<br>
|
||||
Greetings adventurer!<br1>
|
||||
Are you skilled enough to teach others the path to glory or are you one who needs guidance in this difficult world?<br1>
|
||||
Is there anything I can help you with?<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest MentorGuide 33587-02.htm">"What is mentoring?"</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest MentorGuide 33587-05.htm">"How can I become a mentor or a mentee?"</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest MentorGuide 33587-06.htm">"What can I do if I become a mentor or a mentee?"</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest MentorGuide 33587-07.htm">"Tell me about the skills of mentors and mentees."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_multisell 839">"I want to use my Mentee's Mark."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest MentorGuide 33587-03.htm">"I'd like to exchange my Mentee Certificate for a Diploma."</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_multisell 840">"I want to use my Diploma."</Button>
|
||||
</body></html>
|
@@ -1,4 +0,0 @@
|
||||
<html><body>Mentor Guide:<br>
|
||||
If you allow me to break the fourth wall for a moment, new or returning players who have not played Lineage II in awhile might find some aspects of the game have changed or are a bit challenging. The Mentor/Mentee system was designed to help anyone who is in that situation. A more experienced player will fill the role as the Mentor, while the new or inexperienced player will be the Mentee.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest MentorGuide 33587-01.htm">Back</Button>
|
||||
</body></html>
|
@@ -1,5 +0,0 @@
|
||||
<html>><body>Mentor Guide:<br>
|
||||
If you are level 85 or higher and have a Mentee Certificate, I can exchange it for a Diploma.<br1>
|
||||
Diplomas can be traded for various beneficial items.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest MentorGuide exchange">"I want to exchange my Mentee Certificate for a Diploma."</Button>
|
||||
</body></html>
|
@@ -1,3 +0,0 @@
|
||||
<html><body>Mentor Guide:<br>
|
||||
It appears that you are missing one or more of the requirements in order for me to provide you assistance.<br>
|
||||
</body></html>
|
@@ -1,7 +0,0 @@
|
||||
<html><body>Mentor Guide:<br>
|
||||
A Mentor can open the Friend Manager window, click the <font color="LEVEL">Mentoring Tab</font>, and click + to invite a target as a Mentee.<br>
|
||||
If you are a mentor, you can use the mentoring screen to search characters who can become mentees. <br>
|
||||
You must be Level 85 or above and Awakened to be a mentor. Potential mentees must be Level 85 or under.<br1>
|
||||
If the mentor and mentee end their contract prematurely, the mentor must wait 2 days to find another mentee. If the mentee graduates, the mentor must wait 1 day to find another mentee. <br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest MentorGuide 33587-01.htm">Back</Button>
|
||||
</body></html>
|
@@ -1,6 +0,0 @@
|
||||
<html><body>Mentor Guide:<br>
|
||||
A mentor can guide up to 3 mentees at a time. Every time a mentee levels up, the mentor receives an item called Mentee's Mark in the mail. This mark can be exchanged for items useful after awakening.<br1>
|
||||
Between levels 1 and 50, the mentor receives mail every 10 levels. After level 50, the mentor receives mail each time a mentee levels up. Be sure to delete unnecessary mail, as you cannot receive new mail if your mailbox is full. <br>
|
||||
When a mentor and mentee are both online, they can receive a powerful ability-raising buff. The mentee can also receive XP and SP bonus buffs at this time. Awakening while having a mentor is called graduating. Upon graduating, a mentee receives a Mentee Certificate in the mail. Bring me the Mentee Certificate to receive a Diploma. Diplomas are good for various items.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest MentorGuide 33587-01.htm">Back</Button>
|
||||
</body></html>
|
@@ -1,6 +0,0 @@
|
||||
<html><body>Mentor Guide:<br>
|
||||
By becoming a mentor, you can apply strong buffs to your mentee.<br1>
|
||||
However, if the mentor and mentee are too far apart, it will be difficult to apply this skill. To resolve this issue, the mentee has a skill to summon the mentor.<br>
|
||||
Please refer to the clan / hero / mentoring skill categories in the skill window.<br>
|
||||
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest MentorGuide 33587-01.htm">Back</Button>
|
||||
</body></html>
|
@@ -1,554 +0,0 @@
|
||||
/*
|
||||
* 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.MentorGuide;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.commons.util.IGameXmlReader;
|
||||
import com.l2jmobius.gameserver.enums.CategoryType;
|
||||
import com.l2jmobius.gameserver.enums.MailType;
|
||||
import com.l2jmobius.gameserver.instancemanager.MailManager;
|
||||
import com.l2jmobius.gameserver.instancemanager.MentorManager;
|
||||
import com.l2jmobius.gameserver.model.L2Mentee;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.base.ClassLevel;
|
||||
import com.l2jmobius.gameserver.model.entity.Message;
|
||||
import com.l2jmobius.gameserver.model.events.EventType;
|
||||
import com.l2jmobius.gameserver.model.events.ListenerRegisterType;
|
||||
import com.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
|
||||
import com.l2jmobius.gameserver.model.events.annotations.RegisterType;
|
||||
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLevelChanged;
|
||||
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerMenteeAdd;
|
||||
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerMenteeLeft;
|
||||
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerMenteeRemove;
|
||||
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerMenteeStatus;
|
||||
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerMentorStatus;
|
||||
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerProfessionChange;
|
||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import com.l2jmobius.gameserver.model.skills.BuffInfo;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.mentoring.ExMentorList;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
|
||||
import ai.AbstractNpcAI;
|
||||
|
||||
/**
|
||||
* Mentor Guide AI.
|
||||
* @author Gnacik, UnAfraid
|
||||
*/
|
||||
public final class MentorGuide extends AbstractNpcAI implements IGameXmlReader
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger(MentorGuide.class.getName());
|
||||
|
||||
// NPCs
|
||||
private static final int MENTOR_GUIDE = 33587;
|
||||
// Items
|
||||
private static final int MENTEE_CERT = 33800;
|
||||
private static final int MENTEE_MARK = 33804;
|
||||
private static final int MENTEE_HEADPHONE = 34759;
|
||||
private static final int DIPLOMA = 33805;
|
||||
// Skills
|
||||
private static final SkillHolder[] MENTEE_BUFFS =
|
||||
{
|
||||
new SkillHolder(9233, 1), // Mentor's Guidance
|
||||
};
|
||||
// Skills
|
||||
private static final SkillHolder[] MENTEE_BUFFS_WITHOUT_MENTOR_ONLINE =
|
||||
{
|
||||
new SkillHolder(9227, 1), // Mentor's Poem of Horn
|
||||
new SkillHolder(9228, 1), // Mentor's Poem of Drum
|
||||
new SkillHolder(9229, 1), // Mentor's Poem of Lute
|
||||
new SkillHolder(9230, 1), // Mentor's Poem of Organ
|
||||
new SkillHolder(9231, 1), // Mentor's Poem of Guitar
|
||||
new SkillHolder(9232, 1), // Mentor's Poem of Harp
|
||||
new SkillHolder(17082, 1), // Mentor's Prevailing Sonata
|
||||
new SkillHolder(17083, 1), // Mentor's Daring Sonata
|
||||
new SkillHolder(17084, 1), // Mentor's Refreshing Sonata
|
||||
};
|
||||
protected static final SkillHolder[] MENTOR_BUFFS =
|
||||
{
|
||||
new SkillHolder(9256, 1), // Mentee's Appreciation;
|
||||
};
|
||||
private static final SkillHolder MENTEE_MENTOR_SUMMON = new SkillHolder(9379, 1); // Mentee's Mentor Summon
|
||||
private static final SkillHolder MENTOR_KNIGHTS_HARMONY = new SkillHolder(9376, 1); // Mentor's Knight's Harmony
|
||||
private static final SkillHolder MENTOR_WIZARDS_HARMONY = new SkillHolder(9377, 1); // Mentor's Wizard's Harmony
|
||||
private static final SkillHolder MENTOR_WARRIORS_HARMONY = new SkillHolder(9378, 1); // Mentor's Warrior's Harmony
|
||||
// Misc
|
||||
private static final int MAX_LEVEL = 85;
|
||||
private static final String LEVEL_UP_TITLE = "Mentee coin from Mentee leveling";
|
||||
private static final String LEVEL_UP_BODY = "Your mentee %s has reached level %d, so you are receiving some Mentee Coin. After Mentee Coin has successfully been removed and placed into your inventory please be sure to delete this letter. If your mailbox is full when any future letters are sent to you cannot be delivered and you will not receive these items.";
|
||||
private static final String MENTEE_ADDED_TITLE = "Congratulations on becoming a mentee.";
|
||||
private static final String MENTEE_ADDED_BODY = "Greetings. This is the Mentor Guide.\n\nYou will experience a world of unlimited adventures with your mentor, Exciting, isn't it?\n\nWhen you graduate from mentee status (upon awakening at level 85), you will receive a Mentee Certificate. If you bring it to me, I will give you a Diploma that you can exchange for R-grade equipment.";
|
||||
private static final String MENTEE_GRADUATE_TITLE = "Congratulations on your graduation";
|
||||
private static final String MENTEE_GRADUATE_BODY = "Greetings! This is the Mentor Guide.\nCongratulations! Did you enjoy the time with a mentor? Here is a Mentee Certificate for graduating.\n\nFind me in town, and I'll give you a Diploma if you show me your Mentee Certificatee. You'll also get a small graduation gift!\n\nNow, on to your next Adventure!";
|
||||
private static final Map<Integer, Integer> MENTEE_COINS = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void load()
|
||||
{
|
||||
parseDatapackFile("config/MentorCoins.xml");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded: " + MENTEE_COINS.size() + " mentee coins");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void parseDocument(Document doc, File f)
|
||||
{
|
||||
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
|
||||
{
|
||||
if ("list".equalsIgnoreCase(n.getNodeName()))
|
||||
{
|
||||
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
|
||||
{
|
||||
if ("mentee".equalsIgnoreCase(d.getNodeName()))
|
||||
{
|
||||
final int level = parseInteger(d.getAttributes(), "level");
|
||||
final int coins = parseInteger(d.getAttributes(), "coins");
|
||||
MENTEE_COINS.put(level, coins);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private MentorGuide()
|
||||
{
|
||||
addFirstTalkId(MENTOR_GUIDE);
|
||||
addStartNpc(MENTOR_GUIDE);
|
||||
addTalkId(MENTOR_GUIDE);
|
||||
load();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = event;
|
||||
|
||||
if (event.equalsIgnoreCase("exchange"))
|
||||
{
|
||||
if (hasQuestItems(player, MENTEE_CERT) && (player.getLevel() >= MAX_LEVEL) && (player.getClassId().level() == ClassLevel.AWAKEN.ordinal()))
|
||||
{
|
||||
takeItems(player, MENTEE_CERT, 1);
|
||||
giveItems(player, DIPLOMA, 40);
|
||||
return null;
|
||||
}
|
||||
htmltext = "33587-04.htm";
|
||||
}
|
||||
else if (event.startsWith("REMOVE_BUFFS"))
|
||||
{
|
||||
final String[] params = event.split(" ");
|
||||
if (Util.isDigit(params[1]))
|
||||
{
|
||||
final int objectId = Integer.valueOf(params[1]);
|
||||
MentorManager.getInstance().getMentees(objectId).stream().filter(Objects::nonNull).filter(L2Mentee::isOnline).forEach(mentee ->
|
||||
{
|
||||
final L2PcInstance menteePlayer = mentee.getPlayerInstance();
|
||||
if (menteePlayer != null)
|
||||
{
|
||||
for (SkillHolder holder : MENTEE_BUFFS)
|
||||
{
|
||||
menteePlayer.stopSkillEffects(holder.getSkill());
|
||||
}
|
||||
}
|
||||
mentee.sendPacket(new ExMentorList(mentee.getPlayerInstance()));
|
||||
});
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
return "33587-01.htm";
|
||||
}
|
||||
|
||||
@RegisterEvent(EventType.ON_PLAYER_MENTEE_ADD)
|
||||
@RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
|
||||
public void onMenteeAdded(OnPlayerMenteeAdd event)
|
||||
{
|
||||
// Starting buffs for Mentor
|
||||
for (SkillHolder sk : MENTOR_BUFFS)
|
||||
{
|
||||
sk.getSkill().applyEffects(event.getMentor(), event.getMentor());
|
||||
}
|
||||
|
||||
// Starting buffs for Mentee when mentor is online
|
||||
for (SkillHolder sk : MENTEE_BUFFS)
|
||||
{
|
||||
sk.getSkill().applyEffects(event.getMentee(), event.getMentee());
|
||||
}
|
||||
|
||||
// Starting buffs for Mentee
|
||||
for (SkillHolder sk : MENTEE_BUFFS_WITHOUT_MENTOR_ONLINE)
|
||||
{
|
||||
sk.getSkill().applyEffects(event.getMentee(), event.getMentee());
|
||||
}
|
||||
|
||||
// Update mentor list
|
||||
event.getMentor().sendPacket(new ExMentorList(event.getMentor()));
|
||||
|
||||
// Add the mentee skill
|
||||
handleMenteeSkills(event.getMentee());
|
||||
|
||||
// Give mentor's buffs only if he didn't had them.
|
||||
handleMentorSkills(event.getMentor());
|
||||
|
||||
// Send mail with the headphone
|
||||
sendMail(event.getMentee(), MENTEE_ADDED_TITLE, MENTEE_ADDED_BODY, MENTEE_HEADPHONE, 1);
|
||||
}
|
||||
|
||||
@RegisterEvent(EventType.ON_PLAYER_MENTEE_STATUS)
|
||||
@RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
|
||||
public void OnPlayerMenteeStatus(OnPlayerMenteeStatus event)
|
||||
{
|
||||
final L2PcInstance player = event.getMentee();
|
||||
|
||||
if (event.isMenteeOnline())
|
||||
{
|
||||
final L2Mentee mentor = MentorManager.getInstance().getMentor(player.getObjectId());
|
||||
if (mentor != null)
|
||||
{
|
||||
// Starting buffs for Mentee
|
||||
for (SkillHolder sk : MENTEE_BUFFS_WITHOUT_MENTOR_ONLINE)
|
||||
{
|
||||
sk.getSkill().applyEffects(player, player);
|
||||
}
|
||||
|
||||
if (mentor.isOnline())
|
||||
{
|
||||
//@formatter:off
|
||||
final long mentorBuffs = mentor.getPlayerInstance().getEffectList().getEffects()
|
||||
.stream()
|
||||
.map(BuffInfo::getSkill)
|
||||
.filter(Skill::isMentoring)
|
||||
.count();
|
||||
//@formatter:on
|
||||
|
||||
if (mentorBuffs != MENTOR_BUFFS.length)
|
||||
{
|
||||
// Starting buffs for Mentor
|
||||
for (SkillHolder sk : MENTOR_BUFFS)
|
||||
{
|
||||
sk.getSkill().applyEffects(mentor.getPlayerInstance(), mentor.getPlayerInstance());
|
||||
}
|
||||
}
|
||||
|
||||
// Starting buffs for Mentee
|
||||
for (SkillHolder sk : MENTEE_BUFFS)
|
||||
{
|
||||
sk.getSkill().applyEffects(player, player);
|
||||
}
|
||||
|
||||
// Add the mentee skill
|
||||
handleMenteeSkills(player);
|
||||
|
||||
mentor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_MENTEE_S1_HAS_CONNECTED).addCharName(player));
|
||||
mentor.sendPacket(new ExMentorList(mentor.getPlayerInstance()));
|
||||
}
|
||||
}
|
||||
player.sendPacket(new ExMentorList(player));
|
||||
}
|
||||
else
|
||||
{
|
||||
final L2Mentee mentor = MentorManager.getInstance().getMentor(player.getObjectId());
|
||||
if ((mentor != null) && mentor.isOnline())
|
||||
{
|
||||
if (MentorManager.getInstance().isAllMenteesOffline(mentor.getObjectId(), player.getObjectId()))
|
||||
{
|
||||
MentorManager.getInstance().cancelAllMentoringBuffs(mentor.getPlayerInstance());
|
||||
}
|
||||
|
||||
mentor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_MENTEE_S1_HAS_DISCONNECTED).addCharName(player));
|
||||
mentor.sendPacket(new ExMentorList(mentor.getPlayerInstance()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@RegisterEvent(EventType.ON_PLAYER_MENTOR_STATUS)
|
||||
@RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
|
||||
public void OnPlayerMentorStatus(OnPlayerMentorStatus event)
|
||||
{
|
||||
final L2PcInstance player = event.getMentor();
|
||||
|
||||
if (event.isMentorOnline())
|
||||
{
|
||||
// stop buffs removal task
|
||||
cancelQuestTimer("REMOVE_BUFFS " + player.getObjectId(), null, null);
|
||||
|
||||
MentorManager.getInstance().getMentees(player.getObjectId()).stream().filter(Objects::nonNull).filter(L2Mentee::isOnline).forEach(mentee ->
|
||||
{
|
||||
//@formatter:off
|
||||
final long menteeBuffs = mentee.getPlayerInstance().getEffectList().getEffects()
|
||||
.stream()
|
||||
.map(BuffInfo::getSkill)
|
||||
.filter(Skill::isMentoring)
|
||||
.count();
|
||||
//@formatter:on
|
||||
|
||||
if (menteeBuffs != MENTEE_BUFFS.length)
|
||||
{
|
||||
// Starting buffs for Mentee
|
||||
for (SkillHolder sk : MENTEE_BUFFS)
|
||||
{
|
||||
sk.getSkill().applyEffects(mentee.getPlayerInstance(), mentee.getPlayerInstance());
|
||||
}
|
||||
}
|
||||
|
||||
mentee.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_MENTOR_S1_HAS_CONNECTED).addCharName(player));
|
||||
mentee.sendPacket(new ExMentorList(mentee.getPlayerInstance()));
|
||||
});
|
||||
|
||||
if (MentorManager.getInstance().hasOnlineMentees(player.getObjectId()))
|
||||
{
|
||||
// Starting buffs for Mentor
|
||||
for (SkillHolder sk : MENTOR_BUFFS)
|
||||
{
|
||||
sk.getSkill().applyEffects(player, player);
|
||||
}
|
||||
}
|
||||
|
||||
// Give mentor's buffs only if he didn't had them.
|
||||
handleMentorSkills(player);
|
||||
|
||||
player.sendPacket(new ExMentorList(player));
|
||||
}
|
||||
else
|
||||
{
|
||||
startQuestTimer("REMOVE_BUFFS " + player.getObjectId(), 5 * 60 * 1000, null, null);
|
||||
MentorManager.getInstance().getMentees(player.getObjectId()).stream().filter(Objects::nonNull).filter(L2Mentee::isOnline).forEach(mentee ->
|
||||
{
|
||||
mentee.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_MENTOR_S1_HAS_DISCONNECTED).addCharName(player));
|
||||
mentee.sendPacket(new ExMentorList(mentee.getPlayerInstance()));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@RegisterEvent(EventType.ON_PLAYER_PROFESSION_CHANGE)
|
||||
@RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
|
||||
public void onProfessionChange(OnPlayerProfessionChange event)
|
||||
{
|
||||
final L2PcInstance player = event.getActiveChar();
|
||||
|
||||
if (player.isMentor())
|
||||
{
|
||||
// Give mentor's buffs only if he didn't had them.
|
||||
handleMentorSkills(player);
|
||||
return;
|
||||
}
|
||||
|
||||
// Not a mentee
|
||||
if (!player.isMentee())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
handleMenteeSkills(player);
|
||||
|
||||
if (player.isInCategory(CategoryType.AWAKEN_GROUP))
|
||||
{
|
||||
handleGraduateMentee(player);
|
||||
}
|
||||
}
|
||||
|
||||
@RegisterEvent(EventType.ON_PLAYER_LEVEL_CHANGED)
|
||||
@RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
|
||||
public void onLevelIncreased(OnPlayerLevelChanged event)
|
||||
{
|
||||
final L2PcInstance player = event.getActiveChar();
|
||||
|
||||
// Not a mentee
|
||||
if (!player.isMentee())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
checkLevelForReward(player); // Checking level to send a mail if is necessary
|
||||
|
||||
if (player.getLevel() > MAX_LEVEL)
|
||||
{
|
||||
handleGraduateMentee(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
final L2Mentee mentor = MentorManager.getInstance().getMentor(player.getObjectId());
|
||||
if ((mentor != null) && mentor.isOnline())
|
||||
{
|
||||
mentor.sendPacket(new ExMentorList(mentor.getPlayerInstance()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@RegisterEvent(EventType.ON_PLAYER_MENTEE_LEFT)
|
||||
@RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
|
||||
public void onMenteeLeft(OnPlayerMenteeLeft event)
|
||||
{
|
||||
final L2PcInstance player = event.getMentee();
|
||||
final L2PcInstance mentor = event.getMentor().getPlayerInstance();
|
||||
// Remove the mentee skills
|
||||
player.removeSkill(MENTEE_MENTOR_SUMMON.getSkill(), true);
|
||||
|
||||
// If player does not have any mentees anymore remove mentor skills.
|
||||
if ((mentor != null) && (MentorManager.getInstance().getMentees(mentor.getObjectId()) == null))
|
||||
{
|
||||
mentor.removeSkill(MENTOR_KNIGHTS_HARMONY.getSkill(), true);
|
||||
mentor.removeSkill(MENTOR_WIZARDS_HARMONY.getSkill(), true);
|
||||
mentor.removeSkill(MENTOR_WARRIORS_HARMONY.getSkill(), true);
|
||||
|
||||
// Clear the mentee
|
||||
mentor.sendPacket(new ExMentorList(mentor));
|
||||
}
|
||||
|
||||
// Clear mentee status
|
||||
player.sendPacket(new ExMentorList(player));
|
||||
}
|
||||
|
||||
@RegisterEvent(EventType.ON_PLAYER_MENTEE_REMOVE)
|
||||
@RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
|
||||
public void onMenteeRemove(OnPlayerMenteeRemove event)
|
||||
{
|
||||
final L2Mentee mentee = event.getMentee();
|
||||
final L2PcInstance mentor = event.getMentor();
|
||||
final L2PcInstance player = mentee.getPlayerInstance();
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
// Remove the mentee skills
|
||||
player.removeSkill(MENTEE_MENTOR_SUMMON.getSkill(), true);
|
||||
|
||||
// Clear mentee status
|
||||
player.sendPacket(new ExMentorList(player));
|
||||
}
|
||||
|
||||
// If player does not have any mentees anymore remove mentor skills.
|
||||
if (MentorManager.getInstance().getMentees(mentor.getObjectId()) == null)
|
||||
{
|
||||
mentor.removeSkill(MENTOR_KNIGHTS_HARMONY.getSkill(), true);
|
||||
mentor.removeSkill(MENTOR_WIZARDS_HARMONY.getSkill(), true);
|
||||
mentor.removeSkill(MENTOR_WARRIORS_HARMONY.getSkill(), true);
|
||||
}
|
||||
|
||||
// Remove mentee from the list
|
||||
event.getMentor().sendPacket(new ExMentorList(mentor));
|
||||
}
|
||||
|
||||
private void handleMenteeSkills(L2PcInstance player)
|
||||
{
|
||||
// Give mentee's buffs only if he didn't had them.
|
||||
if (player.getKnownSkill(MENTEE_MENTOR_SUMMON.getSkillId()) == null)
|
||||
{
|
||||
// Add the mentee skills
|
||||
player.addSkill(MENTEE_MENTOR_SUMMON.getSkill(), false);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleMentorSkills(L2PcInstance player)
|
||||
{
|
||||
// Give mentor's buffs only if he didn't had them.
|
||||
if (player.getKnownSkill(MENTOR_KNIGHTS_HARMONY.getSkillId()) == null)
|
||||
{
|
||||
// Add the mentor skills
|
||||
player.addSkill(MENTOR_KNIGHTS_HARMONY.getSkill(), false);
|
||||
player.addSkill(MENTOR_WIZARDS_HARMONY.getSkill(), false);
|
||||
player.addSkill(MENTOR_WARRIORS_HARMONY.getSkill(), false);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleGraduateMentee(L2PcInstance player)
|
||||
{
|
||||
MentorManager.getInstance().cancelAllMentoringBuffs(player);
|
||||
final L2Mentee mentor = MentorManager.getInstance().getMentor(player.getObjectId());
|
||||
if (mentor != null)
|
||||
{
|
||||
MentorManager.getInstance().setPenalty(mentor.getObjectId(), Config.MENTOR_PENALTY_FOR_MENTEE_COMPLETE);
|
||||
MentorManager.getInstance().deleteMentor(mentor.getObjectId(), player.getObjectId());
|
||||
|
||||
if (mentor.isOnline())
|
||||
{
|
||||
mentor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_AWAKENED_AND_THE_MENTOR_MENTEE_RELATIONSHIP_HAS_ENDED_THE_MENTOR_CANNOT_OBTAIN_ANOTHER_MENTEE_FOR_ONE_DAY_AFTER_THE_MENTEE_S_GRADUATION).addPcName(player));
|
||||
|
||||
if (MentorManager.getInstance().isAllMenteesOffline(mentor.getObjectId(), player.getObjectId()))
|
||||
{
|
||||
MentorManager.getInstance().cancelAllMentoringBuffs(mentor.getPlayerInstance());
|
||||
}
|
||||
mentor.sendPacket(new ExMentorList(mentor.getPlayerInstance()));
|
||||
}
|
||||
|
||||
// Remove the mentee skills
|
||||
player.removeSkill(MENTEE_MENTOR_SUMMON.getSkill(), true);
|
||||
|
||||
// Clear mentee status
|
||||
player.sendPacket(new ExMentorList(player));
|
||||
|
||||
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_MENTOR_MENTEE_RELATIONSHIP_WITH_YOUR_MENTOR_S1_HAS_ENDED_AS_YOU_ARE_AN_AWAKENED_CHARACTER_OF_LV_85_OR_ABOVE_YOU_CAN_NO_LONGER_BE_PAIRED_WITH_A_MENTOR).addPcName(player));
|
||||
|
||||
sendMail(player, MENTEE_GRADUATE_TITLE, MENTEE_GRADUATE_BODY, MENTEE_CERT, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies if player is mentee and if his current level should reward his mentor and if so sends a mail with reward.
|
||||
* @param player
|
||||
*/
|
||||
private void checkLevelForReward(L2PcInstance player)
|
||||
{
|
||||
if (!MENTEE_COINS.containsKey(player.getLevel()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final L2Mentee mentor = MentorManager.getInstance().getMentor(player.getObjectId());
|
||||
if (mentor == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int amount = MENTEE_COINS.get(player.getLevel());
|
||||
if (amount > 0)
|
||||
{
|
||||
sendMail(mentor.getObjectId(), player, LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
||||
}
|
||||
}
|
||||
|
||||
private void sendMail(L2PcInstance player, String title, String body, int itemId, long amount)
|
||||
{
|
||||
sendMail(player.getObjectId(), player, title, body, itemId, amount);
|
||||
}
|
||||
|
||||
private void sendMail(int objectId, L2PcInstance player, String title, String body, int itemId, long amount)
|
||||
{
|
||||
final Message msg = new Message(MENTOR_GUIDE, objectId, title, body, MailType.MENTOR_NPC);
|
||||
msg.createAttachments().addItem(getName(), itemId, amount, null, player);
|
||||
|
||||
MailManager.getInstance().sendMessage(msg);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new MentorGuide();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user