테스트

aion-server 4.8

Gitteol
최고관리자 · 1 · 💬 0 클론/새로받기
 4.8 61f661d · 1 commits 새로받기(Pull)
game-server/data/handlers/instance/LowerUdasTempleInstance.java
package instance;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;

import com.aionemu.commons.utils.Rnd;
import com.aionemu.gameserver.instance.handlers.GeneralInstanceHandler;
import com.aionemu.gameserver.instance.handlers.InstanceID;
import com.aionemu.gameserver.model.gameobjects.Npc;
import com.aionemu.gameserver.model.gameobjects.player.Player;
import com.aionemu.gameserver.world.WorldMapInstance;
import com.aionemu.gameserver.world.WorldPosition;

/**
 * @author xTz, Luzien, Majka
 */
@InstanceID(300160000)
public class LowerUdasTempleInstance extends GeneralInstanceHandler {

	private final static WorldPosition[] trap_positions = { new WorldPosition(300160000, 749.4821f, 880.4201f, 154.0f, (byte) 0),
		new WorldPosition(300160000, 745.0469f, 881.81305f, 154.0f, (byte) 0), new WorldPosition(300160000, 746.5357f, 894.3326f, 154.0f, (byte) 0),
		new WorldPosition(300160000, 744.6791f, 891.93774f, 154.0f, (byte) 0), new WorldPosition(300160000, 740.22205f, 889.76013f, 154.0f, (byte) 0),
		new WorldPosition(300160000, 747.434f, 892.34344f, 154.0f, (byte) 0), new WorldPosition(300160000, 742.4482f, 877.25726f, 154.0f, (byte) 0),
		new WorldPosition(300160000, 753.5256f, 887.18353f, 154.0f, (byte) 0), new WorldPosition(300160000, 737.72534f, 881.5906f, 154.0f, (byte) 0),
		new WorldPosition(300160000, 754.2026f, 891.1411f, 154.0f, (byte) 0), new WorldPosition(300160000, 752.56525f, 882.522f, 154.0f, (byte) 0),
		new WorldPosition(300160000, 747.5493f, 877.8989f, 154.0f, (byte) 0), new WorldPosition(300160000, 742.0631f, 880.5939f, 154.0f, (byte) 0),
		new WorldPosition(300160000, 743.5199f, 894.62134f, 154.0f, (byte) 0), new WorldPosition(300160000, 750.18896f, 888.14606f, 154.0f, (byte) 0),
		new WorldPosition(300160000, 734.8378f, 881.8151f, 154.0f, (byte) 0), new WorldPosition(300160000, 749.77515f, 890.7882f, 154.0f, (byte) 0),
		new WorldPosition(300160000, 736.18536f, 885.216f, 154.0f, (byte) 0), new WorldPosition(300160000, 747.9022f, 881.5243f, 154.0f, (byte) 0),
		new WorldPosition(300160000, 749.48315f, 884.58484f, 154.0f, (byte) 0), new WorldPosition(300160000, 737.6233f, 890.88306f, 154.0f, (byte) 0),
		new WorldPosition(300160000, 739.68243f, 879.1843f, 154.0f, (byte) 0), new WorldPosition(300160000, 738.9124f, 884.0289f, 154.0f, (byte) 0),
		new WorldPosition(300160000, 752.7236f, 884.03937f, 154.0f, (byte) 0), new WorldPosition(300160000, 753.46356f, 880.17993f, 154.0f, (byte) 0),
		new WorldPosition(300160000, 736.9874f, 878.4464f, 154.0f, (byte) 0), new WorldPosition(300160000, 737.6233f, 894.2839f, 154.0f, (byte) 0),
		new WorldPosition(300160000, 735.89667f, 888.10345f, 154.0f, (byte) 0), new WorldPosition(300160000, 740.22205f, 893.73846f, 154.0f, (byte) 0),
		new WorldPosition(300160000, 751.57184f, 893.03406f, 154.0f, (byte) 0), new WorldPosition(300160000, 742.10815f, 891.3489f, 154.0f, (byte) 0),
		new WorldPosition(300160000, 738.27075f, 887.3014f, 154.0f, (byte) 0), new WorldPosition(300160000, 744.6297f, 879.0218f, 154.0f, (byte) 0),
		new WorldPosition(300160000, 752.0531f, 889.8899f, 154.0f, (byte) 0), new WorldPosition(300160000, 750.2841f, 877.8855f, 154.0f, (byte) 0),
		new WorldPosition(300160000, 749.3269f, 895.6159f, 154.0f, (byte) 0) };

	private List<Npc> traps = new ArrayList<>();
	private AtomicBoolean wasSpawned = new AtomicBoolean();

	public LowerUdasTempleInstance(WorldMapInstance instance) {
		super(instance);
	}

	@Override
	public void onInstanceCreate() {
		float chance = Rnd.chance();
		if (chance < 20) { // spawn named drop chests, 20% both, 30% epic, 50% fabled chest
			spawn(216150, 455.984f, 1192.506f, 190.221f, (byte) 116);
			spawn(216645, 435.664f, 1182.577f, 190.221f, (byte) 116);
		} else if (chance < 50) {
			spawn(216150, 455.984f, 1192.506f, 190.221f, (byte) 116);
		} else {
			spawn(216645, 435.664f, 1182.577f, 190.221f, (byte) 116);
		}
	}

	@Override
	public void onEnterInstance(Player player) {
		if (wasSpawned.compareAndSet(false, true)) {
			traps.add((Npc) spawn(216531, 744.7521f, 885.8238f, 152.7852f, (byte) 30)); // Zhanim The Librarian
			for (WorldPosition position : trap_positions)
				traps.add((Npc) spawn(216530, position.getX(), position.getY(), position.getZ(), (byte) 0)); // Ancient Trap
		}
	}

	@Override
	public void handleUseItemFinish(Player player, Npc npc) {
		for (Npc trap : traps) {
			if (trap != null && trap.getNpcId() != 216531)
				trap.getController().delete();
		}
	}
}

📎 첨부파일

댓글 작성 권한이 없습니다.
🏆 포인트 랭킹 TOP 10
순위 닉네임 포인트
1 no_profile 타키야겐지쪽지보내기 자기소개 아이디로 검색 전체게시물 100,792
2 no_profile 동가리쪽지보내기 자기소개 아이디로 검색 전체게시물 58,079
3 no_profile 라프텔쪽지보내기 자기소개 아이디로 검색 전체게시물 51,771
4 no_profile 불멸의행복쪽지보내기 자기소개 아이디로 검색 전체게시물 36,923
5 서번트쪽지보내기 자기소개 아이디로 검색 전체게시물 35,011
6 no_profile 보거스쪽지보내기 자기소개 아이디로 검색 전체게시물 29,969
7 no_profile 닥터스쪽지보내기 자기소개 아이디로 검색 전체게시물 29,470
8 no_profile 검은고양이쪽지보내기 자기소개 아이디로 검색 전체게시물 29,077
9 no_profile Revolution쪽지보내기 자기소개 아이디로 검색 전체게시물 28,199
10 no_profile 호롤롤로쪽지보내기 자기소개 아이디로 검색 전체게시물 17,020
알림 0