Page 1 of 1

Subclass Stuck Solution

Posted: Wed Nov 17, 2010 12:01 am
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;            }

Re: Subclass Stuck Solution

Posted: Wed Nov 17, 2010 1:08 am
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

Re: Subclass Stuck Solution

Posted: Wed Nov 17, 2010 1:24 am
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

Re: Subclass Stuck Solution

Posted: Wed Nov 17, 2010 1:38 am
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.

Re: Subclass Stuck Solution

Posted: Wed Nov 17, 2010 1:45 am
by hiroshima
Thanks :))))