2
0
Эх сурвалжийг харах

BETA: Reworking Sweeper to use retail like effects.
* Unhardcoded Max Sweeper Time value.
* Removed !RewardItem class, replaced with !ItemHolder.
* Removed SWEEP skill type.
* Added method addItem(String, !ItemHolder, L2Object, boolean) to work with !ItemHolder.
* Removed L2SkillSweeper class.
* Changed name and logic for method checkCorpseTime(..).
* Removed L2SkillElemental class, not used anywhere.

Zoey76 12 жил өмнө
parent
commit
c1b5f01cf8

+ 2 - 0
L2J_Server_BETA/dist/game/config/NPC.properties

@@ -104,6 +104,8 @@ NpcDecayTime = 8500
 RaidBossDecayTime = 30000
 # Default: 18500
 SpoiledDecayTime = 18500
+# Default: 15000
+MaxSweeperTime = 15000
 
 # ---------------------------------------------------------------------------
 # Guards

+ 3 - 12
L2J_Server_BETA/java/com/l2jserver/Config.java

@@ -72,7 +72,6 @@ public final class Config
 	// Constants
 	// --------------------------------------------------
 	public static final String EOL = System.getProperty("line.separator");
-	
 	// --------------------------------------------------
 	// L2J Property File Definitions
 	// --------------------------------------------------
@@ -104,7 +103,6 @@ public final class Config
 	public static final String SECURITY_CONFIG_FILE = "./config/Security.properties";
 	public static final String EMAIL_CONFIG_FILE = "./config/Email.properties";
 	public static final String CH_SIEGE_FILE = "./config/ConquerableHallSiege.properties";
-	
 	// --------------------------------------------------
 	// L2J Variable Definitions
 	// --------------------------------------------------
@@ -232,7 +230,7 @@ public final class Config
 	public static int UNSTUCK_INTERVAL;
 	public static int TELEPORT_WATCHDOG_TIMEOUT;
 	public static int PLAYER_SPAWN_PROTECTION;
-	public static ArrayList<Integer> SPAWN_PROTECTION_ALLOWED_ITEMS;
+	public static List<Integer> SPAWN_PROTECTION_ALLOWED_ITEMS;
 	public static int PLAYER_TELEPORT_PROTECTION;
 	public static boolean RANDOM_RESPAWN_IN_TOWN_ENABLED;
 	public static boolean OFFSET_ON_TELEPORT_ENABLED;
@@ -258,7 +256,6 @@ public final class Config
 	public static boolean STORE_UI_SETTINGS;
 	public static String[] FORBIDDEN_NAMES;
 	public static boolean SILENCE_MODE_EXCLUDE;
-	
 	// --------------------------------------------------
 	// ClanHall Settings
 	// --------------------------------------------------
@@ -313,7 +310,6 @@ public final class Config
 	public static int CH_FRONT1_FEE;
 	public static int CH_FRONT2_FEE;
 	public static boolean CH_BUFF_FREE;
-	
 	// --------------------------------------------------
 	// Castle Settings
 	// --------------------------------------------------
@@ -344,7 +340,6 @@ public final class Config
 	public static List<String> CL_SET_SIEGE_TIME_LIST;
 	public static List<Integer> SIEGE_HOUR_LIST_MORNING;
 	public static List<Integer> SIEGE_HOUR_LIST_AFTERNOON;
-	
 	// --------------------------------------------------
 	// Fortress Settings
 	// --------------------------------------------------
@@ -368,7 +363,6 @@ public final class Config
 	public static int FS_MAX_SUPPLY_LEVEL;
 	public static int FS_FEE_FOR_CASTLE;
 	public static int FS_MAX_OWN_TIME;
-	
 	// --------------------------------------------------
 	// Feature Settings
 	// --------------------------------------------------
@@ -414,7 +408,6 @@ public final class Config
 	public static int CLAN_LEVEL_10_REQUIREMENT;
 	public static int CLAN_LEVEL_11_REQUIREMENT;
 	public static boolean ALLOW_WYVERN_DURING_SIEGE;
-	
 	// --------------------------------------------------
 	// General Settings
 	// --------------------------------------------------
@@ -658,7 +651,6 @@ public final class Config
 	public static boolean CLEAR_CREST_CACHE;
 	public static int NORMAL_ENCHANT_COST_MULTIPLIER;
 	public static int SAFE_ENCHANT_COST_MULTIPLIER;
-	
 	// --------------------------------------------------
 	// FloodProtector Settings
 	// --------------------------------------------------
@@ -678,7 +670,6 @@ public final class Config
 	public static FloodProtectorConfig FLOOD_PROTECTOR_SENDMAIL;
 	public static FloodProtectorConfig FLOOD_PROTECTOR_CHARACTER_SELECT;
 	public static FloodProtectorConfig FLOOD_PROTECTOR_ITEM_AUCTION;
-	
 	// --------------------------------------------------
 	// L2JMods Settings
 	// --------------------------------------------------
@@ -786,7 +777,6 @@ public final class Config
 	public static int L2JMOD_DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
 	public static Map<Integer, Integer> L2JMOD_DUALBOX_CHECK_WHITELIST;
 	public static boolean L2JMOD_ALLOW_CHANGE_PASSWORD;
-	
 	// --------------------------------------------------
 	// NPC Settings
 	// --------------------------------------------------
@@ -810,6 +800,7 @@ public final class Config
 	public static int NPC_DECAY_TIME;
 	public static int RAID_BOSS_DECAY_TIME;
 	public static int SPOILED_DECAY_TIME;
+	public static int MAX_SWEEPER_TIME;
 	public static boolean GUARD_ATTACK_AGGRO_MOB;
 	public static boolean ALLOW_WYVERN_UPGRADER;
 	public static List<Integer> LIST_PET_RENT_NPC;
@@ -1724,7 +1715,6 @@ public final class Config
 					SPAWN_PROTECTION_ALLOWED_ITEMS.add(itm);
 				}
 			}
-			SPAWN_PROTECTION_ALLOWED_ITEMS.trimToSize();
 			PLAYER_TELEPORT_PROTECTION = Integer.parseInt(Character.getProperty("PlayerTeleportProtection", "0"));
 			RANDOM_RESPAWN_IN_TOWN_ENABLED = Boolean.parseBoolean(Character.getProperty("RandomRespawnInTownEnabled", "True"));
 			OFFSET_ON_TELEPORT_ENABLED = Boolean.parseBoolean(Character.getProperty("OffsetOnTeleportEnabled", "True"));
@@ -2176,6 +2166,7 @@ public final class Config
 			NPC_DECAY_TIME = Integer.parseInt(NPC.getProperty("NpcDecayTime", "8500"));
 			RAID_BOSS_DECAY_TIME = Integer.parseInt(NPC.getProperty("RaidBossDecayTime", "30000"));
 			SPOILED_DECAY_TIME = Integer.parseInt(NPC.getProperty("SpoiledDecayTime", "18500"));
+			MAX_SWEEPER_TIME = Integer.parseInt(NPC.getProperty("MaxSweeperTime", "15000"));
 			ENABLE_DROP_VITALITY_HERBS = Boolean.parseBoolean(NPC.getProperty("EnableVitalityHerbs", "True"));
 			GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(NPC.getProperty("GuardAttackAggroMob", "False"));
 			ALLOW_WYVERN_UPGRADER = Boolean.parseBoolean(NPC.getProperty("AllowWyvernUpgrader", "False"));

+ 7 - 6
L2J_Server_BETA/java/com/l2jserver/gameserver/model/L2Party.java

@@ -41,6 +41,7 @@ import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2ServitorInstance;
 import com.l2jserver.gameserver.model.entity.DimensionalRift;
+import com.l2jserver.gameserver.model.holders.ItemHolder;
 import com.l2jserver.gameserver.model.itemcontainer.PcInventory;
 import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
 import com.l2jserver.gameserver.model.skills.L2Skill;
@@ -647,29 +648,29 @@ public class L2Party extends AbstractPlayerGroup
 	 * @param spoil
 	 * @param target
 	 */
-	public void distributeItem(L2PcInstance player, L2Attackable.RewardItem item, boolean spoil, L2Attackable target)
+	public void distributeItem(L2PcInstance player, ItemHolder item, boolean spoil, L2Attackable target)
 	{
 		if (item == null)
 		{
 			return;
 		}
 		
-		if (item.getItemId() == PcInventory.ADENA_ID)
+		if (item.getId() == PcInventory.ADENA_ID)
 		{
 			distributeAdena(player, item.getCount(), target);
 			return;
 		}
 		
-		L2PcInstance looter = getActualLooter(player, item.getItemId(), spoil, target);
+		L2PcInstance looter = getActualLooter(player, item.getId(), spoil, target);
 		
-		looter.addItem(spoil ? "Sweep" : "Party", item.getItemId(), item.getCount(), player, true);
+		looter.addItem(spoil ? "Sweeper" : "Party", item, player, true);
 		
 		// Send messages to other party members about reward
 		if (item.getCount() > 1)
 		{
 			SystemMessage msg = spoil ? SystemMessage.getSystemMessage(SystemMessageId.C1_SWEEPED_UP_S3_S2) : SystemMessage.getSystemMessage(SystemMessageId.C1_OBTAINED_S3_S2);
 			msg.addString(looter.getName());
-			msg.addItemName(item.getItemId());
+			msg.addItemName(item.getId());
 			msg.addItemNumber(item.getCount());
 			broadcastToPartyMembers(looter, msg);
 		}
@@ -677,7 +678,7 @@ public class L2Party extends AbstractPlayerGroup
 		{
 			SystemMessage msg = spoil ? SystemMessage.getSystemMessage(SystemMessageId.C1_SWEEPED_UP_S2) : SystemMessage.getSystemMessage(SystemMessageId.C1_OBTAINED_S2);
 			msg.addString(looter.getName());
-			msg.addItemName(item.getItemId());
+			msg.addItemName(item.getId());
 			broadcastToPartyMembers(looter, msg);
 		}
 	}

+ 46 - 68
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Attackable.java

@@ -57,6 +57,7 @@ import com.l2jserver.gameserver.model.actor.instance.L2ServitorInstance;
 import com.l2jserver.gameserver.model.actor.knownlist.AttackableKnownList;
 import com.l2jserver.gameserver.model.actor.status.AttackableStatus;
 import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
+import com.l2jserver.gameserver.model.holders.ItemHolder;
 import com.l2jserver.gameserver.model.itemcontainer.PcInventory;
 import com.l2jserver.gameserver.model.items.L2Item;
 import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
@@ -241,29 +242,6 @@ public class L2Attackable extends L2Npc
 		}
 	}
 	
-	public static final class RewardItem
-	{
-		protected int _itemId;
-		
-		protected int _count;
-		
-		public RewardItem(int itemId, int count)
-		{
-			_itemId = itemId;
-			_count = count;
-		}
-		
-		public int getItemId()
-		{
-			return _itemId;
-		}
-		
-		public int getCount()
-		{
-			return _count;
-		}
-	}
-	
 	private final FastMap<L2Character, AggroInfo> _aggroList = new FastMap<L2Character, AggroInfo>().shared();
 	
 	public final FastMap<L2Character, AggroInfo> getAggroList()
@@ -307,9 +285,8 @@ public class L2Attackable extends L2Npc
 		_seeThroughSilentMove = val;
 	}
 	
-	private RewardItem[] _sweepItems;
-	
-	private RewardItem[] _harvestItems;
+	private ItemHolder[] _sweepItems;
+	private ItemHolder[] _harvestItems;
 	private boolean _seeded;
 	private int _seedType = 0;
 	private int _seederObjId = 0;
@@ -1313,7 +1290,7 @@ public class L2Attackable extends L2Npc
 	 * @param isSweep
 	 * @return
 	 */
-	private RewardItem calculateRewardItem(L2PcInstance lastAttacker, L2DropData drop, int levelModifier, boolean isSweep)
+	private ItemHolder calculateRewardItem(L2PcInstance lastAttacker, L2DropData drop, int levelModifier, boolean isSweep)
 	{
 		// Get default drop chance
 		double dropChance = drop.getChance();
@@ -1425,7 +1402,7 @@ public class L2Attackable extends L2Npc
 		
 		if (itemCount > 0)
 		{
-			return new RewardItem(drop.getItemId(), itemCount);
+			return new ItemHolder(drop.getItemId(), itemCount);
 		}
 		return null;
 	}
@@ -1438,7 +1415,7 @@ public class L2Attackable extends L2Npc
 	 * @param levelModifier level modifier in %'s (will be subtracted from drop chance)
 	 * @return
 	 */
-	private RewardItem calculateCategorizedRewardItem(L2PcInstance lastAttacker, L2DropCategory categoryDrops, int levelModifier)
+	private ItemHolder calculateCategorizedRewardItem(L2PcInstance lastAttacker, L2DropCategory categoryDrops, int levelModifier)
 	{
 		if (categoryDrops == null)
 		{
@@ -1596,7 +1573,7 @@ public class L2Attackable extends L2Npc
 			
 			if (itemCount > 0)
 			{
-				return new RewardItem(drop.getItemId(), itemCount);
+				return new ItemHolder(drop.getItemId(), itemCount);
 			}
 		}
 		return null;
@@ -1634,7 +1611,7 @@ public class L2Attackable extends L2Npc
 		return 0;
 	}
 	
-	private RewardItem calculateCategorizedHerbItem(L2PcInstance lastAttacker, L2DropCategory categoryDrops)
+	private ItemHolder calculateCategorizedHerbItem(L2PcInstance lastAttacker, L2DropCategory categoryDrops)
 	{
 		if (categoryDrops == null)
 		{
@@ -1778,7 +1755,7 @@ public class L2Attackable extends L2Npc
 			
 			if (itemCount > 0)
 			{
-				return new RewardItem(drop.getItemId(), itemCount);
+				return new ItemHolder(drop.getItemId(), itemCount);
 			}
 		}
 		return null;
@@ -1829,13 +1806,13 @@ public class L2Attackable extends L2Npc
 		// now throw all categorized drops and handle spoil.
 		for (L2DropCategory cat : npcTemplate.getDropData())
 		{
-			RewardItem item = null;
+			ItemHolder item = null;
 			if (cat.isSweep())
 			{
 				// according to sh1ny, seeded mobs CAN be spoiled and swept.
 				if (isSpoil()/* && !isSeeded() */)
 				{
-					FastList<RewardItem> sweepList = new FastList<>();
+					FastList<ItemHolder> sweepList = new FastList<>();
 					
 					for (L2DropData drop : cat.getAllDrops())
 					{
@@ -1849,7 +1826,7 @@ public class L2Attackable extends L2Npc
 					// Set the table _sweepItems of this L2Attackable
 					if (!sweepList.isEmpty())
 					{
-						_sweepItems = sweepList.toArray(new RewardItem[sweepList.size()]);
+						_sweepItems = sweepList.toArray(new ItemHolder[sweepList.size()]);
 					}
 				}
 			}
@@ -1889,7 +1866,7 @@ public class L2Attackable extends L2Npc
 						SystemMessage sm;
 						sm = SystemMessage.getSystemMessage(SystemMessageId.C1_DIED_DROPPED_S3_S2);
 						sm.addCharName(this);
-						sm.addItemName(item.getItemId());
+						sm.addItemName(item.getId());
 						sm.addItemNumber(item.getCount());
 						broadcastPacket(sm);
 					}
@@ -1900,13 +1877,13 @@ public class L2Attackable extends L2Npc
 		if (Config.L2JMOD_CHAMPION_ENABLE && isChampion() && ((Config.L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE > 0) || (Config.L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE > 0)))
 		{
 			int champqty = Rnd.get(Config.L2JMOD_CHAMPION_REWARD_QTY);
-			RewardItem item = new RewardItem(Config.L2JMOD_CHAMPION_REWARD_ID, ++champqty);
+			ItemHolder item = new ItemHolder(Config.L2JMOD_CHAMPION_REWARD_ID, ++champqty);
 			
 			if ((player.getLevel() <= getLevel()) && (Rnd.get(100) < Config.L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE))
 			{
 				if (Config.AUTO_LOOT || isFlying())
 				{
-					player.addItem("ChampionLoot", item.getItemId(), item.getCount(), this, true); // Give the item(s) to the L2PcInstance that has killed the L2Attackable
+					player.addItem("ChampionLoot", item.getId(), item.getCount(), this, true); // Give the item(s) to the L2PcInstance that has killed the L2Attackable
 				}
 				else
 				{
@@ -1917,7 +1894,7 @@ public class L2Attackable extends L2Npc
 			{
 				if (Config.AUTO_LOOT || isFlying())
 				{
-					player.addItem("ChampionLoot", item.getItemId(), item.getCount(), this, true); // Give the item(s) to the L2PcInstance that has killed the L2Attackable
+					player.addItem("ChampionLoot", item.getId(), item.getCount(), this, true); // Give the item(s) to the L2PcInstance that has killed the L2Attackable
 				}
 				else
 				{
@@ -1931,22 +1908,22 @@ public class L2Attackable extends L2Npc
 		{
 			for (L2DropCategory cat : HerbDropTable.getInstance().getHerbDroplist(getTemplate().getDropHerbGroup()))
 			{
-				RewardItem item = calculateCategorizedHerbItem(player, cat);
+				ItemHolder item = calculateCategorizedHerbItem(player, cat);
 				if (item != null)
 				{
-					// more than one herb cant be auto looted!
-					int count = item.getCount();
+					// more than one herb can't be auto looted!
+					long count = item.getCount();
 					if (count > 1)
 					{
-						item._count = 1;
+						final ItemHolder herb = new ItemHolder(item.getId(), 1);
 						for (int i = 0; i < count; i++)
 						{
-							dropItem(player, item);
+							dropItem(player, herb);
 						}
 					}
 					else if (isFlying() || Config.AUTO_LOOT_HERBS)
 					{
-						player.addItem("Loot", item.getItemId(), count, this, true);
+						player.addItem("Loot", item.getId(), count, this, true);
 					}
 					else
 					{
@@ -1996,7 +1973,7 @@ public class L2Attackable extends L2Npc
 		{
 			if (Rnd.get(L2DropData.MAX_CHANCE) < drop.getEventDrop().getDropChance())
 			{
-				final RewardItem rewardItem = new RewardItem(drop.getEventDrop().getItemIdList()[Rnd.get(drop.getEventDrop().getItemIdList().length)], Rnd.get(drop.getEventDrop().getMinCount(), drop.getEventDrop().getMaxCount()));
+				final ItemHolder rewardItem = new ItemHolder(drop.getEventDrop().getItemIdList()[Rnd.get(drop.getEventDrop().getItemIdList().length)], Rnd.get(drop.getEventDrop().getMinCount(), drop.getEventDrop().getMaxCount()));
 				
 				if (Config.AUTO_LOOT || isFlying())
 				{
@@ -2016,7 +1993,7 @@ public class L2Attackable extends L2Npc
 	 * @param item
 	 * @return
 	 */
-	public L2ItemInstance dropItem(L2PcInstance mainDamageDealer, RewardItem item)
+	public L2ItemInstance dropItem(L2PcInstance mainDamageDealer, ItemHolder item)
 	{
 		int randDropLim = 70;
 		
@@ -2028,15 +2005,15 @@ public class L2Attackable extends L2Npc
 			int newY = (getY() + Rnd.get((randDropLim * 2) + 1)) - randDropLim;
 			int newZ = Math.max(getZ(), mainDamageDealer.getZ()) + 20; // TODO: temp hack, do something nicer when we have geodatas
 			
-			if (ItemTable.getInstance().getTemplate(item.getItemId()) != null)
+			if (ItemTable.getInstance().getTemplate(item.getId()) != null)
 			{
 				// Init the dropped L2ItemInstance and add it in the world as a visible object at the position where mob was last
-				ditem = ItemTable.getInstance().createItem("Loot", item.getItemId(), item.getCount(), mainDamageDealer, this);
+				ditem = ItemTable.getInstance().createItem("Loot", item.getId(), item.getCount(), mainDamageDealer, this);
 				ditem.getDropProtection().protect(mainDamageDealer);
 				ditem.dropMe(this, newX, newY, newZ);
 				
 				// Add drop to auto destroy item task
-				if (!Config.LIST_PROTECTED_ITEMS.contains(item.getItemId()))
+				if (!Config.LIST_PROTECTED_ITEMS.contains(item.getId()))
 				{
 					if (((Config.AUTODESTROY_ITEM_AFTER > 0) && (ditem.getItemType() != L2EtcItemType.HERB)) || ((Config.HERB_AUTO_DESTROY_TIME > 0) && (ditem.getItemType() == L2EtcItemType.HERB)))
 					{
@@ -2053,7 +2030,7 @@ public class L2Attackable extends L2Npc
 			}
 			else
 			{
-				_log.log(Level.SEVERE, "Item doesn't exist so cannot be dropped. Item ID: " + item.getItemId());
+				_log.log(Level.SEVERE, "Item doesn't exist so cannot be dropped. Item ID: " + item.getId());
 			}
 		}
 		return ditem;
@@ -2061,7 +2038,7 @@ public class L2Attackable extends L2Npc
 	
 	public L2ItemInstance dropItem(L2PcInstance lastAttacker, int itemId, int itemCount)
 	{
-		return dropItem(lastAttacker, new RewardItem(itemId, itemCount));
+		return dropItem(lastAttacker, new ItemHolder(itemId, itemCount));
 	}
 	
 	/**
@@ -2118,9 +2095,9 @@ public class L2Attackable extends L2Npc
 		final FastList<L2Item> lootItems = new FastList<>();
 		if (isSweepActive())
 		{
-			for (RewardItem item : _sweepItems)
+			for (ItemHolder item : _sweepItems)
 			{
-				lootItems.add(ItemTable.getInstance().createDummyItem(item.getItemId()).getItem());
+				lootItems.add(ItemTable.getInstance().createDummyItem(item.getId()).getItem());
 			}
 		}
 		return lootItems;
@@ -2129,9 +2106,9 @@ public class L2Attackable extends L2Npc
 	/**
 	 * @return table containing all L2ItemInstance that can be spoiled.
 	 */
-	public synchronized RewardItem[] takeSweep()
+	public synchronized ItemHolder[] takeSweep()
 	{
-		RewardItem[] sweep = _sweepItems;
+		ItemHolder[] sweep = _sweepItems;
 		_sweepItems = null;
 		return sweep;
 	}
@@ -2139,20 +2116,21 @@ public class L2Attackable extends L2Npc
 	/**
 	 * @return table containing all L2ItemInstance that can be harvested.
 	 */
-	public synchronized RewardItem[] takeHarvest()
+	public synchronized ItemHolder[] takeHarvest()
 	{
-		RewardItem[] harvest = _harvestItems;
+		ItemHolder[] harvest = _harvestItems;
 		_harvestItems = null;
 		return harvest;
 	}
 	
 	/**
-	 * @param attacker the player to validate.
-	 * @param time the time to check.
-	 * @param sendMessage if {@code true} will send a message of corpse too old.
-	 * @return {@code true} if the corpse isn't too old.
+	 * Check if the corpse is too old.
+	 * @param attacker the player to validate
+	 * @param time the time to check
+	 * @param sendMessage if {@code true} will send a message of corpse too old
+	 * @return {@code true} if the corpse is too old
 	 */
-	public boolean checkCorpseTime(L2PcInstance attacker, int time, boolean sendMessage)
+	public boolean isOldCorpse(L2PcInstance attacker, int time, boolean sendMessage)
 	{
 		if (DecayTaskManager.getInstance().getTasks().containsKey(this) && ((System.currentTimeMillis() - DecayTaskManager.getInstance().getTasks().get(this)) > time))
 		{
@@ -2160,9 +2138,9 @@ public class L2Attackable extends L2Npc
 			{
 				attacker.sendPacket(SystemMessageId.CORPSE_TOO_OLD_SKILL_NOT_USED);
 			}
-			return false;
+			return true;
 		}
-		return true;
+		return false;
 	}
 	
 	/**
@@ -2513,11 +2491,11 @@ public class L2Attackable extends L2Npc
 			count += diff;
 		}
 		
-		FastList<RewardItem> harvested = new FastList<>();
+		FastList<ItemHolder> harvested = new FastList<>();
 		
-		harvested.add(new RewardItem(ManorData.getInstance().getCropType(_seedType), count * Config.RATE_DROP_MANOR));
+		harvested.add(new ItemHolder(ManorData.getInstance().getCropType(_seedType), count * Config.RATE_DROP_MANOR));
 		
-		_harvestItems = harvested.toArray(new RewardItem[harvested.size()]);
+		_harvestItems = harvested.toArray(new ItemHolder[harvested.size()]);
 	}
 	
 	public int getSeederId()

+ 17 - 5
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

@@ -172,6 +172,7 @@ import com.l2jserver.gameserver.model.entity.Siege;
 import com.l2jserver.gameserver.model.entity.TvTEvent;
 import com.l2jserver.gameserver.model.fishing.L2Fish;
 import com.l2jserver.gameserver.model.fishing.L2Fishing;
+import com.l2jserver.gameserver.model.holders.ItemHolder;
 import com.l2jserver.gameserver.model.itemcontainer.Inventory;
 import com.l2jserver.gameserver.model.itemcontainer.ItemContainer;
 import com.l2jserver.gameserver.model.itemcontainer.PcFreight;
@@ -3882,7 +3883,7 @@ public final class L2PcInstance extends L2Playable
 				}
 				else
 				{
-					if (process.equalsIgnoreCase("sweep") || process.equalsIgnoreCase("Quest"))
+					if (process.equalsIgnoreCase("Sweeper") || process.equalsIgnoreCase("Quest"))
 					{
 						SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.EARNED_ITEM_S1);
 						sm.addItemName(itemId);
@@ -3959,6 +3960,17 @@ public final class L2PcInstance extends L2Playable
 		return null;
 	}
 	
+	/**
+	 * @param process the process name
+	 * @param item the item holder
+	 * @param reference the reference object
+	 * @param sendMessage if {@code true} a system message will be sent
+	 */
+	public void addItem(String process, ItemHolder item, L2Object reference, boolean sendMessage)
+	{
+		addItem(process, item.getId(), item.getCount(), reference, sendMessage);
+	}
+	
 	/**
 	 * Destroy item from inventory and send a Server->Client InventoryUpdate packet to the L2PcInstance.
 	 * @param process : String Identifier of process triggering this action
@@ -5036,19 +5048,19 @@ public final class L2PcInstance extends L2Playable
 	 * @param target The L2ItemInstance dropped
 	 * @param item
 	 */
-	public void doAutoLoot(L2Attackable target, L2Attackable.RewardItem item)
+	public void doAutoLoot(L2Attackable target, ItemHolder item)
 	{
-		if (isInParty() && (ItemTable.getInstance().getTemplate(item.getItemId()).getItemType() != L2EtcItemType.HERB))
+		if (isInParty() && (ItemTable.getInstance().getTemplate(item.getId()).getItemType() != L2EtcItemType.HERB))
 		{
 			getParty().distributeItem(this, item, false, target);
 		}
-		else if (item.getItemId() == PcInventory.ADENA_ID)
+		else if (item.getId() == PcInventory.ADENA_ID)
 		{
 			addAdena("Loot", item.getCount(), target, true);
 		}
 		else
 		{
-			addItem("Loot", item.getItemId(), item.getCount(), target, true);
+			addItem("Loot", item, target, true);
 		}
 	}
 	

+ 2 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/conditions/ConditionPlayerCanSweep.java

@@ -18,6 +18,7 @@
  */
 package com.l2jserver.gameserver.model.conditions;
 
+import com.l2jserver.Config;
 import com.l2jserver.gameserver.model.L2Object;
 import com.l2jserver.gameserver.model.actor.L2Attackable;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
@@ -39,7 +40,6 @@ import com.l2jserver.gameserver.network.SystemMessageId;
  */
 public class ConditionPlayerCanSweep extends Condition
 {
-	private static final int MAX_SWEEP_TIME = 15000;
 	private final boolean _val;
 	
 	public ConditionPlayerCanSweep(boolean val)
@@ -71,7 +71,7 @@ public class ConditionPlayerCanSweep extends Condition
 								if (target.isSpoil())
 								{
 									canSweep = target.checkSpoilOwner(sweeper, true);
-									canSweep &= target.checkCorpseTime(sweeper, MAX_SWEEP_TIME, true);
+									canSweep &= !target.isOldCorpse(sweeper, Config.MAX_SWEEPER_TIME, true);
 									canSweep &= sweeper.getInventory().checkInventorySlotsAndWeight(target.getSpoilLootItems(), true, true);
 								}
 								else

+ 0 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/L2Skill.java

@@ -1175,7 +1175,6 @@ public abstract class L2Skill implements IChanceSkillTrigger
 			case SOULSHOT:
 			case SPIRITSHOT:
 			case SPOIL:
-			case SWEEP:
 			case PARALYZE:
 			case AGGREDUCE:
 			case AGGREMOVE:

+ 0 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/L2SkillType.java

@@ -34,7 +34,6 @@ import com.l2jserver.gameserver.model.skills.l2skills.L2SkillSignet;
 import com.l2jserver.gameserver.model.skills.l2skills.L2SkillSignetCasttime;
 import com.l2jserver.gameserver.model.skills.l2skills.L2SkillSpawn;
 import com.l2jserver.gameserver.model.skills.l2skills.L2SkillSummon;
-import com.l2jserver.gameserver.model.skills.l2skills.L2SkillSweeper;
 import com.l2jserver.gameserver.model.skills.l2skills.L2SkillTeleport;
 import com.l2jserver.gameserver.model.skills.l2skills.L2SkillTrap;
 
@@ -133,7 +132,6 @@ public enum L2SkillType
 	TELEPORT(L2SkillTeleport.class),
 	SUMMON_FRIEND,
 	SPOIL,
-	SWEEP(L2SkillSweeper.class),
 	BEAST_FEED,
 	BEAST_RELEASE,
 	BEAST_RELEASE_ALL,

+ 0 - 152
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/l2skills/L2SkillElemental.java

@@ -1,152 +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.skills.l2skills;
-
-import com.l2jserver.gameserver.model.L2Object;
-import com.l2jserver.gameserver.model.ShotType;
-import com.l2jserver.gameserver.model.StatsSet;
-import com.l2jserver.gameserver.model.actor.L2Character;
-import com.l2jserver.gameserver.model.effects.L2Effect;
-import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
-import com.l2jserver.gameserver.model.skills.L2Skill;
-import com.l2jserver.gameserver.model.stats.Env;
-import com.l2jserver.gameserver.model.stats.Formulas;
-
-public class L2SkillElemental extends L2Skill
-{
-	private final int[] _seeds;
-	private final boolean _seedAny;
-	
-	public L2SkillElemental(StatsSet set)
-	{
-		super(set);
-		
-		_seeds = new int[3];
-		_seeds[0] = set.getInteger("seed1", 0);
-		_seeds[1] = set.getInteger("seed2", 0);
-		_seeds[2] = set.getInteger("seed3", 0);
-		
-		if (set.getInteger("seed_any", 0) == 1)
-		{
-			_seedAny = true;
-		}
-		else
-		{
-			_seedAny = false;
-		}
-	}
-	
-	@Override
-	public void useSkill(L2Character activeChar, L2Object[] targets)
-	{
-		if (activeChar.isAlikeDead())
-		{
-			return;
-		}
-		
-		L2ItemInstance weaponInst = activeChar.getActiveWeaponInstance();
-		
-		if (activeChar.isPlayer())
-		{
-			if (weaponInst == null)
-			{
-				activeChar.sendMessage("You must equip your weapon before casting a spell.");
-				return;
-			}
-		}
-		
-		boolean ss = useSoulShot() && activeChar.isChargedShot(ShotType.SOULSHOTS);
-		boolean sps = useSpiritShot() && activeChar.isChargedShot(ShotType.SPIRITSHOTS);
-		boolean bss = useSpiritShot() && activeChar.isChargedShot(ShotType.BLESSED_SPIRITSHOTS);
-		
-		for (L2Character target : (L2Character[]) targets)
-		{
-			if (target.isAlikeDead())
-			{
-				continue;
-			}
-			
-			boolean charged = true;
-			if (!_seedAny)
-			{
-				for (int _seed : _seeds)
-				{
-					if (_seed != 0)
-					{
-						L2Effect e = target.getFirstEffect(_seed);
-						if ((e == null) || !e.getInUse())
-						{
-							charged = false;
-							break;
-						}
-					}
-				}
-			}
-			else
-			{
-				charged = false;
-				for (int _seed : _seeds)
-				{
-					if (_seed != 0)
-					{
-						L2Effect e = target.getFirstEffect(_seed);
-						if ((e != null) && e.getInUse())
-						{
-							charged = true;
-							break;
-						}
-					}
-				}
-			}
-			if (!charged)
-			{
-				activeChar.sendMessage("Target is not charged by elements.");
-				continue;
-			}
-			
-			boolean mcrit = Formulas.calcMCrit(activeChar.getMCriticalHit(target, this));
-			byte shld = Formulas.calcShldUse(activeChar, target, this);
-			
-			int damage = (int) Formulas.calcMagicDam(activeChar, target, this, shld, sps, bss, mcrit);
-			
-			if (damage > 0)
-			{
-				target.reduceCurrentHp(damage, activeChar, this);
-				
-				// Manage attack or cast break of the target (calculating rate, sending message...)
-				if (!target.isRaid() && Formulas.calcAtkBreak(target, damage))
-				{
-					target.breakAttack();
-					target.breakCast();
-				}
-				
-				activeChar.sendDamageMessage(target, damage, false, false, false);
-				
-			}
-			
-			// activate attacked effects, if any
-			target.stopSkillEffects(getId());
-			
-			getEffects(activeChar, target, new Env(shld, ss, sps, bss));
-		}
-		
-		// Consume shot
-		activeChar.setChargedShot(bss ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, false);
-	}
-}

+ 0 - 60
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/l2skills/L2SkillSweeper.java

@@ -1,60 +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.skills.l2skills;
-
-import com.l2jserver.gameserver.model.L2Object;
-import com.l2jserver.gameserver.model.StatsSet;
-import com.l2jserver.gameserver.model.actor.L2Character;
-import com.l2jserver.gameserver.model.skills.L2Skill;
-
-/**
- * @author JIV
- */
-public class L2SkillSweeper extends L2Skill
-{
-	private final boolean _absorbHp;
-	private final int _absorbAbs;
-	
-	/**
-	 * @param set
-	 */
-	public L2SkillSweeper(StatsSet set)
-	{
-		super(set);
-		_absorbHp = set.getBool("absorbHp", true);
-		_absorbAbs = set.getInteger("absorbAbs", -1);
-	}
-	
-	@Override
-	public void useSkill(L2Character caster, L2Object[] targets)
-	{
-		// not used
-	}
-	
-	public boolean isAbsorbHp()
-	{
-		return _absorbHp;
-	}
-	
-	public int getAbsorbAbs()
-	{
-		return _absorbAbs;
-	}
-	
-}