Jump to content
  • 0

[REQUEST]Christmas Box (JAVA)


Question

Posted

Kalispera sas, tha ithela na valo ston server mou to eksis:

o gm tha mporei na pataei gia paradigma .boxreward kati tetio kai oloi oi online pektes tha pernoun as poume kati items(valte id oti thelete tha to alaksw) kai oi pektes an to patane auto tha tous dinei dwra tixea, gia paradigma: adenas i bogs i lifestones kai etsi. den kserw apo java , iparxei periptosi na me to kanei kaneis apo esas free? euxaristw.

1 answer to this question

Recommended Posts

  • 0
Posted

### Eclipse Workspace Patch 1.0
#P INTERLUDE_GAMESERVER_TEST
Index: java/net/sf/l2j/gameserver/handler/itemhandlers/boxrewarding.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/itemhandlers/boxrewarding.java	(revision 0)
+++ java/net/sf/l2j/gameserver/handler/itemhandlers/boxrewarding.java	(revision 0)
@@ -0,0 +1,65 @@
+/* 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
+ */
+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;
+import net.sf.l2j.util.Rnd;
+
+/**
+ *
+ * @author  Codex
+ */
+public class boxrewarding implements IItemHandler
+{
+
+	private static final int[] ITEM_IDS = {3481};
+	
+	/**
+	 * @see net.sf.l2j.gameserver.handler.IItemHandler#useItem(net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance, net.sf.l2j.gameserver.model.L2ItemInstance)
+	 */
+	public void useItem(L2PlayableInstance playable, L2ItemInstance item)
+	{
+		if (!(playable instanceof L2PcInstance))
+			return;
+		L2PcInstance activeChar = (L2PcInstance) playable;
+		
+		if(item == null ) return; else
+		{
+			switch(Rnd.get(1)){
+			case 0:
+				activeChar.getInventory().addItem("CASE 1", 57, 250000000, activeChar, null);
+				activeChar.sendMessage("The ~Christmas Box had adenas, you took them");
+			case 1:
+				activeChar.getInventory().addItem("CASE 1", 8762, 20, activeChar, null);
+				activeChar.sendMessage("The ~Christmas Box had life stones, you took them");
+			}
+		}	
+	}
+
+	/**
+	 * @see net.sf.l2j.gameserver.handler.IItemHandler#getItemIds()
+	 */
+	public int[] getItemIds()
+	{
+		return ITEM_IDS;
+	}
+
+}
Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/boxreward.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/boxreward.java	(revision 0)
+++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/boxreward.java	(revision 0)
@@ -0,0 +1,59 @@
+/* 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
+ */
+package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
+
+import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
+import net.sf.l2j.gameserver.model.L2World;
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ *
+ * @author  Codex
+ */
+public class boxreward implements IVoicedCommandHandler
+{
+
+	/**
+	 * @see net.sf.l2j.gameserver.handler.IVoicedCommandHandler#useVoicedCommand(java.lang.String, net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
+	 */
+	
+	public static String[] VOICED_COMMANDS = {"boxreward"};
+	
+	public boolean useVoicedCommand(String command, L2PcInstance activeChar,String target)	
+	{
+		if(command.equalsIgnoreCase("boxreward") && activeChar.isGM()){
+			for(L2PcInstance players : L2World.getInstance().getAllPlayers()){
+				if(!players.isGM()){
+				players.getInventory().addItem("CHRISTMAS", 3481, 1, players, null);
+				players.sendMessage("Admin rewarded you with a ~Christmas Box~,press it to see the reward");
+			  }
+			}
+			activeChar.sendMessage("Players rewarded successfully with the Christmas Box");
+		}
+		return true;
+	}
+
+	/**
+	 * @see net.sf.l2j.gameserver.handler.IVoicedCommandHandler#getVoicedCommandList()
+	 */
+	public String[] getVoicedCommandList()
+	{
+		return VOICED_COMMANDS;
+	}
+
+}
Index: java/net/sf/l2j/gameserver/GameServer.java
===================================================================
--- java/net/sf/l2j/gameserver/GameServer.java	(revision 5048)
+++ java/net/sf/l2j/gameserver/GameServer.java	(working copy)
@@ -152,6 +152,7 @@
import net.sf.l2j.gameserver.handler.itemhandlers.SpiritShot;
import net.sf.l2j.gameserver.handler.itemhandlers.SummonItems;
import net.sf.l2j.gameserver.handler.itemhandlers.Maps;
+import net.sf.l2j.gameserver.handler.itemhandlers.boxrewarding;
import net.sf.l2j.gameserver.handler.skillhandlers.BalanceLife;
import net.sf.l2j.gameserver.handler.skillhandlers.BeastFeed;
import net.sf.l2j.gameserver.handler.skillhandlers.Blow;
@@ -197,6 +198,7 @@
import net.sf.l2j.gameserver.handler.usercommandhandlers.PartyInfo;
import net.sf.l2j.gameserver.handler.usercommandhandlers.Time;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Wedding;
+import net.sf.l2j.gameserver.handler.voicedcommandhandlers.boxreward;
import net.sf.l2j.gameserver.handler.voicedcommandhandlers.stats;
import net.sf.l2j.gameserver.idfactory.IdFactory;
import net.sf.l2j.gameserver.instancemanager.AuctionManager;
@@ -444,6 +446,7 @@
		_log.config("AutoSpawnHandler: Loaded " + _autoSpawnHandler.size() + " handlers in total.");

		_itemHandler = ItemHandler.getInstance();
+		_itemHandler.registerItemHandler(new boxrewarding());
		_itemHandler.registerItemHandler(new ScrollOfEscape());
		_itemHandler.registerItemHandler(new ScrollOfResurrection());
		_itemHandler.registerItemHandler(new SoulShots());
@@ -589,6 +592,7 @@

		_voicedCommandHandler = VoicedCommandHandler.getInstance();
		_voicedCommandHandler.registerVoicedCommandHandler(new stats());
+		_voicedCommandHandler.registerVoicedCommandHandler(new boxreward());

		if(Config.L2JMOD_ALLOW_WEDDING)
			_voicedCommandHandler.registerVoicedCommandHandler(new Wedding());

 

το κανα πολυ γρηγορα, πρωτα διαβασε το και μετα αρχισε το edit ;)

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

    • Perfect way to experience L2 without the brutal official grind. The progression here is so much smoother and faster, you get to the fun PvP and epic raids way quicker. The custom stuff keeps it fresh too. Definitely worth diving into!
    • L2-Getwork server highly customized with high-stats https://l2server.eu/ https://discord.gg/SsVhm7R Rates: L2 High Five fully customized Getwork Style with High Stats and Enchant ExP/Sp: 75x (custom) Drop/Spoil: 1x (custom) Safe: 500 Max: 50 000   Enchant System: Normal Scrolls: 93% - fail - decrease enchant by 20 Blessed Scrolls: 96% - fail - decrease enchant by 10   Armor Max Enchant D-Grade: +1000 Max Enchant C-Grade: +2000 Max Enchant B-Grade: +3000 Max Enchant A-Grade: +4000 Max Enchant S-Grade: +5000   Weapons Max Enchant D-Grade: +5000 Max Enchant C-Grade: +10000 Max Enchant B-Grade: +15000 Max Enchant A-Grade: +20000 Max Enchant S-Grade: +25000 - 50000   Fir Tree Branch (Weapon): +100 into Weapons (max 50 000) Fir Tree Branch (Armor): +15 into Armor (max 5000) Road to Dvc Cloak Enchant: +1 into cloak (max +1000) Masks of Spirit/Demon Horns Enchants: +1 into Masks (max +10) Each accessories has different max enchant and chances Daily Missions (.missions) Collections (ALT + B) Gambling System(.gamble) - each pack cost different amount Gamble Points, different items How to get gambling points? - by killing Raid Bosses/Events or Completing Daily Missions. Clan Bonus VIP Bonuses (maximum level 10) Battlepass (maximum level 100) - by killing monsters Rebirth (starting in Parnassus) Everything in ALT+B Master's Buffs - 100 Small Glass Box (1 buff) Farm Zones: Custom Farm Zones: Ruin of Agony (Exp Zone) Underground Coliseum (Safe Exp Zone) DVC,Brigand,Frost are similiar farm zones with same monsters Dvc Brigand Stronghold Frost Lake Parnassus - TOP ZONE some of our features: .gamble,collections,battlepass,talent tree, rebirth        
    • https://www.mediafire.com/file/l905r1sd84hnovf/FileEdit.rar/file
  • 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