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;
@@ -235,6 +236,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

@@ -42,6 +42,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("AgathionSlot", AgathionSlot::new);
@@ -195,6 +197,7 @@ public class EffectMasterHandler
EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new);
EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new);
EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new);
EffectHandler.getInstance().registerHandler("IgnoreReduceDamage", IgnoreReduceDamage::new);
EffectHandler.getInstance().registerHandler("ImmobileDamageBonus", ImmobileDamageBonus::new);
EffectHandler.getInstance().registerHandler("ImmobileDamageResist", ImmobileDamageResist::new);
EffectHandler.getInstance().registerHandler("ImmobilePetBuff", ImmobilePetBuff::new);
@@ -234,7 +237,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

@@ -47,6 +47,7 @@ public class SkillConditionMasterHandler
SkillConditionHandler.getInstance().registerHandler("CanUseInBattlefield", CanUseInBattlefieldSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("CanUseInDragonLair", CanUseInDragonLairSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("CanUseSwoopCannon", CanUseSwoopCannonSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("CanUseSymbolSealIncreaseItem", CanUseSymbolSealIncreaseItemSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("CanUseVitalityIncreaseItem", CanUseVitalityIncreaseItemSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("CheckLevel", CheckLevelSkillCondition::new);
SkillConditionHandler.getInstance().registerHandler("CheckSex", CheckSexSkillCondition::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

@@ -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 IgnoreReduceDamage extends AbstractStatEffect
{
public IgnoreReduceDamage(StatSet params)
{
super(params, Stat.IGNORE_REDUCE_DAMAGE);
}
}

View File

@@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import org.l2jmobius.gameserver.enums.StatModifierType;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
@@ -25,6 +26,7 @@ import org.l2jmobius.gameserver.model.events.listeners.FunctionEventListener;
import org.l2jmobius.gameserver.model.events.returns.DamageReturn;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.model.stats.Stat;
/**
* @author Sdw
@@ -32,10 +34,12 @@ import org.l2jmobius.gameserver.model.skill.Skill;
public class ReduceDamage extends AbstractEffect
{
private final double _amount;
private final StatModifierType _mode;
public ReduceDamage(StatSet params)
{
_amount = params.getDouble("amount");
_mode = params.getEnum("mode", StatModifierType.class, StatModifierType.DIFF);
}
private DamageReturn onDamageReceivedEvent(OnCreatureDamageReceived event)
@@ -46,7 +50,15 @@ public class ReduceDamage extends AbstractEffect
return null;
}
final double newDamage = event.getDamage() * (_amount / 100);
final double newDamage;
if (_mode == StatModifierType.PER)
{
newDamage = event.getDamage() - (event.getDamage() * (_amount / 100));
}
else // DIFF
{
newDamage = event.getDamage() - Math.max((_amount - event.getAttacker().getStat().getAdd(Stat.IGNORE_REDUCE_DAMAGE)), 0.0);
}
return new DamageReturn(false, true, false, newDamage);
}

View File

@@ -16,14 +16,21 @@
*/
package handlers.effecthandlers;
import java.util.LinkedList;
import java.util.List;
import org.l2jmobius.Config;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.gameserver.enums.StatModifierType;
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.effects.EffectType;
import org.l2jmobius.gameserver.model.holders.ItemSkillHolder;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.skill.Skill;
import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
/**
* @author NviX
@@ -39,6 +46,12 @@ public class RestoreSymbolSeal extends AbstractEffect
_mode = params.getEnum("mode", StatModifierType.class, StatModifierType.PER);
}
@Override
public EffectType getEffectType()
{
return EffectType.RESTORE_SYMBOL_SEAL;
}
@Override
public boolean isInstant()
{
@@ -77,6 +90,33 @@ public class RestoreSymbolSeal extends AbstractEffect
player.updateSymbolSealSkills();
player.sendSkillList();
player.broadcastUserInfo();
// Send item list to update Dye Powder with red icon in inventory.
ThreadPool.schedule(() ->
{
final List<Item> items = new LinkedList<>();
ITEMS: for (Item i : effected.getActingPlayer().getInventory().getItems())
{
if (i.getTemplate().hasSkills())
{
for (ItemSkillHolder s : i.getTemplate().getAllSkills())
{
if (s.getSkill().hasEffectType(EffectType.RESTORE_SYMBOL_SEAL))
{
items.add(i);
continue ITEMS;
}
}
}
}
if (!items.isEmpty())
{
final InventoryUpdate iu = new InventoryUpdate();
iu.addItems(items);
effected.getActingPlayer().sendInventoryUpdate(iu);
}
}, 1000);
}
}
}

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,61 @@
*/
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_PET_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);
}
}
@Override
public boolean isPetAction()
{
return true;
}
}

View File

@@ -52,4 +52,10 @@ public class PetHold implements IPlayerActionHandler
((SummonAI) pet.getAI()).notifyFollowStatusChange();
}
}
@Override
public boolean isPetAction()
{
return true;
}
}

View File

@@ -53,4 +53,10 @@ public class PetMove implements IPlayerActionHandler
pet.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, player.getTarget().getLocation());
}
}
@Override
public boolean isPetAction()
{
return true;
}
}

View File

@@ -77,4 +77,10 @@ public class PetSkillUse implements IPlayerActionHandler
}
}
}
@Override
public boolean isPetAction()
{
return true;
}
}

View File

@@ -51,4 +51,10 @@ public class PetStop implements IPlayerActionHandler
pet.cancelAction();
}
}
@Override
public boolean isPetAction()
{
return true;
}
}

View File

@@ -16,34 +16,52 @@
*/
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);
}
}
}
@Override
public boolean isPetAction()
{
return true;
}
}

View File

@@ -48,4 +48,10 @@ public class ServitorHold implements IPlayerActionHandler
((SummonAI) s.getAI()).notifyFollowStatusChange();
});
}
@Override
public boolean isPetAction()
{
return true;
}
}

View File

@@ -68,4 +68,10 @@ public class ServitorMode implements IPlayerActionHandler
}
}
}
@Override
public boolean isPetAction()
{
return true;
}
}

View File

@@ -56,4 +56,10 @@ public class ServitorMove implements IPlayerActionHandler
}
}
}
@Override
public boolean isPetAction()
{
return true;
}
}

View File

@@ -62,4 +62,10 @@ public class ServitorSkillUse implements IPlayerActionHandler
}
});
}
@Override
public boolean isPetAction()
{
return true;
}
}

View File

@@ -47,4 +47,10 @@ public class ServitorStop implements IPlayerActionHandler
s.cancelAction();
});
}
@Override
public boolean isPetAction()
{
return true;
}
}

View File

@@ -62,4 +62,10 @@ public class UnsummonPet implements IPlayerActionHandler
pet.unSummon(player);
}
}
@Override
public boolean isPetAction()
{
return true;
}
}

View File

@@ -69,4 +69,10 @@ public class UnsummonServitor implements IPlayerActionHandler
player.sendPacket(SystemMessageId.YOU_DO_NOT_HAVE_A_SERVITOR);
}
}
@Override
public boolean isPetAction()
{
return true;
}
}

View File

@@ -0,0 +1,43 @@
/*
* 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.Config;
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 CostyKiller
*/
public class CanUseSymbolSealIncreaseItemSkillCondition implements ISkillCondition
{
private final int _amount;
public CanUseSymbolSealIncreaseItemSkillCondition(StatSet params)
{
_amount = params.getInt("amount", 0);
}
@Override
public boolean canUse(Creature caster, Skill skill, WorldObject target)
{
return caster.isPlayer() && ((caster.getActingPlayer().getSymbolSealPoints() + ((Config.MAX_SYMBOL_SEAL_POINTS * _amount) / 100)) <= Config.MAX_SYMBOL_SEAL_POINTS);
}
}

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

View File

@@ -24,6 +24,7 @@ import org.l2jmobius.gameserver.model.actor.Attackable;
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.instance.FriendlyNpc;
import org.l2jmobius.gameserver.model.actor.instance.Monster;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.quest.QuestState;
@@ -46,10 +47,11 @@ public class ChamberOfProphecies extends AbstractInstance
{
// NPCs
private static final int KAIN_VAN_HALTER = 31639;
private static final int VAN_HALTER = 33999;
private static final int FERIN = 34001;
private static final int GRAIL = 33996;
private static final int MYSTERIOUS_WIZARD = 33980;
// Helper NPCs
private static final int HELPER_VAN_HALTER = 33999;
private static final int HELPER_FERIN = 34001;
// Misc
private static final int DOOR_2 = 17230102;
private static final int DOOR_3 = 17230103;
@@ -66,7 +68,7 @@ public class ChamberOfProphecies extends AbstractInstance
addStartNpc(KAIN_VAN_HALTER);
addFirstTalkId(KAIN_VAN_HALTER, GRAIL, MYSTERIOUS_WIZARD);
addTalkId(KAIN_VAN_HALTER, GRAIL, MYSTERIOUS_WIZARD);
addCreatureSeeId(FERIN, VAN_HALTER);
addCreatureSeeId(HELPER_FERIN, HELPER_VAN_HALTER);
}
@Override
@@ -145,12 +147,12 @@ public class ChamberOfProphecies extends AbstractInstance
{
return null;
}
final Npc valHalter = world.getNpc(VAN_HALTER);
if (valHalter != null)
final FriendlyNpc vanHalter = (FriendlyNpc) world.getNpc(HELPER_VAN_HALTER);
if (vanHalter != null)
{
valHalter.deleteMe(); // probably needs another npc id for initial room
vanHalter.deleteMe(); // probably needs another npc id for initial room
}
final Npc ferin = world.getNpc(FERIN);
final FriendlyNpc ferin = (FriendlyNpc) world.getNpc(HELPER_FERIN);
if (ferin != null)
{
ferin.deleteMe(); // probably needs another npc id for initial room
@@ -190,6 +192,8 @@ public class ChamberOfProphecies extends AbstractInstance
case "CHECK_STATUS":
{
final Instance world = player.getInstanceWorld();
final FriendlyNpc ferin = (FriendlyNpc) world.getNpc(HELPER_FERIN);
final FriendlyNpc vanHalter = (FriendlyNpc) world.getNpc(HELPER_VAN_HALTER);
if (!isInInstance(world))
{
return null;
@@ -200,8 +204,8 @@ public class ChamberOfProphecies extends AbstractInstance
{
if (world.getAliveNpcs(Monster.class).isEmpty())
{
startQuestTimer("SEY2", 14000, world.getNpc(FERIN), player);
startQuestTimer("SEY_KAIN", 24000, world.getNpc(VAN_HALTER), player);
startQuestTimer("SEY2", 14000, ferin, player);
startQuestTimer("SEY_KAIN", 24000, vanHalter, player);
startQuestTimer("OPEN_DOOR1", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
@@ -221,7 +225,7 @@ public class ChamberOfProphecies extends AbstractInstance
{
if (world.getAliveNpcs(Monster.class).isEmpty())
{
startQuestTimer("SEY3", 8000, world.getNpc(FERIN), player);
startQuestTimer("SEY3", 8000, ferin, player);
startQuestTimer("OPEN_DOOR2", 5000, npc, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
@@ -234,7 +238,7 @@ public class ChamberOfProphecies extends AbstractInstance
world.setStatus(4);
world.spawnGroup("wof_room3_2");
world.openCloseDoor(DOOR_3, false);
startQuestTimer("SEY_KAIN_1", 5000, world.getNpc(VAN_HALTER), player);
startQuestTimer("SEY_KAIN_1", 5000, vanHalter, player);
}
startQuestTimer("CHECK_STATUS", 7000, npc, player);
break;
@@ -245,8 +249,8 @@ public class ChamberOfProphecies extends AbstractInstance
{
world.setStatus(5);
world.spawnGroup("wof_room4");
startQuestTimer("SEY_KAIN_2", 3000, world.getNpc(VAN_HALTER), player);
startQuestTimer("SEY4", 7000, world.getNpc(FERIN), player);
startQuestTimer("SEY_KAIN_2", 3000, vanHalter, player);
startQuestTimer("SEY4", 7000, ferin, player);
}
else
{
@@ -304,7 +308,7 @@ public class ChamberOfProphecies extends AbstractInstance
return null;
}
cancelQuestTimer("ATTACK1", npc, player);
startQuestTimer("ATTACK2", 200, world.getNpc(VAN_HALTER), player, true);
startQuestTimer("ATTACK2", 200, world.getNpc(HELPER_VAN_HALTER), player, true);
world.setStatus(3);
world.spawnGroup("wof_room3");
world.openCloseDoor(DOOR_3, true);
@@ -321,7 +325,7 @@ public class ChamberOfProphecies extends AbstractInstance
}
case "SEY2":
{
if ((npc != null) && (npc.getId() == FERIN))
if ((npc != null) && (npc.getId() == HELPER_FERIN))
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.YOU_CAN_T_DIE_HERE_I_DIDN_T_LEARN_RESURRECT_YET));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_4", 0, 0, 0, 0, 0));
@@ -330,7 +334,7 @@ public class ChamberOfProphecies extends AbstractInstance
}
case "SEY_KAIN":
{
if ((npc != null) && (npc.getId() == VAN_HALTER))
if ((npc != null) && (npc.getId() == HELPER_VAN_HALTER))
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GISELLE_WAS_SUCH_A_SWEET_CHILD));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_1", 0, 0, 0, 0, 0));
@@ -340,7 +344,7 @@ public class ChamberOfProphecies extends AbstractInstance
}
case "SEY3":
{
if ((npc != null) && (npc.getId() == FERIN))
if ((npc != null) && (npc.getId() == HELPER_FERIN))
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.DO_YOU_THINK_I_LL_GROW_TALLER_IF_I_EAT_LOTS_AND_LOTS));
player.sendPacket(new PlaySound(3, "Npcdialog1.apple_quest_6", 0, 0, 0, 0, 0));
@@ -349,7 +353,7 @@ public class ChamberOfProphecies extends AbstractInstance
}
case "SEY_KAIN_1":
{
if ((npc != null) && (npc.getId() == VAN_HALTER))
if ((npc != null) && (npc.getId() == HELPER_VAN_HALTER))
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SUCH_MONSTERS_IN_A_PLACE_LIKE_THIS_UNBELIEVABLE));
}
@@ -357,7 +361,7 @@ public class ChamberOfProphecies extends AbstractInstance
}
case "SEY_KAIN_2":
{
if ((npc != null) && (npc.getId() == VAN_HALTER))
if ((npc != null) && (npc.getId() == HELPER_VAN_HALTER))
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.THAT_S_THE_MONSTER_THAT_ATTACKED_FAERON_YOU_RE_OUTMATCHED_HERE_GO_AHEAD_I_LL_CATCH_UP));
player.sendPacket(new PlaySound(3, "Npcdialog1.holter_quest_6", 0, 0, 0, 0, 0));
@@ -367,7 +371,7 @@ public class ChamberOfProphecies extends AbstractInstance
}
case "SEY4":
{
if ((npc != null) && (npc.getId() == FERIN))
if ((npc != null) && (npc.getId() == HELPER_FERIN))
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.GO_NOW_KAIN_CAN_HANDLE_THIS));
npc.setScriptValue(1);
@@ -377,7 +381,7 @@ public class ChamberOfProphecies extends AbstractInstance
}
case "SEY_KAIN_3":
{
if ((npc != null) && (npc.getId() == VAN_HALTER))
if ((npc != null) && (npc.getId() == HELPER_VAN_HALTER))
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.LEAVE_THIS_TO_ME_GO));
npc.setScriptValue(1);
@@ -387,7 +391,7 @@ public class ChamberOfProphecies extends AbstractInstance
}
case "REST":
{
if ((npc != null) && (npc.getId() == FERIN))
if ((npc != null) && (npc.getId() == HELPER_FERIN))
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, player);
}
@@ -508,7 +512,7 @@ public class ChamberOfProphecies extends AbstractInstance
{
switch (npc.getId())
{
case FERIN:
case HELPER_FERIN:
{
if (creature.isPlayer() && !creature.isDead() && npc.isScriptValue(0))
{
@@ -516,7 +520,7 @@ public class ChamberOfProphecies extends AbstractInstance
}
break;
}
case VAN_HALTER:
case HELPER_VAN_HALTER:
{
if (creature.isPlayer() && !creature.isDead() && world.isStatus(0))
{