U3Games
Lineage II | Desarrollo & Soporte => Implementaciones => Desarrollo de Servidores => Comandos => Mensaje iniciado por: Swarlog en Ago 05, 2022, 01:21 AM
CitarConfig.java
public static int STARTING_ADENA;
public static int STARTING_AA;
//Class Itmes On new Players\\
+ public static boolean CLASS_ITEMS_ENABLE;
+ public static int FIGHTER_ITEMS_PRICE;
+ public static int MAGE_ITEMS_PRICE;
STARTING_ADENA = Integer.parseInt(otherSettings.getProperty("StartingAdena", "100"));
STARTING_AA = Integer.parseInt(otherSettings.getProperty("StartingAncientAdena", "0"));
+ CLASS_ITEMS_ENABLE = Boolean.parseBoolean(otherSettings.getProperty("ClassItemsCmd", "false"));
+ FIGHTER_ITEMS_PRICE = Integer.parseInt(otherSettings.getProperty("FighterItemsPirce", "50000000"));
+ MAGE_ITEMS_PRICE = Integer.parseInt(otherSettings.getProperty("MageItemsPirce", "50000000"));
Citarproperties
#Amount of adena/AA that a new character is given
StartingAdena = 0
StartingAncientAdena = 0
+
+#------------------------------------------------------------------
+# Class Items.
+# .daggeritems / .bowitems / .tankitems / .mageitems
+#------------------------------------------------------------------
+ClassItemsCmd = false
+#
+FighterItemsPirce = 50000000
+#
+MageItemsPirce = 50000000
+
CitarVoicedCommandHandler.java
import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.Wedding;
+import com.l2jfrozen.gameserver.handler.voicedcommandhandlers.ClassItem;
private VoicedCommandHandler()
{
_datatable = new FastMap<>();
+
+ if(Config.CLASS_ITEMS_ENABLE)
+ {
+ registerVoicedCommandHandler(new ClassItems());
+ }
CitarClassItem.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 com.l2jfrozen.gameserver.handler.voicedcommandhandlers;
import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.network.serverpackets.ItemList;
public class ClassItems implements IVoicedCommandHandler
{
private static String[] _voicedCommands =
{
"daggeritems", "bowitems", "tankitems", "mageitems"
};
/**
* @see com.l2jfrozen.gameserver.handler.IVoicedCommandHandler(java.lang.String,
* com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
*/
@Override
public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
{
if(activeChar.getInventory().getInventoryItemCount(57, 0) >= Config.FIGHTER_ITEMS_PRICE)
{
activeChar.sendMessage("You do not have enough Adena");
return false;
}
if(activeChar.isInOlympiadMode())
{
activeChar.sendMessage("Sorry,you are in the Olympiad now.");
return false;
}
if(activeChar.isInDuel())
{
activeChar.sendMessage("Sorry,you are in a duel!");
return false;
}
if(activeChar.atEvent)
{
activeChar.sendMessage("Sorry,you are on event now.");
return false;
}
if(!Config.ALT_GAME_KARMA_PLAYER_CAN_USE_GK && activeChar.getKarma() > 0)
{
activeChar.sendMessage("Sorry,PK player can't use this.");
return false;
}
if(activeChar.isDead())
{
activeChar.sendMessage("Sorry,Dead player can't take items.");
return false;
}
if(activeChar.isFakeDeath())
{
activeChar.sendMessage("Sorry,on fake death mode can't use this.");
return false;
}
if(command.equalsIgnoreCase("daggeritems"))
{
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.sendMessage("Now You Have Dagger Items On Your Invetory. Take a Look!.");
}
else if (command.equalsIgnoreCase("bowitems"))
{
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.sendMessage("Now You Have Bow Items On Your Invetory. Take a Look!.");
}
else if (command.equalsIgnoreCase("tankitems"))
{
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.sendMessage("Now You Have Tank Items On Your Invetory. Take a Look!.");
}
else if (command.equalsIgnoreCase("mageitems"))
{
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.sendMessage("Now You Have Mage Items On Your Invetory. Take a Look!");
}
return true;
}
/**
* @see com.l2jfrozen.gameserver.handler.IVoicedCommandHandler#getVoicedCommandList()
*/
@Override
public String[] getVoicedCommandList()
{
return _voicedCommands;
}
}