Classmasters rework.
This commit is contained in:
		
							
								
								
									
										71
									
								
								L2J_Mobius_Classic/dist/game/data/multisell/622.xml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										71
									
								
								L2J_Mobius_Classic/dist/game/data/multisell/622.xml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,71 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <list applyTaxes="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/multisell.xsd"> | ||||
| 	<npcs> | ||||
| 		<npc>31756</npc> <!-- Mr. Cat - Test Server Helper --> | ||||
| 		<npc>31757</npc> <!-- Queen of Hearts - Test Server Helper --> | ||||
| 	</npcs> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="200000" /> <!-- Adena --> | ||||
| 		<production id="955" count="1" /> <!-- Scroll: Enchant Weapon (D-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="24000" /> <!-- Adena --> | ||||
| 		<production id="956" count="1" /> <!-- Scroll: Enchant Armor (D-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="440000" /> <!-- Adena --> | ||||
| 		<production id="951" count="1" /> <!-- Scroll: Enchant Weapon (C-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="60000" /> <!-- Adena --> | ||||
| 		<production id="952" count="1" /> <!-- Scroll: Enchant Armor (C-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="2000000" /> <!-- Adena --> | ||||
| 		<production id="947" count="1" /> <!-- Scroll: Enchant Weapon (B-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="320000" /> <!-- Adena --> | ||||
| 		<production id="948" count="1" /> <!-- Scroll: Enchant Armor (B-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="7200000" /> <!-- Adena --> | ||||
| 		<production id="729" count="1" /> <!-- Scroll: Enchant Weapon (A-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="960000" /> <!-- Adena --> | ||||
| 		<production id="730" count="1" /> <!-- Scroll: Enchant Armor (A-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="2600" /> <!-- Adena --> | ||||
| 		<production id="1458" count="1" /> <!-- Crystal (D-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="12000" /> <!-- Adena --> | ||||
| 		<production id="1459" count="1" /> <!-- Crystal (C-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="36000" /> <!-- Adena --> | ||||
| 		<production id="1460" count="1" /> <!-- Crystal (B-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="60000" /> <!-- Adena --> | ||||
| 		<production id="1461" count="1" /> <!-- Crystal (A-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="1100" /> <!-- Adena --> | ||||
| 		<production id="2130" count="1" /> <!-- Gemstone (D-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="3300" /> <!-- Adena --> | ||||
| 		<production id="2131" count="1" /> <!-- Gemstone (C-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="11000" /> <!-- Adena --> | ||||
| 		<production id="2132" count="1" /> <!-- Gemstone (B-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="120000" /> <!-- Adena --> | ||||
| 		<production id="2133" count="1" /> <!-- Gemstone (A-grade) --> | ||||
| 	</item> | ||||
| </list> | ||||
							
								
								
									
										231
									
								
								L2J_Mobius_Classic/dist/game/data/multisell/697.xml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										231
									
								
								L2J_Mobius_Classic/dist/game/data/multisell/697.xml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,231 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/multisell.xsd"> | ||||
| 	<npcs> | ||||
| 		<npc>31756</npc> <!-- Mr. Cat - Test Server Helper --> | ||||
| 		<npc>31757</npc> <!-- Queen of Hearts - Test Server Helper --> | ||||
| 	</npcs> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="3562000" id="57" /> | ||||
| 		<!-- Dark Crystal Breastplate --> | ||||
| 		<production count="1" id="365" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="2226000" id="57" /> | ||||
| 		<!-- Dark Crystal Gaiters --> | ||||
| 		<production count="1" id="388" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="1336000" id="57" /> | ||||
| 		<!-- Dark Crystal Helmet --> | ||||
| 		<production count="1" id="512" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="935000" id="57" /> | ||||
| 		<!-- Dark Crystal Shield --> | ||||
| 		<production count="1" id="641" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="2671000" id="57" /> | ||||
| 		<!-- Dark Crystal Leather Armor --> | ||||
| 		<production count="1" id="2385" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="1670000" id="57" /> | ||||
| 		<!-- Dark Crystal Leggings --> | ||||
| 		<production count="1" id="2389" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="4341000" id="57" /> | ||||
| 		<!-- Dark Crystal Robe --> | ||||
| 		<production count="1" id="2407" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="5788000" id="57" /> | ||||
| 		<!-- Tallum Plate Armor --> | ||||
| 		<production count="1" id="2382" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="1336000" id="57" /> | ||||
| 		<!-- Tallum Helmet --> | ||||
| 		<production count="1" id="547" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="4341000" id="57" /> | ||||
| 		<!-- Tallum Leather Armor --> | ||||
| 		<production count="1" id="2393" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="2671000" id="57" /> | ||||
| 		<!-- Tallum Tunic --> | ||||
| 		<production count="1" id="2400" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="1670000" id="57" /> | ||||
| 		<!-- Tallum Stockings --> | ||||
| 		<production count="1" id="2405" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="890000" id="57" /> | ||||
| 		<!-- Sealed Dark Crystal Gloves --> | ||||
| 		<production count="1" id="5290" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="890000" id="57" /> | ||||
| 		<!-- Sealed Tallum Gloves --> | ||||
| 		<production count="1" id="5295" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="890000" id="57" /> | ||||
| 		<!-- Sealed Dark Crystal Boots --> | ||||
| 		<production count="1" id="5291" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="890000" id="57" /> | ||||
| 		<!-- Sealed Tallum Boots --> | ||||
| 		<production count="1" id="5296" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="1340000" id="57" /> | ||||
| 		<!-- Sealed Phoenix Necklace --> | ||||
| 		<production count="1" id="6323" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="1005000" id="57" /> | ||||
| 		<!-- Sealed Phoenix Earring --> | ||||
| 		<production count="1" id="6324" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="670000" id="57" /> | ||||
| 		<!-- Sealed Phoenix Ring --> | ||||
| 		<production count="1" id="6325" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="20741000" id="57" /> | ||||
| 		<!-- Soul Separator --> | ||||
| 		<production count="1" id="236" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="20741000" id="57" /> | ||||
| 		<!-- Sword of Miracles --> | ||||
| 		<production count="1" id="151" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="20741000" id="57" /> | ||||
| 		<!-- Dark Legion's Edge --> | ||||
| 		<production count="1" id="2500" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="20741000" id="57" /> | ||||
| 		<!-- Dragon Slayer --> | ||||
| 		<production count="1" id="81" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="20741000" id="57" /> | ||||
| 		<!-- Doom Crusher --> | ||||
| 		<production count="1" id="7902" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="20741000" id="57" /> | ||||
| 		<!-- Flaming Dragon Skull --> | ||||
| 		<production count="1" id="7895" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="20741000" id="57" /> | ||||
| 		<!-- Elysian --> | ||||
| 		<production count="1" id="164" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="20741000" id="57" /> | ||||
| 		<!-- Branch of the Mother Tree --> | ||||
| 		<production count="1" id="213" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="20741000" id="57" /> | ||||
| 		<!-- Tallum Glaive --> | ||||
| 		<production count="1" id="305" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="20741000" id="57" /> | ||||
| 		<!-- Dragon Grinder --> | ||||
| 		<production count="1" id="270" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<!-- Adena --> | ||||
| 		<ingredient count="20741000" id="57" /> | ||||
| 		<!-- Soul Bow --> | ||||
| 		<production count="1" id="289" /> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="16" /> <!-- Adena --> | ||||
| 		<production id="1344" count="1" /> <!-- Mithril Arrow --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="14" /> <!-- Adena --> | ||||
| 		<production id="1463" count="1" /> <!-- Soulshot (D-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="22" /> <!-- Adena --> | ||||
| 		<production id="1464" count="1" /> <!-- Soulshot (C-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="50" /> <!-- Adena --> | ||||
| 		<production id="1465" count="1" /> <!-- Soulshot (B-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="80" /> <!-- Adena --> | ||||
| 		<production id="1466" count="1" /> <!-- Soulshot (A-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="28" /> <!-- Adena --> | ||||
| 		<production id="3948" count="1" /> <!-- Blessed Spiritshot (D-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="42" /> <!-- Adena --> | ||||
| 		<production id="3949" count="1" /> <!-- Blessed Spiritshot (C-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="245" /> <!-- Adena --> | ||||
| 		<production id="3950" count="1" /> <!-- Blessed Spiritshot (B-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="290" /> <!-- Adena --> | ||||
| 		<production id="3951" count="1" /> <!-- Blessed Spiritshot (A-grade) --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="20" /> <!-- Adena --> | ||||
| 		<production id="6645" count="1" /> <!-- Beast Soulshot --> | ||||
| 	</item> | ||||
| 	<item> | ||||
| 		<ingredient id="57" count="40" /> <!-- Adena --> | ||||
| 		<production id="6646" count="1" /> <!-- Beast Spiritshot --> | ||||
| 	</item> | ||||
| </list> | ||||
| @@ -17,6 +17,7 @@ | ||||
| package ai.others.ClassMaster; | ||||
|  | ||||
| import java.io.File; | ||||
| import java.util.ArrayList; | ||||
| import java.util.Arrays; | ||||
| import java.util.Collections; | ||||
| import java.util.LinkedList; | ||||
| @@ -29,7 +30,6 @@ import org.w3c.dom.NamedNodeMap; | ||||
| import org.w3c.dom.Node; | ||||
|  | ||||
| import com.l2jmobius.commons.util.IGameXmlReader; | ||||
| import com.l2jmobius.commons.util.Rnd; | ||||
| import com.l2jmobius.gameserver.data.xml.impl.CategoryData; | ||||
| import com.l2jmobius.gameserver.data.xml.impl.ClassListData; | ||||
| import com.l2jmobius.gameserver.data.xml.impl.SkillData; | ||||
| @@ -50,7 +50,7 @@ import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLevel | ||||
| import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLogin; | ||||
| import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerPressTutorialMark; | ||||
| import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerProfessionChange; | ||||
| import com.l2jmobius.gameserver.model.holders.ItemChanceHolder; | ||||
| import com.l2jmobius.gameserver.model.holders.ItemHolder; | ||||
| import com.l2jmobius.gameserver.model.spawns.SpawnTemplate; | ||||
| import com.l2jmobius.gameserver.network.serverpackets.PlaySound; | ||||
| import com.l2jmobius.gameserver.network.serverpackets.TutorialCloseHtml; | ||||
| @@ -65,11 +65,11 @@ import ai.AbstractNpcAI; | ||||
| public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader | ||||
| { | ||||
| 	// NPCs | ||||
| 	private static final int[] CLASS_MASTER = | ||||
| 	private static final List<Integer> CLASS_MASTERS = new ArrayList<>(); | ||||
| 	{ | ||||
| 		31756, // Mr. Cat | ||||
| 		31757, // Queen of Hearts | ||||
| 	}; | ||||
| 		CLASS_MASTERS.add(31756); // Mr. Cat | ||||
| 		CLASS_MASTERS.add(31757); // Queen of Hearts | ||||
| 	} | ||||
| 	// Misc | ||||
| 	private boolean _isEnabled; | ||||
| 	private boolean _spawnClassMasters; | ||||
| @@ -80,9 +80,9 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader | ||||
| 	public ClassMaster() | ||||
| 	{ | ||||
| 		load(); | ||||
| 		addStartNpc(CLASS_MASTER); | ||||
| 		addTalkId(CLASS_MASTER); | ||||
| 		addFirstTalkId(CLASS_MASTER); | ||||
| 		addStartNpc(CLASS_MASTERS); | ||||
| 		addTalkId(CLASS_MASTERS); | ||||
| 		addFirstTalkId(CLASS_MASTERS); | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| @@ -128,8 +128,8 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader | ||||
| 							if ("classChangeOption".equals(c.getNodeName())) | ||||
| 							{ | ||||
| 								final List<CategoryType> appliedCategories = new LinkedList<>(); | ||||
| 								final List<ItemChanceHolder> requiredItems = new LinkedList<>(); | ||||
| 								final List<ItemChanceHolder> rewardedItems = new LinkedList<>(); | ||||
| 								final List<ItemHolder> requiredItems = new LinkedList<>(); | ||||
| 								final List<ItemHolder> rewardedItems = new LinkedList<>(); | ||||
| 								boolean setNoble = false; | ||||
| 								boolean setHero = false; | ||||
| 								final String optionName = parseString(attrs, "name", ""); | ||||
| @@ -163,9 +163,8 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader | ||||
| 											{ | ||||
| 												final int itemId = parseInteger(attrs, "id"); | ||||
| 												final int count = parseInteger(attrs, "count", 1); | ||||
| 												final int chance = parseInteger(attrs, "chance", 100); | ||||
| 												 | ||||
| 												rewardedItems.add(new ItemChanceHolder(itemId, chance, count)); | ||||
| 												rewardedItems.add(new ItemHolder(itemId, count)); | ||||
| 											} | ||||
| 											else if ("setNoble".equals(r.getNodeName())) | ||||
| 											{ | ||||
| @@ -186,9 +185,8 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader | ||||
| 											{ | ||||
| 												final int itemId = parseInteger(attrs, "id"); | ||||
| 												final int count = parseInteger(attrs, "count", 1); | ||||
| 												final int chance = parseInteger(attrs, "chance", 100); | ||||
| 												 | ||||
| 												requiredItems.add(new ItemChanceHolder(itemId, chance, count)); | ||||
| 												requiredItems.add(new ItemHolder(itemId, count)); | ||||
| 											} | ||||
| 										} | ||||
| 									} | ||||
| @@ -251,28 +249,13 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader | ||||
| 		{ | ||||
| 			case "buyitems": | ||||
| 			{ | ||||
| 				htmltext = npc.getId() == CLASS_MASTER[0] ? "test_server_helper001a.html" : "test_server_helper001b.html"; | ||||
| 				break; | ||||
| 			} | ||||
| 			case "setnoble": | ||||
| 			{ | ||||
| 				if (player.isNoble()) | ||||
| 				{ | ||||
| 					htmltext = "test_server_helper025b.html"; | ||||
| 				} | ||||
| 				else if (player.getLevel() < 75) | ||||
| 				{ | ||||
| 					htmltext = "test_server_helper025a.html"; | ||||
| 				} | ||||
| 				else | ||||
| 				{ | ||||
| 					player.setNoble(true); | ||||
| 					player.broadcastUserInfo(); | ||||
| 					// TODO: SetOneTimeQuestFlag(talker, 10385, 1); | ||||
| 					htmltext = "test_server_helper025.html"; | ||||
| 				} | ||||
| 				htmltext = npc.getId() == CLASS_MASTERS.get(0) ? "test_server_helper001a.html" : "test_server_helper001b.html"; | ||||
| 				break; | ||||
| 			} | ||||
| 			/* | ||||
| 			 * case "setnoble": { if (player.isNoble()) { htmltext = "test_server_helper025b.html"; } else if (player.getLevel() < 75) { htmltext = "test_server_helper025a.html"; } else { player.setNoble(true); player.broadcastUserInfo(); // TODO: SetOneTimeQuestFlag(talker, 10385, 1); htmltext = | ||||
| 			 * "test_server_helper025.html"; } break; } | ||||
| 			 */ | ||||
| 			case "firstclass": | ||||
| 			{ | ||||
| 				htmltext = getFirstOccupationChangeHtml(player); | ||||
| @@ -298,38 +281,21 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader | ||||
| 				{ | ||||
| 					htmltext = "test_server_helper011.html"; | ||||
| 				} | ||||
| 				else if (player.isInCategory(CategoryType.AWAKEN_GROUP)) | ||||
| 				{ | ||||
| 					htmltext = "test_server_helper011a.html"; | ||||
| 				} | ||||
| 				// else if (player.isInCategory(CategoryType.AWAKEN_GROUP)) | ||||
| 				// { | ||||
| 				// htmltext = "test_server_helper011a.html"; | ||||
| 				// } | ||||
| 				else | ||||
| 				{ | ||||
| 					htmltext = "test_server_helper024.html"; | ||||
| 				} | ||||
| 				break; | ||||
| 			} | ||||
| 			case "awaken": | ||||
| 			{ | ||||
| 				if (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP) && (player.getLevel() > 84)) | ||||
| 				{ | ||||
| 					if (changeToNextClass(player)) | ||||
| 					{ | ||||
| 						player.sendPacket(new PlaySound("ItemSound.quest_fanfare_2")); | ||||
| 						player.broadcastUserInfo(); | ||||
| 						player.store(false); // Save player cause if server crashes before this char is saved, he will lose class and the money payed for class change. | ||||
| 						htmltext = "test_server_helper021.html"; | ||||
| 					} | ||||
| 				} | ||||
| 				else if (player.isInCategory(CategoryType.AWAKEN_GROUP)) | ||||
| 				{ | ||||
| 					htmltext = "test_server_helper011a.html"; | ||||
| 				} | ||||
| 				else | ||||
| 				{ | ||||
| 					htmltext = "test_server_helper011b.html"; | ||||
| 				} | ||||
| 				break; | ||||
| 			} | ||||
| 			/* | ||||
| 			 * case "awaken": { if (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP) && (player.getLevel() > 84)) { if (changeToNextClass(player)) { player.sendPacket(new PlaySound("ItemSound.quest_fanfare_2")); player.broadcastUserInfo(); player.store(false); // Save player cause if server | ||||
| 			 * crashes before this char is saved, he will lose class and the money payed for class change. htmltext = "test_server_helper021.html"; } } else if (player.isInCategory(CategoryType.AWAKEN_GROUP)) { htmltext = "test_server_helper011a.html"; } else { htmltext = | ||||
| 			 * "test_server_helper011b.html"; } break; } | ||||
| 			 */ | ||||
| 			case "setclass": | ||||
| 			{ | ||||
| 				if (!st.hasMoreTokens()) | ||||
| @@ -352,10 +318,10 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader | ||||
| 				{ | ||||
| 					canChange = CategoryData.getInstance().isInCategory(CategoryType.FOURTH_CLASS_GROUP, classId); | ||||
| 				} | ||||
| 				else if (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP) && (player.getLevel() >= 85)) // 9 | ||||
| 				{ | ||||
| 					canChange = CategoryData.getInstance().isInCategory(CategoryType.AWAKEN_GROUP, classId); // 11 | ||||
| 				} | ||||
| 				// else if (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP) && (player.getLevel() >= 85)) // 9 | ||||
| 				// { | ||||
| 				// canChange = CategoryData.getInstance().isInCategory(CategoryType.AWAKEN_GROUP, classId); // 11 | ||||
| 				// } | ||||
| 				 | ||||
| 				if (canChange) | ||||
| 				{ | ||||
| @@ -374,31 +340,22 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader | ||||
| 							htmltext = htmltext.replace("%options%", getClassChangeOptions(player, classId)); | ||||
| 							return htmltext; | ||||
| 						} | ||||
| 						 | ||||
| 						final ClassChangeData data = getClassChangeData(classDataIndex); | ||||
| 						if (data == null) | ||||
| 					} | ||||
| 					 | ||||
| 					final ClassChangeData data = getClassChangeData(classDataIndex); | ||||
| 					if ((data != null) && (data.getItemsRequired().size() > 0)) | ||||
| 					{ | ||||
| 						for (ItemHolder ri : data.getItemsRequired()) | ||||
| 						{ | ||||
| 							return null; | ||||
| 							if (player.getInventory().getInventoryItemCount(ri.getId(), -1) < ri.getCount()) | ||||
| 							{ | ||||
| 								player.sendMessage("You do not have enough items."); | ||||
| 								return null; // No class change if payment failed. | ||||
| 							} | ||||
| 						} | ||||
| 						 | ||||
| 						//@formatter:off | ||||
| 						final boolean paid = data.getItemsRequired().stream() | ||||
| 						.filter(ich -> ich.getChance() > Rnd.get(100)) // Chance to pay the price | ||||
| 						.filter(ih -> player.getInventory().getInventoryItemCount(ih.getId(), -1) >= ih.getCount()) | ||||
| 						.allMatch(ih -> player.destroyItemByItemId(getClass().getSimpleName(), ih.getId(), ih.getCount(), npc, true)); | ||||
| 						//@formatter:on | ||||
| 						 | ||||
| 						if (paid) | ||||
| 						for (ItemHolder ri : data.getItemsRequired()) | ||||
| 						{ | ||||
| 							//@formatter:off | ||||
| 							data.getItemsRewarded().stream() | ||||
| 							.filter(ich -> ich.getChance() > Rnd.get(100)) // Chance to receive the reward | ||||
| 							.forEach(ih -> player.addItem(getClass().getSimpleName(), ih.getId(), ih.getCount(), npc, true)); | ||||
| 							//@formatter:on | ||||
| 						} | ||||
| 						else | ||||
| 						{ | ||||
| 							return null; // No class change if payment failed. | ||||
| 							player.destroyItemByItemId(getClass().getSimpleName(), ri.getId(), ri.getCount(), npc, true); | ||||
| 						} | ||||
| 					} | ||||
| 					 | ||||
| @@ -463,6 +420,14 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader | ||||
| 				} | ||||
| 				break; | ||||
| 			} | ||||
| 			case "test_server_helper001.html": | ||||
| 			{ | ||||
| 				if (CLASS_MASTERS.contains(npc.getId())) | ||||
| 				{ | ||||
| 					htmltext = event; | ||||
| 				} | ||||
| 				break; | ||||
| 			} | ||||
| 		} | ||||
| 		 | ||||
| 		return htmltext; | ||||
| @@ -555,10 +520,10 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader | ||||
| 		{ | ||||
| 			htmltext = "test_server_helper011.html"; | ||||
| 		} | ||||
| 		else if (player.isInCategory(CategoryType.AWAKEN_GROUP)) | ||||
| 		{ | ||||
| 			htmltext = "test_server_helper011a.html"; | ||||
| 		} | ||||
| 		// else if (player.isInCategory(CategoryType.AWAKEN_GROUP)) | ||||
| 		// { | ||||
| 		// htmltext = "test_server_helper011a.html"; | ||||
| 		// } | ||||
| 		return htmltext; | ||||
| 	} | ||||
| 	 | ||||
| @@ -737,10 +702,10 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader | ||||
| 		{ | ||||
| 			htmltext = "test_server_helper011.html"; | ||||
| 		} | ||||
| 		else if (player.isInCategory(CategoryType.AWAKEN_GROUP)) | ||||
| 		{ | ||||
| 			htmltext = "test_server_helper011a.html"; | ||||
| 		} | ||||
| 		// else if (player.isInCategory(CategoryType.AWAKEN_GROUP)) | ||||
| 		// { | ||||
| 		// htmltext = "test_server_helper011a.html"; | ||||
| 		// } | ||||
| 		else | ||||
| 		{ | ||||
| 			htmltext = "test_server_helper029.html"; | ||||
| @@ -804,11 +769,11 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader | ||||
| 		//@formatter:off | ||||
| 		if ((player.isInCategory(CategoryType.FIRST_CLASS_GROUP) && (player.getLevel() >= 20)) || | ||||
| 			((player.isInCategory(CategoryType.SECOND_CLASS_GROUP) || player.isInCategory(CategoryType.FIRST_CLASS_GROUP)) && (player.getLevel() >= 40)) || | ||||
| 			(player.isInCategory(CategoryType.THIRD_CLASS_GROUP) && (player.getLevel() >= 76)) || | ||||
| 			(player.isInCategory(CategoryType.FOURTH_CLASS_GROUP) && (player.getLevel() >= 85))) | ||||
| 			(player.isInCategory(CategoryType.THIRD_CLASS_GROUP) && (player.getLevel() >= 76)) /*|| | ||||
| 			(player.isInCategory(CategoryType.FOURTH_CLASS_GROUP) && (player.getLevel() >= 85))*/) | ||||
| 		//@formatter:on | ||||
| 		{ | ||||
| 			player.sendPacket(new TutorialShowQuestionMark(1001)); | ||||
| 			player.sendPacket(new TutorialShowQuestionMark(2, 0)); // mark id was 1001 - used 2 for quest text | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
| @@ -818,7 +783,7 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader | ||||
| 	{ | ||||
| 		final L2PcInstance player = event.getActiveChar(); | ||||
| 		 | ||||
| 		if (!_showPopupWindow || (event.getMarkId() != 1001)) | ||||
| 		if (!_showPopupWindow || (event.getMarkId() != 2)) // mark id was 1001 - used 2 for quest text | ||||
| 		{ | ||||
| 			return; | ||||
| 		} | ||||
| @@ -836,10 +801,10 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader | ||||
| 		{ | ||||
| 			html = getHtm(player.getHtmlPrefix(), "qm_thirdclass.html"); | ||||
| 		} | ||||
| 		else if (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP) && (player.getLevel() >= 85)) // 9 | ||||
| 		{ | ||||
| 			html = getHtm(player.getHtmlPrefix(), "qm_awaken.html"); | ||||
| 		} | ||||
| 		// else if (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP) && (player.getLevel() >= 85)) // 9 | ||||
| 		// { | ||||
| 		// html = getHtm(player.getHtmlPrefix(), "qm_awaken.html"); | ||||
| 		// } | ||||
| 		 | ||||
| 		if (html != null) | ||||
| 		{ | ||||
| @@ -906,14 +871,7 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader | ||||
| 			{ | ||||
| 				option.getItemsRequired().forEach(ih -> | ||||
| 				{ | ||||
| 					if (ih.getChance() >= 100) | ||||
| 					{ | ||||
| 						sb.append("<tr><td><font color=\"LEVEL\">" + ih.getCount() + "</font></td><td>" + ItemTable.getInstance().getTemplate(ih.getId()).getName() + "</td><td width=30></td></tr>"); | ||||
| 					} | ||||
| 					else | ||||
| 					{ | ||||
| 						sb.append("<tr><td><font color=\"LEVEL\">" + ih.getCount() + "</font></td><td>" + ItemTable.getInstance().getTemplate(ih.getId()).getName() + "</td><td width=30><font color=LEVEL>" + ih.getChance() + "%</font></td></tr>"); | ||||
| 					} | ||||
| 					sb.append("<tr><td><font color=\"LEVEL\">" + ih.getCount() + "</font></td><td>" + ItemTable.getInstance().getTemplate(ih.getId()).getName() + "</td><td width=30></td></tr>"); | ||||
| 				}); | ||||
| 			} | ||||
| 			sb.append("<tr><td>Rewards:</td></tr>"); | ||||
| @@ -938,14 +896,7 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader | ||||
| 			{ | ||||
| 				option.getItemsRewarded().forEach(ih -> | ||||
| 				{ | ||||
| 					if (ih.getChance() >= 100) | ||||
| 					{ | ||||
| 						sb.append("<tr><td><font color=\"LEVEL\">" + ih.getCount() + "</font></td><td>" + ItemTable.getInstance().getTemplate(ih.getId()).getName() + "</td><td width=30></td></tr>"); | ||||
| 					} | ||||
| 					else | ||||
| 					{ | ||||
| 						sb.append("<tr><td><font color=\"LEVEL\">" + ih.getCount() + "</font></td><td>" + ItemTable.getInstance().getTemplate(ih.getId()).getName() + "</td><td width=30><font color=LEVEL>" + ih.getChance() + "%</font></td></tr>"); | ||||
| 					} | ||||
| 					sb.append("<tr><td><font color=\"LEVEL\">" + ih.getCount() + "</font></td><td>" + ItemTable.getInstance().getTemplate(ih.getId()).getName() + "</td><td width=30></td></tr>"); | ||||
| 				}); | ||||
| 				 | ||||
| 				if (option.isRewardNoblesse()) | ||||
| @@ -971,8 +922,8 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader | ||||
| 		private final List<CategoryType> _appliedCategories; | ||||
| 		private boolean _rewardNoblesse; | ||||
| 		private boolean _rewardHero; | ||||
| 		private List<ItemChanceHolder> _itemsRequired; | ||||
| 		private List<ItemChanceHolder> _itemsRewarded; | ||||
| 		private List<ItemHolder> _itemsRequired; | ||||
| 		private List<ItemHolder> _itemsRewarded; | ||||
| 		 | ||||
| 		public ClassChangeData(String name, List<CategoryType> appliedCategories) | ||||
| 		{ | ||||
| @@ -1026,22 +977,22 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader | ||||
| 			_rewardHero = rewardHero; | ||||
| 		} | ||||
| 		 | ||||
| 		void setItemsRequired(List<ItemChanceHolder> itemsRequired) | ||||
| 		void setItemsRequired(List<ItemHolder> itemsRequired) | ||||
| 		{ | ||||
| 			_itemsRequired = itemsRequired; | ||||
| 		} | ||||
| 		 | ||||
| 		public List<ItemChanceHolder> getItemsRequired() | ||||
| 		public List<ItemHolder> getItemsRequired() | ||||
| 		{ | ||||
| 			return _itemsRequired != null ? _itemsRequired : Collections.emptyList(); | ||||
| 		} | ||||
| 		 | ||||
| 		void setItemsRewarded(List<ItemChanceHolder> itemsRewarded) | ||||
| 		void setItemsRewarded(List<ItemHolder> itemsRewarded) | ||||
| 		{ | ||||
| 			_itemsRewarded = itemsRewarded; | ||||
| 		} | ||||
| 		 | ||||
| 		public List<ItemChanceHolder> getItemsRewarded() | ||||
| 		public List<ItemHolder> getItemsRewarded() | ||||
| 		{ | ||||
| 			return _itemsRewarded != null ? _itemsRewarded : Collections.emptyList(); | ||||
| 		} | ||||
|   | ||||
| @@ -1,17 +1,17 @@ | ||||
| <html><body>Test Server Helper:<br> | ||||
| How may I help you?<br> | ||||
| <font color="LEVEL">*About haracters*</font><br> | ||||
| <font color="LEVEL">*About Classes*</font><br> | ||||
| <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ClassMaster firstclass">"I want to complete the first class transfer."</Button> | ||||
| <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ClassMaster secondclass">"I want to complete the second class transfer."</Button> | ||||
| <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ClassMaster thirdclass">"I want to complete the third class transfer."</Button> | ||||
| <!--<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ClassMaster awaken">"I'm interested in the 4th class transfer (Awaken!)."</Button>--> | ||||
| <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ClassMaster setnoble">"I want to become a Noblesse!"</Button> | ||||
| <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ClassMaster ask=-6&reply=2">"I want to acquire the Exalted status."</Button> | ||||
| <!--<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ClassMaster setnoble">"I want to become a Noblesse!"</Button>--> | ||||
| <!--<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ClassMaster ask=-6&reply=2">"I want to acquire the Exalted status."</Button>--> | ||||
| <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ClassMaster learnskills">"I want to learn all skills up to the third class transfer."</Button><br> | ||||
| <font color="LEVEL">*About Items*</font><br> | ||||
| <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Multisell 697">"I need some gear."</Button> | ||||
| <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Multisell 622">"I want to purchase some Enhancers and such."</Button> | ||||
| <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Multisell 644">"I want to buy some Dimensional Items."</Button><br> | ||||
| <!--<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Multisell 644">"I want to buy some Dimensional Items."</Button><br>--><br> | ||||
| <font color="LEVEL">*About Clans*</font><br> | ||||
| <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ClassMaster clanlevel">"Can I raise my clan level?" </Button> | ||||
| </body> | ||||
|   | ||||
| @@ -1,3 +1,3 @@ | ||||
| <html><body>Test Server Guide:<br> | ||||
| <html><body>Test Server Helper:<br> | ||||
| You've already attempted the third class transfer! | ||||
| </body></html> | ||||
| @@ -1,3 +1,3 @@ | ||||
| <html><body>Test Server Guide:<br> | ||||
| <html><body>Test Server Helper:<br> | ||||
| You have successfully transferred class! | ||||
| </body></html> | ||||
| @@ -2,5 +2,5 @@ | ||||
| Do you want to raise your clan's level?<br> | ||||
| You can raise it <font color="LEVEL">up to level 10</font>, using the test server helper.<br> | ||||
| <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest ClassMaster clanlevelup">"I want to level up."</Button> | ||||
| <Button ALIGN=LEFT ICON="RETURN" action="link test_server_helper001.htm">Back</Button> | ||||
| <Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest ClassMaster test_server_helper001.html">Back</Button> | ||||
| </body></html> | ||||
| @@ -1,3 +1,3 @@ | ||||
| <html><body>Test Server Guide:<br> | ||||
| <html><body>Test Server Helper:<br> | ||||
| The second class transfer is only available for characters level 40 or above. | ||||
| </body></html> | ||||
| @@ -1,4 +1,4 @@ | ||||
| <html><body>Test Server Guide:<br> | ||||
| <html><body>Test Server Helper:<br> | ||||
| characters level 76 or above who have completed their second occupation change can change occupations for a third time.<br> | ||||
| Come back after you've finished your second occupation change and reached level 76. | ||||
| </body></html> | ||||
| @@ -253,7 +253,7 @@ public class Q00255_Tutorial extends Quest | ||||
| 			qs.setMemoState(2); | ||||
| 			playSound(player, "ItemSound.quest_tutorial"); | ||||
| 			playTutorialVoice(player, "tutorial_voice_013"); | ||||
| 			player.sendPacket(new TutorialShowQuestionMark(0, 1)); | ||||
| 			player.sendPacket(new TutorialShowQuestionMark(1, 0)); | ||||
| 		} | ||||
| 	} | ||||
| 	 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 MobiusDev
					MobiusDev