diff --git a/game-server/data/handlers/ai/worlds/panesterra/PanesterraEntryCorridorAI.java b/game-server/data/handlers/ai/worlds/panesterra/PanesterraEntryCorridorAI.java index b595e5539..eaf042677 100644 --- a/game-server/data/handlers/ai/worlds/panesterra/PanesterraEntryCorridorAI.java +++ b/game-server/data/handlers/ai/worlds/panesterra/PanesterraEntryCorridorAI.java @@ -23,15 +23,10 @@ @AIName("panesterra_entry_corridor") public class PanesterraEntryCorridorAI extends GeneralNpcAI { - private int relatedFortressId; + private final int relatedFortressId; public PanesterraEntryCorridorAI(Npc owner) { super(owner); - } - - @Override - protected void handleSpawned() { - super.handleSpawned(); relatedFortressId = switch (getNpcId()) { case 730946, 730950 -> 10111; case 730947, 730951 -> 10211; diff --git a/game-server/data/handlers/ai/worlds/panesterra/ahserionsflight/AhserionAI.java b/game-server/data/handlers/ai/worlds/panesterra/ahserionsflight/AhserionAI.java index 4a3d7b813..58fd820df 100644 --- a/game-server/data/handlers/ai/worlds/panesterra/ahserionsflight/AhserionAI.java +++ b/game-server/data/handlers/ai/worlds/panesterra/ahserionsflight/AhserionAI.java @@ -6,6 +6,9 @@ import java.util.Map; import java.util.stream.Collectors; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import com.aionemu.commons.utils.Rnd; import com.aionemu.gameserver.ai.AIName; import com.aionemu.gameserver.configs.main.SiegeConfig; @@ -28,9 +31,6 @@ import ai.AggressiveNpcAI; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * @author Yeats, Estrayl */ diff --git a/game-server/data/static_data/spawns/spawns.xsd b/game-server/data/static_data/spawns/spawns.xsd index 7d2acc202..485a5c636 100644 --- a/game-server/data/static_data/spawns/spawns.xsd +++ b/game-server/data/static_data/spawns/spawns.xsd @@ -135,8 +135,6 @@ - - diff --git a/game-server/src/com/aionemu/gameserver/controllers/PlayerController.java b/game-server/src/com/aionemu/gameserver/controllers/PlayerController.java index cdec4223e..8182a6aea 100644 --- a/game-server/src/com/aionemu/gameserver/controllers/PlayerController.java +++ b/game-server/src/com/aionemu/gameserver/controllers/PlayerController.java @@ -381,14 +381,16 @@ public void doReward() { @Override public void onBeforeSpawn() { super.onBeforeSpawn(); - if (getOwner().isDead()) - return; - if (getOwner().getIsFlyingBeforeDeath()) - getOwner().unsetState(CreatureState.FLOATING_CORPSE); - else if (getOwner().isInState(CreatureState.DEAD)) - getOwner().unsetState(CreatureState.DEAD); - getOwner().setState(CreatureState.ACTIVE); + if (!getOwner().isDead()) { + if (getOwner().getIsFlyingBeforeDeath()) + getOwner().unsetState(CreatureState.FLOATING_CORPSE); + else if (getOwner().isInState(CreatureState.DEAD)) + getOwner().unsetState(CreatureState.DEAD); + getOwner().setState(CreatureState.ACTIVE); + } getOwner().setHitTimeBoost(0, 0); + if (getOwner().getPanesterraFaction() != null && !WorldMapType.isPanesterraMap(getOwner().getWorldId())) + getOwner().setPanesterraFaction(null); } @Override diff --git a/game-server/src/com/aionemu/gameserver/model/base/BaseBossDeathListener.java b/game-server/src/com/aionemu/gameserver/model/base/BaseBossDeathListener.java index 8071f8131..3d17856a7 100644 --- a/game-server/src/com/aionemu/gameserver/model/base/BaseBossDeathListener.java +++ b/game-server/src/com/aionemu/gameserver/model/base/BaseBossDeathListener.java @@ -6,8 +6,6 @@ import com.aionemu.gameserver.model.gameobjects.player.Player; import com.aionemu.gameserver.model.team.TemporaryPlayerTeam; import com.aionemu.gameserver.services.BaseService; -import com.aionemu.gameserver.services.panesterra.PanesterraService; -import com.aionemu.gameserver.services.panesterra.ahserion.PanesterraFaction; /** * @author Source, Rolandas @@ -50,10 +48,8 @@ private BaseOccupier findOccupierType(GeneralAIEvent event) { private BaseOccupier findOccupierType(Player player) { if (base instanceof PanesterraFactionCamp) return BaseOccupier.PEACE; // If the soul anchor (boss) is destroyed, the camp will be eliminated - - if (base instanceof PanesterraBase && player.getPanesterraFaction() != null) { + if (base instanceof PanesterraBase && player.getPanesterraFaction() != null) return BaseOccupier.findBy(player.getPanesterraFaction()); - } return BaseOccupier.findBy(player.getRace()); } } diff --git a/game-server/src/com/aionemu/gameserver/model/gameobjects/player/Player.java b/game-server/src/com/aionemu/gameserver/model/gameobjects/player/Player.java index 3cc43fc10..60799fb8f 100644 --- a/game-server/src/com/aionemu/gameserver/model/gameobjects/player/Player.java +++ b/game-server/src/com/aionemu/gameserver/model/gameobjects/player/Player.java @@ -933,9 +933,6 @@ public boolean isEnemyFrom(Player enemy) { if (isInCustomState(CustomPlayerState.ENEMY_OF_ALL_PLAYERS) || enemy.isInCustomState(CustomPlayerState.ENEMY_OF_ALL_PLAYERS)) { return !isInFfaTeamMode || !enemy.isInFfaTeamMode() || !isInSameTeam(enemy); } - if (panesterraFaction != null && WorldMapType.isPanesterraMap(getWorldId())) { - return panesterraFaction != enemy.getPanesterraFaction(); - } return canPvP(enemy) || isDueling(enemy); } diff --git a/game-server/src/com/aionemu/gameserver/services/SiegeService.java b/game-server/src/com/aionemu/gameserver/services/SiegeService.java index ca410f898..86fce95e0 100644 --- a/game-server/src/com/aionemu/gameserver/services/SiegeService.java +++ b/game-server/src/com/aionemu/gameserver/services/SiegeService.java @@ -7,8 +7,6 @@ import java.util.function.Consumer; import java.util.stream.Collectors; -import com.aionemu.gameserver.services.panesterra.PanesterraService; - import org.quartz.CronExpression; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -29,6 +27,7 @@ import com.aionemu.gameserver.model.templates.spawns.SpawnTemplate; import com.aionemu.gameserver.model.templates.spawns.siegespawns.SiegeSpawnTemplate; import com.aionemu.gameserver.network.aion.serverpackets.*; +import com.aionemu.gameserver.services.panesterra.PanesterraService; import com.aionemu.gameserver.services.siege.*; import com.aionemu.gameserver.spawnengine.SpawnEngine; import com.aionemu.gameserver.utils.PacketSendUtility; diff --git a/game-server/src/com/aionemu/gameserver/services/TribeRelationService.java b/game-server/src/com/aionemu/gameserver/services/TribeRelationService.java index c122691a5..5919dc67f 100644 --- a/game-server/src/com/aionemu/gameserver/services/TribeRelationService.java +++ b/game-server/src/com/aionemu/gameserver/services/TribeRelationService.java @@ -55,7 +55,7 @@ public static boolean isAggressive(Creature creature1, Creature creature2) { } break; } - if (creature1.getTribe().name().startsWith("GAB1_") && creature2 instanceof Player p && p.getPanesterraFaction() != null) { + if (creature2 instanceof Player p && p.getPanesterraFaction() != null && creature1.getTribe().name().startsWith("GAB1_")) { TribeClass playerTribe = creature1.getTribe().name().startsWith("GAB1_SUB") ? p.getPanesterraFaction().getSubTribe() : p.getPanesterraFaction().getTribe(); if (creature1.getTribe() == playerTribe) return false; @@ -101,7 +101,7 @@ public static boolean isFriend(Creature creature1, Creature creature2) { return true; break; } - if (creature1.getTribe().name().startsWith("GAB1_") && creature2 instanceof Player p && p.getPanesterraFaction() != null) { + if (creature2 instanceof Player p && p.getPanesterraFaction() != null && creature1.getTribe().name().startsWith("GAB1_")) { TribeClass playerTribe = creature1.getTribe().name().startsWith("GAB1_SUB") ? p.getPanesterraFaction().getSubTribe() : p.getPanesterraFaction().getTribe(); if (creature1.getTribe() == playerTribe) return true; @@ -126,7 +126,7 @@ public static boolean isSupport(Creature creature1, Creature creature2) { return true; break; } - if (creature1.getTribe().name().startsWith("GAB1_") && creature2 instanceof Player p && p.getPanesterraFaction() != null) { + if (creature2 instanceof Player p && p.getPanesterraFaction() != null && creature1.getTribe().name().startsWith("GAB1_")) { TribeClass playerTribe = creature1.getTribe().name().startsWith("GAB1_SUB") ? p.getPanesterraFaction().getSubTribe() : p.getPanesterraFaction().getTribe(); if (creature1.getTribe() == playerTribe) return true; @@ -179,7 +179,7 @@ public static boolean isHostile(Creature creature1, Creature creature2) { } } - if (creature1.getTribe().name().startsWith("GAB1_") && creature2 instanceof Player p && p.getPanesterraFaction() != null) { + if (creature2 instanceof Player p && p.getPanesterraFaction() != null && creature1.getTribe().name().startsWith("GAB1_")) { TribeClass playerTribe = creature1.getTribe().name().startsWith("GAB1_SUB") ? p.getPanesterraFaction().getSubTribe() : p.getPanesterraFaction().getTribe(); if (creature1.getTribe() == playerTribe) return false; diff --git a/game-server/src/com/aionemu/gameserver/services/panesterra/PanesterraService.java b/game-server/src/com/aionemu/gameserver/services/panesterra/PanesterraService.java index 9126fee58..0fc0c0ecc 100644 --- a/game-server/src/com/aionemu/gameserver/services/panesterra/PanesterraService.java +++ b/game-server/src/com/aionemu/gameserver/services/panesterra/PanesterraService.java @@ -1,15 +1,15 @@ package com.aionemu.gameserver.services.panesterra; +import static com.aionemu.gameserver.services.panesterra.ahserion.PanesterraFaction.*; + import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Stream; -import com.aionemu.commons.utils.Rnd; -import com.aionemu.gameserver.world.WorldPosition; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.aionemu.commons.utils.Rnd; import com.aionemu.gameserver.model.base.BaseOccupier; import com.aionemu.gameserver.model.base.BaseType; import com.aionemu.gameserver.model.gameobjects.player.Player; @@ -28,8 +28,7 @@ import com.aionemu.gameserver.utils.PacketSendUtility; import com.aionemu.gameserver.world.World; import com.aionemu.gameserver.world.WorldMapType; - -import static com.aionemu.gameserver.services.panesterra.ahserion.PanesterraFaction.*; +import com.aionemu.gameserver.world.WorldPosition; /** * Workflow for Panesterra sieges: diff --git a/game-server/src/com/aionemu/gameserver/services/player/PlayerReviveService.java b/game-server/src/com/aionemu/gameserver/services/player/PlayerReviveService.java index fb266e994..61d53e54d 100644 --- a/game-server/src/com/aionemu/gameserver/services/player/PlayerReviveService.java +++ b/game-server/src/com/aionemu/gameserver/services/player/PlayerReviveService.java @@ -1,9 +1,5 @@ package com.aionemu.gameserver.services.player; -import com.aionemu.gameserver.services.panesterra.PanesterraService; - -import com.aionemu.gameserver.world.WorldMapType; - import org.slf4j.LoggerFactory; import com.aionemu.gameserver.configs.administration.AdminConfig; @@ -20,13 +16,14 @@ import com.aionemu.gameserver.model.vortex.VortexLocation; import com.aionemu.gameserver.network.aion.serverpackets.*; import com.aionemu.gameserver.services.VortexService; -import com.aionemu.gameserver.services.panesterra.ahserion.AhserionRaid; +import com.aionemu.gameserver.services.panesterra.PanesterraService; import com.aionemu.gameserver.services.teleport.TeleportService; import com.aionemu.gameserver.skillengine.model.Effect; import com.aionemu.gameserver.utils.PacketSendUtility; import com.aionemu.gameserver.utils.audit.AuditLogger; import com.aionemu.gameserver.world.World; import com.aionemu.gameserver.world.WorldMap; +import com.aionemu.gameserver.world.WorldMapType; import com.aionemu.gameserver.world.WorldPosition; /** diff --git a/game-server/src/com/aionemu/gameserver/services/teleport/TeleportService.java b/game-server/src/com/aionemu/gameserver/services/teleport/TeleportService.java index 872e4e88b..326185083 100644 --- a/game-server/src/com/aionemu/gameserver/services/teleport/TeleportService.java +++ b/game-server/src/com/aionemu/gameserver/services/teleport/TeleportService.java @@ -265,9 +265,6 @@ public static void teleportTo(final Player player, final int worldId, final int } else if (DuelService.getInstance().isDueling(player)) { DuelService.getInstance().loseDuel(player); } - if (player.getPanesterraFaction() != null && !WorldMapType.isPanesterraMap(worldId)) - player.setPanesterraFaction(null); - sendLoc(player, worldId, instanceId, x, y, z, heading, animation); } diff --git a/game-server/src/com/aionemu/gameserver/spawnengine/VisibleObjectSpawner.java b/game-server/src/com/aionemu/gameserver/spawnengine/VisibleObjectSpawner.java index 197736865..d4583f7a0 100644 --- a/game-server/src/com/aionemu/gameserver/spawnengine/VisibleObjectSpawner.java +++ b/game-server/src/com/aionemu/gameserver/spawnengine/VisibleObjectSpawner.java @@ -13,6 +13,7 @@ import com.aionemu.gameserver.geoEngine.collision.IgnoreProperties; import com.aionemu.gameserver.geoEngine.math.Vector3f; import com.aionemu.gameserver.model.Race; +import com.aionemu.gameserver.model.base.Base; import com.aionemu.gameserver.model.gameobjects.*; import com.aionemu.gameserver.model.gameobjects.player.PetCommonData; import com.aionemu.gameserver.model.gameobjects.player.Player; @@ -31,7 +32,6 @@ import com.aionemu.gameserver.network.aion.serverpackets.SM_PLAYER_STATE; import com.aionemu.gameserver.services.BaseService; import com.aionemu.gameserver.services.RiftService; -import com.aionemu.gameserver.model.base.Base; import com.aionemu.gameserver.skillengine.effect.SummonOwner; import com.aionemu.gameserver.skillengine.model.SkillTemplate; import com.aionemu.gameserver.utils.PacketSendUtility; @@ -48,7 +48,7 @@ public class VisibleObjectSpawner { private static final Logger log = LoggerFactory.getLogger(VisibleObjectSpawner.class); - + protected static VisibleObject spawnNpc(SpawnTemplate spawn, int instanceIndex) { int npcId = spawn.getNpcId(); NpcTemplate npcTemplate = DataManager.NPC_DATA.getNpcTemplate(npcId);