forked from MagicBane/Server
lore mine charter type declaration
This commit is contained in:
@@ -3,6 +3,7 @@ package engine.gameManager;
|
|||||||
import engine.Enum;
|
import engine.Enum;
|
||||||
import engine.math.Vector3fImmutable;
|
import engine.math.Vector3fImmutable;
|
||||||
import engine.objects.Guild;
|
import engine.objects.Guild;
|
||||||
|
import engine.objects.Mine;
|
||||||
import engine.objects.PlayerCharacter;
|
import engine.objects.PlayerCharacter;
|
||||||
import engine.objects.Regions;
|
import engine.objects.Regions;
|
||||||
|
|
||||||
@@ -20,7 +21,6 @@ public class LoreMineManager {
|
|||||||
//THIEVES
|
//THIEVES
|
||||||
//SCOURGE
|
//SCOURGE
|
||||||
//UNHOLY
|
//UNHOLY
|
||||||
|
|
||||||
public static final Map<Enum.GuildType, List<String>> GUILD_RACES = new HashMap<>();
|
public static final Map<Enum.GuildType, List<String>> GUILD_RACES = new HashMap<>();
|
||||||
public static final Map<Enum.GuildType, List<String>> GUILD_CLASSES = new HashMap<>();
|
public static final Map<Enum.GuildType, List<String>> GUILD_CLASSES = new HashMap<>();
|
||||||
public static final Map<Enum.GuildType, Boolean> GUILD_GENDER_RESTRICTION = new HashMap<>();
|
public static final Map<Enum.GuildType, Boolean> GUILD_GENDER_RESTRICTION = new HashMap<>();
|
||||||
@@ -79,10 +79,22 @@ public class LoreMineManager {
|
|||||||
GUILD_CLASSES.put(Enum.GuildType.UNHOLY, Arrays.asList("Assassin", "Channeler", "Necromancer", "Priest", "Scout", "Thief", "Warlock", "Warrior", "Wizard"));
|
GUILD_CLASSES.put(Enum.GuildType.UNHOLY, Arrays.asList("Assassin", "Channeler", "Necromancer", "Priest", "Scout", "Thief", "Warlock", "Warrior", "Wizard"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AuditPlayer(PlayerCharacter pc){
|
public static void AuditPlayer(PlayerCharacter pc, Mine mine){
|
||||||
Guild nation = pc.guild.getNation();
|
Guild nation = pc.guild.getNation();
|
||||||
int charterID = nation.getCharter();
|
|
||||||
if(!validForCharter(pc,charterID)){
|
if(mine.chosen_charters == null){
|
||||||
|
mine.chosen_charters = new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
Enum.GuildType guildType;
|
||||||
|
if (mine.chosen_charters.containsKey(nation)) {
|
||||||
|
guildType = mine.chosen_charters.get(nation);
|
||||||
|
}else{
|
||||||
|
guildType = Enum.GuildType.getGuildTypeFromInt(pc.guild.getCharter());
|
||||||
|
mine.chosen_charters.put(nation,guildType);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!validForCharter(pc,guildType)){
|
||||||
//bounce out to SDR
|
//bounce out to SDR
|
||||||
Vector3fImmutable bounceLoc = Vector3fImmutable.getRandomPointOnCircle(ZoneManager.getZoneByUUID(656).getLoc(),30f);
|
Vector3fImmutable bounceLoc = Vector3fImmutable.getRandomPointOnCircle(ZoneManager.getZoneByUUID(656).getLoc(),30f);
|
||||||
pc.setLoc(bounceLoc);
|
pc.setLoc(bounceLoc);
|
||||||
@@ -91,10 +103,9 @@ public class LoreMineManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean validForCharter(PlayerCharacter pc, int charterID) {
|
public static boolean validForCharter(PlayerCharacter pc, Enum.GuildType guildType) {
|
||||||
if(pc.getPromotionClass() == null)
|
if(pc.getPromotionClass() == null)
|
||||||
return false;
|
return false;
|
||||||
Enum.GuildType guildType = Enum.GuildType.getGuildTypeFromInt(charterID);
|
|
||||||
|
|
||||||
// Define the races and classes for each GuildType
|
// Define the races and classes for each GuildType
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ public class Mine extends AbstractGameObject {
|
|||||||
|
|
||||||
public Long allowed_teleport_time;
|
public Long allowed_teleport_time;
|
||||||
public Boolean enforceLore = false;
|
public Boolean enforceLore = false;
|
||||||
|
public HashMap<Guild, Enum.GuildType> chosen_charters;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ResultSet Constructor
|
* ResultSet Constructor
|
||||||
@@ -670,7 +671,7 @@ public class Mine extends AbstractGameObject {
|
|||||||
Guild nation = player.guild.getNation();
|
Guild nation = player.guild.getNation();
|
||||||
|
|
||||||
if(this.enforceLore){
|
if(this.enforceLore){
|
||||||
LoreMineManager.AuditPlayer(player);
|
LoreMineManager.AuditPlayer(player, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(charactersByNation.containsKey(nation)){
|
if(charactersByNation.containsKey(nation)){
|
||||||
|
|||||||
Reference in New Issue
Block a user