This commit is contained in:
mobius
2015-01-01 20:02:50 +00:00
parent eeae660458
commit a6a3718849
17894 changed files with 2818932 additions and 0 deletions

View File

@ -0,0 +1,385 @@
/*
* Copyright (C) 2004-2014 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.gameserver.model.skills;
/**
* 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,
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_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,
DMG_SHIELD,
DOT_ATTR,
DOT_MP,
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,
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_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_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;
/**
* 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,128 @@
/*
* Copyright (C) 2004-2014 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.gameserver.model.skills;
/**
* Abnormal Visual Effect enumerated.
* @author DrHouse, Zoey76
*/
public enum AbnormalVisualEffect
{
NONE(0x0000000, 0),
DOT_BLEEDING(0x00000001, 0),
DOT_POISON(0x00000002, 0),
DOT_FIRE(0x00000004, 0),
DOT_WATER(0x00000008, 0),
DOT_WIND(0x00000010, 0),
DOT_SOIL(0x00000020, 0),
STUN(0x00000040, 0),
SLEEP(0x00000080, 0),
SILENCE(0x00000100, 0),
ROOT(0x00000200, 0),
PARALYZE(0x00000400, 0),
FLESH_STONE(0x00000800, 0),
DOT_MP(0x00001000, 0),
BIG_HEAD(0x00002000, 0),
DOT_FIRE_AREA(0x00004000, 0),
CHANGE_TEXTURE(0x00008000, 0),
BIG_BODY(0x00010000, 0),
FLOATING_ROOT(0x00020000, 0),
DANCE_ROOT(0x00040000, 0),
GHOST_STUN(0x00080000, 0),
STEALTH(0x00100000, 0),
SEIZURE1(0x00200000, 0),
SEIZURE2(0x00400000, 0),
MAGIC_SQUARE(0x00800000, 0),
FREEZING(0x01000000, 0),
SHAKE(0x02000000, 0),
BLIND(0x04000000, 0),
ULTIMATE_DEFENCE(0x08000000, 0),
VP_UP(0x10000000, 0),
REAL_TARGET(0x20000000, 0),
DEATH_MARK(0x40000000, 0),
TURN_FLEE(0x80000000, 0),
VP_KEEP(0x10000000, 0), // TODO: Find.
// Special
INVINCIBILITY(0x000001, 1),
AIR_BATTLE_SLOW(0x000002, 1),
AIR_BATTLE_ROOT(0x000004, 1),
CHANGE_WP(0x000008, 1),
CHANGE_HAIR_G(0x000010, 1),
CHANGE_HAIR_P(0x000020, 1),
CHANGE_HAIR_B(0x000040, 1),
STIGMA_OF_SILEN(0x000100, 1),
SPEED_DOWN(0x000200, 1),
FROZEN_PILLAR(0x000400, 1),
CHANGE_VES_S(0x000800, 1),
CHANGE_VES_C(0x001000, 1),
CHANGE_VES_D(0x002000, 1),
TIME_BOMB(0x004000, 1), // High Five
MP_SHIELD(0x008000, 1), // High Five
NAVIT_ADVENT(0x080000, 1), // High Five
// Event
// TODO: Fix, currently not working.
BR_NONE(0x000000, 2),
BR_AFRO_NORMAL(0x000001, 2),
BR_AFRO_PINK(0x000002, 2),
BR_AFRO_GOLD(0x000004, 2),
BR_POWER_OF_EVA(0x000008, 2), // High Five
BR_HEADPHONE(0x000010, 2), // High Five
BR_VESPER1(0x000020, 2),
BR_VESPER2(0x000040, 2),
BR_VESPER3(0x000080, 2),
BR_SOUL_AVATAR(0x000100, 2); // High Five
/** Int mask. */
private final int _mask;
/** Type: 0 Normal, 1 Special, 2 Event. */
private final int _type;
private AbnormalVisualEffect(int mask, int type)
{
_mask = mask;
_type = type;
}
/**
* Gets the int bitmask for the abnormal visual effect.
* @return the int bitmask
*/
public final int getMask()
{
return _mask;
}
/**
* Verify if it's a special abnormal visual effect.
* @return {@code true} it's a special abnormal visual effect, {@code false} otherwise
*/
public final boolean isSpecial()
{
return _type == 1;
}
/**
* Verify if it's an event abnormal visual effect.
* @return {@code true} it's an event abnormal visual effect, {@code false} otherwise
*/
public final boolean isEvent()
{
return _type == 2;
}
}

View File

@ -0,0 +1,475 @@
/*
* Copyright (C) 2004-2014 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.gameserver.model.skills;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import com.l2jserver.Config;
import com.l2jserver.gameserver.GameTimeController;
import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.gameserver.model.CharEffectList;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.L2Summon;
import com.l2jserver.gameserver.model.effects.AbstractEffect;
import com.l2jserver.gameserver.model.effects.EffectTaskInfo;
import com.l2jserver.gameserver.model.effects.EffectTickTask;
import com.l2jserver.gameserver.model.stats.Formulas;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.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);
}
boolean update = false;
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));
update = true;
}
if (update)
{
// Add abnormal visual effects.
addAbnormalVisualEffects();
}
}
/**
* 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().remove(true, this); // 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.
removeAbnormalVisualEffects();
// 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 addAbnormalVisualEffects()
{
if (_skill.hasAbnormalVisualEffects())
{
_effected.startAbnormalVisualEffect(false, _skill.getAbnormalVisualEffects());
}
if (_effected.isPlayer() && _skill.hasAbnormalVisualEffectsEvent())
{
_effected.startAbnormalVisualEffect(false, _skill.getAbnormalVisualEffectsEvent());
}
if (_skill.hasAbnormalVisualEffectsSpecial())
{
_effected.startAbnormalVisualEffect(false, _skill.getAbnormalVisualEffectsSpecial());
}
// Update abnormal visual effects.
_effected.updateAbnormalEffect();
}
/**
* Removes all the abnormal visual effects from the effected.<br>
* Prevents multiple updates.
*/
private void removeAbnormalVisualEffects()
{
if ((_effected == null) || (_skill == null))
{
return;
}
if (_skill.hasAbnormalVisualEffects())
{
_effected.stopAbnormalVisualEffect(false, _skill.getAbnormalVisualEffects());
}
if (_effected.isPlayer() && _skill.hasAbnormalVisualEffectsEvent())
{
_effected.stopAbnormalVisualEffect(false, _skill.getAbnormalVisualEffectsEvent());
}
if (_skill.hasAbnormalVisualEffectsSpecial())
{
_effected.stopAbnormalVisualEffect(false, _skill.getAbnormalVisualEffectsSpecial());
}
_effected.updateAbnormalEffect();
}
/**
* 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;
}
}

View File

@ -0,0 +1,58 @@
/*
* Copyright (C) 2004-2014 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.gameserver.model.skills;
import java.util.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,77 @@
/*
* Copyright (C) 2004-2014 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.gameserver.model.skills;
import com.l2jserver.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);
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,34 @@
/*
* Copyright (C) 2004-2014 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.gameserver.model.skills;
/**
* @author NosBit
*/
public enum EffectScope
{
GENERAL,
START,
SELF,
PASSIVE,
CHANNELING,
PVP,
PVE,
END
}

View File

@ -0,0 +1,35 @@
/*
* Copyright (C) 2004-2014 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.gameserver.model.skills;
/**
* 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,87 @@
/*
* Copyright (C) 2004-2014 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.gameserver.model.skills;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.l2jserver.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)
{
if (!_channelizers.containsKey(skillId))
{
_channelizers.put(skillId, new ConcurrentHashMap<Integer, L2Character>());
}
_channelizers.get(skillId).put(channelizer.getObjectId(), channelizer);
}
public void removeChannelizer(int skillId, L2Character channelizer)
{
if (_channelizers.containsKey(skillId))
{
_channelizers.get(skillId).remove(channelizer.getObjectId());
}
}
public int getChannerlizersSize(int skillId)
{
if (_channelizers.containsKey(skillId))
{
return _channelizers.get(skillId).size();
}
return 0;
}
public Map<Integer, L2Character> getChannelizers(int skillId)
{
return _channelizers.get(skillId);
}
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 @@
/*
* Copyright (C) 2004-2014 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.gameserver.model.skills;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ScheduledFuture;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jserver.gameserver.GeoData;
import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.gameserver.datatables.SkillData;
import com.l2jserver.gameserver.enums.ShotType;
import com.l2jserver.gameserver.model.L2Object;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.MagicSkillLaunched;
import com.l2jserver.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.log(Level.WARNING, "Character: " + toString() + " 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.log(Level.WARNING, "Character: " + toString() + " is attempting to stop channel skill but he does not!");
return;
}
// Cancel the task and unset it.
_task.cancel(false);
_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;
}
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.log(Level.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.log(Level.WARNING, getClass().getSimpleName() + ": Non existent channeling skill requested: " + _skill);
_channelizer.abortCast();
return;
}
// Update PvP status
if (character.isPlayable() && getChannelizer().isPlayer())
{
((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.log(Level.WARNING, "Error while channelizing skill: " + _skill + " channelizer: " + _channelizer + " channelized: " + _channelized, e);
}
}
}

View File

@ -0,0 +1,170 @@
/*
* Copyright (C) 2004-2014 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.gameserver.model.skills;
/**
* This enum class holds the skill operative types:
* <ul>
* <li>A1</li>
* <li>A2</li>
* <li>A3</li>
* <li>A4</li>
* <li>CA1</li>
* <li>CA5</li>
* <li>DA1</li>
* <li>DA2</li>
* <li>P</li>
* <li>T</li>
* </ul>
* @author Zoey76
*/
public enum SkillOperateType
{
/**
* Active Skill with "Instant Effect" (for example damage skills heal/pdam/mdam/cpdam skills).
*/
A1,
/**
* Active Skill with "Continuous effect + Instant effect" (for example buff/debuff or damage/heal over time skills).
*/
A2,
/**
* Active Skill with "Instant effect + Continuous effect"
*/
A3,
/**
* Active Skill with "Instant effect + ?" used for special event herb.
*/
A4,
/**
* Continuous Active Skill with "instant effect" (instant effect casted by ticks).
*/
CA1,
/**
* Continuous Active Skill with "continuous effect" (continuous effect casted by ticks).
*/
CA5,
/**
* Directional Active Skill with "Charge/Rush instant effect".
*/
DA1,
/**
* Directional Active Skill with "Charge/Rush Continuous effect".
*/
DA2,
/**
* Passive Skill.
*/
P,
/**
* Toggle Skill.
*/
T;
/**
* 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 A1:
case A2:
case A3:
case A4:
case CA1:
case CA5:
case DA1:
case DA2:
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 A2:
case A4:
case DA2:
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 == A3);
}
/**
* 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 == P);
}
/**
* 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 == T);
}
/**
* 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 CA1:
case CA5:
return true;
default:
return false;
}
}
}

View File

@ -0,0 +1,37 @@
/*
* Copyright (C) 2004-2014 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.gameserver.model.skills.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,57 @@
/*
* Copyright (C) 2004-2014 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.gameserver.model.skills.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 @@
/*
* Copyright (C) 2004-2014 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.gameserver.model.skills.targets;
/**
* @author Zoey76
*/
public enum L2TargetType
{
AREA,
AREA_CORPSE_MOB,
AREA_FRIENDLY,
AREA_SUMMON,
AREA_UNDEAD,
AURA,
AURA_CORPSE_MOB,
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,
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,63 @@
/*
* Copyright (C) 2004-2014 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.gameserver.model.skills.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;
}