Jump to content
  • 0

[Help]Need script pls help immediately :/


Suzi

Question

Hey guys can any1 add me script of command which open reagent pouch(you know those quest items from suplear of reagents quest). I need command which help player open them fast he write and them open immediately(for example .openreagentpouch 500, 500 is the number how much reagent pouch must be opened). Because know they are using autoclickers and thats causing server lag :/ pls help me asap  :-\

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

untested

package handlers.voicedcommandhandlers;

import com.l2jserver.gameserver.datatables.SkillTable;
import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
import com.l2jserver.gameserver.model.L2ItemInstance;
import com.l2jserver.gameserver.model.L2Object;
import com.l2jserver.gameserver.model.L2Skill;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;

/**
* @author BiggBoss
*
*/
public class OpenItem implements IVoicedCommandHandler 
{
private static final String[] CMD = {"openitems"};
private static final int REAGENT = 6007; 

@Override
public String[] getVoicedCommandList() 
{
	return CMD;
}

@Override
public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params) 
{
	if(activeChar == null) 
		return false;

	L2ItemInstance reagent = activeChar.getInventory().getItemByItemId(REAGENT);

	if(reagent == null)
		return false;

	L2ItemInstance[] reagents = activeChar.getInventory().getAllItemsByItemId(REAGENT);

	if(command.startsWith("openitems"))
	{
		activeChar.sendMessage("Usage: .openitems <amount>");
		long val = Long.valueOf(command.split(" ")[1]);

		if(reagents.length < val)
			val = reagents.length;

		for(int i = 0; i < val + 1; ++i)
		{
			L2Skill sk = SkillTable.getInstance().getInfo(2174, 1);
			sk.useSkill(activeChar, new L2Object[]{activeChar});
		}	
	}
	return false;
}

}

Link to comment
Share on other sites

  • 0

But then nothing more happend only that message and no reagent pouches are opened what I need to fix then? :/

 

it uses a skill to open it maybe you dont have that skill?check your skill with skillId 2174

Link to comment
Share on other sites

  • 0

I checked there is skill for open reagent puoch but it doesn't open it I don't understand why?

 

Here's the code from my skills:

 

<skill id="2174" levels="3" name="Ingredient Bag">

<set name="itemConsumeCount" val="1" />

<set name="target" val="TARGET_SELF" />

<set name="skillType" val="EXTRACTABLE" />

<set name="operateType" val="OP_ACTIVE" />

<cond msgId="129">

<and>

<player invSize="10" />

<player weight="80" />

</and>

</cond>

</skill>

Link to comment
Share on other sites

  • 0

I checked there is skill for open reagent puoch but it doesn't open it I don't understand why?

 

Here's the code from my skills:

 

<skill id="2174" levels="3" name="Ingredient Bag">

<set name="itemConsumeCount" val="1" />

<set name="target" val="TARGET_SELF" />

<set name="skillType" val="EXTRACTABLE" />

<set name="operateType" val="OP_ACTIVE" />

<cond msgId="129">

<and>

<player invSize="10" />

<player weight="80" />

</and>

</cond>

</skill>

 

skill have 3 lvls in b1ggboss's code its use lvl 1 try to change this

 

L2Skill sk = SkillTable.getInstance().getInfo(2174, 1);

 

to

 

L2Skill sk = SkillTable.getInstance().getInfo(2174, 3);

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.



×
×
  • 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