tensador125

cubic

Jun 22nd, 2023 (edited)
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 31.59 KB | Gaming | 0 0
  1. Subject: [PATCH] AIO Cubic
  2. ---
  3. Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java
  4. IDEA additional info:
  5. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  6. <+>UTF-8
  7. ===================================================================
  8. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java
  9. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java    (revision 6537f1023595a270a0b4d8785ee362d1122a674c)
  10. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java    (date 1687416470796)
  11. @@ -7407,4 +7407,15 @@
  12.        
  13.         return gms;
  14.     }
  15. +
  16. +   private boolean _isCubicBypass;
  17. +   public boolean isCubicBypass()
  18. +   {
  19. +       return _isCubicBypass;
  20. +   }
  21. +   public void setIsCubicBypass(boolean isCubicBypass)
  22. +   {
  23. +       _isCubicBypass = isCubicBypass;
  24. +   }
  25. +
  26.  }
  27. \ No newline at end of file
  28. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
  29. IDEA additional info:
  30. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  31. <+>UTF-8
  32. ===================================================================
  33. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
  34. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java   (revision 6537f1023595a270a0b4d8785ee362d1122a674c)
  35. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java   (date 1686989017105)
  36. @@ -1,8 +1,5 @@
  37.  package net.sf.l2j.gameserver.network.clientpackets;
  38.  
  39. -import java.util.StringTokenizer;
  40. -import java.util.logging.Logger;
  41. -
  42.  import net.sf.l2j.Config;
  43.  import net.sf.l2j.gameserver.communitybbs.CommunityBoard;
  44.  import net.sf.l2j.gameserver.data.manager.HeroManager;
  45. @@ -10,6 +7,7 @@
  46.  import net.sf.l2j.gameserver.enums.FloodProtector;
  47.  import net.sf.l2j.gameserver.handler.AdminCommandHandler;
  48.  import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  49. +import net.sf.l2j.gameserver.handler.itemhandlers.Cubic;
  50.  import net.sf.l2j.gameserver.model.World;
  51.  import net.sf.l2j.gameserver.model.WorldObject;
  52.  import net.sf.l2j.gameserver.model.actor.Npc;
  53. @@ -21,6 +19,9 @@
  54.  import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
  55.  import net.sf.l2j.gameserver.scripting.QuestState;
  56.  
  57. +import java.util.StringTokenizer;
  58. +import java.util.logging.Logger;
  59. +
  60.  public final class RequestBypassToServer extends L2GameClientPacket
  61.  {
  62.     private static final Logger GMAUDIT_LOG = Logger.getLogger("gmaudit");
  63. @@ -45,7 +46,7 @@
  64.         final Player player = getClient().getPlayer();
  65.         if (player == null)
  66.             return;
  67. -      
  68. +
  69.         if (_command.startsWith("admin_"))
  70.         {
  71.             String command = _command.split(" ")[0];
  72. @@ -72,6 +73,17 @@
  73.            
  74.             ach.useAdminCommand(_command, player);
  75.         }
  76. +       if (_command.startsWith("cubic_"))
  77. +       {
  78. +           String command = _command.substring(6);
  79. +           try
  80. +           {
  81. +               Cubic.onBypass(player, command);
  82. +           }
  83. +           catch (NumberFormatException nfe)
  84. +           {
  85. +           }
  86. +       }
  87.         else if (_command.startsWith("player_help "))
  88.         {
  89.             final String path = _command.substring(12);
  90. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/ItemHandler.java
  91. IDEA additional info:
  92. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  93. <+>UTF-8
  94. ===================================================================
  95. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/handler/ItemHandler.java b/aCis_gameserver/java/net/sf/l2j/gameserver/handler/ItemHandler.java
  96. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/handler/ItemHandler.java   (revision 6537f1023595a270a0b4d8785ee362d1122a674c)
  97. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/handler/ItemHandler.java   (date 1686988305138)
  98. @@ -3,32 +3,7 @@
  99.  import java.util.HashMap;
  100.  import java.util.Map;
  101.  
  102. -import net.sf.l2j.gameserver.handler.itemhandlers.BeastSoulShots;
  103. -import net.sf.l2j.gameserver.handler.itemhandlers.BeastSpices;
  104. -import net.sf.l2j.gameserver.handler.itemhandlers.BeastSpiritShots;
  105. -import net.sf.l2j.gameserver.handler.itemhandlers.BlessedSpiritShots;
  106. -import net.sf.l2j.gameserver.handler.itemhandlers.Books;
  107. -import net.sf.l2j.gameserver.handler.itemhandlers.Calculators;
  108. -import net.sf.l2j.gameserver.handler.itemhandlers.Elixirs;
  109. -import net.sf.l2j.gameserver.handler.itemhandlers.EnchantScrolls;
  110. -import net.sf.l2j.gameserver.handler.itemhandlers.FishShots;
  111. -import net.sf.l2j.gameserver.handler.itemhandlers.Harvesters;
  112. -import net.sf.l2j.gameserver.handler.itemhandlers.ItemSkills;
  113. -import net.sf.l2j.gameserver.handler.itemhandlers.Keys;
  114. -import net.sf.l2j.gameserver.handler.itemhandlers.Maps;
  115. -import net.sf.l2j.gameserver.handler.itemhandlers.MercenaryTickets;
  116. -import net.sf.l2j.gameserver.handler.itemhandlers.PaganKeys;
  117. -import net.sf.l2j.gameserver.handler.itemhandlers.PetFoods;
  118. -import net.sf.l2j.gameserver.handler.itemhandlers.Recipes;
  119. -import net.sf.l2j.gameserver.handler.itemhandlers.RollingDices;
  120. -import net.sf.l2j.gameserver.handler.itemhandlers.ScrollsOfResurrection;
  121. -import net.sf.l2j.gameserver.handler.itemhandlers.Seeds;
  122. -import net.sf.l2j.gameserver.handler.itemhandlers.SevenSignsRecords;
  123. -import net.sf.l2j.gameserver.handler.itemhandlers.SoulCrystals;
  124. -import net.sf.l2j.gameserver.handler.itemhandlers.SoulShots;
  125. -import net.sf.l2j.gameserver.handler.itemhandlers.SpecialXMas;
  126. -import net.sf.l2j.gameserver.handler.itemhandlers.SpiritShots;
  127. -import net.sf.l2j.gameserver.handler.itemhandlers.SummonItems;
  128. +import net.sf.l2j.gameserver.handler.itemhandlers.*;
  129.  import net.sf.l2j.gameserver.model.item.kind.EtcItem;
  130.  
  131.  public class ItemHandler
  132. @@ -63,6 +38,7 @@
  133.         registerHandler(new SoulCrystals());
  134.         registerHandler(new SpiritShots());
  135.         registerHandler(new SummonItems());
  136. +       registerHandler(new Cubic());
  137.     }
  138.    
  139.     private void registerHandler(IItemHandler handler)
  140. Index: aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/Cubic.java
  141. IDEA additional info:
  142. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  143. <+>UTF-8
  144. ===================================================================
  145. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/Cubic.java b/aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/Cubic.java
  146. new file mode 100644
  147. --- /dev/null   (date 1687430218863)
  148. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/handler/itemhandlers/Cubic.java    (date 1687430218863)
  149. @@ -0,0 +1,340 @@
  150. +/*
  151. + * This program is free software: you can redistribute it and/or modify it under
  152. + * the terms of the GNU General Public License as published by the Free Software
  153. + * Foundation, either version 3 of the License, or (at your option) any later
  154. + * version.
  155. + *
  156. + * This program is distributed in the hope that it will be useful, but WITHOUT
  157. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  158. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  159. + * details.
  160. + *
  161. + * You should have received a copy of the GNU General Public License along with
  162. + * this program. If not, see <http://www.gnu.org/licenses/>.
  163. + */
  164. +package net.sf.l2j.gameserver.handler.itemhandlers;
  165. +
  166. +import net.sf.l2j.gameserver.data.cache.HtmCache;
  167. +import net.sf.l2j.gameserver.data.xml.MultisellData;
  168. +import net.sf.l2j.gameserver.data.xml.PlayerData;
  169. +import net.sf.l2j.gameserver.data.xml.SkillTreeData;
  170. +import net.sf.l2j.gameserver.enums.actors.ClassId;
  171. +import net.sf.l2j.gameserver.enums.skills.Stats;
  172. +import net.sf.l2j.gameserver.handler.IItemHandler;
  173. +import net.sf.l2j.gameserver.model.actor.Playable;
  174. +import net.sf.l2j.gameserver.model.actor.Player;
  175. +import net.sf.l2j.gameserver.model.holder.skillnode.EnchantSkillNode;
  176. +import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  177. +import net.sf.l2j.gameserver.model.olympiad.OlympiadManager;
  178. +import net.sf.l2j.gameserver.network.SystemMessageId;
  179. +import net.sf.l2j.gameserver.network.serverpackets.*;
  180. +
  181. +import java.text.DecimalFormat;
  182. +import java.util.List;
  183. +
  184. +/**
  185. + * @author Acacia aka Kishin
  186. + *
  187. + */
  188. +public class Cubic implements IItemHandler
  189. +{
  190. +    @Override
  191. +    public void useItem(Playable playable, ItemInstance item,boolean forceUse)
  192. +    {
  193. +        if (!(playable instanceof Player))
  194. +            return;
  195. +        Player player = (Player)playable;
  196. +
  197. +        if( player.isInJail() || player.isInDuel() || player.isInCombat() ||
  198. +                player.isInOlympiadMode() || player.isInObserverMode() ||
  199. +                OlympiadManager.getInstance().isRegistered(player))
  200. +            {
  201. +                player.sendMessage("Invalid action");
  202. +                player.sendPacket(ActionFailed.STATIC_PACKET);
  203. +                return;
  204. +            }
  205. +
  206. +        int itemId = item.getItemId();
  207. +
  208. +        if (itemId == 5588) // Tutorial Guide
  209. +        {
  210. +            String htmFile = "data/html/Custom/PortableCubic/Cubic.htm";
  211. +            String htmContent = HtmCache.getInstance().getHtm(htmFile);
  212. +
  213. +            NpcHtmlMessage infoHtml = new NpcHtmlMessage(1);
  214. +            infoHtml.setHtml(htmContent);
  215. +            player.sendPacket(infoHtml);
  216. +        }
  217. +    }
  218. +
  219. +    public static void onBypass(Player player, String command)
  220. +    {
  221. +        if(player.isInJail() || player.isInDuel() || player.isInCombat() ||
  222. +           player.isInOlympiadMode() || player.isInObserverMode() ||
  223. +           OlympiadManager.getInstance().isRegistered(player))
  224. +           {
  225. +             player.sendMessage("Invalid action");
  226. +             player.sendPacket(ActionFailed.STATIC_PACKET);
  227. +             return;
  228. +           }
  229. +        //Augment Command
  230. +        if(command.equalsIgnoreCase("aug"))
  231. +        {
  232. +            player.sendPacket(SystemMessageId.SELECT_THE_ITEM_TO_BE_AUGMENTED);
  233. +            player.sendPacket(ExShowVariationMakeWindow.STATIC_PACKET);
  234. +        }
  235. +        //Cancel Augment Command
  236. +        if(command.equalsIgnoreCase("cancelaug"))
  237. +        {
  238. +            player.sendPacket(SystemMessageId.SELECT_THE_ITEM_TO_BE_AUGMENTED);
  239. +            player.sendPacket(ExShowVariationCancelWindow.STATIC_PACKET);
  240. +        }
  241. +        //enchant skills
  242. +        if(command.equalsIgnoreCase("enchantskill"))
  243. +        {
  244. +            if(player.getClassId().getLevel() < 3)
  245. +            {
  246. +                player.sendMessage("You must have completed the 3rd class transfer.");
  247. +                return;
  248. +            }
  249. +
  250. +            final List<EnchantSkillNode> skills = SkillTreeData.getInstance().getEnchantSkillsFor(player);
  251. +            if (skills.isEmpty())
  252. +            {
  253. +                player.sendPacket(SystemMessageId.THERE_IS_NO_SKILL_THAT_ENABLES_ENCHANT);
  254. +
  255. +                if (player.getStatus().getLevel() < 76)
  256. +                    player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.DO_NOT_HAVE_FURTHER_SKILLS_TO_LEARN_S1).addNumber(91));
  257. +                else
  258. +                    player.sendPacket(SystemMessageId.NO_MORE_SKILLS_TO_LEARN);
  259. +            }
  260. +            else
  261. +                player.setIsCubicBypass(true);
  262. +            player.sendPacket(new ExEnchantSkillList(skills));
  263. +        }
  264. +
  265. +        // Player's Statistics
  266. +        if (command.equalsIgnoreCase("stats"))
  267. +        {
  268. +            if(player.isDead() || player.isAlikeDead())
  269. +            {player.sendMessage("Invalid action");
  270. +                player.sendPacket(ActionFailed.STATIC_PACKET);
  271. +                return;}
  272. +
  273. +            NpcHtmlMessage html = new NpcHtmlMessage(1);
  274. +            StringBuilder html1 = new StringBuilder("<html><body>");
  275. +
  276. +            html1.append("<br><center><font color=\"LEVEL\">[Additional Player Stats]</font></center>");
  277. +            html1.append("<table border=0 width=\"100%\">");
  278. +            html1.append("<tr><td>Critical Damage Multi</td><td>" + new DecimalFormat("0.##").format(player.getStatus().calcStat(Stats.CRITICAL_DAMAGE, 1.00, null, null)) + "x +"
  279. +                    + player.getStatus().calcStat(Stats.CRITICAL_DAMAGE_ADD, 0, null, null) + "</td></tr>");
  280. +            html1.append("<tr><td>Magic Critical Rate</td><td>" + Math.round((float) player.getStatus().getMCriticalHit(null, null) / 10) + "%" + "</td></tr>");
  281. +            html1.append("<tr><td>Healed Boost (received)</td><td>" + (int) (player.getStatus().calcStat(Stats.HEAL_EFFECTIVNESS, 100, null, null)) + "%" + "</td></tr>");
  282. +            html1.append("<tr><td>Healing Power (given)</td><td>" + (int) (player.getStatus().calcStat(Stats.HEAL_PROFICIENCY, 100, null, null)) + "%" + "</td></tr>");
  283. +            html1.append("<tr><td>PVP Attack Hits Damage</td><td>" + new DecimalFormat("0.##").format(player.getStatus().calcStat(Stats.PVP_PHYSICAL_DMG, 1, null, null)) + "x" + "</td></tr>");
  284. +            html1.append("<tr><td>PVP Physical Skill Damage</td><td>" + new DecimalFormat("0.##").format(player.getStatus().calcStat(Stats.PVP_PHYS_SKILL_DMG, 1, null, null)) + "x" + "</td></tr>");
  285. +            html1.append("<tr><td>PVP Physical Skill Defence</td><td>" + new DecimalFormat("0.##").format(player.getStatus().calcStat(Stats.PVP_PHYS_SKILL_DEF, 1, null, null)) + "x" + "</td></tr>");
  286. +            html1.append("<tr><td>PVP Magical Damage</td><td>" + new DecimalFormat("0.##").format(player.getStatus().calcStat(Stats.PVP_MAGICAL_DMG, 1, null, null)) + "x" + "</td></tr>");
  287. +            html1.append("<tr><td>Physical Skill Dodge</td><td>" + (int) (player.getStatus().calcStat(Stats.P_SKILL_EVASION, 0, null, null)) + "%" + "</td></tr>");
  288. +            html1.append("<tr><td>Attack Range</td><td>" + player.getStatus().getPhysicalAttackRange() + "</td></tr>");
  289. +            html1.append("<tr><td>Damage Reflect</td><td>" + (int) (player.getStatus().calcStat(Stats.REFLECT_DAMAGE_PERCENT, 0, null, null)) + "%" + "</td></tr>");
  290. +            html1.append("<tr><td>Skill Reflect</td><td>" + (int) (player.getStatus().calcStat(Stats.REFLECT_SKILL_PHYSIC, 0, null, null)) + "%" + "</td></tr>");
  291. +            html1.append("<tr><td>Magic Reflect</td><td>" + (int) (player.getStatus().calcStat(Stats.REFLECT_SKILL_MAGIC, 0, null, null)) + "%" + "</td></tr>");
  292. +            html1.append("<tr><td>Mp Consume Rate %</td><td>" + (int) (player.getStatus().calcStat(Stats.MAGICAL_MP_CONSUME_RATE, 100, null, null)) + "%" + "</td></tr><br><br>");
  293. +            html1.append("<tr><td>Vamp. Absorb %</td><td>" + (int) (player.getStatus().calcStat(Stats.ABSORB_DAMAGE_PERCENT, 0, null, null)) + "%" + "</td></tr><br><br>");
  294. +            html1.append("<tr><td>Critical Damage Resist</td><td>" + (int) (1 - player.getStatus().calcStat(Stats.CRIT_VULN, 1, null, null)) * 100 + "%" + "</td></tr><br><br>");
  295. +            final int atkCount = (int) (player.getStatus().calcStat(Stats.ATTACK_COUNT_MAX, 1, null, null));
  296. +            html1.append("<tr><td>Attack Count</td><td>" + atkCount + "</td></tr><br><br>");
  297. +            html1.append("<tr><td>Attack AOE Angle</td><td>" + (atkCount > 1 ? (int) (player.getStatus().calcStat(Stats.POWER_ATTACK_ANGLE, 120, null, null)) : "N/A") + "</td></tr><br><br>");
  298. +            html1.append("</table>");
  299. +            html1.append("<center><button value=\"Refresh\" action=\"bypass -h cubic_stats\" width=64 height=14 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">");
  300. +            html1.append("<center><button value=\"Back\" action=\"bypass -h cubic_chat cubic.htm\" width=64 height=14 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">");
  301. +            html1.append("</body></html>");
  302. +
  303. +            html.setHtml(html1.toString());
  304. +            player.sendPacket(html);
  305. +        }
  306. +        //class change
  307. +        if (command.equalsIgnoreCase("upgradeclass"))
  308. +        {
  309. +            if(player.isDead() || player.isAlikeDead())
  310. +            {player.sendMessage("Invalid action");
  311. +                player.sendPacket(ActionFailed.STATIC_PACKET);
  312. +                return;}
  313. +
  314. +            Cubic.sendClassChangeHTML(player);
  315. +        }
  316. +        //class change choose
  317. +        if (command.startsWith("upgradeclasschoose"))
  318. +        {
  319. +            if(player.isDead() || player.isAlikeDead())
  320. +            {player.sendMessage("Invalid action");
  321. +                player.sendPacket(ActionFailed.STATIC_PACKET);
  322. +                return;}
  323. +
  324. +            if (player.isInCombat())
  325. +            {
  326. +                player.sendMessage("Cannot use while in combat");
  327. +                return;
  328. +            }
  329. +            final int val = Integer.parseInt(command.substring(19));
  330. +
  331. +            final ClassId classId = player.getClassId();
  332. +            final ClassId newClassId = ClassId.values()[val];
  333. +
  334. +            final int level = player.getStatus().getLevel();
  335. +            final int jobLevel = classId.getLevel();
  336. +            final int newJobLevel = newClassId.getLevel();
  337. +
  338. +            // Prevents changing to class not in same class tree
  339. +            if (!newClassId.isChildOf(classId))
  340. +                return;
  341. +
  342. +            // Prevents changing between same level jobs
  343. +            if (newJobLevel != jobLevel + 1)
  344. +                return;
  345. +
  346. +            // Check for player level
  347. +            if (level < 20 && newJobLevel > 1)
  348. +                return;
  349. +            if (level < 40 && newJobLevel > 2)
  350. +                return;
  351. +            if (level < 76 && newJobLevel > 3)
  352. +                return;
  353. +            // -- Prevention ends
  354. +
  355. +            changeClass(player, val);
  356. +            player.broadcastCharInfo();
  357. +            player.broadcastUserInfo();
  358. +
  359. +            if (newJobLevel == 3)
  360. +                player.sendPacket(SystemMessageId.THIRD_CLASS_TRANSFER);
  361. +            else
  362. +                player.sendPacket(SystemMessageId.CLASS_TRANSFER);
  363. +
  364. +            NpcHtmlMessage html = new NpcHtmlMessage(31228);
  365. +            StringBuilder sb = new StringBuilder();
  366. +            sb.append("<html><body>");
  367. +            sb.append("Class Upgrader:<br>");
  368. +            sb.append("<br>");
  369. +            sb.append("You have become a <font color=\"LEVEL\">" + PlayerData.getInstance().getClassNameById(player.getClassId().getId()) + "</font>.");
  370. +
  371. +            if ((level >= 76 && newJobLevel < 3) || (level >= 40 && newJobLevel < 2))
  372. +            {
  373. +                sb.append("<br><button value=\"Next Class\" action=\"bypass -h cubic_upgradeclass\" width=94 height=20 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">");
  374. +            }
  375. +            else
  376. +                sb.append("<br><button value=\"Welcome Page\" action=\"bypass -h cubic_chat cubic.htm\" width=94 height=20 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">");
  377. +
  378. +            sb.append("</body></html>");
  379. +            html.setHtml(sb.toString());
  380. +            player.sendPacket(html);
  381. +        }
  382. +        if(command.startsWith("chat"))
  383. +        {
  384. +            if(player.isDead() || player.isAlikeDead())
  385. +            {player.sendMessage("Invalid action");
  386. +                player.sendPacket(ActionFailed.STATIC_PACKET);
  387. +                return;}
  388. +            NpcHtmlMessage html = new NpcHtmlMessage(0);
  389. +            html.setFile((new StringBuilder()).append("data/html/custom/PortableCubic/").append(command.substring(5)).toString());
  390. +            player.sendPacket(html);
  391. +            player.sendPacket(ActionFailed.STATIC_PACKET);
  392. +        }
  393. +
  394. +        //sell inventory items
  395. +        if(command.equalsIgnoreCase("sell"))
  396. +        {
  397. +            if(player.isDead() || player.isAlikeDead())
  398. +            {player.sendMessage("Invalid action");
  399. +                player.sendPacket(ActionFailed.STATIC_PACKET);
  400. +                return;}
  401. +
  402. +            final List<ItemInstance> items = player.getInventory().getSellableItems();
  403. +            player.setIsCubicBypass(true);
  404. +            player.sendPacket(new SellList(player.getAdena(), items));
  405. +        }
  406. +        //Execute Multisell Store:
  407. +        if(command.startsWith("multi"))
  408. +        {
  409. +            if(player.isDead() || player.isAlikeDead())
  410. +            {player.sendMessage("Invalid action");
  411. +                player.sendPacket(ActionFailed.STATIC_PACKET);
  412. +                return;}
  413. +
  414. +            player.setIsCubicBypass(true);
  415. +            String name = command.substring(6);
  416. +            MultisellData.getInstance().separateAndSend(name, player, null, false);
  417. +        }
  418. +
  419. +        if(command.startsWith("teleport"))
  420. +        {
  421. +            /**
  422. +             * ADD YOUR TELEPORTER CUBIC CODE HERE
  423. +             */
  424. +        }
  425. +    }
  426. +
  427. +
  428. +    private static void changeClass(Player player, int val)
  429. +    {
  430. +        player.setClassId(val);
  431. +
  432. +        if (player.isSubClassActive())
  433. +            player.getSubClasses().get(player.getClassIndex()).setClassId(player.getActiveClass());
  434. +        else
  435. +            player.setBaseClass(player.getActiveClass());
  436. +    }
  437. +
  438. +    public static void sendClassChangeHTML(Player player)
  439. +    {
  440. +        NpcHtmlMessage html = new NpcHtmlMessage(1); //roy the cat default class master
  441. +        StringBuilder sb = new StringBuilder();
  442. +        sb.append("<html><body>");
  443. +        sb.append("Class Upgrader:<br>");
  444. +        sb.append("<br>");
  445. +
  446. +        final ClassId classId = player.getClassId();
  447. +        final int level = player.getStatus().getLevel();
  448. +        final int jobLevel = classId.getLevel();
  449. +        final int newJobLevel = jobLevel + 1;
  450. +
  451. +        if ((level >= 20 && jobLevel == 0) || (level >= 40 && jobLevel == 1) || (level >= 76 && jobLevel == 2))
  452. +        {
  453. +            sb.append("You can change your class to following:<br>");
  454. +
  455. +            for (ClassId child : ClassId.values())
  456. +                if (child.isChildOf(classId) && child.getLevel() == newJobLevel)
  457. +                    sb.append("<br><a action=\"bypass -h cubic_upgradeclasschoose " + (child.getId()) + "\"> " + PlayerData.getInstance().getClassNameById(child.getId()) + "</a>");
  458. +
  459. +            sb.append("<br>");
  460. +        }
  461. +        else
  462. +        {
  463. +            switch (jobLevel)
  464. +            {
  465. +                case 0:
  466. +                    sb.append("You must reach lvl 20 to begin class change.<br>");
  467. +                    break;
  468. +                case 1:
  469. +                    sb.append("You must reach lvl 40 to begin 2nd class change.<br>");
  470. +                    break;
  471. +                case 2:
  472. +                    sb.append("You must reach lvl 76 to begin 3rd class change.<br>");
  473. +                    break;
  474. +                case 3:
  475. +                    sb.append("There is no class change available for you anymore.");
  476. +                    break;
  477. +            }
  478. +
  479. +            sb.append("<br>");
  480. +        }
  481. +
  482. +        sb.append("<br><br>You can access this page from the Class Upgrade option of the Wondrous Cubic (F12)<br>");
  483. +        sb.append("<br><button value=\"Welcome Page\" action=\"bypass -h cubic_chat cubic.htm\" width=94 height=20 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">");
  484. +
  485. +        sb.append("</body></html>");
  486. +        html.setHtml(sb.toString());
  487. +        player.sendPacket(html);
  488. +    }
  489. +}
  490. \ No newline at end of file
  491. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestSellItem.java
  492. IDEA additional info:
  493. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  494. <+>UTF-8
  495. ===================================================================
  496. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestSellItem.java b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestSellItem.java
  497. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestSellItem.java (revision 6537f1023595a270a0b4d8785ee362d1122a674c)
  498. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestSellItem.java (date 1686987823780)
  499. @@ -56,9 +56,17 @@
  500.         if (player == null)
  501.             return;
  502.        
  503. -       final Npc merchant = (player.getTarget() instanceof Merchant || player.getTarget() instanceof MercenaryManagerNpc) ? (Npc) player.getTarget() : null;
  504. +       /*final Npc merchant = (player.getTarget() instanceof Merchant || player.getTarget() instanceof MercenaryManagerNpc) ? (Npc) player.getTarget() : null;
  505.         if (merchant == null || !player.getAI().canDoInteract(merchant))
  506. -           return;
  507. +           return;*/
  508. +
  509. +       Npc merchant = null;
  510. +       if(!player.isCubicBypass())
  511. +       {
  512. +           merchant = !(player.getTarget() instanceof Merchant) && !(player.getTarget() instanceof MercenaryManagerNpc) ? null : (Npc)player.getTarget();
  513. +           if(merchant == null || !player.getAI().canDoInteract(merchant))
  514. +               return;
  515. +       }
  516.        
  517.         if (_listId > 1000000 && merchant.getTemplate().getNpcId() != _listId - 1000000)
  518.             return;
  519. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java
  520. IDEA additional info:
  521. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  522. <+>UTF-8
  523. ===================================================================
  524. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java
  525. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java (revision 6537f1023595a270a0b4d8785ee362d1122a674c)
  526. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java (date 1687428231559)
  527. @@ -68,13 +68,25 @@
  528.             player.setMultiSell(null);
  529.             return;
  530.         }
  531. -      
  532. -       final Folk folk = player.getCurrentFolk();
  533. +
  534. +       Folk folk = null ;
  535. +       if(!player.isCubicBypass()) {
  536. +
  537. +           folk = player.getCurrentFolk();
  538. +
  539. +           if ((folk != null && !list.isNpcAllowed(folk.getNpcId())) || (folk == null && list.isNpcOnly()))
  540. +           {
  541. +               player.setMultiSell(null);
  542. +               return;
  543. +           }
  544. +       }
  545. +
  546. +       /*final Folk folk = player.getCurrentFolk();
  547.         if ((folk != null && !list.isNpcAllowed(folk.getNpcId())) || (folk == null && list.isNpcOnly()))
  548.         {
  549.             player.setMultiSell(null);
  550.             return;
  551. -       }
  552. +       }*/
  553.        
  554.         if (folk != null && !player.getAI().canDoInteract(folk))
  555.         {
  556. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestExEnchantSkillInfo.java
  557. IDEA additional info:
  558. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  559. <+>UTF-8
  560. ===================================================================
  561. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestExEnchantSkillInfo.java b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestExEnchantSkillInfo.java
  562. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestExEnchantSkillInfo.java   (revision 6537f1023595a270a0b4d8785ee362d1122a674c)
  563. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestExEnchantSkillInfo.java   (date 1687426261191)
  564. @@ -13,49 +13,61 @@
  565.  {
  566.     private int _skillId;
  567.     private int _skillLevel;
  568. -  
  569. +
  570.     @Override
  571. -   protected void readImpl()
  572. -   {
  573. +   protected void readImpl() {
  574.         _skillId = readD();
  575.         _skillLevel = readD();
  576.     }
  577. -  
  578. +
  579.     @Override
  580. -   protected void runImpl()
  581. -   {
  582. +   protected void runImpl() {
  583.         if (_skillId <= 0 || _skillLevel <= 0)
  584.             return;
  585. -      
  586. +
  587.         final Player player = getClient().getPlayer();
  588.         if (player == null)
  589.             return;
  590. -      
  591. +
  592.         if (player.getClassId().getLevel() < 3 || player.getStatus().getLevel() < 76)
  593.             return;
  594. -      
  595. -       final Folk folk = player.getCurrentFolk();
  596. +
  597. +        /*final Folk folk = player.getCurrentFolk();
  598.         if (folk == null || !player.getAI().canDoInteract(folk))
  599. -           return;
  600. -      
  601. +           return;*/
  602. +
  603. +       Folk folk = null;
  604. +       if(!player.isCubicBypass()) {
  605. +           folk = player.getCurrentFolk();
  606. +           if(folk == null || !player.getAI().canDoInteract(folk))
  607. +               return;
  608. +       }
  609. +
  610.         if (player.getSkillLevel(_skillId) >= _skillLevel)
  611.             return;
  612. -      
  613. +
  614.         final L2Skill skill = SkillTable.getInstance().getInfo(_skillId, _skillLevel);
  615.         if (skill == null)
  616.             return;
  617. -      
  618. -       if (!folk.getTemplate().canTeach(player.getClassId()))
  619. -           return;
  620. -      
  621. -       final EnchantSkillNode esn = SkillTreeData.getInstance().getEnchantSkillFor(player, _skillId, _skillLevel);
  622. +
  623. +        /*if (!folk.getTemplate().canTeach(player.getClassId()))
  624. +           return;*/
  625. +
  626. +       if(!player.isCubicBypass())
  627. +       {
  628. +           folk = player.getCurrentFolk();
  629. +           if(folk == null || !folk.getTemplate().canTeach(player.getClassId()))
  630. +               return;
  631. +       }
  632. +
  633. +           final EnchantSkillNode esn = SkillTreeData.getInstance().getEnchantSkillFor(player, _skillId, _skillLevel);
  634.         if (esn == null)
  635.             return;
  636. -      
  637. +
  638.         final ExEnchantSkillInfo esi = new ExEnchantSkillInfo(_skillId, _skillLevel, esn.getSp(), esn.getExp(), esn.getEnchantRate(player.getStatus().getLevel()));
  639.         if (Config.ES_SP_BOOK_NEEDED && esn.getItem() != null)
  640.             esi.addRequirement(4, esn.getItem().getId(), esn.getItem().getValue(), 0);
  641. -      
  642. +
  643.         sendPacket(esi);
  644.     }
  645.  }
  646. \ No newline at end of file
  647. Index: aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestExEnchantSkill.java
  648. IDEA additional info:
  649. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  650. <+>UTF-8
  651. ===================================================================
  652. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestExEnchantSkill.java b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestExEnchantSkill.java
  653. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestExEnchantSkill.java   (revision 6537f1023595a270a0b4d8785ee362d1122a674c)
  654. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestExEnchantSkill.java   (date 1686989297778)
  655. @@ -38,9 +38,17 @@
  656.         if (player.getClassId().getLevel() < 3 || player.getStatus().getLevel() < 76)
  657.             return;
  658.        
  659. -       final Folk folk = player.getCurrentFolk();
  660. +       /*final Folk folk = player.getCurrentFolk();
  661.         if (folk == null || !player.getAI().canDoInteract(folk))
  662. -           return;
  663. +           return;*/
  664. +
  665. +       Folk folk = null;
  666. +       if(!player.isCubicBypass())
  667. +       {
  668. +           folk = player.getCurrentFolk();
  669. +           if(folk == null || !player.getAI().canDoInteract(folk))
  670. +               return;
  671. +       }
  672.        
  673.         if (player.getSkillLevel(_skillId) >= _skillLevel)
  674.             return;
  675. @@ -92,6 +100,7 @@
  676.         player.sendPacket(new UserInfo(player));
  677.        
  678.         // Show enchant skill list.
  679. +       assert folk != null;
  680.         folk.showEnchantSkillList(player);
  681.     }
  682.  }
  683. \ No newline at end of file
  684. Index: aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/MultisellData.java
  685. IDEA additional info:
  686. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  687. <+>UTF-8
  688. ===================================================================
  689. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/MultisellData.java b/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/MultisellData.java
  690. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/MultisellData.java    (revision 6537f1023595a270a0b4d8785ee362d1122a674c)
  691. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/MultisellData.java    (date 1687426978082)
  692. @@ -10,6 +10,7 @@
  693.  
  694.  import net.sf.l2j.gameserver.model.actor.Npc;
  695.  import net.sf.l2j.gameserver.model.actor.Player;
  696. +import net.sf.l2j.gameserver.model.actor.instance.Folk;
  697.  import net.sf.l2j.gameserver.model.multisell.Entry;
  698.  import net.sf.l2j.gameserver.model.multisell.Ingredient;
  699.  import net.sf.l2j.gameserver.model.multisell.ListContainer;
  700. @@ -92,8 +93,16 @@
  701.         if (template == null)
  702.             return;
  703.        
  704. -       if ((npc != null && !template.isNpcAllowed(npc.getNpcId())) || (npc == null && template.isNpcOnly()))
  705. -           return;
  706. +       /*if ((npc != null && !template.isNpcAllowed(npc.getNpcId())) || (npc == null && template.isNpcOnly()))
  707. +           return;*/
  708. +
  709. +       Folk folk = null ;
  710. +       if(!player.isCubicBypass())
  711. +       {
  712. +           folk = player.getCurrentFolk();
  713. +           if((folk == null || !template.isNpcAllowed(npc.getNpcId())) || (npc == null && template.isNpcOnly()))
  714. +               return;
  715. +       }
  716.        
  717.         final PreparedListContainer list = new PreparedListContainer(template, inventoryOnly, player, npc);
  718.        
  719.  
Add Comment
Please, Sign In to add comment