Jump to content
  • 0

[help]oi gms na mporoune na kanoune enchant item mono ston eauto tous


xrulezz

Question

kaluspera! 8elw na kanw tous gms m ston srv na kanoune enchant items apo admin panel alla mono ta items p exoune ston gm tous.. (ston eauto s) kai amma kanoun allo char target na e3akolou8i na kanei enchant ton eauto tou o gm p kanei ++! pws 8a mporousa na to fixarw?

boh8iste me .. euxaristo

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

sto ekana alliws egw, eam to target pou exei den einai gm kai einai aplos char trwei akuro

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

import java.util.logging.Logger;

import com.l2jserver.Config;
import com.l2jserver.gameserver.handler.IAdminCommandHandler;
import com.l2jserver.gameserver.model.L2Object;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.itemcontainer.Inventory;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.CharInfo;
import com.l2jserver.gameserver.network.serverpackets.ExBrExtraUserInfo;
import com.l2jserver.gameserver.network.serverpackets.InventoryUpdate;
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
import com.l2jserver.gameserver.network.serverpackets.UserInfo;


/**
* This class handles following admin commands:
* - enchant_armor
*
* @version $Revision: 1.3.2.1.2.10 $ $Date: 2005/08/24 21:06:06 $
*/
public class AdminEnchant implements IAdminCommandHandler
{
private static Logger _log = Logger.getLogger(AdminEnchant.class.getName());

private static final String[] ADMIN_COMMANDS =
{
	"admin_seteh",//6
	"admin_setec",//10
	"admin_seteg",//9
	"admin_setel",//11
	"admin_seteb",//12
	"admin_setew",//7
	"admin_setes",//8
	"admin_setle",//1
	"admin_setre",//2
	"admin_setlf",//4
	"admin_setrf",//5
	"admin_seten",//3
	"admin_setun",//0
	"admin_setba",//13
	"admin_setbe",
	"admin_enchant"
};

@Override
public boolean useAdminCommand(String command, L2PcInstance activeChar)
{
	if (command.equals("admin_enchant"))
	{
		showMainPage(activeChar);
	}
	else
	{
		int armorType = -1;

		if (command.startsWith("admin_seteh"))
			armorType = Inventory.PAPERDOLL_HEAD;
		else if (command.startsWith("admin_setec"))
			armorType = Inventory.PAPERDOLL_CHEST;
		else if (command.startsWith("admin_seteg"))
			armorType = Inventory.PAPERDOLL_GLOVES;
		else if (command.startsWith("admin_seteb"))
			armorType = Inventory.PAPERDOLL_FEET;
		else if (command.startsWith("admin_setel"))
			armorType = Inventory.PAPERDOLL_LEGS;
		else if (command.startsWith("admin_setew"))
			armorType = Inventory.PAPERDOLL_RHAND;
		else if (command.startsWith("admin_setes"))
			armorType = Inventory.PAPERDOLL_LHAND;
		else if (command.startsWith("admin_setle"))
			armorType = Inventory.PAPERDOLL_LEAR;
		else if (command.startsWith("admin_setre"))
			armorType = Inventory.PAPERDOLL_REAR;
		else if (command.startsWith("admin_setlf"))
			armorType = Inventory.PAPERDOLL_LFINGER;
		else if (command.startsWith("admin_setrf"))
			armorType = Inventory.PAPERDOLL_RFINGER;
		else if (command.startsWith("admin_seten"))
			armorType = Inventory.PAPERDOLL_NECK;
		else if (command.startsWith("admin_setun"))
			armorType = Inventory.PAPERDOLL_UNDER;
		else if (command.startsWith("admin_setba"))
			armorType = Inventory.PAPERDOLL_CLOAK;
		else if (command.startsWith("admin_setbe"))
			armorType = Inventory.PAPERDOLL_BELT;

		if (armorType != -1)
		{
			try
			{
				int ench = Integer.parseInt(command.substring(12));
				L2Object target = activeChar.getTarget();
				if (target == null)
					target = activeChar;
				L2PcInstance player = null;
				if (target instanceof L2PcInstance)
				{
					player = (L2PcInstance) target;
				}
				else
				{
					activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET);
					return false;
				}
				if (!player.isGM())
				{
					activeChar.sendMessage("You cannot enchant items to non GM players.");
					activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT));
					return false;
				}
				// check value
				if (ench < 0 || ench > 65535)
					activeChar.sendMessage("You must set the enchant level to be between 0-65535.");
				else
					setEnchant(activeChar, ench, armorType);
			}
			catch (StringIndexOutOfBoundsException e)
			{
				if (Config.DEVELOPER)
					_log.warning("Set enchant error: " + e);
				activeChar.sendMessage("Please specify a new enchant value.");
			}
			catch (NumberFormatException e)
			{
				if (Config.DEVELOPER)
					_log.warning("Set enchant error: " + e);
				activeChar.sendMessage("Please specify a valid new enchant value.");
			}
		}

		// show the enchant menu after an action
		showMainPage(activeChar);
	}

	return true;
}

private void setEnchant(L2PcInstance activeChar, int ench, int armorType)
{
	// get the target
	L2Object target = activeChar.getTarget();
	if (target == null)
		target = activeChar;
	L2PcInstance player = null;
	if (target instanceof L2PcInstance)
	{
		player = (L2PcInstance) target;
	}
	else
	{
		activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET);
		return;
	}

	// now we need to find the equipped weapon of the targeted character...
	int curEnchant = 0; // display purposes only
	L2ItemInstance itemInstance = null;

	// only attempt to enchant if there is a weapon equipped
	L2ItemInstance parmorInstance = player.getInventory().getPaperdollItem(armorType);
	if (parmorInstance != null && parmorInstance.getLocationSlot() == armorType)
	{
		itemInstance = parmorInstance;
	}

	if (itemInstance != null)
	{
		curEnchant = itemInstance.getEnchantLevel();

		// set enchant value
		player.getInventory().unEquipItemInSlot(armorType);
		itemInstance.setEnchantLevel(ench);
		player.getInventory().equipItem(itemInstance);

		// send packets
		InventoryUpdate iu = new InventoryUpdate();
		iu.addModifiedItem(itemInstance);
		player.sendPacket(iu);
		player.broadcastPacket(new CharInfo(player));
		player.sendPacket(new UserInfo(player));
		player.broadcastPacket(new ExBrExtraUserInfo(player));

		// informations
		activeChar.sendMessage("Changed enchantment of " + player.getName() + "'s " + itemInstance.getItem().getName() + " from " + curEnchant + " to " + ench + ".");
		player.sendMessage("Admin has changed the enchantment of your " + itemInstance.getItem().getName() + " from " + curEnchant + " to " + ench + ".");
	}
}

private void showMainPage(L2PcInstance activeChar)
{
	AdminHelpPage.showHelpPage(activeChar, "enchant.htm");
}

@Override
public String[] getAdminCommandList()
{
	return ADMIN_COMMANDS;
}
}

PS. L2jserver Beta last rev

Link to comment
Share on other sites

  • 0

gia na kanei twra afto pou les pio apla kane ta parakatw kai mhn dwseis shmasia sto parapanw reply ;)

panw apo afthn thn seira: // now we need to find the equipped weapon of the targeted character...

vale afto:

if (!player.isGM())
	{
		player = activeChar;
	}

 

sta admin command handlers sto arxeio AdminEnchant.java

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • Good morning, how do I use it to open a npcname.txt file from l2 c1? I made some progress and understood that I must create a bat file with the following specifications: l2encdec_old -e 121 npcname-e.txt   When I run the .bat it creates a new enc-npcname-e.txt  But when I open it, I still can't read the files Is there something wrong with the code I ran?    
    • Hello! Since this video with those cool agathions belongs to Asuki, better ask him if they are private or free. As for me, since KejbL mentioned me, I've also done a lot of work of this kind, such as body-attached auras in the form of agathions like in the video and cool versions that attach to the back like agathions as well. If you're interested, I can show you some examples.
    • Server Rates: » Xp 500x. » Sp 500x. » Aden 500x. » Drop 1x. » PartyXp 2x. » PartySp 2x. » Starting character level -1 Enchant rates: » Safe enchant +4. » Blessed and simple scrolls max enchant (+16). » Crystal scrolls max enchant (+16). » Simple enchant scrolls chance – 65%. » Blessed enchant scrolls chance – 80%. » Crystal enchant scrolls chance – 90% Augmentations: » High life stone skill chance – 10%. » Top life stone skill chance – 15%. » Augments 1 active   1passive Unique features: » Main town – Giran » Automatic-Manual Potions. » Working 2 castle sieges. (Giran-Aden) » SPS cancel lasts 10 seconds and than buffs come back. » Stackable scrolls, lifestones, book of giants. » Unique pvp zone » More then 11 active raid bosses. » Wedding system. » Unique farming areas. » Npc skill enchanter. » Full npc buffer with auto buff. » Max count of buffs – 55. » Max subclasses – 4. » Free and no quest class change. » Free and no quest sub class. » Raid boss drop nobless item. » No weight limit. » Unique protection anti-hwy armor for archers/daggers etc. » Ingame password change. » Top pvp/pk/online ranks NPC. » Unique monsters & NPC. » Interlude retail skills. » Server up-time [24/7] [99]%. » Perfect class balance (all class can kill all class depending on players skill and setup knowledge,gear,augmentations). » Announcements on double kills triple kills etc. » Announcements on Grand Boss death , with the name of the killer as well as clan name of the player. » Information Npc in game with all servers infromations.   🌐 https://l2-prodigy.com ✅ https://discord.gg/bEphbJ4WY7
    • Good morning, how do I use it to open a npcname.txt file from l2 c1? Good morning, I made some progress and understood that I must create a bat file with the following specifications: l2encdec_old -e 121 npcname-e.txt   When I run the .bat it creates a new enc-npcname-e.txt  But when I open it, I still can't read the files Is there something wrong with the code I ran?    
    • It's on formula the skill launch time, if you decrease it, you won't see the whole visual effect, close please.
  • Topics

×
×
  • Create New...