This commit is contained in:
9
trunk/dist/game/data/scripts/ai/npc/Alexandria/30098-02.html
vendored
Normal file
9
trunk/dist/game/data/scripts/ai/npc/Alexandria/30098-02.html
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<html><body>Trader Alexandria:<br><br>
|
||||
Ah, you have excellent taste! This bracelet is truly unique. In fact, it is said that it contains an <font color="LEVEL">Agathion</font>. Quite a find, eh? Wondering if it is for sale? Of course it is -- that's why I'm here!<br>
|
||||
Both this <font color="LEVEL">Little Angel Agathion Bracelet</font> and this <font color="LEVEL">Little Devil Agathion Bracelet</font> were discovered by another group of adventurers while exploring some ancient ruins. I am positive that they contain Agathions! Of course, no one knows for sure the power an Agathion possesses or how long it lasts. I have been reluctant to experiment on them because it's clear that some of the bracelets possess only limited magic power.<br>
|
||||
Others have more, however. What you get depends on your luck, I'm afraid.<br>
|
||||
To get either the angel or devil bracelet, you must bring me <font color="LEVEL">10 Fish Bones</font>, <font color="LEVEL">10 Fish Scales</font>, <font color="LEVEL">10 units of Fish Oil</font>, <font color="LEVEL">10 Fish Fins</font>, <font color="LEVEL">10 Fish Gems</font>, <font color="LEVEL">5 units of Whale Blubber</font>, and <font color="LEVEL">3,000,000 Adena</font>. I wish I could part with them in exchange for crystals as I normally would, but the adventurers who delivered the bracelets here insisted on these other items for payment.<br>
|
||||
Even so, I still believe this is a reasonable price. After all, an Agathion isn't something you run across every day, eh? So, would you like to buy one?<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alexandria littleAngel">Purchase the Little Angel Agathion Bracelet</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alexandria littleDevil">Purchase the Little Devil Agathion Bracelet</Button>
|
||||
</body></html>
|
4
trunk/dist/game/data/scripts/ai/npc/Alexandria/30098-03.html
vendored
Normal file
4
trunk/dist/game/data/scripts/ai/npc/Alexandria/30098-03.html
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Trader Alexandria:<br>
|
||||
Yes, I've checked the necessary items. Thank you for your hard work.<br>
|
||||
I'm telling you ahead that I don't know for sure what kind of power each bracelet has. I only can tell you that the angel-engraved bracelet has an angel-type Agathion, and the devil-engraved one has a devil-type Agathion. You can find out the capability and magic power of each Agathion on your own.
|
||||
</body></html>
|
6
trunk/dist/game/data/scripts/ai/npc/Alexandria/30098-03a.html
vendored
Normal file
6
trunk/dist/game/data/scripts/ai/npc/Alexandria/30098-03a.html
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Trader Alexandria:<br>
|
||||
Yes, I checked the necessary items. It must have been difficult to obtain them all!<br>
|
||||
I must warn you that I do not know for sure what kind of power posessed by each bracelet. I only can tell you that the Angel's Bracelet contains an angel-type Agathion, while the Devil's Bracelet contains a devil-type Agathion. You must discover the capability and magic power of each on your own.<br>
|
||||
Here, please take this as an extra token of my appreciation for your business...<br>
|
||||
(I have a strange feeling about that bracelet -- I hope this adventurer will simply take this and leave here immediately.)
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/ai/npc/Alexandria/30098-04.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/npc/Alexandria/30098-04.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Trader Alexandria:<br>
|
||||
Oh, you don't have the items required to buy either the Angel's Bracelet or the Devil's Bracelet. In order to obtain one, you must first bring me <font color="LEVEL">25 Big Red Nimble Fish</font>, <font color="LEVEL">50 Great Codrans</font>, and <font color="LEVEL">4 Memento Moris, 5 Earth Eggs, 5 Nonliving Nuclei, 3 Dragon Hearts</font>, and <font color="LEVEL">7,500,000 Adena</font>.
|
||||
</body></html>
|
9
trunk/dist/game/data/scripts/ai/npc/Alexandria/30098.html
vendored
Normal file
9
trunk/dist/game/data/scripts/ai/npc/Alexandria/30098.html
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<html><body>Trader Alexandria:<br>
|
||||
Welcome! Thank you so much for visiting our boutique. We sell precious and valuable things that you would never find anywhere else. We've also added some luxury accessories this time. Look around see if you can find anything you like.<br>
|
||||
Ah! Now, you can use <font color="LEVEL">Adena</font> to pay for your goods.<br>
|
||||
If you would like to purchase a weapon, please ask my husband.<br>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_multisell 300984001">Purchase Armor</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_multisell 300984002">Purchase supplies</Button>
|
||||
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Alexandria 30098-02.html">Purchase an Agathion Bracelet</Button>
|
||||
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
|
||||
</body></html>
|
147
trunk/dist/game/data/scripts/ai/npc/Alexandria/Alexandria.java
vendored
Normal file
147
trunk/dist/game/data/scripts/ai/npc/Alexandria/Alexandria.java
vendored
Normal file
@@ -0,0 +1,147 @@
|
||||
/*
|
||||
* 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.Alexandria;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import ai.npc.AbstractNpcAI;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.holders.ItemHolder;
|
||||
import com.l2jserver.gameserver.model.holders.QuestItemHolder;
|
||||
|
||||
/**
|
||||
* Alexandria (Armor Merchant) AI.
|
||||
* @author xban1x
|
||||
*/
|
||||
public final class Alexandria extends AbstractNpcAI
|
||||
{
|
||||
// NPC
|
||||
private static final int ALEXANDRIA = 30098;
|
||||
// Items
|
||||
private static final ItemHolder[] REQUIRED_ITEMS = new ItemHolder[]
|
||||
{
|
||||
new ItemHolder(57, 3550000),
|
||||
new ItemHolder(5094, 400),
|
||||
new ItemHolder(6471, 200),
|
||||
new ItemHolder(9814, 40),
|
||||
new ItemHolder(9815, 30),
|
||||
new ItemHolder(9816, 50),
|
||||
new ItemHolder(9817, 50),
|
||||
};
|
||||
// Agathions
|
||||
private static final QuestItemHolder[] LITTLE_DEVILS = new QuestItemHolder[]
|
||||
{
|
||||
new AdditionalQuestItemHolder(10321, 600, 1, 10408),
|
||||
new QuestItemHolder(10322, 10),
|
||||
new QuestItemHolder(10323, 10),
|
||||
new QuestItemHolder(10324, 5),
|
||||
new QuestItemHolder(10325, 5),
|
||||
new QuestItemHolder(10326, 370),
|
||||
};
|
||||
private static final QuestItemHolder[] LITTLE_ANGELS = new QuestItemHolder[]
|
||||
{
|
||||
new AdditionalQuestItemHolder(10315, 600, 1, 10408),
|
||||
new QuestItemHolder(10316, 10),
|
||||
new QuestItemHolder(10317, 10),
|
||||
new QuestItemHolder(10318, 5),
|
||||
new QuestItemHolder(10319, 5),
|
||||
new QuestItemHolder(10320, 370),
|
||||
};
|
||||
private static final Map<String, List<QuestItemHolder>> AGATHIONS = new HashMap<>();
|
||||
static
|
||||
{
|
||||
AGATHIONS.put("littleAngel", Arrays.asList(LITTLE_ANGELS));
|
||||
AGATHIONS.put("littleDevil", Arrays.asList(LITTLE_DEVILS));
|
||||
}
|
||||
|
||||
private Alexandria()
|
||||
{
|
||||
super(Alexandria.class.getSimpleName(), "ai/npc");
|
||||
addStartNpc(ALEXANDRIA);
|
||||
addTalkId(ALEXANDRIA);
|
||||
addFirstTalkId(ALEXANDRIA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = null;
|
||||
if (event.equals("30098-02.html"))
|
||||
{
|
||||
htmltext = event;
|
||||
}
|
||||
else if (AGATHIONS.containsKey(event))
|
||||
{
|
||||
final int chance = getRandom(1000);
|
||||
int chance2 = 0;
|
||||
int chance3 = 0;
|
||||
for (QuestItemHolder agathion : AGATHIONS.get(event))
|
||||
{
|
||||
chance3 += agathion.getChance();
|
||||
if ((chance >= chance2) && (chance2 < chance3))
|
||||
{
|
||||
if (takeAllItems(player, REQUIRED_ITEMS))
|
||||
{
|
||||
giveItems(player, agathion);
|
||||
htmltext = "30098-03.html";
|
||||
|
||||
if (agathion instanceof AdditionalQuestItemHolder)
|
||||
{
|
||||
giveItems(player, ((AdditionalQuestItemHolder) agathion).getAdditionalId(), 1);
|
||||
htmltext = "30098-03a.html";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "30098-04.html";
|
||||
}
|
||||
break;
|
||||
}
|
||||
chance2 += agathion.getChance();
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
public static class AdditionalQuestItemHolder extends QuestItemHolder
|
||||
{
|
||||
private final int _additionalId;
|
||||
|
||||
public AdditionalQuestItemHolder(int id, int chance, long count, int additionalId)
|
||||
{
|
||||
super(id, chance, count);
|
||||
_additionalId = additionalId;
|
||||
}
|
||||
|
||||
public int getAdditionalId()
|
||||
{
|
||||
return _additionalId;
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new Alexandria();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user