Pārlūkot izejas kodu

BETA: Misc fixes:
* More fixes for [4890] and fix for #5883 ...
* Removed L2World reference from L2BirthdayCakeInstance.
* GPL and JavaDoc fixes.

'''Note:''' Please always when creating a contribution refer to previous implementations, keeping the system consistency is important aspect of developing in a open source project.

Zoey76 13 gadi atpakaļ
vecāks
revīzija
db87866f32

+ 0 - 12
L2J_Server_BETA/java/com/l2jserver/gameserver/idfactory/BitSetIDFactory.java

@@ -1,14 +1,4 @@
 /*
- * $Header: BitSetIDFactory.java, 24/08/2005 22:44:26 luisantonioa Exp $
- *
- * $Author: luisantonioa $
- * $Date: 24/08/2005 22:44:26 $
- * $Revision: 1 $
- * $Log: BitSetIDFactory.java,v $
- * Revision 1  24/08/2005 22:44:26  luisantonioa
- * Added copyright notice
- *
- *
  * This program 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
@@ -32,13 +22,11 @@ import java.util.logging.Logger;
 import com.l2jserver.gameserver.ThreadPoolManager;
 import com.l2jserver.util.PrimeFinder;
 
-
 /**
  * This class ..
  *
  * @version $Revision: 1.2 $ $Date: 2004/06/27 08:12:59 $
  */
-
 public class BitSetIDFactory extends IdFactory
 {
 	private static Logger _log = Logger.getLogger(BitSetIDFactory.class.getName());

+ 0 - 11
L2J_Server_BETA/java/com/l2jserver/gameserver/model/BlockList.java

@@ -1,14 +1,4 @@
 /*
- * $Header: BlockList.java, 21/11/2005 14:53:53 luisantonioa Exp $
- *
- * $Author: luisantonioa $
- * $Date: 21/11/2005 14:53:53 $
- * $Revision: 1 $
- * $Log: BlockList.java,v $
- * Revision 1  21/11/2005 14:53:53  luisantonioa
- * Added copyright notice
- *
- *
  * This program 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
@@ -46,7 +36,6 @@ import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
  * 
  * @version $Revision: 1.2 $ $Date: 2004/06/27 08:12:59 $
  */
-
 public class BlockList
 {
 	private static Logger _log = Logger.getLogger(BlockList.class.getName());

+ 2 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/L2Object.java

@@ -182,7 +182,8 @@ public abstract class L2Object
 		L2NpcBufferInstance(L2Npc),
 		L2TvTEventNpcInstance(L2Npc),
 		L2WeddingManagerInstance(L2Npc),
-		L2EventMobInstance(L2Npc);
+		L2EventMobInstance(L2Npc),
+		L2BirthdayCakeInstance(L2Npc);
 		
 		private final InstanceType _parent;
 		private final long _typeL;

+ 0 - 10
L2J_Server_BETA/java/com/l2jserver/gameserver/model/SpawnListener.java

@@ -1,14 +1,4 @@
 /*
- * $Header: SpawnListener.java, 7/09/2005 23:44:50 luisantonioa Exp $
- *
- * $Author: luisantonioa $
- * $Date: 7/09/2005 23:44:50 $
- * $Revision: 1 $
- * $Log: SpawnListener.java,v $
- * Revision 1  7/09/2005 23:44:50  luisantonioa
- * Added copyright notice
- *
- *
  * This program 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

+ 22 - 15
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2BirthdayCakeInstance.java

@@ -20,7 +20,6 @@ import com.l2jserver.gameserver.ThreadPoolManager;
 import com.l2jserver.gameserver.datatables.SkillTable;
 import com.l2jserver.gameserver.model.L2Party;
 import com.l2jserver.gameserver.model.L2Skill;
-import com.l2jserver.gameserver.model.L2World;
 import com.l2jserver.gameserver.model.actor.L2Character;
 import com.l2jserver.gameserver.model.actor.L2Npc;
 import com.l2jserver.gameserver.templates.chars.L2NpcTemplate;
@@ -33,26 +32,29 @@ public class L2BirthdayCakeInstance extends L2Npc
 	private static final int BIRTHDAY_CAKE_24 = 106;
 	private static final int BIRTHDAY_CAKE = 139;
 	private static L2Skill _skill;
-	private ScheduledFuture<?> _aiTask;
-	private int _masterId;
+	private final ScheduledFuture<?> _aiTask;
 	
-	public L2BirthdayCakeInstance(int objectId, L2NpcTemplate template, int masterId)
+	public L2BirthdayCakeInstance(int objectId, L2NpcTemplate template)
 	{
 		super(objectId, template);
 		
 		if (template.getNpcId() == BIRTHDAY_CAKE_24)
+		{
 			_skill = SkillTable.getInstance().getInfo(22035, 1);
+		}
 		else if (template.getNpcId() == BIRTHDAY_CAKE)
+		{
 			_skill = SkillTable.getInstance().getInfo(22250, 1);
-		
-		_masterId = masterId;
+		}
 		
 		_aiTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new BuffTask(this), 1000, 1000);
+		
+		setInstanceType(InstanceType.L2BirthdayCakeInstance);
 	}
 	
-	class BuffTask implements Runnable
+	private class BuffTask implements Runnable
 	{
-		L2BirthdayCakeInstance _cake;
+		private final L2BirthdayCakeInstance _cake;
 		
 		protected BuffTask(L2BirthdayCakeInstance cake)
 		{
@@ -66,29 +68,35 @@ public class L2BirthdayCakeInstance extends L2Npc
 			{
 				if (_cake.getNpcId() == BIRTHDAY_CAKE_24)
 				{
-					for(L2PcInstance player : _cake.getKnownList().getKnownPlayersInRadius(_skill.getSkillRadius()))
+					for (L2PcInstance player : _cake.getKnownList().getKnownPlayersInRadius(_skill.getSkillRadius()))
 					{
 						_skill.getEffects(_cake, player);
 					}
 				}
 				else if (_cake.getNpcId() == BIRTHDAY_CAKE)
 				{
-					L2PcInstance player = L2World.getInstance().getPlayer(_masterId);
+					final L2PcInstance player = (L2PcInstance) _cake.getSummoner();
 					if (player == null)
+					{
 						return;
+					}
 					
-					L2Party party = player.getParty();
+					final L2Party party = player.getParty();
 					if (party == null)
 					{
 						if (player.isInsideRadius(_cake, _skill.getSkillRadius(), true, true))
+						{
 							_skill.getEffects(_cake, player);
+						}
 					}
 					else
 					{
 						for (L2PcInstance member : party.getPartyMembers())
 						{
-							if (member != null && member.isInsideRadius(_cake, _skill.getSkillRadius(), true, true))
+							if ((member != null) && member.isInsideRadius(_cake, _skill.getSkillRadius(), true, true))
+							{
 								_skill.getEffects(_cake, member);
+							}
 						}
 					}
 				}
@@ -100,13 +108,12 @@ public class L2BirthdayCakeInstance extends L2Npc
 	public void deleteMe()
 	{
 		if (_aiTask != null)
+		{
 			_aiTask.cancel(true);
+		}
 		super.deleteMe();
 	}
 	
-	/* (non-Javadoc)
-	 * @see com.l2jserver.gameserver.model.L2Object#isAttackable()
-	 */
 	@Override
 	public boolean isAutoAttackable(L2Character attacker)
 	{

+ 1 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2ChestInstance.java

@@ -1,6 +1,4 @@
 /*
- *@author Julian
- *
  * This program 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
@@ -26,6 +24,7 @@ import com.l2jserver.util.Rnd;
 
 /**
  * This class manages all chest.
+ * @author Julian
  */
 public final class L2ChestInstance extends L2MonsterInstance
 {

+ 1 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2EventMonsterInstance.java

@@ -17,8 +17,7 @@ package com.l2jserver.gameserver.model.actor.instance;
 import com.l2jserver.gameserver.templates.chars.L2NpcTemplate;
 
 /**
- ** @author Gnacik
- **
+ * @author Gnacik
  */
 public class L2EventMonsterInstance extends L2MonsterInstance
 {

+ 0 - 11
L2J_Server_BETA/java/com/l2jserver/gameserver/model/base/ClassLevel.java

@@ -1,14 +1,4 @@
 /*
- * $Header: ClassLevel.java, 24/11/2005 15:56:45 luisantonioa Exp $
- *
- * $Author: luisantonioa $
- * $Date: 24/11/2005 15:56:45 $
- * $Revision: 1 $
- * $Log: ClassLevel.java,v $
- * Revision 1  24/11/2005 15:56:45  luisantonioa
- * Added copyright notice
- *
- *
  * This program 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
@@ -29,7 +19,6 @@ package com.l2jserver.gameserver.model.base;
  *
  * @version $Revision: 1.2 $ $Date: 2004/06/27 08:12:59 $
  */
-
 public enum ClassLevel
 {
 	First,

+ 0 - 10
L2J_Server_BETA/java/com/l2jserver/gameserver/model/waypoint/WayPointNode.java

@@ -1,14 +1,4 @@
 /*
- * $Header: WayPointNode.java, 20/07/2005 19:49:29 luisantonioa Exp $
- *
- * $Author: luisantonioa $
- * $Date: 20/07/2005 19:49:29 $
- * $Revision: 1 $
- * $Log: WayPointNode.java,v $
- * Revision 1  20/07/2005 19:49:29  luisantonioa
- * Added copyright notice
- *
- *
  * This program 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

+ 0 - 10
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/MultiSellList.java

@@ -1,14 +1,4 @@
 /*
- * $Header: MultiSellList.java, 2/08/2005 14:21:01 luisantonioa Exp $
- *
- * $Author: luisantonioa $
- * $Date: 2/08/2005 14:21:01 $
- * $Revision: 1 $
- * $Log: MultiSellList.java,v $
- * Revision 1  2/08/2005 14:21:01  luisantonioa
- * Added copyright notice
- *
- *
  * This program 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

+ 1 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/scripting/L2ScriptEngineManager.java

@@ -45,8 +45,7 @@ import com.l2jserver.Config;
 import com.l2jserver.script.jython.JythonScriptEngine;
 
 /**
- * Caches script engines and provides funcionality for executing and managing scripts.<BR>
- *
+ * Caches script engines and provides functionality for executing and managing scripts.
  * @author  KenM
  */
 public final class L2ScriptEngineManager