Jump to content

BaM4yYy

Members
  • Posts

    26
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by BaM4yYy

  1. Hello guys i'm looking for method that i would  be able to use one id with a few ids inside for example  if i put in droplist id 9999 it will  generate random item and will drop it . like  it wont be necessary to add the items one by one in the drop list ,  i have found a code for gracia final but when i tried to put it on interlude (acis) its not working its . In the database its saying  Droplist data for undefined itemId: 9999.  Also there is no error on the Gameserver----> its saying . Loaded 63 item lists from the database.

    ....and loaded 3 combined item lists from the database. I'm using  Acis 368 rev http://prntscr.com/fdluip thats the database 
    package net.sf.l2j.gameserver.datatables;
    
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.util.StringTokenizer;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    
    import javolution.util.FastList;
    import javolution.util.FastMap;
    import net.sf.l2j.L2DatabaseFactory;
    import net.sf.l2j.commons.random.Rnd;
    
    public class ItemLists
    {
    protected static final Logger _log = Logger.getLogger(ItemLists.class.getName());
    private FastMap<String, FastList<Integer>> _itemLists;
    
    public static ItemLists getInstance()
    {
    	return SingletonHolder._instance;
    }
    
    private ItemLists()
    {
    	loadLists();
    }
    
    public void loadLists()
    {
    	_itemLists = new FastMap<String, FastList<Integer>>();
    	
    	Connection con = null;
    	try
    	{
    		con = L2DatabaseFactory.getInstance().getConnection();
    		PreparedStatement statement = con.prepareStatement("SELECT * FROM itemlists");
    		ResultSet result = statement.executeQuery();
    		
    		int count = 0;
    		
    		while (result.next())
    		{
    			String list = result.getString("list");
    			if (list == null)
    				continue;
    			
    			if (list.equalsIgnoreCase(""))
    				list = "0";
    			
    			final StringTokenizer st = new StringTokenizer(list, ";");
    			FastList<Integer> fastlist = new FastList<Integer>();
    			
    			while (st.hasMoreTokens())
    			{
    				int itemId = 0;
    				
    				try
    				{
    					itemId = Integer.parseInt(st.nextToken());
    				}
    				catch (Exception e)
    				{
    					e.printStackTrace();
    					itemId = 0;
    				}
    				
    				if (itemId != 0)
    					fastlist.addLast(itemId);
    			}
    			
    			final String name = result.getString("name");
    			
    			if (!_itemLists.containsKey(name))
    			{
    				_itemLists.put(name, fastlist);
    				count++;
    			}
    		}
    		
    		result.close();
    		statement.close();
    		
    		_log.config("Loaded " + count + " item lists from the database.");
    		
    		statement = con.prepareStatement("SELECT name, include FROM itemlists");
    		result = statement.executeQuery();
    		
    		count = 0;
    		
    		while (result.next())
    		{
    			String include = result.getString("include");
    			
    			if (include == null || include.equalsIgnoreCase("0"))
    				continue;
    			
    			final StringTokenizer st = new StringTokenizer(include, ";");
    			FastList<Integer> fastlist = new FastList<Integer>();
    			
    			while (st.hasMoreTokens())
    			{
    				int listId = 0;
    				
    				try
    				{
    					listId = Integer.parseInt(st.nextToken());
    				}
    				catch (Exception e)
    				{
    					e.printStackTrace();
    					listId = 0;
    				}
    				
    				if (listId != 0)
    				{
    					fastlist.addAll(_itemLists.get(getListName(listId)));
    				}
    			}
    			
    			_itemLists.get(result.getString("name")).addAll(fastlist);
    			count++;
    		}
    		
    		_log.config("....and loaded " + count + " combined item lists from the database.");
    	}
    	catch (Exception e)
    	{
    		_log.log(Level.SEVERE, "Error loading item lists.", e);
    	}
    	finally
    	{
    		try
    		{
    			con.close();
    		}
    		catch (Exception e)
    		{
    		}
    	}
    }
    
    public String getListName(int listId)
    {
    	int count = 1;
    	
    	if (listId > 1000000)
    		listId -= 1000000;
    	
    	for (String val : _itemLists.keySet())
    	{
    		if (count == listId)
    			return val;
    		
    		count++;
    	}
    	
    	_log.warning("getListName() of ItemLists returned null!!!!!!!!!!!");
    	return null;
    }
    
    public int generateRandomItemFromList(int listId)
    {
    	final String name = getListName(listId);
    	
    	if (name != null)
    	{
    		FastList<Integer> val = _itemLists.get(name);
    		
    		if (val != null && !val.isEmpty())
    			return val.get(Rnd.get(val.size()));
    	}
    	
    	_log.warning("generateRandomItemFromList() of ItemLists returned 0!!!!!!!!!!! list id: " + listId);
    	return 0;
    }
    
    public FastList<Integer> getFirstListByItemId(int itemId)
    {
    	for (FastList<Integer> list : _itemLists.values())
    	{
    		if (list != null && list.size() > 0)
    		{
    			if (list.contains(itemId))
    				return list;
    		}
    	}
    	
    	return null;
    }
    
    public void debug()
    {
    	System.out.println(_itemLists.toString());
    }
    
    @SuppressWarnings("synthetic-access")
    private static class SingletonHolder
    {
    protected static final ItemLists _instance = new ItemLists();
    }
    }
    
  2. check in frozen's source what tradeList is (should be a list) and then try to adapt the way it works

    well i found that code in l2skills (l2 acis )

        

    List<Creature> targetList = new ArrayList<>();

       
        // Go through the Creature knownList
        if (_skillType == L2SkillType.DUMMY)
       
        if (onlyFirst)
        return new Creature[]
        {
        activeChar
        };
       
        if (activeChar instanceof Player)

    and its work perfect :D:D i dont know if its right or not but there is not error in eclipse neither in game server and its working fine in game thanks buddy ^^ 

  3. with small changes on the code it work perfect on acis 361 rev.

    tested

     

    
    
     
    + if (isAutoPot(728))
    + {
    + sendPacket(new ExAutoSoulShot(728, 0));
    + setAutoPot(728, null, false);
    + }
    + if (isAutoPot(1539))
    + {
    + sendPacket(new ExAutoSoulShot(1539, 0));
    + setAutoPot(1539, null, false);
    + }
    + if (isAutoPot(5592))
    + {
    + sendPacket(new ExAutoSoulShot(5592, 0));
    + setAutoPot(5592, null, false);
    +

     

    Bro do u know on which line the code should be on cuz i didn't find this @@ -4321,6 +4339,22 @@

      teleToLocation(184351, 20318, -3174, 0);
      }

    .

    Thank u in advance

     

     

     

    PS: All good thank u anyway ^^

  4. okey thanks and one more question when i trying to Compiled  it  i take error :

     

    BUILD FAILED

    C:\Users\DarkY\workspace\L2jFrozen_GameServer\build.xml:64: Compile failed; see the compiler error output for details.

    and details are that -->

    <javac destdir="${build.classes}" optimize="on" debug="on" source="1.6" target="1.6" encoding="utf-8" nowarn="off">

  5. He's from bulgaria and server is realy sucks better open beta and try with other features

    LoL first try  to test  server , then said "this server is sucks" i'm not here to listens your bad words about server
  6. First server's is not old, second server's is on one day old, 3 Connection with server is very good

    about

    *homemade* >> dedicated gaming servers do not ever had those graphic cards xD

    Also,if servers connection is good is maybe because our friend(the owner of the pc) lives near his internet company node(GR*node=κομβος) !

    another 1-week-before-joining-the-closing-servers-department

    Don't worry server's will live's long year's,  second i can say that graphic cards its  very cool for server

  7. Welcome To L2-Pure Enjoy NOW

    Rates

    Server Rates: 3000x Xp 3000x Sp 1x Adena

     

    -== Enchant ==-

    Crystal Scroll: 95%

    Normal Scrolls: 65%

    Bless Scroll : 95%

    Maximum: +25

    Safe: +4

     

    ******************************

    Server status: - Interlude PvP server Server :)

    ******************************

    #Working Hero Status

    #Working Nobles System

    #C1/C2/C3/C4/C5/Interlude/(all skills working) Symbol too

    #Cursed Weapons: Zariche / Blood Sword of Akamash

    #Auto Learn Skills

    #No Grade Penalty

    #NO Weight Penalty

    #9h Buffs

    --------------------

    ----------------------------

    #Custom GM Shop

    #Custom GateKeepers

    #Custom NPC Buffer (12h duration - all buffs)

    #Custom NPC Skills Enchanter

    #Custom No Custom Item Only Mask and Tattos

    #Llife stone System Work

    #Custom Wedding Priest

    #Custom Hero item's                                                          And meny more Enjoy now ;)

    *********************************

    $No donations

    $Subclass system - 3 non stack subclass

     

    *********************************

    -----------------------------------------

    -== Events ==-

     

    Auto Events: Team Vs Team (Auto evry 1h)

    Auto Events: CTF Event (Admin/GM Activation)

    Auto Events: DeathMatch (Admin/GM Activation)

    -----------------------------------------

     

    *********************************

    #Machine Who Support This Server Have 12 Gb Ram

    #Video CARD: Nvidia GeForce 9600  1024/1024MB

    #Download: 64mb/s and Upload: 32/4mb

                                                       Join on our server Good luck Have fun :)

    by:L2-Pure Teams..

    WebSite: http://L2-Pure.tk/

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