Fixed Talking Island and Faeron Village scrolls of escape.
Dropped Batalion Zone due to lack of further development. Added Various missing syncs from L2jServer Ertheia.
This commit is contained in:
@@ -1762,7 +1762,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
return;
|
||||
}
|
||||
|
||||
// Prevent monsters buffing players.
|
||||
// FIXME: Prevent monsters buffing players.
|
||||
if (isMonster() && !target.isMonster() && !skill.isBad() && skill.getName().contains("NPC"))
|
||||
{
|
||||
setTarget(this);
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 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.actor.instance;
|
||||
|
||||
import com.l2jserver.gameserver.enums.InstanceType;
|
||||
import com.l2jserver.gameserver.model.actor.L2Npc;
|
||||
import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
|
||||
import com.l2jserver.gameserver.network.serverpackets.commission.ExShowCommission;
|
||||
|
||||
/**
|
||||
* @author NosBit
|
||||
*/
|
||||
public class CommissionManagerInstance extends L2Npc
|
||||
{
|
||||
public CommissionManagerInstance(L2NpcTemplate template)
|
||||
{
|
||||
super(template);
|
||||
setInstanceType(InstanceType.CommissionManagerInstance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBypassFeedback(L2PcInstance player, String command)
|
||||
{
|
||||
if (command.equalsIgnoreCase("show_commission"))
|
||||
{
|
||||
player.sendPacket(ExShowCommission.STATIC_PACKET);
|
||||
}
|
||||
else
|
||||
{
|
||||
super.onBypassFeedback(player, command);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -221,7 +221,6 @@ import com.l2jserver.gameserver.model.interfaces.IEventListener;
|
||||
import com.l2jserver.gameserver.model.interfaces.ILocational;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.Inventory;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.ItemContainer;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.PcAuction;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.PcFreight;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.PcInventory;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.PcRefund;
|
||||
@@ -256,7 +255,6 @@ import com.l2jserver.gameserver.model.variables.AccountVariables;
|
||||
import com.l2jserver.gameserver.model.variables.PlayerVariables;
|
||||
import com.l2jserver.gameserver.model.zone.L2ZoneType;
|
||||
import com.l2jserver.gameserver.model.zone.ZoneId;
|
||||
import com.l2jserver.gameserver.model.zone.type.L2BattalionZone;
|
||||
import com.l2jserver.gameserver.model.zone.type.L2BossZone;
|
||||
import com.l2jserver.gameserver.network.L2GameClient;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
@@ -332,6 +330,7 @@ import com.l2jserver.gameserver.network.serverpackets.TradeOtherDone;
|
||||
import com.l2jserver.gameserver.network.serverpackets.TradeStart;
|
||||
import com.l2jserver.gameserver.network.serverpackets.UserInfo;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ValidateLocation;
|
||||
import com.l2jserver.gameserver.network.serverpackets.commission.ExResponseCommissionInfo;
|
||||
import com.l2jserver.gameserver.network.serverpackets.friend.L2FriendStatus;
|
||||
import com.l2jserver.gameserver.taskmanager.AttackStanceTaskManager;
|
||||
import com.l2jserver.gameserver.util.Broadcast;
|
||||
@@ -550,7 +549,6 @@ public final class L2PcInstance extends L2Playable
|
||||
private int _vitalityPoints = 140000;
|
||||
|
||||
private final PcInventory _inventory = new PcInventory(this);
|
||||
private final PcAuction _auctionInventory = new PcAuction(this);
|
||||
private final PcFreight _freight = new PcFreight(this);
|
||||
private PcWarehouse _warehouse;
|
||||
private PcRefund _refund;
|
||||
@@ -679,7 +677,7 @@ public final class L2PcInstance extends L2Playable
|
||||
private boolean _exchangeRefusal = false; // Exchange refusal
|
||||
|
||||
private L2Party _party;
|
||||
PartyDistributionType _partyDistributionType;
|
||||
private PartyDistributionType _partyDistributionType;
|
||||
|
||||
// this is needed to find the inviting player for Party response
|
||||
// there can only be one active party request at once
|
||||
@@ -694,6 +692,8 @@ public final class L2PcInstance extends L2Playable
|
||||
|
||||
private L2ItemInstance _lure = null;
|
||||
|
||||
private volatile Map<Integer, ExResponseCommissionInfo> _lastCommissionInfos;
|
||||
|
||||
public boolean isSpawnProtected()
|
||||
{
|
||||
return _protectEndTime > GameTimeController.getInstance().getGameTicks();
|
||||
@@ -723,17 +723,6 @@ public final class L2PcInstance extends L2Playable
|
||||
|
||||
private volatile Map<Class<? extends AbstractRequest>, AbstractRequest> _requests;
|
||||
|
||||
private boolean _isEnchanting = false;
|
||||
private int _activeEnchantItemId = ID_NONE;
|
||||
private int _activeEnchantSupportItemId = ID_NONE;
|
||||
private int _activeEnchantAttrItemId = ID_NONE;
|
||||
private long _activeEnchantTimestamp = 0;
|
||||
|
||||
private int _firstCompoundOID = -1;
|
||||
private int _secondCompoundOID = -1;
|
||||
|
||||
private boolean _usingPrimeShop = false;
|
||||
|
||||
protected boolean _inventoryDisable = false;
|
||||
/** Player's cubics. */
|
||||
private final Map<Integer, L2CubicInstance> _cubics = new ConcurrentSkipListMap<>(); // TODO(Zoey76): This should be sorted in insert order.
|
||||
@@ -2434,63 +2423,6 @@ public final class L2PcInstance extends L2Playable
|
||||
return getStat().getExp();
|
||||
}
|
||||
|
||||
public void setActiveEnchantAttrItemId(int objectId)
|
||||
{
|
||||
_activeEnchantAttrItemId = objectId;
|
||||
}
|
||||
|
||||
public int getActiveEnchantAttrItemId()
|
||||
{
|
||||
return _activeEnchantAttrItemId;
|
||||
}
|
||||
|
||||
public void setActiveEnchantItemId(int objectId)
|
||||
{
|
||||
// If we don't have a Enchant Item, we are not enchanting.
|
||||
if (objectId == ID_NONE)
|
||||
{
|
||||
setActiveEnchantSupportItemId(ID_NONE);
|
||||
setActiveEnchantTimestamp(0);
|
||||
setIsEnchanting(false);
|
||||
}
|
||||
_activeEnchantItemId = objectId;
|
||||
}
|
||||
|
||||
public int getActiveEnchantItemId()
|
||||
{
|
||||
return _activeEnchantItemId;
|
||||
}
|
||||
|
||||
public void setActiveEnchantSupportItemId(int objectId)
|
||||
{
|
||||
_activeEnchantSupportItemId = objectId;
|
||||
}
|
||||
|
||||
public int getActiveEnchantSupportItemId()
|
||||
{
|
||||
return _activeEnchantSupportItemId;
|
||||
}
|
||||
|
||||
public long getActiveEnchantTimestamp()
|
||||
{
|
||||
return _activeEnchantTimestamp;
|
||||
}
|
||||
|
||||
public void setActiveEnchantTimestamp(long val)
|
||||
{
|
||||
_activeEnchantTimestamp = val;
|
||||
}
|
||||
|
||||
public void setIsEnchanting(boolean val)
|
||||
{
|
||||
_isEnchanting = val;
|
||||
}
|
||||
|
||||
public boolean isEnchanting()
|
||||
{
|
||||
return _isEnchanting;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the fists weapon of the L2PcInstance (used when no weapon is equiped).
|
||||
* @param weaponItem The fists L2Weapon to set to the L2PcInstance
|
||||
@@ -2858,11 +2790,6 @@ public final class L2PcInstance extends L2Playable
|
||||
return _inventory;
|
||||
}
|
||||
|
||||
public PcAuction getAuctionInventory()
|
||||
{
|
||||
return _auctionInventory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a ShortCut of the L2PcInstance _shortCuts.
|
||||
* @param objectId
|
||||
@@ -3976,7 +3903,7 @@ public final class L2PcInstance extends L2Playable
|
||||
return null;
|
||||
}
|
||||
|
||||
if (getActiveEnchantItemId() == objectId)
|
||||
if (isProcessingItem(objectId))
|
||||
{
|
||||
if (Config.DEBUG)
|
||||
{
|
||||
@@ -5645,8 +5572,6 @@ public final class L2PcInstance extends L2Playable
|
||||
{
|
||||
setPvpKills(getPvpKills() + 1);
|
||||
|
||||
L2BattalionZone.givereward(this);
|
||||
|
||||
// Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
|
||||
UserInfo ui = new UserInfo(this, false);
|
||||
ui.addComponentType(UserInfoType.SOCIAL);
|
||||
@@ -11364,7 +11289,7 @@ public final class L2PcInstance extends L2Playable
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getActiveEnchantItemId() == objectId)
|
||||
if (isProcessingItem(objectId))
|
||||
{
|
||||
if (Config.DEBUG)
|
||||
{
|
||||
@@ -13983,7 +13908,7 @@ public final class L2PcInstance extends L2Playable
|
||||
sendPacket(sm);
|
||||
}
|
||||
|
||||
// Prevent falling in game graphics.
|
||||
// FIXME: Prevent falling in game graphics.
|
||||
sendPacket(new ValidateLocation(this));
|
||||
|
||||
setFalling();
|
||||
@@ -15093,11 +15018,17 @@ public final class L2PcInstance extends L2Playable
|
||||
return getPlayerSide() == CastleSide.LIGHT;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the maximum amount of points that player can use
|
||||
*/
|
||||
public int getMaxSummonPoints()
|
||||
{
|
||||
return (int) getStat().calcStat(Stats.MAX_SUMMON_POINTS, 0, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the amount of points that player used
|
||||
*/
|
||||
public int getSummonPoints()
|
||||
{
|
||||
return getServitors().values().stream().mapToInt(L2Summon::getSummonPoints).sum();
|
||||
@@ -15232,36 +15163,6 @@ public final class L2PcInstance extends L2Playable
|
||||
_vitalityPoints = points;
|
||||
}
|
||||
|
||||
public int getFirstCompoundOID()
|
||||
{
|
||||
return _firstCompoundOID;
|
||||
}
|
||||
|
||||
public void setFirstCompoundOID(int firstCompoundOID)
|
||||
{
|
||||
_firstCompoundOID = firstCompoundOID;
|
||||
}
|
||||
|
||||
public int getSecondCompoundOID()
|
||||
{
|
||||
return _secondCompoundOID;
|
||||
}
|
||||
|
||||
public void setSecondCompoundOID(int secondCompoundOID)
|
||||
{
|
||||
_secondCompoundOID = secondCompoundOID;
|
||||
}
|
||||
|
||||
public void setUsingPrimeShop(boolean isUsing)
|
||||
{
|
||||
_usingPrimeShop = isUsing;
|
||||
}
|
||||
|
||||
public boolean isUsingPrimeShop()
|
||||
{
|
||||
return _usingPrimeShop;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the prime shop points of the player.
|
||||
*/
|
||||
@@ -15282,6 +15183,25 @@ public final class L2PcInstance extends L2Playable
|
||||
vars.storeMe();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the last commission infos.
|
||||
* @return the last commission infos
|
||||
*/
|
||||
public Map<Integer, ExResponseCommissionInfo> getLastCommissionInfos()
|
||||
{
|
||||
if (_lastCommissionInfos == null)
|
||||
{
|
||||
synchronized (this)
|
||||
{
|
||||
if (_lastCommissionInfos == null)
|
||||
{
|
||||
_lastCommissionInfos = new ConcurrentHashMap<>();
|
||||
}
|
||||
}
|
||||
}
|
||||
return _lastCommissionInfos;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the whisperers.
|
||||
* @return the whisperers
|
||||
|
||||
@@ -182,6 +182,7 @@ public class PcKnownList extends PlayableKnownList
|
||||
return 2900;
|
||||
}
|
||||
|
||||
// Old custom/wrong method.
|
||||
// if (knownlistSize <= 70)
|
||||
// {
|
||||
// return 2300;
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* 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.actor.request;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.serverpackets.adenadistribution.ExDivideAdenaCancel;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
*/
|
||||
public class AdenaDistributionRequest extends AbstractRequest
|
||||
{
|
||||
private final L2PcInstance _distributor;
|
||||
private final List<L2PcInstance> _players;
|
||||
private final int _adenaObjectId;
|
||||
private final long _adenaCount;
|
||||
|
||||
public AdenaDistributionRequest(L2PcInstance activeChar, L2PcInstance distributor, List<L2PcInstance> players, int adenaObjectId, long adenaCount)
|
||||
{
|
||||
super(activeChar);
|
||||
_distributor = distributor;
|
||||
_adenaObjectId = adenaObjectId;
|
||||
_players = players;
|
||||
_adenaCount = adenaCount;
|
||||
}
|
||||
|
||||
public L2PcInstance getDistributor()
|
||||
{
|
||||
return _distributor;
|
||||
}
|
||||
|
||||
public List<L2PcInstance> getPlayers()
|
||||
{
|
||||
return _players;
|
||||
}
|
||||
|
||||
public int getAdenaObjectId()
|
||||
{
|
||||
return _adenaObjectId;
|
||||
}
|
||||
|
||||
public long getAdenaCount()
|
||||
{
|
||||
return _adenaCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUsing(int objectId)
|
||||
{
|
||||
return objectId == _adenaObjectId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimeout()
|
||||
{
|
||||
super.onTimeout();
|
||||
_players.forEach(p ->
|
||||
{
|
||||
p.removeRequest(AdenaDistributionRequest.class);
|
||||
p.sendPacket(ExDivideAdenaCancel.STATIC_PACKET);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* 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.actor.request;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class CompoundRequest extends AbstractRequest
|
||||
{
|
||||
private int _itemOne;
|
||||
private int _itemTwo;
|
||||
|
||||
public CompoundRequest(L2PcInstance activeChar)
|
||||
{
|
||||
super(activeChar);
|
||||
}
|
||||
|
||||
public L2ItemInstance getItemOne()
|
||||
{
|
||||
return getActiveChar().getInventory().getItemByObjectId(_itemOne);
|
||||
}
|
||||
|
||||
public void setItemOne(int itemOne)
|
||||
{
|
||||
_itemOne = itemOne;
|
||||
}
|
||||
|
||||
public L2ItemInstance getItemTwo()
|
||||
{
|
||||
return getActiveChar().getInventory().getItemByObjectId(_itemTwo);
|
||||
}
|
||||
|
||||
public void setItemTwo(int itemTwo)
|
||||
{
|
||||
_itemTwo = itemTwo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemRequest()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canWorkWith(AbstractRequest request)
|
||||
{
|
||||
return !request.isItemRequest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUsing(int objectId)
|
||||
{
|
||||
return (objectId > 0) && ((objectId == _itemOne) || (objectId == _itemTwo));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* 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.actor.request;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public final class EnchantItemAttributeRequest extends AbstractRequest
|
||||
{
|
||||
private volatile int _enchantingItemObjectId;
|
||||
private volatile int _enchantingStoneObjectId;
|
||||
|
||||
public EnchantItemAttributeRequest(L2PcInstance activeChar, int enchantingStoneObjectId)
|
||||
{
|
||||
super(activeChar);
|
||||
_enchantingStoneObjectId = enchantingStoneObjectId;
|
||||
}
|
||||
|
||||
public L2ItemInstance getEnchantingItem()
|
||||
{
|
||||
return getActiveChar().getInventory().getItemByObjectId(_enchantingItemObjectId);
|
||||
}
|
||||
|
||||
public void setEnchantingItem(int objectId)
|
||||
{
|
||||
_enchantingItemObjectId = objectId;
|
||||
}
|
||||
|
||||
public L2ItemInstance getEnchantingStone()
|
||||
{
|
||||
return getActiveChar().getInventory().getItemByObjectId(_enchantingStoneObjectId);
|
||||
}
|
||||
|
||||
public void setEnchantingStone(int objectId)
|
||||
{
|
||||
_enchantingStoneObjectId = objectId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemRequest()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canWorkWith(AbstractRequest request)
|
||||
{
|
||||
return !request.isItemRequest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUsing(int objectId)
|
||||
{
|
||||
return (objectId > 0) && ((objectId == _enchantingItemObjectId) || (objectId == _enchantingStoneObjectId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* 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.actor.request;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public final class EnchantItemRequest extends AbstractRequest
|
||||
{
|
||||
private volatile int _enchantingItemObjectId;
|
||||
private volatile int _enchantingScrollObjectId;
|
||||
private volatile int _supportItemObjectId;
|
||||
|
||||
public EnchantItemRequest(L2PcInstance activeChar, int enchantingScrollObjectId)
|
||||
{
|
||||
super(activeChar);
|
||||
_enchantingScrollObjectId = enchantingScrollObjectId;
|
||||
}
|
||||
|
||||
public L2ItemInstance getEnchantingItem()
|
||||
{
|
||||
return getActiveChar().getInventory().getItemByObjectId(_enchantingItemObjectId);
|
||||
}
|
||||
|
||||
public void setEnchantingItem(int objectId)
|
||||
{
|
||||
_enchantingItemObjectId = objectId;
|
||||
}
|
||||
|
||||
public L2ItemInstance getEnchantingScroll()
|
||||
{
|
||||
return getActiveChar().getInventory().getItemByObjectId(_enchantingScrollObjectId);
|
||||
}
|
||||
|
||||
public void setEnchantingScroll(int objectId)
|
||||
{
|
||||
_enchantingScrollObjectId = objectId;
|
||||
}
|
||||
|
||||
public L2ItemInstance getSupportItem()
|
||||
{
|
||||
return getActiveChar().getInventory().getItemByObjectId(_supportItemObjectId);
|
||||
}
|
||||
|
||||
public void setSupportItem(int objectId)
|
||||
{
|
||||
_supportItemObjectId = objectId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemRequest()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canWorkWith(AbstractRequest request)
|
||||
{
|
||||
return !request.isItemRequest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUsing(int objectId)
|
||||
{
|
||||
return (objectId > 0) && ((objectId == _enchantingItemObjectId) || (objectId == _enchantingScrollObjectId) || (objectId == _supportItemObjectId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* 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.actor.request;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class PartyRequest extends AbstractRequest
|
||||
{
|
||||
private final L2PcInstance _targetPlayer;
|
||||
|
||||
public PartyRequest(L2PcInstance activeChar, L2PcInstance targetPlayer)
|
||||
{
|
||||
super(activeChar);
|
||||
Objects.requireNonNull(targetPlayer);
|
||||
_targetPlayer = targetPlayer;
|
||||
}
|
||||
|
||||
public L2PcInstance getTargetPlayer()
|
||||
{
|
||||
return _targetPlayer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUsing(int objectId)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTimeout()
|
||||
{
|
||||
super.onTimeout();
|
||||
getActiveChar().removeRequest(getClass());
|
||||
_targetPlayer.removeRequest(getClass());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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.actor.request;
|
||||
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
/**
|
||||
* @author UnAfraid
|
||||
*/
|
||||
public class PrimeShopRequest extends AbstractRequest
|
||||
{
|
||||
public PrimeShopRequest(L2PcInstance activeChar)
|
||||
{
|
||||
super(activeChar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUsing(int objectId)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* 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.commission;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
|
||||
import com.l2jserver.gameserver.model.ItemInfo;
|
||||
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
|
||||
|
||||
/**
|
||||
* @author NosBit
|
||||
*/
|
||||
public class CommissionItem
|
||||
{
|
||||
private final long _commissionId;
|
||||
private final L2ItemInstance _itemInstance;
|
||||
private final ItemInfo _itemInfo;
|
||||
private final long _pricePerUnit;
|
||||
private final Instant _startTime;
|
||||
private final byte _durationInDays;
|
||||
private ScheduledFuture<?> _saleEndTask;
|
||||
|
||||
public CommissionItem(long commissionId, L2ItemInstance itemInstance, long pricePerUnit, Instant startTime, byte durationInDays)
|
||||
{
|
||||
_commissionId = commissionId;
|
||||
_itemInstance = itemInstance;
|
||||
_itemInfo = new ItemInfo(_itemInstance);
|
||||
_pricePerUnit = pricePerUnit;
|
||||
_startTime = startTime;
|
||||
_durationInDays = durationInDays;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the commission id.
|
||||
* @return the commission id
|
||||
*/
|
||||
public long getCommissionId()
|
||||
{
|
||||
return _commissionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the item instance.
|
||||
* @return the item instance
|
||||
*/
|
||||
public L2ItemInstance getItemInstance()
|
||||
{
|
||||
return _itemInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the item info.
|
||||
* @return the item info
|
||||
*/
|
||||
public ItemInfo getItemInfo()
|
||||
{
|
||||
return _itemInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the price per unit.
|
||||
* @return the price per unit
|
||||
*/
|
||||
public long getPricePerUnit()
|
||||
{
|
||||
return _pricePerUnit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the start time.
|
||||
* @return the start time
|
||||
*/
|
||||
public Instant getStartTime()
|
||||
{
|
||||
return _startTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the duration in days.
|
||||
* @return the duration in days
|
||||
*/
|
||||
public byte getDurationInDays()
|
||||
{
|
||||
return _durationInDays;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the end time.
|
||||
* @return the end time
|
||||
*/
|
||||
public Instant getEndTime()
|
||||
{
|
||||
return _startTime.plus(_durationInDays, ChronoUnit.DAYS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sale end task.
|
||||
* @return the sale end task
|
||||
*/
|
||||
public ScheduledFuture<?> getSaleEndTask()
|
||||
{
|
||||
return _saleEndTask;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the sale end task.
|
||||
* @param saleEndTask the sale end task
|
||||
*/
|
||||
public void setSaleEndTask(ScheduledFuture<?> saleEndTask)
|
||||
{
|
||||
_saleEndTask = saleEndTask;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
* 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.commission;
|
||||
|
||||
/**
|
||||
* @author NosBit
|
||||
*/
|
||||
public enum CommissionItemType
|
||||
{
|
||||
// Weapon
|
||||
ONE_HAND_SWORD(1),
|
||||
ONE_HAND_MAGIC_SWORD(2),
|
||||
DAGGER(3),
|
||||
RAPIER(4),
|
||||
TWO_HAND_SWORD(5),
|
||||
ANCIENT_SWORD(6),
|
||||
DUALSWORD(7),
|
||||
DUAL_DAGGER(8),
|
||||
BLUNT_WEAPON(9),
|
||||
ONE_HAND_MAGIC_BLUNT_WEAPON(10),
|
||||
TWO_HAND_BLUNT_WEAPON(11),
|
||||
TWO_HAND_MAGIC_BLUNT_WEAPON(12),
|
||||
DUAL_BLUNT_WEAPON(13),
|
||||
BOW(14),
|
||||
CROSSBOW(15),
|
||||
FIST_WEAPON(16),
|
||||
SPEAR(17),
|
||||
OTHER_WEAPON(18),
|
||||
// Armor
|
||||
HELMET(19),
|
||||
ARMOR_TOP(20),
|
||||
ARMOR_PANTS(21),
|
||||
FULL_BODY(22),
|
||||
GLOVES(23),
|
||||
FEET(24),
|
||||
SHIELD(25),
|
||||
SIGIL(26),
|
||||
UNDERWEAR(27),
|
||||
CLOAK(28),
|
||||
// Accessory
|
||||
RING(29),
|
||||
EARRING(30),
|
||||
NECKLACE(31),
|
||||
BELT(32),
|
||||
BRACELET(33),
|
||||
HAIR_ACCESSORY(34),
|
||||
// Supplies
|
||||
POTION(35),
|
||||
SCROLL_ENCHANT_WEAPON(36),
|
||||
SCROLL_ENCHANT_ARMOR(37),
|
||||
SCROLL_OTHER(38),
|
||||
SOULSHOT(39),
|
||||
SPIRITSHOT(40),
|
||||
// Pet Goods
|
||||
PET_EQUIPMENT(42),
|
||||
PET_SUPPLIES(43),
|
||||
// Misc.
|
||||
CRYSTAL(44),
|
||||
RECIPE(45),
|
||||
MAJOR_CRAFTING_INGREDIENTS(46),
|
||||
LIFE_STONE(47),
|
||||
SOUL_CRYSTAL(48),
|
||||
ATTRIBUTE_STONE(49),
|
||||
WEAPON_ENCHANT_STONE(50),
|
||||
ARMOR_ENCHANT_STONE(51),
|
||||
SPELLBOOK(52),
|
||||
GEMSTONE(53),
|
||||
POUCH(54),
|
||||
PIN(55),
|
||||
MAGIC_RUNE_CLIP(56),
|
||||
MAGIC_ORNAMENT(57),
|
||||
DYES(58),
|
||||
OTHER_ITEM(59);
|
||||
|
||||
private final int _clientId;
|
||||
|
||||
private CommissionItemType(int clientId)
|
||||
{
|
||||
_clientId = clientId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the client id.
|
||||
* @return the client id
|
||||
*/
|
||||
public int getClientId()
|
||||
{
|
||||
return _clientId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the commission item type by the client id
|
||||
* @param clientId the client id
|
||||
* @return the commission item type if its found, {@code null} otherwise
|
||||
*/
|
||||
public static CommissionItemType findByClientId(int clientId)
|
||||
{
|
||||
for (CommissionItemType value : values())
|
||||
{
|
||||
if (value.getClientId() == clientId)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* 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.commission;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author NosBit
|
||||
*/
|
||||
public enum CommissionTreeType
|
||||
{
|
||||
WEAPON(
|
||||
0,
|
||||
CommissionItemType.ONE_HAND_SWORD,
|
||||
CommissionItemType.ONE_HAND_MAGIC_SWORD,
|
||||
CommissionItemType.DAGGER,
|
||||
CommissionItemType.RAPIER,
|
||||
CommissionItemType.TWO_HAND_SWORD,
|
||||
CommissionItemType.ANCIENT_SWORD,
|
||||
CommissionItemType.DUALSWORD,
|
||||
CommissionItemType.DUAL_DAGGER,
|
||||
CommissionItemType.BLUNT_WEAPON,
|
||||
CommissionItemType.ONE_HAND_MAGIC_BLUNT_WEAPON,
|
||||
CommissionItemType.TWO_HAND_BLUNT_WEAPON,
|
||||
CommissionItemType.TWO_HAND_MAGIC_BLUNT_WEAPON,
|
||||
CommissionItemType.DUAL_BLUNT_WEAPON,
|
||||
CommissionItemType.BOW,
|
||||
CommissionItemType.CROSSBOW,
|
||||
CommissionItemType.FIST_WEAPON,
|
||||
CommissionItemType.SPEAR,
|
||||
CommissionItemType.OTHER_WEAPON),
|
||||
ARMOR(1, CommissionItemType.HELMET, CommissionItemType.ARMOR_TOP, CommissionItemType.ARMOR_PANTS, CommissionItemType.FULL_BODY, CommissionItemType.GLOVES, CommissionItemType.FEET, CommissionItemType.SHIELD, CommissionItemType.SIGIL, CommissionItemType.UNDERWEAR, CommissionItemType.CLOAK),
|
||||
ACCESSORY(2, CommissionItemType.RING, CommissionItemType.EARRING, CommissionItemType.NECKLACE, CommissionItemType.BELT, CommissionItemType.BRACELET, CommissionItemType.HAIR_ACCESSORY),
|
||||
SUPPLIES(3, CommissionItemType.POTION, CommissionItemType.SCROLL_ENCHANT_WEAPON, CommissionItemType.SCROLL_ENCHANT_ARMOR, CommissionItemType.SCROLL_OTHER, CommissionItemType.SOULSHOT, CommissionItemType.SPIRITSHOT),
|
||||
PET_GOODS(4, CommissionItemType.PET_EQUIPMENT, CommissionItemType.PET_SUPPLIES),
|
||||
MISC(
|
||||
5,
|
||||
CommissionItemType.CRYSTAL,
|
||||
CommissionItemType.RECIPE,
|
||||
CommissionItemType.MAJOR_CRAFTING_INGREDIENTS,
|
||||
CommissionItemType.LIFE_STONE,
|
||||
CommissionItemType.SOUL_CRYSTAL,
|
||||
CommissionItemType.ATTRIBUTE_STONE,
|
||||
CommissionItemType.WEAPON_ENCHANT_STONE,
|
||||
CommissionItemType.ARMOR_ENCHANT_STONE,
|
||||
CommissionItemType.SPELLBOOK,
|
||||
CommissionItemType.GEMSTONE,
|
||||
CommissionItemType.POUCH,
|
||||
CommissionItemType.PIN,
|
||||
CommissionItemType.MAGIC_RUNE_CLIP,
|
||||
CommissionItemType.MAGIC_ORNAMENT,
|
||||
CommissionItemType.DYES,
|
||||
CommissionItemType.OTHER_ITEM);
|
||||
|
||||
private final int _clientId;
|
||||
private final Set<CommissionItemType> _commissionItemTypes;
|
||||
|
||||
private CommissionTreeType(int clientId, CommissionItemType... commissionItemTypes)
|
||||
{
|
||||
_clientId = clientId;
|
||||
_commissionItemTypes = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(commissionItemTypes)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the client id.
|
||||
* @return the client id
|
||||
*/
|
||||
public int getClientId()
|
||||
{
|
||||
return _clientId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the filter.
|
||||
* @return the filter
|
||||
*/
|
||||
public Set<CommissionItemType> getCommissionItemTypes()
|
||||
{
|
||||
return _commissionItemTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the commission tree type by the client id
|
||||
* @param clientId the client id
|
||||
* @return the commission tree type if its found, {@code null} otherwise
|
||||
*/
|
||||
public static CommissionTreeType findByClientId(int clientId)
|
||||
{
|
||||
for (CommissionTreeType value : values())
|
||||
{
|
||||
if (value.getClientId() == clientId)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public class ConditionChangeWeapon extends Condition
|
||||
return false;
|
||||
}
|
||||
|
||||
if (effector.getActingPlayer().isEnchanting())
|
||||
if (effector.getActingPlayer().hasItemRequest())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -61,8 +61,6 @@ public class Message
|
||||
private boolean _hasAttachments;
|
||||
private Mail _attachments = null;
|
||||
private ScheduledFuture<?> _unloadTask = null;
|
||||
private int _systemMessage1 = 0;
|
||||
private int _systemMessage2 = 0;
|
||||
|
||||
private int _itemId;
|
||||
private int _enchantLvl;
|
||||
@@ -97,8 +95,6 @@ public class Message
|
||||
_elementals[i] = Integer.parseInt(elemDef[i]);
|
||||
}
|
||||
}
|
||||
_systemMessage1 = rset.getInt("systemMessage1");
|
||||
_systemMessage2 = rset.getInt("systemMessage2");
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -119,28 +115,6 @@ public class Message
|
||||
_reqAdena = reqAdena;
|
||||
}
|
||||
|
||||
/*
|
||||
* This constructor used for System Mails
|
||||
*/
|
||||
public Message(int receiverId, String subject, String content, int systemMessage1, int systemMessage2, MailType sendBySystem)
|
||||
{
|
||||
_messageId = IdFactory.getInstance().getNextId();
|
||||
_senderId = -1;
|
||||
_receiverId = receiverId;
|
||||
_subject = subject;
|
||||
_content = content;
|
||||
_expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
|
||||
_reqAdena = 0;
|
||||
_hasAttachments = false;
|
||||
_unread = true;
|
||||
_deletedBySender = true;
|
||||
_deletedByReceiver = false;
|
||||
_messageType = sendBySystem;
|
||||
_returned = false;
|
||||
_systemMessage1 = systemMessage1;
|
||||
_systemMessage2 = systemMessage2;
|
||||
}
|
||||
|
||||
/*
|
||||
* This constructor used for System Mails
|
||||
*/
|
||||
@@ -235,7 +209,7 @@ public class Message
|
||||
_elementals[item.getAttackElementType()] = item.getAttackElementPower();
|
||||
}
|
||||
}
|
||||
else if (mailType == MailType.SYSTEM)
|
||||
else if (mailType == MailType.COMMISSION_ITEM_RETURNED)
|
||||
{
|
||||
final Mail attachement = createAttachments();
|
||||
attachement.addItem("CommissionReturnItem", item, null, null);
|
||||
@@ -244,7 +218,7 @@ public class Message
|
||||
|
||||
public static final PreparedStatement getStatement(Message msg, Connection con) throws SQLException
|
||||
{
|
||||
PreparedStatement stmt = con.prepareStatement("INSERT INTO messages (messageId, senderId, receiverId, subject, content, expiration, reqAdena, hasAttachments, isUnread, isDeletedBySender, isDeletedByReceiver, sendBySystem, isReturned, itemId, enchantLvl, elementals, systemMessage1, systemMessage2) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
PreparedStatement stmt = con.prepareStatement("INSERT INTO messages (messageId, senderId, receiverId, subject, content, expiration, reqAdena, hasAttachments, isUnread, isDeletedBySender, isDeletedByReceiver, sendBySystem, isReturned, itemId, enchantLvl, elementals) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
|
||||
stmt.setInt(1, msg._messageId);
|
||||
stmt.setInt(2, msg._senderId);
|
||||
@@ -262,8 +236,6 @@ public class Message
|
||||
stmt.setInt(14, msg._itemId);
|
||||
stmt.setInt(15, msg._enchantLvl);
|
||||
stmt.setString(16, msg._elementals[0] + ";" + msg._elementals[1] + ";" + msg._elementals[2] + ";" + msg._elementals[3] + ";" + msg._elementals[4] + ";" + msg._elementals[5]);
|
||||
stmt.setInt(17, msg._systemMessage1);
|
||||
stmt.setInt(18, msg._systemMessage2);
|
||||
|
||||
return stmt;
|
||||
}
|
||||
@@ -300,7 +272,7 @@ public class Message
|
||||
case NPC: // Handled by NpcName in client
|
||||
case BIRTHDAY: // Handled by Sysstring in client
|
||||
case COMMISSION_ITEM_SOLD: // Handled by Sysstring in client
|
||||
case SYSTEM: // Handled by Sysstring in client
|
||||
case COMMISSION_ITEM_RETURNED: // Handled by Sysstring in client
|
||||
case MENTOR_NPC: // Handled in client
|
||||
default:
|
||||
{
|
||||
@@ -353,16 +325,6 @@ public class Message
|
||||
return _unread;
|
||||
}
|
||||
|
||||
public final int getSystemMessage1()
|
||||
{
|
||||
return _systemMessage1;
|
||||
}
|
||||
|
||||
public final int getSystemMessage2()
|
||||
{
|
||||
return _systemMessage2;
|
||||
}
|
||||
|
||||
public final void markAsRead()
|
||||
{
|
||||
if (_unread)
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program 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.itemcontainer;
|
||||
|
||||
import com.l2jserver.gameserver.enums.ItemLocation;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
/**
|
||||
* @author Erlandys
|
||||
*/
|
||||
public class PcAuction extends ItemContainer
|
||||
{
|
||||
private final L2PcInstance _owner;
|
||||
|
||||
public PcAuction(L2PcInstance owner)
|
||||
{
|
||||
_owner = owner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return "Auction";
|
||||
}
|
||||
|
||||
@Override
|
||||
public L2PcInstance getOwner()
|
||||
{
|
||||
return _owner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemLocation getBaseLocation()
|
||||
{
|
||||
return ItemLocation.AUCTION_HOUSE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean validateCapacity(long slots)
|
||||
{
|
||||
return ((_items.size() + slots) <= 10);
|
||||
}
|
||||
}
|
||||
@@ -822,9 +822,9 @@ public class PcInventory extends Inventory
|
||||
getOwner().removeItemFromShortCut(item.getObjectId());
|
||||
|
||||
// Removes active Enchant Scroll
|
||||
if (item.getObjectId() == getOwner().getActiveEnchantItemId())
|
||||
if (getOwner().isProcessingItem(item.getObjectId()))
|
||||
{
|
||||
getOwner().setActiveEnchantItemId(L2PcInstance.ID_NONE);
|
||||
getOwner().removeRequestsThatProcessesItem(item.getObjectId());
|
||||
}
|
||||
|
||||
if (item.getId() == ADENA_ID)
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.l2jserver.gameserver.model.StatsSet;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.L2Summon;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.commission.CommissionItemType;
|
||||
import com.l2jserver.gameserver.model.conditions.Condition;
|
||||
import com.l2jserver.gameserver.model.events.ListenersContainer;
|
||||
import com.l2jserver.gameserver.model.holders.SkillHolder;
|
||||
@@ -126,7 +127,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
private final int _time;
|
||||
private final int _autoDestroyTime;
|
||||
private final int _bodyPart;
|
||||
private final String _bodyPartName;
|
||||
private final int _referencePrice;
|
||||
private final int _crystalCount;
|
||||
private final boolean _sellable;
|
||||
@@ -161,6 +161,10 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
private final int _reuseDelay;
|
||||
private final int _sharedReuseGroup;
|
||||
|
||||
private final CommissionItemType _commissionItemType;
|
||||
private final int _compoundItem;
|
||||
private final float _compoundChance;
|
||||
|
||||
/**
|
||||
* Constructor of the L2Item that fill class variables.<BR>
|
||||
* <BR>
|
||||
@@ -179,7 +183,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
_time = set.getInt("time", -1);
|
||||
_autoDestroyTime = set.getInt("auto_destroy_time", -1) * 1000;
|
||||
_bodyPart = ItemTable.SLOTS.get(set.getString("bodypart", "none"));
|
||||
_bodyPartName = set.getString("bodypart", "none");
|
||||
_referencePrice = set.getInt("price", 0);
|
||||
_crystalType = set.getEnum("crystal_type", CrystalType.class, CrystalType.NONE);
|
||||
_crystalCount = set.getInt("crystal_count", 0);
|
||||
@@ -206,6 +209,9 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
_defaultEnchantLevel = set.getInt("enchanted", 0);
|
||||
_reuseDelay = set.getInt("reuse_delay", 0);
|
||||
_sharedReuseGroup = set.getInt("shared_reuse_group", 0);
|
||||
_commissionItemType = set.getEnum("commissionItemType", CommissionItemType.class, CommissionItemType.OTHER_ITEM);
|
||||
_compoundItem = set.getInt("compoundItem", 0);
|
||||
_compoundChance = set.getFloat("compoundChance", 0);
|
||||
|
||||
String skills = set.getString("item_skill", null);
|
||||
if (skills != null)
|
||||
@@ -932,6 +938,21 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
return _sharedReuseGroup;
|
||||
}
|
||||
|
||||
public CommissionItemType getCommissionItemType()
|
||||
{
|
||||
return _commissionItemType;
|
||||
}
|
||||
|
||||
public int getCompoundItem()
|
||||
{
|
||||
return _compoundItem;
|
||||
}
|
||||
|
||||
public float getCompoundChance()
|
||||
{
|
||||
return _compoundChance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Usable in HTML windows.
|
||||
* @return the icon link in client files
|
||||
@@ -941,14 +962,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
return _icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return body part name
|
||||
*/
|
||||
public String getBodyPartName()
|
||||
{
|
||||
return _bodyPartName;
|
||||
}
|
||||
|
||||
public int getDefaultEnchantLevel()
|
||||
{
|
||||
return _defaultEnchantLevel;
|
||||
|
||||
@@ -862,9 +862,7 @@ public final class L2ItemInstance extends L2Object
|
||||
&& (getItem().getType2() != L2Item.TYPE2_QUEST) // Not Quest Item
|
||||
&& ((getItem().getType2() != L2Item.TYPE2_MONEY) || (getItem().getType1() != L2Item.TYPE1_SHIELD_ARMOR)) // not money, not shield
|
||||
&& ((pet == null) || (getObjectId() != pet.getControlObjectId())) // Not Control item of currently summoned pet
|
||||
&& (player.getActiveEnchantItemId() != getObjectId()) // Not momentarily used enchant scroll
|
||||
&& (player.getActiveEnchantSupportItemId() != getObjectId()) // Not momentarily used enchant support item
|
||||
&& (player.getActiveEnchantAttrItemId() != getObjectId()) // Not momentarily used enchant attribute item
|
||||
&& !(player.isProcessingItem(getObjectId())) // Not momentarily used enchant scroll
|
||||
&& (allowAdena || (getId() != Inventory.ADENA_ID)) // Not Adena
|
||||
&& ((player.getCurrentSkill() == null) || (player.getCurrentSkill().getSkill().getItemConsumeId() != getId())) && (!player.isCastingSimultaneouslyNow() || (player.getLastSimultaneousSkillCast() == null) || (player.getLastSimultaneousSkillCast().getItemConsumeId() != getId())) && (allowNonTradeable || (isTradeable() && (!((getItem().getItemType() == EtcItemType.PET_COLLAR) && player.havePetInvItems())))));
|
||||
}
|
||||
|
||||
@@ -47,8 +47,7 @@ public enum ZoneId
|
||||
NO_BOOKMARK,
|
||||
NO_ITEM_DROP,
|
||||
NO_RESTART,
|
||||
JUMP,
|
||||
BATTALION;
|
||||
JUMP;
|
||||
|
||||
public static int getZoneCount()
|
||||
{
|
||||
|
||||
@@ -1,268 +0,0 @@
|
||||
/*
|
||||
* 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.zone.type;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.datatables.ItemTable;
|
||||
import com.l2jserver.gameserver.datatables.SkillData;
|
||||
import com.l2jserver.gameserver.model.actor.L2Character;
|
||||
import com.l2jserver.gameserver.model.actor.L2Summon;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.PcInventory;
|
||||
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jserver.gameserver.model.skills.Skill;
|
||||
import com.l2jserver.gameserver.model.zone.L2ZoneRespawn;
|
||||
import com.l2jserver.gameserver.model.zone.ZoneId;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
|
||||
import com.l2jserver.util.Rnd;
|
||||
|
||||
/**
|
||||
* Another type of damage zone with skills
|
||||
* @author kerberos
|
||||
*/
|
||||
public class L2BattalionZone extends L2ZoneRespawn
|
||||
{
|
||||
private final static Skill NOBLESS_SKILL = SkillData.getInstance().getSkill(1323, 1);
|
||||
private final static String[] GRADE_NAMES =
|
||||
{
|
||||
"",
|
||||
"D",
|
||||
"C",
|
||||
"B",
|
||||
"A",
|
||||
"S",
|
||||
"S80",
|
||||
"S84",
|
||||
"R",
|
||||
"R95",
|
||||
"R99"
|
||||
};
|
||||
|
||||
public L2BattalionZone(int id)
|
||||
{
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onEnter(L2Character character)
|
||||
{
|
||||
character.setInsideZone(ZoneId.NO_SUMMON_FRIEND, true);
|
||||
character.setInsideZone(ZoneId.BATTALION, true);
|
||||
character.setInsideZone(ZoneId.PVP, true);
|
||||
if (!Config.BTZ_STORE_ZONE)
|
||||
{
|
||||
character.setInsideZone(ZoneId.NO_STORE, true);
|
||||
}
|
||||
|
||||
if (character.isPlayer())
|
||||
{
|
||||
final L2PcInstance activeChar = character.getActingPlayer();
|
||||
if ((Config.BTZ_CLASSES != null) && Config.BTZ_CLASSES.contains("" + activeChar.getClassId().getId()))
|
||||
{
|
||||
activeChar.teleToLocation(83597, 147888, -3405);
|
||||
activeChar.sendMessage("Your class is not allowed in the Battalion zone.");
|
||||
return;
|
||||
}
|
||||
|
||||
for (L2ItemInstance o : activeChar.getInventory().getItems())
|
||||
{
|
||||
if (o.isEquipable() && o.isEquipped() && !checkItem(o))
|
||||
{
|
||||
int slot = activeChar.getInventory().getSlotFromItem(o);
|
||||
activeChar.getInventory().unEquipItemInBodySlot(slot);
|
||||
activeChar.sendMessage(o.getName() + " unequiped because is not allowed inside this zone.");
|
||||
}
|
||||
}
|
||||
activeChar.sendMessage("You entered into the Battalion zone.");
|
||||
clear(activeChar);
|
||||
if (Config.BTZ_GIVE_NOBLES)
|
||||
{
|
||||
NOBLESS_SKILL.applyEffects(activeChar, activeChar);
|
||||
}
|
||||
if (Config.BTZ_PVP_ENABLED)
|
||||
{
|
||||
activeChar.updatePvPFlag(1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onExit(L2Character character)
|
||||
{
|
||||
character.setInsideZone(ZoneId.NO_SUMMON_FRIEND, false);
|
||||
character.setInsideZone(ZoneId.BATTALION, false);
|
||||
character.setInsideZone(ZoneId.PVP, false);
|
||||
if (!Config.BTZ_STORE_ZONE)
|
||||
{
|
||||
character.setInsideZone(ZoneId.NO_STORE, false);
|
||||
}
|
||||
|
||||
if (character.isPlayer())
|
||||
{
|
||||
final L2PcInstance activeChar = character.getActingPlayer();
|
||||
activeChar.sendMessage("You left from a Battalion zone.");
|
||||
|
||||
if (Config.BTZ_PVP_ENABLED)
|
||||
{
|
||||
activeChar.stopPvPFlag();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDieInside(final L2Character character)
|
||||
{
|
||||
if (character.isPlayer())
|
||||
{
|
||||
final L2PcInstance activeChar = character.getActingPlayer();
|
||||
if (Config.BTZ_REVIVE)
|
||||
{
|
||||
ThreadPoolManager.getInstance().scheduleGeneral(() ->
|
||||
{
|
||||
activeChar.doRevive();
|
||||
heal(activeChar);
|
||||
int[] loc = Config.BTZ_SPAWN_LOCATIONS[Rnd.get(Config.BTZ_SPAWN_LOCATIONS.length)];
|
||||
activeChar.teleToLocation(loc[0] + Rnd.get(-Config.BTZ_RADIUS, Config.BTZ_RADIUS), loc[1] + Rnd.get(-Config.BTZ_RADIUS, Config.BTZ_RADIUS), loc[2]);
|
||||
}, Config.BTZ_REVIVE_DELAY * 1000);
|
||||
|
||||
ExShowScreenMessage revive = new ExShowScreenMessage("You will be respawned in " + Config.BTZ_REVIVE_DELAY + " seconds.", 5000, true, 2); // 5 Seconds display
|
||||
activeChar.sendPacket(revive);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReviveInside(L2Character character)
|
||||
{
|
||||
if (character.isPlayer())
|
||||
{
|
||||
final L2PcInstance activeChar = character.getActingPlayer();
|
||||
if (Config.BTZ_REVIVE_NOBLESS)
|
||||
{
|
||||
NOBLESS_SKILL.applyEffects(activeChar, activeChar);
|
||||
}
|
||||
if (Config.BTZ_REVIVE_HEAL)
|
||||
{
|
||||
heal(activeChar);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void clear(L2PcInstance player)
|
||||
{
|
||||
if (Config.BTZ_REMOVE_BUFFS)
|
||||
{
|
||||
player.stopAllEffectsExceptThoseThatLastThroughDeath();
|
||||
if (Config.BTZ_REMOVE_PETS)
|
||||
{
|
||||
L2Summon pet = player.getPet();
|
||||
if (pet != null)
|
||||
{
|
||||
pet.stopAllEffectsExceptThoseThatLastThroughDeath();
|
||||
pet.unSummon(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Config.BTZ_REMOVE_PETS)
|
||||
{
|
||||
L2Summon pet = player.getPet();
|
||||
if (pet != null)
|
||||
{
|
||||
pet.unSummon(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void heal(L2PcInstance activeChar)
|
||||
{
|
||||
activeChar.setCurrentHp(activeChar.getMaxHp());
|
||||
activeChar.setCurrentCp(activeChar.getMaxCp());
|
||||
activeChar.setCurrentMp(activeChar.getMaxMp());
|
||||
}
|
||||
|
||||
public static void givereward(L2PcInstance player)
|
||||
{
|
||||
if (player.isInsideZone(ZoneId.BATTALION))
|
||||
{
|
||||
SystemMessage systemMessage = null;
|
||||
|
||||
for (int[] reward : Config.BTZ_REWARDS)
|
||||
{
|
||||
final PcInventory inv = player.getInventory();
|
||||
|
||||
if (ItemTable.getInstance().getTemplate(reward[0]).isStackable())
|
||||
{
|
||||
inv.addItem("L2MultiFunctionZone ", reward[0], reward[1], player, player);
|
||||
|
||||
if (reward[1] > 1)
|
||||
{
|
||||
systemMessage = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_EARNED_S2_S1_S);
|
||||
systemMessage.addItemName(reward[0]);
|
||||
systemMessage.addLong(reward[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
systemMessage = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_EARNED_S1);
|
||||
systemMessage.addItemName(reward[0]);
|
||||
}
|
||||
player.sendPacket(systemMessage);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < reward[1]; ++i)
|
||||
{
|
||||
inv.addItem("L2MultiFunctionZone ", reward[0], 1, player, player);
|
||||
systemMessage = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_EARNED_S1);
|
||||
systemMessage.addItemName(reward[0]);
|
||||
player.sendPacket(systemMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean checkItem(L2ItemInstance item)
|
||||
{
|
||||
final int o = item.getItem().getCrystalType().ordinal();
|
||||
final int e = item.getEnchantLevel();
|
||||
|
||||
if ((Config.BTZ_ENCHANT != 0) && (e >= Config.BTZ_ENCHANT))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Config.BTZ_GRADES.contains(GRADE_NAMES[o]))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((Config.BTZ_ITEMS != null) && Config.BTZ_ITEMS.contains("" + item.getId()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user