Jump to content

[Share] .res voice command - Takes one goldbar and resses you


Recommended Posts

Posted

Go to package net.sf.l2j.gameserver.handler.voicedcommandhandlers and create new file called Res.java

 

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

 

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

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

 

 

/**

*

*

*/

public class Res implements IVoicedCommandHandler

{

    private static final String[] VOICED_COMMANDS = { "res" };

 

    public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)

    {   

        if (command.equalsIgnoreCase("res"))

        {

        if (!activeChar.isAlikeDead())

        {

        activeChar.sendMessage("You cannot be ressurected while alive.");

        return false;

        }

        if(activeChar.isInOlympiadMode())

        {

        activeChar.sendMessage("You cannot use this feature during olympiad.");

    return false;

        }

        if(activeChar.getInventory().getItemByItemId(3470) == null)

        {

        activeChar.sendMessage("You need 1 or more Gold Bars to use the ressurection system.");

    return false;

        }

       

       

       

        activeChar.sendMessage("You have been ressurected!");

activeChar.getInventory().destroyItemByItemId("RessSystem", 3470, 1, activeChar, activeChar.getTarget());

        activeChar.doRevive();

        activeChar.broadcastUserInfo();

        activeChar.sendMessage("One GoldBar has dissapeared! Thank you!");

        }

    return true;

    }

    public String[] getVoicedCommandList()

    {

        return VOICED_COMMANDS;

    }

 

}

 

   

 

Go to GameServer.java and add

 

import net.sf.l2j.gameserver.handler.voicedcommandhandlers.stats;

import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Stat;

import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Res;

_voicedCommandHandler.registerVoicedCommandHandler(new Res());

_log.config("VoicedCommandHandler: Loaded .res VoiceCommand handler.");

 

One again thanx to TheOneGandalf for ideas..

Posted

Once again thnx m8 ;)

You have done great Work ! ! ! :P

GRatz

 

they done great work :D where is they work? lawl dont forgot to add credis!

 

hmm maby this is they work! ok is little code! dont tell me 1k lines is your codes ;)

 

Posted

So if i change the id in this line:

 

if(activeChar.getInventory().getItemByItemId(3470) == null)

 

for the id of the item i want i will res him whit any item?

 

 

Btw good job

Posted

they done great work :D where is they work? lawl dont forgot to add credis!

 

hmm maby this is they work! ok is little code! dont tell me 1k lines is your codes ;)

 

 

It is all MY work...Should I give credits to myself? rofl :D

So if i change the id in this line:

 

if(activeChar.getInventory().getItemByItemId(3470) == null)

 

for the id of the item i want i will res him whit any item?

 

 

Btw good job

 

No...That is a check. That code is to see if the player has any gold bars, if he does, it continues to deleting one of them and ress the player, if not, it returns false and sends a message.

 

If you wanna change the item needed for ress change it here

 

           if(activeChar.getInventory().getItemByItemId(3470) == null)

           {

              activeChar.sendMessage("You need 1 or more Gold Bars to use the ressurection system.");

             return false;

           }

 

 

and here

 

 

            activeChar.getInventory().destroyItemByItemId("RessSystem", 3470, 1, activeChar, activeChar.getTarget());

              activeChar.doRevive();

              activeChar.broadcastUserInfo();

              activeChar.sendMessage("One GoldBar has dissapeared! Thank you!");

 

======================

            activeChar.getInventory().destroyItemByItemId("RessSystem", 3470, 1, activeChar, activeChar.getTarget());

 

Red - Item ID

Yellow - Count

 

 

 

==================================================================================

 

 

If you wanna delete the item restriction just delete the blue lines

 

          if(activeChar.getInventory().getItemByItemId(3470) == null)

          {

              activeChar.sendMessage("You need 1 or more Gold Bars to use the ressurection system.");

            return false;

          }

         

         

         

              activeChar.sendMessage("You have been ressurected!");

            activeChar.getInventory().destroyItemByItemId("RessSystem", 3470, 1, activeChar, activeChar.getTarget());

              activeChar.doRevive();

              activeChar.broadcastUserInfo();

              activeChar.sendMessage("One GoldBar has dissapeared! Thank you!");

        }

 

Posted

is good idea! in pvp servers :)

 

so u wanna tell me that server i developed wasnt developed by me and was developed by you ? cool .. so this code was made by me and not by vago? be serious .. be serious..

Posted

so u wanna tell me that server i developed wasnt developed by me and was developed by you ? cool .. so this code was made by me and not by vago? be serious .. be serious..

 

What I got from here is that your last server had .res command...Fine...That was made by you or whoever else. This command is mine to be clear from now on. There probablly are similar versions of my code over net, maybe made by mafia, by maxtor or by whoever else...just stop spamming for credits...I made it END OF STORY! (mafia dont take it like Im saying this to you, I just continued what you said xD)

Posted

Awesome job and thanks for explaining the way to change the Gold Bar for something else i really appreciate your overall job at development sections.

 

+1 karma

  • 2 weeks later...
Posted

u wrote that i should  write this

_voicedCommandHandler.registerVoicedCommandHandler(new Res()); 

after this

_log.config("VoicedCommandHandler: Loaded .res VoiceCommand handler."); 

but i can't find _log.config and dont know where to put that, maybe u can write line o smt like that? using 2ljfree

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