테스트

aion-server 4.8

Gitteol
최고관리자 · 1 · 💬 0 클론/새로받기
 4.8 61f661d · 1 commits 새로받기(Pull)
game-server/src/com/aionemu/gameserver/model/gameobjects/DropNpc.java
package com.aionemu.gameserver.model.gameobjects;

import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

import com.aionemu.gameserver.model.gameobjects.player.Player;
import com.aionemu.gameserver.model.team.TeamMember;
import com.aionemu.gameserver.model.team.TemporaryPlayerTeam;
import com.aionemu.gameserver.model.team.alliance.PlayerAlliance;
import com.aionemu.gameserver.model.team.common.legacy.LootGroupRules;

/**
 * @author Simple
 */
public class DropNpc {

	private final int objectIdId;
	private Set<Integer> allowedLooters = new HashSet<>();
	private Collection<Player> inRangePlayers = new ArrayList<>();
	private Collection<Player> playerStatus = new ArrayList<>();
	private Player lootingPlayer = null;
	private int distributionId = 0;
	private boolean distributionType;
	private int currentIndex = 0;
	private WeakReference<TemporaryPlayerTeam<? extends TeamMember<Player>>> lootingTeam;
	private int lootingTeamId;
	private int maxRoll;
	private LootGroupRules lastLootGroupRules;
	private boolean isFreeForAll = false;
	private long remaingDecayTime;

	public DropNpc(int objectIdId) {
		this.objectIdId = objectIdId;
	}

	public void setAllowedLooters(Set<Integer> allowedLooters) {
		this.allowedLooters = allowedLooters;
	}

	public void setAllowedLooter(Player player) {
		allowedLooters.add(player.getObjectId());
	}

	public Set<Integer> getAllowedLooters() {
		return allowedLooters;
	}

	public boolean isAllowedToLoot(Player player) {
		return isFreeForAll || allowedLooters.contains(player.getObjectId());
	}

	public void setLootingPlayer(Player player) {
		this.lootingPlayer = player;
	}

	public Player getLootingPlayer() {
		return lootingPlayer;
	}

	public boolean isBeingLooted() {
		return lootingPlayer != null;
	}

	public void setDistributionId(int distributionId) {
		this.distributionId = distributionId;
	}

	public int getDistributionId() {
		return distributionId;
	}

	public void setDistributionType(boolean distributionType) {
		this.distributionType = distributionType;
	}

	public boolean getDistributionType() {
		return distributionType;
	}

	public void setCurrentIndex(int currentIndex) {
		this.currentIndex = currentIndex;
	}

	public int getCurrentIndex() {
		return currentIndex;
	}

	public int getLootingTeamId() {
		return lootingTeamId;
	}

	public int getMaxRoll() {
		return maxRoll;
	}

	public LootGroupRules getLootGroupRules() {
		var team = lootingTeam == null ? null : lootingTeam.get();
		if (team != null)
			lastLootGroupRules = team.getLootGroupRules();
		return lastLootGroupRules;
	}

	public void setLootingTeam(TemporaryPlayerTeam<? extends TeamMember<Player>> team) {
		lootingTeam = new WeakReference<>(team);
		lootingTeamId = team.getTeamId();
		maxRoll = team instanceof PlayerAlliance alli ? alli.isInLeague() ? 10000 : 1000 : 100;
		lastLootGroupRules = team.getLootGroupRules();
	}

	public void setInRangePlayers(Collection<Player> inRangePlayers) {
		this.inRangePlayers = inRangePlayers;
	}

	public Collection<Player> getInRangePlayers() {
		return inRangePlayers;
	}

	public void addPlayerStatus(Player player) {
		playerStatus.add(player);
	}

	public void delPlayerStatus(Player player) {
		playerStatus.remove(player);
	}

	public Collection<Player> getPlayerStatus() {
		return playerStatus;
	}

	public boolean containsPlayerStatus(Player player) {
		return playerStatus.contains(player);
	}

	public boolean isFreeForAll() {
		return isFreeForAll;
	}

	public void startFreeForAll() {
		isFreeForAll = true;
		distributionId = 0;
		allowedLooters.clear();
	}

	public final int getObjectId() {
		return objectIdId;
	}

	public long getRemaingDecayTime() {
		return remaingDecayTime;
	}

	public void setRemaingDecayTime(long remaingDecayTime) {
		this.remaingDecayTime = remaingDecayTime;
	}
}

📎 첨부파일

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