Free version update 14-12-2023.

This commit is contained in:
MobiusDevelopment
2023-12-14 02:11:28 +02:00
parent 6a0a4be1ea
commit 1204ad8e00
6352 changed files with 98838 additions and 68045 deletions

View File

@@ -37,6 +37,7 @@ import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.actor.Summon;
import org.l2jmobius.gameserver.model.actor.instance.Door;
import org.l2jmobius.gameserver.model.events.EventType;
import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent;
import org.l2jmobius.gameserver.model.events.impl.creature.OnCreatureDeath;
@@ -254,6 +255,8 @@ public class TvT extends Event
final InstanceManager manager = InstanceManager.getInstance();
final InstanceTemplate template = manager.getInstanceTemplate(INSTANCE_ID);
PVP_WORLD = manager.createInstance(template, null);
// Make sure doors are closed.
PVP_WORLD.getDoors().forEach(Door::closeMe);
// Randomize player list and separate teams.
final List<Player> playerList = new ArrayList<>(PLAYER_LIST.size());
playerList.addAll(PLAYER_LIST);

View File

@@ -41,6 +41,8 @@ public class EffectMasterHandler
EffectHandler.getInstance().registerHandler("AdditionalPotionHp", AdditionalPotionHp::new);
EffectHandler.getInstance().registerHandler("AdditionalPotionMp", AdditionalPotionMp::new);
EffectHandler.getInstance().registerHandler("AddPcCafePoints", AddPcCafePoints::new);
EffectHandler.getInstance().registerHandler("AddMaxPhysicalCriticalRate", AddMaxPhysicalCriticalRate::new);
EffectHandler.getInstance().registerHandler("AddMaxMagicCriticalRate", AddMaxMagicCriticalRate::new);
EffectHandler.getInstance().registerHandler("AddSkillBySkill", AddSkillBySkill::new);
EffectHandler.getInstance().registerHandler("AddTeleportBookmarkSlot", AddTeleportBookmarkSlot::new);
EffectHandler.getInstance().registerHandler("AirBind", AirBind::new);
@@ -225,7 +227,6 @@ public class EffectMasterHandler
EffectHandler.getInstance().registerHandler("MAtk", MAtk::new);
EffectHandler.getInstance().registerHandler("MaxCp", MaxCp::new);
EffectHandler.getInstance().registerHandler("MaxHp", MaxHp::new);
EffectHandler.getInstance().registerHandler("MaxMagicCriticalRate", MaxMagicCriticalRate::new);
EffectHandler.getInstance().registerHandler("MaxMp", MaxMp::new);
EffectHandler.getInstance().registerHandler("ModifyVital", ModifyVital::new);
EffectHandler.getInstance().registerHandler("Mp", Mp::new);

View File

@@ -1,31 +1,31 @@
/*
* 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.stats.Stat;
/**
* @author Mobius
*/
public class MaxMagicCriticalRate extends AbstractStatEffect
{
public MaxMagicCriticalRate(StatSet params)
{
super(params, Stat.MAX_MAGIC_CRITICAL_RATE);
}
}
/*
* 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.stats.Stat;
/**
* @author fruit
*/
public class AddMaxMagicCriticalRate extends AbstractStatEffect
{
public AddMaxMagicCriticalRate(StatSet params)
{
super(params, Stat.ADD_MAX_MAGIC_CRITICAL_RATE);
}
}

View File

@@ -0,0 +1,31 @@
/*
* 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.stats.Stat;
/**
* @author fruit
*/
public class AddMaxPhysicalCriticalRate extends AbstractStatEffect
{
public AddMaxPhysicalCriticalRate(StatSet params)
{
super(params, Stat.ADD_MAX_PHYSICAL_CRITICAL_RATE);
}
}

View File

@@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.model.StatSet;
@@ -26,6 +27,7 @@ import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.skill.BuffInfo;
import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.model.skill.SkillCaster;
import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
/**
* Call Skill effect implementation.
@@ -58,7 +60,7 @@ public class CallSkill extends AbstractEffect
return;
}
Skill triggerSkill = null;
final Skill triggerSkill;
if (_skillLevelScaleTo <= 0)
{
// Mobius: Use 0 to trigger max effector learned skill level.
@@ -72,6 +74,7 @@ public class CallSkill extends AbstractEffect
else
{
LOGGER.warning("Player " + effector + " called unknown skill " + _skill + " triggered by " + skill + " CallSkill.");
return;
}
}
else
@@ -100,7 +103,21 @@ public class CallSkill extends AbstractEffect
return;
}
SkillCaster.triggerCast(effector, effected, triggerSkill);
final int hitTime = triggerSkill.getHitTime();
if (hitTime > 0)
{
if (effector.isSkillDisabled(triggerSkill))
{
return;
}
effector.broadcastPacket(new MagicSkillUse(effector, effected, triggerSkill.getDisplayId(), triggerSkill.getLevel(), hitTime, 0));
ThreadPool.schedule(() -> SkillCaster.triggerCast(effector, effected, triggerSkill), hitTime);
}
else
{
SkillCaster.triggerCast(effector, effected, triggerSkill);
}
}
else
{

View File

@@ -182,6 +182,11 @@ public class TriggerSkillByAttack extends AbstractEffect
else
{
triggerSkill = SkillData.getInstance().getSkill(_skill.getSkillId(), Math.min(_skillLevelScaleTo, buffInfo.getSkill().getLevel() + 1));
if (event.getAttacker().isSkillDisabled(buffInfo.getSkill()))
{
return;
}
}
if ((buffInfo == null) || (buffInfo.getSkill().getLevel() < triggerSkill.getLevel()))

View File

@@ -124,6 +124,15 @@ public class TriggerSkillBySkill extends AbstractEffect
if (buffInfo != null)
{
triggerSkill = SkillData.getInstance().getSkill(_skill.getSkillId(), Math.min(_skillLevelScaleTo, buffInfo.getSkill().getLevel() + 1));
if (event.getCaster().isSkillDisabled(buffInfo.getSkill()))
{
if ((_replace) && (buffInfo.getSkill().getLevel() == _skillLevelScaleTo))
{
((Creature) target).stopSkillEffects(SkillFinishType.SILENT, triggerSkill.getId());
}
return;
}
}
else
{

View File

@@ -16,39 +16,55 @@
*/
package handlers.playeractions;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.handler.IPlayerActionHandler;
import org.l2jmobius.gameserver.model.ActionDataHolder;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.actor.instance.Pet;
import org.l2jmobius.gameserver.network.SystemMessageId;
/**
* Pet attack player action handler.
* @author Nik
* @author Mobius
*/
public class PetAttack implements IPlayerActionHandler
{
@Override
public void useAction(Player player, ActionDataHolder data, boolean ctrlPressed, boolean shiftPressed)
{
if ((player.getPet() == null) || !player.getPet().isPet())
final Pet pet = player.getPet();
if ((pet == null) || !pet.isPet())
{
player.sendPacket(SystemMessageId.YOU_DO_NOT_HAVE_A_PET);
return;
}
final Pet pet = player.getPet();
if (pet.isUncontrollable())
{
player.sendPacket(SystemMessageId.WHEN_YOUR_PET_S_HUNGER_GAUGE_IS_AT_0_YOU_CANNOT_USE_YOUR_PET);
return;
}
else if (pet.isBetrayed())
if (pet.isBetrayed())
{
player.sendPacket(SystemMessageId.YOUR_SERVITOR_IS_UNRESPONSIVE_AND_WILL_NOT_OBEY_ANY_ORDERS);
return;
}
else if (pet.canAttack(player.getTarget(), ctrlPressed))
final WorldObject target = player.getTarget();
if (target == null)
{
pet.doAttack(player.getTarget());
return;
}
if (player.calculateDistance3D(target) > 3000)
{
pet.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else if (pet.canAttack(target, ctrlPressed))
{
pet.doAttack(target);
}
}
}

View File

@@ -16,34 +16,46 @@
*/
package handlers.playeractions;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.handler.IPlayerActionHandler;
import org.l2jmobius.gameserver.model.ActionDataHolder;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.actor.Summon;
import org.l2jmobius.gameserver.network.SystemMessageId;
/**
* Servitor Attack player action handler.
* @author St3eT
* @author Mobius
*/
public class ServitorAttack implements IPlayerActionHandler
{
@Override
public void useAction(Player player, ActionDataHolder data, boolean ctrlPressed, boolean shiftPressed)
{
if (player.hasServitors())
{
for (Summon summon : player.getServitors().values())
{
if (summon.canAttack(player.getTarget(), ctrlPressed))
{
summon.doAttack(player.getTarget());
}
}
}
else
if (!player.hasServitors())
{
player.sendPacket(SystemMessageId.YOU_DO_NOT_HAVE_A_SERVITOR);
return;
}
final WorldObject target = player.getTarget();
if (target == null)
{
return;
}
final boolean targetOutOfRange = player.calculateDistance3D(target) > 3000;
for (Summon summon : player.getServitors().values())
{
if (targetOutOfRange)
{
summon.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
}
else if (summon.canAttack(target, ctrlPressed))
{
summon.doAttack(target);
}
}
}
}

View File

@@ -39,10 +39,11 @@ public class OpSkillAcquireSkillCondition implements ISkillCondition
@Override
public boolean canUse(Creature caster, Skill skill, WorldObject target)
{
if (!target.isCreature())
if ((target == null) || !target.isCreature())
{
return false;
}
final int skillLevel = ((Creature) target).getSkillLevel(_skillId);
return _hasLearned ? skillLevel != 0 : skillLevel == 0;
}

View File

@@ -67,7 +67,7 @@ public class PartyPledge implements IAffectScopeHandler
return false;
}
if ((p != player) && (p.getClanId() != clanId) && ((party == null) || (party != p.getParty())))
if ((p != player) && ((clanId == 0) || (p.getClanId() != clanId)) && ((party == null) || (party != p.getParty())))
{
return false;
}