Jump to content
  • 0

All Subs In One Npc


mikemaster

Question

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;
		}
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

All you have to change is this.. Like this, I have created a config for myself.

 

 

    /*
     * Returns true if this PlayerClass is allowed for master
     */
    public final boolean checkVillageMaster(PlayerClass pclass)
    {
        if (Config.ALT_GAME_SUBCLASS_EVERYWHERE)
            return true;
        
        return checkVillageMasterRace(pclass) && checkVillageMasterTeachType(pclass);
    }
Link to comment
Share on other sites

  • 0

 

All you have to change is this.. Like this, I have created a config for myself.

    /*
     * Returns true if this PlayerClass is allowed for master
     */
    public final boolean checkVillageMaster(PlayerClass pclass)
    {
        if (Config.ALT_GAME_SUBCLASS_EVERYWHERE)
            return true;
        
        return checkVillageMasterRace(pclass) && checkVillageMasterTeachType(pclass);
    }

so do i have to revert the changes that i already made and simply create a config that suits with this code that you gave me? :D

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore1 Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11
    • L2 ArenaWar: Low Rate PvP Server with Free Buffs & Autofarm [PVP]⚔️ [Free]🆓 Classic Interlude with  3x XP rates! Free starter pack(no grade) to kickstart your adventure! Autofarm for convenient grinding! Free buffs to keep you fighting fit! (2 job buffs) No experience loss on death! (Except with Karma) Clear Karma system to keep things fair! ⚖️ Active community of 800-1k players! Join our Discord to learn more! >> Discord <<     Server website: https://l2arenawar.com/en/    
    • This is dedication! 2 years working on a problem. Congratulations!
    • You indeed have to save player position over Enterworld to properly clean it up later (if you don't, even trying to delete packet content would eventually keep it up), that's what we do with debug packet (which is a reusable Map of ExServerPrimitive packets) on aCis.   It doesn't solve the FPS stuttering - more you draw/delete lines, more your client becomes laggy. It's like if client wasn't deleting drawn points/lines properly, but instead simply hide them and redrawn content above.   If you got a solution, I would happy to integrate it.   You should check aCis#Player _debug packet integration, it allows very big amount of lines/points to be drawn, it is also reusable.   https://gitlab.com/Tryskell/acis_public/-/blob/master/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/Player.java?ref_type=heads https://gitlab.com/Tryskell/acis_public/-/blob/master/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java?ref_type=heads  
    • we sell website templates, make websites to order. Great selection at very good prices. My contacts discord : advert1231 telegram : https://t.me/ggwpins  
  • Topics

×
×
  • Create New...