Hey i followed a guide here that showed how to make all subs available in one npc i made the following changes but there is a problem :D When you press Add a subclass it gives the full sub class list but you can add classes that are available retail like in the Npc For Example Master Jurek where you can add mage classes does not allow you to become a gladiator and pops up the subclass error ( Mimir's Elixir etc)
Also when i want to change into another subclass the Npc only desplays classes that are available only at that kind of Npc I wanna make it like that: When you want to add a class you can add everything from one single NpC except ( dominator and the dwarf class )
and also at the same Npc to be able to change in whatever subclass you like
Changes i made in L2VillageMasterInstance.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, and 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
*/
Set<PlayerClass> availSubs = PlayerClass.values()[baseClassId].getAvailableSubclasses(player);
if (availSubs != null)
{
for (PlayerClass availSub : availSubs)
{
for (Iterator<SubClass> subList = iterSubClasses(player); subList.hasNext();)
{
SubClass prevSubClass = subList.next();
int subClassId = prevSubClass.getClassId();
if (subClassId >= 88) subClassId = ClassId.values()[subClassId].getParent().getId();
if (availSub.ordinal() == subClassId
|| availSub.ordinal() == player.getBaseClass())
availSubs.remove(PlayerClass.values()[availSub.ordinal()]);
}
}
}
return availSubs;
}
/*
* Check new subclass classId for validity (villagemaster race/type is not contains in previous subclasses, but in allowed subclasses) Base class not added into allowed subclasses.
*/
private final boolean isValidNewSubClass(L2PcInstance player, int classId)
{
if (!checkVillageMaster(classId))
return false;
final ClassId cid = ClassId.values()[classId];
for (Iterator<SubClass> subList = iterSubClasses(player); subList.hasNext();)
{
SubClass sub = subList.next();
ClassId subClassId = ClassId.values()[sub.getClassId()];
if (subClassId.equalsOrChildOf(cid))
return false;
}
The heavy lifting is done in the client, because while you can get away with small imperfections in the java, everything in the client must be impecable.
So, if you haven't touched the client, I'd say pick the newest protocol version you can find the client editing tools and Interface.u (mandatory) / NWindow.dll (better to have it) / Engine.dll (optional) sources for.
At the very least, you need the Interface.u to fix the Clan Window and enable skill enchanting on Classic/Essence versions, if you decide to use one of them instead of MAIN/LIVE.
Thanks for clarification. Do you think the newest clients offer solid advantages compared to the classic ones like Salvation?
I'm also in the process of porting h5 to one of them just for the sake of it, so I was wondering if I should just attempt to go to the newest possible.
Upgrading to Salvation is exactly the same as upgrading to the newest client with the only difference being access to free-shared client editing tools and resources.
I am speaking from experience. I have upgraded my HF source to one of the newest clients by myself (in terms of server side. got help with the client) and hit every single wall there was in the process.
Now, I already have several multi-protocool server cores so I can easily compare different approaches to tackling the same issue, which also helped the learning process.
Best way to learn would be to use this one (link below) to snoop around and figure out what has been changed in the server side (the packet structure will be different, for sure, but works for understanding/figuring the process out in general terms).
https://github.com/iBezneR/L2J_SunriseProject_Purity
The client side will always be the same, always the same files, only the DAT structure will be different. I personally wrote myself some parsers for the data of the DAT files from OLD -> NEW client.
I guess if you want to learn the whole process, your best bet is to start with a classic client (like salvation? also must be easy to modify so that you don't get stuck behind paywalls) and check how the network communication is implemented. L2jmobius has a lot of sources that use classic clients.
Question
mikemaster
Hey i followed a guide here that showed how to make all subs available in one npc i made the following changes but there is a problem :D
When you press Add a subclass it gives the full sub class list but you can add classes that are available retail like in the Npc
For Example Master Jurek where you can add mage classes does not allow you to become a gladiator and pops up the subclass error ( Mimir's Elixir etc)
Also when i want to change into another subclass the Npc only desplays classes that are available only at that kind of Npc
I wanna make it like that: When you want to add a class you can add everything from one single NpC except ( dominator and the dwarf class )
and also at the same Npc to be able to change in whatever subclass you like
Changes i made in L2VillageMasterInstance.java:
Link to comment
Share on other sites
6 answers to this question
Recommended Posts