123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- /*
- * 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.ai.CtrlIntention;
- import net.sf.l2j.gameserver.model.L2CharPosition;
- import net.sf.l2j.gameserver.model.L2Effect;
- import net.sf.l2j.gameserver.model.actor.L2Npc;
- import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance;
- import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance;
- import net.sf.l2j.gameserver.model.actor.instance.L2SiegeSummonInstance;
- import net.sf.l2j.gameserver.skills.Env;
- import net.sf.l2j.gameserver.templates.effects.EffectTemplate;
- import net.sf.l2j.gameserver.templates.skills.L2EffectType;
- /**
- * @author decad
- *
- * Implementation of the Bluff Effect
- */
- public class EffectBluff extends L2Effect
- {
-
- public EffectBluff(Env env, EffectTemplate template)
- {
- super(env, template);
- }
-
- /**
- *
- * @see net.sf.l2j.gameserver.model.L2Effect#getEffectType()
- */
- @Override
- public L2EffectType getEffectType()
- {
- return L2EffectType.BLUFF; // test for bluff effect
- }
-
- /**
- *
- * @see net.sf.l2j.gameserver.model.L2Effect#onStart()
- */
- @Override
- public boolean onStart()
- {
- getEffected().startFear();
- if (getEffected() instanceof L2NpcInstance)
- return false;
-
- if (getEffected() instanceof L2Npc && ((L2Npc) getEffected()).getNpcId() == 35062 || getSkill().getId() != 358)
- return false;
-
- if (getEffected() instanceof L2SiegeSummonInstance)
- {
- return false;
- }
- 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;
- if (!(getEffected() instanceof L2PetInstance))
- getEffected().setRunning();
- getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(posX + (signx * 40), posY + (signy * 40), posZ, 0));
- getEffected().sendMessage("You can feel Bluff's effect");
- getEffected().setTarget(null);
- return true;
- }
-
- /**
- *
- * @see net.sf.l2j.gameserver.model.L2Effect#onExit()
- */
- @Override
- public void onExit()
- {
- getEffected().stopFear(this);
-
- }
-
- /**
- *
- * @see net.sf.l2j.gameserver.model.L2Effect#onActionTime()
- */
- @Override
- public boolean onActionTime()
- {
- return false;
- }
- }
|