Addition of AutoLearnSkillsWithoutItems configuration.
This commit is contained in:
		@@ -368,7 +368,7 @@ public class ClassMaster extends AbstractNpcAI implements IXmlReader
 | 
			
		||||
					}
 | 
			
		||||
					if (Config.AUTO_LEARN_SKILLS)
 | 
			
		||||
					{
 | 
			
		||||
						player.giveAvailableSkills(Config.AUTO_LEARN_FS_SKILLS, true);
 | 
			
		||||
						player.giveAvailableSkills(Config.AUTO_LEARN_FS_SKILLS, true, Config.AUTO_LEARN_SKILLS_WITHOUT_ITEMS);
 | 
			
		||||
					}
 | 
			
		||||
					player.store(false); // Save player cause if server crashes before this char is saved, he will lose class and the money payed for class change.
 | 
			
		||||
					player.broadcastUserInfo();
 | 
			
		||||
@@ -385,7 +385,7 @@ public class ClassMaster extends AbstractNpcAI implements IXmlReader
 | 
			
		||||
			}
 | 
			
		||||
			case "learnskills":
 | 
			
		||||
			{
 | 
			
		||||
				player.giveAvailableSkills(true, true);
 | 
			
		||||
				player.giveAvailableSkills(true, true, true);
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
			case "clanlevelup":
 | 
			
		||||
@@ -762,7 +762,7 @@ public class ClassMaster extends AbstractNpcAI implements IXmlReader
 | 
			
		||||
			}
 | 
			
		||||
			if (Config.AUTO_LEARN_SKILLS)
 | 
			
		||||
			{
 | 
			
		||||
				player.giveAvailableSkills(Config.AUTO_LEARN_FS_SKILLS, true);
 | 
			
		||||
				player.giveAvailableSkills(Config.AUTO_LEARN_FS_SKILLS, true, Config.AUTO_LEARN_SKILLS_WITHOUT_ITEMS);
 | 
			
		||||
			}
 | 
			
		||||
			player.store(false); // Save player cause if server crashes before this char is saved, he will lose class and the money payed for class change.
 | 
			
		||||
			player.broadcastUserInfo();
 | 
			
		||||
 
 | 
			
		||||
@@ -156,11 +156,11 @@ public class AdminSkill implements IAdminCommandHandler
 | 
			
		||||
		}
 | 
			
		||||
		else if (command.equals("admin_give_all_skills"))
 | 
			
		||||
		{
 | 
			
		||||
			adminGiveAllSkills(activeChar, false);
 | 
			
		||||
			adminGiveAllSkills(activeChar, false, false);
 | 
			
		||||
		}
 | 
			
		||||
		else if (command.equals("admin_give_all_skills_fs"))
 | 
			
		||||
		{
 | 
			
		||||
			adminGiveAllSkills(activeChar, true);
 | 
			
		||||
			adminGiveAllSkills(activeChar, true, true);
 | 
			
		||||
		}
 | 
			
		||||
		else if (command.equals("admin_give_clan_skills"))
 | 
			
		||||
		{
 | 
			
		||||
@@ -277,9 +277,10 @@ public class AdminSkill implements IAdminCommandHandler
 | 
			
		||||
	/**
 | 
			
		||||
	 * This function will give all the skills that the target can learn at his/her level
 | 
			
		||||
	 * @param activeChar the player
 | 
			
		||||
	 * @param includedByFs if {@code true} Forgotten Scroll skills will be delivered.
 | 
			
		||||
	 * @param includeByFs if {@code true} Forgotten Scroll skills will be delivered.
 | 
			
		||||
	 * @param includeRequiredItems if {@code true} skills that have required items will be added
 | 
			
		||||
	 */
 | 
			
		||||
	private void adminGiveAllSkills(PlayerInstance activeChar, boolean includedByFs)
 | 
			
		||||
	private void adminGiveAllSkills(PlayerInstance activeChar, boolean includeByFs, boolean includeRequiredItems)
 | 
			
		||||
	{
 | 
			
		||||
		final WorldObject target = activeChar.getTarget();
 | 
			
		||||
		if ((target == null) || !target.isPlayer())
 | 
			
		||||
@@ -289,7 +290,7 @@ public class AdminSkill implements IAdminCommandHandler
 | 
			
		||||
		}
 | 
			
		||||
		final PlayerInstance player = target.getActingPlayer();
 | 
			
		||||
		// Notify player and admin
 | 
			
		||||
		BuilderUtil.sendSysMessage(activeChar, "You gave " + player.giveAvailableSkills(includedByFs, true) + " skills to " + player.getName());
 | 
			
		||||
		BuilderUtil.sendSysMessage(activeChar, "You gave " + player.giveAvailableSkills(includeByFs, true, includeRequiredItems) + " skills to " + player.getName());
 | 
			
		||||
		player.sendSkillList();
 | 
			
		||||
		player.sendPacket(new AcquireSkillList(player));
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user