사이트 로그인
2016.06.28 22:24
자바생성 L1HardinQuest .java
에바팩에는 되어있다고 들었습니다.
일팩 유저화이팅
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package l1j.server.model.etc; //이거 자바만드는위치로 변경하셔두됨
import java.util.ArrayList;
import java.util.Timer;
import java.util.TimerTask;
import java.util.logging.Level;
import java.util.logging.Logger;
import l1j.server.GeneralThreadPool;
import l1j.server.datatables.DoorTable;
import l1j.server.datatables.MobGroupTable;
import l1j.server.datatables.NpcTable;
import l1j.server.datatables.TrapTable;
import l1j.server.model.instance.L1DoorInstance;
import l1j.server.model.instance.L1EffectInstance;
import l1j.server.model.instance.L1FieldObjectInstance;
import l1j.server.model.instance.L1ItemInstance;
import l1j.server.model.instance.L1MonsterInstance;
import l1j.server.model.instance.L1NpcInstance;
import l1j.server.model.instance.L1PcInstance;
import l1j.server.model.instance.L1TrapInstance;
import l1j.server.model.L1HardinQuest;
import l1j.server.model.L1Location;
import l1j.server.model.L1MobGroupSpawn;
import l1j.server.model.L1Object;
import l1j.server.model.L1Teleport;
import l1j.server.model.L1World;
import l1j.server.model.inventory.L1Inventory;
import l1j.server.model.skill.L1SkillId;
import l1j.server.model.skill.L1SkillUse;
import l1j.server.model.trap.L1Trap;
import l1j.server.model.trap.L1WorldTraps;
import l1j.server.packets.server.S_GreenMessage;
import l1j.server.packets.server.S_NpcChatPacket;
import l1j.server.packets.server.S_NpcPack;
import l1j.server.packets.server.S_NpcTalkReturn;
import l1j.server.packets.server.S_ShockWave;
import l1j.server.packets.server.S_SkillSound;
import l1j.server.random.RandomGenerator;
import l1j.server.random.RandomGeneratorFactory;
import l1j.server.templates.L1DoorGfx;
import l1j.server.types.Point;
import l1j.server.utils.IdFactory;
import l1j.server.utils.collections.Lists;
public class L1HardinQuest {
class assailantSpawn extends TimerTask {
public void begin() {
final Timer timer = new Timer();
timer.scheduleAtFixedRate(this, 10 * 1000, 160 * 1000);
}
@Override
public void run() {
if (!isDeleteTransactionNow()) {
if (getBoneLaidStatus() == -1 && _leader.getMapId() == getMapId()) {
final RandomGenerator rd = RandomGeneratorFactory.getSharedRandom();
final int i = rd.nextInt(3);
final int mobGroupLeaderId = MobGroupTable.getInstance().getTemplate(85 + i).getLeaderId();
doSpawnGroup(_leader.getLocation(), mobGroupLeaderId, 85 + i);
if (i == 1) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7596", 0));
}
} else {
this.cancel();
}
} else {
this.cancel();
}
}
}
class attackKerenis extends TimerTask {
int randomtime = 20;
public void begin() {
final Timer timer = new Timer();
timer.scheduleAtFixedRate(this, 30 * 1000, randomtime * 1000);
}
@Override
public void run() {
if (!isDeleteTransactionNow()) {
if (!isAlreadyGuardManDeath()) {
final RandomGenerator rd = RandomGeneratorFactory.getSharedRandom();
randomtime = 20 + rd.nextInt(10);
for (final L1Object obj : L1World.getInstance().getVisibleObjects(_Kerenis, 6)) {
if (obj instanceof L1MonsterInstance) {
if (!((L1MonsterInstance) obj).isDead()) {
final L1SkillUse l1skilluse = new L1SkillUse();
l1skilluse.handleCommands(_leader,
L1SkillId.FROZEN_CLOUD, obj.getId(),
obj.getX(), obj.getY(), null, 0,
L1SkillUse.TYPE_GMBUFF, _Kerenis);
break;
}
}
}
} else {
this.cancel();
}
} else {
this.cancel();
}
}
}
class HardinQuestMonitor extends TimerTask {
public void begin() {
final Timer timer = new Timer();
timer.scheduleAtFixedRate(this, 30 * 1000, 300 * 1000);
}
@Override
public void run() {
if (!isDeleteTransactionNow()) { //대비
for (final L1PcInstance pc : L1World.getInstance().getAllPlayers()) {
if (getMapId() == pc.getMapId()) {
return;
}
}
if (!isDeleteTransactionNow())
end();
this.cancel();
} else {
this.cancel();
}
}
}
class HqThread extends Thread {
@Override
public void run() {
try {
sendCountDown();
boolean hardMode = false;
int pattern = 1;
if (isHardMode()) {
hardMode = true;
}
for (int round = 1; round <= 12; round++) {
if (!isDeleteTransactionNow()) {
setCurRound(round);
sendRoundMessage(round);
if (hardMode) {
if (round > 1) {
if (getBoneLaidStatus() == 2) {
pattern = 3;
} else {
pattern = 2;
}
} else if (getBoneLaidStatus() == 2) {
pattern = 3;
}
}
if (round % 4 == 0) {
Thread.sleep(5 * 1000);
}
final RandomGenerator random = RandomGeneratorFactory.getSharedRandom();
if (99 < (random.nextInt(100) + 1)) {
setBonusStage(true);
}
for (int subRound = 1; subRound <= 4; subRound++) {
if (isDeleteTransactionNow())
return;
sendSubRoundMessage(subRound);
selectSpawn(pattern, round);
// Thread.sleep(9000);
}
if (round % 4 == 0) {
Thread.sleep(109 * 1000);
} else {
Thread.sleep(75 * 1000);
}
int cnt = 0;
for (final L1PcInstance pc : L1World.getInstance().getAllPlayers()) {
if (pc.getMapId() == getMapId()) {
cnt++;
}
}
/// 5명시작
if (searchCountMonster() > 6 || isBonusStage()) {
if (!isBonusStage() && getCurRound() != 12) {
sendMessage("$7653", 0);
}
Thread.sleep(25 * 1000);
if (searchCountMonster() > 6 || isBonusStage()) {
Thread.sleep(35 * 1000);
sendMessage("$7811", 0);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7811", 0));
boolean remain = true;
for (int i = 0; ((i < 3) && remain)
|| isBonusStage(); i++) {
if (isDeleteTransactionNow())
return;
Thread.sleep(30000);
remain = searchCountMonster() > 6;
}
if (remain || isBonusStage()) {
sendMessage("$7681", 0);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7681", 0));
if (!isDeleteTransactionNow())
outPushPlayer();
return;
} else {
if (getCurRound() != 12) {
sendMessage("$8703", 0);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$8703", 0));
}
}
}
setRoundStatus(round - 1, 2);
} else {
if (searchCountMonster() < 4) {
setRoundStatus(round - 1, 1);
} else {
setRoundStatus(round - 1, 3);
}
if (getCurRound() != 12) {
sendMessage("$7652", 0);
}
}
} else {
return;
}
}
} catch (final Exception e) {
_log.log(Level.SEVERE, e.getLocalizedMessage(), e);
}
}
}
//////////멘트...........
class KerenisPart1 extends Thread {
@Override
public void run() {
try {
final L1Location loc = new L1Location(32742, 32930, getMapId());
spawnOne(loc, 91320, 0);
if (_leader.getMapId() == getMapId()) {
_leader.sendPackets(new S_NpcTalkReturn(_leader.getId(), "j_ep003"));
}
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7616", 0));
setActionKerenisDirect(0);
Thread.sleep(3000);
if (getActionKerenis() == 1) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7562", 0));
} else {
if (getActionKerenis() == 2) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7570", 0));
} else {// 0
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7617", 0));
}
}
Thread.sleep(102 * 1000);
if (getSwitchStatus(0) == 0) {
setSwitchStatus(0, -1);
}
if (isAlreadyFirstSwitch()) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7622", 0));
return;
} else {
if (_leader.getMapId() == getMapId()) {
_leader.sendPackets(new S_NpcTalkReturn(_leader.getId(), "j_ep004"));
}
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7618", 0));
sendMessage("$7560 : $7618", 0);
setActionKerenisDirect(0);//
Thread.sleep(3000);
if (isAlreadyFirstSwitch()) {
setSwitchStatus(0, 2);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7620", 0));
}
if (getActionKerenis() == 1) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7571", 0));
} else {
if (getActionKerenis() == 2) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7563", 0));
} else {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7619", 0));
}
}
}
Thread.sleep(15 * 1000);
// System.out.print(getSwitchStatus(0));
if (getSwitchStatus(0) == -1) {
if (isAlreadyFirstSwitch()) {
setSwitchStatus(0, 0);
} else {
if (!isDeleteTransactionNow())
outPushPlayer();// end();
}
}
} catch (final InterruptedException ignore) {
}
}
}
class KerenisPart2 extends Thread {
@Override
public void run() {
try {
Thread.sleep(310 * 1000);
if (getSwitchStatus(1) == 0) {
setSwitchStatus(1, -1);
}
if (isAlreadySecondSwitch()) {
return;
} else {
if (_leader.getMapId() == getMapId()) {
_leader.sendPackets(new S_NpcTalkReturn(_leader.getId(), "j_ep004"));
}
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7625", 0));
sendMessage("$7560 : $7625", 0);
setActionKerenisDirect(0);
Thread.sleep(3000);
if (isAlreadySecondSwitch()) {
setSwitchStatus(1, 2);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7627", 0));
}
if (getActionKerenis() == 1) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7571", 0));
} else {
if (getActionKerenis() == 2) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7563", 0));
} else {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7626", 0));
}
}
setActionKerenisDirect(0);
}
Thread.sleep(15 * 1000);
if (getSwitchStatus(1) == -1) {
if (isAlreadySecondSwitch()) {
setSwitchStatus(1, 0);
} else {
if (!isDeleteTransactionNow())
outPushPlayer();// end();
}
}
} catch (final InterruptedException ignore) {
}
}
}
class KerenisPart3 extends Thread {
@Override
public void run() {
try {
Thread.sleep(230 * 1000);
if (getSwitchStatus(2) == 0) {
setSwitchStatus(2, -1);
}
if (isAlreadyPortal()) {
return;
} else {
if (_leader.getMapId() == getMapId()) {
_leader.sendPackets(new S_NpcTalkReturn(_leader.getId(), "j_ep004"));
}
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7632", 0));
sendMessage("$7560 : $7632", 0);
setActionKerenisDirect(0);
Thread.sleep(3000);
if (isAlreadyPortal()) {
setSwitchStatus(2, 2);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7634", 0));
}
if (getActionKerenis() == 1) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7563", 0));
} else {
if (getActionKerenis() == 2) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7571", 0));
} else {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7633", 0));
}
}
setActionKerenisDirect(0);
}
Thread.sleep(15 * 1000);
if (getSwitchStatus(2) == -1) {
if (isAlreadyPortal()) {
setSwitchStatus(2, 0);
} else {
if (!isDeleteTransactionNow())
outPushPlayer();// end();
}
}
} catch (final InterruptedException ignore) {
}
}
}
class KerenisPart4 extends Thread {
@Override
public void run() {
try {
Thread.sleep(150 * 1000);
if (getSwitchStatus(3) == 0) {
setSwitchStatus(3, -1);
}
if (isAlreadyGuardManDeath()) {
return;
} else {
if (_leader.getMapId() == getMapId()) {
_leader.sendPackets(new S_NpcTalkReturn(_leader.getId(), "j_ep004"));
}
sendMessage("$7560 : $7640", 0);
setActionKerenisDirect(0);
Thread.sleep(3000);
if (isAlreadyGuardManDeath()) {
setSwitchStatus(3, 2);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7642", 0));
}
if (getActionKerenis() == 1) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7563", 0));
} else {
if (getActionKerenis() == 2) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7571", 0));
}
}
Thread.sleep(3000);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7641", 0));
setActionKerenisDirect(0);
}
Thread.sleep(15 * 1000);
if (getSwitchStatus(3) == -1) {
if (isAlreadyGuardManDeath()) {
setSwitchStatus(3, 0);
} else {
if (!isDeleteTransactionNow())
outPushPlayer();// end();
}
}
} catch (final InterruptedException ignore) {
}
}
}
class KerenisRandomMessage extends TimerTask {
private final int MSGID = 7576;
public void begin() {
final Timer timer = new Timer();
timer.scheduleAtFixedRate(this, 10 * 1000, 60 * 1000);
}
////////////////번호멘트
@Override
public void run() {
if (!isDeleteTransactionNow()) {
if (!isAlreadyGuardManDeath()) {
final RandomGenerator rd = RandomGeneratorFactory.getSharedRandom();
final int i = rd.nextInt(12);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$" + (MSGID + i), 0));
} else {
this.cancel();
}
} else {
this.cancel();
}
}
}
class moveWall extends TimerTask {
private final RandomGenerator _rnd = RandomGeneratorFactory.newRandom();
private void waitForLocation(L1Location loc)
throws InterruptedException {
boolean find = true;
while (find) {
find = false;
for (final L1Object obj : L1World.getInstance()
.getVisiblePoint(loc, 0)) {
if (!(obj instanceof L1ItemInstance)) {
find = true;
Thread.sleep(500);
break;
}
}
}
}
private L1Location findLocation(L1Location base) {
L1Location newLoc = new L1Location(base);
boolean find = true;
while (find) {
find = false;
int moveX = 2 + _rnd.nextInt(3);
int moveY = _rnd.nextInt(7);
newLoc.set(newLoc.getX() + moveX, newLoc.getY() - moveY);
for (final L1Object obj : L1World.getInstance()
.getVisiblePoint(newLoc, 0)) {
if (!(obj instanceof L1ItemInstance)) {
find = true;
break;
}
}
}
return newLoc;
}
public void begin() {
final Timer timer = new Timer();
timer.schedule(this, 6000);
}
@Override
public void run() {
try {
int cnt = 3;
for (L1DoorInstance wall : Lists.newArrayList(getAllDoors())) {
if (cnt % 4 == 0) {
sendShockWave();
}
if (wall.getGfxId() != WALL_GFXID) {
continue;
}
L1Location newLoc = findLocation(wall.getLocation());
removeDoor(wall);
addDoor(newLoc);
Thread.sleep(600);
cnt++;
}
Thread.sleep(5000);
int val;
int startX1;// 32703,32702
int startX2;
if (_rnd.nextInt(2) == 0) {// 1
val = 1;
startX1 = 32703;
startX2 = startX1;
} else {
val = -1;
startX1 = 32711;
startX2 = 32709;
}
cnt = 0;
for (L1DoorInstance wall : Lists.newArrayList(getAllDoors())) {
L1Location newLoc = new L1Location();
if (cnt % 4 == 0) {
sendShockWave();
}
if (cnt % 2 == 0) {
newLoc.set(startX1, 32866, getMapId());
startX1 += val;
} else {
newLoc.set(startX2, 32872, getMapId());
startX2 += val;
}
waitForLocation(newLoc);
removeDoor(wall);
addDoor(newLoc);
Thread.sleep(600);
cnt++;
}
Thread.sleep(20000);
sendMessage("$8718", 0);
} catch (final InterruptedException e) {
_log.log(Level.SEVERE, e.getLocalizedMessage(), e);
}
}
}
class orcVocabulary extends TimerTask {
public void begin() {
final Timer timer = new Timer();
timer.schedule(this, 2 * 1000);
}
@Override
public void run() {
try {
final L1Location loc = new L1Location();
loc.set(32746, 32932, getMapId());
final L1NpcInstance orc = spawnOne(loc, 91333, 7);
loc.set(32748, 32931, getMapId());
final L1NpcInstance orcFighter = spawnOne(loc, 91336, 7);
loc.set(32745, 32935, getMapId());
final L1NpcInstance orcArcher = spawnOne(loc, 91334, 7);
loc.set(32747, 32934, getMapId());
final L1NpcInstance barusim = spawnOne(loc, 91335, 7);
Thread.sleep(2000);
barusim.broadcastPacket(new S_NpcChatPacket(barusim, "$7842", 0));
Thread.sleep(2000);
orc.broadcastPacket(new S_NpcChatPacket(orc, "$7848", 0));
Thread.sleep(2000);
orcFighter.broadcastPacket(new S_NpcChatPacket(orcFighter, "$7854", 0));
Thread.sleep(2000);
orc.broadcastPacket(new S_NpcChatPacket(orc, "$7849", 0));
Thread.sleep(2000);
orcFighter.broadcastPacket(new S_NpcChatPacket(orcFighter, "$7855", 0));
Thread.sleep(2000);
barusim.broadcastPacket(new S_NpcChatPacket(barusim, "$7843", 0));
Thread.sleep(2000);
orcFighter.broadcastPacket(new S_NpcChatPacket(orcFighter, "$7856", 0));
Thread.sleep(2000);
barusim.broadcastPacket(new S_NpcChatPacket(barusim, "$7844", 0));
Thread.sleep(2000);
orcFighter.broadcastPacket(new S_NpcChatPacket(orcFighter, "$7857", 0));
Thread.sleep(2000);
orcArcher.broadcastPacket(new S_NpcChatPacket(orcArcher, "$7851", 0));
Thread.sleep(2000);
orcFighter.broadcastPacket(new S_NpcChatPacket(orcFighter, "$7858", 0));
Thread.sleep(2000);
orcArcher.broadcastPacket(new S_NpcChatPacket(orcArcher, "$7852", 0));
Thread.sleep(2000);
orcFighter.broadcastPacket(new S_NpcChatPacket(orcFighter, "$7859", 0));
Thread.sleep(2000);
while (orcFighter.moveDirection(32748, 32935) != -1) {
if (orcFighter.getLocation().getLineDistance(
new Point(32748, 32935)) != 0) {
orcFighter.setDirectionMove(orcFighter.moveDirection(32748, 32935));
Thread.sleep(orcFighter.getPassiSpeed());
} else {
break;
}
}
Thread.sleep(2000);
orcFighter.deleteMe();
orcArcher.broadcastPacket(new S_NpcChatPacket(orcArcher, "$7853", 0));
Thread.sleep(2000);
while (orcArcher.moveDirection(32748, 32935) != -1) {
if (orcArcher.getLocation().getLineDistance(
new Point(32748, 32935)) != 0) {
orcArcher.setDirectionMove(orcArcher.moveDirection(32748, 32935));
Thread.sleep(orcArcher.getPassiSpeed());
} else {
break;
}
}
Thread.sleep(2000);
orcArcher.deleteMe();
orc.broadcastPacket(new S_NpcChatPacket(orc, "$7850", 0));
Thread.sleep(2000);
while (orc.moveDirection(32748, 32935) != -1) {
if (orc.getLocation().getLineDistance(
new Point(32748, 32935)) != 0) {
orc.setDirectionMove(orc.moveDirection(32748, 32935));
Thread.sleep(orc.getPassiSpeed());
} else {
break;
}
}
Thread.sleep(2000);
orc.deleteMe();
barusim.broadcastPacket(new S_NpcChatPacket(barusim, "$7845", 0));
Thread.sleep(4000);
barusim.broadcastPacket(new S_NpcChatPacket(barusim, "$7846", 0));
Thread.sleep(4000);
barusim.broadcastPacket(new S_NpcChatPacket(barusim, "$7847", 0));
Thread.sleep(2000);
while (barusim.moveDirection(32748, 32935) != -1) {
if (barusim.getLocation().getLineDistance(
new Point(32748, 32935)) != 0) {
barusim.setDirectionMove(barusim.moveDirection(32748, 32935));
Thread.sleep(barusim.getPassiSpeed());
} else {
break;
}
}
Thread.sleep(2000);
barusim.deleteMe();
} catch (final InterruptedException e) {
e.printStackTrace();
}
}
}
//시작 준비 래디 고
class Preliminary extends Thread {
@Override
public void run() {
try {
Thread.sleep(2000);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7598", 0));
Thread.sleep(4000);
sendMessage(_Hardin.getName() + " : $8693", 0);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$8693", 0));
Thread.sleep(8000);
setActionHardinDirect(0);
sendMessage(_Hardin.getName() + " : $8694", 0);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$8694", 0));
Thread.sleep(8000);
if (getActionHardin() != 1) {
sendMessage(_Hardin.getName() + " : $8695", 0);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$8695", 0));
Thread.sleep(8000);
sendMessage(_Hardin.getName() + " : $8696", 0);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$8696", 0));
Thread.sleep(8000);
sendMessage(_Hardin.getName() + " : $8697", 0);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$8697", 0));
Thread.sleep(8000);
sendMessage(_Hardin.getName() + " : $8698", 0);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$8698", 0));
Thread.sleep(8000);
sendMessage(_Hardin.getName() + " : $8699", 0);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$8699", 0));
Thread.sleep(8000);
sendMessage(_Hardin.getName() + " : $8700", 0);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$8700", 0));
Thread.sleep(8000);
sendMessage(_Hardin.getName() + " : $8701", 0);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$8701", 0));
Thread.sleep(8000);
}
setActionHardinDirect(0);
sendMessage(_Hardin.getName() + " : $8702", 0);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$8702", 0));
Thread.sleep(4000);
if (getActionHardin() != 1) {
if (_leader.getMapId() == getMapId()) {
_leader.sendPackets(new S_NpcTalkReturn(_leader.getId(), "j_ep002"));
}
Thread.sleep(10000);
}
setActionHardinDirect(0);
if (_leader.getMapId() == getMapId()) {
_leader.sendPackets(new S_NpcTalkReturn(_leader.getId(), "j_ep001"));
}
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7599", 0));
Thread.sleep(8000);
if (getActionHardin() != 1) {
sendMessage(_Hardin.getName() + " : $7601", 0);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7601", 0));
setActionHardinDirect(0);
Thread.sleep(10000);
for (int i = 0; i < 5; i++) {
if (getActionHardin() != 1) {
setActionHardinDirect(0);
sendMessage(_Hardin.getName() + " : $7602", 0);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7602", 0));
Thread.sleep(8000);
} else {
break;
}
}
}
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7600", 0));
Thread.sleep(8000);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7603", 0));
Thread.sleep(2000);
if (_leader.getMapId() == getMapId()) {
L1Teleport.teleport(_leader, 32738, 32930, getMapId(), 5, true);
}
final L1Location loc = new L1Location();
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7604", 0));
/* 1 */
Thread.sleep(1000);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7607", 0));
/* 5 */
Thread.sleep(4000);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7605", 0));
/* 10 */
Thread.sleep(2000);
loc.set(32725, 32724, getMapId());
setSwitch(loc, 65);
spawnOne(loc, 91319, 0);
/* 12 */
Thread.sleep(5000);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7606", 0));
Thread.sleep(4000);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7608", 0));
Thread.sleep(4000);
_Hardin.teleport(32716, 32846, 6);
loc.set(32716, 32846, getMapId());
spawnOne(loc, 91319, 0);
spawnOne(loc, 91317, 0);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7609", 0));
Thread.sleep(5000);
setActionKerenisDirect(0);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7610", 0));
Thread.sleep(5000);
sendMessage(_Hardin.getName() + " : $7611", 0);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7611", 0));
Thread.sleep(2000);
if (getActionKerenis() == 1) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7561", 0));
} else {
if (getActionKerenis() == 2) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7569", 0));
} else {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7612", 0));
}
}
setActionKerenisDirect(0);
Thread.sleep(6000);
sendMessage(_Hardin.getName() + " : $7613", 0);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7613", 0));
Thread.sleep(5000);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7614", 0));
sendMessage(_Hardin.getName() + " : $7615", 0);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7615", 0));
sendShockWave();
Thread.sleep(2000);
if (!isDeleteTransactionNow()) {
_kp1 = new KerenisPart1();
GeneralThreadPool.getInstance().execute(_kp1);
_krm = new KerenisRandomMessage();
_krm.begin();
}
} catch (final InterruptedException e) {
e.printStackTrace();
}
}
}
class spawnBoss extends TimerTask {
public void begin() {
final Timer timer = new Timer();
timer.schedule(this, 0);
}
@Override
public void run() {
try {
if (getCurRound() == 4) {
spawnOneMob(getLocation(), 91291);
} else if (getCurRound() == 8) {
spawnOneMob(getLocation(), 91293);
} else if (getCurRound() == 12) {
int cnt = 0;
for (int i = 0; i < _roundStatus.length; i++) {
if (getRoundStatus(i) == 1) {
cnt++;
}
}
if (8 < cnt) {
_lunker = spawnOneMob(getLocation(), 91294);
} else {
_lunker = spawnOneMob(getLocation(), 91290);
}
final L1Location loc = new L1Location(32711, 32845,
getMapId());
boolean kerenisSpawn = true;
_lunker.broadcastPacket(new S_NpcChatPacket(_lunker, "$7656", 0));
Thread.sleep(1500);
_lunker.broadcastPacket(new S_NpcChatPacket(_lunker, "$7657", 0));
if (!isKerenisAngry()) {
_Kerenis = spawnOneMob(loc, 91296);
} else {
if (isHardMode()) {
_Kerenis = spawnOneMob(loc, 91295);
} else {
kerenisSpawn = false;
}
}
if (kerenisSpawn) {
_Kerenis.tagertClear();
_Kerenis.setTarget(_lunker);
_lunker.tagertClear();
_lunker.setTarget(_Kerenis);
///////////////////////////////////////
if (_Kerenis.getNpcId() == 91296) {
Thread.sleep(1500);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7820", 0));
Thread.sleep(1500);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7821", 0));
Thread.sleep(1500);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7822", 0));
Thread.sleep(1500);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7823", 0));
Thread.sleep(1500);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7824", 0));
} else {
Thread.sleep(1500);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7815", 0));
Thread.sleep(1500);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7816", 0));
Thread.sleep(1500);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7817", 0));
Thread.sleep(1500);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7818", 0));
Thread.sleep(1500);
_lunker.broadcastPacket(new S_NpcChatPacket(_lunker, "$7819", 0));
Thread.sleep(1500);
}
}
}
} catch (final InterruptedException e) {
e.printStackTrace();
}
}
}
private L1Location _location;
private short _mapId;
private L1PcInstance _leader;
public void setLeader(L1PcInstance leader) {
this._leader = leader;
}
private int[] _randomRuneEffect;
private int[] _roundStatus;
private int[] _switchStatus;
private L1NpcInstance _Hardin;
private L1NpcInstance _Kerenis;
private boolean _active;
private boolean _receiveAllAction;
private boolean _kerenisAngry;
private static final Logger _log = Logger.getLogger(L1HardinQuest.class.getName());
private boolean _alreadyFirstSwitch;
private boolean _alreadySecondSwitch;
private boolean _alreadyPortal;
//private boolean _hintAlready;
private int _curRound;
spawnBoss _sb;
HqThread _hq;
Preliminary _preliminary;
HardinQuestMonitor _hqm;
KerenisRandomMessage _krm;
KerenisPart1 _kp1;
KerenisPart2 _kp2;
KerenisPart3 _kp3;
KerenisPart4 _kp4;
assailantSpawn _as;
attackKerenis _ak;
private boolean _BlackRuneTrodAlready;
orcVocabulary _ov;
private boolean _blackRune;
private int _actionKerenis;
private int _actionHardin;
private int[] _onPlayerList;
L1NpcInstance _lunker;
private boolean _alreadyGuardManDeath;
private boolean _deleteTransactionNow;
private final ArrayList<L1TrapInstance> _trapList = new ArrayList<L1TrapInstance>();
private ArrayList<L1DoorInstance> _doors;
moveWall _mw;
///오비션
public L1HardinQuest(short mapId) {
setMapId(mapId);
init();
}
private static final int WALL_GFXID = 7536;
private final L1DoorGfx _wallGfx = L1DoorGfx.findByGfxId(WALL_GFXID);
private void addDoor(L1Location loc) {
L1DoorInstance door = DoorTable.getInstance().createDoor(0, _wallGfx, loc, 0, 1, false);
getAllDoors().add(door);
}
private void addTrapList(L1TrapInstance trap) {
_trapList.add(trap);
}
private void doSpawnGroup(L1Location loc, int npcId, int groupId) {
final L1NpcInstance mob = new L1NpcInstance(NpcTable.getInstance().getTemplate(npcId));
mob.setId(IdFactory.getInstance().nextId());
mob.setHeading(5);
mob.setX(loc.getX());
mob.setHomeX(loc.getX());
mob.setY(loc.getY());
mob.setHomeY(loc.getY());
mob.setMap((short) loc.getMapId());
L1MobGroupSpawn.getInstance().doSpawn(mob, groupId, true, false);
mob.deleteMe();
}
public void end() {
// this.outPushPlayer();
setDeleteTransactionNow(true);
killTimer();
reset();
setDeleteTransactionNow(false);
L1HardinQuest.getInstance().resetActiveMaps(getMapId());
}
private int getActionHardin() {
return _actionHardin;
}
private int getActionKerenis() {
return _actionKerenis;
}
private ArrayList<L1DoorInstance> getAllDoors() {
return _doors;
}
private int getBoneLaidStatus() {
return getSwitchStatus(_switchStatus.length - 1);
}
private int getCurRound() {
return _curRound;
}
L1Location getLocation() {
return _location;
}
public short getMapId() {
return _mapId;
}
private int[] getOnPlayerList() {
return _onPlayerList;
}
private int getRandomRuneEffect(int i) {
return _randomRuneEffect[i];
}
private boolean getReceiveAllAction() {
return _receiveAllAction;
}
private int getRoundStatus(int i) {
return _roundStatus[i];
}
private int getSwitchStatus(int x) {
return _switchStatus[x];
}
private ArrayList<L1TrapInstance> getTrapList() {
return _trapList;
}
/**
* @throws InterruptedException
*/
public void guardmanDeath() throws InterruptedException {
GuardmanDeath temp = new GuardmanDeath();
temp.begin();
}
class GuardmanDeath extends TimerTask {
public void begin() {
final Timer timer = new Timer();
timer.schedule(this, 0);
}
@Override
public void run() {
if (!isDeleteTransactionNow()) {
try {
if (getSwitchStatus(3) == 0) {
setSwitchStatus(3, 1);
}
setAlreadyGuardManDeath(true);
if (_leader.getMapId() == getMapId()) {
_leader.sendPackets(new S_NpcTalkReturn(_leader.getId(), "j_ep008"));
}
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7643", 0));// 7643
if (getReceiveAllAction()) {
setActionKerenisDirect(0);
Thread.sleep(8000);
if (getActionKerenis() == 1) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7567", 0));
} else {
if (getActionKerenis() == 2) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7575", 0));
} else {// 0
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7646", 0));
}
}
} else {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7644", 0));// 7644
setActionKerenisDirect(0);
Thread.sleep(3000);
if (getActionKerenis() == 1) {
setKerenisAngry(true);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7568", 0));
} else {
if (getActionKerenis() == 0) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7645", 0));
}
}
}
Thread.sleep(2500);
if(_leader != null){
if(_leader.getMapId()==getMapId()){
L1Teleport.teleport(_leader, 32718, 32849, getMapId(), 5, true);
}
}
sendMessage("$7647", 0);
Thread.sleep(4000);
sendMessage("$7648", 0);
Thread.sleep(4000);
sendMessage("$7649", 0);
sendShockWave();
Thread.sleep(5000);
if (!isDeleteTransactionNow()) {
_hq = new HqThread();
GeneralThreadPool.getInstance().execute(_hq);
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
this.cancel();
}
}
GuestSpawn _gs;
class GuestSpawn extends Thread {
@Override
public void run() {
try {
sendShockWave();
final L1Location loc = new L1Location();
loc.set(32707, 32858, getMapId());
if (isHardMode()) {
L1NpcInstance Mob = null;
if (isKerenisAngry()) {
Mob = spawnOne(loc, 91344, 0);
Mob.broadcastPacket(new S_NpcChatPacket(Mob, "$7694", 0));
Thread.sleep(1000);
Mob.broadcastPacket(new S_NpcChatPacket(Mob, "$7695", 0));// 7695
Thread.sleep(1000);
Mob.broadcastPacket(new S_NpcChatPacket(Mob, "$7709", 0));// 7709
Thread.sleep(1000);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7677", 0));// 7677
} else {
Mob = spawnOne(loc, 91343, 0);
Mob.broadcastPacket(new S_NpcChatPacket(Mob, "$7663", 0));// 7663
Thread.sleep(1000);
Mob.broadcastPacket(new S_NpcChatPacket(Mob, "$7664", 0));// 7664
Thread.sleep(1000);
Mob.broadcastPacket(new S_NpcChatPacket(Mob, "$7665", 0));// 7665
Thread.sleep(1000);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7837", 0));
}
Thread.sleep(1000);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7838", 0));
Thread.sleep(1000);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7839", 0));
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
private void init() {
setActive(true);
_location = new L1Location(32707, 32846, getMapId());
_switchStatus = new int[4];
_roundStatus = new int[12];
_randomRuneEffect = new int[9];
_doors = new ArrayList<L1DoorInstance>();
final RandomGenerator rd = RandomGeneratorFactory.getSharedRandom();
int value = 0;
int[] tmp = new int[4];
boolean find = false;
setRandomRuneEffect(0, value);
for (int i = 0; i < 4; i++) {
while (!find) {
value = rd.nextInt(4) + 1;
find = searchRandomRuneEffect(value, tmp);
}
tmp[i] = value;
find = false;
}
for (int i = 0; i < 4; i++) {
if (rd.nextInt(2) == 1) {
setRandomRuneEffect(i * 2 + 1, (tmp[i] - 1) * 2 + 1);
setRandomRuneEffect(i * 2 + 2, (tmp[i] - 1) * 2 + 2);
} else {
setRandomRuneEffect(i * 2 + 1, (tmp[i] - 1) * 2 + 2);
setRandomRuneEffect(i * 2 + 2, (tmp[i] - 1) * 2 + 1);
}
}
final L1Location loc = new L1Location();
loc.set(32742, 32930, getMapId());
//////////////////////////////////////////////
_Kerenis = spawnOne(loc, 91297, 6);
loc.set(32733, 32724, getMapId());
_Hardin = spawnOne(loc, 91330, 6);
loc.set(32684, 32817, getMapId());
spawnOne(loc, 81167, 0);
loc.set(32732, 32789, getMapId());
spawnOne(loc, 81167, 0);
loc.set(32760, 32791, getMapId());
spawnOne(loc, 81167, 0);
loc.set(32667, 32874, getMapId());
spawnOne(loc, 81167, 0);
loc.set(32729, 32854, getMapId());
spawnOne(loc, 81167, 0);
loc.set(32666, 32817, getMapId());
spawnOne(loc, 91326, 0);
loc.set(32668, 32817, getMapId());
spawnOne(loc, 91326, 0);
loc.set(32668, 32819, getMapId());
spawnOne(loc, 91326, 0);
loc.set(32666, 32819, getMapId());
spawnOne(loc, 91326, 0);
loc.set(32809, 32837, getMapId());
spawnOne(loc, 91326, 0);
loc.set(32809, 32839, getMapId());
spawnOne(loc, 91326, 0);
loc.set(32807, 32837, getMapId());
spawnOne(loc, 91326, 0);
loc.set(32807, 32839, getMapId());
spawnOne(loc, 91326, 0);
//11111111111111111111111111111삼//
loc.set(32806, 32863, getMapId());
spawnOne(loc, 91339, 0);
loc.set(32808, 32864, getMapId());
spawnOne(loc, 91339, 0);
loc.set(32800, 32864, getMapId());
spawnOne(loc, 91339, 0);
loc.set(32799, 32866, getMapId());
spawnOne(loc, 91339, 0);
loc.set(32807, 32870, getMapId());
spawnOne(loc, 91339, 0);
loc.set(32806, 32872, getMapId());
spawnOne(loc, 91339, 0);
loc.set(32798, 32872, getMapId());
spawnOne(loc, 91339, 0);
loc.set(32800, 32873, getMapId());
spawnOne(loc, 91339, 0);
//loc.set(32802, 32868, getMapId());
//spawnOne(loc, 91338, 0);
////////////2///////////
loc.set(32666, 32817, getMapId());
setSwitch(loc, 54);
loc.set(32668, 32817, getMapId());
setSwitch(loc, 54);
loc.set(32668, 32819, getMapId());
setSwitch(loc, 54);
loc.set(32666, 32819, getMapId());
setSwitch(loc, 54);
loc.set(32712, 32793, getMapId());
setSwitch(loc, 55);
loc.set(32703, 32791, getMapId());
setSwitch(loc, 55);
loc.set(32710, 32803, getMapId());
setSwitch(loc, 55);
loc.set(32703, 32800, getMapId());
setSwitch(loc, 55);
loc.set(32807, 32839, getMapId());
setSwitch(loc, 56);
loc.set(32809, 32837, getMapId());
setSwitch(loc, 56);
loc.set(32807, 32837, getMapId());
setSwitch(loc, 56);
loc.set(32809, 32839, getMapId());
setSwitch(loc, 56);
loc.set(32807, 32870, getMapId());
setSwitch(loc, 57);
loc.set(32806, 32872, getMapId());
setSwitch(loc, 57);
loc.set(32799, 32866, getMapId());
setSwitch(loc, 57);
loc.set(32800, 32864, getMapId());
setSwitch(loc, 57);
loc.set(32808, 32864, getMapId());
setSwitch(loc, 57);
loc.set(32806, 32863, getMapId());
setSwitch(loc, 57);
loc.set(32798, 32872, getMapId());
setSwitch(loc, 57);
loc.set(32800, 32873, getMapId());
setSwitch(loc, 57);
loc.set(32684, 32816, getMapId());
setSwitch(loc, 60);
loc.set(32732, 32789, getMapId());
setSwitch(loc, 61);
loc.set(32760, 32791, getMapId());
setSwitch(loc, 62);
loc.set(32729, 32854, getMapId());
setSwitch(loc, 63);
loc.set(32667, 32874, getMapId());
setSwitch(loc, 64);
final int mobGroupIdFirst = 78;
int mobGroupLeaderId;
int temp;
loc.set(32785, 32871, getMapId());
temp = rd.nextInt(7) + mobGroupIdFirst;
mobGroupLeaderId = MobGroupTable.getInstance().getTemplate(temp).getLeaderId();
doSpawnGroup(loc, mobGroupLeaderId, temp);
loc.set(32725, 32789, getMapId());
temp = rd.nextInt(7) + mobGroupIdFirst;
mobGroupLeaderId = MobGroupTable.getInstance().getTemplate(temp).getLeaderId();
doSpawnGroup(loc, mobGroupLeaderId, temp);
loc.set(32745, 32813, getMapId());
temp = rd.nextInt(7) + mobGroupIdFirst;
mobGroupLeaderId = MobGroupTable.getInstance().getTemplate(temp).getLeaderId();
doSpawnGroup(loc, mobGroupLeaderId, temp);
loc.set(32686, 32790, getMapId());
temp = rd.nextInt(7) + mobGroupIdFirst;
mobGroupLeaderId = MobGroupTable.getInstance().getTemplate(temp).getLeaderId();
doSpawnGroup(loc, mobGroupLeaderId, temp);
loc.set(32664, 32813, getMapId());
temp = rd.nextInt(7) + mobGroupIdFirst;
mobGroupLeaderId = MobGroupTable.getInstance().getTemplate(temp).getLeaderId();
doSpawnGroup(loc, mobGroupLeaderId, temp);
loc.set(32669, 32850, getMapId());
temp = rd.nextInt(7) + mobGroupIdFirst;
mobGroupLeaderId = MobGroupTable.getInstance().getTemplate(temp).getLeaderId();
doSpawnGroup(loc, mobGroupLeaderId, temp);
loc.set(32683, 32813, getMapId());
temp = rd.nextInt(7) + mobGroupIdFirst;
mobGroupLeaderId = MobGroupTable.getInstance().getTemplate(temp).getLeaderId();
doSpawnGroup(loc, mobGroupLeaderId, temp);
loc.set(32715, 32810, getMapId());
temp = rd.nextInt(7) + mobGroupIdFirst;
mobGroupLeaderId = MobGroupTable.getInstance().getTemplate(temp).getLeaderId();
doSpawnGroup(loc, mobGroupLeaderId, temp);
loc.set(32745, 32789, getMapId());
temp = rd.nextInt(7) + mobGroupIdFirst;
mobGroupLeaderId = MobGroupTable.getInstance().getTemplate(temp).getLeaderId();
doSpawnGroup(loc, mobGroupLeaderId, temp);
loc.set(32784, 32795, getMapId());
temp = rd.nextInt(7) + mobGroupIdFirst;
mobGroupLeaderId = MobGroupTable.getInstance().getTemplate(temp).getLeaderId();
doSpawnGroup(loc, mobGroupLeaderId, temp);
loc.set(32805, 32797, getMapId());
temp = rd.nextInt(7) + mobGroupIdFirst;
mobGroupLeaderId = MobGroupTable.getInstance().getTemplate(temp).getLeaderId();
doSpawnGroup(loc, mobGroupLeaderId, temp);
loc.set(32792, 32828, getMapId());
temp = rd.nextInt(7) + mobGroupIdFirst;
mobGroupLeaderId = MobGroupTable.getInstance().getTemplate(temp).getLeaderId();
doSpawnGroup(loc, mobGroupLeaderId, temp);
loc.set(32775, 32846, getMapId());
temp = 77;
mobGroupLeaderId = MobGroupTable.getInstance().getTemplate(temp).getLeaderId();
doSpawnGroup(loc, mobGroupLeaderId, temp);
final int diaryFirstId = 50008;
final int[] x = { 32763, 32758, 32663, 32667, 32722 };
final int[] y = { 32800, 32801, 32876, 32867, 32866 };
for (int i = 0; i < x.length; i++) {
if (rd.nextInt(100) <= 50) {
loc.set(x[i], y[i], getMapId());
L1World.getInstance().getInventory(loc).storeItem(
diaryFirstId + rd.nextInt(10), 1);
}
}
if (getMapId() != 9000) {
for (L1DoorInstance door : DoorTable.getInstance().getDoorList()) {
if (door.getMapId() == 2) {// TIC2Fのドア
if (door.getX() == 32684 && door.getY() == 32850) {
continue;
}
L1DoorGfx gfx = L1DoorGfx.findByGfxId(door.getGfxId());
L1DoorInstance createDoor = DoorTable.getInstance().createDoor(0, gfx,
new L1Location(door.getX(), door.getY(), getMapId()), 0, 0, false);
}
}
for (L1Object obj : L1World.getInstance().getObject()) {
if (obj.getMapId() == 2) {
if (obj instanceof L1FieldObjectInstance) {
if (((L1FieldObjectInstance) obj).getNpcId() == 91269) {
continue;
}
spawnOne(new L1Location(obj.getX(), obj.getY(), getMapId()),
((L1FieldObjectInstance) obj).getNpcId(), 0);
}
}
}
}
createWalls();
}
private void createWalls() {
for (int i = 0; i < 10; i++) {
addDoor(new L1Location(32702 + i, 32866, getMapId()));
addDoor(new L1Location(32703 + i, 32872, getMapId()));
}
}
public boolean isActive() {
return _active;
}
public boolean isAlreadyFirstSwitch() {
return _alreadyFirstSwitch;
}
private boolean isAlreadyGuardManDeath() {
return _alreadyGuardManDeath;
}
public boolean isAlreadyPortal() {
return _alreadyPortal;
}
public boolean isAlreadySecondSwitch() {
return _alreadySecondSwitch;
}
private boolean isBlackRuneCreated() {
return _blackRune;
}
private boolean isBlackRuneTrodAlready() {
return _BlackRuneTrodAlready;
}
public boolean isDeleteTransactionNow() {
return _deleteTransactionNow;
}
private boolean isHardMode() {
boolean flag = true;
for (int n = 0; n < _switchStatus.length - 1; n++) {
if (getSwitchStatus(n) != 2) {
flag = false;
break;
}
}
return flag;
}
private boolean isKerenisAngry() {
return _kerenisAngry;
}
private void killTimer() {
try {
if (_krm != null) {
_krm.cancel();
_krm = null;
}
if (_ak != null) {
_ak.cancel();
_ak = null;
}
if (_as != null) {
_as.cancel();
_as = null;
}
if (_sb != null) {
_sb.cancel();
_sb = null;
}
if (_preliminary != null) {
_preliminary.join();
_preliminary = null;
}
if (_mw != null) {
_mw.cancel();
_mw = null;
}
if (_ov != null) {
_ov.cancel();
_ov = null;
}
if (_hq != null) {
_hq.join();
_hq = null;
}
if (_kp1 != null) {
_kp1.join();
_kp1 = null;
}
if (_kp2 != null) {
_kp2.join();
_kp2 = null;
}
if (_kp3 != null) {
_kp3.join();
_kp3 = null;
}
if (_kp4 != null) {
_kp4.join();
_kp4 = null;
}
if (_gs != null) {
_gs.join();
_gs = null;
}
} catch (final Exception ex) {
ex.printStackTrace();
}
}
public void lunkerDie(L1NpcInstance npc) throws InterruptedException {
boolean kerenisSpawn = false;
boolean guestSpawn = false;
if (!isKerenisAngry()) {
kerenisSpawn = true;
} else {
if (isHardMode()) {
kerenisSpawn = true;
}
}
if (isHardMode()) {
guestSpawn = true;
}
if (kerenisSpawn) {
if (npc.getNpcId() == 91295 || npc.getNpcId() == 91296) {
boolean find = false;
for (L1Object obj : L1World.getInstance().getVisiblePoint(
getLocation(), 15)) {
if (obj instanceof L1MonsterInstance) {
if (((L1MonsterInstance) obj).getNpcId() == 91290
|| ((L1MonsterInstance) obj).getNpcId() == 91294) {
if (!((L1MonsterInstance) obj).isDead()) {
find = true;
}
break;
}
}
}
if (find) {
BossEndTalks bet = new BossEndTalks(1, _Hardin, _Kerenis);
bet.begin();
} else {
if (guestSpawn) {
_gs = new GuestSpawn();
GeneralThreadPool.getInstance().execute(_gs);
}
_mw = new moveWall();
_mw.begin();
}
} else {
boolean find = false;
for (L1Object obj : L1World.getInstance().getVisiblePoint(
getLocation(), 15)) {
if (obj instanceof L1MonsterInstance) {
if (((L1MonsterInstance) obj).getNpcId() == 91295
|| ((L1MonsterInstance) obj).getNpcId() == 91296) {
if (!((L1MonsterInstance) obj).isDead()) {
find = true;
}
break;
}
}
}
if (find) {
BossEndTalks bet = new BossEndTalks(2, _Hardin, _Kerenis);
bet.begin();
} else {
if (guestSpawn) {
_gs = new GuestSpawn();
GeneralThreadPool.getInstance().execute(_gs);
}
_mw = new moveWall();
_mw.begin();
}
}
} else {
if (guestSpawn) {
_gs = new GuestSpawn();
GeneralThreadPool.getInstance().execute(_gs);
}
_mw = new moveWall();
_mw.begin();
}
}
private void setItemEffect(L1ItemInstance item, int type){
if(type == 0){
item.setIsHaste(true) ;
}else if(type == 1){
item.setMr(5) ;
}else if(type == 2){
item.setHitModifier(1) ;
}else if(type == 3){
item.setBowHitModifier(1) ;
}else if(type == 4){
item.setDmgModifier(1) ;
item.setBowDmgModifier(1);
}else if(type == 5){
item.setSp(1) ;
}else if(type == 6){
item.setHpr(1) ;
}else if(type == 7){
item.setMpr(1) ; ;
}
}
public void onBlackRune() throws InterruptedException {
if (isBlackRuneTrodAlready()) {
return;
}
sendShockWave();
setBlackRuneTrodAlready(true);
final int mapId = getMapId();
int starItem = 0;
int player_cnt = 0;
for (int i = 0; i < getOnPlayerList().length; i++) {
if (getOnPlayerList()[i] != 0) {
player_cnt++;
}
}
if (player_cnt != 0) {
if(player_cnt <= 4){
starItem = 21156;
}else if(player_cnt == 5){
starItem = 21157;
}else if(player_cnt == 6){
starItem = 21158;
}else if(player_cnt >= 7){
starItem = 21159;
}
}
final L1Location loc = new L1Location(32802, 32868, mapId);
for (final L1Object obj : L1World.getInstance().getVisiblePoint(loc, 0)) {
if (obj instanceof L1PcInstance) {
L1ItemInstance item = L1World.getInstance().getInventory(loc).storeItem(starItem,1);
final RandomGenerator random = RandomGeneratorFactory.getSharedRandom();
final int rnd = random.nextInt(8);
setItemEffect(item, rnd);
}
}
loc.set(32806, 32863, mapId);
for (final L1Object obj : L1World.getInstance().getVisiblePoint(loc, 0)) {
if (obj instanceof L1PcInstance) {
for (int i = 0; i < getOnPlayerList().length; i++) {
if (obj.getId() == getOnPlayerList()[i]) {
L1ItemInstance item = L1World.getInstance().getInventory(loc).storeItem(starItem, 1);
setItemEffect(item,getRandomRuneEffect(i + 1) - 1);
}
}
}
}
loc.set(32808, 32864, mapId);
for (final L1Object obj : L1World.getInstance().getVisiblePoint(loc, 0)) {
if (obj instanceof L1PcInstance) {
for (int i = 0; i < getOnPlayerList().length; i++) {
if (obj.getId() == getOnPlayerList()[i]) {
L1ItemInstance item = L1World.getInstance().getInventory(loc).storeItem(starItem, 1);
setItemEffect(item,getRandomRuneEffect(i + 1) - 1);
}
}
}
}
loc.set(32800, 32864, mapId);
for (final L1Object obj : L1World.getInstance().getVisiblePoint(loc, 0)) {
if (obj instanceof L1PcInstance) {
for (int i = 0; i < getOnPlayerList().length; i++) {
if (obj.getId() == getOnPlayerList()[i]) {
L1ItemInstance item = L1World.getInstance().getInventory(loc).storeItem(starItem, 1);
setItemEffect(item,getRandomRuneEffect(i + 1) - 1);
}
}
}
}
loc.set(32799, 32866, mapId);
for (final L1Object obj : L1World.getInstance().getVisiblePoint(loc, 0)) {
if (obj instanceof L1PcInstance) {
for (int i = 0; i < getOnPlayerList().length; i++) {
if (obj.getId() == getOnPlayerList()[i]) {
L1ItemInstance item = L1World.getInstance().getInventory(loc).storeItem(starItem, 1);
setItemEffect(item,getRandomRuneEffect(i + 1) - 1);
}
}
}
}
loc.set(32807, 32870, mapId);
for (final L1Object obj : L1World.getInstance().getVisiblePoint(loc, 0)) {
if (obj instanceof L1PcInstance) {
for (int i = 0; i < getOnPlayerList().length; i++) {
if (obj.getId() == getOnPlayerList()[i]) {
L1ItemInstance item = L1World.getInstance().getInventory(loc).storeItem(starItem, 1);
setItemEffect(item,getRandomRuneEffect(i + 1) - 1);
}
}
}
}
loc.set(32806, 32872, mapId);
for (final L1Object obj : L1World.getInstance().getVisiblePoint(loc, 0)) {
if (obj instanceof L1PcInstance) {
for (int i = 0; i < getOnPlayerList().length; i++) {
if (obj.getId() == getOnPlayerList()[i]) {
L1ItemInstance item = L1World.getInstance().getInventory(loc).storeItem(starItem, 1);
setItemEffect(item,getRandomRuneEffect(i + 1) - 1);
}
}
}
}
loc.set(32798, 32872, mapId);
for (final L1Object obj : L1World.getInstance().getVisiblePoint(loc, 0)) {
if (obj instanceof L1PcInstance) {
for (int i = 0; i < getOnPlayerList().length; i++) {
if (obj.getId() == getOnPlayerList()[i]) {
L1ItemInstance item = L1World.getInstance().getInventory(loc).storeItem(starItem, 1);
setItemEffect(item,getRandomRuneEffect(i + 1) - 1);
}
}
}
}
loc.set(32800, 32873, mapId);
for (final L1Object obj : L1World.getInstance().getVisiblePoint(loc, 0)) {
if (obj instanceof L1PcInstance) {
for (int i = 0; i < getOnPlayerList().length; i++) {
if (obj.getId() == getOnPlayerList()[i]) {
L1ItemInstance item = L1World.getInstance().getInventory(loc).storeItem(starItem, 1);
setItemEffect(item,getRandomRuneEffect(i + 1) - 1);
}
}
}
}
sendMessage("$8719", 0);
Thread.sleep(30 * 1000);
if (!isDeleteTransactionNow())
outPushPlayer();// end();
}
/**
* @throws InterruptedException
*/
public void onFirstSwitch() throws InterruptedException {
if (!isDeleteTransactionNow()) {
sendShockWave();
_kp2 = new KerenisPart2();
GeneralThreadPool.getInstance().execute(_kp2);
}
if (getSwitchStatus(0) == 0) {
setSwitchStatus(0, 1);
}
setAlreadyFirstSwitch(true);
final L1Location loc = new L1Location(32744, 32932, getMapId());
spawnOne(loc, 91326, 0);
loc.set(32667, 32818, getMapId());
spawnOne(loc, 91318, 0);
sendMessage(_Hardin.getName() + " : $7621", 0);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7621", 0));// 7621
_ov = new orcVocabulary();
_ov.begin();
if (_leader.getMapId() == getMapId()) {
_leader.sendPackets(new S_NpcTalkReturn(_leader.getId(), "j_ep005"));
}
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7623", 0));// //7623
Thread.sleep(8000);
if (getActionKerenis() == 1) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7564", 0));// 7564
} else {
if (getActionKerenis() == 2) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7572", 0));
} else {// 0
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7624", 0));
}
}
final int mobGroupLeaderId = MobGroupTable.getInstance().getTemplate(85).getLeaderId();
doSpawnGroup(_leader.getLocation(), mobGroupLeaderId, 85);
_as = new assailantSpawn();
_as.begin();
_ak = new attackKerenis();
_ak.begin();
}
public void onSecondSwitch() throws InterruptedException {
if (!isDeleteTransactionNow()) {
sendShockWave();
_kp3 = new KerenisPart3();
GeneralThreadPool.getInstance().execute(_kp3);
}
if (getSwitchStatus(1) == 0) {
setSwitchStatus(1, 1);
}
setAlreadySecondSwitch(true);
final L1Location loc = new L1Location(32740, 32928, getMapId());
spawnOne(loc, 91326, 0);
loc.set(32712, 32793, getMapId());
spawnOne(loc, 81167, 0);
loc.set(32703, 32791, getMapId());
spawnOne(loc, 81167, 0);
loc.set(32710, 32803, getMapId());
spawnOne(loc, 81167, 0);
loc.set(32703, 32800, getMapId());
spawnOne(loc, 81167, 0);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7629", 0));// 7629
sendMessage(_Hardin.getName() + " : $7628", 0);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7628", 0));// 7628
if (_leader.getMapId() == getMapId()) {
_leader.sendPackets(new S_NpcTalkReturn(_leader.getId(), "j_ep006"));
}
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7630", 0));// 7630
setActionKerenisDirect(0);
Thread.sleep(8000);
final int mobGroupLeaderId = MobGroupTable.getInstance().getTemplate(85).getLeaderId();
doSpawnGroup(_leader.getLocation(), mobGroupLeaderId, 85);
if (getActionKerenis() == 1) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7565", 0));// 7565
} else {
if (getActionKerenis() == 2) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7573", 0));
} else {// 0
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7631", 0));
}
}
}
/**
* @throws InterruptedException
*/
public void onThirdSwitch() throws InterruptedException {
if (!isDeleteTransactionNow()) {
_kp4 = new KerenisPart4();
GeneralThreadPool.getInstance().execute(_kp4);
}
if (getSwitchStatus(2) == 0) {
setSwitchStatus(2, 1);
}
setAlreadyPortal(true);
final L1Location loc = new L1Location(32743, 32929, getMapId());
spawnOne(loc, 91326, 0);
loc.set(32787, 32821, getMapId());
spawnOne(loc, 91318, 0);
loc.set(32808, 32838, getMapId());
spawnOne(loc, 91319, 0);
setSwitch(loc, 53);
sendMessage(_Hardin.getName() + " : $7635", 0);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7635", 0));// 7635
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7636", 0));// 7636
if (_leader.getMapId() == getMapId()) {
_leader.sendPackets(new S_NpcTalkReturn(_leader.getId(), "j_ep007"));
}
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7637", 0));// 7637
Thread.sleep(8000);
if (getActionKerenis() == 1) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7566", 0));// 7566
} else {
if (getActionKerenis() == 2) {
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7574", 0));
} else {// 0
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7638", 0));
}
}
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7639", 0));// 7639
}
private void outPushPlayer() {
for (final L1PcInstance pc : L1World.getInstance().getAllPlayers())
{
if (pc.getMapId() == getMapId()) {
final RandomGenerator random = RandomGeneratorFactory.getSharedRandom();
final int rndx = random.nextInt(4);
final int rndy = random.nextInt(4);
final int locx = 32587 + rndx;
final int locy = 32941 + rndy;
final short mapid = 0;
L1Teleport.teleport(pc, locx, locy, mapid, 5, true);
}
}
}
/**
* @param door
*/
private void removeDoor(L1DoorInstance door) {
getAllDoors().remove(door);
DoorTable.getInstance().deleteDoorByLocation(door.getLocation());
}
private void reset() {
try {
for (final L1Object obj : L1World.getInstance().getObject()) {
if (obj.getMapId() == getMapId()) {
if (obj instanceof L1FieldObjectInstance) {
L1World.getInstance().removeVisibleObject(obj);
L1World.getInstance().removeObject(obj);
} else if (obj instanceof L1EffectInstance) {
L1World.getInstance().removeVisibleObject(obj);
L1World.getInstance().removeObject(obj);
} else if (obj instanceof L1ItemInstance) {
final L1Inventory groundInventory = L1World.getInstance().getInventory(
obj.getX(), obj.getY(), obj.getMapId());
groundInventory.deleteItem((L1ItemInstance) obj);
L1World.getInstance().removeVisibleObject(obj);
L1World.getInstance().removeObject(obj);
} else if (obj instanceof L1DoorInstance) {
removeDoor((L1DoorInstance) obj);
} else if (obj instanceof L1NpcInstance) {
((L1NpcInstance) obj).deleteMe();
}
}
}
for (final L1TrapInstance obj : this.getTrapList()) {
if (obj.getMapId() == getMapId()) {
L1WorldTraps.getInstance().removeTrap(obj);
}
}
} catch (final Exception e) {
e.printStackTrace();
}
}
/**
* @param pattern
* @param curRound
* @throws InterruptedException
*/
private void selectSpawn(int pattern, int curRound) throws InterruptedException {
final int npcid[] = { 91274, 91275, 91276, 91277, 91278, 91279, 91280,
91281, 91282, 91283, 91284, 91285, 91286, 91287, 91288, 91289,
91292 };
final RandomGenerator random = RandomGeneratorFactory.getSharedRandom();
int startPoint = 0;
int endPoint = 16;
int delay = 0;
final int X[] = { 32706, 32695, 32702, 32717, 32706 };
final int Y[] = { 32836, 32847, 32855, 32847, 32846 };
final L1Location loc = new L1Location();
if (pattern == 2) {
// if(pattern==3){
// startPoint=12;
// }else{
startPoint = 9;
endPoint = 14;
// }
} else if (pattern == 3) {
// if(pattern==3){
// startPoint=12;
// }else{
startPoint = 12;
endPoint = 14;
// }
} else {
endPoint = 6;
}
for (int i = 0; i < curRound - 1; i++) {
if (getRoundStatus(i) == 1) {
if (endPoint < 16) {
startPoint++;
endPoint++;
} else {
break;
}
}else if (getRoundStatus(i) == 2) {//slow
if (startPoint > 0) {
startPoint--;
endPoint--;
} else {
break;
}
}else{//stop case : 3
}
}
if (isBonusStage()) {
int s = random.nextInt(4);
for (L1PcInstance pc : L1World.getInstance().getAllPlayers()) {
if (pc.getMapId() == getMapId()) {
pc.sendPackets(new S_SkillSound(pc.getId(), 2028 + s));
pc.broadcastPacket(new S_SkillSound(pc.getId(), 2028 + s));
}
}
}
for (int i = 0; startPoint + i <= endPoint; i++) {
final int n = random.nextInt(5);
loc.set(X[n] - 3 + random.nextInt(6), Y[n] - 3 + random.nextInt(6), getMapId());
if (isBonusStage()) {
spawnOneMob(loc, 91337);
} else {
spawnOneMob(loc, npcid[startPoint + random.nextInt(endPoint + 1 - startPoint)]);
}
delay += 500;
Thread.sleep(500);
}
Thread.sleep(9000 - delay);
}
private void setBonusStage(boolean flag) {
_bonusStage = flag;
}
private boolean isBonusStage() {
return _bonusStage;
}
private boolean _bonusStage;
/**
* @param curRound
* @throws InterruptedException
*/
private void sendBossRoundMessage(int curRound) throws InterruptedException {
if (curRound / 4 > 1) {
sendMessage("$8706", 0);// blue
Thread.sleep(3000);
sendMessage("$8707", 0);// blue
} else {
sendMessage("$8704", 0);// blue
Thread.sleep(3000);
sendMessage("$8705", 0);// blue
}
_sb = new spawnBoss();
_sb.begin();
}
private void sendCountDown() throws InterruptedException {
Thread.sleep(4000);
sendMessage("$7650", 0);
Thread.sleep(4000);
sendMessage("$7651", 0);
Thread.sleep(4000);
}
private void sendMessage(String s, int cases) {
if(cases==0){
for (final L1PcInstance pc : L1World.getInstance().getAllPlayers()) {
if (pc.getMapId() == this.getMapId()) {
pc.sendPackets(new S_GreenMessage(s));
}
}
}else if(cases==1){
if (_leader.getMapId() == this.getMapId()) {
_leader.sendPackets(new S_GreenMessage(s));
}
}else if(cases==2){
for (final L1PcInstance pc : L1World.getInstance().getAllPlayers()) {
if (pc.getMapId() == this.getMapId() && _leader.getId() != pc.getId()) {
pc.sendPackets(new S_GreenMessage(s));
}
}
}
}
private void sendShockWave() {
for (final L1PcInstance pc : L1World.getInstance().getAllPlayers()) {
if (pc.getMapId() == this.getMapId()) {
pc.sendPackets(new S_ShockWave());
}
}
}
private void sendRoundMessage(int curRound) throws InterruptedException {
final int MSGID = 8708;
if ((curRound % 4 == 0) && (curRound != 12)) {
Thread.sleep(5000);
sendBossRoundMessage(curRound);
} else {
if (curRound != 12) {
Thread.sleep(7000);
sendMessage("$" + (MSGID + curRound
- (int) (1 + Math.floor(curRound / 4))), 0);
Thread.sleep(2000);
} else {
sendMessage("$7654", 0);
Thread.sleep(15000);
sendMessage("$8717", 0);
sendShockWave();
Thread.sleep(2000);
_sb = new spawnBoss();
_sb.begin();
}
}
}
private void sendSubRoundMessage(int curSubRound) {
final int MSGID = 8689;
if (getCurRound() != 12) {
sendMessage("$" + (MSGID + curSubRound - 1), 0);
}
}
public void sendWisperWindow(int type) {
sendMessage("$8720",0);
if (getMapId() == _leader.getMapId()) {
if (type == 0) {
_leader.sendPackets(new S_NpcTalkReturn(_leader.getId(), "j_int00"));
} else {
final String[] EffectBase = { "$8681", "$8682", "$8685",
"$8686", "$8683", "$8684", "$8687", "$8688" };
if (type == 1) {
final String[] EffectType = { EffectBase[(getRandomRuneEffect(1) - 1)]};
_leader.sendPackets(new S_NpcTalkReturn(_leader.getId(), "j_int01", EffectType));
} else if (type == 2) {
final String[] EffectType = { EffectBase[(getRandomRuneEffect(3) - 1)]};
_leader.sendPackets(new S_NpcTalkReturn(_leader.getId(), "j_int02", EffectType));
} else if (type == 3) {
final String[] EffectType = { EffectBase[(getRandomRuneEffect(6) - 1)]};
_leader.sendPackets(new S_NpcTalkReturn(_leader.getId(), "j_int03", EffectType));
} else if (type == 4) {
final String[] EffectType = { EffectBase[(getRandomRuneEffect(7) - 1)]};
_leader.sendPackets(new S_NpcTalkReturn(_leader.getId(), "j_int04", EffectType));
}
}
}
}
private int searchCountMonster() {
int mobCnt = 0;
for (final L1Object obj : L1World.getInstance().getVisiblePoint(
getLocation(), 13)) {
if (obj instanceof L1MonsterInstance) {
if (!((L1MonsterInstance) obj).isDead()) {
mobCnt++;
}
}
}
return mobCnt;
}
private boolean searchRandomRuneEffect(int value, int[] tmp) {
boolean result = true;
for (int i = 0; i < tmp.length; i++) {
if (value == tmp[i]) {
result = false;
break;
}
}
return result;
}
public void setActionHardin(L1PcInstance pc, int actionCode) {
if(pc.getId() == _leader.getId()){
if (actionCode == 66) {// Alt+4
actionCode = 2;
} else {
if (actionCode == 69) {// Alt+2
actionCode = 1;
} else {
return;
}
}
_actionHardin = actionCode;
}
}
public void setActionKerenis(L1PcInstance pc,int actionCode) {
if(pc.getId() == _leader.getId()){
if (actionCode == 66) {// Alt+4
actionCode = 2;
} else {
if (actionCode == 69) {// Alt+2
actionCode = 1;
} else {
return;// }
}
setReceiveAllAction(getReceiveAllAction() | true);
_actionKerenis = actionCode;
}
}
public void setActionHardinDirect(int actionCode) {
_actionHardin = actionCode;
}
public void setActionKerenisDirect(int actionCode) {
_actionKerenis = actionCode;
}
private void setActive(boolean active) {
_active = active;
}
private void setAlreadyFirstSwitch(boolean firstSwitch) {
_alreadyFirstSwitch = firstSwitch;
}
private void setAlreadyGuardManDeath(boolean guradManDeath) {
_alreadyGuardManDeath = guradManDeath;
}
private void setAlreadyPortal(boolean flag) {
_alreadyPortal = flag;
}
private void setAlreadySecondSwitch(boolean secondSwitch) {
_alreadySecondSwitch = secondSwitch;
}
if (!isBlackRuneCreated()) {
final L1Location loc = new L1Location();
loc.set(32802, 32868, _mapId);
spawnOne(loc, 91338, 0);
setSwitch(loc, 59);
_blackRune = true;
}
}
private void setBlackRuneTrodAlready(boolean trod) {
_BlackRuneTrodAlready = trod;
}
////////라운드
private void setCurRound(int curRound) {
_curRound = curRound;
}
private void setDeleteTransactionNow(boolean transactionNow) {
_deleteTransactionNow = transactionNow;
}
/////
/////
private void setKerenisAngry(boolean angry) {
_kerenisAngry = angry;
}
///////
///////
private void setMapId(short mapId) {
_mapId = mapId;
}
////
////
private void setOnPlayerList(int[] onPlayerList) {
_onPlayerList = onPlayerList;
}
/////
/////
private void setRandomRuneEffect(int i, int value) {
_randomRuneEffect[i] = value;
}
//////
/////
private void setReceiveAllAction(boolean action) {
_receiveAllAction = action;
}
//////////
//////////
private void setRoundStatus(int round, int value) {
_roundStatus[round] = value;
}
//////////
//////////
private void setSwitch(L1Location loc, int id) {
final int trapId = id;
final L1Trap trapTemp = TrapTable.getInstance().getTemplate(trapId);
final Point rndPt = new Point();
rndPt.setX(0);
rndPt.setY(0);
final int span = 0;
final L1TrapInstance trap = new L1TrapInstance(IdFactory.getInstance().nextId(),
trapTemp, loc, rndPt, span);
L1World.getInstance().addVisibleObject(trap);
L1WorldTraps.getInstance().addTrap(trap);
this.addTrapList(trap);
}
///////
//속계/
////// private void setSwitchStatus(int x, int status) {
_switchStatus[x] = status;
}
///////////
여기도
///////////
private L1NpcInstance spawnOne(L1Location loc, int npcid, int heading) {
final L1NpcInstance mob = new L1NpcInstance(NpcTable.getInstance().getTemplate(npcid));
if (mob == null) {
_log.warning("mob == null");
return mob;
}
mob.setId(IdFactory.getInstance().nextId());
mob.setHeading(heading);
mob.setX(loc.getX());
mob.setHomeX(loc.getX());
mob.setY(loc.getY());
mob.setHomeY(loc.getY());
mob.setMap((short) loc.getMapId());
L1World.getInstance().storeObject(mob);
L1World.getInstance().addVisibleObject(mob);
final S_NpcPack S_NpcPack = new S_NpcPack(mob);
for (final L1PcInstance pc : L1World.getInstance().getRecognizePlayer(mob)) {
pc.addKnownObject(mob);
mob.addKnownObject(pc);
pc.sendPackets(S_NpcPack);
}
mob.onNpcAI();
mob.updateLight();
mob.startChat(L1NpcInstance.CHAT_TIMING_APPEARANCE);
return mob;
}
////
위치부분
/////
private L1MonsterInstance spawnOneMob(L1Location loc, int npcid) {
final L1MonsterInstance mob = new L1MonsterInstance(NpcTable.getInstance().getTemplate(npcid));
if (mob == null) {
_log.warning("mob == null");
return mob;
}
mob.setId(IdFactory.getInstance().nextId());
mob.setHeading(5);
mob.setX(loc.getX());
mob.setHomeX(loc.getX());
mob.setY(loc.getY());
mob.setHomeY(loc.getY());
mob.setMap((short) loc.getMapId());
mob.setStoreDroped(false);
mob.setUbSealCount(0);
L1World.getInstance().storeObject(mob);
L1World.getInstance().addVisibleObject(mob);
final S_NpcPack S_NpcPack = new S_NpcPack(mob);
for (final L1PcInstance pc : L1World.getInstance().getRecognizePlayer(mob)) {
pc.addKnownObject(mob);
mob.addKnownObject(pc);
pc.sendPackets(S_NpcPack);
}
mob.onNpcAI();
mob.updateLight();
// mob.startChat(L1NpcInstance.CHAT_TIMING_APPEARANCE);
return mob;
}
//////////////
//////////
public void tereportEntrance(L1PcInstance pc, L1Location loc, int heading) {
L1Teleport.teleport(pc, loc, heading, true);
}
//////////
/////////
public void start() {
_preliminary = new Preliminary();
_hqm = new HardinQuestMonitor();
GeneralThreadPool.getInstance().execute(_preliminary);
_hqm.begin();
}
public void checkLeaveGame(L1PcInstance pc) {
if (pc.getMapId() == getMapId()) {
final RandomGenerator random = RandomGeneratorFactory.getSharedRandom();
final int rndx = random.nextInt(4);
final int rndy = random.nextInt(4);
final int locx = 32587 + rndx;
final int locy = 32941 + rndy;
final short mapid = 0;
L1Teleport.teleport(pc, locx, locy, mapid, 5, false);
}
}
}
class BossEndTalks extends TimerTask {
int _type;
L1NpcInstance _Hardin;
L1NpcInstance _Kerenis;
BossEndTalks(int type,L1NpcInstance Hardin,L1NpcInstance Kerenis){//
_type=type;
_Hardin=Hardin;
_Kerenis=Kerenis;
}
public void begin() {
final Timer timer = new Timer();
timer.schedule(this,0);
}
////////////////////////
@Override
public void run() {
try {
if(_type==1){
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7833", 0));
Thread.sleep(2000);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7834", 0));
}else if(_type==2){
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7827", 0));
Thread.sleep(1000);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7828", 0));
Thread.sleep(1800);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7829", 0));
Thread.sleep(1800);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7830", 0));
Thread.sleep(1000);
_Hardin.broadcastPacket(new S_NpcChatPacket(_Hardin, "$7831", 0));
Thread.sleep(1500);
_Kerenis.broadcastPacket(new S_NpcChatPacket(_Kerenis, "$7832", 0));
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
[출처] [일팩유저화이팅]하딘시스템 (비공개 카페)
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
공지 | 소스자료는 직접 올려주세요 | 게임존 | 2017.06.06 | 550 |
309 | 재질에 의한 타격치.. | 준희미니 | 2016.06.29 | 39 |
308 | 헤이스트 아이템 헤이스트효과구현 | 준희미니 | 2016.06.29 | 41 |
307 | 언데드계열 힐주기 | 준희미니 | 2016.06.29 | 27 |
306 | 경험치 중복 떨구기 및 문지방적용시 잊섬에서 경험치 적용안되는부분 수정.txt | 준희미니 | 2016.06.29 | 49 |
305 | 고대인의 지혜및 기타지팡이 엠흡수.txt | 준희미니 | 2016.06.29 | 67 |
304 | 리스창 케릭삭제부분.txt | 준희미니 | 2016.06.29 | 38 |
303 | 마법공격시 보라돌이,유저공격시 카오적용.txt | 준희미니 | 2016.06.29 | 41 |
302 | cpu_100%.txt | 준희미니 | 2016.06.29 | 107 |
301 | 특정지역 몬스터 아덴드랍율 높히기.txt | 준희미니 | 2016.06.29 | 99 |
300 | 트리플에로우 카오적용.txt | 준희미니 | 2016.06.29 | 49 |
299 | 점프팩 옵코...관련 | 준희미니 | 2016.06.29 | 177 |
298 | 세트 착용시 화려한 임팩 | 준희미니 | 2016.06.28 | 53 |
297 | 환영의 체인소드 저만의 짜집기 | 준희미니 | 2016.06.28 | 38 |
296 | 어스가디언 (수정) | 준희미니 | 2016.06.28 | 23 |
295 | 허수아비 파티시 어택불가 | 준희미니 | 2016.06.28 | 27 |
294 | 이미 마법을 배우면 더이상 안배워지도록 | 준희미니 | 2016.06.28 | 82 |
293 | [서버방어프로젝트1] 너 스핵쓰냐? 잡아줄게 | 준희미니 | 2016.06.28 | 75 |
» | [일팩유저화이팅]하딘시스템 | 준희미니 | 2016.06.28 | 35 |
291 | 페이트님 혈맹버프를 실시간으로... | 준희미니 | 2016.06.28 | 26 |
290 | 계급 및 혈맹 매칭 | 준희미니 | 2016.06.28 | 28 |
289 | 강제변신검 특화검 혹시나 필요하신분있을꺼같아서 | 준희미니 | 2016.06.28 | 59 |
288 | npc 거리제한 해제 | 준희미니 | 2016.06.28 | 41 |
287 | 흑사버프 | 준희미니 | 2016.06.28 | 30 |
286 | 제브레퀴 라이브화 | 준희미니 | 2016.06.28 | 30 |
285 | [에바] 3.80 옵코드 | 준희미니 | 2016.06.28 | 160 |
284 | 보스몹 유저 소환 | 준희미니 | 2016.06.28 | 98 |
283 | 성혈전용 던전이동주문서 만들어보자 | 준희미니 | 2016.06.28 | 45 |
282 | 전쟁.종전.항복 소스입니다 | 준희미니 | 2016.06.28 | 24 |
281 | 서먼 공속 막는 야매 | 준희미니 | 2016.06.28 | 35 |
280 | 환생물약(고전) | 최강빅토리 | 2016.06.27 | 117 |
279 | 아덴 증가 로그 시스템 추가 | 최강빅토리 | 2016.06.27 | 57 |
278 | 몹 공격시 4대 용처럼 몹 주위로 강제 소환 되도록 하기 | 최강빅토리 | 2016.06.27 | 56 |
277 | pvp 이긴사람에게 아이템 지급~ | 최강빅토리 | 2016.06.27 | 65 |
276 | 지엠설정 아이피체크 외부화~ | 최강빅토리 | 2016.06.27 | 64 |
275 | 기란마을 제이프퀘 본섭화 | 최강빅토리 | 2016.06.27 | 48 |
274 | 펫레이싱 본섭화 하기~ | 최강빅토리 | 2016.06.27 | 57 |
273 | 엔피씨에게 호칭을 주자~ | 최강빅토리 | 2016.06.27 | 40 |
272 | 유저 접속시 매니저창에 서버에 접속한 총인원을 표시 | 최강빅토리 | 2016.06.27 | 52 |
271 | 쉽게 올버프물약 만들어보자~ | 최강빅토리 | 2016.06.27 | 190 |
270 | 아이템드랍 필드별제한 | 최강빅토리 | 2016.06.27 | 52 |
269 | 스핵5회감지시 좀비로변신하게~ | 최강빅토리 | 2016.06.27 | 53 |
268 | 세트착용시 화려한임팩 | 최강빅토리 | 2016.06.27 | 61 |
267 | 붉은기사단의 물약 | 최강빅토리 | 2016.06.27 | 47 |
266 | 변신이벤트 외부화로 해봅시다~(2.7 Rev1484용)[Eva는 조금다름] | 최강빅토리 | 2016.06.27 | 72 |
265 | 마방및 마법데미지 본x화 | 최강빅토리 | 2016.06.27 | 282 |
264 | PK시 이긴사람이 진사람에게 깃털 뺏어오기 | 최강빅토리 | 2016.06.27 | 34 |
263 | 스냅퍼 용사/지혜 반지 | 준희미니 | 2016.06.27 | 40 |
262 | 투석기입니다용; | 준희미니 | 2016.06.27 | 15 |
261 | 성장의 마법사^에킨스 | 준희미니 | 2016.06.27 | 30 |
260 | 한국옵 코 | 준희미니 | 2016.06.27 | 108 |