diff --git a/src/main/java/emu/grasscutter/game/world/World.java b/src/main/java/emu/grasscutter/game/world/World.java index 81a57edda..1501b6909 100644 --- a/src/main/java/emu/grasscutter/game/world/World.java +++ b/src/main/java/emu/grasscutter/game/world/World.java @@ -275,14 +275,17 @@ public class World implements Iterable { .teleportType(teleportType) .enterReason(enterReason) .teleportTo(teleportTo) - .enterType(EnterType.ENTER_TYPE_JUMP); + .enterType(EnterType.ENTER_TYPE_GOTO); val sceneData = GameData.getSceneDataMap().get(sceneId); if (dungeonData != null) { teleportProps .teleportTo(dungeonData.getStartPosition()) .teleportRot(dungeonData.getStartRotation()); - teleportProps.enterType(EnterType.ENTER_TYPE_DUNGEON).enterReason(EnterReason.DungeonEnter); + teleportProps + .enterType(EnterType.ENTER_TYPE_DUNGEON) + .enterReason(EnterReason.DungeonEnter); + teleportProps.dungeonId(dungeonData.getId()); } else if (player.getSceneId() == sceneId) { teleportProps.enterType(EnterType.ENTER_TYPE_GOTO); } else if (sceneData != null && sceneData.getSceneType() == SceneType.SCENE_HOME_WORLD) { @@ -326,7 +329,7 @@ public class World implements Iterable { var newScene = this.getSceneById(teleportProperties.getSceneId()); newScene.addPlayer(player); - player.setAvatarsAbilityForScene(newScene); + player.getTeamManager().applyAbilities(newScene); // Dungeon // Dungeon system is handling this already diff --git a/src/main/java/emu/grasscutter/game/world/data/TeleportProperties.java b/src/main/java/emu/grasscutter/game/world/data/TeleportProperties.java index 283651120..bd7ac111a 100644 --- a/src/main/java/emu/grasscutter/game/world/data/TeleportProperties.java +++ b/src/main/java/emu/grasscutter/game/world/data/TeleportProperties.java @@ -11,6 +11,7 @@ import lombok.Data; @Builder public class TeleportProperties { private final int sceneId; + @Builder.Default private final int dungeonId = 0; private final PlayerTeleportEvent.TeleportType teleportType; private final EnterReason enterReason; private Position teleportTo; diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerEnterSceneNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerEnterSceneNotify.java index f0e683593..29dc48861 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerEnterSceneNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketPlayerEnterSceneNotify.java @@ -100,6 +100,10 @@ public class PacketPlayerEnterSceneNotify extends BasePacket { + "-" + 18402); + if (teleportProperties.getDungeonId() != 0) { + proto.setDungeonId(teleportProperties.getDungeonId()); + } + this.setData(proto); } }