Рейтинг темы:
  • 0 Голос(ов) - 0 в среднем
  • 1
  • 2
  • 3
  • 4
  • 5
NEW_SKILL_TYPE
#1
Сделал новый скил, который можно кастовать только на мобов.
[SRC="xml"] <skill id="77" levels="7" name="Мобонюк">
<table name="#mpConsume"> 50 100 150 200 250 300 350 </table>
<table name="#magicLvl"> 30 40 50 60 70 80 85 </table>
<table name="#power"> 200 300 400 500 600 700 700 </table>
<set name="mpConsume" val="#mpConsume" />
<set name="magicLvl" val="#magicLvl" />
<set name="power" val="#power" />
<set name="target" val="TARGET_ONE_MOB" />
<set name="reuseDelay" val="6000" />
<set name="hitTime" val="4000" />
<set name="skillType" val="MDAM" />
<set name="isMagic" val="1" /> <!-- Magic Skill -->
<set name="operateType" val="A1" />
<set name="castRange" val="750" />
<set name="effectRange" val="1000" />
</skill>[/SRC]
Targethandlers:[SRC="java"]/*
* 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 handlers.targethandlers;

import java.util.List;

import javolution.util.FastList;

import com.l2jserver.Config;
import com.l2jserver.gameserver.handler.ITargetTypeHandler;
import com.l2jserver.gameserver.model.L2Object;
import com.l2jserver.gameserver.model.actor.L2Attackable;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.instance.L2ServitorInstance;
import com.l2jserver.gameserver.model.skills.L2Skill;
import com.l2jserver.gameserver.model.skills.targets.L2TargetType;
import com.l2jserver.gameserver.network.SystemMessageId;

/**
* @author UnAfraid
*/
public class TargetOneMob implements ITargetTypeHandler
{
@Override
public L2Object[] getTargetList(L2Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target)
{
List<L2Character> targetList = new FastList<>();
if (target != null && !target.isDead() && target instanceof L2MonsterInstance)
return new L2Character[] { target };

return _emptyTargetList;
}

@Override
public Enum<L2TargetType> getTargetType()
{
return L2TargetType.TARGET_ONE_MOB;
}
}
[/SRC]
Но скилл не кастуется, [Изображение: 21:34:12_aa766409.png]
В чем ошибка?

Добавлено через 8 минут
в L2TargetType.java добавил.
Ответ
#2
в TargetHandler не зарегал
Человек просто обязан ошибаться, раз другие учатся на его ошибках .......
Ответ
#3
не проще использовать обычный таргет, и добавить кондишн?
Ответ
#4
кондишн свой писать или существует такой уже?
Ответ
#5
http://trac.l2jserver.com/browser/branch...conditions
Использовать можно например ConditionTargetNpcType
Ответ
#6
L2J Написал:Targethandlers:[SRC="java"]/*
* 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 handlers.targethandlers;

import java.util.List;

import javolution.util.FastList;

import com.l2jserver.Config;
import com.l2jserver.gameserver.handler.ITargetTypeHandler;
import com.l2jserver.gameserver.model.L2Object;
import com.l2jserver.gameserver.model.actor.L2Attackable;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.instance.L2ServitorInstance;
import com.l2jserver.gameserver.model.skills.L2Skill;
import com.l2jserver.gameserver.model.skills.targets.L2TargetType;
import com.l2jserver.gameserver.network.SystemMessageId;

/**
* @author UnAfraid
*/
public class TargetOneMob implements ITargetTypeHandler
{
@Override
public L2Object[] getTargetList(L2Skill skill, L2Character activeChar, boolean onlyFirst, L2Character target)
{
List<L2Character> targetList = new FastList<>();
if (target != null && !target.isDead() && target instanceof L2MonsterInstance)
return new L2Character[] { target };

return _emptyTargetList;
}

@Override
public Enum<L2TargetType> getTargetType()
{
return L2TargetType.TARGET_ONE_MOB;
}
}
[/SRC]
Один я не понимаю что тут написано? Оо
Ответ
#7
kingzor, а что здесь непонятного?! Говнокод, как говнокод :confused:
Fortuna - non penis, in manus non recipe.
Ответ


Перейти к форуму:


Пользователи, просматривающие эту тему: 3 Гость(ей)