Jump to content

Recommended Posts

Posted
/*

* This program is free software; you can redistribute it and/or modify

* it under the terms of the GNU General Public License as published by

* the Free Software Foundation; either version 2, or (at your option)

* any later version.

*

* This program is distributed in the hope that it will be useful,

* but WITHOUT ANY WARRANTY; without even the implied warranty of

* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

* GNU General Public License for more details.

*

* You should have received a copy of the GNU General Public License

* along with this program; if not, write to the Free Software

* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA

* 02111-1307, USA.

*

* http://www.gnu.org/copyleft/gpl.html

*/

 

/**

*

* @author x.v3ndetta@yahoo.com

*

*/

 

package net.sf.l2j.gameserver.handler.itemhandlers;

import java.util.logging.Level;

import java.util.logging.Logger;

import net.sf.l2j.gameserver.ThreadPoolManager;

import net.sf.l2j.gameserver.datatables.SkillTable;

import net.sf.l2j.gameserver.handler.IItemHandler;

import net.sf.l2j.gameserver.model.L2ItemInstance;

import net.sf.l2j.gameserver.model.L2Skill;

import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance;

import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance;

import net.sf.l2j.gameserver.network.SystemMessageId;

import net.sf.l2j.gameserver.serverpackets.ActionFailed;

import net.sf.l2j.gameserver.serverpackets.MagicSkillUser;

import net.sf.l2j.gameserver.serverpackets.SystemMessage;

import net.sf.l2j.gameserver.util.FloodProtector;

 

public class MBuff implements IItemHandler

{

protected static final Logger _log = Logger.getLogger(Potions.class.getName());

private static final int[] ITEM_IDS = {7163};

 

 

private int _herbstask = 0;

 

private class HerbTask implements Runnable

{

private L2PcInstance _activeChar;

private int _magicId;

private int _level;

HerbTask(L2PcInstance activeChar, int magicId, int level)

{

_activeChar = activeChar;

_magicId = magicId;

_level = level;

}

public void run()

{

try

{

usePotion(_activeChar, _magicId, _level);

}

catch (Throwable t)

{

_log.log(Level.WARNING, "", t);

}

}

}

public synchronized void useItem(L2PlayableInstance playable, L2ItemInstance item)

{

L2PcInstance activeChar;

if (playable instanceof L2PcInstance)

activeChar = (L2PcInstance) playable;

else if (playable instanceof L2PetInstance)

activeChar = ((L2PetInstance) playable).getOwner();

else

return;

if (activeChar.isInOlympiadMode())

{

activeChar.sendPacket(new SystemMessage(SystemMessageId.THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT));

return;

}

if (activeChar.isAllSkillsDisabled())

{

activeChar.sendPacket(new ActionFailed());

return;

}

 

L2Skill skill;

   int itemId = item.getItemId();

if (itemId == 7163)

{

skill = SkillTable.getInstance().getInfo(1204, 2);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(1040, 3);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(1068, 3);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(1035, 4);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(1045, 6);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(1048, 6);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(1036, 2);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(1259, 4);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(1257, 3);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(1062, 2);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(1268, 4);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(1086, 2);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(1240, 3);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(1077, 3);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(1242, 3);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(271, 1);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(274, 1);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(275, 1);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(310, 1);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(1229, 18);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(267, 1);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(268, 1);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(269, 1);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(304, 1);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(305, 1);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(308, 1);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(349, 1);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(1284, 3);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(1363, 1);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(4700, 13);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(4699, 13);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(1388, 2);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

skill = SkillTable.getInstance().getInfo(1323, 1);

skill.getEffects(activeChar, activeChar);

activeChar.broadcastPacket(new MagicSkillUser(activeChar, activeChar, skill.getId(), 1, skill.getHitTime(), 0));

}

}

public boolean usePotion(L2PcInstance activeChar, int magicId, int level)

{

if (activeChar.isCastingNow() && magicId>2277 && magicId<2285)

{

_herbstask += 100;

ThreadPoolManager.getInstance().scheduleAi(new HerbTask(activeChar, magicId, level), _herbstask);

}

else

{

if (magicId>2277 && magicId<2285 && _herbstask>=100) _herbstask -= 100;

L2Skill skill = SkillTable.getInstance().getInfo(magicId, level);

if (skill != null)

{

activeChar.doCast(skill);

if (!(activeChar.isSitting() && !skill.isPotion()))

return true;

}

}

return false;

} public int[] getItemIds()

{

return ITEM_IDS;

}

}

 

CREDITS : V3ndetta[ME}
  • 4 weeks later...
Posted

1st atleast if you do a such a thing dont use a herbtask rofl!

2nd use sql connection for buff store

 

at for last the most necessary learn to dont use INTERLUDE!If you ever want to learn something use gracia or epilogue!

Posted

at for last the most necessary learn to dont use INTERLUDE!If you ever want to learn something use gracia or epilogue!

 

At the moment i am using epilogue :P I bught a dedi,and l2zone will be on in few days,Gracia Epilogue :)

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • 我们的 Telegram 频道 已达到 3000 名订阅者! 感谢大家对我们项目的支持与关注! 我们即将举办一场精彩的抽奖或比赛,专为您准备! 不要错过参与的机会 — 立即订阅:https://t.me/accsforyou_shop✅ 活跃链接: 数字商品商店(网站):前往 商店 Telegram 机器人:前往 用于购买 Telegram Stars 的机器人:前往 SMM 面板:前往 – 推广您的社交媒体账户。 我们向您展示当前的 促销与特别优惠,可用于购买我们平台的产品与服务: 1. 使用优惠码 OCTOBER2025(8% 折扣)在十月期间通过我们的网站或机器人购物!首次购买还可使用优惠码 SOCNET(15% 折扣)。 2. 获得 $1 商店余额或 10–20% 折扣 —— 只需在我们网站注册后在论坛留言:“SEND ME BONUS, MY USERNAME IS...”。 3. 首次试用 SMM 面板可获得 $1 奖励 —— 只需在我们网站(支持页面)提交标题为 “Get Trial Bonus” 的工单。 4. 每周在我们的 Telegram 频道和用于购买 Stars 的机器人中赠送 Telegram Stars!
    • 我们的 Telegram 频道 已达到 3000 名订阅者! 感谢大家对我们项目的支持与关注! 我们即将举办一场精彩的抽奖或比赛,专为您准备! 不要错过参与的机会 — 立即订阅:https://t.me/accsforyou_shop✅ 活跃链接: 数字商品商店(网站):前往 商店 Telegram 机器人:前往 用于购买 Telegram Stars 的机器人:前往 SMM 面板:前往 – 推广您的社交媒体账户。 我们向您展示当前的 促销与特别优惠,可用于购买我们平台的产品与服务: 1. 使用优惠码 OCTOBER2025(8% 折扣)在十月期间通过我们的网站或机器人购物!首次购买还可使用优惠码 SOCNET(15% 折扣)。 2. 获得 $1 商店余额或 10–20% 折扣 —— 只需在我们网站注册后在论坛留言:“SEND ME BONUS, MY USERNAME IS...”。 3. 首次试用 SMM 面板可获得 $1 奖励 —— 只需在我们网站(支持页面)提交标题为 “Get Trial Bonus” 的工单。 4. 每周在我们的 Telegram 频道和用于购买 Stars 的机器人中赠送 Telegram Stars!
    • 我们的 Telegram 频道 已达到 3000 名订阅者! 感谢大家对我们项目的支持与关注! 我们即将举办一场精彩的抽奖或比赛,专为您准备! 不要错过参与的机会 — 立即订阅:https://t.me/accsforyou_shop✅ 活跃链接: 数字商品商店(网站):前往 商店 Telegram 机器人:前往 用于购买 Telegram Stars 的机器人:前往 SMM 面板:前往 – 推广您的社交媒体账户。 我们向您展示当前的 促销与特别优惠,可用于购买我们平台的产品与服务: 1. 使用优惠码 OCTOBER2025(8% 折扣)在十月期间通过我们的网站或机器人购物!首次购买还可使用优惠码 SOCNET(15% 折扣)。 2. 获得 $1 商店余额或 10–20% 折扣 —— 只需在我们网站注册后在论坛留言:“SEND ME BONUS, MY USERNAME IS...”。 3. 首次试用 SMM 面板可获得 $1 奖励 —— 只需在我们网站(支持页面)提交标题为 “Get Trial Bonus” 的工单。 4. 每周在我们的 Telegram 频道和用于购买 Stars 的机器人中赠送 Telegram Stars!
    • 我们的 Telegram 频道 已达到 3000 名订阅者! 感谢大家对我们项目的支持与关注! 我们即将举办一场精彩的抽奖或比赛,专为您准备! 不要错过参与的机会 — 立即订阅:https://t.me/accsforyou_shop✅ 活跃链接: 数字商品商店(网站):前往 商店 Telegram 机器人:前往 用于购买 Telegram Stars 的机器人:前往 SMM 面板:前往 – 推广您的社交媒体账户。 我们向您展示当前的 促销与特别优惠,可用于购买我们平台的产品与服务: 1. 使用优惠码 OCTOBER2025(8% 折扣)在十月期间通过我们的网站或机器人购物!首次购买还可使用优惠码 SOCNET(15% 折扣)。 2. 获得 $1 商店余额或 10–20% 折扣 —— 只需在我们网站注册后在论坛留言:“SEND ME BONUS, MY USERNAME IS...”。 3. 首次试用 SMM 面板可获得 $1 奖励 —— 只需在我们网站(支持页面)提交标题为 “Get Trial Bonus” 的工单。 4. 每周在我们的 Telegram 频道和用于购买 Stars 的机器人中赠送 Telegram Stars!
    • 3000 subscribers in our Telegram channel! Thank you all for your support and interest in our project! Very soon, we’ll be hosting an exciting giveaway or contest just for you! Don’t miss the chance to take part — subscribe here: https://t.me/accsforyou_shop✅ Active Links: Digital goods store (Website): Go Store Telegram bot: Go Telegram bot for purchasing Telegram Stars: Go SMM Panel: Go – promote your social media accounts. We would like to present you with the current list of promotions and special offers for purchasing products and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website or Bot) during October! You can also use the first-time promo code SOCNET (15% discount). 2. Get $1 credited to your store balance or a 10–20% discount — just post your username after registration on our website using the following format: "SEND ME BONUS, MY USERNAME IS..." – post it in our forum thread! 3. Get $1 for your first SMM Panel trial — just open a support ticket titled “Get Trial Bonus” on our website (Support). 4. Weekly giveaways of Telegram Stars in our Telegram channel and in our Telegram bot for Star purchases!
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock