Dropped RideState class.

This commit is contained in:
MobiusDev
2019-01-14 04:35:27 +00:00
parent 5390e3a42a
commit ca1dde80a6
1696 changed files with 88 additions and 92095 deletions

View File

@ -1,33 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* 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.l2jmobius.gameserver.model.skills;
/**
* Ride state enumerated.
* @author Zoey76
*/
public enum RideState
{
/** Riding nothing. */
NONE,
/** Riding a strider. */
STRIDER,
/** Riding a wolf. */
WOLF,
/** Riding a wyvern. */
WYVERN,
}

View File

@ -37,7 +37,6 @@ import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData;
import com.l2jmobius.gameserver.enums.AttributeType;
import com.l2jmobius.gameserver.enums.BasicProperty;
import com.l2jmobius.gameserver.enums.MountType;
import com.l2jmobius.gameserver.enums.NextActionType;
import com.l2jmobius.gameserver.enums.ShotType;
import com.l2jmobius.gameserver.handler.AffectScopeHandler;
@ -48,7 +47,6 @@ import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.PcCondOverride;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.cubic.CubicInstance;
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
import com.l2jmobius.gameserver.model.effects.EffectFlag;
@ -167,7 +165,6 @@ public final class Skill implements IIdentifiable
private final boolean _isTriggeredSkill; // If true the skill will take activation buff slot instead of a normal buff slot
private final int _effectPoint;
private Set<MountType> _rideState;
private final Map<SkillConditionScope, List<ISkillCondition>> _conditionLists = new EnumMap<>(SkillConditionScope.class);
private final Map<EffectScope, List<AbstractEffect>> _effectLists = new EnumMap<>(EffectScope.class);
@ -212,6 +209,13 @@ public final class Skill implements IIdentifiable
private final SkillBuffType _buffType;
private final boolean _displayInList;
private final static List<Integer> MOUNT_ENABLED_SKILLS = new ArrayList<>();
static
{
MOUNT_ENABLED_SKILLS.add(4289); // Wyvern Breath
MOUNT_ENABLED_SKILLS.add(325); // Strider Siege Assault
}
public Skill(StatsSet set)
{
_id = set.getInt(".id");
@ -282,26 +286,6 @@ public final class Skill implements IIdentifiable
_affectObject = set.getEnum("affectObject", AffectObject.class, AffectObject.ALL);
_affectRange = set.getInt("affectRange", 0);
final String rideState = set.getString("rideState", null);
if (rideState != null)
{
final String[] state = rideState.split(";");
if (state.length > 0)
{
_rideState = new HashSet<>(state.length);
for (String s : state)
{
try
{
_rideState.add(MountType.valueOf(s));
}
catch (Exception e)
{
LOGGER.log(Level.WARNING, "Bad data in rideState for skill " + this + "!", e);
}
}
}
}
final String fanRange = set.getString("fanRange", null);
if (fanRange != null)
{
@ -1087,7 +1071,7 @@ public final class Skill implements IIdentifiable
return true;
}
if (activeChar.isPlayer() && !canBeUseWhileRiding((L2PcInstance) activeChar))
if (activeChar.isPlayer() && activeChar.getActingPlayer().isMounted() && isBad() && !MOUNT_ENABLED_SKILLS.contains(_id))
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_CANNOT_BE_USED_DUE_TO_UNSUITABLE_TERMS);
sm.addSkillName(_id);
@ -1109,16 +1093,6 @@ public final class Skill implements IIdentifiable
return true;
}
/**
* Checks if a player can use this skill while riding.
* @param player the player
* @return {@code true} if the player can use this skill, {@code false} otherwise
*/
public boolean canBeUseWhileRiding(L2PcInstance player)
{
return (_rideState == null) || _rideState.contains(player.getMountType());
}
/**
* @param activeChar the character that requests getting the skill target.
* @param forceUse if character pressed ctrl (force pick target)
@ -1740,11 +1714,6 @@ public final class Skill implements IIdentifiable
return _channelingStart;
}
public Set<MountType> getRideState()
{
return _rideState;
}
public boolean isMentoring()
{
return _isMentoring;