This commit is contained in:
3
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/AlreadyReceived.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/AlreadyReceived.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Subclass Skill Certification:<br>
|
||||
You have already received the certificate for this skill.
|
||||
</body></html>
|
10
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/CertificationList.html
vendored
Normal file
10
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/CertificationList.html
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<html><body>Subclass Skill Certification:<br>
|
||||
Depending on your level, I may be able to certify your subclass.<br>
|
||||
Take this certification to <font color="LEVEL">Avant-Garde, the Wizard of Transformation in the Ivory Tower</font>, for more information on which skills you will be able to acquire.<br>
|
||||
Additionally, you will receive the Transformation Sealbook in lieu of ultimate skills.<br>
|
||||
Now, what level of certification do you want to obtain?<br>
|
||||
<a action="bypass -h Quest SubclassCertification Obtain65">Level 65 Emergent Skill certification.</a><br>
|
||||
<a action="bypass -h Quest SubclassCertification Obtain70">Level 70 Emergent Skill certification.</a><br>
|
||||
<a action="bypass -h Quest SubclassCertification Obtain75">Level 75 Master or class-specific Skill certification.</a><br>
|
||||
<a action="bypass -h Quest SubclassCertification Obtain80">Level 80 Divine Transformation certification.</a>
|
||||
</body></html>
|
7
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/ClassAbility.html
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/ClassAbility.html
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<html><body>Subclass Skill Certification:<br>
|
||||
You are trying to obtain level 75 certification of %class%, common skill or special skill. Remember that once this subclass is certified, it cannot be re-certified -- even if you delete this class and develop another one -- without a special and expensive cancellation process.<br>
|
||||
Do you still want to be certified?<br>
|
||||
<a action="bypass -h Quest SubclassCertification lvl75Class">Obtain class specific skill certification.</a><br>
|
||||
<a action="bypass -h Quest SubclassCertification lvl75Master">Obtain master skill certification.</a><br>
|
||||
<a action="bypass -h Quest SubclassCertification NotObtain.html">Do not obtain certification.</a>
|
||||
</body></html>
|
6
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/EmergentAbility.html
vendored
Normal file
6
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/EmergentAbility.html
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Subclass Skill Certification:<br>
|
||||
You are trying to obtain level %level% certification of %class%, %skilltype%. Remember that once this subclass is certified, it cannot be re-certified -- even if you delete this class and develop another one -- without a special and expensive cancellation process.<br>
|
||||
Do you still want to be certified?<br>
|
||||
<a action="bypass -h Quest SubclassCertification %event%">Obtain certification.</a><br>
|
||||
<a action="bypass -h Quest SubclassCertification NotObtain.html">Do not obtain certification.</a>
|
||||
</body></html>
|
6
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/Explanation.html
vendored
Normal file
6
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/Explanation.html
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<html><body>Subclass Skill Certification:<br>
|
||||
You can be certified at levels 65, 70, 75 and 80. You can practice common skills at Level 65 and 70, common or special skills at Level 75, and ultimate skills at level 80.<br>
|
||||
Common skills are not occupation specific. They can be learned regardless of class. Special skills and ultimate skills are specific to your occupation.<br>
|
||||
The effects of skills learned through this certification can overlap each other, even if they are the same kind of skill.<br>
|
||||
<a action="bypass -h Quest SubclassCertification Main.html">Back.</a>
|
||||
</body></html>
|
5
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/GetAbility.html
vendored
Normal file
5
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/GetAbility.html
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<html><body>Subclass Skill Certification:<br>
|
||||
This certifies that you has reached the required level.<br>
|
||||
Take it to <font color="LEVEL">Transformation Wizard Avant-Garde</font>, and you will be able to learn some new skills.<br>
|
||||
To cancel this certification, simply ask her.
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/LowLevel.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/LowLevel.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Subclass Skill Certification:<br>
|
||||
You are not yet ready to receive your level %level% certification. Work hard and come back later.
|
||||
</body></html>
|
7
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/Main.html
vendored
Normal file
7
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/Main.html
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<html><body>Subclass Skill Certification:<br>
|
||||
Once you reach a certain level of skill in your subclass, your skills can be certified. As a result, you will be able to learn some special skills which you can use in your main class.<br>
|
||||
However, each subclass slot can have only <font color="LEVEL">one certification</font>. That means that even if you come back with a different occupation for the subclass, you cannot obtain another certification unless you first spend a <font color="LEVEL">huge amount to cancel the first certification</font>.<br>
|
||||
If you want to obtain a certification, <font color="LEVEL">your current occupation should be that of the subclass you want to be certified, and you should be above level 65</font>. Now, do you wish to be certified for this subclass?<br>
|
||||
<a action="bypass -h Quest SubclassCertification Explanation.html">Listen to a detailed explanation about subclass certification.</a><br>
|
||||
<a action="bypass -h Quest SubclassCertification GetCertified">Get certified.</a>
|
||||
</body></html>
|
4
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/NotMinLevel.html
vendored
Normal file
4
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/NotMinLevel.html
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Subclass Ability Validation:<br>
|
||||
Your skill level is not yet sufficient to obtain a certificate.<br>
|
||||
You can get Skill Certificate once you have reached level 65, 70, 75 or 80.
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/NotObtain.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/NotObtain.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Subclass Skill Certification:<br>
|
||||
Choose carefully whether or not you decide to obtain certification. Once you have it, it will cost you a tremendous sum to cancel it.
|
||||
</body></html>
|
3
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/NotSubclass.html
vendored
Normal file
3
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/NotSubclass.html
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<html><body>Subclass Ability Validation:<br>
|
||||
If you want to obtain the certificate, you should come as a form of subclass you wish to apply.
|
||||
</body></html>
|
283
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/SubclassCertification.java
vendored
Normal file
283
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/SubclassCertification.java
vendored
Normal file
@@ -0,0 +1,283 @@
|
||||
/*
|
||||
* 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.SubclassCertification;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import ai.npc.AbstractNpcAI;
|
||||
|
||||
import com.l2jserver.gameserver.datatables.ClassListData;
|
||||
import com.l2jserver.gameserver.enums.CategoryType;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2VillageMasterInstance;
|
||||
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jserver.gameserver.model.quest.QuestState;
|
||||
import com.l2jserver.gameserver.model.quest.State;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
/**
|
||||
* Subclass certification
|
||||
* @author xban1x, jurchiks
|
||||
*/
|
||||
public final class SubclassCertification extends AbstractNpcAI
|
||||
{
|
||||
// @formatter:off
|
||||
private static final int[] NPCS =
|
||||
{
|
||||
30026, 30031, 30037, 30066, 30070, 30109, 30115, 30120, 30154, 30174,
|
||||
30175, 30176, 30187, 30191, 30195, 30288, 30289, 30290, 30297, 30358,
|
||||
30373, 30462, 30474, 30498, 30499, 30500, 30503, 30504, 30505, 30508,
|
||||
30511, 30512, 30513, 30520, 30525, 30565, 30594, 30595, 30676, 30677,
|
||||
30681, 30685, 30687, 30689, 30694, 30699, 30704, 30845, 30847, 30849,
|
||||
30854, 30857, 30862, 30865, 30894, 30897, 30900, 30905, 30910, 30913,
|
||||
31269, 31272, 31276, 31279, 31285, 31288, 31314, 31317, 31321, 31324,
|
||||
31326, 31328, 31331, 31334, 31336, 31755, 31958, 31961, 31965, 31968,
|
||||
31974, 31977, 31996, 32092, 32093, 32094, 32095, 32096, 32097, 32098,
|
||||
32145, 32146, 32147, 32150, 32153, 32154, 32157, 32158, 32160, 32171,
|
||||
32193, 32199, 32202, 32213, 32214, 32221, 32222, 32229, 32230, 32233,
|
||||
32234
|
||||
};
|
||||
// @formatter:on
|
||||
private static final int CERTIFICATE_EMERGENT_ABILITY = 10280;
|
||||
private static final int CERTIFICATE_MASTER_ABILITY = 10612;
|
||||
private static final Map<Integer, Integer> ABILITY_CERTIFICATES = new HashMap<>();
|
||||
private static final Map<Integer, Integer> TRANSFORMATION_SEALBOOKS = new HashMap<>();
|
||||
static
|
||||
{
|
||||
ABILITY_CERTIFICATES.put(0, 10281); // Certificate - Warrior Ability
|
||||
ABILITY_CERTIFICATES.put(1, 10283); // Certificate - Rogue Ability
|
||||
ABILITY_CERTIFICATES.put(2, 10282); // Certificate - Knight Ability
|
||||
ABILITY_CERTIFICATES.put(3, 10286); // Certificate - Summoner Ability
|
||||
ABILITY_CERTIFICATES.put(4, 10284); // Certificate - Wizard Ability
|
||||
ABILITY_CERTIFICATES.put(5, 10285); // Certificate - Healer Ability
|
||||
ABILITY_CERTIFICATES.put(6, 10287); // Certificate - Enchanter Ability
|
||||
|
||||
TRANSFORMATION_SEALBOOKS.put(0, 10289); // Transformation Sealbook: Divine Warrior
|
||||
TRANSFORMATION_SEALBOOKS.put(1, 10290); // Transformation Sealbook: Divine Rogue
|
||||
TRANSFORMATION_SEALBOOKS.put(2, 10288); // Transformation Sealbook: Divine Knight
|
||||
TRANSFORMATION_SEALBOOKS.put(3, 10294); // Transformation Sealbook: Divine Summoner
|
||||
TRANSFORMATION_SEALBOOKS.put(4, 10292); // Transformation Sealbook: Divine Wizard
|
||||
TRANSFORMATION_SEALBOOKS.put(5, 10291); // Transformation Sealbook: Divine Healer
|
||||
TRANSFORMATION_SEALBOOKS.put(6, 10293); // Transformation Sealbook: Divine Enchanter
|
||||
}
|
||||
|
||||
private static final int MIN_LVL = 65;
|
||||
|
||||
private SubclassCertification()
|
||||
{
|
||||
super(SubclassCertification.class.getSimpleName(), "ai/npc");
|
||||
addStartNpc(NPCS);
|
||||
addTalkId(NPCS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
final QuestState st = player.getQuestState(getName());
|
||||
String htmltext = getNoQuestMsg(player);
|
||||
if (st != null)
|
||||
{
|
||||
st.setState(State.STARTED);
|
||||
htmltext = "Main.html";
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = null;
|
||||
final QuestState st = player.getQuestState(getName());
|
||||
if (st == null)
|
||||
{
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
switch (event)
|
||||
{
|
||||
case "GetCertified":
|
||||
{
|
||||
if (!player.isSubClassActive())
|
||||
{
|
||||
htmltext = "NotSubclass.html";
|
||||
}
|
||||
else if (player.getLevel() < MIN_LVL)
|
||||
{
|
||||
htmltext = "NotMinLevel.html";
|
||||
}
|
||||
else if (((L2VillageMasterInstance) npc).checkVillageMaster(player.getActiveClass()))
|
||||
{
|
||||
htmltext = "CertificationList.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "WrongVillageMaster.html";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "Obtain65":
|
||||
{
|
||||
htmltext = replaceHtml(player, "EmergentAbility.html", true, null).replace("%level%", "65").replace("%skilltype%", "common skill").replace("%event%", "lvl65Emergent");
|
||||
break;
|
||||
}
|
||||
case "Obtain70":
|
||||
{
|
||||
htmltext = replaceHtml(player, "EmergentAbility.html", true, null).replace("%level%", "70").replace("%skilltype%", "common skill").replace("%event%", "lvl70Emergent");
|
||||
break;
|
||||
}
|
||||
case "Obtain75":
|
||||
{
|
||||
htmltext = replaceHtml(player, "ClassAbility.html", true, null);
|
||||
break;
|
||||
}
|
||||
case "Obtain80":
|
||||
{
|
||||
htmltext = replaceHtml(player, "EmergentAbility.html", true, null).replace("%level%", "80").replace("%skilltype%", "transformation skill").replace("%event%", "lvl80Class");
|
||||
break;
|
||||
}
|
||||
case "lvl65Emergent":
|
||||
{
|
||||
htmltext = doCertification(player, st, "EmergentAbility", CERTIFICATE_EMERGENT_ABILITY, 65);
|
||||
break;
|
||||
}
|
||||
case "lvl70Emergent":
|
||||
{
|
||||
htmltext = doCertification(player, st, "EmergentAbility", CERTIFICATE_EMERGENT_ABILITY, 70);
|
||||
break;
|
||||
}
|
||||
case "lvl75Master":
|
||||
{
|
||||
htmltext = doCertification(player, st, "ClassAbility", CERTIFICATE_MASTER_ABILITY, 75);
|
||||
break;
|
||||
}
|
||||
case "lvl75Class":
|
||||
{
|
||||
htmltext = doCertification(player, st, "ClassAbility", ABILITY_CERTIFICATES.get(getClassIndex(player)), 75);
|
||||
break;
|
||||
}
|
||||
case "lvl80Class":
|
||||
{
|
||||
htmltext = doCertification(player, st, "ClassAbility", TRANSFORMATION_SEALBOOKS.get(getClassIndex(player)), 80);
|
||||
break;
|
||||
}
|
||||
case "Main.html":
|
||||
case "Explanation.html":
|
||||
case "NotObtain.html":
|
||||
{
|
||||
htmltext = event;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
private String replaceHtml(L2PcInstance player, String htmlFile, boolean replaceClass, String levelToReplace)
|
||||
{
|
||||
String htmltext = getHtm(player.getHtmlPrefix(), htmlFile);
|
||||
if (replaceClass)
|
||||
{
|
||||
htmltext = htmltext.replace("%class%", String.valueOf(ClassListData.getInstance().getClass(player.getActiveClass()).getClientCode()));
|
||||
}
|
||||
if (levelToReplace != null)
|
||||
{
|
||||
htmltext = htmltext.replace("%level%", levelToReplace);
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
private static int getClassIndex(L2PcInstance player)
|
||||
{
|
||||
if (player.isInCategory(CategoryType.SUB_GROUP_WARRIOR))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if (player.isInCategory(CategoryType.SUB_GROUP_ROGUE))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if (player.isInCategory(CategoryType.SUB_GROUP_KNIGHT))
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
else if (player.isInCategory(CategoryType.SUB_GROUP_SUMMONER))
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
else if (player.isInCategory(CategoryType.SUB_GROUP_WIZARD))
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
else if (player.isInCategory(CategoryType.SUB_GROUP_HEALER))
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
else if (player.isInCategory(CategoryType.SUB_GROUP_ENCHANTER))
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
private String doCertification(L2PcInstance player, QuestState qs, String variable, Integer itemId, int level)
|
||||
{
|
||||
if (itemId == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
String htmltext;
|
||||
String tmp = variable + level + "-" + player.getClassIndex();
|
||||
String globalVariable = qs.getGlobalQuestVar(tmp);
|
||||
|
||||
if (!globalVariable.equals("") && !globalVariable.equals("0"))
|
||||
{
|
||||
htmltext = "AlreadyReceived.html";
|
||||
}
|
||||
else if (player.getLevel() < level)
|
||||
{
|
||||
htmltext = replaceHtml(player, "LowLevel.html", false, Integer.toString(level));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Add items to player's inventory
|
||||
final L2ItemInstance item = player.getInventory().addItem("Quest", itemId, 1, player, player.getTarget());
|
||||
if (item == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
final SystemMessage smsg = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_EARNED_S1);
|
||||
smsg.addItemName(item);
|
||||
player.sendPacket(smsg);
|
||||
|
||||
qs.saveGlobalQuestVar(tmp, String.valueOf(item.getObjectId()));
|
||||
htmltext = "GetAbility.html";
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
new SubclassCertification();
|
||||
}
|
||||
}
|
4
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/WrongVillageMaster.html
vendored
Normal file
4
trunk/dist/game/data/scripts/ai/npc/SubclassCertification/WrongVillageMaster.html
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<html><body>Subclass Ability Validation:<br>
|
||||
I'm sorry, but I cannot give you a certificate for your current occupation.<br>
|
||||
You should go and look for the subclass master for your current occupation.
|
||||
</body></html>
|
Reference in New Issue
Block a user