Jump to content

Custom Effects At Echant Armor And More..


Recommended Posts

Hello Mxc,Today Ill Show You Some Codes I think Some Off this Is Not Shared Or Is shared Before 2009.

 

 

 

 

 

 

First ill Show You Enchant armor auto get abnormal effect

When you have enchanted your armor +16 there will be show an abnormal effect if you want you can change it!

l2character.java search for abnormal effects

 

Go at inventory.java after this line 

"+armorSet.getEnchant6skillId()+".");

add this

if (armorSet.isEnchanted16(player))
{
player.startAbnormalEffect(L2Character.ABNORMAL_EFFECT_STEALTH);
 }

before this line

 if(removeSkillId1 != 0)
                        {
                                L2Skill skill = SkillTable.getInstance().getInfo(removeSkillId1,1);

add this

player.stopAbnormalEffect(L2Character.ABNORMAL_EFFECT_STEALTH);
                  

Now go to L2Armorset.java and add this

    
    public boolean isEnchanted16(L2PcInstance player)
    {
         // Player don't have full set
        if(!containAll(player))
            return false;

        Inventory inv = player.getInventory();

        L2ItemInstance chestItem  = inv.getPaperdollItem(Inventory.PAPERDOLL_CHEST);
        L2ItemInstance legsItem   = inv.getPaperdollItem(Inventory.PAPERDOLL_LEGS);
        L2ItemInstance headItem   = inv.getPaperdollItem(Inventory.PAPERDOLL_HEAD);
        L2ItemInstance glovesItem = inv.getPaperdollItem(Inventory.PAPERDOLL_GLOVES);
        L2ItemInstance feetItem   = inv.getPaperdollItem(Inventory.PAPERDOLL_FEET);

        if(chestItem.getEnchantLevel() < 16)
            return false;
        if(_legs != 0 && legsItem.getEnchantLevel() < 16)
            return false;
        if(_gloves != 0 && glovesItem.getEnchantLevel() < 16)
            return false;
        if(_head != 0 && headItem.getEnchantLevel() < 16)
            return false;
        if(_feet != 0 && feetItem.getEnchantLevel() < 16)
            return false;

        return true;
    }

Thats all with this..

 

Then i give too one code L2Password Changer with command and without npc and nah...bored this

 

 

 

 

Create a public class ChangePassword At Com.L2jfrozen.Gameserver.Hander.VoicedCommandHandler

and then add this

/*
 * 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 java.security.MessageDigest;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.StringTokenizer;
 
import com.l2jfrozen.crypt.Base64;
import com.l2jfrozen.util.database.L2DatabaseFactory;
import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.network.serverpackets.ExShowScreenMessage;
 
/*
 * @Author: Abyssal
 */
 
public class ChangePassword implements IVoicedCommandHandler
{
        private static final String[] _voicedCommands =
        {
                "changepass"
        };
 
        @Override
        public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
        {
                if(command.equalsIgnoreCase("changepass") && target != null)
                {
                        StringTokenizer st = new StringTokenizer(target);
                        try
                        {
                                String curpass = null, newpass = null, repeatnewpass = null;
 
                                if(st.hasMoreTokens())
                                        curpass = st.nextToken();
                                if(st.hasMoreTokens())
                                        newpass = st.nextToken();
                                if(st.hasMoreTokens())
                                        repeatnewpass = st.nextToken();
 
                                if(!(curpass == null || newpass == null || repeatnewpass == null))
                                {
                                        if(!newpass.equals(repeatnewpass))
                                        {
                                                activeChar.sendMessage("The new password doesn't match with the repeated one!");
                                                return false;
                                        }
                                        if(newpass.length() < 4)
                                        {
                                                activeChar.sendMessage("The new password is shorter than 4 characters! Please try with a longer one.");
                                                return false;
                                        }
                                        if(newpass.length() > 25)
                                        {
                                                activeChar.sendMessage("The new password is longer than 25 characters! Please try with a shorter one.");
                                                return false;
                                        }
 
                                        MessageDigest md = MessageDigest.getInstance("SHA");
 
                                        byte[] raw = curpass.getBytes("UTF-8");
                                        raw = md.digest(raw);
                                        String curpassEnc = Base64.encodeBytes(raw);
                                        String pass = null;
                                        int passUpdated = 0;
 
                                        Connection con = null;
                                        con = L2DatabaseFactory.getInstance().getConnection();
                                        PreparedStatement statement = con.prepareStatement("SELECT password FROM accounts WHERE login=?");
                                        statement.setString(1, activeChar.getAccountName());
                                        ResultSet rset = statement.executeQuery();
 
                                        if(rset.next())
                                        {
                                                pass = rset.getString("password");
                                        }
 
                                        rset.close();
                                        statement.close();
 
                                        if(curpassEnc.equals(pass))
                                        {
                                                byte[] password = newpass.getBytes("UTF-8");
                                                password = md.digest(password);
 
                                                PreparedStatement ps = con.prepareStatement("UPDATE accounts SET password=? WHERE login=?");
                                                ps.setString(1, Base64.encodeBytes(password));
                                                ps.setString(2, activeChar.getAccountName());
                                                passUpdated = ps.executeUpdate();
                                                ps.close();
                                                con.close();
                                               
                                                if(passUpdated > 0)
                                                {
                                                        activeChar.sendMessage("You have successfully changed your password!");
                                                        activeChar.sendPacket(new ExShowScreenMessage("You have successfully changed your password!#Enjoy :)", 6000));
                                                }
                                                else
                                                {
                                                                activeChar.sendMessage("The password change was unsuccessful!");
                                                                activeChar.sendPacket(new ExShowScreenMessage("The password change was unsuccessful!!#U_u)", 6000));
                                                }
                                        }
                                        else
                                        {
                                                activeChar.sendMessage("CurrentPass doesn't match with your current one.");
                                                return false;
                                        }
                                }
                                else
                                {
                                        activeChar.sendMessage("Invalid pass data! Format: .changepass CurrentPass NewPass NewPass");
                                        return false;
                                }
                        }
                        catch(Exception e)
                        {
                                activeChar.sendMessage("A problem occured while changing password!");
                        }
                }
                else
                {
                        activeChar.sendMessage("To change your current password, you have to type the command in the following format(without the brackets []): [.changepass CurrentPass NewPass NewPass]. You should also know that the password is case sensitive.");
                        activeChar.sendPacket(new ExShowScreenMessage("To change your current password, you have to type the command in the following format(without the brackets []):#[.changepass CurrentPass NewPass NewPass]. You should also know that the password is case sensitive.)", 7000));
                        return false;
                }
 
                return true;
        }
 
        @Override
        public String[] getVoicedCommandList()
        {
                return _voicedCommands;
        }
 
}

Then ill show BugReport Npc.

 

 

With this X player Can Report one bug and server admin gets at server files Server\gameserver\log\BugReports

One file with bug report and the message is 

Character Info: [Character: Abyssal - Account: Abyssal - IP: 999.999.999.999]
Bug Type: General
Message: BuG With Vote Manager Fix It

Go to Com.L2jfrozen.Gameserver.Model.Actor.Instance and create a class L2BugReportInstance

and copy paste this code

/*
 * 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.model.actor.instance;

import java.io.*;
import java.util.StringTokenizer;

import javolution.text.TextBuilder;

import com.l2jfrozen.gameserver.ai.CtrlIntention;
import com.l2jfrozen.gameserver.model.L2World;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.network.L2GameClient;
import com.l2jfrozen.gameserver.network.clientpackets.Say2;
import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed;
import com.l2jfrozen.gameserver.network.serverpackets.CreatureSay;
import com.l2jfrozen.gameserver.network.serverpackets.MyTargetSelected;
import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jfrozen.gameserver.network.serverpackets.ValidateLocation;
import com.l2jfrozen.gameserver.templates.L2NpcTemplate;

/**
 * @author squallcs
 *
 * @Reworked Abyssal
 */
public class L2BugReportInstance extends L2FolkInstance
{
	private static String _type;
	
	public L2BugReportInstance(int objectId, L2NpcTemplate template)
	{
		super(objectId, template);
	}
	
	@Override
	public void onBypassFeedback(L2PcInstance player, String command)
	{
		if (command.startsWith("send_report"))
		{
			StringTokenizer st = new StringTokenizer(command);
			st.nextToken();
			String msg = "";
			String type = null;
			type = st.nextToken();
			st.nextToken();
			try
			{
				while (st.hasMoreTokens())
				{
					msg = msg + " " + st.nextToken();
				}
				
				sendReport(player, type, msg);
			}
			catch (StringIndexOutOfBoundsException e)
			{
			}
		}
	}
	
	static
	{
		new File("log/BugReports/").mkdirs();
	}
	
	private void sendReport(L2PcInstance player, String command, String msg)
	{
		String type = command;
		L2GameClient info = player.getClient().getConnection().getClient();
		
		if (type.equals("General"))
			_type = "General";
		if (type.equals("Fatal"))
			_type = "Fatal";
		if (type.equals("Misuse"))
			_type = "Misuse";
		if (type.equals("Balance"))
			_type = "Balance";
		if (type.equals("Other"))
			_type = "Other";
		
		try
		{
			String fname = "log/BugReports/" + player.getName() + ".txt";
			File file = new File(fname);
			boolean exist = file.createNewFile();
			if (!exist)
			{
				player.sendMessage("You have already sent a bug report, GMs must check it first.");
				return;
			}
			FileWriter fstream = new FileWriter(fname);
			BufferedWriter out = new BufferedWriter(fstream);
			out.write("Character Info: " + info + "\r\nBug Type: " + _type + "\r\nMessage: " + msg);
			player.sendMessage("Report sent. GMs will check it soon. Thanks...");
			
			for (L2PcInstance allgms : L2World.getInstance().getAllGMs())
				allgms.sendPacket(new CreatureSay(0, Say2.SHOUT, "Bug Report Manager", player.getName() + " sent a bug report."));
			
			System.out.println("Character: " + player.getName() + " sent a bug report.");
			out.close();
		}
		catch (Exception e)
		{
			player.sendMessage("Something went wrong try again.");
		}
	}
	
	@Override
	public void onAction(L2PcInstance player)
	{
		if (!canTarget(player))
		{
			return;
		}
		
		if (this != player.getTarget())
		{
			player.setTarget(this);
			
			player.sendPacket(new MyTargetSelected(getObjectId(), 0));
			
			player.sendPacket(new ValidateLocation(this));
		}
		else if (!canInteract(player))
		{
			player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this);
		}
		else
		{
			showHtmlWindow(player);
		}
		
		player.sendPacket(new ActionFailed());
	}
	
	private void showHtmlWindow(L2PcInstance activeChar)
	{
		NpcHtmlMessage nhm = new NpcHtmlMessage(5);
		TextBuilder replyMSG = new TextBuilder("");
		
		replyMSG.append("<html><title>Bug Report Manager</title>");
		replyMSG.append("<body><br><br><center>");
		replyMSG.append("<table border=0 height=10 bgcolor=\"444444\" width=240>");
		replyMSG.append("<tr><td align=center><font color=\"00FFFF\">Hello " + activeChar.getName() + ".</font></td></tr>");
		replyMSG.append("<tr><td align=center><font color=\"00FFFF\">There are no Gms online</font></td></tr>");
		replyMSG.append("<tr><td align=center><font color=\"00FFFF\">and you want to report something?</font></td></tr>");
		replyMSG.append("</table><br>");
		replyMSG.append("<img src=\"L2UI.SquareWhite\" width=280 height=1><br><br>");
		replyMSG.append("<table width=250><tr>");
		replyMSG.append("<td><font color=\"LEVEL\">Select Report Type:</font></td>");
		replyMSG.append("<td><combobox width=105 var=type list=General;Fatal;Misuse;Balance;Other></td>");
		replyMSG.append("</tr></table><br><br>");
		replyMSG.append("<multiedit var=\"msg\" width=250 height=50><br>");
		replyMSG.append("<br><img src=\"L2UI.SquareWhite\" width=280 height=1><br><br><br><br><br><br><br>");
		replyMSG.append("<button value=\"Send Report\" action=\"bypass -h npc_" + getObjectId() + "_send_report $type $msg\" width=204 height=20 back=\"sek.cbui75\" fore=\"sek.cbui75\">");
		replyMSG.append("</center></body></html>");
		
		nhm.setHtml(replyMSG.toString());
		activeChar.sendPacket(nhm);
		
		activeChar.sendPacket(new ActionFailed());
	}
	
}

Then ill show you reputation item,This give you x reputation points to your clan.

 

Go to

Com.L2jfrozen.Gameserver.Handler.ItemHandler.java

 

Find this

import com.l2jfrozen.gameserver.handler.itemhandlers.ChristmasTree;

bellow add this

import com.l2jfrozen.gameserver.handler.itemhandlers.ClanRepsItem;

then find this 

registerItemHandler(new ChestKey());

bellow add this

registerItemHandler(new ClanRepsItem());

Then go Com.L2jfrozen.Gamserver.Handler.ItemHander and create new ClanRepsItem.java

 

 

add this

/*
 * 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 com.l2jfrozen.gameserver.handler.itemhandlers;

/**
 * 
 * 
 * @author Coyote
 * Adapted by Strike
 * Reworked by Abyssal
 */


import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.handler.IItemHandler;
import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.network.serverpackets.MagicSkillUser;

public class ClanRepsItem implements IItemHandler
{
    private static final int ITEM_IDS[] =
    {
       Config.CR_ITEM_REPS_ITEM_ID
    };

    public void useItem(L2PlayableInstance playable, L2ItemInstance item)
    {
            if (!(playable instanceof L2PcInstance))
            {
                return;
            }

            L2PcInstance activeChar = (L2PcInstance)playable;

            if (!activeChar.isClanLeader())
            {
                activeChar.sendMessage("This can be used only by Clan Leaders!");
                return;
            }
           
            else if (!(activeChar.getClan().getLevel() >= Config.CR_ITEM_MIN_CLAN_LVL))
            {
               activeChar.sendMessage("Your Clan Level is not big enough to use this item!");
               return;
            }
            else
            {
               activeChar.getClan().setReputationScore(activeChar.getClan().getReputationScore()+Config.CR_ITEM_REPS_TO_BE_AWARDED, true);
               activeChar.sendMessage("Your clan has earned "+ Config.CR_ITEM_REPS_TO_BE_AWARDED +" rep points!");
               MagicSkillUser  MSU = new MagicSkillUser(activeChar, activeChar, 2024, 1, 1, 0);
               activeChar.broadcastPacket(MSU);
              playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
            }
        }

    public int[] getItemIds()
    {
        return ITEM_IDS;
    }
}

then go Config.java

 

Find this

public static String PVP2_CUSTOM_MESSAGE;

and then add this 

         /**
	 * Clan Reputation Item
	 */
	public static boolean USE_CR_ITEM;
	public static int CR_ITEM_MIN_CLAN_LVL;
	public static int CR_ITEM_REPS_TO_BE_AWARDED;
	public static int CR_ITEM_REPS_ITEM_ID;

then find this

			PVP2_CUSTOM_MESSAGE = L2ScoriaSettings.getProperty("PvP2CustomMeesage", "You have been teleported to PvP Zone 2!");

and bellow add this

			/** Clan reputation Item**/
			USE_CR_ITEM = Boolean.parseBoolean(L2ScoriaSettings.getProperty("EnableTheClanRepPointsItem", "False"));
			CR_ITEM_MIN_CLAN_LVL = Integer.parseInt(L2ScoriaSettings.getProperty("ClanLevelNeededForCR", "5"));
			CR_ITEM_REPS_TO_BE_AWARDED = Integer.parseInt(L2ScoriaSettings.getProperty("HowManyClanRepsToGive", "500"));
			CR_ITEM_REPS_ITEM_ID = Integer.parseInt(L2ScoriaSettings.getProperty("CRItemID", "6673"));

and the last 

 

Go To L2JFrozen.Propeties

 

Find this

# -----------------------------------------------------
# Hero Custom Item Configuration -
# -----------------------------------------------------
# When ActiveChar will use this item will gain Hero Status.
EnableHeroCustomItem = False
# Id Itemn Need's 
HeroCustomItemId = 3481
# Hero for X days, 0 forever.
HeroCustomDay = 0

and after this add this

# -------------------------------------------------------
# Clan Reputation Custom Item Configuration
# -------------------------------------------------------
# Would you like to enable the Clan Reputation points item?
# Default: False
EnableTheClanRepPointsItem = False
# What's the Min Level in which clan leaders will be able to use the item?
# Default 5
MinClanLevelNeededForCR = 5
# How many rep points will be rewarded to the clan?
# Default 500
HowManyClanRepsToGive = 500
# Set the ID of the Clan Rep Points Item
# Default = 6673 (Festival Adena)
CRItemID = 6673

And The Last Code ChangeNameNpc..

 

Com.L2jFrozen.Gamserver.Model.Actor.Instance and create L2ChangeNameInstance

 

add this

/*
 * 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.model.actor.instance;

import com.l2jfrozen.gameserver.ai.CtrlIntention;
import com.l2jfrozen.gameserver.communitybbs.Manager.RegionBBSManager;
import com.l2jfrozen.gameserver.datatables.sql.CharNameTable;
import com.l2jfrozen.gameserver.datatables.sql.ItemTable;
import com.l2jfrozen.gameserver.model.L2World;
import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed;
import com.l2jfrozen.gameserver.network.serverpackets.MyTargetSelected;
import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jfrozen.gameserver.network.serverpackets.PartySmallWindowAll;
import com.l2jfrozen.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
import com.l2jfrozen.gameserver.network.serverpackets.ValidateLocation;
import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
import com.l2jfrozen.logs.Log;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Properties;
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;

import javolution.text.TextBuilder;

public class L2ChangeNameInstance extends L2FolkInstance
{
	
	private static final String changeNameConfigFile = "./config/changename.properties"; // Set the config file path.
	private static boolean paymentRequired;
	private static int changeNamePrice;
	private static int itemID;
	
	// Get configurations from file.
	
	public static void loadOptionsConfig()
	{
		final String OPTIONS = L2ChangeNameInstance.changeNameConfigFile;
		
		try
		{
			Properties optionsSettings = new Properties();
			InputStream is = new FileInputStream(new File(OPTIONS));
			optionsSettings.load(is);
			is.close();
			
			changeNamePrice = Integer.parseInt(optionsSettings.getProperty("ChangeNamePrice", "0"));
			itemID = Integer.parseInt(optionsSettings.getProperty("ItemID", "57"));
			paymentRequired = Boolean.valueOf(optionsSettings.getProperty("PaymentRequired", "false"));
		}
		catch (Exception e)
		{
			e.printStackTrace();
			throw new Error("Failed to Load " + OPTIONS + " File.");
		}
	}
	
	// Load config files.
	
	static
	{
		loadOptionsConfig();
	}
	
	// Obtain item name.
	
	public static String getItemName()
	{
		String _itemName = ItemTable.getInstance().getTemplate(itemID).getName();
		return _itemName;
	}
	
	// Audit change name.
	
	static
	{
		new File("log/CHARChangeName").mkdirs();
	}
	
	private static final Logger _log = Logger.getLogger(Log.class.getName());
	
	public static void auditChangeName(String oldCharName, String newCharName)
	{
		SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy H:mm:ss");
		String today = formatter.format(new Date());
		
		FileWriter save = null;
		
		try
		{
			File file = new File("log/CHARChangeName/log.txt");
			save = new FileWriter(file, true);
			String out = "[" + today + "] --> User: " + oldCharName + " changed his name to " + newCharName + " \r\n";
			
			save.write(out);
		}
		catch (IOException e)
		{
			_log.log(Level.SEVERE, "Change name of " + oldCharName + " could not be saved: ", e);
		}
		finally
		{
			if (save != null)
				try
				{
					save.close();
				}
				catch (Exception e)
				{
					e.printStackTrace();
				}
		}
	}
	
	// Create NPC.
	
	public L2ChangeNameInstance(int objectId, L2NpcTemplate template)
	{
		super(objectId, template);
	}
	
	// Changing name action.
	
	@Override
	public void onBypassFeedback(L2PcInstance player, String command)
	{
		if (command.startsWith("change_name"))
		{
			StringTokenizer st = new StringTokenizer(command);
			st.nextToken();
			String currName = null;
			String newName = null;
			String repeatNewName = null;
			try
			{
				if (st.hasMoreTokens())
				{
					currName = st.nextToken();
					newName = st.nextToken();
					repeatNewName = st.nextToken();
				}
				else
				{
					printErrorMessage("Please fill in all the blanks before requesting for a name change.", player);
					return;
				}
				changeName(currName, newName, repeatNewName, player);
			}
			catch (StringIndexOutOfBoundsException e)
			{
			}
		}
	}
	
	// Interaction with npc.
	
	@Override
	public void onAction(L2PcInstance player)
	{
		if (!canTarget(player))
		{
			return;
		}
		
		if (this != player.getTarget())
		{
			player.setTarget(this);
			
			player.sendPacket(new MyTargetSelected(getObjectId(), 0));
			
			player.sendPacket(new ValidateLocation(this));
		}
		else if (!canInteract(player))
		{
			player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this);
		}
		else
		{
			showHtmlWindow(player);
		}
		
		player.sendPacket(new ActionFailed());
	}
	
	// Main html frame.
	
	private void showHtmlWindow(L2PcInstance activeChar)
	{
		NpcHtmlMessage nhm = new NpcHtmlMessage(5);
		TextBuilder replyMSG = new TextBuilder("");
		
		replyMSG.append("<html><title>Name Manager</title>");
		replyMSG.append("<body><center>");
		replyMSG.append("To change your name:<br1> First fill in your current name and then your new!</font><br>");
		if (paymentRequired)
		{
			replyMSG.append("Item required: " + getItemName() + "and amount: " + changeNamePrice + " <br>");
		}
		replyMSG.append("Current Name: <edit var=\"cur\" width=100 height=15><br>");
		replyMSG.append("New Name: <edit var=\"new\" width=100 height=15><br>");
		replyMSG.append("Repeat New Name: <edit var=\"repeatnew\" width=100 height=15><br><br>");
		replyMSG.append("<button value=\"Change Name\" action=\"bypass -h npc_" + getObjectId() + "_change_name $cur $new $repeatnew\" width=204 height=20 back=\"sek.cbui75\" fore=\"sek.cbui75\">");
		replyMSG.append("</center></body></html>");
		
		nhm.setHtml(replyMSG.toString());
		activeChar.sendPacket(nhm);
		
		activeChar.sendPacket(new ActionFailed());
	}
	
	// Print html method.
	
	private static void printErrorMessage(String msg, L2PcInstance activeChar)
	{
		
		NpcHtmlMessage nhm = new NpcHtmlMessage(5);
		TextBuilder replyMSG = new TextBuilder("");
		
		replyMSG.append("<html><title>Name Manager</title>");
		replyMSG.append("<body><center><br>Ohh no! A problem ocurred!</center><br> " + msg + " </body></html>");
		nhm.setHtml(replyMSG.toString());
		activeChar.sendPacket(nhm);
		
	}
	
	public static boolean changeName(String currName, String newName, String repeatNewName, L2PcInstance activeChar)
	{
		
		// Check player name requirements
		
		if (newName.length() < 4)
		{
			printErrorMessage("The new name is too short! You should use 4 charcaters or more", activeChar);
			return false;
		}
		if (newName.length() > 16)
		{
			printErrorMessage("The new name is too long!", activeChar);
			return false;
		}
		if (!newName.equals(repeatNewName))
		{
			printErrorMessage("Repeated name doesn't match the new name.", activeChar);
			return false;
		}
		
		String name2 = null;
		
		// Check if player name already exists if not, continue.
		
		if (CharNameTable.getInstance().doesCharNameExist(newName))
		{
			activeChar.sendMessage(newName + " already in use!");
			return false;
		}
		
		// Check if player name verifies the original.
		
		if (!currName.equals(activeChar.getName()))
		{
			printErrorMessage("Your actual name doesn't verifies yours.", activeChar);
			return false;
		}
		
		// Check player required item.
		
		if (paymentRequired && (activeChar.getInventory().getItemByItemId(itemID) == null || activeChar.getInventory().getItemByItemId(itemID).getCount() < changeNamePrice))
		{
			printErrorMessage("You dont have enough " + getItemName(), activeChar);
			return false;
		}
		
		try
		{
			name2 = newName;
			
			L2PcInstance player = null;
			String oldName = null;
			
			player = activeChar;
			oldName = player.getName();
			
			L2World.getInstance().removeFromAllPlayers(player);
			player.setName(name2);
			player.store();
			L2World.getInstance().addToAllPlayers(player);
			printErrorMessage("Your name has been changed succesfully from " + oldName + " to " + name2, player);
			player.broadcastUserInfo();
			
			if (player.isInParty())
			{
				player.getParty().broadcastToPartyMembers(player, new PartySmallWindowDeleteAll());
				for (L2PcInstance member : player.getParty().getPartyMembers())
				{
					if (member != player)
					{
						member.sendPacket(new PartySmallWindowAll(player, player.getParty()));
					}
				}
			}
			if (player.getClan() != null)
			{
				player.getClan().broadcastClanStatus();
			}
			RegionBBSManager.getInstance().changeCommunityBoard();
			
			// Audit change name for security if a char did something bad and he changes his name to hide his malevolent steps...
			
			auditChangeName(oldName, name2);
			
			// Take required item from inventory.
			
			if (paymentRequired && (changeNamePrice > 0))
			{
				player.destroyItemByItemId("ChangeNameNPC", itemID, changeNamePrice, player.getLastFolkNPC(), true);
			}
		}
		catch (Exception e)
		{
			_log.log(Level.SEVERE, "Change name action couldn't be performed!", e);
		}
		
		return true;
	}
}

then create a file at gamserver/config/changename.propeties

 

and add this

# Change Name settings

# PaymentRequired = Set if you need to pay in order to change your name
# Default: false
PaymentRequired = True

# ChangeNamePrice = Set the amount of adena that you have to pay.
# Default = 0
ChangeNamePrice = 1000000

# ItemID = Set the item id as payment. For example 57 = Adena
# Default = 57

ItemID = 57

and the last add sql

INSERT INTO `custom_npc` VALUES ('9991', '29047', 'ChangeName', '1', '', '1', 'Monster3.follower_of_frintessa_tran', '10.00', '110.00', '85', 'male', 'L2ChangeName', '40', '1709400', '70000', '668.78', '300.00', '60', '57', '73', '76', '70', '80', '111550355', '9525390', '50000', '4500', '8082', '2000', '270', '0', '300', '8222', '0', '0', '160', '300', 'frintezza_clan', '5000', '0', '13', 'FULL_PARTY');

Dont ask credits some is mine some is from another but i find at my pc thrown

 

Soon more Thank you ..

Link to comment
Share on other sites

find this, add this, bellow this.. ohh my head... 

I can't read more...

 

But on first part with armor effect in +16 weapon.. you have test this? is it work?

 

The next time use "+" and "-".

Edited by 'Baggos'
Link to comment
Share on other sites

find this, add this, bellow this.. ohh my head...

I can't read more...

 

But on first part with armor effect in +16 weapon.. you have test this? is it work?

 

The next time use "+" and "-".

Yep, works! ^_^

www.maxcheaters.com/topic/187044-enchant-armor-effects/#entry2437673

Link to comment
Share on other sites

Yep, works! ^_^

www.maxcheaters.com/topic/187044-enchant-armor-effects/#entry2437673

Abyssal got all this and made share? :O

Effect on enchant is good idea for that i want to do. but i will set it differently.

Link to comment
Share on other sites

Abyssal got all this and made share? :o

Effect on enchant is good idea for that i want to do. but i will set it differently.

baggos but with armor echant wwe have one prob if you find answer tell me and i fix it

the prob is if you got +16 armor getEffectAbnormal but if ArmorRemove abnormal effect stay..

Link to comment
Share on other sites

baggos but with armor echant wwe have one prob if you find answer tell me and i fix it

the prob is if you got +16 armor getEffectAbnormal but if ArmorRemove abnormal effect stay..

obviously pass a check dude

 

on if(remove

Link to comment
Share on other sites

Because I've created it on my own pack (which starts from l2jserver's rev 1433) where it works perfectly. On the public packs there may be a difference, so you should use it according to their realization. :)

Link to comment
Share on other sites

Because I've created it on my own pack (which starts from l2jserver's rev 1433) where it works perfectly. On the public packs there may be a difference, so you should use it according to their realization. :)

EDIT:

 

Here is the check for remove the effect?

 

 

player.stopAbnormalEffect(L2Character.ABNORMAL_EFFECT_STEALTH);
Edited by 'Baggos'
Link to comment
Share on other sites

  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   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

    • Что ты за 2 года войны смогло сделать со своего дивана трансвеститка?) Твой высер нужно читать как: хрю-хрю-хрююю! Ибо большего ты не можешь сделать, поэтому слезливо хрюкаешь на форумах :D Или ты начало резко так хрюкать из за того что твой Оренбург затопило?) Карма она вездесущая и Каховская ГЕС себя не заставила ждать)  
    • Pig dog are you still alive? Are you still able to escape from the military registration and enlistment office? Well, nothing, either they will catch you and send you to be meat in a combat zone, or after the end of a special military operation, we will find and punish every degenerate. And you pig dog can’t hide anywhere. I will personally make sure that you cannot stay on the territory of the Russian Federation and Ukraine. By the way, don’t be offended by those who call you a pigdog. You are a descendant of Bandera’s followers, and the soldiers of Hitler’s Germany called them schweinehund   So.... 🤣
    • Hello, i purchased an interface and unfortunately i don't receive any support on this issue weeks now. Basically when you go at any Fortress (Baroy for example) and you hit anything your character stuck there hitting and you cannot quit, chat or do anything.   Is like client overflood by packets. If i remove the interface everything works fine. Anyone have any idea how to fix this or what could cause this? I can provide access to my interface which i bough but i think it's encrypted. Thanks.
    • Any code global chat for this feature?   
    • (862)4337118Timberwood Park,TX PsychicReadingLove Spells     (862)4337118  Love u  Instantly & How To Cast 2024 | Return Ex-Lover | Best Spiritual Psychic | Love & Relationship Problems | Free Best Online Astrology Medium. Top Astrological Solutions for Your Love, Marriage & Relationships Life Problems Using Real Powerful Love Spells That Work Instantly. Do you ever wonder why some people are successful and joyful? They won't tell you how they made it in their marriage, or at their work, or how they fixed that money problem, or how they got pregnant, or how they got their lover back, or how they removed that family curse. ☎ Call Or WhatsApp (862)4337118. Love Spells in New York City, NY They won't tell you how they stopped the divorce from happening or how their spouse stopped cheating. Have you been disappointed or lost hope? Then you are fortunate to have found. I offer to guide you and answer your questions. These spells are harmless and are designed to help you. As a real spell caster, I Caster Ruben believe in coincidence, there are superior energies in the universe that can be used to your advantage. Voodoo Love Spells in New York City, NY Meet one of the world's best lost love spell casters, traditional healer, Psychic, spiritual healer, and herbalist healers in America with head offices in Town today for a great transformation in your life. Lost Love spells are very effective and work fast for both opposite-sex and same-sex couples. Be serious that the person you want to cast this spell upon, you love him or her. BRINGING BACK LOST LOVERS IN 24 HOURS Bring back your lost love today with the help of these bring back lost love spells that work fast. Even if you lost your lover 2 years or 4 years ago, with the help of these love spells he or she will be back. These spells are very powerful. If you would like to bring back the love of your life? This bring-back lost love spell is a must. They are very easy to use and safe you will have him or her back in no time. MARRIAGE SPELLS | THAT WORK FAST VERY Is your lover not taking you seriously? Are you tired of being single? Have you stayed with your lover for so many years? He or she doesn’t want to propose to you. Marriage love spells are a must for you. To decide about casting these spells. You must clear your mind and make the right decision. This powerful marriage spell is a must. The marriage love spell will make things to be revived and be on a smooth track again in your marriage. Your marriage could be failing due to many things like unresolved arguments. The number one cause of most failed marriages is arguments being unresolved. That is where the marriage love spell comes in because it will go to the actual core of the issue and solve it so that it never affects you again. Binding Love Spells Do you want to strengthen your relationship? Do you want to make him love you more? Do you feel he or she is seeing others? Binding love spells help you to tire your relationship tight. Binding love spells make your lover love you more and more. These spells also create more passion and care in your relationship. Strengthen your relationship today. Simply contact our love spells caster. Most Boyfriend, Girlfriend Problems Many unmarried couples go through a tough time and they can perform astrological remedies to help a person to end such boyfriend/girlfriend problems very easily and make the relationship good. Love Spells in New York City, NY How To Solve Relationship Problems Today numerous couples are struggling with relationship problems, astrology helps them to achieve the best part of their relationship by making everything better and keeping the love life better always. Lost Love Back Specialist in America When you need a solution for lost love back then it is good to use astrology which is the best remedy to end love issues and get love on track. Divorce Love Spells Do you want to divorce? Do you want to stop a divorce? Is your lover planning to divorce you? Are you tired of your wife or husband and you want to divorce her? These Divorce spells are very powerful. So, you have to be very careful when choosing these spells. You command whatever you may like whether to divorce or to stop a divorce. Divorce spells or Stop a Divorce spells in America are cast by our powerful love spell casters like me, Ruben Black Magic Love Spells in New York City, NY for Winning the Lottery / Gambling If you want to win the lottery using black magic, a lot of it involves positive thinking, and being proactive. Firstly, you need to write down what you wish to achieve and make sure that you focus all of your energy on that one simple thing: winning the lottery. It is also important, of course, that you go out and buy lottery tickets. No one has ever struck it rich with the lottery by sitting at home and forgetting to buy tickets to all of the big draws. Remember that you might not win the biggest lottery playout in the world, but you are bound to win something if you keep on focusing your energy, and you use the right types of black magic spells for the lottery to help you win. If you would like to know more about winning the lottery using black magic, or about improving your life in any other way, there are many helpful lottery spells available from black magic experts.(862)4337118 Voodoo Death Spell That Works Voodoo black magic to kill or destroy enemy/ Revenge death spells are the ultimate weapon of taking revenge or destroying them by using Revenge Spells. Powerful working death spells. A death spell is cast on a person whom we just can't tolerate any further not only around us but in this world. since someone has created so much trouble for us and has caused/ can cause some irreparable damage to us. How To Cast Voodoo Divorce Banishing Spells Mix Salt with vinegar, Press it in Front of a burning candle. Make A short prayer for 5 minutes then the Voodoo divorce spells to banish divorce so that you & your partner stay together & make your marriage last. Love spells to help a couple save their marriage & resolve their differences. Prevent a divorce with love spells to make your marriage stronger & banish all negativity from your marriage. Relationship Booster Love Spells Voodoo relationship spells boost the love, intimacy & affection between couples for a stronger relationship. Voodoo love spells make someone fall in love with you or cause an ex-lover to fall back in love with you. Lost love spells to help a couple get closer together & become more intimate & loving with each other. Attraction Love Spells in New York City, NY to attract a lover& make them desire you. Be reunited with an ex-lover using attraction spells to find a new lover. Attract a new lover or an ex-lover with attraction spells Increase the attraction between the toy & your lover using attraction spells. Powerful attraction spells to make someone fall in love with you & attraction spells to make your ex come back to you Voodoo Spells to Break Up a Couple Break up a relationship or marriage using voodoo break-up spells by Voodoo spells Caster Ruben who will cause a couple in a relationship to fall out of love & break up in less than 2 days after casting the voodoo break-up spell. If your ex-lover is in a relationship with someone else use my voodoo spells to break up their relationship & get them back. Crush Love spells Make the man or woman you desire to be in a relationship with fall in love with you using crush love spells. Psychically connect to the heart of the person you love & make them have feelings for you using voodoo love spells Obsession spells Perhaps obsession spells are the strongest love spells that exist. Even the word ‘obsession’ expresses a desire which is more than love and lust. To cast an obsession spell, the spell casters must have a great strength of mentality and huge knowledge of the spell casting realm (including witchcraft). Obsession spells are mainly used to create a great connection between people and things. The love spell of this category that I will introduce is the ‘love me deeply’ spell. It’s one of the free spells without ingredients * in other words, you don’t have to prepare any ingredients except your strong mind, your faith, and your focus. Gay And Lesbian Spells. Gay and Lesbian love spells are designed in such a way that they will attract only your male or female partner or love towards you. Love is an amazing feeling between two souls. There are different definitions of love according to the type of relationship. In today’s scenario love towards the same sex is very common. CLIENT TESTIMONIAL I have solved my inter-caste marriage problem by consulting Astrologer Psychic Ruben. His astrological remedies have worked best for me to get my parents' approval and blessings for my love marriage. A consultation with Astrologer Psychic BITOKA has helped me to tackle my business issues easily. His guidance and solutions are worth using and help to bring success to my business. Psychic Reading | Love Spells | Lost Love Spell Caster | Astrology | Remove Black Magic | Witchcraft Spells. (862)4337118
  • Topics

×
×
  • Create New...