Support for Vanguard Beast Points.

This commit is contained in:
MobiusDevelopment
2022-04-22 21:04:40 +00:00
parent 28f5e93ac2
commit 328d32d750
16 changed files with 202 additions and 13 deletions

View File

@@ -233,6 +233,7 @@ public class EffectMasterHandler
EffectHandler.getInstance().registerHandler("MaxHp", MaxHp::new);
EffectHandler.getInstance().registerHandler("MaxMagicCriticalRate", MaxMagicCriticalRate::new);
EffectHandler.getInstance().registerHandler("MaxMp", MaxMp::new);
EffectHandler.getInstance().registerHandler("ModifyBeastPoints", ModifyBeastPoints::new);
EffectHandler.getInstance().registerHandler("ModifyCraftPoints", ModifyCraftPoints::new);
EffectHandler.getInstance().registerHandler("ModifyDeathPoints", ModifyDeathPoints::new);
EffectHandler.getInstance().registerHandler("ModifyMagicLampPoints", ModifyMagicLampPoints::new);

View File

@@ -27,6 +27,7 @@ public class SkillConditionMasterHandler
{
public static void main(String[] args)
{
SkillConditionHandler.getInstance().registerHandler("BeastPoints", BeastPointsSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("BuildAdvanceBase", BuildAdvanceBaseSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("BuildCamp", BuildCampSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("CanAddMaxEntranceInzone", CanAddMaxEntranceInzoneSkillCondition::new);

View File

@@ -434,6 +434,17 @@ public class AdminEditChar implements IAdminCommandHandler
{
player.getAppearance().setMale();
player.disarmShield();
if (!player.isVanguard())
{
player.setVanguard(true);
}
}
else
{
if (player.isVanguard())
{
player.setVanguard(false);
}
}
final String newclass = ClassListData.getInstance().getClass(player.getClassId()).getClassName();

View File

@@ -0,0 +1,60 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package handlers.effecthandlers;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.skill.Skill;
/**
* @author Mobius
*/
public class ModifyBeastPoints extends AbstractEffect
{
private final int _amount;
public ModifyBeastPoints(StatSet params)
{
_amount = params.getInt("amount");
}
@Override
public boolean isInstant()
{
return true;
}
@Override
public void instant(Creature effector, Creature effected, Skill skill, Item item)
{
if (effected == null)
{
return;
}
final Player player = effected.getActingPlayer();
if (player == null)
{
return;
}
player.setBeastPoints(player.getBeastPoints() + _amount);
}
}

View File

@@ -0,0 +1,42 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package handlers.skillconditionhandlers;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.skill.ISkillCondition;
import org.l2jmobius.gameserver.model.skill.Skill;
/**
* @author Mobius
*/
public class BeastPointsSkillCondition implements ISkillCondition
{
private final int _amount;
public BeastPointsSkillCondition(StatSet params)
{
_amount = params.getInt("amount");
}
@Override
public boolean canUse(Creature caster, Skill skill, WorldObject target)
{
return caster.getActingPlayer().getBeastPoints() >= _amount;
}
}

View File

@@ -17,8 +17,6 @@
package quests.Q10950_FiercestFlame;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.data.xml.CategoryData;
import org.l2jmobius.gameserver.enums.CategoryType;
import org.l2jmobius.gameserver.enums.Race;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.Player;
@@ -235,7 +233,7 @@ public class Q10950_FiercestFlame extends Quest
return;
}
if ((player.getRace() != Race.ORC) || CategoryData.getInstance().isInCategory(CategoryType.VANGUARD_ALL_CLASS, player.getClassId().getId()))
if ((player.getRace() != Race.ORC) || player.isVanguard())
{
return;
}

View File

@@ -17,8 +17,6 @@
package quests.Q10951_NewFlameOfOrcs;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.data.xml.CategoryData;
import org.l2jmobius.gameserver.enums.CategoryType;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.events.EventType;
@@ -145,7 +143,7 @@ public class Q10951_NewFlameOfOrcs extends Quest
@Override
public String onTalk(Npc npc, Player player)
{
if (!CategoryData.getInstance().isInCategory(CategoryType.VANGUARD_ALL_CLASS, player.getClassId().getId()))
if (!player.isVanguard())
{
return "no_race.html";
}
@@ -234,7 +232,7 @@ public class Q10951_NewFlameOfOrcs extends Quest
return;
}
if (!CategoryData.getInstance().isInCategory(CategoryType.VANGUARD_ALL_CLASS, player.getClassId().getId()))
if (!player.isVanguard())
{
return;
}

View File

@@ -203,6 +203,7 @@ MaxCp: Max. CP stat.
MaxHp: Max. HP stat.
MaxMagicCriticalRate: Stat that overrides the default config MAX_MCRIT_RATE. (l2jmobius)
MaxMp: Max. MP stat.
ModifyBeastPoints: Modifies player Beast Point count. (l2jmobius)
ModifyCraftPoints: Modifies player Craft Point count. (l2jmobius)
ModifyDeathPoints: Modifies player Death Point count. (l2jmobius)
ModifyMagicLampPoints: Modifies player MagicLamp point count. (l2jmobius)