Jump to content

Recommended Posts

Posted

Hi all here you have a command to increase the inventory of Site = Slot if your PJ has 100 slot in your inventory and put the commands you have increases 20 slot for more items in the inventory.

 

Imagen :

invetariooooo.jpg

 

Codigo :

 

### Eclipse Workspace Patch 1.0
#P L2J_Server
Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java	(revision 5708)
+++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@ -286,9 +295,9 @@
	private static final String DELETE_SKILL_SAVE = "DELETE FROM character_skills_save WHERE charId=? AND class_index=?";

	// Character Character SQL String Definitions:
-	private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,charId,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,fame,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,title_color,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,newbie,nobless,power_grade,createTime) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
-	private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,fame=?,pvpkills=?,pkkills=?,clanid=?,race=?,classid=?,deletetime=?,title=?,title_color=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,bookmarkslot=?,vitality_points=?,language=? WHERE charId=?";
-	private static final String RESTORE_CHARACTER = "SELECT account_name, charId, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, fame, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, title_color, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, newbie, nobless, power_grade, subpledge, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,bookmarkslot,vitality_points,createTime,language FROM characters WHERE charId=?";
+	private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,charId,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,fame,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,title_color,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,newbie,nobless,power_grade,createTime,moreslot) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
+	private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,fame=?,pvpkills=?,pkkills=?,clanid=?,race=?,classid=?,deletetime=?,title=?,title_color=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,bookmarkslot=?,vitality_points=?,language=?,moreslot=? WHERE charId=?";
+	private static final String RESTORE_CHARACTER = "SELECT account_name, charId, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, fame, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, title_color, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, newbie, nobless, power_grade, subpledge, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,bookmarkslot,vitality_points,createTime,language,moreslot FROM characters WHERE charId=?";

	// Character Teleport Bookmark:
	private static final String INSERT_TP_BOOKMARK = "INSERT INTO character_tpbookmark (charId,Id,x,y,z,icon,tag,name) values (?,?,?,?,?,?,?,?)";
@@ -538,6 +580,7 @@
	private boolean _recoTwoHoursGiven = false;

	private final PcInventory _inventory = new PcInventory(this);
+	private int _moreslot = 0;
	private PcWarehouse _warehouse;
	private PcRefund _refund;

@@ -7026,6 +7122,10 @@
			statement.setInt(35, isNoble() ? 1 :0);
			statement.setLong(36, 0);
			statement.setLong(37,getCreateTime());
+			statement.setInt(38, 0);

			statement.executeUpdate();
			statement.close();
@@ -7224,6 +7324,16 @@
				// Language
				player.setLang(rset.getString("language"));

+				player.setMoreSlot(rset.getInt("moreslot"));
+				

				// Retrieve the name and ID of the other characters assigned to this account.
				PreparedStatement stmt = con.prepareStatement("SELECT charId, char_name FROM characters WHERE account_name=? AND charId<>?");
				stmt.setString(1, player._accountName);
@@ -7665,7 +7775,11 @@
			statement.setInt(50, getBookMarkSlot());
			statement.setInt(51, getVitalityPoints());
			statement.setString(52, getLang());
-			statement.setInt(53, getObjectId());
+			statement.setInt(53, getMoreSlot());
+			statement.setInt(54, getObjectId());

			statement.execute();
			statement.close();
@@ -12206,56 +12342,98 @@
	{
		int ivlim;
		if (isGM())
-			ivlim = Config.INVENTORY_MAXIMUM_GM;
+			ivlim = Config.INVENTORY_MAXIMUM_GM + _moreslot;
		else if (getRace() == Race.Dwarf)
-			ivlim = Config.INVENTORY_MAXIMUM_DWARF;
+			ivlim = Config.INVENTORY_MAXIMUM_DWARF + _moreslot;
		else
-			ivlim = Config.INVENTORY_MAXIMUM_NO_DWARF;
+			ivlim = Config.INVENTORY_MAXIMUM_NO_DWARF + _moreslot;
		ivlim += (int)getStat().calcStat(Stats.INV_LIM, 0, null, null);

		return ivlim;
	}

+	public void setMoreSlot(int quantity)
+	{
+		_moreslot += quantity;
+	}
+	
+	public int getMoreSlot()
+	{
+		return _moreslot;
+	}
+	

 

Let data\scripts\handlers\voicedcommandhandlers -> and create a file called slotinventario.java and 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 handlers.voicedcommandhandlers;

import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.clientpackets.Say2;
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
import com.l2jserver.gameserver.network.serverpackets.ExPrivateStoreSetWholeMsg;
import com.l2jserver.gameserver.network.serverpackets.ExStorageMaxCount;
import com.l2jserver.gameserver.network.serverpackets.SocialAction;

/**
* @author Lobillo
*/
public class slotinventario implements IVoicedCommandHandler
{
private static final String[] _voicedCommands =
{
	"buyslot"
};

/**
 * 
 * @see com.l2jserver.gameserver.handler.IVoicedCommandHandler#useVoicedCommand(java.lang.String, com.l2jserver.gameserver.model.actor.instance.L2PcInstance, java.lang.String)
 */
public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)
{
	if (command.equalsIgnoreCase("buyslot"))
		{
		if (activeChar.getLevel() < 40)
		{
                CreatureSay e = new CreatureSay(activeChar.getObjectId(), Say2.PARTY, "NAME", "Tienes que ser LvL 40 o mas!");
                activeChar.sendPacket( e );
                return true;
		}
		else if(activeChar.getInventory().getItemByItemId(3470) != null && activeChar.getInventory().getItemByItemId(3470).getCount() >= 100)
		{	
		activeChar.getInventory().destroyItemByItemId("buyslot", 3470, 100, activeChar, activeChar.getTarget());
		activeChar.setMoreSlot(20);
		activeChar.sendPacket(new ExStorageMaxCount(activeChar));
		activeChar.sendPacket(new ExPrivateStoreSetWholeMsg(activeChar));
		activeChar.broadcastPacket(new SocialAction(activeChar,2122));
		CreatureSay i = new CreatureSay(activeChar.getObjectId(), Say2.BATTLEFIELD, "NAME", "Tienes +20 Slots en el Inventario!");
		activeChar.broadcastUserInfo();
		activeChar.sendPacket( i );
	}
		else
            {
			CreatureSay o = new CreatureSay(activeChar.getObjectId(), Say2.TELL, "NAME", "Tienes que tener 100 Event-Apiga!");
                activeChar.sendPacket( o );
			return true;
            }
	}
	return true;
}

/**
 * 
 * @see com.l2jserver.gameserver.handler.IVoicedCommandHandler#getVoicedCommandList()
 */
public String[] getVoicedCommandList()
{
	return _voicedCommands;
}
}

 

Let data\scripts\handlers -> and edit the file -> MasterHandler.java

 


import handlers.voicedcommandhandlers.stats;
+import handlers.voicedcommandhandlers.slotinventario;

+		VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new slotinventario());
	VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new stats());

 

SQL Create a SQL file and get this and add it to navicat

 

ALTER TABLE characters
ADD moreslot int(10) NOT NULL DEFAULT 0

 

and finally you have to put .buyslot

 

Creaditos -> Lobillo

 

Posted

u can change this:

else if(activeChar.getInventory().getItemByItemId(3470) != null && activeChar.getInventory().getItemByItemId(3470).getCount() >= 100)

 

with this:

 

else if(activeChar.getInventory().destroyItemByItemId("buyslot", 3470, 100, activeChar, activeChar.getTarget()))

 

 

also why every1 is adding everything to characters table? ech

Posted

You can also put without adding it to the table but then when you restart it puts the normal inventory sete

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • GX-Ext Which file of the svn files should i edit to make blow skills to have 100% chance so i can add the settings in the IlExt.ini? because when im changing it from the skilldata.txt it just helps
    • L2REBORN x10  l2reborn x1   LU4 MASTERWORRK BOHPTS - TOP PRICE discord - adver745645
    • 我们感谢您的 反馈 并希望让服务变得更加 优秀! 如果您使用过我们的服务并愿意分享您的体验(任何体验——积极或建设性),请在Trustpilot上留下评价,并获得$1作为感谢。 链接: https://www.trustpilot.com/review/socnet.pro 如何获得奖励: 1. 前往Trustpilot并留下您的评价 2. 向我们发送发布确认截图,以及带有与评价用户名一致的授权账户截图。 3. 指定哪个商店应收到这 $1 奖励。根据商店不同,可能需要您的用户名/电子邮箱。 您的反馈帮助我们成长,并让项目对社区中的每一位成员变得更好。感谢您与我们同行! 条款: 此活动仅适用于一个唯一用户。不允许多账号行为。 项目有效链接: 数字商品商店(网站): 前往 商店 Telegram 机器人: 前往 – 通过 Telegram 方便访问商店。 虚拟号码服务: 前往 用于购买 Telegram Stars 的 Telegram 机器人: 前往 – 在 Telegram 中快捷且优惠地购买 Stars。 SMM 面板: 前往 – 推广您的社交媒体账户。 我们想向您展示当前的 促销和特别优惠列表 用于购买我们提供的产品与服务: 1. 您可在首次购买时使用优惠码:SOCNET(15% 折扣) 2. 获得 $1 商店余额或 10–20% 折扣——只需在我们网站注册后,按照模板填写您的用户名:“SEND ME BONUS, MY USERNAME IS...”并在我们的论坛主题中发布! 3. 首次启动 SMM 面板可获得 $1:只需在我们的网站(Support)提交主题为 “Get Trial Bonus” 的工单。 4. 我们的 Telegram 频道以及 Stars 购买机器人中每周都有 Telegram Stars 抽奖! 新闻: ➡ Telegram 频道: https://t.me/accsforyou_shop ➡ WhatsApp 频道: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器: https://discord.gg/y9AStFFsrh 联系方式与支持: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • 我们感谢您的 反馈 并希望让服务变得更加 优秀! 如果您使用过我们的服务并愿意分享您的体验(任何体验——积极或建设性),请在Trustpilot上留下评价,并获得$1作为感谢。 链接: https://www.trustpilot.com/review/socnet.pro 如何获得奖励: 1. 前往Trustpilot并留下您的评价 2. 向我们发送发布确认截图,以及带有与评价用户名一致的授权账户截图。 3. 指定哪个商店应收到这 $1 奖励。根据商店不同,可能需要您的用户名/电子邮箱。 您的反馈帮助我们成长,并让项目对社区中的每一位成员变得更好。感谢您与我们同行! 条款: 此活动仅适用于一个唯一用户。不允许多账号行为。 项目有效链接: 数字商品商店(网站): 前往 商店 Telegram 机器人: 前往 – 通过 Telegram 方便访问商店。 虚拟号码服务: 前往 用于购买 Telegram Stars 的 Telegram 机器人: 前往 – 在 Telegram 中快捷且优惠地购买 Stars。 SMM 面板: 前往 – 推广您的社交媒体账户。 我们想向您展示当前的 促销和特别优惠列表 用于购买我们提供的产品与服务: 1. 您可在首次购买时使用优惠码:SOCNET(15% 折扣) 2. 获得 $1 商店余额或 10–20% 折扣——只需在我们网站注册后,按照模板填写您的用户名:“SEND ME BONUS, MY USERNAME IS...”并在我们的论坛主题中发布! 3. 首次启动 SMM 面板可获得 $1:只需在我们的网站(Support)提交主题为 “Get Trial Bonus” 的工单。 4. 我们的 Telegram 频道以及 Stars 购买机器人中每周都有 Telegram Stars 抽奖! 新闻: ➡ Telegram 频道: https://t.me/accsforyou_shop ➡ WhatsApp 频道: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器: https://discord.gg/y9AStFFsrh 联系方式与支持: ➡ 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