Jump to content

Recommended Posts

Posted

Hello!

When a player put .daggeritems, then take Dagger weapon,armor,jewls.

Commands: .daggeritems / .bowitems / .tankitems / .mageitems

 

config:
# Specified reward item rnd qty
ChampionRewardItemQty = 1
+
+#------------------------------------------------------------------
+# Class Items.
+# .daggeritems / .bowitems / .tankitems / .mageitems                
+#------------------------------------------------------------------
+ClassItemsCmd = false
+#
+FighterItemsPirce = 50000000
+#
+MageItemsPirce = 50000000
+
=====
Index: sf/l2j/config.java
       public static int L2JMOD_CHAMPION_REWARD_QTY;
+    public static boolean CLASS_ITEMS_ENABLE;
+    public static int FIGHTER_ITEMS_PRICE;
+    public static int MAGE_ITEMS_PRICE;


                  L2JMOD_CHAMPION_REWARD_QTY            = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemQty", "1"));
+                CLASS_ITEMS_ENABLE             = Boolean.parseBoolean(L2JModSettings.getProperty("ClassItemsCmd", "false"));
+                FIGHTER_ITEMS_PRICE            = Integer.parseInt(L2JModSettings.getProperty("FighterItemsPirce", "50000000"));
+                MAGE_ITEMS_PRICE            = Integer.parseInt(L2JModSettings.getProperty("MageItemsPirce", "50000000"));


=====
Index: net.sf.l2j.gameserver.handler.VoicedCommandHandler.java

import java.util.logging.Logger;

+import net.sf.l2j.gameserver.handler.voicedcommandhandlers.LevelZones;

import javolution.util.FastMap;


private VoicedCommandHandler()
{
	_datatable = new FastMap<String, IVoicedCommandHandler>();
+
+	if(Config.CLASS_ITEMS_ENABLE)
+		{
+			registerVoicedCommandHandler(new ClassItems());
+		}
}

public void registerVoicedCommandHandler(IVoicedCommandHandler handler)

 

Here you have to create a New Class with name ClassItems.java

=====
Index: net.sf.l2j.gameserver.handler.voicedcommandhandlers.ClassItems.java

/*
* 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.voicedcommandhandlers;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.serverpackets.ItemList;

public class ClassItems implements IVoicedCommandHandler
{
private static String[] _voicedCommands =
{
		"daggeritems", "bowitems", "tankitems", "mageitems"
};

/**
 * @see net.sf.l2j.gameserver.handler.IVoicedCommandHandler#useVoicedCommand(java.lang.String,
 *      net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
 */
@Override
public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
{

	if(command.equalsIgnoreCase("daggeritems"))
	{
		if(activeChar.getInventory().getInventoryItemCount(57, 0) >= Config.FIGHTER_ITEMS_PRICE)
		{
			activeChar.getInventory().reduceAdena("Adena", Config.FIGHTER_ITEMS_PRICE, activeChar, null);
			activeChar.getInventory().addItem("Angel Slayer", 6367, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("Dragonic Light", 6379, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("Dragonic Boots", 6380, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("Dragonic Gloves", 6381, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("Dragonic Helmet", 6382, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
			activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar );
			activeChar.getInventory().updateDatabase();
			activeChar.sendPacket(new ItemList(activeChar, true));
			activeChar.sendMessage("Now You Have Dagger Items On Your Invetory. Take a Look!.");
		}
		else
		{
			activeChar.sendMessage("You do not have enough Adena");
		}
		if(activeChar.isInOlympiadMode())
		{
			activeChar.sendMessage("Sorry,you are in the Olympiad now.");
			return false;
		}
		else if(activeChar.isInDuel())
		{
			activeChar.sendMessage("Sorry,you are in a duel!");
			return false;
		}
		else if(activeChar.atEvent)
		{
			activeChar.sendMessage("Sorry,you are on event now.");
			return false;
		}
		else if(!Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK && activeChar.getKarma() > 0)
		{
			activeChar.sendMessage("Sorry,PK player can't use this.");
			return false;
		}
		else if(activeChar.isDead())
		{
			activeChar.sendMessage("Sorry,Dead player can't take items.");			
                        return false;
		}
		else if(activeChar.isFakeDeath())
		{
			activeChar.sendMessage("Sorry,on fake death mode can't use this.");
			return false;
		}
	}
	if(command.equalsIgnoreCase("bowitems"))
	{
		if(activeChar.getInventory().getInventoryItemCount(57, 0) >= Config.FIGHTER_ITEMS_PRICE)
		{
			activeChar.getInventory().reduceAdena("Adena", Config.FIGHTER_ITEMS_PRICE, activeChar, null);
			activeChar.getInventory().addItem("Draconic Bow", 7577, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("Draconic Light", 6379, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("Draconic Boots", 6380, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("Draconic Gloves", 6381, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("Draconic Helmet", 6382, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
			activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar );
			activeChar.getInventory().updateDatabase();
			activeChar.sendPacket(new ItemList(activeChar, true));
			activeChar.sendMessage("Now You Have Bow Items On Your Invetory. Take a Look!.");
		}
		else
		{
			activeChar.sendMessage("You do not have enough Adena");
		}
		if(activeChar.isInOlympiadMode())
		{
			activeChar.sendMessage("Sorry,you are in the Olympiad now.");
			return false;
		}
		else if(activeChar.isInDuel())
		{
			activeChar.sendMessage("Sorry,you are in a duel!");
			return false;
		}
		else if(activeChar.atEvent)
		{
			activeChar.sendMessage("Sorry,you are on event now.");
			return false;
		}
		else if(!Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK && activeChar.getKarma() > 0)
		{
			activeChar.sendMessage("Sorry,PK player can't use this.");
			return false;
		}
		else if(activeChar.isDead())
		{
			activeChar.sendMessage("Sorry,Dead player can't take items.");			
                        return false;
		}
		else if(activeChar.isFakeDeath())
		{
			activeChar.sendMessage("Sorry,on fake death mode can't use this.");
			return false;
		}
	}
	if(command.equalsIgnoreCase("tankitems"))
	{
		if(activeChar.getInventory().getInventoryItemCount(57, 0) >= Config.FIGHTER_ITEMS_PRICE)
		{
			activeChar.getInventory().reduceAdena("Adena", Config.FIGHTER_ITEMS_PRICE, activeChar, null);
			activeChar.getInventory().addItem("Forgotten Blade", 6582, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("Imperial Armor", 6373, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("Imperial ArmorP2", 6374, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("Imperial Gloves", 6375, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("Imperial Boots", 6376, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("Imperial Helmet", 6378, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
			activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar );
			activeChar.getInventory().updateDatabase();
			activeChar.sendPacket(new ItemList(activeChar, true));
			activeChar.sendMessage("Now You Have Tank Items On Your Invetory. Take a Look!.");
		}
		else
		{
			activeChar.sendMessage("You do not have enough Adena");
		}
		if(activeChar.isInOlympiadMode())
		{
			activeChar.sendMessage("Sorry,you are in the Olympiad now.");
			return false;
		}
		else if(activeChar.isInDuel())
		{
			activeChar.sendMessage("Sorry,you are in a duel!");
			return false;
		}
		else if(activeChar.atEvent)
		{
			activeChar.sendMessage("Sorry,you are on event now.");
			return false;
		}
		else if(!Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK && activeChar.getKarma() > 0)
		{
			activeChar.sendMessage("Sorry,PK player can't use this.");
			return false;
		}
		else if(activeChar.isDead())
		{
			activeChar.sendMessage("Sorry,Dead player can't take items.");			
                        return false;
		}
		else if(activeChar.isFakeDeath())
		{
			activeChar.sendMessage("Sorry,on fake death mode can't use this.");
			return false;
		}
	}
	else if(command.equalsIgnoreCase("mageitems"))
	{
		if(activeChar.getInventory().getInventoryItemCount(57, 0) >= Config.MAGE_ITEMS_PRICE)
		{
			activeChar.getInventory().destroyItemByItemId("Adena", 57, Config.MAGE_ITEMS_PRICE, activeChar, null);
			activeChar.getInventory().addItem("Arcana Mace Acumen", 6608, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("DC Robe", 2407, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("DC Gloves", 5767, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("DC Boots", 5779, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("DC Helmet", 512, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
			activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar );
			activeChar.getInventory().updateDatabase();
			activeChar.sendPacket(new ItemList(activeChar, true));
			activeChar.sendMessage("Now You Have Mage Items On Your Invetory. Take a Look!");
		}
		else
		{
			activeChar.sendMessage("You do not have enough Adena");
		}
		if(activeChar.isInOlympiadMode())
		{
			activeChar.sendMessage("Sorry,you are in the Olympiad now.");
			return false;
		}
		else if(activeChar.isInDuel())
		{
			activeChar.sendMessage("Sorry,you are in a duel!");
			return false;
		}
		else if(activeChar.atEvent)
		{
			activeChar.sendMessage("Sorry,you are on event now.");
			return false;
		}
		else if(!Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK && activeChar.getKarma() > 0)
		{
			activeChar.sendMessage("Sorry,PK player can't use this.");
			return false;
		}
		else if(activeChar.isDead())
		{
			activeChar.sendMessage("Sorry,Dead player can't take items.");			
                        return false;
		}
		else if(activeChar.isFakeDeath())
		{
			activeChar.sendMessage("Sorry,on fake death mode can't use this.");
			return false;
		}
	}
	return true;
}

/**
 * @see net.sf.l2j.gameserver.handler.IVoicedCommandHandler#getVoicedCommandList()
 */
@Override
public String[] getVoicedCommandList()
{
	return _voicedCommands;
}
}

  • 2 weeks later...
Posted

Use some arrays and for loops , instead of this way. It will be better and cleaner.

Thank you for sharing

For loops? At which part?
Posted

You must be kidding.

Why? You create a list and then you use loops.

In this way if you have to modify and add another item you will only have to write ", 14720" in the list, for example.

Posted

Maybe you must be kidding. Did you understand what I tell him to do?

I am really bored to explain to you. But anyway, I have to kill my time somehow.

 

You tell him to use for loops. You propably don't know what for loops do or you had in mind to tell something different and you got confused.

 

In this code, you cannot use for loops. Because you don't need to repeat any kind of action inside the code. That's why I asked you in which part of the code, you think that a for loop will fit?

Posted

I am really bored to explain to you. But anyway, I have to kill my time somehow.

 

You tell him to use for loops. You propably don't know what for loops do or you had in mind to tell something different and you got confused.

 

In this code, you cannot use for loops. Because you don't need to repeat any kind of action inside the code. That's why I asked you in which part of the code, you think that a for loop will fit?

Hey computer programmer,

private int[][] bow_items = { {x,y } }  //x id , y count

for(int[] it : bow_items)
{
int id = it[0];
int count = it[1];
player.addItem(........);
}

 

Are you serious?

Posted

Hey computer programmer,

private int[][] bow_items = { {x,y } }  //x id , y count

for(int[] it : bow_items)
{
int id = it[0];
int count = it[1];
player.addItem(........);
}

 

Are you serious?

You still don't understand, do you?
Posted

You still don't understand, do you?

Explain then , I explained you about for loops. Don't be afraid , I won't leach your super codes.

Posted

Explain then , I explained you about for loops. Don't be afraid , I won't leach your super codes.

I explained to you some lines above.

 

That's why, I don't want people like you, to sell 'java' servicies.

 

I end this conversation here, because you are propably too immature to communicate.

 

Please, consider have a look here:

http://docs.oracle.com/javase/tutorial/java/nutsandbolts/for.html

 

I hope it helps you.

 

OnTopic: Keep sharing, Baggos.

Posted

Hello!

When a player put .daggeritems, then take Dagger weapon,armor,jewls.

Commands: .daggeritems / .bowitems / .tankitems / .mageitems

 

config:
# Specified reward item rnd qty
ChampionRewardItemQty = 1
+
+#------------------------------------------------------------------
+# Class Items.
+# .daggeritems / .bowitems / .tankitems / .mageitems                
+#------------------------------------------------------------------
+ClassItemsCmd = false
+#
+FighterItemsPirce = 50000000
+#
+MageItemsPirce = 50000000
+
=====
Index: sf/l2j/config.java
       public static int L2JMOD_CHAMPION_REWARD_QTY;
+    public static boolean CLASS_ITEMS_ENABLE;
+    public static int FIGHTER_ITEMS_PRICE;
+    public static int MAGE_ITEMS_PRICE;


                  L2JMOD_CHAMPION_REWARD_QTY            = Integer.parseInt(L2JModSettings.getProperty("ChampionRewardItemQty", "1"));
+                CLASS_ITEMS_ENABLE             = Boolean.parseBoolean(L2JModSettings.getProperty("ClassItemsCmd", "false"));
+                FIGHTER_ITEMS_PRICE            = Integer.parseInt(L2JModSettings.getProperty("FighterItemsPirce", "50000000"));
+                MAGE_ITEMS_PRICE            = Integer.parseInt(L2JModSettings.getProperty("MageItemsPirce", "50000000"));


=====
Index: net.sf.l2j.gameserver.handler.VoicedCommandHandler.java

import java.util.logging.Logger;

+import net.sf.l2j.gameserver.handler.voicedcommandhandlers.LevelZones;

import javolution.util.FastMap;


private VoicedCommandHandler()
{
	_datatable = new FastMap<String, IVoicedCommandHandler>();
+
+	if(Config.CLASS_ITEMS_ENABLE)
+		{
+			registerVoicedCommandHandler(new ClassItems());
+		}
}

public void registerVoicedCommandHandler(IVoicedCommandHandler handler)

 

Here you have to create a New Class with name ClassItems.java

=====
Index: net.sf.l2j.gameserver.handler.voicedcommandhandlers.ClassItems.java

/*
* 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.voicedcommandhandlers;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.serverpackets.ItemList;

public class ClassItems implements IVoicedCommandHandler
{
private static String[] _voicedCommands =
{
		"daggeritems", "bowitems", "tankitems", "mageitems"
};

/**
 * @see net.sf.l2j.gameserver.handler.IVoicedCommandHandler#useVoicedCommand(java.lang.String,
 *      net.sf.l2j.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
 */
@Override
public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
{

	if(command.equalsIgnoreCase("daggeritems"))
	{
		if(activeChar.getInventory().getInventoryItemCount(57, 0) >= Config.FIGHTER_ITEMS_PRICE)
		{
			activeChar.getInventory().reduceAdena("Adena", Config.FIGHTER_ITEMS_PRICE, activeChar, null);
			activeChar.getInventory().addItem("Angel Slayer", 6367, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("Dragonic Light", 6379, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("Dragonic Boots", 6380, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("Dragonic Gloves", 6381, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("Dragonic Helmet", 6382, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
			activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar );
			activeChar.getInventory().updateDatabase();
			activeChar.sendPacket(new ItemList(activeChar, true));
			activeChar.sendMessage("Now You Have Dagger Items On Your Invetory. Take a Look!.");
		}
		else
		{
			activeChar.sendMessage("You do not have enough Adena");
		}
		if(activeChar.isInOlympiadMode())
		{
			activeChar.sendMessage("Sorry,you are in the Olympiad now.");
			return false;
		}
		else if(activeChar.isInDuel())
		{
			activeChar.sendMessage("Sorry,you are in a duel!");
			return false;
		}
		else if(activeChar.atEvent)
		{
			activeChar.sendMessage("Sorry,you are on event now.");
			return false;
		}
		else if(!Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK && activeChar.getKarma() > 0)
		{
			activeChar.sendMessage("Sorry,PK player can't use this.");
			return false;
		}
		else if(activeChar.isDead())
		{
			activeChar.sendMessage("Sorry,Dead player can't take items.");			
                        return false;
		}
		else if(activeChar.isFakeDeath())
		{
			activeChar.sendMessage("Sorry,on fake death mode can't use this.");
			return false;
		}
	}
	if(command.equalsIgnoreCase("bowitems"))
	{
		if(activeChar.getInventory().getInventoryItemCount(57, 0) >= Config.FIGHTER_ITEMS_PRICE)
		{
			activeChar.getInventory().reduceAdena("Adena", Config.FIGHTER_ITEMS_PRICE, activeChar, null);
			activeChar.getInventory().addItem("Draconic Bow", 7577, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("Draconic Light", 6379, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("Draconic Boots", 6380, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("Draconic Gloves", 6381, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("Draconic Helmet", 6382, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
			activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar );
			activeChar.getInventory().updateDatabase();
			activeChar.sendPacket(new ItemList(activeChar, true));
			activeChar.sendMessage("Now You Have Bow Items On Your Invetory. Take a Look!.");
		}
		else
		{
			activeChar.sendMessage("You do not have enough Adena");
		}
		if(activeChar.isInOlympiadMode())
		{
			activeChar.sendMessage("Sorry,you are in the Olympiad now.");
			return false;
		}
		else if(activeChar.isInDuel())
		{
			activeChar.sendMessage("Sorry,you are in a duel!");
			return false;
		}
		else if(activeChar.atEvent)
		{
			activeChar.sendMessage("Sorry,you are on event now.");
			return false;
		}
		else if(!Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK && activeChar.getKarma() > 0)
		{
			activeChar.sendMessage("Sorry,PK player can't use this.");
			return false;
		}
		else if(activeChar.isDead())
		{
			activeChar.sendMessage("Sorry,Dead player can't take items.");			
                        return false;
		}
		else if(activeChar.isFakeDeath())
		{
			activeChar.sendMessage("Sorry,on fake death mode can't use this.");
			return false;
		}
	}
	if(command.equalsIgnoreCase("tankitems"))
	{
		if(activeChar.getInventory().getInventoryItemCount(57, 0) >= Config.FIGHTER_ITEMS_PRICE)
		{
			activeChar.getInventory().reduceAdena("Adena", Config.FIGHTER_ITEMS_PRICE, activeChar, null);
			activeChar.getInventory().addItem("Forgotten Blade", 6582, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("Imperial Armor", 6373, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("Imperial ArmorP2", 6374, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("Imperial Gloves", 6375, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("Imperial Boots", 6376, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("Imperial Helmet", 6378, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
			activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar );
			activeChar.getInventory().updateDatabase();
			activeChar.sendPacket(new ItemList(activeChar, true));
			activeChar.sendMessage("Now You Have Tank Items On Your Invetory. Take a Look!.");
		}
		else
		{
			activeChar.sendMessage("You do not have enough Adena");
		}
		if(activeChar.isInOlympiadMode())
		{
			activeChar.sendMessage("Sorry,you are in the Olympiad now.");
			return false;
		}
		else if(activeChar.isInDuel())
		{
			activeChar.sendMessage("Sorry,you are in a duel!");
			return false;
		}
		else if(activeChar.atEvent)
		{
			activeChar.sendMessage("Sorry,you are on event now.");
			return false;
		}
		else if(!Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK && activeChar.getKarma() > 0)
		{
			activeChar.sendMessage("Sorry,PK player can't use this.");
			return false;
		}
		else if(activeChar.isDead())
		{
			activeChar.sendMessage("Sorry,Dead player can't take items.");			
                        return false;
		}
		else if(activeChar.isFakeDeath())
		{
			activeChar.sendMessage("Sorry,on fake death mode can't use this.");
			return false;
		}
	}
	else if(command.equalsIgnoreCase("mageitems"))
	{
		if(activeChar.getInventory().getInventoryItemCount(57, 0) >= Config.MAGE_ITEMS_PRICE)
		{
			activeChar.getInventory().destroyItemByItemId("Adena", 57, Config.MAGE_ITEMS_PRICE, activeChar, null);
			activeChar.getInventory().addItem("Arcana Mace Acumen", 6608, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("DC Robe", 2407, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("DC Gloves", 5767, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("DC Boots", 5779, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("DC Helmet", 512, 1, activeChar, activeChar);
			activeChar.getInventory().addItem("TEO Necklace", 920, 1, activeChar, activeChar );
			activeChar.getInventory().addItem("TEO Earring", 858, 2, activeChar, activeChar);
			activeChar.getInventory().addItem("TEO Ring", 889, 2, activeChar, activeChar );
			activeChar.getInventory().updateDatabase();
			activeChar.sendPacket(new ItemList(activeChar, true));
			activeChar.sendMessage("Now You Have Mage Items On Your Invetory. Take a Look!");
		}
		else
		{
			activeChar.sendMessage("You do not have enough Adena");
		}
		if(activeChar.isInOlympiadMode())
		{
			activeChar.sendMessage("Sorry,you are in the Olympiad now.");
			return false;
		}
		else if(activeChar.isInDuel())
		{
			activeChar.sendMessage("Sorry,you are in a duel!");
			return false;
		}
		else if(activeChar.atEvent)
		{
			activeChar.sendMessage("Sorry,you are on event now.");
			return false;
		}
		else if(!Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK && activeChar.getKarma() > 0)
		{
			activeChar.sendMessage("Sorry,PK player can't use this.");
			return false;
		}
		else if(activeChar.isDead())
		{
			activeChar.sendMessage("Sorry,Dead player can't take items.");			
                        return false;
		}
		else if(activeChar.isFakeDeath())
		{
			activeChar.sendMessage("Sorry,on fake death mode can't use this.");
			return false;
		}
	}
	return true;
}

/**
 * @see net.sf.l2j.gameserver.handler.IVoicedCommandHandler#getVoicedCommandList()
 */
@Override
public String[] getVoicedCommandList()
{
	return _voicedCommands;
}
}

Better add all of these commands in one html (.items) or  made an instance! I think will be more attractive for admins of pvp servers! :D

 

P.S: It's just an ideea! ;)

 

Guest
This topic is now closed to further replies.


  • Posts

    • 10-17-2025 - OUR TOPIC IS RELEVANT! CONTACT US BY THE CONTACTS BELOW
    • Tell a Škoda 1.4 driver that a Škoda 1.8 is faster — and suddenly, you’re riding a mini race car. On the way, they might share random stories — gas prices, the perfect BBQ recipe, or how passengers once called them “just for a minute.” Maybe even how someone left a suitcase full of money in their car once.     The important part? You’ll get there on time, no delays.     Vibe SMS works just as fast — messages fly like that driver who just heard their 1.8 isn’t the fastest.     🌐 https://vibe-sms.net/ 📲 https://t.me/vibe_sms  
    • ⚔️ The Grand Opening Has Arrived! ⚔️ In just a few hours the gate to the eternal battlefield will be open and the war between Order and Chaos will be set once again ! Its time to claim your destiny 🔥 👉 Register now and join the fight today! 🌐 https://l2ovc.com register now : https://l2ovc.com The gates are open the war between Order and Chaos has officially started! 🔥 Join the battlefield NOW and claim your destiny in Order vs Chaos! 💥 Don’t fall behind your faction needs you. ➡️ https://l2ovc.com  
    • Don’t miss the new Telegram gifts with our Telegram Stars purchasing bot! A great opportunity to invest in a stable digital asset at an early stage while the market is still forming. Buy other existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium subscriptions, and react to messages in channels! Low prices, multiple payment options, and other cool unique features! ⚡ Try it today — SOCNET STARS BOT ⚡ Active links to SOCNET stores: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store via Telegram messenger. ⭐ Telegram Stars Purchase Bot: Go – fast and profitable way to buy stars in Telegram. SMM Panel: Go – promote your social media accounts. We present to you the current list of promotions and special offers for purchasing our products and services: 1️⃣ Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in October! You can also use the promo code SOCNET (15% discount) for your first purchase. 2️⃣ Get $1 on your store balance or a 10–20% discount — just write your username after registration on our website using the template: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3️⃣ Get $1 for your first SMM Panel trial — simply open a ticket titled “Get Trial Bonus” on our website (Support). 4️⃣ Weekly ⭐ Telegram Stars giveaways in our Telegram channel and in our Telegram Stars bot! 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