Преглед на файлове

BETA: Core part for [DP9399]
Reviewed by: !UnAfraid

malyelfik преди 12 години
родител
ревизия
035175975d

+ 0 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/GameServer.java

@@ -56,7 +56,6 @@ import com.l2jserver.gameserver.datatables.ExperienceTable;
 import com.l2jserver.gameserver.datatables.FishData;
 import com.l2jserver.gameserver.datatables.FishingMonstersData;
 import com.l2jserver.gameserver.datatables.FishingRodsData;
-import com.l2jserver.gameserver.datatables.HelperBuffTable;
 import com.l2jserver.gameserver.datatables.HennaData;
 import com.l2jserver.gameserver.datatables.HerbDropTable;
 import com.l2jserver.gameserver.datatables.HitConditionBonus;
@@ -301,7 +300,6 @@ public class GameServer
 		PartyMatchWaitingList.getInstance();
 		PartyMatchRoomList.getInstance();
 		PetitionManager.getInstance();
-		HelperBuffTable.getInstance();
 		AugmentationData.getInstance();
 		CursedWeaponsManager.getInstance();
 		

+ 0 - 209
L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/HelperBuffTable.java

@@ -1,209 +0,0 @@
-/*
- * Copyright (C) 2004-2013 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server 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.
- * 
- * L2J Server 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 com.l2jserver.gameserver.datatables;
-
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.Statement;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javolution.util.FastList;
-
-import com.l2jserver.L2DatabaseFactory;
-import com.l2jserver.gameserver.model.L2HelperBuff;
-import com.l2jserver.gameserver.model.StatsSet;
-
-/**
- * This class represents the Newbie Helper Buff list
- * @author Ayor
- */
-public class HelperBuffTable
-{
-	private static Logger _log = Logger.getLogger(HelperBuffTable.class.getName());
-	
-	/** The table containing all Buff of the Newbie Helper */
-	private final List<L2HelperBuff> _helperBuff;
-	
-	/**
-	 * The player level since Newbie Helper can give the fisrt buff <BR>
-	 * Used to generate message : "Come back here when you have reached level ...")
-	 */
-	private int _magicClassLowestLevel = 100;
-	private int _physicClassLowestLevel = 100;
-	
-	/**
-	 * The player level above which Newbie Helper won't give any buff <BR>
-	 * Used to generate message : "Only novice character of level ... or less can receive my support magic.")
-	 */
-	private int _magicClassHighestLevel = 1;
-	private int _physicClassHighestLevel = 1;
-	
-	private int _servitorLowestLevel = 100;
-	
-	private int _servitorHighestLevel = 1;
-	
-	public static HelperBuffTable getInstance()
-	{
-		return SingletonHolder._instance;
-	}
-	
-	/**
-	 * Create and Load the Newbie Helper Buff list from SQL Table helper_buff_list
-	 */
-	protected HelperBuffTable()
-	{
-		_helperBuff = new FastList<>();
-		restoreHelperBuffData();
-		
-	}
-	
-	/**
-	 * Read and Load the Newbie Helper Buff list from SQL Table helper_buff_list
-	 */
-	private void restoreHelperBuffData()
-	{
-		try (Connection con = L2DatabaseFactory.getInstance().getConnection();
-			Statement s = con.createStatement();
-			ResultSet HelperBuffData = s.executeQuery("SELECT * FROM helper_buff_list"))
-		{
-			while (HelperBuffData.next())
-			{
-				StatsSet helperBuffDat = new StatsSet();
-				int id = HelperBuffData.getInt("id");
-				
-				helperBuffDat.set("id", id);
-				helperBuffDat.set("skillID", HelperBuffData.getInt("skill_id"));
-				helperBuffDat.set("skillLevel", HelperBuffData.getInt("skill_level"));
-				helperBuffDat.set("lowerLevel", HelperBuffData.getInt("lower_level"));
-				helperBuffDat.set("upperLevel", HelperBuffData.getInt("upper_level"));
-				helperBuffDat.set("isMagicClass", HelperBuffData.getString("is_magic_class"));
-				helperBuffDat.set("forSummon", HelperBuffData.getString("forSummon"));
-				
-				// Calulate the range level in wich player must be to obtain buff from Newbie Helper
-				if ("false".equals(HelperBuffData.getString("is_magic_class")))
-				{
-					if (HelperBuffData.getInt("lower_level") < _physicClassLowestLevel)
-					{
-						_physicClassLowestLevel = HelperBuffData.getInt("lower_level");
-					}
-					
-					if (HelperBuffData.getInt("upper_level") > _physicClassHighestLevel)
-					{
-						_physicClassHighestLevel = HelperBuffData.getInt("upper_level");
-					}
-				}
-				else
-				{
-					if (HelperBuffData.getInt("lower_level") < _magicClassLowestLevel)
-					{
-						_magicClassLowestLevel = HelperBuffData.getInt("lower_level");
-					}
-					
-					if (HelperBuffData.getInt("upper_level") > _magicClassHighestLevel)
-					{
-						_magicClassHighestLevel = HelperBuffData.getInt("upper_level");
-					}
-				}
-				if ("true".equals(HelperBuffData.getString("forSummon")))
-				{
-					if (HelperBuffData.getInt("lower_level") < _servitorLowestLevel)
-					{
-						_servitorLowestLevel = HelperBuffData.getInt("lower_level");
-					}
-					
-					if (HelperBuffData.getInt("upper_level") > _servitorHighestLevel)
-					{
-						_servitorHighestLevel = HelperBuffData.getInt("upper_level");
-					}
-				}
-				// Add this Helper Buff to the Helper Buff List
-				L2HelperBuff template = new L2HelperBuff(helperBuffDat);
-				_helperBuff.add(template);
-			}
-			_log.info(getClass().getSimpleName() + ": Loaded " + _helperBuff.size() + " Templates.");
-		}
-		catch (Exception e)
-		{
-			_log.log(Level.SEVERE, getClass().getSimpleName() + ": Table helper_buff_list not found : Update your DataPack! Error : " + e.getMessage(), e);
-		}
-	}
-	
-	/**
-	 * @return the Helper Buff List
-	 */
-	public List<L2HelperBuff> getHelperBuffTable()
-	{
-		return _helperBuff;
-	}
-	
-	/**
-	 * @return Returns the magicClassHighestLevel.
-	 */
-	public int getMagicClassHighestLevel()
-	{
-		return _magicClassHighestLevel;
-	}
-	
-	/**
-	 * @return Returns the magicClassLowestLevel.
-	 */
-	public int getMagicClassLowestLevel()
-	{
-		return _magicClassLowestLevel;
-	}
-	
-	/**
-	 * @return Returns the physicClassHighestLevel.
-	 */
-	public int getPhysicClassHighestLevel()
-	{
-		return _physicClassHighestLevel;
-	}
-	
-	/**
-	 * @return Returns the physicClassLowestLevel.
-	 */
-	public int getPhysicClassLowestLevel()
-	{
-		return _physicClassLowestLevel;
-	}
-	
-	/**
-	 * @return Returns the servitorLowestLevel.
-	 */
-	public int getServitorLowestLevel()
-	{
-		return _servitorLowestLevel;
-	}
-	
-	/**
-	 * @return Returns the servitorHighestLevel.
-	 */
-	public int getServitorHighestLevel()
-	{
-		return _servitorHighestLevel;
-	}
-	
-	private static class SingletonHolder
-	{
-		protected static final HelperBuffTable _instance = new HelperBuffTable();
-	}
-}

+ 0 - 123
L2J_Server_BETA/java/com/l2jserver/gameserver/model/L2HelperBuff.java

@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2004-2013 L2J Server
- * 
- * This file is part of L2J Server.
- * 
- * L2J Server 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.
- * 
- * L2J Server 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 com.l2jserver.gameserver.model;
-
-/**
- * This class represents a Newbie Helper Buff Author: Ayor
- */
-
-public class L2HelperBuff
-{
-	/** Min level that the player must achieve to obtain this buff from Newbie Helper */
-	private final int _lowerLevel;
-	
-	/** Max level that the player mustn't exceed if it want to obtain this buff from Newbie Helper */
-	private final int _upperLevel;
-	
-	/** Identifier of the skill (buff) that the Newbie Helper must cast */
-	private final int _skillID;
-	
-	/** Level of the skill (buff) that the Newbie Helper must cast */
-	private final int _skillLevel;
-	
-	/**
-	 * If True only Magus class will obtain this Buff <BR>
-	 * If False only Fighter class will obtain this Buff
-	 */
-	private boolean _isMagicClass;
-	
-	private boolean _forSummon = false;
-	
-	/**
-	 * Constructor of L2HelperBuff.
-	 * @param set
-	 */
-	public L2HelperBuff(StatsSet set)
-	{
-		
-		_lowerLevel = set.getInteger("lowerLevel");
-		_upperLevel = set.getInteger("upperLevel");
-		_skillID = set.getInteger("skillID");
-		_skillLevel = set.getInteger("skillLevel");
-		if ("true".equals(set.getString("forSummon")))
-		{
-			_forSummon = true;
-		}
-		
-		if ("false".equals(set.getString("isMagicClass")))
-		{
-			_isMagicClass = false;
-		}
-		else
-		{
-			_isMagicClass = true;
-		}
-		
-	}
-	
-	/**
-	 * Returns the lower level that the L2PcInstance must achieve in order to obtain this buff
-	 * @return int
-	 */
-	public int getLowerLevel()
-	{
-		return _lowerLevel;
-	}
-	
-	/**
-	 * Returns the upper level that the L2PcInstance mustn't exceed in order to obtain this buff
-	 * @return int
-	 */
-	public int getUpperLevel()
-	{
-		return _upperLevel;
-	}
-	
-	/**
-	 * Returns the ID of the buff that the L2PcInstance will receive
-	 * @return int
-	 */
-	public int getSkillID()
-	{
-		return _skillID;
-	}
-	
-	/**
-	 * Returns the Level of the buff that the L2PcInstance will receive
-	 * @return int
-	 */
-	public int getSkillLevel()
-	{
-		return _skillLevel;
-	}
-	
-	/**
-	 * Returns if this Buff can be cast on a fighter or a mystic
-	 * @return boolean : False if it's a fighter class Buff
-	 */
-	public boolean isMagicClassBuff()
-	{
-		return _isMagicClass;
-	}
-	
-	public boolean isForSummon()
-	{
-		return _forSummon;
-	}
-}