Skip to content
Snippets Groups Projects
Commit ad8265e2 authored by St3eT's avatar St3eT
Browse files

BETA: Reworked '''Lekon''' AI.

* Reviewed by: Zoey76, !UnAfraid
parent bb5558dd
No related branches found
No related tags found
No related merge requests found
......@@ -37,6 +37,7 @@ ai/npc/FortuneTelling/FortuneTelling.java
ai/npc/FreyasSteward/FreyasSteward.java
ai/npc/Jinia/Jinia.java
ai/npc/KetraOrcSupport/KetraOrcSupport.java
ai/npc/Lekon/Lekon.java
ai/npc/MercenaryCaptain/MercenaryCaptain.java
ai/npc/Minigame/Minigame.java
ai/npc/MonumentOfHeroes/MonumentOfHeroes.java
......@@ -335,7 +336,6 @@ vehicles/BoatRunePrimeval.java
vehicles/AirShipGludioGracia/AirShipGludioGracia.java
# AirShip Controllers
vehicles/EngineerLekon/EngineerLekon.java
vehicles/KeucereusNorthController/KeucereusNorthController.java
vehicles/KeucereusSouthController/KeucereusSouthController.java
vehicles/SoIController/SoIController.java
......
......@@ -3,5 +3,5 @@ Airship, eh? If you want board an Airship, you need to first register for a Summ
Only <font color="LEVEL">clan lords whose clan is level 5 or higher</font> may earn the license. There is also a limit on the number of Airships.<br>
If you meet the requirements, you can obtain a Airship Summon License in exchange for <font color="LEVEL">10 Energy Star Stones</font>.<br>
An Energy Star Stone can be made by assembling Star Stones found floating in the skies over Gracia. If you thinkk this is too time-consuming, you can also buy them from Officer Tolonis right over there..<br>
<a action="bypass -h Quest EngineerLekon license">Obtain the Airship Summon License.</a>
<a action="bypass -h Quest Lekon licence">Obtain the Airship Summon License.</a>
</body></html>
\ No newline at end of file
<html><body>Engineer Lekon:<br>
Only a clan lord whose clan is level 5 or above can be issued an Airship Summon License.
</body></html>
\ No newline at end of file
<html><head><body>Engineer Lekon:<br>
You don't have enough Energy Star Stones yet. You can make them by assembling Star Stones found floating in the skies over Gracia. If you prefer, you can also purchase them from Officer Tolonis.
</body></html>
\ No newline at end of file
<html><body>Engineer Lekon:<br>
Hey, I see here that you already have a Airship Summon License! Haven't you registered it yet? Or did you lose it already?
</body></html>
\ No newline at end of file
......@@ -2,6 +2,6 @@
I'm too busy to take a breath! I'm supposed to maintain all these Airships and air vehicles by myself?! How does that make sense?<br>
And it's all very detailed, time-consuming work with no margin for error. Somebody up there must really hate me!<br>
Well, at least they supply me with the materials I need. Hey, adventurer! You must know how to use Airships or air vehicles. Care to lend me a hand?<br>
<a action="bypass -h Quest EngineerLekon 32557-1.htm">Ask about Airship Summon License.</a><br>
<a action="bypass -h Quest Lekon 32557-01.html">Ask about Airship Summon License.</a><br>
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
</body></html>
\ No newline at end of file
......@@ -16,79 +16,82 @@
* 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 vehicles.EngineerLekon;
package ai.npc.Lekon;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.instancemanager.AirShipManager;
import com.l2jserver.gameserver.model.L2Clan;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
public final class EngineerLekon extends Quest
/**
* Lekon AI.
* @author St3eT
*/
public final class Lekon extends AbstractNpcAI
{
// NPCs
private static final int LEKON = 32557;
// Items
private static final int LICENCE = 13559; // Airship Summon License
private static final int STONE = 13277; // Energy Star Stone
// Misc
private static final int MIN_CLAN_LV = 5;
private static final int STONE_COUNT = 10;
private static final int LICENSE = 13559;
private static final int STARSTONE = 13277;
private static final int LICENSE_COST = 10;
private static final SystemMessage SM_NEED_CLANLVL5 = SystemMessage.getSystemMessage(SystemMessageId.THE_AIRSHIP_NEED_CLANLVL_5_TO_SUMMON);
private static final SystemMessage SM_NO_PRIVS = SystemMessage.getSystemMessage(SystemMessageId.THE_AIRSHIP_NO_PRIVILEGES);
private static final SystemMessage SM_LICENSE_ALREADY_ACQUIRED = SystemMessage.getSystemMessage(SystemMessageId.THE_AIRSHIP_SUMMON_LICENSE_ALREADY_ACQUIRED);
private EngineerLekon()
private Lekon()
{
super(-1, EngineerLekon.class.getSimpleName(), "vehicles");
addStartNpc(LEKON);
super(Lekon.class.getSimpleName(), "ai/npc");
addFirstTalkId(LEKON);
addTalkId(LEKON);
addStartNpc(LEKON);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if ("license".equalsIgnoreCase(event))
String htmltext = null;
switch (event)
{
if ((player.getClan() == null) || (player.getClan().getLevel() < 5))
{
player.sendPacket(SM_NEED_CLANLVL5);
return null;
}
if (!player.isClanLeader())
case "32557-01.html":
{
player.sendPacket(SM_NO_PRIVS);
return null;
htmltext = event;
break;
}
if (AirShipManager.getInstance().hasAirShipLicense(player.getClanId()))
case "licence":
{
player.sendPacket(SM_LICENSE_ALREADY_ACQUIRED);
return null;
final L2Clan clan = player.getClan();
if ((clan == null) || !player.isClanLeader() || (clan.getLevel() < MIN_CLAN_LV))
{
htmltext = "32557-02.html";
}
else if (hasAtLeastOneQuestItem(player, LICENCE))
{
htmltext = "32557-04.html";
}
else if (AirShipManager.getInstance().hasAirShipLicense(clan.getId()))
{
player.sendPacket(SystemMessageId.THE_AIRSHIP_SUMMON_LICENSE_ALREADY_ACQUIRED);
}
else if (getQuestItemsCount(player, STONE) >= STONE_COUNT)
{
takeItems(player, STONE, STONE_COUNT);
giveItems(player, LICENCE, 1);
}
else
{
htmltext = "32557-03.html";
}
break;
}
if (player.getInventory().getItemByItemId(LICENSE) != null)
{
player.sendPacket(SM_LICENSE_ALREADY_ACQUIRED);
return null;
}
if (!player.destroyItemByItemId("AirShipLicense", STARSTONE, LICENSE_COST, npc, true))
{
return null;
}
player.addItem("AirShipLicense", LICENSE, 1, npc, true);
return null;
}
return event;
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
return npc.getId() + ".htm";
return htmltext;
}
public static void main(String[] args)
public static void main(String args[])
{
new EngineerLekon();
new Lekon();
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment