// 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; }
### 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)
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; }
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