drakola 10 Posted April 14, 2017 Да я вернул. но теперь моб просто стоит на месте и не убегает от персонажа. фир проходит и моб начинает атаковать. Share this post Link to post Share on other sites
zGosu 397 Posted April 14, 2017 я вернул. но теперь моб просто стоит на месте и не убегает от персонажа. фир проходит и моб начинает атаковать. А если игрока в фир кинуть, он побежит? Share this post Link to post Share on other sites
drakola 10 Posted April 14, 2017 А если игрока в фир кинуть, он побежит? нет тоже стоит на месте. Share this post Link to post Share on other sites
zGosu 397 Posted April 14, 2017 нет тоже стоит на месте. Значит в эффект дописывай метод на передвижение (пример я скинул в файле) и всё Share this post Link to post Share on other sites
drakola 10 Posted April 14, 2017 Значит в эффект дописывай метод на передвижение (пример я скинул в файле) и всё /* * 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; } } Что тут дописывать ? Share this post Link to post Share on other sites
ffffffffffffffffff 643 Posted April 14, 2017 Что тут дописывать ? Вы издеваетесь? Если у вас нет знаний, платите за фиксы. За вас никто бесплатно делать не будет. Вам дали 100 наводок, а вы спрашиваете "Что тут фиксить?", "А тут что делать?", "А как это делать?" Зачем вы вообще взялись за исходники?Если у вас нет знаний java, то не нужно морочить себе и другим голову. Как говорится не умеешь ходить в туалет, не мучай заднее место. 1 Share this post Link to post Share on other sites
zGosu 397 Posted April 14, 2017 (edited) /* * 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; } } Что тут дописывать ? Повторяю фикс: private void fearAction(BuffInfo info, boolean start) { double radians = Math.toRadians(start ? Util.calculateAngleFrom(info.getEffector(), info.getEffected()) : Util.convertHeadingToDegree(info.getEffected().getHeading())); int posX = (int) (info.getEffected().getX() + (FEAR_RANGE * Math.cos(radians))); int posY = (int) (info.getEffected().getY() + (FEAR_RANGE * Math.sin(radians))); int posZ = info.getEffected().getZ(); if (!info.getEffected().isPet()) { info.getEffected().setRunning(); } // If pathfinding enabled the creature will go to the defined destination (retail like). // Otherwise it will go to the nearest obstacle. final Location destination; if (Config.PATHFINDING > 0) { destination = GeoData.getInstance().moveCheck(info.getEffected().getX(), info.getEffected().getY(), info.getEffected().getZ(), posX, posY, posZ, info.getEffected().getInstanceId()); } else { destination = new Location(posX, posY, posZ, info.getEffected().getInstanceId()); } info.getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);} Edited April 14, 2017 by zGosu Share this post Link to post Share on other sites
drakola 10 Posted April 14, 2017 Повторяю фикс: private void fearAction(BuffInfo info, boolean start) { double radians = Math.toRadians(start ? Util.calculateAngleFrom(info.getEffector(), info.getEffected()) : Util.convertHeadingToDegree(info.getEffected().getHeading())); int posX = (int) (info.getEffected().getX() + (FEAR_RANGE * Math.cos(radians))); int posY = (int) (info.getEffected().getY() + (FEAR_RANGE * Math.sin(radians))); int posZ = info.getEffected().getZ(); if (!info.getEffected().isPet()) { info.getEffected().setRunning(); } // If pathfinding enabled the creature will go to the defined destination (retail like). // Otherwise it will go to the nearest obstacle. final Location destination; if (Config.PATHFINDING > 0) { destination = GeoData.getInstance().moveCheck(info.getEffected().getX(), info.getEffected().getY(), info.getEffected().getZ(), posX, posY, posZ, info.getEffected().getInstanceId()); } else { destination = new Location(posX, posY, posZ, info.getEffected().getInstanceId()); } info.getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);} так по него еще надо дописывать класс Share this post Link to post Share on other sites
ffffffffffffffffff 643 Posted April 14, 2017 так по него еще надо дописывать класс Ты можешь только ставить "ПАЛЬЧИК ВНИЗ" и больше ничего. А правда глаза режет? 1 Share this post Link to post Share on other sites
zGosu 397 Posted April 14, 2017 так по него еще надо дописывать класс никакого нового класса делать не надо. ctrl+c ctr+v (то что внутри метода) и всё. Пример есть. Осталось только подставить. Share this post Link to post Share on other sites
drakola 10 Posted April 16, 2017 никакого нового класса делать не надо. ctrl+c ctr+v (то что внутри метода) и всё. Пример есть. Осталось только подставить. ставлю и у меня прут ошибки Share this post Link to post Share on other sites
drakola 10 Posted April 16, 2017 Ты можешь только ставить "ПАЛЬЧИК ВНИЗ" и больше ничего. А правда глаза режет? не пиши тут если нет желания помогать. Share this post Link to post Share on other sites
zGosu 397 Posted April 16, 2017 ставлю и у меня прут ошибки Естественно. Я же скинул код от лыжы, а у Вас ИТ (вроде бы). Но прикол в том, что язык одинаковый и алгоритм работы программы одинаковый. Скорей всего там ошибки рода (метод не найден) или (тип данных не совпадает). Всё исправляется простой заменой на свои методы и классы (уже имеющиеся в сборке, а не создание новых), ну и импортов. Просто уже какой день Вы не можете решить эту элементарную проблему. Заплатите кому-то уже 100р., что бы он за Вас вставил нужный код и всё. (такой сборкой как у Вас мало кто пользуется.... не сложно догадаться почему). У вас просто остается 2 варианта: 1) не страдать фигней и с помощью "поиска в Интернете" иправить баг 2) нанять разработчика, который за "пиво" будет писать Вам код. Надеюсь, что у Вас всё получиться) 1 Share this post Link to post Share on other sites
drakola 10 Posted April 17, 2017 Естественно. Я же скинул код от лыжы, а у Вас ИТ (вроде бы). Но прикол в том, что язык одинаковый и алгоритм работы программы одинаковый. Скорей всего там ошибки рода (метод не найден) или (тип данных не совпадает). Всё исправляется простой заменой на свои методы и классы (уже имеющиеся в сборке, а не создание новых), ну и импортов. Просто уже какой день Вы не можете решить эту элементарную проблему. Заплатите кому-то уже 100р., что бы он за Вас вставил нужный код и всё. (такой сборкой как у Вас мало кто пользуется.... не сложно догадаться почему). У вас просто остается 2 варианта: 1) не страдать фигней и с помощью "поиска в Интернете" иправить баг 2) нанять разработчика, который за "пиво" будет писать Вам код. Надеюсь, что у Вас всё получиться) вы мне сможете помочь за 2 вариант ? Share this post Link to post Share on other sites
zGosu 397 Posted April 17, 2017 вы мне сможете помочь за 2 вариант ? Да Share this post Link to post Share on other sites
drakola 10 Posted April 17, 2017 Да хорошо. я как буду свободен я вам напишу в лк Share this post Link to post Share on other sites