Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CostyKiller/367a494f5c6c0304736b559cd26fee5c to your computer and use it in GitHub Desktop.
Save CostyKiller/367a494f5c6c0304736b559cd26fee5c to your computer and use it in GitHub Desktop.
Index: dist/game/data/scripts/ai/areas/Conquest/ConquestEngine.java
===================================================================
--- dist/game/data/scripts/ai/areas/Conquest/ConquestEngine.java (revision 13630)
+++ dist/game/data/scripts/ai/areas/Conquest/ConquestEngine.java (working copy)
@@ -34,9 +34,9 @@
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.gameserver.data.xml.DethroneShopData;
-import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
+import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.Player;
@@ -403,13 +403,29 @@
player.sendPacket(new ExDethroneSeasonInfo(false));
}
Broadcast.toAllOnlinePlayers(new SystemMessage(SystemMessageId.THE_PATH_TO_THE_CONQUEST_WORLD_IS_CLOSED_YOU_CAN_GET_THERE_ON_MONDAYS_TUESDAYS_WEDNESDAYS_AND_THURSDAYS_FROM_10_00_TILL_14_00_AND_FROM_22_00_TILL_00_00_AND_ON_FRIDAYS_SATURDAYS_AND_SUNDAYS_FROM_20_00_TILL_01_00_OF_THE_FOLLOWING_DAY_SERVER_TIME_PVP_IS_DISABLED_FROM_20_00_TILL_22_00_FOR_2_HOURS_BECAUSE_THE_NEW_WORLD_EXPLORATION_IS_UNDER_WAY));
- // Teleport players to town if Open Access ends.
+ // Teleport players to origin location if Open Access ends.
ConquestZone conquestZone = (ConquestZone) ZoneManager.getInstance().getZoneByName("conquest");
for (Player player : conquestZone.getPlayersInside())
{
if (!player.isGM())
{
- player.teleToLocation(TeleportWhereType.TOWN);
+
+ final PlayerVariables vars = player.getVariables();
+ Location location = new Location(147458, 26903, -2206); // Aden center if no location stored
+ if (vars.contains(PlayerVariables.CONQUEST_ORIGIN))
+ {
+ final int[] loc = vars.getIntArray(PlayerVariables.CONQUEST_ORIGIN, ";");
+ if ((loc != null) && (loc.length == 3))
+ {
+ location = new Location(loc[0], loc[1], loc[2]);
+ }
+ player.teleToLocation(location);
+ vars.remove(PlayerVariables.CONQUEST_ORIGIN);
+ }
+ else
+ {
+ player.teleToLocation(location);
+ }
}
}
init();
Index: java/org/l2jmobius/gameserver/model/zone/type/ConquestZone.java
===================================================================
--- java/org/l2jmobius/gameserver/model/zone/type/ConquestZone.java (revision 13630)
+++ java/org/l2jmobius/gameserver/model/zone/type/ConquestZone.java (working copy)
@@ -29,6 +29,7 @@
import org.l2jmobius.gameserver.enums.SkillFinishType;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
+import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.appearance.PlayerAppearance;
import org.l2jmobius.gameserver.model.skill.Skill;
@@ -194,7 +195,22 @@
{
if (!creature.isGM())
{
- creature.teleToLocation(TeleportWhereType.TOWN);
+ final PlayerVariables vars = creature.getActingPlayer().getVariables();
+ Location location = new Location(147458, 26903, -2206); // Aden center if no location stored
+ if (vars.contains(PlayerVariables.CONQUEST_ORIGIN))
+ {
+ final int[] loc = vars.getIntArray(PlayerVariables.CONQUEST_ORIGIN, ";");
+ if ((loc != null) && (loc.length == 3))
+ {
+ location = new Location(loc[0], loc[1], loc[2]);
+ }
+ creature.getActingPlayer().teleToLocation(location);
+ vars.remove(PlayerVariables.CONQUEST_ORIGIN);
+ }
+ else
+ {
+ creature.getActingPlayer().teleToLocation(location);
+ }
onExit(creature);
}
}
Index: java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java
===================================================================
--- java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java (revision 13630)
+++ java/org/l2jmobius/gameserver/model/variables/PlayerVariables.java (working copy)
@@ -101,6 +101,7 @@
public static final String PRISON_WAIT_TIME = "PRISON_WAIT_TIME";
public static final String PRISON_2_POINTS = "PRISON_2_POINTS";
public static final String PRISON_3_POINTS = "PRISON_3_POINTS";
+ public static final String CONQUEST_ORIGIN = "CONQUEST_ORIGIN";
public static final String CONQUEST_NAME = "CONQUEST_NAME";
public static final String CONQUEST_INTRO = "CONQUEST_INTRO";
public static final String CONQUEST_ATTACK_POINTS = "CONQUEST_ATTACK_POINTS";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment