Project update.

This commit is contained in:
MobiusDev
2015-12-31 23:53:41 +00:00
parent e0d681a17e
commit ad2bcd79be
4084 changed files with 83696 additions and 86998 deletions

View File

@ -0,0 +1,413 @@
/*
* 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;
/**
* Abnormal type enumerate.
* @author Zoey76
*/
public enum AbnormalType
{
ABNORMAL_INVINCIBILITY,
ABNORMAL_ITEM,
AB_HAWK_EYE,
ALL_ATTACK_DOWN,
ALL_REGEN_UP,
ALL_SPEED_DOWN,
ANESTHESIA,
ANTARAS_DEBUFF,
APELLA,
ARCHER_SPECIAL,
ARCHER_SPECIAL_I,
ARMOR_EARTH,
ARMOR_FIRE,
ARMOR_HOLY,
ARMOR_UNHOLY,
ARMOR_WATER,
ARMOR_WIND,
ARROW_RAIN,
ATTACK_SPEED_UP_BOW,
ATTACK_TIME_DOWN,
ATTACK_TIME_DOWN_SPECIAL,
ATTACK_TIME_UP,
ATTRIBUTE_POTION,
AVOID_DOWN,
AVOID_SKILL,
AVOID_UP,
AVOID_UP_SPECIAL,
CHANGE_BODY,
BERSERKER,
BETRAYAL_MARK,
BIG_BODY,
BIG_HEAD,
BLEEDING,
BLESS_THE_BLOOD,
BLOCK_RESURRECTION,
BLOCK_SHIELD_UP,
BLOCK_SPEED_UP,
BLOCK_TRANSFORM,
BLOOD_CONSTRACT,
BOT_PENALTY,
BR_EVENT_BUF1,
BR_EVENT_BUF10,
BR_EVENT_BUF2,
BR_EVENT_BUF3,
BR_EVENT_BUF5,
BR_EVENT_BUF6,
BR_EVENT_BUF7,
BUFF_QUEEN_OF_CAT,
BUFF_UNICORN_SERAPHIM,
CANCEL_PROB_DOWN,
CASTING_TIME_DOWN,
CASTING_TIME_UP,
CHANGE_CLASS,
CHEAP_MAGIC,
COMBINATION,
COUNTER_CRITICAL,
COUNTER_CRITICAL_TRIGGER,
COUNTER_SKILL,
CP_UP,
CRITICAL_DMG_DOWN,
CRITICAL_DMG_UP,
CRITICAL_POISON,
CRITICAL_PROB_DOWN,
CRITICAL_PROB_UP,
CURSE_LIFE_FLOW,
DAMAGE_AMPLIFY,
DANCE_DEFENCE_MOTION1,
DANCE_OF_ALIGNMENT,
DANCE_OF_AQUA_GUARD,
DANCE_OF_BERSERKER,
DANCE_OF_BLADESTORM,
DANCE_OF_CONCENTRATION,
DANCE_OF_EARTH_GUARD,
DANCE_OF_FIRE,
DANCE_OF_FURY,
DANCE_OF_INSPIRATION,
DANCE_OF_LIGHT,
DANCE_OF_MYSTIC,
DANCE_OF_PROTECTION,
DANCE_OF_SHADOW,
DANCE_OF_SIREN,
DANCE_OF_VAMPIRE,
DANCE_OF_WARRIOR,
DARK_SEED,
DD_RESIST,
DEATHWORM,
DEATH_CLACK,
DEATH_MARK,
DEATH_PENALTY,
DEBUFF_NIGHTSHADE,
DEBUFF_SHIELD,
DECREASE_WEIGHT_PENALTY,
DERANGEMENT,
DETECT_WEAKNESS,
DISARM,
DITTY_BUFF,
DMG_SHIELD,
DOT_ATTR,
DOT_MP,
DRAGON_BUFF,
DRAGON_BREATH,
DUELIST_SPIRIT,
DWARF_ATTACK_BUFF,
DWARF_DEFENCE_BUFF,
ELEMENTAL_ARMOR,
ENERVATION,
ENTRY_FOR_GAME,
EVASION_BUFF,
EVENT_GAWI,
EVENT_SANTA_REWARD,
EVENT_TERRITORY,
EVENT_WIN,
EVIL_BLOOD,
EXPOSE_WEAK_POINT,
FATAL_POISON,
FINAL_SECRET,
FIRE_DOT,
FISHING_MASTERY_DOWN,
FLAME_HAWK,
FLY_AWAY,
FOCUS_DAGGER,
FORCE_MEDITATION,
FORCE_OF_DESTRUCTION,
FREEZING,
GHOST_PIERCING,
HEAL_EFFECT_DOWN,
HEAL_EFFECT_UP,
HEAL_POWER_UP,
HERO_BUFF,
HERO_DEBUFF,
HIDE,
HIT_DOWN,
HIT_UP,
HOLY_ATTACK,
HOT_GROUND,
HP_RECOVER,
HP_REGEN_DOWN,
HP_REGEN_UP,
IMPROVE_CRT_RATE_DMG_UP,
IMPROVE_HIT_DEFENCE_CRT_RATE_UP,
IMPROVE_HP_MP_UP,
IMPROVE_MA_MD_UP,
IMPROVE_PA_PD_UP,
IMPROVE_SHIELD_RATE_DEFENCE_UP,
IMPROVE_SPEED_AVOID_UP,
IMPROVE_VAMPIRIC_HASTE,
INSTINCT,
INVINCIBILITY,
IRON_SHIELD,
IRON_SHIELD_I,
KAMAEL_SPECIAL,
KNIGHT_AURA,
KNOCK_DOWN,
LIFE_FORCE_KAMAEL,
LIFE_FORCE_ORC,
LIFE_FORCE_OTHERS,
LIMIT,
MAGICAL_STANCE,
MAGIC_CRITICAL_UP,
MAJESTY,
MAXIMUM_ABILITY,
MAX_BREATH_UP,
MAX_HP_DOWN,
MAX_HP_UP,
MAX_HP_CP_UP,
MAX_MP_UP,
MA_DOWN,
MA_MD_UP,
MA_UP,
MA_UP_HERB,
MA_UP_SPECIAL,
MD_DOWN,
MD_UP,
MD_UP_ATTR,
MENTAL_IMPOVERISH,
METEOR,
MIGHT_MORTAL,
MIRAGE,
MIRAGE_TRAP,
MP_COST_DOWN,
MP_COST_UP,
MP_REGEN_UP,
MULTI_BUFF,
MULTI_BUFF_A,
MULTI_DEBUFF,
MULTI_DEBUFF_A,
MULTI_DEBUFF_B,
MULTI_DEBUFF_C,
MULTI_DEBUFF_D,
MULTI_DEBUFF_E,
MULTI_DEBUFF_F,
MULTI_DEBUFF_FIRE,
MULTI_DEBUFF_G,
MULTI_DEBUFF_HOLY,
MULTI_DEBUFF_SOUL,
MULTI_DEBUFF_UNHOLY,
MULTI_DEBUFF_WATER,
MULTI_DEBUFF_WIND,
NONE,
NORMAL_ATTACK_BLOCK,
OBLIVION,
PARALYZE,
PATIENCE,
PA_DOWN,
PA_PD_UP,
PA_UP,
PA_UP_HERB,
PA_UP_SPECIAL,
PD_DOWN,
PD_UP,
PD_UP_BOW,
PD_UP_SPECIAL,
PHYSICAL_STANCE,
PINCH,
PK_PROTECT,
POISON,
POLEARM_ATTACK,
POSSESSION,
POSSESSION_SPECIAL, // Used in High Five skills.
POTION_OF_GENESIS,
PRESERVE_ABNORMAL,
PROTECTION,
PUBLIC_SLOT,
PVP_DMG_DOWN,
PVP_WEAPON_BUFF,
PVP_WEAPON_DEBUFF,
RAGE_MIGHT,
REAL_TARGET,
RECHARGE_UP,
REDUCE_DROP_PENALTY,
REFLECT_ABNORMAL,
REFLECT_MAGIC_DD,
RESIST_BLEEDING,
RESIST_DEBUFF_DISPEL,
RESIST_DERANGEMENT,
RESIST_HOLY_UNHOLY,
RESIST_POISON,
RESIST_SHOCK,
RESIST_SPIRITLESS,
RESURRECTION_SPECIAL,
REUSE_DELAY_DOWN,
REUSE_DELAY_UP,
ROOT_MAGICALLY,
ROOT_PHYSICALLY,
SEED_OF_CRITICAL,
SEED_OF_KNIGHT,
SEIZURE_A,
SEIZURE_B,
SEIZURE_C,
SEIZURE_PENALTY,
SHIELD_DEFENCE_UP,
SHIELD_PROB_UP,
SIGNAL_A,
SIGNAL_B,
SIGNAL_C,
SIGNAL_D,
SIGNAL_E,
SILENCE,
SILENCE_ALL,
SILENCE_PHYSICAL,
SKILL_IGNORE,
SLEEP,
SNIPE,
SOA_BUFF1,
SOA_BUFF2,
SOA_BUFF3,
SONG_BATTLE_WHISPER,
SONG_OF_CHAMPION,
SONG_OF_EARTH,
SONG_OF_ELEMENTAL,
SONG_OF_FLAME_GUARD,
SONG_OF_HUNTER,
SONG_OF_INVOCATION,
SONG_OF_LIFE,
SONG_OF_MEDITATION,
SONG_OF_PURIFICATION,
SONG_OF_RENEWAL,
SONG_OF_STORM_GUARD,
SONG_OF_VENGEANCE,
SONG_OF_VITALITY,
SONG_OF_WARDING,
SONG_OF_WATER,
SONG_OF_WIND,
SONG_OF_WINDSTORM,
SPA_DISEASE_A,
SPA_DISEASE_B,
SPA_DISEASE_C,
SPA_DISEASE_D,
SPEED_DOWN,
SPEED_UP,
SPEED_UP_SPECIAL,
SPITE,
SPOIL_BOMB,
SSQ_TOWN_BLESSING,
SSQ_TOWN_CURSE,
STAR_FALL,
STEALTH,
STIGMA_A,
STIGMA_OF_SILEN,
STUN,
SUB_TRIGGER_CRT_RATE_UP,
SUB_TRIGGER_DEFENCE,
SUB_TRIGGER_HASTE,
SUB_TRIGGER_SPIRIT,
SUMMON_CONDITION,
TALISMAN,
TARGET_LOCK,
THIN_SKIN,
THRILL_FIGHT,
TIME_CHECK,
TOUCH_OF_DEATH,
TOUCH_OF_LIFE,
TRANSFER_DAMAGE,
TRANSFORM,
TRANSFORM_HANGOVER,
TRANSFORM_SCRIFICE,
TRANSFORM_SCRIFICE_P,
TURN_FLEE,
TURN_PASSIVE,
TURN_STONE,
T_CRT_DMG_DOWN,
T_CRT_DMG_UP,
T_CRT_RATE_UP,
ULTIMATE_BUFF,
ULTIMATE_DEBUFF,
VALAKAS_ITEM,
VAMPIRIC_ATTACK,
VAMPIRIC_ATTACK_SPECIAL,
VIBRATION,
VOTE,
VP_KEEP,
VP_UP,
WATCHER_GAZE,
WATER_DOT,
WEAK_CONSTITUTION,
WEAPON_MASTERY,
WILL,
WIND_DOT,
WP_CHANGE_EVENT,
HARMONY,
MELODY_HORN,
MELODY_DRUM,
MELODY_PIPE,
MELODY_GUITAR,
MELODY_HARP,
MELODY_LUTE,
PREV_SONATA,
DARING_SONATA,
REF_SONATA,
ELEMENTAL_RESISTANCE_ISS,
HOLY_ATTACK_RESISTANCE_ISS,
MENTAL_ATTACK_RESISTANCE_ISS,
SIGEL_AURA,
FEOH_STANCE,
YUL_STANCE,
RHYTHM_OF_CRITICAL,
RHYTHM_OF_MAGIC,
RHYTHM_OF_COMBAT,
RHYTHM_OF_FIGHTER,
RHYTHM_OF_REVENGE,
RHYTHM_OF_START,
RHYTHM_OF_MAGICIAN;
/**
* Get the enumerate for the given String.
* @param type the abnormal type to get
* @return the abnormal type
*/
public static AbnormalType getAbnormalType(String type)
{
try
{
return Enum.valueOf(AbnormalType.class, type);
}
catch (Exception e)
{
return NONE;
}
}
/**
* Verify if this enumerate is default.
* @return {@code true} if this enumerate is none, {@code false} otherwise
*/
public boolean isNone()
{
return this == NONE;
}
}

View File

@ -0,0 +1,190 @@
/*
* 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;
/**
* Abnormal Visual Effect enumerated.
* @author NosBit
*/
public enum AbnormalVisualEffect
{
DOT_BLEEDING(1),
DOT_POISON(2),
DOT_FIRE(3),
DOT_WATER(4),
DOT_WIND(5),
DOT_SOIL(6),
STUN(7),
SLEEP(8),
SILENCE(9),
ROOT(10),
PARALYZE(11),
FLESH_STONE(12),
DOT_MP(13),
BIG_HEAD(14),
DOT_FIRE_AREA(15),
CHANGE_TEXTURE(16),
BIG_BODY(17),
FLOATING_ROOT(18),
DANCE_ROOT(19),
GHOST_STUN(20),
STEALTH(21),
SEIZURE1(22),
SEIZURE2(23),
MAGIC_SQUARE(24),
FREEZING(25),
SHAKE(26),
ULTIMATE_DEFENCE(28),
VP_UP(29),
REAL_TARGET(30),
DEATH_MARK(31),
TURN_FLEE(32),
INVINCIBILITY(33),
AIR_BATTLE_SLOW(34),
AIR_BATTLE_ROOT(35),
CHANGE_WEAPON(36),
CHANGE_GOLD_AFRO(37),
CHANGE_PINK_AFRO(38),
CHANGE_BLACK_AFRO(39),
STIGMA_OF_SILEN(41),
SPEED_DOWN(42),
FROZEN_PILLAR(43),
CHANGE_VESPER_S(44),
CHANGE_VESPER_C(45),
CHANGE_VESPER_D(46),
TIME_BOMB(47),
MP_SHIELD(48),
AIR_BIND(49),
CHANGE_BODY(50),
KNOCK_DOWN(51),
NAVIT_ADVENT(52),
KNOCK_BACK(53),
CHANGE_7TH_ANNIVERSARY(54),
ON_SPOT_MOVEMENT(55),
DEPORT(56),
AURA_BUFF(57),
AURA_BUFF_SELF(58),
AURA_DEBUFF(59),
AURA_DEBUFF_SELF(60),
HURRICANE(61),
HURRICANE_SELF(62),
BLACK_MARK(63),
SOUL_AVATAR(64),
CHANGE_8TH_ANNIVERSARY(65),
NO_CHAT(68),
HERB_OF_POWER(69),
HERB_OF_MAGIC(70),
TALISMAN_DECO_DARK_PURPLE(71),
TALISMAN_POWER2(72), // removed?
TALISMAN_DECO_GOLD(73),
TALISMAN_DECO_ORANGE(74),
TALISMAN_DECO_BLUE(75),
TALISMAN_DECO_LIGHT_PURPLE(76),
CHANGE_CURIOUS_HOUSE(77),
CHANGE_MEMORY_N(78),
CHANGE_MEMORY_D(79),
CHANGE_MEMORY_C(80),
CHANGE_MEMORY_B(81),
CHANGE_MEMORY_A(82),
CHANGE_SWIMSUIT_A(83),
CHANGE_SWIMSUIT_B(84),
CHANGE_XMAS(85),
CARD_PC_DECO(86),
CHANGE_DINOS(87),
CHANGE_VALENTINE(88),
CHOCOLATE(89),
CANDY(90),
COOKIE(91),
STARS_0(92),
STARS_1(93),
STARS_2(94),
STARS_3(95),
STARS_4(96),
STARS_5(97),
DUELING(98),
FREEZING2(99),
CHANGE_YOGI(100),
YOGI(101),
MUSICAL_NOTE_YELLOW(102),
MUSICAL_NOTE_BLUE(103),
MUSICAL_NOTE_GREEN(104),
TENTH_ANNIVERSARY(105),
XMAS_SOCKS(106),
XMAS_TREE(107),
XMAS_SNOWMAN(108),
OTHELL_ROGUE_BLUFF(109),
HE_PROTECT(110),
SU_SUMCROSS(111),
WIND_STUN(112),
STORM_SIGN2(113),
STORM_SIGN1(114),
WIND_BLEND(115),
DECEPTIVE_BLINK(116),
WIND_HIDE(117),
PSY_POWER(118),
SQUALL(119),
WIND_ILLUSION(120),
SAYHA_FURY(121),
HIDE4(123),
PMENTAL_TRAIL(124),
HOLD_LIGHTING(125),
GRAVITY_SPACE_3(126),
SPACEREF(127),
HE_ASPECT(128),
CHANGE_AR1(129),
CHANGE_AR2(130),
CHANGE_AR3(131),
CHANGE_AR4(132),
CHANGE_AR5(133),
CHANGE_AR6(134),
CHANGE_WP1(135),
CHANGE_WP2(136),
CHANGE_HALLOWEEN(1000);
private final int _clientId;
private AbnormalVisualEffect(int clientId)
{
_clientId = clientId;
}
/**
* Gets the client id.
* @return the client id
*/
public int getClientId()
{
return _clientId;
}
/**
* Finds abnormal visual effect by name.
* @param name the name
* @return The abnormal visual effect if its found, {@code null} otherwise
*/
public static final AbnormalVisualEffect findByName(String name)
{
for (AbnormalVisualEffect abnormalVisualEffect : values())
{
if (abnormalVisualEffect.name().equalsIgnoreCase(name))
{
return abnormalVisualEffect;
}
}
return null;
}
}

View File

@ -0,0 +1,57 @@
/*
* 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;
import java.util.HashMap;
import java.util.Map;
import com.l2jmobius.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();
}
}

View File

@ -0,0 +1,431 @@
/*
* 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;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.GameTimeController;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.model.CharEffectList;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Summon;
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
import com.l2jmobius.gameserver.model.effects.EffectTaskInfo;
import com.l2jmobius.gameserver.model.effects.EffectTickTask;
import com.l2jmobius.gameserver.model.stats.Formulas;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
/**
* Buff Info.<br>
* Complex DTO that holds all the information for a given buff (or debuff or dance/song) set of effects issued by an skill.
* @author Zoey76
*/
public final class BuffInfo
{
// Data
/** Data. */
private final L2Character _effector;
private final L2Character _effected;
private final Skill _skill;
/** The effects. */
private final List<AbstractEffect> _effects = new ArrayList<>(1);
// Tasks
/** Effect tasks for ticks. */
private volatile Map<AbstractEffect, EffectTaskInfo> _tasks;
/** Scheduled future. */
private ScheduledFuture<?> _scheduledFutureTimeTask;
// Time and ticks
/** Abnormal time. */
private int _abnormalTime;
/** The game ticks at the start of this effect. */
private final int _periodStartTicks;
// Misc
/** If {@code true} then this effect has been cancelled. */
private boolean _isRemoved = false;
/** If {@code true} then this effect is in use (or has been stop because an Herb took place). */
private boolean _isInUse = true;
/**
* Buff Info constructor.
* @param effector
* @param effected
* @param skill
*/
public BuffInfo(L2Character effector, L2Character effected, Skill skill)
{
_effector = effector;
_effected = effected;
_skill = skill;
_abnormalTime = Formulas.calcEffectAbnormalTime(effector, effected, skill);
_periodStartTicks = GameTimeController.getInstance().getGameTicks();
}
/**
* Gets the effects on this buff info.
* @return the effects
*/
public List<AbstractEffect> getEffects()
{
return _effects;
}
/**
* Adds an effect to this buff info.
* @param effect the effect to add
*/
public void addEffect(AbstractEffect effect)
{
_effects.add(effect);
}
/**
* Adds an effect task to this buff info.<br>
* Uses double-checked locking to initialize the map if it's necessary.
* @param effect the effect that owns the task
* @param effectTaskInfo the task info
*/
private void addTask(AbstractEffect effect, EffectTaskInfo effectTaskInfo)
{
if (_tasks == null)
{
synchronized (this)
{
if (_tasks == null)
{
_tasks = new ConcurrentHashMap<>();
}
}
}
_tasks.put(effect, effectTaskInfo);
}
/**
* Gets the task for the given effect.
* @param effect the effect
* @return the task
*/
private EffectTaskInfo getEffectTask(AbstractEffect effect)
{
return (_tasks == null) ? null : _tasks.get(effect);
}
/**
* Gets the skill that created this buff info.
* @return the skill
*/
public Skill getSkill()
{
return _skill;
}
/**
* Gets the calculated abnormal time.
* @return the abnormal time
*/
public int getAbnormalTime()
{
return _abnormalTime;
}
/**
* Sets the abnormal time.
* @param abnormalTime the abnormal time to set
*/
public void setAbnormalTime(int abnormalTime)
{
_abnormalTime = abnormalTime;
}
/**
* Gets the period start ticks.
* @return the period start
*/
public int getPeriodStartTicks()
{
return _periodStartTicks;
}
/**
* Get the remaining time in seconds for this buff info.
* @return the elapsed time
*/
public int getTime()
{
return _abnormalTime - ((GameTimeController.getInstance().getGameTicks() - _periodStartTicks) / GameTimeController.TICKS_PER_SECOND);
}
/**
* Verify if this buff info has been cancelled.
* @return {@code true} if this buff info has been cancelled, {@code false} otherwise
*/
public boolean isRemoved()
{
return _isRemoved;
}
/**
* Set the buff info to removed.
* @param val the value to set
*/
public void setRemoved(boolean val)
{
_isRemoved = val;
}
/**
* Verify if this buff info is in use.
* @return {@code true} if this buff info is in use, {@code false} otherwise
*/
public boolean isInUse()
{
return _isInUse;
}
/**
* Set the buff info to in use.
* @param val the value to set
*/
public void setInUse(boolean val)
{
_isInUse = val;
}
/**
* Gets the character that launched the buff.
* @return the effector
*/
public L2Character getEffector()
{
return _effector;
}
/**
* Gets the target of the skill.
* @return the effected
*/
public L2Character getEffected()
{
return _effected;
}
/**
* Stops all the effects for this buff info.<br>
* Removes effects stats.<br>
* <b>It will not remove the buff info from the effect list</b>.<br>
* Instead call {@link CharEffectList#stopSkillEffects(boolean, Skill)}
* @param removed if {@code true} the skill will be handled as removed
*/
public void stopAllEffects(boolean removed)
{
setRemoved(removed);
// Cancels the task that will end this buff info
if ((_scheduledFutureTimeTask != null) && !_scheduledFutureTimeTask.isCancelled())
{
_scheduledFutureTimeTask.cancel(true);
}
finishEffects();
}
public void initializeEffects()
{
if ((_effected == null) || (_skill == null))
{
return;
}
// When effects are initialized, the successfully landed.
if (_effected.isPlayer() && !_skill.isPassive())
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_S_EFFECT_CAN_BE_FELT);
sm.addSkillName(_skill);
_effected.sendPacket(sm);
}
// Creates a task that will stop all the effects.
if (_abnormalTime > 0)
{
_scheduledFutureTimeTask = ThreadPoolManager.getInstance().scheduleEffectAtFixedRate(new BuffTimeTask(this), 0, 1000L);
}
// Reset abnormal visual effects.
resetAbnormalVisualEffects();
for (AbstractEffect effect : _effects)
{
if (effect.isInstant() || (_effected.isDead() && !_skill.isPassive()))
{
continue;
}
// Call on start.
effect.onStart(this);
// If it's a continuous effect, if has ticks schedule a task with period, otherwise schedule a simple task to end it.
if (effect.getTicks() > 0)
{
// The task for the effect ticks.
final EffectTickTask effectTask = new EffectTickTask(this, effect);
final ScheduledFuture<?> scheduledFuture = ThreadPoolManager.getInstance().scheduleEffectAtFixedRate(effectTask, effect.getTicks() * Config.EFFECT_TICK_RATIO, effect.getTicks() * Config.EFFECT_TICK_RATIO);
// Adds the task for ticking.
addTask(effect, new EffectTaskInfo(effectTask, scheduledFuture));
}
// Add stats.
_effected.addStatFuncs(effect.getStatFuncs(_effector, _effected, _skill));
}
}
/**
* Called on each tick.<br>
* Verify if the effect should end and the effect task should be cancelled.
* @param effect the effect that is ticking
* @param tickCount the tick count
*/
public void onTick(AbstractEffect effect, int tickCount)
{
boolean continueForever = false;
// If the effect is in use, allow it to affect the effected.
if (_isInUse)
{
// Callback for on action time event.
continueForever = effect.onActionTime(this);
}
if (!continueForever && _skill.isToggle())
{
final EffectTaskInfo task = getEffectTask(effect);
if (task != null)
{
task.getScheduledFuture().cancel(true); // Don't allow to finish current run.
_effected.getEffectList().stopSkillEffects(true, getSkill()); // Remove the buff from the effect list.
}
}
}
public void finishEffects()
{
// Cancels the ticking task.
if (_tasks != null)
{
for (EffectTaskInfo effectTask : _tasks.values())
{
effectTask.getScheduledFuture().cancel(true); // Don't allow to finish current run.
}
}
// Remove stats
removeStats();
// Notify on exit.
for (AbstractEffect effect : _effects)
{
// Instant effects shouldn't call onExit(..).
if ((effect != null) && !effect.isInstant())
{
effect.onExit(this);
}
}
// Remove abnormal visual effects.
resetAbnormalVisualEffects();
// Set the proper system message.
if (!(_effected.isSummon() && !((L2Summon) _effected).getOwner().hasSummon()))
{
SystemMessageId smId = null;
if (_skill.isToggle())
{
smId = SystemMessageId.S1_HAS_BEEN_ABORTED;
}
else if (isRemoved())
{
smId = SystemMessageId.THE_EFFECT_OF_S1_HAS_BEEN_REMOVED;
}
else if (!_skill.isPassive())
{
smId = SystemMessageId.S1_HAS_WORN_OFF;
}
if (smId != null)
{
final SystemMessage sm = SystemMessage.getSystemMessage(smId);
sm.addSkillName(_skill);
_effected.sendPacket(sm);
}
}
// Remove short buff.
if (this == _effected.getEffectList().getShortBuff())
{
_effected.getEffectList().shortBuffStatusUpdate(null);
}
}
/**
* Applies all the abnormal visual effects to the effected.<br>
* Prevents multiple updates.
*/
private void resetAbnormalVisualEffects()
{
if (_skill.hasAbnormalVisualEffects())
{
_effected.resetCurrentAbnormalVisualEffects();
}
}
/**
* Adds the buff stats.
*/
public void addStats()
{
_effects.forEach(effect -> _effected.addStatFuncs(effect.getStatFuncs(_effector, _effected, _skill)));
}
/**
* Removes the buff stats.
*/
public void removeStats()
{
_effects.forEach(_effected::removeStatsOwner);
_effected.removeStatsOwner(_skill);
}
/**
* Gets the effect tick count.
* @param effect the effect
* @return the current tick count
*/
public int getTickCount(AbstractEffect effect)
{
if (_tasks != null)
{
final EffectTaskInfo effectTaskInfo = _tasks.get(effect);
if (effectTaskInfo != null)
{
return effectTaskInfo.getEffectTask().getTickCount();
}
}
return 0;
}
@Override
public String toString()
{
return "BuffInfo [effector=" + _effector + ", effected=" + _effected + ", skill=" + _skill + ", effects=" + _effects + ", tasks=" + _tasks + ", scheduledFutureTimeTask=" + _scheduledFutureTimeTask + ", abnormalTime=" + _abnormalTime + ", periodStartTicks=" + _periodStartTicks + ", isRemoved=" + _isRemoved + ", isInUse=" + _isInUse + "]";
}
}

View File

@ -0,0 +1,56 @@
/*
* 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;
import java.util.concurrent.atomic.AtomicInteger;
/**
* Effect time task finish the effect when the abnormal time is reached.
* @author Zoey76
*/
public class BuffTimeTask implements Runnable
{
private final AtomicInteger _time = new AtomicInteger();
private final BuffInfo _info;
/**
* EffectTimeTask constructor.
* @param info the buff info
*/
public BuffTimeTask(BuffInfo info)
{
_info = info;
}
/**
* Gets the elapsed time.
* @return the tick count
*/
public int getElapsedTime()
{
return _time.get();
}
@Override
public void run()
{
if (_time.incrementAndGet() > _info.getAbnormalTime())
{
_info.getEffected().getEffectList().stopSkillEffects(false, _info.getSkill().getId());
}
}
}

View File

@ -0,0 +1,80 @@
/*
* 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;
import com.l2jmobius.gameserver.model.holders.SkillHolder;
/**
* An Enum to hold some important references to commonly used skills
* @author DrHouse
*/
public enum CommonSkill
{
RAID_CURSE(4215, 1),
RAID_CURSE2(4515, 1),
SEAL_OF_RULER(246, 1),
BUILD_HEADQUARTERS(247, 1),
WYVERN_BREATH(4289, 1),
STRIDER_SIEGE_ASSAULT(325, 1),
FIREWORK(5965, 1),
LARGE_FIREWORK(2025, 1),
BLESSING_OF_PROTECTION(5182, 1),
VOID_BURST(3630, 1),
VOID_FLOW(3631, 1),
THE_VICTOR_OF_WAR(5074, 1),
THE_VANQUISHED_OF_WAR(5075, 1),
SPECIAL_TREE_RECOVERY_BONUS(2139, 1),
WEAPON_GRADE_PENALTY(6209, 1),
ARMOR_GRADE_PENALTY(6213, 1),
CREATE_DWARVEN(172, 1),
LUCKY(194, 1),
EXPERTISE(239, 1),
CRYSTALLIZE(248, 1),
ONYX_BEAST_TRANSFORMATION(617, 1),
CREATE_COMMON(1320, 1),
DIVINE_INSPIRATION(1405, 1),
SERVITOR_SHARE(1557, 1),
CARAVANS_SECRET_MEDICINE(2341, 1),
SHILENS_BREATH(14571, 1),
IMPRIT_OF_LIGHT(19034, 1),
IMPRIT_OF_DARKNESS(19035, 1),
ABILITY_OF_LIGHT(19032, 1),
ABILITY_OF_DARKNESS(19033, 1),
HAIR_ACCESSORY_SET(17192, 1);
private final SkillHolder _holder;
private CommonSkill(int id, int level)
{
_holder = new SkillHolder(id, level);
}
public int getId()
{
return _holder.getSkillId();
}
public int getLevel()
{
return _holder.getSkillLvl();
}
public Skill getSkill()
{
return _holder.getSkill();
}
}

View File

@ -0,0 +1,32 @@
/*
* 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;
/**
* @author NosBit
*/
public enum EffectScope
{
GENERAL,
START,
SELF,
PASSIVE,
CHANNELING,
PVP,
PVE,
END
}

View File

@ -0,0 +1,33 @@
/*
* 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,
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,75 @@
/*
* 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;
import java.util.Collections;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.l2jmobius.gameserver.model.actor.L2Character;
/**
* @author UnAfraid
*/
public final class SkillChannelized
{
private final Map<Integer, Map<Integer, L2Character>> _channelizers = new ConcurrentHashMap<>();
public void addChannelizer(int skillId, L2Character channelizer)
{
_channelizers.computeIfAbsent(skillId, k -> new ConcurrentHashMap<>()).put(channelizer.getObjectId(), channelizer);
}
public void removeChannelizer(int skillId, L2Character channelizer)
{
getChannelizers(skillId).remove(channelizer.getObjectId());
}
public int getChannerlizersSize(int skillId)
{
return getChannelizers(skillId).size();
}
public Map<Integer, L2Character> getChannelizers(int skillId)
{
return _channelizers.getOrDefault(skillId, Collections.emptyMap());
}
public void abortChannelization()
{
for (Map<Integer, L2Character> map : _channelizers.values())
{
for (L2Character channelizer : map.values())
{
channelizer.abortCast();
}
}
_channelizers.clear();
}
public boolean isChannelized()
{
for (Map<Integer, L2Character> map : _channelizers.values())
{
if (!map.isEmpty())
{
return true;
}
}
return false;
}
}

View File

@ -0,0 +1,235 @@
/*
* 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;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
import com.l2jmobius.gameserver.GeoData;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.datatables.SkillData;
import com.l2jmobius.gameserver.enums.ShotType;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.MagicSkillLaunched;
import com.l2jmobius.gameserver.util.Util;
/**
* Skill Channelizer implementation.
* @author UnAfraid
*/
public class SkillChannelizer implements Runnable
{
private static final Logger _log = Logger.getLogger(SkillChannelizer.class.getName());
private final L2Character _channelizer;
private List<L2Character> _channelized;
private Skill _skill;
private volatile ScheduledFuture<?> _task = null;
public SkillChannelizer(L2Character channelizer)
{
_channelizer = channelizer;
}
public L2Character getChannelizer()
{
return _channelizer;
}
public List<L2Character> getChannelized()
{
return _channelized;
}
public boolean hasChannelized()
{
return _channelized != null;
}
public void startChanneling(Skill skill)
{
// Verify for same status.
if (isChanneling())
{
_log.warning("Character: " + _channelizer + " is attempting to channel skill but he already does!");
return;
}
// Start channeling.
_skill = skill;
_task = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(this, skill.getChannelingTickInitialDelay(), skill.getChannelingTickInterval());
}
public void stopChanneling()
{
// Verify for same status.
if (!isChanneling())
{
_log.warning("Character: " + _channelizer + " is attempting to stop channel skill but he does not!");
return;
}
// Cancel the task and unset it.
_task.cancel(true);
_task = null;
// Cancel target channelization and unset it.
if (_channelized != null)
{
for (L2Character chars : _channelized)
{
chars.getSkillChannelized().removeChannelizer(_skill.getChannelingSkillId(), getChannelizer());
}
_channelized = null;
}
// unset skill.
_skill = null;
}
public Skill getSkill()
{
return _skill;
}
public boolean isChanneling()
{
return _task != null;
}
@Override
public void run()
{
if (!isChanneling())
{
return;
}
if (_skill == null)
{
return;
}
try
{
if (_skill.getMpPerChanneling() > 0)
{
// Validate mana per tick.
if (_channelizer.getCurrentMp() < _skill.getMpPerChanneling())
{
if (_channelizer.isPlayer())
{
_channelizer.sendPacket(SystemMessageId.YOUR_SKILL_WAS_DEACTIVATED_DUE_TO_LACK_OF_MP);
}
_channelizer.abortCast();
return;
}
// Reduce mana per tick
_channelizer.reduceCurrentMp(_skill.getMpPerChanneling());
}
// Apply channeling skills on the targets.
if (_skill.getChannelingSkillId() > 0)
{
final Skill baseSkill = SkillData.getInstance().getSkill(_skill.getChannelingSkillId(), 1);
if (baseSkill == null)
{
_log.warning(getClass().getSimpleName() + ": skill " + _skill + " couldn't find effect id skill: " + _skill.getChannelingSkillId() + " !");
_channelizer.abortCast();
return;
}
final List<L2Character> targetList = new ArrayList<>();
for (L2Object chars : _skill.getTargetList(_channelizer))
{
if (chars.isCharacter())
{
targetList.add((L2Character) chars);
((L2Character) chars).getSkillChannelized().addChannelizer(_skill.getChannelingSkillId(), getChannelizer());
}
}
if (targetList.isEmpty())
{
return;
}
_channelized = targetList;
for (L2Character character : _channelized)
{
if (!Util.checkIfInRange(_skill.getEffectRange(), _channelizer, character, true))
{
continue;
}
else if (!GeoData.getInstance().canSeeTarget(_channelizer, character))
{
continue;
}
else
{
final int maxSkillLevel = SkillData.getInstance().getMaxLevel(_skill.getChannelingSkillId());
final int skillLevel = Math.min(character.getSkillChannelized().getChannerlizersSize(_skill.getChannelingSkillId()), maxSkillLevel);
final BuffInfo info = character.getEffectList().getBuffInfoBySkillId(_skill.getChannelingSkillId());
if ((info == null) || (info.getSkill().getLevel() < skillLevel))
{
final Skill skill = SkillData.getInstance().getSkill(_skill.getChannelingSkillId(), skillLevel);
if (skill == null)
{
_log.warning(getClass().getSimpleName() + ": Non existent channeling skill requested: " + _skill);
_channelizer.abortCast();
return;
}
// Update PvP status
if (character.isPlayable() && getChannelizer().isPlayer() && skill.isBad())
{
((L2PcInstance) getChannelizer()).updatePvPStatus(character);
}
skill.applyEffects(getChannelizer(), character);
// Reduce shots.
if (_skill.useSpiritShot())
{
_channelizer.setChargedShot(_channelizer.isChargedShot(ShotType.BLESSED_SPIRITSHOTS) ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS, false);
}
else
{
_channelizer.setChargedShot(ShotType.SOULSHOTS, false);
}
// Shots are re-charged every cast.
_channelizer.rechargeShots(_skill.useSoulShot(), _skill.useSpiritShot());
}
_channelizer.broadcastPacket(new MagicSkillLaunched(_channelizer, _skill.getId(), _skill.getLevel(), character));
}
}
}
}
catch (Exception e)
{
_log.warning("Error while channelizing skill: " + _skill + " channelizer: " + _channelizer + " channelized: " + _channelized + "; " + e.getMessage());
}
}
}

View File

@ -0,0 +1,180 @@
/*
* 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;
/**
* This enum class holds the skill operative types:
* <ul>
* <li>ACTIVE_INSTANT</li>
* <li>ACTIVE_CONTINUOUS</li>
* <li>ACTIVE_WITH_TRIGGER</li>
* <li>SPECIAL_HERB</li>
* <li>CHANNELING_INSTANT</li>
* <li>CHANNELING_CONTINUOUS</li>
* <li>DIRECTIONAL_INSTANT</li>
* <li>DIRECTIONAL_CONTINUOUS</li>
* <li>PASSIVE</li>
* <li>TOGGLE</li>
* </ul>
* @author Zoey76
*/
public enum SkillOperateType
{
/**
* Active Skill with "Instant Effect" (for example damage skills heal/pdam/mdam/cpdam skills).
*/
ACTIVE_INSTANT,
/**
* Active Skill with "Continuous effect + Instant effect" (for example buff/debuff or damage/heal over time skills).
*/
ACTIVE_CONTINUOUS,
/**
* Active Skill with "Instant effect + Continuous effect"
*/
ACTIVE_WITH_TRIGGER,
/**
* Active Skill with "Instant effect + ?" used for special event herb (itemId 20903, skillId 22158).
*/
SPECIAL_HERB,
/**
* Continuous Active Skill with "instant effect" (instant effect casted by ticks).
*/
CHANNELING_INSTANT,
/**
* Continuous Active Skill with "continuous effect" (continuous effect casted by ticks).
*/
CHANNELING_CONTINUOUS,
/**
* Directional Active Skill with "Charge/Rush instant effect".
*/
DIRECTIONAL_INSTANT,
/**
* Directional Active Skill with "Charge/Rush Continuous effect".
*/
DIRECTIONAL_CONTINUOUS,
/**
* Passive Skill.
*/
PASSIVE,
/**
* Toggle Skill.
*/
TOGGLE;
/**
* Verifies if the operative type correspond to an active skill.
* @return {@code true} if the operative skill type is active, {@code false} otherwise
*/
public boolean isActive()
{
switch (this)
{
case ACTIVE_INSTANT:
case ACTIVE_CONTINUOUS:
case ACTIVE_WITH_TRIGGER:
case CHANNELING_INSTANT:
case CHANNELING_CONTINUOUS:
case DIRECTIONAL_INSTANT:
case DIRECTIONAL_CONTINUOUS:
case SPECIAL_HERB:
{
return true;
}
default:
{
return false;
}
}
}
/**
* Verifies if the operative type correspond to a continuous skill.
* @return {@code true} if the operative skill type is continuous, {@code false} otherwise
*/
public boolean isContinuous()
{
switch (this)
{
case ACTIVE_CONTINUOUS:
case DIRECTIONAL_CONTINUOUS:
case SPECIAL_HERB:
{
return true;
}
default:
{
return false;
}
}
}
/**
* Verifies if the operative type correspond to a continuous skill.
* @return {@code true} if the operative skill type is continuous, {@code false} otherwise
*/
public boolean isSelfContinuous()
{
return (this == ACTIVE_WITH_TRIGGER);
}
/**
* Verifies if the operative type correspond to a passive skill.
* @return {@code true} if the operative skill type is passive, {@code false} otherwise
*/
public boolean isPassive()
{
return (this == PASSIVE);
}
/**
* Verifies if the operative type correspond to a toggle skill.
* @return {@code true} if the operative skill type is toggle, {@code false} otherwise
*/
public boolean isToggle()
{
return (this == TOGGLE);
}
/**
* Verifies if the operative type correspond to a channeling skill.
* @return {@code true} if the operative skill type is channeling, {@code false} otherwise
*/
public boolean isChanneling()
{
switch (this)
{
case CHANNELING_INSTANT:
case CHANNELING_CONTINUOUS:
{
return true;
}
default:
{
return false;
}
}
}
}

View File

@ -0,0 +1,35 @@
/*
* 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.targets;
/**
* Affect object enumerated.
* @author Zoey76
*/
public enum AffectObject
{
ALL,
CLAN,
FRIEND,
HIDDEN_PLACE,
INVISIBLE,
NOE,
NOT_FRIEND,
OBJECT_DEAD_NPC_BODY,
UNDEAD_REAL_ENEMY,
WYVERN_OBJECT
}

View File

@ -0,0 +1,55 @@
/*
* 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.targets;
/**
* Affect scope enumerated.
* @author Zoey76
*/
public enum AffectScope
{
/** Affects Valakas. */
BALAKAS_SCOPE,
/** Affects dead clan mates. */
DEAD_PLEDGE,
/** Affects fan area. */
FAN,
/** Affects nothing. */
NONE,
/** Affects party members. */
PARTY,
/** Affects party and clan mates. */
PARTY_PLEDGE,
/** Affects clan mates. */
PLEDGE,
/** Affects point blank targets, using caster as point of origin. */
POINT_BLANK,
/** Affects ranged targets, using selected target as point of origin. */
RANGE,
/** Affects ranged targets, using selected target as point of origin. */
RING_RANGE,
/** Affects a single target. */
SINGLE,
/** Affects targets inside an square area, using selected target as point of origin. */
SQUARE,
/** Affects targets inside an square area, using caster as point of origin. */
SQUARE_PB,
/** Affects static object targets. */
STATIC_OBJECT_SCOPE,
/** Affects wyverns. */
WYVERN_SCOPE
}

View File

@ -0,0 +1,63 @@
/*
* 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.targets;
/**
* @author Zoey76
*/
public enum L2TargetType
{
AREA,
AREA_CORPSE_MOB,
AREA_FRIENDLY,
AREA_SUMMON,
AREA_UNDEAD,
AURA,
AURA_CORPSE_MOB,
AURA_FRIENDLY,
BEHIND_AREA,
BEHIND_AURA,
CLAN,
CLAN_MEMBER,
COMMAND_CHANNEL,
CORPSE,
CORPSE_CLAN,
CORPSE_MOB,
ENEMY_SUMMON,
FLAGPOLE,
FRONT_AREA,
FRONT_AURA,
GROUND,
HOLY,
NONE,
ONE,
ONE_FRIENDLY,
OWNER_PET,
PARTY,
PARTY_CLAN,
PARTY_MEMBER,
PARTY_NOTME,
PARTY_OTHER,
PC_BODY,
PET,
SELF,
SERVITOR,
SUMMON,
TARGET_PARTY,
UNDEAD,
UNLOCKABLE
}

View File

@ -0,0 +1,61 @@
/*
* 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.targets;
/**
* Target type enumerated.
* @author Zoey76
*/
public enum TargetType
{
/** Advance Head Quarters (Outposts). */
ADVANCE_BASE,
/** Enemies in high terrain or protected by castle walls and doors. */
ARTILLERY,
/** Doors or treasure chests. */
DOOR_TREASURE,
/** Any enemies (included allies). */
ENEMY,
/** Friendly. */
ENEMY_NOT,
/** Only enemies (not included allies). */
ENEMY_ONLY,
/** Fortress's Flagpole. */
FORTRESS_FLAGPOLE,
/** Ground. */
GROUND,
/** Holy Artifacts from sieges. */
HOLYTHING,
/** Items. */
ITEM,
/** Nothing. */
NONE,
/** NPC corpses. */
NPC_BODY,
/** Others, except caster. */
OTHERS,
/** Player corpses. */
PC_BODY,
/** Self. */
SELF,
/** Servitor, not pet. */
SUMMON,
/** Anything targetable. */
TARGET,
/** Wyverns. */
WYVERN_TARGET;
}