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;
|
||||
}
|
||||
|
@@ -84,7 +84,7 @@ final class DevastatedCastle extends ClanHallSiegeEngine
|
||||
final int id = clan.getId();
|
||||
if (_damageToGustav.containsKey(id))
|
||||
{
|
||||
_damageToGustav.put(id, (_damageToGustav.get(id) + damage));
|
||||
_damageToGustav.put(id, _damageToGustav.get(id) + damage);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -117,7 +117,7 @@ final class FortressOfResistance extends ClanHallSiegeEngine
|
||||
final int clanId = player.getClanId();
|
||||
if (clanId > 0)
|
||||
{
|
||||
_damageToNurka.put(clanId, ((_damageToNurka.containsKey(clanId)) ? _damageToNurka.get(clanId) + damage : damage));
|
||||
_damageToNurka.put(clanId, _damageToNurka.containsKey(clanId) ? _damageToNurka.get(clanId) + damage : damage);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@@ -91,7 +91,7 @@ final class FortressOfTheDead extends ClanHallSiegeEngine
|
||||
final int id = clan.getId();
|
||||
if ((id > 0) && _damageToLidia.containsKey(id))
|
||||
{
|
||||
_damageToLidia.put(id, (_damageToLidia.get(id) + damage));
|
||||
_damageToLidia.put(id, _damageToLidia.get(id) + damage);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -156,7 +156,7 @@ final class FortressOfTheDead extends ClanHallSiegeEngine
|
||||
if ((hoursLeft < 0) || (hoursLeft > 6))
|
||||
{
|
||||
cancelSiegeTask();
|
||||
_siegeTask = ThreadPoolManager.getInstance().scheduleGeneral(new SiegeStarts(), ((24 - hoursLeft) * 10 * 60000));
|
||||
_siegeTask = ThreadPoolManager.getInstance().scheduleGeneral(new SiegeStarts(), (24 - hoursLeft) * 10 * 60000);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -805,7 +805,7 @@ final class RainbowSpringsChateau extends ClanHallSiegeEngine
|
||||
else
|
||||
{
|
||||
_usedTextPassages.put(_textPassages[randomPos], new ArrayList<L2Clan>());
|
||||
npc.broadcastPacket((new NpcSay(npc.getObjectId(), ChatType.NPC_SHOUT, npc.getId(), _textPassages[randomPos])));
|
||||
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_SHOUT, npc.getId(), _textPassages[randomPos]));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -61,7 +61,7 @@ final class FactionManager extends AbstractNpcAI
|
||||
{
|
||||
case "selectGoodFaction":
|
||||
{
|
||||
if (Config.FACTION_BALANCE_ONLINE_PLAYERS && (L2World.getInstance().getAllGoodPlayersCount() >= ((L2World.getInstance().getAllEvilPlayersCount() + Config.FACTION_BALANCE_PLAYER_EXCEED_LIMIT))))
|
||||
if (Config.FACTION_BALANCE_ONLINE_PLAYERS && (L2World.getInstance().getAllGoodPlayersCount() >= (L2World.getInstance().getAllEvilPlayersCount() + Config.FACTION_BALANCE_PLAYER_EXCEED_LIMIT)))
|
||||
{
|
||||
final String htmltext = null;
|
||||
final NpcHtmlMessage packet = new NpcHtmlMessage(npc.getObjectId());
|
||||
@@ -88,7 +88,7 @@ final class FactionManager extends AbstractNpcAI
|
||||
}
|
||||
case "selectEvilFaction":
|
||||
{
|
||||
if (Config.FACTION_BALANCE_ONLINE_PLAYERS && (L2World.getInstance().getAllEvilPlayersCount() >= ((L2World.getInstance().getAllGoodPlayersCount() + Config.FACTION_BALANCE_PLAYER_EXCEED_LIMIT))))
|
||||
if (Config.FACTION_BALANCE_ONLINE_PLAYERS && (L2World.getInstance().getAllEvilPlayersCount() >= (L2World.getInstance().getAllGoodPlayersCount() + Config.FACTION_BALANCE_PLAYER_EXCEED_LIMIT)))
|
||||
{
|
||||
final String htmltext = null;
|
||||
final NpcHtmlMessage packet = new NpcHtmlMessage(npc.getObjectId());
|
||||
|
@@ -220,7 +220,7 @@ final class Elpies extends Event
|
||||
}
|
||||
}
|
||||
|
||||
private static final void dropItem(L2Npc mob, L2PcInstance player, int[][] droplist)
|
||||
private static void dropItem(L2Npc mob, L2PcInstance player, int[][] droplist)
|
||||
{
|
||||
final int chance = getRandom(100);
|
||||
|
||||
|
@@ -138,7 +138,7 @@ final class TvTManager extends AbstractNpcAI implements IVoicedCommandHandler
|
||||
{
|
||||
final boolean isParticipant = TvTEvent.isPlayerParticipant(player.getObjectId());
|
||||
final int[] teamsPlayerCounts = TvTEvent.getTeamsPlayerCounts();
|
||||
htmltext = getHtm(player.getHtmlPrefix(), (!isParticipant ? "Participation.html" : "RemoveParticipation.html"));
|
||||
htmltext = getHtm(player.getHtmlPrefix(), !isParticipant ? "Participation.html" : "RemoveParticipation.html");
|
||||
htmltext = htmltext.replaceAll("%objectId%", String.valueOf(npc.getObjectId()));
|
||||
htmltext = htmltext.replaceAll("%team1name%", Config.TVT_EVENT_TEAM_1_NAME);
|
||||
htmltext = htmltext.replaceAll("%team1playercount%", String.valueOf(teamsPlayerCounts[0]));
|
||||
|
@@ -31,7 +31,7 @@ final class CharacterBirthday extends Quest
|
||||
private static final int ALEGRIA = 32600;
|
||||
private static int SPAWNS = 0;
|
||||
|
||||
private final static int[] GK =
|
||||
private static final int[] GK =
|
||||
{
|
||||
30006,
|
||||
30059,
|
||||
|
@@ -131,12 +131,9 @@ final class FreyaCelebration extends LongTimeEvent
|
||||
|
||||
caster.addItem("FreyaCelebration", FREYA_GIFT, 1, npc, true);
|
||||
}
|
||||
else
|
||||
else if (getRandom(10) < 2)
|
||||
{
|
||||
if (getRandom(10) < 2)
|
||||
{
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), FREYA_TEXT[getRandom(FREYA_TEXT.length - 1)]));
|
||||
}
|
||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), FREYA_TEXT[getRandom(FREYA_TEXT.length - 1)]));
|
||||
}
|
||||
}
|
||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||
|
@@ -123,7 +123,7 @@ final class GiftOfVitality extends LongTimeEvent
|
||||
}
|
||||
else
|
||||
{
|
||||
final SkillHolder[] skills = (player.isMageClass()) ? MAGE_SKILLS : FIGHTER_SKILLS;
|
||||
final SkillHolder[] skills = player.isMageClass() ? MAGE_SKILLS : FIGHTER_SKILLS;
|
||||
npc.setTarget(player);
|
||||
for (SkillHolder sk : skills)
|
||||
{
|
||||
|
@@ -27,20 +27,20 @@ import com.l2jmobius.gameserver.model.event.LongTimeEvent;
|
||||
*/
|
||||
final class HeavyMedal extends LongTimeEvent
|
||||
{
|
||||
private final static int CAT_ROY = 31228;
|
||||
private final static int CAT_WINNIE = 31229;
|
||||
private final static int GLITTERING_MEDAL = 6393;
|
||||
private static final int CAT_ROY = 31228;
|
||||
private static final int CAT_WINNIE = 31229;
|
||||
private static final int GLITTERING_MEDAL = 6393;
|
||||
|
||||
private final static int WIN_CHANCE = 50;
|
||||
private static final int WIN_CHANCE = 50;
|
||||
|
||||
private final static int[] MEDALS =
|
||||
private static final int[] MEDALS =
|
||||
{
|
||||
5,
|
||||
10,
|
||||
20,
|
||||
40
|
||||
};
|
||||
private final static int[] BADGES =
|
||||
private static final int[] BADGES =
|
||||
{
|
||||
6399,
|
||||
6400,
|
||||
|
@@ -134,21 +134,18 @@ final class MasterOfEnchanting extends LongTimeEvent
|
||||
player.sendPacket(sm);
|
||||
htmltext = "32599-scroll24.htm";
|
||||
}
|
||||
// Little glitch. There is no SystemMessage with seconds only.
|
||||
// If time is less than 1 minute player can buy scrolls
|
||||
else if (getQuestItemsCount(player, Inventory.ADENA_ID) > SCROLL_24_PRICE)
|
||||
{
|
||||
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
|
||||
giveItems(player, MASTER_YOGI_SCROLL, 24);
|
||||
saveGlobalQuestVar(player.getAccountName(), Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
|
||||
htmltext = "32599-scroll24.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
// Little glitch. There is no SystemMessage with seconds only.
|
||||
// If time is less than 1 minute player can buy scrolls
|
||||
if (getQuestItemsCount(player, Inventory.ADENA_ID) > SCROLL_24_PRICE)
|
||||
{
|
||||
takeItems(player, Inventory.ADENA_ID, SCROLL_24_PRICE);
|
||||
giveItems(player, MASTER_YOGI_SCROLL, 24);
|
||||
saveGlobalQuestVar(player.getAccountName(), Long.toString(System.currentTimeMillis() + (SCROLL_24_TIME * 3600000)));
|
||||
htmltext = "32599-scroll24.htm";
|
||||
}
|
||||
else
|
||||
{
|
||||
htmltext = "32599-s24-no.htm";
|
||||
}
|
||||
htmltext = "32599-s24-no.htm";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -73,7 +73,7 @@ final class ThePowerOfLove extends LongTimeEvent
|
||||
}
|
||||
case "ct":
|
||||
{
|
||||
if (!hasQuestItems(player, CT) && (!hasQuestItems(player, CH) && (!hasQuestItems(player, CC))))
|
||||
if (!hasQuestItems(player, CT) && !hasQuestItems(player, CH) && !hasQuestItems(player, CC))
|
||||
{
|
||||
giveItems(player, CT, 1);
|
||||
giveItems(player, CT_TRANSORM, 1);
|
||||
@@ -88,7 +88,7 @@ final class ThePowerOfLove extends LongTimeEvent
|
||||
}
|
||||
case "ch":
|
||||
{
|
||||
if (!hasQuestItems(player, CT) && (!hasQuestItems(player, CH) && (!hasQuestItems(player, CC))))
|
||||
if (!hasQuestItems(player, CT) && !hasQuestItems(player, CH) && !hasQuestItems(player, CC))
|
||||
{
|
||||
giveItems(player, CH, 1);
|
||||
giveItems(player, CH_TRANSORM, 1);
|
||||
@@ -103,7 +103,7 @@ final class ThePowerOfLove extends LongTimeEvent
|
||||
}
|
||||
case "cc":
|
||||
{
|
||||
if (!hasQuestItems(player, CT) && (!hasQuestItems(player, CH) && (!hasQuestItems(player, CC))))
|
||||
if (!hasQuestItems(player, CT) && !hasQuestItems(player, CH) && !hasQuestItems(player, CC))
|
||||
{
|
||||
giveItems(player, CC, 1);
|
||||
giveItems(player, CC_TRANSORM, 1);
|
||||
|
@@ -177,14 +177,13 @@ public class EnergySeeds extends AbstractNpcAI
|
||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||
}
|
||||
}
|
||||
caster.sendPacket(SystemMessageId.YOUR_COLLECTION_HAS_SUCCEEDED);
|
||||
if (getRandom(100) < 33)
|
||||
{
|
||||
caster.sendPacket(SystemMessageId.YOUR_COLLECTION_HAS_SUCCEEDED);
|
||||
caster.addItem("EnergySeed", itemId, getRandom(RATE + 1, 2 * RATE), null, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
caster.sendPacket(SystemMessageId.YOUR_COLLECTION_HAS_SUCCEEDED);
|
||||
caster.addItem("EnergySeed", itemId, getRandom(1, RATE), null, true);
|
||||
}
|
||||
seedCollectEvent(caster, npc, spawn._seedId);
|
||||
|
@@ -110,7 +110,7 @@ public class Lindvior extends AbstractNpcAI
|
||||
|
||||
private void scheduleNextLindviorVisit()
|
||||
{
|
||||
startQuestTimer("start", ((ALT_MODE) ? ALT_MODE_MIN * 60000 : scheduleNextLindviorDate()), null, null);
|
||||
startQuestTimer("start", ALT_MODE ? ALT_MODE_MIN * 60000 : scheduleNextLindviorDate(), null, null);
|
||||
}
|
||||
|
||||
private long scheduleNextLindviorDate()
|
||||
|
@@ -70,7 +70,7 @@ public final class ZealotOfShilen extends AbstractNpcAI
|
||||
@Override
|
||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
return (npc.isAttackingNow()) ? "32628-01.html" : npc.getId() + ".html";
|
||||
return npc.isAttackingNow() ? "32628-01.html" : npc.getId() + ".html";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -806,7 +806,7 @@ public final class Stage1 extends Quest
|
||||
if (!isSummon && (player != null))
|
||||
{
|
||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(player.getInstanceId());
|
||||
if ((tmpworld instanceof SOD1World) && (((SOD1World) tmpworld).getStatus() == 7) && spawnState(((SOD1World) tmpworld)))
|
||||
if ((tmpworld instanceof SOD1World) && (((SOD1World) tmpworld).getStatus() == 7) && spawnState((SOD1World) tmpworld))
|
||||
{
|
||||
for (int objId : ((SOD1World) tmpworld).getAllowed())
|
||||
{
|
||||
@@ -997,7 +997,7 @@ public final class Stage1 extends Quest
|
||||
if (npcId == ALENOS)
|
||||
{
|
||||
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
||||
if ((GraciaSeedsManager.getInstance().getSoDState() == 1) || ((world != null) && (world instanceof SOD1World)))
|
||||
if ((GraciaSeedsManager.getInstance().getSoDState() == 1) || (world instanceof SOD1World))
|
||||
{
|
||||
enterInstance(player, "SeedOfDestructionStage1.xml", ENTER_TELEPORT_1);
|
||||
}
|
||||
|
@@ -182,7 +182,6 @@ public final class HallOfSuffering extends AbstractNpcAI
|
||||
private static final int TEMPLATE_ID = 115;
|
||||
private static final int MIN_LEVEL = 75;
|
||||
private static final int MAX_LEVEL = 82;
|
||||
private static final boolean debug = false;
|
||||
|
||||
public HallOfSuffering()
|
||||
{
|
||||
@@ -198,11 +197,6 @@ public final class HallOfSuffering extends AbstractNpcAI
|
||||
|
||||
private static boolean checkConditions(L2PcInstance player)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
final L2Party party = player.getParty();
|
||||
if (party == null)
|
||||
{
|
||||
@@ -514,7 +508,7 @@ public final class HallOfSuffering extends AbstractNpcAI
|
||||
else if (event.equalsIgnoreCase("ressurectTwin"))
|
||||
{
|
||||
final Skill skill = SkillData.getInstance().getSkill(5824, 1);
|
||||
final L2Npc aliveTwin = (world.klanikus == npc ? world.klodekus : world.klanikus);
|
||||
final L2Npc aliveTwin = world.klanikus == npc ? world.klodekus : world.klanikus;
|
||||
npc.doRevive();
|
||||
npc.doCast(skill);
|
||||
npc.setCurrentHp(aliveTwin.getCurrentHp());
|
||||
|
@@ -398,16 +398,13 @@ public abstract class AirShipController extends Quest
|
||||
{
|
||||
_log.log(Level.WARNING, getName() + ": Fuel consumption not defined.");
|
||||
}
|
||||
else if (_teleportsTable.length != _fuelTable.length)
|
||||
{
|
||||
_log.log(Level.WARNING, getName() + ": Fuel consumption not match teleport list.");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_teleportsTable.length != _fuelTable.length)
|
||||
{
|
||||
_log.log(Level.WARNING, getName() + ": Fuel consumption not match teleport list.");
|
||||
}
|
||||
else
|
||||
{
|
||||
AirShipManager.getInstance().registerAirShipTeleportList(_dockZone, _locationId, _teleportsTable, _fuelTable);
|
||||
}
|
||||
AirShipManager.getInstance().registerAirShipTeleportList(_dockZone, _locationId, _teleportsTable, _fuelTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -537,13 +537,13 @@ final class MasterHandler
|
||||
// TODO: Add configuration options for this voiced commands:
|
||||
// CastleVCmd.class,
|
||||
// SetVCmd.class,
|
||||
(Config.L2JMOD_ALLOW_WEDDING ? Wedding.class : null),
|
||||
(Config.BANKING_SYSTEM_ENABLED ? Banking.class : null),
|
||||
(Config.L2JMOD_CHAT_ADMIN ? ChatAdmin.class : null),
|
||||
(Config.L2JMOD_MULTILANG_ENABLE && Config.L2JMOD_MULTILANG_VOICED_ALLOW ? Lang.class : null),
|
||||
(Config.L2JMOD_DEBUG_VOICE_COMMAND ? Debug.class : null),
|
||||
(Config.L2JMOD_ALLOW_CHANGE_PASSWORD ? ChangePassword.class : null),
|
||||
(Config.PREMIUM_SYSTEM_ENABLED ? Premium.class : null),
|
||||
Config.L2JMOD_ALLOW_WEDDING ? Wedding.class : null,
|
||||
Config.BANKING_SYSTEM_ENABLED ? Banking.class : null,
|
||||
Config.L2JMOD_CHAT_ADMIN ? ChatAdmin.class : null,
|
||||
Config.L2JMOD_MULTILANG_ENABLE && Config.L2JMOD_MULTILANG_VOICED_ALLOW ? Lang.class : null,
|
||||
Config.L2JMOD_DEBUG_VOICE_COMMAND ? Debug.class : null,
|
||||
Config.L2JMOD_ALLOW_CHANGE_PASSWORD ? ChangePassword.class : null,
|
||||
Config.PREMIUM_SYSTEM_ENABLED ? Premium.class : null,
|
||||
},
|
||||
{
|
||||
// Target Handlers
|
||||
|
@@ -89,41 +89,38 @@ public class L2PcInstanceAction implements IActionHandler
|
||||
{
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, player);
|
||||
}
|
||||
else
|
||||
// Check if this L2PcInstance is autoAttackable
|
||||
else if (player.isAutoAttackable(activeChar))
|
||||
{
|
||||
// Check if this L2PcInstance is autoAttackable
|
||||
if (player.isAutoAttackable(activeChar))
|
||||
if ((player.isCursedWeaponEquipped() && (activeChar.getLevel() < CURSED_WEAPON_VICTIM_MIN_LEVEL)) //
|
||||
|| (activeChar.isCursedWeaponEquipped() && (player.getLevel() < CURSED_WEAPON_VICTIM_MIN_LEVEL)))
|
||||
{
|
||||
if ((player.isCursedWeaponEquipped() && (activeChar.getLevel() < CURSED_WEAPON_VICTIM_MIN_LEVEL)) //
|
||||
|| (activeChar.isCursedWeaponEquipped() && (player.getLevel() < CURSED_WEAPON_VICTIM_MIN_LEVEL)))
|
||||
{
|
||||
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GeoData.getInstance().canSeeTarget(activeChar, player))
|
||||
{
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, GeoData.getInstance().moveCheck(activeChar, player));
|
||||
}
|
||||
activeChar.onActionRequest();
|
||||
}
|
||||
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
}
|
||||
else
|
||||
{
|
||||
// This Action Failed packet avoids activeChar getting stuck when clicking three or more times
|
||||
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
if (GeoData.getInstance().canSeeTarget(activeChar, player))
|
||||
{
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, GeoData.getInstance().moveCheck(activeChar, player));
|
||||
}
|
||||
activeChar.onActionRequest();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// This Action Failed packet avoids activeChar getting stuck when clicking three or more times
|
||||
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
if (GeoData.getInstance().canSeeTarget(activeChar, player))
|
||||
{
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, GeoData.getInstance().moveCheck(activeChar, player));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -51,29 +51,26 @@ public class L2StaticObjectInstanceAction implements IActionHandler
|
||||
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, staticObject);
|
||||
}
|
||||
else
|
||||
else if (staticObject.getType() == 2)
|
||||
{
|
||||
if (staticObject.getType() == 2)
|
||||
final String filename = (staticObject.getId() == 24230101) ? "html/signboards/tomb_of_crystalgolem.htm" : "html/signboards/pvp_signboard.htm";
|
||||
final String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), filename);
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(staticObject.getObjectId());
|
||||
|
||||
if (content != null)
|
||||
{
|
||||
final String filename = (staticObject.getId() == 24230101) ? "html/signboards/tomb_of_crystalgolem.htm" : "html/signboards/pvp_signboard.htm";
|
||||
final String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), filename);
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(staticObject.getObjectId());
|
||||
|
||||
if (content == null)
|
||||
{
|
||||
html.setHtml("<html><body>Signboard is missing:<br>" + filename + "</body></html>");
|
||||
}
|
||||
else
|
||||
{
|
||||
html.setHtml(content);
|
||||
}
|
||||
|
||||
activeChar.sendPacket(html);
|
||||
html.setHtml(content);
|
||||
}
|
||||
else if (staticObject.getType() == 0)
|
||||
else
|
||||
{
|
||||
activeChar.sendPacket(staticObject.getMap());
|
||||
html.setHtml("<html><body>Signboard is missing:<br>" + filename + "</body></html>");
|
||||
}
|
||||
|
||||
activeChar.sendPacket(html);
|
||||
}
|
||||
else if (staticObject.getType() == 0)
|
||||
{
|
||||
activeChar.sendPacket(staticObject.getMap());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@@ -72,12 +72,9 @@ public class L2SummonAction implements IActionHandler
|
||||
{
|
||||
activeChar.updateNotMoveUntil();
|
||||
}
|
||||
else
|
||||
else if (GeoData.getInstance().canSeeTarget(activeChar, target))
|
||||
{
|
||||
if (GeoData.getInstance().canSeeTarget(activeChar, target))
|
||||
{
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, target);
|
||||
}
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ import com.l2jmobius.util.StringUtil;
|
||||
|
||||
public class AdminBuffs implements IAdminCommandHandler
|
||||
{
|
||||
private final static int PAGE_LIMIT = 20;
|
||||
private static final int PAGE_LIMIT = 20;
|
||||
|
||||
private static final String[] ADMIN_COMMANDS =
|
||||
{
|
||||
@@ -253,7 +253,7 @@ public class AdminBuffs implements IAdminCommandHandler
|
||||
}
|
||||
|
||||
final StringBuilder html = StringUtil.startAppend(500 + (effects.size() * 200), "<html><table width=\"100%\"><tr><td width=45><button value=\"Main\" action=\"bypass -h admin_admin\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center><font color=\"LEVEL\">Effects of ", target.getName(), "</font></td><td width=45><button value=\"Back\" action=\"bypass -h admin_current_player\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br><table width=\"100%\"><tr><td width=200>Skill</td><td width=30>Rem. Time</td><td width=70>Action</td></tr>");
|
||||
final int start = ((page - 1) * PAGE_LIMIT);
|
||||
final int start = (page - 1) * PAGE_LIMIT;
|
||||
final int end = Math.min(((page - 1) * PAGE_LIMIT) + PAGE_LIMIT, effects.size());
|
||||
int count = 0;
|
||||
for (BuffInfo info : effects)
|
||||
@@ -294,7 +294,7 @@ public class AdminBuffs implements IAdminCommandHandler
|
||||
html.append("</tr></table>");
|
||||
|
||||
// Buttons
|
||||
StringUtil.append(html, "<br><center><button value=\"Refresh\" action=\"bypass -h admin_getbuffs", (passive ? "_ps " : " "), target.getName(), "\" width=80 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
|
||||
StringUtil.append(html, "<br><center><button value=\"Refresh\" action=\"bypass -h admin_getbuffs", passive ? "_ps " : " ", target.getName(), "\" width=80 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
|
||||
StringUtil.append(html, "<button value=\"Remove All\" action=\"bypass -h admin_stopallbuffs ", Integer.toString(target.getObjectId()), "\" width=80 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br>");
|
||||
// Legend
|
||||
if (!passive)
|
||||
|
@@ -250,7 +250,7 @@ public final class AdminCastle implements IAdminCommandHandler
|
||||
|
||||
private boolean checkTarget(L2PcInstance player)
|
||||
{
|
||||
return ((player.getTarget() != null) && player.getTarget().isPlayer() && (((L2PcInstance) player.getTarget()).getClan() != null));
|
||||
return (player.getTarget() != null) && player.getTarget().isPlayer() && (((L2PcInstance) player.getTarget()).getClan() != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -187,7 +187,7 @@ public class AdminCreateItem implements IAdminCommandHandler
|
||||
}
|
||||
for (L2PcInstance onlinePlayer : L2World.getInstance().getPlayers())
|
||||
{
|
||||
if ((activeChar != onlinePlayer) && onlinePlayer.isOnline() && ((onlinePlayer.getClient() != null) && !onlinePlayer.getClient().isDetached()))
|
||||
if ((activeChar != onlinePlayer) && onlinePlayer.isOnline() && (onlinePlayer.getClient() != null) && !onlinePlayer.getClient().isDetached())
|
||||
{
|
||||
onlinePlayer.getInventory().addItem("Admin", idval, numval, onlinePlayer, activeChar);
|
||||
onlinePlayer.sendMessage("Admin spawned " + numval + " " + template.getName() + " in your inventory.");
|
||||
|
@@ -100,7 +100,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
|
||||
if (cw.isActivated())
|
||||
{
|
||||
final L2PcInstance pl = cw.getPlayer();
|
||||
StringUtil.append(replyMSG, "<tr><td>Weilder:</td><td>", (pl == null ? "null" : pl.getName()), "</td></tr><tr><td>Karma:</td><td>", String.valueOf(cw.getPlayerKarma()), "</td></tr><tr><td>Kills:</td><td>", String.valueOf(cw.getPlayerPkKills()), "/", String.valueOf(cw.getNbKills()), "</td></tr><tr><td>Time remaining:</td><td>", String.valueOf(cw.getTimeLeft() / 60000), " min.</td></tr><tr><td><button value=\"Remove\" action=\"bypass -h admin_cw_remove ", String.valueOf(itemId), "\" width=73 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><button value=\"Go\" action=\"bypass -h admin_cw_goto ", String.valueOf(itemId), "\" width=73 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
|
||||
StringUtil.append(replyMSG, "<tr><td>Weilder:</td><td>", pl == null ? "null" : pl.getName(), "</td></tr><tr><td>Karma:</td><td>", String.valueOf(cw.getPlayerKarma()), "</td></tr><tr><td>Kills:</td><td>", String.valueOf(cw.getPlayerPkKills()), "/", String.valueOf(cw.getNbKills()), "</td></tr><tr><td>Time remaining:</td><td>", String.valueOf(cw.getTimeLeft() / 60000), " min.</td></tr><tr><td><button value=\"Remove\" action=\"bypass -h admin_cw_remove ", String.valueOf(itemId), "\" width=73 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td><button value=\"Go\" action=\"bypass -h admin_cw_goto ", String.valueOf(itemId), "\" width=73 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
|
||||
}
|
||||
else if (cw.isDropped())
|
||||
{
|
||||
|
@@ -117,7 +117,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
else if (command.startsWith("admin_character_info"))
|
||||
{
|
||||
final String[] data = command.split(" ");
|
||||
if ((data.length > 1))
|
||||
if (data.length > 1)
|
||||
{
|
||||
showCharacterInfo(activeChar, L2World.getInstance().getPlayer(data[1]));
|
||||
}
|
||||
@@ -185,7 +185,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
else if (command.startsWith("admin_edit_character"))
|
||||
{
|
||||
final String[] data = command.split(" ");
|
||||
if ((data.length > 1))
|
||||
if (data.length > 1)
|
||||
{
|
||||
editCharacter(activeChar, data[1]);
|
||||
}
|
||||
@@ -481,7 +481,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
{
|
||||
return false;
|
||||
}
|
||||
player.getAppearance().setSex(player.getAppearance().getSex() ? false : true);
|
||||
player.getAppearance().setSex(!player.getAppearance().getSex());
|
||||
player.sendMessage("Your gender has been changed by a GM");
|
||||
player.broadcastUserInfo();
|
||||
}
|
||||
@@ -574,17 +574,14 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
ps.execute();
|
||||
}
|
||||
}
|
||||
else // removing penalty
|
||||
if (changeCreateExpiryTime)
|
||||
{
|
||||
player.setClanCreateExpiryTime(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// removing penalty
|
||||
if (changeCreateExpiryTime)
|
||||
{
|
||||
player.setClanCreateExpiryTime(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setClanJoinExpiryTime(0);
|
||||
}
|
||||
player.setClanJoinExpiryTime(0);
|
||||
}
|
||||
|
||||
activeChar.sendMessage("Clan penalty successfully removed to character: " + playerName);
|
||||
@@ -634,7 +631,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
{
|
||||
final String[] data = command.split(" ");
|
||||
L2PcInstance pl = null;
|
||||
if ((data.length > 1))
|
||||
if (data.length > 1)
|
||||
{
|
||||
pl = L2World.getInstance().getPlayer(data[1]);
|
||||
}
|
||||
@@ -798,7 +795,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
{
|
||||
player = activeChar;
|
||||
}
|
||||
else if ((activeChar.getTarget() != null) && (activeChar.getTarget() instanceof L2PcInstance))
|
||||
else if (activeChar.getTarget() instanceof L2PcInstance)
|
||||
{
|
||||
player = (L2PcInstance) activeChar.getTarget();
|
||||
}
|
||||
@@ -1067,7 +1064,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
|
||||
if (target instanceof L2PcInstance)
|
||||
{
|
||||
gatherCharacterInfo(activeChar, ((L2PcInstance) target), "charedit.htm");
|
||||
gatherCharacterInfo(activeChar, (L2PcInstance) target, "charedit.htm");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1137,12 +1134,9 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
{
|
||||
findDisconnected = true;
|
||||
}
|
||||
else
|
||||
else if (!IpAdress.matches("^(?:(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2(?:[0-4][0-9]|5[0-5]))\\.){3}(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2(?:[0-4][0-9]|5[0-5]))$"))
|
||||
{
|
||||
if (!IpAdress.matches("^(?:(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2(?:[0-4][0-9]|5[0-5]))\\.){3}(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2(?:[0-4][0-9]|5[0-5]))$"))
|
||||
{
|
||||
throw new IllegalArgumentException("Malformed IPv4 number");
|
||||
}
|
||||
throw new IllegalArgumentException("Malformed IPv4 number");
|
||||
}
|
||||
|
||||
int CharactersFound = 0;
|
||||
@@ -1270,13 +1264,13 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
if (ipMap.get(ip).size() >= multibox)
|
||||
{
|
||||
final Integer count = dualboxIPs.get(ip);
|
||||
if (count == null)
|
||||
if (count != null)
|
||||
{
|
||||
dualboxIPs.put(ip, multibox);
|
||||
dualboxIPs.put(ip, count + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
dualboxIPs.put(ip, count + 1);
|
||||
dualboxIPs.put(ip, multibox);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1322,13 +1316,13 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
if (ipMap.get(pack).size() >= multibox)
|
||||
{
|
||||
final Integer count = dualboxIPs.get(pack);
|
||||
if (count == null)
|
||||
if (count != null)
|
||||
{
|
||||
dualboxIPs.put(pack, multibox);
|
||||
dualboxIPs.put(pack, count + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
dualboxIPs.put(pack, count + 1);
|
||||
dualboxIPs.put(pack, multibox);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -688,12 +688,12 @@ public class AdminEffects implements IAdminCommandHandler
|
||||
activeChar.sendPacket(SystemMessageId.NOTHING_HAPPENED);
|
||||
return false;
|
||||
}
|
||||
if ((target.isNpc()) && ((action < 1) || (action > 20)))
|
||||
if (target.isNpc() && ((action < 1) || (action > 20)))
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.NOTHING_HAPPENED);
|
||||
return false;
|
||||
}
|
||||
if ((target.isPlayer()) && ((action < 2) || ((action > 18) && (action != SocialAction.LEVEL_UP))))
|
||||
if (target.isPlayer() && ((action < 2) || ((action > 18) && (action != SocialAction.LEVEL_UP))))
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.NOTHING_HAPPENED);
|
||||
return false;
|
||||
|
@@ -140,13 +140,13 @@ public class AdminElement implements IAdminCommandHandler
|
||||
{
|
||||
String old, current;
|
||||
final Elementals element = itemInstance.getElemental(type);
|
||||
if (element == null)
|
||||
if (element != null)
|
||||
{
|
||||
old = "None";
|
||||
old = element.toString();
|
||||
}
|
||||
else
|
||||
{
|
||||
old = element.toString();
|
||||
old = "None";
|
||||
}
|
||||
|
||||
// set enchant value
|
||||
@@ -161,13 +161,13 @@ public class AdminElement implements IAdminCommandHandler
|
||||
}
|
||||
player.getInventory().equipItem(itemInstance);
|
||||
|
||||
if (itemInstance.getElementals() == null)
|
||||
if (itemInstance.getElementals() != null)
|
||||
{
|
||||
current = "None";
|
||||
current = itemInstance.getElemental(type).toString();
|
||||
}
|
||||
else
|
||||
{
|
||||
current = itemInstance.getElemental(type).toString();
|
||||
current = "None";
|
||||
}
|
||||
|
||||
// send packets
|
||||
|
@@ -385,12 +385,9 @@ public class AdminEventEngine implements IAdminCommandHandler
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (activeChar.getTarget() instanceof L2PcInstance)
|
||||
{
|
||||
if ((activeChar.getTarget() != null) && (activeChar.getTarget() instanceof L2PcInstance))
|
||||
{
|
||||
L2Event.removeAndResetPlayer((L2PcInstance) activeChar.getTarget());
|
||||
}
|
||||
L2Event.removeAndResetPlayer((L2PcInstance) activeChar.getTarget());
|
||||
}
|
||||
showEventControl(activeChar);
|
||||
}
|
||||
@@ -502,7 +499,7 @@ public class AdminEventEngine implements IAdminCommandHandler
|
||||
replyMSG.append("<center><multiedit var=\"txt\" width=270 height=100> <button value=\"Add text\" action=\"bypass -h admin_add $txt\" width=120 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
|
||||
replyMSG.append("<button value=\"Remove text\" action=\"bypass -h admin_delete_buffer\" width=120 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
|
||||
|
||||
if (!(tempName.isEmpty() && tempBuffer.isEmpty()))
|
||||
if (!tempName.isEmpty() || !tempBuffer.isEmpty())
|
||||
{
|
||||
replyMSG.append("<br><button value=\"Store Event Data\" action=\"bypass -h admin_event_store\" width=160 height=32 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\">");
|
||||
}
|
||||
|
@@ -64,7 +64,7 @@ public class AdminFortSiege implements IAdminCommandHandler
|
||||
fort = FortManager.getInstance().getFortById(fortId);
|
||||
}
|
||||
// Get fort
|
||||
if (((fort == null) || (fortId == 0)))
|
||||
if ((fort == null) || (fortId == 0))
|
||||
{
|
||||
// No fort specified
|
||||
showFortSelectPage(activeChar);
|
||||
@@ -84,18 +84,15 @@ public class AdminFortSiege implements IAdminCommandHandler
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
|
||||
}
|
||||
else if (fort.getSiege().addAttacker(player, false) == 4)
|
||||
{
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOUR_CLAN_HAS_BEEN_REGISTERED_TO_S1_S_FORTRESS_BATTLE);
|
||||
sm.addCastleId(fort.getResidenceId());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fort.getSiege().addAttacker(player, false) == 4)
|
||||
{
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOUR_CLAN_HAS_BEEN_REGISTERED_TO_S1_S_FORTRESS_BATTLE);
|
||||
sm.addCastleId(fort.getResidenceId());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.sendMessage("During registering error occurred!");
|
||||
}
|
||||
player.sendMessage("During registering error occurred!");
|
||||
}
|
||||
}
|
||||
else if (command.equalsIgnoreCase("admin_clear_fortsiege_list"))
|
||||
|
@@ -112,7 +112,7 @@ public class AdminGmChat implements IAdminCommandHandler
|
||||
offset = 13;
|
||||
}
|
||||
text = command.substring(offset);
|
||||
AdminData.getInstance().broadcastToGMs((new CreatureSay(0, ChatType.ALLIANCE, activeChar.getName(), text)));
|
||||
AdminData.getInstance().broadcastToGMs(new CreatureSay(0, ChatType.ALLIANCE, activeChar.getName(), text));
|
||||
}
|
||||
catch (StringIndexOutOfBoundsException e)
|
||||
{
|
||||
|
@@ -96,7 +96,7 @@ public class AdminHtml implements IAdminCommandHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
content = HtmCache.getInstance().loadFile((new File(Config.DATAPACK_ROOT, path)));
|
||||
content = HtmCache.getInstance().loadFile(new File(Config.DATAPACK_ROOT, path));
|
||||
}
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage();
|
||||
if (content != null)
|
||||
|
@@ -106,13 +106,12 @@ public class AdminLogin implements IAdminCommandHandler
|
||||
Config.SERVER_LIST_TYPE = newType;
|
||||
LoginServerThread.getInstance().sendServerType();
|
||||
activeChar.sendMessage("Server Type changed to " + getServerTypeName(newType));
|
||||
showMainPage(activeChar);
|
||||
}
|
||||
else
|
||||
{
|
||||
activeChar.sendMessage("Server Type is already " + getServerTypeName(newType));
|
||||
showMainPage(activeChar);
|
||||
}
|
||||
showMainPage(activeChar);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -135,13 +134,12 @@ public class AdminLogin implements IAdminCommandHandler
|
||||
Config.SERVER_LIST_TYPE = age;
|
||||
LoginServerThread.getInstance().sendServerStatus(ServerStatus.SERVER_AGE, age);
|
||||
activeChar.sendMessage("Server Age changed to " + age);
|
||||
showMainPage(activeChar);
|
||||
}
|
||||
else
|
||||
{
|
||||
activeChar.sendMessage("Server Age is already " + age);
|
||||
showMainPage(activeChar);
|
||||
}
|
||||
showMainPage(activeChar);
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
|
@@ -95,7 +95,7 @@ public class AdminMobGroup implements IAdminCommandHandler
|
||||
{
|
||||
if (activeChar.getTarget() instanceof L2Character)
|
||||
{
|
||||
attack(command, activeChar, ((L2Character) activeChar.getTarget()));
|
||||
attack(command, activeChar, (L2Character) activeChar.getTarget());
|
||||
}
|
||||
}
|
||||
else if (command.startsWith("admin_mobgroup_rnd"))
|
||||
|
@@ -99,7 +99,7 @@ public final class AdminPCBangPoints implements IAdminCommandHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
int pcBangCount = Math.min((target.getPcBangPoints() + value), Config.PC_BANG_MAX_POINTS);
|
||||
int pcBangCount = Math.min(target.getPcBangPoints() + value, Config.PC_BANG_MAX_POINTS);
|
||||
if (pcBangCount < 0)
|
||||
{
|
||||
pcBangCount = Config.PC_BANG_MAX_POINTS;
|
||||
@@ -166,7 +166,7 @@ public final class AdminPCBangPoints implements IAdminCommandHandler
|
||||
continue;
|
||||
}
|
||||
|
||||
int pcBangCount = Math.min((temp.getPcBangPoints() + value), Integer.MAX_VALUE);
|
||||
int pcBangCount = Math.min(temp.getPcBangPoints() + value, Integer.MAX_VALUE);
|
||||
if (pcBangCount < 0)
|
||||
{
|
||||
pcBangCount = Integer.MAX_VALUE;
|
||||
|
@@ -67,12 +67,12 @@ public final class AdminPForge implements IAdminCommandHandler
|
||||
opCodes.add(token);
|
||||
}
|
||||
|
||||
if (opCodes == null)
|
||||
if (opCodes != null)
|
||||
{
|
||||
return null;
|
||||
return opCodes.toArray(new String[opCodes.size()]);
|
||||
}
|
||||
|
||||
return opCodes.toArray(new String[opCodes.size()]);
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean validateOpCodes(String[] opCodes)
|
||||
@@ -201,13 +201,13 @@ public final class AdminPForge implements IAdminCommandHandler
|
||||
private void showSendUsage(L2PcInstance activeChar, String[] opCodes, String format)
|
||||
{
|
||||
activeChar.sendMessage("Usage: //forge_send sc|sb|cs opcode1[;opcode2[;opcode3]][ format value1 ... valueN] ");
|
||||
if (opCodes == null)
|
||||
if (opCodes != null)
|
||||
{
|
||||
showMainPage(activeChar);
|
||||
showValuesPage(activeChar, opCodes, format);
|
||||
}
|
||||
else
|
||||
{
|
||||
showValuesPage(activeChar, opCodes, format);
|
||||
showMainPage(activeChar);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -466,7 +466,7 @@ public final class AdminPForge implements IAdminCommandHandler
|
||||
case "$tboid":
|
||||
{
|
||||
target = activeChar.getTarget();
|
||||
if ((target != null) && (target instanceof L2Playable))
|
||||
if (target instanceof L2Playable)
|
||||
{
|
||||
boat = ((L2Playable) target).getActingPlayer().getBoat();
|
||||
value = boat != null ? String.valueOf(boat.getObjectId()) : "0";
|
||||
@@ -476,7 +476,7 @@ public final class AdminPForge implements IAdminCommandHandler
|
||||
case "$ttitle":
|
||||
{
|
||||
target = activeChar.getTarget();
|
||||
value = (target != null) && (target instanceof L2Character) ? String.valueOf(((L2Character) target).getTitle()) : "";
|
||||
value = target instanceof L2Character ? String.valueOf(((L2Character) target).getTitle()) : "";
|
||||
break;
|
||||
}
|
||||
case "$tname":
|
||||
|
@@ -119,13 +119,13 @@ public class AdminPledge implements IAdminCommandHandler
|
||||
|
||||
ClanTable.getInstance().destroyClan(targetPlayer.getClanId());
|
||||
clan = targetPlayer.getClan();
|
||||
if (clan == null)
|
||||
if (clan != null)
|
||||
{
|
||||
activeChar.sendMessage("Clan disbanded.");
|
||||
activeChar.sendMessage("There was a problem while destroying the clan.");
|
||||
}
|
||||
else
|
||||
{
|
||||
activeChar.sendMessage("There was a problem while destroying the clan.");
|
||||
activeChar.sendMessage("Clan disbanded.");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@@ -85,7 +85,7 @@ public final class AdminPrimePoints implements IAdminCommandHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
int primeCount = Math.min((target.getPrimePoints() + value), Integer.MAX_VALUE);
|
||||
int primeCount = Math.min(target.getPrimePoints() + value, Integer.MAX_VALUE);
|
||||
if (primeCount < 0)
|
||||
{
|
||||
primeCount = Integer.MAX_VALUE;
|
||||
@@ -150,7 +150,7 @@ public final class AdminPrimePoints implements IAdminCommandHandler
|
||||
continue;
|
||||
}
|
||||
|
||||
int primeCount = Math.min((temp.getPrimePoints() + value), Integer.MAX_VALUE);
|
||||
int primeCount = Math.min(temp.getPrimePoints() + value, Integer.MAX_VALUE);
|
||||
if (primeCount < 0)
|
||||
{
|
||||
primeCount = Integer.MAX_VALUE;
|
||||
|
@@ -384,7 +384,7 @@ public class AdminPunishment implements IAdminCommandHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
private static final String findCharId(String key)
|
||||
private static String findCharId(String key)
|
||||
{
|
||||
final int charId = CharNameTable.getInstance().getIdByName(key);
|
||||
return charId > 0 ? Integer.toString(charId) : key;
|
||||
|
@@ -151,7 +151,7 @@ public class AdminServerInfo implements IAdminCommandHandler
|
||||
|
||||
for (L2PcInstance onlinePlayer : L2World.getInstance().getPlayers())
|
||||
{
|
||||
if (((onlinePlayer != null) && (onlinePlayer.getClient() != null)) && !onlinePlayer.getClient().isDetached())
|
||||
if ((onlinePlayer != null) && (onlinePlayer.getClient() != null) && !onlinePlayer.getClient().isDetached())
|
||||
{
|
||||
realPlayers.add(onlinePlayer.getIPAddress());
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user