Addition of AutoLearnSkillsWithoutItems configuration.

This commit is contained in:
MobiusDevelopment
2021-11-05 08:22:05 +00:00
parent 851a4cbd88
commit 460d69f89c
153 changed files with 860 additions and 349 deletions

View File

@@ -396,7 +396,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();
@@ -420,7 +420,7 @@ public class ClassMaster extends AbstractNpcAI implements IXmlReader
}
else
{
player.giveAvailableSkills(true, true);
player.giveAvailableSkills(true, true, true);
}
break;
}
@@ -835,7 +835,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();

View File

@@ -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));
}