Addition of configurations for fake death target.

This commit is contained in:
MobiusDevelopment
2019-04-27 08:58:16 +00:00
parent 1014855f61
commit 223da2f310
177 changed files with 576 additions and 186 deletions

View File

@@ -172,6 +172,8 @@ public final class Config
public static boolean SUMMON_STORE_SKILL_COOLTIME;
public static long EFFECT_TICK_RATIO;
public static boolean ENABLE_ALTER_SKILLS;
public static boolean FAKE_DEATH_UNTARGET;
public static boolean FAKE_DEATH_DAMAGE_STAND;
public static boolean LIFE_CRYSTAL_NEEDED;
public static boolean DIVINE_SP_BOOK_NEEDED;
public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
@@ -1508,6 +1510,8 @@ public final class Config
SUMMON_STORE_SKILL_COOLTIME = Character.getBoolean("SummonStoreSkillCooltime", true);
EFFECT_TICK_RATIO = Character.getLong("EffectTickRatio", 666);
ENABLE_ALTER_SKILLS = Character.getBoolean("EnableAlterSkills", true);
FAKE_DEATH_UNTARGET = Character.getBoolean("FakeDeathUntarget", true);
FAKE_DEATH_DAMAGE_STAND = Character.getBoolean("FakeDeathDamageStand", false);
LIFE_CRYSTAL_NEEDED = Character.getBoolean("LifeCrystalNeeded", true);
DIVINE_SP_BOOK_NEEDED = Character.getBoolean("DivineInspirationSpBookNeeded", true);
ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Character.getBoolean("AltSubClassWithoutQuests", false);

View File

@@ -31,6 +31,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.gameserver.enums.ItemLocation;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
@@ -1046,7 +1047,7 @@ public class CreatureAI extends AbstractAI
if ((target == null) || target.isAlikeDead())
{
// check if player is fakedeath
if ((target != null) && target.isPlayer() && ((PlayerInstance) target).isFakeDeath())
if ((target != null) && target.isPlayer() && ((PlayerInstance) target).isFakeDeath() && Config.FAKE_DEATH_DAMAGE_STAND)
{
target.stopFakeDeath(true);
return false;
@@ -1076,11 +1077,10 @@ public class CreatureAI extends AbstractAI
*/
protected boolean checkTargetLost(WorldObject target)
{
// check if player is fakedeath
if ((target != null) && target.isPlayer())
// Check if player is fakedeath.
if ((target != null) && target.isPlayer() && Config.FAKE_DEATH_DAMAGE_STAND)
{
final PlayerInstance target2 = (PlayerInstance) target; // convert object to chara
final PlayerInstance target2 = (PlayerInstance) target; // Convert object to player.
if (target2.isFakeDeath())
{
target2.stopFakeDeath(true);

View File

@@ -2288,6 +2288,18 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
stopMove(null);
getAI().notifyEvent(CtrlEvent.EVT_FAKE_DEATH);
broadcastPacket(new ChangeWaitType(this, ChangeWaitType.WT_START_FAKEDEATH));
// Remove target from those that have the untargetable creature on target.
if (Config.FAKE_DEATH_UNTARGET)
{
World.getInstance().forEachVisibleObject(this, Creature.class, c ->
{
if (c.getTarget() == this)
{
c.setTarget(null);
}
});
}
}
public final void startParalyze()