Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/config/CustomMods/ItensCoins.ini b/config/CustomMods/ItensCoins.ini
- new file mode 100644
- index 0000000..0ff21e6
- --- /dev/null
- +++ b/config/CustomMods/ItensCoins.ini
- @@ -0,0 +1,11 @@
- +#=============================================================
- +# Item Clean Pk
- +#=============================================================
- +#Item Clean PK ID
- +CleanPkItemID = 0
- +
- +#ID da skill animasao quando usa o item
- +SkillIDCleanPk = 5000
- +
- +#Tempo de animasao da skill Clean Pk
- +SkillEffectsTimeCleanPK = 5000
- diff --git a/head-src/com/l2jfrozen/Config.java b/head-src/com/l2jfrozen/Config.java
- index f2336bb..77b1b0b 100644
- --- a/head-src/com/l2jfrozen/Config.java
- +++ b/head-src/com/l2jfrozen/Config.java
- @@ -835,6 +835,9 @@
- public static int CLAN_FULL_STATUS;
- public static int CLAN_QUANTIDADE_ITEMFULL;
- public static int ITEM_CLASS_ID;
- + public static int SEGUNDS_SKILL_ANIMATION_PK;
- + public static int SKILL_ID_PK;
- + public static int ITEM_PK_CLEANID;
- // ============================================================
- public static void loadItensCoin()
- {
- @@ -846,6 +849,9 @@
- final InputStream is = new FileInputStream(new File(ITENS_COIN));
- item.load(is);
- is.close();
- + ITEM_PK_CLEANID = Integer.parseInt(item.getProperty("CleanPkItemID", "0"));
- + SKILL_ID_PK = Integer.parseInt(item.getProperty("SkillIDCleanPk", "0"));
- + SEGUNDS_SKILL_ANIMATION_PK = Integer.parseInt(item.getProperty("SkillEffectsTimeCleanPK", "0"));
- ITEM_CLASS_ID = Integer.parseInt(item.getProperty("ItemCard", "0"));
- REWARD_ITEM_D = Integer.parseInt(item.getProperty("ItemRewardGradeDCoinID", "0"));
- COIN_ITEM_LEVEL = Integer.parseInt(item.getProperty("ItemLevelCoinID", "5557"));
- diff --git a/head-src/com/l2jfrozen/gameserver/handler/ItemHandler.java b/head-src/com/l2jfrozen/gameserver/handler/ItemHandler.java
- index 63c3b34..3c3027d 100644
- --- a/head-src/com/l2jfrozen/gameserver/handler/ItemHandler.java
- +++ b/head-src/com/l2jfrozen/gameserver/handler/ItemHandler.java
- @@ -42,6 +42,7 @@
- import com.l2jfrozen.gameserver.handler.itemhandlers.ClanLevel;
- import com.l2jfrozen.gameserver.handler.itemhandlers.ClanReputation;
- import com.l2jfrozen.gameserver.handler.itemhandlers.ClassItem;
- +import com.l2jfrozen.gameserver.handler.itemhandlers.CleanPk;
- import com.l2jfrozen.gameserver.handler.itemhandlers.CrystalCarol;
- import com.l2jfrozen.gameserver.handler.itemhandlers.Crystals;
- import com.l2jfrozen.gameserver.handler.itemhandlers.CustomPotions;
- @@ -136,6 +137,7 @@
- private ItemHandler()
- {
- _datatable = new TreeMap<>();
- + registerItemHandler(new CleanPk());
- registerItemHandler(new Skin1());
- registerItemHandler(new Skin2());
- registerItemHandler(new Skin3());
- diff --git a/head-src/com/l2jfrozen/gameserver/handler/itemhandlers/CleanPk.java b/head-src/com/l2jfrozen/gameserver/handler/itemhandlers/CleanPk.java
- new file mode 100644
- index 0000000..0c7f435
- --- /dev/null
- +++ b/head-src/com/l2jfrozen/gameserver/handler/itemhandlers/CleanPk.java
- @@ -0,0 +1,67 @@
- +package com.l2jfrozen.gameserver.handler.itemhandlers;
- +
- +import com.l2jfrozen.Config;
- +import com.l2jfrozen.gameserver.handler.IItemHandler;
- +import com.l2jfrozen.gameserver.model.L2Object;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance;
- +import com.l2jfrozen.gameserver.network.serverpackets.MagicSkillUser;
- +import com.l2jfrozen.gameserver.network.serverpackets.SetupGauge;
- +import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
- +import com.l2jfrozen.gameserver.util.Broadcast;
- +
- +/**
- + *
- + * @author Sarada
- + *
- + */
- +public class CleanPk implements IItemHandler
- +{
- + @Override
- + public void useItem(final L2PlayableInstance playable, final L2ItemInstance item)
- + {
- +
- + if (!(playable instanceof L2PcInstance))
- + return;
- +
- + L2PcInstance activeChar = (L2PcInstance)playable;
- +
- + if (activeChar.getPkKills() < 5)
- + {
- + activeChar.sendMessage("You do not have enough Pk kills for clean.");
- + return;
- + }
- + if (activeChar.isImmobileUntilAttacked())
- + {
- + activeChar.sendMessage("You do use Item Mod Animation.");
- + return;
- + }
- + ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
- + {
- + @Override
- + public void run()
- + {
- + playable.setIsImmobileUntilAttacked(false);
- + activeChar.setPkKills(0);
- + activeChar.sendMessage("You have successfully clean pks!");
- + activeChar.broadcastUserInfo();
- + }
- + }, Config.SEGUNDS_SKILL_ANIMATION_PK);
- + final L2Object oldTarget = playable.getTarget();
- + playable.setTarget(playable);
- + Broadcast.toSelfAndKnownPlayers(playable, new MagicSkillUser(playable, Config.SKILL_ID_PK, 1, Config.SEGUNDS_SKILL_ANIMATION_PK, 0));
- + playable.setTarget(oldTarget);
- + playable.sendPacket(new SetupGauge(0, Config.SEGUNDS_SKILL_ANIMATION_PK));
- + playable.setIsImmobileUntilAttacked(true);
- + }
- + @Override
- + public int[] getItemIds()
- + {
- + return ITEM_IDS;
- + }
- +
- + private static final int ITEM_IDS[] = {
- + Config.ITEM_PK_CLEANID
- + };
- +}
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement