Sync with L2jServer HighFive Feb 18th 2015.
This commit is contained in:
@ -21,6 +21,7 @@ package com.l2jserver.gameserver.model;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jserver.gameserver.instancemanager.MapRegionManager;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.interfaces.IIdentifiable;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
@ -35,7 +36,6 @@ public class PartyMatchRoom implements IIdentifiable
|
||||
private final int _id;
|
||||
private String _title;
|
||||
private int _loot;
|
||||
private int _location;
|
||||
private int _minlvl;
|
||||
private int _maxlvl;
|
||||
private int _maxmem;
|
||||
@ -46,7 +46,6 @@ public class PartyMatchRoom implements IIdentifiable
|
||||
_id = id;
|
||||
_title = title;
|
||||
_loot = loot;
|
||||
_location = 0; // TODO: Closes town
|
||||
_minlvl = minlvl;
|
||||
_maxlvl = maxlvl;
|
||||
_maxmem = maxmem;
|
||||
@ -132,9 +131,29 @@ public class PartyMatchRoom implements IIdentifiable
|
||||
return _maxlvl;
|
||||
}
|
||||
|
||||
/**
|
||||
* <ul>
|
||||
* <li>1 : Talking Island</li>
|
||||
* <li>2 : Gludio</li>
|
||||
* <li>3 : Dark Elven Ter.</li>
|
||||
* <li>4 : Elven Territory</li>
|
||||
* <li>5 : Dion</li>
|
||||
* <li>6 : Giran</li>
|
||||
* <li>7 : Neutral Zone</li>
|
||||
* <li>8 : Lyonn</li>
|
||||
* <li>9 : Schuttgart</li>
|
||||
* <li>10 : Oren</li>
|
||||
* <li>11 : Hunters Village</li>
|
||||
* <li>12 : Innadril</li>
|
||||
* <li>13 : Aden</li>
|
||||
* <li>14 : Rune</li>
|
||||
* <li>15 : Goddard</li>
|
||||
* </ul>
|
||||
* @return the id
|
||||
*/
|
||||
public int getLocation()
|
||||
{
|
||||
return _location;
|
||||
return MapRegionManager.getInstance().getMapRegion(_members.get(0)).getBbs();
|
||||
}
|
||||
|
||||
public int getMembers()
|
||||
@ -169,11 +188,6 @@ public class PartyMatchRoom implements IIdentifiable
|
||||
_maxlvl = maxlvl;
|
||||
}
|
||||
|
||||
public void setLocation(int loc)
|
||||
{
|
||||
_location = loc;
|
||||
}
|
||||
|
||||
public void setLootType(int loot)
|
||||
{
|
||||
_loot = loot;
|
||||
@ -188,4 +202,4 @@ public class PartyMatchRoom implements IIdentifiable
|
||||
{
|
||||
_title = title;
|
||||
}
|
||||
}
|
||||
}
|
@ -1954,6 +1954,11 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
if (item.isEquipped())
|
||||
{
|
||||
if (item.getMana() < item.useSkillDisTime())
|
||||
{
|
||||
abortCast();
|
||||
return;
|
||||
}
|
||||
item.decreaseMana(false, item.useSkillDisTime());
|
||||
break;
|
||||
}
|
||||
@ -5173,10 +5178,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
// Launch weapon Special ability effect if available
|
||||
L2Weapon activeWeapon = getActiveWeaponItem();
|
||||
if (activeWeapon != null)
|
||||
if (crit)
|
||||
{
|
||||
activeWeapon.castOnCriticalSkill(this, target);
|
||||
L2Weapon activeWeapon = getActiveWeaponItem();
|
||||
if (activeWeapon != null)
|
||||
{
|
||||
activeWeapon.castOnCriticalSkill(this, target);
|
||||
}
|
||||
}
|
||||
|
||||
// Recharge any active auto-soulshot tasks for current creature.
|
||||
|
@ -680,20 +680,7 @@ public class CharStat
|
||||
return 1;
|
||||
}
|
||||
|
||||
double mpConsume = calcStat(Stats.MP_CONSUME, skill.getMpInitialConsume(), null, skill);
|
||||
|
||||
if (skill.isDance())
|
||||
{
|
||||
return (int) calcStat(Stats.DANCE_MP_CONSUME_RATE, mpConsume);
|
||||
}
|
||||
else if (skill.isMagic())
|
||||
{
|
||||
return (int) calcStat(Stats.MAGICAL_MP_CONSUME_RATE, mpConsume);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (int) calcStat(Stats.PHYSICAL_MP_CONSUME_RATE, mpConsume);
|
||||
}
|
||||
return (int) calcStat(Stats.MP_CONSUME, skill.getMpInitialConsume(), null, skill);
|
||||
}
|
||||
|
||||
public byte getAttackElement()
|
||||
|
@ -454,6 +454,7 @@ public abstract class Inventory extends ItemContainer
|
||||
|
||||
if (itemSkill != null)
|
||||
{
|
||||
itemSkill.setReferenceItemId(item.getId());
|
||||
player.addSkill(itemSkill, false);
|
||||
|
||||
if (itemSkill.isActive())
|
||||
|
@ -126,7 +126,7 @@ public final class Skill implements IIdentifiable
|
||||
/** If {@code true} this skill's effect recovery HP/MP or CP from herb. */
|
||||
private final boolean _isRecoveryHerb;
|
||||
|
||||
private final int _refId;
|
||||
private int _refId;
|
||||
// all times in milliseconds
|
||||
private final int _hitTime;
|
||||
// private final int _skillInterruptTime;
|
||||
@ -225,7 +225,6 @@ public final class Skill implements IIdentifiable
|
||||
{
|
||||
_id = set.getInt("skill_id");
|
||||
_level = set.getInt("level");
|
||||
_refId = set.getInt("referenceId", 0);
|
||||
_displayId = set.getInt("displayId", _id);
|
||||
_displayLevel = set.getInt("displayLevel", _level);
|
||||
_name = set.getString("name", "");
|
||||
@ -1602,6 +1601,11 @@ public final class Skill implements IIdentifiable
|
||||
return _refId;
|
||||
}
|
||||
|
||||
public void setReferenceItemId(int val)
|
||||
{
|
||||
_refId = val;
|
||||
}
|
||||
|
||||
public String getAttributeName()
|
||||
{
|
||||
return _attribute;
|
||||
|
@ -53,7 +53,7 @@ public class ExManagePartyRoomMember extends L2GameServerPacket
|
||||
writeS(_activeChar.getName());
|
||||
writeD(_activeChar.getActiveClass());
|
||||
writeD(_activeChar.getLevel());
|
||||
writeD(0x00); // TODO: Closes town
|
||||
writeD(_room.getLocation());
|
||||
if (_room.getOwner().equals(_activeChar))
|
||||
{
|
||||
writeD(1);
|
||||
|
@ -48,7 +48,7 @@ public class ExPartyRoomMember extends L2GameServerPacket
|
||||
writeS(member.getName());
|
||||
writeD(member.getActiveClass());
|
||||
writeD(member.getLevel());
|
||||
writeD(0x00); // TODO: Closes town
|
||||
writeD(_room.getLocation());
|
||||
if (_room.getOwner().equals(member))
|
||||
{
|
||||
writeD(0x01);
|
||||
|
@ -41,13 +41,13 @@ public class PartyMatchDetail extends L2GameServerPacket
|
||||
protected final void writeImpl()
|
||||
{
|
||||
writeC(0x9d);
|
||||
writeD(_room.getId()); // Room ID
|
||||
writeD(_room.getMaxMembers()); // Max Members
|
||||
writeD(_room.getMinLvl()); // Level Min
|
||||
writeD(_room.getMaxLvl()); // Level Max
|
||||
writeD(_room.getLootType()); // Loot Type
|
||||
writeD(_room.getLocation()); // Room Location
|
||||
writeS(_room.getTitle()); // Room title
|
||||
writeH(0x00); // Unknown
|
||||
writeD(_room.getId());
|
||||
writeD(_room.getMaxMembers());
|
||||
writeD(_room.getMinLvl());
|
||||
writeD(_room.getMaxLvl());
|
||||
writeD(_room.getLootType());
|
||||
writeD(_room.getLocation());
|
||||
writeS(_room.getTitle());
|
||||
writeH(59064);
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,6 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.util;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.logging.Logger;
|
||||
@ -38,7 +37,7 @@ import com.l2jserver.util.Rnd;
|
||||
*/
|
||||
public class MinionList
|
||||
{
|
||||
private static Logger _log = Logger.getLogger(MinionList.class.getName());
|
||||
private static final Logger _log = Logger.getLogger(MinionList.class.getName());
|
||||
|
||||
protected final L2MonsterInstance _master;
|
||||
/** List containing the current spawned minions */
|
||||
@ -85,7 +84,8 @@ public class MinionList
|
||||
return;
|
||||
}
|
||||
|
||||
int minionCount, minionId, minionsToSpawn;
|
||||
int minionCount, minionId;
|
||||
long minionsToSpawn;
|
||||
for (MinionHolder minion : minions)
|
||||
{
|
||||
minionCount = minion.getCount();
|
||||
@ -272,22 +272,16 @@ public class MinionList
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// searching in reused minions
|
||||
if ((_reusedMinionReferences != null) && !_reusedMinionReferences.isEmpty())
|
||||
if (_reusedMinionReferences != null)
|
||||
{
|
||||
L2MonsterInstance minion;
|
||||
Iterator<L2MonsterInstance> iter = _reusedMinionReferences.iterator();
|
||||
while (iter.hasNext())
|
||||
final L2MonsterInstance minion = _reusedMinionReferences.stream().filter(m -> (m.getId() == minionId)).findFirst().orElse(null);
|
||||
if (minion != null)
|
||||
{
|
||||
minion = iter.next();
|
||||
if ((minion != null) && (minion.getId() == minionId))
|
||||
{
|
||||
iter.remove();
|
||||
minion.refreshID();
|
||||
initializeNpcInstance(_master, minion);
|
||||
return;
|
||||
}
|
||||
_reusedMinionReferences.remove(minion);
|
||||
minion.refreshID();
|
||||
initializeNpcInstance(_master, minion);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// not found in cache
|
||||
@ -397,17 +391,9 @@ public class MinionList
|
||||
|
||||
// Statistics part
|
||||
|
||||
private final int countSpawnedMinionsById(int minionId)
|
||||
private final long countSpawnedMinionsById(int minionId)
|
||||
{
|
||||
int count = 0;
|
||||
for (L2MonsterInstance minion : _minionReferences)
|
||||
{
|
||||
if ((minion != null) && (minion.getId() == minionId))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
return _minionReferences.stream().filter(npc -> npc.getId() == minionId).count();
|
||||
}
|
||||
|
||||
public final int countSpawnedMinions()
|
||||
@ -417,6 +403,6 @@ public class MinionList
|
||||
|
||||
public final long lazyCountSpawnedMinionsGroups()
|
||||
{
|
||||
return _minionReferences.stream().distinct().count();
|
||||
return _minionReferences.stream().map(L2MonsterInstance::getId).distinct().count();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user