Advertisement
Sarada-L2

Limpar Pk Click item Frozen Yo: Sarada

Mar 23rd, 2021
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.17 KB | None | 0 0
  1. diff --git a/config/CustomMods/ItensCoins.ini b/config/CustomMods/ItensCoins.ini
  2. new file mode 100644
  3. index 0000000..0ff21e6
  4. --- /dev/null
  5. +++ b/config/CustomMods/ItensCoins.ini
  6. @@ -0,0 +1,11 @@
  7. +#=============================================================
  8. +# Item Clean Pk
  9. +#=============================================================
  10. +#Item Clean PK ID
  11. +CleanPkItemID = 0
  12. +
  13. +#ID da skill animasao quando usa o item
  14. +SkillIDCleanPk = 5000
  15. +
  16. +#Tempo de animasao da skill Clean Pk
  17. +SkillEffectsTimeCleanPK = 5000
  18. diff --git a/head-src/com/l2jfrozen/Config.java b/head-src/com/l2jfrozen/Config.java
  19. index f2336bb..77b1b0b 100644
  20. --- a/head-src/com/l2jfrozen/Config.java
  21. +++ b/head-src/com/l2jfrozen/Config.java
  22. @@ -835,6 +835,9 @@
  23. public static int CLAN_FULL_STATUS;
  24. public static int CLAN_QUANTIDADE_ITEMFULL;
  25. public static int ITEM_CLASS_ID;
  26. + public static int SEGUNDS_SKILL_ANIMATION_PK;
  27. + public static int SKILL_ID_PK;
  28. + public static int ITEM_PK_CLEANID;
  29. // ============================================================
  30. public static void loadItensCoin()
  31. {
  32. @@ -846,6 +849,9 @@
  33. final InputStream is = new FileInputStream(new File(ITENS_COIN));
  34. item.load(is);
  35. is.close();
  36. + ITEM_PK_CLEANID = Integer.parseInt(item.getProperty("CleanPkItemID", "0"));
  37. + SKILL_ID_PK = Integer.parseInt(item.getProperty("SkillIDCleanPk", "0"));
  38. + SEGUNDS_SKILL_ANIMATION_PK = Integer.parseInt(item.getProperty("SkillEffectsTimeCleanPK", "0"));
  39. ITEM_CLASS_ID = Integer.parseInt(item.getProperty("ItemCard", "0"));
  40. REWARD_ITEM_D = Integer.parseInt(item.getProperty("ItemRewardGradeDCoinID", "0"));
  41. COIN_ITEM_LEVEL = Integer.parseInt(item.getProperty("ItemLevelCoinID", "5557"));
  42. diff --git a/head-src/com/l2jfrozen/gameserver/handler/ItemHandler.java b/head-src/com/l2jfrozen/gameserver/handler/ItemHandler.java
  43. index 63c3b34..3c3027d 100644
  44. --- a/head-src/com/l2jfrozen/gameserver/handler/ItemHandler.java
  45. +++ b/head-src/com/l2jfrozen/gameserver/handler/ItemHandler.java
  46. @@ -42,6 +42,7 @@
  47. import com.l2jfrozen.gameserver.handler.itemhandlers.ClanLevel;
  48. import com.l2jfrozen.gameserver.handler.itemhandlers.ClanReputation;
  49. import com.l2jfrozen.gameserver.handler.itemhandlers.ClassItem;
  50. +import com.l2jfrozen.gameserver.handler.itemhandlers.CleanPk;
  51. import com.l2jfrozen.gameserver.handler.itemhandlers.CrystalCarol;
  52. import com.l2jfrozen.gameserver.handler.itemhandlers.Crystals;
  53. import com.l2jfrozen.gameserver.handler.itemhandlers.CustomPotions;
  54. @@ -136,6 +137,7 @@
  55. private ItemHandler()
  56. {
  57. _datatable = new TreeMap<>();
  58. + registerItemHandler(new CleanPk());
  59. registerItemHandler(new Skin1());
  60. registerItemHandler(new Skin2());
  61. registerItemHandler(new Skin3());
  62. diff --git a/head-src/com/l2jfrozen/gameserver/handler/itemhandlers/CleanPk.java b/head-src/com/l2jfrozen/gameserver/handler/itemhandlers/CleanPk.java
  63. new file mode 100644
  64. index 0000000..0c7f435
  65. --- /dev/null
  66. +++ b/head-src/com/l2jfrozen/gameserver/handler/itemhandlers/CleanPk.java
  67. @@ -0,0 +1,67 @@
  68. +package com.l2jfrozen.gameserver.handler.itemhandlers;
  69. +
  70. +import com.l2jfrozen.Config;
  71. +import com.l2jfrozen.gameserver.handler.IItemHandler;
  72. +import com.l2jfrozen.gameserver.model.L2Object;
  73. +import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
  74. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  75. +import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance;
  76. +import com.l2jfrozen.gameserver.network.serverpackets.MagicSkillUser;
  77. +import com.l2jfrozen.gameserver.network.serverpackets.SetupGauge;
  78. +import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
  79. +import com.l2jfrozen.gameserver.util.Broadcast;
  80. +
  81. +/**
  82. + *
  83. + * @author Sarada
  84. + *
  85. + */
  86. +public class CleanPk implements IItemHandler
  87. +{
  88. + @Override
  89. + public void useItem(final L2PlayableInstance playable, final L2ItemInstance item)
  90. + {
  91. +
  92. + if (!(playable instanceof L2PcInstance))
  93. + return;
  94. +
  95. + L2PcInstance activeChar = (L2PcInstance)playable;
  96. +
  97. + if (activeChar.getPkKills() < 5)
  98. + {
  99. + activeChar.sendMessage("You do not have enough Pk kills for clean.");
  100. + return;
  101. + }
  102. + if (activeChar.isImmobileUntilAttacked())
  103. + {
  104. + activeChar.sendMessage("You do use Item Mod Animation.");
  105. + return;
  106. + }
  107. + ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
  108. + {
  109. + @Override
  110. + public void run()
  111. + {
  112. + playable.setIsImmobileUntilAttacked(false);
  113. + activeChar.setPkKills(0);
  114. + activeChar.sendMessage("You have successfully clean pks!");
  115. + activeChar.broadcastUserInfo();
  116. + }
  117. + }, Config.SEGUNDS_SKILL_ANIMATION_PK);
  118. + final L2Object oldTarget = playable.getTarget();
  119. + playable.setTarget(playable);
  120. + Broadcast.toSelfAndKnownPlayers(playable, new MagicSkillUser(playable, Config.SKILL_ID_PK, 1, Config.SEGUNDS_SKILL_ANIMATION_PK, 0));
  121. + playable.setTarget(oldTarget);
  122. + playable.sendPacket(new SetupGauge(0, Config.SEGUNDS_SKILL_ANIMATION_PK));
  123. + playable.setIsImmobileUntilAttacked(true);
  124. + }
  125. + @Override
  126. + public int[] getItemIds()
  127. + {
  128. + return ITEM_IDS;
  129. + }
  130. +
  131. + private static final int ITEM_IDS[] = {
  132. + Config.ITEM_PK_CLEANID
  133. + };
  134. +}
  135. \ No newline at end of file
  136.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement