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.


×
×
  • Create New...