Jump to content
  • 0

[-Table-]*Premium Teleport


Question

Posted

I try to make individual zones for premium. And i try to add in table Teleport, tab Premium, like fornoble. I make setting in

L2TeleportLocation.java

public void setIsPremium(boolean val)
	{
		_premiumService = val;
	}

+++

private boolean _premiumService;

+++ 

public boolean IsPremium()
	{
		return _premiumService;
	}

TeleportLocationTable.java

 

public void reloadAll()
	{
		_teleports.clear();
		try (Connection con = L2DatabaseFactory.getInstance().getConnection();
			Statement s = con.createStatement();
			ResultSet rs = s.executeQuery("SELECT id, loc_x, loc_y, loc_z, price, fornoble, premium, itemId FROM teleport"))
		{
			L2TeleportLocation teleport;
			while (rs.next())
			{
				teleport = new L2TeleportLocation();
				
				teleport.setTeleId(rs.getInt("id"));
				teleport.setX(rs.getInt("loc_x"));
				teleport.setY(rs.getInt("loc_y"));
				teleport.setZ(rs.getInt("loc_z"));
				teleport.setPrice(rs.getInt("price"));
				teleport.setIsForNoble(rs.getInt("fornoble") == 1);
				teleport.setIsPremium(rs.getInt("premium") == 1);
				teleport.setItemId(rs.getInt("itemId"));
				
				_teleports.put(teleport.getTeleId(), teleport);
			}
			_log.info(getClass().getSimpleName() + ": Loaded " + _teleports.size() + " Teleport Location Templates.");
		}
		catch (Exception e)
		{
			_log.error(getClass().getSimpleName() + ": Error loading Teleport Table.", e);
		}
		
		if (Config.CUSTOM_TELEPORT_TABLE)
		{
			int _cTeleCount = _teleports.size();
			try (Connection con = L2DatabaseFactory.getInstance().getConnection();
				Statement s = con.createStatement();
				ResultSet rs = s.executeQuery("SELECT id, loc_x, loc_y, loc_z, price, fornoble, premium, itemId FROM custom_teleport"))
			{
				L2TeleportLocation teleport;
				while (rs.next())
				{
					teleport = new L2TeleportLocation();
					teleport.setTeleId(rs.getInt("id"));
					teleport.setX(rs.getInt("loc_x"));
					teleport.setY(rs.getInt("loc_y"));
					teleport.setZ(rs.getInt("loc_z"));
					teleport.setPrice(rs.getInt("price"));
					teleport.setIsForNoble(rs.getInt("fornoble") == 1);
					teleport.setIsPremium(rs.getInt("premium") == 1);
					teleport.setItemId(rs.getInt("itemId"));
					
					_teleports.put(teleport.getTeleId(), teleport);
				}
				_cTeleCount = _teleports.size() - _cTeleCount;
				if (_cTeleCount > 0)
				{
					_log.info(getClass().getSimpleName() + ": Loaded " + _cTeleCount + " Custom Teleport Location Templates.");
				}
			}
			catch (Exception e)
			{
				_log.warn(getClass().getSimpleName() + ": Error while creating custom teleport table " + e.getMessage(), e);
			}
		}
	}

Table Design

http://BC0LLEp.png

And in Teleports table i set premium to 1, and nothing happend

4 answers to this question

Recommended Posts

  • 0
Posted

Obviously you are doing something wrong. Highly doubt anyone will debug, explain or do it for you. There is simple logic, copy it, follow the pattern. It must work.

  • 0
Posted

"А мыши плакали и кололись, но продолжали грызть кактус.", russian metaphor.

 

I told you what you need to do for avoid stupid actions and got result w/o outside help.

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


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