Sync with L2JServer Jan 12th 2015.

This commit is contained in:
mobius
2015-01-13 09:50:20 +00:00
parent a868d961a3
commit 0a44ad683c
1158 changed files with 59729 additions and 58627 deletions

View File

@ -20,109 +20,172 @@ package com.l2jserver.gameserver.model.skills;
/**
* Abnormal Visual Effect enumerated.
* @author DrHouse, Zoey76
* @author NosBit
*/
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
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_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);
/** Int mask. */
private final int _mask;
/** Type: 0 Normal, 1 Special, 2 Event. */
private final int _type;
private final int _clientId;
private AbnormalVisualEffect(int mask, int type)
private AbnormalVisualEffect(int clientId)
{
_mask = mask;
_type = type;
_clientId = clientId;
}
/**
* Gets the int bitmask for the abnormal visual effect.
* @return the int bitmask
* Gets the client id.
* @return the client id
*/
public final int getMask()
public int getClientId()
{
return _mask;
return _clientId;
}
/**
* Verify if it's a special abnormal visual effect.
* @return {@code true} it's a special abnormal visual effect, {@code false} otherwise
* Finds abnormal visual effect by name.
* @param name the name
* @return The abnormal visual effect if its found, {@code null} otherwise
*/
public final boolean isSpecial()
public static final AbnormalVisualEffect findByName(String name)
{
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;
for (AbnormalVisualEffect abnormalVisualEffect : values())
{
if (abnormalVisualEffect.name().equalsIgnoreCase(name))
{
return abnormalVisualEffect;
}
}
return null;
}
}

View File

@ -269,7 +269,9 @@ public final class BuffInfo
_scheduledFutureTimeTask = ThreadPoolManager.getInstance().scheduleEffectAtFixedRate(new BuffTimeTask(this), 0, 1000L);
}
boolean update = false;
// Reset abnormal visual effects.
resetAbnormalVisualEffects();
for (AbstractEffect effect : _effects)
{
if (effect.isInstant() || (_effected.isDead() && !_skill.isPassive()))
@ -292,14 +294,6 @@ public final class BuffInfo
// Add stats.
_effected.addStatFuncs(effect.getStatFuncs(_effector, _effected, _skill));
update = true;
}
if (update)
{
// Add abnormal visual effects.
addAbnormalVisualEffects();
}
}
@ -352,7 +346,7 @@ public final class BuffInfo
}
}
// Remove abnormal visual effects.
removeAbnormalVisualEffects();
resetAbnormalVisualEffects();
// Set the proper system message.
if (!(_effected.isSummon() && !((L2Summon) _effected).getOwner().hasSummon()))
{
@ -388,54 +382,12 @@ public final class BuffInfo
* Applies all the abnormal visual effects to the effected.<br>
* Prevents multiple updates.
*/
private void addAbnormalVisualEffects()
private void resetAbnormalVisualEffects()
{
if (_skill.hasAbnormalVisualEffects())
{
_effected.startAbnormalVisualEffect(false, _skill.getAbnormalVisualEffects());
_effected.resetCurrentAbnormalVisualEffects();
}
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();
}
/**

View File

@ -55,7 +55,8 @@ public enum CommonSkill
IMPRIT_OF_LIGHT(19034, 1),
IMPRIT_OF_DARKNESS(19035, 1),
ABILITY_OF_LIGHT(19032, 1),
ABILITY_OF_DARKNESS(19033, 1);
ABILITY_OF_DARKNESS(19033, 1),
HAIR_ACCESSORY_SET(17192, 1);
private final SkillHolder _holder;

View File

@ -115,11 +115,7 @@ public final class Skill implements IIdentifiable
/** Abnormal time: global effect duration time. */
private final int _abnormalTime;
/** Abnormal visual effect: the visual effect displayed ingame. */
private AbnormalVisualEffect[] _abnormalVisualEffects = null;
/** Abnormal visual effect special: the visual effect displayed ingame. */
private AbnormalVisualEffect[] _abnormalVisualEffectsSpecial = null;
/** Abnormal visual effect event: the visual effect displayed ingame. */
private AbnormalVisualEffect[] _abnormalVisualEffectsEvent = null;
private Set<AbnormalVisualEffect> _abnormalVisualEffects;
/** If {@code true} this skill's effect should stay after death. */
private final boolean _stayAfterDeath;
/** If {@code true} this skill's effect should stay after class-subclass change. */
@ -536,9 +532,9 @@ public final class Skill implements IIdentifiable
* Gets the skill abnormal visual effect.
* @return the abnormal visual effect
*/
public AbnormalVisualEffect[] getAbnormalVisualEffects()
public Set<AbnormalVisualEffect> getAbnormalVisualEffects()
{
return _abnormalVisualEffects;
return (_abnormalVisualEffects != null) ? _abnormalVisualEffects : Collections.emptySet();
}
/**
@ -547,43 +543,7 @@ public final class Skill implements IIdentifiable
*/
public boolean hasAbnormalVisualEffects()
{
return (_abnormalVisualEffects != null) && (_abnormalVisualEffects.length > 0);
}
/**
* Gets the skill special abnormal visual effect.
* @return the abnormal visual effect
*/
public AbnormalVisualEffect[] getAbnormalVisualEffectsSpecial()
{
return _abnormalVisualEffectsSpecial;
}
/**
* Verify if the skill has special abnormal visual effects.
* @return {@code true} if the skill has special abnormal visual effects, {@code false} otherwise
*/
public boolean hasAbnormalVisualEffectsSpecial()
{
return (_abnormalVisualEffectsSpecial != null) && (_abnormalVisualEffectsSpecial.length > 0);
}
/**
* Gets the skill event abnormal visual effect.
* @return the abnormal visual effect
*/
public AbnormalVisualEffect[] getAbnormalVisualEffectsEvent()
{
return _abnormalVisualEffectsEvent;
}
/**
* Verify if the skill has event abnormal visual effects.
* @return {@code true} if the skill has event abnormal visual effects, {@code false} otherwise
*/
public boolean hasAbnormalVisualEffectsEvent()
{
return (_abnormalVisualEffectsEvent != null) && (_abnormalVisualEffectsEvent.length > 0);
return (_abnormalVisualEffects != null) && !_abnormalVisualEffects.isEmpty();
}
/**
@ -1728,55 +1688,23 @@ public final class Skill implements IIdentifiable
if (abnormalVisualEffects != null)
{
final String[] data = abnormalVisualEffects.split(";");
List<AbnormalVisualEffect> avesEvent = null;
List<AbnormalVisualEffect> avesSpecial = null;
List<AbnormalVisualEffect> aves = null;
for (String ave2 : data)
final Set<AbnormalVisualEffect> aves = new HashSet<>(1);
for (String aveString : data)
{
final AbnormalVisualEffect ave = AbnormalVisualEffect.valueOf(ave2);
final AbnormalVisualEffect ave = AbnormalVisualEffect.findByName(aveString);
if (ave != null)
{
if (ave.isEvent())
{
if (avesEvent == null)
{
avesEvent = new ArrayList<>(1);
}
avesEvent.add(ave);
continue;
}
if (ave.isSpecial())
{
if (avesSpecial == null)
{
avesSpecial = new ArrayList<>(1);
}
avesSpecial.add(ave);
continue;
}
if (aves == null)
{
aves = new ArrayList<>(1);
}
aves.add(ave);
}
else
{
_log.warning("Invalid AbnormalVisualEffect(" + aveString + ") found for Skill(" + this + ")");
}
}
if (avesEvent != null)
if (!aves.isEmpty())
{
_abnormalVisualEffectsEvent = avesEvent.toArray(new AbnormalVisualEffect[avesEvent.size()]);
}
if (avesSpecial != null)
{
_abnormalVisualEffectsSpecial = avesSpecial.toArray(new AbnormalVisualEffect[avesSpecial.size()]);
}
if (aves != null)
{
_abnormalVisualEffects = aves.toArray(new AbnormalVisualEffect[aves.size()]);
_abnormalVisualEffects = aves;
}
}
}