Code style changes.
This commit is contained in:
@@ -292,12 +292,12 @@ final class MC_Show extends AbstractNpcAI
|
||||
final int hours = (gameTime / 60) % 24;
|
||||
final int minutes = gameTime % 60;
|
||||
int hourDiff, minDiff;
|
||||
hourDiff = (20 - hours);
|
||||
hourDiff = 20 - hours;
|
||||
if (hourDiff < 0)
|
||||
{
|
||||
hourDiff = 24 - (hourDiff *= -1);
|
||||
}
|
||||
minDiff = (30 - minutes);
|
||||
minDiff = 30 - minutes;
|
||||
if (minDiff < 0)
|
||||
{
|
||||
minDiff = 60 - (minDiff *= -1);
|
||||
@@ -500,25 +500,22 @@ final class MC_Show extends AbstractNpcAI
|
||||
IS_STARTED = false;
|
||||
npc.deleteMe();
|
||||
}
|
||||
else
|
||||
else if (TALKS.containsKey(event))
|
||||
{
|
||||
if (TALKS.containsKey(event))
|
||||
final ShoutInfo si = TALKS.get(event);
|
||||
if (si != null)
|
||||
{
|
||||
final ShoutInfo si = TALKS.get(event);
|
||||
if (si != null)
|
||||
{
|
||||
autoChat(npc, si.getNpcStringId(), ChatType.NPC_SHOUT);
|
||||
startQuestTimer(si.getNextEvent(), si.getTime(), npc, null);
|
||||
}
|
||||
autoChat(npc, si.getNpcStringId(), ChatType.NPC_SHOUT);
|
||||
startQuestTimer(si.getNextEvent(), si.getTime(), npc, null);
|
||||
}
|
||||
else if (WALKS.containsKey(event))
|
||||
}
|
||||
else if (WALKS.containsKey(event))
|
||||
{
|
||||
final WalkInfo wi = WALKS.get(event);
|
||||
if (wi != null)
|
||||
{
|
||||
final WalkInfo wi = WALKS.get(event);
|
||||
if (wi != null)
|
||||
{
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, wi.getCharPos());
|
||||
startQuestTimer(wi.getNextEvent(), wi.getTime(), npc, null);
|
||||
}
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, wi.getCharPos());
|
||||
startQuestTimer(wi.getNextEvent(), wi.getTime(), npc, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -74,7 +74,7 @@ final class AdenReconstructorManager extends AbstractNpcAI
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
startQuestTimer("SPAM_TEXT", (5 * 60 * 1000), npc, null, true);
|
||||
startQuestTimer("SPAM_TEXT", 5 * 60 * 1000, npc, null, true);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@@ -40,7 +40,6 @@ final class ArcanRitual extends Quest
|
||||
private static final int BLUE_TRIGGER = 262001;
|
||||
private static final int RED_TRIGGER = 262003;
|
||||
private static final int ARCAN_RITUAL_INTERVAL = 30 * 60000; // 30 minutes
|
||||
private static final boolean ENABLED = true; // In case we want to disable spawning NPCs
|
||||
private static final Location ARCAN_TOWN_LOC = new Location(207096, 88696, -1129);
|
||||
// @formatter:off
|
||||
static final int[][] RITUAL_NPCS =
|
||||
@@ -155,10 +154,7 @@ final class ArcanRitual extends Quest
|
||||
}
|
||||
addEnterZoneId(arcanZone.getId());
|
||||
ritualStage = BLUE_TRIGGER;
|
||||
if (ENABLED)
|
||||
{
|
||||
ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new ChangeStage(), ARCAN_RITUAL_INTERVAL, ARCAN_RITUAL_INTERVAL);
|
||||
}
|
||||
ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new ChangeStage(), ARCAN_RITUAL_INTERVAL, ARCAN_RITUAL_INTERVAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -93,8 +93,6 @@ final class DenOfEvil extends AbstractNpcAI
|
||||
new Location(62905, -106109, -2384, 51288)
|
||||
};
|
||||
|
||||
private final static boolean DEBUG = false;
|
||||
|
||||
private DenOfEvil()
|
||||
{
|
||||
super(DenOfEvil.class.getSimpleName(), "ai/group_template");
|
||||
@@ -119,10 +117,6 @@ final class DenOfEvil extends AbstractNpcAI
|
||||
final L2EffectZone zone = ZoneManager.getInstance().getZone(npc, L2EffectZone.class);
|
||||
if (zone == null)
|
||||
{
|
||||
if (DEBUG)
|
||||
{
|
||||
_log.warning("NPC " + npc + " spawned outside of L2EffectZone, check your zone coords! X:" + npc.getX() + " Y:" + npc.getY() + " Z:" + npc.getZ());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
final int skillId = getSkillIdByNpcId(npc.getId());
|
||||
@@ -147,10 +141,6 @@ final class DenOfEvil extends AbstractNpcAI
|
||||
final L2EffectZone zone = ZoneManager.getInstance().getZone(npc, L2EffectZone.class);
|
||||
if (zone == null)
|
||||
{
|
||||
if (DEBUG)
|
||||
{
|
||||
_log.warning("NPC " + npc + " killed outside of L2EffectZone, check your zone coords! X:" + npc.getX() + " Y:" + npc.getY() + " Z:" + npc.getZ());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
final int skillId = getSkillIdByNpcId(npc.getId());
|
||||
@@ -210,12 +200,9 @@ final class DenOfEvil extends AbstractNpcAI
|
||||
{
|
||||
SkillData.getInstance().getSkill(6149, 1).applyEffects(character, character);
|
||||
}
|
||||
else
|
||||
else if (character.doDie(null) && character.isNpc() && Util.contains(EYE_IDS, ((L2Npc) character).getId())) // mobs die
|
||||
{
|
||||
if (character.doDie(null) && character.isNpc() && Util.contains(EYE_IDS, ((L2Npc) character).getId())) // mobs die
|
||||
{
|
||||
ThreadPoolManager.getInstance().scheduleAi(new RespawnNewEye(((L2Npc) character).getLocation()), 15000);
|
||||
}
|
||||
ThreadPoolManager.getInstance().scheduleAi(new RespawnNewEye(((L2Npc) character).getLocation()), 15000);
|
||||
}
|
||||
}
|
||||
for (int i = SKILL_ID; i <= (SKILL_ID + 4); i = i + 2)
|
||||
|
@@ -164,18 +164,15 @@ final class DragonValley extends AbstractNpcAI
|
||||
{
|
||||
spawnGhost(npc, attacker, isSummon, 1);
|
||||
}
|
||||
else
|
||||
else if ((npc.getCurrentHp() < (npc.getMaxHp() / 2)) && (getRandom(100) < 5) && npc.isScriptValue(0))
|
||||
{
|
||||
if ((npc.getCurrentHp() < (npc.getMaxHp() / 2)) && (getRandom(100) < 5) && npc.isScriptValue(0))
|
||||
npc.setScriptValue(1);
|
||||
final int rnd = getRandom(3, 5);
|
||||
for (int i = 0; i < rnd; i++)
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
final int rnd = getRandom(3, 5);
|
||||
for (int i = 0; i < rnd; i++)
|
||||
{
|
||||
final L2Playable playable = isSummon ? attacker.getServitors().values().stream().findFirst().orElse(attacker.getPet()) : attacker;
|
||||
final L2Npc minion = addSpawn(DRAKOS_ASSASSIN, npc.getX(), npc.getY(), npc.getZ() + 10, npc.getHeading(), true, 0, true);
|
||||
addAttackDesire(minion, playable);
|
||||
}
|
||||
final L2Playable playable = isSummon ? attacker.getServitors().values().stream().findFirst().orElse(attacker.getPet()) : attacker;
|
||||
final L2Npc minion = addSpawn(DRAKOS_ASSASSIN, npc.getX(), npc.getY(), npc.getZ() + 10, npc.getHeading(), true, 0, true);
|
||||
addAttackDesire(minion, playable);
|
||||
}
|
||||
}
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
@@ -285,7 +282,7 @@ final class DragonValley extends AbstractNpcAI
|
||||
ghost1.getVariables().set("playable", attacker);
|
||||
addAttackDesire(ghost1, attacker);
|
||||
val++;
|
||||
if ((val < 2) && (getRandomBoolean()))
|
||||
if ((val < 2) && getRandomBoolean())
|
||||
{
|
||||
final L2Npc ghost2 = addSpawn(WRATHFUL_ORC_GHOST, npc.getX(), npc.getY(), npc.getZ() + 20, npc.getHeading(), false, 0, false);
|
||||
addAttackDesire(ghost2, attacker);
|
||||
|
@@ -368,18 +368,15 @@ final class FeedableBeasts extends AbstractNpcAI
|
||||
nextNpcId = GROWTH_CAPABLE_MONSTERS.get(npcId).getMob(food, 1, 0);
|
||||
}
|
||||
}
|
||||
else // if not tamed, there is a small chance that have "mad cow" disease.
|
||||
// that is a stronger-than-normal animal that attacks its feeder
|
||||
if (getRandom(5) == 0)
|
||||
{
|
||||
nextNpcId = GROWTH_CAPABLE_MONSTERS.get(npcId).getMob(food, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
// if not tamed, there is a small chance that have "mad cow" disease.
|
||||
// that is a stronger-than-normal animal that attacks its feeder
|
||||
if (getRandom(5) == 0)
|
||||
{
|
||||
nextNpcId = GROWTH_CAPABLE_MONSTERS.get(npcId).getMob(food, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
nextNpcId = GROWTH_CAPABLE_MONSTERS.get(npcId).getMob(food, 0, 0);
|
||||
}
|
||||
nextNpcId = GROWTH_CAPABLE_MONSTERS.get(npcId).getMob(food, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -464,7 +461,7 @@ final class FeedableBeasts extends AbstractNpcAI
|
||||
|
||||
if (MAD_COW_POLYMORPH.containsKey(nextNpcId))
|
||||
{
|
||||
this.startQuestTimer("polymorph Mad Cow", 10000, nextNpc, player);
|
||||
startQuestTimer("polymorph Mad Cow", 10000, nextNpc, player);
|
||||
}
|
||||
|
||||
// register the player in the feedinfo for the mob that just spawned
|
||||
@@ -573,7 +570,7 @@ final class FeedableBeasts extends AbstractNpcAI
|
||||
}
|
||||
else if (Util.contains(TAMED_BEASTS, npcId) && (npc instanceof L2TamedBeastInstance))
|
||||
{
|
||||
final L2TamedBeastInstance beast = ((L2TamedBeastInstance) npc);
|
||||
final L2TamedBeastInstance beast = (L2TamedBeastInstance) npc;
|
||||
if (skillId == beast.getFoodType())
|
||||
{
|
||||
beast.onReceiveFood();
|
||||
|
@@ -60,7 +60,7 @@ final class GiantsCave extends AbstractNpcAI
|
||||
|
||||
for (L2Character characters : npc.getKnownList().getKnownCharactersInRadius(450))
|
||||
{
|
||||
if ((characters != null) && (characters.isAttackable()) && (getRandomBoolean()))
|
||||
if ((characters != null) && characters.isAttackable() && getRandomBoolean())
|
||||
{
|
||||
addAttackDesire((L2Npc) characters, player);
|
||||
}
|
||||
|
@@ -32,17 +32,17 @@ import ai.npc.AbstractNpcAI;
|
||||
final class LairOfAntharas extends AbstractNpcAI
|
||||
{
|
||||
// NPC
|
||||
final private static int KNORIKS = 22857;
|
||||
final private static int DRAGON_KNIGHT = 22844;
|
||||
final private static int DRAGON_KNIGHT2 = 22845;
|
||||
final private static int ELITE_DRAGON_KNIGHT = 22846;
|
||||
private static final int KNORIKS = 22857;
|
||||
private static final int DRAGON_KNIGHT = 22844;
|
||||
private static final int DRAGON_KNIGHT2 = 22845;
|
||||
private static final int ELITE_DRAGON_KNIGHT = 22846;
|
||||
|
||||
final private static int DRAGON_GUARD = 22852;
|
||||
final private static int DRAGON_MAGE = 22853;
|
||||
private static final int DRAGON_GUARD = 22852;
|
||||
private static final int DRAGON_MAGE = 22853;
|
||||
// Misc
|
||||
final private static int KNIGHT_CHANCE = 30;
|
||||
final private static int KNORIKS_CHANCE = 60;
|
||||
final private static int KNORIKS_CHANCE2 = 50;
|
||||
private static final int KNIGHT_CHANCE = 30;
|
||||
private static final int KNORIKS_CHANCE = 60;
|
||||
private static final int KNORIKS_CHANCE2 = 50;
|
||||
|
||||
private LairOfAntharas()
|
||||
{
|
||||
|
@@ -138,7 +138,7 @@ final class PrimevalIsle extends AbstractNpcAI
|
||||
if (skill.getId() == SELFBUFF1.getSkillId())
|
||||
{
|
||||
npc.setScriptValue(3);
|
||||
if ((target != null))
|
||||
if (target != null)
|
||||
{
|
||||
npc.setTarget(target);
|
||||
addAttackDesire(npc, player);
|
||||
@@ -150,7 +150,7 @@ final class PrimevalIsle extends AbstractNpcAI
|
||||
if (skill.getId() == SELFBUFF1.getSkillId())
|
||||
{
|
||||
npc.setScriptValue(1);
|
||||
if ((target != null))
|
||||
if (target != null)
|
||||
{
|
||||
npc.setTarget(target);
|
||||
addAttackDesire(npc, player);
|
||||
@@ -159,7 +159,7 @@ final class PrimevalIsle extends AbstractNpcAI
|
||||
else if (skill.getId() == SELFBUFF2.getSkillId())
|
||||
{
|
||||
npc.setScriptValue(5);
|
||||
if ((target != null))
|
||||
if (target != null)
|
||||
{
|
||||
npc.setTarget(target);
|
||||
addAttackDesire(npc, player);
|
||||
@@ -179,7 +179,7 @@ final class PrimevalIsle extends AbstractNpcAI
|
||||
{
|
||||
if ((npc != null) && !npc.isDead())
|
||||
{
|
||||
npc.doCast((npc.getId() == SPRIGNANT[0] ? ANESTHESIA.getSkill() : DEADLY_POISON.getSkill()));
|
||||
npc.doCast(npc.getId() == SPRIGNANT[0] ? ANESTHESIA.getSkill() : DEADLY_POISON.getSkill());
|
||||
startQuestTimer("USE_SKILL", 15000, npc, null);
|
||||
}
|
||||
break;
|
||||
@@ -320,9 +320,9 @@ final class PrimevalIsle extends AbstractNpcAI
|
||||
final L2Playable playable = isSummon ? attacker.getServitors().values().stream().findFirst().orElse(attacker.getPet()) : attacker;
|
||||
for (L2Character characters : npc.getKnownList().getKnownCharactersInRadius(500))
|
||||
{
|
||||
if ((characters != null) && (characters.isAttackable()) && (getRandomBoolean()))
|
||||
if ((characters != null) && characters.isAttackable() && getRandomBoolean())
|
||||
{
|
||||
addAttackDesire(((L2Attackable) characters), playable);
|
||||
addAttackDesire((L2Attackable) characters, playable);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -349,7 +349,7 @@ final class PrimevalIsle extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((((npc.getCurrentHp() / npc.getMaxHp()) * 100) <= 60) && (npc.isScriptValue(3)))
|
||||
else if ((((npc.getCurrentHp() / npc.getMaxHp()) * 100) <= 60) && npc.isScriptValue(3))
|
||||
{
|
||||
if (!npc.isSkillDisabled(SELFBUFF1.getSkill()))
|
||||
{
|
||||
|
@@ -92,14 +92,11 @@ final class PrisonGuards extends AbstractNpcAI
|
||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.IT_S_NOT_EASY_TO_OBTAIN);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (!player.isAffectedBySkill(TIMER) && (npc.calculateDistance(npc.getSpawn().getLocation(), false, false) < 2000))
|
||||
{
|
||||
if (!player.isAffectedBySkill(TIMER) && (npc.calculateDistance(npc.getSpawn().getLocation(), false, false) < 2000))
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(STONE.getSkill());
|
||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.YOU_RE_OUT_OF_YOUR_MIND_COMING_HERE);
|
||||
}
|
||||
npc.setTarget(player);
|
||||
npc.doCast(STONE.getSkill());
|
||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.YOU_RE_OUT_OF_YOUR_MIND_COMING_HERE);
|
||||
}
|
||||
return super.onAttack(npc, player, damage, isSummon);
|
||||
}
|
||||
|
@@ -206,12 +206,12 @@ final class SelMahumDrill extends AbstractNpcAI
|
||||
// group hate
|
||||
for (L2Character ch : npc.getKnownList().getKnownCharacters())
|
||||
{
|
||||
if (!ch.isInCombat() && ch.isMonster() && (((L2Npc) ch).getSpawn().getName().equals(npc.getSpawn().getName())))
|
||||
if (!ch.isInCombat() && ch.isMonster() && ((L2Npc) ch).getSpawn().getName().equals(npc.getSpawn().getName()))
|
||||
{
|
||||
addAttackDesire((L2Npc) ch, attacker);
|
||||
}
|
||||
}
|
||||
if ((getRandom(10) < 1) && (Util.contains(MAHUM_SOLDIERS, npc.getId())))
|
||||
if ((getRandom(10) < 1) && Util.contains(MAHUM_SOLDIERS, npc.getId()))
|
||||
{
|
||||
npc.broadcastEvent("ATTACKED", 1000, null);
|
||||
}
|
||||
@@ -317,7 +317,7 @@ final class SelMahumDrill extends AbstractNpcAI
|
||||
final int remainedCount = npc.getVariables().getInt("SOCIAL_ACTION_REMAINED_COUNT");
|
||||
if (remainedCount > 0)
|
||||
{
|
||||
npc.getVariables().set("SOCIAL_ACTION_REMAINED_COUNT", (remainedCount - 1));
|
||||
npc.getVariables().set("SOCIAL_ACTION_REMAINED_COUNT", remainedCount - 1);
|
||||
startQuestTimer("do_social_action", action.getRepeatInterval(), npc, null);
|
||||
}
|
||||
}
|
||||
|
@@ -159,7 +159,7 @@ final class SilentValley extends AbstractNpcAI
|
||||
{
|
||||
if (creature.isPlayable())
|
||||
{
|
||||
final L2PcInstance player = (isSummon) ? ((L2Summon) creature).getOwner() : creature.getActingPlayer();
|
||||
final L2PcInstance player = isSummon ? ((L2Summon) creature).getOwner() : creature.getActingPlayer();
|
||||
if ((npc.getId() == GUARD1) || (npc.getId() == GUARD2))
|
||||
{
|
||||
npc.setTarget(player);
|
||||
|
@@ -245,7 +245,7 @@ final class StakatoNest extends AbstractNpcAI
|
||||
|
||||
private static void giveCocoon(L2PcInstance player, L2Npc npc)
|
||||
{
|
||||
player.addItem("StakatoCocoon", ((getRandom(100) > 80) ? LARGE_COCOON : SMALL_COCOON), 1, npc, true);
|
||||
player.addItem("StakatoCocoon", (getRandom(100) > 80) ? LARGE_COCOON : SMALL_COCOON, 1, npc, true);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
@@ -214,8 +214,8 @@ public final class Antharas extends AbstractNpcAI
|
||||
{
|
||||
final L2Party party = player.getParty();
|
||||
final boolean isInCC = party.isInCommandChannel();
|
||||
final List<L2PcInstance> members = (isInCC) ? party.getCommandChannel().getMembers() : party.getMembers();
|
||||
final boolean isPartyLeader = (isInCC) ? party.getCommandChannel().isLeader(player) : party.isLeader(player);
|
||||
final List<L2PcInstance> members = isInCC ? party.getCommandChannel().getMembers() : party.getMembers();
|
||||
final boolean isPartyLeader = isInCC ? party.getCommandChannel().isLeader(player) : party.isLeader(player);
|
||||
if (!isPartyLeader)
|
||||
{
|
||||
htmltext = "13001-05.html";
|
||||
@@ -244,20 +244,17 @@ public final class Antharas extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!hasQuestItems(player, STONE))
|
||||
{
|
||||
htmltext = "13001-03.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!hasQuestItems(player, STONE))
|
||||
player.teleToLocation(179700 + getRandom(700), 113800 + getRandom(2100), -7709);
|
||||
if (getStatus() != WAITING)
|
||||
{
|
||||
htmltext = "13001-03.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
player.teleToLocation(179700 + getRandom(700), 113800 + getRandom(2100), -7709);
|
||||
if (getStatus() != WAITING)
|
||||
{
|
||||
setStatus(WAITING);
|
||||
startQuestTimer("SPAWN_ANTHARAS", Config.ANTHARAS_WAIT_TIME * 60000, null, null);
|
||||
}
|
||||
setStatus(WAITING);
|
||||
startQuestTimer("SPAWN_ANTHARAS", Config.ANTHARAS_WAIT_TIME * 60000, null, null);
|
||||
}
|
||||
}
|
||||
return htmltext;
|
||||
@@ -418,7 +415,7 @@ public final class Antharas extends AbstractNpcAI
|
||||
addSpawn(BEHEMOTH, npc, true);
|
||||
addSpawn(TERASQUE, npc, true);
|
||||
}
|
||||
_minionCount += (minionMultipler * 2);
|
||||
_minionCount += minionMultipler * 2;
|
||||
}
|
||||
else if (_minionCount < 98)
|
||||
{
|
||||
@@ -428,7 +425,7 @@ public final class Antharas extends AbstractNpcAI
|
||||
}
|
||||
else if (_minionCount < 99)
|
||||
{
|
||||
addSpawn((getRandomBoolean() ? BEHEMOTH : TERASQUE), npc, true);
|
||||
addSpawn(getRandomBoolean() ? BEHEMOTH : TERASQUE, npc, true);
|
||||
_minionCount++;
|
||||
}
|
||||
|
||||
@@ -641,23 +638,23 @@ public final class Antharas extends AbstractNpcAI
|
||||
|
||||
if (skill == null)
|
||||
{
|
||||
refreshAiParams(attacker, (damage * 1000));
|
||||
refreshAiParams(attacker, damage * 1000);
|
||||
}
|
||||
else if (npc.getCurrentHp() < (npc.getMaxHp() * 0.25))
|
||||
{
|
||||
refreshAiParams(attacker, ((damage / 3) * 100));
|
||||
refreshAiParams(attacker, (damage / 3) * 100);
|
||||
}
|
||||
else if (npc.getCurrentHp() < (npc.getMaxHp() * 0.5))
|
||||
{
|
||||
refreshAiParams(attacker, (damage * 20));
|
||||
refreshAiParams(attacker, damage * 20);
|
||||
}
|
||||
else if (npc.getCurrentHp() < (npc.getMaxHp() * 0.75))
|
||||
{
|
||||
refreshAiParams(attacker, (damage * 10));
|
||||
refreshAiParams(attacker, damage * 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
refreshAiParams(attacker, ((damage / 3) * 20));
|
||||
refreshAiParams(attacker, (damage / 3) * 20);
|
||||
}
|
||||
manageSkills(npc);
|
||||
}
|
||||
@@ -761,7 +758,7 @@ public final class Antharas extends AbstractNpcAI
|
||||
|
||||
private void setRespawn(long respawnTime)
|
||||
{
|
||||
GrandBossManager.getInstance().getStatsSet(ANTHARAS).set("respawn_time", (System.currentTimeMillis() + respawnTime));
|
||||
GrandBossManager.getInstance().getStatsSet(ANTHARAS).set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
}
|
||||
|
||||
private final void refreshAiParams(L2PcInstance attacker, int damage)
|
||||
|
@@ -492,23 +492,23 @@ public final class Baium extends AbstractNpcAI
|
||||
|
||||
if (skill == null)
|
||||
{
|
||||
refreshAiParams(attacker, npc, (damage * 1000));
|
||||
refreshAiParams(attacker, npc, damage * 1000);
|
||||
}
|
||||
else if (npc.getCurrentHp() < (npc.getMaxHp() * 0.25))
|
||||
{
|
||||
refreshAiParams(attacker, npc, ((damage / 3) * 100));
|
||||
refreshAiParams(attacker, npc, (damage / 3) * 100);
|
||||
}
|
||||
else if (npc.getCurrentHp() < (npc.getMaxHp() * 0.5))
|
||||
{
|
||||
refreshAiParams(attacker, npc, (damage * 20));
|
||||
refreshAiParams(attacker, npc, damage * 20);
|
||||
}
|
||||
else if (npc.getCurrentHp() < (npc.getMaxHp() * 0.75))
|
||||
{
|
||||
refreshAiParams(attacker, npc, (damage * 10));
|
||||
refreshAiParams(attacker, npc, damage * 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
refreshAiParams(attacker, npc, ((damage / 3) * 20));
|
||||
refreshAiParams(attacker, npc, (damage / 3) * 20);
|
||||
}
|
||||
manageSkills(npc);
|
||||
}
|
||||
@@ -658,7 +658,7 @@ public final class Baium extends AbstractNpcAI
|
||||
|
||||
private void setRespawn(long respawnTime)
|
||||
{
|
||||
GrandBossManager.getInstance().getStatsSet(BAIUM).set("respawn_time", (System.currentTimeMillis() + respawnTime));
|
||||
GrandBossManager.getInstance().getStatsSet(BAIUM).set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
}
|
||||
|
||||
private void manageSkills(L2Npc npc)
|
||||
@@ -672,7 +672,7 @@ public final class Baium extends AbstractNpcAI
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
final L2Character attacker = vars.getObject("c_quest" + i, L2Character.class);
|
||||
if ((attacker == null) || ((npc.calculateDistance(attacker, true, false) > 9000) || attacker.isDead()))
|
||||
if ((attacker == null) || (npc.calculateDistance(attacker, true, false) > 9000) || attacker.isDead())
|
||||
{
|
||||
vars.set("i_quest" + i, 0);
|
||||
}
|
||||
|
@@ -108,7 +108,7 @@ final class Beleth extends AbstractNpcAI
|
||||
final int status = GrandBossManager.getInstance().getBossStatus(REAL_BELETH);
|
||||
if (status == DEAD)
|
||||
{
|
||||
final long time = (info.getLong("respawn_time") - System.currentTimeMillis());
|
||||
final long time = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
if (time > 0)
|
||||
{
|
||||
startQuestTimer("BELETH_UNLOCK", time, null, null);
|
||||
@@ -634,7 +634,7 @@ final class Beleth extends AbstractNpcAI
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
|
||||
startQuestTimer("CAST", ((int) (((distance2 - 890) / (npc.isRunning() ? npc.getRunSpeed() : npc.getWalkSpeed())) * 1000)), npc, null);
|
||||
startQuestTimer("CAST", (int) (((distance2 - 890) / (npc.isRunning() ? npc.getRunSpeed() : npc.getWalkSpeed())) * 1000), npc, null);
|
||||
}
|
||||
else if (distance2 < 890)
|
||||
{
|
||||
|
@@ -65,7 +65,7 @@ final class Core extends AbstractNpcAI
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
|
||||
if (GrandBossManager.getInstance().getBossStatus(CORE) == DEAD)
|
||||
{
|
||||
final long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
|
||||
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
if (temp > 0)
|
||||
{
|
||||
startQuestTimer("core_unlock", temp, null, null);
|
||||
@@ -194,7 +194,7 @@ final class Core extends AbstractNpcAI
|
||||
startQuestTimer("core_unlock", respawnTime, null, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
|
||||
info.set("respawn_time", (System.currentTimeMillis() + respawnTime));
|
||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
GrandBossManager.getInstance().setStatsSet(CORE, info);
|
||||
startQuestTimer("despawn_minions", 20000, null, null);
|
||||
cancelQuestTimers("spawn_minion");
|
||||
|
@@ -85,19 +85,19 @@ final class DarkWaterDragon extends AbstractNpcAI
|
||||
}
|
||||
else if (event.equalsIgnoreCase("1")) // spawns a detractor
|
||||
{
|
||||
addSpawn(DETRACTOR1, (npc.getX() + 100), (npc.getY() + 100), npc.getZ(), 0, false, 40000);
|
||||
addSpawn(DETRACTOR1, npc.getX() + 100, npc.getY() + 100, npc.getZ(), 0, false, 40000);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("2")) // spawns a detractor
|
||||
{
|
||||
addSpawn(DETRACTOR2, (npc.getX() + 100), (npc.getY() - 100), npc.getZ(), 0, false, 40000);
|
||||
addSpawn(DETRACTOR2, npc.getX() + 100, npc.getY() - 100, npc.getZ(), 0, false, 40000);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("3")) // spawns a detractor
|
||||
{
|
||||
addSpawn(DETRACTOR1, (npc.getX() - 100), (npc.getY() + 100), npc.getZ(), 0, false, 40000);
|
||||
addSpawn(DETRACTOR1, npc.getX() - 100, npc.getY() + 100, npc.getZ(), 0, false, 40000);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("4")) // spawns a detractor
|
||||
{
|
||||
addSpawn(DETRACTOR2, (npc.getX() - 100), (npc.getY() - 100), npc.getZ(), 0, false, 40000);
|
||||
addSpawn(DETRACTOR2, npc.getX() - 100, npc.getY() - 100, npc.getZ(), 0, false, 40000);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("fafurion_despawn")) // Fafurion Kindred disappears and drops reward
|
||||
{
|
||||
@@ -156,7 +156,7 @@ final class DarkWaterDragon extends AbstractNpcAI
|
||||
spawnShade(originalAttacker, SHADE2, npc.getX() - 100, npc.getY() - 100, npc.getZ());
|
||||
spawnShade(originalAttacker, SHADE1, npc.getX() - 150, npc.getY() + 150, npc.getZ());
|
||||
}
|
||||
else if ((npc.getCurrentHp() < (npc.getMaxHp() / 2.0)) && !(SECOND_SPAWN.contains(npcObjId)))
|
||||
else if ((npc.getCurrentHp() < (npc.getMaxHp() / 2.0)) && !SECOND_SPAWN.contains(npcObjId))
|
||||
{
|
||||
SECOND_SPAWN.add(npcObjId);
|
||||
// Spawn second 5 shades on half hp of on Dark Water Dragon
|
||||
|
@@ -39,7 +39,7 @@ final class Devno extends AbstractNpcAI
|
||||
NpcStringId.I_SEE_THAT_ADVENTURERS_ARE_RETURNING_TO_TALKING_ISLAND_FOR_THE_AWAKENING,
|
||||
NpcStringId.YOU_CAN_SEE_VARIOUS_STATISTICS_IN_THE_MUSEUM_STATS_IN_THE_MAIN_MENU
|
||||
};
|
||||
private final static Location[] DEVNO_LOC =
|
||||
private static final Location[] DEVNO_LOC =
|
||||
{
|
||||
new Location(-114448, 259106, -1203),
|
||||
new Location(-114565, 258686, -1203),
|
||||
|
@@ -38,7 +38,7 @@ final class Eleve extends AbstractNpcAI
|
||||
NpcStringId.DON_T_KNOW_WHAT_TO_DO_LOOK_AT_THE_MAP,
|
||||
NpcStringId.DO_YOU_SEE_A_SCROLL_ICON_GO_THAT_LOCATION
|
||||
};
|
||||
private final static Location[] ELEVE_LOC =
|
||||
private static final Location[] ELEVE_LOC =
|
||||
{
|
||||
new Location(-114936, 259918, -1203),
|
||||
new Location(-114687, 259872, -1203),
|
||||
|
@@ -122,7 +122,7 @@ final class FrightenedRagnaOrc extends AbstractNpcAI
|
||||
}
|
||||
else
|
||||
{
|
||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, (getRandomBoolean() ? NpcStringId.THANKS_BUT_THAT_THING_ABOUT_10_000_000_ADENA_WAS_A_LIE_SEE_YA : NpcStringId.YOU_RE_PRETTY_DUMB_TO_BELIEVE_ME));
|
||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, getRandomBoolean() ? NpcStringId.THANKS_BUT_THAT_THING_ABOUT_10_000_000_ADENA_WAS_A_LIE_SEE_YA : NpcStringId.YOU_RE_PRETTY_DUMB_TO_BELIEVE_ME);
|
||||
}
|
||||
startQuestTimer("despawn", 1000, npc, null);
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@ final class Karonf extends AbstractNpcAI
|
||||
NpcStringId.WHEN_YOU_GO_TO_THE_MUSEUM_SPEAK_TO_PANTHEON,
|
||||
NpcStringId.SOME_FOLKS_DON_T_KNOW_WHAT_THEY_ARE_DOING
|
||||
};
|
||||
private final static Location[] KARONF_LOC =
|
||||
private static final Location[] KARONF_LOC =
|
||||
{
|
||||
new Location(-113984, 259782, -1203),
|
||||
new Location(-113786, 259475, -1203),
|
||||
|
@@ -306,12 +306,9 @@ final class QueenAnt extends AbstractNpcAI
|
||||
curse = CommonSkill.RAID_CURSE.getSkill();
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (!character.isParalyzed() && (getRandom(4) == 0))
|
||||
{
|
||||
if (!character.isParalyzed() && (getRandom(4) == 0))
|
||||
{
|
||||
curse = CommonSkill.RAID_CURSE2.getSkill();
|
||||
}
|
||||
curse = CommonSkill.RAID_CURSE2.getSkill();
|
||||
}
|
||||
|
||||
if (curse != null)
|
||||
@@ -360,7 +357,7 @@ final class QueenAnt extends AbstractNpcAI
|
||||
{
|
||||
if (((L2MonsterInstance) npc).getLeader() != null)
|
||||
{
|
||||
((L2MonsterInstance) npc).getLeader().getMinionList().onMinionDie(((L2MonsterInstance) npc), (280 + getRandom(40)) * 1000);
|
||||
((L2MonsterInstance) npc).getLeader().getMinionList().onMinionDie((L2MonsterInstance) npc, (280 + getRandom(40)) * 1000);
|
||||
}
|
||||
}
|
||||
else if (npcId == NURSE)
|
||||
@@ -391,13 +388,10 @@ final class QueenAnt extends AbstractNpcAI
|
||||
_task.cancel(false);
|
||||
_task = null;
|
||||
}
|
||||
else
|
||||
else if (_queen.calculateDistance(QUEEN_X, QUEEN_Y, QUEEN_Z, false, false) > 2000.)
|
||||
{
|
||||
if (_queen.calculateDistance(QUEEN_X, QUEEN_Y, QUEEN_Z, false, false) > 2000.)
|
||||
{
|
||||
_queen.clearAggroList();
|
||||
_queen.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(QUEEN_X, QUEEN_Y, QUEEN_Z, 0));
|
||||
}
|
||||
_queen.clearAggroList();
|
||||
_queen.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(QUEEN_X, QUEEN_Y, QUEEN_Z, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -87,7 +87,7 @@ final class QueenShyeed extends AbstractNpcAI
|
||||
private void spawnShyeed()
|
||||
{
|
||||
final String respawn = loadGlobalQuestVar("Respawn");
|
||||
final long remain = (!respawn.isEmpty()) ? Long.parseLong(respawn) - System.currentTimeMillis() : 0;
|
||||
final long remain = !respawn.isEmpty() ? Long.parseLong(respawn) - System.currentTimeMillis() : 0;
|
||||
if (remain > 0)
|
||||
{
|
||||
startQuestTimer("respawn", remain, null, null);
|
||||
|
@@ -178,7 +178,7 @@ final class ScarletVanHalisha extends AbstractNpcAI
|
||||
Skill skill = _skill;
|
||||
if (skill == null)
|
||||
{
|
||||
skill = (getRndSkills(npc));
|
||||
skill = getRndSkills(npc);
|
||||
}
|
||||
|
||||
if (npc.isPhysicalMuted())
|
||||
@@ -222,7 +222,7 @@ final class ScarletVanHalisha extends AbstractNpcAI
|
||||
continue;
|
||||
}
|
||||
|
||||
if (((((L2Character) obj).getZ() < (npc.getZ() - 100)) && (((L2Character) obj).getZ() > (npc.getZ() + 100))) || !(GeoData.getInstance().canSeeTarget(((L2Character) obj).getX(), ((L2Character) obj).getY(), ((L2Character) obj).getZ(), npc.getX(), npc.getY(), npc.getZ())))
|
||||
if (((((L2Character) obj).getZ() < (npc.getZ() - 100)) && (((L2Character) obj).getZ() > (npc.getZ() + 100))) || !GeoData.getInstance().canSeeTarget(((L2Character) obj).getX(), ((L2Character) obj).getY(), ((L2Character) obj).getZ(), npc.getX(), npc.getY(), npc.getZ()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@@ -71,7 +71,7 @@ final class SinWardens extends AbstractNpcAI
|
||||
int killedCount = killedMinionsCount.containsKey(master.getObjectId()) ? killedMinionsCount.get(master.getObjectId()) : 0;
|
||||
killedCount++;
|
||||
|
||||
if ((killedCount) == 5)
|
||||
if (killedCount == 5)
|
||||
{
|
||||
master.broadcastPacket(new NpcSay(master.getObjectId(), ChatType.NPC_GENERAL, master.getId(), NpcStringId.WE_MIGHT_NEED_NEW_SLAVES_I_LL_BE_BACK_SOON_SO_WAIT));
|
||||
master.doDie(killer);
|
||||
|
@@ -127,7 +127,7 @@ public final class Valakas extends AbstractNpcAI
|
||||
if (status == DEAD)
|
||||
{
|
||||
// load the unlock date and time for valakas from DB
|
||||
final long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
|
||||
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||
if (temp > 0)
|
||||
{
|
||||
// The time has not yet expired. Mark Valakas as currently locked (dead).
|
||||
@@ -178,7 +178,7 @@ public final class Valakas extends AbstractNpcAI
|
||||
// Start timer to lock entry after 30 minutes
|
||||
if (status == WAITING)
|
||||
{
|
||||
startQuestTimer("beginning", (Config.VALAKAS_WAIT_TIME * 60000), valakas, null);
|
||||
startQuestTimer("beginning", Config.VALAKAS_WAIT_TIME * 60000, valakas, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -356,18 +356,15 @@ public final class Valakas extends AbstractNpcAI
|
||||
callSkillAI(npc);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (event.equalsIgnoreCase("valakas_unlock"))
|
||||
{
|
||||
if (event.equalsIgnoreCase("valakas_unlock"))
|
||||
{
|
||||
final L2Npc valakas = addSpawn(VALAKAS, -105200, -253104, -15264, 32768, false, 0);
|
||||
GrandBossManager.getInstance().addBoss((L2GrandBossInstance) valakas);
|
||||
GrandBossManager.getInstance().setBossStatus(VALAKAS, DORMANT);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("remove_players"))
|
||||
{
|
||||
ZONE.oustAllPlayers();
|
||||
}
|
||||
final L2Npc valakas = addSpawn(VALAKAS, -105200, -253104, -15264, 32768, false, 0);
|
||||
GrandBossManager.getInstance().addBoss((L2GrandBossInstance) valakas);
|
||||
GrandBossManager.getInstance().setBossStatus(VALAKAS, DORMANT);
|
||||
}
|
||||
else if (event.equalsIgnoreCase("remove_players"))
|
||||
{
|
||||
ZONE.oustAllPlayers();
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
@@ -436,7 +433,7 @@ public final class Valakas extends AbstractNpcAI
|
||||
startQuestTimer("valakas_unlock", respawnTime, null, null);
|
||||
// also save the respawn time so that the info is maintained past reboots
|
||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(VALAKAS);
|
||||
info.set("respawn_time", (System.currentTimeMillis() + respawnTime));
|
||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||
GrandBossManager.getInstance().setStatsSet(VALAKAS, info);
|
||||
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
@@ -456,7 +453,7 @@ public final class Valakas extends AbstractNpcAI
|
||||
}
|
||||
|
||||
// Pickup a target if no or dead victim. 10% luck he decides to reconsiders his target.
|
||||
if ((_actualVictim == null) || _actualVictim.isDead() || !(npc.getKnownList().knowsObject(_actualVictim)) || (getRandom(10) == 0))
|
||||
if ((_actualVictim == null) || _actualVictim.isDead() || !npc.getKnownList().knowsObject(_actualVictim) || (getRandom(10) == 0))
|
||||
{
|
||||
_actualVictim = getRandomTarget(npc);
|
||||
}
|
||||
@@ -550,7 +547,7 @@ public final class Valakas extends AbstractNpcAI
|
||||
}
|
||||
}
|
||||
|
||||
return (result.isEmpty()) ? null : result.get(getRandom(result.size()));
|
||||
return result.isEmpty() ? null : result.get(getRandom(result.size()));
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
@@ -241,7 +241,7 @@ final class Alarm extends AbstractNpcAI
|
||||
* @param memoState the memo state, if memo state is less than zero, only quest state is checked
|
||||
* @return {@code true} if the player has the memo state, {@code false} otherwise
|
||||
*/
|
||||
private static final boolean verifyMemoState(L2PcInstance player, int questId, int memoState)
|
||||
private static boolean verifyMemoState(L2PcInstance player, int questId, int memoState)
|
||||
{
|
||||
QuestState qs = null;
|
||||
switch (questId)
|
||||
@@ -266,7 +266,7 @@ final class Alarm extends AbstractNpcAI
|
||||
* @param questId the quest ID
|
||||
* @param memoState the memo state
|
||||
*/
|
||||
private static final void setMemoState(L2PcInstance player, int questId, int memoState)
|
||||
private static void setMemoState(L2PcInstance player, int questId, int memoState)
|
||||
{
|
||||
QuestState qs = null;
|
||||
switch (questId)
|
||||
@@ -295,7 +295,7 @@ final class Alarm extends AbstractNpcAI
|
||||
* @param slot the slot
|
||||
* @return the memo state ex
|
||||
*/
|
||||
private static final int getMemoStateEx(L2PcInstance player, int questId, int slot)
|
||||
private static int getMemoStateEx(L2PcInstance player, int questId, int slot)
|
||||
{
|
||||
QuestState qs = null;
|
||||
switch (questId)
|
||||
@@ -321,7 +321,7 @@ final class Alarm extends AbstractNpcAI
|
||||
* @param slot the slot
|
||||
* @param memoStateEx the memo state ex
|
||||
*/
|
||||
private static final void setMemoStateEx(L2PcInstance player, int questId, int slot, int memoStateEx)
|
||||
private static void setMemoStateEx(L2PcInstance player, int questId, int slot, int memoStateEx)
|
||||
{
|
||||
QuestState qs = null;
|
||||
switch (questId)
|
||||
|
@@ -58,16 +58,16 @@ public final class AwakeningMaster extends AbstractNpcAI
|
||||
private static final int AEORE_MASTER = 33404;
|
||||
// Items
|
||||
private static final int SCROLL_OF_AFTERLIFE = 17600;
|
||||
private final static int ABELIUS_POWER = 32264;
|
||||
private final static int SAPYROS_POWER = 32265;
|
||||
private final static int ASHAGEN_POWER = 32266;
|
||||
private final static int CRANIGG_POWER = 32267;
|
||||
private final static int SOLTKREIG_POWER = 32268;
|
||||
private final static int NAVIAROPE_POWER = 32269;
|
||||
private final static int LEISTER_POWER = 32270;
|
||||
private final static int LAKCIS_POWER = 32271;
|
||||
private static final int ABELIUS_POWER = 32264;
|
||||
private static final int SAPYROS_POWER = 32265;
|
||||
private static final int ASHAGEN_POWER = 32266;
|
||||
private static final int CRANIGG_POWER = 32267;
|
||||
private static final int SOLTKREIG_POWER = 32268;
|
||||
private static final int NAVIAROPE_POWER = 32269;
|
||||
private static final int LEISTER_POWER = 32270;
|
||||
private static final int LAKCIS_POWER = 32271;
|
||||
// Other
|
||||
private final static int AWAKENING_END_USM_ID = 10;
|
||||
private static final int AWAKENING_END_USM_ID = 10;
|
||||
|
||||
private AwakeningMaster()
|
||||
{
|
||||
|
@@ -56,7 +56,7 @@ final class BlackJudge extends AbstractNpcAI
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
String htmltext = null;
|
||||
final int level = ((player.getExpertiseLevel() < 5) ? player.getExpertiseLevel() : 5);
|
||||
final int level = (player.getExpertiseLevel() < 5) ? player.getExpertiseLevel() : 5;
|
||||
switch (event)
|
||||
{
|
||||
case "remove_info":
|
||||
|
@@ -140,7 +140,7 @@ final class CastleAmbassador extends AbstractNpcAI
|
||||
|
||||
if (player.isClanLeader() && (player.getClanId() == fortOwner))
|
||||
{
|
||||
htmltext = (fortresss.isBorderFortress()) ? "ambassador-01.html" : "ambassador.html";
|
||||
htmltext = fortresss.isBorderFortress() ? "ambassador-01.html" : "ambassador.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -65,7 +65,7 @@ final class CastleBlacksmith extends AbstractNpcAI
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
return (hasRights(player, npc)) ? npc.getId() + "-01.html" : "no.html";
|
||||
return hasRights(player, npc) ? npc.getId() + "-01.html" : "no.html";
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
@@ -725,7 +725,7 @@ final class CastleChamberlain extends AbstractNpcAI
|
||||
{
|
||||
if (isOwner(player, npc) && player.hasClanPrivilege(ClanPrivilege.CS_TAXES))
|
||||
{
|
||||
final long amount = (st.hasMoreTokens()) ? Long.parseLong(st.nextToken()) : 0;
|
||||
final long amount = st.hasMoreTokens() ? Long.parseLong(st.nextToken()) : 0;
|
||||
if ((amount > 0) && (amount < Inventory.MAX_ADENA))
|
||||
{
|
||||
if (player.getAdena() >= amount)
|
||||
@@ -750,10 +750,10 @@ final class CastleChamberlain extends AbstractNpcAI
|
||||
{
|
||||
if (isOwner(player, npc) && player.hasClanPrivilege(ClanPrivilege.CS_TAXES))
|
||||
{
|
||||
final long amount = (st.hasMoreTokens()) ? Long.parseLong(st.nextToken()) : 0;
|
||||
final long amount = st.hasMoreTokens() ? Long.parseLong(st.nextToken()) : 0;
|
||||
if (amount <= castle.getTreasury())
|
||||
{
|
||||
castle.addToTreasuryNoTax((-1) * amount);
|
||||
castle.addToTreasuryNoTax(-1 * amount);
|
||||
giveAdena(player, amount, false);
|
||||
htmltext = "chamberlain-01.html";
|
||||
}
|
||||
@@ -851,12 +851,12 @@ final class CastleChamberlain extends AbstractNpcAI
|
||||
}
|
||||
else
|
||||
{
|
||||
final boolean open = (Integer.parseInt(st.nextToken()) == 1);
|
||||
final boolean open = Integer.parseInt(st.nextToken()) == 1;
|
||||
while (st.hasMoreTokens())
|
||||
{
|
||||
castle.openCloseDoor(player, Integer.parseInt(st.nextToken()), open);
|
||||
}
|
||||
htmltext = (open ? "chamberlain-05.html" : "chamberlain-06.html");
|
||||
htmltext = open ? "chamberlain-05.html" : "chamberlain-06.html";
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -972,13 +972,13 @@ final class CastleChamberlain extends AbstractNpcAI
|
||||
{
|
||||
htmltext = "chamberlain-21.html";
|
||||
}
|
||||
else if (castle.getFunction(Castle.FUNC_TELEPORT) == null)
|
||||
else if (castle.getFunction(Castle.FUNC_TELEPORT) != null)
|
||||
{
|
||||
htmltext = "castlefuncdisabled.html";
|
||||
htmltext = npc.getCastle().getName() + "-t" + castle.getFunction(Castle.FUNC_TELEPORT).getLvl() + ".html";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = npc.getCastle().getName() + "-t" + castle.getFunction(Castle.FUNC_TELEPORT).getLvl() + ".html";
|
||||
htmltext = "castlefuncdisabled.html";
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1164,7 +1164,7 @@ final class CastleChamberlain extends AbstractNpcAI
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
return (isOwner(player, npc)) ? "chamberlain-01.html" : "chamberlain-04.html";
|
||||
return isOwner(player, npc) ? "chamberlain-01.html" : "chamberlain-04.html";
|
||||
}
|
||||
|
||||
// @formatter:off
|
||||
|
@@ -68,16 +68,13 @@ final class CastleSiegeManager extends AbstractNpcAI
|
||||
{
|
||||
htmltext = "CastleSiegeManager-02.html";
|
||||
}
|
||||
else if (npc.getConquerableHall() != null)
|
||||
{
|
||||
npc.getConquerableHall().showSiegeInfo(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (npc.getConquerableHall() != null)
|
||||
{
|
||||
npc.getConquerableHall().showSiegeInfo(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.getCastle().getSiege().listRegisterClan(player);
|
||||
}
|
||||
npc.getCastle().getSiege().listRegisterClan(player);
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
@@ -92,7 +92,7 @@ final class CastleTeleporter extends AbstractNpcAI
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
final Siege siege = npc.getCastle().getSiege();
|
||||
return (npc.isScriptValue(0)) ? (siege.isInProgress() && (siege.getControlTowerCount() == 0)) ? "teleporter-02.html" : "teleporter-01.html" : "teleporter-03.html";
|
||||
return npc.isScriptValue(0) ? (siege.isInProgress() && (siege.getControlTowerCount() == 0)) ? "teleporter-02.html" : "teleporter-01.html" : "teleporter-03.html";
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
@@ -66,7 +66,7 @@ final class CastleWarehouse extends AbstractNpcAI
|
||||
}
|
||||
case "warehouse-04.html":
|
||||
{
|
||||
htmltext = (!npc.isMyLord(player)) ? "warehouse-no.html" : getHtm(player.getHtmlPrefix(), "warehouse-04.html").replace("%blood%", Integer.toString(player.getClan().getBloodAllianceCount()));
|
||||
htmltext = !npc.isMyLord(player) ? "warehouse-no.html" : getHtm(player.getHtmlPrefix(), "warehouse-04.html").replace("%blood%", Integer.toString(player.getClan().getBloodAllianceCount()));
|
||||
break;
|
||||
}
|
||||
case "Receive":
|
||||
|
@@ -119,7 +119,7 @@ final class DragonVortex extends AbstractNpcAI
|
||||
if (!unspawnedRaids.isEmpty())
|
||||
{
|
||||
final int unspawnedRaidsSize = unspawnedRaids.size();
|
||||
final int chanceIncrease = (raidChanceIncrease / unspawnedRaidsSize);
|
||||
final int chanceIncrease = raidChanceIncrease / unspawnedRaidsSize;
|
||||
int raidChanceValue = 0;
|
||||
|
||||
for (int[] unspawnedRaidsList : unspawnedRaids)
|
||||
@@ -172,7 +172,7 @@ final class DragonVortex extends AbstractNpcAI
|
||||
for (L2Spawn spawn : SpawnTable.getInstance().getSpawns(npcId))
|
||||
{
|
||||
final L2Npc spawnedWarpgate = spawn.getLastSpawn();
|
||||
if ((spawnedWarpgate != null))
|
||||
if (spawnedWarpgate != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@@ -135,33 +135,29 @@ final class ForgeOfTheGods extends AbstractNpcAI
|
||||
mob = spawnLavasaurus(npc, rand, LAVASAURUSES[2], LAVASAURUSES[1]);
|
||||
}
|
||||
}
|
||||
else
|
||||
// if (_npcsAlive < 32)
|
||||
else if ((_npcCount > BONUS_UPPER_LV05) && (rand <= FORGE_BONUS02))
|
||||
{
|
||||
if ((_npcCount > BONUS_UPPER_LV05) && (rand <= FORGE_BONUS02))
|
||||
{
|
||||
mob = addSpawn(LAVASAURUSES[1], npc, true);
|
||||
}
|
||||
else if (_npcCount > BONUS_UPPER_LV04)
|
||||
{
|
||||
mob = spawnLavasaurus(npc, rand, LAVASAURUSES[4], LAVASAURUSES[3]);
|
||||
}
|
||||
else if (_npcCount > BONUS_UPPER_LV03)
|
||||
{
|
||||
mob = spawnLavasaurus(npc, rand, LAVASAURUSES[3], LAVASAURUSES[2]);
|
||||
}
|
||||
else if (_npcCount > BONUS_UPPER_LV02)
|
||||
{
|
||||
mob = spawnLavasaurus(npc, rand, LAVASAURUSES[2], LAVASAURUSES[1]);
|
||||
}
|
||||
else if (_npcCount > BONUS_UPPER_LV01)
|
||||
{
|
||||
mob = spawnLavasaurus(npc, rand, LAVASAURUSES[1], LAVASAURUSES[0]);
|
||||
}
|
||||
else if ((_npcCount >= MOBCOUNT_BONUS_MIN) && (rand <= FORGE_BONUS01))
|
||||
{
|
||||
mob = addSpawn(LAVASAURUSES[0], npc, true);
|
||||
}
|
||||
mob = addSpawn(LAVASAURUSES[1], npc, true);
|
||||
}
|
||||
else if (_npcCount > BONUS_UPPER_LV04)
|
||||
{
|
||||
mob = spawnLavasaurus(npc, rand, LAVASAURUSES[4], LAVASAURUSES[3]);
|
||||
}
|
||||
else if (_npcCount > BONUS_UPPER_LV03)
|
||||
{
|
||||
mob = spawnLavasaurus(npc, rand, LAVASAURUSES[3], LAVASAURUSES[2]);
|
||||
}
|
||||
else if (_npcCount > BONUS_UPPER_LV02)
|
||||
{
|
||||
mob = spawnLavasaurus(npc, rand, LAVASAURUSES[2], LAVASAURUSES[1]);
|
||||
}
|
||||
else if (_npcCount > BONUS_UPPER_LV01)
|
||||
{
|
||||
mob = spawnLavasaurus(npc, rand, LAVASAURUSES[1], LAVASAURUSES[0]);
|
||||
}
|
||||
else if ((_npcCount >= MOBCOUNT_BONUS_MIN) && (rand <= FORGE_BONUS01))
|
||||
{
|
||||
mob = addSpawn(LAVASAURUSES[0], npc, true);
|
||||
}
|
||||
if (mob != null)
|
||||
{
|
||||
|
@@ -106,7 +106,7 @@ final class FortressSiegeManager extends AbstractNpcAI
|
||||
{
|
||||
htmltext = "FortressSiegeManager-10.html";
|
||||
}
|
||||
else if ((clan.getLevel() < FortSiegeManager.getInstance().getSiegeClanMinLevel()))
|
||||
else if (clan.getLevel() < FortSiegeManager.getInstance().getSiegeClanMinLevel())
|
||||
{
|
||||
htmltext = "FortressSiegeManager-04.html";
|
||||
}
|
||||
|
@@ -51,7 +51,7 @@ final class Hardin extends AbstractNpcAI
|
||||
{
|
||||
htmltext = "33870-01.html";
|
||||
}
|
||||
else if ((player.getRace() != Race.ERTHEIA) && (CategoryData.getInstance().isInCategory(CategoryType.AWAKEN_GROUP, player.getBaseClassId())))
|
||||
else if ((player.getRace() != Race.ERTHEIA) && CategoryData.getInstance().isInCategory(CategoryType.AWAKEN_GROUP, player.getBaseClassId()))
|
||||
{
|
||||
htmltext = "33870-02.html";
|
||||
}
|
||||
|
@@ -102,7 +102,7 @@ final class KetraOrcSupport extends AbstractNpcAI
|
||||
{
|
||||
if (hasQuestItems(player, KETRA_MARKS[i]))
|
||||
{
|
||||
return (i + 1);
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@@ -112,7 +112,7 @@ final class LaVieEnRose extends AbstractNpcAI
|
||||
@Override
|
||||
public String onSpawn(L2Npc npc)
|
||||
{
|
||||
startQuestTimer("SPAM_TEXT", (5 * 60 * 1000), npc, null, true);
|
||||
startQuestTimer("SPAM_TEXT", 5 * 60 * 1000, npc, null, true);
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
|
||||
|
@@ -71,7 +71,7 @@ public final class MentorGuide extends AbstractNpcAI implements IXmlReader
|
||||
private static final int DIPLOMA = 33805;
|
||||
|
||||
// Skills
|
||||
private final static SkillHolder[] MENTEE_BUFFS =
|
||||
private static final SkillHolder[] MENTEE_BUFFS =
|
||||
{
|
||||
new SkillHolder(9227, 1), // Mentor's Poem of Horn
|
||||
new SkillHolder(9228, 1), // Mentor's Poem of Drum
|
||||
|
@@ -208,7 +208,7 @@ final class Minigame extends AbstractNpcAI
|
||||
|
||||
if (npc.getTarget() == null)
|
||||
{
|
||||
htmltext = (miniGameStarted ? "32758-08.html" : "32758.html");
|
||||
htmltext = miniGameStarted ? "32758-08.html" : "32758.html";
|
||||
}
|
||||
else if (npc.getTarget() == talker)
|
||||
{
|
||||
@@ -291,23 +291,20 @@ final class Minigame extends AbstractNpcAI
|
||||
startQuestTimer("end", 4000, room.getManager(), null);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (room.getAttemptNumber() == MAX_ATTEMPTS)
|
||||
{
|
||||
if (room.getAttemptNumber() == MAX_ATTEMPTS)
|
||||
{
|
||||
broadcastNpcSay(room.getManager(), ChatType.NPC_GENERAL, NpcStringId.I_VE_FAILED_ANY_FURTHER_ATTEMPTS_WOULD_BE_WASTEFUL);
|
||||
room.burnThemAll();
|
||||
startQuestTimer("off", 2000, room.getManager(), null);
|
||||
room.getParticipant().removeListenerIf(EventType.ON_CREATURE_SKILL_USE, listener -> listener.getOwner() == room);
|
||||
startQuestTimer("end", 4000, room.getManager(), null);
|
||||
}
|
||||
else if (room.getAttemptNumber() < MAX_ATTEMPTS)
|
||||
{
|
||||
broadcastNpcSay(room.getManager(), ChatType.NPC_GENERAL, NpcStringId.TOO_BAD_I_WILL_NOT_GIVE_UP_ON_THIS_THOUGH);
|
||||
room.burnThemAll();
|
||||
startQuestTimer("off", 2000, room.getManager(), null);
|
||||
room.setAttemptNumber(room.getAttemptNumber() + 1);
|
||||
}
|
||||
broadcastNpcSay(room.getManager(), ChatType.NPC_GENERAL, NpcStringId.I_VE_FAILED_ANY_FURTHER_ATTEMPTS_WOULD_BE_WASTEFUL);
|
||||
room.burnThemAll();
|
||||
startQuestTimer("off", 2000, room.getManager(), null);
|
||||
room.getParticipant().removeListenerIf(EventType.ON_CREATURE_SKILL_USE, listener -> listener.getOwner() == room);
|
||||
startQuestTimer("end", 4000, room.getManager(), null);
|
||||
}
|
||||
else if (room.getAttemptNumber() < MAX_ATTEMPTS)
|
||||
{
|
||||
broadcastNpcSay(room.getManager(), ChatType.NPC_GENERAL, NpcStringId.TOO_BAD_I_WILL_NOT_GIVE_UP_ON_THIS_THOUGH);
|
||||
room.burnThemAll();
|
||||
startQuestTimer("off", 2000, room.getManager(), null);
|
||||
room.setAttemptNumber(room.getAttemptNumber() + 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@@ -76,12 +76,9 @@ class NpcBufferAI implements Runnable
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (Util.checkIfInRange(skill.getAffectRange(), _npc, player, true) && !player.isDead())
|
||||
{
|
||||
if (Util.checkIfInRange(skill.getAffectRange(), _npc, player, true) && !player.isDead())
|
||||
{
|
||||
skill.applyEffects(player, player);
|
||||
}
|
||||
skill.applyEffects(player, player);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@@ -66,14 +66,14 @@ public final class Raina extends AbstractNpcAI
|
||||
private static final int RAINA = 33491;
|
||||
// Items
|
||||
private static final int SUBCLASS_CERTIFICATE = 30433;
|
||||
private final static int ABELIUS_POWER = 32264;
|
||||
private final static int SAPYROS_POWER = 32265;
|
||||
private final static int ASHAGEN_POWER = 32266;
|
||||
private final static int CRANIGG_POWER = 32267;
|
||||
private final static int SOLTKREIG_POWER = 32268;
|
||||
private final static int NAVIAROPE_POWER = 32269;
|
||||
private final static int LEISTER_POWER = 32270;
|
||||
private final static int LAKCIS_POWER = 32271;
|
||||
private static final int ABELIUS_POWER = 32264;
|
||||
private static final int SAPYROS_POWER = 32265;
|
||||
private static final int ASHAGEN_POWER = 32266;
|
||||
private static final int CRANIGG_POWER = 32267;
|
||||
private static final int SOLTKREIG_POWER = 32268;
|
||||
private static final int NAVIAROPE_POWER = 32269;
|
||||
private static final int LEISTER_POWER = 32270;
|
||||
private static final int LAKCIS_POWER = 32271;
|
||||
// Misc
|
||||
private static final Set<PlayerClass> mainSubclassSet;
|
||||
private static final Set<PlayerClass> neverSubclassed = EnumSet.of(PlayerClass.Overlord, PlayerClass.Warsmith);
|
||||
@@ -529,7 +529,7 @@ public final class Raina extends AbstractNpcAI
|
||||
case 5: // Reawaken (change dual class)
|
||||
{
|
||||
final int classId = event.getReply();
|
||||
if (player.isTransformed() || player.hasSummon() || (!player.hasDualClass() || !player.isDualClassActive() || (player.getClassId().level() != ClassLevel.AWAKEN.ordinal())))
|
||||
if (player.isTransformed() || player.hasSummon() || !player.hasDualClass() || !player.isDualClassActive() || (player.getClassId().level() != ClassLevel.AWAKEN.ordinal()))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -549,7 +549,7 @@ public final class Raina extends AbstractNpcAI
|
||||
break;
|
||||
}
|
||||
|
||||
player.reduceAdena((getClass().getSimpleName() + "_Reawaken"), REAWAKEN_PRICE[index], npc, true);
|
||||
player.reduceAdena(getClass().getSimpleName() + "_Reawaken", REAWAKEN_PRICE[index], npc, true);
|
||||
takeItems(player, getCloakId(player), 1);
|
||||
|
||||
final int classIndex = player.getClassIndex();
|
||||
|
@@ -48,11 +48,11 @@ final class Sirra extends AbstractNpcAI
|
||||
|
||||
if ((world != null) && (world.getTemplateId() == FREYA_INSTID))
|
||||
{
|
||||
return (world.isStatus(0)) ? "32762-easy.html" : "32762-easyfight.html";
|
||||
return world.isStatus(0) ? "32762-easy.html" : "32762-easyfight.html";
|
||||
}
|
||||
else if ((world != null) && (world.getTemplateId() == FREYA_HARD_INSTID))
|
||||
{
|
||||
return (world.isStatus(0)) ? "32762-hard.html" : "32762-hardfight.html";
|
||||
return world.isStatus(0) ? "32762-hard.html" : "32762-hardfight.html";
|
||||
}
|
||||
return "32762.html";
|
||||
}
|
||||
|
@@ -78,7 +78,7 @@ final class DelusionTeleport extends AbstractNpcAI
|
||||
if (npc.getId() == NPCS[0]) // Pathfinder Worker
|
||||
{
|
||||
final L2TownZone town = TownManager.getTown(npc.getX(), npc.getY(), npc.getZ());
|
||||
final int townId = ((town == null) ? 0 : town.getTownId());
|
||||
final int townId = (town == null) ? 0 : town.getTownId();
|
||||
player.getVariables().set(DELUSION_RETURN, townId);
|
||||
player.teleToLocation(HALL_LOCATIONS[getRandom(HALL_LOCATIONS.length)], false);
|
||||
}
|
||||
|
@@ -28,14 +28,14 @@ import ai.npc.AbstractNpcAI;
|
||||
final class DimensionalWarpTeleport extends AbstractNpcAI
|
||||
{
|
||||
// NPC
|
||||
private final static int RESED = 33974;
|
||||
private static final int RESED = 33974;
|
||||
// Misc
|
||||
private final static int MIN_LEVEL = 99;
|
||||
private static final int MIN_LEVEL = 99;
|
||||
// Items
|
||||
private final static int WARP_CRYSTAL = 39597;
|
||||
private final static int WARP_CRYSTAL_COUNT = 3;
|
||||
private static final int WARP_CRYSTAL = 39597;
|
||||
private static final int WARP_CRYSTAL_COUNT = 3;
|
||||
// Location
|
||||
private final static Location DIMENSIONAL_WARP = new Location(-76785, -217420, 4016);
|
||||
private static final Location DIMENSIONAL_WARP = new Location(-76785, -217420, 4016);
|
||||
|
||||
private DimensionalWarpTeleport()
|
||||
{
|
||||
@@ -47,7 +47,7 @@ final class DimensionalWarpTeleport extends AbstractNpcAI
|
||||
@Override
|
||||
public String onTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if ((hasQuestItems(player, WARP_CRYSTAL)) && (player.getLevel() >= MIN_LEVEL) && (getQuestItemsCount(player, WARP_CRYSTAL) >= WARP_CRYSTAL_COUNT) && (player.isAwaken()))
|
||||
if (hasQuestItems(player, WARP_CRYSTAL) && (player.getLevel() >= MIN_LEVEL) && (getQuestItemsCount(player, WARP_CRYSTAL) >= WARP_CRYSTAL_COUNT) && player.isAwaken())
|
||||
{
|
||||
takeItems(player, WARP_CRYSTAL, 3);
|
||||
player.teleToLocation(DIMENSIONAL_WARP);
|
||||
|
@@ -28,11 +28,11 @@ import ai.npc.AbstractNpcAI;
|
||||
final class HarnakUnderground extends AbstractNpcAI
|
||||
{
|
||||
// NPC
|
||||
private final static int HADEL = 33344;
|
||||
private static final int HADEL = 33344;
|
||||
// Misc
|
||||
private final static int MIN_LEVEL = 85;
|
||||
private static final int MIN_LEVEL = 85;
|
||||
// Location
|
||||
private final static Location HARNAK_UNDERGROUND = new Location(-114700, 147909, -7720);
|
||||
private static final Location HARNAK_UNDERGROUND = new Location(-114700, 147909, -7720);
|
||||
|
||||
private HarnakUnderground()
|
||||
{
|
||||
@@ -44,7 +44,7 @@ final class HarnakUnderground extends AbstractNpcAI
|
||||
@Override
|
||||
public String onTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
if ((player.getLevel() >= MIN_LEVEL) && (player.isAwaken()))
|
||||
if ((player.getLevel() >= MIN_LEVEL) && player.isAwaken())
|
||||
{
|
||||
player.teleToLocation(HARNAK_UNDERGROUND);
|
||||
}
|
||||
|
@@ -28,13 +28,13 @@ import ai.npc.AbstractNpcAI;
|
||||
final class KargosTeleport extends AbstractNpcAI
|
||||
{
|
||||
// NPC
|
||||
private final static int KARGOS = 33821;
|
||||
private static final int KARGOS = 33821;
|
||||
// Items
|
||||
private final static int PAGAN_MARK = 8067;
|
||||
private final static int VISITOR_MARK = 8064;
|
||||
private static final int PAGAN_MARK = 8067;
|
||||
private static final int VISITOR_MARK = 8064;
|
||||
// Locations
|
||||
private final static Location PAGAN_TEMPLE = new Location(-16350, -37579, -10725);
|
||||
private final static Location PAGAN_ROOM = new Location(-12766, -35840, -10851);
|
||||
private static final Location PAGAN_TEMPLE = new Location(-16350, -37579, -10725);
|
||||
private static final Location PAGAN_ROOM = new Location(-12766, -35840, -10851);
|
||||
|
||||
private KargosTeleport()
|
||||
{
|
||||
|
@@ -29,7 +29,7 @@ import ai.npc.AbstractNpcAI;
|
||||
final class MithrilMinesTeleporter extends AbstractNpcAI
|
||||
{
|
||||
// NPC
|
||||
private final static int TELEPORT_CRYSTAL = 32652;
|
||||
private static final int TELEPORT_CRYSTAL = 32652;
|
||||
// Location
|
||||
private static final Location[] LOCS =
|
||||
{
|
||||
|
@@ -31,7 +31,7 @@ import quests.Q00240_ImTheOnlyOneYouCanTrust.Q00240_ImTheOnlyOneYouCanTrust;
|
||||
final class StakatoNestTeleporter extends AbstractNpcAI
|
||||
{
|
||||
// Locations
|
||||
private final static Location[] LOCS =
|
||||
private static final Location[] LOCS =
|
||||
{
|
||||
new Location(80456, -52322, -5640),
|
||||
new Location(88718, -46214, -4640),
|
||||
@@ -40,7 +40,7 @@ final class StakatoNestTeleporter extends AbstractNpcAI
|
||||
new Location(87682, -43291, -4128)
|
||||
};
|
||||
// NPC
|
||||
private final static int KINTAIJIN = 32640;
|
||||
private static final int KINTAIJIN = 32640;
|
||||
|
||||
private StakatoNestTeleporter()
|
||||
{
|
||||
@@ -77,7 +77,7 @@ final class StakatoNestTeleporter extends AbstractNpcAI
|
||||
public String onTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
final QuestState accessQuest = player.getQuestState(Q00240_ImTheOnlyOneYouCanTrust.class.getSimpleName());
|
||||
return (((accessQuest != null) && accessQuest.isCompleted()) ? "32640.htm" : "32640-no.htm");
|
||||
return ((accessQuest != null) && accessQuest.isCompleted()) ? "32640.htm" : "32640-no.htm";
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
@@ -29,7 +29,7 @@ import ai.npc.AbstractNpcAI;
|
||||
final class StrongholdsTeleports extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private final static int[] NPCs =
|
||||
private static final int[] NPCs =
|
||||
{
|
||||
32181,
|
||||
32184,
|
||||
|
@@ -30,14 +30,14 @@ import ai.npc.AbstractNpcAI;
|
||||
final class TeleportWithCharm extends AbstractNpcAI
|
||||
{
|
||||
// NPCs
|
||||
private final static int WHIRPY = 30540;
|
||||
private final static int TAMIL = 30576;
|
||||
private static final int WHIRPY = 30540;
|
||||
private static final int TAMIL = 30576;
|
||||
// Items
|
||||
private final static int ORC_GATEKEEPER_CHARM = 1658;
|
||||
private final static int DWARF_GATEKEEPER_TOKEN = 1659;
|
||||
private static final int ORC_GATEKEEPER_CHARM = 1658;
|
||||
private static final int DWARF_GATEKEEPER_TOKEN = 1659;
|
||||
// Locations
|
||||
private final static Location ORC_TELEPORT = new Location(-80826, 149775, -3043);
|
||||
private final static Location DWARF_TELEPORT = new Location(-80826, 149775, -3043);
|
||||
private static final Location ORC_TELEPORT = new Location(-80826, 149775, -3043);
|
||||
private static final Location DWARF_TELEPORT = new Location(-80826, 149775, -3043);
|
||||
|
||||
private TeleportWithCharm()
|
||||
{
|
||||
|
@@ -188,7 +188,7 @@ final class HealerTrainer extends AbstractNpcAI
|
||||
itemId = -1;
|
||||
}
|
||||
}
|
||||
return (player.getInventory().getInventoryItemCount(itemId, -1) > 0);
|
||||
return player.getInventory().getInventoryItemCount(itemId, -1) > 0;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
@@ -91,12 +91,9 @@ final class FirstClassTransferTalk extends AbstractNpcAI
|
||||
htmltext += "mystic.html";
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (npc instanceof L2VillageMasterFighterInstance)
|
||||
{
|
||||
if (npc instanceof L2VillageMasterFighterInstance)
|
||||
{
|
||||
htmltext += "fighter.html";
|
||||
}
|
||||
htmltext += "fighter.html";
|
||||
}
|
||||
}
|
||||
else if (player.getClassId().level() == 1)
|
||||
|
@@ -284,23 +284,17 @@ final class WyvernManager extends AbstractNpcAI
|
||||
{
|
||||
htmltext = "wyvernmanager-02.html";
|
||||
}
|
||||
else if (Config.ALLOW_WYVERN_ALWAYS)
|
||||
{
|
||||
htmltext = replaceAll(npc, player.getHtmlPrefix());
|
||||
}
|
||||
else if (MANAGERS.get(npc.getId()) == ManagerType.CASTLE)
|
||||
{
|
||||
htmltext = "wyvernmanager-dusk.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Config.ALLOW_WYVERN_ALWAYS)
|
||||
{
|
||||
htmltext = replaceAll(npc, player.getHtmlPrefix());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (MANAGERS.get(npc.getId()) == ManagerType.CASTLE)
|
||||
{
|
||||
htmltext = "wyvernmanager-dusk.html";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = replaceAll(npc, player.getHtmlPrefix());
|
||||
}
|
||||
}
|
||||
htmltext = replaceAll(npc, player.getHtmlPrefix());
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
Reference in New Issue
Block a user