|
@@ -9441,7 +9441,7 @@ public final class L2PcInstance extends L2Playable
|
|
|
}
|
|
|
|
|
|
// TODO: Unhardcode skillId 844 which is the outpost construct skill
|
|
|
- if (((sklTargetType == L2TargetType.HOLY) && !checkIfOkToCastSealOfRule(CastleManager.getInstance().getCastle(this), false, skill, target)) || ((sklTargetType == L2TargetType.FLAGPOLE) && !checkIfOkToCastFlagDisplay(FortManager.getInstance().getFort(this), false, skill, target)) || ((sklType == L2SkillType.SIEGEFLAG) && !L2SkillSiegeFlag.checkIfOkToPlaceFlag(this, false, skill.getId() == 844)) || ((sklType == L2SkillType.SUMMON_FRIEND) && !(checkSummonerStatus(this) && checkSummonTargetStatus(target, this))))
|
|
|
+ if (((sklTargetType == L2TargetType.HOLY) && !checkIfOkToCastSealOfRule(CastleManager.getInstance().getCastle(this), false, skill, target)) || ((sklTargetType == L2TargetType.FLAGPOLE) && !checkIfOkToCastFlagDisplay(FortManager.getInstance().getFort(this), false, skill, target)) || ((sklType == L2SkillType.SIEGEFLAG) && !L2SkillSiegeFlag.checkIfOkToPlaceFlag(this, false, skill.getId() == 844)))
|
|
|
{
|
|
|
sendPacket(ActionFailed.STATIC_PACKET);
|
|
|
abortCast();
|
|
@@ -13566,183 +13566,6 @@ public final class L2PcInstance extends L2Playable
|
|
|
getStat().updateVitalityPoints(points, useRates, quiet);
|
|
|
}
|
|
|
|
|
|
- public static void teleToTarget(L2PcInstance targetChar, L2PcInstance summonerChar, L2Skill summonSkill)
|
|
|
- {
|
|
|
- if ((targetChar == null) || (summonerChar == null) || (summonSkill == null))
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (!checkSummonerStatus(summonerChar))
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (!checkSummonTargetStatus(targetChar, summonerChar))
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- int itemConsumeId = summonSkill.getTargetConsumeId();
|
|
|
- int itemConsumeCount = summonSkill.getTargetConsume();
|
|
|
- if ((itemConsumeId != 0) && (itemConsumeCount != 0))
|
|
|
- {
|
|
|
- if (targetChar.getInventory().getInventoryItemCount(itemConsumeId, 0) < itemConsumeCount)
|
|
|
- {
|
|
|
- SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_REQUIRED_FOR_SUMMONING);
|
|
|
- sm.addItemName(summonSkill.getTargetConsumeId());
|
|
|
- targetChar.sendPacket(sm);
|
|
|
- return;
|
|
|
- }
|
|
|
- targetChar.getInventory().destroyItemByItemId("Consume", itemConsumeId, itemConsumeCount, summonerChar, targetChar);
|
|
|
- SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_DISAPPEARED);
|
|
|
- sm.addItemName(summonSkill.getTargetConsumeId());
|
|
|
- targetChar.sendPacket(sm);
|
|
|
- }
|
|
|
- targetChar.teleToLocation(summonerChar.getX(), summonerChar.getY(), summonerChar.getZ(), true);
|
|
|
- }
|
|
|
-
|
|
|
- public static boolean checkSummonerStatus(L2PcInstance summonerChar)
|
|
|
- {
|
|
|
- if (summonerChar == null)
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- if (summonerChar.isInOlympiadMode())
|
|
|
- {
|
|
|
- summonerChar.sendPacket(SystemMessageId.THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT);
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- if (summonerChar.inObserverMode())
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- if (!TvTEvent.onEscapeUse(summonerChar.getObjectId()))
|
|
|
- {
|
|
|
- summonerChar.sendPacket(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING);
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- if (summonerChar.isInsideZone(ZoneId.NO_SUMMON_FRIEND) || summonerChar.isFlyingMounted())
|
|
|
- {
|
|
|
- summonerChar.sendPacket(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING);
|
|
|
- return false;
|
|
|
- }
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- public static boolean checkSummonTargetStatus(L2Object target, L2PcInstance summonerChar)
|
|
|
- {
|
|
|
- if ((target == null) || !(target instanceof L2PcInstance))
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- L2PcInstance targetChar = (L2PcInstance) target;
|
|
|
-
|
|
|
- if (targetChar.isAlikeDead())
|
|
|
- {
|
|
|
- SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_DEAD_AT_THE_MOMENT_AND_CANNOT_BE_SUMMONED);
|
|
|
- sm.addPcName(targetChar);
|
|
|
- summonerChar.sendPacket(sm);
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- if (targetChar.isInStoreMode())
|
|
|
- {
|
|
|
- SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_CURRENTLY_TRADING_OR_OPERATING_PRIVATE_STORE_AND_CANNOT_BE_SUMMONED);
|
|
|
- sm.addPcName(targetChar);
|
|
|
- summonerChar.sendPacket(sm);
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- if (targetChar.isRooted() || targetChar.isInCombat())
|
|
|
- {
|
|
|
- SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_ENGAGED_IN_COMBAT_AND_CANNOT_BE_SUMMONED);
|
|
|
- sm.addPcName(targetChar);
|
|
|
- summonerChar.sendPacket(sm);
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- if (targetChar.isInOlympiadMode())
|
|
|
- {
|
|
|
- summonerChar.sendPacket(SystemMessageId.YOU_CANNOT_SUMMON_PLAYERS_WHO_ARE_IN_OLYMPIAD);
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- if (targetChar.isFestivalParticipant() || targetChar.isFlyingMounted())
|
|
|
- {
|
|
|
- summonerChar.sendPacket(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING);
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- if (targetChar.inObserverMode())
|
|
|
- {
|
|
|
- SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_STATE_FORBIDS_SUMMONING);
|
|
|
- sm.addCharName(targetChar);
|
|
|
- summonerChar.sendPacket(sm);
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- if (targetChar.isCombatFlagEquipped())
|
|
|
- {
|
|
|
- summonerChar.sendPacket(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING);
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- if (!TvTEvent.onEscapeUse(targetChar.getObjectId()))
|
|
|
- {
|
|
|
- summonerChar.sendPacket(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING);
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- if (targetChar.isInsideZone(ZoneId.NO_SUMMON_FRIEND))
|
|
|
- {
|
|
|
- SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IN_SUMMON_BLOCKING_AREA);
|
|
|
- sm.addString(targetChar.getName());
|
|
|
- summonerChar.sendPacket(sm);
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- if (summonerChar.getInstanceId() > 0)
|
|
|
- {
|
|
|
- Instance summonerInstance = InstanceManager.getInstance().getInstance(summonerChar.getInstanceId());
|
|
|
- if (!Config.ALLOW_SUMMON_TO_INSTANCE || !summonerInstance.isSummonAllowed())
|
|
|
- {
|
|
|
- summonerChar.sendPacket(SystemMessageId.YOU_MAY_NOT_SUMMON_FROM_YOUR_CURRENT_LOCATION);
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // on retail character can enter 7s dungeon with summon friend,
|
|
|
- // but will be teleported away by mobs
|
|
|
- // because currently this is not working in L2J we do not allowing summoning
|
|
|
- if (summonerChar.isIn7sDungeon())
|
|
|
- {
|
|
|
- int targetCabal = SevenSigns.getInstance().getPlayerCabal(targetChar.getObjectId());
|
|
|
- if (SevenSigns.getInstance().isSealValidationPeriod())
|
|
|
- {
|
|
|
- if (targetCabal != SevenSigns.getInstance().getCabalHighestScore())
|
|
|
- {
|
|
|
- summonerChar.sendPacket(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING);
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (targetCabal == SevenSigns.CABAL_NULL)
|
|
|
- {
|
|
|
- summonerChar.sendPacket(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING);
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
public void checkItemRestriction()
|
|
|
{
|
|
|
for (int i = 0; i < Inventory.PAPERDOLL_TOTALSLOTS; i++)
|