Jump to content

andy1984

Members
  • Posts

    43
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by andy1984

  1. On 4/30/2024 at 2:57 AM, luzzifer said:

    Hello, I am adapting it to acis 401, and when I run it in the game it tells me:

    No rights defined for admin command 'admin_search'.
    Admin tried to use admin command 'admin_search', but has no access to use it.

     

    Also try to adapt it in AdminAdmin.java with else in the last lines using it as admin_buscar (buscar = search in spanish)
    and I get the same error:
    No rights defined for admin command 'admin_buscar'.
    Admin tried to use admin command 'admin_search', but has no access to use it.


    I have the AdminSearch.java like this:

    package net.sf.l2j.gameserver.handler.admincommandhandlers;
    
    import java.util.Arrays;
    import java.util.List;
    import java.util.StringTokenizer;
    
    import net.sf.l2j.commons.lang.StringUtil;
    import net.sf.l2j.commons.math.MathUtil;
    
    import net.sf.l2j.gameserver.data.xml.ItemData;
    import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
    import net.sf.l2j.gameserver.model.WorldObject;
    import net.sf.l2j.gameserver.model.actor.Player;
    import net.sf.l2j.gameserver.model.item.kind.Item;
    import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
    
    public class AdminSearch implements IAdminCommandHandler
    {
    	private static final String[] ADMIN_COMMANDS =
    	{
    		"admin_search"
    	};
    	private static final int PAGE_LIMIT = 15;
    	
    	@Override
    	public void useAdminCommand(String command, Player activeChar)
    	{
    		if (command.startsWith("admin_search"))
    		{
    			StringTokenizer st = new StringTokenizer(command, " ");
    			st.nextToken();
    			
    			if (!st.hasMoreTokens())
    			{
    				final NpcHtmlMessage html = new NpcHtmlMessage(0);
    				html.setFile("data/html/admin/search.htm");
    				html.replace("%items%", "");
    				html.replace("%pages%", "");
    				activeChar.sendPacket(html);
    				
    			}
    			else
    			{
    				final String item = st.nextToken();
    				int page = 1;
    				if (st.hasMoreTokens())
    				{
    					
    					try
    					{
    						page = Integer.parseInt(st.nextToken());
    					}
    					catch (NumberFormatException e)
    					{
    						page = 1;
    					}
    				}
    				results(activeChar, item, page);
    			}
    		}
    		return;
    	}
    	
    	private static void results(Player activeChar, String item, int page)
    	{
    		final NpcHtmlMessage html = new NpcHtmlMessage(0);
    		html.setFile("data/html/admin/search.htm");
    		
    		//List<Item> items = new ArrayList<>();//no sirvio
    		List<Object> items = Arrays.asList(ItemData.getInstance().getAllItems());
    		
    		for (Object itemName : items)
    			if (itemName != null)
    				if (((WorldObject) itemName).getName().toLowerCase().contains(item.toLowerCase()))
    					items.add(itemName);
    				
    		if (items.isEmpty())
    		{
    			html.replace("%items%", "<tr><td>No items found with word " + item + ".</td></tr>");
    			html.replace("%pages%", "");
    			activeChar.sendPacket(html);
    			return;
    		}
    		
    		final int max = Math.min(100, MathUtil.countPagesNumber(items.size(), PAGE_LIMIT));
    		items = items.subList((page - 1) * PAGE_LIMIT, Math.min(page * PAGE_LIMIT, items.size()));
    		
    		final StringBuilder sb = new StringBuilder();
    		
    		for (Object itemName : items)
    		{
    			String actualName = getFontedWord(item, ((WorldObject) itemName).getName());
    			StringUtil.append(sb, "<tr><td>", actualName, " (", ((Item) itemName).getItemId(), ")", "</td></tr>");
    		}
    		html.replace("%items%", sb.toString());
    		
    		sb.setLength(0);
    		
    		for (int i = 0; i < max; i++)
    		{
    			final int pagenr = i + 1;
    			if (page == pagenr)
    				StringUtil.append(sb, pagenr, "&nbsp;");
    			else
    				StringUtil.append(sb, "<a action=\"bypass -h admin_search ", item, " ", pagenr, "\">", pagenr, "</a>&nbsp;");
    			
    		}
    		
    		html.replace("%pages%", sb.toString());
    		activeChar.sendPacket(html);
    	}
    	
    	private static String getFontedWord(String word, String tt)
    	{
    		
    		int position = tt.toLowerCase().indexOf(word.toLowerCase());
    		StringBuilder str = new StringBuilder(tt);
    		
    		String font = "<FONT COLOR=\"LEVEL\">";
    		str.insert(position, font);
    		str.insert(position + (font.length() + word.length()), "</FONT>");
    		
    		return str.toString();
    	}
    	
    	@Override
    	public String[] getAdminCommandList()
    	{
    		return ADMIN_COMMANDS;
    	}
    }

    Can someone give me a hand and tell me what I'm doing wrong?

     

    add <aCar name="admin_search" accessLevel="7" params="" desc=""/> to data/xml/adminCommands

    • Like 1
  2. RequestGiveNickName() packet

     

    find:

    // Noblesse can bestow a title to themselves
            if (player.isNoble() && _name.matches(player.getName()))
            {
                player.setTitle(_title);
                player.sendPacket(SystemMessageId.TITLE_CHANGED);
                player.broadcastTitleInfo();
            }
            else
            {
                // Can the player change/give a title?
                if (!player.hasClanPrivileges(Clan.CP_CL_GIVE_TITLE))
                {
                    player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
                    return;
                }
                
                if (player.getClan().getLevel() < 3)
                {
                    player.sendPacket(SystemMessageId.CLAN_LVL_3_NEEDED_TO_ENDOWE_TITLE);
                    return;
                }
                
                final ClanMember member = player.getClan().getClanMember(_name);
                if (member != null)
                {
                    final Player playerMember = member.getPlayerInstance();
                    if (playerMember != null)
                    {
                        playerMember.setTitle(_title);
                        
                        playerMember.sendPacket(SystemMessageId.TITLE_CHANGED);
                        if (player != playerMember)
                            player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.CLAN_MEMBER_S1_TITLE_CHANGED_TO_S2).addCharName(playerMember).addString(_title));
                        
                        playerMember.broadcastTitleInfo();
                    }
                    else
                        player.sendPacket(SystemMessageId.TARGET_IS_NOT_FOUND_IN_THE_GAME);
                }
                else
                    player.sendPacket(SystemMessageId.TARGET_MUST_BE_IN_CLAN);
            }

     

    and replace with

     

    // Noblesse can bestow a title to themselves
            if (player.isNoble() && _name.matches(player.getName()))
            {
                player.sendMessage("Titles are disabled.");    
                return;
            }
            else
            {
                player.sendMessage("Titles are disabled.");    
                return;
            }

     

    not tested but should work

     

     

  3. 0    9373    1    1    7    1    0    vCt1LineageWeapons.dynasty_blade_m00_wp    Ct1LineageWeapons.dynasty_blade_m00_wp        ct1LineageWeaponsTex.dynasty_blade_wp    ct1LineageWeaponsTex.dynasty_blade_wp        icon.weapon_dual_sword_i00    ct1icon.weapon_dynasty_blade_i01    ct1icon.weapon_dynasty_blade_i01            95    2080    51    1    0    14    3    2    Ct1LineageWeapons.dynasty_blade_m00_wp    Ct1LineageWeapons.dynasty_blade_m00_wp    2    ct1LineageWeaponsTex.dynasty_blade_wp    ct1LineageWeaponsTex.dynasty_blade_wp        4    ItemSound.public_sword_shing_8    ItemSound.sword_great_4    ItemSound.sword_mid_2    ItemSound.public_sword_shing_4    ItemSound.itemdrop_sword    ItemSound.itemequip_sword        10    525    202    8    5    8    0    0    0    0    325    0    1    1    1000    0    -1    0    LineageEffect.e_u092_a    LineageEffect.e_u092_a    0.000000    0.000000    0.000000    0.000000    0.000000    0.000000    1.000000    1.000000    1.300000    1.300000    LineageWeapons.rangesample    LineageWeapons.rangesample    1.450000    0.800000    0.800000    1.450000    0.800000    0.800000    13.000000    0.000000    0.000000    13.000000    0.000000    0.000000    7    7    -1    -1                
     

    tag    id    drop_type    drop_anim_type    drop_radius    drop_height    UNK_0    drop_mesh1    drop_mesh2    drop_mesh3    drop_tex1    drop_tex2    drop_tex3    icon[0]    icon[1]    icon[2]    icon[3]    icon[4]    durability    weight    material    crystallizable    projectile_?    body_part    handness    wpn_mesh_cnt    wpn_mesh[0]    wpn_mesh[1]    wpn_tex_cnt    wpn_tex[0]    wpn_tex[1]    wpn_tex[2]    item_sound_cnt    item_sound[0]    item_sound[1]    item_sound[2]    item_sound[3]    drop_sound    equip_sound    effect    random_damage    patt    matt    weapon_type    crystal_type    critical    hit_mod    avoid_mod    shield_pdef    shield_rate    speed    mp_consume    SS_count    SPS_count    curvature    UNK_2    is_hero    UNK_3    effA    effB    junk1A[0]    junk1A[1]    junk1A[2]    junk1A[3]    junk1A[4]    junk1B[0]    junk1B[1]    junk1B[2]    junk1B[3]    junk1B[4]    rangeA    rangeB    junk2A[0]    junk2A[1]    junk2A[2]    junk2A[3]    junk2A[4]    junk2A[5]    junk2B[0]    junk2B[1]    junk2B[2]    junk2B[3]    junk2B[4]    junk2B[5]    junk3[0]    junk3[1]    junk3[2]    junk3[3]    icons[0]    icons[1]    icons[2]    icons[3]
     

    as you see you need to change crystal_type to s grade. A Grade = 4, S Grade = 5

  4. me 127.0.0.1 mporeis na mpeis mono an einai sta config to idio. an valeis sta config public ip den mporeis na mpeis me 127.0.01. den exei tetoio sistima to acis einai custom. vale sta config 127.0.0.1 kai sto .ini to idio kai den koitaei oute port tpt. an den mpainei exeis kanei kapou allou lathos. episis les evales 2 kodikes. ti kodikes?

  5. Profanos kati den paei kala me to pc i to client sou. otan les restart to pc ti kanei akrivos? apla restart i mple othoni? dinei kana error? Dokimase na sviseis to client teleios kai na to peraseis clean apo to 0 kai update drivers stin karta grafikon.

  6. Hello MxC!

     

    I want to add to multisell window next to item needed count, the item count that the player have in his inventory. For ex if you need 15000 adena to buy x item price to be  like 15000 (100000000). Check image bellow.

    image.png.92d5f1ea27fbdc09a730c77ef179f17e.png

     

    I know that this is interface matter and maybe needed some core support. Anyone can give me a hand? I have decrypted and allready edited interface files for my needs. This is the last addon i would like to have.

    Thanks in advance

  7. Hello MxC
    I added a custom mail system to my acis pack that allow players to send items to each other. When they recieve an email or they login into the game and their inbox is not empty they got a message to inform them and the notification icon from default system. I managed to add into interface the command to open my customs email default page when they press it, but also the default mail window from community board opens. Can anyone guide me where to look to deactivate this? I cannot find something in MailBtnWnd.

    Thanks in advance

     

  8. Great share! I installed it on aCis 401. Note that old scheme buffer will not work after this patch so i removed it at all on my pack. The only bug that i found is in SchemeBufferManager.java on useShareCode(). if you copy a scheme from a player that have max schemes created and then you try to add it on another char it says You cannot create more tha 4 schemes etc. i found the solution.

     

    image.png.3c58aa41dce46cf0befd0c5c6b604ab0.png

    • Thanks 2
  9. again i have an error... image.png.f0f3540a3d594fd773ac64a2544e7773.png

    2 hours ago, andy1984 said:

    again i have an error... image.png.f0f3540a3d594fd773ac64a2544e7773.png

    i fixed the error but again it blocks the visual for the party members not for me. Its very weird. Seems im not able to broadcast charInfo of the party members when i use the blockAction because im using _player.getClient().getPlayer(); and _player is the user it self, not the party members. Its completely different than aCis.

  10. Hello guys!

    Im trying to add on L2 j Mobius H5 free revision a system for parties. This system is adding blue cycles on party members and red on party leader and players can also deactivate it from menu panel. i have it working 100% on acis but here im stucked. See my code bellow from acis.

     

            final Player tmp = getClient().getPlayer();

            final Party party = tmp.getParty();
            final boolean sameparty = tmp != null && party != null && party.equals(_player.getParty());
            if (tmp.getActionStatus(BlockAction.PARTY_CYCLES) != null && !tmp.getActionStatus(BlockAction.PARTY_CYCLES) && Config.ALLOW_PARTY_CYCLES && sameparty && !party.isLeader(_player) || _player.getServerWarTeam().equals("blue"))
                writeC(0x01); // team circle around feet 1= Blue, 2 = red
            else if (tmp.getActionStatus(BlockAction.PARTY_CYCLES) != null && !tmp.getActionStatus(BlockAction.PARTY_CYCLES) && Config.ALLOW_PARTY_CYCLES && sameparty && party.isLeader(_player) || _player.getServerWarTeam().equals("red"))
                writeC(0x02); // team circle around feet 1= Blue, 2 = red    
            else
                writeC(_player.getTeam().getId());

     

    the problem is that i cant found how to fix the first line.  final Player tmp = getClient().getPlayer();

    If i found how to correct this line then i will find all the rest. i know is it something stupid that i dont know because im not familiar with the pack but any help will be welcomed.

     

    Thanks in advance

     

  11. Hello. 

    I added this on aCis401 but i found some serious problems on the code. First of all i updated all sql queries and i removed the character_memo_alt (its useless) and instead i saved everything in character_memo. All custom edits on Gameclient.java caused a serious problem (WARNING on GS) when a players was logging out. I found this part useless too so i removed it. Then i removed all Tournament arenas and OutOfZoneTask (i found them useless too because all games are instanced). Another bug is :when a team is on countdown to port in, for those 10 seconds was able to register on another game. That caused serious issues if another team join the Q and could port your team on next game before you finish the active one. And last bug is with the pets. Instance is not handled upon teleport in arena so enemies cannot kill your pet. I fixed more things for sure but i don't remember something else big. 

     

    Its a very good system if you can manage to fix/update. I don't recommend it for live server as it is.

     

    Keep up.

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