Jump to content

Recommended Posts

Posted

Hello, today I created my first java code with help by Fanky.

 

It's an item, when you click it you obtain 255 recommends.

 

The 6673 is the id, if you want change it.

 

### Eclipse Workspace Patch 1.0
#P L2_GameServer_It
Index: java/net/sf/l2j/gameserver/GameServer.java
===================================================================
--- java/net/sf/l2j/gameserver/GameServer.java	(revision 5468)
+++ java/net/sf/l2j/gameserver/GameServer.java	(working copy)
@@ -147,6 +147,7 @@
import net.sf.l2j.gameserver.handler.itemhandlers.Recipes;
import net.sf.l2j.gameserver.handler.itemhandlers.Remedy;
import net.sf.l2j.gameserver.handler.itemhandlers.RollingDice;
+import net.sf.l2j.gameserver.handler.itemhandlers.RecItem;
import net.sf.l2j.gameserver.handler.itemhandlers.ScrollOfEscape;
import net.sf.l2j.gameserver.handler.itemhandlers.ScrollOfResurrection;
import net.sf.l2j.gameserver.handler.itemhandlers.Scrolls;
@@ -460,6 +461,7 @@
		_itemHandler.registerItemHandler(new Potions());
		_itemHandler.registerItemHandler(new Recipes());
         _itemHandler.registerItemHandler(new RollingDice());
+        _itemHandler.registerItemHandler(new RecItem());
         _itemHandler.registerItemHandler(new MysteryPotion());
		_itemHandler.registerItemHandler(new EnchantScrolls());
         _itemHandler.registerItemHandler(new EnergyStone());
Index: java/net/sf/l2j/gameserver/handler/itemhandlers/RecItem.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/itemhandlers/RecItem.java	(revision 0)
+++ java/net/sf/l2j/gameserver/handler/itemhandlers/RecItem.java	(revision 0)
@@ -0,0 +1,51 @@
+/*
+ * 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
+ */
+package net.sf.l2j.gameserver.handler.itemhandlers;
+
+import net.sf.l2j.gameserver.handler.IItemHandler;
+import net.sf.l2j.gameserver.model.L2ItemInstance;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance;
+
+/**
+ * @author Crystalia
+ *
+ */
+public class RecItem implements IItemHandler
+{
+
+	private static final int ITEM_IDS[] = {
+        6673
+    };
+
+	public int[] getItemIds()
+    {
+        return ITEM_IDS;
+    }
+
+	public void useItem(L2PlayableInstance playable, L2ItemInstance item)
+	{
+		if(!(playable instanceof L2PcInstance))
+            return;
+        L2PcInstance activeChar = (L2PcInstance)playable;
+        {
+        	playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
+        	activeChar.setRecomHave(255);
+        	activeChar.sendMessage("Thanks for using our item in order to increase your current recommendations.");
+           activeChar.broadcastUserInfo();
+        }
+		
+	}
+	
+}

 

It's coded on clean l2j , because you can change it for any project that you want.

 

Have Fun!

 


 

PS; Correct me , if there is something wrong.

 


Posted

Oh , Crystalia , your first code . What to say , congratulations . All works good , i didn't checked but I read the code . Good luck and I wanna see other codes made by you . :D

Posted

Oh , Crystalia , your first code . What to say , congratulations . All works good , i didn't checked but I read the code . Good luck and I wanna see other codes made by you . :D

 

Thanks, I love this language.

 

I want to learn more, and more. Thanks again!

Posted

If i can help you with something or if wanna work as teammates just tell me , will be great .

Please, don't stay out of topic.

 

We can discuss via pm, or something else.

 

Today, new share is coming!

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

    • Upgrade your Telegram Gifts to NFT level with SOCNET! Buy Telegram Stars quickly, conveniently, and at the best prices — maybe you’ll be lucky enough to get a rare black-background model! Active SOCNET Store Links: Digital goods store (Website): Go Store Telegram bot: Go – convenient access to the store through the Telegram messenger. Telegram bot for purchasing Telegram Stars: Go – fast and profitable way to buy Telegram Stars. 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 September! 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 in the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — simply 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! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Upgrade your Telegram Gifts to NFT level with SOCNET! Buy Telegram Stars quickly, conveniently, and at the best prices — maybe you’ll be lucky enough to get a rare black-background model! Active SOCNET Store Links: Digital goods store (Website): Go Store Telegram bot: Go – convenient access to the store through the Telegram messenger. Telegram bot for purchasing Telegram Stars: Go – fast and profitable way to buy Telegram Stars. 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 September! 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 in the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — simply 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! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Upgrade your Telegram Gifts to NFT level with SOCNET! Buy Telegram Stars quickly, conveniently, and at the best prices — maybe you’ll be lucky enough to get a rare black-background model! Active SOCNET Store Links: Digital goods store (Website): Go Store Telegram bot: Go – convenient access to the store through the Telegram messenger. Telegram bot for purchasing Telegram Stars: Go – fast and profitable way to buy Telegram Stars. 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 September! 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 in the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — simply 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! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • 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