Subclass Stuck Solution

Find the proper support area, Saga-Version.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
hiroshima
Posts: 107
Joined: Tue Nov 03, 2009 1:28 pm

Subclass Stuck Solution

Post by hiroshima »

Well, i added to GrandMaster's core side files thing like:
dont allow to change/create/delete subclass if in combat mode
to protect subclass stucking... floodprotection is also enabled but...

they make it in party... can someone give me code to:
dont allow to change/create/delete subclass if in party
?

i`ll be thanksful :))

Code: Select all

            // Subclasses may not be changed while a skill is in use.            if (player.isCastingNow() || player.isAllSkillsDisabled() || AttackStanceTaskManager.getInstance().getAttackStanceTask(player))            {                player.sendPacket(new SystemMessage(SystemMessageId.SUBCLASS_NO_CHANGE_OR_CREATE_WHILE_SKILL_IN_USE));                return;            }                                     NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());             if (player.getTransformation() != null)            {                html.setFile(player.getHtmlPrefix(), "data/html/villagemaster/SubClass_NoTransformed.htm");                player.sendPacket(html);                return;            }
User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 7008
Joined: Tue Aug 11, 2009 3:36 am

Re: Subclass Stuck Solution

Post by Zoey76 »

Use this code to avoid subclass change while player is in combat or party. :P

Code: Select all

### by Zoey76#P L2_GameServerIndex: java/com/l2jserver/gameserver/model/actor/instance/L2VillageMasterInstance.java===================================================================--- java/com/l2jserver/gameserver/model/actor/instance/L2VillageMasterInstance.java (revision 4411)+++ java/com/l2jserver/gameserver/model/actor/instance/L2VillageMasterInstance.java (working copy)@@ -180,7 +180,19 @@                player.sendPacket(new SystemMessage(SystemMessageId.SUBCLASS_NO_CHANGE_OR_CREATE_WHILE_SKILL_IN_USE));                return;            }-+           +           if (player.isInCombat())+           {+               player.sendMessage("Sub classes may not be created or changed while in combat.");+               return;+           }+           +           if (player.getParty() != null)+           {+               player.sendMessage("Sub classes may not be created or changed while in party.");+               return;+           }+                       NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());             if (player.getTransformation() != null) 
http://pastebin.ca/1994006
Powered by Eclipse 4.34 🌌 | Eclipse Temurin 21 ☕ | MariaDB 11.3.2 🗃️ | L2J Server 2.6.3.0 - High Five 🚀

🔗 Join our Discord! 🎮💬
hiroshima
Posts: 107
Joined: Tue Nov 03, 2009 1:28 pm

Re: Subclass Stuck Solution

Post by hiroshima »

ok i`ll use yours but i am wondering:

Code: Select all

        else if (command.startsWith("Subclass"))        {            // Subclasses may not be changed while a skill is in use.            if (player.isCastingNow() || player.isAllSkillsDisabled() || AttackStanceTaskManager.getInstance().getAttackStanceTask(player))            {                player.sendPacket(SystemMessage.sendString("You are in combat mode!"));                return;            }                        if (!player.isInParty())            {                player.sendPacket(SystemMessage.sendString("Try again without party!"));                return;            }
i made it like this: its okey ? ;P
User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 7008
Joined: Tue Aug 11, 2009 3:36 am

Re: Subclass Stuck Solution

Post by Zoey76 »

hiroshima wrote:ok i`ll use yours but i am wondering
i made it like this: its okey ? ;P
Well you can use player.isInParty() instead of (player.getParty() != null)
But player.isInParty() not !player.isInParty() otherwise he wouldn't be able to change/add a sub if is not in party.
Powered by Eclipse 4.34 🌌 | Eclipse Temurin 21 ☕ | MariaDB 11.3.2 🗃️ | L2J Server 2.6.3.0 - High Five 🚀

🔗 Join our Discord! 🎮💬
hiroshima
Posts: 107
Joined: Tue Nov 03, 2009 1:28 pm

Re: Subclass Stuck Solution

Post by hiroshima »

Thanks :))))
Post Reply