Added missing final modifiers.
This commit is contained in:
@@ -71,15 +71,15 @@ public class HandysBlockCheckerEvent extends Quest
|
|||||||
|
|
||||||
if (HandysBlockCheckerManager.getInstance().addPlayerToArena(player, arena))
|
if (HandysBlockCheckerManager.getInstance().addPlayerToArena(player, arena))
|
||||||
{
|
{
|
||||||
ArenaParticipantsHolder holder = HandysBlockCheckerManager.getInstance().getHolder(arena);
|
final ArenaParticipantsHolder holder = HandysBlockCheckerManager.getInstance().getHolder(arena);
|
||||||
|
|
||||||
final ExCubeGameTeamList tl = new ExCubeGameTeamList(holder.getRedPlayers(), holder.getBluePlayers(), arena);
|
final ExCubeGameTeamList tl = new ExCubeGameTeamList(holder.getRedPlayers(), holder.getBluePlayers(), arena);
|
||||||
|
|
||||||
player.sendPacket(tl);
|
player.sendPacket(tl);
|
||||||
|
|
||||||
int countBlue = holder.getBlueTeamSize();
|
final int countBlue = holder.getBlueTeamSize();
|
||||||
int countRed = holder.getRedTeamSize();
|
final int countRed = holder.getRedTeamSize();
|
||||||
int minMembers = Config.MIN_BLOCK_CHECKER_TEAM_MEMBERS;
|
final int minMembers = Config.MIN_BLOCK_CHECKER_TEAM_MEMBERS;
|
||||||
|
|
||||||
if ((countBlue >= minMembers) && (countRed >= minMembers))
|
if ((countBlue >= minMembers) && (countRed >= minMembers))
|
||||||
{
|
{
|
||||||
|
@@ -290,9 +290,9 @@ public class MC_Show extends AbstractNpcAI
|
|||||||
|
|
||||||
private void scheduleTimer()
|
private void scheduleTimer()
|
||||||
{
|
{
|
||||||
int gameTime = GameTimeController.getInstance().getGameTime();
|
final int gameTime = GameTimeController.getInstance().getGameTime();
|
||||||
int hours = (gameTime / 60) % 24;
|
final int hours = (gameTime / 60) % 24;
|
||||||
int minutes = gameTime % 60;
|
final int minutes = gameTime % 60;
|
||||||
int hourDiff, minDiff;
|
int hourDiff, minDiff;
|
||||||
hourDiff = (20 - hours);
|
hourDiff = (20 - hours);
|
||||||
if (hourDiff < 0)
|
if (hourDiff < 0)
|
||||||
@@ -310,7 +310,7 @@ public class MC_Show extends AbstractNpcAI
|
|||||||
diff = hourDiff + minDiff;
|
diff = hourDiff + minDiff;
|
||||||
if (Config.DEBUG)
|
if (Config.DEBUG)
|
||||||
{
|
{
|
||||||
SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
final SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||||
_log.info("Fantasy Isle: MC show script starting at " + format.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);
|
||||||
|
@@ -160,7 +160,7 @@ public class Parade extends AbstractNpcAI
|
|||||||
|
|
||||||
private long timeLeftMilli(int hh, int mm, int ss)
|
private long timeLeftMilli(int hh, int mm, int ss)
|
||||||
{
|
{
|
||||||
int now = (GameTimeController.getInstance().getGameTicks() * 60) / 100;
|
final int now = (GameTimeController.getInstance().getGameTicks() * 60) / 100;
|
||||||
int dd = ((hh * 3600) + (mm * 60) + ss) - (now % 86400);
|
int dd = ((hh * 3600) + (mm * 60) + ss) - (now % 86400);
|
||||||
if (dd < 0)
|
if (dd < 0)
|
||||||
{
|
{
|
||||||
@@ -194,16 +194,16 @@ public class Parade extends AbstractNpcAI
|
|||||||
spawnTask.cancel(false);
|
spawnTask.cancel(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int npcId = ACTORS[npcIndex++];
|
final int npcId = ACTORS[npcIndex++];
|
||||||
if (npcId == 0)
|
if (npcId == 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (int route = 0; route < 5; ++route)
|
for (int route = 0; route < 5; ++route)
|
||||||
{
|
{
|
||||||
int[] start = START[route][i];
|
final int[] start = START[route][i];
|
||||||
int[] goal = GOAL[route][i];
|
final int[] goal = GOAL[route][i];
|
||||||
L2Npc actor = addSpawn(npcId, start[0], start[1], start[2], start[3], false, 0);
|
final L2Npc actor = addSpawn(npcId, start[0], start[1], start[2], start[3], false, 0);
|
||||||
actor.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(goal[0], goal[1], goal[2], goal[3]));
|
actor.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(goal[0], goal[1], goal[2], goal[3]));
|
||||||
spawns.add(actor);
|
spawns.add(actor);
|
||||||
}
|
}
|
||||||
|
@@ -226,7 +226,7 @@ public class ArcanRitual extends Quest
|
|||||||
player.sendPacket(trigger);
|
player.sendPacket(trigger);
|
||||||
if (message)
|
if (message)
|
||||||
{
|
{
|
||||||
L2GameServerPacket sm = new ExShowScreenMessage(NpcStringId.DARK_POWER_SEEPS_OUT_FROM_THE_MIDDLE_OF_THE_TOWN, ExShowScreenMessage.TOP_CENTER, 5000);
|
final L2GameServerPacket sm = new ExShowScreenMessage(NpcStringId.DARK_POWER_SEEPS_OUT_FROM_THE_MIDDLE_OF_THE_TOWN, ExShowScreenMessage.TOP_CENTER, 5000);
|
||||||
player.sendPacket(sm);
|
player.sendPacket(sm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -254,7 +254,7 @@ public final class BeastFarm extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
final L2TamedBeastInstance nextNpc = new L2TamedBeastInstance(nextNpcId, player, food, npc.getX(), npc.getY(), npc.getZ(), true);
|
final L2TamedBeastInstance nextNpc = new L2TamedBeastInstance(nextNpcId, player, food, npc.getX(), npc.getY(), npc.getZ(), true);
|
||||||
|
|
||||||
TamedBeast beast = TAMED_BEAST_DATA.get(getRandom(TAMED_BEAST_DATA.size()));
|
final TamedBeast beast = TAMED_BEAST_DATA.get(getRandom(TAMED_BEAST_DATA.size()));
|
||||||
String name = beast.getName();
|
String name = beast.getName();
|
||||||
switch (nextNpcId)
|
switch (nextNpcId)
|
||||||
{
|
{
|
||||||
@@ -275,7 +275,7 @@ public final class BeastFarm extends AbstractNpcAI
|
|||||||
nextNpc.broadcastPacket(new NpcInfo(nextNpc));
|
nextNpc.broadcastPacket(new NpcInfo(nextNpc));
|
||||||
nextNpc.setRunning();
|
nextNpc.setRunning();
|
||||||
|
|
||||||
SkillData st = SkillData.getInstance();
|
final SkillData st = SkillData.getInstance();
|
||||||
for (SkillHolder sh : beast.getSkills())
|
for (SkillHolder sh : beast.getSkills())
|
||||||
{
|
{
|
||||||
nextNpc.addBeastSkill(st.getSkill(sh.getSkillId(), sh.getSkillLvl()));
|
nextNpc.addBeastSkill(st.getSkill(sh.getSkillId(), sh.getSkillLvl()));
|
||||||
@@ -287,7 +287,7 @@ public final class BeastFarm extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
// if not trained, the newly spawned mob will automatically be agro against its feeder
|
// if not trained, the newly spawned mob will automatically be agro against its feeder
|
||||||
// (what happened to "never bite the hand that feeds you" anyway?!)
|
// (what happened to "never bite the hand that feeds you" anyway?!)
|
||||||
L2Attackable nextNpc = (L2Attackable) addSpawn(nextNpcId, npc);
|
final L2Attackable nextNpc = (L2Attackable) addSpawn(nextNpcId, npc);
|
||||||
|
|
||||||
// register the player in the feedinfo for the mob that just spawned
|
// register the player in the feedinfo for the mob that just spawned
|
||||||
FEED_INFO.put(nextNpc.getObjectId(), player.getObjectId());
|
FEED_INFO.put(nextNpc.getObjectId(), player.getObjectId());
|
||||||
@@ -309,8 +309,8 @@ public final class BeastFarm extends AbstractNpcAI
|
|||||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||||
}
|
}
|
||||||
// gather some values on local variables
|
// gather some values on local variables
|
||||||
int npcId = npc.getId();
|
final int npcId = npc.getId();
|
||||||
int skillId = skill.getId();
|
final int skillId = skill.getId();
|
||||||
// check if the npc and skills used are valid for this script. Exit if invalid.
|
// check if the npc and skills used are valid for this script. Exit if invalid.
|
||||||
if (!Util.contains(FEEDABLE_BEASTS, npcId) || ((skillId != SKILL_GOLDEN_SPICE) && (skillId != SKILL_CRYSTAL_SPICE) && (skillId != SKILL_BLESSED_GOLDEN_SPICE) && (skillId != SKILL_BLESSED_CRYSTAL_SPICE) && (skillId != SKILL_SGRADE_GOLDEN_SPICE) && (skillId != SKILL_SGRADE_CRYSTAL_SPICE)))
|
if (!Util.contains(FEEDABLE_BEASTS, npcId) || ((skillId != SKILL_GOLDEN_SPICE) && (skillId != SKILL_CRYSTAL_SPICE) && (skillId != SKILL_BLESSED_GOLDEN_SPICE) && (skillId != SKILL_BLESSED_CRYSTAL_SPICE) && (skillId != SKILL_SGRADE_GOLDEN_SPICE) && (skillId != SKILL_SGRADE_CRYSTAL_SPICE)))
|
||||||
{
|
{
|
||||||
@@ -318,7 +318,7 @@ public final class BeastFarm extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// first gather some values on local variables
|
// first gather some values on local variables
|
||||||
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)
|
int growthLevel = 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))
|
if (GROWTH_CAPABLE_MONSTERS.containsKey(npcId))
|
||||||
{
|
{
|
||||||
@@ -351,7 +351,7 @@ public final class BeastFarm extends AbstractNpcAI
|
|||||||
if (GROWTH_CAPABLE_MONSTERS.containsKey(npcId))
|
if (GROWTH_CAPABLE_MONSTERS.containsKey(npcId))
|
||||||
{
|
{
|
||||||
// do nothing if this mob doesn't eat the specified food (food gets consumed but has no effect).
|
// do nothing if this mob doesn't eat the specified food (food gets consumed but has no effect).
|
||||||
int newNpcId = GROWTH_CAPABLE_MONSTERS.get(npcId).getLeveledNpcId(skillId);
|
final int newNpcId = GROWTH_CAPABLE_MONSTERS.get(npcId).getLeveledNpcId(skillId);
|
||||||
if (newNpcId == -1)
|
if (newNpcId == -1)
|
||||||
{
|
{
|
||||||
if (growthLevel == 0)
|
if (growthLevel == 0)
|
||||||
|
@@ -121,7 +121,7 @@ public final class DenOfEvil extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
npc.disableCoreAI(true);
|
npc.disableCoreAI(true);
|
||||||
npc.setIsImmobilized(true);
|
npc.setIsImmobilized(true);
|
||||||
L2EffectZone zone = ZoneManager.getInstance().getZone(npc, L2EffectZone.class);
|
final L2EffectZone zone = ZoneManager.getInstance().getZone(npc, L2EffectZone.class);
|
||||||
if (zone == null)
|
if (zone == null)
|
||||||
{
|
{
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
@@ -130,8 +130,8 @@ public final class DenOfEvil extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
int skillId = getSkillIdByNpcId(npc.getId());
|
final int skillId = getSkillIdByNpcId(npc.getId());
|
||||||
int skillLevel = zone.getSkillLevel(skillId);
|
final int skillLevel = zone.getSkillLevel(skillId);
|
||||||
zone.addSkill(skillId, skillLevel + 1);
|
zone.addSkill(skillId, skillLevel + 1);
|
||||||
if (skillLevel == 3) // 3+1=4
|
if (skillLevel == 3) // 3+1=4
|
||||||
{
|
{
|
||||||
@@ -149,7 +149,7 @@ public final class DenOfEvil extends AbstractNpcAI
|
|||||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
||||||
{
|
{
|
||||||
ThreadPoolManager.getInstance().scheduleAi(new RespawnNewEye(npc.getLocation()), 15000);
|
ThreadPoolManager.getInstance().scheduleAi(new RespawnNewEye(npc.getLocation()), 15000);
|
||||||
L2EffectZone zone = ZoneManager.getInstance().getZone(npc, L2EffectZone.class);
|
final L2EffectZone zone = ZoneManager.getInstance().getZone(npc, L2EffectZone.class);
|
||||||
if (zone == null)
|
if (zone == null)
|
||||||
{
|
{
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
@@ -158,8 +158,8 @@ public final class DenOfEvil extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
int skillId = getSkillIdByNpcId(npc.getId());
|
final int skillId = getSkillIdByNpcId(npc.getId());
|
||||||
int skillLevel = zone.getSkillLevel(skillId);
|
final int skillLevel = zone.getSkillLevel(skillId);
|
||||||
zone.addSkill(skillId, skillLevel - 1);
|
zone.addSkill(skillId, skillLevel - 1);
|
||||||
return super.onKill(npc, killer, isSummon);
|
return super.onKill(npc, killer, isSummon);
|
||||||
}
|
}
|
||||||
@@ -213,7 +213,7 @@ public final class DenOfEvil extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
if (character.isPlayable())
|
if (character.isPlayable())
|
||||||
{
|
{
|
||||||
Skill skill = SkillData.getInstance().getSkill(6149, 1);
|
final Skill skill = SkillData.getInstance().getSkill(6149, 1);
|
||||||
skill.applyEffects(character, character);
|
skill.applyEffects(character, character);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -223,7 +223,7 @@ public final class DenOfEvil extends AbstractNpcAI
|
|||||||
if (character.isNpc())
|
if (character.isNpc())
|
||||||
{
|
{
|
||||||
// respawn eye
|
// respawn eye
|
||||||
L2Npc npc = (L2Npc) character;
|
final L2Npc npc = (L2Npc) character;
|
||||||
if (Util.contains(EYE_IDS, npc.getId()))
|
if (Util.contains(EYE_IDS, npc.getId()))
|
||||||
{
|
{
|
||||||
ThreadPoolManager.getInstance().scheduleAi(new RespawnNewEye(npc.getLocation()), 15000);
|
ThreadPoolManager.getInstance().scheduleAi(new RespawnNewEye(npc.getLocation()), 15000);
|
||||||
|
@@ -165,7 +165,7 @@ public final class FeedableBeasts extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
int[][] temp;
|
int[][] temp;
|
||||||
temp = _spiceToMob.get(spice);
|
temp = _spiceToMob.get(spice);
|
||||||
int rand = getRandom(temp[0].length);
|
final int rand = getRandom(temp[0].length);
|
||||||
return temp[0][rand];
|
return temp[0][rand];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -359,7 +359,7 @@ public final class FeedableBeasts extends AbstractNpcAI
|
|||||||
|
|
||||||
private void spawnNext(L2Npc npc, int growthLevel, L2PcInstance player, int food)
|
private void spawnNext(L2Npc npc, int growthLevel, L2PcInstance player, int food)
|
||||||
{
|
{
|
||||||
int npcId = npc.getId();
|
final int npcId = npc.getId();
|
||||||
int nextNpcId = 0;
|
int nextNpcId = 0;
|
||||||
|
|
||||||
// find the next mob to spawn, based on the current npcId, growthlevel, and food.
|
// find the next mob to spawn, based on the current npcId, growthlevel, and food.
|
||||||
@@ -442,8 +442,8 @@ public final class FeedableBeasts extends AbstractNpcAI
|
|||||||
// also, perform a rare random chat
|
// also, perform a rare random chat
|
||||||
if (getRandom(20) == 0)
|
if (getRandom(20) == 0)
|
||||||
{
|
{
|
||||||
NpcStringId message = NpcStringId.getNpcStringId(getRandom(2024, 2029));
|
final NpcStringId message = NpcStringId.getNpcStringId(getRandom(2024, 2029));
|
||||||
NpcSay packet = new NpcSay(nextNpc, ChatType.NPC_GENERAL, message);
|
final NpcSay packet = new NpcSay(nextNpc, ChatType.NPC_GENERAL, message);
|
||||||
if (message.getParamCount() > 0) // player name, $s1
|
if (message.getParamCount() > 0) // player name, $s1
|
||||||
{
|
{
|
||||||
packet.addStringParameter(player.getName());
|
packet.addStringParameter(player.getName());
|
||||||
@@ -469,7 +469,7 @@ public final class FeedableBeasts extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
// if not trained, the newly spawned mob will automatically be aggro against its feeder
|
// if not trained, the newly spawned mob will automatically be aggro against its feeder
|
||||||
// (what happened to "never bite the hand that feeds you" anyway?!)
|
// (what happened to "never bite the hand that feeds you" anyway?!)
|
||||||
L2Attackable nextNpc = (L2Attackable) addSpawn(nextNpcId, npc);
|
final L2Attackable nextNpc = (L2Attackable) addSpawn(nextNpcId, npc);
|
||||||
|
|
||||||
if (MAD_COW_POLYMORPH.containsKey(nextNpcId))
|
if (MAD_COW_POLYMORPH.containsKey(nextNpcId))
|
||||||
{
|
{
|
||||||
@@ -499,7 +499,7 @@ public final class FeedableBeasts extends AbstractNpcAI
|
|||||||
// despawn the mad cow
|
// despawn the mad cow
|
||||||
npc.deleteMe();
|
npc.deleteMe();
|
||||||
// spawn the new mob
|
// spawn the new mob
|
||||||
L2Attackable nextNpc = (L2Attackable) addSpawn(MAD_COW_POLYMORPH.get(npc.getId()), npc);
|
final L2Attackable nextNpc = (L2Attackable) addSpawn(MAD_COW_POLYMORPH.get(npc.getId()), npc);
|
||||||
|
|
||||||
// register the player in the feedinfo for the mob that just spawned
|
// register the player in the feedinfo for the mob that just spawned
|
||||||
FEED_INFO.put(nextNpc.getObjectId(), player.getObjectId());
|
FEED_INFO.put(nextNpc.getObjectId(), player.getObjectId());
|
||||||
@@ -521,8 +521,8 @@ public final class FeedableBeasts extends AbstractNpcAI
|
|||||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||||
}
|
}
|
||||||
// gather some values on local variables
|
// gather some values on local variables
|
||||||
int npcId = npc.getId();
|
final int npcId = npc.getId();
|
||||||
int skillId = skill.getId();
|
final int skillId = skill.getId();
|
||||||
// check if the npc and skills used are valid for this script. Exit if invalid.
|
// check if the npc and skills used are valid for this script. Exit if invalid.
|
||||||
if ((skillId != SKILL_GOLDEN_SPICE) && (skillId != SKILL_CRYSTAL_SPICE))
|
if ((skillId != SKILL_GOLDEN_SPICE) && (skillId != SKILL_CRYSTAL_SPICE))
|
||||||
{
|
{
|
||||||
@@ -530,7 +530,7 @@ public final class FeedableBeasts extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// first gather some values on local variables
|
// first gather some values on local variables
|
||||||
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)
|
int growthLevel = 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))
|
if (GROWTH_CAPABLE_MONSTERS.containsKey(npcId))
|
||||||
{
|
{
|
||||||
@@ -571,8 +571,8 @@ public final class FeedableBeasts extends AbstractNpcAI
|
|||||||
// rare random talk...
|
// rare random talk...
|
||||||
if (getRandom(20) == 0)
|
if (getRandom(20) == 0)
|
||||||
{
|
{
|
||||||
NpcStringId message = TEXT[growthLevel][getRandom(TEXT[growthLevel].length)];
|
final NpcStringId message = TEXT[growthLevel][getRandom(TEXT[growthLevel].length)];
|
||||||
NpcSay packet = new NpcSay(npc, ChatType.NPC_GENERAL, message);
|
final NpcSay packet = new NpcSay(npc, ChatType.NPC_GENERAL, message);
|
||||||
if (message.getParamCount() > 0) // player name, $s1
|
if (message.getParamCount() > 0) // player name, $s1
|
||||||
{
|
{
|
||||||
packet.addStringParameter(caster.getName());
|
packet.addStringParameter(caster.getName());
|
||||||
@@ -595,12 +595,12 @@ public final class FeedableBeasts extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else if (Util.contains(TAMED_BEASTS, npcId) && (npc instanceof L2TamedBeastInstance))
|
else if (Util.contains(TAMED_BEASTS, npcId) && (npc instanceof L2TamedBeastInstance))
|
||||||
{
|
{
|
||||||
L2TamedBeastInstance beast = ((L2TamedBeastInstance) npc);
|
final L2TamedBeastInstance beast = ((L2TamedBeastInstance) npc);
|
||||||
if (skillId == beast.getFoodType())
|
if (skillId == beast.getFoodType())
|
||||||
{
|
{
|
||||||
beast.onReceiveFood();
|
beast.onReceiveFood();
|
||||||
NpcStringId message = TAMED_TEXT[getRandom(TAMED_TEXT.length)];
|
final NpcStringId message = TAMED_TEXT[getRandom(TAMED_TEXT.length)];
|
||||||
NpcSay packet = new NpcSay(npc, ChatType.NPC_GENERAL, message);
|
final NpcSay packet = new NpcSay(npc, ChatType.NPC_GENERAL, message);
|
||||||
if (message.getParamCount() > 0)
|
if (message.getParamCount() > 0)
|
||||||
{
|
{
|
||||||
packet.addStringParameter(caster.getName());
|
packet.addStringParameter(caster.getName());
|
||||||
|
@@ -84,13 +84,13 @@ public class HillsOfGold 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)
|
||||||
{
|
{
|
||||||
L2Npc mob1 = addSpawn(SPICULA_ELITE_GUARD, npc.getX(), npc.getY(), npc.getZ(), attacker.getHeading() + 32500, true, npc.getSpawn().getRespawnDelay());
|
final L2Npc mob1 = addSpawn(SPICULA_ELITE_GUARD, npc.getX(), npc.getY(), npc.getZ(), attacker.getHeading() + 32500, true, npc.getSpawn().getRespawnDelay());
|
||||||
((L2MonsterInstance) mob1).addDamage(attacker, 1, null);
|
((L2MonsterInstance) mob1).addDamage(attacker, 1, null);
|
||||||
L2Npc mob2 = addSpawn(SPICULA_ELITE_GUARD, npc.getX(), npc.getY(), npc.getZ(), attacker.getHeading() + 32500, true, npc.getSpawn().getRespawnDelay());
|
final L2Npc mob2 = addSpawn(SPICULA_ELITE_GUARD, npc.getX(), npc.getY(), npc.getZ(), attacker.getHeading() + 32500, true, npc.getSpawn().getRespawnDelay());
|
||||||
((L2MonsterInstance) mob2).addDamage(attacker, 1, null);
|
((L2MonsterInstance) mob2).addDamage(attacker, 1, null);
|
||||||
L2Npc mob3 = addSpawn(SPICULA_ELITE_GUARD, npc.getX(), npc.getY(), npc.getZ(), attacker.getHeading() + 32500, true, npc.getSpawn().getRespawnDelay());
|
final L2Npc mob3 = addSpawn(SPICULA_ELITE_GUARD, npc.getX(), npc.getY(), npc.getZ(), attacker.getHeading() + 32500, true, npc.getSpawn().getRespawnDelay());
|
||||||
((L2MonsterInstance) mob3).addDamage(attacker, 1, null);
|
((L2MonsterInstance) mob3).addDamage(attacker, 1, null);
|
||||||
L2Npc mob4 = addSpawn(SPICULA_ELITE_GUARD, npc.getX(), npc.getY(), npc.getZ(), attacker.getHeading() + 32500, true, npc.getSpawn().getRespawnDelay());
|
final L2Npc mob4 = addSpawn(SPICULA_ELITE_GUARD, npc.getX(), npc.getY(), npc.getZ(), attacker.getHeading() + 32500, true, npc.getSpawn().getRespawnDelay());
|
||||||
((L2MonsterInstance) mob4).addDamage(attacker, 1, null);
|
((L2MonsterInstance) mob4).addDamage(attacker, 1, null);
|
||||||
npc.deleteMe();
|
npc.deleteMe();
|
||||||
return super.onAttack(npc, attacker, damage, isSummon);
|
return super.onAttack(npc, attacker, damage, isSummon);
|
||||||
|
@@ -97,7 +97,7 @@ public final class PolymorphingOnAttack extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (tmp.get(3) >= 0)
|
if (tmp.get(3) >= 0)
|
||||||
{
|
{
|
||||||
NpcStringId npcString = MOBTEXTS[tmp.get(3)][getRandom(MOBTEXTS[tmp.get(3)].length)];
|
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.broadcastPacket(new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), npcString));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -331,7 +331,7 @@ public final class PrimevalIsle extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if ((characters != null) && (characters.isAttackable()) && (getRandomBoolean()))
|
if ((characters != null) && (characters.isAttackable()) && (getRandomBoolean()))
|
||||||
{
|
{
|
||||||
L2Attackable monster = (L2Attackable) characters;
|
final L2Attackable monster = (L2Attackable) characters;
|
||||||
addAttackPlayerDesire(monster, playable);
|
addAttackPlayerDesire(monster, playable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -99,7 +99,7 @@ public final class StakatoNest extends AbstractNpcAI
|
|||||||
|
|
||||||
if (_follower != null)
|
if (_follower != null)
|
||||||
{
|
{
|
||||||
double _hp = _follower.getCurrentHp();
|
final double _hp = _follower.getCurrentHp();
|
||||||
|
|
||||||
if (_hp > (_follower.getMaxHp() * 0.3))
|
if (_hp > (_follower.getMaxHp() * 0.3))
|
||||||
{
|
{
|
||||||
@@ -129,7 +129,7 @@ public final class StakatoNest extends AbstractNpcAI
|
|||||||
Broadcast.toSelfAndKnownPlayers(npc, new MagicSkillUse(npc, 2046, 1, 1000, 0));
|
Broadcast.toSelfAndKnownPlayers(npc, new MagicSkillUse(npc, 2046, 1, 1000, 0));
|
||||||
for (int i = 0; i < 3; i++)
|
for (int i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
L2Npc spawned = addSpawn(STAKATO_CAPTAIN, monster, true);
|
final L2Npc spawned = addSpawn(STAKATO_CAPTAIN, monster, true);
|
||||||
addAttackPlayerDesire(spawned, killer);
|
addAttackPlayerDesire(spawned, killer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -148,7 +148,7 @@ public final class StakatoNest extends AbstractNpcAI
|
|||||||
Broadcast.toSelfAndKnownPlayers(npc, new MagicSkillUse(npc, 2046, 1, 1000, 0));
|
Broadcast.toSelfAndKnownPlayers(npc, new MagicSkillUse(npc, 2046, 1, 1000, 0));
|
||||||
for (int i = 0; i < 3; i++)
|
for (int i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
L2Npc spawned = addSpawn(STAKATO_GUARD, monster, true);
|
final L2Npc spawned = addSpawn(STAKATO_GUARD, monster, true);
|
||||||
addAttackPlayerDesire(spawned, killer);
|
addAttackPlayerDesire(spawned, killer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -163,7 +163,7 @@ public final class StakatoNest extends AbstractNpcAI
|
|||||||
case STAKATO_CHIEF:
|
case STAKATO_CHIEF:
|
||||||
if (killer.isInParty())
|
if (killer.isInParty())
|
||||||
{
|
{
|
||||||
List<L2PcInstance> party = killer.getParty().getMembers();
|
final List<L2PcInstance> party = killer.getParty().getMembers();
|
||||||
for (L2PcInstance member : party)
|
for (L2PcInstance member : party)
|
||||||
{
|
{
|
||||||
giveCocoon(member, npc);
|
giveCocoon(member, npc);
|
||||||
|
@@ -59,13 +59,13 @@ public final class Anais extends AbstractNpcAI
|
|||||||
|
|
||||||
private void burnerOnAttack(int pot, L2Npc anais)
|
private void burnerOnAttack(int pot, L2Npc anais)
|
||||||
{
|
{
|
||||||
L2Npc npc = _divineBurners.get(pot);
|
final L2Npc npc = _divineBurners.get(pot);
|
||||||
npc.setDisplayEffect(1);
|
npc.setDisplayEffect(1);
|
||||||
npc.setIsRunning(false);
|
npc.setIsRunning(false);
|
||||||
if (pot < 4)
|
if (pot < 4)
|
||||||
{
|
{
|
||||||
_current = npc;
|
_current = npc;
|
||||||
QuestTimer checkAround = getQuestTimer("CHECK", anais, null);
|
final QuestTimer checkAround = getQuestTimer("CHECK", anais, null);
|
||||||
if (checkAround == null) // || !checkAround.getIsActive()
|
if (checkAround == null) // || !checkAround.getIsActive()
|
||||||
{
|
{
|
||||||
startQuestTimer("CHECK", 3000, anais, null);
|
startQuestTimer("CHECK", 3000, anais, null);
|
||||||
@@ -101,7 +101,7 @@ public final class Anais extends AbstractNpcAI
|
|||||||
_pot = _pot + 1;
|
_pot = _pot + 1;
|
||||||
b.setDisplayEffect(1);
|
b.setDisplayEffect(1);
|
||||||
b.setIsRunning(false);
|
b.setIsRunning(false);
|
||||||
L2Npc ward = addSpawn(GRAIL_WARD, new Location(b.getX(), b.getY(), b.getZ()), true, 0);
|
final L2Npc ward = addSpawn(GRAIL_WARD, new Location(b.getX(), b.getY(), b.getZ()), true, 0);
|
||||||
((L2Attackable) ward).addDamageHate(_nextTarget, 0, 999);
|
((L2Attackable) ward).addDamageHate(_nextTarget, 0, 999);
|
||||||
ward.setIsRunning(true);
|
ward.setIsRunning(true);
|
||||||
ward.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, _nextTarget, null);
|
ward.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, _nextTarget, null);
|
||||||
|
@@ -682,7 +682,7 @@ public final class Antharas extends AbstractNpcAI
|
|||||||
zone.broadcastPacket(new SpecialCamera(npc, 1200, 20, -10, 0, 10000, 13000, 0, 0, 0, 0, 0));
|
zone.broadcastPacket(new SpecialCamera(npc, 1200, 20, -10, 0, 10000, 13000, 0, 0, 0, 0, 0));
|
||||||
zone.broadcastPacket(new PlaySound("BS01_D"));
|
zone.broadcastPacket(new PlaySound("BS01_D"));
|
||||||
addSpawn(CUBE, 177615, 114941, -7709, 0, false, 900000);
|
addSpawn(CUBE, 177615, 114941, -7709, 0, false, 900000);
|
||||||
long respawnTime = (Config.ANTHARAS_SPAWN_INTERVAL + getRandom(-Config.ANTHARAS_SPAWN_RANDOM, Config.ANTHARAS_SPAWN_RANDOM)) * 3600000;
|
final long respawnTime = (Config.ANTHARAS_SPAWN_INTERVAL + getRandom(-Config.ANTHARAS_SPAWN_RANDOM, Config.ANTHARAS_SPAWN_RANDOM)) * 3600000;
|
||||||
setRespawn(respawnTime);
|
setRespawn(respawnTime);
|
||||||
startQuestTimer("CLEAR_STATUS", respawnTime, null, null);
|
startQuestTimer("CLEAR_STATUS", respawnTime, null, null);
|
||||||
cancelQuestTimer("SET_REGEN", npc, null);
|
cancelQuestTimer("SET_REGEN", npc, null);
|
||||||
|
@@ -254,7 +254,7 @@ public final class Baium extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
L2PcInstance randomPlayer = getRandomPlayer(npc);
|
final L2PcInstance randomPlayer = getRandomPlayer(npc);
|
||||||
if (randomPlayer != null)
|
if (randomPlayer != null)
|
||||||
{
|
{
|
||||||
randomPlayer.teleToLocation(BAIUM_GIFT_LOC);
|
randomPlayer.teleToLocation(BAIUM_GIFT_LOC);
|
||||||
@@ -305,7 +305,7 @@ public final class Baium extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
L2PcInstance randomPlayer = getRandomPlayer(npc);
|
final L2PcInstance randomPlayer = getRandomPlayer(npc);
|
||||||
if (randomPlayer != null)
|
if (randomPlayer != null)
|
||||||
{
|
{
|
||||||
addAttackPlayerDesire(npc, randomPlayer);
|
addAttackPlayerDesire(npc, randomPlayer);
|
||||||
@@ -556,7 +556,7 @@ public final class Baium extends AbstractNpcAI
|
|||||||
setStatus(DEAD);
|
setStatus(DEAD);
|
||||||
addSpawn(TELE_CUBE, TELEPORT_CUBIC_LOC, false, 900000);
|
addSpawn(TELE_CUBE, TELEPORT_CUBIC_LOC, false, 900000);
|
||||||
zone.broadcastPacket(new PlaySound("BS01_D"));
|
zone.broadcastPacket(new PlaySound("BS01_D"));
|
||||||
long respawnTime = (Config.BAIUM_SPAWN_INTERVAL + getRandom(-Config.BAIUM_SPAWN_RANDOM, Config.BAIUM_SPAWN_RANDOM)) * 3600000;
|
final long respawnTime = (Config.BAIUM_SPAWN_INTERVAL + getRandom(-Config.BAIUM_SPAWN_RANDOM, Config.BAIUM_SPAWN_RANDOM)) * 3600000;
|
||||||
setRespawn(respawnTime);
|
setRespawn(respawnTime);
|
||||||
startQuestTimer("CLEAR_STATUS", respawnTime, null, null);
|
startQuestTimer("CLEAR_STATUS", respawnTime, null, null);
|
||||||
startQuestTimer("CLEAR_ZONE", 900000, null, null);
|
startQuestTimer("CLEAR_ZONE", 900000, null, null);
|
||||||
|
@@ -106,8 +106,8 @@ public final class Beleth extends AbstractNpcAI
|
|||||||
addStartNpc(STONE_COFFIN);
|
addStartNpc(STONE_COFFIN);
|
||||||
addTalkId(STONE_COFFIN);
|
addTalkId(STONE_COFFIN);
|
||||||
addFirstTalkId(ELF);
|
addFirstTalkId(ELF);
|
||||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(REAL_BELETH);
|
final StatsSet info = GrandBossManager.getInstance().getStatsSet(REAL_BELETH);
|
||||||
int status = GrandBossManager.getInstance().getBossStatus(REAL_BELETH);
|
final int status = GrandBossManager.getInstance().getBossStatus(REAL_BELETH);
|
||||||
if (status == DEAD)
|
if (status == DEAD)
|
||||||
{
|
{
|
||||||
final long time = (info.getLong("respawn_time") - System.currentTimeMillis());
|
final long time = (info.getLong("respawn_time") - System.currentTimeMillis());
|
||||||
@@ -247,9 +247,9 @@ public final class Beleth extends AbstractNpcAI
|
|||||||
|
|
||||||
for (int i = 0; i < 6; i++)
|
for (int i = 0; i < 6; i++)
|
||||||
{
|
{
|
||||||
int x = (int) ((150 * Math.cos(i * 1.046666667)) + 16323);
|
final int x = (int) ((150 * Math.cos(i * 1.046666667)) + 16323);
|
||||||
int y = (int) ((150 * Math.sin(i * 1.046666667)) + 213059);
|
final int y = (int) ((150 * Math.sin(i * 1.046666667)) + 213059);
|
||||||
L2Npc minion = addSpawn(FAKE_BELETH, new Location(x, y, -9357, 49152));
|
final L2Npc minion = addSpawn(FAKE_BELETH, new Location(x, y, -9357, 49152));
|
||||||
minion.setShowSummonAnimation(true);
|
minion.setShowSummonAnimation(true);
|
||||||
minion.decayMe();
|
minion.decayMe();
|
||||||
|
|
||||||
@@ -391,8 +391,8 @@ public final class Beleth extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
a++;
|
a++;
|
||||||
|
|
||||||
int x = (int) ((650 * Math.cos(i * 0.39)) + 16323);
|
final int x = (int) ((650 * Math.cos(i * 0.39)) + 16323);
|
||||||
int y = (int) ((650 * Math.sin(i * 0.39)) + 213170);
|
final int y = (int) ((650 * Math.sin(i * 0.39)) + 213170);
|
||||||
|
|
||||||
npc = addSpawn(FAKE_BELETH, new Location(x, y, -9357, 49152));
|
npc = addSpawn(FAKE_BELETH, new Location(x, y, -9357, 49152));
|
||||||
_minions.add(npc);
|
_minions.add(npc);
|
||||||
@@ -404,8 +404,8 @@ public final class Beleth extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int[] xm = new int[16];
|
final int[] xm = new int[16];
|
||||||
int[] ym = new int[16];
|
final int[] ym = new int[16];
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
xm[i] = (int) ((1700 * Math.cos((i * 1.57) + 0.78)) + 16323);
|
xm[i] = (int) ((1700 * Math.cos((i * 1.57) + 0.78)) + 16323);
|
||||||
@@ -523,7 +523,7 @@ public final class Beleth extends AbstractNpcAI
|
|||||||
ZONE.broadcastPacket(new SpecialCamera(_camera2, 800, 180, 0, 0, 4000, 0, 10, 1, 0, 0));
|
ZONE.broadcastPacket(new SpecialCamera(_camera2, 800, 180, 0, 0, 4000, 0, 10, 1, 0, 0));
|
||||||
ZONE.broadcastPacket(new SpecialCamera(_camera2, 800, 180, 0, 0, 4000, 0, 10, 1, 0, 0));
|
ZONE.broadcastPacket(new SpecialCamera(_camera2, 800, 180, 0, 0, 4000, 0, 10, 1, 0, 0));
|
||||||
|
|
||||||
L2DoorInstance door2 = DoorData.getInstance().getDoor(DOOR2);
|
final L2DoorInstance door2 = DoorData.getInstance().getDoor(DOOR2);
|
||||||
door2.openMe();
|
door2.openMe();
|
||||||
|
|
||||||
ZONE.broadcastPacket(new StaticObject(door2, false));
|
ZONE.broadcastPacket(new StaticObject(door2, false));
|
||||||
@@ -639,8 +639,8 @@ public 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);
|
||||||
double speed = npc.isRunning() ? npc.getRunSpeed() : npc.getWalkSpeed();
|
final double speed = npc.isRunning() ? npc.getRunSpeed() : npc.getWalkSpeed();
|
||||||
int time = (int) (((distance2 - 890) / speed) * 1000);
|
final int time = (int) (((distance2 - 890) / speed) * 1000);
|
||||||
startQuestTimer("CAST", time, npc, null);
|
startQuestTimer("CAST", time, npc, null);
|
||||||
}
|
}
|
||||||
else if (distance2 < 890)
|
else if (distance2 < 890)
|
||||||
@@ -759,7 +759,7 @@ public final class Beleth extends AbstractNpcAI
|
|||||||
setBelethKiller(killer);
|
setBelethKiller(killer);
|
||||||
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, DEAD);
|
GrandBossManager.getInstance().setBossStatus(REAL_BELETH, DEAD);
|
||||||
final long respawnTime = (Config.BELETH_SPAWN_INTERVAL + getRandom(-Config.BELETH_SPAWN_RANDOM, Config.BELETH_SPAWN_RANDOM)) * 3600000;
|
final long respawnTime = (Config.BELETH_SPAWN_INTERVAL + getRandom(-Config.BELETH_SPAWN_RANDOM, Config.BELETH_SPAWN_RANDOM)) * 3600000;
|
||||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(REAL_BELETH);
|
final StatsSet info = GrandBossManager.getInstance().getStatsSet(REAL_BELETH);
|
||||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||||
GrandBossManager.getInstance().setStatsSet(REAL_BELETH, info);
|
GrandBossManager.getInstance().setStatsSet(REAL_BELETH, info);
|
||||||
startQuestTimer("BELETH_UNLOCK", respawnTime, null, null);
|
startQuestTimer("BELETH_UNLOCK", respawnTime, null, null);
|
||||||
|
@@ -69,7 +69,7 @@ public final class Core extends AbstractNpcAI
|
|||||||
if (status == DEAD)
|
if (status == DEAD)
|
||||||
{
|
{
|
||||||
// load the unlock date and time for Core from DB
|
// load the unlock date and time for Core from DB
|
||||||
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
|
// if Core is locked until a certain time, mark it so and start the unlock timer
|
||||||
// the unlock time has not yet expired.
|
// the unlock time has not yet expired.
|
||||||
if (temp > 0)
|
if (temp > 0)
|
||||||
@@ -79,7 +79,7 @@ public final class Core extends AbstractNpcAI
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// the time has already expired while the server was offline. Immediately spawn Core.
|
// the time has already expired while the server was offline. Immediately spawn Core.
|
||||||
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);
|
||||||
}
|
}
|
||||||
@@ -131,7 +131,7 @@ public final class Core extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
int x = 16800 + (i * 450);
|
final int x = 16800 + (i * 450);
|
||||||
mob = (L2Attackable) addSpawn(SUSCEPTOR, x, 110300, npc.getZ(), 280 + getRandom(40), false, 0);
|
mob = (L2Attackable) addSpawn(SUSCEPTOR, x, 110300, npc.getZ(), 280 + getRandom(40), false, 0);
|
||||||
mob.setIsRaidMinion(true);
|
mob.setIsRaidMinion(true);
|
||||||
_minions.add(mob);
|
_minions.add(mob);
|
||||||
@@ -143,13 +143,13 @@ public final class Core extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (event.equalsIgnoreCase("core_unlock"))
|
if (event.equalsIgnoreCase("core_unlock"))
|
||||||
{
|
{
|
||||||
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);
|
||||||
}
|
}
|
||||||
else if (event.equalsIgnoreCase("spawn_minion"))
|
else if (event.equalsIgnoreCase("spawn_minion"))
|
||||||
{
|
{
|
||||||
L2Attackable mob = (L2Attackable) addSpawn(npc.getId(), npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
final L2Attackable mob = (L2Attackable) addSpawn(npc.getId(), npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
|
||||||
mob.setIsRaidMinion(true);
|
mob.setIsRaidMinion(true);
|
||||||
_minions.add(mob);
|
_minions.add(mob);
|
||||||
}
|
}
|
||||||
@@ -188,7 +188,7 @@ public final class Core extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (npc.getId() == CORE)
|
if (npc.getId() == CORE)
|
||||||
{
|
{
|
||||||
int objId = npc.getObjectId();
|
final int objId = npc.getObjectId();
|
||||||
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, objId, npc.getX(), npc.getY(), npc.getZ()));
|
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, objId, npc.getX(), npc.getY(), npc.getZ()));
|
||||||
npc.broadcastPacket(new NpcSay(objId, ChatType.NPC_GENERAL, npc.getId(), NpcStringId.A_FATAL_ERROR_HAS_OCCURRED));
|
npc.broadcastPacket(new NpcSay(objId, ChatType.NPC_GENERAL, npc.getId(), NpcStringId.A_FATAL_ERROR_HAS_OCCURRED));
|
||||||
npc.broadcastPacket(new NpcSay(objId, ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SYSTEM_IS_BEING_SHUT_DOWN));
|
npc.broadcastPacket(new NpcSay(objId, ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SYSTEM_IS_BEING_SHUT_DOWN));
|
||||||
@@ -197,10 +197,10 @@ public final class Core extends AbstractNpcAI
|
|||||||
|
|
||||||
GrandBossManager.getInstance().setBossStatus(CORE, DEAD);
|
GrandBossManager.getInstance().setBossStatus(CORE, DEAD);
|
||||||
// Calculate Min and Max respawn times randomly.
|
// Calculate Min and Max respawn times randomly.
|
||||||
long respawnTime = (Config.CORE_SPAWN_INTERVAL + getRandom(-Config.CORE_SPAWN_RANDOM, Config.CORE_SPAWN_RANDOM)) * 3600000;
|
final long respawnTime = (Config.CORE_SPAWN_INTERVAL + getRandom(-Config.CORE_SPAWN_RANDOM, Config.CORE_SPAWN_RANDOM)) * 3600000;
|
||||||
startQuestTimer("core_unlock", respawnTime, null, null);
|
startQuestTimer("core_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
|
||||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
|
final StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
|
||||||
info.set("respawn_time", (System.currentTimeMillis() + respawnTime));
|
info.set("respawn_time", (System.currentTimeMillis() + respawnTime));
|
||||||
GrandBossManager.getInstance().setStatsSet(CORE, info);
|
GrandBossManager.getInstance().setStatsSet(CORE, info);
|
||||||
startQuestTimer("despawn_minions", 20000, null, null);
|
startQuestTimer("despawn_minions", 20000, null, null);
|
||||||
|
@@ -49,7 +49,7 @@ public final class DarkWaterDragon extends AbstractNpcAI
|
|||||||
private DarkWaterDragon()
|
private DarkWaterDragon()
|
||||||
{
|
{
|
||||||
super(DarkWaterDragon.class.getSimpleName(), "ai/individual");
|
super(DarkWaterDragon.class.getSimpleName(), "ai/individual");
|
||||||
int[] mobs =
|
final int[] mobs =
|
||||||
{
|
{
|
||||||
DRAGON,
|
DRAGON,
|
||||||
SHADE1,
|
SHADE1,
|
||||||
@@ -144,15 +144,15 @@ public final class DarkWaterDragon 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)
|
||||||
{
|
{
|
||||||
int npcId = npc.getId();
|
final int npcId = npc.getId();
|
||||||
int npcObjId = npc.getObjectId();
|
final int npcObjId = npc.getObjectId();
|
||||||
if (npcId == DRAGON)
|
if (npcId == DRAGON)
|
||||||
{
|
{
|
||||||
if (!MY_TRACKING_SET.contains(npcObjId)) // this allows to handle multiple instances of npc
|
if (!MY_TRACKING_SET.contains(npcObjId)) // this allows to handle multiple instances of npc
|
||||||
{
|
{
|
||||||
MY_TRACKING_SET.add(npcObjId);
|
MY_TRACKING_SET.add(npcObjId);
|
||||||
// Spawn first 5 shades on first attack on Dark Water Dragon
|
// Spawn first 5 shades on first attack on Dark Water Dragon
|
||||||
L2Character originalAttacker = isSummon ? attacker.getServitors().values().stream().findFirst().orElse(attacker.getPet()) : attacker;
|
final L2Character originalAttacker = isSummon ? attacker.getServitors().values().stream().findFirst().orElse(attacker.getPet()) : attacker;
|
||||||
spawnShade(originalAttacker, SHADE1, npc.getX() + 100, npc.getY() + 100, npc.getZ());
|
spawnShade(originalAttacker, SHADE1, npc.getX() + 100, npc.getY() + 100, npc.getZ());
|
||||||
spawnShade(originalAttacker, SHADE2, npc.getX() + 100, npc.getY() - 100, npc.getZ());
|
spawnShade(originalAttacker, SHADE2, npc.getX() + 100, npc.getY() - 100, npc.getZ());
|
||||||
spawnShade(originalAttacker, SHADE1, npc.getX() - 100, npc.getY() + 100, npc.getZ());
|
spawnShade(originalAttacker, SHADE1, npc.getX() - 100, npc.getY() + 100, npc.getZ());
|
||||||
@@ -163,7 +163,7 @@ public final class DarkWaterDragon extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
SECOND_SPAWN.add(npcObjId);
|
SECOND_SPAWN.add(npcObjId);
|
||||||
// Spawn second 5 shades on half hp of on Dark Water Dragon
|
// Spawn second 5 shades on half hp of on Dark Water Dragon
|
||||||
L2Character originalAttacker = isSummon ? attacker.getServitors().values().stream().findFirst().orElse(attacker.getPet()) : attacker;
|
final L2Character originalAttacker = isSummon ? attacker.getServitors().values().stream().findFirst().orElse(attacker.getPet()) : attacker;
|
||||||
spawnShade(originalAttacker, SHADE2, npc.getX() + 100, npc.getY() + 100, npc.getZ());
|
spawnShade(originalAttacker, SHADE2, npc.getX() + 100, npc.getY() + 100, npc.getZ());
|
||||||
spawnShade(originalAttacker, SHADE1, npc.getX() + 100, npc.getY() - 100, npc.getZ());
|
spawnShade(originalAttacker, SHADE1, npc.getX() + 100, npc.getY() - 100, npc.getZ());
|
||||||
spawnShade(originalAttacker, SHADE2, npc.getX() - 100, npc.getY() + 100, npc.getZ());
|
spawnShade(originalAttacker, SHADE2, npc.getX() - 100, npc.getY() + 100, npc.getZ());
|
||||||
@@ -177,13 +177,13 @@ public final class DarkWaterDragon extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
||||||
{
|
{
|
||||||
int npcId = npc.getId();
|
final int npcId = npc.getId();
|
||||||
int npcObjId = npc.getObjectId();
|
final int npcObjId = npc.getObjectId();
|
||||||
if (npcId == DRAGON)
|
if (npcId == DRAGON)
|
||||||
{
|
{
|
||||||
MY_TRACKING_SET.remove(npcObjId);
|
MY_TRACKING_SET.remove(npcObjId);
|
||||||
SECOND_SPAWN.remove(npcObjId);
|
SECOND_SPAWN.remove(npcObjId);
|
||||||
L2Attackable faf = (L2Attackable) addSpawn(FAFURION, npc.getX(), npc.getY(), npc.getZ(), 0, false, 0); // spawns Fafurion Kindred when Dard Water Dragon is dead
|
final L2Attackable faf = (L2Attackable) addSpawn(FAFURION, npc.getX(), npc.getY(), npc.getZ(), 0, false, 0); // spawns Fafurion Kindred when Dard Water Dragon is dead
|
||||||
ID_MAP.put(faf.getObjectId(), killer);
|
ID_MAP.put(faf.getObjectId(), killer);
|
||||||
}
|
}
|
||||||
else if (npcId == FAFURION)
|
else if (npcId == FAFURION)
|
||||||
@@ -207,16 +207,16 @@ public final class DarkWaterDragon extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onSpawn(L2Npc npc)
|
public String onSpawn(L2Npc npc)
|
||||||
{
|
{
|
||||||
int npcId = npc.getId();
|
final int npcId = npc.getId();
|
||||||
int npcObjId = npc.getObjectId();
|
final int npcObjId = npc.getObjectId();
|
||||||
if (npcId == FAFURION)
|
if (npcId == FAFURION)
|
||||||
{
|
{
|
||||||
if (!MY_TRACKING_SET.contains(npcObjId))
|
if (!MY_TRACKING_SET.contains(npcObjId))
|
||||||
{
|
{
|
||||||
MY_TRACKING_SET.add(npcObjId);
|
MY_TRACKING_SET.add(npcObjId);
|
||||||
// Spawn 4 Detractors on spawn of Fafurion
|
// Spawn 4 Detractors on spawn of Fafurion
|
||||||
int x = npc.getX();
|
final int x = npc.getX();
|
||||||
int y = npc.getY();
|
final int y = npc.getY();
|
||||||
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);
|
addSpawn(DETRACTOR2, x - 100, y + 100, npc.getZ(), 0, false, 40000);
|
||||||
|
@@ -75,9 +75,9 @@ public final class Epidos extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if ((getRandom(1000) > 250) && _lastHp.containsKey(npc.getObjectId()))
|
if ((getRandom(1000) > 250) && _lastHp.containsKey(npc.getObjectId()))
|
||||||
{
|
{
|
||||||
int hpDecreasePercent = (int) (((_lastHp.get(npc.getObjectId()) - npc.getCurrentHp()) * 100) / npc.getMaxHp());
|
final int hpDecreasePercent = (int) (((_lastHp.get(npc.getObjectId()) - npc.getCurrentHp()) * 100) / npc.getMaxHp());
|
||||||
int minionsCount = 0;
|
int minionsCount = 0;
|
||||||
int spawnedMinions = ((L2MonsterInstance) npc).getMinionList().countSpawnedMinions();
|
final int spawnedMinions = ((L2MonsterInstance) npc).getMinionList().countSpawnedMinions();
|
||||||
|
|
||||||
if ((hpDecreasePercent > 5) && (hpDecreasePercent <= 15) && (spawnedMinions <= 9))
|
if ((hpDecreasePercent > 5) && (hpDecreasePercent <= 15) && (spawnedMinions <= 9))
|
||||||
{
|
{
|
||||||
|
@@ -81,7 +81,7 @@ public final class Orfen extends AbstractNpcAI
|
|||||||
private Orfen()
|
private Orfen()
|
||||||
{
|
{
|
||||||
super(Orfen.class.getSimpleName(), "ai/individual");
|
super(Orfen.class.getSimpleName(), "ai/individual");
|
||||||
int[] mobs =
|
final int[] mobs =
|
||||||
{
|
{
|
||||||
ORFEN,
|
ORFEN,
|
||||||
RAIKEL_LEOS,
|
RAIKEL_LEOS,
|
||||||
@@ -90,12 +90,12 @@ public final class Orfen extends AbstractNpcAI
|
|||||||
registerMobs(mobs);
|
registerMobs(mobs);
|
||||||
_IsTeleported = false;
|
_IsTeleported = false;
|
||||||
ZONE = GrandBossManager.getInstance().getZone(POS[0]);
|
ZONE = GrandBossManager.getInstance().getZone(POS[0]);
|
||||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);
|
final StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);
|
||||||
int status = GrandBossManager.getInstance().getBossStatus(ORFEN);
|
final int status = GrandBossManager.getInstance().getBossStatus(ORFEN);
|
||||||
if (status == DEAD)
|
if (status == DEAD)
|
||||||
{
|
{
|
||||||
// load the unlock date and time for Orfen from DB
|
// load the unlock date and time for Orfen from DB
|
||||||
long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||||
// if Orfen is locked until a certain time, mark it so and start the unlock timer
|
// if Orfen is locked until a certain time, mark it so and start the unlock timer
|
||||||
// the unlock time has not yet expired.
|
// the unlock time has not yet expired.
|
||||||
if (temp > 0)
|
if (temp > 0)
|
||||||
@@ -105,7 +105,7 @@ public final class Orfen extends AbstractNpcAI
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// the time has already expired while the server was offline. Immediately spawn Orfen.
|
// the time has already expired while the server was offline. Immediately spawn Orfen.
|
||||||
int i = getRandom(10);
|
final int i = getRandom(10);
|
||||||
Location loc;
|
Location loc;
|
||||||
if (i < 4)
|
if (i < 4)
|
||||||
{
|
{
|
||||||
@@ -119,20 +119,20 @@ public final class Orfen extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
loc = POS[3];
|
loc = POS[3];
|
||||||
}
|
}
|
||||||
L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc, false, 0);
|
final L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc, false, 0);
|
||||||
GrandBossManager.getInstance().setBossStatus(ORFEN, ALIVE);
|
GrandBossManager.getInstance().setBossStatus(ORFEN, ALIVE);
|
||||||
spawnBoss(orfen);
|
spawnBoss(orfen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int loc_x = info.getInt("loc_x");
|
final int loc_x = info.getInt("loc_x");
|
||||||
int loc_y = info.getInt("loc_y");
|
final int loc_y = info.getInt("loc_y");
|
||||||
int loc_z = info.getInt("loc_z");
|
final int loc_z = info.getInt("loc_z");
|
||||||
int heading = info.getInt("heading");
|
final int heading = info.getInt("heading");
|
||||||
int hp = info.getInt("currentHP");
|
final int hp = info.getInt("currentHP");
|
||||||
int mp = info.getInt("currentMP");
|
final int mp = info.getInt("currentMP");
|
||||||
L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0);
|
final L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0);
|
||||||
orfen.setCurrentHpMp(hp, mp);
|
orfen.setCurrentHpMp(hp, mp);
|
||||||
spawnBoss(orfen);
|
spawnBoss(orfen);
|
||||||
}
|
}
|
||||||
@@ -142,7 +142,7 @@ public final class Orfen extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
((L2Attackable) npc).clearAggroList();
|
((L2Attackable) npc).clearAggroList();
|
||||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null, null);
|
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null, null);
|
||||||
L2Spawn spawn = npc.getSpawn();
|
final L2Spawn spawn = npc.getSpawn();
|
||||||
spawn.setLocation(POS[index]);
|
spawn.setLocation(POS[index]);
|
||||||
npc.teleToLocation(POS[index], false);
|
npc.teleToLocation(POS[index], false);
|
||||||
}
|
}
|
||||||
@@ -153,8 +153,8 @@ public final class Orfen extends AbstractNpcAI
|
|||||||
npc.broadcastPacket(new PlaySound(1, "BS01_A", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
npc.broadcastPacket(new PlaySound(1, "BS01_A", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
|
||||||
startQuestTimer("check_orfen_pos", 10000, npc, null, true);
|
startQuestTimer("check_orfen_pos", 10000, npc, null, true);
|
||||||
// Spawn minions
|
// Spawn minions
|
||||||
int x = npc.getX();
|
final int x = npc.getX();
|
||||||
int y = npc.getY();
|
final int y = npc.getY();
|
||||||
L2Attackable mob;
|
L2Attackable mob;
|
||||||
mob = (L2Attackable) addSpawn(RAIKEL_LEOS, x + 100, y + 100, npc.getZ(), 0, false, 0);
|
mob = (L2Attackable) addSpawn(RAIKEL_LEOS, x + 100, y + 100, npc.getZ(), 0, false, 0);
|
||||||
mob.setIsRaidMinion(true);
|
mob.setIsRaidMinion(true);
|
||||||
@@ -176,7 +176,7 @@ public final class Orfen extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (event.equalsIgnoreCase("orfen_unlock"))
|
if (event.equalsIgnoreCase("orfen_unlock"))
|
||||||
{
|
{
|
||||||
int i = getRandom(10);
|
final int i = getRandom(10);
|
||||||
Location loc;
|
Location loc;
|
||||||
if (i < 4)
|
if (i < 4)
|
||||||
{
|
{
|
||||||
@@ -190,7 +190,7 @@ public final class Orfen extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
loc = POS[3];
|
loc = POS[3];
|
||||||
}
|
}
|
||||||
L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc, false, 0);
|
final L2GrandBossInstance orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc, false, 0);
|
||||||
GrandBossManager.getInstance().setBossStatus(ORFEN, ALIVE);
|
GrandBossManager.getInstance().setBossStatus(ORFEN, ALIVE);
|
||||||
spawnBoss(orfen);
|
spawnBoss(orfen);
|
||||||
}
|
}
|
||||||
@@ -210,7 +210,7 @@ public final class Orfen extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < MINIONS.size(); i++)
|
for (int i = 0; i < MINIONS.size(); i++)
|
||||||
{
|
{
|
||||||
L2Attackable mob = MINIONS.get(i);
|
final L2Attackable mob = MINIONS.get(i);
|
||||||
if (!npc.isInsideRadius(mob, 3000, false, false))
|
if (!npc.isInsideRadius(mob, 3000, false, false))
|
||||||
{
|
{
|
||||||
mob.teleToLocation(npc.getLocation());
|
mob.teleToLocation(npc.getLocation());
|
||||||
@@ -223,7 +223,7 @@ public final class Orfen extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < MINIONS.size(); i++)
|
for (int i = 0; i < MINIONS.size(); i++)
|
||||||
{
|
{
|
||||||
L2Attackable mob = MINIONS.get(i);
|
final L2Attackable mob = MINIONS.get(i);
|
||||||
if (mob != null)
|
if (mob != null)
|
||||||
{
|
{
|
||||||
mob.decayMe();
|
mob.decayMe();
|
||||||
@@ -233,7 +233,7 @@ public final class Orfen extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else if (event.equalsIgnoreCase("spawn_minion"))
|
else if (event.equalsIgnoreCase("spawn_minion"))
|
||||||
{
|
{
|
||||||
L2Attackable mob = (L2Attackable) addSpawn(RAIKEL_LEOS, npc.getX(), npc.getY(), npc.getZ(), 0, false, 0);
|
final L2Attackable mob = (L2Attackable) addSpawn(RAIKEL_LEOS, npc.getX(), npc.getY(), npc.getZ(), 0, false, 0);
|
||||||
mob.setIsRaidMinion(true);
|
mob.setIsRaidMinion(true);
|
||||||
MINIONS.add(mob);
|
MINIONS.add(mob);
|
||||||
}
|
}
|
||||||
@@ -245,10 +245,10 @@ public final class Orfen extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (npc.getId() == ORFEN)
|
if (npc.getId() == ORFEN)
|
||||||
{
|
{
|
||||||
L2Character originalCaster = isSummon ? caster.getServitors().values().stream().findFirst().orElse(caster.getPet()) : caster;
|
final L2Character originalCaster = isSummon ? caster.getServitors().values().stream().findFirst().orElse(caster.getPet()) : caster;
|
||||||
if ((skill.getEffectPoint() > 0) && (getRandom(5) == 0) && npc.isInsideRadius(originalCaster, 1000, false, false))
|
if ((skill.getEffectPoint() > 0) && (getRandom(5) == 0) && npc.isInsideRadius(originalCaster, 1000, false, false))
|
||||||
{
|
{
|
||||||
NpcSay packet = new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), TEXT[getRandom(4)]);
|
final NpcSay packet = new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), TEXT[getRandom(4)]);
|
||||||
packet.addStringParameter(caster.getName().toString());
|
packet.addStringParameter(caster.getName().toString());
|
||||||
npc.broadcastPacket(packet);
|
npc.broadcastPacket(packet);
|
||||||
originalCaster.teleToLocation(npc.getLocation());
|
originalCaster.teleToLocation(npc.getLocation());
|
||||||
@@ -266,8 +266,8 @@ public final class Orfen extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
return super.onFactionCall(npc, caller, attacker, isSummon);
|
return super.onFactionCall(npc, caller, attacker, isSummon);
|
||||||
}
|
}
|
||||||
int npcId = npc.getId();
|
final int npcId = npc.getId();
|
||||||
int callerId = caller.getId();
|
final int callerId = caller.getId();
|
||||||
if ((npcId == RAIKEL_LEOS) && (getRandom(20) == 0))
|
if ((npcId == RAIKEL_LEOS) && (getRandom(20) == 0))
|
||||||
{
|
{
|
||||||
npc.setTarget(attacker);
|
npc.setTarget(attacker);
|
||||||
@@ -293,7 +293,7 @@ public final class Orfen 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)
|
||||||
{
|
{
|
||||||
int npcId = npc.getId();
|
final int npcId = npc.getId();
|
||||||
if (npcId == ORFEN)
|
if (npcId == ORFEN)
|
||||||
{
|
{
|
||||||
if (!_IsTeleported && ((npc.getCurrentHp() - damage) < (npc.getMaxHp() / 2)))
|
if (!_IsTeleported && ((npc.getCurrentHp() - damage) < (npc.getMaxHp() / 2)))
|
||||||
@@ -303,7 +303,7 @@ public final class Orfen extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else if (npc.isInsideRadius(attacker, 1000, false, false) && !npc.isInsideRadius(attacker, 300, false, false) && (getRandom(10) == 0))
|
else if (npc.isInsideRadius(attacker, 1000, false, false) && !npc.isInsideRadius(attacker, 300, false, false) && (getRandom(10) == 0))
|
||||||
{
|
{
|
||||||
NpcSay packet = new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npcId, TEXT[getRandom(3)]);
|
final NpcSay packet = new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npcId, TEXT[getRandom(3)]);
|
||||||
packet.addStringParameter(attacker.getName().toString());
|
packet.addStringParameter(attacker.getName().toString());
|
||||||
npc.broadcastPacket(packet);
|
npc.broadcastPacket(packet);
|
||||||
attacker.teleToLocation(npc.getLocation());
|
attacker.teleToLocation(npc.getLocation());
|
||||||
@@ -334,7 +334,7 @@ public final class Orfen extends AbstractNpcAI
|
|||||||
respawnTime *= 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
|
||||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);
|
final StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);
|
||||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||||
GrandBossManager.getInstance().setStatsSet(ORFEN, info);
|
GrandBossManager.getInstance().setStatsSet(ORFEN, info);
|
||||||
cancelQuestTimer("check_minion_loc", npc, null);
|
cancelQuestTimer("check_minion_loc", npc, null);
|
||||||
|
@@ -95,12 +95,12 @@ public final class QueenAnt extends AbstractNpcAI
|
|||||||
addFactionCallId(NURSE);
|
addFactionCallId(NURSE);
|
||||||
|
|
||||||
_zone = GrandBossManager.getInstance().getZone(QUEEN_X, QUEEN_Y, QUEEN_Z);
|
_zone = GrandBossManager.getInstance().getZone(QUEEN_X, QUEEN_Y, QUEEN_Z);
|
||||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
|
final StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
|
||||||
int status = GrandBossManager.getInstance().getBossStatus(QUEEN);
|
final int status = GrandBossManager.getInstance().getBossStatus(QUEEN);
|
||||||
if (status == 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
|
||||||
long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
|
||||||
// if queen ant is locked until a certain time, mark it so and start the unlock timer
|
// if queen ant is locked until a certain time, mark it so and start the unlock timer
|
||||||
// the unlock time has not yet expired.
|
// the unlock time has not yet expired.
|
||||||
if (temp > 0)
|
if (temp > 0)
|
||||||
@@ -110,21 +110,21 @@ public final class QueenAnt extends AbstractNpcAI
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// the time has already expired while the server was offline. Immediately spawn queen ant.
|
// the time has already expired while the server was offline. Immediately spawn queen ant.
|
||||||
L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0);
|
final L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0);
|
||||||
GrandBossManager.getInstance().setBossStatus(QUEEN, ALIVE);
|
GrandBossManager.getInstance().setBossStatus(QUEEN, ALIVE);
|
||||||
spawnBoss(queen);
|
spawnBoss(queen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int loc_x = QUEEN_X;
|
final int loc_x = QUEEN_X;
|
||||||
int loc_y = QUEEN_Y;
|
final int loc_y = QUEEN_Y;
|
||||||
int loc_z = QUEEN_Z;
|
final int loc_z = QUEEN_Z;
|
||||||
int heading = info.getInt("heading");
|
final int heading = info.getInt("heading");
|
||||||
int hp = info.getInt("currentHP");
|
final int hp = info.getInt("currentHP");
|
||||||
int mp = info.getInt("currentMP");
|
final int mp = info.getInt("currentMP");
|
||||||
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
@@ -215,7 +215,7 @@ public final class QueenAnt extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else if (event.equalsIgnoreCase("queen_unlock"))
|
else if (event.equalsIgnoreCase("queen_unlock"))
|
||||||
{
|
{
|
||||||
L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0);
|
final L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, QUEEN_X, QUEEN_Y, QUEEN_Z, 0, false, 0);
|
||||||
GrandBossManager.getInstance().setBossStatus(QUEEN, ALIVE);
|
GrandBossManager.getInstance().setBossStatus(QUEEN, ALIVE);
|
||||||
spawnBoss(queen);
|
spawnBoss(queen);
|
||||||
}
|
}
|
||||||
@@ -329,7 +329,7 @@ public final class QueenAnt extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
||||||
{
|
{
|
||||||
int npcId = npc.getId();
|
final int npcId = npc.getId();
|
||||||
if (npcId == QUEEN)
|
if (npcId == QUEEN)
|
||||||
{
|
{
|
||||||
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()));
|
||||||
@@ -341,7 +341,7 @@ public final class QueenAnt extends AbstractNpcAI
|
|||||||
cancelQuestTimer("action", npc, null);
|
cancelQuestTimer("action", npc, null);
|
||||||
cancelQuestTimer("heal", null, null);
|
cancelQuestTimer("heal", 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
|
||||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
|
final StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
|
||||||
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
|
||||||
GrandBossManager.getInstance().setStatsSet(QUEEN, info);
|
GrandBossManager.getInstance().setStatsSet(QUEEN, info);
|
||||||
_nurses.clear();
|
_nurses.clear();
|
||||||
@@ -358,7 +358,7 @@ public final class QueenAnt extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (npcId == ROYAL)
|
if (npcId == ROYAL)
|
||||||
{
|
{
|
||||||
L2MonsterInstance mob = (L2MonsterInstance) npc;
|
final L2MonsterInstance mob = (L2MonsterInstance) npc;
|
||||||
if (mob.getLeader() != null)
|
if (mob.getLeader() != null)
|
||||||
{
|
{
|
||||||
mob.getLeader().getMinionList().onMinionDie(mob, (280 + getRandom(40)) * 1000);
|
mob.getLeader().getMinionList().onMinionDie(mob, (280 + getRandom(40)) * 1000);
|
||||||
@@ -366,7 +366,7 @@ public final class QueenAnt extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else if (npcId == NURSE)
|
else if (npcId == NURSE)
|
||||||
{
|
{
|
||||||
L2MonsterInstance mob = (L2MonsterInstance) npc;
|
final L2MonsterInstance mob = (L2MonsterInstance) npc;
|
||||||
_nurses.remove(mob);
|
_nurses.remove(mob);
|
||||||
if (mob.getLeader() != null)
|
if (mob.getLeader() != null)
|
||||||
{
|
{
|
||||||
|
@@ -176,7 +176,7 @@ public class ScarletVanHalisha extends AbstractNpcAI
|
|||||||
_skill = getRndSkills(npc);
|
_skill = getRndSkills(npc);
|
||||||
_target = getRandomTarget(npc, _skill);
|
_target = getRandomTarget(npc, _skill);
|
||||||
}
|
}
|
||||||
L2Character target = _target;
|
final L2Character target = _target;
|
||||||
Skill skill = _skill;
|
Skill skill = _skill;
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
@@ -213,7 +213,7 @@ public class ScarletVanHalisha extends AbstractNpcAI
|
|||||||
private L2Character getRandomTarget(L2Npc npc, Skill skill)
|
private L2Character getRandomTarget(L2Npc npc, Skill skill)
|
||||||
{
|
{
|
||||||
final Collection<L2Object> objs = npc.getKnownList().getKnownObjects().values();
|
final Collection<L2Object> objs = npc.getKnownList().getKnownObjects().values();
|
||||||
ArrayList<L2Character> result = new ArrayList<>();
|
final ArrayList<L2Character> result = new ArrayList<>();
|
||||||
{
|
{
|
||||||
for (L2Object obj : objs)
|
for (L2Object obj : objs)
|
||||||
{
|
{
|
||||||
@@ -269,7 +269,7 @@ public class ScarletVanHalisha extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
if (!result.isEmpty() && (result.size() != 0))
|
if (!result.isEmpty() && (result.size() != 0))
|
||||||
{
|
{
|
||||||
Object[] characters = result.toArray();
|
final Object[] characters = result.toArray();
|
||||||
return (L2Character) characters[Rnd.get(characters.length)];
|
return (L2Character) characters[Rnd.get(characters.length)];
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@@ -129,7 +129,7 @@ public final class Valakas extends AbstractNpcAI
|
|||||||
if (status == DEAD)
|
if (status == DEAD)
|
||||||
{
|
{
|
||||||
// load the unlock date and time for valakas from DB
|
// load the unlock date and time for valakas from DB
|
||||||
long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
|
final long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
|
||||||
if (temp > 0)
|
if (temp > 0)
|
||||||
{
|
{
|
||||||
// The time has not yet expired. Mark Valakas as currently locked (dead).
|
// The time has not yet expired. Mark Valakas as currently locked (dead).
|
||||||
@@ -446,7 +446,7 @@ public final class Valakas extends AbstractNpcAI
|
|||||||
|
|
||||||
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
|
||||||
StatsSet info = GrandBossManager.getInstance().getStatsSet(VALAKAS);
|
final StatsSet info = GrandBossManager.getInstance().getStatsSet(VALAKAS);
|
||||||
info.set("respawn_time", (System.currentTimeMillis() + respawnTime));
|
info.set("respawn_time", (System.currentTimeMillis() + respawnTime));
|
||||||
GrandBossManager.getInstance().setStatsSet(VALAKAS, info);
|
GrandBossManager.getInstance().setStatsSet(VALAKAS, info);
|
||||||
|
|
||||||
@@ -477,12 +477,12 @@ public final class Valakas extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (getRandom(10) == 0)
|
if (getRandom(10) == 0)
|
||||||
{
|
{
|
||||||
int x = npc.getX();
|
final int x = npc.getX();
|
||||||
int y = npc.getY();
|
final int y = npc.getY();
|
||||||
int z = npc.getZ();
|
final int z = npc.getZ();
|
||||||
|
|
||||||
int posX = x + getRandom(-1400, 1400);
|
final int posX = x + getRandom(-1400, 1400);
|
||||||
int posY = y + getRandom(-1400, 1400);
|
final int posY = y + getRandom(-1400, 1400);
|
||||||
|
|
||||||
if (GeoData.getInstance().canMove(x, y, z, posX, posY, z, npc.getInstanceId()))
|
if (GeoData.getInstance().canMove(x, y, z, posX, posY, z, npc.getInstanceId()))
|
||||||
{
|
{
|
||||||
@@ -547,7 +547,7 @@ public final class Valakas extends AbstractNpcAI
|
|||||||
*/
|
*/
|
||||||
private L2Playable getRandomTarget(L2Npc npc)
|
private L2Playable getRandomTarget(L2Npc npc)
|
||||||
{
|
{
|
||||||
List<L2Playable> result = new ArrayList<>();
|
final List<L2Playable> result = new ArrayList<>();
|
||||||
|
|
||||||
for (L2Character obj : npc.getKnownList().getKnownCharacters())
|
for (L2Character obj : npc.getKnownList().getKnownCharacters())
|
||||||
{
|
{
|
||||||
|
@@ -330,7 +330,7 @@ public final class Venom extends AbstractNpcAI
|
|||||||
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.IT_S_NOT_OVER_YET_IT_WON_T_BE_OVER_LIKE_THIS_NEVER);
|
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.IT_S_NOT_OVER_YET_IT_WON_T_BE_OVER_LIKE_THIS_NEVER);
|
||||||
if (!CastleManager.getInstance().getCastleById(CASTLE).getSiege().isInProgress())
|
if (!CastleManager.getInstance().getCastleById(CASTLE).getSiege().isInProgress())
|
||||||
{
|
{
|
||||||
L2Npc cube = addSpawn(TELEPORT_CUBE, CUBE, false, 0);
|
final L2Npc cube = addSpawn(TELEPORT_CUBE, CUBE, false, 0);
|
||||||
startQuestTimer("cube_despawn", 120000, cube, null);
|
startQuestTimer("cube_despawn", 120000, cube, null);
|
||||||
}
|
}
|
||||||
cancelQuestTimer("raid_check", npc, null);
|
cancelQuestTimer("raid_check", npc, null);
|
||||||
|
@@ -168,7 +168,7 @@ public final class Alarm extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (verifyMemoState(player, ART_OF_PERSUASION_ID, 3))
|
if (verifyMemoState(player, ART_OF_PERSUASION_ID, 3))
|
||||||
{
|
{
|
||||||
int i0 = getMemoStateEx(player, ART_OF_PERSUASION_ID, 1);
|
final int i0 = getMemoStateEx(player, ART_OF_PERSUASION_ID, 1);
|
||||||
if (i0 >= 3)
|
if (i0 >= 3)
|
||||||
{
|
{
|
||||||
if ((npc0 != null) && npc0.getVariables().getBoolean("SPAWNED"))
|
if ((npc0 != null) && npc0.getVariables().getBoolean("SPAWNED"))
|
||||||
@@ -187,7 +187,7 @@ public final class Alarm extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else if (verifyMemoState(player, NIKOLAS_COOPERATION_ID, 3))
|
else if (verifyMemoState(player, NIKOLAS_COOPERATION_ID, 3))
|
||||||
{
|
{
|
||||||
int i0 = getMemoStateEx(player, NIKOLAS_COOPERATION_ID, 1);
|
final int i0 = getMemoStateEx(player, NIKOLAS_COOPERATION_ID, 1);
|
||||||
if (i0 >= 3)
|
if (i0 >= 3)
|
||||||
{
|
{
|
||||||
if ((npc0 != null) && npc0.getVariables().getBoolean("SPAWNED"))
|
if ((npc0 != null) && npc0.getVariables().getBoolean("SPAWNED"))
|
||||||
|
@@ -85,7 +85,7 @@ public final class AwakeningMaster extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
String htmltext = null;
|
final String htmltext = null;
|
||||||
switch (event)
|
switch (event)
|
||||||
{
|
{
|
||||||
case "awakening":
|
case "awakening":
|
||||||
|
@@ -70,7 +70,7 @@ public class BlackJudge extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (player.getShilensBreathDebuffLevel() > 0)
|
if (player.getShilensBreathDebuffLevel() > 0)
|
||||||
{
|
{
|
||||||
int cost = COSTS[level];
|
final int cost = COSTS[level];
|
||||||
|
|
||||||
if (player.getAdena() >= cost)
|
if (player.getAdena() >= cost)
|
||||||
{
|
{
|
||||||
|
@@ -159,7 +159,7 @@ public final class DragonVortex extends AbstractNpcAI
|
|||||||
*/
|
*/
|
||||||
public void spawnRaid(int raidId, L2Npc npc, L2PcInstance player)
|
public void spawnRaid(int raidId, L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
L2Spawn spawnDat = addSpawn(raidId, npc.getX() + getRandom(-500, 500), npc.getY() + getRandom(-500, 500), npc.getZ() + 10, 0, false, DESPAWN_DELAY, true).getSpawn();
|
final L2Spawn spawnDat = addSpawn(raidId, npc.getX() + getRandom(-500, 500), npc.getY() + getRandom(-500, 500), npc.getZ() + 10, 0, false, DESPAWN_DELAY, true).getSpawn();
|
||||||
SpawnTable.getInstance().addNewSpawn(spawnDat, false);
|
SpawnTable.getInstance().addNewSpawn(spawnDat, false);
|
||||||
takeItems(player, LARGE_DRAGON_BONE, 1);
|
takeItems(player, LARGE_DRAGON_BONE, 1);
|
||||||
}
|
}
|
||||||
@@ -173,7 +173,7 @@ public final class DragonVortex extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
for (L2Spawn spawn : SpawnTable.getInstance().getSpawns(npcId))
|
for (L2Spawn spawn : SpawnTable.getInstance().getSpawns(npcId))
|
||||||
{
|
{
|
||||||
L2Npc spawnedWarpgate = spawn.getLastSpawn();
|
final L2Npc spawnedWarpgate = spawn.getLastSpawn();
|
||||||
if ((spawnedWarpgate != null))
|
if ((spawnedWarpgate != null))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@@ -111,7 +111,7 @@ public final class ForgeOfTheGods extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
||||||
{
|
{
|
||||||
int rand = getRandom(100);
|
final int rand = getRandom(100);
|
||||||
L2Npc mob = null;
|
L2Npc mob = null;
|
||||||
_npcCount++;
|
_npcCount++;
|
||||||
|
|
||||||
|
@@ -508,7 +508,7 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int amount = MENTEE_COINS.get(player.getLevel());
|
final int amount = MENTEE_COINS.get(player.getLevel());
|
||||||
if (amount > 0)
|
if (amount > 0)
|
||||||
{
|
{
|
||||||
sendMail(mentor.getObjectId(), player, LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
sendMail(mentor.getObjectId(), player, LEVEL_UP_TITLE, String.format(LEVEL_UP_BODY, player.getName(), player.getLevel()), MENTEE_MARK, amount);
|
||||||
|
@@ -146,7 +146,7 @@ public final class Minigame extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (room.getCurrentPot() < 9)
|
if (room.getCurrentPot() < 9)
|
||||||
{
|
{
|
||||||
L2Npc b = room.getBurners()[room.getOrder()[room.getCurrentPot()]];
|
final L2Npc b = room.getBurners()[room.getOrder()[room.getCurrentPot()]];
|
||||||
b.setDisplayEffect(1);
|
b.setDisplayEffect(1);
|
||||||
b.setIsRunning(false);
|
b.setIsRunning(false);
|
||||||
startQuestTimer("off", 2000, b, null); // Stopping burning each pot 2s after
|
startQuestTimer("off", 2000, b, null); // Stopping burning each pot 2s after
|
||||||
@@ -220,7 +220,7 @@ public final class Minigame extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int attemptNumber = room.getAttemptNumber();
|
final int attemptNumber = room.getAttemptNumber();
|
||||||
|
|
||||||
if (attemptNumber == 2)
|
if (attemptNumber == 2)
|
||||||
{
|
{
|
||||||
@@ -270,7 +270,7 @@ public final class Minigame extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if ((obj != null) && obj.isNpc())
|
if ((obj != null) && obj.isNpc())
|
||||||
{
|
{
|
||||||
L2Npc npc = (L2Npc) obj;
|
final L2Npc npc = (L2Npc) obj;
|
||||||
if (npc.getId() == BURNER)
|
if (npc.getId() == BURNER)
|
||||||
{
|
{
|
||||||
npc.doCast(TRIGGER_MIRAGE.getSkill());
|
npc.doCast(TRIGGER_MIRAGE.getSkill());
|
||||||
|
@@ -100,7 +100,7 @@ public final class MonumentOfHeroes extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
int weaponId = Integer.parseInt(event);
|
final int weaponId = Integer.parseInt(event);
|
||||||
if (Util.contains(WEAPONS, weaponId))
|
if (Util.contains(WEAPONS, weaponId))
|
||||||
{
|
{
|
||||||
giveItems(player, weaponId, 1);
|
giveItems(player, weaponId, 1);
|
||||||
|
@@ -646,7 +646,7 @@ public final class Raina extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
final int currentBaseId = player.getBaseClassId();
|
final int currentBaseId = player.getBaseClassId();
|
||||||
final ClassId baseCID = ClassId.getClassId(currentBaseId);
|
final ClassId baseCID = ClassId.getClassId(currentBaseId);
|
||||||
int baseClassId = (baseCID.level() > 2) ? baseCID.getParent().ordinal() : currentBaseId;
|
final int baseClassId = (baseCID.level() > 2) ? baseCID.getParent().ordinal() : currentBaseId;
|
||||||
|
|
||||||
final Set<PlayerClass> availSubs = getSubclasses(player, baseClassId);
|
final Set<PlayerClass> availSubs = getSubclasses(player, baseClassId);
|
||||||
|
|
||||||
@@ -803,7 +803,7 @@ public final class Raina extends AbstractNpcAI
|
|||||||
subclasses.removeAll(PlayerClass.getSet(Race.KAMAEL, THIRD));
|
subclasses.removeAll(PlayerClass.getSet(Race.KAMAEL, THIRD));
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<PlayerClass> unavailableClasses = subclassSetMap.get(this);
|
final Set<PlayerClass> unavailableClasses = subclassSetMap.get(this);
|
||||||
|
|
||||||
if (unavailableClasses != null)
|
if (unavailableClasses != null)
|
||||||
{
|
{
|
||||||
|
@@ -95,7 +95,7 @@ public final class GrandBossTeleporters extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (valakasAI() != null)
|
if (valakasAI() != null)
|
||||||
{
|
{
|
||||||
int status = GrandBossManager.getInstance().getBossStatus(29028);
|
final int status = GrandBossManager.getInstance().getBossStatus(29028);
|
||||||
|
|
||||||
if ((status == 0) || (status == 1))
|
if ((status == 0) || (status == 1))
|
||||||
{
|
{
|
||||||
@@ -106,7 +106,7 @@ public final class GrandBossTeleporters extends AbstractNpcAI
|
|||||||
else if (st.getInt("allowEnter") == 1)
|
else if (st.getInt("allowEnter") == 1)
|
||||||
{
|
{
|
||||||
st.unset("allowEnter");
|
st.unset("allowEnter");
|
||||||
L2BossZone zone = GrandBossManager.getInstance().getZone(212852, -114842, -1632);
|
final L2BossZone zone = GrandBossManager.getInstance().getZone(212852, -114842, -1632);
|
||||||
|
|
||||||
if (zone != null)
|
if (zone != null)
|
||||||
{
|
{
|
||||||
@@ -119,7 +119,7 @@ public final class GrandBossTeleporters extends AbstractNpcAI
|
|||||||
|
|
||||||
if (status == 0)
|
if (status == 0)
|
||||||
{
|
{
|
||||||
L2GrandBossInstance valakas = GrandBossManager.getInstance().getBoss(29028);
|
final L2GrandBossInstance valakas = GrandBossManager.getInstance().getBoss(29028);
|
||||||
valakasAI().startQuestTimer("beginning", Config.VALAKAS_WAIT_TIME * 60000, valakas, null);
|
valakasAI().startQuestTimer("beginning", Config.VALAKAS_WAIT_TIME * 60000, valakas, null);
|
||||||
GrandBossManager.getInstance().setBossStatus(29028, 1);
|
GrandBossManager.getInstance().setBossStatus(29028, 1);
|
||||||
}
|
}
|
||||||
|
@@ -54,10 +54,10 @@ public final class MithrilMinesTeleporter extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
int index = Integer.parseInt(event) - 1;
|
final int index = Integer.parseInt(event) - 1;
|
||||||
if (LOCS.length > index)
|
if (LOCS.length > index)
|
||||||
{
|
{
|
||||||
Location loc = LOCS[index];
|
final Location loc = LOCS[index];
|
||||||
player.teleToLocation(loc, false);
|
player.teleToLocation(loc, false);
|
||||||
}
|
}
|
||||||
return super.onAdvEvent(event, npc, player);
|
return super.onAdvEvent(event, npc, player);
|
||||||
|
@@ -54,11 +54,11 @@ public final class StakatoNestTeleporter extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
int index = Integer.parseInt(event) - 1;
|
final int index = Integer.parseInt(event) - 1;
|
||||||
|
|
||||||
if (LOCS.length > index)
|
if (LOCS.length > index)
|
||||||
{
|
{
|
||||||
Location loc = LOCS[index];
|
final Location loc = LOCS[index];
|
||||||
|
|
||||||
if (player.getParty() != null)
|
if (player.getParty() != null)
|
||||||
{
|
{
|
||||||
@@ -78,7 +78,7 @@ public final class StakatoNestTeleporter extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onTalk(L2Npc npc, L2PcInstance player)
|
public String onTalk(L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
QuestState accessQuest = player.getQuestState(Q00240_ImTheOnlyOneYouCanTrust.class.getSimpleName());
|
final QuestState accessQuest = player.getQuestState(Q00240_ImTheOnlyOneYouCanTrust.class.getSimpleName());
|
||||||
return (((accessQuest != null) && accessQuest.isCompleted()) ? "32640.htm" : "32640-no.htm");
|
return (((accessQuest != null) && accessQuest.isCompleted()) ? "32640.htm" : "32640-no.htm");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -108,7 +108,7 @@ public final class TeleportToUndergroundColiseum extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else if (Util.isDigit(event))
|
else if (Util.isDigit(event))
|
||||||
{
|
{
|
||||||
int val = Integer.parseInt(event) - 1;
|
final int val = Integer.parseInt(event) - 1;
|
||||||
player.teleToLocation(MANAGERS_LOCS[val][getRandom(MANAGERS_LOCS[val].length)], false);
|
player.teleToLocation(MANAGERS_LOCS[val][getRandom(MANAGERS_LOCS[val].length)], false);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@@ -91,7 +91,7 @@ public final class ToIVortex extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
int npcId = npc.getId();
|
final int npcId = npc.getId();
|
||||||
|
|
||||||
switch (event)
|
switch (event)
|
||||||
{
|
{
|
||||||
|
@@ -56,7 +56,7 @@ public final class Tunatun extends AbstractNpcAI
|
|||||||
return "31537-01.html";
|
return "31537-01.html";
|
||||||
}
|
}
|
||||||
|
|
||||||
QuestState st = player.getQuestState(Q00020_BringUpWithLove.class.getSimpleName());
|
final QuestState st = player.getQuestState(Q00020_BringUpWithLove.class.getSimpleName());
|
||||||
if ((st == null) && (player.getLevel() < MIN_LEVEL))
|
if ((st == null) && (player.getLevel() < MIN_LEVEL))
|
||||||
{
|
{
|
||||||
return "31537-02.html";
|
return "31537-02.html";
|
||||||
|
@@ -164,7 +164,7 @@ public final class WeaverOlf extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (event.contains("_grade_"))
|
if (event.contains("_grade_"))
|
||||||
{
|
{
|
||||||
int grade = Integer.parseInt(event.substring(0, 1));
|
final int grade = Integer.parseInt(event.substring(0, 1));
|
||||||
int price;
|
int price;
|
||||||
int[] itemIds;
|
int[] itemIds;
|
||||||
if (event.endsWith("_pin"))
|
if (event.endsWith("_pin"))
|
||||||
@@ -198,7 +198,7 @@ public final class WeaverOlf extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
takeItems(player, Inventory.ADENA_ID, price);
|
takeItems(player, Inventory.ADENA_ID, price);
|
||||||
takeItems(player, itemIds[0], 1);
|
takeItems(player, itemIds[0], 1);
|
||||||
int rand = getRandom(200);
|
final int rand = getRandom(200);
|
||||||
if (rand <= CHANCES[0])
|
if (rand <= CHANCES[0])
|
||||||
{
|
{
|
||||||
giveItems(player, itemIds[1], 1);
|
giveItems(player, itemIds[1], 1);
|
||||||
|
@@ -172,7 +172,7 @@ public final class WyvernManager extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
case CLAN_HALL:
|
case CLAN_HALL:
|
||||||
{
|
{
|
||||||
SiegableHall hall = npc.getConquerableHall();
|
final SiegableHall hall = npc.getConquerableHall();
|
||||||
return (hall != null) ? hall.isInSiege() : npc.getCastle().getSiege().isInProgress();
|
return (hall != null) ? hall.isInSiege() : npc.getCastle().getSiege().isInProgress();
|
||||||
}
|
}
|
||||||
case FORT:
|
case FORT:
|
||||||
|
@@ -91,7 +91,7 @@ public final class FortressOfResistance extends ClanHallSiegeEngine
|
|||||||
|
|
||||||
private final void buildMessengerMessage()
|
private final void buildMessengerMessage()
|
||||||
{
|
{
|
||||||
String html = HtmCache.getInstance().getHtm(null, "scripts/conquerablehalls/FortressOfResistance/partisan_ordery_brakel001.htm");
|
final String html = HtmCache.getInstance().getHtm(null, "scripts/conquerablehalls/FortressOfResistance/partisan_ordery_brakel001.htm");
|
||||||
if (html != null)
|
if (html != null)
|
||||||
{
|
{
|
||||||
// FIXME: We don't have an object id to put in here :(
|
// FIXME: We don't have an object id to put in here :(
|
||||||
@@ -116,10 +116,10 @@ public final class FortressOfResistance extends ClanHallSiegeEngine
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
int clanId = player.getClanId();
|
final int clanId = player.getClanId();
|
||||||
if (clanId > 0)
|
if (clanId > 0)
|
||||||
{
|
{
|
||||||
long clanDmg = (_damageToNurka.containsKey(clanId)) ? _damageToNurka.get(clanId) + damage : damage;
|
final long clanDmg = (_damageToNurka.containsKey(clanId)) ? _damageToNurka.get(clanId) + damage : damage;
|
||||||
_damageToNurka.put(clanId, clanDmg);
|
_damageToNurka.put(clanId, clanDmg);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -153,7 +153,7 @@ public final class FortressOfResistance extends ClanHallSiegeEngine
|
|||||||
long counter = 0;
|
long counter = 0;
|
||||||
for (Entry<Integer, Long> e : _damageToNurka.entrySet())
|
for (Entry<Integer, Long> e : _damageToNurka.entrySet())
|
||||||
{
|
{
|
||||||
long dam = e.getValue();
|
final long dam = e.getValue();
|
||||||
if (dam > counter)
|
if (dam > counter)
|
||||||
{
|
{
|
||||||
winnerId = e.getKey();
|
winnerId = e.getKey();
|
||||||
|
@@ -155,12 +155,12 @@ public final class FortressOfTheDead extends ClanHallSiegeEngine
|
|||||||
public void startSiege()
|
public void startSiege()
|
||||||
{
|
{
|
||||||
// Siege must start at night
|
// Siege must start at night
|
||||||
int hoursLeft = (GameTimeController.getInstance().getGameTime() / 60) % 24;
|
final int hoursLeft = (GameTimeController.getInstance().getGameTime() / 60) % 24;
|
||||||
|
|
||||||
if ((hoursLeft < 0) || (hoursLeft > 6))
|
if ((hoursLeft < 0) || (hoursLeft > 6))
|
||||||
{
|
{
|
||||||
cancelSiegeTask();
|
cancelSiegeTask();
|
||||||
long scheduleTime = (24 - hoursLeft) * 10 * 60000;
|
final long scheduleTime = (24 - hoursLeft) * 10 * 60000;
|
||||||
_siegeTask = ThreadPoolManager.getInstance().scheduleGeneral(new SiegeStarts(), scheduleTime);
|
_siegeTask = ThreadPoolManager.getInstance().scheduleGeneral(new SiegeStarts(), scheduleTime);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -79,7 +79,7 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
|
|||||||
int spotLeft = 4;
|
int spotLeft = 4;
|
||||||
if (_rainbow.getOwnerId() > 0)
|
if (_rainbow.getOwnerId() > 0)
|
||||||
{
|
{
|
||||||
L2Clan owner = ClanTable.getInstance().getClan(_rainbow.getOwnerId());
|
final L2Clan owner = ClanTable.getInstance().getClan(_rainbow.getOwnerId());
|
||||||
if (owner != null)
|
if (owner != null)
|
||||||
{
|
{
|
||||||
_rainbow.free();
|
_rainbow.free();
|
||||||
@@ -94,7 +94,7 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
|
|||||||
L2Clan clan = null;
|
L2Clan clan = null;
|
||||||
for (int clanId : _warDecreesCount.keySet())
|
for (int clanId : _warDecreesCount.keySet())
|
||||||
{
|
{
|
||||||
L2Clan actingClan = ClanTable.getInstance().getClan(clanId);
|
final L2Clan actingClan = ClanTable.getInstance().getClan(clanId);
|
||||||
if ((actingClan == null) || (actingClan.getDissolvingExpiryTime() > 0))
|
if ((actingClan == null) || (actingClan.getDissolvingExpiryTime() > 0))
|
||||||
{
|
{
|
||||||
_warDecreesCount.remove(clanId);
|
_warDecreesCount.remove(clanId);
|
||||||
@@ -111,7 +111,7 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
|
|||||||
if ((clan != null) && (_acceptedClans.size() < 4))
|
if ((clan != null) && (_acceptedClans.size() < 4))
|
||||||
{
|
{
|
||||||
_acceptedClans.add(clan);
|
_acceptedClans.add(clan);
|
||||||
L2PcInstance leader = clan.getLeader().getPlayerInstance();
|
final L2PcInstance leader = clan.getLeader().getPlayerInstance();
|
||||||
if (leader != null)
|
if (leader != null)
|
||||||
{
|
{
|
||||||
leader.sendMessage("Your clan has been accepted to join the RainBow Srpings Chateau siege!");
|
leader.sendMessage("Your clan has been accepted to join the RainBow Srpings Chateau siege!");
|
||||||
@@ -287,7 +287,7 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
|
|||||||
_rainbow = CHSiegeManager.getInstance().getSiegableHall(RAINBOW_SPRINGS);
|
_rainbow = CHSiegeManager.getInstance().getSiegableHall(RAINBOW_SPRINGS);
|
||||||
if (_rainbow != null)
|
if (_rainbow != null)
|
||||||
{
|
{
|
||||||
long delay = _rainbow.getNextSiegeTime();
|
final long delay = _rainbow.getNextSiegeTime();
|
||||||
if (delay > -1)
|
if (delay > -1)
|
||||||
{
|
{
|
||||||
setRegistrationEndString(delay - 3600000);
|
setRegistrationEndString(delay - 3600000);
|
||||||
@@ -337,10 +337,10 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
L2Clan clan = player.getClan();
|
final L2Clan clan = player.getClan();
|
||||||
if (_acceptedClans.contains(clan))
|
if (_acceptedClans.contains(clan))
|
||||||
{
|
{
|
||||||
int index = _acceptedClans.indexOf(clan);
|
final int index = _acceptedClans.indexOf(clan);
|
||||||
if (npcId == YETIS[index])
|
if (npcId == YETIS[index])
|
||||||
{
|
{
|
||||||
html = "yeti_main.htm";
|
html = "yeti_main.htm";
|
||||||
@@ -393,7 +393,7 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
long count = warDecrees.getCount();
|
final long count = warDecrees.getCount();
|
||||||
_warDecreesCount.put(clan.getId(), count);
|
_warDecreesCount.put(clan.getId(), count);
|
||||||
player.destroyItem("Rainbow Springs Registration", warDecrees, npc, true);
|
player.destroyItem("Rainbow Springs Registration", warDecrees, npc, true);
|
||||||
addAttacker(clan.getId(), count);
|
addAttacker(clan.getId(), count);
|
||||||
@@ -524,7 +524,7 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] split = event.split("_ ");
|
final String[] split = event.split("_ ");
|
||||||
if (split.length < 2)
|
if (split.length < 2)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
@@ -539,7 +539,7 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
|
|||||||
|
|
||||||
if (_usedTextPassages.containsKey(passage))
|
if (_usedTextPassages.containsKey(passage))
|
||||||
{
|
{
|
||||||
ArrayList<L2Clan> list = _usedTextPassages.get(passage);
|
final ArrayList<L2Clan> list = _usedTextPassages.get(passage);
|
||||||
|
|
||||||
if (list.contains(clan))
|
if (list.contains(clan))
|
||||||
{
|
{
|
||||||
@@ -635,14 +635,14 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
L2Object target = player.getTarget();
|
final L2Object target = player.getTarget();
|
||||||
|
|
||||||
if ((target == null) || !(target instanceof L2Npc))
|
if ((target == null) || !(target instanceof L2Npc))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
int yeti = target.getId();
|
final int yeti = target.getId();
|
||||||
if (!isYetiTarget(yeti))
|
if (!isYetiTarget(yeti))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
@@ -744,12 +744,12 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
|
|||||||
|
|
||||||
private static void moveGourds()
|
private static void moveGourds()
|
||||||
{
|
{
|
||||||
L2Spawn[] tempArray = _gourds;
|
final L2Spawn[] tempArray = _gourds;
|
||||||
int iterator = _acceptedClans.size();
|
final int iterator = _acceptedClans.size();
|
||||||
for (int i = 0; i < iterator; i++)
|
for (int i = 0; i < iterator; i++)
|
||||||
{
|
{
|
||||||
L2Spawn oldSpawn = _gourds[(iterator - 1) - i];
|
final L2Spawn oldSpawn = _gourds[(iterator - 1) - i];
|
||||||
L2Spawn curSpawn = tempArray[i];
|
final L2Spawn curSpawn = tempArray[i];
|
||||||
|
|
||||||
_gourds[(iterator - 1) - i] = curSpawn;
|
_gourds[(iterator - 1) - i] = curSpawn;
|
||||||
|
|
||||||
@@ -759,14 +759,14 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
|
|||||||
|
|
||||||
private static void reduceGourdHp(int index, L2PcInstance player)
|
private static void reduceGourdHp(int index, L2PcInstance player)
|
||||||
{
|
{
|
||||||
L2Spawn gourd = _gourds[index];
|
final L2Spawn gourd = _gourds[index];
|
||||||
gourd.getLastSpawn().reduceCurrentHp(1000, player, null);
|
gourd.getLastSpawn().reduceCurrentHp(1000, player, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void increaseGourdHp(int index)
|
private static void increaseGourdHp(int index)
|
||||||
{
|
{
|
||||||
L2Spawn gourd = _gourds[index];
|
final L2Spawn gourd = _gourds[index];
|
||||||
L2Npc gourdNpc = gourd.getLastSpawn();
|
final L2Npc gourdNpc = gourd.getLastSpawn();
|
||||||
gourdNpc.setCurrentHp(gourdNpc.getCurrentHp() + 1000);
|
gourdNpc.setCurrentHp(gourdNpc.getCurrentHp() + 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -795,15 +795,15 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
|
|||||||
|
|
||||||
private static void shoutRandomText(L2Npc npc)
|
private static void shoutRandomText(L2Npc npc)
|
||||||
{
|
{
|
||||||
int length = _textPassages.length;
|
final int length = _textPassages.length;
|
||||||
|
|
||||||
if (_usedTextPassages.size() >= length)
|
if (_usedTextPassages.size() >= length)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int randomPos = getRandom(length);
|
final int randomPos = getRandom(length);
|
||||||
String message = _textPassages[randomPos];
|
final String message = _textPassages[randomPos];
|
||||||
|
|
||||||
if (_usedTextPassages.containsKey(message))
|
if (_usedTextPassages.containsKey(message))
|
||||||
{
|
{
|
||||||
@@ -883,13 +883,13 @@ public final class RainbowSpringsChateau extends ClanHallSiegeEngine
|
|||||||
|
|
||||||
protected static void setRegistrationEndString(long time)
|
protected static void setRegistrationEndString(long time)
|
||||||
{
|
{
|
||||||
Calendar c = Calendar.getInstance();
|
final Calendar c = Calendar.getInstance();
|
||||||
c.setTime(new Date(time));
|
c.setTime(new Date(time));
|
||||||
int year = c.get(Calendar.YEAR);
|
final int year = c.get(Calendar.YEAR);
|
||||||
int month = c.get(Calendar.MONTH) + 1;
|
final int month = c.get(Calendar.MONTH) + 1;
|
||||||
int day = c.get(Calendar.DAY_OF_MONTH);
|
final int day = c.get(Calendar.DAY_OF_MONTH);
|
||||||
int hour = c.get(Calendar.HOUR);
|
final int hour = c.get(Calendar.HOUR);
|
||||||
int mins = c.get(Calendar.MINUTE);
|
final int mins = c.get(Calendar.MINUTE);
|
||||||
|
|
||||||
_registrationEnds = year + "-" + month + "-" + day + " " + hour + (mins < 10 ? ":0" : ":") + mins;
|
_registrationEnds = year + "-" + month + "-" + day + " " + hour + (mins < 10 ? ":0" : ":") + mins;
|
||||||
}
|
}
|
||||||
|
@@ -64,7 +64,7 @@ public final class BanditStronghold extends FlagWar
|
|||||||
FLAG_COORDS[5] = new Location(81981, -15708, -1858, 60392);
|
FLAG_COORDS[5] = new Location(81981, -15708, -1858, 60392);
|
||||||
FLAG_COORDS[6] = new Location(84375, -17060, -1860, 27712);
|
FLAG_COORDS[6] = new Location(84375, -17060, -1860, 27712);
|
||||||
|
|
||||||
Collection<L2ResidenceHallTeleportZone> zoneList = ZoneManager.getInstance().getAllZones(L2ResidenceHallTeleportZone.class);
|
final Collection<L2ResidenceHallTeleportZone> zoneList = ZoneManager.getInstance().getAllZones(L2ResidenceHallTeleportZone.class);
|
||||||
|
|
||||||
for (L2ResidenceHallTeleportZone teleZone : zoneList)
|
for (L2ResidenceHallTeleportZone teleZone : zoneList)
|
||||||
{
|
{
|
||||||
@@ -73,7 +73,7 @@ public final class BanditStronghold extends FlagWar
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
int id = teleZone.getResidenceZoneId();
|
final int id = teleZone.getResidenceZoneId();
|
||||||
|
|
||||||
if ((id < 0) || (id >= 6))
|
if ((id < 0) || (id >= 6))
|
||||||
{
|
{
|
||||||
|
@@ -131,7 +131,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
|
|||||||
{
|
{
|
||||||
if (!checkIsAttacker(player.getClan()))
|
if (!checkIsAttacker(player.getClan()))
|
||||||
{
|
{
|
||||||
L2Clan clan = ClanTable.getInstance().getClan(_hall.getOwnerId());
|
final L2Clan clan = ClanTable.getInstance().getClan(_hall.getOwnerId());
|
||||||
String content = getHtm(player.getHtmlPrefix(), "messenger_initial.htm");
|
String content = getHtm(player.getHtmlPrefix(), "messenger_initial.htm");
|
||||||
content = content.replaceAll("%clanName%", (clan == null) ? "no owner" : clan.getName());
|
content = content.replaceAll("%clanName%", (clan == null) ? "no owner" : clan.getName());
|
||||||
content = content.replaceAll("%objectId%", String.valueOf(npc.getObjectId()));
|
content = content.replaceAll("%objectId%", String.valueOf(npc.getObjectId()));
|
||||||
@@ -144,7 +144,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int index = npc.getId() - TELEPORT_1;
|
final int index = npc.getId() - TELEPORT_1;
|
||||||
if ((index == 0) && _firstPhase)
|
if ((index == 0) && _firstPhase)
|
||||||
{
|
{
|
||||||
html = "teleporter_notyet.htm";
|
html = "teleporter_notyet.htm";
|
||||||
@@ -162,7 +162,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
|
|||||||
public synchronized String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
public synchronized String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
String html = event;
|
String html = event;
|
||||||
L2Clan clan = player.getClan();
|
final L2Clan clan = player.getClan();
|
||||||
|
|
||||||
if (event.startsWith("register_clan")) // Register the clan for the siege
|
if (event.startsWith("register_clan")) // Register the clan for the siege
|
||||||
{
|
{
|
||||||
@@ -196,7 +196,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
String[] arg = event.split(" ");
|
final String[] arg = event.split(" ");
|
||||||
if (arg.length >= 2)
|
if (arg.length >= 2)
|
||||||
{
|
{
|
||||||
// Register passing the quest
|
// Register passing the quest
|
||||||
@@ -241,7 +241,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
String[] var = event.split(" ");
|
final String[] var = event.split(" ");
|
||||||
if (var.length >= 2)
|
if (var.length >= 2)
|
||||||
{
|
{
|
||||||
int id = 0;
|
int id = 0;
|
||||||
@@ -307,7 +307,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ClanData data = _data.get(clan.getId());
|
final ClanData data = _data.get(clan.getId());
|
||||||
data.players.add(player.getObjectId());
|
data.players.add(player.getObjectId());
|
||||||
saveMember(clan.getId(), player.getObjectId());
|
saveMember(clan.getId(), player.getObjectId());
|
||||||
if (data.npc == 0)
|
if (data.npc == 0)
|
||||||
@@ -333,7 +333,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
for (Entry<Integer, ClanData> clanData : _data.entrySet())
|
for (Entry<Integer, ClanData> clanData : _data.entrySet())
|
||||||
{
|
{
|
||||||
L2Clan attacker = ClanTable.getInstance().getClan(clanData.getKey());
|
final L2Clan attacker = ClanTable.getInstance().getClan(clanData.getKey());
|
||||||
if (attacker == null)
|
if (attacker == null)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -454,7 +454,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
|
|||||||
}
|
}
|
||||||
|
|
||||||
_hall.banishForeigners();
|
_hall.banishForeigners();
|
||||||
SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.THE_REGISTRATION_TERM_FOR_S1_HAS_ENDED);
|
final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.THE_REGISTRATION_TERM_FOR_S1_HAS_ENDED);
|
||||||
msg.addString(getName());
|
msg.addString(getName());
|
||||||
Broadcast.toAllOnlinePlayers(msg);
|
Broadcast.toAllOnlinePlayers(msg);
|
||||||
_hall.updateSiegeStatus(SiegeStatus.WAITING_BATTLE);
|
_hall.updateSiegeStatus(SiegeStatus.WAITING_BATTLE);
|
||||||
@@ -470,7 +470,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
|
|||||||
onSiegeEnds();
|
onSiegeEnds();
|
||||||
getAttackers().clear();
|
getAttackers().clear();
|
||||||
_hall.updateNextSiege();
|
_hall.updateNextSiege();
|
||||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_SIEGE_OF_S1_HAS_BEEN_CANCELED_DUE_TO_LACK_OF_INTEREST);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_SIEGE_OF_S1_HAS_BEEN_CANCELED_DUE_TO_LACK_OF_INTEREST);
|
||||||
sm.addString(_hall.getName());
|
sm.addString(_hall.getName());
|
||||||
Broadcast.toAllOnlinePlayers(sm);
|
Broadcast.toAllOnlinePlayers(sm);
|
||||||
return;
|
return;
|
||||||
@@ -485,7 +485,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
|
|||||||
// Teleport owner inside
|
// Teleport owner inside
|
||||||
if (_hall.getOwnerId() > 0)
|
if (_hall.getOwnerId() > 0)
|
||||||
{
|
{
|
||||||
L2Clan owner = ClanTable.getInstance().getClan(_hall.getOwnerId());
|
final L2Clan owner = ClanTable.getInstance().getClan(_hall.getOwnerId());
|
||||||
final Location loc = _hall.getZone().getSpawns().get(0); // Owner restart point
|
final Location loc = _hall.getZone().getSpawns().get(0); // Owner restart point
|
||||||
for (L2ClanMember pc : owner.getMembers())
|
for (L2ClanMember pc : owner.getMembers())
|
||||||
{
|
{
|
||||||
@@ -539,7 +539,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
|
|||||||
// Spawns challengers flags and npcs
|
// Spawns challengers flags and npcs
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ClanData data = clan.getValue();
|
final ClanData data = clan.getValue();
|
||||||
doSpawns(clan.getKey(), data);
|
doSpawns(clan.getKey(), data);
|
||||||
fillPlayerList(data);
|
fillPlayerList(data);
|
||||||
}
|
}
|
||||||
@@ -556,7 +556,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
|
|||||||
{
|
{
|
||||||
if (_hall.getOwnerId() > 0)
|
if (_hall.getOwnerId() > 0)
|
||||||
{
|
{
|
||||||
L2Clan clan = ClanTable.getInstance().getClan(_hall.getOwnerId());
|
final L2Clan clan = ClanTable.getInstance().getClan(_hall.getOwnerId());
|
||||||
clan.setHideoutId(0);
|
clan.setHideoutId(0);
|
||||||
_hall.free();
|
_hall.free();
|
||||||
}
|
}
|
||||||
@@ -593,10 +593,10 @@ public abstract class FlagWar extends ClanHallSiegeEngine
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ClanData cd = _data.get(player.getClanId());
|
final ClanData cd = _data.get(player.getClanId());
|
||||||
if (cd != null)
|
if (cd != null)
|
||||||
{
|
{
|
||||||
int index = cd.flag - FLAG_RED;
|
final int index = cd.flag - FLAG_RED;
|
||||||
if ((index >= 0) && (index <= 4))
|
if ((index >= 0) && (index <= 4))
|
||||||
{
|
{
|
||||||
loc = _hall.getZone().getChallengerSpawns().get(index);
|
loc = _hall.getZone().getChallengerSpawns().get(index);
|
||||||
@@ -635,7 +635,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
|
|||||||
{
|
{
|
||||||
index = clanId == _hall.getOwnerId() ? 5 : 6;
|
index = clanId == _hall.getOwnerId() ? 5 : 6;
|
||||||
}
|
}
|
||||||
Location loc = FLAG_COORDS[index];
|
final Location loc = FLAG_COORDS[index];
|
||||||
|
|
||||||
data.flagInstance = new L2Spawn(data.flag);
|
data.flagInstance = new L2Spawn(data.flag);
|
||||||
data.flagInstance.setLocation(loc);
|
data.flagInstance.setLocation(loc);
|
||||||
@@ -660,7 +660,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
|
|||||||
{
|
{
|
||||||
for (int objId : data.players)
|
for (int objId : data.players)
|
||||||
{
|
{
|
||||||
L2PcInstance plr = L2World.getInstance().getPlayer(objId);
|
final L2PcInstance plr = L2World.getInstance().getPlayer(objId);
|
||||||
if (plr != null)
|
if (plr != null)
|
||||||
{
|
{
|
||||||
data.playersInstance.add(plr);
|
data.playersInstance.add(plr);
|
||||||
@@ -672,10 +672,10 @@ public abstract class FlagWar extends ClanHallSiegeEngine
|
|||||||
{
|
{
|
||||||
final int clanId = clan.getId();
|
final int clanId = clan.getId();
|
||||||
|
|
||||||
L2SiegeClan sc = new L2SiegeClan(clanId, SiegeClanType.ATTACKER);
|
final L2SiegeClan sc = new L2SiegeClan(clanId, SiegeClanType.ATTACKER);
|
||||||
getAttackers().put(clanId, sc);
|
getAttackers().put(clanId, sc);
|
||||||
|
|
||||||
ClanData data = new ClanData();
|
final ClanData data = new ClanData();
|
||||||
data.flag = ROYAL_FLAG + _data.size();
|
data.flag = ROYAL_FLAG + _data.size();
|
||||||
data.players.add(clan.getLeaderId());
|
data.players.add(clan.getLeaderId());
|
||||||
_data.put(clanId, data);
|
_data.put(clanId, data);
|
||||||
@@ -700,7 +700,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
|
|||||||
|
|
||||||
private final void removeParticipant(int clanId, boolean teleport)
|
private final void removeParticipant(int clanId, boolean teleport)
|
||||||
{
|
{
|
||||||
ClanData dat = _data.remove(clanId);
|
final ClanData dat = _data.remove(clanId);
|
||||||
|
|
||||||
if (dat != null)
|
if (dat != null)
|
||||||
{
|
{
|
||||||
@@ -778,7 +778,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClanData data = new ClanData();
|
final ClanData data = new ClanData();
|
||||||
data.flag = rset.getInt("flag");
|
data.flag = rset.getInt("flag");
|
||||||
data.npc = rset.getInt("npc");
|
data.npc = rset.getInt("npc");
|
||||||
|
|
||||||
|
@@ -64,7 +64,7 @@ public final class WildBeastReserve extends FlagWar
|
|||||||
INNER_DOORS_TO_OPEN[0] = 21150001;
|
INNER_DOORS_TO_OPEN[0] = 21150001;
|
||||||
INNER_DOORS_TO_OPEN[1] = 21150002;
|
INNER_DOORS_TO_OPEN[1] = 21150002;
|
||||||
|
|
||||||
Collection<L2ResidenceHallTeleportZone> zoneList = ZoneManager.getInstance().getAllZones(L2ResidenceHallTeleportZone.class);
|
final Collection<L2ResidenceHallTeleportZone> zoneList = ZoneManager.getInstance().getAllZones(L2ResidenceHallTeleportZone.class);
|
||||||
|
|
||||||
for (L2ResidenceHallTeleportZone teleZone : zoneList)
|
for (L2ResidenceHallTeleportZone teleZone : zoneList)
|
||||||
{
|
{
|
||||||
@@ -73,7 +73,7 @@ public final class WildBeastReserve extends FlagWar
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
int id = teleZone.getResidenceZoneId();
|
final int id = teleZone.getResidenceZoneId();
|
||||||
|
|
||||||
if ((id < 0) || (id >= 6))
|
if ((id < 0) || (id >= 6))
|
||||||
{
|
{
|
||||||
|
@@ -65,7 +65,7 @@ public class FactionManager extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (Config.FACTION_BALANCE_ONLINE_PLAYERS && (L2World.getInstance().getAllGoodPlayersCount() >= ((L2World.getInstance().getAllEvilPlayersCount() + Config.FACTION_BALANCE_PLAYER_EXCEED_LIMIT))))
|
if (Config.FACTION_BALANCE_ONLINE_PLAYERS && (L2World.getInstance().getAllGoodPlayersCount() >= ((L2World.getInstance().getAllEvilPlayersCount() + Config.FACTION_BALANCE_PLAYER_EXCEED_LIMIT))))
|
||||||
{
|
{
|
||||||
String htmltext = null;
|
final String htmltext = null;
|
||||||
final NpcHtmlMessage packet = new NpcHtmlMessage(npc.getObjectId());
|
final NpcHtmlMessage packet = new NpcHtmlMessage(npc.getObjectId());
|
||||||
packet.setHtml(getHtm(player.getHtmlPrefix(), "onlinelimit.html"));
|
packet.setHtml(getHtm(player.getHtmlPrefix(), "onlinelimit.html"));
|
||||||
packet.replace("%name%", player.getName());
|
packet.replace("%name%", player.getName());
|
||||||
@@ -92,7 +92,7 @@ public class FactionManager extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (Config.FACTION_BALANCE_ONLINE_PLAYERS && (L2World.getInstance().getAllEvilPlayersCount() >= ((L2World.getInstance().getAllGoodPlayersCount() + Config.FACTION_BALANCE_PLAYER_EXCEED_LIMIT))))
|
if (Config.FACTION_BALANCE_ONLINE_PLAYERS && (L2World.getInstance().getAllEvilPlayersCount() >= ((L2World.getInstance().getAllGoodPlayersCount() + Config.FACTION_BALANCE_PLAYER_EXCEED_LIMIT))))
|
||||||
{
|
{
|
||||||
String htmltext = null;
|
final String htmltext = null;
|
||||||
final NpcHtmlMessage packet = new NpcHtmlMessage(npc.getObjectId());
|
final NpcHtmlMessage packet = new NpcHtmlMessage(npc.getObjectId());
|
||||||
packet.setHtml(getHtm(player.getHtmlPrefix(), "onlinelimit.html"));
|
packet.setHtml(getHtm(player.getHtmlPrefix(), "onlinelimit.html"));
|
||||||
packet.replace("%name%", player.getName());
|
packet.replace("%name%", player.getName());
|
||||||
@@ -130,7 +130,7 @@ public class FactionManager extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
public String onFirstTalk(L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
String htmltext = null;
|
final String htmltext = null;
|
||||||
final NpcHtmlMessage packet = new NpcHtmlMessage(npc.getObjectId());
|
final NpcHtmlMessage packet = new NpcHtmlMessage(npc.getObjectId());
|
||||||
packet.setHtml(getHtm(player.getHtmlPrefix(), "manager.html"));
|
packet.setHtml(getHtm(player.getHtmlPrefix(), "manager.html"));
|
||||||
packet.replace("%name%", player.getName());
|
packet.replace("%name%", player.getName());
|
||||||
|
@@ -55,8 +55,8 @@ public final class ShadowWeapons extends Quest
|
|||||||
public String onTalk(L2Npc npc, L2PcInstance player)
|
public String onTalk(L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
String htmltext;
|
String htmltext;
|
||||||
boolean has_d = hasQuestItems(player, 8869); // Shadow Item Exchange Coupon (D-Grade)
|
final boolean has_d = hasQuestItems(player, 8869); // Shadow Item Exchange Coupon (D-Grade)
|
||||||
boolean has_c = hasQuestItems(player, 8870); // Shadow Item Exchange Coupon (C-Grade)
|
final boolean has_c = hasQuestItems(player, 8870); // Shadow Item Exchange Coupon (C-Grade)
|
||||||
|
|
||||||
if (has_d || has_c)
|
if (has_d || has_c)
|
||||||
{
|
{
|
||||||
|
@@ -98,10 +98,10 @@ public final class Elpies extends Event
|
|||||||
|
|
||||||
EVENT_ACTIVE = true;
|
EVENT_ACTIVE = true;
|
||||||
|
|
||||||
EventLocation[] locations = EventLocation.values();
|
final EventLocation[] locations = EventLocation.values();
|
||||||
EventLocation randomLoc = locations[getRandom(locations.length)];
|
final EventLocation randomLoc = locations[getRandom(locations.length)];
|
||||||
|
|
||||||
long despawnDelay = EVENT_DURATION_MINUTES * 60000;
|
final long despawnDelay = EVENT_DURATION_MINUTES * 60000;
|
||||||
|
|
||||||
for (int i = 0; i < ELPY_AMOUNT; i++)
|
for (int i = 0; i < ELPY_AMOUNT; i++)
|
||||||
{
|
{
|
||||||
|
@@ -159,7 +159,7 @@ public final class Race extends Event
|
|||||||
// Announce
|
// Announce
|
||||||
Broadcast.toAllOnlinePlayers("Race started!");
|
Broadcast.toAllOnlinePlayers("Race started!");
|
||||||
// Get random Finish
|
// Get random Finish
|
||||||
int location = getRandom(0, _locations.length - 1);
|
final int location = getRandom(0, _locations.length - 1);
|
||||||
_randspawn = _coords[location];
|
_randspawn = _coords[location];
|
||||||
// And spawn NPC
|
// And spawn NPC
|
||||||
recordSpawn(_stop_npc, _randspawn[0], _randspawn[1], _randspawn[2], _randspawn[3], false, 0);
|
recordSpawn(_stop_npc, _randspawn[0], _randspawn[1], _randspawn[2], _randspawn[3], false, 0);
|
||||||
@@ -238,8 +238,8 @@ public final class Race extends Event
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int _number = Integer.valueOf(bypass.substring(5));
|
final int _number = Integer.valueOf(bypass.substring(5));
|
||||||
Skill _sk = SkillData.getInstance().getSkill(_number, 1);
|
final Skill _sk = SkillData.getInstance().getSkill(_number, 1);
|
||||||
if (_sk != null)
|
if (_sk != null)
|
||||||
{
|
{
|
||||||
_skill = _number;
|
_skill = _number;
|
||||||
@@ -271,8 +271,8 @@ public final class Race extends Event
|
|||||||
@Override
|
@Override
|
||||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
String htmltext = event;
|
final String htmltext = event;
|
||||||
QuestState st = getQuestState(player, false);
|
final QuestState st = getQuestState(player, false);
|
||||||
if (st == null)
|
if (st == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
@@ -380,7 +380,7 @@ public final class Race extends Event
|
|||||||
private void showMenu(L2PcInstance activeChar)
|
private void showMenu(L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
final NpcHtmlMessage html = new NpcHtmlMessage();
|
final NpcHtmlMessage html = new NpcHtmlMessage();
|
||||||
String content = getHtm(activeChar.getHtmlPrefix(), "admin_menu.htm");
|
final String content = getHtm(activeChar.getHtmlPrefix(), "admin_menu.htm");
|
||||||
html.setHtml(content);
|
html.setHtml(content);
|
||||||
activeChar.sendPacket(html);
|
activeChar.sendPacket(html);
|
||||||
}
|
}
|
||||||
@@ -393,7 +393,7 @@ public final class Race extends Event
|
|||||||
|
|
||||||
private void winRace(L2PcInstance player)
|
private void winRace(L2PcInstance player)
|
||||||
{
|
{
|
||||||
int[] _reward = _rewards[getRandom(_rewards.length - 1)];
|
final int[] _reward = _rewards[getRandom(_rewards.length - 1)];
|
||||||
player.addItem("eventModRace", _reward[0], _reward[1], _npc, true);
|
player.addItem("eventModRace", _reward[0], _reward[1], _npc, true);
|
||||||
Broadcast.toAllOnlinePlayers(player.getName() + " is a winner!");
|
Broadcast.toAllOnlinePlayers(player.getName() + " is a winner!");
|
||||||
eventStop();
|
eventStop();
|
||||||
|
@@ -70,7 +70,7 @@ public final class TvTManager extends AbstractNpcAI implements IVoicedCommandHan
|
|||||||
{
|
{
|
||||||
case "join":
|
case "join":
|
||||||
{
|
{
|
||||||
int playerLevel = player.getLevel();
|
final int playerLevel = player.getLevel();
|
||||||
final int team1Count = TvTEvent.getTeamsPlayerCounts()[0];
|
final int team1Count = TvTEvent.getTeamsPlayerCounts()[0];
|
||||||
final int team2Count = TvTEvent.getTeamsPlayerCounts()[1];
|
final int team2Count = TvTEvent.getTeamsPlayerCounts()[1];
|
||||||
if (player.isCursedWeaponEquipped())
|
if (player.isCursedWeaponEquipped())
|
||||||
@@ -139,7 +139,7 @@ public final class TvTManager extends AbstractNpcAI implements IVoicedCommandHan
|
|||||||
if (TvTEvent.isParticipating())
|
if (TvTEvent.isParticipating())
|
||||||
{
|
{
|
||||||
final boolean isParticipant = TvTEvent.isPlayerParticipant(player.getObjectId());
|
final boolean isParticipant = TvTEvent.isPlayerParticipant(player.getObjectId());
|
||||||
int[] teamsPlayerCounts = TvTEvent.getTeamsPlayerCounts();
|
final int[] teamsPlayerCounts = TvTEvent.getTeamsPlayerCounts();
|
||||||
htmltext = getHtm(player.getHtmlPrefix(), (!isParticipant ? "Participation.html" : "RemoveParticipation.html"));
|
htmltext = getHtm(player.getHtmlPrefix(), (!isParticipant ? "Participation.html" : "RemoveParticipation.html"));
|
||||||
htmltext = htmltext.replaceAll("%objectId%", String.valueOf(npc.getObjectId()));
|
htmltext = htmltext.replaceAll("%objectId%", String.valueOf(npc.getObjectId()));
|
||||||
htmltext = htmltext.replaceAll("%team1name%", Config.TVT_EVENT_TEAM_1_NAME);
|
htmltext = htmltext.replaceAll("%team1name%", Config.TVT_EVENT_TEAM_1_NAME);
|
||||||
@@ -199,8 +199,8 @@ public final class TvTManager extends AbstractNpcAI implements IVoicedCommandHan
|
|||||||
|
|
||||||
private String getTvTStatus(L2PcInstance player)
|
private String getTvTStatus(L2PcInstance player)
|
||||||
{
|
{
|
||||||
int[] teamsPlayerCounts = TvTEvent.getTeamsPlayerCounts();
|
final int[] teamsPlayerCounts = TvTEvent.getTeamsPlayerCounts();
|
||||||
int[] teamsPointsCounts = TvTEvent.getTeamsPoints();
|
final int[] teamsPointsCounts = TvTEvent.getTeamsPoints();
|
||||||
String htmltext = getHtm(player.getHtmlPrefix(), "Status.html");
|
String htmltext = getHtm(player.getHtmlPrefix(), "Status.html");
|
||||||
htmltext = htmltext.replaceAll("%team1name%", Config.TVT_EVENT_TEAM_1_NAME);
|
htmltext = htmltext.replaceAll("%team1name%", Config.TVT_EVENT_TEAM_1_NAME);
|
||||||
htmltext = htmltext.replaceAll("%team1playercount%", String.valueOf(teamsPlayerCounts[0]));
|
htmltext = htmltext.replaceAll("%team1playercount%", String.valueOf(teamsPlayerCounts[0]));
|
||||||
|
@@ -130,7 +130,7 @@ public final class Wedding extends AbstractNpcAI
|
|||||||
|
|
||||||
// Accept the wedding request
|
// Accept the wedding request
|
||||||
player.setMarryAccepted(true);
|
player.setMarryAccepted(true);
|
||||||
Couple couple = CoupleManager.getInstance().getCouple(player.getCoupleId());
|
final Couple couple = CoupleManager.getInstance().getCouple(player.getCoupleId());
|
||||||
couple.marry();
|
couple.marry();
|
||||||
|
|
||||||
// Messages to the couple
|
// Messages to the couple
|
||||||
@@ -146,7 +146,7 @@ public final class Wedding extends AbstractNpcAI
|
|||||||
partner.broadcastPacket(new MagicSkillUse(partner, partner, 2230, 1, 1, 0));
|
partner.broadcastPacket(new MagicSkillUse(partner, partner, 2230, 1, 1, 0));
|
||||||
|
|
||||||
// Fireworks
|
// Fireworks
|
||||||
Skill skill = CommonSkill.LARGE_FIREWORK.getSkill();
|
final Skill skill = CommonSkill.LARGE_FIREWORK.getSkill();
|
||||||
if (skill != null)
|
if (skill != null)
|
||||||
{
|
{
|
||||||
player.doCast(skill);
|
player.doCast(skill);
|
||||||
|
@@ -106,7 +106,7 @@ public final class CharacterBirthday extends Quest
|
|||||||
|
|
||||||
if (!Util.checkIfInRange(10, npc, player, true))
|
if (!Util.checkIfInRange(10, npc, player, true))
|
||||||
{
|
{
|
||||||
L2Npc spawned = addSpawn(32600, player.getX() + 10, player.getY() + 10, player.getZ() + 10, 0, false, 0, true);
|
final L2Npc spawned = addSpawn(32600, player.getX() + 10, player.getY() + 10, player.getZ() + 10, 0, false, 0, true);
|
||||||
startQuestTimer("despawn_npc", 180000, spawned, player);
|
startQuestTimer("despawn_npc", 180000, spawned, player);
|
||||||
SPAWNS++;
|
SPAWNS++;
|
||||||
}
|
}
|
||||||
|
@@ -81,9 +81,9 @@ public final class FreyaCelebration extends LongTimeEvent
|
|||||||
{
|
{
|
||||||
if (getQuestItemsCount(player, Inventory.ADENA_ID) > 1)
|
if (getQuestItemsCount(player, Inventory.ADENA_ID) > 1)
|
||||||
{
|
{
|
||||||
long _curr_time = System.currentTimeMillis();
|
final long _curr_time = System.currentTimeMillis();
|
||||||
String value = loadGlobalQuestVar(player.getAccountName());
|
final String value = loadGlobalQuestVar(player.getAccountName());
|
||||||
long _reuse_time = value == "" ? 0 : Long.parseLong(value);
|
final long _reuse_time = value == "" ? 0 : Long.parseLong(value);
|
||||||
|
|
||||||
if (_curr_time > _reuse_time)
|
if (_curr_time > _reuse_time)
|
||||||
{
|
{
|
||||||
@@ -93,10 +93,10 @@ public final class FreyaCelebration extends LongTimeEvent
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
long remainingTime = (_reuse_time - System.currentTimeMillis()) / 1000;
|
final long remainingTime = (_reuse_time - System.currentTimeMillis()) / 1000;
|
||||||
int hours = (int) (remainingTime / 3600);
|
final int hours = (int) (remainingTime / 3600);
|
||||||
int minutes = (int) ((remainingTime % 3600) / 60);
|
final int minutes = (int) ((remainingTime % 3600) / 60);
|
||||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
|
||||||
sm.addItemName(FREYA_POTION);
|
sm.addItemName(FREYA_POTION);
|
||||||
sm.addInt(hours);
|
sm.addInt(hours);
|
||||||
sm.addInt(minutes);
|
sm.addInt(minutes);
|
||||||
@@ -105,7 +105,7 @@ public final class FreyaCelebration extends LongTimeEvent
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_NEED_S2_S1_S);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_NEED_S2_S1_S);
|
||||||
sm.addItemName(Inventory.ADENA_ID);
|
sm.addItemName(Inventory.ADENA_ID);
|
||||||
sm.addInt(1);
|
sm.addInt(1);
|
||||||
player.sendPacket(sm);
|
player.sendPacket(sm);
|
||||||
@@ -126,7 +126,7 @@ public final class FreyaCelebration extends LongTimeEvent
|
|||||||
{
|
{
|
||||||
if (getRandom(100) < 5)
|
if (getRandom(100) < 5)
|
||||||
{
|
{
|
||||||
CreatureSay cs = new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), NpcStringId.DEAR_S1_THINK_OF_THIS_AS_MY_APPRECIATION_FOR_THE_GIFT_TAKE_THIS_WITH_YOU_THERE_S_NOTHING_STRANGE_ABOUT_IT_IT_S_JUST_A_BIT_OF_MY_CAPRICIOUSNESS);
|
final CreatureSay cs = new CreatureSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getName(), NpcStringId.DEAR_S1_THINK_OF_THIS_AS_MY_APPRECIATION_FOR_THE_GIFT_TAKE_THIS_WITH_YOU_THERE_S_NOTHING_STRANGE_ABOUT_IT_IT_S_JUST_A_BIT_OF_MY_CAPRICIOUSNESS);
|
||||||
cs.addStringParameter(caster.getName());
|
cs.addStringParameter(caster.getName());
|
||||||
|
|
||||||
npc.broadcastPacket(cs);
|
npc.broadcastPacket(cs);
|
||||||
|
@@ -98,10 +98,10 @@ public final class GiftOfVitality extends LongTimeEvent
|
|||||||
final long reuse = player.getVariables().getLong(REUSE, 0);
|
final long reuse = player.getVariables().getLong(REUSE, 0);
|
||||||
if (reuse > System.currentTimeMillis())
|
if (reuse > System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
|
final long remainingTime = (reuse - System.currentTimeMillis()) / 1000;
|
||||||
int hours = (int) (remainingTime / 3600);
|
final int hours = (int) (remainingTime / 3600);
|
||||||
int minutes = (int) ((remainingTime % 3600) / 60);
|
final int minutes = (int) ((remainingTime % 3600) / 60);
|
||||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_WILL_BE_AVAILABLE_FOR_RE_USE_AFTER_S2_HOUR_S_S3_MINUTE_S);
|
||||||
sm.addSkillName(23179);
|
sm.addSkillName(23179);
|
||||||
sm.addInt(hours);
|
sm.addInt(hours);
|
||||||
sm.addInt(minutes);
|
sm.addInt(minutes);
|
||||||
|
@@ -94,9 +94,9 @@ public final class MasterOfEnchanting extends LongTimeEvent
|
|||||||
}
|
}
|
||||||
else if (event.equalsIgnoreCase("buy_scroll_24"))
|
else if (event.equalsIgnoreCase("buy_scroll_24"))
|
||||||
{
|
{
|
||||||
long curTime = System.currentTimeMillis();
|
final long curTime = System.currentTimeMillis();
|
||||||
String value = loadGlobalQuestVar(player.getAccountName());
|
final String value = loadGlobalQuestVar(player.getAccountName());
|
||||||
long reuse = value == "" ? 0 : Long.parseLong(value);
|
final long reuse = value == "" ? 0 : Long.parseLong(value);
|
||||||
if (player.getCreateDate().after(EVENT_START))
|
if (player.getCreateDate().after(EVENT_START))
|
||||||
{
|
{
|
||||||
return "32599-bidth.htm";
|
return "32599-bidth.htm";
|
||||||
@@ -118,12 +118,12 @@ public final class MasterOfEnchanting extends LongTimeEvent
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
long remainingTime = (reuse - curTime) / 1000;
|
final long remainingTime = (reuse - curTime) / 1000;
|
||||||
int hours = (int) remainingTime / 3600;
|
final int hours = (int) remainingTime / 3600;
|
||||||
int minutes = ((int) remainingTime % 3600) / 60;
|
final int minutes = ((int) remainingTime % 3600) / 60;
|
||||||
if (hours > 0)
|
if (hours > 0)
|
||||||
{
|
{
|
||||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THERE_ARE_S1_HOUR_S_AND_S2_MINUTE_S_REMAINING_UNTIL_THE_ITEM_CAN_BE_PURCHASED_AGAIN);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THERE_ARE_S1_HOUR_S_AND_S2_MINUTE_S_REMAINING_UNTIL_THE_ITEM_CAN_BE_PURCHASED_AGAIN);
|
||||||
sm.addInt(hours);
|
sm.addInt(hours);
|
||||||
sm.addInt(minutes);
|
sm.addInt(minutes);
|
||||||
player.sendPacket(sm);
|
player.sendPacket(sm);
|
||||||
@@ -131,7 +131,7 @@ public final class MasterOfEnchanting extends LongTimeEvent
|
|||||||
}
|
}
|
||||||
else if (minutes > 0)
|
else if (minutes > 0)
|
||||||
{
|
{
|
||||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THERE_ARE_S1_MINUTE_S_REMAINING_UNTIL_THE_ITEM_CAN_BE_PURCHASED_AGAIN);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THERE_ARE_S1_MINUTE_S_REMAINING_UNTIL_THE_ITEM_CAN_BE_PURCHASED_AGAIN);
|
||||||
sm.addInt(minutes);
|
sm.addInt(minutes);
|
||||||
player.sendPacket(sm);
|
player.sendPacket(sm);
|
||||||
htmltext = "32599-scroll24.htm";
|
htmltext = "32599-scroll24.htm";
|
||||||
|
@@ -130,7 +130,7 @@ public class EnergySeeds extends AbstractNpcAI
|
|||||||
|
|
||||||
if (_spawnedNpcs.containsKey(npc) && SPAWNS.containsKey(_spawnedNpcs.get(npc)))
|
if (_spawnedNpcs.containsKey(npc) && SPAWNS.containsKey(_spawnedNpcs.get(npc)))
|
||||||
{
|
{
|
||||||
ESSpawn spawn = SPAWNS.get(_spawnedNpcs.get(npc));
|
final ESSpawn spawn = SPAWNS.get(_spawnedNpcs.get(npc));
|
||||||
spawn.scheduleRespawn(RESPAWN + getRandom(RANDOM_RESPAWN_OFFSET));
|
spawn.scheduleRespawn(RESPAWN + getRandom(RANDOM_RESPAWN_OFFSET));
|
||||||
_spawnedNpcs.remove(npc);
|
_spawnedNpcs.remove(npc);
|
||||||
if (isSeedActive(spawn._seedId))
|
if (isSeedActive(spawn._seedId))
|
||||||
@@ -184,7 +184,7 @@ public class EnergySeeds extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
for (int doorId : SEED_OF_DESTRUCTION_DOORS)
|
for (int doorId : SEED_OF_DESTRUCTION_DOORS)
|
||||||
{
|
{
|
||||||
L2DoorInstance doorInstance = DoorData.getInstance().getDoor(doorId);
|
final L2DoorInstance doorInstance = DoorData.getInstance().getDoor(doorId);
|
||||||
if (doorInstance != null)
|
if (doorInstance != null)
|
||||||
{
|
{
|
||||||
doorInstance.openMe();
|
doorInstance.openMe();
|
||||||
@@ -196,7 +196,7 @@ public class EnergySeeds extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
for (int doorId : SEED_OF_DESTRUCTION_DOORS)
|
for (int doorId : SEED_OF_DESTRUCTION_DOORS)
|
||||||
{
|
{
|
||||||
L2DoorInstance doorInstance = DoorData.getInstance().getDoor(doorId);
|
final L2DoorInstance doorInstance = DoorData.getInstance().getDoor(doorId);
|
||||||
if (doorInstance != null)
|
if (doorInstance != null)
|
||||||
{
|
{
|
||||||
doorInstance.closeMe();
|
doorInstance.closeMe();
|
||||||
@@ -316,7 +316,7 @@ public class EnergySeeds extends AbstractNpcAI
|
|||||||
case ANNIHILATION_BISTAKON:
|
case ANNIHILATION_BISTAKON:
|
||||||
if (getRandom(100) < 50)
|
if (getRandom(100) < 50)
|
||||||
{
|
{
|
||||||
L2MonsterInstance mob = spawnSupriseMob(seedEnergy, ANNIHILATION_SUPRISE_MOB_IDS[0][getRandom(ANNIHILATION_SUPRISE_MOB_IDS[0].length)]);
|
final L2MonsterInstance mob = spawnSupriseMob(seedEnergy, ANNIHILATION_SUPRISE_MOB_IDS[0][getRandom(ANNIHILATION_SUPRISE_MOB_IDS[0].length)]);
|
||||||
mob.setRunning();
|
mob.setRunning();
|
||||||
mob.addDamageHate(player, 0, 999);
|
mob.addDamageHate(player, 0, 999);
|
||||||
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||||
@@ -325,7 +325,7 @@ public class EnergySeeds extends AbstractNpcAI
|
|||||||
case ANNIHILATION_REPTILIKON:
|
case ANNIHILATION_REPTILIKON:
|
||||||
if (getRandom(100) < 50)
|
if (getRandom(100) < 50)
|
||||||
{
|
{
|
||||||
L2MonsterInstance mob = spawnSupriseMob(seedEnergy, ANNIHILATION_SUPRISE_MOB_IDS[1][getRandom(ANNIHILATION_SUPRISE_MOB_IDS[1].length)]);
|
final L2MonsterInstance mob = spawnSupriseMob(seedEnergy, ANNIHILATION_SUPRISE_MOB_IDS[1][getRandom(ANNIHILATION_SUPRISE_MOB_IDS[1].length)]);
|
||||||
mob.setRunning();
|
mob.setRunning();
|
||||||
mob.addDamageHate(player, 0, 999);
|
mob.addDamageHate(player, 0, 999);
|
||||||
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||||
@@ -334,7 +334,7 @@ public class EnergySeeds extends AbstractNpcAI
|
|||||||
case ANNIHILATION_COKRAKON:
|
case ANNIHILATION_COKRAKON:
|
||||||
if (getRandom(100) < 50)
|
if (getRandom(100) < 50)
|
||||||
{
|
{
|
||||||
L2MonsterInstance mob = spawnSupriseMob(seedEnergy, ANNIHILATION_SUPRISE_MOB_IDS[2][getRandom(ANNIHILATION_SUPRISE_MOB_IDS[2].length)]);
|
final L2MonsterInstance mob = spawnSupriseMob(seedEnergy, ANNIHILATION_SUPRISE_MOB_IDS[2][getRandom(ANNIHILATION_SUPRISE_MOB_IDS[2].length)]);
|
||||||
mob.setRunning();
|
mob.setRunning();
|
||||||
mob.addDamageHate(player, 0, 999);
|
mob.addDamageHate(player, 0, 999);
|
||||||
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||||
@@ -345,8 +345,8 @@ public class EnergySeeds extends AbstractNpcAI
|
|||||||
|
|
||||||
private L2MonsterInstance spawnSupriseMob(L2Npc energy, int npcId)
|
private L2MonsterInstance spawnSupriseMob(L2Npc energy, int npcId)
|
||||||
{
|
{
|
||||||
L2NpcTemplate surpriseMobTemplate = NpcData.getInstance().getTemplate(npcId);
|
final L2NpcTemplate surpriseMobTemplate = NpcData.getInstance().getTemplate(npcId);
|
||||||
L2MonsterInstance monster = new L2MonsterInstance(surpriseMobTemplate);
|
final L2MonsterInstance monster = new L2MonsterInstance(surpriseMobTemplate);
|
||||||
monster.setCurrentHpMp(monster.getMaxHp(), monster.getMaxMp());
|
monster.setCurrentHpMp(monster.getMaxHp(), monster.getMaxMp());
|
||||||
monster.setHeading(energy.getHeading());
|
monster.setHeading(energy.getHeading());
|
||||||
monster.setInstanceId(energy.getInstanceId());
|
monster.setInstanceId(energy.getInstanceId());
|
||||||
@@ -717,7 +717,7 @@ public class EnergySeeds extends AbstractNpcAI
|
|||||||
if (isSeedActive(_seedId))
|
if (isSeedActive(_seedId))
|
||||||
{
|
{
|
||||||
// get a random NPC that should spawn at this location
|
// get a random NPC that should spawn at this location
|
||||||
Integer spawnId = _spawnId; // the map uses "Integer", not "int"
|
final Integer spawnId = _spawnId; // the map uses "Integer", not "int"
|
||||||
_spawnedNpcs.put(addSpawn(_npcIds[getRandom(_npcIds.length)], _loc, false, 0), spawnId);
|
_spawnedNpcs.put(addSpawn(_npcIds[getRandom(_npcIds.length)], _loc, false, 0), spawnId);
|
||||||
}
|
}
|
||||||
}, waitTime);
|
}, waitTime);
|
||||||
|
@@ -102,13 +102,13 @@ public class Lindvior extends AbstractNpcAI
|
|||||||
|
|
||||||
public void scheduleNextLindviorVisit()
|
public void scheduleNextLindviorVisit()
|
||||||
{
|
{
|
||||||
long delay = (ALT_MODE) ? ALT_MODE_MIN * 60000 : scheduleNextLindviorDate();
|
final long delay = (ALT_MODE) ? ALT_MODE_MIN * 60000 : scheduleNextLindviorDate();
|
||||||
startQuestTimer("start", delay, null, null);
|
startQuestTimer("start", delay, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long scheduleNextLindviorDate()
|
protected long scheduleNextLindviorDate()
|
||||||
{
|
{
|
||||||
GregorianCalendar date = new GregorianCalendar();
|
final GregorianCalendar date = new GregorianCalendar();
|
||||||
date.set(Calendar.MINUTE, RESET_MIN);
|
date.set(Calendar.MINUTE, RESET_MIN);
|
||||||
date.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
|
date.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
|
||||||
if (System.currentTimeMillis() >= date.getTimeInMillis())
|
if (System.currentTimeMillis() >= date.getTimeInMillis())
|
||||||
@@ -116,7 +116,7 @@ public class Lindvior extends AbstractNpcAI
|
|||||||
date.add(Calendar.DAY_OF_WEEK, 1);
|
date.add(Calendar.DAY_OF_WEEK, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int dayOfWeek = date.get(Calendar.DAY_OF_WEEK);
|
final int dayOfWeek = date.get(Calendar.DAY_OF_WEEK);
|
||||||
if (dayOfWeek <= RESET_DAY_1)
|
if (dayOfWeek <= RESET_DAY_1)
|
||||||
{
|
{
|
||||||
date.add(Calendar.DAY_OF_WEEK, RESET_DAY_1 - dayOfWeek);
|
date.add(Calendar.DAY_OF_WEEK, RESET_DAY_1 - dayOfWeek);
|
||||||
|
@@ -82,7 +82,7 @@ public final class GeneralDilios extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else if (event.startsWith("guard_animation_"))
|
else if (event.startsWith("guard_animation_"))
|
||||||
{
|
{
|
||||||
int value = Integer.parseInt(event.substring(16));
|
final int value = Integer.parseInt(event.substring(16));
|
||||||
for (L2Spawn guard : _guards)
|
for (L2Spawn guard : _guards)
|
||||||
{
|
{
|
||||||
guard.getLastSpawn().broadcastSocialAction(4);
|
guard.getLastSpawn().broadcastSocialAction(4);
|
||||||
|
@@ -228,7 +228,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
|
|||||||
});
|
});
|
||||||
|
|
||||||
int buffsNow = 0;
|
int buffsNow = 0;
|
||||||
String var = loadGlobalQuestVar("SeedNextStatusChange");
|
final String var = loadGlobalQuestVar("SeedNextStatusChange");
|
||||||
if (var.equalsIgnoreCase("") || (Long.parseLong(var) < System.currentTimeMillis()))
|
if (var.equalsIgnoreCase("") || (Long.parseLong(var) < System.currentTimeMillis()))
|
||||||
{
|
{
|
||||||
buffsNow = getRandom(ZONE_BUFFS_LIST.length);
|
buffsNow = getRandom(ZONE_BUFFS_LIST.length);
|
||||||
@@ -249,7 +249,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
|
|||||||
|
|
||||||
private Long getNextSeedsStatusChangeTime()
|
private Long getNextSeedsStatusChangeTime()
|
||||||
{
|
{
|
||||||
Calendar reenter = Calendar.getInstance();
|
final Calendar reenter = Calendar.getInstance();
|
||||||
reenter.set(Calendar.SECOND, 0);
|
reenter.set(Calendar.SECOND, 0);
|
||||||
reenter.set(Calendar.MINUTE, 0);
|
reenter.set(Calendar.MINUTE, 0);
|
||||||
reenter.set(Calendar.HOUR_OF_DAY, 13);
|
reenter.set(Calendar.HOUR_OF_DAY, 13);
|
||||||
@@ -301,7 +301,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (event.equalsIgnoreCase("ChangeSeedsStatus"))
|
if (event.equalsIgnoreCase("ChangeSeedsStatus"))
|
||||||
{
|
{
|
||||||
int buffsNow = getRandom(ZONE_BUFFS_LIST.length);
|
final int buffsNow = getRandom(ZONE_BUFFS_LIST.length);
|
||||||
saveGlobalQuestVar("SeedBuffsList", String.valueOf(buffsNow));
|
saveGlobalQuestVar("SeedBuffsList", String.valueOf(buffsNow));
|
||||||
_seedsNextStatusChange = getNextSeedsStatusChangeTime();
|
_seedsNextStatusChange = getNextSeedsStatusChangeTime();
|
||||||
saveGlobalQuestVar("SeedNextStatusChange", String.valueOf(_seedsNextStatusChange));
|
saveGlobalQuestVar("SeedNextStatusChange", String.valueOf(_seedsNextStatusChange));
|
||||||
@@ -314,7 +314,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
|
|||||||
af.setDisplayEffect(_regionsData[i].activeBuff);
|
af.setDisplayEffect(_regionsData[i].activeBuff);
|
||||||
}
|
}
|
||||||
|
|
||||||
L2EffectZone zone = ZoneManager.getInstance().getZoneById(_regionsData[i].buff_zone, L2EffectZone.class);
|
final L2EffectZone zone = ZoneManager.getInstance().getZoneById(_regionsData[i].buff_zone, L2EffectZone.class);
|
||||||
zone.clearSkills();
|
zone.clearSkills();
|
||||||
zone.addSkill(ZONE_BUFFS[_regionsData[i].activeBuff], 1);
|
zone.addSkill(ZONE_BUFFS[_regionsData[i].activeBuff], 1);
|
||||||
}
|
}
|
||||||
@@ -342,7 +342,7 @@ public class SeedOfAnnihilation extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (TELEPORT_ZONES.containsKey(zone.getId()))
|
if (TELEPORT_ZONES.containsKey(zone.getId()))
|
||||||
{
|
{
|
||||||
Location teleLoc = TELEPORT_ZONES.get(zone.getId());
|
final Location teleLoc = TELEPORT_ZONES.get(zone.getId());
|
||||||
character.teleToLocation(teleLoc, false);
|
character.teleToLocation(teleLoc, false);
|
||||||
}
|
}
|
||||||
return super.onEnterZone(character, zone);
|
return super.onEnterZone(character, zone);
|
||||||
|
@@ -83,7 +83,7 @@ public final class SecretArea extends Quest
|
|||||||
@Override
|
@Override
|
||||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
String htmltext = getNoQuestMsg(player);
|
final String htmltext = getNoQuestMsg(player);
|
||||||
if ((npc.getId() == GINBY) && event.equalsIgnoreCase("enter"))
|
if ((npc.getId() == GINBY) && event.equalsIgnoreCase("enter"))
|
||||||
{
|
{
|
||||||
enterInstance(player);
|
enterInstance(player);
|
||||||
|
@@ -249,19 +249,19 @@ public final class Stage1 extends Quest
|
|||||||
int spawnCount = 0;
|
int spawnCount = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||||
factory.setValidating(false);
|
factory.setValidating(false);
|
||||||
factory.setIgnoringComments(true);
|
factory.setIgnoringComments(true);
|
||||||
|
|
||||||
File file = new File(Config.DATAPACK_ROOT + "/spawnZones/seed_of_destruction.xml");
|
final File file = new File(Config.DATAPACK_ROOT + "/spawnZones/seed_of_destruction.xml");
|
||||||
if (!file.exists())
|
if (!file.exists())
|
||||||
{
|
{
|
||||||
_log.severe("[Seed of Destruction] Missing seed_of_destruction.xml. The quest wont work without it!");
|
_log.severe("[Seed of Destruction] Missing seed_of_destruction.xml. The quest wont work without it!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Document doc = factory.newDocumentBuilder().parse(file);
|
final Document doc = factory.newDocumentBuilder().parse(file);
|
||||||
Node first = doc.getFirstChild();
|
final Node first = doc.getFirstChild();
|
||||||
if ((first != null) && "list".equalsIgnoreCase(first.getNodeName()))
|
if ((first != null) && "list".equalsIgnoreCase(first.getNodeName()))
|
||||||
{
|
{
|
||||||
for (Node n = first.getFirstChild(); n != null; n = n.getNextSibling())
|
for (Node n = first.getFirstChild(); n != null; n = n.getNextSibling())
|
||||||
@@ -279,7 +279,7 @@ public final class Stage1 extends Quest
|
|||||||
_log.severe("[Seed of Destruction] Missing npcId in npc List, skipping");
|
_log.severe("[Seed of Destruction] Missing npcId in npc List, skipping");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int npcId = Integer.parseInt(attrs.getNamedItem("npcId").getNodeValue());
|
final int npcId = Integer.parseInt(attrs.getNamedItem("npcId").getNodeValue());
|
||||||
|
|
||||||
att = attrs.getNamedItem("flag");
|
att = attrs.getNamedItem("flag");
|
||||||
if (att == null)
|
if (att == null)
|
||||||
@@ -287,7 +287,7 @@ public final class Stage1 extends Quest
|
|||||||
_log.severe("[Seed of Destruction] Missing flag in npc List npcId: " + npcId + ", skipping");
|
_log.severe("[Seed of Destruction] Missing flag in npc List npcId: " + npcId + ", skipping");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int flag = Integer.parseInt(attrs.getNamedItem("flag").getNodeValue());
|
final int flag = Integer.parseInt(attrs.getNamedItem("flag").getNodeValue());
|
||||||
if (!_spawnList.containsKey(flag))
|
if (!_spawnList.containsKey(flag))
|
||||||
{
|
{
|
||||||
_spawnList.put(flag, new ArrayList<SODSpawn>());
|
_spawnList.put(flag, new ArrayList<SODSpawn>());
|
||||||
@@ -298,7 +298,7 @@ public final class Stage1 extends Quest
|
|||||||
if ("loc".equalsIgnoreCase(cd.getNodeName()))
|
if ("loc".equalsIgnoreCase(cd.getNodeName()))
|
||||||
{
|
{
|
||||||
attrs = cd.getAttributes();
|
attrs = cd.getAttributes();
|
||||||
SODSpawn spw = new SODSpawn();
|
final SODSpawn spw = new SODSpawn();
|
||||||
spw.npcId = npcId;
|
spw.npcId = npcId;
|
||||||
|
|
||||||
att = attrs.getNamedItem("x");
|
att = attrs.getNamedItem("x");
|
||||||
@@ -352,7 +352,7 @@ public final class Stage1 extends Quest
|
|||||||
else if ("zone".equalsIgnoreCase(cd.getNodeName()))
|
else if ("zone".equalsIgnoreCase(cd.getNodeName()))
|
||||||
{
|
{
|
||||||
attrs = cd.getAttributes();
|
attrs = cd.getAttributes();
|
||||||
SODSpawn spw = new SODSpawn();
|
final SODSpawn spw = new SODSpawn();
|
||||||
spw.npcId = npcId;
|
spw.npcId = npcId;
|
||||||
spw.isZone = true;
|
spw.isZone = true;
|
||||||
|
|
||||||
@@ -403,22 +403,22 @@ public final class Stage1 extends Quest
|
|||||||
_log.severe("[Seed of Destruction] Missing id in spawnZones List, skipping");
|
_log.severe("[Seed of Destruction] Missing id in spawnZones List, skipping");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int id = Integer.parseInt(att.getNodeValue());
|
final int id = Integer.parseInt(att.getNodeValue());
|
||||||
att = attrs.getNamedItem("minZ");
|
att = attrs.getNamedItem("minZ");
|
||||||
if (att == null)
|
if (att == null)
|
||||||
{
|
{
|
||||||
_log.severe("[Seed of Destruction] Missing minZ in spawnZones List id: " + id + ", skipping");
|
_log.severe("[Seed of Destruction] Missing minZ in spawnZones List id: " + id + ", skipping");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int minz = Integer.parseInt(att.getNodeValue());
|
final int minz = Integer.parseInt(att.getNodeValue());
|
||||||
att = attrs.getNamedItem("maxZ");
|
att = attrs.getNamedItem("maxZ");
|
||||||
if (att == null)
|
if (att == null)
|
||||||
{
|
{
|
||||||
_log.severe("[Seed of Destruction] Missing maxZ in spawnZones List id: " + id + ", skipping");
|
_log.severe("[Seed of Destruction] Missing maxZ in spawnZones List id: " + id + ", skipping");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int maxz = Integer.parseInt(att.getNodeValue());
|
final int maxz = Integer.parseInt(att.getNodeValue());
|
||||||
L2Territory ter = new L2Territory(id);
|
final L2Territory ter = new L2Territory(id);
|
||||||
|
|
||||||
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
|
for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
|
||||||
{
|
{
|
||||||
@@ -495,22 +495,22 @@ public final class Stage1 extends Quest
|
|||||||
{
|
{
|
||||||
if (partyMember.getLevel() < 75)
|
if (partyMember.getLevel() < 75)
|
||||||
{
|
{
|
||||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_S_LEVEL_DOES_NOT_CORRESPOND_TO_THE_REQUIREMENTS_FOR_ENTRY);
|
||||||
sm.addPcName(partyMember);
|
sm.addPcName(partyMember);
|
||||||
party.broadcastPacket(sm);
|
party.broadcastPacket(sm);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!Util.checkIfInRange(1000, player, partyMember, true))
|
if (!Util.checkIfInRange(1000, player, partyMember, true))
|
||||||
{
|
{
|
||||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_A_LOCATION_WHICH_CANNOT_BE_ENTERED_THEREFORE_IT_CANNOT_BE_PROCESSED);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_A_LOCATION_WHICH_CANNOT_BE_ENTERED_THEREFORE_IT_CANNOT_BE_PROCESSED);
|
||||||
sm.addPcName(partyMember);
|
sm.addPcName(partyMember);
|
||||||
party.broadcastPacket(sm);
|
party.broadcastPacket(sm);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Long reentertime = InstanceManager.getInstance().getInstanceTime(partyMember.getObjectId(), INSTANCEID);
|
final Long reentertime = InstanceManager.getInstance().getInstanceTime(partyMember.getObjectId(), INSTANCEID);
|
||||||
if (System.currentTimeMillis() < reentertime)
|
if (System.currentTimeMillis() < reentertime)
|
||||||
{
|
{
|
||||||
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);
|
||||||
party.broadcastPacket(sm);
|
party.broadcastPacket(sm);
|
||||||
return false;
|
return false;
|
||||||
@@ -640,7 +640,7 @@ public final class Stage1 extends Quest
|
|||||||
spawnFlaggedNPCs(world, 0);
|
spawnFlaggedNPCs(world, 0);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
ExShowScreenMessage message1 = new ExShowScreenMessage(NpcStringId.THE_ENEMIES_HAVE_ATTACKED_EVERYONE_COME_OUT_AND_FIGHT_URGH, 5, 1);
|
final ExShowScreenMessage message1 = new ExShowScreenMessage(NpcStringId.THE_ENEMIES_HAVE_ATTACKED_EVERYONE_COME_OUT_AND_FIGHT_URGH, 5, 1);
|
||||||
sendScreenMessage(world, message1);
|
sendScreenMessage(world, message1);
|
||||||
for (int i : ENTRANCE_ROOM_DOORS)
|
for (int i : ENTRANCE_ROOM_DOORS)
|
||||||
{
|
{
|
||||||
@@ -653,7 +653,7 @@ public final class Stage1 extends Quest
|
|||||||
// handled elsewhere
|
// handled elsewhere
|
||||||
return true;
|
return true;
|
||||||
case 4:
|
case 4:
|
||||||
ExShowScreenMessage message2 = new ExShowScreenMessage(NpcStringId.OBELISK_HAS_COLLAPSED_DON_T_LET_THE_ENEMIES_JUMP_AROUND_WILDLY_ANYMORE, 5, 1);
|
final ExShowScreenMessage message2 = new ExShowScreenMessage(NpcStringId.OBELISK_HAS_COLLAPSED_DON_T_LET_THE_ENEMIES_JUMP_AROUND_WILDLY_ANYMORE, 5, 1);
|
||||||
sendScreenMessage(world, message2);
|
sendScreenMessage(world, message2);
|
||||||
for (int i : SQUARE_DOORS)
|
for (int i : SQUARE_DOORS)
|
||||||
{
|
{
|
||||||
@@ -673,7 +673,7 @@ public final class Stage1 extends Quest
|
|||||||
spawnFlaggedNPCs(world, 7);
|
spawnFlaggedNPCs(world, 7);
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
ExShowScreenMessage message4 = new ExShowScreenMessage(NpcStringId.COME_OUT_WARRIORS_PROTECT_SEED_OF_DESTRUCTION, 5, 1);
|
final ExShowScreenMessage message4 = new ExShowScreenMessage(NpcStringId.COME_OUT_WARRIORS_PROTECT_SEED_OF_DESTRUCTION, 5, 1);
|
||||||
sendScreenMessage(world, message4);
|
sendScreenMessage(world, message4);
|
||||||
world.deviceSpawnedMobCount = 0;
|
world.deviceSpawnedMobCount = 0;
|
||||||
spawnFlaggedNPCs(world, 8);
|
spawnFlaggedNPCs(world, 8);
|
||||||
@@ -718,7 +718,7 @@ public final class Stage1 extends Quest
|
|||||||
addTrap(npcId, x, y, z, h, skill, world.getInstanceId());
|
addTrap(npcId, x, y, z, h, skill, world.getInstanceId());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
L2Npc npc = addSpawn(npcId, x, y, z, h, false, 0, false, world.getInstanceId());
|
final L2Npc npc = addSpawn(npcId, x, y, z, h, false, 0, false, world.getInstanceId());
|
||||||
if (addToKillTable)
|
if (addToKillTable)
|
||||||
{
|
{
|
||||||
world.npcList.put(npc, false);
|
world.npcList.put(npc, false);
|
||||||
@@ -748,7 +748,7 @@ public final class Stage1 extends Quest
|
|||||||
|
|
||||||
protected void setInstanceTimeRestrictions(SOD1World world)
|
protected void setInstanceTimeRestrictions(SOD1World world)
|
||||||
{
|
{
|
||||||
Calendar reenter = Calendar.getInstance();
|
final Calendar reenter = Calendar.getInstance();
|
||||||
reenter.set(Calendar.MINUTE, RESET_MIN);
|
reenter.set(Calendar.MINUTE, RESET_MIN);
|
||||||
reenter.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
|
reenter.set(Calendar.HOUR_OF_DAY, RESET_HOUR);
|
||||||
// if time is >= RESET_HOUR - roll to the next day
|
// if time is >= RESET_HOUR - roll to the next day
|
||||||
@@ -771,13 +771,13 @@ public final class Stage1 extends Quest
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.INSTANT_ZONE_S1_S_ENTRY_HAS_BEEN_RESTRICTED_YOU_CAN_CHECK_THE_NEXT_POSSIBLE_ENTRY_TIME_BY_USING_THE_COMMAND_INSTANCEZONE);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.INSTANT_ZONE_S1_S_ENTRY_HAS_BEEN_RESTRICTED_YOU_CAN_CHECK_THE_NEXT_POSSIBLE_ENTRY_TIME_BY_USING_THE_COMMAND_INSTANCEZONE);
|
||||||
sm.addInstanceName(INSTANCEID);
|
sm.addInstanceName(INSTANCEID);
|
||||||
|
|
||||||
// set instance reenter time for all allowed players
|
// set instance reenter time for all allowed players
|
||||||
for (int objectId : world.getAllowed())
|
for (int objectId : world.getAllowed())
|
||||||
{
|
{
|
||||||
L2PcInstance player = L2World.getInstance().getPlayer(objectId);
|
final L2PcInstance player = L2World.getInstance().getPlayer(objectId);
|
||||||
InstanceManager.getInstance().setInstanceTime(objectId, INSTANCEID, reenter.getTimeInMillis());
|
InstanceManager.getInstance().setInstanceTime(objectId, INSTANCEID, reenter.getTimeInMillis());
|
||||||
if ((player != null) && player.isOnline())
|
if ((player != null) && player.isOnline())
|
||||||
{
|
{
|
||||||
@@ -790,7 +790,7 @@ public final class Stage1 extends Quest
|
|||||||
{
|
{
|
||||||
for (int objId : world.getAllowed())
|
for (int objId : world.getAllowed())
|
||||||
{
|
{
|
||||||
L2PcInstance player = L2World.getInstance().getPlayer(objId);
|
final L2PcInstance player = L2World.getInstance().getPlayer(objId);
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
player.sendPacket(message);
|
player.sendPacket(message);
|
||||||
@@ -817,17 +817,17 @@ public final class Stage1 extends Quest
|
|||||||
{
|
{
|
||||||
if (!isSummon && (player != null))
|
if (!isSummon && (player != null))
|
||||||
{
|
{
|
||||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(player.getInstanceId());
|
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(player.getInstanceId());
|
||||||
if (tmpworld instanceof SOD1World)
|
if (tmpworld instanceof SOD1World)
|
||||||
{
|
{
|
||||||
SOD1World world = (SOD1World) tmpworld;
|
final SOD1World world = (SOD1World) tmpworld;
|
||||||
if (world.getStatus() == 7)
|
if (world.getStatus() == 7)
|
||||||
{
|
{
|
||||||
if (spawnState(world))
|
if (spawnState(world))
|
||||||
{
|
{
|
||||||
for (int objId : world.getAllowed())
|
for (int objId : world.getAllowed())
|
||||||
{
|
{
|
||||||
L2PcInstance pl = L2World.getInstance().getPlayer(objId);
|
final L2PcInstance pl = L2World.getInstance().getPlayer(objId);
|
||||||
if (pl != null)
|
if (pl != null)
|
||||||
{
|
{
|
||||||
pl.showQuestMovie(5);
|
pl.showQuestMovie(5);
|
||||||
@@ -844,10 +844,10 @@ public final class Stage1 extends Quest
|
|||||||
@Override
|
@Override
|
||||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon, Skill skill)
|
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon, Skill skill)
|
||||||
{
|
{
|
||||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||||
if (tmpworld instanceof SOD1World)
|
if (tmpworld instanceof SOD1World)
|
||||||
{
|
{
|
||||||
SOD1World world = (SOD1World) tmpworld;
|
final SOD1World world = (SOD1World) tmpworld;
|
||||||
if ((world.getStatus() == 2) && (npc.getId() == OBELISK))
|
if ((world.getStatus() == 2) && (npc.getId() == OBELISK))
|
||||||
{
|
{
|
||||||
world.setStatus(4);
|
world.setStatus(4);
|
||||||
@@ -876,16 +876,16 @@ public final class Stage1 extends Quest
|
|||||||
@Override
|
@Override
|
||||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||||
if (tmpworld instanceof SOD1World)
|
if (tmpworld instanceof SOD1World)
|
||||||
{
|
{
|
||||||
SOD1World world = (SOD1World) tmpworld;
|
final SOD1World world = (SOD1World) tmpworld;
|
||||||
if (event.equalsIgnoreCase("Spawn"))
|
if (event.equalsIgnoreCase("Spawn"))
|
||||||
{
|
{
|
||||||
L2PcInstance target = L2World.getInstance().getPlayer(world.getAllowed().get(getRandom(world.getAllowed().size())));
|
final L2PcInstance target = L2World.getInstance().getPlayer(world.getAllowed().get(getRandom(world.getAllowed().size())));
|
||||||
if ((world.deviceSpawnedMobCount < MAX_DEVICESPAWNEDMOBCOUNT) && (target != null) && (target.getInstanceId() == npc.getInstanceId()) && !target.isDead())
|
if ((world.deviceSpawnedMobCount < MAX_DEVICESPAWNEDMOBCOUNT) && (target != null) && (target.getInstanceId() == npc.getInstanceId()) && !target.isDead())
|
||||||
{
|
{
|
||||||
L2Attackable mob = (L2Attackable) addSpawn(SPAWN_MOB_IDS[getRandom(SPAWN_MOB_IDS.length)], npc.getSpawn().getLocation(), false, 0, false, world.getInstanceId());
|
final L2Attackable mob = (L2Attackable) addSpawn(SPAWN_MOB_IDS[getRandom(SPAWN_MOB_IDS.length)], npc.getSpawn().getLocation(), false, 0, false, world.getInstanceId());
|
||||||
world.deviceSpawnedMobCount++;
|
world.deviceSpawnedMobCount++;
|
||||||
mob.setSeeThroughSilentMove(true);
|
mob.setSeeThroughSilentMove(true);
|
||||||
mob.setRunning();
|
mob.setRunning();
|
||||||
@@ -901,12 +901,12 @@ public final class Stage1 extends Quest
|
|||||||
}
|
}
|
||||||
else if (event.equalsIgnoreCase("DoorCheck"))
|
else if (event.equalsIgnoreCase("DoorCheck"))
|
||||||
{
|
{
|
||||||
L2DoorInstance tmp = getDoor(FORTRESS_DOOR, npc.getInstanceId());
|
final L2DoorInstance tmp = getDoor(FORTRESS_DOOR, npc.getInstanceId());
|
||||||
if (tmp.getCurrentHp() < tmp.getMaxHp())
|
if (tmp.getCurrentHp() < tmp.getMaxHp())
|
||||||
{
|
{
|
||||||
world.deviceSpawnedMobCount = 0;
|
world.deviceSpawnedMobCount = 0;
|
||||||
spawnFlaggedNPCs(world, 6);
|
spawnFlaggedNPCs(world, 6);
|
||||||
ExShowScreenMessage message3 = new ExShowScreenMessage(NpcStringId.ENEMIES_ARE_TRYING_TO_DESTROY_THE_FORTRESS_EVERYONE_DEFEND_THE_FORTRESS, 5, 1);
|
final ExShowScreenMessage message3 = new ExShowScreenMessage(NpcStringId.ENEMIES_ARE_TRYING_TO_DESTROY_THE_FORTRESS_EVERYONE_DEFEND_THE_FORTRESS, 5, 1);
|
||||||
sendScreenMessage(world, message3);
|
sendScreenMessage(world, message3);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -926,7 +926,7 @@ public final class Stage1 extends Quest
|
|||||||
L2Character mostHate = ((L2Attackable) npc).getMostHated();
|
L2Character mostHate = ((L2Attackable) npc).getMostHated();
|
||||||
if (mostHate != null)
|
if (mostHate != null)
|
||||||
{
|
{
|
||||||
double dist = Util.calculateDistance(mostHate.getXdestination(), mostHate.getYdestination(), 0, npc.getSpawn().getX(), npc.getSpawn().getY(), 0, false, false);
|
final double dist = Util.calculateDistance(mostHate.getXdestination(), mostHate.getYdestination(), 0, npc.getSpawn().getX(), npc.getSpawn().getY(), 0, false, false);
|
||||||
if (dist > 900)
|
if (dist > 900)
|
||||||
{
|
{
|
||||||
((L2Attackable) npc).reduceHate(mostHate, ((L2Attackable) npc).getHating(mostHate));
|
((L2Attackable) npc).reduceHate(mostHate, ((L2Attackable) npc).getHating(mostHate));
|
||||||
@@ -950,10 +950,10 @@ public final class Stage1 extends Quest
|
|||||||
cancelQuestTimer("Spawn", npc, null);
|
cancelQuestTimer("Spawn", npc, null);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||||
if (tmpworld instanceof SOD1World)
|
if (tmpworld instanceof SOD1World)
|
||||||
{
|
{
|
||||||
SOD1World world = (SOD1World) tmpworld;
|
final SOD1World world = (SOD1World) tmpworld;
|
||||||
if (world.getStatus() == 1)
|
if (world.getStatus() == 1)
|
||||||
{
|
{
|
||||||
if (checkKillProgress(npc, world))
|
if (checkKillProgress(npc, world))
|
||||||
@@ -993,7 +993,7 @@ public final class Stage1 extends Quest
|
|||||||
world.incStatus();
|
world.incStatus();
|
||||||
for (int objId : world.getAllowed())
|
for (int objId : world.getAllowed())
|
||||||
{
|
{
|
||||||
L2PcInstance pl = L2World.getInstance().getPlayer(objId);
|
final L2PcInstance pl = L2World.getInstance().getPlayer(objId);
|
||||||
if (pl != null)
|
if (pl != null)
|
||||||
{
|
{
|
||||||
pl.showQuestMovie(6);
|
pl.showQuestMovie(6);
|
||||||
@@ -1018,11 +1018,11 @@ public final class Stage1 extends Quest
|
|||||||
@Override
|
@Override
|
||||||
public String onTalk(L2Npc npc, L2PcInstance player)
|
public String onTalk(L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
int npcId = npc.getId();
|
final int npcId = npc.getId();
|
||||||
getQuestState(player, true);
|
getQuestState(player, true);
|
||||||
if (npcId == ALENOS)
|
if (npcId == ALENOS)
|
||||||
{
|
{
|
||||||
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
||||||
if ((GraciaSeedsManager.getInstance().getSoDState() == 1) || ((world != null) && (world instanceof SOD1World)))
|
if ((GraciaSeedsManager.getInstance().getSoDState() == 1) || ((world != null) && (world instanceof SOD1World)))
|
||||||
{
|
{
|
||||||
enterInstance(player, "SeedOfDestructionStage1.xml", ENTER_TELEPORT_1);
|
enterInstance(player, "SeedOfDestructionStage1.xml", ENTER_TELEPORT_1);
|
||||||
@@ -1042,10 +1042,10 @@ public final class Stage1 extends Quest
|
|||||||
@Override
|
@Override
|
||||||
public String onTrapAction(L2TrapInstance trap, L2Character trigger, TrapAction action)
|
public String onTrapAction(L2TrapInstance trap, L2Character trigger, TrapAction action)
|
||||||
{
|
{
|
||||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(trap.getInstanceId());
|
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(trap.getInstanceId());
|
||||||
if (tmpworld instanceof SOD1World)
|
if (tmpworld instanceof SOD1World)
|
||||||
{
|
{
|
||||||
SOD1World world = (SOD1World) tmpworld;
|
final SOD1World world = (SOD1World) tmpworld;
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case TRAP_TRIGGERED:
|
case TRAP_TRIGGERED:
|
||||||
|
@@ -266,7 +266,7 @@ public final class HallOfSuffering extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
L2Party party = player.getParty();
|
final L2Party party = player.getParty();
|
||||||
final int instanceId = InstanceManager.getInstance().createDynamicInstance(template);
|
final int instanceId = InstanceManager.getInstance().createDynamicInstance(template);
|
||||||
world = new HSWorld();
|
world = new HSWorld();
|
||||||
world.setInstanceId(instanceId);
|
world.setInstanceId(instanceId);
|
||||||
@@ -394,7 +394,7 @@ public final class HallOfSuffering extends AbstractNpcAI
|
|||||||
|
|
||||||
private void calcRewardItemId(HSWorld world)
|
private void calcRewardItemId(HSWorld world)
|
||||||
{
|
{
|
||||||
Long finishDiff = System.currentTimeMillis() - world.startTime;
|
final Long finishDiff = System.currentTimeMillis() - world.startTime;
|
||||||
if (finishDiff < 1260000)
|
if (finishDiff < 1260000)
|
||||||
{
|
{
|
||||||
world.rewardHtm = "32530-00.htm";
|
world.rewardHtm = "32530-00.htm";
|
||||||
@@ -472,10 +472,10 @@ public final class HallOfSuffering extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||||
{
|
{
|
||||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||||
if (tmpworld instanceof HSWorld)
|
if (tmpworld instanceof HSWorld)
|
||||||
{
|
{
|
||||||
HSWorld world = (HSWorld) tmpworld;
|
final HSWorld world = (HSWorld) tmpworld;
|
||||||
if (event.equalsIgnoreCase("spawnBossGuards"))
|
if (event.equalsIgnoreCase("spawnBossGuards"))
|
||||||
{
|
{
|
||||||
if (!world.klanikus.isInCombat() && !world.klodekus.isInCombat())
|
if (!world.klanikus.isInCombat() && !world.klodekus.isInCombat())
|
||||||
@@ -508,14 +508,14 @@ public final class HallOfSuffering extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else if (event.equalsIgnoreCase("ressurectTwin"))
|
else if (event.equalsIgnoreCase("ressurectTwin"))
|
||||||
{
|
{
|
||||||
Skill skill = SkillData.getInstance().getSkill(5824, 1);
|
final Skill skill = SkillData.getInstance().getSkill(5824, 1);
|
||||||
L2Npc aliveTwin = (world.klanikus == npc ? world.klodekus : world.klanikus);
|
final L2Npc aliveTwin = (world.klanikus == npc ? world.klodekus : world.klanikus);
|
||||||
npc.doRevive();
|
npc.doRevive();
|
||||||
npc.doCast(skill);
|
npc.doCast(skill);
|
||||||
npc.setCurrentHp(aliveTwin.getCurrentHp());
|
npc.setCurrentHp(aliveTwin.getCurrentHp());
|
||||||
|
|
||||||
// get most hated of other boss
|
// get most hated of other boss
|
||||||
L2Character hated = ((L2MonsterInstance) aliveTwin).getMostHated();
|
final L2Character hated = ((L2MonsterInstance) aliveTwin).getMostHated();
|
||||||
if (hated != null)
|
if (hated != null)
|
||||||
{
|
{
|
||||||
npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, hated, 1000);
|
npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, hated, 1000);
|
||||||
@@ -542,16 +542,16 @@ public final class HallOfSuffering extends AbstractNpcAI
|
|||||||
if (!world.isBossesAttacked)
|
if (!world.isBossesAttacked)
|
||||||
{
|
{
|
||||||
world.isBossesAttacked = true;
|
world.isBossesAttacked = true;
|
||||||
Calendar reenter = Calendar.getInstance();
|
final Calendar reenter = Calendar.getInstance();
|
||||||
reenter.add(Calendar.HOUR, INSTANCE_PENALTY);
|
reenter.add(Calendar.HOUR, INSTANCE_PENALTY);
|
||||||
|
|
||||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.INSTANT_ZONE_S1_S_ENTRY_HAS_BEEN_RESTRICTED_YOU_CAN_CHECK_THE_NEXT_POSSIBLE_ENTRY_TIME_BY_USING_THE_COMMAND_INSTANCEZONE);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.INSTANT_ZONE_S1_S_ENTRY_HAS_BEEN_RESTRICTED_YOU_CAN_CHECK_THE_NEXT_POSSIBLE_ENTRY_TIME_BY_USING_THE_COMMAND_INSTANCEZONE);
|
||||||
sm.addInstanceName(tmpworld.getTemplateId());
|
sm.addInstanceName(tmpworld.getTemplateId());
|
||||||
|
|
||||||
// set instance reenter time for all allowed players
|
// set instance reenter time for all allowed players
|
||||||
for (int objectId : tmpworld.getAllowed())
|
for (int objectId : tmpworld.getAllowed())
|
||||||
{
|
{
|
||||||
L2PcInstance player = L2World.getInstance().getPlayer(objectId);
|
final L2PcInstance player = L2World.getInstance().getPlayer(objectId);
|
||||||
if ((player != null) && player.isOnline())
|
if ((player != null) && player.isOnline())
|
||||||
{
|
{
|
||||||
InstanceManager.getInstance().setInstanceTime(objectId, tmpworld.getTemplateId(), reenter.getTimeInMillis());
|
InstanceManager.getInstance().setInstanceTime(objectId, tmpworld.getTemplateId(), reenter.getTimeInMillis());
|
||||||
@@ -588,10 +588,10 @@ public final class HallOfSuffering extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
||||||
{
|
{
|
||||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
final InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||||
if (tmpworld instanceof HSWorld)
|
if (tmpworld instanceof HSWorld)
|
||||||
{
|
{
|
||||||
HSWorld world = (HSWorld) tmpworld;
|
final HSWorld world = (HSWorld) tmpworld;
|
||||||
|
|
||||||
if (npc.getId() == TUMOR_ALIVE)
|
if (npc.getId() == TUMOR_ALIVE)
|
||||||
{
|
{
|
||||||
@@ -635,7 +635,7 @@ public final class HallOfSuffering extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (npc.getId() == TEPIOS)
|
if (npc.getId() == TEPIOS)
|
||||||
{
|
{
|
||||||
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
|
||||||
if (((HSWorld) world).rewardItemId == -1)
|
if (((HSWorld) world).rewardItemId == -1)
|
||||||
{
|
{
|
||||||
_log.warning("Hall of Suffering: " + player.getName() + "(" + player.getObjectId() + ") is try to cheat!");
|
_log.warning("Hall of Suffering: " + player.getName() + "(" + player.getObjectId() + ") is try to cheat!");
|
||||||
@@ -665,7 +665,7 @@ public final class HallOfSuffering extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else if (npc.getId() == TEPIOS)
|
else if (npc.getId() == TEPIOS)
|
||||||
{
|
{
|
||||||
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(talker);
|
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(talker);
|
||||||
if (((HSWorld) world).rewardItemId == -1)
|
if (((HSWorld) world).rewardItemId == -1)
|
||||||
{
|
{
|
||||||
_log.warning("Hall of Suffering: " + talker.getName() + "(" + talker.getObjectId() + ") is try to cheat!");
|
_log.warning("Hall of Suffering: " + talker.getName() + "(" + talker.getObjectId() + ") is try to cheat!");
|
||||||
|
@@ -140,7 +140,7 @@ public abstract class AirShipController extends Quest
|
|||||||
player.sendPacket(SystemMessageId.AIRSHIP_SUMMON_LICENSE_REGISTRATION_CAN_ONLY_BE_DONE_BY_THE_CLAN_LEADER);
|
player.sendPacket(SystemMessageId.AIRSHIP_SUMMON_LICENSE_REGISTRATION_CAN_ONLY_BE_DONE_BY_THE_CLAN_LEADER);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
int ownerId = player.getClanId();
|
final int ownerId = player.getClanId();
|
||||||
if (!AirShipManager.getInstance().hasAirShipLicense(ownerId))
|
if (!AirShipManager.getInstance().hasAirShipLicense(ownerId))
|
||||||
{
|
{
|
||||||
player.sendPacket(SystemMessageId.AN_AIRSHIP_CANNOT_BE_SUMMONED_BECAUSE_EITHER_YOU_HAVE_NOT_REGISTERED_YOUR_AIRSHIP_LICENSE_OR_THE_AIRSHIP_HAS_NOT_YET_BEEN_SUMMONED);
|
player.sendPacket(SystemMessageId.AN_AIRSHIP_CANNOT_BE_SUMMONED_BECAUSE_EITHER_YOU_HAVE_NOT_REGISTERED_YOUR_AIRSHIP_LICENSE_OR_THE_AIRSHIP_HAS_NOT_YET_BEEN_SUMMONED);
|
||||||
@@ -349,7 +349,7 @@ public abstract class AirShipController extends Quest
|
|||||||
|
|
||||||
protected void validityCheck()
|
protected void validityCheck()
|
||||||
{
|
{
|
||||||
L2ScriptZone zone = ZoneManager.getInstance().getZoneById(_dockZone, L2ScriptZone.class);
|
final L2ScriptZone zone = ZoneManager.getInstance().getZoneById(_dockZone, L2ScriptZone.class);
|
||||||
if (zone == null)
|
if (zone == null)
|
||||||
{
|
{
|
||||||
_log.log(Level.WARNING, getName() + ": Invalid zone " + _dockZone + ", controller disabled");
|
_log.log(Level.WARNING, getName() + ": Invalid zone " + _dockZone + ", controller disabled");
|
||||||
|
@@ -598,7 +598,7 @@ public class MasterHandler
|
|||||||
{
|
{
|
||||||
_log.log(Level.INFO, "Loading Handlers...");
|
_log.log(Level.INFO, "Loading Handlers...");
|
||||||
|
|
||||||
Map<IHandler<?, ?>, Method> registerHandlerMethods = new HashMap<>();
|
final Map<IHandler<?, ?>, Method> registerHandlerMethods = new HashMap<>();
|
||||||
for (IHandler<?, ?> loadInstance : LOAD_INSTANCES)
|
for (IHandler<?, ?> loadInstance : LOAD_INSTANCES)
|
||||||
{
|
{
|
||||||
registerHandlerMethods.put(loadInstance, null);
|
registerHandlerMethods.put(loadInstance, null);
|
||||||
@@ -627,7 +627,7 @@ public class MasterHandler
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Object handler = c.newInstance();
|
final Object handler = c.newInstance();
|
||||||
for (Entry<IHandler<?, ?>, Method> entry : registerHandlerMethods.entrySet())
|
for (Entry<IHandler<?, ?>, Method> entry : registerHandlerMethods.entrySet())
|
||||||
{
|
{
|
||||||
if ((entry.getValue() != null) && entry.getValue().getParameterTypes()[0].isInstance(handler))
|
if ((entry.getValue() != null) && entry.getValue().getParameterTypes()[0].isInstance(handler))
|
||||||
|
@@ -42,7 +42,7 @@ public class L2DoorInstanceAction implements IActionHandler
|
|||||||
}
|
}
|
||||||
else if (interact)
|
else if (interact)
|
||||||
{
|
{
|
||||||
L2DoorInstance door = (L2DoorInstance) target;
|
final L2DoorInstance door = (L2DoorInstance) target;
|
||||||
// MyTargetSelected my = new MyTargetSelected(getObjectId(), activeChar.getLevel());
|
// MyTargetSelected my = new MyTargetSelected(getObjectId(), activeChar.getLevel());
|
||||||
// activeChar.sendPacket(my);
|
// activeChar.sendPacket(my);
|
||||||
if (target.isAutoAttackable(activeChar))
|
if (target.isAutoAttackable(activeChar))
|
||||||
|
@@ -44,7 +44,7 @@ public class L2PetInstanceAction implements IActionHandler
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isOwner = activeChar.getObjectId() == ((L2PetInstance) target).getOwner().getObjectId();
|
final boolean isOwner = activeChar.getObjectId() == ((L2PetInstance) target).getOwner().getObjectId();
|
||||||
|
|
||||||
if (isOwner && (activeChar != ((L2PetInstance) target).getOwner()))
|
if (isOwner && (activeChar != ((L2PetInstance) target).getOwner()))
|
||||||
{
|
{
|
||||||
|
@@ -34,7 +34,7 @@ public class L2DoorInstanceActionShift implements IActionShiftHandler
|
|||||||
if (activeChar.getAccessLevel().isGm())
|
if (activeChar.getAccessLevel().isGm())
|
||||||
{
|
{
|
||||||
activeChar.setTarget(target);
|
activeChar.setTarget(target);
|
||||||
L2DoorInstance door = (L2DoorInstance) target;
|
final L2DoorInstance door = (L2DoorInstance) target;
|
||||||
activeChar.sendPacket(new StaticObject(door, activeChar.isGM()));
|
activeChar.sendPacket(new StaticObject(door, activeChar.isGM()));
|
||||||
|
|
||||||
final NpcHtmlMessage html = new NpcHtmlMessage();
|
final NpcHtmlMessage html = new NpcHtmlMessage();
|
||||||
|
@@ -102,7 +102,7 @@ public class L2NpcActionShift implements IActionShiftHandler
|
|||||||
html.replace("%collision_height%", String.valueOf(((L2Character) target).getTemplate().getfCollisionHeight()));
|
html.replace("%collision_height%", String.valueOf(((L2Character) target).getTemplate().getfCollisionHeight()));
|
||||||
html.replace("%dist%", String.valueOf((int) activeChar.calculateDistance(target, true, false)));
|
html.replace("%dist%", String.valueOf((int) activeChar.calculateDistance(target, true, false)));
|
||||||
|
|
||||||
byte attackAttribute = ((L2Character) target).getAttackElement();
|
final byte attackAttribute = ((L2Character) target).getAttackElement();
|
||||||
html.replace("%ele_atk%", Elementals.getElementName(attackAttribute));
|
html.replace("%ele_atk%", Elementals.getElementName(attackAttribute));
|
||||||
html.replace("%ele_atk_value%", String.valueOf(((L2Character) target).getAttackElementValue(attackAttribute)));
|
html.replace("%ele_atk_value%", String.valueOf(((L2Character) target).getAttackElementValue(attackAttribute)));
|
||||||
html.replace("%ele_dfire%", String.valueOf(((L2Character) target).getDefenseElementValue(Elementals.FIRE)));
|
html.replace("%ele_dfire%", String.valueOf(((L2Character) target).getDefenseElementValue(Elementals.FIRE)));
|
||||||
@@ -153,10 +153,10 @@ public class L2NpcActionShift implements IActionShiftHandler
|
|||||||
|
|
||||||
if (((L2Npc) target).hasAI())
|
if (((L2Npc) target).hasAI())
|
||||||
{
|
{
|
||||||
Set<Integer> clans = ((L2Npc) target).getTemplate().getClans();
|
final Set<Integer> clans = ((L2Npc) target).getTemplate().getClans();
|
||||||
Set<Integer> ignoreClanNpcIds = ((L2Npc) target).getTemplate().getIgnoreClanNpcIds();
|
final Set<Integer> ignoreClanNpcIds = ((L2Npc) target).getTemplate().getIgnoreClanNpcIds();
|
||||||
String clansString = clans != null ? Util.implode(clans.toArray(), ", ") : "";
|
final String clansString = clans != null ? Util.implode(clans.toArray(), ", ") : "";
|
||||||
String ignoreClanNpcIdsString = ignoreClanNpcIds != null ? Util.implode(ignoreClanNpcIds.toArray(), ", ") : "";
|
final String ignoreClanNpcIdsString = ignoreClanNpcIds != null ? Util.implode(ignoreClanNpcIds.toArray(), ", ") : "";
|
||||||
|
|
||||||
html.replace("%ai_intention%", "<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color=FFAA00>Intention:</font></td><td align=right width=170>" + String.valueOf(((L2Npc) target).getAI().getIntention().name()) + "</td></tr></table></td></tr>");
|
html.replace("%ai_intention%", "<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color=FFAA00>Intention:</font></td><td align=right width=170>" + String.valueOf(((L2Npc) target).getAI().getIntention().name()) + "</td></tr></table></td></tr>");
|
||||||
html.replace("%ai%", "<tr><td><table width=270 border=0><tr><td width=100><font color=FFAA00>AI</font></td><td align=right width=170>" + ((L2Npc) target).getAI().getClass().getSimpleName() + "</td></tr></table></td></tr>");
|
html.replace("%ai%", "<tr><td><table width=270 border=0><tr><td width=100><font color=FFAA00>AI</font></td><td align=right width=170>" + ((L2Npc) target).getAI().getClass().getSimpleName() + "</td></tr></table></td></tr>");
|
||||||
|
@@ -39,7 +39,7 @@ public class L2PcInstanceActionShift implements IActionShiftHandler
|
|||||||
activeChar.setTarget(target);
|
activeChar.setTarget(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
IAdminCommandHandler ach = AdminCommandHandler.getInstance().getHandler("admin_character_info");
|
final IAdminCommandHandler ach = AdminCommandHandler.getInstance().getHandler("admin_character_info");
|
||||||
if (ach != null)
|
if (ach != null)
|
||||||
{
|
{
|
||||||
ach.useAdminCommand("admin_character_info " + target.getName(), activeChar);
|
ach.useAdminCommand("admin_character_info " + target.getName(), activeChar);
|
||||||
|
@@ -164,7 +164,7 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
StringTokenizer st = new StringTokenizer(command);
|
final StringTokenizer st = new StringTokenizer(command);
|
||||||
st.nextToken();
|
st.nextToken();
|
||||||
if (st.nextToken().equalsIgnoreCase("on"))
|
if (st.nextToken().equalsIgnoreCase("on"))
|
||||||
{
|
{
|
||||||
@@ -200,7 +200,7 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String mode = command.substring(15);
|
final String mode = command.substring(15);
|
||||||
if (mode.equalsIgnoreCase("on"))
|
if (mode.equalsIgnoreCase("on"))
|
||||||
{
|
{
|
||||||
activeChar.setTradeRefusal(true);
|
activeChar.setTradeRefusal(true);
|
||||||
@@ -229,12 +229,12 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (command.startsWith("admin_setconfig"))
|
else if (command.startsWith("admin_setconfig"))
|
||||||
{
|
{
|
||||||
StringTokenizer st = new StringTokenizer(command);
|
final StringTokenizer st = new StringTokenizer(command);
|
||||||
st.nextToken();
|
st.nextToken();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String pName = st.nextToken();
|
final String pName = st.nextToken();
|
||||||
String pValue = st.nextToken();
|
final String pValue = st.nextToken();
|
||||||
if (Config.setParameterValue(pName, pValue))
|
if (Config.setParameterValue(pName, pValue))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Config parameter " + pName + " set to " + pValue);
|
activeChar.sendMessage("Config parameter " + pName + " set to " + pValue);
|
||||||
@@ -255,13 +255,13 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (command.startsWith("admin_set"))
|
else if (command.startsWith("admin_set"))
|
||||||
{
|
{
|
||||||
StringTokenizer st = new StringTokenizer(command);
|
final StringTokenizer st = new StringTokenizer(command);
|
||||||
String[] cmd = st.nextToken().split("_");
|
final String[] cmd = st.nextToken().split("_");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String[] parameter = st.nextToken().split("=");
|
final String[] parameter = st.nextToken().split("=");
|
||||||
String pName = parameter[0].trim();
|
final String pName = parameter[0].trim();
|
||||||
String pValue = parameter[1].trim();
|
final String pValue = parameter[1].trim();
|
||||||
if (Config.setParameterValue(pName, pValue))
|
if (Config.setParameterValue(pName, pValue))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("parameter " + pName + " succesfully set to " + pValue);
|
activeChar.sendMessage("parameter " + pName + " succesfully set to " + pValue);
|
||||||
@@ -427,7 +427,7 @@ public class AdminAdmin implements IAdminCommandHandler
|
|||||||
public void showConfigPage(L2PcInstance activeChar)
|
public void showConfigPage(L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||||
StringBuilder replyMSG = new StringBuilder("<html><title>L2J :: Config</title><body>");
|
final StringBuilder replyMSG = new StringBuilder("<html><title>L2J :: Config</title><body>");
|
||||||
replyMSG.append("<center><table width=270><tr><td width=60><button value=\"Main\" action=\"bypass -h admin_admin\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=150>Config Server Panel</td><td width=60><button value=\"Back\" action=\"bypass -h admin_admin4\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table></center><br>");
|
replyMSG.append("<center><table width=270><tr><td width=60><button value=\"Main\" action=\"bypass -h admin_admin\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=150>Config Server Panel</td><td width=60><button value=\"Back\" action=\"bypass -h admin_admin4\" width=60 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table></center><br>");
|
||||||
replyMSG.append("<center><table width=260><tr><td width=140></td><td width=40></td><td width=40></td></tr>");
|
replyMSG.append("<center><table width=260><tr><td width=140></td><td width=40></td><td width=40></td></tr>");
|
||||||
replyMSG.append("<tr><td><font color=\"00AA00\">Drop:</font></td><td></td><td></td></tr>");
|
replyMSG.append("<tr><td><font color=\"00AA00\">Drop:</font></td><td></td><td></td></tr>");
|
||||||
|
@@ -92,7 +92,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
if (!st.hasMoreTokens())
|
if (!st.hasMoreTokens())
|
||||||
{
|
{
|
||||||
String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/admin/announces-add.htm");
|
final String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/admin/announces-add.htm");
|
||||||
Util.sendCBHtml(activeChar, content);
|
Util.sendCBHtml(activeChar, content);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -104,26 +104,26 @@ public class AdminAnnouncements implements IAdminCommandHandler
|
|||||||
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
String annInitDelay = st.nextToken();
|
final String annInitDelay = st.nextToken();
|
||||||
if (!Util.isDigit(annInitDelay))
|
if (!Util.isDigit(annInitDelay))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int initDelay = Integer.parseInt(annInitDelay) * 1000;
|
final int initDelay = Integer.parseInt(annInitDelay) * 1000;
|
||||||
// ************************************
|
// ************************************
|
||||||
if (!st.hasMoreTokens())
|
if (!st.hasMoreTokens())
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
String annDelay = st.nextToken();
|
final String annDelay = st.nextToken();
|
||||||
if (!Util.isDigit(annDelay))
|
if (!Util.isDigit(annDelay))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int delay = Integer.parseInt(annDelay) * 1000;
|
final int delay = Integer.parseInt(annDelay) * 1000;
|
||||||
if ((delay < (10 * 1000)) && ((type == AnnouncementType.AUTO_NORMAL) || (type == AnnouncementType.AUTO_CRITICAL)))
|
if ((delay < (10 * 1000)) && ((type == AnnouncementType.AUTO_NORMAL) || (type == AnnouncementType.AUTO_CRITICAL)))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Delay cannot be less then 10 seconds!");
|
activeChar.sendMessage("Delay cannot be less then 10 seconds!");
|
||||||
@@ -135,7 +135,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
|
|||||||
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
String annRepeat = st.nextToken();
|
final String annRepeat = st.nextToken();
|
||||||
if (!Util.isDigit(annRepeat))
|
if (!Util.isDigit(annRepeat))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
||||||
@@ -178,13 +178,13 @@ public class AdminAnnouncements implements IAdminCommandHandler
|
|||||||
activeChar.sendMessage("Syntax: //announces edit <id>");
|
activeChar.sendMessage("Syntax: //announces edit <id>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
String annId = st.nextToken();
|
final String annId = st.nextToken();
|
||||||
if (!Util.isDigit(annId))
|
if (!Util.isDigit(annId))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Syntax: //announces edit <id>");
|
activeChar.sendMessage("Syntax: //announces edit <id>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int id = Integer.parseInt(annId);
|
final int id = Integer.parseInt(annId);
|
||||||
final IAnnouncement announce = AnnouncementsTable.getInstance().getAnnounce(id);
|
final IAnnouncement announce = AnnouncementsTable.getInstance().getAnnounce(id);
|
||||||
if (announce == null)
|
if (announce == null)
|
||||||
{
|
{
|
||||||
@@ -194,13 +194,13 @@ public class AdminAnnouncements implements IAdminCommandHandler
|
|||||||
if (!st.hasMoreTokens())
|
if (!st.hasMoreTokens())
|
||||||
{
|
{
|
||||||
String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/admin/announces-edit.htm");
|
String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/admin/announces-edit.htm");
|
||||||
String announcementId = "" + announce.getId();
|
final String announcementId = "" + announce.getId();
|
||||||
String announcementType = announce.getType().name();
|
final String announcementType = announce.getType().name();
|
||||||
String announcementInital = "0";
|
String announcementInital = "0";
|
||||||
String announcementDelay = "0";
|
String announcementDelay = "0";
|
||||||
String announcementRepeat = "0";
|
String announcementRepeat = "0";
|
||||||
String announcementAuthor = announce.getAuthor();
|
final String announcementAuthor = announce.getAuthor();
|
||||||
String announcementContent = announce.getContent();
|
final String announcementContent = announce.getContent();
|
||||||
if (announce instanceof AutoAnnouncement)
|
if (announce instanceof AutoAnnouncement)
|
||||||
{
|
{
|
||||||
final AutoAnnouncement autoAnnounce = (AutoAnnouncement) announce;
|
final AutoAnnouncement autoAnnounce = (AutoAnnouncement) announce;
|
||||||
@@ -265,26 +265,26 @@ public class AdminAnnouncements implements IAdminCommandHandler
|
|||||||
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
String annInitDelay = st.nextToken();
|
final String annInitDelay = st.nextToken();
|
||||||
if (!Util.isDigit(annInitDelay))
|
if (!Util.isDigit(annInitDelay))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int initDelay = Integer.parseInt(annInitDelay);
|
final int initDelay = Integer.parseInt(annInitDelay);
|
||||||
// ************************************
|
// ************************************
|
||||||
if (!st.hasMoreTokens())
|
if (!st.hasMoreTokens())
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
String annDelay = st.nextToken();
|
final String annDelay = st.nextToken();
|
||||||
if (!Util.isDigit(annDelay))
|
if (!Util.isDigit(annDelay))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int delay = Integer.parseInt(annDelay);
|
final int delay = Integer.parseInt(annDelay);
|
||||||
if ((delay < 10) && ((type == AnnouncementType.AUTO_NORMAL) || (type == AnnouncementType.AUTO_CRITICAL)))
|
if ((delay < 10) && ((type == AnnouncementType.AUTO_NORMAL) || (type == AnnouncementType.AUTO_CRITICAL)))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Delay cannot be less then 10 seconds!");
|
activeChar.sendMessage("Delay cannot be less then 10 seconds!");
|
||||||
@@ -296,7 +296,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
|
|||||||
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
String annRepeat = st.nextToken();
|
final String annRepeat = st.nextToken();
|
||||||
if (!Util.isDigit(annRepeat))
|
if (!Util.isDigit(annRepeat))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
activeChar.sendMessage("Syntax: //announces add <type> <delay> <repeat> <text>");
|
||||||
@@ -327,7 +327,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
|
|||||||
announce.setAuthor(activeChar.getName());
|
announce.setAuthor(activeChar.getName());
|
||||||
if (announce instanceof AutoAnnouncement)
|
if (announce instanceof AutoAnnouncement)
|
||||||
{
|
{
|
||||||
AutoAnnouncement autoAnnounce = (AutoAnnouncement) announce;
|
final AutoAnnouncement autoAnnounce = (AutoAnnouncement) announce;
|
||||||
autoAnnounce.setInitial(initDelay * 1000);
|
autoAnnounce.setInitial(initDelay * 1000);
|
||||||
autoAnnounce.setDelay(delay * 1000);
|
autoAnnounce.setDelay(delay * 1000);
|
||||||
autoAnnounce.setRepeat(repeat);
|
autoAnnounce.setRepeat(repeat);
|
||||||
@@ -343,13 +343,13 @@ public class AdminAnnouncements implements IAdminCommandHandler
|
|||||||
activeChar.sendMessage("Syntax: //announces remove <announcement id>");
|
activeChar.sendMessage("Syntax: //announces remove <announcement id>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
String token = st.nextToken();
|
final String token = st.nextToken();
|
||||||
if (!Util.isDigit(token))
|
if (!Util.isDigit(token))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Syntax: //announces remove <announcement id>");
|
activeChar.sendMessage("Syntax: //announces remove <announcement id>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int id = Integer.parseInt(token);
|
final int id = Integer.parseInt(token);
|
||||||
if (AnnouncementsTable.getInstance().deleteAnnouncement(id))
|
if (AnnouncementsTable.getInstance().deleteAnnouncement(id))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Announcement has been successfully removed!");
|
activeChar.sendMessage("Announcement has been successfully removed!");
|
||||||
@@ -375,13 +375,13 @@ public class AdminAnnouncements implements IAdminCommandHandler
|
|||||||
activeChar.sendMessage("Auto announcements has been successfully restarted");
|
activeChar.sendMessage("Auto announcements has been successfully restarted");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
String token = st.nextToken();
|
final String token = st.nextToken();
|
||||||
if (!Util.isDigit(token))
|
if (!Util.isDigit(token))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Syntax: //announces show <announcement id>");
|
activeChar.sendMessage("Syntax: //announces show <announcement id>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int id = Integer.parseInt(token);
|
final int id = Integer.parseInt(token);
|
||||||
final IAnnouncement announce = AnnouncementsTable.getInstance().getAnnounce(id);
|
final IAnnouncement announce = AnnouncementsTable.getInstance().getAnnounce(id);
|
||||||
if (announce != null)
|
if (announce != null)
|
||||||
{
|
{
|
||||||
@@ -409,24 +409,24 @@ public class AdminAnnouncements implements IAdminCommandHandler
|
|||||||
activeChar.sendMessage("Syntax: //announces show <announcement id>");
|
activeChar.sendMessage("Syntax: //announces show <announcement id>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
String token = st.nextToken();
|
final String token = st.nextToken();
|
||||||
if (!Util.isDigit(token))
|
if (!Util.isDigit(token))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Syntax: //announces show <announcement id>");
|
activeChar.sendMessage("Syntax: //announces show <announcement id>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int id = Integer.parseInt(token);
|
final int id = Integer.parseInt(token);
|
||||||
final IAnnouncement announce = AnnouncementsTable.getInstance().getAnnounce(id);
|
final IAnnouncement announce = AnnouncementsTable.getInstance().getAnnounce(id);
|
||||||
if (announce != null)
|
if (announce != null)
|
||||||
{
|
{
|
||||||
String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/admin/announces-show.htm");
|
String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/admin/announces-show.htm");
|
||||||
String announcementId = "" + announce.getId();
|
final String announcementId = "" + announce.getId();
|
||||||
String announcementType = announce.getType().name();
|
final String announcementType = announce.getType().name();
|
||||||
String announcementInital = "0";
|
String announcementInital = "0";
|
||||||
String announcementDelay = "0";
|
String announcementDelay = "0";
|
||||||
String announcementRepeat = "0";
|
String announcementRepeat = "0";
|
||||||
String announcementAuthor = announce.getAuthor();
|
final String announcementAuthor = announce.getAuthor();
|
||||||
String announcementContent = announce.getContent();
|
final String announcementContent = announce.getContent();
|
||||||
if (announce instanceof AutoAnnouncement)
|
if (announce instanceof AutoAnnouncement)
|
||||||
{
|
{
|
||||||
final AutoAnnouncement autoAnnounce = (AutoAnnouncement) announce;
|
final AutoAnnouncement autoAnnounce = (AutoAnnouncement) announce;
|
||||||
|
@@ -68,7 +68,7 @@ public class AdminBuffs implements IAdminCommandHandler
|
|||||||
if (st.hasMoreTokens())
|
if (st.hasMoreTokens())
|
||||||
{
|
{
|
||||||
final String playername = st.nextToken();
|
final String playername = st.nextToken();
|
||||||
L2PcInstance player = L2World.getInstance().getPlayer(playername);
|
final L2PcInstance player = L2World.getInstance().getPlayer(playername);
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
int page = 1;
|
int page = 1;
|
||||||
@@ -97,11 +97,11 @@ public class AdminBuffs implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
StringTokenizer st = new StringTokenizer(command, " ");
|
final StringTokenizer st = new StringTokenizer(command, " ");
|
||||||
|
|
||||||
st.nextToken();
|
st.nextToken();
|
||||||
int objectId = Integer.parseInt(st.nextToken());
|
final int objectId = Integer.parseInt(st.nextToken());
|
||||||
int skillId = Integer.parseInt(st.nextToken());
|
final int skillId = Integer.parseInt(st.nextToken());
|
||||||
|
|
||||||
removeBuff(activeChar, objectId, skillId);
|
removeBuff(activeChar, objectId, skillId);
|
||||||
return true;
|
return true;
|
||||||
@@ -117,9 +117,9 @@ public class AdminBuffs implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
StringTokenizer st = new StringTokenizer(command, " ");
|
final StringTokenizer st = new StringTokenizer(command, " ");
|
||||||
st.nextToken();
|
st.nextToken();
|
||||||
int objectId = Integer.parseInt(st.nextToken());
|
final int objectId = Integer.parseInt(st.nextToken());
|
||||||
removeAllBuffs(activeChar, objectId);
|
removeAllBuffs(activeChar, objectId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -132,12 +132,12 @@ public class AdminBuffs implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (command.startsWith("admin_areacancel"))
|
else if (command.startsWith("admin_areacancel"))
|
||||||
{
|
{
|
||||||
StringTokenizer st = new StringTokenizer(command, " ");
|
final StringTokenizer st = new StringTokenizer(command, " ");
|
||||||
st.nextToken();
|
st.nextToken();
|
||||||
String val = st.nextToken();
|
final String val = st.nextToken();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int radius = Integer.parseInt(val);
|
final int radius = Integer.parseInt(val);
|
||||||
|
|
||||||
for (L2Character knownChar : activeChar.getKnownList().getKnownCharactersInRadius(radius))
|
for (L2Character knownChar : activeChar.getKnownList().getKnownCharactersInRadius(radius))
|
||||||
{
|
{
|
||||||
@@ -158,7 +158,7 @@ public class AdminBuffs implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (command.startsWith("admin_removereuse"))
|
else if (command.startsWith("admin_removereuse"))
|
||||||
{
|
{
|
||||||
StringTokenizer st = new StringTokenizer(command, " ");
|
final StringTokenizer st = new StringTokenizer(command, " ");
|
||||||
command = st.nextToken();
|
command = st.nextToken();
|
||||||
|
|
||||||
L2Character creature = null;
|
L2Character creature = null;
|
||||||
@@ -255,8 +255,8 @@ public class AdminBuffs implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
final StringBuilder html = StringUtil.startAppend(500 + (effects.size() * 200), "<html><table width=\"100%\"><tr><td width=45><button value=\"Main\" action=\"bypass -h admin_admin\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center><font color=\"LEVEL\">Effects of ", target.getName(), "</font></td><td width=45><button value=\"Back\" action=\"bypass -h admin_current_player\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br><table width=\"100%\"><tr><td width=200>Skill</td><td width=30>Rem. Time</td><td width=70>Action</td></tr>");
|
final StringBuilder html = StringUtil.startAppend(500 + (effects.size() * 200), "<html><table width=\"100%\"><tr><td width=45><button value=\"Main\" action=\"bypass -h admin_admin\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center><font color=\"LEVEL\">Effects of ", target.getName(), "</font></td><td width=45><button value=\"Back\" action=\"bypass -h admin_current_player\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br><table width=\"100%\"><tr><td width=200>Skill</td><td width=30>Rem. Time</td><td width=70>Action</td></tr>");
|
||||||
int start = ((page - 1) * PAGE_LIMIT);
|
final int start = ((page - 1) * PAGE_LIMIT);
|
||||||
int end = Math.min(((page - 1) * PAGE_LIMIT) + PAGE_LIMIT, effects.size());
|
final int end = Math.min(((page - 1) * PAGE_LIMIT) + PAGE_LIMIT, effects.size());
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (BuffInfo info : effects)
|
for (BuffInfo info : effects)
|
||||||
{
|
{
|
||||||
@@ -274,7 +274,7 @@ public class AdminBuffs implements IAdminCommandHandler
|
|||||||
html.append("</table><table width=300 bgcolor=444444><tr>");
|
html.append("</table><table width=300 bgcolor=444444><tr>");
|
||||||
for (int x = 0; x < max; x++)
|
for (int x = 0; x < max; x++)
|
||||||
{
|
{
|
||||||
int pagenr = x + 1;
|
final int pagenr = x + 1;
|
||||||
if (page == pagenr)
|
if (page == pagenr)
|
||||||
{
|
{
|
||||||
html.append("<td>Page ");
|
html.append("<td>Page ");
|
||||||
|
@@ -90,7 +90,7 @@ public final class AdminCHSiege implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
L2Clan owner = ClanTable.getInstance().getClan(hall.getOwnerId());
|
final L2Clan owner = ClanTable.getInstance().getClan(hall.getOwnerId());
|
||||||
if (owner != null)
|
if (owner != null)
|
||||||
{
|
{
|
||||||
hall.free();
|
hall.free();
|
||||||
@@ -123,26 +123,26 @@ public final class AdminCHSiege implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
String[] rawDate = split[2].split(";");
|
final String[] rawDate = split[2].split(";");
|
||||||
if (rawDate.length < 2)
|
if (rawDate.length < 2)
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("You have to specify this format DD-MM-YYYY;HH:MM");
|
activeChar.sendMessage("You have to specify this format DD-MM-YYYY;HH:MM");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
String[] day = rawDate[0].split("-");
|
final String[] day = rawDate[0].split("-");
|
||||||
String[] hour = rawDate[1].split(":");
|
final String[] hour = rawDate[1].split(":");
|
||||||
if ((day.length < 3) || (hour.length < 2))
|
if ((day.length < 3) || (hour.length < 2))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Incomplete day, hour or both!");
|
activeChar.sendMessage("Incomplete day, hour or both!");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int d = parseInt(day[0]);
|
final int d = parseInt(day[0]);
|
||||||
int month = parseInt(day[1]) - 1;
|
final int month = parseInt(day[1]) - 1;
|
||||||
int year = parseInt(day[2]);
|
final int year = parseInt(day[2]);
|
||||||
int h = parseInt(hour[0]);
|
final int h = parseInt(hour[0]);
|
||||||
int min = parseInt(hour[1]);
|
final int min = parseInt(hour[1]);
|
||||||
if (((month == 2) && (d > 28)) || (d > 31) || (d <= 0) || (month <= 0) || (month > 12) || (year < Calendar.getInstance().get(Calendar.YEAR)))
|
if (((month == 2) && (d > 28)) || (d > 31) || (d <= 0) || (month <= 0) || (month > 12) || (year < Calendar.getInstance().get(Calendar.YEAR)))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Wrong day/month/year gave!");
|
activeChar.sendMessage("Wrong day/month/year gave!");
|
||||||
@@ -153,7 +153,7 @@ public final class AdminCHSiege implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Calendar c = Calendar.getInstance();
|
final Calendar c = Calendar.getInstance();
|
||||||
c.set(Calendar.YEAR, year);
|
c.set(Calendar.YEAR, year);
|
||||||
c.set(Calendar.MONTH, month);
|
c.set(Calendar.MONTH, month);
|
||||||
c.set(Calendar.DAY_OF_MONTH, d);
|
c.set(Calendar.DAY_OF_MONTH, d);
|
||||||
@@ -189,7 +189,7 @@ public final class AdminCHSiege implements IAdminCommandHandler
|
|||||||
L2Clan attacker = null;
|
L2Clan attacker = null;
|
||||||
if (split.length < 3)
|
if (split.length < 3)
|
||||||
{
|
{
|
||||||
L2Object rawTarget = activeChar.getTarget();
|
final L2Object rawTarget = activeChar.getTarget();
|
||||||
L2PcInstance target = null;
|
L2PcInstance target = null;
|
||||||
if (rawTarget == null)
|
if (rawTarget == null)
|
||||||
{
|
{
|
||||||
@@ -214,7 +214,7 @@ public final class AdminCHSiege implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
L2Clan rawClan = ClanTable.getInstance().getClanByName(split[2]);
|
final L2Clan rawClan = ClanTable.getInstance().getClanByName(split[2]);
|
||||||
if (rawClan == null)
|
if (rawClan == null)
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("The given clan does not exist!");
|
activeChar.sendMessage("The given clan does not exist!");
|
||||||
@@ -244,7 +244,7 @@ public final class AdminCHSiege implements IAdminCommandHandler
|
|||||||
|
|
||||||
if (split.length < 3)
|
if (split.length < 3)
|
||||||
{
|
{
|
||||||
L2Object rawTarget = activeChar.getTarget();
|
final L2Object rawTarget = activeChar.getTarget();
|
||||||
L2PcInstance target = null;
|
L2PcInstance target = null;
|
||||||
if (rawTarget == null)
|
if (rawTarget == null)
|
||||||
{
|
{
|
||||||
@@ -269,7 +269,7 @@ public final class AdminCHSiege implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
L2Clan rawClan = ClanTable.getInstance().getClanByName(split[2]);
|
final L2Clan rawClan = ClanTable.getInstance().getClanByName(split[2]);
|
||||||
if (rawClan == null)
|
if (rawClan == null)
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("The given clan does not exist!");
|
activeChar.sendMessage("The given clan does not exist!");
|
||||||
@@ -301,7 +301,7 @@ public final class AdminCHSiege implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (split[0].equals(COMMANDS[8]))
|
else if (split[0].equals(COMMANDS[8]))
|
||||||
{
|
{
|
||||||
ClanHallSiegeEngine siegable = hall.getSiege();
|
final ClanHallSiegeEngine siegable = hall.getSiege();
|
||||||
siegable.cancelSiegeTask();
|
siegable.cancelSiegeTask();
|
||||||
switch (hall.getSiegeStatus())
|
switch (hall.getSiegeStatus())
|
||||||
{
|
{
|
||||||
@@ -323,14 +323,14 @@ public final class AdminCHSiege implements IAdminCommandHandler
|
|||||||
|
|
||||||
private SiegableHall getHall(String id, L2PcInstance gm)
|
private SiegableHall getHall(String id, L2PcInstance gm)
|
||||||
{
|
{
|
||||||
int ch = parseInt(id);
|
final int ch = parseInt(id);
|
||||||
if (ch == 0)
|
if (ch == 0)
|
||||||
{
|
{
|
||||||
gm.sendMessage("Wrong clan hall id, unparseable id!");
|
gm.sendMessage("Wrong clan hall id, unparseable id!");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
SiegableHall hall = CHSiegeManager.getInstance().getSiegableHall(ch);
|
final SiegableHall hall = CHSiegeManager.getInstance().getSiegableHall(ch);
|
||||||
|
|
||||||
if (hall == null)
|
if (hall == null)
|
||||||
{
|
{
|
||||||
@@ -362,7 +362,7 @@ public final class AdminCHSiege implements IAdminCommandHandler
|
|||||||
msg.replace("%clanhallName%", hall.getName());
|
msg.replace("%clanhallName%", hall.getName());
|
||||||
if (hall.getOwnerId() > 0)
|
if (hall.getOwnerId() > 0)
|
||||||
{
|
{
|
||||||
L2Clan owner = ClanTable.getInstance().getClan(hall.getOwnerId());
|
final L2Clan owner = ClanTable.getInstance().getClan(hall.getOwnerId());
|
||||||
if (owner != null)
|
if (owner != null)
|
||||||
{
|
{
|
||||||
msg.replace("%clanhallOwner%", owner.getName());
|
msg.replace("%clanhallOwner%", owner.getName());
|
||||||
|
@@ -44,12 +44,12 @@ public final class AdminChangeAccessLevel implements IAdminCommandHandler
|
|||||||
@Override
|
@Override
|
||||||
public boolean useAdminCommand(String command, L2PcInstance activeChar)
|
public boolean useAdminCommand(String command, L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
String[] parts = command.split(" ");
|
final String[] parts = command.split(" ");
|
||||||
if (parts.length == 2)
|
if (parts.length == 2)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int lvl = Integer.parseInt(parts[1]);
|
final int lvl = Integer.parseInt(parts[1]);
|
||||||
if (activeChar.getTarget() instanceof L2PcInstance)
|
if (activeChar.getTarget() instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
onlineChange(activeChar, (L2PcInstance) activeChar.getTarget(), lvl);
|
onlineChange(activeChar, (L2PcInstance) activeChar.getTarget(), lvl);
|
||||||
@@ -66,9 +66,9 @@ public final class AdminChangeAccessLevel implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (parts.length == 3)
|
else if (parts.length == 3)
|
||||||
{
|
{
|
||||||
String name = parts[1];
|
final String name = parts[1];
|
||||||
int lvl = Integer.parseInt(parts[2]);
|
final int lvl = Integer.parseInt(parts[2]);
|
||||||
L2PcInstance player = L2World.getInstance().getPlayer(name);
|
final L2PcInstance player = L2World.getInstance().getPlayer(name);
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
onlineChange(activeChar, player, lvl);
|
onlineChange(activeChar, player, lvl);
|
||||||
|
@@ -119,7 +119,7 @@ public class AdminClan implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
final NpcHtmlMessage html = new NpcHtmlMessage(0, 1);
|
final NpcHtmlMessage html = new NpcHtmlMessage(0, 1);
|
||||||
html.setHtml(HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/admin/clanchanges.htm"));
|
html.setHtml(HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/admin/clanchanges.htm"));
|
||||||
StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
for (L2Clan clan : ClanTable.getInstance().getClans())
|
for (L2Clan clan : ClanTable.getInstance().getClans())
|
||||||
{
|
{
|
||||||
if (clan.getNewLeaderId() != 0)
|
if (clan.getNewLeaderId() != 0)
|
||||||
@@ -139,12 +139,12 @@ public class AdminClan implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
if (st.hasMoreElements())
|
if (st.hasMoreElements())
|
||||||
{
|
{
|
||||||
String token = st.nextToken();
|
final String token = st.nextToken();
|
||||||
if (!Util.isDigit(token))
|
if (!Util.isDigit(token))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int clanId = Integer.parseInt(token);
|
final int clanId = Integer.parseInt(token);
|
||||||
|
|
||||||
final L2Clan clan = ClanTable.getInstance().getClan(clanId);
|
final L2Clan clan = ClanTable.getInstance().getClan(clanId);
|
||||||
if (clan == null)
|
if (clan == null)
|
||||||
@@ -201,7 +201,7 @@ public class AdminClan implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
L2Object targetObj = activeChar.getTarget();
|
final L2Object targetObj = activeChar.getTarget();
|
||||||
if (targetObj instanceof L2PcInstance)
|
if (targetObj instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
player = targetObj.getActingPlayer();
|
player = targetObj.getActingPlayer();
|
||||||
|
@@ -66,7 +66,7 @@ public class AdminClanHall implements IAdminCommandHandler
|
|||||||
player = activeChar.getTarget().getActingPlayer();
|
player = activeChar.getTarget().getActingPlayer();
|
||||||
}
|
}
|
||||||
|
|
||||||
String val = st.nextToken();
|
final String val = st.nextToken();
|
||||||
if (command.startsWith("admin_clanhall"))
|
if (command.startsWith("admin_clanhall"))
|
||||||
{
|
{
|
||||||
if (Util.isDigit(val))
|
if (Util.isDigit(val))
|
||||||
|
@@ -53,20 +53,20 @@ public class AdminCreateItem implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(17);
|
final String val = command.substring(17);
|
||||||
StringTokenizer st = new StringTokenizer(val);
|
final StringTokenizer st = new StringTokenizer(val);
|
||||||
if (st.countTokens() == 2)
|
if (st.countTokens() == 2)
|
||||||
{
|
{
|
||||||
String id = st.nextToken();
|
final String id = st.nextToken();
|
||||||
int idval = Integer.parseInt(id);
|
final int idval = Integer.parseInt(id);
|
||||||
String num = st.nextToken();
|
final String num = st.nextToken();
|
||||||
long numval = Long.parseLong(num);
|
final long numval = Long.parseLong(num);
|
||||||
createItem(activeChar, activeChar, idval, numval);
|
createItem(activeChar, activeChar, idval, numval);
|
||||||
}
|
}
|
||||||
else if (st.countTokens() == 1)
|
else if (st.countTokens() == 1)
|
||||||
{
|
{
|
||||||
String id = st.nextToken();
|
final String id = st.nextToken();
|
||||||
int idval = Integer.parseInt(id);
|
final int idval = Integer.parseInt(id);
|
||||||
createItem(activeChar, activeChar, idval, 1);
|
createItem(activeChar, activeChar, idval, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -84,23 +84,23 @@ public class AdminCreateItem implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(17);
|
final String val = command.substring(17);
|
||||||
StringTokenizer st = new StringTokenizer(val);
|
final StringTokenizer st = new StringTokenizer(val);
|
||||||
if (st.countTokens() == 2)
|
if (st.countTokens() == 2)
|
||||||
{
|
{
|
||||||
String name = st.nextToken();
|
final String name = st.nextToken();
|
||||||
int idval = getCoinId(name);
|
final int idval = getCoinId(name);
|
||||||
if (idval > 0)
|
if (idval > 0)
|
||||||
{
|
{
|
||||||
String num = st.nextToken();
|
final String num = st.nextToken();
|
||||||
long numval = Long.parseLong(num);
|
final long numval = Long.parseLong(num);
|
||||||
createItem(activeChar, activeChar, idval, numval);
|
createItem(activeChar, activeChar, idval, numval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (st.countTokens() == 1)
|
else if (st.countTokens() == 1)
|
||||||
{
|
{
|
||||||
String name = st.nextToken();
|
final String name = st.nextToken();
|
||||||
int idval = getCoinId(name);
|
final int idval = getCoinId(name);
|
||||||
createItem(activeChar, activeChar, idval, 1);
|
createItem(activeChar, activeChar, idval, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -129,20 +129,20 @@ public class AdminCreateItem implements IAdminCommandHandler
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
String val = command.substring(22);
|
final String val = command.substring(22);
|
||||||
StringTokenizer st = new StringTokenizer(val);
|
final StringTokenizer st = new StringTokenizer(val);
|
||||||
if (st.countTokens() == 2)
|
if (st.countTokens() == 2)
|
||||||
{
|
{
|
||||||
String id = st.nextToken();
|
final String id = st.nextToken();
|
||||||
int idval = Integer.parseInt(id);
|
final int idval = Integer.parseInt(id);
|
||||||
String num = st.nextToken();
|
final String num = st.nextToken();
|
||||||
long numval = Long.parseLong(num);
|
final long numval = Long.parseLong(num);
|
||||||
createItem(activeChar, target, idval, numval);
|
createItem(activeChar, target, idval, numval);
|
||||||
}
|
}
|
||||||
else if (st.countTokens() == 1)
|
else if (st.countTokens() == 1)
|
||||||
{
|
{
|
||||||
String id = st.nextToken();
|
final String id = st.nextToken();
|
||||||
int idval = Integer.parseInt(id);
|
final int idval = Integer.parseInt(id);
|
||||||
createItem(activeChar, target, idval, 1);
|
createItem(activeChar, target, idval, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -158,25 +158,25 @@ public class AdminCreateItem implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (command.startsWith("admin_give_item_to_all"))
|
else if (command.startsWith("admin_give_item_to_all"))
|
||||||
{
|
{
|
||||||
String val = command.substring(22);
|
final String val = command.substring(22);
|
||||||
StringTokenizer st = new StringTokenizer(val);
|
final StringTokenizer st = new StringTokenizer(val);
|
||||||
int idval = 0;
|
int idval = 0;
|
||||||
long numval = 0;
|
long numval = 0;
|
||||||
if (st.countTokens() == 2)
|
if (st.countTokens() == 2)
|
||||||
{
|
{
|
||||||
String id = st.nextToken();
|
final String id = st.nextToken();
|
||||||
idval = Integer.parseInt(id);
|
idval = Integer.parseInt(id);
|
||||||
String num = st.nextToken();
|
final String num = st.nextToken();
|
||||||
numval = Long.parseLong(num);
|
numval = Long.parseLong(num);
|
||||||
}
|
}
|
||||||
else if (st.countTokens() == 1)
|
else if (st.countTokens() == 1)
|
||||||
{
|
{
|
||||||
String id = st.nextToken();
|
final String id = st.nextToken();
|
||||||
idval = Integer.parseInt(id);
|
idval = Integer.parseInt(id);
|
||||||
numval = 1;
|
numval = 1;
|
||||||
}
|
}
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
L2Item template = ItemTable.getInstance().getTemplate(idval);
|
final L2Item template = ItemTable.getInstance().getTemplate(idval);
|
||||||
if (template == null)
|
if (template == null)
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("This item doesn't exist.");
|
activeChar.sendMessage("This item doesn't exist.");
|
||||||
@@ -209,7 +209,7 @@ public class AdminCreateItem implements IAdminCommandHandler
|
|||||||
|
|
||||||
private void createItem(L2PcInstance activeChar, L2PcInstance target, int id, long num)
|
private void createItem(L2PcInstance activeChar, L2PcInstance target, int id, long num)
|
||||||
{
|
{
|
||||||
L2Item template = ItemTable.getInstance().getTemplate(id);
|
final L2Item template = ItemTable.getInstance().getTemplate(id);
|
||||||
if (template == null)
|
if (template == null)
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("This item doesn't exist.");
|
activeChar.sendMessage("This item doesn't exist.");
|
||||||
|
@@ -53,10 +53,10 @@ public class AdminCursedWeapons implements IAdminCommandHandler
|
|||||||
public boolean useAdminCommand(String command, L2PcInstance activeChar)
|
public boolean useAdminCommand(String command, L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
|
|
||||||
CursedWeaponsManager cwm = CursedWeaponsManager.getInstance();
|
final CursedWeaponsManager cwm = CursedWeaponsManager.getInstance();
|
||||||
int id = 0;
|
int id = 0;
|
||||||
|
|
||||||
StringTokenizer st = new StringTokenizer(command);
|
final StringTokenizer st = new StringTokenizer(command);
|
||||||
st.nextToken();
|
st.nextToken();
|
||||||
|
|
||||||
if (command.startsWith("admin_cw_info"))
|
if (command.startsWith("admin_cw_info"))
|
||||||
@@ -69,7 +69,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
|
|||||||
activeChar.sendMessage("> " + cw.getName() + " (" + cw.getItemId() + ")");
|
activeChar.sendMessage("> " + cw.getName() + " (" + cw.getItemId() + ")");
|
||||||
if (cw.isActivated())
|
if (cw.isActivated())
|
||||||
{
|
{
|
||||||
L2PcInstance pl = cw.getPlayer();
|
final L2PcInstance pl = cw.getPlayer();
|
||||||
activeChar.sendMessage(" Player holding: " + (pl == null ? "null" : pl.getName()));
|
activeChar.sendMessage(" Player holding: " + (pl == null ? "null" : pl.getName()));
|
||||||
activeChar.sendMessage(" Player karma: " + cw.getPlayerKarma());
|
activeChar.sendMessage(" Player karma: " + cw.getPlayerKarma());
|
||||||
activeChar.sendMessage(" Time Remaining: " + (cw.getTimeLeft() / 60000) + " min.");
|
activeChar.sendMessage(" Time Remaining: " + (cw.getTimeLeft() / 60000) + " min.");
|
||||||
@@ -102,7 +102,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
|
|||||||
|
|
||||||
if (cw.isActivated())
|
if (cw.isActivated())
|
||||||
{
|
{
|
||||||
L2PcInstance pl = cw.getPlayer();
|
final L2PcInstance pl = cw.getPlayer();
|
||||||
StringUtil.append(replyMSG, "<tr><td>Weilder:</td><td>", (pl == null ? "null" : pl.getName()), "</td></tr>" + "<tr><td>Karma:</td><td>", String.valueOf(cw.getPlayerKarma()), "</td></tr>" + "<tr><td>Kills:</td><td>", String.valueOf(cw.getPlayerPkKills()), "/", String.valueOf(cw.getNbKills()), "</td></tr>" + "<tr><td>Time remaining:</td><td>", String.valueOf(cw.getTimeLeft() / 60000), " min.</td></tr>" + "<tr><td><button value=\"Remove\" action=\"bypass -h admin_cw_remove ", String.valueOf(itemId), "\" width=73 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" + "<td><button value=\"Go\" action=\"bypass -h admin_cw_goto ", String.valueOf(itemId), "\" width=73 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
|
StringUtil.append(replyMSG, "<tr><td>Weilder:</td><td>", (pl == null ? "null" : pl.getName()), "</td></tr>" + "<tr><td>Karma:</td><td>", String.valueOf(cw.getPlayerKarma()), "</td></tr>" + "<tr><td>Kills:</td><td>", String.valueOf(cw.getPlayerPkKills()), "/", String.valueOf(cw.getNbKills()), "</td></tr>" + "<tr><td>Time remaining:</td><td>", String.valueOf(cw.getTimeLeft() / 60000), " min.</td></tr>" + "<tr><td><button value=\"Remove\" action=\"bypass -h admin_cw_remove ", String.valueOf(itemId), "\" width=73 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" + "<td><button value=\"Go\" action=\"bypass -h admin_cw_goto ", String.valueOf(itemId), "\" width=73 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
|
||||||
}
|
}
|
||||||
else if (cw.isDropped())
|
else if (cw.isDropped())
|
||||||
@@ -175,7 +175,7 @@ public class AdminCursedWeapons implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
((L2PcInstance) target).addItem("AdminCursedWeaponAdd", id, 1, target, true);
|
((L2PcInstance) target).addItem("AdminCursedWeaponAdd", id, 1, target, true);
|
||||||
|
@@ -35,7 +35,7 @@ public class AdminDebug implements IAdminCommandHandler
|
|||||||
@Override
|
@Override
|
||||||
public final boolean useAdminCommand(String command, L2PcInstance activeChar)
|
public final boolean useAdminCommand(String command, L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
String[] commandSplit = command.split(" ");
|
final String[] commandSplit = command.split(" ");
|
||||||
if (ADMIN_COMMANDS[0].equalsIgnoreCase(commandSplit[0]))
|
if (ADMIN_COMMANDS[0].equalsIgnoreCase(commandSplit[0]))
|
||||||
{
|
{
|
||||||
L2Object target;
|
L2Object target;
|
||||||
|
@@ -56,13 +56,13 @@ public class AdminDelete implements IAdminCommandHandler
|
|||||||
// TODO: add possibility to delete any L2Object (except L2PcInstance)
|
// TODO: add possibility to delete any L2Object (except L2PcInstance)
|
||||||
private void handleDelete(L2PcInstance activeChar)
|
private void handleDelete(L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
L2Object obj = activeChar.getTarget();
|
final L2Object obj = activeChar.getTarget();
|
||||||
if (obj instanceof L2Npc)
|
if (obj instanceof L2Npc)
|
||||||
{
|
{
|
||||||
L2Npc target = (L2Npc) obj;
|
final L2Npc target = (L2Npc) obj;
|
||||||
target.deleteMe();
|
target.deleteMe();
|
||||||
|
|
||||||
L2Spawn spawn = target.getSpawn();
|
final L2Spawn spawn = target.getSpawn();
|
||||||
if (spawn != null)
|
if (spawn != null)
|
||||||
{
|
{
|
||||||
spawn.stopRespawn();
|
spawn.stopRespawn();
|
||||||
|
@@ -51,7 +51,7 @@ public class AdminDisconnect implements IAdminCommandHandler
|
|||||||
|
|
||||||
private void disconnectCharacter(L2PcInstance activeChar)
|
private void disconnectCharacter(L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
L2PcInstance player = null;
|
L2PcInstance player = null;
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
|
@@ -49,7 +49,7 @@ public class AdminDoorControl implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
if (command.startsWith("admin_open "))
|
if (command.startsWith("admin_open "))
|
||||||
{
|
{
|
||||||
int doorId = Integer.parseInt(command.substring(11));
|
final int doorId = Integer.parseInt(command.substring(11));
|
||||||
if (_doorTable.getDoor(doorId) != null)
|
if (_doorTable.getDoor(doorId) != null)
|
||||||
{
|
{
|
||||||
_doorTable.getDoor(doorId).openMe();
|
_doorTable.getDoor(doorId).openMe();
|
||||||
@@ -67,7 +67,7 @@ public class AdminDoorControl implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (command.startsWith("admin_close "))
|
else if (command.startsWith("admin_close "))
|
||||||
{
|
{
|
||||||
int doorId = Integer.parseInt(command.substring(12));
|
final int doorId = Integer.parseInt(command.substring(12));
|
||||||
if (_doorTable.getDoor(doorId) != null)
|
if (_doorTable.getDoor(doorId) != null)
|
||||||
{
|
{
|
||||||
_doorTable.getDoor(doorId).closeMe();
|
_doorTable.getDoor(doorId).closeMe();
|
||||||
@@ -113,7 +113,7 @@ public class AdminDoorControl implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
if (command.equals("admin_open"))
|
if (command.equals("admin_open"))
|
||||||
{
|
{
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
if (target instanceof L2DoorInstance)
|
if (target instanceof L2DoorInstance)
|
||||||
{
|
{
|
||||||
((L2DoorInstance) target).openMe();
|
((L2DoorInstance) target).openMe();
|
||||||
@@ -126,7 +126,7 @@ public class AdminDoorControl implements IAdminCommandHandler
|
|||||||
|
|
||||||
if (command.equals("admin_close"))
|
if (command.equals("admin_close"))
|
||||||
{
|
{
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
if (target instanceof L2DoorInstance)
|
if (target instanceof L2DoorInstance)
|
||||||
{
|
{
|
||||||
((L2DoorInstance) target).closeMe();
|
((L2DoorInstance) target).closeMe();
|
||||||
|
@@ -118,7 +118,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (command.startsWith("admin_character_info"))
|
else if (command.startsWith("admin_character_info"))
|
||||||
{
|
{
|
||||||
String[] data = command.split(" ");
|
final String[] data = command.split(" ");
|
||||||
if ((data.length > 1))
|
if ((data.length > 1))
|
||||||
{
|
{
|
||||||
showCharacterInfo(activeChar, L2World.getInstance().getPlayer(data[1]));
|
showCharacterInfo(activeChar, L2World.getInstance().getPlayer(data[1]));
|
||||||
@@ -140,8 +140,8 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(22);
|
final String val = command.substring(22);
|
||||||
int page = Integer.parseInt(val);
|
final int page = Integer.parseInt(val);
|
||||||
listCharacters(activeChar, page);
|
listCharacters(activeChar, page);
|
||||||
}
|
}
|
||||||
catch (StringIndexOutOfBoundsException e)
|
catch (StringIndexOutOfBoundsException e)
|
||||||
@@ -154,7 +154,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(21);
|
final String val = command.substring(21);
|
||||||
findCharacter(activeChar, val);
|
findCharacter(activeChar, val);
|
||||||
}
|
}
|
||||||
catch (StringIndexOutOfBoundsException e)
|
catch (StringIndexOutOfBoundsException e)
|
||||||
@@ -167,7 +167,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(14);
|
final String val = command.substring(14);
|
||||||
findCharactersPerIp(activeChar, val);
|
findCharactersPerIp(activeChar, val);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -180,7 +180,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(19);
|
final String val = command.substring(19);
|
||||||
findCharactersPerAccount(activeChar, val);
|
findCharactersPerAccount(activeChar, val);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -191,7 +191,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (command.startsWith("admin_edit_character"))
|
else if (command.startsWith("admin_edit_character"))
|
||||||
{
|
{
|
||||||
String[] data = command.split(" ");
|
final String[] data = command.split(" ");
|
||||||
if ((data.length > 1))
|
if ((data.length > 1))
|
||||||
{
|
{
|
||||||
editCharacter(activeChar, data[1]);
|
editCharacter(activeChar, data[1]);
|
||||||
@@ -214,8 +214,8 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(15);
|
final String val = command.substring(15);
|
||||||
int karma = Integer.parseInt(val);
|
final int karma = Integer.parseInt(val);
|
||||||
setTargetKarma(activeChar, karma);
|
setTargetKarma(activeChar, karma);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -231,12 +231,12 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(12);
|
final String val = command.substring(12);
|
||||||
int pk = Integer.parseInt(val);
|
final int pk = Integer.parseInt(val);
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
L2PcInstance player = (L2PcInstance) target;
|
final L2PcInstance player = (L2PcInstance) target;
|
||||||
player.setPkKills(pk);
|
player.setPkKills(pk);
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new UserInfo(player));
|
player.sendPacket(new UserInfo(player));
|
||||||
@@ -261,12 +261,12 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(13);
|
final String val = command.substring(13);
|
||||||
int pvp = Integer.parseInt(val);
|
final int pvp = Integer.parseInt(val);
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
L2PcInstance player = (L2PcInstance) target;
|
final L2PcInstance player = (L2PcInstance) target;
|
||||||
player.setPvpKills(pvp);
|
player.setPvpKills(pvp);
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new UserInfo(player));
|
player.sendPacket(new UserInfo(player));
|
||||||
@@ -291,12 +291,12 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(14);
|
final String val = command.substring(14);
|
||||||
int fame = Integer.parseInt(val);
|
final int fame = Integer.parseInt(val);
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
L2PcInstance player = (L2PcInstance) target;
|
final L2PcInstance player = (L2PcInstance) target;
|
||||||
player.setFame(fame);
|
player.setFame(fame);
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new UserInfo(player));
|
player.sendPacket(new UserInfo(player));
|
||||||
@@ -321,12 +321,12 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(10);
|
final String val = command.substring(10);
|
||||||
int recVal = Integer.parseInt(val);
|
final int recVal = Integer.parseInt(val);
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
L2PcInstance player = (L2PcInstance) target;
|
final L2PcInstance player = (L2PcInstance) target;
|
||||||
player.setRecomHave(recVal);
|
player.setRecomHave(recVal);
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new UserInfo(player));
|
player.sendPacket(new UserInfo(player));
|
||||||
@@ -348,9 +348,9 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(15).trim();
|
final String val = command.substring(15).trim();
|
||||||
int classidval = Integer.parseInt(val);
|
final int classidval = Integer.parseInt(val);
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
if ((target == null) || !target.isPlayer())
|
if ((target == null) || !target.isPlayer())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@@ -408,8 +408,8 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(15);
|
final String val = command.substring(15);
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
L2PcInstance player = null;
|
L2PcInstance player = null;
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
@@ -432,8 +432,8 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(17);
|
final String val = command.substring(17);
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
L2PcInstance player = null;
|
L2PcInstance player = null;
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
@@ -480,7 +480,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (command.startsWith("admin_setsex"))
|
else if (command.startsWith("admin_setsex"))
|
||||||
{
|
{
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
L2PcInstance player = null;
|
L2PcInstance player = null;
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
@@ -498,8 +498,8 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(15);
|
final String val = command.substring(15);
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
L2PcInstance player = null;
|
L2PcInstance player = null;
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
@@ -522,8 +522,8 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(16);
|
final String val = command.substring(16);
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
L2PcInstance player = null;
|
L2PcInstance player = null;
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
@@ -544,10 +544,10 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (command.startsWith("admin_fullfood"))
|
else if (command.startsWith("admin_fullfood"))
|
||||||
{
|
{
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
if (target instanceof L2PetInstance)
|
if (target instanceof L2PetInstance)
|
||||||
{
|
{
|
||||||
L2PetInstance targetPet = (L2PetInstance) target;
|
final L2PetInstance targetPet = (L2PetInstance) target;
|
||||||
targetPet.setCurrentFed(targetPet.getMaxFed());
|
targetPet.setCurrentFed(targetPet.getMaxFed());
|
||||||
targetPet.broadcastStatusUpdate();
|
targetPet.broadcastStatusUpdate();
|
||||||
}
|
}
|
||||||
@@ -560,7 +560,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
StringTokenizer st = new StringTokenizer(command, " ");
|
final StringTokenizer st = new StringTokenizer(command, " ");
|
||||||
if (st.countTokens() != 3)
|
if (st.countTokens() != 3)
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Usage: //remove_clan_penalty join|create charname");
|
activeChar.sendMessage("Usage: //remove_clan_penalty join|create charname");
|
||||||
@@ -569,9 +569,9 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
|
|
||||||
st.nextToken();
|
st.nextToken();
|
||||||
|
|
||||||
boolean changeCreateExpiryTime = st.nextToken().equalsIgnoreCase("create");
|
final boolean changeCreateExpiryTime = st.nextToken().equalsIgnoreCase("create");
|
||||||
|
|
||||||
String playerName = st.nextToken();
|
final String playerName = st.nextToken();
|
||||||
L2PcInstance player = null;
|
L2PcInstance player = null;
|
||||||
player = L2World.getInstance().getPlayer(playerName);
|
player = L2World.getInstance().getPlayer(playerName);
|
||||||
|
|
||||||
@@ -610,7 +610,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
int multibox = 2;
|
int multibox = 2;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(19);
|
final String val = command.substring(19);
|
||||||
multibox = Integer.parseInt(val);
|
multibox = Integer.parseInt(val);
|
||||||
if (multibox < 1)
|
if (multibox < 1)
|
||||||
{
|
{
|
||||||
@@ -628,7 +628,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
int multibox = 2;
|
int multibox = 2;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(26);
|
final String val = command.substring(26);
|
||||||
multibox = Integer.parseInt(val);
|
multibox = Integer.parseInt(val);
|
||||||
if (multibox < 1)
|
if (multibox < 1)
|
||||||
{
|
{
|
||||||
@@ -643,7 +643,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (command.startsWith("admin_tracert"))
|
else if (command.startsWith("admin_tracert"))
|
||||||
{
|
{
|
||||||
String[] data = command.split(" ");
|
final String[] data = command.split(" ");
|
||||||
L2PcInstance pl = null;
|
L2PcInstance pl = null;
|
||||||
if ((data.length > 1))
|
if ((data.length > 1))
|
||||||
{
|
{
|
||||||
@@ -651,7 +651,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
pl = (L2PcInstance) target;
|
pl = (L2PcInstance) target;
|
||||||
@@ -678,7 +678,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
String ip;
|
String ip;
|
||||||
int[][] trace = client.getTrace();
|
final int[][] trace = client.getTrace();
|
||||||
for (int i = 0; i < trace.length; i++)
|
for (int i = 0; i < trace.length; i++)
|
||||||
{
|
{
|
||||||
ip = "";
|
ip = "";
|
||||||
@@ -695,7 +695,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (command.startsWith("admin_summon_info"))
|
else if (command.startsWith("admin_summon_info"))
|
||||||
{
|
{
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
if (target instanceof L2Summon)
|
if (target instanceof L2Summon)
|
||||||
{
|
{
|
||||||
gatherSummonInfo((L2Summon) target, activeChar);
|
gatherSummonInfo((L2Summon) target, activeChar);
|
||||||
@@ -707,7 +707,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (command.startsWith("admin_unsummon"))
|
else if (command.startsWith("admin_unsummon"))
|
||||||
{
|
{
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
if (target instanceof L2Summon)
|
if (target instanceof L2Summon)
|
||||||
{
|
{
|
||||||
((L2Summon) target).unSummon(((L2Summon) target).getOwner());
|
((L2Summon) target).unSummon(((L2Summon) target).getOwner());
|
||||||
@@ -719,14 +719,14 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (command.startsWith("admin_summon_setlvl"))
|
else if (command.startsWith("admin_summon_setlvl"))
|
||||||
{
|
{
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
if (target instanceof L2PetInstance)
|
if (target instanceof L2PetInstance)
|
||||||
{
|
{
|
||||||
L2PetInstance pet = (L2PetInstance) target;
|
final L2PetInstance pet = (L2PetInstance) target;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(20);
|
final String val = command.substring(20);
|
||||||
int level = Integer.parseInt(val);
|
final int level = Integer.parseInt(val);
|
||||||
long newexp, oldexp = 0;
|
long newexp, oldexp = 0;
|
||||||
oldexp = pet.getStat().getExp();
|
oldexp = pet.getStat().getExp();
|
||||||
newexp = pet.getStat().getExpForLevel(level);
|
newexp = pet.getStat().getExpForLevel(level);
|
||||||
@@ -753,8 +753,8 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
L2Object target;
|
L2Object target;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(19);
|
final String val = command.substring(19);
|
||||||
int objId = Integer.parseInt(val);
|
final int objId = Integer.parseInt(val);
|
||||||
target = L2World.getInstance().getPet(objId);
|
target = L2World.getInstance().getPet(objId);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -777,7 +777,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
L2Object target;
|
L2Object target;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(16);
|
final String val = command.substring(16);
|
||||||
target = L2World.getInstance().getPlayer(val);
|
target = L2World.getInstance().getPlayer(val);
|
||||||
if (target == null)
|
if (target == null)
|
||||||
{
|
{
|
||||||
@@ -921,7 +921,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
return "<td align=center><a action=\"bypass -h admin_show_characters " + i + "\">Page " + (i + 1) + "</a></td>";
|
return "<td align=center><a action=\"bypass -h admin_show_characters " + i + "\">Page " + (i + 1) + "</a></td>";
|
||||||
}, player ->
|
}, player ->
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
sb.append("<tr>");
|
sb.append("<tr>");
|
||||||
sb.append("<td width=80><a action=\"bypass -h admin_character_info " + player.getName() + "\">" + player.getName() + "</a></td>");
|
sb.append("<td width=80><a action=\"bypass -h admin_character_info " + player.getName() + "\">" + player.getName() + "</a></td>");
|
||||||
sb.append("<td width=110>" + ClassListData.getInstance().getClass(player.getClassId()).getClientCode() + "</td><td width=40>" + player.getLevel() + "</td>");
|
sb.append("<td width=110>" + ClassListData.getInstance().getClass(player.getClassId()).getClientCode() + "</td><td width=40>" + player.getLevel() + "</td>");
|
||||||
@@ -946,7 +946,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
if (player == null)
|
if (player == null)
|
||||||
{
|
{
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
player = (L2PcInstance) target;
|
player = (L2PcInstance) target;
|
||||||
@@ -1042,7 +1042,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
private void setTargetKarma(L2PcInstance activeChar, int newKarma)
|
private void setTargetKarma(L2PcInstance activeChar, int newKarma)
|
||||||
{
|
{
|
||||||
// function to change karma of selected char
|
// function to change karma of selected char
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
L2PcInstance player = null;
|
L2PcInstance player = null;
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
@@ -1054,11 +1054,11 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
// for display
|
// for display
|
||||||
int oldKarma = player.getReputation();
|
final int oldKarma = player.getReputation();
|
||||||
// update reputation
|
// update reputation
|
||||||
player.setKarma(newKarma);
|
player.setKarma(newKarma);
|
||||||
// Common character information
|
// Common character information
|
||||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOUR_REPUTATION_HAS_BEEN_CHANGED_TO_S1);
|
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOUR_REPUTATION_HAS_BEEN_CHANGED_TO_S1);
|
||||||
sm.addInt(newKarma);
|
sm.addInt(newKarma);
|
||||||
player.sendPacket(sm);
|
player.sendPacket(sm);
|
||||||
// Admin information
|
// Admin information
|
||||||
@@ -1083,7 +1083,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
|
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
L2PcInstance player = (L2PcInstance) target;
|
final L2PcInstance player = (L2PcInstance) target;
|
||||||
gatherCharacterInfo(activeChar, player, "charedit.htm");
|
gatherCharacterInfo(activeChar, player, "charedit.htm");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1240,7 +1240,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
*/
|
*/
|
||||||
private void findCharactersPerAccount(L2PcInstance activeChar, String characterName) throws IllegalArgumentException
|
private void findCharactersPerAccount(L2PcInstance activeChar, String characterName) throws IllegalArgumentException
|
||||||
{
|
{
|
||||||
L2PcInstance player = L2World.getInstance().getPlayer(characterName);
|
final L2PcInstance player = L2World.getInstance().getPlayer(characterName);
|
||||||
if (player == null)
|
if (player == null)
|
||||||
{
|
{
|
||||||
throw new IllegalArgumentException("Player doesn't exist");
|
throw new IllegalArgumentException("Player doesn't exist");
|
||||||
@@ -1264,7 +1264,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
*/
|
*/
|
||||||
private void findDualbox(L2PcInstance activeChar, int multibox)
|
private void findDualbox(L2PcInstance activeChar, int multibox)
|
||||||
{
|
{
|
||||||
Map<String, List<L2PcInstance>> ipMap = new HashMap<>();
|
final Map<String, List<L2PcInstance>> ipMap = new HashMap<>();
|
||||||
String ip = "0.0.0.0";
|
String ip = "0.0.0.0";
|
||||||
L2GameClient client;
|
L2GameClient client;
|
||||||
final Map<String, Integer> dualboxIPs = new HashMap<>();
|
final Map<String, Integer> dualboxIPs = new HashMap<>();
|
||||||
@@ -1286,7 +1286,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
|
|
||||||
if (ipMap.get(ip).size() >= multibox)
|
if (ipMap.get(ip).size() >= multibox)
|
||||||
{
|
{
|
||||||
Integer count = dualboxIPs.get(ip);
|
final Integer count = dualboxIPs.get(ip);
|
||||||
if (count == null)
|
if (count == null)
|
||||||
{
|
{
|
||||||
dualboxIPs.put(ip, multibox);
|
dualboxIPs.put(ip, multibox);
|
||||||
@@ -1298,7 +1298,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> keys = new ArrayList<>(dualboxIPs.keySet());
|
final List<String> keys = new ArrayList<>(dualboxIPs.keySet());
|
||||||
keys.sort(Comparator.comparing(s -> dualboxIPs.get(s)).reversed());
|
keys.sort(Comparator.comparing(s -> dualboxIPs.get(s)).reversed());
|
||||||
|
|
||||||
final StringBuilder results = new StringBuilder();
|
final StringBuilder results = new StringBuilder();
|
||||||
@@ -1317,7 +1317,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
|
|
||||||
private void findDualboxStrict(L2PcInstance activeChar, int multibox)
|
private void findDualboxStrict(L2PcInstance activeChar, int multibox)
|
||||||
{
|
{
|
||||||
Map<IpPack, List<L2PcInstance>> ipMap = new HashMap<>();
|
final Map<IpPack, List<L2PcInstance>> ipMap = new HashMap<>();
|
||||||
L2GameClient client;
|
L2GameClient client;
|
||||||
final Map<IpPack, Integer> dualboxIPs = new HashMap<>();
|
final Map<IpPack, Integer> dualboxIPs = new HashMap<>();
|
||||||
|
|
||||||
@@ -1329,7 +1329,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
IpPack pack = new IpPack(client.getConnection().getInetAddress().getHostAddress(), client.getTrace());
|
final IpPack pack = new IpPack(client.getConnection().getInetAddress().getHostAddress(), client.getTrace());
|
||||||
if (ipMap.get(pack) == null)
|
if (ipMap.get(pack) == null)
|
||||||
{
|
{
|
||||||
ipMap.put(pack, new ArrayList<L2PcInstance>());
|
ipMap.put(pack, new ArrayList<L2PcInstance>());
|
||||||
@@ -1338,7 +1338,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
|
|
||||||
if (ipMap.get(pack).size() >= multibox)
|
if (ipMap.get(pack).size() >= multibox)
|
||||||
{
|
{
|
||||||
Integer count = dualboxIPs.get(pack);
|
final Integer count = dualboxIPs.get(pack);
|
||||||
if (count == null)
|
if (count == null)
|
||||||
{
|
{
|
||||||
dualboxIPs.put(pack, multibox);
|
dualboxIPs.put(pack, multibox);
|
||||||
@@ -1350,7 +1350,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<IpPack> keys = new ArrayList<>(dualboxIPs.keySet());
|
final List<IpPack> keys = new ArrayList<>(dualboxIPs.keySet());
|
||||||
keys.sort(Comparator.comparing(s -> dualboxIPs.get(s)).reversed());
|
keys.sort(Comparator.comparing(s -> dualboxIPs.get(s)).reversed());
|
||||||
|
|
||||||
final StringBuilder results = new StringBuilder();
|
final StringBuilder results = new StringBuilder();
|
||||||
@@ -1406,7 +1406,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
IpPack other = (IpPack) obj;
|
final IpPack other = (IpPack) obj;
|
||||||
if (!getOuterType().equals(other.getOuterType()))
|
if (!getOuterType().equals(other.getOuterType()))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@@ -1445,11 +1445,11 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
final NpcHtmlMessage html = new NpcHtmlMessage();
|
final NpcHtmlMessage html = new NpcHtmlMessage();
|
||||||
html.setFile(activeChar.getHtmlPrefix(), "html/admin/petinfo.htm");
|
html.setFile(activeChar.getHtmlPrefix(), "html/admin/petinfo.htm");
|
||||||
String name = target.getName();
|
final String name = target.getName();
|
||||||
html.replace("%name%", name == null ? "N/A" : name);
|
html.replace("%name%", name == null ? "N/A" : name);
|
||||||
html.replace("%level%", Integer.toString(target.getLevel()));
|
html.replace("%level%", Integer.toString(target.getLevel()));
|
||||||
html.replace("%exp%", Long.toString(target.getStat().getExp()));
|
html.replace("%exp%", Long.toString(target.getStat().getExp()));
|
||||||
String owner = target.getActingPlayer().getName();
|
final String owner = target.getActingPlayer().getName();
|
||||||
html.replace("%owner%", " <a action=\"bypass -h admin_character_info " + owner + "\">" + owner + "</a>");
|
html.replace("%owner%", " <a action=\"bypass -h admin_character_info " + owner + "\">" + owner + "</a>");
|
||||||
html.replace("%class%", target.getClass().getSimpleName());
|
html.replace("%class%", target.getClass().getSimpleName());
|
||||||
html.replace("%ai%", target.hasAI() ? String.valueOf(target.getAI().getIntention().name()) : "NULL");
|
html.replace("%ai%", target.hasAI() ? String.valueOf(target.getAI().getIntention().name()) : "NULL");
|
||||||
@@ -1459,7 +1459,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)
|
||||||
{
|
{
|
||||||
int objId = target.getActingPlayer().getObjectId();
|
final int objId = target.getActingPlayer().getObjectId();
|
||||||
html.replace("%inv%", " <a action=\"bypass admin_show_pet_inv " + objId + "\">view</a>");
|
html.replace("%inv%", " <a action=\"bypass admin_show_pet_inv " + objId + "\">view</a>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1484,7 +1484,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
|||||||
boolean color = true;
|
boolean color = true;
|
||||||
final NpcHtmlMessage html = new NpcHtmlMessage();
|
final NpcHtmlMessage html = new NpcHtmlMessage();
|
||||||
html.setFile(activeChar.getHtmlPrefix(), "html/admin/partyinfo.htm");
|
html.setFile(activeChar.getHtmlPrefix(), "html/admin/partyinfo.htm");
|
||||||
StringBuilder text = new StringBuilder(400);
|
final StringBuilder text = new StringBuilder(400);
|
||||||
for (L2PcInstance member : target.getParty().getMembers())
|
for (L2PcInstance member : target.getParty().getMembers())
|
||||||
{
|
{
|
||||||
if (color)
|
if (color)
|
||||||
|
@@ -101,7 +101,7 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
@Override
|
@Override
|
||||||
public boolean useAdminCommand(String command, L2PcInstance activeChar)
|
public boolean useAdminCommand(String command, L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
StringTokenizer st = new StringTokenizer(command);
|
final StringTokenizer st = new StringTokenizer(command);
|
||||||
st.nextToken();
|
st.nextToken();
|
||||||
|
|
||||||
if (command.equals("admin_invis_menu"))
|
if (command.equals("admin_invis_menu"))
|
||||||
@@ -162,11 +162,11 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val1 = st.nextToken();
|
final String val1 = st.nextToken();
|
||||||
int intensity = Integer.parseInt(val1);
|
final int intensity = Integer.parseInt(val1);
|
||||||
String val2 = st.nextToken();
|
final String val2 = st.nextToken();
|
||||||
int duration = Integer.parseInt(val2);
|
final int duration = Integer.parseInt(val2);
|
||||||
Earthquake eq = new Earthquake(activeChar.getX(), activeChar.getY(), activeChar.getZ(), intensity, duration);
|
final Earthquake eq = new Earthquake(activeChar.getX(), activeChar.getY(), activeChar.getZ(), intensity, duration);
|
||||||
activeChar.broadcastPacket(eq);
|
activeChar.broadcastPacket(eq);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -178,9 +178,9 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String type = st.nextToken();
|
final String type = st.nextToken();
|
||||||
String state = st.nextToken();
|
final String state = st.nextToken();
|
||||||
int duration = Integer.parseInt(st.nextToken());
|
final int duration = Integer.parseInt(st.nextToken());
|
||||||
adminAtmosphere(type, state, duration, activeChar);
|
adminAtmosphere(type, state, duration, activeChar);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -218,7 +218,7 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Collection<L2PcInstance> plrs = activeChar.getKnownList().getKnownPlayers().values();
|
final Collection<L2PcInstance> plrs = activeChar.getKnownList().getKnownPlayers().values();
|
||||||
for (L2PcInstance player : plrs)
|
for (L2PcInstance player : plrs)
|
||||||
{
|
{
|
||||||
if (!player.isGM())
|
if (!player.isGM())
|
||||||
@@ -237,7 +237,7 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Collection<L2PcInstance> plrs = activeChar.getKnownList().getKnownPlayers().values();
|
final Collection<L2PcInstance> plrs = activeChar.getKnownList().getKnownPlayers().values();
|
||||||
for (L2PcInstance player : plrs)
|
for (L2PcInstance player : plrs)
|
||||||
{
|
{
|
||||||
player.stopAbnormalVisualEffect(AbnormalVisualEffect.PARALYZE);
|
player.stopAbnormalVisualEffect(AbnormalVisualEffect.PARALYZE);
|
||||||
@@ -260,7 +260,7 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
L2Character player = null;
|
L2Character player = null;
|
||||||
if (target instanceof L2Character)
|
if (target instanceof L2Character)
|
||||||
{
|
{
|
||||||
@@ -293,7 +293,7 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
L2Character player = null;
|
L2Character player = null;
|
||||||
if (target instanceof L2Character)
|
if (target instanceof L2Character)
|
||||||
{
|
{
|
||||||
@@ -317,7 +317,7 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
L2Character player = null;
|
L2Character player = null;
|
||||||
if (target instanceof L2Character)
|
if (target instanceof L2Character)
|
||||||
{
|
{
|
||||||
@@ -333,7 +333,7 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
L2Character player = null;
|
L2Character player = null;
|
||||||
if (target instanceof L2Character)
|
if (target instanceof L2Character)
|
||||||
{
|
{
|
||||||
@@ -349,12 +349,12 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int val = Integer.parseInt(st.nextToken());
|
final int val = Integer.parseInt(st.nextToken());
|
||||||
boolean sendMessage = activeChar.isAffectedBySkill(7029);
|
final boolean sendMessage = activeChar.isAffectedBySkill(7029);
|
||||||
activeChar.stopSkillEffects((val == 0) && sendMessage, 7029);
|
activeChar.stopSkillEffects((val == 0) && sendMessage, 7029);
|
||||||
if ((val >= 1) && (val <= 4))
|
if ((val >= 1) && (val <= 4))
|
||||||
{
|
{
|
||||||
Skill gmSpeedSkill = SkillData.getInstance().getSkill(7029, val);
|
final Skill gmSpeedSkill = SkillData.getInstance().getSkill(7029, val);
|
||||||
activeChar.doSimultaneousCast(gmSpeedSkill);
|
activeChar.doSimultaneousCast(gmSpeedSkill);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -372,12 +372,12 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String id = st.nextToken();
|
final String id = st.nextToken();
|
||||||
activeChar.getPoly().setPolyInfo("npc", id);
|
activeChar.getPoly().setPolyInfo("npc", id);
|
||||||
activeChar.teleToLocation(activeChar.getLocation());
|
activeChar.teleToLocation(activeChar.getLocation());
|
||||||
CharInfo info1 = new CharInfo(activeChar);
|
final CharInfo info1 = new CharInfo(activeChar);
|
||||||
activeChar.broadcastPacket(info1);
|
activeChar.broadcastPacket(info1);
|
||||||
UserInfo info2 = new UserInfo(activeChar);
|
final UserInfo info2 = new UserInfo(activeChar);
|
||||||
activeChar.sendPacket(info2);
|
activeChar.sendPacket(info2);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -390,16 +390,16 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
activeChar.getPoly().setPolyInfo(null, "1");
|
activeChar.getPoly().setPolyInfo(null, "1");
|
||||||
activeChar.decayMe();
|
activeChar.decayMe();
|
||||||
activeChar.spawnMe(activeChar.getX(), activeChar.getY(), activeChar.getZ());
|
activeChar.spawnMe(activeChar.getX(), activeChar.getY(), activeChar.getZ());
|
||||||
CharInfo info1 = new CharInfo(activeChar);
|
final CharInfo info1 = new CharInfo(activeChar);
|
||||||
activeChar.broadcastPacket(info1);
|
activeChar.broadcastPacket(info1);
|
||||||
UserInfo info2 = new UserInfo(activeChar);
|
final UserInfo info2 = new UserInfo(activeChar);
|
||||||
activeChar.sendPacket(info2);
|
activeChar.sendPacket(info2);
|
||||||
}
|
}
|
||||||
else if (command.equals("admin_clearteams"))
|
else if (command.equals("admin_clearteams"))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Collection<L2PcInstance> plrs = activeChar.getKnownList().getKnownPlayers().values();
|
final Collection<L2PcInstance> plrs = activeChar.getKnownList().getKnownPlayers().values();
|
||||||
for (L2PcInstance player : plrs)
|
for (L2PcInstance player : plrs)
|
||||||
{
|
{
|
||||||
player.setTeam(Team.NONE);
|
player.setTeam(Team.NONE);
|
||||||
@@ -414,14 +414,14 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = st.nextToken();
|
final String val = st.nextToken();
|
||||||
int radius = 400;
|
int radius = 400;
|
||||||
if (st.hasMoreTokens())
|
if (st.hasMoreTokens())
|
||||||
{
|
{
|
||||||
radius = Integer.parseInt(st.nextToken());
|
radius = Integer.parseInt(st.nextToken());
|
||||||
}
|
}
|
||||||
Team team = Team.valueOf(val.toUpperCase());
|
final Team team = Team.valueOf(val.toUpperCase());
|
||||||
Collection<L2Character> plrs = activeChar.getKnownList().getKnownCharactersInRadius(radius);
|
final Collection<L2Character> plrs = activeChar.getKnownList().getKnownCharactersInRadius(radius);
|
||||||
|
|
||||||
for (L2Character player : plrs)
|
for (L2Character player : plrs)
|
||||||
{
|
{
|
||||||
@@ -437,7 +437,7 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Team team = Team.valueOf(st.nextToken().toUpperCase());
|
final Team team = Team.valueOf(st.nextToken().toUpperCase());
|
||||||
L2Character target = null;
|
L2Character target = null;
|
||||||
if (activeChar.getTarget() instanceof L2Character)
|
if (activeChar.getTarget() instanceof L2Character)
|
||||||
{
|
{
|
||||||
@@ -462,11 +462,11 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
L2Object obj = activeChar.getTarget();
|
L2Object obj = activeChar.getTarget();
|
||||||
if (st.countTokens() == 2)
|
if (st.countTokens() == 2)
|
||||||
{
|
{
|
||||||
int social = Integer.parseInt(st.nextToken());
|
final int social = Integer.parseInt(st.nextToken());
|
||||||
target = st.nextToken();
|
target = st.nextToken();
|
||||||
if (target != null)
|
if (target != null)
|
||||||
{
|
{
|
||||||
L2PcInstance player = L2World.getInstance().getPlayer(target);
|
final L2PcInstance player = L2World.getInstance().getPlayer(target);
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
if (performSocial(social, player, activeChar))
|
if (performSocial(social, player, activeChar))
|
||||||
@@ -478,8 +478,8 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int radius = Integer.parseInt(target);
|
final int radius = Integer.parseInt(target);
|
||||||
Collection<L2Object> objs = activeChar.getKnownList().getKnownObjects().values();
|
final Collection<L2Object> objs = activeChar.getKnownList().getKnownObjects().values();
|
||||||
for (L2Object object : objs)
|
for (L2Object object : objs)
|
||||||
{
|
{
|
||||||
if (activeChar.isInsideRadius(object, radius, false, false))
|
if (activeChar.isInsideRadius(object, radius, false, false))
|
||||||
@@ -498,7 +498,7 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (st.countTokens() == 1)
|
else if (st.countTokens() == 1)
|
||||||
{
|
{
|
||||||
int social = Integer.parseInt(st.nextToken());
|
final int social = Integer.parseInt(st.nextToken());
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
{
|
{
|
||||||
obj = activeChar;
|
obj = activeChar;
|
||||||
@@ -600,7 +600,7 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
L2Object obj = activeChar.getTarget();
|
L2Object obj = activeChar.getTarget();
|
||||||
int level = 1, hittime = 1;
|
int level = 1, hittime = 1;
|
||||||
int skill = Integer.parseInt(st.nextToken());
|
final int skill = Integer.parseInt(st.nextToken());
|
||||||
if (st.hasMoreTokens())
|
if (st.hasMoreTokens())
|
||||||
{
|
{
|
||||||
level = Integer.parseInt(st.nextToken());
|
level = Integer.parseInt(st.nextToken());
|
||||||
@@ -619,7 +619,7 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
L2Character target = (L2Character) obj;
|
final L2Character target = (L2Character) obj;
|
||||||
target.broadcastPacket(new MagicSkillUse(target, activeChar, skill, level, hittime, 0));
|
target.broadcastPacket(new MagicSkillUse(target, activeChar, skill, level, hittime, 0));
|
||||||
activeChar.sendMessage(obj.getName() + " performs MSU " + skill + "/" + level + " by your request.");
|
activeChar.sendMessage(obj.getName() + " performs MSU " + skill + "/" + level + " by your request.");
|
||||||
}
|
}
|
||||||
@@ -632,17 +632,17 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (command.startsWith("admin_set_displayeffect"))
|
else if (command.startsWith("admin_set_displayeffect"))
|
||||||
{
|
{
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
if (!(target instanceof L2Npc))
|
if (!(target instanceof L2Npc))
|
||||||
{
|
{
|
||||||
activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
|
activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
L2Npc npc = (L2Npc) target;
|
final L2Npc npc = (L2Npc) target;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String type = st.nextToken();
|
final String type = st.nextToken();
|
||||||
int diplayeffect = Integer.parseInt(type);
|
final int diplayeffect = Integer.parseInt(type);
|
||||||
npc.setDisplayEffect(diplayeffect);
|
npc.setDisplayEffect(diplayeffect);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@@ -702,7 +702,7 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
activeChar.sendPacket(SystemMessageId.NOTHING_HAPPENED);
|
activeChar.sendPacket(SystemMessageId.NOTHING_HAPPENED);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
L2Character character = (L2Character) target;
|
final L2Character character = (L2Character) target;
|
||||||
character.broadcastPacket(new SocialAction(character.getObjectId(), action));
|
character.broadcastPacket(new SocialAction(character.getObjectId(), action));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -760,7 +760,7 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
|
|
||||||
private void playAdminSound(L2PcInstance activeChar, String sound)
|
private void playAdminSound(L2PcInstance activeChar, String sound)
|
||||||
{
|
{
|
||||||
PlaySound _snd = new PlaySound(1, sound, 0, 0, 0, 0, 0);
|
final PlaySound _snd = new PlaySound(1, sound, 0, 0, 0, 0, 0);
|
||||||
activeChar.sendPacket(_snd);
|
activeChar.sendPacket(_snd);
|
||||||
activeChar.broadcastPacket(_snd);
|
activeChar.broadcastPacket(_snd);
|
||||||
activeChar.sendMessage("Playing " + sound + ".");
|
activeChar.sendMessage("Playing " + sound + ".");
|
||||||
|
@@ -82,10 +82,10 @@ public class AdminElement implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String[] args = command.split(" ");
|
final String[] args = command.split(" ");
|
||||||
|
|
||||||
byte element = Elementals.getElementId(args[1]);
|
final byte element = Elementals.getElementId(args[1]);
|
||||||
int value = Integer.parseInt(args[2]);
|
final int value = Integer.parseInt(args[2]);
|
||||||
if ((element < -1) || (element > 5) || (value < 0) || (value > 450))
|
if ((element < -1) || (element > 5) || (value < 0) || (value > 450))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Usage: //setlh/setlc/setlg/setlb/setll/setlw/setls <element> <value>[0-450]");
|
activeChar.sendMessage("Usage: //setlh/setlc/setlg/setlb/setll/setlw/setls <element> <value>[0-450]");
|
||||||
@@ -132,7 +132,7 @@ public class AdminElement implements IAdminCommandHandler
|
|||||||
L2ItemInstance itemInstance = null;
|
L2ItemInstance itemInstance = null;
|
||||||
|
|
||||||
// only attempt to enchant if there is a weapon equipped
|
// only attempt to enchant if there is a weapon equipped
|
||||||
L2ItemInstance parmorInstance = player.getInventory().getPaperdollItem(armorType);
|
final L2ItemInstance parmorInstance = player.getInventory().getPaperdollItem(armorType);
|
||||||
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType))
|
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType))
|
||||||
{
|
{
|
||||||
itemInstance = parmorInstance;
|
itemInstance = parmorInstance;
|
||||||
@@ -141,7 +141,7 @@ public class AdminElement implements IAdminCommandHandler
|
|||||||
if (itemInstance != null)
|
if (itemInstance != null)
|
||||||
{
|
{
|
||||||
String old, current;
|
String old, current;
|
||||||
Elementals element = itemInstance.getElemental(type);
|
final Elementals element = itemInstance.getElemental(type);
|
||||||
if (element == null)
|
if (element == null)
|
||||||
{
|
{
|
||||||
old = "None";
|
old = "None";
|
||||||
@@ -173,7 +173,7 @@ public class AdminElement implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
// send packets
|
// send packets
|
||||||
InventoryUpdate iu = new InventoryUpdate();
|
final InventoryUpdate iu = new InventoryUpdate();
|
||||||
iu.addModifiedItem(itemInstance);
|
iu.addModifiedItem(itemInstance);
|
||||||
player.sendPacket(iu);
|
player.sendPacket(iu);
|
||||||
|
|
||||||
|
@@ -135,7 +135,7 @@ public class AdminEnchant implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int ench = Integer.parseInt(command.substring(12));
|
final int ench = Integer.parseInt(command.substring(12));
|
||||||
|
|
||||||
// check value
|
// check value
|
||||||
if ((ench < 0) || (ench > 127))
|
if ((ench < 0) || (ench > 127))
|
||||||
@@ -196,7 +196,7 @@ public class AdminEnchant implements IAdminCommandHandler
|
|||||||
L2ItemInstance itemInstance = null;
|
L2ItemInstance itemInstance = null;
|
||||||
|
|
||||||
// only attempt to enchant if there is a weapon equipped
|
// only attempt to enchant if there is a weapon equipped
|
||||||
L2ItemInstance parmorInstance = player.getInventory().getPaperdollItem(armorType);
|
final L2ItemInstance parmorInstance = player.getInventory().getPaperdollItem(armorType);
|
||||||
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType))
|
if ((parmorInstance != null) && (parmorInstance.getLocationSlot() == armorType))
|
||||||
{
|
{
|
||||||
itemInstance = parmorInstance;
|
itemInstance = parmorInstance;
|
||||||
@@ -212,7 +212,7 @@ public class AdminEnchant implements IAdminCommandHandler
|
|||||||
player.getInventory().equipItem(itemInstance);
|
player.getInventory().equipItem(itemInstance);
|
||||||
|
|
||||||
// send packets
|
// send packets
|
||||||
InventoryUpdate iu = new InventoryUpdate();
|
final InventoryUpdate iu = new InventoryUpdate();
|
||||||
iu.addModifiedItem(itemInstance);
|
iu.addModifiedItem(itemInstance);
|
||||||
player.sendPacket(iu);
|
player.sendPacket(iu);
|
||||||
player.broadcastPacket(new CharInfo(player));
|
player.broadcastPacket(new CharInfo(player));
|
||||||
|
@@ -87,7 +87,7 @@ public class AdminEventEngine implements IAdminCommandHandler
|
|||||||
public boolean useAdminCommand(String command, L2PcInstance activeChar)
|
public boolean useAdminCommand(String command, L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
StringTokenizer st = new StringTokenizer(command);
|
StringTokenizer st = new StringTokenizer(command);
|
||||||
String actualCommand = st.nextToken();
|
final String actualCommand = st.nextToken();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (actualCommand.equals("admin_event"))
|
if (actualCommand.equals("admin_event"))
|
||||||
@@ -116,7 +116,7 @@ public class AdminEventEngine implements IAdminCommandHandler
|
|||||||
else if (actualCommand.startsWith("admin_event_see"))
|
else if (actualCommand.startsWith("admin_event_see"))
|
||||||
{
|
{
|
||||||
// There is an exception here for not using the ST. We use spaces (ST delim) for the event name.
|
// There is an exception here for not using the ST. We use spaces (ST delim) for the event name.
|
||||||
String eventName = command.substring(16);
|
final String eventName = command.substring(16);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||||
@@ -145,8 +145,8 @@ public class AdminEventEngine implements IAdminCommandHandler
|
|||||||
else if (actualCommand.startsWith("admin_event_del"))
|
else if (actualCommand.startsWith("admin_event_del"))
|
||||||
{
|
{
|
||||||
// There is an exception here for not using the ST. We use spaces (ST delim) for the event name.
|
// There is an exception here for not using the ST. We use spaces (ST delim) for the event name.
|
||||||
String eventName = command.substring(16);
|
final String eventName = command.substring(16);
|
||||||
File file = new File(Config.DATAPACK_ROOT + "events/" + eventName);
|
final File file = new File(Config.DATAPACK_ROOT + "events/" + eventName);
|
||||||
file.delete();
|
file.delete();
|
||||||
showMainPage(activeChar);
|
showMainPage(activeChar);
|
||||||
}
|
}
|
||||||
@@ -222,7 +222,7 @@ public class AdminEventEngine implements IAdminCommandHandler
|
|||||||
activeChar.sendMessage(L2Event.startEventParticipation());
|
activeChar.sendMessage(L2Event.startEventParticipation());
|
||||||
Broadcast.toAllOnlinePlayers(activeChar.getName() + " has started an event. You will find a participation NPC somewhere around you.");
|
Broadcast.toAllOnlinePlayers(activeChar.getName() + " has started an event. You will find a participation NPC somewhere around you.");
|
||||||
|
|
||||||
PlaySound _snd = new PlaySound(1, "B03_F", 0, 0, 0, 0, 0);
|
final PlaySound _snd = new PlaySound(1, "B03_F", 0, 0, 0, 0, 0);
|
||||||
activeChar.sendPacket(_snd);
|
activeChar.sendPacket(_snd);
|
||||||
activeChar.broadcastPacket(_snd);
|
activeChar.broadcastPacket(_snd);
|
||||||
|
|
||||||
@@ -247,7 +247,7 @@ public class AdminEventEngine implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
while (st.hasMoreElements()) // Every next ST should be a team number
|
while (st.hasMoreElements()) // Every next ST should be a team number
|
||||||
{
|
{
|
||||||
int teamId = Integer.parseInt(st.nextToken());
|
final int teamId = Integer.parseInt(st.nextToken());
|
||||||
|
|
||||||
for (L2PcInstance player : L2Event._teams.get(teamId))
|
for (L2PcInstance player : L2Event._teams.get(teamId))
|
||||||
{
|
{
|
||||||
@@ -314,8 +314,8 @@ public class AdminEventEngine implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (actualCommand.startsWith("admin_event_control_poly"))
|
else if (actualCommand.startsWith("admin_event_control_poly"))
|
||||||
{
|
{
|
||||||
int teamId = Integer.parseInt(st.nextToken());
|
final int teamId = Integer.parseInt(st.nextToken());
|
||||||
String[] polyIds = new String[st.countTokens()];
|
final String[] polyIds = new String[st.countTokens()];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (st.hasMoreElements()) // Every next ST should be a polymorph ID
|
while (st.hasMoreElements()) // Every next ST should be a polymorph ID
|
||||||
{
|
{
|
||||||
@@ -326,9 +326,9 @@ public class AdminEventEngine implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
player.getPoly().setPolyInfo("npc", polyIds[Rnd.get(polyIds.length)]);
|
player.getPoly().setPolyInfo("npc", polyIds[Rnd.get(polyIds.length)]);
|
||||||
player.teleToLocation(player.getLocation(), true);
|
player.teleToLocation(player.getLocation(), true);
|
||||||
CharInfo info1 = new CharInfo(player);
|
final CharInfo info1 = new CharInfo(player);
|
||||||
player.broadcastPacket(info1);
|
player.broadcastPacket(info1);
|
||||||
UserInfo info2 = new UserInfo(player);
|
final UserInfo info2 = new UserInfo(player);
|
||||||
player.sendPacket(info2);
|
player.sendPacket(info2);
|
||||||
}
|
}
|
||||||
showEventControl(activeChar);
|
showEventControl(activeChar);
|
||||||
@@ -342,9 +342,9 @@ public class AdminEventEngine implements IAdminCommandHandler
|
|||||||
player.getPoly().setPolyInfo(null, "1");
|
player.getPoly().setPolyInfo(null, "1");
|
||||||
player.decayMe();
|
player.decayMe();
|
||||||
player.spawnMe(player.getX(), player.getY(), player.getZ());
|
player.spawnMe(player.getX(), player.getY(), player.getZ());
|
||||||
CharInfo info1 = new CharInfo(player);
|
final CharInfo info1 = new CharInfo(player);
|
||||||
player.broadcastPacket(info1);
|
player.broadcastPacket(info1);
|
||||||
UserInfo info2 = new UserInfo(player);
|
final UserInfo info2 = new UserInfo(player);
|
||||||
player.sendPacket(info2);
|
player.sendPacket(info2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -352,8 +352,8 @@ public class AdminEventEngine implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (actualCommand.startsWith("admin_event_control_transform"))
|
else if (actualCommand.startsWith("admin_event_control_transform"))
|
||||||
{
|
{
|
||||||
int teamId = Integer.parseInt(st.nextToken());
|
final int teamId = Integer.parseInt(st.nextToken());
|
||||||
int[] transIds = new int[st.countTokens()];
|
final int[] transIds = new int[st.countTokens()];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (st.hasMoreElements()) // Every next ST should be a transform ID
|
while (st.hasMoreElements()) // Every next ST should be a transform ID
|
||||||
{
|
{
|
||||||
@@ -362,7 +362,7 @@ public class AdminEventEngine implements IAdminCommandHandler
|
|||||||
|
|
||||||
for (L2PcInstance player : L2Event._teams.get(teamId))
|
for (L2PcInstance player : L2Event._teams.get(teamId))
|
||||||
{
|
{
|
||||||
int transId = transIds[Rnd.get(transIds.length)];
|
final int transId = transIds[Rnd.get(transIds.length)];
|
||||||
if (!TransformData.getInstance().transformPlayer(transId, player))
|
if (!TransformData.getInstance().transformPlayer(transId, player))
|
||||||
{
|
{
|
||||||
AdminData.getInstance().broadcastMessageToGMs("EventEngine: Unknow transformation id: " + transId);
|
AdminData.getInstance().broadcastMessageToGMs("EventEngine: Unknow transformation id: " + transId);
|
||||||
@@ -387,7 +387,7 @@ public class AdminEventEngine implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
while (st.hasMoreElements())
|
while (st.hasMoreElements())
|
||||||
{
|
{
|
||||||
L2PcInstance player = L2World.getInstance().getPlayer(st.nextToken());
|
final L2PcInstance player = L2World.getInstance().getPlayer(st.nextToken());
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
L2Event.removeAndResetPlayer(player);
|
L2Event.removeAndResetPlayer(player);
|
||||||
@@ -405,15 +405,15 @@ public class AdminEventEngine implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (actualCommand.startsWith("admin_event_control_prize"))
|
else if (actualCommand.startsWith("admin_event_control_prize"))
|
||||||
{
|
{
|
||||||
int[] teamIds = new int[st.countTokens() - 2];
|
final int[] teamIds = new int[st.countTokens() - 2];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while ((st.countTokens() - 2) > 0) // The last 2 tokens are used for "n" and "item id"
|
while ((st.countTokens() - 2) > 0) // The last 2 tokens are used for "n" and "item id"
|
||||||
{
|
{
|
||||||
teamIds[i++] = Integer.parseInt(st.nextToken());
|
teamIds[i++] = Integer.parseInt(st.nextToken());
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] n = st.nextToken().split("\\*");
|
final String[] n = st.nextToken().split("\\*");
|
||||||
int itemId = Integer.parseInt(st.nextToken());
|
final int itemId = Integer.parseInt(st.nextToken());
|
||||||
|
|
||||||
for (int teamId : teamIds)
|
for (int teamId : teamIds)
|
||||||
{
|
{
|
||||||
@@ -525,7 +525,7 @@ public class AdminEventEngine implements IAdminCommandHandler
|
|||||||
public void showEventParameters(L2PcInstance activeChar, int teamnumbers)
|
public void showEventParameters(L2PcInstance activeChar, int teamnumbers)
|
||||||
{
|
{
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||||
StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
sb.append("<html><body><title>[ L2J EVENT ENGINE ]</title><br><center> Current event: <font color=\"LEVEL\">");
|
sb.append("<html><body><title>[ L2J EVENT ENGINE ]</title><br><center> Current event: <font color=\"LEVEL\">");
|
||||||
sb.append(L2Event._eventName);
|
sb.append(L2Event._eventName);
|
||||||
@@ -563,7 +563,7 @@ public class AdminEventEngine implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
|
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||||
StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
sb.append("<html><title>[ L2J EVENT ENGINE ]</title><body><br><center>Current event: <font color=\"LEVEL\">");
|
sb.append("<html><title>[ L2J EVENT ENGINE ]</title><body><br><center>Current event: <font color=\"LEVEL\">");
|
||||||
sb.append(L2Event._eventName);
|
sb.append(L2Event._eventName);
|
||||||
sb.append("</font></center><br><table cellspacing=-1 width=280><tr><td align=center>Type the team ID(s) that will be affected by the commands. Commands with '*' work with only 1 team ID in the field, while '!' - none.</td></tr><tr><td align=center><edit var=\"team_number\" width=100 height=15></td></tr>");
|
sb.append("</font></center><br><table cellspacing=-1 width=280><tr><td align=center>Type the team ID(s) that will be affected by the commands. Commands with '*' work with only 1 team ID in the field, while '!' - none.</td></tr><tr><td align=center><edit var=\"team_number\" width=100 height=15></td></tr>");
|
||||||
|
@@ -56,7 +56,7 @@ public class AdminEvents implements IAdminCommandHandler
|
|||||||
|
|
||||||
String event_name = "";
|
String event_name = "";
|
||||||
String _event_bypass = "";
|
String _event_bypass = "";
|
||||||
StringTokenizer st = new StringTokenizer(command, " ");
|
final StringTokenizer st = new StringTokenizer(command, " ");
|
||||||
st.nextToken();
|
st.nextToken();
|
||||||
if (st.hasMoreTokens())
|
if (st.hasMoreTokens())
|
||||||
{
|
{
|
||||||
@@ -78,7 +78,7 @@ public class AdminEvents implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
if (event_name != null)
|
if (event_name != null)
|
||||||
{
|
{
|
||||||
Event event = (Event) QuestManager.getInstance().getQuest(event_name);
|
final Event event = (Event) QuestManager.getInstance().getQuest(event_name);
|
||||||
if (event != null)
|
if (event != null)
|
||||||
{
|
{
|
||||||
if (event.eventStart(activeChar))
|
if (event.eventStart(activeChar))
|
||||||
@@ -105,7 +105,7 @@ public class AdminEvents implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
if (event_name != null)
|
if (event_name != null)
|
||||||
{
|
{
|
||||||
Event event = (Event) QuestManager.getInstance().getQuest(event_name);
|
final Event event = (Event) QuestManager.getInstance().getQuest(event_name);
|
||||||
if (event != null)
|
if (event != null)
|
||||||
{
|
{
|
||||||
if (event.eventStop())
|
if (event.eventStop())
|
||||||
@@ -132,7 +132,7 @@ public class AdminEvents implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
if (event_name != null)
|
if (event_name != null)
|
||||||
{
|
{
|
||||||
Event event = (Event) QuestManager.getInstance().getQuest(event_name);
|
final Event event = (Event) QuestManager.getInstance().getQuest(event_name);
|
||||||
if (event != null)
|
if (event != null)
|
||||||
{
|
{
|
||||||
event.eventBypass(activeChar, _event_bypass);
|
event.eventBypass(activeChar, _event_bypass);
|
||||||
|
@@ -52,7 +52,7 @@ public class AdminExpSp implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(16);
|
final String val = command.substring(16);
|
||||||
if (!adminAddExpSp(activeChar, val))
|
if (!adminAddExpSp(activeChar, val))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Usage: //add_exp_sp exp sp");
|
activeChar.sendMessage("Usage: //add_exp_sp exp sp");
|
||||||
@@ -67,7 +67,7 @@ public class AdminExpSp implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String val = command.substring(19);
|
final String val = command.substring(19);
|
||||||
if (!adminRemoveExpSP(activeChar, val))
|
if (!adminRemoveExpSP(activeChar, val))
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Usage: //remove_exp_sp exp sp");
|
activeChar.sendMessage("Usage: //remove_exp_sp exp sp");
|
||||||
@@ -90,7 +90,7 @@ public class AdminExpSp implements IAdminCommandHandler
|
|||||||
|
|
||||||
private void addExpSp(L2PcInstance activeChar)
|
private void addExpSp(L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
L2PcInstance player = null;
|
L2PcInstance player = null;
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
@@ -113,7 +113,7 @@ public class AdminExpSp implements IAdminCommandHandler
|
|||||||
|
|
||||||
private boolean adminAddExpSp(L2PcInstance activeChar, String ExpSp)
|
private boolean adminAddExpSp(L2PcInstance activeChar, String ExpSp)
|
||||||
{
|
{
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
L2PcInstance player = null;
|
L2PcInstance player = null;
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
@@ -124,14 +124,14 @@ public class AdminExpSp implements IAdminCommandHandler
|
|||||||
activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
|
activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
StringTokenizer st = new StringTokenizer(ExpSp);
|
final StringTokenizer st = new StringTokenizer(ExpSp);
|
||||||
if (st.countTokens() != 2)
|
if (st.countTokens() != 2)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
String exp = st.nextToken();
|
final String exp = st.nextToken();
|
||||||
String sp = st.nextToken();
|
final String sp = st.nextToken();
|
||||||
long expval = 0;
|
long expval = 0;
|
||||||
long spval = 0;
|
long spval = 0;
|
||||||
try
|
try
|
||||||
@@ -160,7 +160,7 @@ public class AdminExpSp implements IAdminCommandHandler
|
|||||||
|
|
||||||
private boolean adminRemoveExpSP(L2PcInstance activeChar, String ExpSp)
|
private boolean adminRemoveExpSP(L2PcInstance activeChar, String ExpSp)
|
||||||
{
|
{
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
L2PcInstance player = null;
|
L2PcInstance player = null;
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
@@ -171,14 +171,14 @@ public class AdminExpSp implements IAdminCommandHandler
|
|||||||
activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
|
activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
StringTokenizer st = new StringTokenizer(ExpSp);
|
final StringTokenizer st = new StringTokenizer(ExpSp);
|
||||||
if (st.countTokens() != 2)
|
if (st.countTokens() != 2)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
String exp = st.nextToken();
|
final String exp = st.nextToken();
|
||||||
String sp = st.nextToken();
|
final String sp = st.nextToken();
|
||||||
long expval = 0;
|
long expval = 0;
|
||||||
int spval = 0;
|
int spval = 0;
|
||||||
try
|
try
|
||||||
|
@@ -78,14 +78,14 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
|||||||
|
|
||||||
private void handleStart(String params, L2PcInstance activeChar)
|
private void handleStart(String params, L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
StringTokenizer st = new StringTokenizer(params);
|
final StringTokenizer st = new StringTokenizer(params);
|
||||||
int lvl1 = 0;
|
int lvl1 = 0;
|
||||||
int lvl2 = 0;
|
int lvl2 = 0;
|
||||||
int mid1 = 0;
|
int mid1 = 0;
|
||||||
int mid2 = 0;
|
int mid2 = 0;
|
||||||
while (st.hasMoreTokens())
|
while (st.hasMoreTokens())
|
||||||
{
|
{
|
||||||
String s = st.nextToken();
|
final String s = st.nextToken();
|
||||||
if (s.equals("lvl1"))
|
if (s.equals("lvl1"))
|
||||||
{
|
{
|
||||||
lvl1 = Integer.parseInt(st.nextToken());
|
lvl1 = Integer.parseInt(st.nextToken());
|
||||||
@@ -182,7 +182,7 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
int mid1 = 0;
|
int mid1 = 0;
|
||||||
int mid2 = 0;
|
int mid2 = 0;
|
||||||
StringTokenizer st = new StringTokenizer(params);
|
final StringTokenizer st = new StringTokenizer(params);
|
||||||
mid1 = Integer.parseInt(st.nextToken());
|
mid1 = Integer.parseInt(st.nextToken());
|
||||||
mid2 = Integer.parseInt(st.nextToken());
|
mid2 = Integer.parseInt(st.nextToken());
|
||||||
|
|
||||||
@@ -212,17 +212,17 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
|||||||
|
|
||||||
for (int i = 0; i < 10000; i++)
|
for (int i = 0; i < 10000; i++)
|
||||||
{
|
{
|
||||||
boolean _miss1 = Formulas.calcHitMiss(npc1, npc2);
|
final boolean _miss1 = Formulas.calcHitMiss(npc1, npc2);
|
||||||
if (_miss1)
|
if (_miss1)
|
||||||
{
|
{
|
||||||
miss1++;
|
miss1++;
|
||||||
}
|
}
|
||||||
byte _shld1 = Formulas.calcShldUse(npc1, npc2, null, false);
|
final byte _shld1 = Formulas.calcShldUse(npc1, npc2, null, false);
|
||||||
if (_shld1 > 0)
|
if (_shld1 > 0)
|
||||||
{
|
{
|
||||||
shld1++;
|
shld1++;
|
||||||
}
|
}
|
||||||
boolean _crit1 = Formulas.calcCrit(npc1, npc2);
|
final boolean _crit1 = Formulas.calcCrit(npc1, npc2);
|
||||||
if (_crit1)
|
if (_crit1)
|
||||||
{
|
{
|
||||||
crit1++;
|
crit1++;
|
||||||
@@ -232,12 +232,12 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
|||||||
_patk1 += npc1.getRandomDamageMultiplier();
|
_patk1 += npc1.getRandomDamageMultiplier();
|
||||||
patk1 += _patk1;
|
patk1 += _patk1;
|
||||||
|
|
||||||
double _pdef1 = npc1.getPDef(npc2);
|
final double _pdef1 = npc1.getPDef(npc2);
|
||||||
pdef1 += _pdef1;
|
pdef1 += _pdef1;
|
||||||
|
|
||||||
if (!_miss1)
|
if (!_miss1)
|
||||||
{
|
{
|
||||||
double _dmg1 = Formulas.calcPhysDam(npc1, npc2, null, _shld1, _crit1, false);
|
final double _dmg1 = Formulas.calcPhysDam(npc1, npc2, null, _shld1, _crit1, false);
|
||||||
dmg1 += _dmg1;
|
dmg1 += _dmg1;
|
||||||
npc1.abortAttack();
|
npc1.abortAttack();
|
||||||
}
|
}
|
||||||
@@ -245,17 +245,17 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
|||||||
|
|
||||||
for (int i = 0; i < 10000; i++)
|
for (int i = 0; i < 10000; i++)
|
||||||
{
|
{
|
||||||
boolean _miss2 = Formulas.calcHitMiss(npc2, npc1);
|
final boolean _miss2 = Formulas.calcHitMiss(npc2, npc1);
|
||||||
if (_miss2)
|
if (_miss2)
|
||||||
{
|
{
|
||||||
miss2++;
|
miss2++;
|
||||||
}
|
}
|
||||||
byte _shld2 = Formulas.calcShldUse(npc2, npc1, null, false);
|
final byte _shld2 = Formulas.calcShldUse(npc2, npc1, null, false);
|
||||||
if (_shld2 > 0)
|
if (_shld2 > 0)
|
||||||
{
|
{
|
||||||
shld2++;
|
shld2++;
|
||||||
}
|
}
|
||||||
boolean _crit2 = Formulas.calcCrit(npc2, npc1);
|
final boolean _crit2 = Formulas.calcCrit(npc2, npc1);
|
||||||
if (_crit2)
|
if (_crit2)
|
||||||
{
|
{
|
||||||
crit2++;
|
crit2++;
|
||||||
@@ -265,12 +265,12 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
|||||||
_patk2 *= npc2.getRandomDamageMultiplier();
|
_patk2 *= npc2.getRandomDamageMultiplier();
|
||||||
patk2 += _patk2;
|
patk2 += _patk2;
|
||||||
|
|
||||||
double _pdef2 = npc2.getPDef(npc1);
|
final double _pdef2 = npc2.getPDef(npc1);
|
||||||
pdef2 += _pdef2;
|
pdef2 += _pdef2;
|
||||||
|
|
||||||
if (!_miss2)
|
if (!_miss2)
|
||||||
{
|
{
|
||||||
double _dmg2 = Formulas.calcPhysDam(npc2, npc1, null, _shld2, _crit2, false);
|
final double _dmg2 = Formulas.calcPhysDam(npc2, npc1, null, _shld2, _crit2, false);
|
||||||
dmg2 += _dmg2;
|
dmg2 += _dmg2;
|
||||||
npc2.abortAttack();
|
npc2.abortAttack();
|
||||||
}
|
}
|
||||||
@@ -290,14 +290,14 @@ public class AdminFightCalculator implements IAdminCommandHandler
|
|||||||
dmg2 /= 10000;
|
dmg2 /= 10000;
|
||||||
|
|
||||||
// total damage per 100 seconds
|
// total damage per 100 seconds
|
||||||
int tdmg1 = (int) (sAtk1 * dmg1);
|
final int tdmg1 = (int) (sAtk1 * dmg1);
|
||||||
int tdmg2 = (int) (sAtk2 * dmg2);
|
final int tdmg2 = (int) (sAtk2 * dmg2);
|
||||||
// HP restored per 100 seconds
|
// HP restored per 100 seconds
|
||||||
double maxHp1 = npc1.getMaxHp();
|
final double maxHp1 = npc1.getMaxHp();
|
||||||
int hp1 = (int) ((Formulas.calcHpRegen(npc1) * 100000) / Formulas.getRegeneratePeriod(npc1));
|
final int hp1 = (int) ((Formulas.calcHpRegen(npc1) * 100000) / Formulas.getRegeneratePeriod(npc1));
|
||||||
|
|
||||||
double maxHp2 = npc2.getMaxHp();
|
final double maxHp2 = npc2.getMaxHp();
|
||||||
int hp2 = (int) ((Formulas.calcHpRegen(npc2) * 100000) / Formulas.getRegeneratePeriod(npc2));
|
final int hp2 = (int) ((Formulas.calcHpRegen(npc2) * 100000) / Formulas.getRegeneratePeriod(npc2));
|
||||||
|
|
||||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
final NpcHtmlMessage adminReply = new NpcHtmlMessage();
|
||||||
|
|
||||||
|
@@ -55,7 +55,7 @@ public class AdminFortSiege implements IAdminCommandHandler
|
|||||||
@Override
|
@Override
|
||||||
public boolean useAdminCommand(String command, L2PcInstance activeChar)
|
public boolean useAdminCommand(String command, L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
StringTokenizer st = new StringTokenizer(command, " ");
|
final StringTokenizer st = new StringTokenizer(command, " ");
|
||||||
command = st.nextToken(); // Get actual command
|
command = st.nextToken(); // Get actual command
|
||||||
|
|
||||||
// Get fort
|
// Get fort
|
||||||
@@ -74,7 +74,7 @@ public class AdminFortSiege implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
L2PcInstance player = null;
|
L2PcInstance player = null;
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
@@ -126,7 +126,7 @@ public class AdminFortSiege implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (command.equalsIgnoreCase("admin_removefort"))
|
else if (command.equalsIgnoreCase("admin_removefort"))
|
||||||
{
|
{
|
||||||
L2Clan clan = fort.getOwnerClan();
|
final L2Clan clan = fort.getOwnerClan();
|
||||||
if (clan != null)
|
if (clan != null)
|
||||||
{
|
{
|
||||||
fort.removeOwner(true);
|
fort.removeOwner(true);
|
||||||
|
@@ -85,7 +85,7 @@ public class AdminGmChat implements IAdminCommandHandler
|
|||||||
activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
|
activeChar.sendPacket(SystemMessageId.INVALID_TARGET);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
L2PcInstance player = (L2PcInstance) target;
|
final L2PcInstance player = (L2PcInstance) target;
|
||||||
player.addSnooper(activeChar);
|
player.addSnooper(activeChar);
|
||||||
activeChar.addSnooped(player);
|
activeChar.addSnooped(player);
|
||||||
}
|
}
|
||||||
@@ -115,7 +115,7 @@ public class AdminGmChat implements IAdminCommandHandler
|
|||||||
offset = 13;
|
offset = 13;
|
||||||
}
|
}
|
||||||
text = command.substring(offset);
|
text = command.substring(offset);
|
||||||
CreatureSay cs = new CreatureSay(0, ChatType.ALLIANCE, activeChar.getName(), text);
|
final CreatureSay cs = new CreatureSay(0, ChatType.ALLIANCE, activeChar.getName(), text);
|
||||||
AdminData.getInstance().broadcastToGMs(cs);
|
AdminData.getInstance().broadcastToGMs(cs);
|
||||||
}
|
}
|
||||||
catch (StringIndexOutOfBoundsException e)
|
catch (StringIndexOutOfBoundsException e)
|
||||||
|
@@ -38,8 +38,8 @@ public class AdminGraciaSeeds implements IAdminCommandHandler
|
|||||||
@Override
|
@Override
|
||||||
public boolean useAdminCommand(String command, L2PcInstance activeChar)
|
public boolean useAdminCommand(String command, L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
StringTokenizer st = new StringTokenizer(command, " ");
|
final StringTokenizer st = new StringTokenizer(command, " ");
|
||||||
String actualCommand = st.nextToken(); // Get actual command
|
final String actualCommand = st.nextToken(); // Get actual command
|
||||||
|
|
||||||
String val = "";
|
String val = "";
|
||||||
if (st.countTokens() >= 1)
|
if (st.countTokens() >= 1)
|
||||||
@@ -68,7 +68,7 @@ public class AdminGraciaSeeds implements IAdminCommandHandler
|
|||||||
html.replace("%sodtiatkill%", String.valueOf(GraciaSeedsManager.getInstance().getSoDTiatKilled()));
|
html.replace("%sodtiatkill%", String.valueOf(GraciaSeedsManager.getInstance().getSoDTiatKilled()));
|
||||||
if (GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange() > 0)
|
if (GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange() > 0)
|
||||||
{
|
{
|
||||||
Calendar nextChangeDate = Calendar.getInstance();
|
final Calendar nextChangeDate = Calendar.getInstance();
|
||||||
nextChangeDate.setTimeInMillis(System.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
|
nextChangeDate.setTimeInMillis(System.currentTimeMillis() + GraciaSeedsManager.getInstance().getSoDTimeForNextStateChange());
|
||||||
html.replace("%sodtime%", nextChangeDate.getTime().toString());
|
html.replace("%sodtime%", nextChangeDate.getTime().toString());
|
||||||
}
|
}
|
||||||
|
@@ -75,7 +75,7 @@ public class AdminGrandBoss implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NpcHtmlMessage html = new NpcHtmlMessage(0, 1);
|
final NpcHtmlMessage html = new NpcHtmlMessage(0, 1);
|
||||||
html.setHtml(HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/admin/grandboss.htm"));
|
html.setHtml(HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "html/admin/grandboss.htm"));
|
||||||
activeChar.sendPacket(html);
|
activeChar.sendPacket(html);
|
||||||
}
|
}
|
||||||
@@ -303,7 +303,7 @@ public class AdminGrandBoss implements IAdminCommandHandler
|
|||||||
final StatsSet info = GrandBossManager.getInstance().getStatsSet(grandBossId);
|
final StatsSet info = GrandBossManager.getInstance().getStatsSet(grandBossId);
|
||||||
final String bossRespawn = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(info.getLong("respawn_time"));
|
final String bossRespawn = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(info.getLong("respawn_time"));
|
||||||
|
|
||||||
NpcHtmlMessage html = new NpcHtmlMessage(0, 1);
|
final NpcHtmlMessage html = new NpcHtmlMessage(0, 1);
|
||||||
html.setHtml(HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), htmlPatch));
|
html.setHtml(HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), htmlPatch));
|
||||||
html.replace("%bossStatus%", text);
|
html.replace("%bossStatus%", text);
|
||||||
html.replace("%bossColor%", textColor);
|
html.replace("%bossColor%", textColor);
|
||||||
|
@@ -52,7 +52,7 @@ public class AdminHeal implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String healTarget = command.substring(11);
|
final String healTarget = command.substring(11);
|
||||||
handleHeal(activeChar, healTarget);
|
handleHeal(activeChar, healTarget);
|
||||||
}
|
}
|
||||||
catch (StringIndexOutOfBoundsException e)
|
catch (StringIndexOutOfBoundsException e)
|
||||||
@@ -84,7 +84,7 @@ public class AdminHeal implements IAdminCommandHandler
|
|||||||
L2Object obj = activeChar.getTarget();
|
L2Object obj = activeChar.getTarget();
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
L2PcInstance plyr = L2World.getInstance().getPlayer(player);
|
final L2PcInstance plyr = L2World.getInstance().getPlayer(player);
|
||||||
|
|
||||||
if (plyr != null)
|
if (plyr != null)
|
||||||
{
|
{
|
||||||
@@ -94,13 +94,13 @@ public class AdminHeal implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int radius = Integer.parseInt(player);
|
final int radius = Integer.parseInt(player);
|
||||||
Collection<L2Object> objs = activeChar.getKnownList().getKnownObjects().values();
|
final Collection<L2Object> objs = activeChar.getKnownList().getKnownObjects().values();
|
||||||
for (L2Object object : objs)
|
for (L2Object object : objs)
|
||||||
{
|
{
|
||||||
if (object instanceof L2Character)
|
if (object instanceof L2Character)
|
||||||
{
|
{
|
||||||
L2Character character = (L2Character) object;
|
final L2Character character = (L2Character) object;
|
||||||
character.setCurrentHpMp(character.getMaxHp(), character.getMaxMp());
|
character.setCurrentHpMp(character.getMaxHp(), character.getMaxMp());
|
||||||
if (object instanceof L2PcInstance)
|
if (object instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
@@ -123,7 +123,7 @@ public class AdminHeal implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
if (obj instanceof L2Character)
|
if (obj instanceof L2Character)
|
||||||
{
|
{
|
||||||
L2Character target = (L2Character) obj;
|
final L2Character target = (L2Character) obj;
|
||||||
target.setCurrentHpMp(target.getMaxHp(), target.getMaxMp());
|
target.setCurrentHpMp(target.getMaxHp(), target.getMaxMp());
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
|
@@ -98,7 +98,7 @@ public class AdminHtml implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
File file = new File(Config.DATAPACK_ROOT, path);
|
final File file = new File(Config.DATAPACK_ROOT, path);
|
||||||
content = HtmCache.getInstance().loadFile(file);
|
content = HtmCache.getInstance().loadFile(file);
|
||||||
}
|
}
|
||||||
final NpcHtmlMessage html = new NpcHtmlMessage();
|
final NpcHtmlMessage html = new NpcHtmlMessage();
|
||||||
|
@@ -45,13 +45,13 @@ public class AdminInstance implements IAdminCommandHandler
|
|||||||
@Override
|
@Override
|
||||||
public boolean useAdminCommand(String command, L2PcInstance activeChar)
|
public boolean useAdminCommand(String command, L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
StringTokenizer st = new StringTokenizer(command);
|
final StringTokenizer st = new StringTokenizer(command);
|
||||||
st.nextToken();
|
st.nextToken();
|
||||||
|
|
||||||
// create new instance
|
// create new instance
|
||||||
if (command.startsWith("admin_createinstance"))
|
if (command.startsWith("admin_createinstance"))
|
||||||
{
|
{
|
||||||
String[] parts = command.split(" ");
|
final String[] parts = command.split(" ");
|
||||||
if (parts.length != 3)
|
if (parts.length != 3)
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Example: //createinstance <id> <templatefile> - ids => 300000 are reserved for dynamic instances");
|
activeChar.sendMessage("Example: //createinstance <id> <templatefile> - ids => 300000 are reserved for dynamic instances");
|
||||||
@@ -89,14 +89,14 @@ public class AdminInstance implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int val = Integer.parseInt(st.nextToken());
|
final int val = Integer.parseInt(st.nextToken());
|
||||||
if (InstanceManager.getInstance().getInstance(val) == null)
|
if (InstanceManager.getInstance().getInstance(val) == null)
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Instance " + val + " doesnt exist.");
|
activeChar.sendMessage("Instance " + val + " doesnt exist.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
if ((target == null) || (target instanceof L2Summon)) // Don't separate summons from masters
|
if ((target == null) || (target instanceof L2Summon)) // Don't separate summons from masters
|
||||||
{
|
{
|
||||||
activeChar.sendMessage("Incorrect target.");
|
activeChar.sendMessage("Incorrect target.");
|
||||||
@@ -105,7 +105,7 @@ public class AdminInstance implements IAdminCommandHandler
|
|||||||
target.setInstanceId(val);
|
target.setInstanceId(val);
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
L2PcInstance player = (L2PcInstance) target;
|
final L2PcInstance player = (L2PcInstance) target;
|
||||||
player.sendMessage("Admin set your instance to:" + val);
|
player.sendMessage("Admin set your instance to:" + val);
|
||||||
player.teleToLocation(player.getLocation());
|
player.teleToLocation(player.getLocation());
|
||||||
}
|
}
|
||||||
@@ -121,7 +121,7 @@ public class AdminInstance implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int val = Integer.parseInt(st.nextToken());
|
final int val = Integer.parseInt(st.nextToken());
|
||||||
InstanceManager.getInstance().destroyInstance(val);
|
InstanceManager.getInstance().destroyInstance(val);
|
||||||
activeChar.sendMessage("Instance destroyed");
|
activeChar.sendMessage("Instance destroyed");
|
||||||
}
|
}
|
||||||
|
@@ -40,14 +40,14 @@ public class AdminInstanceZone implements IAdminCommandHandler
|
|||||||
@Override
|
@Override
|
||||||
public boolean useAdminCommand(String command, L2PcInstance activeChar)
|
public boolean useAdminCommand(String command, L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
String target = (activeChar.getTarget() != null) ? activeChar.getTarget().getName() : "no-target";
|
final String target = (activeChar.getTarget() != null) ? activeChar.getTarget().getName() : "no-target";
|
||||||
GMAudit.auditGMAction(activeChar.getName(), command, target, "");
|
GMAudit.auditGMAction(activeChar.getName(), command, target, "");
|
||||||
|
|
||||||
if (command.startsWith("admin_instancezone_clear"))
|
if (command.startsWith("admin_instancezone_clear"))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
StringTokenizer st = new StringTokenizer(command, " ");
|
final StringTokenizer st = new StringTokenizer(command, " ");
|
||||||
|
|
||||||
st.nextToken();
|
st.nextToken();
|
||||||
final L2PcInstance player = L2World.getInstance().getPlayer(st.nextToken());
|
final L2PcInstance player = L2World.getInstance().getPlayer(st.nextToken());
|
||||||
@@ -68,13 +68,13 @@ public class AdminInstanceZone implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
else if (command.startsWith("admin_instancezone"))
|
else if (command.startsWith("admin_instancezone"))
|
||||||
{
|
{
|
||||||
StringTokenizer st = new StringTokenizer(command, " ");
|
final StringTokenizer st = new StringTokenizer(command, " ");
|
||||||
command = st.nextToken();
|
command = st.nextToken();
|
||||||
|
|
||||||
if (st.hasMoreTokens())
|
if (st.hasMoreTokens())
|
||||||
{
|
{
|
||||||
L2PcInstance player = null;
|
L2PcInstance player = null;
|
||||||
String playername = st.nextToken();
|
final String playername = st.nextToken();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -118,7 +118,7 @@ public class AdminInstanceZone implements IAdminCommandHandler
|
|||||||
|
|
||||||
private void display(L2PcInstance player, L2PcInstance activeChar)
|
private void display(L2PcInstance player, L2PcInstance activeChar)
|
||||||
{
|
{
|
||||||
Map<Integer, Long> instanceTimes = InstanceManager.getInstance().getAllInstanceTimes(player.getObjectId());
|
final Map<Integer, Long> instanceTimes = InstanceManager.getInstance().getAllInstanceTimes(player.getObjectId());
|
||||||
|
|
||||||
final StringBuilder html = StringUtil.startAppend(500 + (instanceTimes.size() * 200), "<html><center><table width=260><tr>" + "<td width=40><button value=\"Main\" action=\"bypass -h admin_admin\" width=40 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" + "<td width=180><center>Character Instances</center></td>" + "<td width=40><button value=\"Back\" action=\"bypass -h admin_current_player\" width=40 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" + "</tr></table><br><font color=\"LEVEL\">Instances for ", player.getName(), "</font><center><br>" + "<table>" + "<tr><td width=150>Name</td><td width=50>Time</td><td width=70>Action</td></tr>");
|
final StringBuilder html = StringUtil.startAppend(500 + (instanceTimes.size() * 200), "<html><center><table width=260><tr>" + "<td width=40><button value=\"Main\" action=\"bypass -h admin_admin\" width=40 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" + "<td width=180><center>Character Instances</center></td>" + "<td width=40><button value=\"Back\" action=\"bypass -h admin_current_player\" width=40 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>" + "</tr></table><br><font color=\"LEVEL\">Instances for ", player.getName(), "</font><center><br>" + "<table>" + "<tr><td width=150>Name</td><td width=50>Time</td><td width=70>Action</td></tr>");
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ public class AdminInstanceZone implements IAdminCommandHandler
|
|||||||
{
|
{
|
||||||
int hours = 0;
|
int hours = 0;
|
||||||
int minutes = 0;
|
int minutes = 0;
|
||||||
long remainingTime = (instanceTimes.get(id) - System.currentTimeMillis()) / 1000;
|
final long remainingTime = (instanceTimes.get(id) - System.currentTimeMillis()) / 1000;
|
||||||
if (remainingTime > 0)
|
if (remainingTime > 0)
|
||||||
{
|
{
|
||||||
hours = (int) (remainingTime / 3600);
|
hours = (int) (remainingTime / 3600);
|
||||||
|
@@ -49,7 +49,7 @@ public class AdminInvul implements IAdminCommandHandler
|
|||||||
}
|
}
|
||||||
if (command.equals("admin_setinvul"))
|
if (command.equals("admin_setinvul"))
|
||||||
{
|
{
|
||||||
L2Object target = activeChar.getTarget();
|
final L2Object target = activeChar.getTarget();
|
||||||
if (target instanceof L2PcInstance)
|
if (target instanceof L2PcInstance)
|
||||||
{
|
{
|
||||||
handleInvul((L2PcInstance) target);
|
handleInvul((L2PcInstance) target);
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user