Знающие люди , подскажите пожалуйста. Festival sweeper работает не правильно . ( заспойля моба и убив его , остальные вокруг пропадают и спойл идет только с первого (1) моба.) [spoiler=
Не работающий ( ядро крякнутое gvb 25,01,2017)]
package ru.catssoftware.gameserver.handler.skillhandlers;
import ru.catssoftware.gameserver.handler.ISkillHandler; import ru.catssoftware.gameserver.model.*; import ru.catssoftware.gameserver.model.actor.instance.L2PcInstance; import ru.catssoftware.gameserver.model.itemcontainer.PcInventory; import ru.catssoftware.gameserver.network.SystemMessageId; import ru.catssoftware.gameserver.network.serverpackets.*; import ru.catssoftware.gameserver.templates.skills.L2SkillType; public class Sweep implements ISkillHandler { public Sweep() { } public transient void useSkill(L2Character l2character, L2Skill l2skill, L2Character al2character[]) { if(!(l2character instanceof L2PcInstance)) return; L2PcInstance l2pcinstance = (L2PcInstance)l2character; InventoryUpdate inventoryupdate = new InventoryUpdate(); boolean flag = false; L2Character al2character1[] = al2character; int i = al2character1.length; for(int j = 0; j < i; j++) { L2Character l2character1 = al2character1[j]; if(!(l2character1 instanceof L2Attackable)) continue; L2Attackable l2attackable = (L2Attackable)l2character1; ru.catssoftware.gameserver.model.L2Attackable.RewardItem arewarditem[] = null; boolean flag1 = false; synchronized(l2attackable) { if(l2attackable.isSweepActive()) { arewarditem = l2attackable.takeSweep(); flag1 = true; } } if(flag1) { if(arewarditem == null || arewarditem.length == 0) continue; ru.catssoftware.gameserver.model.L2Attackable.RewardItem arewarditem1[] = arewarditem; int k = arewarditem1.length; for(int l = 0; l < k; l++) { ru.catssoftware.gameserver.model.L2Attackable.RewardItem rewarditem = arewarditem1[l]; if(l2pcinstance.isInParty()) { l2pcinstance.getParty().distributeItem(l2pcinstance, rewarditem, true, l2attackable); continue; } if(!l2pcinstance.getInventory().validateCapacityByItemId(rewarditem.getItemId())) continue; L2ItemInstance l2iteminstance = l2pcinstance.getInventory().addItem("Sweep", rewarditem.getItemId(), rewarditem.getCount(), l2pcinstance, l2attackable); if(inventoryupdate != null) inventoryupdate.addItem(l2iteminstance); flag = true; SystemMessage systemmessage = new SystemMessage(SystemMessageId.YOU_PICKED_UP_S1_S2); systemmessage.addNumber(rewarditem.getCount()); systemmessage.addItemName(l2iteminstance); l2pcinstance.sendPacket(systemmessage); } } l2attackable.endDecayTask(); if(!flag) continue; if(inventoryupdate != null) l2pcinstance.sendPacket(inventoryupdate); else l2pcinstance.sendPacket(new ItemList(l2pcinstance, false)); } } public L2SkillType[] getSkillIds() { return SKILL_IDS; } private static final L2SkillType SKILL_IDS[]; static { SKILL_IDS = (new L2SkillType[] { L2SkillType.SWEEP }); } }
[spoiler=
Работающий ( Если не изменяет память 15reva от ловели )]package ru.catssoftware.gameserver.handler.skillhandlers; import java.util.Iterator; import java.util.List; import ru.catssoftware.gameserver.handler.ISkillHandler; import ru.catssoftware.gameserver.model.*; import ru.catssoftware.gameserver.model.actor.instance.L2PcInstance; import ru.catssoftware.gameserver.model.itemcontainer.PcInventory; import ru.catssoftware.gameserver.network.SystemMessageId; import ru.catssoftware.gameserver.network.serverpackets.*; import ru.catssoftware.gameserver.templates.skills.L2SkillType; public class Sweep implements ISkillHandler { public Sweep() { } public transient void useSkill(L2Character l2character, L2Skill l2skill, L2Character al2character[]) { if(!(l2character instanceof L2PcInstance)) return; L2PcInstance l2pcinstance = (L2PcInstance)l2character; InventoryUpdate inventoryupdate = new InventoryUpdate(); boolean flag = false; for(int i = 0; i < al2character.length; i++) { if(!(al2character instanceof L2Attackable)) continue; L2Attackable l2attackable = (L2Attackable)al2character; if(!l2attackable.isSpoil()) continue; List list = l2attackable.takeSweep(); if(list.isEmpty()) continue; Iterator iterator = list.iterator(); do { if(!iterator.hasNext()) break; ru.catssoftware.gameserver.model.L2Attackable.RewardItem rewarditem = (ru.catssoftware.gameserver.model.L2Attackable.RewardItem)iterator.next(); if(l2pcinstance.isInParty()) l2pcinstance.getParty().distributeItem(l2pcinstance, rewarditem, true, l2attackable); else if(l2pcinstance.getInventory().validateCapacityByItemId(rewarditem.getItemId())) { L2ItemInstance l2iteminstance = l2pcinstance.getInventory().addItem("Sweep", rewarditem.getItemId(), rewarditem.getCount(), l2pcinstance, l2attackable); if(inventoryupdate != null) inventoryupdate.addItem(l2iteminstance); flag = true; SystemMessage systemmessage = new SystemMessage(SystemMessageId.YOU_PICKED_UP_S1_S2); systemmessage.addNumber(rewarditem.getCount()); systemmessage.addItemName(l2iteminstance); l2pcinstance.sendPacket(systemmessage); } } while(true); l2attackable.endDecayTask(); if(!flag) continue; if(inventoryupdate != null) l2pcinstance.sendPacket(inventoryupdate); else l2pcinstance.sendPacket(new ItemList(l2pcinstance, false)); } } public L2SkillType[] getSkillIds() { return SKILL_IDS; } private static final L2SkillType SKILL_IDS[]; static { SKILL_IDS = (new L2SkillType[] { L2SkillType.SWEEP }); } }