Underground update.
This commit is contained in:
@ -18,6 +18,7 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.model;
|
||||
|
||||
import com.l2jserver.gameserver.model.entity.Hero;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.Inventory;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.PcInventory;
|
||||
import com.l2jserver.gameserver.model.variables.PlayerVariables;
|
||||
@ -322,9 +323,14 @@ public class CharSelectInfoPackage
|
||||
_sp = sp;
|
||||
}
|
||||
|
||||
public int getEnchantEffect()
|
||||
public int getWeaponEnchantEffect()
|
||||
{
|
||||
return _paperdoll[Inventory.PAPERDOLL_RHAND][2];
|
||||
return getEnchantEffect(Inventory.PAPERDOLL_RHAND);
|
||||
}
|
||||
|
||||
public int getEnchantEffect(int slot)
|
||||
{
|
||||
return _paperdoll[slot][2];
|
||||
}
|
||||
|
||||
public void setReputation(int reputation)
|
||||
@ -421,4 +427,48 @@ public class CharSelectInfoPackage
|
||||
{
|
||||
return _vars.getBoolean("hairAccessoryEnabled", true);
|
||||
}
|
||||
|
||||
public int getTransformationId()
|
||||
{
|
||||
int weaponId = getPaperdollItemId(Inventory.PAPERDOLL_RHAND);
|
||||
switch (weaponId)
|
||||
{
|
||||
case 8190:
|
||||
return 301;
|
||||
case 8689:
|
||||
return 302;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getVitalityPercent()
|
||||
{
|
||||
return 200; // TODO: Implement.
|
||||
}
|
||||
|
||||
public int getVitalityItemCount()
|
||||
{
|
||||
return 5; // TODO: Implement.
|
||||
}
|
||||
|
||||
public boolean isAvailable()
|
||||
{
|
||||
return getAccessLevel() > -100;
|
||||
}
|
||||
|
||||
public boolean isHero()
|
||||
{
|
||||
return Hero.getInstance().isHero(getObjectId());
|
||||
}
|
||||
|
||||
public int get1stAugmentationId()
|
||||
{
|
||||
return 0x0000FFFF & getAugmentationId();
|
||||
}
|
||||
|
||||
public int get2ndAugmentationId()
|
||||
{
|
||||
return getAugmentationId() >> 16;
|
||||
}
|
||||
}
|
||||
|
@ -325,6 +325,16 @@ public class ItemInfo
|
||||
return _augmentation;
|
||||
}
|
||||
|
||||
public int get1stAugmentationId()
|
||||
{
|
||||
return 0x0000FFFF & getAugmentationBonus();
|
||||
}
|
||||
|
||||
public int get2ndAugmentationId()
|
||||
{
|
||||
return getAugmentationBonus() >> 16;
|
||||
}
|
||||
|
||||
public long getCount()
|
||||
{
|
||||
return _count;
|
||||
|
@ -59,17 +59,17 @@ public final class L2EnchantSkillLearn
|
||||
|
||||
public static int getEnchantRoute(int level)
|
||||
{
|
||||
return (int) Math.floor(level / 100);
|
||||
return (int) Math.floor(level / 1000);
|
||||
}
|
||||
|
||||
public static int getEnchantIndex(int level)
|
||||
{
|
||||
return (level % 100) - 1;
|
||||
return (level % 1000) - 1;
|
||||
}
|
||||
|
||||
public static int getEnchantType(int level)
|
||||
{
|
||||
return ((level - 1) / 100) - 1;
|
||||
return ((level - 1) / 1000) - 1;
|
||||
}
|
||||
|
||||
public L2EnchantSkillGroup getFirstRouteGroup()
|
||||
@ -84,7 +84,7 @@ public final class L2EnchantSkillLearn
|
||||
|
||||
public int getMinSkillLevel(int level)
|
||||
{
|
||||
if ((level % 100) == 1)
|
||||
if ((level % 1000) == 1)
|
||||
{
|
||||
return _baseLvl;
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ public class L2Mentee
|
||||
else
|
||||
{
|
||||
_name = player.getName();
|
||||
_classId = player.getBaseClass();
|
||||
_classId = player.getBaseClassId();
|
||||
_currentLevel = player.getLevel();
|
||||
}
|
||||
}
|
||||
|
@ -129,7 +129,30 @@ public class ShortCuts implements IRestorable
|
||||
{
|
||||
if (_owner.removeAutoSoulShot(item.getId()))
|
||||
{
|
||||
_owner.sendPacket(new ExAutoSoulShot(item.getId(), 0));
|
||||
switch (item.getEtcItem().getDefaultAction())
|
||||
{
|
||||
case SOULSHOT:
|
||||
case FISHINGSHOT:
|
||||
{
|
||||
_owner.sendPacket(new ExAutoSoulShot(item.getId(), 0, 0));
|
||||
break;
|
||||
}
|
||||
case SPIRITSHOT:
|
||||
{
|
||||
_owner.sendPacket(new ExAutoSoulShot(item.getId(), 0, 1));
|
||||
break;
|
||||
}
|
||||
case SUMMON_SOULSHOT:
|
||||
{
|
||||
_owner.sendPacket(new ExAutoSoulShot(item.getId(), 0, 2));
|
||||
break;
|
||||
}
|
||||
case SUMMON_SPIRITSHOT:
|
||||
{
|
||||
_owner.sendPacket(new ExAutoSoulShot(item.getId(), 0, 3));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -138,7 +161,32 @@ public class ShortCuts implements IRestorable
|
||||
|
||||
for (int shotId : _owner.getAutoSoulShot())
|
||||
{
|
||||
_owner.sendPacket(new ExAutoSoulShot(shotId, 1));
|
||||
L2ItemInstance item = _owner.getInventory().getItemByObjectId(shotId);
|
||||
|
||||
switch (item.getEtcItem().getDefaultAction())
|
||||
{
|
||||
case SOULSHOT:
|
||||
case FISHINGSHOT:
|
||||
{
|
||||
_owner.sendPacket(new ExAutoSoulShot(shotId, 1, 0));
|
||||
break;
|
||||
}
|
||||
case SPIRITSHOT:
|
||||
{
|
||||
_owner.sendPacket(new ExAutoSoulShot(shotId, 1, 1));
|
||||
break;
|
||||
}
|
||||
case SUMMON_SOULSHOT:
|
||||
{
|
||||
_owner.sendPacket(new ExAutoSoulShot(shotId, 1, 2));
|
||||
break;
|
||||
}
|
||||
case SUMMON_SPIRITSHOT:
|
||||
{
|
||||
_owner.sendPacket(new ExAutoSoulShot(shotId, 1, 3));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,6 +86,7 @@ import com.l2jserver.gameserver.model.actor.tasks.character.QueuedMagicUseTask;
|
||||
import com.l2jserver.gameserver.model.actor.templates.L2CharTemplate;
|
||||
import com.l2jserver.gameserver.model.actor.transform.Transform;
|
||||
import com.l2jserver.gameserver.model.actor.transform.TransformTemplate;
|
||||
import com.l2jserver.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jserver.gameserver.model.effects.EffectFlag;
|
||||
import com.l2jserver.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jserver.gameserver.model.entity.Instance;
|
||||
@ -119,6 +120,7 @@ import com.l2jserver.gameserver.model.options.OptionsSkillHolder;
|
||||
import com.l2jserver.gameserver.model.options.OptionsSkillType;
|
||||
import com.l2jserver.gameserver.model.skills.AbnormalType;
|
||||
import com.l2jserver.gameserver.model.skills.AbnormalVisualEffect;
|
||||
import com.l2jserver.gameserver.model.skills.BlowSuccess;
|
||||
import com.l2jserver.gameserver.model.skills.BuffInfo;
|
||||
import com.l2jserver.gameserver.model.skills.CommonSkill;
|
||||
import com.l2jserver.gameserver.model.skills.EffectScope;
|
||||
@ -1853,7 +1855,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
if (!destroyItemByItemId("Consume", skill.getItemConsumeId(), skill.getItemConsumeCount(), null, true))
|
||||
{
|
||||
getActingPlayer().sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT2);
|
||||
getActingPlayer().sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT);
|
||||
abortCast();
|
||||
return;
|
||||
}
|
||||
@ -1880,7 +1882,18 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
// Send a Server->Client packet MagicSkillUser with target, displayId, level, skillTime, reuseDelay
|
||||
// to the L2Character AND to all L2PcInstance in the _KnownPlayers of the L2Character
|
||||
broadcastPacket(new MagicSkillUse(this, target, skill.getDisplayId(), skill.getDisplayLevel(), skillTime, reuseDelay));
|
||||
if (skill.getBlowChance() > 0)
|
||||
{
|
||||
for (AbstractEffect effect : skill.getEffects(EffectScope.GENERAL))
|
||||
{
|
||||
BlowSuccess.getInstance().set(this, skill, effect.calcSuccess(new BuffInfo(this, target, skill)));
|
||||
}
|
||||
broadcastPacket(new MagicSkillUse(this, target, skill.getDisplayId(), skill.getDisplayLevel(), skillTime, reuseDelay, BlowSuccess.getInstance().get(this, skill)));
|
||||
}
|
||||
else
|
||||
{
|
||||
broadcastPacket(new MagicSkillUse(this, target, skill.getDisplayId(), skill.getDisplayLevel(), skillTime, reuseDelay));
|
||||
}
|
||||
|
||||
// Send a system message to the player.
|
||||
if (isPlayer() && !skill.isAbnormalInstant())
|
||||
|
@ -395,7 +395,7 @@ public final class L2ClassMasterInstance extends L2MerchantInstance
|
||||
{
|
||||
if (player.getInventory().getInventoryItemCount(holder.getId(), -1) < holder.getCount())
|
||||
{
|
||||
player.sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT2);
|
||||
player.sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -419,11 +419,11 @@ public final class L2ClassMasterInstance extends L2MerchantInstance
|
||||
|
||||
if (player.isSubClassActive())
|
||||
{
|
||||
player.getSubClasses().get(player.getClassIndex()).setClassId(player.getActiveClass());
|
||||
player.getSubClasses().get(player.getClassIndex()).setClassId(player.getActiveClassId());
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setBaseClass(player.getActiveClass());
|
||||
player.setBaseClassId(player.getActiveClassId());
|
||||
}
|
||||
|
||||
player.broadcastUserInfo();
|
||||
|
@ -429,6 +429,7 @@ public final class L2PcInstance extends L2Playable
|
||||
private long _uptime;
|
||||
|
||||
private final ReentrantLock _subclassLock = new ReentrantLock();
|
||||
protected int _initialClass;
|
||||
protected int _baseClass;
|
||||
protected int _activeClass;
|
||||
protected int _classIndex = 0;
|
||||
@ -954,6 +955,8 @@ public final class L2PcInstance extends L2Playable
|
||||
player.setName(name);
|
||||
// Set Character's create time
|
||||
player.setCreateDate(Calendar.getInstance());
|
||||
// Set the initial class ID to that of the actual class ID.
|
||||
player.setInitialClassId(player.getClassId().getId());
|
||||
// Set the base class ID to that of the actual class ID.
|
||||
player.setBaseClass(player.getClassId());
|
||||
// Give 20 recommendations
|
||||
@ -1234,14 +1237,19 @@ public final class L2PcInstance extends L2Playable
|
||||
return super.getLevelMod();
|
||||
}
|
||||
|
||||
public void setBaseClass(int baseClass)
|
||||
public void setInitialClassId(int classId)
|
||||
{
|
||||
_initialClass = classId;
|
||||
}
|
||||
|
||||
public void setBaseClassId(int baseClass)
|
||||
{
|
||||
_baseClass = baseClass;
|
||||
}
|
||||
|
||||
public void setBaseClass(ClassId classId)
|
||||
{
|
||||
_baseClass = classId.ordinal();
|
||||
_baseClass = classId.getId();
|
||||
}
|
||||
|
||||
public boolean isInStoreMode()
|
||||
@ -3125,7 +3133,7 @@ public final class L2PcInstance extends L2Playable
|
||||
{
|
||||
if (sendMessage)
|
||||
{
|
||||
sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT2);
|
||||
sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -3459,7 +3467,7 @@ public final class L2PcInstance extends L2Playable
|
||||
{
|
||||
if (sendMessage)
|
||||
{
|
||||
sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT2);
|
||||
sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -3519,7 +3527,7 @@ public final class L2PcInstance extends L2Playable
|
||||
{
|
||||
if (sendMessage)
|
||||
{
|
||||
sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT2);
|
||||
sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT);
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -3544,7 +3552,7 @@ public final class L2PcInstance extends L2Playable
|
||||
{
|
||||
if (sendMessage)
|
||||
{
|
||||
sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT2);
|
||||
sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT);
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -3576,7 +3584,7 @@ public final class L2PcInstance extends L2Playable
|
||||
{
|
||||
if (sendMessage)
|
||||
{
|
||||
sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT2);
|
||||
sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT);
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -3771,7 +3779,7 @@ public final class L2PcInstance extends L2Playable
|
||||
{
|
||||
if (sendMessage)
|
||||
{
|
||||
sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT2);
|
||||
sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT);
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -3864,7 +3872,7 @@ public final class L2PcInstance extends L2Playable
|
||||
{
|
||||
if (sendMessage)
|
||||
{
|
||||
sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT2);
|
||||
sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT);
|
||||
}
|
||||
|
||||
return null;
|
||||
@ -6616,7 +6624,7 @@ public final class L2PcInstance extends L2Playable
|
||||
{
|
||||
// You can't mount, dismount, break and drop items while fishing
|
||||
sendPacket(ActionFailed.STATIC_PACKET);
|
||||
sendPacket(SystemMessageId.YOU_CANNOT_DO_THAT_WHILE_FISHING2);
|
||||
sendPacket(SystemMessageId.YOU_CANNOT_DO_THAT_WHILE_FISHING);
|
||||
return false;
|
||||
}
|
||||
else if (isTransformed() || isCursedWeaponEquipped())
|
||||
@ -7020,7 +7028,7 @@ public final class L2PcInstance extends L2Playable
|
||||
ps.setInt(30, isOnlineInt());
|
||||
ps.setInt(31, getClanPrivileges().getBitmask());
|
||||
ps.setInt(32, getWantsPeace());
|
||||
ps.setInt(33, getBaseClass());
|
||||
ps.setInt(33, getBaseClassId());
|
||||
ps.setInt(34, isNoble() ? 1 : 0);
|
||||
ps.setLong(35, 0);
|
||||
ps.setTimestamp(36, new Timestamp(getCreateDate().getTimeInMillis()));
|
||||
@ -7125,18 +7133,18 @@ public final class L2PcInstance extends L2Playable
|
||||
player._classIndex = 0;
|
||||
try
|
||||
{
|
||||
player.setBaseClass(rset.getInt("base_class"));
|
||||
player.setBaseClassId(rset.getInt("base_class"));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// TODO: Should this be logged?
|
||||
player.setBaseClass(activeClassId);
|
||||
player.setBaseClassId(activeClassId);
|
||||
}
|
||||
player.setInitialClassId(ClassId.getInitialClassId(player));
|
||||
|
||||
// Restore Subclass Data (cannot be done earlier in function)
|
||||
if (restoreSubClassData(player))
|
||||
{
|
||||
if (activeClassId != player.getBaseClass())
|
||||
if (activeClassId != player.getBaseClassId())
|
||||
{
|
||||
for (SubClass subClass : player.getSubClasses().values())
|
||||
{
|
||||
@ -7147,12 +7155,12 @@ public final class L2PcInstance extends L2Playable
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((player.getClassIndex() == 0) && (activeClassId != player.getBaseClass()))
|
||||
if ((player.getClassIndex() == 0) && (activeClassId != player.getBaseClassId()))
|
||||
{
|
||||
// Subclass in use but doesn't exist in DB -
|
||||
// a possible restart-while-modifysubclass cheat has been attempted.
|
||||
// Switching to use base class
|
||||
player.setClassId(player.getBaseClass());
|
||||
player.setClassId(player.getBaseClassId());
|
||||
_log.warning("Player " + player.getName() + " reverted to base class. Possibly has tried a relogin exploit while subclassing.");
|
||||
}
|
||||
else
|
||||
@ -7651,7 +7659,7 @@ public final class L2PcInstance extends L2Playable
|
||||
ps.setInt(31, isOnlineInt());
|
||||
ps.setInt(32, getClanPrivileges().getBitmask());
|
||||
ps.setInt(33, getWantsPeace());
|
||||
ps.setInt(34, getBaseClass());
|
||||
ps.setInt(34, getBaseClassId());
|
||||
|
||||
long totalOnlineTime = _onlineTime;
|
||||
if (_onlineBeginTime > 0)
|
||||
@ -9657,8 +9665,32 @@ public final class L2PcInstance extends L2Playable
|
||||
{
|
||||
if (_activeSoulShots.contains(itemId))
|
||||
{
|
||||
removeAutoSoulShot(itemId);
|
||||
sendPacket(new ExAutoSoulShot(itemId, 0));
|
||||
final L2ItemInstance item = getInventory().getItemByItemId(itemId);
|
||||
|
||||
switch (item.getEtcItem().getDefaultAction())
|
||||
{
|
||||
case SOULSHOT:
|
||||
case FISHINGSHOT:
|
||||
{
|
||||
sendPacket(new ExAutoSoulShot(itemId, 0, 0));
|
||||
break;
|
||||
}
|
||||
case SPIRITSHOT:
|
||||
{
|
||||
sendPacket(new ExAutoSoulShot(itemId, 0, 1));
|
||||
break;
|
||||
}
|
||||
case SUMMON_SOULSHOT:
|
||||
{
|
||||
sendPacket(new ExAutoSoulShot(itemId, 0, 2));
|
||||
break;
|
||||
}
|
||||
case SUMMON_SPIRITSHOT:
|
||||
{
|
||||
sendPacket(new ExAutoSoulShot(itemId, 0, 3));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_AUTOMATIC_USE_OF_S1_HAS_BEEN_DEACTIVATED);
|
||||
sm.addItemName(itemId);
|
||||
@ -9675,7 +9707,33 @@ public final class L2PcInstance extends L2Playable
|
||||
{
|
||||
for (int itemId : _activeSoulShots)
|
||||
{
|
||||
sendPacket(new ExAutoSoulShot(itemId, 0));
|
||||
final L2ItemInstance item = getInventory().getItemByItemId(itemId);
|
||||
|
||||
switch (item.getEtcItem().getDefaultAction())
|
||||
{
|
||||
case SOULSHOT:
|
||||
case FISHINGSHOT:
|
||||
{
|
||||
sendPacket(new ExAutoSoulShot(itemId, 0, 0));
|
||||
break;
|
||||
}
|
||||
case SPIRITSHOT:
|
||||
{
|
||||
sendPacket(new ExAutoSoulShot(itemId, 0, 1));
|
||||
break;
|
||||
}
|
||||
case SUMMON_SOULSHOT:
|
||||
{
|
||||
sendPacket(new ExAutoSoulShot(itemId, 0, 2));
|
||||
break;
|
||||
}
|
||||
case SUMMON_SPIRITSHOT:
|
||||
{
|
||||
sendPacket(new ExAutoSoulShot(itemId, 0, 3));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_AUTOMATIC_USE_OF_S1_HAS_BEEN_DEACTIVATED);
|
||||
sm.addItemName(itemId);
|
||||
sendPacket(sm);
|
||||
@ -10573,12 +10631,27 @@ public final class L2PcInstance extends L2Playable
|
||||
return getSubClasses().size();
|
||||
}
|
||||
|
||||
public int getBaseClass()
|
||||
public int getInitialClassId()
|
||||
{
|
||||
return _initialClass;
|
||||
}
|
||||
|
||||
public ClassId getInitialClass()
|
||||
{
|
||||
return ClassId.getClassId(_initialClass);
|
||||
}
|
||||
|
||||
public int getBaseClassId()
|
||||
{
|
||||
return _baseClass;
|
||||
}
|
||||
|
||||
public int getActiveClass()
|
||||
public ClassId getBaseClass()
|
||||
{
|
||||
return ClassId.getClassId(_baseClass);
|
||||
}
|
||||
|
||||
public int getActiveClassId()
|
||||
{
|
||||
return _activeClass;
|
||||
}
|
||||
@ -10663,7 +10736,7 @@ public final class L2PcInstance extends L2Playable
|
||||
|
||||
if (classIndex == 0)
|
||||
{
|
||||
setClassTemplate(getBaseClass());
|
||||
setClassTemplate(getBaseClassId());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -14888,7 +14961,7 @@ public final class L2PcInstance extends L2Playable
|
||||
|
||||
public boolean isAwaken()
|
||||
{
|
||||
if (((getActiveClass() >= 139) && (getActiveClass() <= 181)) || (getActiveClass() >= 188))
|
||||
if (((getActiveClassId() >= 139) && (getActiveClassId() <= 181)) || (getActiveClassId() >= 188))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -15298,7 +15371,7 @@ public final class L2PcInstance extends L2Playable
|
||||
*/
|
||||
public int getVitalityPoints()
|
||||
{
|
||||
if (getClassId().getId() == getBaseClass())
|
||||
if (getClassId().getId() == getBaseClassId())
|
||||
{
|
||||
return _vitalityPoints;
|
||||
}
|
||||
@ -15311,7 +15384,7 @@ public final class L2PcInstance extends L2Playable
|
||||
|
||||
public void setVitalityPoints(int points)
|
||||
{
|
||||
if (getClassId().getId() == getBaseClass())
|
||||
if (getClassId().getId() == getBaseClassId())
|
||||
{
|
||||
_vitalityPoints = points;
|
||||
return;
|
||||
|
@ -395,7 +395,7 @@ public class L2PetInstance extends L2Summon
|
||||
{
|
||||
if (sendMessage)
|
||||
{
|
||||
sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT2);
|
||||
sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT);
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -443,7 +443,7 @@ public class L2PetInstance extends L2Summon
|
||||
{
|
||||
if (sendMessage)
|
||||
{
|
||||
sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT2);
|
||||
sendPacket(SystemMessageId.INCORRECT_ITEM_COUNT);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -218,8 +218,6 @@ public final class L2TeleporterInstance extends L2Npc
|
||||
}
|
||||
|
||||
/**
|
||||
* For characters below level 77 teleport service is free.<br>
|
||||
* From 8.00 pm to 00.00 from Monday till Tuesday for all characters there's a 50% discount on teleportation services
|
||||
* @param player
|
||||
* @param type
|
||||
* @param loc
|
||||
@ -247,7 +245,7 @@ public final class L2TeleporterInstance extends L2Npc
|
||||
|
||||
protected boolean shouldPayFee(L2PcInstance player, TeleportType type, TeleportLocation loc)
|
||||
{
|
||||
return (type != TeleportType.NORMAL) || (!Config.ALT_GAME_FREE_TELEPORT && ((player.getLevel() > 76) || player.isSubClassActive()) && ((loc.getFeeId() != 0) && (loc.getFeeCount() > 0)));
|
||||
return (type != TeleportType.NORMAL) || (!Config.FREE_TELEPORTING && ((player.getLevel() > 76) || player.isSubClassActive()) && ((loc.getFeeId() != 0) && (loc.getFeeCount() > 0)));
|
||||
}
|
||||
|
||||
protected int parseNextInt(StringTokenizer st, int defaultVal)
|
||||
@ -556,7 +554,7 @@ public final class L2TeleporterInstance extends L2Npc
|
||||
}
|
||||
}
|
||||
|
||||
if (Config.ALT_GAME_FREE_TELEPORT || player.destroyItemByItemId("Teleport " + (list.getIsForNoble() ? " nobless" : ""), list.getItemId(), price, this, true))
|
||||
if (Config.FREE_TELEPORTING || player.destroyItemByItemId("Teleport " + (list.getIsForNoble() ? " nobless" : ""), list.getItemId(), price, this, true))
|
||||
{
|
||||
if (Config.DEBUG)
|
||||
{
|
||||
|
@ -22,6 +22,7 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.l2jserver.gameserver.enums.Race;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.interfaces.IIdentifiable;
|
||||
|
||||
/**
|
||||
@ -377,7 +378,7 @@ public enum ClassId implements IIdentifiable
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the child level of this Class (0=root, 1=child leve 1...)
|
||||
* @return the level of this Class (0=initial, 4=awaken...)
|
||||
*/
|
||||
public final int level()
|
||||
{
|
||||
@ -421,4 +422,64 @@ public enum ClassId implements IIdentifiable
|
||||
{
|
||||
_nextClassIds.add(cId);
|
||||
}
|
||||
|
||||
public static int getInitialClassId(L2PcInstance player)
|
||||
{
|
||||
switch (player.getBaseClass().getRace())
|
||||
{
|
||||
case HUMAN:
|
||||
{
|
||||
if (player.getClassId().isMage())
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
case ELF:
|
||||
{
|
||||
if (player.getClassId().isMage())
|
||||
{
|
||||
return 25;
|
||||
}
|
||||
return 18;
|
||||
}
|
||||
case DARK_ELF:
|
||||
{
|
||||
if (player.getClassId().isMage())
|
||||
{
|
||||
return 38;
|
||||
}
|
||||
return 31;
|
||||
}
|
||||
case ORC:
|
||||
{
|
||||
if (player.getClassId().isMage())
|
||||
{
|
||||
return 49;
|
||||
}
|
||||
return 44;
|
||||
}
|
||||
case DWARF:
|
||||
{
|
||||
return 53;
|
||||
}
|
||||
case KAMAEL:
|
||||
{
|
||||
if (player.getAppearance().getSex())
|
||||
{
|
||||
return 124;
|
||||
}
|
||||
return 123;
|
||||
}
|
||||
case ERTHEIA:
|
||||
{
|
||||
if (player.getClassId().isMage())
|
||||
{
|
||||
return 183;
|
||||
}
|
||||
return 182;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ public class PledgeApplicantInfo
|
||||
|
||||
public int getClassId()
|
||||
{
|
||||
if (isOnline() && (getPlayerInstance().getBaseClass() != _classId))
|
||||
if (isOnline() && (getPlayerInstance().getBaseClassId() != _classId))
|
||||
{
|
||||
_classId = getPlayerInstance().getClassId().getId();
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ public class PledgeWaitingInfo
|
||||
|
||||
public int getPlayerClassId()
|
||||
{
|
||||
if (isOnline() && (getPlayerInstance().getBaseClass() != _playerClassId))
|
||||
if (isOnline() && (getPlayerInstance().getBaseClassId() != _playerClassId))
|
||||
{
|
||||
_playerClassId = getPlayerInstance().getClassId().getId();
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ public final class AuctionableHall extends ClanHall
|
||||
{
|
||||
ClanHallAuctionManager.getInstance().initNPC(getId());
|
||||
ClanHallManager.getInstance().setFree(getId());
|
||||
Clan.broadcastToOnlineMembers(SystemMessage.getSystemMessage(SystemMessageId.THE_CLAN_HALL_FEE_IS_ONE_WEEK_OVERDUE_THEREFORE_THE_CLAN_HALL_OWNERSHIP_HAS_BEEN_REVOKED));
|
||||
Clan.broadcastToOnlineMembers(SystemMessage.getSystemMessage(SystemMessageId.THE_CLAN_HALL_FEE_IS_ONE_WEEK_OVERDUE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2015 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.holders;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public class DailyMissionHolder
|
||||
{
|
||||
private final int _id;
|
||||
private final int _clientId;
|
||||
private final String _type;
|
||||
private final int _level;
|
||||
private final List<Integer> _classes;
|
||||
private final Map<Integer, Integer> _rewards;
|
||||
|
||||
public DailyMissionHolder(int id, int clientId, String type, int level, List<Integer> classes, Map<Integer, Integer> rewards)
|
||||
{
|
||||
_id = id;
|
||||
_clientId = clientId;
|
||||
_type = type;
|
||||
_level = level;
|
||||
_classes = classes;
|
||||
_rewards = rewards;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the id
|
||||
*/
|
||||
public int getId()
|
||||
{
|
||||
return _id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the clientId
|
||||
*/
|
||||
public int getClientId()
|
||||
{
|
||||
return _clientId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the type
|
||||
*/
|
||||
public String getType()
|
||||
{
|
||||
return _type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the level
|
||||
*/
|
||||
public int getLevel()
|
||||
{
|
||||
return _level;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the classes
|
||||
*/
|
||||
public List<Integer> getAvailableClasses()
|
||||
{
|
||||
return _classes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the rewards
|
||||
*/
|
||||
public Map<Integer, Integer> getRewards()
|
||||
{
|
||||
return _rewards;
|
||||
}
|
||||
}
|
@ -71,38 +71,113 @@ public abstract class Inventory extends ItemContainer
|
||||
public static final long MAX_ADENA = Config.MAX_ADENA;
|
||||
|
||||
public static final int PAPERDOLL_UNDER = 0;
|
||||
public static final int PAPERDOLL_HEAD = 1;
|
||||
public static final int PAPERDOLL_HAIR = 2;
|
||||
public static final int PAPERDOLL_HAIR2 = 3;
|
||||
public static final int PAPERDOLL_NECK = 4;
|
||||
public static final int PAPERDOLL_RHAND = 5;
|
||||
public static final int PAPERDOLL_CHEST = 6;
|
||||
public static final int PAPERDOLL_LHAND = 7;
|
||||
public static final int PAPERDOLL_REAR = 8;
|
||||
public static final int PAPERDOLL_LEAR = 9;
|
||||
public static final int PAPERDOLL_GLOVES = 10;
|
||||
public static final int PAPERDOLL_REAR = 1;
|
||||
public static final int PAPERDOLL_LEAR = 2;
|
||||
public static final int PAPERDOLL_NECK = 3;
|
||||
public static final int PAPERDOLL_RFINGER = 4;
|
||||
public static final int PAPERDOLL_LFINGER = 5;
|
||||
public static final int PAPERDOLL_HEAD = 6;
|
||||
public static final int PAPERDOLL_RHAND = 7;
|
||||
public static final int PAPERDOLL_LHAND = 8;
|
||||
public static final int PAPERDOLL_GLOVES = 9;
|
||||
public static final int PAPERDOLL_CHEST = 10;
|
||||
public static final int PAPERDOLL_LEGS = 11;
|
||||
public static final int PAPERDOLL_FEET = 12;
|
||||
public static final int PAPERDOLL_RFINGER = 13;
|
||||
public static final int PAPERDOLL_LFINGER = 14;
|
||||
public static final int PAPERDOLL_LBRACELET = 15;
|
||||
public static final int PAPERDOLL_RBRACELET = 16;
|
||||
public static final int PAPERDOLL_DECO1 = 17;
|
||||
public static final int PAPERDOLL_DECO2 = 18;
|
||||
public static final int PAPERDOLL_DECO3 = 19;
|
||||
public static final int PAPERDOLL_DECO4 = 20;
|
||||
public static final int PAPERDOLL_DECO5 = 21;
|
||||
public static final int PAPERDOLL_DECO6 = 22;
|
||||
public static final int PAPERDOLL_CLOAK = 23;
|
||||
public static final int PAPERDOLL_BELT = 24;
|
||||
public static final int PAPERDOLL_BROOCH = 25;
|
||||
public static final int PAPERDOLL_BROOCH_JEWEL1 = 26;
|
||||
public static final int PAPERDOLL_BROOCH_JEWEL2 = 27;
|
||||
public static final int PAPERDOLL_BROOCH_JEWEL3 = 28;
|
||||
public static final int PAPERDOLL_BROOCH_JEWEL4 = 29;
|
||||
public static final int PAPERDOLL_BROOCH_JEWEL5 = 30;
|
||||
public static final int PAPERDOLL_BROOCH_JEWEL6 = 31;
|
||||
public static final int PAPERDOLL_TOTALSLOTS = 32;
|
||||
public static final int PAPERDOLL_CLOAK = 13;
|
||||
public static final int PAPERDOLL_LRHAND = 14;
|
||||
public static final int PAPERDOLL_HAIR = 15;
|
||||
public static final int PAPERDOLL_DHAIR = 16;
|
||||
public static final int PAPERDOLL_RBRACELET = 17;
|
||||
public static final int PAPERDOLL_LBRACELET = 18;
|
||||
public static final int PAPERDOLL_TALISMAN1 = 19;
|
||||
public static final int PAPERDOLL_TALISMAN2 = 20;
|
||||
public static final int PAPERDOLL_TALISMAN3 = 21;
|
||||
public static final int PAPERDOLL_TALISMAN4 = 22;
|
||||
public static final int PAPERDOLL_TALISMAN5 = 23;
|
||||
public static final int PAPERDOLL_TALISMAN6 = 24;
|
||||
public static final int PAPERDOLL_BELT = 25;
|
||||
public static final int PAPERDOLL_BROOCH = 26;
|
||||
public static final int PAPERDOLL_BROOCH_STONE1 = 27;
|
||||
public static final int PAPERDOLL_BROOCH_STONE2 = 28;
|
||||
public static final int PAPERDOLL_BROOCH_STONE3 = 29;
|
||||
public static final int PAPERDOLL_BROOCH_STONE4 = 30;
|
||||
public static final int PAPERDOLL_BROOCH_STONE5 = 31;
|
||||
public static final int PAPERDOLL_BROOCH_STONE6 = 32;
|
||||
|
||||
public static final int PAPERDOLL_TOTALSLOTS = 33;
|
||||
|
||||
public static final int[] PAPERDOLL_ORDER = new int[]
|
||||
{
|
||||
Inventory.PAPERDOLL_UNDER,
|
||||
Inventory.PAPERDOLL_HEAD,
|
||||
Inventory.PAPERDOLL_RHAND,
|
||||
Inventory.PAPERDOLL_LHAND,
|
||||
Inventory.PAPERDOLL_GLOVES,
|
||||
Inventory.PAPERDOLL_CHEST,
|
||||
Inventory.PAPERDOLL_LEGS,
|
||||
Inventory.PAPERDOLL_FEET,
|
||||
Inventory.PAPERDOLL_CLOAK,
|
||||
Inventory.PAPERDOLL_LRHAND,
|
||||
Inventory.PAPERDOLL_HAIR,
|
||||
Inventory.PAPERDOLL_DHAIR
|
||||
};
|
||||
|
||||
public static final int[] PAPERDOLL_ORDER_ALL =
|
||||
{
|
||||
Inventory.PAPERDOLL_UNDER,
|
||||
Inventory.PAPERDOLL_REAR,
|
||||
Inventory.PAPERDOLL_LEAR,
|
||||
Inventory.PAPERDOLL_NECK,
|
||||
Inventory.PAPERDOLL_RFINGER,
|
||||
Inventory.PAPERDOLL_LFINGER,
|
||||
Inventory.PAPERDOLL_HEAD,
|
||||
Inventory.PAPERDOLL_RHAND,
|
||||
Inventory.PAPERDOLL_LHAND,
|
||||
Inventory.PAPERDOLL_GLOVES,
|
||||
Inventory.PAPERDOLL_CHEST,
|
||||
Inventory.PAPERDOLL_LEGS,
|
||||
Inventory.PAPERDOLL_FEET,
|
||||
Inventory.PAPERDOLL_CLOAK,
|
||||
Inventory.PAPERDOLL_LRHAND,
|
||||
Inventory.PAPERDOLL_HAIR,
|
||||
Inventory.PAPERDOLL_DHAIR,
|
||||
Inventory.PAPERDOLL_RBRACELET,
|
||||
Inventory.PAPERDOLL_LBRACELET,
|
||||
Inventory.PAPERDOLL_TALISMAN1,
|
||||
Inventory.PAPERDOLL_TALISMAN2,
|
||||
Inventory.PAPERDOLL_TALISMAN3,
|
||||
Inventory.PAPERDOLL_TALISMAN4,
|
||||
Inventory.PAPERDOLL_TALISMAN5,
|
||||
Inventory.PAPERDOLL_TALISMAN6,
|
||||
Inventory.PAPERDOLL_BELT,
|
||||
Inventory.PAPERDOLL_BROOCH,
|
||||
Inventory.PAPERDOLL_BROOCH_STONE1,
|
||||
Inventory.PAPERDOLL_BROOCH_STONE2,
|
||||
Inventory.PAPERDOLL_BROOCH_STONE3,
|
||||
Inventory.PAPERDOLL_BROOCH_STONE4,
|
||||
Inventory.PAPERDOLL_BROOCH_STONE5,
|
||||
Inventory.PAPERDOLL_BROOCH_STONE6
|
||||
};
|
||||
|
||||
public static final int[] PAPERDOLL_ORDER_AUGMENT = new int[]
|
||||
{
|
||||
Inventory.PAPERDOLL_RHAND,
|
||||
Inventory.PAPERDOLL_LHAND,
|
||||
Inventory.PAPERDOLL_LRHAND
|
||||
};
|
||||
|
||||
public static final int[] PAPERDOLL_ORDER_VISUAL_ID = new int[]
|
||||
{
|
||||
Inventory.PAPERDOLL_RHAND,
|
||||
Inventory.PAPERDOLL_LHAND,
|
||||
Inventory.PAPERDOLL_GLOVES,
|
||||
Inventory.PAPERDOLL_CHEST,
|
||||
Inventory.PAPERDOLL_LEGS,
|
||||
Inventory.PAPERDOLL_FEET,
|
||||
Inventory.PAPERDOLL_LRHAND,
|
||||
Inventory.PAPERDOLL_HAIR,
|
||||
Inventory.PAPERDOLL_DHAIR
|
||||
};
|
||||
|
||||
// Speed percentage mods
|
||||
public static final double MAX_ARMOR_WEIGHT = 12000;
|
||||
@ -848,12 +923,12 @@ public abstract class Inventory extends ItemContainer
|
||||
{
|
||||
if (item.getItem().getBodyPart() == L2Item.SLOT_R_BRACELET)
|
||||
{
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_DECO1);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_DECO2);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_DECO3);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_DECO4);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_DECO5);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_DECO6);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_TALISMAN1);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_TALISMAN2);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_TALISMAN3);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_TALISMAN4);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_TALISMAN5);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_TALISMAN6);
|
||||
}
|
||||
}
|
||||
|
||||
@ -878,12 +953,12 @@ public abstract class Inventory extends ItemContainer
|
||||
{
|
||||
if (item.getItem().getBodyPart() == L2Item.SLOT_BROOCH)
|
||||
{
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_BROOCH_JEWEL1);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_BROOCH_JEWEL2);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_BROOCH_JEWEL3);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_BROOCH_JEWEL4);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_BROOCH_JEWEL5);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_BROOCH_JEWEL6);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_BROOCH_STONE1);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_BROOCH_STONE2);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_BROOCH_STONE3);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_BROOCH_STONE4);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_BROOCH_STONE5);
|
||||
inventory.unEquipItemInSlot(PAPERDOLL_BROOCH_STONE6);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1092,19 +1167,19 @@ public abstract class Inventory extends ItemContainer
|
||||
case L2Item.SLOT_HAIRALL:
|
||||
return PAPERDOLL_HAIR;
|
||||
case L2Item.SLOT_HAIR2:
|
||||
return PAPERDOLL_HAIR2;
|
||||
return PAPERDOLL_DHAIR;
|
||||
case L2Item.SLOT_R_BRACELET:
|
||||
return PAPERDOLL_RBRACELET;
|
||||
case L2Item.SLOT_L_BRACELET:
|
||||
return PAPERDOLL_LBRACELET;
|
||||
case L2Item.SLOT_DECO:
|
||||
return PAPERDOLL_DECO1; // return first we deal with it later
|
||||
return PAPERDOLL_TALISMAN1; // return first we deal with it later
|
||||
case L2Item.SLOT_BELT:
|
||||
return PAPERDOLL_BELT;
|
||||
case L2Item.SLOT_BROOCH:
|
||||
return PAPERDOLL_BROOCH;
|
||||
case L2Item.SLOT_BROOCH_JEWEL:
|
||||
return PAPERDOLL_BROOCH_JEWEL1;
|
||||
return PAPERDOLL_BROOCH_STONE1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@ -1167,6 +1242,16 @@ public abstract class Inventory extends ItemContainer
|
||||
return ((item != null) && (item.getAugmentation() != null)) ? item.getAugmentation().getAugmentationId() : 0;
|
||||
}
|
||||
|
||||
public int getPaperdoll1stAugmentationId(int slot)
|
||||
{
|
||||
return 0x0000FFFF & getPaperdollAugmentationId(slot);
|
||||
}
|
||||
|
||||
public int getPaperdoll2ndAugmentationId(int slot)
|
||||
{
|
||||
return getPaperdollAugmentationId(slot) >> 16;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the objectID associated to the item in the paperdoll slot
|
||||
* @param slot : int pointing out the slot
|
||||
@ -1303,7 +1388,7 @@ public abstract class Inventory extends ItemContainer
|
||||
case PAPERDOLL_HAIR:
|
||||
slot = L2Item.SLOT_HAIR;
|
||||
break;
|
||||
case PAPERDOLL_HAIR2:
|
||||
case PAPERDOLL_DHAIR:
|
||||
slot = L2Item.SLOT_HAIR2;
|
||||
break;
|
||||
case PAPERDOLL_HEAD:
|
||||
@ -1336,12 +1421,12 @@ public abstract class Inventory extends ItemContainer
|
||||
case PAPERDOLL_RBRACELET:
|
||||
slot = L2Item.SLOT_R_BRACELET;
|
||||
break;
|
||||
case PAPERDOLL_DECO1:
|
||||
case PAPERDOLL_DECO2:
|
||||
case PAPERDOLL_DECO3:
|
||||
case PAPERDOLL_DECO4:
|
||||
case PAPERDOLL_DECO5:
|
||||
case PAPERDOLL_DECO6:
|
||||
case PAPERDOLL_TALISMAN1:
|
||||
case PAPERDOLL_TALISMAN2:
|
||||
case PAPERDOLL_TALISMAN3:
|
||||
case PAPERDOLL_TALISMAN4:
|
||||
case PAPERDOLL_TALISMAN5:
|
||||
case PAPERDOLL_TALISMAN6:
|
||||
slot = L2Item.SLOT_DECO;
|
||||
break;
|
||||
case PAPERDOLL_BELT:
|
||||
@ -1350,12 +1435,12 @@ public abstract class Inventory extends ItemContainer
|
||||
case PAPERDOLL_BROOCH:
|
||||
slot = L2Item.SLOT_BROOCH;
|
||||
break;
|
||||
case PAPERDOLL_BROOCH_JEWEL1:
|
||||
case PAPERDOLL_BROOCH_JEWEL2:
|
||||
case PAPERDOLL_BROOCH_JEWEL3:
|
||||
case PAPERDOLL_BROOCH_JEWEL4:
|
||||
case PAPERDOLL_BROOCH_JEWEL5:
|
||||
case PAPERDOLL_BROOCH_JEWEL6:
|
||||
case PAPERDOLL_BROOCH_STONE1:
|
||||
case PAPERDOLL_BROOCH_STONE2:
|
||||
case PAPERDOLL_BROOCH_STONE3:
|
||||
case PAPERDOLL_BROOCH_STONE4:
|
||||
case PAPERDOLL_BROOCH_STONE5:
|
||||
case PAPERDOLL_BROOCH_STONE6:
|
||||
slot = L2Item.SLOT_BROOCH_JEWEL;
|
||||
break;
|
||||
}
|
||||
@ -1453,7 +1538,7 @@ public abstract class Inventory extends ItemContainer
|
||||
pdollSlot = PAPERDOLL_HAIR;
|
||||
break;
|
||||
case L2Item.SLOT_HAIR2:
|
||||
pdollSlot = PAPERDOLL_HAIR2;
|
||||
pdollSlot = PAPERDOLL_DHAIR;
|
||||
break;
|
||||
case L2Item.SLOT_HAIRALL:
|
||||
setPaperdollItem(PAPERDOLL_HAIR, null);
|
||||
@ -1496,7 +1581,7 @@ public abstract class Inventory extends ItemContainer
|
||||
pdollSlot = PAPERDOLL_RBRACELET;
|
||||
break;
|
||||
case L2Item.SLOT_DECO:
|
||||
pdollSlot = PAPERDOLL_DECO1;
|
||||
pdollSlot = PAPERDOLL_TALISMAN1;
|
||||
break;
|
||||
case L2Item.SLOT_BELT:
|
||||
pdollSlot = PAPERDOLL_BELT;
|
||||
@ -1505,7 +1590,7 @@ public abstract class Inventory extends ItemContainer
|
||||
pdollSlot = PAPERDOLL_BROOCH;
|
||||
break;
|
||||
case L2Item.SLOT_BROOCH_JEWEL:
|
||||
pdollSlot = PAPERDOLL_BROOCH_JEWEL1;
|
||||
pdollSlot = PAPERDOLL_BROOCH_STONE1;
|
||||
break;
|
||||
default:
|
||||
_log.info("Unhandled slot type: " + slot);
|
||||
@ -1684,7 +1769,7 @@ public abstract class Inventory extends ItemContainer
|
||||
L2ItemInstance hair = getPaperdollItem(PAPERDOLL_HAIR);
|
||||
if ((hair != null) && (hair.getItem().getBodyPart() == L2Item.SLOT_HAIRALL))
|
||||
{
|
||||
setPaperdollItem(PAPERDOLL_HAIR2, null);
|
||||
setPaperdollItem(PAPERDOLL_DHAIR, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1701,13 +1786,13 @@ public abstract class Inventory extends ItemContainer
|
||||
}
|
||||
else
|
||||
{
|
||||
setPaperdollItem(PAPERDOLL_HAIR2, null);
|
||||
setPaperdollItem(PAPERDOLL_DHAIR, null);
|
||||
}
|
||||
|
||||
setPaperdollItem(PAPERDOLL_HAIR2, item);
|
||||
setPaperdollItem(PAPERDOLL_DHAIR, item);
|
||||
break;
|
||||
case L2Item.SLOT_HAIRALL:
|
||||
setPaperdollItem(PAPERDOLL_HAIR2, null);
|
||||
setPaperdollItem(PAPERDOLL_DHAIR, null);
|
||||
setPaperdollItem(PAPERDOLL_HAIR, item);
|
||||
break;
|
||||
case L2Item.SLOT_UNDERWEAR:
|
||||
@ -1893,7 +1978,7 @@ public abstract class Inventory extends ItemContainer
|
||||
}
|
||||
|
||||
// find same (or incompatible) talisman type
|
||||
for (int i = PAPERDOLL_DECO1; i < (PAPERDOLL_DECO1 + getTalismanSlots()); i++)
|
||||
for (int i = PAPERDOLL_TALISMAN1; i < (PAPERDOLL_TALISMAN1 + getTalismanSlots()); i++)
|
||||
{
|
||||
if (_paperdoll[i] != null)
|
||||
{
|
||||
@ -1907,7 +1992,7 @@ public abstract class Inventory extends ItemContainer
|
||||
}
|
||||
|
||||
// no free slot found - put on first free
|
||||
for (int i = PAPERDOLL_DECO1; i < (PAPERDOLL_DECO1 + getTalismanSlots()); i++)
|
||||
for (int i = PAPERDOLL_TALISMAN1; i < (PAPERDOLL_TALISMAN1 + getTalismanSlots()); i++)
|
||||
{
|
||||
if (_paperdoll[i] == null)
|
||||
{
|
||||
@ -1917,7 +2002,7 @@ public abstract class Inventory extends ItemContainer
|
||||
}
|
||||
|
||||
// no free slots - put on first
|
||||
setPaperdollItem(PAPERDOLL_DECO1, item);
|
||||
setPaperdollItem(PAPERDOLL_TALISMAN1, item);
|
||||
}
|
||||
|
||||
public int getBroochJewelSlots()
|
||||
@ -1933,7 +2018,7 @@ public abstract class Inventory extends ItemContainer
|
||||
}
|
||||
|
||||
// find same (or incompatible) brooch jewel type
|
||||
for (int i = PAPERDOLL_BROOCH_JEWEL1; i < (PAPERDOLL_BROOCH_JEWEL1 + getBroochJewelSlots()); i++)
|
||||
for (int i = PAPERDOLL_BROOCH_STONE1; i < (PAPERDOLL_BROOCH_STONE1 + getBroochJewelSlots()); i++)
|
||||
{
|
||||
if (_paperdoll[i] != null)
|
||||
{
|
||||
@ -1947,7 +2032,7 @@ public abstract class Inventory extends ItemContainer
|
||||
}
|
||||
|
||||
// no free slot found - put on first free
|
||||
for (int i = PAPERDOLL_BROOCH_JEWEL1; i < (PAPERDOLL_BROOCH_JEWEL1 + getBroochJewelSlots()); i++)
|
||||
for (int i = PAPERDOLL_BROOCH_STONE1; i < (PAPERDOLL_BROOCH_STONE1 + getBroochJewelSlots()); i++)
|
||||
{
|
||||
if (_paperdoll[i] == null)
|
||||
{
|
||||
@ -1957,7 +2042,7 @@ public abstract class Inventory extends ItemContainer
|
||||
}
|
||||
|
||||
// no free slots - put on first
|
||||
setPaperdollItem(PAPERDOLL_BROOCH_JEWEL1, item);
|
||||
setPaperdollItem(PAPERDOLL_BROOCH_STONE1, item);
|
||||
}
|
||||
|
||||
public boolean canEquipCloak()
|
||||
|
@ -879,7 +879,7 @@ public class PcInventory extends Inventory
|
||||
|
||||
public static int[][] restoreVisibleInventory(int objectId)
|
||||
{
|
||||
int[][] paperdoll = new int[33][4];
|
||||
int[][] paperdoll = new int[Inventory.PAPERDOLL_TOTALSLOTS][4];
|
||||
try (Connection con = ConnectionFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT object_id,item_id,loc_data,enchant_level FROM items WHERE owner_id=? AND loc='PAPERDOLL'"))
|
||||
{
|
||||
|
@ -114,18 +114,18 @@ public abstract class AbstractOlympiadGame
|
||||
{
|
||||
if ((player == null) || !player.isOnline())
|
||||
{
|
||||
return SystemMessage.getSystemMessage(SystemMessageId.YOUR_OPPONENT_MADE_HASTE_WITH_THEIR_TAIL_BETWEEN_THEIR_LEGS_THE_MATCH_HAS_BEEN_CANCELLED);
|
||||
return SystemMessage.getSystemMessage(SystemMessageId.YOUR_OPPONENT_MADE_HASTE_WITH_THEIR_TAIL_BETWEEN_THEIR_LEGS);
|
||||
}
|
||||
|
||||
if ((player.getClient() == null) || player.getClient().isDetached())
|
||||
{
|
||||
return SystemMessage.getSystemMessage(SystemMessageId.YOUR_OPPONENT_MADE_HASTE_WITH_THEIR_TAIL_BETWEEN_THEIR_LEGS_THE_MATCH_HAS_BEEN_CANCELLED);
|
||||
return SystemMessage.getSystemMessage(SystemMessageId.YOUR_OPPONENT_MADE_HASTE_WITH_THEIR_TAIL_BETWEEN_THEIR_LEGS);
|
||||
}
|
||||
|
||||
// safety precautions
|
||||
if (player.inObserverMode() || TvTEvent.isPlayerParticipant(player.getObjectId()))
|
||||
{
|
||||
return SystemMessage.getSystemMessage(SystemMessageId.YOUR_OPPONENT_DOES_NOT_MEET_THE_REQUIREMENTS_TO_DO_BATTLE_THE_MATCH_HAS_BEEN_CANCELLED);
|
||||
return SystemMessage.getSystemMessage(SystemMessageId.YOUR_OPPONENT_DOES_NOT_MEET_THE_REQUIREMENTS_TO_DO_BATTLE);
|
||||
}
|
||||
|
||||
SystemMessage sm;
|
||||
@ -134,14 +134,14 @@ public abstract class AbstractOlympiadGame
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_CURRENTLY_DEAD_AND_CANNOT_PARTICIPATE_IN_THE_OLYMPIAD);
|
||||
sm.addPcName(player);
|
||||
player.sendPacket(sm);
|
||||
return SystemMessage.getSystemMessage(SystemMessageId.YOUR_OPPONENT_DOES_NOT_MEET_THE_REQUIREMENTS_TO_DO_BATTLE_THE_MATCH_HAS_BEEN_CANCELLED);
|
||||
return SystemMessage.getSystemMessage(SystemMessageId.YOUR_OPPONENT_DOES_NOT_MEET_THE_REQUIREMENTS_TO_DO_BATTLE);
|
||||
}
|
||||
if (player.isSubClassActive())
|
||||
{
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.C1_DOES_NOT_MEET_THE_PARTICIPATION_REQUIREMENTS_YOU_CANNOT_PARTICIPATE_IN_THE_OLYMPIAD_BECAUSE_YOU_HAVE_CHANGED_YOUR_CLASS_TO_SUBCLASS);
|
||||
sm.addPcName(player);
|
||||
player.sendPacket(sm);
|
||||
return SystemMessage.getSystemMessage(SystemMessageId.YOUR_OPPONENT_DOES_NOT_MEET_THE_REQUIREMENTS_TO_DO_BATTLE_THE_MATCH_HAS_BEEN_CANCELLED);
|
||||
return SystemMessage.getSystemMessage(SystemMessageId.YOUR_OPPONENT_DOES_NOT_MEET_THE_REQUIREMENTS_TO_DO_BATTLE);
|
||||
}
|
||||
if (player.isCursedWeaponEquipped())
|
||||
{
|
||||
@ -149,14 +149,14 @@ public abstract class AbstractOlympiadGame
|
||||
sm.addPcName(player);
|
||||
sm.addItemName(player.getCursedWeaponEquippedId());
|
||||
player.sendPacket(sm);
|
||||
return SystemMessage.getSystemMessage(SystemMessageId.YOUR_OPPONENT_DOES_NOT_MEET_THE_REQUIREMENTS_TO_DO_BATTLE_THE_MATCH_HAS_BEEN_CANCELLED);
|
||||
return SystemMessage.getSystemMessage(SystemMessageId.YOUR_OPPONENT_DOES_NOT_MEET_THE_REQUIREMENTS_TO_DO_BATTLE);
|
||||
}
|
||||
if (!player.isInventoryUnder90(true))
|
||||
{
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.C1_DOES_NOT_MEET_THE_PARTICIPATION_REQUIREMENTS_AS_THE_INVENTORY_WEIGHT_SLOT_IS_FILLED_BEYOND_80);
|
||||
sm.addPcName(player);
|
||||
player.sendPacket(sm);
|
||||
return SystemMessage.getSystemMessage(SystemMessageId.YOUR_OPPONENT_DOES_NOT_MEET_THE_REQUIREMENTS_TO_DO_BATTLE_THE_MATCH_HAS_BEEN_CANCELLED);
|
||||
return SystemMessage.getSystemMessage(SystemMessageId.YOUR_OPPONENT_DOES_NOT_MEET_THE_REQUIREMENTS_TO_DO_BATTLE);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -520,7 +520,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
|
||||
}
|
||||
else if (_pOneCrash && _pTwoCrash)
|
||||
{
|
||||
stadium.broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.THERE_IS_NO_VICTOR_THE_MATCH_ENDS_IN_A_TIE));
|
||||
stadium.broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.THERE_IS_NO_VICTOR));
|
||||
|
||||
_playerOne.updateStat(COMP_LOST, 1);
|
||||
removePointsFromParticipant(_playerOne, pointDiff);
|
||||
@ -614,7 +614,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
|
||||
{
|
||||
_playerOne.updateStat(COMP_DRAWN, 1);
|
||||
_playerTwo.updateStat(COMP_DRAWN, 1);
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.THERE_IS_NO_VICTOR_THE_MATCH_ENDS_IN_A_TIE);
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.THERE_IS_NO_VICTOR);
|
||||
stadium.broadcastPacket(sm);
|
||||
}
|
||||
else if ((_playerTwo.getPlayer() == null) || !_playerTwo.getPlayer().isOnline() || ((playerTwoHp == 0) && (playerOneHp != 0)) || ((_damageP1 > _damageP2) && (playerTwoHp != 0) && (playerOneHp != 0)))
|
||||
@ -672,7 +672,7 @@ public abstract class OlympiadGameNormal extends AbstractOlympiadGame
|
||||
// Save Fight Result
|
||||
saveResults(_playerOne, _playerTwo, 0, _startTime, _fightTime, getType());
|
||||
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.THERE_IS_NO_VICTOR_THE_MATCH_ENDS_IN_A_TIE);
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.THERE_IS_NO_VICTOR);
|
||||
stadium.broadcastPacket(sm);
|
||||
|
||||
int value = Math.min(playerOnePoints / getDivider(), Config.ALT_OLY_MAX_POINTS);
|
||||
|
@ -784,7 +784,7 @@ public class OlympiadGameTeams extends AbstractOlympiadGame
|
||||
}
|
||||
else if (tOneCrash && tTwoCrash)
|
||||
{
|
||||
stadium.broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.THERE_IS_NO_VICTOR_THE_MATCH_ENDS_IN_A_TIE));
|
||||
stadium.broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.THERE_IS_NO_VICTOR));
|
||||
|
||||
for (int i = _teamOneSize; --i >= 0;)
|
||||
{
|
||||
@ -936,7 +936,7 @@ public class OlympiadGameTeams extends AbstractOlympiadGame
|
||||
}
|
||||
else
|
||||
{
|
||||
stadium.broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.THERE_IS_NO_VICTOR_THE_MATCH_ENDS_IN_A_TIE));
|
||||
stadium.broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.THERE_IS_NO_VICTOR));
|
||||
|
||||
for (int i = 0; i < _teamOneSize; i++)
|
||||
{
|
||||
|
@ -141,7 +141,7 @@ public class OlympiadManager
|
||||
return true;
|
||||
}
|
||||
|
||||
final List<Integer> classed = _classBasedRegisters.get(noble.getBaseClass());
|
||||
final List<Integer> classed = _classBasedRegisters.get(noble.getBaseClassId());
|
||||
if ((classed != null) && classed.contains(objId))
|
||||
{
|
||||
if (showMessage)
|
||||
@ -250,7 +250,7 @@ public class OlympiadManager
|
||||
return false;
|
||||
}
|
||||
|
||||
List<Integer> classed = _classBasedRegisters.get(player.getBaseClass());
|
||||
List<Integer> classed = _classBasedRegisters.get(player.getBaseClassId());
|
||||
if (classed != null)
|
||||
{
|
||||
classed.add(charId);
|
||||
@ -259,7 +259,7 @@ public class OlympiadManager
|
||||
{
|
||||
classed = new CopyOnWriteArrayList<>();
|
||||
classed.add(charId);
|
||||
_classBasedRegisters.put(player.getBaseClass(), classed);
|
||||
_classBasedRegisters.put(player.getBaseClassId(), classed);
|
||||
}
|
||||
|
||||
player.sendPacket(SystemMessageId.YOU_HAVE_BEEN_REGISTERED_FOR_THE_OLYMPIAD_WAITING_LIST_FOR_A_CLASS_BATTLE);
|
||||
@ -388,10 +388,10 @@ public class OlympiadManager
|
||||
return true;
|
||||
}
|
||||
|
||||
final List<Integer> classed = _classBasedRegisters.get(noble.getBaseClass());
|
||||
final List<Integer> classed = _classBasedRegisters.get(noble.getBaseClassId());
|
||||
if ((classed != null) && classed.remove(objId))
|
||||
{
|
||||
_classBasedRegisters.put(noble.getBaseClass(), classed);
|
||||
_classBasedRegisters.put(noble.getBaseClassId(), classed);
|
||||
|
||||
if (Config.L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP > 0)
|
||||
{
|
||||
@ -428,7 +428,7 @@ public class OlympiadManager
|
||||
return;
|
||||
}
|
||||
|
||||
final List<Integer> classed = _classBasedRegisters.get(player.getBaseClass());
|
||||
final List<Integer> classed = _classBasedRegisters.get(player.getBaseClassId());
|
||||
if ((classed != null) && classed.remove(objId))
|
||||
{
|
||||
return;
|
||||
@ -508,7 +508,7 @@ public class OlympiadManager
|
||||
if (statDat == null)
|
||||
{
|
||||
statDat = new StatsSet();
|
||||
statDat.set(Olympiad.CLASS_ID, noble.getBaseClass());
|
||||
statDat.set(Olympiad.CLASS_ID, noble.getBaseClassId());
|
||||
statDat.set(Olympiad.CHAR_NAME, noble.getName());
|
||||
statDat.set(Olympiad.POINTS, Olympiad.DEFAULT_POINTS);
|
||||
statDat.set(Olympiad.COMP_DONE, 0);
|
||||
|
@ -44,7 +44,7 @@ public final class Participant
|
||||
player = plr;
|
||||
name = plr.getName();
|
||||
side = olympiadSide;
|
||||
baseClass = plr.getBaseClass();
|
||||
baseClass = plr.getBaseClassId();
|
||||
stats = Olympiad.getNobleStats(getObjectId());
|
||||
clanName = plr.getClan() != null ? plr.getClan().getName() : "";
|
||||
clanId = plr.getClanId();
|
||||
|
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (C) 2004-2015 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;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
|
||||
public class BlowSuccess
|
||||
{
|
||||
private static Map<String, Boolean> _success = new HashMap<>();
|
||||
|
||||
public static BlowSuccess getInstance()
|
||||
{
|
||||
return SingletonHolder._instance;
|
||||
}
|
||||
|
||||
private static class SingletonHolder
|
||||
{
|
||||
protected static final BlowSuccess _instance = new BlowSuccess();
|
||||
}
|
||||
|
||||
public void remove(L2Character l2Character, Skill skill)
|
||||
{
|
||||
_success.remove(makeKey(l2Character, skill));
|
||||
}
|
||||
|
||||
public boolean get(L2Character l2Character, Skill skill)
|
||||
{
|
||||
return _success.get(makeKey(l2Character, skill));
|
||||
}
|
||||
|
||||
public void set(L2Character l2Character, Skill skill, boolean success)
|
||||
{
|
||||
_success.put(makeKey(l2Character, skill), success);
|
||||
}
|
||||
|
||||
private String makeKey(L2Character l2Character, Skill skill)
|
||||
{
|
||||
return "" + l2Character.getObjectId() + ":" + skill.getId();
|
||||
}
|
||||
}
|
@ -1308,7 +1308,7 @@ public final class Skill implements IIdentifiable
|
||||
{
|
||||
if (effect.isInstant())
|
||||
{
|
||||
if (applyInstantEffects && effect.calcSuccess(info))
|
||||
if (applyInstantEffects && (getBlowChance() > 0 ? BlowSuccess.getInstance().get(info.getEffector(), info.getSkill()) : effect.calcSuccess(info)))
|
||||
{
|
||||
effect.onStart(info);
|
||||
}
|
||||
|
@ -71,6 +71,11 @@ public class L2JumpZone extends L2ZoneType
|
||||
@Override
|
||||
protected void onEnter(L2Character character)
|
||||
{
|
||||
if (!isInsideZone(character))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (character.isPlayer())
|
||||
{
|
||||
character.setInsideZone(ZoneId.JUMP, true);
|
||||
|
Reference in New Issue
Block a user