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

View File

@@ -0,0 +1,10 @@
<html><body>Transformation Wizard Avant-Garde:<br>
I am Avant-Garde, the Transformation Wizard. I have long wandered through the land and only recently settled here.<br>
In fact, my young friend, I am not a wizard of the Ivory Tower. You look surprised! Heh. Think of me as a wanderer who acquired a special power quite by chance... My magic, however, requires some very specialized items.<br>
If you have acquired these unique items from the dark wizard in Hardin's Academy, then perhaps I can help you.<br>
<a action="bypass -h Quest AvantGarde 32323-02.html">Ask about transformation.</a><br>
<a action="bypass -h Quest AvantGarde LearnTransformationSkill">Learn transformation.</a><br>
<a action="bypass -h Quest AvantGarde BuyTransformationItems">Purchase items related to transformation.</a><br>
<a action="bypass -h Quest AvantGarde 32323-05a.html">Learn about subclass certification.</a><br>
<a action="bypass -h npc_%objectId%_Quest">Quest.</a>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Wizard of Trasformation Avant-Garde:<br>
What do you wish to know about transformation?<br>
<br>
<a action="bypass -h Quest AvantGarde 32323-02a.html">"What do I need to know about transformation?"</a><br>
<a action="bypass -h Quest AvantGarde 32323-02b.html">"What do I need to do to transform into another shape?"</a><br>
<a action="bypass -h Quest AvantGarde 32323-02c.html">"What do I need to know before transformation?"</a>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Transformation Wizard Avant-Garde:<br>
To learn the magic of transformation, you will need to receive special training.<br>
Find the Wizard of Darkness, who lives at Hardin's Academy. He will open the path to transformation.<br>
You must have reached at least <font color="LEVEL">level 50 </font> to embark on this path.<br>
You will also need a special seal. I do not know how you can obtain it, but without it transformation is impossible.<br>
<a action="bypass -h Quest AvantGarde 32323-02.html">Back.</a>
</body></html>

View File

@@ -0,0 +1,5 @@
<html><body>Transformation Wizard Avant-Garde:<br>
After you have been guided through the process of transformation by a wizard, you may transform yourself into another shape by bringing a transform sealbook to me.<br>
Know that it is no easy task to earn one. I have heard, however, that you may find one through the Marketeer of Mammon or the Adventure Guild.<br>
<a action="bypass -h Quest AvantGarde 32323-02.html">Back.</a>
</body></html>

View File

@@ -0,0 +1,5 @@
<html><body>Transformation Wizard Avant-Garde:<br>
You must remember that once you have been transformed, you must not go into <font color="LEVEL">deep water</font>. Once you have reverted to your original form, your soul will need time to recover -- you will not be able to transform again for some time. Understand?<br>
Other than that... Each individual soul contains its own <font color="LEVEL">unique character</font>. If you transform into something that matches that character, you may earn some benefits. Think of it as wearing a suit of clothes that fit you perfectly. Every race has its own respective "figure," so I advise you to do a little research about what kind of transformation would fit you best.<br>
<a action="bypass -h Quest AvantGarde 32323-02.html">Back.</a>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Transformation Wizard Avant-Garde:<br>
This is not a path for every one. It is meaningless for me to even teach you Transformation until you have proven your ability.<br>
Meet the great wizard who uses black magic, open the road of Transformation, and then return to me.
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Transformation Wizard Avant-Garde:<br>
You must be able to transform in order to buy transformation-related goods.<br>
Find a great wizard who wields black magic and can open the path to transformation for you. Then you may return here.
</body></html>

View File

@@ -0,0 +1,10 @@
<html><body>Transformation Wizard Avant-Garde:<br>
If your subclass skill is above a certain level, you can transfer that power to your main class.<br>
Because this is a very dangerous mission, however, you must be certified in order to carry it out.<br>
If you were certified by your subclass master and have brought the certificate, I will transfer some of your subclass power to your main class.<br>
Be warned: this will inflict a serious shock to your soul. You must strengthen it in preparation for this rite.<br>
In order to learn certified subclass skills, you must first speak to Hardin and obtain the first sealbook. Hardin's Academy is in Dragon Valley.<br>
Do you wish to proceed?<br>
<a action="bypass -h Quest AvantGarde LearnSubClassSkill">Learn skills.</a><br>
<a action="bypass -h Quest AvantGarde 32323-06.html">Return.</a>
</body></html>

View File

@@ -0,0 +1,5 @@
<html><body>Transformation Wizard Avant-Garde:<br>
What do you wish to know about subclass certification?<br>
<a action="bypass -h Quest AvantGarde 32323-05.html">Learn skills of the certified subclass.</a><br>
<a action="bypass -h Quest AvantGarde 32323-05no.html">Certification removal.</a>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Transformation Wizard Avant-Garde:<br>
It is a tremendous endeavor to obtain subclass certification and learn the appropriate skills. Beyond the purely physical effort, the burden on your soul is beyond your imagination... It is almost a suicidal venture.<br>
However, the process can be undone. There is a special kind of herb that can be used to remove your previously chosen skills. The price of the herb, though, is approximately <font color="LEVEL">10 million Adena</font>... I have the herb here, so I can cancel the certification anytime once you have paid.<br>
If the certification is canceled, <font color="LEVEL">the current certification status and skills will vanish immediately -- poof!</font> Now then, do you really wish to cancel certification?<br>
<a action="bypass -h Quest AvantGarde CancelCertification">Cancel certification.</a><br>
<a action="bypass -h Quest AvantGarde 32323-06no.html">Return.</a>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Transformation Wizard Avant-Garde:<br>
If you want to give up, I cannot help you.<br>
To use the subclass power in the main class requires a great deal of power, after all.
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Transformation Wizard Avant-Garde:<br>
An excellent decision, I think. In fact, it is very difficult to even get the herb. Since there's no one except that vicious Dark Wizard who lives in Dragon Valley who knows the technique, I didn't feel like it either...<br>
But isn't it a pity to throw away all of the skills for which you have already been certified?
</body></html>

View File

@@ -0,0 +1,5 @@
<html><body>Transformation Wizard Avant-garde:<br>
A great deal of soul energy is needed to transfer subclass powers to the main class. Although you vanquished the Bridle of Soul by Mimir's Elixir, it is not so easy to practice it.<br>
To utilize the subclass power, you must be ritually cleansed by both the <font color="LEVEL">Dark Wizard and Mimir's Elixir</font>. Visit the Dark Wizard inside the Dragon Valley to obtain the magic power of transformation.<br>
Once you have learned the magic power of transformation, <font color="LEVEL">visit a subclass master</font> in order to certify your ability. Then come back to me on your main class.
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Transformation Wizard Avant-Garde:<br>
To transfer the sub-class power, <font color="LEVEL">make your current class your main class and bring me either a certificate or a Scroll of Transformation</font>.
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Transformation Wizard Avant-Garde:<br>
As I just told you, you need 10 million Adena.<br>
I don't see that much money on you...
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Transformation Wizard Avant-Garde:<br>
Then I have no choice...<br>
Your certifications are all canceled in exchange for <font color="LEVEL">10 million Adena</font>. However, that does not change the fact that you are very skilled. Why don't you find another master and obtain the certification you want?
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Transformation Wizard Avant-Garde:<br>
What are you going to cancel? You have neither certification nor the related skills.<br>
This herb is very rare -- unless you really need it, I would rather not use it.
</body></html>

View File

@@ -0,0 +1,338 @@
package ai.npc.AvantGarde;
import java.util.List;
import ai.npc.AbstractNpcAI;
import com.l2jserver.Config;
import com.l2jserver.gameserver.datatables.MultisellData;
import com.l2jserver.gameserver.datatables.SkillData;
import com.l2jserver.gameserver.datatables.SkillTreesData;
import com.l2jserver.gameserver.instancemanager.QuestManager;
import com.l2jserver.gameserver.model.L2SkillLearn;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.base.AcquireSkillType;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.model.skills.Skill;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.clientpackets.RequestAcquireSkill;
import com.l2jserver.gameserver.network.serverpackets.ExAcquirableSkillListByClass;
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
import com.l2jserver.gameserver.util.Util;
import custom.Validators.SubClassSkills;
/**
* Avant-Garde AI.<br>
* Sub-Class Certification system, skill learning and certification canceling.<br>
* Transformation skill learning and transformation scroll sell.
* @author Zoey76
*/
public class AvantGarde extends AbstractNpcAI
{
// NPC
private static final int AVANT_GARDE = 32323;
// Items
// @formatter:off
private static final int[] ITEMS =
{
10280, 10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 10291, 10292, 10293, 10294, 10612
};
// @formatter:on
// Misc
private static final String[] QUEST_VAR_NAMES =
{
"EmergentAbility65-",
"EmergentAbility70-",
"ClassAbility75-",
"ClassAbility80-"
};
public AvantGarde()
{
super(AvantGarde.class.getSimpleName(), "ai/npc");
addStartNpc(AVANT_GARDE);
addTalkId(AVANT_GARDE);
addFirstTalkId(AVANT_GARDE);
addAcquireSkillId(AVANT_GARDE);
}
@Override
public String onAcquireSkill(L2Npc npc, L2PcInstance player, Skill skill, AcquireSkillType type)
{
switch (type)
{
case TRANSFORM:
{
showTransformSkillList(player);
break;
}
case SUBCLASS:
{
showSubClassSkillList(player);
break;
}
}
return null;
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
String htmltext = null;
switch (event)
{
case "32323-02.html":
case "32323-02a.html":
case "32323-02b.html":
case "32323-02c.html":
case "32323-05.html":
case "32323-05a.html":
case "32323-05no.html":
case "32323-06.html":
case "32323-06no.html":
{
htmltext = event;
break;
}
case "LearnTransformationSkill":
{
if (RequestAcquireSkill.canTransform(player))
{
showTransformSkillList(player);
}
else
{
htmltext = "32323-03.html";
}
break;
}
case "BuyTransformationItems":
{
if (RequestAcquireSkill.canTransform(player))
{
MultisellData.getInstance().separateAndSend(32323001, player, npc, false);
}
else
{
htmltext = "32323-04.html";
}
break;
}
case "LearnSubClassSkill":
{
if (!RequestAcquireSkill.canTransform(player))
{
htmltext = "32323-04.html";
}
if (player.isSubClassActive())
{
htmltext = "32323-08.html";
}
else
{
boolean hasItems = false;
for (int id : ITEMS)
{
if (player.getInventory().getItemByItemId(id) != null)
{
hasItems = true;
break;
}
}
if (hasItems)
{
showSubClassSkillList(player);
}
else
{
htmltext = "32323-08.html";
}
}
break;
}
case "CancelCertification":
{
if (player.getSubClasses().size() == 0)
{
htmltext = "32323-07.html";
}
else if (player.isSubClassActive())
{
htmltext = "32323-08.html";
}
else if (player.getAdena() < Config.FEE_DELETE_SUBCLASS_SKILLS)
{
htmltext = "32323-08no.html";
}
else
{
QuestState st = player.getQuestState(SubClassSkills.class.getSimpleName());
if (st == null)
{
st = QuestManager.getInstance().getQuest(SubClassSkills.class.getSimpleName()).newQuestState(player);
}
int activeCertifications = 0;
for (String varName : QUEST_VAR_NAMES)
{
for (int i = 1; i <= Config.MAX_SUBCLASS; i++)
{
String qvar = st.getGlobalQuestVar(varName + i);
if (!qvar.isEmpty() && (qvar.endsWith(";") || !qvar.equals("0")))
{
activeCertifications++;
}
}
}
if (activeCertifications == 0)
{
htmltext = "32323-10no.html";
}
else
{
for (String varName : QUEST_VAR_NAMES)
{
for (int i = 1; i <= Config.MAX_SUBCLASS; i++)
{
final String qvarName = varName + i;
final String qvar = st.getGlobalQuestVar(qvarName);
if (qvar.endsWith(";"))
{
final String skillIdVar = qvar.replace(";", "");
if (Util.isDigit(skillIdVar))
{
int skillId = Integer.parseInt(skillIdVar);
final Skill sk = SkillData.getInstance().getSkill(skillId, 1);
if (sk != null)
{
player.removeSkill(sk);
st.saveGlobalQuestVar(qvarName, "0");
}
}
else
{
_log.warning("Invalid Sub-Class Skill Id: " + skillIdVar + " for player " + player.getName() + "!");
}
}
else if (!qvar.isEmpty() && !qvar.equals("0"))
{
if (Util.isDigit(qvar))
{
final int itemObjId = Integer.parseInt(qvar);
L2ItemInstance itemInstance = player.getInventory().getItemByObjectId(itemObjId);
if (itemInstance != null)
{
player.destroyItem("CancelCertification", itemObjId, 1, player, false);
}
else
{
itemInstance = player.getWarehouse().getItemByObjectId(itemObjId);
if (itemInstance != null)
{
_log.warning("Somehow " + player.getName() + " put a certification book into warehouse!");
player.getWarehouse().destroyItem("CancelCertification", itemInstance, 1, player, false);
}
else
{
_log.warning("Somehow " + player.getName() + " deleted a certification book!");
}
}
st.saveGlobalQuestVar(qvarName, "0");
}
else
{
_log.warning("Invalid item object Id: " + qvar + " for player " + player.getName() + "!");
}
}
}
}
player.reduceAdena("Cleanse", Config.FEE_DELETE_SUBCLASS_SKILLS, npc, true);
htmltext = "32323-09no.html";
player.sendSkillList();
}
// Let's consume all certification books, even those not present in database.
for (int itemId : ITEMS)
{
L2ItemInstance item = player.getInventory().getItemByItemId(itemId);
if (item != null)
{
_log.warning(getClass().getName() + ": player " + player + " had 'extra' certification skill books while cancelling sub-class certifications!");
player.destroyItem("CancelCertificationExtraBooks", item, npc, false);
}
}
}
break;
}
}
return htmltext;
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
return "32323-01.html";
}
@Override
public String onTalk(L2Npc npc, L2PcInstance talker)
{
return "32323-01.html";
}
/**
* Display the Sub-Class Skill list to the player.
* @param player the player
*/
public static void showSubClassSkillList(L2PcInstance player)
{
final List<L2SkillLearn> subClassSkills = SkillTreesData.getInstance().getAvailableSubClassSkills(player);
if (subClassSkills.isEmpty())
{
player.sendPacket(SystemMessageId.THERE_ARE_NO_OTHER_SKILLS_TO_LEARN);
}
else
{
player.sendPacket(new ExAcquirableSkillListByClass(subClassSkills, AcquireSkillType.TRANSFORM));
}
}
/**
* This displays Transformation Skill List to the player.
* @param player the active character.
*/
public static void showTransformSkillList(L2PcInstance player)
{
final List<L2SkillLearn> skills = SkillTreesData.getInstance().getAvailableTransformSkills(player);
if (skills.isEmpty())
{
final int minlevel = SkillTreesData.getInstance().getMinLevelForNewSkill(player, SkillTreesData.getInstance().getTransformSkillTree());
if (minlevel > 0)
{
// No more skills to learn, come back when you level.
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_DO_NOT_HAVE_ANY_FURTHER_SKILLS_TO_LEARN_COME_BACK_WHEN_YOU_HAVE_REACHED_LEVEL_S1);
sm.addInt(minlevel);
player.sendPacket(sm);
}
else
{
player.sendPacket(SystemMessageId.THERE_ARE_NO_OTHER_SKILLS_TO_LEARN);
}
}
else
{
player.sendPacket(new ExAcquirableSkillListByClass(skills, AcquireSkillType.TRANSFORM));
}
}
public static void main(String[] args)
{
new AvantGarde();
}
}