Code improvements.
This commit is contained in:
@@ -605,21 +605,15 @@ final class AteliaStatus extends AbstractNpcAI
|
|||||||
final int chance = getRandom(1000);
|
final int chance = getRandom(1000);
|
||||||
if (Util.contains(ATELIA_CURSE, npc.getId()))
|
if (Util.contains(ATELIA_CURSE, npc.getId()))
|
||||||
{
|
{
|
||||||
if (!npc.isCastingNow())
|
if (!npc.isCastingNow() && (chance <= 20))
|
||||||
{
|
{
|
||||||
if (chance <= 20)
|
npc.setTarget(attacker);
|
||||||
{
|
npc.doCast(ATELIA_POISON[getRandom(ATELIA_POISON.length)].getSkill());
|
||||||
npc.setTarget(attacker);
|
|
||||||
npc.doCast(ATELIA_POISON[getRandom(ATELIA_POISON.length)].getSkill());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Util.contains(FLOOR_MOBS, npc.getId()))
|
else if (Util.contains(FLOOR_MOBS, npc.getId()) && (chance > 90))
|
||||||
{
|
{
|
||||||
if (chance > 90)
|
broadcastNpcSay(npc, ChatType.NPC_GENERAL, ATELIA_MSG[getRandom(1)], attacker.getName());
|
||||||
{
|
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, ATELIA_MSG[getRandom(1)], attacker.getName());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return super.onAttack(npc, attacker, damage, isSummon);
|
return super.onAttack(npc, attacker, damage, isSummon);
|
||||||
}
|
}
|
||||||
|
@@ -75,11 +75,7 @@ final class HandysBlockCheckerEvent extends Quest
|
|||||||
|
|
||||||
player.sendPacket(tl);
|
player.sendPacket(tl);
|
||||||
|
|
||||||
final int countBlue = holder.getBlueTeamSize();
|
if ((holder.getBlueTeamSize() >= Config.MIN_BLOCK_CHECKER_TEAM_MEMBERS) && (holder.getRedTeamSize() >= Config.MIN_BLOCK_CHECKER_TEAM_MEMBERS))
|
||||||
final int countRed = holder.getRedTeamSize();
|
|
||||||
final int minMembers = Config.MIN_BLOCK_CHECKER_TEAM_MEMBERS;
|
|
||||||
|
|
||||||
if ((countBlue >= minMembers) && (countRed >= minMembers))
|
|
||||||
{
|
{
|
||||||
holder.updateEvent();
|
holder.updateEvent();
|
||||||
holder.broadCastPacketToTeam(new ExCubeGameRequestReady());
|
holder.broadCastPacketToTeam(new ExCubeGameRequestReady());
|
||||||
|
@@ -308,8 +308,7 @@ final class MC_Show extends AbstractNpcAI
|
|||||||
diff = hourDiff + minDiff;
|
diff = hourDiff + minDiff;
|
||||||
if (Config.DEBUG)
|
if (Config.DEBUG)
|
||||||
{
|
{
|
||||||
final SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
_log.info("Fantasy Isle: MC show script starting at " + (new SimpleDateFormat("dd/MM/yyyy HH:mm:ss")).format(System.currentTimeMillis() + diff) + " and is scheduled each next 4 hours.");
|
||||||
_log.info("Fantasy Isle: MC show script starting at " + format.format(System.currentTimeMillis() + diff) + " and is scheduled each next 4 hours.");
|
|
||||||
}
|
}
|
||||||
// TODO startRepeatingQuestTimer("Start", diff, 14400000, null, null);
|
// TODO startRepeatingQuestTimer("Start", diff, 14400000, null, null);
|
||||||
// missing option to provide different initial delay
|
// missing option to provide different initial delay
|
||||||
|
@@ -137,8 +137,7 @@ final class Parade extends AbstractNpcAI
|
|||||||
// final long diff = timeLeftMilli(8, 0, 0), cycle = 600000L;
|
// final long diff = timeLeftMilli(8, 0, 0), cycle = 600000L;
|
||||||
// ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Start(), 180000L, cycle);
|
// ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Start(), 180000L, cycle);
|
||||||
|
|
||||||
final SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd HH:mm");
|
_log.info("Fantasy Isle: Parade starting at " + new SimpleDateFormat("yyyy/MM/dd HH:mm").format(System.currentTimeMillis() + diff) + " and is scheduled each next " + (cycle / 3600000) + " hours.");
|
||||||
_log.info("Fantasy Isle: Parade starting at " + format.format(System.currentTimeMillis() + diff) + " and is scheduled each next " + (cycle / 3600000) + " hours.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void load()
|
void load()
|
||||||
@@ -214,27 +213,28 @@ final class Parade extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
if (spawns.size() > 0)
|
if (spawns.size() <= 0)
|
||||||
{
|
{
|
||||||
for (L2Npc actor : spawns)
|
return;
|
||||||
|
}
|
||||||
|
for (L2Npc actor : spawns)
|
||||||
|
{
|
||||||
|
if (actor != null)
|
||||||
{
|
{
|
||||||
if (actor != null)
|
if (actor.calculateDistance(actor.getXdestination(), actor.getYdestination(), 0, false, true) < (100 * 100))
|
||||||
{
|
{
|
||||||
if (actor.calculateDistance(actor.getXdestination(), actor.getYdestination(), 0, false, true) < (100 * 100))
|
actor.deleteMe();
|
||||||
{
|
spawns.remove(actor);
|
||||||
actor.deleteMe();
|
}
|
||||||
spawns.remove(actor);
|
else if (!actor.isMoving())
|
||||||
}
|
{
|
||||||
else if (!actor.isMoving())
|
actor.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(actor.getXdestination(), actor.getYdestination(), actor.getZdestination(), actor.getHeading()));
|
||||||
{
|
|
||||||
actor.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(actor.getXdestination(), actor.getYdestination(), actor.getZdestination(), actor.getHeading()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (spawns.size() == 0)
|
}
|
||||||
{
|
if (spawns.size() == 0)
|
||||||
deleteTask.cancel(false);
|
{
|
||||||
}
|
deleteTask.cancel(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -224,8 +224,7 @@ final class ArcanRitual extends Quest
|
|||||||
player.sendPacket(trigger);
|
player.sendPacket(trigger);
|
||||||
if (message)
|
if (message)
|
||||||
{
|
{
|
||||||
final L2GameServerPacket sm = new ExShowScreenMessage(NpcStringId.DARK_POWER_SEEPS_OUT_FROM_THE_MIDDLE_OF_THE_TOWN, ExShowScreenMessage.TOP_CENTER, 5000);
|
player.sendPacket(new ExShowScreenMessage(NpcStringId.DARK_POWER_SEEPS_OUT_FROM_THE_MIDDLE_OF_THE_TOWN, ExShowScreenMessage.TOP_CENTER, 5000));
|
||||||
player.sendPacket(sm);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -230,12 +230,9 @@ final class BeastFarm extends AbstractNpcAI
|
|||||||
public void spawnNext(L2Npc npc, L2PcInstance player, int nextNpcId, int food)
|
public void spawnNext(L2Npc npc, L2PcInstance player, int nextNpcId, int food)
|
||||||
{
|
{
|
||||||
// remove the feedinfo of the mob that got despawned, if any
|
// remove the feedinfo of the mob that got despawned, if any
|
||||||
if (FEED_INFO.containsKey(npc.getObjectId()))
|
if (FEED_INFO.containsKey(npc.getObjectId()) && (FEED_INFO.get(npc.getObjectId()) == player.getObjectId()))
|
||||||
{
|
{
|
||||||
if (FEED_INFO.get(npc.getObjectId()) == player.getObjectId())
|
FEED_INFO.remove(npc.getObjectId());
|
||||||
{
|
|
||||||
FEED_INFO.remove(npc.getObjectId());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// despawn the old mob
|
// despawn the old mob
|
||||||
// TODO: same code? FIXED?
|
// TODO: same code? FIXED?
|
||||||
@@ -322,12 +319,7 @@ final class BeastFarm extends AbstractNpcAI
|
|||||||
|
|
||||||
// first gather some values on local variables
|
// first gather some values on local variables
|
||||||
final int objectId = npc.getObjectId();
|
final int objectId = npc.getObjectId();
|
||||||
int growthLevel = 3; // if a mob is in FEEDABLE_BEASTS but not in _GrowthCapableMobs, then it's at max growth (3)
|
final int growthLevel = GROWTH_CAPABLE_MONSTERS.containsKey(npcId) ? GROWTH_CAPABLE_MONSTERS.get(npcId).getGrowthLevel() : 3; // if a mob is in FEEDABLE_BEASTS but not in _GrowthCapableMobs, then it's at max growth (3)
|
||||||
if (GROWTH_CAPABLE_MONSTERS.containsKey(npcId))
|
|
||||||
{
|
|
||||||
growthLevel = GROWTH_CAPABLE_MONSTERS.get(npcId).getGrowthLevel();
|
|
||||||
}
|
|
||||||
|
|
||||||
// prevent exploit which allows 2 players to simultaneously raise the same 0-growth beast
|
// prevent exploit which allows 2 players to simultaneously raise the same 0-growth beast
|
||||||
// If the mob is at 0th level (when it still listens to all feeders) lock it to the first feeder!
|
// If the mob is at 0th level (when it still listens to all feeders) lock it to the first feeder!
|
||||||
if ((growthLevel == 0) && FEED_INFO.containsKey(objectId))
|
if ((growthLevel == 0) && FEED_INFO.containsKey(objectId))
|
||||||
@@ -364,7 +356,7 @@ final class BeastFarm extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||||
}
|
}
|
||||||
else if ((growthLevel > 0) && (FEED_INFO.get(objectId) != caster.getObjectId()))
|
if ((growthLevel > 0) && (FEED_INFO.get(objectId) != caster.getObjectId()))
|
||||||
{
|
{
|
||||||
// check if this is the same player as the one who raised it from growth 0.
|
// check if this is the same player as the one who raised it from growth 0.
|
||||||
// if no, then do not allow a chance to raise the pet (food gets consumed but has no effect).
|
// if no, then do not allow a chance to raise the pet (food gets consumed but has no effect).
|
||||||
|
@@ -23,7 +23,6 @@ import com.l2jmobius.gameserver.model.Location;
|
|||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
|
||||||
import com.l2jmobius.gameserver.model.zone.type.L2EffectZone;
|
import com.l2jmobius.gameserver.model.zone.type.L2EffectZone;
|
||||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||||
@@ -109,9 +108,7 @@ final class DenOfEvil extends AbstractNpcAI
|
|||||||
|
|
||||||
private int getSkillIdByNpcId(int npcId)
|
private int getSkillIdByNpcId(int npcId)
|
||||||
{
|
{
|
||||||
int diff = npcId - EYE_IDS[0];
|
return SKILL_ID + ((npcId - EYE_IDS[0]) * 2);
|
||||||
diff *= 2;
|
|
||||||
return SKILL_ID + diff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -211,22 +208,13 @@ final class DenOfEvil extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
if (character.isPlayable())
|
if (character.isPlayable())
|
||||||
{
|
{
|
||||||
final Skill skill = SkillData.getInstance().getSkill(6149, 1);
|
SkillData.getInstance().getSkill(6149, 1).applyEffects(character, character);
|
||||||
skill.applyEffects(character, character);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (character.doDie(null)) // mobs die
|
if (character.doDie(null) && character.isNpc() && Util.contains(EYE_IDS, ((L2Npc) character).getId())) // mobs die
|
||||||
{
|
{
|
||||||
if (character.isNpc())
|
ThreadPoolManager.getInstance().scheduleAi(new RespawnNewEye(((L2Npc) character).getLocation()), 15000);
|
||||||
{
|
|
||||||
// respawn eye
|
|
||||||
final L2Npc npc = (L2Npc) character;
|
|
||||||
if (Util.contains(EYE_IDS, npc.getId()))
|
|
||||||
{
|
|
||||||
ThreadPoolManager.getInstance().scheduleAi(new RespawnNewEye(npc.getLocation()), 15000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -151,19 +151,13 @@ final class FeedableBeasts extends AbstractNpcAI
|
|||||||
|
|
||||||
public Integer getMob(int spice, int mobType, int classType)
|
public Integer getMob(int spice, int mobType, int classType)
|
||||||
{
|
{
|
||||||
if (_spiceToMob.containsKey(spice))
|
return _spiceToMob.containsKey(spice) ? _spiceToMob.get(spice)[mobType][classType] : null;
|
||||||
{
|
|
||||||
return _spiceToMob.get(spice)[mobType][classType];
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getRandomMob(int spice)
|
public Integer getRandomMob(int spice)
|
||||||
{
|
{
|
||||||
int[][] temp;
|
final int[][] temp = _spiceToMob.get(spice);
|
||||||
temp = _spiceToMob.get(spice);
|
return temp[0][getRandom(temp[0].length)];
|
||||||
final int rand = getRandom(temp[0].length);
|
|
||||||
return temp[0][rand];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getChance()
|
public Integer getChance()
|
||||||
@@ -482,24 +476,20 @@ final class FeedableBeasts extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
if (event.equalsIgnoreCase("polymorph Mad Cow") && (npc != null) && (player != null))
|
if (event.equalsIgnoreCase("polymorph Mad Cow") && (npc != null) && (player != null) && MAD_COW_POLYMORPH.containsKey(npc.getId()))
|
||||||
{
|
{
|
||||||
if (MAD_COW_POLYMORPH.containsKey(npc.getId()))
|
// remove the feed info from the previous mob
|
||||||
|
if (FEED_INFO.get(npc.getObjectId()) == player.getObjectId())
|
||||||
{
|
{
|
||||||
// remove the feed info from the previous mob
|
FEED_INFO.remove(npc.getObjectId());
|
||||||
if (FEED_INFO.get(npc.getObjectId()) == player.getObjectId())
|
|
||||||
{
|
|
||||||
FEED_INFO.remove(npc.getObjectId());
|
|
||||||
}
|
|
||||||
// despawn the mad cow
|
|
||||||
npc.deleteMe();
|
|
||||||
// spawn the new mob
|
|
||||||
final L2Attackable nextNpc = (L2Attackable) addSpawn(MAD_COW_POLYMORPH.get(npc.getId()), npc);
|
|
||||||
|
|
||||||
// register the player in the feedinfo for the mob that just spawned
|
|
||||||
FEED_INFO.put(nextNpc.getObjectId(), player.getObjectId());
|
|
||||||
addAttackDesire(nextNpc, player);
|
|
||||||
}
|
}
|
||||||
|
// despawn the mad cow
|
||||||
|
npc.deleteMe();
|
||||||
|
// spawn the new mob
|
||||||
|
final L2Attackable nextNpc = (L2Attackable) addSpawn(MAD_COW_POLYMORPH.get(npc.getId()), npc);
|
||||||
|
// register the player in the feedinfo for the mob that just spawned
|
||||||
|
FEED_INFO.put(nextNpc.getObjectId(), player.getObjectId());
|
||||||
|
addAttackDesire(nextNpc, player);
|
||||||
}
|
}
|
||||||
return super.onAdvEvent(event, npc, player);
|
return super.onAdvEvent(event, npc, player);
|
||||||
}
|
}
|
||||||
@@ -524,12 +514,7 @@ final class FeedableBeasts extends AbstractNpcAI
|
|||||||
|
|
||||||
// first gather some values on local variables
|
// first gather some values on local variables
|
||||||
final int objectId = npc.getObjectId();
|
final int objectId = npc.getObjectId();
|
||||||
int growthLevel = 3; // if a mob is in FEEDABLE_BEASTS but not in _GrowthCapableMobs, then it's at max growth (3)
|
final int growthLevel = GROWTH_CAPABLE_MONSTERS.containsKey(npcId) ? GROWTH_CAPABLE_MONSTERS.get(npcId).getGrowthLevel() : 3; // if a mob is in FEEDABLE_BEASTS but not in _GrowthCapableMobs, then it's at max growth (3)
|
||||||
if (GROWTH_CAPABLE_MONSTERS.containsKey(npcId))
|
|
||||||
{
|
|
||||||
growthLevel = GROWTH_CAPABLE_MONSTERS.get(npcId).getGrowthLevel();
|
|
||||||
}
|
|
||||||
|
|
||||||
// prevent exploit which allows 2 players to simultaneously raise the same 0-growth beast
|
// prevent exploit which allows 2 players to simultaneously raise the same 0-growth beast
|
||||||
// If the mob is at 0th level (when it still listens to all feeders) lock it to the first feeder!
|
// If the mob is at 0th level (when it still listens to all feeders) lock it to the first feeder!
|
||||||
if ((growthLevel == 0) && FEED_INFO.containsKey(objectId))
|
if ((growthLevel == 0) && FEED_INFO.containsKey(objectId))
|
||||||
|
@@ -432,20 +432,13 @@ final class MinionSpawnManager extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
|
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
|
||||||
{
|
{
|
||||||
if (npc.isMonster())
|
if (npc.isMonster() && !((L2MonsterInstance) npc).isTeleporting() && (getRandom(1, 100) <= npc.getTemplate().getParameters().getInt("SummonPrivateRate", 0)))
|
||||||
{
|
{
|
||||||
final L2MonsterInstance monster = (L2MonsterInstance) npc;
|
for (MinionHolder is : npc.getTemplate().getParameters().getMinionList("Privates"))
|
||||||
if (!monster.isTeleporting())
|
|
||||||
{
|
{
|
||||||
if (getRandom(1, 100) <= npc.getTemplate().getParameters().getInt("SummonPrivateRate", 0))
|
addMinion((L2MonsterInstance) npc, is.getId());
|
||||||
{
|
|
||||||
for (MinionHolder is : npc.getTemplate().getParameters().getMinionList("Privates"))
|
|
||||||
{
|
|
||||||
addMinion((L2MonsterInstance) npc, is.getId());
|
|
||||||
}
|
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, ON_ATTACK_MSG[getRandom(ON_ATTACK_MSG.length)]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
broadcastNpcSay(npc, ChatType.NPC_GENERAL, ON_ATTACK_MSG[getRandom(ON_ATTACK_MSG.length)]);
|
||||||
}
|
}
|
||||||
return super.onAttack(npc, attacker, damage, isSummon);
|
return super.onAttack(npc, attacker, damage, isSummon);
|
||||||
}
|
}
|
||||||
|
@@ -89,20 +89,17 @@ final class PolymorphingOnAttack extends AbstractNpcAI
|
|||||||
if (npc.isVisible() && !npc.isDead())
|
if (npc.isVisible() && !npc.isDead())
|
||||||
{
|
{
|
||||||
final List<Integer> tmp = MOBSPAWNS.get(npc.getId());
|
final List<Integer> tmp = MOBSPAWNS.get(npc.getId());
|
||||||
if (tmp != null)
|
if ((tmp != null) && (npc.getCurrentHp() <= ((npc.getMaxHp() * tmp.get(1)) / 100.0)) && (getRandom(100) < tmp.get(2)))
|
||||||
{
|
{
|
||||||
if ((npc.getCurrentHp() <= ((npc.getMaxHp() * tmp.get(1)) / 100.0)) && (getRandom(100) < tmp.get(2)))
|
if (tmp.get(3) >= 0)
|
||||||
{
|
{
|
||||||
if (tmp.get(3) >= 0)
|
final NpcStringId npcString = MOBTEXTS[tmp.get(3)][getRandom(MOBTEXTS[tmp.get(3)].length)];
|
||||||
{
|
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), npcString));
|
||||||
final NpcStringId npcString = MOBTEXTS[tmp.get(3)][getRandom(MOBTEXTS[tmp.get(3)].length)];
|
|
||||||
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), npcString));
|
|
||||||
}
|
|
||||||
npc.deleteMe();
|
|
||||||
final L2Attackable newNpc = (L2Attackable) addSpawn(tmp.get(0), npc.getX(), npc.getY(), npc.getZ() + 10, npc.getHeading(), false, 0, true);
|
|
||||||
final L2Character originalAttacker = isSummon ? attacker.getServitors().values().stream().findFirst().orElse(attacker.getPet()) : attacker;
|
|
||||||
addAttackDesire(newNpc, originalAttacker);
|
|
||||||
}
|
}
|
||||||
|
npc.deleteMe();
|
||||||
|
final L2Attackable newNpc = (L2Attackable) addSpawn(tmp.get(0), npc.getX(), npc.getY(), npc.getZ() + 10, npc.getHeading(), false, 0, true);
|
||||||
|
final L2Character originalAttacker = isSummon ? attacker.getServitors().values().stream().findFirst().orElse(attacker.getPet()) : attacker;
|
||||||
|
addAttackDesire(newNpc, originalAttacker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return super.onAttack(npc, attacker, damage, isSummon);
|
return super.onAttack(npc, attacker, damage, isSummon);
|
||||||
|
@@ -322,8 +322,7 @@ final class PrimevalIsle extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if ((characters != null) && (characters.isAttackable()) && (getRandomBoolean()))
|
if ((characters != null) && (characters.isAttackable()) && (getRandomBoolean()))
|
||||||
{
|
{
|
||||||
final L2Attackable monster = (L2Attackable) characters;
|
addAttackDesire(((L2Attackable) characters), playable);
|
||||||
addAttackDesire(monster, playable);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -424,21 +423,15 @@ final class PrimevalIsle extends AbstractNpcAI
|
|||||||
|
|
||||||
if (target != null)
|
if (target != null)
|
||||||
{
|
{
|
||||||
if (getRandom(100) <= (probPhysicalSpecial1 * npc.getVariables().getInt("SKILL_MULTIPLER")))
|
if ((getRandom(100) <= (probPhysicalSpecial1 * npc.getVariables().getInt("SKILL_MULTIPLER"))) && !npc.isSkillDisabled(physicalSpecial1.getSkill()))
|
||||||
{
|
{
|
||||||
if (!npc.isSkillDisabled(physicalSpecial1.getSkill()))
|
npc.setTarget(target);
|
||||||
{
|
npc.doCast(physicalSpecial1.getSkill());
|
||||||
npc.setTarget(target);
|
|
||||||
npc.doCast(physicalSpecial1.getSkill());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (getRandom(100) <= (probPhysicalSpecial2 * npc.getVariables().getInt("SKILL_MULTIPLER")))
|
if ((getRandom(100) <= (probPhysicalSpecial2 * npc.getVariables().getInt("SKILL_MULTIPLER"))) && !npc.isSkillDisabled(physicalSpecial2.getSkill()))
|
||||||
{
|
{
|
||||||
if (!npc.isSkillDisabled(physicalSpecial2.getSkill()))
|
npc.setTarget(target);
|
||||||
{
|
npc.doCast(physicalSpecial2.getSkill());
|
||||||
npc.setTarget(target);
|
|
||||||
npc.doCast(physicalSpecial2.getSkill());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -78,14 +78,11 @@ final class PrisonGuards extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (player.isAffectedBySkill(TIMER))
|
if (player.isAffectedBySkill(TIMER))
|
||||||
{
|
{
|
||||||
if ((getRandom(100) < 10) && (npc.calculateDistance(player, true, false) < 100))
|
if ((getRandom(100) < 10) && (npc.calculateDistance(player, true, false) < 100) && (getQuestItemsCount(player, STAMP) <= 3) && npc.isScriptValue(0))
|
||||||
{
|
{
|
||||||
if ((getQuestItemsCount(player, STAMP) <= 3) && npc.isScriptValue(0))
|
giveItems(player, STAMP, 1);
|
||||||
{
|
npc.setScriptValue(1);
|
||||||
giveItems(player, STAMP, 1);
|
startQuestTimer("CLEAR_STATUS", 600000, npc, null);
|
||||||
npc.setScriptValue(1);
|
|
||||||
startQuestTimer("CLEAR_STATUS", 600000, npc, null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -58,28 +58,9 @@ final class Remnants extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public final String onSkillSee(L2Npc npc, L2PcInstance caster, Skill skill, L2Object[] targets, boolean isSummon)
|
public final String onSkillSee(L2Npc npc, L2PcInstance caster, Skill skill, L2Object[] targets, boolean isSummon)
|
||||||
{
|
{
|
||||||
if (skill.getId() == SKILL_HOLY_WATER)
|
if ((skill.getId() == SKILL_HOLY_WATER) && !npc.isDead() && (targets.length > 0) && (targets[0] == npc) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.02)))
|
||||||
{
|
{
|
||||||
if (!npc.isDead())
|
npc.doDie(caster);
|
||||||
{
|
|
||||||
if ((targets.length > 0) && (targets[0] == npc))
|
|
||||||
{
|
|
||||||
if (npc.getCurrentHp() < (npc.getMaxHp() * 0.02)) // Lower, than 2%
|
|
||||||
{
|
|
||||||
npc.doDie(caster);
|
|
||||||
//@formatter:off
|
|
||||||
/*if (npc.getNpcId() == DEREK)
|
|
||||||
{
|
|
||||||
caster.sendMessage(MSG_DEREK);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
caster.sendMessage(MSG);
|
|
||||||
}*/
|
|
||||||
//@formatter:on
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||||
}
|
}
|
||||||
|
@@ -170,8 +170,7 @@ final class StakatoNest extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (killer.isInParty())
|
if (killer.isInParty())
|
||||||
{
|
{
|
||||||
final List<L2PcInstance> party = killer.getParty().getMembers();
|
for (L2PcInstance member : killer.getParty().getMembers())
|
||||||
for (L2PcInstance member : party)
|
|
||||||
{
|
{
|
||||||
giveCocoon(member, npc);
|
giveCocoon(member, npc);
|
||||||
}
|
}
|
||||||
|
@@ -65,16 +65,9 @@ final class SummonPc extends AbstractNpcAI
|
|||||||
doSummonPc(npc, attacker);
|
doSummonPc(npc, attacker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (distance > MIN_DISTANCE_MOST_HATED)
|
else if ((distance > MIN_DISTANCE_MOST_HATED) && (((L2Attackable) npc).getMostHated() != null) && (((((L2Attackable) npc).getMostHated() == attacker) && (chance < 50)) || (chance < 10)))
|
||||||
{
|
{
|
||||||
final L2Attackable monster = (L2Attackable) npc;
|
doSummonPc(npc, attacker);
|
||||||
if (monster.getMostHated() != null)
|
|
||||||
{
|
|
||||||
if (((monster.getMostHated() == attacker) && (chance < 50)) || (chance < 10))
|
|
||||||
{
|
|
||||||
doSummonPc(npc, attacker);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return super.onAttack(npc, attacker, damage, isSummon);
|
return super.onAttack(npc, attacker, damage, isSummon);
|
||||||
}
|
}
|
||||||
|
@@ -24,7 +24,6 @@ import com.l2jmobius.gameserver.model.Location;
|
|||||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||||
import com.l2jmobius.gameserver.model.quest.QuestTimer;
|
|
||||||
|
|
||||||
import ai.npc.AbstractNpcAI;
|
import ai.npc.AbstractNpcAI;
|
||||||
|
|
||||||
@@ -62,8 +61,7 @@ final class Anais extends AbstractNpcAI
|
|||||||
if (pot < 4)
|
if (pot < 4)
|
||||||
{
|
{
|
||||||
_current = npc;
|
_current = npc;
|
||||||
final QuestTimer checkAround = getQuestTimer("CHECK", anais, null);
|
if (getQuestTimer("CHECK", anais, null) == null)
|
||||||
if (checkAround == null) // || !checkAround.getIsActive()
|
|
||||||
{
|
{
|
||||||
startQuestTimer("CHECK", 3000, anais, null);
|
startQuestTimer("CHECK", 3000, anais, null);
|
||||||
}
|
}
|
||||||
|
@@ -633,13 +633,10 @@ public final class Antharas extends AbstractNpcAI
|
|||||||
attacker.teleToLocation(80464, 152294, -3534);
|
attacker.teleToLocation(80464, 152294, -3534);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((attacker.getMountType() == MountType.STRIDER) && !attacker.isAffectedBySkill(ANTH_ANTI_STRIDER.getSkillId()))
|
if ((attacker.getMountType() == MountType.STRIDER) && !attacker.isAffectedBySkill(ANTH_ANTI_STRIDER.getSkillId()) && npc.checkDoCastConditions(ANTH_ANTI_STRIDER.getSkill()))
|
||||||
{
|
{
|
||||||
if (npc.checkDoCastConditions(ANTH_ANTI_STRIDER.getSkill()))
|
npc.setTarget(attacker);
|
||||||
{
|
npc.doCast(ANTH_ANTI_STRIDER.getSkill());
|
||||||
npc.setTarget(attacker);
|
|
||||||
npc.doCast(ANTH_ANTI_STRIDER.getSkill());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
|
@@ -484,13 +484,10 @@ public final class Baium extends AbstractNpcAI
|
|||||||
|
|
||||||
if (npc.getId() == BAIUM)
|
if (npc.getId() == BAIUM)
|
||||||
{
|
{
|
||||||
if ((attacker.getMountType() == MountType.STRIDER) && !attacker.isAffectedBySkill(ANTI_STRIDER.getSkillId()))
|
if ((attacker.getMountType() == MountType.STRIDER) && !attacker.isAffectedBySkill(ANTI_STRIDER.getSkillId()) && !npc.isSkillDisabled(ANTI_STRIDER.getSkill()))
|
||||||
{
|
{
|
||||||
if (!npc.isSkillDisabled(ANTI_STRIDER.getSkill()))
|
npc.setTarget(attacker);
|
||||||
{
|
npc.doCast(ANTI_STRIDER.getSkill());
|
||||||
npc.setTarget(attacker);
|
|
||||||
npc.doCast(ANTI_STRIDER.getSkill());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
|
@@ -74,13 +74,10 @@ final class Ballista extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if ((skill != null) && (caster.getTarget() == npc) && (getRandom(100) < 40) && (skill == BOMB.getSkill()))
|
if ((skill != null) && (caster.getTarget() == npc) && (getRandom(100) < 40) && (skill == BOMB.getSkill()))
|
||||||
{
|
{
|
||||||
if (npc.getFort().getSiege().isInProgress())
|
if (npc.getFort().getSiege().isInProgress() && (caster.getClan() != null) && (caster.getClan().getLevel() >= MIN_CLAN_LV))
|
||||||
{
|
{
|
||||||
if ((caster.getClan() != null) && (caster.getClan().getLevel() >= MIN_CLAN_LV))
|
caster.getClan().addReputationScore(Config.BALLISTA_POINTS, true);
|
||||||
{
|
caster.sendPacket(SystemMessageId.THE_BALLISTA_HAS_BEEN_SUCCESSFULLY_DESTROYED_THE_CLAN_REPUTATION_WILL_BE_INCREASED);
|
||||||
caster.getClan().addReputationScore(Config.BALLISTA_POINTS, true);
|
|
||||||
caster.sendPacket(SystemMessageId.THE_BALLISTA_HAS_BEEN_SUCCESSFULLY_DESTROYED_THE_CLAN_REPUTATION_WILL_BE_INCREASED);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
npc.doDie(caster);
|
npc.doDie(caster);
|
||||||
}
|
}
|
||||||
|
@@ -610,13 +610,10 @@ final class Beleth extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (!npc.isDead() && !npc.isCastingNow())
|
if (!npc.isDead() && !npc.isCastingNow())
|
||||||
{
|
{
|
||||||
if (getRandom(100) < 40)
|
if ((getRandom(100) < 40) && !npc.getKnownList().getKnownPlayersInRadius(200).isEmpty())
|
||||||
{
|
{
|
||||||
if (!npc.getKnownList().getKnownPlayersInRadius(200).isEmpty())
|
npc.doCast(BLEED.getSkill());
|
||||||
{
|
return null;
|
||||||
npc.doCast(BLEED.getSkill());
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
npc.setTarget(player);
|
npc.setTarget(player);
|
||||||
npc.doCast(FIREBALL.getSkill());
|
npc.doCast(FIREBALL.getSkill());
|
||||||
@@ -637,9 +634,7 @@ final class Beleth extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
npc.setTarget(player);
|
npc.setTarget(player);
|
||||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
|
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
|
||||||
final double speed = npc.isRunning() ? npc.getRunSpeed() : npc.getWalkSpeed();
|
startQuestTimer("CAST", ((int) (((distance2 - 890) / (npc.isRunning() ? npc.getRunSpeed() : npc.getWalkSpeed())) * 1000)), npc, null);
|
||||||
final int time = (int) (((distance2 - 890) / speed) * 1000);
|
|
||||||
startQuestTimer("CAST", time, npc, null);
|
|
||||||
}
|
}
|
||||||
else if (distance2 < 890)
|
else if (distance2 < 890)
|
||||||
{
|
{
|
||||||
@@ -648,13 +643,10 @@ final class Beleth extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (getRandom(100) < 40)
|
if ((getRandom(100) < 40) && !npc.getKnownList().getKnownPlayersInRadius(200).isEmpty())
|
||||||
{
|
{
|
||||||
if (!npc.getKnownList().getKnownPlayersInRadius(200).isEmpty())
|
npc.doCast(LIGHTENING.getSkill());
|
||||||
{
|
return null;
|
||||||
npc.doCast(LIGHTENING.getSkill());
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for (L2PcInstance plr : npc.getKnownList().getKnownPlayersInRadius(950))
|
for (L2PcInstance plr : npc.getKnownList().getKnownPlayersInRadius(950))
|
||||||
{
|
{
|
||||||
|
@@ -63,20 +63,15 @@ final class Core extends AbstractNpcAI
|
|||||||
|
|
||||||
_firstAttacked = false;
|
_firstAttacked = false;
|
||||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
|
final StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
|
||||||
final int status = GrandBossManager.getInstance().getBossStatus(CORE);
|
if (GrandBossManager.getInstance().getBossStatus(CORE) == DEAD)
|
||||||
if (status == DEAD)
|
|
||||||
{
|
{
|
||||||
// load the unlock date and time for Core from DB
|
|
||||||
final long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
|
final long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
|
||||||
// if Core is locked until a certain time, mark it so and start the unlock timer
|
|
||||||
// the unlock time has not yet expired.
|
|
||||||
if (temp > 0)
|
if (temp > 0)
|
||||||
{
|
{
|
||||||
startQuestTimer("core_unlock", temp, null, null);
|
startQuestTimer("core_unlock", temp, null, null);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// the time has already expired while the server was offline. Immediately spawn Core.
|
|
||||||
final L2GrandBossInstance core = (L2GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
|
final L2GrandBossInstance core = (L2GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
|
||||||
GrandBossManager.getInstance().setBossStatus(CORE, ALIVE);
|
GrandBossManager.getInstance().setBossStatus(CORE, ALIVE);
|
||||||
spawnBoss(core);
|
spawnBoss(core);
|
||||||
|
@@ -206,25 +206,22 @@ final class DarkWaterDragon extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
final int npcId = npc.getId();
|
final int npcId = npc.getId();
|
||||||
final int npcObjId = npc.getObjectId();
|
final int npcObjId = npc.getObjectId();
|
||||||
if (npcId == FAFURION)
|
if ((npcId == FAFURION) && !MY_TRACKING_SET.contains(npcObjId))
|
||||||
{
|
{
|
||||||
if (!MY_TRACKING_SET.contains(npcObjId))
|
MY_TRACKING_SET.add(npcObjId);
|
||||||
{
|
// Spawn 4 Detractors on spawn of Fafurion
|
||||||
MY_TRACKING_SET.add(npcObjId);
|
final int x = npc.getX();
|
||||||
// Spawn 4 Detractors on spawn of Fafurion
|
final int y = npc.getY();
|
||||||
final int x = npc.getX();
|
addSpawn(DETRACTOR2, x + 100, y + 100, npc.getZ(), 0, false, 40000);
|
||||||
final int y = npc.getY();
|
addSpawn(DETRACTOR1, x + 100, y - 100, npc.getZ(), 0, false, 40000);
|
||||||
addSpawn(DETRACTOR2, x + 100, y + 100, npc.getZ(), 0, false, 40000);
|
addSpawn(DETRACTOR2, x - 100, y + 100, npc.getZ(), 0, false, 40000);
|
||||||
addSpawn(DETRACTOR1, x + 100, y - 100, npc.getZ(), 0, false, 40000);
|
addSpawn(DETRACTOR1, x - 100, y - 100, npc.getZ(), 0, false, 40000);
|
||||||
addSpawn(DETRACTOR2, x - 100, y + 100, npc.getZ(), 0, false, 40000);
|
startQuestTimer("first_spawn", 2000, npc, null);
|
||||||
addSpawn(DETRACTOR1, x - 100, y - 100, npc.getZ(), 0, false, 40000);
|
startQuestTimer("second_spawn", 4000, npc, null);
|
||||||
startQuestTimer("first_spawn", 2000, npc, null); // timer to delay timer "1"
|
startQuestTimer("third_spawn", 8000, npc, null);
|
||||||
startQuestTimer("second_spawn", 4000, npc, null); // timer to delay timer "2"
|
startQuestTimer("fourth_spawn", 10000, npc, null);
|
||||||
startQuestTimer("third_spawn", 8000, npc, null); // timer to delay timer "3"
|
startQuestTimer("fafurion_poison", 3000, npc, null, true);
|
||||||
startQuestTimer("fourth_spawn", 10000, npc, null); // timer to delay timer "4"
|
startQuestTimer("fafurion_despawn", 120000, npc, null);
|
||||||
startQuestTimer("fafurion_poison", 3000, npc, null, true); // Every three seconds reduces Fafurions hp like it is poisoned
|
|
||||||
startQuestTimer("fafurion_despawn", 120000, npc, null); // Fafurion Kindred disappears after two minutes
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return super.onSpawn(npc);
|
return super.onSpawn(npc);
|
||||||
}
|
}
|
||||||
|
@@ -64,15 +64,11 @@ final class Devno extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (event.equalsIgnoreCase("npc_move") && (npc != null))
|
if (event.equalsIgnoreCase("npc_move") && (npc != null))
|
||||||
{
|
{
|
||||||
|
broadcastNpcSay(npc, ChatType.NPC_GENERAL, DEVNO_SHOUT[getRandom(3)], 1000);
|
||||||
if (getRandom(100) > 40)
|
if (getRandom(100) > 40)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, DEVNO_SHOUT[getRandom(3)], 1000);
|
|
||||||
addMoveToDesire(npc, DEVNO_LOC[getRandom(10)], 0);
|
addMoveToDesire(npc, DEVNO_LOC[getRandom(10)], 0);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, DEVNO_SHOUT[getRandom(3)], 1000);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@@ -63,15 +63,11 @@ final class Eleve extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (event.equalsIgnoreCase("npc_move") && (npc != null))
|
if (event.equalsIgnoreCase("npc_move") && (npc != null))
|
||||||
{
|
{
|
||||||
|
broadcastNpcSay(npc, ChatType.NPC_GENERAL, ELEVE_SHOUT[getRandom(2)], 1000);
|
||||||
if (getRandom(100) > 40)
|
if (getRandom(100) > 40)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, ELEVE_SHOUT[getRandom(2)], 1000);
|
|
||||||
addMoveToDesire(npc, ELEVE_LOC[getRandom(10)], 0);
|
addMoveToDesire(npc, ELEVE_LOC[getRandom(10)], 0);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, ELEVE_SHOUT[getRandom(2)], 1000);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@@ -122,8 +122,7 @@ final class FrightenedRagnaOrc extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
final NpcStringId msg = 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));
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, msg);
|
|
||||||
}
|
}
|
||||||
startQuestTimer("despawn", 1000, npc, null);
|
startQuestTimer("despawn", 1000, npc, null);
|
||||||
}
|
}
|
||||||
|
@@ -45,9 +45,7 @@ final class Handermonkey extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (getRandom(100) > 30)
|
if (getRandom(100) > 30)
|
||||||
{
|
{
|
||||||
final int locX = (npc.getSpawn().getX() - 70) + getRandom(100);
|
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(((npc.getSpawn().getX() - 70) + getRandom(100)), ((npc.getSpawn().getY() - 70) + getRandom(100)), npc.getZ(), 0));
|
||||||
final int locY = (npc.getSpawn().getY() - 70) + getRandom(100);
|
|
||||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(locX, locY, npc.getZ(), 0));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -89,8 +89,7 @@ final class Orfen extends AbstractNpcAI
|
|||||||
_IsTeleported = false;
|
_IsTeleported = false;
|
||||||
ZONE = GrandBossManager.getInstance().getZone(POS[0]);
|
ZONE = GrandBossManager.getInstance().getZone(POS[0]);
|
||||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);
|
final StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);
|
||||||
final int status = GrandBossManager.getInstance().getBossStatus(ORFEN);
|
if (GrandBossManager.getInstance().getBossStatus(ORFEN) == DEAD)
|
||||||
if (status == DEAD)
|
|
||||||
{
|
{
|
||||||
// load the unlock date and time for Orfen from DB
|
// load the unlock date and time for Orfen from DB
|
||||||
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||||
@@ -309,13 +308,10 @@ final class Orfen extends AbstractNpcAI
|
|||||||
npc.doCast(SkillData.getInstance().getSkill(4064, 1));
|
npc.doCast(SkillData.getInstance().getSkill(4064, 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (npcId == RIBA_IREN)
|
else if ((npcId == RIBA_IREN) && !npc.isCastingNow() && ((npc.getCurrentHp() - damage) < (npc.getMaxHp() / 2.0)))
|
||||||
{
|
{
|
||||||
if (!npc.isCastingNow() && ((npc.getCurrentHp() - damage) < (npc.getMaxHp() / 2.0)))
|
npc.setTarget(attacker);
|
||||||
{
|
npc.doCast(SkillData.getInstance().getSkill(4516, 1));
|
||||||
npc.setTarget(attacker);
|
|
||||||
npc.doCast(SkillData.getInstance().getSkill(4516, 1));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return super.onAttack(npc, attacker, damage, isSummon);
|
return super.onAttack(npc, attacker, damage, isSummon);
|
||||||
}
|
}
|
||||||
@@ -328,8 +324,7 @@ final class Orfen extends AbstractNpcAI
|
|||||||
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||||
GrandBossManager.getInstance().setBossStatus(ORFEN, DEAD);
|
GrandBossManager.getInstance().setBossStatus(ORFEN, DEAD);
|
||||||
// Calculate Min and Max respawn times randomly.
|
// Calculate Min and Max respawn times randomly.
|
||||||
long respawnTime = Config.ORFEN_SPAWN_INTERVAL + getRandom(-Config.ORFEN_SPAWN_RANDOM, Config.ORFEN_SPAWN_RANDOM);
|
final long respawnTime = (Config.ORFEN_SPAWN_INTERVAL + getRandom(-Config.ORFEN_SPAWN_RANDOM, Config.ORFEN_SPAWN_RANDOM)) * 3600000;
|
||||||
respawnTime *= 3600000;
|
|
||||||
startQuestTimer("orfen_unlock", respawnTime, null, null);
|
startQuestTimer("orfen_unlock", respawnTime, null, null);
|
||||||
// also save the respawn time so that the info is maintained past reboots
|
// also save the respawn time so that the info is maintained past reboots
|
||||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);
|
final StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);
|
||||||
|
@@ -94,8 +94,7 @@ final class QueenAnt extends AbstractNpcAI
|
|||||||
|
|
||||||
_zone = GrandBossManager.getInstance().getZone(QUEEN_X, QUEEN_Y, QUEEN_Z);
|
_zone = GrandBossManager.getInstance().getZone(QUEEN_X, QUEEN_Y, QUEEN_Z);
|
||||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
|
final StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
|
||||||
final int status = GrandBossManager.getInstance().getBossStatus(QUEEN);
|
if (GrandBossManager.getInstance().getBossStatus(QUEEN) == DEAD)
|
||||||
if (status == DEAD)
|
|
||||||
{
|
{
|
||||||
// load the unlock date and time for queen ant from DB
|
// load the unlock date and time for queen ant from DB
|
||||||
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||||
@@ -121,7 +120,6 @@ final class QueenAnt extends AbstractNpcAI
|
|||||||
final int heading = info.getInt("heading");
|
final int heading = info.getInt("heading");
|
||||||
final int hp = info.getInt("currentHP");
|
final int hp = info.getInt("currentHP");
|
||||||
final int mp = info.getInt("currentMP");
|
final int mp = info.getInt("currentMP");
|
||||||
|
|
||||||
final L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, loc_x, loc_y, loc_z, heading, false, 0);
|
final L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, loc_x, loc_y, loc_z, heading, false, 0);
|
||||||
queen.setCurrentHpMp(hp, mp);
|
queen.setCurrentHpMp(hp, mp);
|
||||||
spawnBoss(queen);
|
spawnBoss(queen);
|
||||||
@@ -264,13 +262,10 @@ final class QueenAnt extends AbstractNpcAI
|
|||||||
return super.onFactionCall(npc, caller, attacker, isSummon);
|
return super.onFactionCall(npc, caller, attacker, isSummon);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!npc.isCastingNow() && (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST))
|
if (!npc.isCastingNow() && (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST) && (caller.getCurrentHp() < caller.getMaxHp()))
|
||||||
{
|
{
|
||||||
if (caller.getCurrentHp() < caller.getMaxHp())
|
npc.setTarget(caller);
|
||||||
{
|
((L2Attackable) npc).useMagic(HEAL1.getSkill());
|
||||||
npc.setTarget(caller);
|
|
||||||
((L2Attackable) npc).useMagic(HEAL1.getSkill());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -341,8 +336,7 @@ final class QueenAnt extends AbstractNpcAI
|
|||||||
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||||
GrandBossManager.getInstance().setBossStatus(QUEEN, DEAD);
|
GrandBossManager.getInstance().setBossStatus(QUEEN, DEAD);
|
||||||
// Calculate Min and Max respawn times randomly.
|
// Calculate Min and Max respawn times randomly.
|
||||||
long respawnTime = Config.QUEEN_ANT_SPAWN_INTERVAL + getRandom(-Config.QUEEN_ANT_SPAWN_RANDOM, Config.QUEEN_ANT_SPAWN_RANDOM);
|
final long respawnTime = (Config.QUEEN_ANT_SPAWN_INTERVAL + getRandom(-Config.QUEEN_ANT_SPAWN_RANDOM, Config.QUEEN_ANT_SPAWN_RANDOM)) * 3600000;
|
||||||
respawnTime *= 3600000;
|
|
||||||
startQuestTimer("queen_unlock", respawnTime, null, null);
|
startQuestTimer("queen_unlock", respawnTime, null, null);
|
||||||
cancelQuestTimer("action", npc, null);
|
cancelQuestTimer("action", npc, null);
|
||||||
cancelQuestTimer("heal", null, null);
|
cancelQuestTimer("heal", null, null);
|
||||||
@@ -364,10 +358,9 @@ final class QueenAnt extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (npcId == ROYAL)
|
if (npcId == ROYAL)
|
||||||
{
|
{
|
||||||
final L2MonsterInstance mob = (L2MonsterInstance) npc;
|
if (((L2MonsterInstance) npc).getLeader() != null)
|
||||||
if (mob.getLeader() != null)
|
|
||||||
{
|
{
|
||||||
mob.getLeader().getMinionList().onMinionDie(mob, (280 + getRandom(40)) * 1000);
|
((L2MonsterInstance) npc).getLeader().getMinionList().onMinionDie(((L2MonsterInstance) npc), (280 + getRandom(40)) * 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (npcId == NURSE)
|
else if (npcId == NURSE)
|
||||||
|
@@ -220,24 +220,21 @@ public final class Valakas extends AbstractNpcAI
|
|||||||
else if (event.equalsIgnoreCase("regen_task"))
|
else if (event.equalsIgnoreCase("regen_task"))
|
||||||
{
|
{
|
||||||
// Inactivity task - 15min
|
// Inactivity task - 15min
|
||||||
if (GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING)
|
if ((GrandBossManager.getInstance().getBossStatus(VALAKAS) == FIGHTING) && ((_timeTracker + 900000) < System.currentTimeMillis()))
|
||||||
{
|
{
|
||||||
if ((_timeTracker + 900000) < System.currentTimeMillis())
|
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
||||||
{
|
npc.teleToLocation(VALAKAS_REGENERATION_LOC);
|
||||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
|
|
||||||
npc.teleToLocation(VALAKAS_REGENERATION_LOC);
|
|
||||||
|
|
||||||
GrandBossManager.getInstance().setBossStatus(VALAKAS, DORMANT);
|
GrandBossManager.getInstance().setBossStatus(VALAKAS, DORMANT);
|
||||||
npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp());
|
npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp());
|
||||||
|
|
||||||
// Drop all players from the zone.
|
// Drop all players from the zone.
|
||||||
ZONE.oustAllPlayers();
|
ZONE.oustAllPlayers();
|
||||||
|
|
||||||
// Cancel skill_task and regen_task.
|
// Cancel skill_task and regen_task.
|
||||||
cancelQuestTimer("regen_task", npc, null);
|
cancelQuestTimer("regen_task", npc, null);
|
||||||
cancelQuestTimer("skill_task", npc, null);
|
cancelQuestTimer("skill_task", npc, null);
|
||||||
return null;
|
return null;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify if "Valakas Regeneration" skill is active.
|
// Verify if "Valakas Regeneration" skill is active.
|
||||||
@@ -403,14 +400,10 @@ public final class Valakas extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Debuff strider-mounted players.
|
// Debuff strider-mounted players.
|
||||||
if (attacker.getMountType() == MountType.STRIDER)
|
if ((attacker.getMountType() == MountType.STRIDER) && !attacker.isAffectedBySkill(4258))
|
||||||
{
|
{
|
||||||
final Skill skill = SkillData.getInstance().getSkill(4258, 1);
|
npc.setTarget(attacker);
|
||||||
if (!attacker.isAffectedBySkill(4258))
|
npc.doCast(SkillData.getInstance().getSkill(4258, 1));
|
||||||
{
|
|
||||||
npc.setTarget(attacker);
|
|
||||||
npc.doCast(skill);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_timeTracker = System.currentTimeMillis();
|
_timeTracker = System.currentTimeMillis();
|
||||||
|
|
||||||
@@ -439,9 +432,7 @@ public final class Valakas extends AbstractNpcAI
|
|||||||
|
|
||||||
GrandBossManager.getInstance().setBossStatus(VALAKAS, DEAD);
|
GrandBossManager.getInstance().setBossStatus(VALAKAS, DEAD);
|
||||||
// Calculate Min and Max respawn times randomly.
|
// Calculate Min and Max respawn times randomly.
|
||||||
long respawnTime = Config.VALAKAS_SPAWN_INTERVAL + getRandom(-Config.VALAKAS_SPAWN_RANDOM, Config.VALAKAS_SPAWN_RANDOM);
|
final long respawnTime = (Config.VALAKAS_SPAWN_INTERVAL + getRandom(-Config.VALAKAS_SPAWN_RANDOM, Config.VALAKAS_SPAWN_RANDOM)) * 3600000;
|
||||||
respawnTime *= 3600000;
|
|
||||||
|
|
||||||
startQuestTimer("valakas_unlock", respawnTime, null, null);
|
startQuestTimer("valakas_unlock", respawnTime, null, null);
|
||||||
// also save the respawn time so that the info is maintained past reboots
|
// also save the respawn time so that the info is maintained past reboots
|
||||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(VALAKAS);
|
final StatsSet info = GrandBossManager.getInstance().getStatsSet(VALAKAS);
|
||||||
|
@@ -113,8 +113,7 @@ final class Venom extends AbstractNpcAI
|
|||||||
|
|
||||||
final long currentTime = System.currentTimeMillis();
|
final long currentTime = System.currentTimeMillis();
|
||||||
final long startSiegeDate = CastleManager.getInstance().getCastleById(CASTLE).getSiegeDate().getTimeInMillis();
|
final long startSiegeDate = CastleManager.getInstance().getCastleById(CASTLE).getSiegeDate().getTimeInMillis();
|
||||||
final long openingDungeonDate = startSiegeDate - (HOURS_BEFORE * 360000);
|
if ((currentTime > (startSiegeDate - (HOURS_BEFORE * 360000))) && (currentTime < startSiegeDate))
|
||||||
if ((currentTime > openingDungeonDate) && (currentTime < startSiegeDate))
|
|
||||||
{
|
{
|
||||||
_prisonIsOpen = true;
|
_prisonIsOpen = true;
|
||||||
}
|
}
|
||||||
|
@@ -76,22 +76,19 @@ final class Alarm extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
case "RECORDER_CRUSHED":
|
case "RECORDER_CRUSHED":
|
||||||
{
|
{
|
||||||
if (npc0 != null)
|
if ((npc0 != null) && npc0.getVariables().getBoolean("SPAWNED"))
|
||||||
{
|
{
|
||||||
if (npc0.getVariables().getBoolean("SPAWNED"))
|
npc0.getVariables().set("SPAWNED", false);
|
||||||
|
if (player0 != null)
|
||||||
{
|
{
|
||||||
npc0.getVariables().set("SPAWNED", false);
|
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.RECORDER_CRUSHED);
|
||||||
if (player0 != null)
|
if (verifyMemoState(player0, ART_OF_PERSUASION_ID, -1))
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.RECORDER_CRUSHED);
|
setMemoState(player0, ART_OF_PERSUASION_ID, 5);
|
||||||
if (verifyMemoState(player0, ART_OF_PERSUASION_ID, -1))
|
}
|
||||||
{
|
else if (verifyMemoState(player0, NIKOLAS_COOPERATION_ID, -1))
|
||||||
setMemoState(player0, ART_OF_PERSUASION_ID, 5);
|
{
|
||||||
}
|
setMemoState(player0, NIKOLAS_COOPERATION_ID, 5);
|
||||||
else if (verifyMemoState(player0, NIKOLAS_COOPERATION_ID, -1))
|
|
||||||
{
|
|
||||||
setMemoState(player0, NIKOLAS_COOPERATION_ID, 5);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -166,8 +163,7 @@ final class Alarm extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (verifyMemoState(player, ART_OF_PERSUASION_ID, 3))
|
if (verifyMemoState(player, ART_OF_PERSUASION_ID, 3))
|
||||||
{
|
{
|
||||||
final int i0 = getMemoStateEx(player, ART_OF_PERSUASION_ID, 1);
|
if (getMemoStateEx(player, ART_OF_PERSUASION_ID, 1) >= 3)
|
||||||
if (i0 >= 3)
|
|
||||||
{
|
{
|
||||||
if ((npc0 != null) && npc0.getVariables().getBoolean("SPAWNED"))
|
if ((npc0 != null) && npc0.getVariables().getBoolean("SPAWNED"))
|
||||||
{
|
{
|
||||||
@@ -185,14 +181,12 @@ final class Alarm extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else if (verifyMemoState(player, NIKOLAS_COOPERATION_ID, 3))
|
else if (verifyMemoState(player, NIKOLAS_COOPERATION_ID, 3))
|
||||||
{
|
{
|
||||||
final int i0 = getMemoStateEx(player, NIKOLAS_COOPERATION_ID, 1);
|
if (getMemoStateEx(player, NIKOLAS_COOPERATION_ID, 1) >= 3)
|
||||||
if (i0 >= 3)
|
|
||||||
{
|
{
|
||||||
if ((npc0 != null) && npc0.getVariables().getBoolean("SPAWNED"))
|
if ((npc0 != null) && npc0.getVariables().getBoolean("SPAWNED"))
|
||||||
{
|
{
|
||||||
npc0.getVariables().set("SPAWNED", false);
|
npc0.getVariables().set("SPAWNED", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
npc.deleteMe();
|
npc.deleteMe();
|
||||||
setMemoState(player, NIKOLAS_COOPERATION_ID, 4);
|
setMemoState(player, NIKOLAS_COOPERATION_ID, 4);
|
||||||
htmltext = "32367-185_09.html";
|
htmltext = "32367-185_09.html";
|
||||||
@@ -215,8 +209,7 @@ final class Alarm extends AbstractNpcAI
|
|||||||
String htmltext = getNoQuestMsg(talker);
|
String htmltext = getNoQuestMsg(talker);
|
||||||
if (verifyMemoState(talker, ART_OF_PERSUASION_ID, 3) || verifyMemoState(talker, NIKOLAS_COOPERATION_ID, 3))
|
if (verifyMemoState(talker, ART_OF_PERSUASION_ID, 3) || verifyMemoState(talker, NIKOLAS_COOPERATION_ID, 3))
|
||||||
{
|
{
|
||||||
final L2PcInstance player = npc.getVariables().getObject("player0", L2PcInstance.class);
|
if (npc.getVariables().getObject("player0", L2PcInstance.class) == talker)
|
||||||
if (player == talker)
|
|
||||||
{
|
{
|
||||||
htmltext = "32367-01.html";
|
htmltext = "32367-01.html";
|
||||||
}
|
}
|
||||||
|
@@ -68,13 +68,10 @@ final class BlackJudge extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (player.getShilensBreathDebuffLevel() > 0)
|
if (player.getShilensBreathDebuffLevel() > 0)
|
||||||
{
|
{
|
||||||
final int cost = COSTS[level];
|
if (player.getAdena() >= COSTS[level])
|
||||||
|
|
||||||
if (player.getAdena() >= cost)
|
|
||||||
{
|
{
|
||||||
takeItems(player, Inventory.ADENA_ID, cost);
|
takeItems(player, Inventory.ADENA_ID, COSTS[level]);
|
||||||
final int nextLv = player.getShilensBreathDebuffLevel() - 1;
|
final int nextLv = player.getShilensBreathDebuffLevel() - 1;
|
||||||
|
|
||||||
if (nextLv > 0)
|
if (nextLv > 0)
|
||||||
{
|
{
|
||||||
final Skill skill = SkillData.getInstance().getSkill(CommonSkill.SHILENS_BREATH.getId(), nextLv);
|
final Skill skill = SkillData.getInstance().getSkill(CommonSkill.SHILENS_BREATH.getId(), nextLv);
|
||||||
|
@@ -377,8 +377,7 @@ final class CastleChamberlain extends AbstractNpcAI
|
|||||||
final List<Integer> fortList = FORTRESS.get(castleId);
|
final List<Integer> fortList = FORTRESS.get(castleId);
|
||||||
for (int i = 0; i < numFort; i++)
|
for (int i = 0; i < numFort; i++)
|
||||||
{
|
{
|
||||||
final Fort fortress = FortManager.getInstance().getFortById(fortList.get(i));
|
if (FortManager.getInstance().getFortById(fortList.get(i)).getFortState() == 2)
|
||||||
if (fortress.getFortState() == 2)
|
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -989,12 +988,9 @@ final class CastleChamberlain extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
final int locId = Integer.parseInt(st.nextToken());
|
final int locId = Integer.parseInt(st.nextToken());
|
||||||
final L2TeleportLocation list = TeleportLocationTable.getInstance().getTemplate(locId);
|
final L2TeleportLocation list = TeleportLocationTable.getInstance().getTemplate(locId);
|
||||||
if (list != null)
|
if ((list != null) && takeItems(player, list.getItemId(), list.getPrice()))
|
||||||
{
|
{
|
||||||
if (takeItems(player, list.getItemId(), list.getPrice()))
|
player.teleToLocation(list.getLocX(), list.getLocY(), list.getLocZ());
|
||||||
{
|
|
||||||
player.teleToLocation(list.getLocX(), list.getLocY(), list.getLocZ());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1118,10 +1114,9 @@ final class CastleChamberlain extends AbstractNpcAI
|
|||||||
htmltext = "chamberlain-08.html";
|
htmltext = "chamberlain-08.html";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (npc.isMyLord(player))
|
if (npc.isMyLord(player))
|
||||||
{
|
{
|
||||||
final int cloakId = npc.getCastle().getSide() == CastleSide.DARK ? LORD_CLOAK_OF_DARK : LORD_CLOAK_OF_LIGHT;
|
final int cloakId = npc.getCastle().getSide() == CastleSide.DARK ? LORD_CLOAK_OF_DARK : LORD_CLOAK_OF_LIGHT;
|
||||||
|
|
||||||
if (hasQuestItems(player, cloakId))
|
if (hasQuestItems(player, cloakId))
|
||||||
{
|
{
|
||||||
htmltext = "chamberlain-03.html";
|
htmltext = "chamberlain-03.html";
|
||||||
|
@@ -69,7 +69,7 @@ final class CastleTeleporter extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
return event;
|
return event;
|
||||||
}
|
}
|
||||||
else if (event.equalsIgnoreCase("teleport"))
|
if (event.equalsIgnoreCase("teleport"))
|
||||||
{
|
{
|
||||||
final int region = MapRegionManager.getInstance().getMapRegionLocId(npc.getX(), npc.getY());
|
final int region = MapRegionManager.getInstance().getMapRegionLocId(npc.getX(), npc.getY());
|
||||||
final NpcSay msg = new NpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.THE_DEFENDERS_OF_S1_CASTLE_WILL_BE_TELEPORTED_TO_THE_INNER_CASTLE);
|
final NpcSay msg = new NpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.THE_DEFENDERS_OF_S1_CASTLE_WILL_BE_TELEPORTED_TO_THE_INNER_CASTLE);
|
||||||
|
@@ -63,8 +63,7 @@ final class FortressArcherCaptain extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
final int fortOwner = npc.getFort().getOwnerClan() == null ? 0 : npc.getFort().getOwnerClan().getId();
|
return ((player.getClan() != null) && (player.getClanId() == (npc.getFort().getOwnerClan() == null ? 0 : npc.getFort().getOwnerClan().getId()))) ? "FortressArcherCaptain.html" : "FortressArcherCaptain-01.html";
|
||||||
return ((player.getClan() != null) && (player.getClanId() == fortOwner)) ? "FortressArcherCaptain.html" : "FortressArcherCaptain-01.html";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
|
@@ -124,9 +124,7 @@ public final class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
{
|
{
|
||||||
if ("mentee".equalsIgnoreCase(d.getNodeName()))
|
if ("mentee".equalsIgnoreCase(d.getNodeName()))
|
||||||
{
|
{
|
||||||
final int level = parseInteger(d.getAttributes(), "level");
|
MENTEE_COINS.put(parseInteger(d.getAttributes(), "level"), parseInteger(d.getAttributes(), "coins"));
|
||||||
final int coins = parseInteger(d.getAttributes(), "coins");
|
|
||||||
MENTEE_COINS.put(level, coins);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -164,8 +162,7 @@ public final class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
final String[] params = event.split(" ");
|
final String[] params = event.split(" ");
|
||||||
if (Util.isDigit(params[1]))
|
if (Util.isDigit(params[1]))
|
||||||
{
|
{
|
||||||
final int objectId = Integer.valueOf(params[1]);
|
MentorManager.getInstance().getMentees(Integer.valueOf(params[1])).stream().filter(Objects::nonNull).filter(L2Mentee::isOnline).forEach(mentee ->
|
||||||
MentorManager.getInstance().getMentees(objectId).stream().filter(Objects::nonNull).filter(L2Mentee::isOnline).forEach(mentee ->
|
|
||||||
{
|
{
|
||||||
MentorManager.getInstance().cancelMentoringBuffs(mentee.getPlayerInstance());
|
MentorManager.getInstance().cancelMentoringBuffs(mentee.getPlayerInstance());
|
||||||
mentee.sendPacket(new ExMentorList(mentee.getPlayerInstance()));
|
mentee.sendPacket(new ExMentorList(mentee.getPlayerInstance()));
|
||||||
@@ -216,9 +213,9 @@ public final class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
{
|
{
|
||||||
final L2PcInstance player = event.getMentee();
|
final L2PcInstance player = event.getMentee();
|
||||||
|
|
||||||
|
final L2Mentee mentor = MentorManager.getInstance().getMentor(player.getObjectId());
|
||||||
if (event.isMenteeOnline())
|
if (event.isMenteeOnline())
|
||||||
{
|
{
|
||||||
final L2Mentee mentor = MentorManager.getInstance().getMentor(player.getObjectId());
|
|
||||||
if ((mentor != null) && mentor.isOnline())
|
if ((mentor != null) && mentor.isOnline())
|
||||||
{
|
{
|
||||||
//@formatter:off
|
//@formatter:off
|
||||||
@@ -246,25 +243,19 @@ public final class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
|
|
||||||
// Add the mentee skill
|
// Add the mentee skill
|
||||||
handleMenteeSkills(player);
|
handleMenteeSkills(player);
|
||||||
|
|
||||||
mentor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_MENTEE_S1_HAS_CONNECTED).addCharName(player));
|
mentor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_MENTEE_S1_HAS_CONNECTED).addCharName(player));
|
||||||
mentor.sendPacket(new ExMentorList(mentor.getPlayerInstance()));
|
mentor.sendPacket(new ExMentorList(mentor.getPlayerInstance()));
|
||||||
}
|
}
|
||||||
player.sendPacket(new ExMentorList(player));
|
player.sendPacket(new ExMentorList(player));
|
||||||
}
|
}
|
||||||
else
|
else if ((mentor != null) && mentor.isOnline())
|
||||||
{
|
{
|
||||||
final L2Mentee mentor = MentorManager.getInstance().getMentor(player.getObjectId());
|
if (MentorManager.getInstance().isAllMenteesOffline(mentor.getObjectId(), player.getObjectId()))
|
||||||
if ((mentor != null) && mentor.isOnline())
|
|
||||||
{
|
{
|
||||||
if (MentorManager.getInstance().isAllMenteesOffline(mentor.getObjectId(), player.getObjectId()))
|
MentorManager.getInstance().cancelMentoringBuffs(mentor.getPlayerInstance());
|
||||||
{
|
|
||||||
MentorManager.getInstance().cancelMentoringBuffs(mentor.getPlayerInstance());
|
|
||||||
}
|
|
||||||
|
|
||||||
mentor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_MENTEE_S1_HAS_DISCONNECTED).addCharName(player));
|
|
||||||
mentor.sendPacket(new ExMentorList(mentor.getPlayerInstance()));
|
|
||||||
}
|
}
|
||||||
|
mentor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_MENTEE_S1_HAS_DISCONNECTED).addCharName(player));
|
||||||
|
mentor.sendPacket(new ExMentorList(mentor.getPlayerInstance()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -461,32 +452,29 @@ public final class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
{
|
{
|
||||||
MentorManager.getInstance().cancelMentoringBuffs(player);
|
MentorManager.getInstance().cancelMentoringBuffs(player);
|
||||||
final L2Mentee mentor = MentorManager.getInstance().getMentor(player.getObjectId());
|
final L2Mentee mentor = MentorManager.getInstance().getMentor(player.getObjectId());
|
||||||
if (mentor != null)
|
if (mentor == null)
|
||||||
{
|
{
|
||||||
MentorManager.getInstance().setPenalty(mentor.getObjectId(), Config.MENTOR_PENALTY_FOR_MENTEE_COMPLETE);
|
return;
|
||||||
MentorManager.getInstance().deleteMentor(mentor.getObjectId(), player.getObjectId());
|
|
||||||
|
|
||||||
if (mentor.isOnline())
|
|
||||||
{
|
|
||||||
mentor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_AWAKENED_AND_THE_MENTOR_MENTEE_RELATIONSHIP_HAS_ENDED_THE_MENTOR_CANNOT_OBTAIN_ANOTHER_MENTEE_FOR_ONE_DAY_AFTER_THE_MENTEE_S_GRADUATION).addPcName(player));
|
|
||||||
|
|
||||||
if (MentorManager.getInstance().isAllMenteesOffline(mentor.getObjectId(), player.getObjectId()))
|
|
||||||
{
|
|
||||||
MentorManager.getInstance().cancelMentoringBuffs(mentor.getPlayerInstance());
|
|
||||||
}
|
|
||||||
mentor.sendPacket(new ExMentorList(mentor.getPlayerInstance()));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove the mentee skills
|
|
||||||
player.removeSkill(MENTEE_MENTOR_SUMMON.getSkill(), true);
|
|
||||||
|
|
||||||
// Clear mentee status
|
|
||||||
player.sendPacket(new ExMentorList(player));
|
|
||||||
|
|
||||||
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_MENTOR_MENTEE_RELATIONSHIP_WITH_YOUR_MENTOR_S1_HAS_ENDED_AS_YOU_ARE_AN_AWAKENED_CHARACTER_OF_LV_85_OR_ABOVE_YOU_CAN_NO_LONGER_BE_PAIRED_WITH_A_MENTOR).addPcName(player));
|
|
||||||
|
|
||||||
sendMail(player, MENTEE_GRADUATE_TITLE, MENTEE_GRADUATE_BODY, MENTEE_CERT, 1);
|
|
||||||
}
|
}
|
||||||
|
MentorManager.getInstance().setPenalty(mentor.getObjectId(), Config.MENTOR_PENALTY_FOR_MENTEE_COMPLETE);
|
||||||
|
MentorManager.getInstance().deleteMentor(mentor.getObjectId(), player.getObjectId());
|
||||||
|
if (mentor.isOnline())
|
||||||
|
{
|
||||||
|
mentor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_AWAKENED_AND_THE_MENTOR_MENTEE_RELATIONSHIP_HAS_ENDED_THE_MENTOR_CANNOT_OBTAIN_ANOTHER_MENTEE_FOR_ONE_DAY_AFTER_THE_MENTEE_S_GRADUATION).addPcName(player));
|
||||||
|
if (MentorManager.getInstance().isAllMenteesOffline(mentor.getObjectId(), player.getObjectId()))
|
||||||
|
{
|
||||||
|
MentorManager.getInstance().cancelMentoringBuffs(mentor.getPlayerInstance());
|
||||||
|
}
|
||||||
|
mentor.sendPacket(new ExMentorList(mentor.getPlayerInstance()));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove the mentee skills
|
||||||
|
player.removeSkill(MENTEE_MENTOR_SUMMON.getSkill(), true);
|
||||||
|
|
||||||
|
// Clear mentee status
|
||||||
|
player.sendPacket(new ExMentorList(player));
|
||||||
|
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_MENTOR_MENTEE_RELATIONSHIP_WITH_YOUR_MENTOR_S1_HAS_ENDED_AS_YOU_ARE_AN_AWAKENED_CHARACTER_OF_LV_85_OR_ABOVE_YOU_CAN_NO_LONGER_BE_PAIRED_WITH_A_MENTOR).addPcName(player));
|
||||||
|
sendMail(player, MENTEE_GRADUATE_TITLE, MENTEE_GRADUATE_BODY, MENTEE_CERT, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -81,7 +81,7 @@ final class Minigame extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
return "32758-05.html";
|
return "32758-05.html";
|
||||||
}
|
}
|
||||||
else if ((npc.getTarget() != null) && (npc.getTarget() != player))
|
if ((npc.getTarget() != null) && (npc.getTarget() != player))
|
||||||
{
|
{
|
||||||
return "32758-04.html";
|
return "32758-04.html";
|
||||||
}
|
}
|
||||||
@@ -261,8 +261,7 @@ final class Minigame extends AbstractNpcAI
|
|||||||
public void onSkillUse(OnCreatureSkillUse event)
|
public void onSkillUse(OnCreatureSkillUse event)
|
||||||
{
|
{
|
||||||
final MinigameRoom room = getRoomByParticipant((L2PcInstance) event.getCaster());
|
final MinigameRoom room = getRoomByParticipant((L2PcInstance) event.getCaster());
|
||||||
final boolean miniGameStarted = room.getStarted();
|
if (room.getStarted() && (event.getSkill().getId() == SKILL_TORCH_LIGHT))
|
||||||
if (miniGameStarted && (event.getSkill().getId() == SKILL_TORCH_LIGHT))
|
|
||||||
{
|
{
|
||||||
for (L2Object obj : event.getTargets())
|
for (L2Object obj : event.getTargets())
|
||||||
{
|
{
|
||||||
|
@@ -423,9 +423,7 @@ public final class Raina extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
final L2PcInstance player = event.getTalker();
|
final L2PcInstance player = event.getTalker();
|
||||||
final L2Npc npc = event.getNpc();
|
final L2Npc npc = event.getNpc();
|
||||||
final int ask = event.getAsk();
|
switch (event.getAsk())
|
||||||
|
|
||||||
switch (ask)
|
|
||||||
{
|
{
|
||||||
case 0: // Add subclass confirm menu
|
case 0: // Add subclass confirm menu
|
||||||
{
|
{
|
||||||
@@ -658,9 +656,7 @@ public final class Raina extends AbstractNpcAI
|
|||||||
|
|
||||||
for (SubClass subList : player.getSubClasses().values())
|
for (SubClass subList : player.getSubClasses().values())
|
||||||
{
|
{
|
||||||
final ClassId subId = ClassId.getClassId(subList.getClassId());
|
if (ClassId.getClassId(subList.getClassId()).equalsOrChildOf(cid))
|
||||||
|
|
||||||
if (subId.equalsOrChildOf(cid))
|
|
||||||
{
|
{
|
||||||
availSubs.remove(cid);
|
availSubs.remove(cid);
|
||||||
break;
|
break;
|
||||||
@@ -674,7 +670,7 @@ public final class Raina extends AbstractNpcAI
|
|||||||
private boolean haveDoneQuest(L2PcInstance player)
|
private boolean haveDoneQuest(L2PcInstance player)
|
||||||
{
|
{
|
||||||
final QuestState qs = player.getQuestState("Q10385_RedThreadOfFate"); // TODO: Replace with class name
|
final QuestState qs = player.getQuestState("Q10385_RedThreadOfFate"); // TODO: Replace with class name
|
||||||
return qs == null ? false : qs.isCompleted();
|
return (qs != null) && qs.isCompleted();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -272,8 +272,7 @@ final class SupportUnitCaptain extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
final int fortOwner = npc.getFort().getOwnerClan() == null ? 0 : npc.getFort().getOwnerClan().getId();
|
return ((player.getClan() != null) && (player.getClanId() == (npc.getFort().getOwnerClan() == null ? 0 : npc.getFort().getOwnerClan().getId()))) ? "unitcaptain.html" : "unitcaptain-04.html";
|
||||||
return ((player.getClan() != null) && (player.getClanId() == fortOwner)) ? "unitcaptain.html" : "unitcaptain-04.html";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
|
@@ -55,8 +55,7 @@ final class MithrilMinesTeleporter extends AbstractNpcAI
|
|||||||
final int index = Integer.parseInt(event) - 1;
|
final int index = Integer.parseInt(event) - 1;
|
||||||
if (LOCS.length > index)
|
if (LOCS.length > index)
|
||||||
{
|
{
|
||||||
final Location loc = LOCS[index];
|
player.teleToLocation(LOCS[index], false);
|
||||||
player.teleToLocation(loc, false);
|
|
||||||
}
|
}
|
||||||
return super.onAdvEvent(event, npc, player);
|
return super.onAdvEvent(event, npc, player);
|
||||||
}
|
}
|
||||||
|
@@ -73,8 +73,7 @@ public final class YeSagiraTeleporter extends AbstractNpcAI
|
|||||||
@RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
|
@RegisterType(ListenerRegisterType.GLOBAL_PLAYERS)
|
||||||
public void OnPlayerCreate(OnPlayerCreate event)
|
public void OnPlayerCreate(OnPlayerCreate event)
|
||||||
{
|
{
|
||||||
final L2PcInstance player = event.getActiveChar();
|
event.getActiveChar().getVariables().set(MOVIE_VAR, true);
|
||||||
player.getVariables().set(MOVIE_VAR, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
|
@@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.model.events.annotations.RegisterType;
|
|||||||
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLogin;
|
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerLogin;
|
||||||
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerSubChange;
|
import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerSubChange;
|
||||||
import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
|
||||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
|
||||||
import com.l2jmobius.gameserver.model.variables.PlayerVariables;
|
import com.l2jmobius.gameserver.model.variables.PlayerVariables;
|
||||||
import com.l2jmobius.gameserver.network.clientpackets.RequestAcquireSkill;
|
import com.l2jmobius.gameserver.network.clientpackets.RequestAcquireSkill;
|
||||||
|
|
||||||
@@ -418,18 +417,18 @@ public final class Trandon extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
final PlayerVariables vars = player.getVariables();
|
final PlayerVariables vars = player.getVariables();
|
||||||
final String list = vars.getString(type, "");
|
final String list = vars.getString(type, "");
|
||||||
if (!list.isEmpty())
|
if (list.isEmpty())
|
||||||
{
|
{
|
||||||
final String[] skills = list.split(";");
|
return;
|
||||||
for (String skill : skills)
|
|
||||||
{
|
|
||||||
final String[] str = skill.split("-");
|
|
||||||
final Skill sk = SkillData.getInstance().getSkill(Integer.parseInt(str[0]), Integer.parseInt(str[1]));
|
|
||||||
player.removeSkill(sk);
|
|
||||||
}
|
|
||||||
vars.remove(type);
|
|
||||||
player.sendSkillList();
|
|
||||||
}
|
}
|
||||||
|
final String[] skills = list.split(";");
|
||||||
|
for (String skill : skills)
|
||||||
|
{
|
||||||
|
final String[] str = skill.split("-");
|
||||||
|
player.removeSkill(SkillData.getInstance().getSkill(Integer.parseInt(str[0]), Integer.parseInt(str[1])));
|
||||||
|
}
|
||||||
|
vars.remove(type);
|
||||||
|
player.sendSkillList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final void giveSkills(L2PcInstance player, String type)
|
private final void giveSkills(L2PcInstance player, String type)
|
||||||
@@ -437,12 +436,10 @@ public final class Trandon extends AbstractNpcAI
|
|||||||
final String list = player.getVariables().getString(type, "");
|
final String list = player.getVariables().getString(type, "");
|
||||||
if (!list.isEmpty())
|
if (!list.isEmpty())
|
||||||
{
|
{
|
||||||
final String[] skills = list.split(";");
|
for (String skill : list.split(";"))
|
||||||
for (String skill : skills)
|
|
||||||
{
|
{
|
||||||
final String[] str = skill.split("-");
|
final String[] str = skill.split("-");
|
||||||
final Skill sk = SkillData.getInstance().getSkill(Integer.parseInt(str[0]), Integer.parseInt(str[1]));
|
player.addSkill(SkillData.getInstance().getSkill(Integer.parseInt(str[0]), Integer.parseInt(str[1])), false);
|
||||||
player.addSkill(sk, false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -69,11 +69,7 @@ final class Zenya extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
if (player.getLevel() < MIN_LEVEL)
|
return player.getLevel() < MIN_LEVEL ? "32140-3.html" : "32140.html";
|
||||||
{
|
|
||||||
return "32140-3.html";
|
|
||||||
}
|
|
||||||
return "32140.html";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
|
@@ -84,9 +84,7 @@ final class DevastatedCastle extends ClanHallSiegeEngine
|
|||||||
final int id = clan.getId();
|
final int id = clan.getId();
|
||||||
if (_damageToGustav.containsKey(id))
|
if (_damageToGustav.containsKey(id))
|
||||||
{
|
{
|
||||||
int newDamage = _damageToGustav.get(id);
|
_damageToGustav.put(id, (_damageToGustav.get(id) + damage));
|
||||||
newDamage += damage;
|
|
||||||
_damageToGustav.put(id, newDamage);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -117,8 +117,7 @@ final class FortressOfResistance extends ClanHallSiegeEngine
|
|||||||
final int clanId = player.getClanId();
|
final int clanId = player.getClanId();
|
||||||
if (clanId > 0)
|
if (clanId > 0)
|
||||||
{
|
{
|
||||||
final long clanDmg = (_damageToNurka.containsKey(clanId)) ? _damageToNurka.get(clanId) + damage : damage;
|
_damageToNurka.put(clanId, ((_damageToNurka.containsKey(clanId)) ? _damageToNurka.get(clanId) + damage : damage));
|
||||||
_damageToNurka.put(clanId, clanDmg);
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@@ -91,9 +91,7 @@ final class FortressOfTheDead extends ClanHallSiegeEngine
|
|||||||
final int id = clan.getId();
|
final int id = clan.getId();
|
||||||
if ((id > 0) && _damageToLidia.containsKey(id))
|
if ((id > 0) && _damageToLidia.containsKey(id))
|
||||||
{
|
{
|
||||||
int newDamage = _damageToLidia.get(id);
|
_damageToLidia.put(id, (_damageToLidia.get(id) + damage));
|
||||||
newDamage += damage;
|
|
||||||
_damageToLidia.put(id, newDamage);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -158,8 +156,7 @@ final class FortressOfTheDead extends ClanHallSiegeEngine
|
|||||||
if ((hoursLeft < 0) || (hoursLeft > 6))
|
if ((hoursLeft < 0) || (hoursLeft > 6))
|
||||||
{
|
{
|
||||||
cancelSiegeTask();
|
cancelSiegeTask();
|
||||||
final long scheduleTime = (24 - hoursLeft) * 10 * 60000;
|
_siegeTask = ThreadPoolManager.getInstance().scheduleGeneral(new SiegeStarts(), ((24 - hoursLeft) * 10 * 60000));
|
||||||
_siegeTask = ThreadPoolManager.getInstance().scheduleGeneral(new SiegeStarts(), scheduleTime);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -22,7 +22,6 @@ import java.sql.ResultSet;
|
|||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -75,57 +74,59 @@ final class RainbowSpringsChateau extends ClanHallSiegeEngine
|
|||||||
}
|
}
|
||||||
|
|
||||||
int spotLeft = 4;
|
int spotLeft = 4;
|
||||||
if (_rainbow.getOwnerId() > 0)
|
if (_rainbow.getOwnerId() <= 0)
|
||||||
{
|
{
|
||||||
final L2Clan owner = ClanTable.getInstance().getClan(_rainbow.getOwnerId());
|
return;
|
||||||
if (owner != null)
|
}
|
||||||
{
|
|
||||||
_rainbow.free();
|
|
||||||
owner.setHideoutId(0);
|
|
||||||
_acceptedClans.add(owner);
|
|
||||||
--spotLeft;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < spotLeft; i++)
|
final L2Clan owner = ClanTable.getInstance().getClan(_rainbow.getOwnerId());
|
||||||
|
if (owner != null)
|
||||||
|
{
|
||||||
|
_rainbow.free();
|
||||||
|
owner.setHideoutId(0);
|
||||||
|
_acceptedClans.add(owner);
|
||||||
|
--spotLeft;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < spotLeft; i++)
|
||||||
|
{
|
||||||
|
long counter = 0;
|
||||||
|
L2Clan clan = null;
|
||||||
|
for (int clanId : _warDecreesCount.keySet())
|
||||||
{
|
{
|
||||||
long counter = 0;
|
final L2Clan actingClan = ClanTable.getInstance().getClan(clanId);
|
||||||
L2Clan clan = null;
|
if ((actingClan == null) || (actingClan.getDissolvingExpiryTime() > 0))
|
||||||
for (int clanId : _warDecreesCount.keySet())
|
|
||||||
{
|
{
|
||||||
final L2Clan actingClan = ClanTable.getInstance().getClan(clanId);
|
_warDecreesCount.remove(clanId);
|
||||||
if ((actingClan == null) || (actingClan.getDissolvingExpiryTime() > 0))
|
continue;
|
||||||
{
|
|
||||||
_warDecreesCount.remove(clanId);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
final long count = _warDecreesCount.get(clanId);
|
|
||||||
if (count > counter)
|
|
||||||
{
|
|
||||||
counter = count;
|
|
||||||
clan = actingClan;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ((clan != null) && (_acceptedClans.size() < 4))
|
|
||||||
|
final long count = _warDecreesCount.get(clanId);
|
||||||
|
if (count > counter)
|
||||||
{
|
{
|
||||||
_acceptedClans.add(clan);
|
counter = count;
|
||||||
final L2PcInstance leader = clan.getLeader().getPlayerInstance();
|
clan = actingClan;
|
||||||
if (leader != null)
|
|
||||||
{
|
|
||||||
leader.sendMessage("Your clan has been accepted to join the RainBow Srpings Chateau siege!");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_acceptedClans.size() >= 2)
|
if ((clan != null) && (_acceptedClans.size() < 4))
|
||||||
{
|
{
|
||||||
_nextSiege = ThreadPoolManager.getInstance().scheduleGeneral(new SiegeStart(), 3600000);
|
_acceptedClans.add(clan);
|
||||||
_rainbow.updateSiegeStatus(SiegeStatus.WAITING_BATTLE);
|
final L2PcInstance leader = clan.getLeader().getPlayerInstance();
|
||||||
}
|
if (leader != null)
|
||||||
else
|
{
|
||||||
{
|
leader.sendMessage("Your clan has been accepted to join the RainBow Srpings Chateau siege!");
|
||||||
Broadcast.toAllOnlinePlayers("Rainbow Springs Chateau siege aborted due lack of population");
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (_acceptedClans.size() >= 2)
|
||||||
|
{
|
||||||
|
_nextSiege = ThreadPoolManager.getInstance().scheduleGeneral(new SiegeStart(), 3600000);
|
||||||
|
_rainbow.updateSiegeStatus(SiegeStatus.WAITING_BATTLE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Broadcast.toAllOnlinePlayers("Rainbow Springs Chateau siege aborted due lack of population");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,8 +195,7 @@ final class RainbowSpringsChateau extends ClanHallSiegeEngine
|
|||||||
{
|
{
|
||||||
for (int arenaId : ARENA_ZONES)
|
for (int arenaId : ARENA_ZONES)
|
||||||
{
|
{
|
||||||
final Collection<L2Character> chars = ZoneManager.getInstance().getZoneById(arenaId).getCharactersInside();
|
for (L2Character chr : ZoneManager.getInstance().getZoneById(arenaId).getCharactersInside())
|
||||||
for (L2Character chr : chars)
|
|
||||||
{
|
{
|
||||||
if (chr != null)
|
if (chr != null)
|
||||||
{
|
{
|
||||||
@@ -285,18 +285,20 @@ final class RainbowSpringsChateau extends ClanHallSiegeEngine
|
|||||||
loadAttackers();
|
loadAttackers();
|
||||||
|
|
||||||
_rainbow = CHSiegeManager.getInstance().getSiegableHall(RAINBOW_SPRINGS);
|
_rainbow = CHSiegeManager.getInstance().getSiegableHall(RAINBOW_SPRINGS);
|
||||||
if (_rainbow != null)
|
if (_rainbow == null)
|
||||||
{
|
{
|
||||||
final long delay = _rainbow.getNextSiegeTime();
|
return;
|
||||||
if (delay > -1)
|
}
|
||||||
{
|
|
||||||
setRegistrationEndString(delay - 3600000);
|
final long delay = _rainbow.getNextSiegeTime();
|
||||||
_nextSiege = ThreadPoolManager.getInstance().scheduleGeneral(new SetFinalAttackers(), delay);
|
if (delay > -1)
|
||||||
}
|
{
|
||||||
else
|
setRegistrationEndString(delay - 3600000);
|
||||||
{
|
_nextSiege = ThreadPoolManager.getInstance().scheduleGeneral(new SetFinalAttackers(), delay);
|
||||||
_log.warning("CHSiegeManager: No Date setted for RainBow Springs Chateau Clan hall siege!. SIEGE CANCELED!");
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
_log.warning("CHSiegeManager: No Date setted for RainBow Springs Chateau Clan hall siege!. SIEGE CANCELED!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -317,35 +319,20 @@ final class RainbowSpringsChateau extends ClanHallSiegeEngine
|
|||||||
}
|
}
|
||||||
else if (npcId == CARETAKER)
|
else if (npcId == CARETAKER)
|
||||||
{
|
{
|
||||||
if (_rainbow.isInSiege())
|
html = _rainbow.isInSiege() ? "game_manager003.htm" : "game_manager001.htm";
|
||||||
|
}
|
||||||
|
else if (Util.contains(YETIS, npcId) && _rainbow.isInSiege())
|
||||||
|
{
|
||||||
|
if (!player.isClanLeader())
|
||||||
{
|
{
|
||||||
html = "game_manager003.htm";
|
html = "no_clan_leader.htm";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
html = "game_manager001.htm";
|
final L2Clan clan = player.getClan();
|
||||||
}
|
if (_acceptedClans.contains(clan) && (npcId == YETIS[_acceptedClans.indexOf(clan)]))
|
||||||
}
|
|
||||||
else if (Util.contains(YETIS, npcId))
|
|
||||||
{
|
|
||||||
// TODO: Review.
|
|
||||||
if (_rainbow.isInSiege())
|
|
||||||
{
|
|
||||||
if (!player.isClanLeader())
|
|
||||||
{
|
{
|
||||||
html = "no_clan_leader.htm";
|
html = "yeti_main.htm";
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
final L2Clan clan = player.getClan();
|
|
||||||
if (_acceptedClans.contains(clan))
|
|
||||||
{
|
|
||||||
final int index = _acceptedClans.indexOf(clan);
|
|
||||||
if (npcId == YETIS[index])
|
|
||||||
{
|
|
||||||
html = "yeti_main.htm";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -769,8 +756,7 @@ final class RainbowSpringsChateau extends ClanHallSiegeEngine
|
|||||||
|
|
||||||
private static void reduceGourdHp(int index, L2PcInstance player)
|
private static void reduceGourdHp(int index, L2PcInstance player)
|
||||||
{
|
{
|
||||||
final L2Spawn gourd = _gourds[index];
|
_gourds[index].getLastSpawn().reduceCurrentHp(1000, player, null);
|
||||||
gourd.getLastSpawn().reduceCurrentHp(1000, player, null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void increaseGourdHp(int index)
|
private static void increaseGourdHp(int index)
|
||||||
@@ -789,8 +775,7 @@ final class RainbowSpringsChateau extends ClanHallSiegeEngine
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
final Collection<L2Character> chars = ZoneManager.getInstance().getZoneById(id).getCharactersInside();
|
for (L2Character chr : ZoneManager.getInstance().getZoneById(id).getCharactersInside())
|
||||||
for (L2Character chr : chars)
|
|
||||||
{
|
{
|
||||||
if (chr != null)
|
if (chr != null)
|
||||||
{
|
{
|
||||||
@@ -813,17 +798,14 @@ final class RainbowSpringsChateau extends ClanHallSiegeEngine
|
|||||||
}
|
}
|
||||||
|
|
||||||
final int randomPos = getRandom(length);
|
final int randomPos = getRandom(length);
|
||||||
final String message = _textPassages[randomPos];
|
if (_usedTextPassages.containsKey(_textPassages[randomPos]))
|
||||||
|
|
||||||
if (_usedTextPassages.containsKey(message))
|
|
||||||
{
|
{
|
||||||
shoutRandomText(npc);
|
shoutRandomText(npc);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_usedTextPassages.put(message, new ArrayList<L2Clan>());
|
_usedTextPassages.put(_textPassages[randomPos], new ArrayList<L2Clan>());
|
||||||
final NpcSay say = new NpcSay(npc.getObjectId(), ChatType.NPC_SHOUT, npc.getId(), message);
|
npc.broadcastPacket((new NpcSay(npc.getObjectId(), ChatType.NPC_SHOUT, npc.getId(), _textPassages[randomPos])));
|
||||||
npc.broadcastPacket(say);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -177,8 +177,7 @@ final class Wedding extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
final String htmltext = getHtm(player.getHtmlPrefix(), "Start.html");
|
return getHtm(player.getHtmlPrefix(), "Start.html").replaceAll("%fee%", String.valueOf(Config.L2JMOD_WEDDING_PRICE));
|
||||||
return htmltext.replaceAll("%fee%", String.valueOf(Config.L2JMOD_WEDDING_PRICE));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String sendHtml(L2PcInstance player, String fileName, String regex, String replacement)
|
private String sendHtml(L2PcInstance player, String fileName, String regex, String replacement)
|
||||||
|
@@ -139,8 +139,7 @@ public class ListenerTest extends AbstractNpcAI
|
|||||||
// Make sure a player killed this monster.
|
// Make sure a player killed this monster.
|
||||||
if ((event.getAttacker() != null) && event.getAttacker().isPlayable() && event.getTarget().isAttackable())
|
if ((event.getAttacker() != null) && event.getAttacker().isPlayable() && event.getTarget().isAttackable())
|
||||||
{
|
{
|
||||||
final L2Attackable monster = (L2Attackable) event.getTarget();
|
((L2Attackable) event.getTarget()).dropItem(event.getAttacker().getActingPlayer(), new ItemHolder(57, Rnd.get(100, 1000)));
|
||||||
monster.dropItem(event.getAttacker().getActingPlayer(), new ItemHolder(57, Rnd.get(100, 1000)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -56,30 +56,27 @@ final class LoveYourGatekeeper extends LongTimeEvent
|
|||||||
{
|
{
|
||||||
case "transform_stick":
|
case "transform_stick":
|
||||||
{
|
{
|
||||||
if (player.getAdena() >= PRICE)
|
if (player.getAdena() < PRICE)
|
||||||
{
|
{
|
||||||
final long reuse = player.getVariables().getLong(REUSE, 0);
|
return "32477-3.htm";
|
||||||
if (reuse > System.currentTimeMillis())
|
}
|
||||||
{
|
final long reuse = player.getVariables().getLong(REUSE, 0);
|
||||||
final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
|
if (reuse > System.currentTimeMillis())
|
||||||
final int hours = (int) (remainingTime / 3600);
|
{
|
||||||
final int minutes = (int) ((remainingTime % 3600) / 60);
|
final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
|
final int hours = (int) (remainingTime / 3600);
|
||||||
sm.addItemName(GATEKEEPER_TRANSFORMATION_STICK);
|
final int minutes = (int) ((remainingTime % 3600) / 60);
|
||||||
sm.addInt(hours);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
|
||||||
sm.addInt(minutes);
|
sm.addItemName(GATEKEEPER_TRANSFORMATION_STICK);
|
||||||
player.sendPacket(sm);
|
sm.addInt(hours);
|
||||||
}
|
sm.addInt(minutes);
|
||||||
else
|
player.sendPacket(sm);
|
||||||
{
|
|
||||||
takeItems(player, Inventory.ADENA_ID, PRICE);
|
|
||||||
giveItems(player, GATEKEEPER_TRANSFORMATION_STICK, 1);
|
|
||||||
player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return "32477-3.htm";
|
takeItems(player, Inventory.ADENA_ID, PRICE);
|
||||||
|
giveItems(player, GATEKEEPER_TRANSFORMATION_STICK, 1);
|
||||||
|
player.getVariables().set(REUSE, System.currentTimeMillis() + (HOURS * 3600000));
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@@ -735,9 +735,7 @@ public class EnergySeeds extends AbstractNpcAI
|
|||||||
// if the AI is inactive, do not spawn the NPC
|
// if the AI is inactive, do not spawn the NPC
|
||||||
if (isSeedActive(_seedId))
|
if (isSeedActive(_seedId))
|
||||||
{
|
{
|
||||||
// get a random NPC that should spawn at this location
|
_spawnedNpcs.put(addSpawn(_npcIds[getRandom(_npcIds.length)], _loc, false, 0), _spawnId);
|
||||||
final Integer spawnId = _spawnId; // the map uses "Integer", not "int"
|
|
||||||
_spawnedNpcs.put(addSpawn(_npcIds[getRandom(_npcIds.length)], _loc, false, 0), spawnId);
|
|
||||||
}
|
}
|
||||||
}, waitTime);
|
}, waitTime);
|
||||||
}
|
}
|
||||||
|
@@ -110,8 +110,7 @@ public class Lindvior extends AbstractNpcAI
|
|||||||
|
|
||||||
private void scheduleNextLindviorVisit()
|
private void scheduleNextLindviorVisit()
|
||||||
{
|
{
|
||||||
final long delay = (ALT_MODE) ? ALT_MODE_MIN * 60000 : scheduleNextLindviorDate();
|
startQuestTimer("start", ((ALT_MODE) ? ALT_MODE_MIN * 60000 : scheduleNextLindviorDate()), null, null);
|
||||||
startQuestTimer("start", delay, null, null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private long scheduleNextLindviorDate()
|
private long scheduleNextLindviorDate()
|
||||||
|
163
trunk/dist/game/data/scripts/gracia/AI/Maguen.java
vendored
163
trunk/dist/game/data/scripts/gracia/AI/Maguen.java
vendored
@@ -260,103 +260,100 @@ public final class Maguen extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onSkillSee(L2Npc npc, L2PcInstance caster, Skill skill, L2Object[] targets, boolean isSummon)
|
public String onSkillSee(L2Npc npc, L2PcInstance caster, Skill skill, L2Object[] targets, boolean isSummon)
|
||||||
{
|
{
|
||||||
if ((skill == MACHINE.getSkill()) && (caster == npc.getVariables().getObject("SUMMON_PLAYER", L2PcInstance.class)))
|
if ((skill == MACHINE.getSkill()) && (caster == npc.getVariables().getObject("SUMMON_PLAYER", L2PcInstance.class)) && (npc.getVariables().getInt("NPC_EFFECT") != 0) && (npc.getVariables().getInt("BLOCKED_SKILLSEE") == 0))
|
||||||
{
|
{
|
||||||
if ((npc.getVariables().getInt("NPC_EFFECT") != 0) && (npc.getVariables().getInt("BLOCKED_SKILLSEE") == 0))
|
final BuffInfo i1_info = caster.getEffectList().getBuffInfoByAbnormalType(B_PLASMA1.getSkill().getAbnormalType());
|
||||||
|
final BuffInfo i2_info = caster.getEffectList().getBuffInfoByAbnormalType(C_PLASMA1.getSkill().getAbnormalType());
|
||||||
|
final BuffInfo i3_info = caster.getEffectList().getBuffInfoByAbnormalType(R_PLASMA1.getSkill().getAbnormalType());
|
||||||
|
|
||||||
|
final int i1 = i1_info == null ? 0 : i1_info.getSkill().getAbnormalLvl();
|
||||||
|
final int i2 = i2_info == null ? 0 : i2_info.getSkill().getAbnormalLvl();
|
||||||
|
final int i3 = i3_info == null ? 0 : i3_info.getSkill().getAbnormalLvl();
|
||||||
|
|
||||||
|
caster.getEffectList().stopSkillEffects(true, B_PLASMA1.getSkill().getAbnormalType());
|
||||||
|
caster.getEffectList().stopSkillEffects(true, C_PLASMA1.getSkill().getAbnormalType());
|
||||||
|
caster.getEffectList().stopSkillEffects(true, R_PLASMA1.getSkill().getAbnormalType());
|
||||||
|
cancelQuestTimer("FIRST_TIMER", npc, caster);
|
||||||
|
cancelQuestTimer("SECOND_TIMER", npc, caster);
|
||||||
|
cancelQuestTimer("THIRD_TIMER", npc, caster);
|
||||||
|
cancelQuestTimer("FORTH_TIMER", npc, caster);
|
||||||
|
npc.getVariables().set("BLOCKED_SKILLSEE", 1);
|
||||||
|
|
||||||
|
SkillHolder skillToCast = null;
|
||||||
|
switch (npc.getVariables().getInt("NPC_EFFECT"))
|
||||||
{
|
{
|
||||||
final BuffInfo i1_info = caster.getEffectList().getBuffInfoByAbnormalType(B_PLASMA1.getSkill().getAbnormalType());
|
case 1:
|
||||||
final BuffInfo i2_info = caster.getEffectList().getBuffInfoByAbnormalType(C_PLASMA1.getSkill().getAbnormalType());
|
|
||||||
final BuffInfo i3_info = caster.getEffectList().getBuffInfoByAbnormalType(R_PLASMA1.getSkill().getAbnormalType());
|
|
||||||
|
|
||||||
final int i1 = i1_info == null ? 0 : i1_info.getSkill().getAbnormalLvl();
|
|
||||||
final int i2 = i2_info == null ? 0 : i2_info.getSkill().getAbnormalLvl();
|
|
||||||
final int i3 = i3_info == null ? 0 : i3_info.getSkill().getAbnormalLvl();
|
|
||||||
|
|
||||||
caster.getEffectList().stopSkillEffects(true, B_PLASMA1.getSkill().getAbnormalType());
|
|
||||||
caster.getEffectList().stopSkillEffects(true, C_PLASMA1.getSkill().getAbnormalType());
|
|
||||||
caster.getEffectList().stopSkillEffects(true, R_PLASMA1.getSkill().getAbnormalType());
|
|
||||||
cancelQuestTimer("FIRST_TIMER", npc, caster);
|
|
||||||
cancelQuestTimer("SECOND_TIMER", npc, caster);
|
|
||||||
cancelQuestTimer("THIRD_TIMER", npc, caster);
|
|
||||||
cancelQuestTimer("FORTH_TIMER", npc, caster);
|
|
||||||
npc.getVariables().set("BLOCKED_SKILLSEE", 1);
|
|
||||||
|
|
||||||
SkillHolder skillToCast = null;
|
|
||||||
switch (npc.getVariables().getInt("NPC_EFFECT"))
|
|
||||||
{
|
{
|
||||||
case 1:
|
switch (i1)
|
||||||
{
|
{
|
||||||
switch (i1)
|
case 0:
|
||||||
{
|
{
|
||||||
case 0:
|
skillToCast = B_PLASMA1;
|
||||||
{
|
break;
|
||||||
skillToCast = B_PLASMA1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1:
|
|
||||||
{
|
|
||||||
skillToCast = B_PLASMA2;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
{
|
|
||||||
skillToCast = B_PLASMA3;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
case 1:
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
{
|
|
||||||
switch (i2)
|
|
||||||
{
|
{
|
||||||
case 0:
|
skillToCast = B_PLASMA2;
|
||||||
{
|
break;
|
||||||
skillToCast = C_PLASMA1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1:
|
|
||||||
{
|
|
||||||
skillToCast = C_PLASMA2;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
{
|
|
||||||
skillToCast = C_PLASMA3;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
case 2:
|
||||||
}
|
|
||||||
case 3:
|
|
||||||
{
|
|
||||||
switch (i3)
|
|
||||||
{
|
{
|
||||||
case 0:
|
skillToCast = B_PLASMA3;
|
||||||
{
|
break;
|
||||||
skillToCast = R_PLASMA1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1:
|
|
||||||
{
|
|
||||||
skillToCast = R_PLASMA2;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
{
|
|
||||||
skillToCast = R_PLASMA3;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
case 2:
|
||||||
if (skillToCast != null)
|
|
||||||
{
|
{
|
||||||
npc.setTarget(caster);
|
switch (i2)
|
||||||
npc.doCast(skillToCast.getSkill());
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
skillToCast = C_PLASMA1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
skillToCast = C_PLASMA2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
skillToCast = C_PLASMA3;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
case 3:
|
||||||
|
{
|
||||||
|
switch (i3)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
skillToCast = R_PLASMA1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
skillToCast = R_PLASMA2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
skillToCast = R_PLASMA3;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (skillToCast != null)
|
||||||
|
{
|
||||||
|
npc.setTarget(caster);
|
||||||
|
npc.doCast(skillToCast.getSkill());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||||
|
@@ -339,8 +339,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (TELEPORT_ZONES.containsKey(zone.getId()))
|
if (TELEPORT_ZONES.containsKey(zone.getId()))
|
||||||
{
|
{
|
||||||
final Location teleLoc = TELEPORT_ZONES.get(zone.getId());
|
character.teleToLocation(TELEPORT_ZONES.get(zone.getId()), false);
|
||||||
character.teleToLocation(teleLoc, false);
|
|
||||||
}
|
}
|
||||||
return super.onEnterZone(character, zone);
|
return super.onEnterZone(character, zone);
|
||||||
}
|
}
|
||||||
|
@@ -86,7 +86,7 @@ public final class SecretArea extends Quest
|
|||||||
enterInstance(player);
|
enterInstance(player);
|
||||||
return "32566-01.html";
|
return "32566-01.html";
|
||||||
}
|
}
|
||||||
else if ((npc.getId() == LELRIKIA) && event.equalsIgnoreCase("exit"))
|
if ((npc.getId() == LELRIKIA) && event.equalsIgnoreCase("exit"))
|
||||||
{
|
{
|
||||||
teleportPlayer(player, TELEPORTS[EXIT], 0);
|
teleportPlayer(player, TELEPORTS[EXIT], 0);
|
||||||
return "32567-01.html";
|
return "32567-01.html";
|
||||||
|
@@ -298,43 +298,30 @@ public final class Stage1 extends Quest
|
|||||||
attrs = cd.getAttributes();
|
attrs = cd.getAttributes();
|
||||||
final SODSpawn spw = new SODSpawn();
|
final SODSpawn spw = new SODSpawn();
|
||||||
spw.npcId = npcId;
|
spw.npcId = npcId;
|
||||||
|
|
||||||
att = attrs.getNamedItem("x");
|
att = attrs.getNamedItem("x");
|
||||||
if (att != null)
|
if (att == null)
|
||||||
{
|
|
||||||
spw.x = Integer.parseInt(att.getNodeValue());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
spw.x = Integer.parseInt(att.getNodeValue());
|
||||||
att = attrs.getNamedItem("y");
|
att = attrs.getNamedItem("y");
|
||||||
if (att != null)
|
if (att == null)
|
||||||
{
|
|
||||||
spw.y = Integer.parseInt(att.getNodeValue());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
spw.y = Integer.parseInt(att.getNodeValue());
|
||||||
att = attrs.getNamedItem("z");
|
att = attrs.getNamedItem("z");
|
||||||
if (att != null)
|
if (att == null)
|
||||||
{
|
|
||||||
spw.z = Integer.parseInt(att.getNodeValue());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
spw.z = Integer.parseInt(att.getNodeValue());
|
||||||
att = attrs.getNamedItem("heading");
|
att = attrs.getNamedItem("heading");
|
||||||
if (att != null)
|
if (att == null)
|
||||||
{
|
|
||||||
spw.h = Integer.parseInt(att.getNodeValue());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
spw.h = Integer.parseInt(att.getNodeValue());
|
||||||
att = attrs.getNamedItem("mustKill");
|
att = attrs.getNamedItem("mustKill");
|
||||||
if (att != null)
|
if (att != null)
|
||||||
{
|
{
|
||||||
@@ -353,25 +340,18 @@ public final class Stage1 extends Quest
|
|||||||
final SODSpawn spw = new SODSpawn();
|
final SODSpawn spw = new SODSpawn();
|
||||||
spw.npcId = npcId;
|
spw.npcId = npcId;
|
||||||
spw.isZone = true;
|
spw.isZone = true;
|
||||||
|
|
||||||
att = attrs.getNamedItem("id");
|
att = attrs.getNamedItem("id");
|
||||||
if (att != null)
|
if (att == null)
|
||||||
{
|
|
||||||
spw.zone = Integer.parseInt(att.getNodeValue());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
spw.zone = Integer.parseInt(att.getNodeValue());
|
||||||
att = attrs.getNamedItem("count");
|
att = attrs.getNamedItem("count");
|
||||||
if (att != null)
|
if (att == null)
|
||||||
{
|
|
||||||
spw.count = Integer.parseInt(att.getNodeValue());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
spw.count = Integer.parseInt(att.getNodeValue());
|
||||||
att = attrs.getNamedItem("mustKill");
|
att = attrs.getNamedItem("mustKill");
|
||||||
if (att != null)
|
if (att != null)
|
||||||
{
|
{
|
||||||
@@ -425,24 +405,17 @@ public final class Stage1 extends Quest
|
|||||||
attrs = cd.getAttributes();
|
attrs = cd.getAttributes();
|
||||||
int x, y;
|
int x, y;
|
||||||
att = attrs.getNamedItem("x");
|
att = attrs.getNamedItem("x");
|
||||||
if (att != null)
|
if (att == null)
|
||||||
{
|
|
||||||
x = Integer.parseInt(att.getNodeValue());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
x = Integer.parseInt(att.getNodeValue());
|
||||||
att = attrs.getNamedItem("y");
|
att = attrs.getNamedItem("y");
|
||||||
if (att != null)
|
if (att == null)
|
||||||
{
|
|
||||||
y = Integer.parseInt(att.getNodeValue());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
y = Integer.parseInt(att.getNodeValue());
|
||||||
ter.add(x, y, minz, maxz, 0);
|
ter.add(x, y, minz, maxz, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -505,8 +478,7 @@ public final class Stage1 extends Quest
|
|||||||
party.broadcastPacket(sm);
|
party.broadcastPacket(sm);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final Long reentertime = InstanceManager.getInstance().getInstanceTime(partyMember.getObjectId(), INSTANCEID);
|
if (System.currentTimeMillis() < InstanceManager.getInstance().getInstanceTime(partyMember.getObjectId(), INSTANCEID))
|
||||||
if (System.currentTimeMillis() < reentertime)
|
|
||||||
{
|
{
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
|
||||||
sm.addPcName(partyMember);
|
sm.addPcName(partyMember);
|
||||||
@@ -834,24 +806,17 @@ public final class Stage1 extends Quest
|
|||||||
if (!isSummon && (player != null))
|
if (!isSummon && (player != null))
|
||||||
{
|
{
|
||||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(player.getInstanceId());
|
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(player.getInstanceId());
|
||||||
if (tmpworld instanceof SOD1World)
|
if ((tmpworld instanceof SOD1World) && (((SOD1World) tmpworld).getStatus() == 7) && spawnState(((SOD1World) tmpworld)))
|
||||||
{
|
{
|
||||||
final SOD1World world = (SOD1World) tmpworld;
|
for (int objId : ((SOD1World) tmpworld).getAllowed())
|
||||||
if (world.getStatus() == 7)
|
|
||||||
{
|
{
|
||||||
if (spawnState(world))
|
final L2PcInstance pl = L2World.getInstance().getPlayer(objId);
|
||||||
|
if (pl != null)
|
||||||
{
|
{
|
||||||
for (int objId : world.getAllowed())
|
pl.showQuestMovie(5);
|
||||||
{
|
|
||||||
final L2PcInstance pl = L2World.getInstance().getPlayer(objId);
|
|
||||||
if (pl != null)
|
|
||||||
{
|
|
||||||
pl.showQuestMovie(5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
npc.deleteMe();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
npc.deleteMe();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -874,16 +839,10 @@ public final class Stage1 extends Quest
|
|||||||
world.setStatus(4);
|
world.setStatus(4);
|
||||||
spawnFlaggedNPCs(world, 2);
|
spawnFlaggedNPCs(world, 2);
|
||||||
}
|
}
|
||||||
else if ((world.getStatus() <= 8) && (npc.getId() == TIAT))
|
else if ((world.getStatus() <= 8) && (npc.getId() == TIAT) && (npc.getCurrentHp() < (npc.getMaxHp() / 2)) && spawnState(world))
|
||||||
{
|
{
|
||||||
if (npc.getCurrentHp() < (npc.getMaxHp() / 2))
|
startQuestTimer("TiatFullHp", 3000, npc, null);
|
||||||
{
|
setInstanceTimeRestrictions(world);
|
||||||
if (spawnState(world))
|
|
||||||
{
|
|
||||||
startQuestTimer("TiatFullHp", 3000, npc, null);
|
|
||||||
setInstanceTimeRestrictions(world);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -922,8 +881,7 @@ public final class Stage1 extends Quest
|
|||||||
{
|
{
|
||||||
world.deviceSpawnedMobCount = 0;
|
world.deviceSpawnedMobCount = 0;
|
||||||
spawnFlaggedNPCs(world, 6);
|
spawnFlaggedNPCs(world, 6);
|
||||||
final ExShowScreenMessage message3 = new ExShowScreenMessage(NpcStringId.ENEMIES_ARE_TRYING_TO_DESTROY_THE_FORTRESS_EVERYONE_DEFEND_THE_FORTRESS, 5, 1);
|
sendScreenMessage(world, new ExShowScreenMessage(NpcStringId.ENEMIES_ARE_TRYING_TO_DESTROY_THE_FORTRESS_EVERYONE_DEFEND_THE_FORTRESS, 5, 1));
|
||||||
sendScreenMessage(world, message3);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1061,7 +1019,6 @@ public final class Stage1 extends Quest
|
|||||||
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(trap.getInstanceId());
|
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(trap.getInstanceId());
|
||||||
if (tmpworld instanceof SOD1World)
|
if (tmpworld instanceof SOD1World)
|
||||||
{
|
{
|
||||||
final SOD1World world = (SOD1World) tmpworld;
|
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case TRAP_TRIGGERED:
|
case TRAP_TRIGGERED:
|
||||||
@@ -1070,14 +1027,14 @@ public final class Stage1 extends Quest
|
|||||||
{
|
{
|
||||||
for (int npcId : TRAP_18771_NPCS)
|
for (int npcId : TRAP_18771_NPCS)
|
||||||
{
|
{
|
||||||
addSpawn(npcId, trap.getX(), trap.getY(), trap.getZ(), trap.getHeading(), true, 0, true, world.getInstanceId());
|
addSpawn(npcId, trap.getX(), trap.getY(), trap.getZ(), trap.getHeading(), true, 0, true, ((SOD1World) tmpworld).getInstanceId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (int npcId : TRAP_OTHER_NPCS)
|
for (int npcId : TRAP_OTHER_NPCS)
|
||||||
{
|
{
|
||||||
addSpawn(npcId, trap.getX(), trap.getY(), trap.getZ(), trap.getHeading(), true, 0, true, world.getInstanceId());
|
addSpawn(npcId, trap.getX(), trap.getY(), trap.getZ(), trap.getHeading(), true, 0, true, ((SOD1World) tmpworld).getInstanceId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -232,8 +232,7 @@ public final class HallOfSuffering extends AbstractNpcAI
|
|||||||
party.broadcastPacket(sm);
|
party.broadcastPacket(sm);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final long reentertime = InstanceManager.getInstance().getInstanceTime(partyMember.getObjectId(), TEMPLATE_ID);
|
if (System.currentTimeMillis() < InstanceManager.getInstance().getInstanceTime(partyMember.getObjectId(), TEMPLATE_ID))
|
||||||
if (System.currentTimeMillis() < reentertime)
|
|
||||||
{
|
{
|
||||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_MAY_NOT_RE_ENTER_YET);
|
||||||
sm.addPcName(partyMember);
|
sm.addPcName(partyMember);
|
||||||
@@ -457,9 +456,7 @@ public final class HallOfSuffering extends AbstractNpcAI
|
|||||||
|
|
||||||
private String getPtLeaderText(L2PcInstance player, HSWorld world)
|
private String getPtLeaderText(L2PcInstance player, HSWorld world)
|
||||||
{
|
{
|
||||||
String htmltext = HtmCache.getInstance().getHtm(player.getHtmlPrefix(), "/scripts/gracia/instances/SeedOfInfinity/HallOfSuffering/32530-10.htm");
|
return HtmCache.getInstance().getHtm(player.getHtmlPrefix(), "/scripts/gracia/instances/SeedOfInfinity/HallOfSuffering/32530-10.htm").replaceAll("%ptLeader%", String.valueOf(world.ptLeaderName));
|
||||||
htmltext = htmltext.replaceAll("%ptLeader%", String.valueOf(world.ptLeaderName));
|
|
||||||
return htmltext;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -619,20 +616,17 @@ public final class HallOfSuffering extends AbstractNpcAI
|
|||||||
runTwins(world);
|
runTwins(world);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((world.getStatus() == 6) && ((npc.getId() == KLODEKUS) || (npc.getId() == KLANIKUS)))
|
else if ((world.getStatus() == 6) && ((npc.getId() == KLODEKUS) || (npc.getId() == KLANIKUS)) && world.klanikus.isDead() && world.klodekus.isDead())
|
||||||
{
|
{
|
||||||
if (world.klanikus.isDead() && world.klodekus.isDead())
|
world.incStatus();
|
||||||
{
|
// instance end
|
||||||
world.incStatus();
|
calcRewardItemId(world);
|
||||||
// instance end
|
world.klanikus = null;
|
||||||
calcRewardItemId(world);
|
world.klodekus = null;
|
||||||
world.klanikus = null;
|
cancelQuestTimers("ressurectTwin");
|
||||||
world.klodekus = null;
|
cancelQuestTimers("spawnBossGuards");
|
||||||
cancelQuestTimers("ressurectTwin");
|
cancelQuestTimers("isTwinSeparated");
|
||||||
cancelQuestTimers("spawnBossGuards");
|
addSpawn(TEPIOS, TEPIOS_SPAWN, false, 0, false, world.getInstanceId());
|
||||||
cancelQuestTimers("isTwinSeparated");
|
|
||||||
addSpawn(TEPIOS, TEPIOS_SPAWN, false, 0, false, world.getInstanceId());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return super.onKill(npc, killer, isSummon);
|
return super.onKill(npc, killer, isSummon);
|
||||||
|
@@ -285,34 +285,31 @@ public abstract class AirShipController extends Quest
|
|||||||
@Override
|
@Override
|
||||||
public String onEnterZone(L2Character character, L2ZoneType zone)
|
public String onEnterZone(L2Character character, L2ZoneType zone)
|
||||||
{
|
{
|
||||||
if (character instanceof L2ControllableAirShipInstance)
|
if ((character instanceof L2ControllableAirShipInstance) && (_dockedShip == null))
|
||||||
{
|
{
|
||||||
if (_dockedShip == null)
|
_dockedShip = (L2ControllableAirShipInstance) character;
|
||||||
{
|
_dockedShip.setInDock(_dockZone);
|
||||||
_dockedShip = (L2ControllableAirShipInstance) character;
|
_dockedShip.setOustLoc(_oustLoc);
|
||||||
_dockedShip.setInDock(_dockZone);
|
|
||||||
_dockedShip.setOustLoc(_oustLoc);
|
|
||||||
|
|
||||||
// Ship is not empty - display movie to passengers and dock
|
// Ship is not empty - display movie to passengers and dock
|
||||||
if (!_dockedShip.isEmpty())
|
if (!_dockedShip.isEmpty())
|
||||||
|
{
|
||||||
|
if (_movieId != 0)
|
||||||
{
|
{
|
||||||
if (_movieId != 0)
|
for (L2PcInstance passenger : _dockedShip.getPassengers())
|
||||||
{
|
{
|
||||||
for (L2PcInstance passenger : _dockedShip.getPassengers())
|
if (passenger != null)
|
||||||
{
|
{
|
||||||
if (passenger != null)
|
passenger.showQuestMovie(_movieId);
|
||||||
{
|
|
||||||
passenger.showQuestMovie(_movieId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ThreadPoolManager.getInstance().scheduleGeneral(_decayTask, 1000);
|
ThreadPoolManager.getInstance().scheduleGeneral(_decayTask, 1000);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_departSchedule = ThreadPoolManager.getInstance().scheduleGeneral(_departTask, DEPART_INTERVAL);
|
_departSchedule = ThreadPoolManager.getInstance().scheduleGeneral(_departTask, DEPART_INTERVAL);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -321,20 +318,17 @@ public abstract class AirShipController extends Quest
|
|||||||
@Override
|
@Override
|
||||||
public String onExitZone(L2Character character, L2ZoneType zone)
|
public String onExitZone(L2Character character, L2ZoneType zone)
|
||||||
{
|
{
|
||||||
if (character instanceof L2ControllableAirShipInstance)
|
if ((character instanceof L2ControllableAirShipInstance) && character.equals(_dockedShip))
|
||||||
{
|
{
|
||||||
if (character.equals(_dockedShip))
|
if (_departSchedule != null)
|
||||||
{
|
{
|
||||||
if (_departSchedule != null)
|
_departSchedule.cancel(false);
|
||||||
{
|
_departSchedule = null;
|
||||||
_departSchedule.cancel(false);
|
|
||||||
_departSchedule = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
_dockedShip.setInDock(0);
|
|
||||||
_dockedShip = null;
|
|
||||||
_isBusy = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_dockedShip.setInDock(0);
|
||||||
|
_dockedShip = null;
|
||||||
|
_isBusy = false;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -373,14 +367,11 @@ public abstract class AirShipController extends Quest
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_arrivalPath == null)
|
if ((_arrivalPath == null) && !ZoneManager.getInstance().getZoneById(_dockZone, L2ScriptZone.class).isInsideZone(_shipSpawnX, _shipSpawnY, _shipSpawnZ))
|
||||||
{
|
{
|
||||||
if (!ZoneManager.getInstance().getZoneById(_dockZone, L2ScriptZone.class).isInsideZone(_shipSpawnX, _shipSpawnY, _shipSpawnZ))
|
_log.log(Level.WARNING, getName() + ": Arrival path is null and spawn point not in zone " + _dockZone + ", controller disabled");
|
||||||
{
|
_isBusy = true;
|
||||||
_log.log(Level.WARNING, getName() + ": Arrival path is null and spawn point not in zone " + _dockZone + ", controller disabled");
|
return;
|
||||||
_isBusy = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_departPath != null)
|
if (_departPath != null)
|
||||||
|
@@ -50,14 +50,11 @@ public class L2ArtefactInstanceAction implements IActionHandler
|
|||||||
{
|
{
|
||||||
activeChar.setTarget(target);
|
activeChar.setTarget(target);
|
||||||
}
|
}
|
||||||
else if (interact)
|
// Calculate the distance between the L2PcInstance and the L2NpcInstance
|
||||||
|
else if (interact && !((L2Npc) target).canInteract(activeChar))
|
||||||
{
|
{
|
||||||
// Calculate the distance between the L2PcInstance and the L2NpcInstance
|
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
|
||||||
if (!((L2Npc) target).canInteract(activeChar))
|
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, target);
|
||||||
{
|
|
||||||
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
|
|
||||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, target);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -22,7 +22,6 @@ import com.l2jmobius.gameserver.ai.CtrlIntention;
|
|||||||
import com.l2jmobius.gameserver.enums.InstanceType;
|
import com.l2jmobius.gameserver.enums.InstanceType;
|
||||||
import com.l2jmobius.gameserver.handler.IActionHandler;
|
import com.l2jmobius.gameserver.handler.IActionHandler;
|
||||||
import com.l2jmobius.gameserver.model.L2Object;
|
import com.l2jmobius.gameserver.model.L2Object;
|
||||||
import com.l2jmobius.gameserver.model.Location;
|
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.model.entity.L2Event;
|
import com.l2jmobius.gameserver.model.entity.L2Event;
|
||||||
@@ -88,8 +87,7 @@ public class L2NpcAction implements IActionHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
final Location destination = GeoData.getInstance().moveCheck(activeChar, target);
|
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, GeoData.getInstance().moveCheck(activeChar, target));
|
||||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!target.isAutoAttackable(activeChar))
|
else if (!target.isAutoAttackable(activeChar))
|
||||||
|
@@ -22,7 +22,6 @@ import com.l2jmobius.gameserver.enums.InstanceType;
|
|||||||
import com.l2jmobius.gameserver.enums.PrivateStoreType;
|
import com.l2jmobius.gameserver.enums.PrivateStoreType;
|
||||||
import com.l2jmobius.gameserver.handler.IActionHandler;
|
import com.l2jmobius.gameserver.handler.IActionHandler;
|
||||||
import com.l2jmobius.gameserver.model.L2Object;
|
import com.l2jmobius.gameserver.model.L2Object;
|
||||||
import com.l2jmobius.gameserver.model.Location;
|
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.model.entity.TvTEvent;
|
import com.l2jmobius.gameserver.model.entity.TvTEvent;
|
||||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
@@ -108,8 +107,7 @@ public class L2PcInstanceAction implements IActionHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
final Location destination = GeoData.getInstance().moveCheck(activeChar, player);
|
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, GeoData.getInstance().moveCheck(activeChar, player));
|
||||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
|
|
||||||
}
|
}
|
||||||
activeChar.onActionRequest();
|
activeChar.onActionRequest();
|
||||||
}
|
}
|
||||||
@@ -124,8 +122,7 @@ public class L2PcInstanceAction implements IActionHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
final Location destination = GeoData.getInstance().moveCheck(activeChar, player);
|
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, GeoData.getInstance().moveCheck(activeChar, player));
|
||||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -29,7 +29,7 @@ import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
|||||||
public class L2StaticObjectInstanceAction implements IActionHandler
|
public class L2StaticObjectInstanceAction implements IActionHandler
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public boolean action(L2PcInstance activeChar, final L2Object target, final boolean interact)
|
public boolean action(L2PcInstance activeChar, L2Object target, boolean interact)
|
||||||
{
|
{
|
||||||
final L2StaticObjectInstance staticObject = (L2StaticObjectInstance) target;
|
final L2StaticObjectInstance staticObject = (L2StaticObjectInstance) target;
|
||||||
if (staticObject.getType() < 0)
|
if (staticObject.getType() < 0)
|
||||||
|
@@ -31,8 +31,7 @@ public class L2ItemInstanceActionShift implements IActionShiftHandler
|
|||||||
{
|
{
|
||||||
if (activeChar.getAccessLevel().isGm())
|
if (activeChar.getAccessLevel().isGm())
|
||||||
{
|
{
|
||||||
final NpcHtmlMessage html = new NpcHtmlMessage(StringUtil.concat("<html><body><center><font color=\"LEVEL\">Item Info</font></center><br><table border=0>", "<tr><td>Object ID: </td><td>", String.valueOf(target.getObjectId()), "</td></tr><tr><td>Item ID: </td><td>", String.valueOf(target.getId()), "</td></tr><tr><td>Owner ID: </td><td>", String.valueOf(((L2ItemInstance) target).getOwnerId()), "</td></tr><tr><td>Location: </td><td>", String.valueOf(((L2ItemInstance) target).getLocation()), "</td></tr><tr><td><br></td></tr><tr><td>Class: </td><td>", target.getClass().getSimpleName(), "</td></tr></table></body></html>"));
|
activeChar.sendPacket(new NpcHtmlMessage(StringUtil.concat("<html><body><center><font color=\"LEVEL\">Item Info</font></center><br><table border=0>", "<tr><td>Object ID: </td><td>", String.valueOf(target.getObjectId()), "</td></tr><tr><td>Item ID: </td><td>", String.valueOf(target.getId()), "</td></tr><tr><td>Owner ID: </td><td>", String.valueOf(((L2ItemInstance) target).getOwnerId()), "</td></tr><tr><td>Location: </td><td>", String.valueOf(((L2ItemInstance) target).getLocation()), "</td></tr><tr><td><br></td></tr><tr><td>Class: </td><td>", target.getClass().getSimpleName(), "</td></tr></table></body></html>")));
|
||||||
activeChar.sendPacket(html);
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -34,9 +34,7 @@ public class L2StaticObjectInstanceActionShift implements IActionShiftHandler
|
|||||||
{
|
{
|
||||||
activeChar.setTarget(target);
|
activeChar.setTarget(target);
|
||||||
activeChar.sendPacket(new StaticObject((L2StaticObjectInstance) target));
|
activeChar.sendPacket(new StaticObject((L2StaticObjectInstance) target));
|
||||||
|
activeChar.sendPacket(new NpcHtmlMessage(StringUtil.concat("<html><body><center><font color=\"LEVEL\">Static Object Info</font></center><br><table border=0><tr><td>Coords X,Y,Z: </td><td>", String.valueOf(target.getX()), ", ", String.valueOf(target.getY()), ", ", String.valueOf(target.getZ()), "</td></tr><tr><td>Object ID: </td><td>", String.valueOf(target.getObjectId()), "</td></tr><tr><td>Static Object ID: </td><td>", String.valueOf(target.getId()), "</td></tr><tr><td>Mesh Index: </td><td>", String.valueOf(((L2StaticObjectInstance) target).getMeshIndex()), "</td></tr><tr><td><br></td></tr><tr><td>Class: </td><td>", target.getClass().getSimpleName(), "</td></tr></table></body></html>")));
|
||||||
final NpcHtmlMessage html = new NpcHtmlMessage(StringUtil.concat("<html><body><center><font color=\"LEVEL\">Static Object Info</font></center><br><table border=0><tr><td>Coords X,Y,Z: </td><td>", String.valueOf(target.getX()), ", ", String.valueOf(target.getY()), ", ", String.valueOf(target.getZ()), "</td></tr><tr><td>Object ID: </td><td>", String.valueOf(target.getObjectId()), "</td></tr><tr><td>Static Object ID: </td><td>", String.valueOf(target.getId()), "</td></tr><tr><td>Mesh Index: </td><td>", String.valueOf(((L2StaticObjectInstance) target).getMeshIndex()), "</td></tr><tr><td><br></td></tr><tr><td>Class: </td><td>", target.getClass().getSimpleName(), "</td></tr></table></body></html>"));
|
|
||||||
activeChar.sendPacket(html);
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -287,16 +287,11 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
showConfigPage(activeChar);
|
showConfigPage(activeChar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (command.startsWith("admin_gmon"))
|
|
||||||
{
|
|
||||||
// nothing
|
|
||||||
}
|
|
||||||
else if (command.startsWith("admin_worldchat"))
|
else if (command.startsWith("admin_worldchat"))
|
||||||
{
|
{
|
||||||
final StringTokenizer st = new StringTokenizer(command);
|
final StringTokenizer st = new StringTokenizer(command);
|
||||||
st.nextToken(); // admin_worldchat
|
st.nextToken(); // admin_worldchat
|
||||||
final String subCmd = st.hasMoreTokens() ? st.nextToken() : "";
|
switch (st.hasMoreTokens() ? st.nextToken() : "")
|
||||||
switch (subCmd)
|
|
||||||
{
|
{
|
||||||
case "shout":
|
case "shout":
|
||||||
{
|
{
|
||||||
@@ -372,6 +367,10 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (command.startsWith("admin_gmon"))
|
||||||
|
{
|
||||||
|
// nothing
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -83,8 +83,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
case "admin_announces":
|
case "admin_announces":
|
||||||
{
|
{
|
||||||
final String subCmd = st.hasMoreTokens() ? st.nextToken() : "";
|
switch (st.hasMoreTokens() ? st.nextToken() : "")
|
||||||
switch (subCmd)
|
|
||||||
{
|
{
|
||||||
case "add":
|
case "add":
|
||||||
{
|
{
|
||||||
|
@@ -138,9 +138,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String val = command.substring(22);
|
listCharacters(activeChar, Integer.parseInt(command.substring(22)));
|
||||||
final int page = Integer.parseInt(val);
|
|
||||||
listCharacters(activeChar, page);
|
|
||||||
}
|
}
|
||||||
catch (StringIndexOutOfBoundsException e)
|
catch (StringIndexOutOfBoundsException e)
|
||||||
{
|
{
|
||||||
@@ -152,8 +150,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String val = command.substring(21);
|
findCharacter(activeChar, command.substring(21));
|
||||||
findCharacter(activeChar, val);
|
|
||||||
}
|
}
|
||||||
catch (StringIndexOutOfBoundsException e)
|
catch (StringIndexOutOfBoundsException e)
|
||||||
{ // Case of empty character name
|
{ // Case of empty character name
|
||||||
@@ -165,8 +162,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String val = command.substring(14);
|
findCharactersPerIp(activeChar, command.substring(14));
|
||||||
findCharactersPerIp(activeChar, val);
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{ // Case of empty or malformed IP number
|
{ // Case of empty or malformed IP number
|
||||||
@@ -178,8 +174,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String val = command.substring(19);
|
findCharactersPerAccount(activeChar, command.substring(19));
|
||||||
findCharactersPerAccount(activeChar, val);
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{ // Case of empty or malformed player name
|
{ // Case of empty or malformed player name
|
||||||
@@ -212,9 +207,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String val = command.substring(15);
|
setTargetKarma(activeChar, Integer.parseInt(command.substring(15)));
|
||||||
final int karma = Integer.parseInt(val);
|
|
||||||
setTargetKarma(activeChar, karma);
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -570,9 +563,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
final boolean changeCreateExpiryTime = st.nextToken().equalsIgnoreCase("create");
|
final boolean changeCreateExpiryTime = st.nextToken().equalsIgnoreCase("create");
|
||||||
|
|
||||||
final String playerName = st.nextToken();
|
final String playerName = st.nextToken();
|
||||||
L2PcInstance player = null;
|
final L2PcInstance player = L2World.getInstance().getPlayer(playerName);
|
||||||
player = L2World.getInstance().getPlayer(playerName);
|
|
||||||
|
|
||||||
if (player == null)
|
if (player == null)
|
||||||
{
|
{
|
||||||
final String updateQuery = "UPDATE characters SET " + (changeCreateExpiryTime ? "clan_create_expiry_time" : "clan_join_expiry_time") + " WHERE char_name=? LIMIT 1";
|
final String updateQuery = "UPDATE characters SET " + (changeCreateExpiryTime ? "clan_create_expiry_time" : "clan_join_expiry_time") + " WHERE char_name=? LIMIT 1";
|
||||||
@@ -751,9 +742,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
L2Object target;
|
L2Object target;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String val = command.substring(19);
|
target = L2World.getInstance().getPet(Integer.parseInt(command.substring(19)));
|
||||||
final int objId = Integer.parseInt(val);
|
|
||||||
target = L2World.getInstance().getPet(objId);
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -888,8 +877,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
|
activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final L2Playable playable = ((L2Playable) target);
|
((L2Playable) target).updatePvPFlag(Math.abs(((L2Playable) target).getPvpFlag() - 1));
|
||||||
playable.updatePvPFlag(Math.abs(playable.getPvpFlag() - 1));
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -1079,8 +1067,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
|
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
final L2PcInstance player = (L2PcInstance) target;
|
gatherCharacterInfo(activeChar, ((L2PcInstance) target), "charedit.htm");
|
||||||
gatherCharacterInfo(activeChar, player, "charedit.htm");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1378,8 +1365,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
public int hashCode()
|
public int hashCode()
|
||||||
{
|
{
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
int result = 1;
|
int result = (prime * 1) + ((ip == null) ? 0 : ip.hashCode());
|
||||||
result = (prime * result) + ((ip == null) ? 0 : ip.hashCode());
|
|
||||||
for (int[] array : tracert)
|
for (int[] array : tracert)
|
||||||
{
|
{
|
||||||
result = (prime * result) + Arrays.hashCode(array);
|
result = (prime * result) + Arrays.hashCode(array);
|
||||||
@@ -1455,8 +1441,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
html.replace("%race%", target.getTemplate().getRace().toString());
|
html.replace("%race%", target.getTemplate().getRace().toString());
|
||||||
if (target instanceof L2PetInstance)
|
if (target instanceof L2PetInstance)
|
||||||
{
|
{
|
||||||
final int objId = target.getActingPlayer().getObjectId();
|
html.replace("%inv%", " <a action=\"bypass admin_show_pet_inv " + target.getActingPlayer().getObjectId() + "\">view</a>");
|
||||||
html.replace("%inv%", " <a action=\"bypass admin_show_pet_inv " + objId + "\">view</a>");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -30,7 +30,6 @@ import com.l2jmobius.gameserver.model.actor.L2Npc;
|
|||||||
import com.l2jmobius.gameserver.model.actor.instance.L2ChestInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2ChestInstance;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.model.skills.AbnormalVisualEffect;
|
import com.l2jmobius.gameserver.model.skills.AbnormalVisualEffect;
|
||||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
|
||||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.CharInfo;
|
import com.l2jmobius.gameserver.network.serverpackets.CharInfo;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.Earthquake;
|
import com.l2jmobius.gameserver.network.serverpackets.Earthquake;
|
||||||
@@ -227,8 +226,7 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final Collection<L2PcInstance> plrs = activeChar.getKnownList().getKnownPlayers().values();
|
for (L2PcInstance player : activeChar.getKnownList().getKnownPlayers().values())
|
||||||
for (L2PcInstance player : plrs)
|
|
||||||
{
|
{
|
||||||
if (!player.isGM())
|
if (!player.isGM())
|
||||||
{
|
{
|
||||||
@@ -246,8 +244,7 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final Collection<L2PcInstance> plrs = activeChar.getKnownList().getKnownPlayers().values();
|
for (L2PcInstance player : activeChar.getKnownList().getKnownPlayers().values())
|
||||||
for (L2PcInstance player : plrs)
|
|
||||||
{
|
{
|
||||||
player.stopAbnormalVisualEffect(AbnormalVisualEffect.PARALYZE);
|
player.stopAbnormalVisualEffect(AbnormalVisualEffect.PARALYZE);
|
||||||
player.setIsParalyzed(false);
|
player.setIsParalyzed(false);
|
||||||
@@ -363,8 +360,7 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
activeChar.stopSkillEffects((val == 0) && sendMessage, 7029);
|
activeChar.stopSkillEffects((val == 0) && sendMessage, 7029);
|
||||||
if ((val >= 1) && (val <= 4))
|
if ((val >= 1) && (val <= 4))
|
||||||
{
|
{
|
||||||
final Skill gmSpeedSkill = SkillData.getInstance().getSkill(7029, val);
|
activeChar.doSimultaneousCast(SkillData.getInstance().getSkill(7029, val));
|
||||||
activeChar.doSimultaneousCast(gmSpeedSkill);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -386,8 +382,7 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
activeChar.teleToLocation(activeChar.getLocation());
|
activeChar.teleToLocation(activeChar.getLocation());
|
||||||
final CharInfo info1 = new CharInfo(activeChar);
|
final CharInfo info1 = new CharInfo(activeChar);
|
||||||
activeChar.broadcastPacket(info1);
|
activeChar.broadcastPacket(info1);
|
||||||
final UserInfo info2 = new UserInfo(activeChar);
|
activeChar.sendPacket(new UserInfo(activeChar));
|
||||||
activeChar.sendPacket(info2);
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -401,15 +396,13 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
activeChar.spawnMe(activeChar.getX(), activeChar.getY(), activeChar.getZ());
|
activeChar.spawnMe(activeChar.getX(), activeChar.getY(), activeChar.getZ());
|
||||||
final CharInfo info1 = new CharInfo(activeChar);
|
final CharInfo info1 = new CharInfo(activeChar);
|
||||||
activeChar.broadcastPacket(info1);
|
activeChar.broadcastPacket(info1);
|
||||||
final UserInfo info2 = new UserInfo(activeChar);
|
activeChar.sendPacket(new UserInfo(activeChar));
|
||||||
activeChar.sendPacket(info2);
|
|
||||||
}
|
}
|
||||||
else if (command.equals("admin_clearteams"))
|
else if (command.equals("admin_clearteams"))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final Collection<L2PcInstance> plrs = activeChar.getKnownList().getKnownPlayers().values();
|
for (L2PcInstance player : activeChar.getKnownList().getKnownPlayers().values())
|
||||||
for (L2PcInstance player : plrs)
|
|
||||||
{
|
{
|
||||||
player.setTeam(Team.NONE);
|
player.setTeam(Team.NONE);
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
@@ -430,9 +423,7 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
radius = Integer.parseInt(st.nextToken());
|
radius = Integer.parseInt(st.nextToken());
|
||||||
}
|
}
|
||||||
final Team team = Team.valueOf(val.toUpperCase());
|
final Team team = Team.valueOf(val.toUpperCase());
|
||||||
final Collection<L2Character> plrs = activeChar.getKnownList().getKnownCharactersInRadius(radius);
|
for (L2Character player : activeChar.getKnownList().getKnownCharactersInRadius(radius))
|
||||||
|
|
||||||
for (L2Character player : plrs)
|
|
||||||
{
|
{
|
||||||
player.setTeam(team);
|
player.setTeam(team);
|
||||||
}
|
}
|
||||||
@@ -648,9 +639,7 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
final L2Npc npc = (L2Npc) target;
|
final L2Npc npc = (L2Npc) target;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String type = st.nextToken();
|
npc.setDisplayEffect(Integer.parseInt(st.nextToken()));
|
||||||
final int diplayeffect = Integer.parseInt(type);
|
|
||||||
npc.setDisplayEffect(diplayeffect);
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -709,8 +698,7 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
activeChar.sendPacket(SystemMessageId.NOTHING_HAPPENED);
|
activeChar.sendPacket(SystemMessageId.NOTHING_HAPPENED);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final L2Character character = (L2Character) target;
|
((L2Character) target).broadcastPacket(new SocialAction(((L2Character) target).getObjectId(), action));
|
||||||
character.broadcastPacket(new SocialAction(character.getObjectId(), action));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -781,11 +769,6 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
|
|
||||||
private void showMainPage(L2PcInstance activeChar, String command)
|
private void showMainPage(L2PcInstance activeChar, String command)
|
||||||
{
|
{
|
||||||
String filename = "effects_menu";
|
AdminHtml.showAdminHtml(activeChar, (command.contains("social") ? "social" : "effects_menu") + ".htm");
|
||||||
if (command.contains("social"))
|
|
||||||
{
|
|
||||||
filename = "social";
|
|
||||||
}
|
|
||||||
AdminHtml.showAdminHtml(activeChar, filename + ".htm");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -321,8 +321,7 @@ public class AdminEventEngine implements IAdminCommandHandler
|
|||||||
player.teleToLocation(player.getLocation(), true);
|
player.teleToLocation(player.getLocation(), true);
|
||||||
final CharInfo info1 = new CharInfo(player);
|
final CharInfo info1 = new CharInfo(player);
|
||||||
player.broadcastPacket(info1);
|
player.broadcastPacket(info1);
|
||||||
final UserInfo info2 = new UserInfo(player);
|
player.sendPacket(new UserInfo(player));
|
||||||
player.sendPacket(info2);
|
|
||||||
}
|
}
|
||||||
showEventControl(activeChar);
|
showEventControl(activeChar);
|
||||||
}
|
}
|
||||||
@@ -337,8 +336,7 @@ public class AdminEventEngine implements IAdminCommandHandler
|
|||||||
player.spawnMe(player.getX(), player.getY(), player.getZ());
|
player.spawnMe(player.getX(), player.getY(), player.getZ());
|
||||||
final CharInfo info1 = new CharInfo(player);
|
final CharInfo info1 = new CharInfo(player);
|
||||||
player.broadcastPacket(info1);
|
player.broadcastPacket(info1);
|
||||||
final UserInfo info2 = new UserInfo(player);
|
player.sendPacket(new UserInfo(player));
|
||||||
player.sendPacket(info2);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
showEventControl(activeChar);
|
showEventControl(activeChar);
|
||||||
|
@@ -52,8 +52,7 @@ public class AdminExpSp implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String val = command.substring(16);
|
if (!adminAddExpSp(activeChar, command.substring(16)))
|
||||||
if (!adminAddExpSp(activeChar, val))
|
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Usage: //add_exp_sp exp sp");
|
activeChar.sendMessage("Usage: //add_exp_sp exp sp");
|
||||||
}
|
}
|
||||||
@@ -67,8 +66,7 @@ public class AdminExpSp implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String val = command.substring(19);
|
if (!adminRemoveExpSP(activeChar, command.substring(19)))
|
||||||
if (!adminRemoveExpSP(activeChar, val))
|
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Usage: //remove_exp_sp exp sp");
|
activeChar.sendMessage("Usage: //remove_exp_sp exp sp");
|
||||||
}
|
}
|
||||||
|
@@ -106,16 +106,8 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
L2NpcTemplate npc1 = null;
|
final L2NpcTemplate npc1 = mid1 != 0 ? NpcData.getInstance().getTemplate(mid1) : null;
|
||||||
if (mid1 != 0)
|
final L2NpcTemplate npc2 = mid2 != 0 ? NpcData.getInstance().getTemplate(mid2) : null;
|
||||||
{
|
|
||||||
npc1 = NpcData.getInstance().getTemplate(mid1);
|
|
||||||
}
|
|
||||||
L2NpcTemplate npc2 = null;
|
|
||||||
if (mid2 != 0)
|
|
||||||
{
|
|
||||||
npc2 = NpcData.getInstance().getTemplate(mid2);
|
|
||||||
}
|
|
||||||
|
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||||
|
|
||||||
|
@@ -21,7 +21,6 @@ import java.util.StringTokenizer;
|
|||||||
|
|
||||||
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
import com.l2jmobius.gameserver.handler.IAdminCommandHandler;
|
||||||
import com.l2jmobius.gameserver.instancemanager.FortManager;
|
import com.l2jmobius.gameserver.instancemanager.FortManager;
|
||||||
import com.l2jmobius.gameserver.model.L2Clan;
|
|
||||||
import com.l2jmobius.gameserver.model.L2Object;
|
import com.l2jmobius.gameserver.model.L2Object;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.model.entity.Fort;
|
import com.l2jmobius.gameserver.model.entity.Fort;
|
||||||
@@ -124,8 +123,7 @@ public class AdminFortSiege implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (command.equalsIgnoreCase("admin_removefort"))
|
else if (command.equalsIgnoreCase("admin_removefort"))
|
||||||
{
|
{
|
||||||
final L2Clan clan = fort.getOwnerClan();
|
if (fort.getOwnerClan() != null)
|
||||||
if (clan != null)
|
|
||||||
{
|
{
|
||||||
fort.removeOwner(true);
|
fort.removeOwner(true);
|
||||||
}
|
}
|
||||||
@@ -190,5 +188,4 @@ public class AdminFortSiege implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
return ADMIN_COMMANDS;
|
return ADMIN_COMMANDS;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -112,8 +112,7 @@ public class AdminGmChat implements IAdminCommandHandler
|
|||||||
offset = 13;
|
offset = 13;
|
||||||
}
|
}
|
||||||
text = command.substring(offset);
|
text = command.substring(offset);
|
||||||
final CreatureSay cs = new CreatureSay(0, ChatType.ALLIANCE, activeChar.getName(), text);
|
AdminData.getInstance().broadcastToGMs((new CreatureSay(0, ChatType.ALLIANCE, activeChar.getName(), text)));
|
||||||
AdminData.getInstance().broadcastToGMs(cs);
|
|
||||||
}
|
}
|
||||||
catch (StringIndexOutOfBoundsException e)
|
catch (StringIndexOutOfBoundsException e)
|
||||||
{
|
{
|
||||||
|
@@ -39,12 +39,7 @@ public class AdminGraciaSeeds implements IAdminCommandHandler
|
|||||||
final StringTokenizer st = new StringTokenizer(command, " ");
|
final StringTokenizer st = new StringTokenizer(command, " ");
|
||||||
final String actualCommand = st.nextToken(); // Get actual command
|
final String actualCommand = st.nextToken(); // Get actual command
|
||||||
|
|
||||||
String val = "";
|
final String val = st.countTokens() >= 1 ? st.nextToken() : "";
|
||||||
if (st.countTokens() >= 1)
|
|
||||||
{
|
|
||||||
val = st.nextToken();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (actualCommand.equalsIgnoreCase("admin_kill_tiat"))
|
if (actualCommand.equalsIgnoreCase("admin_kill_tiat"))
|
||||||
{
|
{
|
||||||
GraciaSeedsManager.getInstance().increaseSoDTiatKilled();
|
GraciaSeedsManager.getInstance().increaseSoDTiatKilled();
|
||||||
|
@@ -68,8 +68,7 @@ public class AdminGrandBoss implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
if (st.hasMoreTokens())
|
if (st.hasMoreTokens())
|
||||||
{
|
{
|
||||||
final int grandBossId = Integer.parseInt(st.nextToken());
|
manageHtml(activeChar, Integer.parseInt(st.nextToken()));
|
||||||
manageHtml(activeChar, grandBossId);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -138,9 +137,7 @@ public class AdminGrandBoss implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
if (st.hasMoreTokens())
|
if (st.hasMoreTokens())
|
||||||
{
|
{
|
||||||
final int grandBossId = Integer.parseInt(st.nextToken());
|
switch (Integer.parseInt(st.nextToken()))
|
||||||
|
|
||||||
switch (grandBossId)
|
|
||||||
{
|
{
|
||||||
case ANTHARAS:
|
case ANTHARAS:
|
||||||
{
|
{
|
||||||
|
@@ -50,8 +50,7 @@ public class AdminHeal implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String healTarget = command.substring(11);
|
handleHeal(activeChar, command.substring(11));
|
||||||
handleHeal(activeChar, healTarget);
|
|
||||||
}
|
}
|
||||||
catch (StringIndexOutOfBoundsException e)
|
catch (StringIndexOutOfBoundsException e)
|
||||||
{
|
{
|
||||||
|
@@ -96,8 +96,7 @@ public class AdminHtml implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
final File file = new File(Config.DATAPACK_ROOT, path);
|
content = HtmCache.getInstance().loadFile((new File(Config.DATAPACK_ROOT, path)));
|
||||||
content = HtmCache.getInstance().loadFile(file);
|
|
||||||
}
|
}
|
||||||
final NpcHtmlMessage html = new NpcHtmlMessage();
|
final NpcHtmlMessage html = new NpcHtmlMessage();
|
||||||
if (content != null)
|
if (content != null)
|
||||||
@@ -116,5 +115,4 @@ public class AdminHtml implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
return ADMIN_COMMANDS;
|
return ADMIN_COMMANDS;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -40,12 +40,7 @@ public class AdminLevel implements IAdminCommandHandler
|
|||||||
final StringTokenizer st = new StringTokenizer(command, " ");
|
final StringTokenizer st = new StringTokenizer(command, " ");
|
||||||
final String actualCommand = st.nextToken(); // Get actual command
|
final String actualCommand = st.nextToken(); // Get actual command
|
||||||
|
|
||||||
String val = "";
|
final String val = st.countTokens() >= 1 ? st.nextToken() : "";
|
||||||
if (st.countTokens() >= 1)
|
|
||||||
{
|
|
||||||
val = st.nextToken();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (actualCommand.equalsIgnoreCase("admin_add_level"))
|
if (actualCommand.equalsIgnoreCase("admin_add_level"))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@@ -79,9 +79,7 @@ public class AdminMenu implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String targetName = command.substring(23);
|
teleportCharacter(L2World.getInstance().getPlayer(command.substring(23)), activeChar.getLocation(), activeChar, "Admin is teleporting you.");
|
||||||
final L2PcInstance player = L2World.getInstance().getPlayer(targetName);
|
|
||||||
teleportCharacter(player, activeChar.getLocation(), activeChar, "Admin is teleporting you.");
|
|
||||||
}
|
}
|
||||||
catch (StringIndexOutOfBoundsException e)
|
catch (StringIndexOutOfBoundsException e)
|
||||||
{
|
{
|
||||||
@@ -194,8 +192,7 @@ public class AdminMenu implements IAdminCommandHandler
|
|||||||
_log.warning("Character " + activeChar.getName() + " tryed to use admin command " + subCommand + ", but have no access to it!");
|
_log.warning("Character " + activeChar.getName() + " tryed to use admin command " + subCommand + ", but have no access to it!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final IAdminCommandHandler ach = AdminCommandHandler.getInstance().getHandler(subCommand);
|
AdminCommandHandler.getInstance().getHandler(subCommand).useAdminCommand(subCommand + command.substring(14), activeChar);
|
||||||
ach.useAdminCommand(subCommand + command.substring(14), activeChar);
|
|
||||||
}
|
}
|
||||||
showMainPage(activeChar);
|
showMainPage(activeChar);
|
||||||
}
|
}
|
||||||
@@ -211,8 +208,7 @@ public class AdminMenu implements IAdminCommandHandler
|
|||||||
_log.warning("Character " + activeChar.getName() + " tryed to use admin command " + subCommand + ", but have no access to it!");
|
_log.warning("Character " + activeChar.getName() + " tryed to use admin command " + subCommand + ", but have no access to it!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final IAdminCommandHandler ach = AdminCommandHandler.getInstance().getHandler(subCommand);
|
AdminCommandHandler.getInstance().getHandler(subCommand).useAdminCommand(subCommand + command.substring(16), activeChar);
|
||||||
ach.useAdminCommand(subCommand + command.substring(16), activeChar);
|
|
||||||
}
|
}
|
||||||
showMainPage(activeChar);
|
showMainPage(activeChar);
|
||||||
}
|
}
|
||||||
|
@@ -95,8 +95,7 @@ public class AdminMobGroup implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
if (activeChar.getTarget() instanceof L2Character)
|
if (activeChar.getTarget() instanceof L2Character)
|
||||||
{
|
{
|
||||||
final L2Character target = (L2Character) activeChar.getTarget();
|
attack(command, activeChar, ((L2Character) activeChar.getTarget()));
|
||||||
attack(command, activeChar, target);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (command.startsWith("admin_mobgroup_rnd"))
|
else if (command.startsWith("admin_mobgroup_rnd"))
|
||||||
@@ -141,8 +140,7 @@ public class AdminMobGroup implements IAdminCommandHandler
|
|||||||
*/
|
*/
|
||||||
private void showMainPage(L2PcInstance activeChar, String command)
|
private void showMainPage(L2PcInstance activeChar, String command)
|
||||||
{
|
{
|
||||||
final String filename = "mobgroup.htm";
|
AdminHtml.showAdminHtml(activeChar, "mobgroup.htm");
|
||||||
AdminHtml.showAdminHtml(activeChar, filename);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void returnToChar(String command, L2PcInstance activeChar)
|
private void returnToChar(String command, L2PcInstance activeChar)
|
||||||
|
@@ -139,23 +139,17 @@ public final class AdminPCBangPoints implements IAdminCommandHandler
|
|||||||
|
|
||||||
if (range <= 0)
|
if (range <= 0)
|
||||||
{
|
{
|
||||||
final int count = increaseForAll(L2World.getInstance().getPlayers(), value);
|
activeChar.sendMessage("You increased PC point(s) of all online players (" + increaseForAll(L2World.getInstance().getPlayers(), value) + ") by " + value + ".");
|
||||||
activeChar.sendMessage("You increased PC point(s) of all online players (" + count + ") by " + value + ".");
|
|
||||||
}
|
}
|
||||||
else if (range > 0)
|
else if (range > 0)
|
||||||
{
|
{
|
||||||
final int count = increaseForAll(activeChar.getKnownList().getKnownPlayers().values(), value);
|
activeChar.sendMessage("You increased PC point(s) of all players (" + increaseForAll(activeChar.getKnownList().getKnownPlayers().values(), value) + ") in range " + range + " by " + value + ".");
|
||||||
activeChar.sendMessage("You increased PC point(s) of all players (" + count + ") in range " + range + " by " + value + ".");
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
showMenuHtml(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
showMenuHtml(activeChar);
|
|
||||||
}
|
}
|
||||||
|
showMenuHtml(activeChar);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -92,12 +92,7 @@ public final class AdminPForge implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
if (i > 0)
|
return i > 0;
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opCodeLong < 0)
|
if (opCodeLong < 0)
|
||||||
@@ -430,14 +425,7 @@ public final class AdminPForge implements IAdminCommandHandler
|
|||||||
case "$boid":
|
case "$boid":
|
||||||
{
|
{
|
||||||
boat = activeChar.getBoat();
|
boat = activeChar.getBoat();
|
||||||
if (boat != null)
|
value = boat != null ? String.valueOf(boat.getObjectId()) : "0";
|
||||||
{
|
|
||||||
value = String.valueOf(boat.getObjectId());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
value = "0";
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "$title":
|
case "$title":
|
||||||
@@ -481,93 +469,44 @@ public final class AdminPForge implements IAdminCommandHandler
|
|||||||
if ((target != null) && (target instanceof L2Playable))
|
if ((target != null) && (target instanceof L2Playable))
|
||||||
{
|
{
|
||||||
boat = ((L2Playable) target).getActingPlayer().getBoat();
|
boat = ((L2Playable) target).getActingPlayer().getBoat();
|
||||||
if (boat != null)
|
value = boat != null ? String.valueOf(boat.getObjectId()) : "0";
|
||||||
{
|
|
||||||
value = String.valueOf(boat.getObjectId());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
value = "0";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "$ttitle":
|
case "$ttitle":
|
||||||
{
|
{
|
||||||
target = activeChar.getTarget();
|
target = activeChar.getTarget();
|
||||||
if ((target != null) && (target instanceof L2Character))
|
value = (target != null) && (target instanceof L2Character) ? String.valueOf(((L2Character) target).getTitle()) : "";
|
||||||
{
|
|
||||||
value = String.valueOf(((L2Character) target).getTitle());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
value = "";
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "$tname":
|
case "$tname":
|
||||||
{
|
{
|
||||||
target = activeChar.getTarget();
|
target = activeChar.getTarget();
|
||||||
if (target != null)
|
value = target != null ? String.valueOf(target.getName()) : "";
|
||||||
{
|
|
||||||
value = String.valueOf(target.getName());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
value = "";
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "$tx":
|
case "$tx":
|
||||||
{
|
{
|
||||||
target = activeChar.getTarget();
|
target = activeChar.getTarget();
|
||||||
if (target != null)
|
value = target != null ? String.valueOf(target.getX()) : "0";
|
||||||
{
|
|
||||||
value = String.valueOf(target.getX());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
value = "0";
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "$ty":
|
case "$ty":
|
||||||
{
|
{
|
||||||
target = activeChar.getTarget();
|
target = activeChar.getTarget();
|
||||||
if (target != null)
|
value = target != null ? String.valueOf(target.getY()) : "0";
|
||||||
{
|
|
||||||
value = String.valueOf(target.getY());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
value = "0";
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "$tz":
|
case "$tz":
|
||||||
{
|
{
|
||||||
target = activeChar.getTarget();
|
target = activeChar.getTarget();
|
||||||
if (target != null)
|
value = target != null ? String.valueOf(target.getZ()) : "0";
|
||||||
{
|
|
||||||
value = String.valueOf(target.getZ());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
value = "0";
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "$theading":
|
case "$theading":
|
||||||
{
|
{
|
||||||
target = activeChar.getTarget();
|
target = activeChar.getTarget();
|
||||||
if (target != null)
|
value = target != null ? String.valueOf(target.getHeading()) : "0";
|
||||||
{
|
|
||||||
value = String.valueOf(target.getHeading());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
value = "0";
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -213,5 +213,4 @@ public class AdminPledge implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
AdminHtml.showAdminHtml(activeChar, "game_menu.htm");
|
AdminHtml.showAdminHtml(activeChar, "game_menu.htm");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -164,8 +164,7 @@ public class AdminPolymorph implements IAdminCommandHandler
|
|||||||
final L2Character Char = (L2Character) obj;
|
final L2Character Char = (L2Character) obj;
|
||||||
final MagicSkillUse msk = new MagicSkillUse(Char, 1008, 1, 4000, 0);
|
final MagicSkillUse msk = new MagicSkillUse(Char, 1008, 1, 4000, 0);
|
||||||
Char.broadcastPacket(msk);
|
Char.broadcastPacket(msk);
|
||||||
final SetupGauge sg = new SetupGauge(0, 4000);
|
Char.sendPacket(new SetupGauge(0, 4000));
|
||||||
Char.sendPacket(sg);
|
|
||||||
}
|
}
|
||||||
// end of animation
|
// end of animation
|
||||||
obj.decayMe();
|
obj.decayMe();
|
||||||
|
@@ -51,8 +51,7 @@ public class AdminPremium implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String val = command.substring(19);
|
addPremiumStatus(activeChar, 1, command.substring(19));
|
||||||
addPremiumStatus(activeChar, 1, val);
|
|
||||||
}
|
}
|
||||||
catch (StringIndexOutOfBoundsException e)
|
catch (StringIndexOutOfBoundsException e)
|
||||||
{
|
{
|
||||||
@@ -63,8 +62,7 @@ public class AdminPremium implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String val = command.substring(19);
|
addPremiumStatus(activeChar, 2, command.substring(19));
|
||||||
addPremiumStatus(activeChar, 2, val);
|
|
||||||
}
|
}
|
||||||
catch (StringIndexOutOfBoundsException e)
|
catch (StringIndexOutOfBoundsException e)
|
||||||
{
|
{
|
||||||
@@ -75,8 +73,7 @@ public class AdminPremium implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String val = command.substring(19);
|
addPremiumStatus(activeChar, 3, command.substring(19));
|
||||||
addPremiumStatus(activeChar, 3, val);
|
|
||||||
}
|
}
|
||||||
catch (StringIndexOutOfBoundsException e)
|
catch (StringIndexOutOfBoundsException e)
|
||||||
{
|
{
|
||||||
@@ -87,8 +84,7 @@ public class AdminPremium implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String val = command.substring(19);
|
viewPremiumInfo(activeChar, command.substring(19));
|
||||||
viewPremiumInfo(activeChar, val);
|
|
||||||
}
|
}
|
||||||
catch (StringIndexOutOfBoundsException e)
|
catch (StringIndexOutOfBoundsException e)
|
||||||
{
|
{
|
||||||
@@ -99,8 +95,7 @@ public class AdminPremium implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String val = command.substring(21);
|
removePremium(activeChar, command.substring(21));
|
||||||
removePremium(activeChar, val);
|
|
||||||
}
|
}
|
||||||
catch (StringIndexOutOfBoundsException e)
|
catch (StringIndexOutOfBoundsException e)
|
||||||
{
|
{
|
||||||
@@ -124,18 +119,14 @@ public class AdminPremium implements IAdminCommandHandler
|
|||||||
|
|
||||||
// TODO: Add check if account exists XD
|
// TODO: Add check if account exists XD
|
||||||
PremiumManager.getInstance().updatePremiumData(months, accountName);
|
PremiumManager.getInstance().updatePremiumData(months, accountName);
|
||||||
final SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy HH:mm");
|
admin.sendMessage("Account " + accountName + " will now have premium status until " + String.valueOf(new SimpleDateFormat("dd.MM.yyyy HH:mm").format(PremiumManager.getInstance().getPremiumEndDate(accountName))) + ".");
|
||||||
final long endDate = PremiumManager.getInstance().getPremiumEndDate(accountName);
|
|
||||||
admin.sendMessage("Account " + accountName + " will now have premium status until " + String.valueOf(format.format(endDate)) + ".");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void viewPremiumInfo(L2PcInstance admin, String accountName)
|
private void viewPremiumInfo(L2PcInstance admin, String accountName)
|
||||||
{
|
{
|
||||||
if (PremiumManager.getInstance().getPremiumEndDate(accountName) > 0)
|
if (PremiumManager.getInstance().getPremiumEndDate(accountName) > 0)
|
||||||
{
|
{
|
||||||
final SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy HH:mm");
|
admin.sendMessage("Account " + accountName + " has premium status until " + String.valueOf(new SimpleDateFormat("dd.MM.yyyy HH:mm").format(PremiumManager.getInstance().getPremiumEndDate(accountName))) + ".");
|
||||||
final long endDate = PremiumManager.getInstance().getPremiumEndDate(accountName);
|
|
||||||
admin.sendMessage("Account " + accountName + " has premium status until " + String.valueOf(format.format(endDate)) + ".");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -123,23 +123,17 @@ public final class AdminPrimePoints implements IAdminCommandHandler
|
|||||||
|
|
||||||
if (range <= 0)
|
if (range <= 0)
|
||||||
{
|
{
|
||||||
final int count = increaseForAll(L2World.getInstance().getPlayers(), value);
|
activeChar.sendMessage("You increased NCoin(s) of all online players (" + increaseForAll(L2World.getInstance().getPlayers(), value) + ") by " + value + ".");
|
||||||
activeChar.sendMessage("You increased NCoin(s) of all online players (" + count + ") by " + value + ".");
|
|
||||||
}
|
}
|
||||||
else if (range > 0)
|
else if (range > 0)
|
||||||
{
|
{
|
||||||
final int count = increaseForAll(activeChar.getKnownList().getKnownPlayers().values(), value);
|
activeChar.sendMessage("You increased NCoin(s) of all players (" + increaseForAll(activeChar.getKnownList().getKnownPlayers().values(), value) + ") in range " + range + " by " + value + ".");
|
||||||
activeChar.sendMessage("You increased NCoin(s) of all players (" + count + ") in range " + range + " by " + value + ".");
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
showMenuHtml(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
showMenuHtml(activeChar);
|
|
||||||
}
|
}
|
||||||
|
showMenuHtml(activeChar);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -91,8 +91,7 @@ public class AdminPunishment implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
final String subcmd = st.nextToken();
|
switch (st.nextToken())
|
||||||
switch (subcmd)
|
|
||||||
{
|
{
|
||||||
case "info":
|
case "info":
|
||||||
{
|
{
|
||||||
@@ -388,11 +387,7 @@ public class AdminPunishment implements IAdminCommandHandler
|
|||||||
private static final String findCharId(String key)
|
private static final String findCharId(String key)
|
||||||
{
|
{
|
||||||
final int charId = CharNameTable.getInstance().getIdByName(key);
|
final int charId = CharNameTable.getInstance().getIdByName(key);
|
||||||
if (charId > 0) // Yeah its a char name!
|
return charId > 0 ? Integer.toString(charId) : key;
|
||||||
{
|
|
||||||
return Integer.toString(charId);
|
|
||||||
}
|
|
||||||
return key;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -76,8 +76,7 @@ public class AdminQuest implements IAdminCommandHandler
|
|||||||
// try the first param as id
|
// try the first param as id
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final int questId = Integer.parseInt(parts[1]);
|
if (QuestManager.getInstance().reload(Integer.parseInt(parts[1])))
|
||||||
if (QuestManager.getInstance().reload(questId))
|
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Quest Reloaded Successfully.");
|
activeChar.sendMessage("Quest Reloaded Successfully.");
|
||||||
}
|
}
|
||||||
|
@@ -298,5 +298,4 @@ public class AdminReload implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
return ADMIN_COMMANDS;
|
return ADMIN_COMMANDS;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -167,5 +167,4 @@ public class AdminRide implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
return ADMIN_COMMANDS;
|
return ADMIN_COMMANDS;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -92,9 +92,7 @@ public class AdminServerInfo implements IAdminCommandHandler
|
|||||||
time -= TimeUnit.DAYS.toMillis(days);
|
time -= TimeUnit.DAYS.toMillis(days);
|
||||||
final long hours = TimeUnit.MILLISECONDS.toHours(time);
|
final long hours = TimeUnit.MILLISECONDS.toHours(time);
|
||||||
time -= TimeUnit.HOURS.toMillis(hours);
|
time -= TimeUnit.HOURS.toMillis(hours);
|
||||||
final long minutes = TimeUnit.MILLISECONDS.toMinutes(time);
|
return days + " Days, " + hours + " Hours, " + TimeUnit.MILLISECONDS.toMinutes(time) + " Minutes";
|
||||||
|
|
||||||
return days + " Days, " + hours + " Hours, " + minutes + " Minutes";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String buildTheardInfo(String category)
|
private String buildTheardInfo(String category)
|
||||||
|
@@ -94,13 +94,10 @@ public class AdminShowQuests implements IAdminCommandHandler
|
|||||||
val[0] = "name";
|
val[0] = "name";
|
||||||
val[1] = cmdParams[2];
|
val[1] = cmdParams[2];
|
||||||
}
|
}
|
||||||
if (cmdParams.length > 3)
|
if ((cmdParams.length > 3) && cmdParams[3].equals("custom"))
|
||||||
{
|
{
|
||||||
if (cmdParams[3].equals("custom"))
|
val[0] = "custom";
|
||||||
{
|
val[1] = cmdParams[2];
|
||||||
val[0] = "custom";
|
|
||||||
val[1] = cmdParams[2];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -125,5 +125,4 @@ public class AdminShutdown implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
Shutdown.getInstance().abort(activeChar);
|
Shutdown.getInstance().abort(activeChar);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -94,8 +94,7 @@ public class AdminSkill implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String val = command.substring(20);
|
removeSkillsPage(activeChar, Integer.parseInt(command.substring(20)));
|
||||||
removeSkillsPage(activeChar, Integer.parseInt(val));
|
|
||||||
}
|
}
|
||||||
catch (StringIndexOutOfBoundsException e)
|
catch (StringIndexOutOfBoundsException e)
|
||||||
{
|
{
|
||||||
@@ -109,8 +108,7 @@ public class AdminSkill implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String val = command.substring(18);
|
AdminHtml.showAdminHtml(activeChar, "skills/" + command.substring(18) + ".htm");
|
||||||
AdminHtml.showAdminHtml(activeChar, "skills/" + val + ".htm");
|
|
||||||
}
|
}
|
||||||
catch (StringIndexOutOfBoundsException e)
|
catch (StringIndexOutOfBoundsException e)
|
||||||
{
|
{
|
||||||
@@ -120,8 +118,7 @@ public class AdminSkill implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String val = command.substring(15);
|
adminAddSkill(activeChar, command.substring(15));
|
||||||
adminAddSkill(activeChar, val);
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -132,9 +129,7 @@ public class AdminSkill implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String id = command.substring(19);
|
adminRemoveSkill(activeChar, Integer.parseInt(command.substring(19)));
|
||||||
final int idval = Integer.parseInt(id);
|
|
||||||
adminRemoveSkill(activeChar, idval);
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -308,19 +303,13 @@ public class AdminSkill implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
final int skillsStart = maxSkillsPerPage * page;
|
final int skillsStart = maxSkillsPerPage * page;
|
||||||
int skillsEnd = skills.length;
|
final int skillsEnd = (skills.length - skillsStart) > maxSkillsPerPage ? skillsStart + maxSkillsPerPage : skills.length;
|
||||||
if ((skillsEnd - skillsStart) > maxSkillsPerPage)
|
|
||||||
{
|
|
||||||
skillsEnd = skillsStart + maxSkillsPerPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||||
final StringBuilder replyMSG = StringUtil.startAppend(500 + (maxPages * 50) + (((skillsEnd - skillsStart) + 1) * 50), "<html><body><table width=260><tr><td width=40><button value=\"Main\" action=\"bypass -h admin_admin\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center>Character Selection Menu</center></td><td width=40><button value=\"Back\" action=\"bypass -h admin_show_skills\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br><br><center>Editing <font color=\"LEVEL\">", player.getName(), "</font></center><br><table width=270><tr><td>Lv: ", String.valueOf(player.getLevel()), " ", ClassListData.getInstance().getClass(player.getClassId()).getClientCode(), "</td></tr></table><br><table width=270><tr><td>Note: Dont forget that modifying players skills can</td></tr><tr><td>ruin the game...</td></tr></table><br><center>Click on the skill you wish to remove:</center><br><center><table width=270><tr>");
|
final StringBuilder replyMSG = StringUtil.startAppend(500 + (maxPages * 50) + (((skillsEnd - skillsStart) + 1) * 50), "<html><body><table width=260><tr><td width=40><button value=\"Main\" action=\"bypass -h admin_admin\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center>Character Selection Menu</center></td><td width=40><button value=\"Back\" action=\"bypass -h admin_show_skills\" width=40 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br><br><center>Editing <font color=\"LEVEL\">", player.getName(), "</font></center><br><table width=270><tr><td>Lv: ", String.valueOf(player.getLevel()), " ", ClassListData.getInstance().getClass(player.getClassId()).getClientCode(), "</td></tr></table><br><table width=270><tr><td>Note: Dont forget that modifying players skills can</td></tr><tr><td>ruin the game...</td></tr></table><br><center>Click on the skill you wish to remove:</center><br><center><table width=270><tr>");
|
||||||
|
|
||||||
for (int x = 0; x < maxPages; x++)
|
for (int x = 0; x < maxPages; x++)
|
||||||
{
|
{
|
||||||
final int pagenr = x + 1;
|
StringUtil.append(replyMSG, "<td><a action=\"bypass -h admin_remove_skills ", String.valueOf(x), "\">Page ", String.valueOf((x + 1)), "</a></td>");
|
||||||
StringUtil.append(replyMSG, "<td><a action=\"bypass -h admin_remove_skills ", String.valueOf(x), "\">Page ", String.valueOf(pagenr), "</a></td>");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
replyMSG.append("</tr></table></center><br><table width=270><tr><td width=80>Name:</td><td width=60>Level:</td><td width=40>Id:</td></tr>");
|
replyMSG.append("</tr></table></center><br><table width=270><tr><td width=80>Name:</td><td width=60>Level:</td><td width=40>Id:</td></tr>");
|
||||||
@@ -448,20 +437,12 @@ public class AdminSkill implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
final L2PcInstance player = target.getActingPlayer();
|
final L2PcInstance player = target.getActingPlayer();
|
||||||
final StringTokenizer st = new StringTokenizer(val);
|
final StringTokenizer st = new StringTokenizer(val);
|
||||||
if (st.countTokens() != 2)
|
if (st.countTokens() == 2)
|
||||||
{
|
|
||||||
showMainPage(activeChar);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
Skill skill = null;
|
Skill skill = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String id = st.nextToken();
|
skill = SkillData.getInstance().getSkill(Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken()));
|
||||||
final String level = st.nextToken();
|
|
||||||
final int idval = Integer.parseInt(id);
|
|
||||||
final int levelval = Integer.parseInt(level);
|
|
||||||
skill = SkillData.getInstance().getSkill(idval, levelval);
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -486,8 +467,8 @@ public class AdminSkill implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
activeChar.sendMessage("Error: there is no such skill.");
|
activeChar.sendMessage("Error: there is no such skill.");
|
||||||
}
|
}
|
||||||
showMainPage(activeChar); // Back to start
|
|
||||||
}
|
}
|
||||||
|
showMainPage(activeChar); // Back to start
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -71,8 +71,7 @@ public class AdminSummon implements IAdminCommandHandler
|
|||||||
_log.warning("Character " + activeChar.getName() + " tryed to use admin command " + subCommand + ", but have no access to it!");
|
_log.warning("Character " + activeChar.getName() + " tryed to use admin command " + subCommand + ", but have no access to it!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final IAdminCommandHandler ach = AdminCommandHandler.getInstance().getHandler(subCommand);
|
AdminCommandHandler.getInstance().getHandler(subCommand).useAdminCommand(subCommand + " " + id + " " + count, activeChar);
|
||||||
ach.useAdminCommand(subCommand + " " + id + " " + count, activeChar);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -140,8 +140,7 @@ public class AdminTeleport implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String val = command.substring(14);
|
teleportTo(activeChar, command.substring(14));
|
||||||
teleportTo(activeChar, val);
|
|
||||||
}
|
}
|
||||||
catch (StringIndexOutOfBoundsException e)
|
catch (StringIndexOutOfBoundsException e)
|
||||||
{
|
{
|
||||||
@@ -158,9 +157,7 @@ public class AdminTeleport implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String val = command.substring(25);
|
teleportCharacter(activeChar, command.substring(25));
|
||||||
|
|
||||||
teleportCharacter(activeChar, val);
|
|
||||||
}
|
}
|
||||||
catch (StringIndexOutOfBoundsException e)
|
catch (StringIndexOutOfBoundsException e)
|
||||||
{
|
{
|
||||||
@@ -173,9 +170,7 @@ public class AdminTeleport implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final String targetName = command.substring(17);
|
teleportToCharacter(activeChar, L2World.getInstance().getPlayer(command.substring(17)));
|
||||||
final L2PcInstance player = L2World.getInstance().getPlayer(targetName);
|
|
||||||
teleportToCharacter(activeChar, player);
|
|
||||||
}
|
}
|
||||||
catch (StringIndexOutOfBoundsException e)
|
catch (StringIndexOutOfBoundsException e)
|
||||||
{
|
{
|
||||||
@@ -646,5 +641,4 @@ public class AdminTeleport implements IAdminCommandHandler
|
|||||||
activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
|
activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -57,8 +57,7 @@ public class AdminVitality implements IAdminCommandHandler
|
|||||||
|
|
||||||
if (activeChar.getTarget() instanceof L2PcInstance)
|
if (activeChar.getTarget() instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
L2PcInstance target;
|
final L2PcInstance target = (L2PcInstance) activeChar.getTarget();
|
||||||
target = (L2PcInstance) activeChar.getTarget();
|
|
||||||
|
|
||||||
if (cmd.equals("admin_set_vitality"))
|
if (cmd.equals("admin_set_vitality"))
|
||||||
{
|
{
|
||||||
|
@@ -97,8 +97,7 @@ public class AdminZone implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
final int zoneId = Integer.parseInt(next);
|
ZoneManager.getInstance().getZoneById(Integer.parseInt(next)).visualizeZone(activeChar.getZ());
|
||||||
ZoneManager.getInstance().getZoneById(zoneId).visualizeZone(activeChar.getZ());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (actualCommand.equalsIgnoreCase("admin_zone_visual_clear"))
|
else if (actualCommand.equalsIgnoreCase("admin_zone_visual_clear"))
|
||||||
|
@@ -114,8 +114,7 @@ public class NpcViewMod implements IBypassHandler
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final int page = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
sendNpcDropList(activeChar, npc, dropListScope, (st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0));
|
||||||
sendNpcDropList(activeChar, npc, dropListScope, page);
|
|
||||||
}
|
}
|
||||||
catch (NumberFormatException e)
|
catch (NumberFormatException e)
|
||||||
{
|
{
|
||||||
|
@@ -87,9 +87,7 @@ public class OlympiadManagerLink implements IBypassHandler
|
|||||||
{
|
{
|
||||||
if (command.toLowerCase().startsWith("olympiaddesc"))
|
if (command.toLowerCase().startsWith("olympiaddesc"))
|
||||||
{
|
{
|
||||||
final int val = Integer.parseInt(command.substring(13, 14));
|
((L2OlympiadManagerInstance) target).showChatWindow(activeChar, Integer.parseInt(command.substring(13, 14)), command.substring(14));
|
||||||
final String suffix = command.substring(14);
|
|
||||||
((L2OlympiadManagerInstance) target).showChatWindow(activeChar, val, suffix);
|
|
||||||
}
|
}
|
||||||
else if (command.toLowerCase().startsWith("olympiadnoble"))
|
else if (command.toLowerCase().startsWith("olympiadnoble"))
|
||||||
{
|
{
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user