Advertisement
Guest User

Tutorialv2

a guest
Apr 20th, 2023
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 24.71 KB | Gaming | 0 0
  1. diff --git a/aCis_datapack/data/html/script/feature/TutorialQuest/60050-03.htm b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-03.htm
  2. new file mode 100644
  3. index 0000000..79c6646
  4. --- /dev/null
  5. +++ b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-03.htm
  6. @@ -0,0 +1,7 @@
  7. +<html><body>
  8. +<center><font color="LEVEL">[Welcome Tutorial]</font></center><br>
  9. +Hello Traveller! Welcome to our Lineage II World.<br>
  10. +Until level 20, your character is limited to wearing No-Grade items. However, once you reach level 20, you will be able to wear D-Grade items.<br>
  11. +<font color="LEVEL">For every monster you kill, I have some items to give you and also explain to you about the game. I hope you are doing well and don't encounter any problems.</font><br>
  12. +<a action="link close">Close window.</a>
  13. +</body></html>
  14. \ No newline at end of file
  15. diff --git a/aCis_datapack/data/html/script/feature/TutorialQuest/60050-06.htm b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-06.htm
  16. new file mode 100644
  17. index 0000000..64d7dd7
  18. --- /dev/null
  19. +++ b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-06.htm
  20. @@ -0,0 +1,7 @@
  21. +<html><body><br>
  22. +<center><font color="LEVEL">[Acquire Item]</font></center><br>
  23. +<font color="FF0000">You just obtained your first weapon!</font> This weapon will makes you stronger! Our weapons help us become stronger against other players.<br>
  24. +Click on the <font color="FF0000">bag</font> on the bottom right screen to open the Inventory Window, or press Tab or ALT+V.<br>
  25. +<img src="L2UI_CH3.tutorial_img07" width=175 height=64><br>
  26. +<a action="link close">Close window.</a>
  27. +</body></html>
  28. \ No newline at end of file
  29. diff --git a/aCis_datapack/data/html/script/feature/TutorialQuest/60050-07.htm b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-07.htm
  30. new file mode 100644
  31. index 0000000..4bc87e8
  32. --- /dev/null
  33. +++ b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-07.htm
  34. @@ -0,0 +1,7 @@
  35. +<html><body><br>
  36. +<center><font color="LEVEL">[Acquire Weapon Item]</font></center><br>
  37. +<font color="FF0000">Here is your Armor</font>, so that you can be more resilient against monsters or other players. I also gave you some jewels, so that you can take less damage from magic skills.<br>
  38. +Click on the <font color="FF0000">bag</font> on the bottom right screen to open the Inventory Window, or press Tab or ALT+V.<br>
  39. +<img src="L2UI_CH3.tutorial_img07" width=175 height=64><br>
  40. +<a action="link close">Close window.</a>
  41. +</body></html>
  42. \ No newline at end of file
  43. diff --git a/aCis_datapack/data/html/script/feature/TutorialQuest/60050-08.htm b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-08.htm
  44. new file mode 100644
  45. index 0000000..8050583
  46. --- /dev/null
  47. +++ b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-08.htm
  48. @@ -0,0 +1,8 @@
  49. +<html><body><br>
  50. +<center><font color="LEVEL">[Tutorial Completed]</font></center><br><br>
  51. +You have just completed the Tutorial with the basic steps to familiarize yourself more with the game<br>
  52. +You are now ready for the world of Lineage II. You can now explore all the remaining areas within the game!<br><br>
  53. +<font color="LEVEL">I wish you a pleasant stay! Good luck!</font><br>
  54. +<center><a action="link move">Move me for more exp.</a><br>
  55. +<center><a action="link town">Back to Town</a></center>
  56. +</body></html>
  57. \ No newline at end of file
  58. diff --git a/aCis_datapack/data/html/script/feature/TutorialQuest/60050-buff.htm b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-buff.htm
  59. new file mode 100644
  60. index 0000000..e3d3ca6
  61. --- /dev/null
  62. +++ b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-buff.htm
  63. @@ -0,0 +1,16 @@
  64. +<html><body><br>
  65. +<font color="LEVEL">[Increase your power]</font><br><br>
  66. +<font color="FF0000">Here are some buffs</font> that will make you stronger and faster in executing your skills.<br>
  67. +These buffs are available to certain characters such as the Prophet and Shillien Elder.<br>
  68. +Check your stats, so you can see what each buff offers you. <font color="LEVEL">Make sure you will never run out of buffs.</font><br>
  69. +<table border="1" bordercolor="#2E9AFE" bgcolor="2E9AFE">
  70. +<tr>
  71. +<td width=37 height=39 align=center><img src="icon.skill0364" width=32 height=32></td>
  72. +<td width=38 height=39 align=center><img src="icon.skill1355" width=32 height=32></td>
  73. +<td width=37 height=39 align=center><img src="icon.skill1332" width=32 height=32></td>
  74. +<td width=38 height=39 align=center><img src="icon.skill1352" width=32 height=32></td>
  75. +</tr>
  76. +</table>
  77. +</center>
  78. +<a action="link close">Close window.</a>
  79. +</body></html>
  80. \ No newline at end of file
  81. diff --git a/aCis_datapack/data/html/script/feature/TutorialQuest/60050-pickup.htm b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-pickup.htm
  82. new file mode 100644
  83. index 0000000..bd36644
  84. --- /dev/null
  85. +++ b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-pickup.htm
  86. @@ -0,0 +1,6 @@
  87. +<html><body>
  88. +<center><font color="LEVEL">[Picking Up Items]</font></center><br
  89. +>When you defeat monsters, they drop their items on the ground.<br>
  90. +Press the <font color="LEVEL">F4 key</font> and you can automatically pick up nearby items. Currently, the fourth slot on the shortcut bar is registered with the pickup action and therefore, when you press the F4 key, that action is activated.<table border=0><tr><td><img src="L2UI_CH3.tutorial_img151" width=64 height=64></td><td><img src="L2UI_CH3.tutorial_img20" width=64 height=64></td></tr></table><br>
  91. +<a action="link close">Close Window.</a>
  92. +</body></html>
  93. \ No newline at end of file
  94. diff --git a/aCis_datapack/data/html/script/feature/TutorialQuest/60050-skills.htm b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-skills.htm
  95. new file mode 100644
  96. index 0000000..fc10cbb
  97. --- /dev/null
  98. +++ b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-skills.htm
  99. @@ -0,0 +1,7 @@
  100. +<html><body><br>
  101. +<center><font color="LEVEL">[Skills]</font></center><br><br>
  102. +Once you reach level 7 or above you will learn new skills. With <font color="LEVEL">"Alt+K"</font> you can check all your available skills. <br>
  103. +It's important to customize your bar (F keys) with the right skills so that you can easily use them whenever needed.<br>
  104. +You can also enchant your skills to make them more powerful, so that for example, your chance skills are more effective against monsters or other players.<br>
  105. +<a action="link close">Close window.</a>
  106. +</body></html>
  107. \ No newline at end of file
  108. diff --git a/aCis_datapack/data/html/script/feature/TutorialQuest/60050-soulshot.htm b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-soulshot.htm
  109. new file mode 100644
  110. index 0000000..5df1c58
  111. --- /dev/null
  112. +++ b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-soulshot.htm
  113. @@ -0,0 +1,14 @@
  114. +<html><body><br>
  115. +<center><font color="LEVEL">[Soulshots]</font></center><br><br>
  116. +I just gave you 300 soulshots. Soulshots are useful to make your weapon stronger!<br>
  117. +Soulshots will be useful to you throughout the game.<br>
  118. +<table border="1" bordercolor="#2E9AFE" bgcolor="2E9AFE">
  119. +<tr>
  120. +<td align=center><img src="icon.etc_spirit_bullet_white_i00" width=32 height=32></td>
  121. +</tr>
  122. +</table>
  123. +</center>
  124. +Fighter classes use <font color="LEVEL">soulshots</font> and only Mage classes uses <font color="LEVEL">Blessed spirishots</font>.<br>
  125. +In game you will find and <font color="LEVEL">Spirishots</font> but you will need them for olympiad matches as a Mage class.<br>
  126. +<a action="link close">Close window.</a>
  127. +</body></html>
  128. \ No newline at end of file
  129. diff --git a/aCis_datapack/data/html/script/feature/TutorialQuest/60050-sp.htm b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-sp.htm
  130. new file mode 100644
  131. index 0000000..5b35c5c
  132. --- /dev/null
  133. +++ b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-sp.htm
  134. @@ -0,0 +1,7 @@
  135. +<html><body>
  136. +<center><font color="LEVEL">[EXP & SP]</font></center><br>
  137. +As you kill monsters, you will have noticed that you receive exp & sp. Your exp is useful for leveling up. The more exp you collect, the faster you level up.<br>
  138. +<font color="LEVEL">On the other hand, you need sp to learn new skills.</font> In every village/town there are Masters where, depending on your class, you can learn some new skills.<br>
  139. +So, it's important to kill monsters. Also, monsters should not be smaller than you because the smaller the monster compared to your level, the less exp & sp you gain.<br>
  140. +<a action="link close">Close window.</a>
  141. +</body></html>
  142. \ No newline at end of file
  143. diff --git a/aCis_datapack/data/html/script/feature/TutorialQuest/60050-spiritshot.htm b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-spiritshot.htm
  144. new file mode 100644
  145. index 0000000..e92067c
  146. --- /dev/null
  147. +++ b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-spiritshot.htm
  148. @@ -0,0 +1,14 @@
  149. +<html><body><br>
  150. +<center><font color="LEVEL">[Blessed Spiritshots]</font></center><br><br>
  151. +I just gave you 300 Blessed Spiritshot. Spiritshots are useful to make your weapon stronger!<br>
  152. +Soulshots will be useful to you throughout the game.<br>
  153. +<table border="1" bordercolor="#2E9AFE" bgcolor="2E9AFE">
  154. +<tr>
  155. +<td align=center><img src="icon.etc_spell_shot_white_i01" width=32 height=32></td>
  156. +</tr>
  157. +</table>
  158. +</center>
  159. +Mage classes use <font color="LEVEL">spiritshots</font> and only Fighter classes uses <font color="LEVEL">soulshots</font>.<br>
  160. +In game you will find and <font color="LEVEL">Spirishots</font> but you will need them for olympiad matches as a Mage class.<br>
  161. +<a action="link close">Close window.</a>
  162. +</body></html>
  163. \ No newline at end of file
  164. diff --git a/aCis_datapack/data/html/script/feature/TutorialQuest/60050-view.htm b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-view.htm
  165. new file mode 100644
  166. index 0000000..e535103
  167. --- /dev/null
  168. +++ b/aCis_datapack/data/html/script/feature/TutorialQuest/60050-view.htm
  169. @@ -0,0 +1,6 @@
  170. +<html><body>
  171. +<center><font color="LEVEL">[Changing Point-Of-View]</font></center><br>
  172. +Good work! Now, I will explain to you how you can change your point-of-view.<br>
  173. +<font color="FF0000">Try moving your mouse while pressing down the right button. </font> You can set your viewpoint in any direction.<img src="L2UI_CH3.tutorial_img04" width=128 height=64><br>When you need to examine the area around your character, you can use this feature to change your viewpoint as needed.<br>
  174. +<a action="link close">Close window.</a>
  175. +</body></html>
  176. \ No newline at end of file
  177. diff --git a/aCis_datapack/data/html/script/feature/TutorialQuest/60050.htm b/aCis_datapack/data/html/script/feature/TutorialQuest/60050.htm
  178. new file mode 100644
  179. index 0000000..869f5d6
  180. --- /dev/null
  181. +++ b/aCis_datapack/data/html/script/feature/TutorialQuest/60050.htm
  182. @@ -0,0 +1,8 @@
  183. +<html><body>
  184. +<font color="LEVEL">[Tutorial Window]</font><br>
  185. +Welcome Traveller! Welcome to our Lineage II World.<br>
  186. +I have some items to give you and also explain to you about the game. The tutorial will help you with your first steps.</font><br>
  187. +You can choose to decline the quest and continue without guidance. <font color="LEVEL">However, you will not benefit from the items/buffs that this tutorial provides.</font><br>
  188. +<a action="link start">Yes I want to.</a><br>
  189. +<a action="link exit">Exit tutorial.</a>
  190. +</body></html>
  191. \ No newline at end of file
  192. diff --git a/aCis_datapack/data/xml/scripts.xml b/aCis_datapack/data/xml/scripts.xml
  193. index 3e38b21..6ed1371 100644
  194. --- a/aCis_datapack/data/xml/scripts.xml
  195. +++ b/aCis_datapack/data/xml/scripts.xml
  196. @@ -411,6 +411,7 @@
  197.     <script path="script.feature.SecondClassChange"/>
  198.     <script path="script.feature.ShadowWeapon"/>
  199.     <script path="script.feature.Tutorial"/>
  200. +   <script path="script.feature.TutorialQuest"/>
  201.     <script path="script.feature.VarkaSilenosSupport"/>
  202.  
  203.     <!-- Siegable Halls -->
  204. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
  205. index e0fdf75..64657c3 100644
  206. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
  207. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
  208. @@ -51,6 +51,7 @@
  209. import net.sf.l2j.gameserver.network.serverpackets.UserInfo;
  210. import net.sf.l2j.gameserver.scripting.Quest;
  211. import net.sf.l2j.gameserver.scripting.QuestState;
  212. +import net.sf.l2j.gameserver.scripting.script.feature.TutorialQuest;
  213. import net.sf.l2j.gameserver.skills.L2Skill;
  214. import net.sf.l2j.gameserver.taskmanager.GameTimeTaskManager;
  215.  
  216. @@ -260,6 +261,7 @@
  217.        
  218.         PetitionManager.getInstance().checkActivePetition(player);
  219.        
  220. +       TutorialQuest.onCreate(player);
  221.         player.onPlayerEnter();
  222.        
  223.         sendPacket(new SkillCoolTime(player));
  224. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestCharacterCreate.java b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestCharacterCreate.java
  225. index 3d4cfae..a8bf410 100644
  226. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestCharacterCreate.java
  227. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestCharacterCreate.java
  228. @@ -20,7 +20,6 @@
  229. import net.sf.l2j.gameserver.network.serverpackets.CharCreateFail;
  230. import net.sf.l2j.gameserver.network.serverpackets.CharCreateOk;
  231. import net.sf.l2j.gameserver.network.serverpackets.CharSelectInfo;
  232. -import net.sf.l2j.gameserver.scripting.Quest;
  233.  
  234. public final class RequestCharacterCreate extends L2GameClientPacket
  235. {
  236. @@ -165,9 +164,9 @@
  237.         }
  238.        
  239.         // Tutorial runs here.
  240. -       final Quest quest = ScriptData.getInstance().getQuest("Tutorial");
  241. -       if (quest != null)
  242. -           quest.newQuestState(player).setState(QuestStatus.STARTED);
  243. +       var quest = ScriptData.getInstance().getQuest("TutorialQuest");
  244. +           if (quest != null)
  245. +               quest.newQuestState(player).setState(QuestStatus.STARTED);
  246.        
  247.         player.setOnlineStatus(true, false);
  248.         player.deleteMe();
  249. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestTutorialLinkHtml.java b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestTutorialLinkHtml.java
  250. index a60ea86..f0987c7 100644
  251. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestTutorialLinkHtml.java
  252. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestTutorialLinkHtml.java
  253. @@ -1,7 +1,13 @@
  254. package net.sf.l2j.gameserver.network.clientpackets;
  255.  
  256. +import net.sf.l2j.commons.random.Rnd;
  257. +
  258. +import net.sf.l2j.gameserver.data.xml.MapRegionData;
  259. +import net.sf.l2j.gameserver.data.xml.MapRegionData.TeleportType;
  260. import net.sf.l2j.gameserver.model.actor.Player;
  261. +import net.sf.l2j.gameserver.network.serverpackets.TutorialCloseHtml;
  262. import net.sf.l2j.gameserver.scripting.QuestState;
  263. +import net.sf.l2j.gameserver.scripting.script.feature.TutorialQuest;
  264.  
  265. public class RequestTutorialLinkHtml extends L2GameClientPacket
  266. {
  267. @@ -20,6 +26,43 @@
  268.         if (player == null)
  269.             return;
  270.        
  271. +       if (_bypass != null)
  272. +       {
  273. +           switch (_bypass)
  274. +           {
  275. +               case "move":
  276. +                   int random = Rnd.get(1, 3);
  277. +                   switch(random)
  278. +                   {
  279. +                       case 1:
  280. +                           player.teleportTo(-99685, 237680, -3568, 20);
  281. +                           break;
  282. +                       case 2:
  283. +                           player.teleportTo(-99091, 230749, -3608, 20);
  284. +                           break;
  285. +                       case 3:
  286. +                           player.teleportTo(-103743, 222504, -3440, 20);
  287. +                           break;
  288. +                   }
  289. +                   break;
  290. +               case "town":
  291. +                   var loc = MapRegionData.getInstance().getLocationToTeleport(player, TeleportType.TOWN);
  292. +                   player.teleportTo(loc.getX(), loc.getY(), loc.getZ(), 20);
  293. +                   break;
  294. +               case "close":
  295. +                   player.sendPacket(TutorialCloseHtml.STATIC_PACKET);
  296. +                   break;
  297. +               case "start":
  298. +                   TutorialQuest.onStartTutorial(player);
  299. +                   break;
  300. +               case "exit":
  301. +                   TutorialQuest.onExitTutorial(player);
  302. +                   break;
  303. +               default:
  304. +                   return;
  305. +           }
  306. +           player.sendPacket(TutorialCloseHtml.STATIC_PACKET);
  307. +       }
  308.         final QuestState qs = player.getQuestList().getQuestState("Tutorial");
  309.         if (qs != null)
  310.             qs.getQuest().notifyEvent(_bypass, null, player);
  311. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/feature/TutorialQuest.java b/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/feature/TutorialQuest.java
  312. new file mode 100644
  313. index 0000000..cec048f
  314. --- /dev/null
  315. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/feature/TutorialQuest.java
  316. @@ -0,0 +1,237 @@
  317. +package net.sf.l2j.gameserver.scripting.script.feature;
  318. +
  319. +import java.util.ArrayList;
  320. +import java.util.Arrays;
  321. +import java.util.List;
  322. +
  323. +import net.sf.l2j.commons.pool.ThreadPool;
  324. +
  325. +import net.sf.l2j.gameserver.data.SkillTable;
  326. +import net.sf.l2j.gameserver.data.cache.HtmCache;
  327. +import net.sf.l2j.gameserver.data.xml.NpcData;
  328. +import net.sf.l2j.gameserver.enums.QuestStatus;
  329. +import net.sf.l2j.gameserver.enums.actors.ClassId;
  330. +import net.sf.l2j.gameserver.model.actor.Creature;
  331. +import net.sf.l2j.gameserver.model.actor.Npc;
  332. +import net.sf.l2j.gameserver.model.actor.Player;
  333. +import net.sf.l2j.gameserver.network.SystemMessageId;
  334. +import net.sf.l2j.gameserver.network.serverpackets.InventoryUpdate;
  335. +import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
  336. +import net.sf.l2j.gameserver.network.serverpackets.TutorialShowHtml;
  337. +import net.sf.l2j.gameserver.scripting.Quest;
  338. +import net.sf.l2j.gameserver.skills.L2Skill;
  339. +
  340. +/**
  341. + * @author Baggos
  342. + */
  343. +public class TutorialQuest extends Quest
  344. +{
  345. +   private static final String QUEST_NAME = "TutorialQuest";
  346. +   private static final int ADENA_REWARD = 20000;
  347. +  
  348. +   public TutorialQuest()
  349. +   {
  350. +       super(-1, "feature");
  351. +      
  352. +       for (var monsterId = 18000; monsterId <= 21000; monsterId++)
  353. +       {
  354. +           var template = NpcData.getInstance().getTemplate(monsterId);
  355. +           if (template != null && template.getLevel() < 20)
  356. +               addKillId(monsterId);
  357. +       }
  358. +   }
  359. +  
  360. +   @Override
  361. +   public String onKill(Npc npc, Creature killer)
  362. +   {
  363. +       var player = killer.getActingPlayer();
  364. +       var htmltext = getNoQuestMsg();
  365. +       var st = player.getQuestList().getQuestState(QUEST_NAME);
  366. +      
  367. +       if (st == null)
  368. +           return htmltext;
  369. +      
  370. +       var cond = st.getCond();
  371. +       if (cond == 0)
  372. +           return null;
  373. +      
  374. +       switch (cond)
  375. +       {
  376. +           case 1:
  377. +               st.setCond(2);
  378. +               player.sendPacket(new TutorialShowHtml(HtmCache.getInstance().getHtmForce("data/html/script/feature/TutorialQuest/60050-pickup.htm")));
  379. +               break;
  380. +           case 2:
  381. +               st.setCond(3);
  382. +               player.sendPacket(new TutorialShowHtml(HtmCache.getInstance().getHtmForce("data/html/script/feature/TutorialQuest/60050-view.htm")));
  383. +               break;
  384. +           case 3:
  385. +               st.setCond(4);
  386. +               var mageBuffs = Arrays.asList(4342, 4355, 4356, 4344);
  387. +               var fighterBuffs = Arrays.asList(4342, 4357, 4345, 4344);
  388. +               var newbieBuffs = player.isMageClass() || player.getClassId() == ClassId.ORC_MYSTIC ? mageBuffs : fighterBuffs;
  389. +              
  390. +               for (var id : newbieBuffs)
  391. +               {
  392. +                   player.getStatus().setMaxHpMp();
  393. +                   L2Skill buff = SkillTable.getInstance().getInfo(id, SkillTable.getInstance().getMaxLevel(id));
  394. +                   buff.getEffects(player, player);
  395. +                   player.sendPacket(new TutorialShowHtml(HtmCache.getInstance().getHtmForce("data/html/script/feature/TutorialQuest/60050-buff.htm")));
  396. +               }
  397. +               break;
  398. +          
  399. +           case 4:
  400. +               st.setCond(5);
  401. +               playSound(player, SOUND_ITEMGET);
  402. +               giveItems(player, player.isMageClass() || player.getClassId() == ClassId.ORC_MYSTIC ? 3947 : 1835, 300);
  403. +               player.sendPacket(new TutorialShowHtml(HtmCache.getInstance().getHtmForce(player.isMageClass() || player.getClassId() == ClassId.ORC_MYSTIC ? "data/html/script/feature/TutorialQuest/60050-spiritshot.htm" : "data/html/script/feature/TutorialQuest/60050-soulshot.htm")));
  404. +               break;
  405. +          
  406. +           case 5:
  407. +               st.setCond(6);
  408. +               playSound(player, SOUND_ITEMGET);
  409. +               equipClassWeapon(null, player);
  410. +               player.sendPacket(new TutorialShowHtml(HtmCache.getInstance().getHtmForce("data/html/script/feature/TutorialQuest/60050-06.htm")));
  411. +               break;
  412. +          
  413. +           case 6:
  414. +               st.setCond(7);
  415. +               playSound(player, SOUND_ITEMGET);
  416. +               equipClassArmor(null, player);
  417. +               player.sendPacket(new TutorialShowHtml(HtmCache.getInstance().getHtmForce("data/html/script/feature/TutorialQuest/60050-07.htm")));
  418. +               break;
  419. +           case 7:
  420. +               st.setCond(8);
  421. +               player.sendPacket(new TutorialShowHtml(HtmCache.getInstance().getHtmForce("data/html/script/feature/TutorialQuest/60050-sp.htm")));
  422. +               break;
  423. +           case 8:
  424. +               st.setCond(9);
  425. +               player.sendPacket(new TutorialShowHtml(HtmCache.getInstance().getHtmForce("data/html/script/feature/TutorialQuest/60050-skills.htm")));
  426. +               break;
  427. +           case 9:
  428. +               st.setCond(0);
  429. +               player.getStatus().addExpAndSp(12000, 2000);
  430. +               player.sendMessage("Quest completed!");
  431. +               giveItems(player, 57, ADENA_REWARD);
  432. +               st.setState(QuestStatus.COMPLETED);
  433. +               playSound(player, SOUND_FINISH);
  434. +               st.exitQuest(true);
  435. +               player.sendPacket(new TutorialShowHtml(HtmCache.getInstance().getHtmForce("data/html/script/feature/TutorialQuest/60050-08.htm")));
  436. +               break;
  437. +       }
  438. +       return null;
  439. +   }
  440. +  
  441. +   public static void onCreate(Player player)
  442. +   {
  443. +       var st = player.getQuestList().getQuestState(QUEST_NAME);
  444. +       var cond = st.getCond();
  445. +       if (cond == 0 && player.getStatus().getLevel() == 1)
  446. +           player.sendPacket(new TutorialShowHtml(HtmCache.getInstance().getHtmForce("data/html/script/feature/TutorialQuest/60050.htm")));
  447. +   }
  448. +  
  449. +   public static void onStartTutorial(Player player)
  450. +   {
  451. +       ThreadPool.schedule(() -> player.sendPacket(new TutorialShowHtml(HtmCache.getInstance().getHtmForce("data/html/script/feature/TutorialQuest/60050-03.htm"))), 1000);
  452. +       var st = player.getQuestList().getQuestState(QUEST_NAME);
  453. +       var cond = st.getCond();
  454. +      
  455. +       if (cond == 0 && player.getStatus().getLevel() == 1)
  456. +       {
  457. +           st.setState(QuestStatus.STARTED);
  458. +           playSound(player, SOUND_ACCEPT);
  459. +           st.setCond(1);
  460. +       }
  461. +   }
  462. +  
  463. +   public static void onExitTutorial(Player player)
  464. +   {
  465. +       var st = player.getQuestList().getQuestState(QUEST_NAME);
  466. +       st.setState(QuestStatus.COMPLETED);
  467. +       playSound(player, SOUND_FINISH);
  468. +       st.set("cond", "0");
  469. +   }
  470. +  
  471. +   /**
  472. +    * @param armorIds - a List of integers representing the IDs of the armors/weapons to be equipped
  473. +    * @param player - a Player object representing the player who will equip the armors/weapons.
  474. +    */
  475. +   private static void equip(List<Integer> armorIds, Player player)
  476. +   {
  477. +       for (var id : armorIds)
  478. +       {
  479. +           player.getInventory().addItem("Armors", id, 1, player, null);
  480. +           player.getInventory().equipItemAndRecord(player.getInventory().getItemByItemId(id));
  481. +       }
  482. +       player.getInventory().reloadEquippedItems();
  483. +       player.broadcastCharInfo();
  484. +       new InventoryUpdate();
  485. +   }
  486. +  
  487. +   /**
  488. +    * Equips weapon based on the player's class ID.
  489. +    * @param classId the class ID of the player
  490. +    * @param player the player to equip weapon for
  491. +    */
  492. +   public static void equipClassWeapon(ClassId classId, Player player)
  493. +   {
  494. +       List<Integer> weaponIds = new ArrayList<>();
  495. +      
  496. +       switch (player.getClassId().getId())
  497. +       {
  498. +           case 0:
  499. +           case 31:
  500. +           case 36:
  501. +           case 53:
  502. +               weaponIds.addAll(Arrays.asList(6354));
  503. +               player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.EARNED_S2_S1_S).addItemName(6354));
  504. +               break;
  505. +           case 44:
  506. +               weaponIds.addAll(Arrays.asList(257));
  507. +               player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.EARNED_S2_S1_S).addItemName(257));
  508. +               break;
  509. +           case 10:
  510. +           case 25:
  511. +           case 38:
  512. +           case 49:
  513. +               weaponIds.addAll(Arrays.asList(100));
  514. +               player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.EARNED_S2_S1_S).addItemName(100));
  515. +               break;
  516. +       }
  517. +       equip(weaponIds, player);
  518. +   }
  519. +  
  520. +   /**
  521. +    * Equips armor based on the player's class ID.
  522. +    * @param classId the class ID of the player
  523. +    * @param player the player to equip armor for
  524. +    */
  525. +   public static void equipClassArmor(ClassId classId, Player player)
  526. +   {
  527. +       List<Integer> armorIds = new ArrayList<>();
  528. +      
  529. +       switch (player.getClassId().getId())
  530. +       {
  531. +           case 0:
  532. +           case 31:
  533. +           case 36:
  534. +           case 53:
  535. +               armorIds.addAll(Arrays.asList(44, 24, 31, 51, 38, 625, 908, 877, 877, 115, 115));
  536. +               player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.EARNED_S2_S1_S).addItemName(24));
  537. +               break;
  538. +           case 44:
  539. +               armorIds.addAll(Arrays.asList(44, 24, 31, 51, 38, 625, 908, 877, 877, 115, 115));
  540. +               player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.EARNED_S2_S1_S).addItemName(24));
  541. +               break;
  542. +           case 10:
  543. +           case 25:
  544. +           case 38:
  545. +           case 49:
  546. +               armorIds.addAll(Arrays.asList(44, 1101, 1104, 51, 38, 625, 908, 877, 877, 115, 115));
  547. +               player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.EARNED_S2_S1_S).addItemName(1101));
  548. +               break;
  549. +       }
  550. +       equip(armorIds, player);
  551. +   }
  552. +}
  553. \ No newline at end of file
  554.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement