Перейти к содержанию

drakola

Постоялец
  • Публикаций

    244
  • Зарегистрирован

  • Посещение

  • Победитель дней

    1
  • Отзывы

    0%

drakola стал победителем дня 27 мая 2022

drakola имел наиболее популярный контент!

Репутация

10

2 Подписчика

Информация о drakola

  • Звание
    Поставил палатку

Информация

  • Пол
    Мужчина
  • Город
    Астрахань

Контакты

Посетители профиля

Блок последних пользователей отключён и не показывается другим пользователям.

  1. drakola

    Исправить Fear

    хорошо. я как буду свободен я вам напишу в лк
  2. drakola

    Исправить Fear

    вы мне сможете помочь за 2 вариант ?
  3. drakola

    Исправить Fear

    не пиши тут если нет желания помогать.
  4. drakola

    Исправить Fear

    ставлю и у меня прут ошибки
  5. drakola

    Исправить Fear

    /* * 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 ru.catssoftware.gameserver.skills.effects; import ru.catssoftware.gameserver.ai.CtrlIntention; import ru.catssoftware.gameserver.geodata.GeoData; import ru.catssoftware.gameserver.model.L2CharPosition; import ru.catssoftware.gameserver.model.L2Effect; import ru.catssoftware.gameserver.model.actor.instance.L2FolkInstance; import ru.catssoftware.gameserver.model.actor.instance.L2FortCommanderInstance; import ru.catssoftware.gameserver.model.actor.instance.L2FortSiegeGuardInstance; import ru.catssoftware.gameserver.model.actor.instance.L2PcInstance; import ru.catssoftware.gameserver.model.actor.instance.L2PetInstance; import ru.catssoftware.gameserver.model.actor.instance.L2SiegeFlagInstance; import ru.catssoftware.gameserver.model.actor.instance.L2SiegeGuardInstance; import ru.catssoftware.gameserver.model.actor.instance.L2SiegeSummonInstance; import ru.catssoftware.gameserver.skills.Env; import ru.catssoftware.gameserver.templates.skills.L2EffectType; //import java.util.logging.Logger; import ru.catssoftware.tools.random.Rnd; /** * @[member='Authority'] littlecrow * * Implementation of the Fear Effect */ public final class EffectFear extends L2Effect { public static final int FEAR_RANGE = 200; //protected static Logger _log = Logger.getLogger(EffectFear.class.getName()); //private static Map<Integer, float[]> _deltas = new FastMap<Integer, float[]>(); public EffectFear(Env env, EffectTemplate template) { super(env, template); } @[member='override'] public L2EffectType getEffectType() { return L2EffectType.FEAR; } /** Notify started */ @[member='override'] public boolean onStart() { // Fear skills cannot be used L2Pcinstance to L2Pcinstance. // Heroic Dread, Curse: Fear, Fear, Horror, Sword Symphony, Word of Fear and Mass Curse Fear are the exceptions. if (getEffected() instanceof L2PcInstance && getEffector() instanceof L2PcInstance) { switch (getSkill().getId()) { case 65: case 98: case 1092: case 1169: case 1272: case 1376: case 1381: // all ok break; default: return false; } } if (getEffected() instanceof L2FolkInstance || getEffected() instanceof L2SiegeGuardInstance || getEffected() instanceof L2SiegeFlagInstance || getEffected() instanceof L2SiegeSummonInstance || getEffected() instanceof L2FortSiegeGuardInstance || getEffected() instanceof L2FortCommanderInstance) { return false; } if (!getEffected().isAfraid()) { /*float _dX = getEffector().getX() - getEffected().getX(); float _dY = getEffector().getY() - getEffected().getY(); if (_dX == 0) { _dX = 0; if (_dY > 0) { _dY = -1; } else { _dY = 1; } } else if (_dY == 0) { _dY = 0; if (_dX > 0) { _dX = -1; } else { _dX = 1; } } else if (_dX > 0 && _dY > 0) { //_log.warning("Situation A-NW ("+_dX+";"+_dY+")"); if (_dX > _dY) { _dY = -1 * _dY / _dX; _dX = -1; } else { _dX = -1 * _dX / _dY; _dY = -1; } } else if (_dX > 0 && _dY < 0) { //_log.warning("Situation B-SW ("+_dX+";"+_dY+")"); if (_dX > (-1 * _dY)) { _dY = -1 * (_dY / _dX); _dX = -1; } else { _dX = _dX / _dY; _dY = 1; } } else if (_dX < 0 && _dY > 0) { //_log.warning("Situation C-NE ("+_dX+";"+_dY+")"); if ((-1 * _dX) > _dY) { _dY = _dY / _dX; _dX = 1; } else { _dX = -1 * (_dX / _dY); _dY = -1; } } else if (_dX < 0 && _dY < 0) { //_log.warning("Situation D-SE ("+_dX+";"+_dY+")"); if (_dX > _dY) { _dY = _dY / _dX; _dX = 1; } else { _dX = _dX / _dY; _dY = 1; } } else if (_dX == 0 && _dY == 0) { //_log.warning("Situation X"); _dX = -1; _dY = -1; } _deltas.put(getEffected().getObjectId(), new float[]{_dX, _dY});*/ getEffected().startFear(); onActionTime(); return true; } return false; } /** Notify exited */ @[member='override'] public void onExit() { getEffected().stopFear(this); getEffected().setTarget(null); getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); //_deltas.remove(getEffected().getObjectId()); } @[member='override'] public boolean onActionTime() { if (getEffected().getFirstEffect(getId()) == null) { onExit(); } int posX = getEffected().getX(); int posY = getEffected().getY(); int posZ = getEffected().getZ(); //float[] delta = _deltas.get(getEffected().getObjectId()); /*float _dX = -1; float _dY = -1; if (delta != null) { _dX = delta[0]; _dY = delta[1]; } //_log.warning("Start Position on Fear. X: " + posX + " Y: " + posY); if (_dX != 0) { posX += _dX * FEAR_RANGE; } if (_dY != 0) { posY += _dY * FEAR_RANGE; }*/ //_log.warning("Next Position on Fear. X: " + posX + " Y: " + posY); //Location destiny = GeoData.getInstance().moveCheck(getEffected().getX(), getEffected().getY(), getEffected().getZ(), posX, posY, posZ, getEffected().getInstanceId()); if (!(getEffected() instanceof L2PetInstance)) { getEffected().setRunning(); } switch (Rnd.get(1, 6)) { case 1: posX += 40; posY += 180; break; case 2: posX += 150; posY += 50; break; case 3: posX += 69; posY -= 100; break; case 4: posX += 10; posY -= 100; break; case 5: posX -= 150; posY -= 20; break; case 6: posX -= 100; posY += 60; break; } if (GeoData.getInstance().canSeeTarget(getEffected().getX(), getEffected().getY(), getEffected().getZ(), posX, posY, posZ)/*GeoData.getInstance().canMoveFromToTarget(getEffected().getX(), getEffected().getY(), getEffected().getZ(), posX, posY, posZ, getEffected().getInstanceId())*/) { getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new L2CharPosition(posX, posY, posZ, 0)); } // Give damage if "val" > 0 double damage = calc(); if (damage != 0) { getEffected().reduceCurrentHp(damage, getEffector(), true, true, getSkill()); } return true; } } Что тут дописывать ?
  6. drakola

    Исправить Fear

    нет тоже стоит на месте.
  7. drakola

    Исправить Fear

    я вернул. но теперь моб просто стоит на месте и не убегает от персонажа. фир проходит и моб начинает атаковать.
  8. drakola

    Исправить Fear

    || isAfraid это ? вернул. /** * Return true if the L2Character can't use its skills (ex : stun, * sleep...). */ public boolean isAllSkillsDisabled() { return _allSkillsDisabled || isStunned() || isSleeping() || isImmobileUntilAttacked() || isParalyzed() || isPetrified()|| isAfraid() ; } /** * Return true if the L2Character can't attack (stun, sleep, attackEndTime, * fakeDeath, paralyse). */ public boolean isAttackingDisabled() { return isStunned() || isSleeping() || isImmobileUntilAttacked() || isAttackingNow() || isFakeDeath() || isParalyzed() || isPetrified() || isFallsdown() || isPhysicalAttackMuted() || isCoreAIDisabled() || isAfraid(); }
  9. drakola

    Исправить Fear

    вы мне скинули эффект в нем то как раз все хорошо. а вот в L2Character.java косяк какой то.
  10. drakola

    Исправить Fear

    public void moveTo(int x, int y, int z, int offset) { moveToLocation(x, y, z, offset); } public boolean moveTo(int x, int y, int z) { return moveToLocation(x, y, z, 0); } // the CtrlEvent.EVT_ARRIVED will be sent when the character will actually arrive // to destination by GameTimeController // Send a Server->Client packet CharMoveToLocation to the actor and all L2PcInstance in its _knownPlayers broadcastPacket(new MoveToLocation(this)); protected boolean moveToLocation(int x, int y, int z, int offset) { // Get the Move Speed of the L2Charcater float speed = getStat().getMoveSpeed(); if (speed <= 0 || isMovementDisabled()) { // actionFail(); return _AIdisabled; } вот все что есть
  11. drakola

    Исправить Fear

    в том то и дело что нет ))) может это ? // Caclulate the Nb of ticks between the current position and the destination // One tick added for rounding reasons int ticksToMove = 1 + (int) ((GameTimeController.TICKS_PER_SECOND * distance) / speed); m._xDestination = x; m._yDestination = y; m._zDestination = z; // this is what was requested from client
×
×
  • Создать...