Перейти к содержимому
La2Base
Главная
ЗагрузкиВикиФорумFAQ
Поиск
ruen
Регистрация Войти
ГлавнаяФайлыВикиВойти
  • Главная
  • Загрузки
  • Вики
  • FAQ
  • Обратная связь
  • О проекте
  • Правила
  • Конфиденциальность
  • Условия использования

© 2026 la2base.com · Все права защищены

ruen
Форум/Форум для новичков[JAVA]/[question] Все Subclass у 1 Npc
Поиск

[question] Все Subclass у 1 Npc

6 ответов92 просмотровСейчас просматривают: 1
R
rast

Пользователь

Участник

Постов: 29

На форуме с: 08.04.2008

Рейтинг: 0

· 10.08.2009, 23:34

Сборка: l2jserver FINAL
Вопрос: Как реализовать получение и смену всех subclass у 1 NPC? (Обычно идёт распределение Дарк эльф/Орк/Воины/Саппорт/Маги/Гномы)
Мои соображения по этому поводу: Мне не нужно писать полный гайд что да как...
Я думаю что это в ядре где то, тока ничего там дельного не нашол, как и во всех остальных местах (БД и скриптс,квест,кустом)

0
R
rast

Пользователь

Участник

Постов: 29

На форуме с: 08.04.2008

Рейтинг: 0

· 11.08.2009, 00:10

L2_GameServer\java\net\sf\l2j\gameserver\model\actor\instanceL2VillageMasterInstance.java
Удаляем сначало

Раскрывающийся текст
/**
* If the race of your main class is Elf or Dark Elf,
* you may not select each class as a subclass to the other class.
*
* If the race of your main class is Kamael, you may not subclass any other race
* If the race of your main class is NOT Kamael, you may not subclass any Kamael class
*
* You may not select Overlord and Warsmith class as a subclass.
*
* You may not select a similar class as the subclass.
* The occupations classified as similar classes are as follows:
*
* Treasure Hunter, Plainswalker and Abyss Walker
* Hawkeye, Silver Ranger and Phantom Ranger
* Paladin, Dark Avenger, Temple Knight and Shillien Knight
* Warlocks, Elemental Summoner and Phantom Summoner
* Elder and Shillien Elder
* Swordsinger and Bladedancer
* Sorcerer, Spellsinger and Spellhowler
*
* Also, Kamael have a special, hidden 4 subclass, the inspector, which can
* only be taken if you have already completed the other two Kamael subclasses
*
*/
Set<PlayerClass> availSubs = currClass.getAvailableSubclasses(player);

if (availSubs != null && !availSubs.isEmpty())
{
for (PlayerClass availSub : availSubs)
{
for (Iterator<SubClass> subList = iterSubClasses(player); subList.hasNext();)
{
SubClass prevSubClass = subList.next();
int subClassId = prevSubClass.getClassId();
if ((subClassId >= 88 && subClassId <= 118) || (subClassId >= 131 && subClassId <= 134) || subClassId == 136)
subClassId = ClassId.values()[subClassId].getParent().getId();

if (availSub.ordinal() == subClassId
|| availSub.ordinal() == player.getBaseClass())
availSubs.remove(availSub);
}

if (npcRace == Race.Human || npcRace == Race.Elf)
{
// If the master is human or light elf, ensure that fighter-type
// masters only teach fighter classes, and priest-type masters
// only teach priest classes etc.
if (!availSub.isOfType(npcTeachType)) availSubs.remove(availSub);

// Remove any non-human or light elf classes.
else if (!availSub.isOfRace(Race.Human)
&& !availSub.isOfRace(Race.Elf)) availSubs.remove(availSub);
}
else
{
// If the master is not human and not light elf,
// then remove any classes not of the same race as the master.
if (!availSub.isOfRace(npcRace)) availSubs.remove(availSub);
}
}
}


А ниже удаляем

Раскрывающийся текст
public final ClassType getVillageMasterTeachType()
{
String npcClass = getTemplate().jClass.toLowerCase();

if (npcClass.indexOf("sanctuary") > -1 || npcClass.indexOf("clergyman") > -1)
return ClassType.Priest;

if (npcClass.indexOf("mageguild") > -1 || npcClass.indexOf("patriarch") > -1)
return ClassType.Mystic;

return ClassType.Fighter;
}

0
Anomis
Anomis

Пользователь

Ветеран

Постов: 537

На форуме с: 25.10.2007

Репутация: +208

Рейтинг: 0

· 11.08.2009, 00:13

rast: L2_GameServer\java\net\sf\l2j\gameserver\model\actor\instanceL2VillageMasterInstance.java
Удаляем сначало
Раскрывающийся текст
/**
* If the race of your main class is Elf or Dark Elf,
* you may not select each class as a subclass to the other class.
*
* If the race of your main class is Kamael, you may not subclass any other race
* If the race of your main class is NOT Kamael, you may not subclass any Kamael class
*
* You may not select Overlord and Warsmith class as a subclass.
*
* You may not select a similar class as the subclass.
* The occupations classified as similar classes are as follows:
*
* Treasure Hunter, Plainswalker and Abyss Walker
* Hawkeye, Silver Ranger and Phantom Ranger
* Paladin, Dark Avenger, Temple Knight and Shillien Knight
* Warlocks, Elemental Summoner and Phantom Summoner
* Elder and Shillien Elder
* Swordsinger and Bladedancer
* Sorcerer, Spellsinger and Spellhowler
*
* Also, Kamael have a special, hidden 4 subclass, the inspector, which can
* only be taken if you have already completed the other two Kamael subclasses
*
*/
Set<PlayerClass> availSubs = currClass.getAvailableSubclasses(player);

if (availSubs != null && !availSubs.isEmpty())
{
for (PlayerClass availSub : availSubs)
{
for (Iterator<SubClass> subList = iterSubClasses(player); subList.hasNext();)
{
SubClass prevSubClass = subList.next();
int subClassId = prevSubClass.getClassId();
if ((subClassId >= 88 && subClassId <= 118) || (subClassId >= 131 && subClassId <= 134) || subClassId == 136)
subClassId = ClassId.values()[subClassId].getParent().getId();

if (availSub.ordinal() == subClassId
|| availSub.ordinal() == player.getBaseClass())
availSubs.remove(availSub);
}

if (npcRace == Race.Human || npcRace == Race.Elf)
{
// If the master is human or light elf, ensure that fighter-type
// masters only teach fighter classes, and priest-type masters
// only teach priest classes etc.
if (!availSub.isOfType(npcTeachType)) availSubs.remove(availSub);

// Remove any non-human or light elf classes.
else if (!availSub.isOfRace(Race.Human)
&& !availSub.isOfRace(Race.Elf)) availSubs.remove(availSub);
}
else
{
// If the master is not human and not light elf,
// then remove any classes not of the same race as the master.
if (!availSub.isOfRace(npcRace)) availSubs.remove(availSub);
}
}
}


А ниже удаляем

Раскрывающийся текст
public final ClassType getVillageMasterTeachType()
{
String npcClass = getTemplate().jClass.toLowerCase();

if (npcClass.indexOf("sanctuary") > -1 || npcClass.indexOf("clergyman") > -1)
return ClassType.Priest;

if (npcClass.indexOf("mageguild") > -1 || npcClass.indexOf("patriarch") > -1)
return ClassType.Mystic;

return ClassType.Fighter;
}


и таким способом темные эльфы берут себе саб класс спеллсингер, при этом сервер не-понимает как это произошло, при этом делаеца мультискилл .

0
R
rast

Пользователь

Участник

Постов: 29

На форуме с: 08.04.2008

Рейтинг: 0

· 11.08.2009, 00:21

tanomist: и таким способом темные эльфы берут себе саб класс спеллсингер, при этом сервер не-понимает как это произошло, при этом делаеца мультискилл .

А как сделать правильно?
Кстате что плохого если на пвп серве тёмные могут брать саб светлых?
------------------------------------------------------------------------------------------
ПЕРВОЕ МОЁ СООБЩЕНИЕ
Раскрывающийся текст
rast: L2_GameServer\java\net\sf\l2j\gameserver\model\actor\instanceL2VillageMasterInstance.java
Удаляем сначало
Раскрывающийся текст
/**
* If the race of your main class is Elf or Dark Elf,
* you may not select each class as a subclass to the other class.
*
* If the race of your main class is Kamael, you may not subclass any other race
* If the race of your main class is NOT Kamael, you may not subclass any Kamael class
*
* You may not select Overlord and Warsmith class as a subclass.
*
* You may not select a similar class as the subclass.
* The occupations classified as similar classes are as follows:
*
* Treasure Hunter, Plainswalker and Abyss Walker
* Hawkeye, Silver Ranger and Phantom Ranger
* Paladin, Dark Avenger, Temple Knight and Shillien Knight
* Warlocks, Elemental Summoner and Phantom Summoner
* Elder and Shillien Elder
* Swordsinger and Bladedancer
* Sorcerer, Spellsinger and Spellhowler
*
* Also, Kamael have a special, hidden 4 subclass, the inspector, which can
* only be taken if you have already completed the other two Kamael subclasses
*
*/
Set<PlayerClass> availSubs = currClass.getAvailableSubclasses(player);

if (availSubs != null && !availSubs.isEmpty())
{
for (PlayerClass availSub : availSubs)
{
for (Iterator<SubClass> subList = iterSubClasses(player); subList.hasNext();)
{
SubClass prevSubClass = subList.next();
int subClassId = prevSubClass.getClassId();
if ((subClassId >= 88 && subClassId <= 118) || (subClassId >= 131 && subClassId <= 134) || subClassId == 136)
subClassId = ClassId.values()[subClassId].getParent().getId();

if (availSub.ordinal() == subClassId
|| availSub.ordinal() == player.getBaseClass())
availSubs.remove(availSub);
}

if (npcRace == Race.Human || npcRace == Race.Elf)
{
// If the master is human or light elf, ensure that fighter-type
// masters only teach fighter classes, and priest-type masters
// only teach priest classes etc.
if (!availSub.isOfType(npcTeachType)) availSubs.remove(availSub);

// Remove any non-human or light elf classes.
else if (!availSub.isOfRace(Race.Human)
&& !availSub.isOfRace(Race.Elf)) availSubs.remove(availSub);
}
else
{
// If the master is not human and not light elf,
// then remove any classes not of the same race as the master.
if (!availSub.isOfRace(npcRace)) availSubs.remove(availSub);
}
}
}


А ниже удаляем

Раскрывающийся текст
public final ClassType getVillageMasterTeachType()
{
String npcClass = getTemplate().jClass.toLowerCase();

if (npcClass.indexOf("sanctuary") > -1 || npcClass.indexOf("clergyman") > -1)
return ClassType.Priest;

if (npcClass.indexOf("mageguild") > -1 || npcClass.indexOf("patriarch") > -1)
return ClassType.Mystic;

return ClassType.Fighter;
}



+ забыл ещо вот это удаляем

Раскрывающийся текст
final Race npcRace = getVillageMasterRace();
final ClassType npcTeachType = getVillageMasterTeachType();

0
R
rast

Пользователь

Участник

Постов: 29

На форуме с: 08.04.2008

Рейтинг: 0

· 11.08.2009, 01:06

Всё протестированно и прекрасно работает!

0
R
rast

Пользователь

Участник

Постов: 29

На форуме с: 08.04.2008

Рейтинг: 0

· 11.08.2009, 01:44

rast: Всё протестированно и прекрасно работает!

зы, работает тока подругому чутка....

всё просто - надо использовать для компиляции eclipse
Как я написал, начинаем компилить АНТом, выводятся ошибки - ищем ключевые слова:
elf
human
и удаляем правильно все теги
от ковычки
[
[
текст скрипта так сказать, где содержаться одно из этих 2 ключевых слов
]
до ковычки
]
Компилим АНТом через eclipse - если есть ошибки, значит вы пропустили и не удалили все скрипты с этими ключевыми словами!




кароче кто не полный нуб - разбьерётся, сори я очень глупо объясняю, но я не знаю как ещо легче

tanomist: и таким способом темные эльфы берут себе саб класс спеллсингер, при этом сервер не-понимает как это произошло, при этом делаеца мультискилл .

А тебе ваще ноуреспект за дизинформацию и панику на счёт мультискилов!!! светлые на тёмных - нет ничего плохого на пвп сервере!

0
Тема закрыта для ответов