Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectMute.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectMute.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectMute.java (working copy)
- @@ -35,8 +35,10 @@
- }
- @Override
- - public void onStart() {
- + public boolean onStart()
- + {
- getEffected().startMuted();
- + return true;
- }
- @Override
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectSignetEffect.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectSignetEffect.java (revision 0)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectSignetEffect.java (revision 0)
- @@ -0,0 +1,46 @@
- +/*
- + * 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 2, 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, write to the Free Software
- + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- + * 02111-1307, USA.
- + *
- + * http://www.gnu.org/copyleft/gpl.html
- + */
- +package net.sf.l2j.gameserver.skills.effects;
- +
- +import net.sf.l2j.gameserver.model.L2Effect;
- +import net.sf.l2j.gameserver.skills.Env;
- +
- +/**
- + * @author Forsaiken
- + */
- +
- +public class EffectSignetEffect extends L2Effect
- +{
- + public EffectSignetEffect(Env env, EffectTemplate template)
- + {
- + super(env, template);
- + }
- +
- + @Override
- + public EffectType getEffectType()
- + {
- + return EffectType.SIGNET_EFFECT;
- + }
- +
- + @Override
- + public boolean onActionTime()
- + {
- + return true;
- + }
- +}
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectProtectionBlessing.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectProtectionBlessing.java (revision 0)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectProtectionBlessing.java (revision 0)
- @@ -0,0 +1,67 @@
- +/* 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 2, 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, write to the Free Software
- + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- + * 02111-1307, USA.
- + *
- + * http://www.gnu.org/copyleft/gpl.html
- + */
- +package net.sf.l2j.gameserver.skills.effects;
- +
- +import net.sf.l2j.gameserver.model.L2Effect;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance;
- +import net.sf.l2j.gameserver.skills.Env;
- +
- +/**
- + * @author kerberos_20
- + *
- + */
- +public class EffectProtectionBlessing extends L2Effect
- +{
- + public EffectProtectionBlessing(Env env, EffectTemplate template)
- + {
- + super(env, template);
- + }
- +
- + @Override
- + public EffectType getEffectType()
- + {
- + return EffectType.PROTECTION_BLESSING;
- + }
- +
- + /** Notify started */
- + @Override
- + public boolean onStart()
- + {
- + if (getEffected() instanceof L2PlayableInstance)
- + {
- + ((L2PlayableInstance) getEffected()).startProtectionBlessing();
- + return true;
- + }
- + return false;
- + }
- +
- + /** Notify exited */
- + @Override
- + public void onExit()
- + {
- + if (getEffected() instanceof L2PlayableInstance)
- + ((L2PlayableInstance)getEffected()).stopProtectionBlessing (this);
- + }
- +
- + @Override
- + public boolean onActionTime()
- + {
- + // just stop this effect
- + return false;
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectFakeDeath.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectFakeDeath.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectFakeDeath.java (working copy)
- @@ -29,7 +29,8 @@
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
- -final class EffectFakeDeath extends L2Effect {
- +public class EffectFakeDeath extends L2Effect
- +{
- public EffectFakeDeath(Env env, EffectTemplate template)
- {
- @@ -44,19 +45,22 @@
- /** Notify started */
- @Override
- - public void onStart() {
- + public boolean onStart()
- + {
- getEffected().startFakeDeath();
- + return true;
- }
- /** Notify exited */
- @Override
- - public void onExit() {
- + public void onExit()
- + {
- getEffected().stopFakeDeath(this);
- }
- - @Override
- + @Override
- public boolean onActionTime()
- - {
- + {
- if(getEffected().isDead())
- return false;
- @@ -74,7 +78,7 @@
- getEffected().reduceCurrentMp(manaDam);
- return true;
- - }
- + }
- }
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectFear.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectFear.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectFear.java (working copy)
- @@ -34,7 +34,7 @@
- *
- * Implementation of the Fear Effect
- */
- -final class EffectFear extends L2Effect
- +public class EffectFear extends L2Effect
- {
- public static final int FEAR_RANGE = 500;
- @@ -51,14 +51,15 @@
- /** Notify started */
- @Override
- - public void onStart()
- + public boolean onStart()
- {
- - if (!getEffected().isAfraid())
- - {
- - getEffected().startFear();
- - onActionTime();
- + if (!getEffected().isAfraid())
- + {
- + getEffected().startFear();
- + onActionTime();
- + }
- + return true;
- }
- - }
- /** Notify exited */
- @Override
- @@ -96,4 +97,4 @@
- getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,new L2CharPosition(posX,posY,posZ,0));
- return true;
- }
- -}
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectBluff.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectBluff.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectBluff.java (working copy)
- @@ -24,6 +24,8 @@
- import net.sf.l2j.gameserver.model.actor.instance.L2FolkInstance;
- import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance;
- import net.sf.l2j.gameserver.model.actor.instance.L2SiegeSummonInstance;
- +import net.sf.l2j.gameserver.serverpackets.BeginRotation;
- +import net.sf.l2j.gameserver.serverpackets.StopRotation;
- import net.sf.l2j.gameserver.serverpackets.SystemMessage;
- import net.sf.l2j.gameserver.skills.Env;
- @@ -32,7 +34,8 @@
- *
- * Implementation of the Bluff Effect
- */
- -final class EffectBluff extends L2Effect {
- +public class EffectBluff extends L2Effect
- +{
- public EffectBluff(Env env, EffectTemplate template)
- {
- @@ -40,54 +43,37 @@
- }
- @Override
- - public EffectType getEffectType()
- + public EffectType getEffectType()
- {
- return EffectType.BLUFF; //test for bluff effect
- }
- /** Notify started */
- @Override
- - public void onStart()
- + public boolean onStart()
- {
- - getEffected().startFear();
- - if(getEffected() instanceof L2FolkInstance) return;
- - // if(getEffected() instanceof L2SiegeGuardInstance) return;
- + if (getEffected() instanceof L2FolkInstance) return false;
- + // if (getEffected() instanceof L2SiegeGuardInstance) return;
- // Cannot be used on Headquarters Flag.
- // bluff now is a PVE PVP skill
- - if(getEffected() instanceof L2NpcInstance && ((L2NpcInstance)getEffected()).getNpcId() == 35062 || getSkill().getId() != 358) return;
- + if (getEffected() instanceof L2NpcInstance && ((L2NpcInstance)getEffected()).getNpcId() == 35062 || getSkill().getId() != 358)
- + return false;
- - if(getEffected() instanceof L2SiegeSummonInstance)
- - {
- - return;
- - }
- - int posX = getEffected().getX();
- - int posY = getEffected().getY();
- - int posZ = getEffected().getZ();
- - int signx=-1;
- - int signy=-1;
- - if (getEffected().getX()>getEffector().getX())
- - signx=1;
- - if (getEffected().getY()>getEffector().getY())
- - signy=1;
- -
- - //posX += signx*40; //distance less than melee attacks (40)
- - //posY += signy*40;
- -
- - getEffected().setRunning();
- - getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,
- - new L2CharPosition(posX +(signx*40),posY + (signy*40),posZ,0));
- - getEffected().sendPacket(SystemMessage.sendString("You can feel Bluff's effect"));
- - getEffected().setTarget(null);
- - onActionTime();
- + if (getEffected() instanceof L2SiegeSummonInstance)
- + return false;
- +
- + getEffected().broadcastPacket(new BeginRotation(getEffected().getObjectId(), getEffected().getHeading(), 1, 65535));
- + getEffected().broadcastPacket(new StopRotation(getEffected().getObjectId(), getEffector().getHeading(), 65535));
- + getEffected().setHeading(getEffector().getHeading());
- + return true;
- }
- @Override
- - public void onExit()
- + public void onExit()
- {
- getEffected().stopFear(this);
- -
- }
- @Override
- - public boolean onActionTime()
- + public boolean onActionTime()
- {
- return false;
- }
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectSignetNoise.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectSignetNoise.java (revision 0)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectSignetNoise.java (revision 0)
- @@ -0,0 +1,56 @@
- +/*
- + * 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 2, 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, write to the Free Software
- + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- + * 02111-1307, USA.
- + *
- + * http://www.gnu.org/copyleft/gpl.html
- + */
- +package net.sf.l2j.gameserver.skills.effects;
- +
- +import net.sf.l2j.gameserver.model.L2Effect;
- +import net.sf.l2j.gameserver.model.L2Character;
- +import net.sf.l2j.gameserver.skills.Env;
- +
- +/**
- + * @author Forsaiken
- + */
- +
- +public class EffectSignetNoise extends EffectSignet
- +{
- + public EffectSignetNoise(Env env, EffectTemplate template)
- + {
- + super(env, template);
- + }
- +
- + @Override
- + public EffectType getEffectType()
- + {
- + return EffectType.SIGNET_GROUND;
- + }
- +
- + @Override
- + public boolean onActionTime()
- + {
- + for (L2Character character : zone.getCharactersInZone())
- + {
- + for (L2Effect effect : character.getAllEffects())
- + {
- + if (effect.getSkill().isDance())
- + effect.exit();
- + }
- + }
- +
- + return true;
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectConfuseMob.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectConfuseMob.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectConfuseMob.java (working copy)
- @@ -35,7 +35,8 @@
- *
- * Implementation of the Confusion Effect
- */
- -final class EffectConfuseMob extends L2Effect {
- +public class EffectConfuseMob extends L2Effect
- +{
- public EffectConfuseMob(Env env, EffectTemplate template)
- {
- @@ -50,19 +51,22 @@
- /** Notify started */
- @Override
- - public void onStart() {
- + public boolean onStart()
- + {
- getEffected().startConfused();
- onActionTime();
- + return true;
- }
- /** Notify exited */
- @Override
- - public void onExit() {
- + public void onExit()
- + {
- getEffected().stopConfused(this);
- }
- @Override
- - public boolean onActionTime()
- + public boolean onActionTime()
- {
- List<L2Character> targetList = new FastList<L2Character>();
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectBetray.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectBetray.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectBetray.java (working copy)
- @@ -44,27 +44,29 @@
- /** Notify started */
- @Override
- - public void onStart()
- + public boolean onStart()
- {
- - if ( getEffected() != null && getEffector() instanceof L2PcInstance && getEffected() instanceof L2Summon)
- + if (getEffected() != null && getEffector() instanceof L2PcInstance && getEffected() instanceof L2Summon)
- {
- L2PcInstance targetOwner = null;
- targetOwner = ((L2Summon)getEffected()).getOwner();
- getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK,targetOwner);
- targetOwner.setIsBetrayed(true);
- onActionTime();
- + return true;
- }
- - }
- + return false;
- + }
- /** Notify exited */
- @Override
- public void onExit()
- {
- - if ( getEffected() != null && getEffector() instanceof L2PcInstance && getEffected() instanceof L2Summon)
- + if (getEffected() != null && getEffector() instanceof L2PcInstance && getEffected() instanceof L2Summon)
- {
- L2PcInstance targetOwner = null;
- targetOwner = ((L2Summon)getEffected()).getOwner();
- targetOwner.setIsBetrayed(false);
- - getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
- + getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
- }
- }
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectDamOverTime.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectDamOverTime.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectDamOverTime.java (working copy)
- @@ -25,7 +25,7 @@
- import net.sf.l2j.gameserver.serverpackets.SystemMessage;
- import net.sf.l2j.gameserver.skills.Env;
- -class EffectDamOverTime extends L2Effect
- +public class EffectDamOverTime extends L2Effect
- {
- public EffectDamOverTime(Env env, EffectTemplate template)
- {
- @@ -44,9 +44,19 @@
- if (getEffected().isDead())
- return false;
- + if (!getSkill().isToggle())
- + {
- + L2Effect[] effects = getEffected().getAllEffects();
- + for (L2Effect e : effects)
- + {
- + if (e.getStackType().equals("sleep"))
- + e.exit();
- + }
- + }
- +
- double damage = calc();
- - if (damage >= getEffected().getCurrentHp())
- + if (damage >= getEffected().getCurrentHp()-1)
- {
- if (getSkill().isToggle())
- {
- @@ -61,11 +71,8 @@
- if (getSkill().getId() != 4082) damage = getEffected().getCurrentHp() - 1;
- }
- - boolean awake = !(getEffected() instanceof L2Attackable)
- - && !(getSkill().getTargetType() == SkillTargetType.TARGET_SELF
- - && getSkill().isToggle());
- + boolean awake = !(getEffected() instanceof L2Attackable) && !(getSkill().getTargetType() == SkillTargetType.TARGET_SELF && getSkill().isToggle());
- -
- getEffected().reduceCurrentHp(damage, getEffector(),awake);
- return true;
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectDebuff.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectDebuff.java (revision 0)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectDebuff.java (revision 0)
- @@ -0,0 +1,40 @@
- +/*
- + * 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 net.sf.l2j.gameserver.skills.effects;
- +
- +import net.sf.l2j.gameserver.model.L2Effect;
- +import net.sf.l2j.gameserver.skills.Env;
- +
- +public class EffectDebuff extends L2Effect
- +{
- +
- + public EffectDebuff(Env env, EffectTemplate template)
- + {
- + super(env, template);
- + }
- +
- + @Override
- + public EffectType getEffectType()
- + {
- + return EffectType.DEBUFF;
- + }
- +
- + @Override
- + public boolean onActionTime()
- + {
- + // just stop this effect
- + return false;
- + }
- +}
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectGrow.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectGrow.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectGrow.java (working copy)
- @@ -5,7 +5,8 @@
- import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance;
- import net.sf.l2j.gameserver.skills.Env;
- -public class EffectGrow extends L2Effect {
- +public class EffectGrow extends L2Effect
- +{
- public EffectGrow(Env env, EffectTemplate template)
- @@ -20,7 +21,7 @@
- }
- @Override
- - public void onStart()
- + public boolean onStart()
- {
- if(getEffected() instanceof L2NpcInstance)
- {
- @@ -29,7 +30,9 @@
- npc.setCollisionRadius((int)(npc.getCollisionRadius()*1.19));
- getEffected().startAbnormalEffect(L2Character.ABNORMAL_EFFECT_GROW);
- + return true;
- }
- + return false;
- }
- @Override
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectCancelTarget.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectCancelTarget.java (revision 0)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectCancelTarget.java (revision 0)
- @@ -0,0 +1,71 @@
- +/*
- + * 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 2, 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, write to the Free Software
- + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- + * 02111-1307, USA.
- + *
- + * http://www.gnu.org/copyleft/gpl.html
- + */
- +package net.sf.l2j.gameserver.skills.effects;
- +
- +import net.sf.l2j.gameserver.ai.CtrlIntention;
- +import net.sf.l2j.gameserver.model.L2Effect;
- +import net.sf.l2j.gameserver.skills.Env;
- +
- +
- +/**
- + * @author decad
- + *
- + * Implementation of the CANCEL TARGET
- + */
- +public class EffectCancelTarget extends L2Effect
- +{
- +
- + public EffectCancelTarget(Env env, EffectTemplate template)
- + {
- + super(env, template);
- + }
- +
- + @Override
- + public EffectType getEffectType()
- + {
- + return EffectType.CANCEL_TARGET;
- + }
- +
- + /** Notify started */
- + @Override
- + public boolean onStart()
- + {
- + getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
- + getEffected().setTarget(null);
- + getEffected().breakAttack();
- + getEffected().breakCast();
- + getEffected().abortAttack();
- + getEffected().abortCast();
- + onActionTime();
- + return true;
- + }
- +
- + @Override
- + public void onExit()
- + {
- + //nothing
- + }
- +
- + @Override
- + public boolean onActionTime()
- + {
- + return false;
- + }
- +}
- +
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java (revision 0)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectDeflectBuff.java (revision 0)
- @@ -0,0 +1,81 @@
- +package net.sf.l2j.gameserver.skills.effects;
- +
- +import net.sf.l2j.gameserver.model.L2Effect;
- +import net.sf.l2j.gameserver.model.L2Skill.SkillType;
- +import net.sf.l2j.gameserver.network.SystemMessageId;
- +import net.sf.l2j.gameserver.serverpackets.SystemMessage;
- +import net.sf.l2j.gameserver.skills.Env;
- +
- +/**
- + * @author Java
- + */
- +public final class EffectDeflectBuff extends L2Effect
- +{
- + /**
- + * @param env
- + * @param template
- + */
- + public EffectDeflectBuff(Env env, EffectTemplate template)
- + {
- + super(env, template);
- + }
- +
- + /*
- + * (non-Javadoc)
- + *
- + * @see net.sf.l2j.gameserver.model.L2Effect#getEffectType()
- + */
- + @Override
- + public EffectType getEffectType()
- + {
- + return EffectType.PREVENT_BUFF;
- + }
- +
- + /*
- + * (non-Javadoc)
- + *
- + * @see net.sf.l2j.gameserver.model.L2Effect#onActionTime()
- + */
- + @Override
- + public boolean onActionTime()
- + {
- + // Only cont skills shouldn't end
- + if(getSkill().getSkillType() != SkillType.CONT)
- + return false;
- +
- + double manaDam = calc();
- +
- + if(manaDam > getEffected().getCurrentMp())
- + {
- + SystemMessage sm = new SystemMessage(SystemMessageId.SKILL_REMOVED_DUE_LACK_MP);
- + getEffected().sendPacket(sm);
- + return false;
- + }
- +
- + getEffected().reduceCurrentMp(manaDam);
- + return true;
- + }
- +
- + /*
- + * (non-Javadoc)
- + *
- + * @see net.sf.l2j.gameserver.model.L2Effect#onStart()
- + */
- + @Override
- + public boolean onStart()
- + {
- + getEffected().setIsBuffProtected(true);
- + return true;
- + }
- +
- + /*
- + * (non-Javadoc)
- + *
- + * @see net.sf.l2j.gameserver.model.L2Effect#onExit()
- + */
- + @Override
- + public void onExit()
- + {
- + getEffected().setIsBuffProtected(false);
- + }
- +}
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectImmobileBuff.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectImmobileBuff.java (revision 0)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectImmobileBuff.java (revision 0)
- @@ -0,0 +1,56 @@
- +/* 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 net.sf.l2j.gameserver.skills.effects;
- +
- +import net.sf.l2j.gameserver.model.L2Effect;
- +import net.sf.l2j.gameserver.skills.Env;
- +
- +/**
- + * @author mkizub TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates
- + */
- +public class EffectImmobileBuff extends L2Effect
- +{
- + public EffectImmobileBuff(Env env, EffectTemplate template)
- + {
- + super(env, template);
- + }
- +
- + @Override
- + public EffectType getEffectType()
- + {
- + return EffectType.BUFF;
- + }
- +
- + /** Notify started */
- + @Override
- + public boolean onStart()
- + {
- + getEffector().setIsImmobilized(true);
- + return true;
- + }
- +
- + /** Notify exited */
- + @Override
- + public void onExit()
- + {
- + getEffector().setIsImmobilized(false);
- + }
- +
- + @Override
- + public boolean onActionTime()
- + {
- + // just stop this effect
- + return false;
- + }
- +}
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectSleep.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectSleep.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectSleep.java (working copy)
- @@ -27,7 +27,8 @@
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
- -final class EffectSleep extends L2Effect {
- +public class EffectSleep extends L2Effect
- +{
- public EffectSleep(Env env, EffectTemplate template)
- {
- @@ -42,22 +43,24 @@
- /** Notify started */
- @Override
- - public void onStart() {
- + public boolean onStart()
- + {
- getEffected().startSleeping();
- + return true;
- }
- /** Notify exited */
- @Override
- - public void onExit() {
- + public void onExit()
- + {
- getEffected().stopSleeping(this);
- }
- @Override
- - public boolean onActionTime()
- + public boolean onActionTime()
- {
- getEffected().stopSleeping(this);
- // just stop this effect
- return false;
- }
- -}
- -
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectLuckNoblesse.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectLuckNoblesse.java (revision 0)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectLuckNoblesse.java (revision 0)
- @@ -0,0 +1,63 @@
- +/* 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 2, 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, write to the Free Software
- + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- + * 02111-1307, USA.
- + *
- + * http://www.gnu.org/copyleft/gpl.html
- + */
- +package net.sf.l2j.gameserver.skills.effects;
- +
- +import net.sf.l2j.gameserver.model.L2Effect;
- +import net.sf.l2j.gameserver.skills.Env;
- +
- +/**
- + * @author tomciaaa
- + *
- + */
- +public class EffectLuckNoblesse extends L2Effect
- +{
- +
- + public EffectLuckNoblesse(Env env, EffectTemplate template)
- + {
- + super(env, template);
- + }
- +
- + @Override
- + public EffectType getEffectType()
- + {
- + return EffectType.LUCKNOBLESSE;
- + }
- +
- + /** Notify started */
- + @Override
- + public boolean onStart()
- + {
- + getEffected().startLuckNoblesse();
- + return true;
- + }
- +
- + /** Notify exited */
- + @Override
- + public void onExit()
- + {
- + getEffected().stopLuckNoblesse();
- + }
- +
- + @Override
- + public boolean onActionTime()
- + {
- + getEffected().stopLuckNoblesse();
- + // just stop this effect
- + return false;
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectPsychicalMute.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectPsychicalMute.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectPsychicalMute.java (working copy)
- @@ -24,33 +24,39 @@
- * @author -Nemesiss-
- *
- */
- -public class EffectPsychicalMute extends L2Effect {
- +public class EffectPsychicalMute extends L2Effect
- +{
- - public EffectPsychicalMute(Env env, EffectTemplate template) {
- + public EffectPsychicalMute(Env env, EffectTemplate template)
- + {
- super(env, template);
- }
- -
- @Override
- - public EffectType getEffectType() {
- + public EffectType getEffectType()
- + {
- return L2Effect.EffectType.PSYCHICAL_MUTE;
- }
- @Override
- - public void onStart() {
- + public boolean onStart()
- + {
- getEffected().startPsychicalMuted();
- + return true;
- }
- @Override
- - public boolean onActionTime() {
- + public boolean onActionTime()
- + {
- // Simply stop the effect
- getEffected().stopPsychicalMuted(this);
- return false;
- }
- @Override
- - public void onExit() {
- + public void onExit()
- + {
- getEffected().stopPsychicalMuted(this);
- }
- }
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectStun.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectStun.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectStun.java (working copy)
- @@ -27,7 +27,8 @@
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
- -final class EffectStun extends L2Effect {
- +public class EffectStun extends L2Effect
- +{
- public EffectStun(Env env, EffectTemplate template)
- {
- @@ -42,21 +43,24 @@
- /** Notify started */
- @Override
- - public void onStart() {
- + public boolean onStart()
- + {
- getEffected().startStunning();
- + return true;
- }
- /** Notify exited */
- @Override
- - public void onExit() {
- + public void onExit()
- + {
- getEffected().stopStunning(this);
- }
- - @Override
- + @Override
- public boolean onActionTime()
- - {
- - // just stop this effect
- - return false;
- - }
- + {
- + // just stop this effect
- + return false;
- + }
- }
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectCombatPointHealOverTime.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectCombatPointHealOverTime.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectCombatPointHealOverTime.java (working copy)
- @@ -23,7 +23,7 @@
- import net.sf.l2j.gameserver.skills.Env;
- -class EffectCombatPointHealOverTime extends L2Effect
- +public class EffectCombatPointHealOverTime extends L2Effect
- {
- public EffectCombatPointHealOverTime(Env env, EffectTemplate template)
- {
- @@ -31,15 +31,15 @@
- }
- @Override
- - public EffectType getEffectType()
- + public EffectType getEffectType()
- {
- return EffectType.COMBAT_POINT_HEAL_OVER_TIME;
- }
- @Override
- - public boolean onActionTime()
- + public boolean onActionTime()
- {
- - if(getEffected().isDead())
- + if (getEffected().isDead())
- return false;
- double cp = getEffected().getCurrentCp();
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectManaDamOverTime.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectManaDamOverTime.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectManaDamOverTime.java (working copy)
- @@ -24,7 +24,7 @@
- import net.sf.l2j.gameserver.skills.Env;
- -class EffectManaDamOverTime extends L2Effect
- +public class EffectManaDamOverTime extends L2Effect
- {
- public EffectManaDamOverTime(Env env, EffectTemplate template)
- {
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectTargetMe.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectTargetMe.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectTargetMe.java (working copy)
- @@ -17,48 +17,56 @@
- */
- package net.sf.l2j.gameserver.skills.effects;
- +import net.sf.l2j.gameserver.ai.CtrlIntention;
- import net.sf.l2j.gameserver.model.L2Effect;
- import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- import net.sf.l2j.gameserver.serverpackets.MyTargetSelected;
- import net.sf.l2j.gameserver.skills.Env;
- /**
- - *
- * @author -Nemesiss-
- */
- public class EffectTargetMe extends L2Effect
- {
- - public EffectTargetMe(Env env, EffectTemplate template)
- + public EffectTargetMe(Env env, EffectTemplate template)
- {
- super(env, template);
- }
- @Override
- - public EffectType getEffectType()
- + public EffectType getEffectType()
- {
- return EffectType.TARGET_ME;
- }
- -
- +
- + /**
- + *
- + * @see com.it.br.gameserver.model.L2Effect#onStart()
- + */
- /** Notify started */
- @Override
- - public void onStart() {
- - //Should only work on PC?
- - if (getEffected() instanceof L2PcInstance)
- - {
- - getEffected().setTarget(getEffector());
- - MyTargetSelected my = new MyTargetSelected(getEffector().getObjectId(), 0);
- - getEffected().sendPacket(my);
- - }
- + public boolean onStart()
- + {
- + getEffected().setTarget(getEffector());
- + MyTargetSelected my = new MyTargetSelected(getEffector().getObjectId(), 0);
- + getEffected().sendPacket(my);
- + getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, getEffector());
- + return true;
- }
- + /**
- + *
- + * @see com.it.br.gameserver.model.L2Effect#onExit()
- + */
- /** Notify exited */
- @Override
- - public void onExit() {
- + public void onExit()
- + {
- //nothing
- }
- @Override
- - public boolean onActionTime()
- + public boolean onActionTime()
- {
- //nothing
- return false;
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectInvincible.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectInvincible.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectInvincible.java (working copy)
- @@ -35,8 +35,10 @@
- }
- @Override
- - public void onStart() {
- + public boolean onStart()
- + {
- getEffected().setIsInvul(true);
- + return true;
- }
- @Override
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectRecoverForce.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectRecoverForce.java (revision 0)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectRecoverForce.java (revision 0)
- @@ -0,0 +1,53 @@
- +/*
- + * 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 2, 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, write to the Free Software
- + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- + * 02111-1307, USA.
- + *
- + * http://www.gnu.org/copyleft/gpl.html
- + */
- +package net.sf.l2j.gameserver.skills.effects;
- +
- +import net.sf.l2j.gameserver.model.L2Effect;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +import net.sf.l2j.gameserver.serverpackets.EtcStatusUpdate;
- +import net.sf.l2j.gameserver.skills.Env;
- +
- +public class EffectRecoverForce extends L2Effect
- +{
- + public EffectRecoverForce(Env env, EffectTemplate template)
- + {
- + super(env, template);
- + }
- +
- + @Override
- + public EffectType getEffectType()
- + {
- + return EffectType.SIGNET_EFFECT;
- + }
- +
- + @Override
- + public boolean onActionTime()
- + {
- + if (getEffected() instanceof L2PcInstance)
- + {
- + EffectCharge effect = (EffectCharge)getEffected().getFirstEffect(EffectType.CHARGE);
- + if (effect != null)
- + {
- + effect.addNumCharges(1);
- + getEffected().sendPacket(new EtcStatusUpdate((L2PcInstance)getEffected()));
- + }
- + }
- + return true;
- + }
- +}
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectRoot.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectRoot.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectRoot.java (working copy)
- @@ -27,7 +27,8 @@
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
- -final class EffectRoot extends L2Effect {
- +public class EffectRoot extends L2Effect
- +{
- public EffectRoot(Env env, EffectTemplate template)
- {
- @@ -42,18 +43,21 @@
- /** Notify started */
- @Override
- - public void onStart() {
- + public boolean onStart()
- + {
- getEffected().startRooted();
- + return true;
- }
- /** Notify exited */
- @Override
- - public void onExit() {
- + public void onExit()
- + {
- getEffected().stopRooting(this);
- }
- @Override
- - public boolean onActionTime()
- + public boolean onActionTime()
- {
- // just stop this effect
- return false;
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectBuff.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectBuff.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectBuff.java (working copy)
- @@ -27,7 +27,8 @@
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
- -final class EffectBuff extends L2Effect {
- +final class EffectBuff extends L2Effect
- +{
- public EffectBuff(Env env, EffectTemplate template)
- {
- @@ -42,9 +43,9 @@
- @Override
- public boolean onActionTime()
- - {
- - // just stop this effect
- - return false;
- - }
- + {
- + // just stop this effect
- + return false;
- + }
- }
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectSignetAntiSummon.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectSignetAntiSummon.java (revision 0)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectSignetAntiSummon.java (revision 0)
- @@ -0,0 +1,85 @@
- +/*
- + * 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 2, 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, write to the Free Software
- + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- + * 02111-1307, USA.
- + *
- + * http://www.gnu.org/copyleft/gpl.html
- + */
- +package net.sf.l2j.gameserver.skills.effects;
- +
- +import net.sf.l2j.gameserver.ai.CtrlEvent;
- +import net.sf.l2j.gameserver.model.L2Character;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance;
- +import net.sf.l2j.gameserver.model.L2Summon;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +import net.sf.l2j.gameserver.network.SystemMessageId;
- +import net.sf.l2j.gameserver.serverpackets.SystemMessage;
- +import net.sf.l2j.gameserver.skills.Env;
- +
- +/**
- + * @author Forsaiken
- + */
- +
- +public class EffectSignetAntiSummon extends EffectSignet
- +{
- + public EffectSignetAntiSummon(Env env, EffectTemplate template)
- + {
- + super(env, template);
- + }
- +
- + @Override
- + public EffectType getEffectType()
- + {
- + return EffectType.SIGNET_GROUND;
- + }
- +
- + @Override
- + public boolean onActionTime()
- + {
- + int mpConsume = getSkill().getMpConsume();
- +
- + L2PcInstance caster = (L2PcInstance)getEffected();
- +
- + for (L2Character cha : zone.getCharactersInZone())
- + {
- + if (cha == null)
- + continue;
- +
- + if (cha instanceof L2PlayableInstance)
- + {
- + L2PcInstance owner = null;
- +
- + if (cha instanceof L2Summon)
- + owner = ((L2Summon)cha).getOwner();
- + else
- + owner = (L2PcInstance)cha;
- +
- + if (owner != null && owner.getPet() != null)
- + {
- + if (mpConsume > caster.getCurrentMp())
- + {
- + caster.sendPacket(new SystemMessage(SystemMessageId.SKILL_REMOVED_DUE_LACK_MP));
- + return false;
- + }
- + else
- + caster.reduceCurrentMp(mpConsume);
- +
- + owner.getPet().unSummon(owner);
- + owner.getAI().notifyEvent(CtrlEvent.EVT_ATTACKED, caster);
- + }
- + }
- + }
- + return true;
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectSilentMove.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectSilentMove.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectSilentMove.java (working copy)
- @@ -26,7 +26,7 @@
- import net.sf.l2j.gameserver.serverpackets.SystemMessage;
- import net.sf.l2j.gameserver.skills.Env;
- -final class EffectSilentMove extends L2Effect
- +public class EffectSilentMove extends L2Effect
- {
- public EffectSilentMove(Env env, EffectTemplate template)
- {
- @@ -35,13 +35,17 @@
- /** Notify started */
- @Override
- - public void onStart()
- + public boolean onStart()
- {
- super.onStart();
- L2Character effected = getEffected();
- if (effected instanceof L2PcInstance)
- - ((L2PcInstance)effected).setSilentMoving(true);
- + {
- + ((L2PcInstance) effected).setSilentMoving(true);
- + return true;
- + }
- + return false;
- }
- /** Notify exited */
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectStunSelf.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectStunSelf.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectStunSelf.java (working copy)
- @@ -35,9 +35,10 @@
- }
- @Override
- - public void onStart()
- + public boolean onStart()
- {
- getEffector().startStunning();
- + return true;
- }
- @Override
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectPhoenixBless.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectPhoenixBless.java (revision 0)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectPhoenixBless.java (revision 0)
- @@ -0,0 +1,68 @@
- +/*
- + * 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 2, 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, write to the Free Software
- + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- + * 02111-1307, USA.
- + *
- + * http://www.gnu.org/copyleft/gpl.html
- + */
- +package net.sf.l2j.gameserver.skills.effects;
- +
- +import net.sf.l2j.gameserver.model.L2Effect;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance;
- +import net.sf.l2j.gameserver.skills.Env;
- +
- +/**
- + * @author Faror
- + */
- +
- +public class EffectPhoenixBless extends L2Effect
- +{
- + public EffectPhoenixBless(Env env, EffectTemplate template)
- + {
- + super(env, template);
- + }
- +
- + @Override
- + public EffectType getEffectType()
- + {
- + return EffectType.PHOENIX_BLESSING;
- + }
- +
- + /** Notify started */
- + @Override
- + public boolean onStart()
- + {
- + if (getEffected() instanceof L2PlayableInstance)
- + {
- + ((L2PlayableInstance) getEffected()).startPhoenixBlessing();
- + return true;
- + }
- + return false;
- + }
- +
- + /** Notify exited */
- + @Override
- + public void onExit()
- + {
- + if (getEffected() instanceof L2PlayableInstance)
- + ((L2PlayableInstance)getEffected()).stopPhoenixBlessing(this);
- + }
- +
- + @Override
- + public boolean onActionTime()
- + {
- + // just stop this effect
- + return false;
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectRemoveTarget.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectRemoveTarget.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectRemoveTarget.java (working copy)
- @@ -17,6 +17,7 @@
- */
- package net.sf.l2j.gameserver.skills.effects;
- +import net.sf.l2j.gameserver.ai.CtrlIntention;
- import net.sf.l2j.gameserver.model.L2Effect;
- import net.sf.l2j.gameserver.skills.Env;
- @@ -32,27 +33,31 @@
- }
- @Override
- - public EffectType getEffectType()
- + public EffectType getEffectType()
- {
- return EffectType.REMOVE_TARGET;
- }
- /** Notify started */
- @Override
- - public void onStart() {
- + public boolean onStart()
- + {
- getEffected().setTarget(null);
- getEffected().abortAttack();
- getEffected().abortCast();
- + getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, getEffector());
- + return true;
- }
- /** Notify exited */
- @Override
- - public void onExit() {
- + public void onExit()
- + {
- //nothing
- }
- @Override
- - public boolean onActionTime()
- + public boolean onActionTime()
- {
- //nothing
- return false;
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectBestowSkill.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectBestowSkill.java (revision 0)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectBestowSkill.java (revision 0)
- @@ -0,0 +1,77 @@
- +/*
- + * 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 net.sf.l2j.gameserver.skills.effects;
- +
- +import net.sf.l2j.gameserver.datatables.SkillTable;
- +import net.sf.l2j.gameserver.model.L2Effect;
- +import net.sf.l2j.gameserver.model.L2Skill;
- +import net.sf.l2j.gameserver.skills.Env;
- +
- +/**
- + * @author Guma
- + */
- +final class EffectBestowSkill extends L2Effect
- +{
- + public EffectBestowSkill(Env env, EffectTemplate template)
- + {
- + super(env, template);
- + }
- +
- + /**
- + *
- + * @see com.it.br.gameserver.model.L2Effect#getEffectType()
- + */
- + @Override
- + public EffectType getEffectType()
- + {
- + return EffectType.BUFF;
- + }
- +
- + /**
- + *
- + * @see com.it.br.gameserver.model.L2Effect#onStart()
- + */
- + @Override
- + public boolean onStart()
- + {
- + L2Skill tempSkill = SkillTable.getInstance().getInfo(getSkill().getTriggeredId(), getSkill().getTriggeredLevel());
- + if (tempSkill != null)
- + {
- + getEffected().addSkill(tempSkill);
- + return true;
- + }
- + return false;
- + }
- +
- + /**
- + *
- + * @see com.it.br.gameserver.model.L2Effect#onExit()
- + */
- + @Override
- + public void onExit()
- + {
- + getEffected().removeSkill(getSkill().getTriggeredId());
- + }
- +
- + /**
- + *
- + * @see com.it.br.gameserver.model.L2Effect#onActionTime()
- + */
- + @Override
- + public boolean onActionTime()
- + {
- + return false;
- + }
- +}
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectNoblesseBless.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectNoblesseBless.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectNoblesseBless.java (working copy)
- @@ -28,7 +28,8 @@
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
- -final class EffectNoblesseBless extends L2Effect {
- +public class EffectNoblesseBless extends L2Effect
- +{
- public EffectNoblesseBless(Env env, EffectTemplate template)
- {
- @@ -43,20 +44,26 @@
- /** Notify started */
- @Override
- - public void onStart() {
- + public boolean onStart()
- + {
- if (getEffected() instanceof L2PlayableInstance)
- - ((L2PlayableInstance)getEffected()).startNoblesseBlessing();
- + {
- + ((L2PlayableInstance) getEffected()).startNoblesseBlessing();
- + return true;
- + }
- + return false;
- }
- /** Notify exited */
- @Override
- - public void onExit() {
- + public void onExit()
- + {
- if (getEffected() instanceof L2PlayableInstance)
- ((L2PlayableInstance)getEffected()).stopNoblesseBlessing(this);
- }
- @Override
- - public boolean onActionTime()
- + public boolean onActionTime()
- {
- // just stop this effect
- return false;
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectSoulOfThePhoenix.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectSoulOfThePhoenix.java (revision 0)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectSoulOfThePhoenix.java (revision 0)
- @@ -0,0 +1,60 @@
- +/*
- + * 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 net.sf.l2j.gameserver.skills.effects;
- +
- +import net.sf.l2j.gameserver.model.L2Effect;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance;
- +import net.sf.l2j.gameserver.skills.Env;
- +
- +/**
- + * @author WhiteMonk Implementation of skill Soul of The Phoenix
- + */
- +public class EffectSoulOfThePhoenix extends L2Effect
- +{
- + public EffectSoulOfThePhoenix(Env env, EffectTemplate template)
- + {
- + super(env, template);
- + }
- +
- + @Override
- + public EffectType getEffectType()
- + {
- + return EffectType.SOUL_OF_THE_PHOENIX;
- + }
- +
- + /** Notify started */
- + @Override
- + public boolean onStart()
- + {
- + if (getEffected() instanceof L2PlayableInstance)
- + ((L2PlayableInstance) getEffected()).startSoulOfThePhoenix();
- + return true;
- + }
- +
- + /** Notify exited */
- + @Override
- + public void onExit()
- + {
- + if (getEffected() instanceof L2PlayableInstance)
- + ((L2PlayableInstance) getEffected()).stopSoulOfThePhoenix(this);
- + }
- +
- + @Override
- + public boolean onActionTime()
- + {
- + // just stop this effect
- + return false;
- + }
- +}
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectParalyze.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectParalyze.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectParalyze.java (working copy)
- @@ -22,7 +22,8 @@
- import net.sf.l2j.gameserver.model.L2Effect;
- import net.sf.l2j.gameserver.skills.Env;
- -final class EffectParalyze extends L2Effect {
- +public class EffectParalyze extends L2Effect
- +{
- public EffectParalyze(Env env, EffectTemplate template)
- {
- @@ -36,10 +37,11 @@
- }
- @Override
- - public void onStart()
- + public boolean onStart()
- {
- getEffected().startAbnormalEffect(L2Character.ABNORMAL_EFFECT_HOLD_1);
- getEffected().setIsParalyzed(true);
- + return true;
- }
- @Override
- @@ -50,7 +52,7 @@
- }
- @Override
- - public boolean onActionTime()
- + public boolean onActionTime()
- {
- return false;
- }
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectTemplate.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectTemplate.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectTemplate.java (working copy)
- @@ -29,18 +29,13 @@
- import net.sf.l2j.gameserver.skills.funcs.Lambda;
- /**
- - * @author mkizub
- - *
- - * TODO To change the template for this generated type comment go to
- - * Window - Preferences - Java - Code Style - Code Templates
- + * @author mkizub TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates
- */
- public final class EffectTemplate
- {
- - static Logger _log = Logger.getLogger(EffectTemplate.class.getName());
- -
- + static Logger _log = Logger.getLogger(EffectTemplate.class.getName());
- private final Class<?> _func;
- - private final Constructor _constructor;
- -
- + private final Constructor<?> _constructor;
- public final Condition attachCond;
- public final Condition applayCond;
- public final Lambda lambda;
- @@ -48,13 +43,10 @@
- public final int period; // in seconds
- public final int abnormalEffect;
- public FuncTemplate[] funcTemplates;
- -
- public final String stackType;
- public final float stackOrder;
- - public EffectTemplate(Condition pAttachCond, Condition pApplayCond,
- - String func, Lambda pLambda, int pCounter, int pPeriod,
- - int pAbnormalEffect, String pStackType, float pStackOrder)
- + public EffectTemplate(Condition pAttachCond, Condition pApplayCond, String func, Lambda pLambda, int pCounter, int pPeriod, int pAbnormalEffect, String pStackType, float pStackOrder)
- {
- attachCond = pAttachCond;
- applayCond = pApplayCond;
- @@ -64,14 +56,20 @@
- abnormalEffect = pAbnormalEffect;
- stackType = pStackType;
- stackOrder = pStackOrder;
- - try {
- - _func = Class.forName("net.sf.l2j.gameserver.skills.effects.Effect"+func);
- - } catch (ClassNotFoundException e) {
- + try
- + {
- + _func = Class.forName("net.sf.l2j.gameserver.skills.effects.Effect" + func);
- + }
- + catch (ClassNotFoundException e)
- + {
- throw new RuntimeException(e);
- }
- - try {
- + try
- + {
- _constructor = _func.getConstructor(Env.class, EffectTemplate.class);
- - } catch (NoSuchMethodException e) {
- + }
- + catch (NoSuchMethodException e)
- + {
- throw new RuntimeException(e);
- }
- }
- @@ -80,39 +78,44 @@
- {
- if (attachCond != null && !attachCond.test(env))
- return null;
- - try {
- - L2Effect effect = (L2Effect)_constructor.newInstance(env, this);
- - //if (_applayCond != null)
- - // effect.setCondition(_applayCond);
- + try
- + {
- + L2Effect effect = (L2Effect) _constructor.newInstance(env, this);
- + // if (_applayCond != null)
- + // effect.setCondition(_applayCond);
- return effect;
- - } catch (IllegalAccessException e) {
- + }
- + catch (IllegalAccessException e)
- + {
- e.printStackTrace();
- return null;
- - } catch (InstantiationException e) {
- + }
- + catch (InstantiationException e)
- + {
- e.printStackTrace();
- return null;
- - } catch (InvocationTargetException e) {
- - _log.warning("Error creating new instance of Class "+_func+" Exception was:");
- + }
- + catch (InvocationTargetException e)
- + {
- + _log.warning("Error creating new instance of Class " + _func + " Exception was:");
- e.getTargetException().printStackTrace();
- return null;
- }
- + }
- + public void attach(FuncTemplate f)
- + {
- + if (funcTemplates == null)
- + {
- + funcTemplates = new FuncTemplate[] { f };
- + }
- + else
- + {
- + int len = funcTemplates.length;
- + FuncTemplate[] tmp = new FuncTemplate[len + 1];
- + System.arraycopy(funcTemplates, 0, tmp, 0, len);
- + tmp[len] = f;
- + funcTemplates = tmp;
- + }
- }
- -
- - public void attach(FuncTemplate f)
- - {
- - if (funcTemplates == null)
- - {
- - funcTemplates = new FuncTemplate[]{f};
- - }
- - else
- - {
- - int len = funcTemplates.length;
- - FuncTemplate[] tmp = new FuncTemplate[len+1];
- - System.arraycopy(funcTemplates, 0, tmp, 0, len);
- - tmp[len] = f;
- - funcTemplates = tmp;
- - }
- - }
- -
- }
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectPetrified.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectPetrified.java (revision 0)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectPetrified.java (revision 0)
- @@ -0,0 +1,67 @@
- +/*
- + * 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 2, 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, write to the Free Software
- + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- + * 02111-1307, USA.
- + *
- + * http://www.gnu.org/copyleft/gpl.html
- + */
- +
- +/**
- + * @author decad
- + *
- + * Implementation of the Petrified effect
- + */
- +package net.sf.l2j.gameserver.skills.effects;
- +
- +import net.sf.l2j.gameserver.model.L2Character;
- +import net.sf.l2j.gameserver.model.L2Effect;
- +import net.sf.l2j.gameserver.skills.Env;
- +
- +public class EffectPetrified extends L2Effect
- +{
- +
- + public EffectPetrified(Env env, EffectTemplate template)
- + {
- + super(env, template);
- + }
- +
- + @Override
- + public EffectType getEffectType()
- + {
- + return EffectType.PETRIFIED;
- + }
- +
- + @Override
- + public boolean onStart()
- + {
- + getEffected().abortAttack();
- + getEffected().abortCast();
- + getEffected().startAbnormalEffect(L2Character.ABNORMAL_EFFECT_HOLD_2);
- + getEffected().setIsParalyzed(true);
- + return true;
- + }
- +
- + @Override
- + public void onExit()
- + {
- + getEffected().stopAbnormalEffect(L2Character.ABNORMAL_EFFECT_HOLD_2);
- + getEffected().setIsParalyzed(false);
- + }
- +
- + @Override
- + public boolean onActionTime()
- + {
- + return false;
- + }
- +}
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectCharge.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectCharge.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectCharge.java (working copy)
- @@ -51,10 +51,10 @@
- @Override
- public boolean onActionTime()
- - {
- - // ignore
- - return true;
- - }
- + {
- + // ignore
- + return true;
- + }
- @Override
- public int getLevel() { return numCharges; }
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectFusion.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectFusion.java (revision 0)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectFusion.java (revision 0)
- @@ -0,0 +1,71 @@
- +/*
- + * 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 net.sf.l2j.gameserver.skills.effects;
- +
- +import net.sf.l2j.gameserver.datatables.SkillTable;
- +import net.sf.l2j.gameserver.model.L2Effect;
- +import net.sf.l2j.gameserver.skills.Env;
- +/**
- + * @author Guma
- + *
- + */
- +public final class EffectFusion extends L2Effect
- +{
- + public int _effect;
- + public int _maxEffect;
- +
- + public EffectFusion(Env env, EffectTemplate template)
- + {
- + super(env, template);
- + _effect = 1;
- + _maxEffect = getSkill().getLevel();
- + }
- +
- + @Override
- + public boolean onActionTime()
- + {
- + return true;
- + }
- +
- + @Override
- + public EffectType getEffectType()
- + {
- + return EffectType.FUSION;
- + }
- +
- + public void increaseEffect()
- + {
- + if (_effect < _maxEffect)
- + {
- + _effect++;
- + updateBuff();
- + }
- + }
- +
- + public void decreaseForce()
- + {
- + _effect--;
- + if (_effect < 1)
- + exit();
- + else
- + updateBuff();
- + }
- +
- + private void updateBuff()
- + {
- + exit();
- + SkillTable.getInstance().getInfo(getSkill().getId(), _effect).getEffects(getEffector(), getEffected());
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectSignetMDam.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectSignetMDam.java (revision 0)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectSignetMDam.java (revision 0)
- @@ -0,0 +1,152 @@
- +/*
- + * 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 2, 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, write to the Free Software
- + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- + * 02111-1307, USA.
- + *
- + * http://www.gnu.org/copyleft/gpl.html
- + */
- +package net.sf.l2j.gameserver.skills.effects;
- +
- +/**
- + * @author Forsaiken
- + */
- +
- +import javolution.util.FastList;
- +
- +import net.sf.l2j.gameserver.ai.CtrlEvent;
- +import net.sf.l2j.gameserver.model.L2ItemInstance;
- +import net.sf.l2j.gameserver.model.L2Object;
- +import net.sf.l2j.gameserver.model.L2Attackable;
- +import net.sf.l2j.gameserver.model.L2Character;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance;
- +import net.sf.l2j.gameserver.model.L2Summon;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +import net.sf.l2j.gameserver.network.SystemMessageId;
- +import net.sf.l2j.gameserver.serverpackets.MagicSkillLaunched;
- +import net.sf.l2j.gameserver.serverpackets.NpcInfo;
- +import net.sf.l2j.gameserver.serverpackets.SystemMessage;
- +import net.sf.l2j.gameserver.skills.Env;
- +import net.sf.l2j.gameserver.skills.Formulas;
- +
- +public class EffectSignetMDam extends EffectSignet
- +{
- + private int _state = 0;
- + public EffectSignetMDam(Env env, EffectTemplate template)
- + {
- + super(env, template);
- + }
- +
- + @Override
- + public EffectType getEffectType()
- + {
- + return EffectType.SIGNET_GROUND;
- + }
- +
- + @Override
- + public boolean onActionTime()
- + {
- + // on offi the zone get created and the first wave starts later
- + // there is also an first hit animation to the caster
- + switch (_state)
- + {
- + case 0:
- + case 2:
- + _state++;
- + return true;
- + case 1:
- + getEffected().broadcastPacket(new MagicSkillLaunched(getEffected(), getSkill().getId(), getSkill().getLevel(), new L2Object[]{getEffected()}));
- + _state++;
- + return true;
- + }
- +
- + int mpConsume = getSkill().getMpConsume();
- +
- + L2PcInstance caster = (L2PcInstance)getEffected();
- +
- + boolean ss = false;
- + boolean bss = false;
- +
- + L2ItemInstance weaponInst = caster.getActiveWeaponInstance();
- + if (weaponInst != null)
- + {
- + switch (weaponInst.getChargedSpiritshot())
- + {
- + case L2ItemInstance.CHARGED_BLESSED_SPIRITSHOT:
- + weaponInst.setChargedSpiritshot(L2ItemInstance.CHARGED_NONE);
- + bss = true;
- + break;
- + case L2ItemInstance.CHARGED_SPIRITSHOT:
- + weaponInst.setChargedSpiritshot(L2ItemInstance.CHARGED_NONE);
- + ss = true;
- + break;
- + }
- + }
- +
- + if (!bss && !ss)
- + caster.rechargeAutoSoulShot(false, true, false);
- +
- + FastList<L2Character> targets = new FastList<L2Character>();
- +
- + for (L2Character cha : zone.getCharactersInZone())
- + {
- + if (cha == null || cha == getEffected())
- + continue;
- +
- + if (cha instanceof L2Attackable || cha instanceof L2PlayableInstance)
- + {
- + if (cha.isAlikeDead())
- + continue;
- +
- + if (mpConsume > caster.getCurrentMp())
- + {
- + caster.sendPacket(new SystemMessage(SystemMessageId.SKILL_REMOVED_DUE_LACK_MP));
- + return false;
- + }
- + else
- + caster.reduceCurrentMp(mpConsume);
- +
- + targets.add(cha);
- + }
- + }
- +
- + if (targets.size() > 0)
- + {
- + caster.broadcastPacket(new MagicSkillLaunched(caster, getSkill().getId(), getSkill().getLevel(), targets.toArray(new L2Character[targets.size()])));
- + for (L2Character target : targets)
- + {
- + boolean mcrit = Formulas.getInstance().calcMCrit(caster.getMCriticalHit(target, getSkill()));
- + int mdam = (int)Formulas.getInstance().calcMagicDam(caster, target, getSkill(), ss, bss, mcrit);
- +
- + if (target instanceof L2Summon)
- + {
- + caster.equals(((L2Summon)target).getOwner());
- + caster.sendPacket(new NpcInfo((L2Summon)target, caster));
- + }
- +
- + if (mdam > 0)
- + {
- + if (!target.isRaid() && Formulas.getInstance().calcAtkBreak(target, mdam))
- + {
- + target.breakAttack();
- + target.breakCast();
- + }
- + caster.sendDamageMessage(target, mdam, mcrit, false, false);
- + target.reduceCurrentHp(mdam, caster);
- + }
- + target.getAI().notifyEvent(CtrlEvent.EVT_ATTACKED, caster);
- + }
- + }
- + return true;
- + }
- +}
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectMpConsumePerLevel.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectMpConsumePerLevel.java (revision 0)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectMpConsumePerLevel.java (revision 0)
- @@ -0,0 +1,55 @@
- +/*
- + * 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 net.sf.l2j.gameserver.skills.effects;
- +
- +import net.sf.l2j.gameserver.model.L2Effect;
- +import net.sf.l2j.gameserver.network.SystemMessageId;
- +import net.sf.l2j.gameserver.serverpackets.SystemMessage;
- +import net.sf.l2j.gameserver.skills.Env;
- +
- +
- +public class EffectMpConsumePerLevel extends L2Effect
- +{
- + public EffectMpConsumePerLevel(Env env, EffectTemplate template)
- + {
- + super(env, template);
- + }
- +
- + @Override
- + public EffectType getEffectType()
- + {
- + return EffectType.MP_CONSUME_PER_LEVEL ;
- + }
- +
- + @Override
- + public boolean onActionTime()
- + {
- + if(getEffected().isDead())
- + return false;
- +
- + double base = calc();
- + double consume = (getEffected().getLevel() - 1)/7.5*base*getPeriod();
- +
- + if(consume > getEffected().getCurrentMp())
- + {
- + SystemMessage sm = new SystemMessage(SystemMessageId.SKILL_REMOVED_DUE_LACK_MP);
- + getEffected().sendPacket(sm);
- + return false;
- + }
- +
- + getEffected().reduceCurrentMp(consume);
- + return true;
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectPetrification.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectPetrification.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectPetrification.java (working copy)
- @@ -25,35 +25,36 @@
- public class EffectPetrification extends L2Effect
- {
- - public EffectPetrification(Env env, EffectTemplate template)
- - {
- + public EffectPetrification(Env env, EffectTemplate template)
- + {
- super(env, template);
- }
- @Override
- - public EffectType getEffectType()
- + public EffectType getEffectType()
- {
- return L2Effect.EffectType.PETRIFICATION;
- }
- @Override
- - public void onStart()
- + public boolean onStart()
- {
- getEffected().startAbnormalEffect(L2Character.ABNORMAL_EFFECT_HOLD_2);
- getEffected().setIsParalyzed(true);
- getEffected().setIsInvul(true);
- + return true;
- }
- @Override
- - public void onExit()
- + public void onExit()
- {
- - getEffected().stopAbnormalEffect(L2Character.ABNORMAL_EFFECT_HOLD_2);
- - getEffected().setIsParalyzed(false);
- - getEffected().setIsInvul(false);
- + getEffected().stopAbnormalEffect(L2Character.ABNORMAL_EFFECT_HOLD_2);
- + getEffected().setIsParalyzed(false);
- + getEffected().setIsInvul(false);
- }
- @Override
- - public boolean onActionTime()
- + public boolean onActionTime()
- {
- return false;
- }
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectSilenceMagicPhysical.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectSilenceMagicPhysical.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectSilenceMagicPhysical.java (working copy)
- @@ -20,27 +20,31 @@
- import net.sf.l2j.gameserver.model.L2Effect;
- import net.sf.l2j.gameserver.skills.Env;
- -public class EffectSilenceMagicPhysical extends L2Effect {
- +public class EffectSilenceMagicPhysical extends L2Effect
- +{
- - public EffectSilenceMagicPhysical(Env env, EffectTemplate template) {
- + public EffectSilenceMagicPhysical(Env env, EffectTemplate template)
- + {
- super(env, template);
- }
- @Override
- - public EffectType getEffectType() {
- + public EffectType getEffectType()
- + {
- return L2Effect.EffectType.SILENCE_MAGIC_PHYSICAL;
- }
- @Override
- - public void onStart()
- + public boolean onStart()
- {
- getEffected().startMuted();
- getEffected().startPsychicalMuted();
- + return true;
- }
- @Override
- - public boolean onActionTime()
- + public boolean onActionTime()
- {
- getEffected().stopMuted(this);
- getEffected().stopPsychicalMuted(this);
- @@ -48,9 +52,9 @@
- }
- @Override
- - public void onExit()
- + public void onExit()
- {
- getEffected().stopMuted(this);
- getEffected().stopPsychicalMuted(this);
- }
- -}
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectRelax.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectRelax.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectRelax.java (working copy)
- @@ -26,7 +26,7 @@
- import net.sf.l2j.gameserver.skills.Env;
- -class EffectRelax extends L2Effect
- +public class EffectRelax extends L2Effect
- {
- public EffectRelax(Env env, EffectTemplate template)
- {
- @@ -41,31 +41,33 @@
- /** Notify started */
- @Override
- - public void onStart() {
- + public boolean onStart()
- + {
- - if(getEffected() instanceof L2PcInstance)
- - {
- - setRelax(true);
- - ((L2PcInstance)getEffected()).sitDown();
- - }
- - else
- - getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_REST);
- - super.onStart();
- + if (getEffected() instanceof L2PcInstance)
- + {
- + setRelax(true);
- + ((L2PcInstance) getEffected()).sitDown();
- + }
- + else
- + getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_REST);
- + return super.onStart();
- }
- /* (non-Javadoc)
- - * @see net.sf.l2j.gameserver.model.L2Effect#onExit()
- + * @see com.it.br.gameserver.model.L2Effect#onExit()
- */
- @Override
- - public void onExit() {
- - setRelax(false);
- - super.onExit();
- + public void onExit()
- + {
- + setRelax(false);
- + super.onExit();
- }
- @Override
- public boolean onActionTime()
- {
- - boolean retval = true;
- + boolean retval = true;
- if(getEffected().isDead())
- retval = false;
- @@ -75,7 +77,8 @@
- retval = false;
- }
- - if (getEffected().getCurrentHp()+1 > getEffected().getMaxHp()) {
- + if (getEffected().getCurrentHp()+1 > getEffected().getMaxHp())
- + {
- if(getSkill().isToggle())
- {
- SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
- @@ -83,7 +86,7 @@
- getEffected().sendPacket(sm);
- //if (getEffected() instanceof L2PcInstance)
- //((L2PcInstance)getEffected()).standUp();
- - retval = false;
- + retval = false;
- }
- }
- @@ -97,7 +100,7 @@
- getEffected().sendPacket(sm);
- //if (getEffected() instanceof L2PcInstance)
- //((L2PcInstance)getEffected()).standUp();
- - retval = false;
- + retval = false;
- }
- }
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectBigHead.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectBigHead.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectBigHead.java (working copy)
- @@ -21,9 +21,9 @@
- import net.sf.l2j.gameserver.skills.Env;
- /**
- - *
- - * @author LBaldi
- - */
- +*
- +* @author LBaldi
- +*/
- final class EffectBigHead extends L2Effect
- {
- @@ -39,12 +39,15 @@
- }
- @Override
- - public void onStart() {
- + public boolean onStart()
- + {
- getEffected().startAbnormalEffect(0x02000);
- + return true;
- }
- @Override
- - public void onExit() {
- + public void onExit()
- + {
- getEffected().stopAbnormalEffect(0x02000);
- }
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectHealOverTime.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectHealOverTime.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectHealOverTime.java (working copy)
- @@ -24,7 +24,7 @@
- import net.sf.l2j.gameserver.skills.Env;
- -class EffectHealOverTime extends L2Effect
- +public class EffectHealOverTime extends L2Effect
- {
- public EffectHealOverTime(Env env, EffectTemplate template)
- {
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectSignet.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectSignet.java (revision 0)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectSignet.java (revision 0)
- @@ -0,0 +1,161 @@
- +/*
- + * 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 2, 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, write to the Free Software
- + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- + * 02111-1307, USA.
- + *
- + * http://www.gnu.org/copyleft/gpl.html
- + */
- +package net.sf.l2j.gameserver.skills.effects;
- +
- +import java.util.logging.Logger;
- +
- +import net.sf.l2j.gameserver.datatables.NpcTable;
- +import net.sf.l2j.gameserver.datatables.SkillTable;
- +import net.sf.l2j.gameserver.datatables.SpawnTable;
- +import net.sf.l2j.gameserver.model.L2Effect;
- +import net.sf.l2j.gameserver.model.L2Skill;
- +import net.sf.l2j.gameserver.model.L2Spawn;
- +import net.sf.l2j.gameserver.model.L2WorldRegion;
- +import net.sf.l2j.gameserver.model.L2Character;
- +import net.sf.l2j.gameserver.model.L2Skill.SkillTargetType;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +import net.sf.l2j.gameserver.model.zone.form.ZoneCylinder;
- +import net.sf.l2j.gameserver.model.zone.type.L2SignetZone;
- +import net.sf.l2j.gameserver.network.SystemMessageId;
- +import net.sf.l2j.gameserver.serverpackets.SystemMessage;
- +import net.sf.l2j.gameserver.skills.Env;
- +import net.sf.l2j.gameserver.skills.l2skills.L2SkillMagicOnGround;
- +import net.sf.l2j.gameserver.templates.L2NpcTemplate;
- +import net.sf.l2j.util.Point3D;
- +
- +
- +/**
- + * @author Forsaiken
- + */
- +
- +public class EffectSignet extends L2Effect
- +{
- + static Logger _log = Logger.getLogger(EffectSignet.class.getName());
- +
- + private L2Spawn _spawn;
- +
- + protected L2SignetZone zone;
- +
- + public EffectSignet(Env env, EffectTemplate template)
- + {
- + super(env, template);
- + }
- +
- + @Override
- + public boolean onStart()
- + {
- + int x = getEffected().getX();
- + int y = getEffected().getY();
- + int z = getEffected().getZ();
- +
- + if (getEffected() instanceof L2PcInstance && getSkill().getTargetType() == L2Skill.SkillTargetType.TARGET_SIGNET_GROUND)
- + {
- + Point3D wordPosition = ((L2PcInstance) getEffected()).getCurrentSkillWorldPosition();
- +
- + if (wordPosition != null)
- + {
- + x = wordPosition.getX();
- + y = wordPosition.getY();
- + z = wordPosition.getZ();
- + }
- + }
- +
- + L2NpcTemplate template = NpcTable.getInstance().getTemplate(((L2SkillMagicOnGround) getSkill()).effectNpcId);
- + if (template != null)
- + {
- + try
- + {
- + _spawn = new L2Spawn(template);
- + _spawn.setLocx(x);
- + _spawn.setLocy(y);
- + _spawn.setLocz(z);
- + _spawn.setAmount(1);
- + _spawn.setHeading(getEffector().getHeading());
- + _spawn.setRespawnDelay(0);
- + SpawnTable.getInstance().addNewSpawn(_spawn, false);
- + _spawn.init();
- + _spawn.stopRespawn();
- + }
- + catch (Throwable e)
- + {
- + e.printStackTrace();
- + }
- + }
- +
- + L2WorldRegion region = getEffected().getWorldRegion();
- +
- + L2Skill skill = SkillTable.getInstance().getInfo(((L2SkillMagicOnGround) getSkill()).triggerEffectId, getLevel());
- +
- + if (skill == null)
- + {
- + _log.warning("EffectSignet: Could not get the tigger effect " + ((L2SkillMagicOnGround) getSkill()).triggerEffectId);
- + onExit();
- + return false;
- + }
- +
- + zone = new L2SignetZone(region, getEffected(), !getSkill().isOffensive(), getSkill().getId(), skill);
- +
- + zone.setZone(new ZoneCylinder(x, y, z - 200, z + 200, getSkill().getSkillRadius()));
- +
- + region.addZone(zone);
- +
- + for (L2Character c : getEffected().getKnownList().getKnownCharacters())
- + zone.revalidateInZone(c);
- +
- + zone.revalidateInZone(getEffected());
- + return true;
- + }
- +
- + @Override
- + public void onExit()
- + {
- + if (_spawn != null)
- + {
- + _spawn.getLastSpawn().deleteMe();
- + SpawnTable.getInstance().deleteSpawn(_spawn, false);
- + }
- +
- + if (zone != null)
- + zone.remove();
- + }
- +
- + @Override
- + public EffectType getEffectType()
- + {
- + return EffectType.SIGNET;
- + }
- +
- + @Override
- + public boolean onActionTime()
- + {
- + int mpConsume = getSkill().getMpConsume();
- +
- + if (mpConsume > getEffected().getCurrentMp())
- + {
- + getEffected()
- + .sendPacket(
- + new SystemMessage(
- + SystemMessageId.SKILL_REMOVED_DUE_LACK_MP));
- + return false;
- + } else
- + getEffected().reduceCurrentMp(mpConsume);
- +
- + return true;
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectImmobileUntilAttacked.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectImmobileUntilAttacked.java (revision 0)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectImmobileUntilAttacked.java (revision 0)
- @@ -0,0 +1,60 @@
- +/*
- + * 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 net.sf.l2j.gameserver.skills.effects;
- +
- +import net.sf.l2j.gameserver.model.L2Effect;
- +import net.sf.l2j.gameserver.skills.Env;
- +
- +/**
- + * @author Ahmed
- + */
- +public final class EffectImmobileUntilAttacked extends L2Effect
- +{
- + public EffectImmobileUntilAttacked(Env env, EffectTemplate template)
- + {
- + super(env, template);
- + }
- +
- + @Override
- + public EffectType getEffectType()
- + {
- + return EffectType.IMMOBILE_UNTIL_ATTACKED;
- + }
- +
- + /** Notify started */
- + @Override
- + public boolean onStart()
- + {
- + getEffected().isImmobileUntilAttacked();
- + return true;
- + }
- +
- + /** Notify exited */
- + @Override
- + public void onExit()
- + {
- + getEffected().setIsImmobileUntilAttacked(false);
- + }
- +
- + /**
- + * @see com.l2j.gameserver.model.L2Effect#onActionTime()
- + */
- + @Override
- + public boolean onActionTime()
- + {
- + // TODO Auto-generated method stub
- + return false;
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectManaHealOverTime.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectManaHealOverTime.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectManaHealOverTime.java (working copy)
- @@ -23,7 +23,7 @@
- import net.sf.l2j.gameserver.skills.Env;
- -class EffectManaHealOverTime extends L2Effect
- +public class EffectManaHealOverTime extends L2Effect
- {
- public EffectManaHealOverTime(Env env, EffectTemplate template)
- {
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectCharmOfLuck.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectCharmOfLuck.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectCharmOfLuck.java (working copy)
- @@ -40,22 +40,28 @@
- /** Notify started */
- @Override
- - public void onStart() {
- - if (getEffected() instanceof L2PlayableInstance)
- - ((L2PlayableInstance)getEffected()).startCharmOfLuck();
- + public boolean onStart()
- + {
- + if (getEffected() instanceof L2PlayableInstance)
- + {
- + ((L2PlayableInstance) getEffected()).startCharmOfLuck();
- + return true;
- + }
- + return false;
- }
- /** Notify exited */
- @Override
- - public void onExit() {
- + public void onExit()
- + {
- if (getEffected() instanceof L2PlayableInstance)
- ((L2PlayableInstance)getEffected()).stopCharmOfLuck (this);
- }
- @Override
- - public boolean onActionTime()
- + public boolean onActionTime()
- {
- - // just stop this effect
- - return false;
- + // just stop this effect
- + return false;
- }
- }
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectImobileBuff.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectImobileBuff.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectImobileBuff.java (working copy)
- @@ -27,7 +27,8 @@
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
- -final class EffectImobileBuff extends L2Effect {
- +public class EffectImobileBuff extends L2Effect
- +{
- public EffectImobileBuff(Env env, EffectTemplate template)
- {
- @@ -42,21 +43,24 @@
- /** Notify started */
- @Override
- - public void onStart() {
- - getEffector().setIsImobilised(true);
- + public boolean onStart()
- + {
- + getEffector().setIsImmobilized(true);
- + return true;
- }
- /** Notify exited */
- @Override
- - public void onExit() {
- - getEffector().setIsImobilised(false);
- + public void onExit()
- + {
- + getEffector().setIsImmobilized(false);
- }
- @Override
- public boolean onActionTime()
- - {
- - // just stop this effect
- - return false;
- - }
- + {
- + // just stop this effect
- + return false;
- + }
- }
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectImobilePetBuff.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectImobilePetBuff.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectImobilePetBuff.java (working copy)
- @@ -29,7 +29,8 @@
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
- -final class EffectImobilePetBuff extends L2Effect {
- +public class EffectImobilePetBuff extends L2Effect
- +{
- private L2Summon _pet;
- public EffectImobilePetBuff(Env env, EffectTemplate template)
- @@ -45,29 +46,31 @@
- /** Notify started */
- @Override
- - public void onStart() {
- + public boolean onStart()
- + {
- _pet = null;
- - if (getEffected() instanceof L2Summon
- - && getEffector() instanceof L2PcInstance
- - && ((L2Summon)getEffected()).getOwner() == getEffector())
- + if (getEffected() instanceof L2Summon && getEffector() instanceof L2PcInstance && ((L2Summon) getEffected()).getOwner() == getEffector())
- {
- _pet = (L2Summon)getEffected();
- - _pet.setIsImobilised(true);
- + _pet.setIsImmobilized(true);
- + return true;
- }
- + return false;
- }
- /** Notify exited */
- @Override
- - public void onExit() {
- + public void onExit()
- + {
- if (_pet != null)
- - _pet.setIsImobilised(false);
- + _pet.setIsImmobilized(false);
- }
- @Override
- public boolean onActionTime()
- - {
- - // just stop this effect
- - return false;
- - }
- + {
- + // just stop this effect
- + return false;
- + }
- }
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectSeed.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectSeed.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectSeed.java (working copy)
- @@ -21,11 +21,12 @@
- import net.sf.l2j.gameserver.model.L2Effect;
- import net.sf.l2j.gameserver.skills.Env;
- -public final class EffectSeed extends L2Effect {
- +public final class EffectSeed extends L2Effect
- +{
- private int _power = 1;
- - public EffectSeed(Env env, EffectTemplate template)
- + public EffectSeed(Env env, EffectTemplate template)
- {
- super(env, template);
- }
- @@ -38,10 +39,10 @@
- @Override
- public boolean onActionTime()
- - {
- - // just stop this effect
- - return false;
- - }
- + {
- + // just stop this effect
- + return false;
- + }
- public int getPower()
- {
- Index: java/net/sf/l2j/gameserver/skills/effects/EffectConfusion.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/skills/effects/EffectConfusion.java (revision 4415)
- +++ java/net/sf/l2j/gameserver/skills/effects/EffectConfusion.java (working copy)
- @@ -35,7 +35,8 @@
- *
- * Implementation of the Confusion Effect
- */
- -final class EffectConfusion extends L2Effect {
- +public class EffectConfusion extends L2Effect
- +{
- public EffectConfusion(Env env, EffectTemplate template)
- {
- @@ -50,19 +51,22 @@
- /** Notify started */
- @Override
- - public void onStart() {
- + public boolean onStart()
- + {
- getEffected().startConfused();
- onActionTime();
- + return true;
- }
- /** Notify exited */
- @Override
- - public void onExit() {
- + public void onExit()
- + {
- getEffected().stopConfused(this);
- }
- @Override
- - public boolean onActionTime()
- + public boolean onActionTime()
- {
- if (Config.DEBUG)
- System.out.println(getEffected());
Advertisement
Add Comment
Please, Sign In to add comment