Fixed nonexistent oracle teleport back to town.
This commit is contained in:
parent
8ab8cd7046
commit
169487938e
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package teleports.OracleTeleport;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
@ -275,6 +276,14 @@ public class OracleTeleport extends Quest
|
||||
htmltext = "rift_back.htm";
|
||||
st.exitQuest(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
final Location loc = RETURN_LOCS[Rnd.get(RETURN_LOCS.length)];
|
||||
player.teleToLocation(loc.getX(), loc.getY(), loc.getZ());
|
||||
htmltext = "rift_back_unknown.htm";
|
||||
player.setIn7sDungeon(false);
|
||||
st.exitQuest(true);
|
||||
}
|
||||
}
|
||||
else if (event.equalsIgnoreCase("Festival"))
|
||||
{
|
||||
|
@ -0,0 +1,4 @@
|
||||
<html><body>Rift Post:<br>
|
||||
I cannot find your original location.<br1>
|
||||
I will return you to a random return point.
|
||||
</body></html>
|
@ -1466,18 +1466,12 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
event = "";
|
||||
}
|
||||
|
||||
if (!_quests.containsKey(quest))
|
||||
if (event.length() == 0)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
QuestState qs = getQuestState(quest);
|
||||
if ((qs == null) && (event.length() == 0))
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
if (qs == null)
|
||||
{
|
||||
Quest q = null;
|
||||
@ -1492,9 +1486,10 @@ public class PlayerInstance extends Playable
|
||||
}
|
||||
qs = q.newQuestState(this);
|
||||
}
|
||||
if ((qs != null) && (getLastQuestNpcObject() > 0))
|
||||
|
||||
if ((qs != null) && (_questNpcObject > 0))
|
||||
{
|
||||
final WorldObject object = World.getInstance().findObject(getLastQuestNpcObject());
|
||||
final WorldObject object = World.getInstance().findObject(_questNpcObject);
|
||||
if ((object instanceof NpcInstance) && isInsideRadius(object, NpcInstance.INTERACTION_DISTANCE, false, false))
|
||||
{
|
||||
final NpcInstance npc = (NpcInstance) object;
|
||||
@ -1509,7 +1504,6 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
showQuestWindow(quest, State.getStateName(qs.getState()));
|
||||
}
|
||||
|
||||
retval = qs;
|
||||
}
|
||||
}
|
||||
|
@ -295,6 +295,15 @@ public class RequestBypassToServer extends GameClientPacket
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject object = player.getTarget();
|
||||
if ((object instanceof NpcInstance) && (player.getLastQuestNpcObject() != object.getObjectId()))
|
||||
{
|
||||
final WorldObject lastQuestNpc = World.getInstance().findObject(player.getLastQuestNpcObject());
|
||||
if ((lastQuestNpc == null) || !player.isInsideRadius(lastQuestNpc, NpcInstance.INTERACTION_DISTANCE, false, false))
|
||||
{
|
||||
player.setLastQuestNpcObject(object.getObjectId());
|
||||
}
|
||||
}
|
||||
player.processQuestEvent(p.substring(0, idx), p.substring(idx).trim());
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package teleports.OracleTeleport;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
@ -275,6 +276,14 @@ public class OracleTeleport extends Quest
|
||||
htmltext = "rift_back.htm";
|
||||
st.exitQuest(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
final Location loc = RETURN_LOCS[Rnd.get(RETURN_LOCS.length)];
|
||||
player.teleToLocation(loc.getX(), loc.getY(), loc.getZ());
|
||||
htmltext = "rift_back_unknown.htm";
|
||||
player.setIn7sDungeon(false);
|
||||
st.exitQuest(true);
|
||||
}
|
||||
}
|
||||
else if (event.equalsIgnoreCase("Festival"))
|
||||
{
|
||||
|
@ -0,0 +1,4 @@
|
||||
<html><body>Rift Post:<br>
|
||||
I cannot find your original location.<br1>
|
||||
I will return you to a random return point.
|
||||
</body></html>
|
@ -1480,18 +1480,12 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
event = "";
|
||||
}
|
||||
|
||||
if (!_quests.containsKey(quest))
|
||||
if (event.length() == 0)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
QuestState qs = getQuestState(quest);
|
||||
if ((qs == null) && (event.length() == 0))
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
if (qs == null)
|
||||
{
|
||||
Quest q = null;
|
||||
@ -1506,9 +1500,10 @@ public class PlayerInstance extends Playable
|
||||
}
|
||||
qs = q.newQuestState(this);
|
||||
}
|
||||
if ((qs != null) && (getLastQuestNpcObject() > 0))
|
||||
|
||||
if ((qs != null) && (_questNpcObject > 0))
|
||||
{
|
||||
final WorldObject object = World.getInstance().findObject(getLastQuestNpcObject());
|
||||
final WorldObject object = World.getInstance().findObject(_questNpcObject);
|
||||
if ((object instanceof NpcInstance) && isInsideRadius(object, NpcInstance.INTERACTION_DISTANCE, false, false))
|
||||
{
|
||||
final NpcInstance npc = (NpcInstance) object;
|
||||
@ -1523,7 +1518,6 @@ public class PlayerInstance extends Playable
|
||||
{
|
||||
showQuestWindow(quest, State.getStateName(qs.getState()));
|
||||
}
|
||||
|
||||
retval = qs;
|
||||
}
|
||||
}
|
||||
|
@ -295,6 +295,15 @@ public class RequestBypassToServer extends GameClientPacket
|
||||
}
|
||||
else
|
||||
{
|
||||
final WorldObject object = player.getTarget();
|
||||
if ((object instanceof NpcInstance) && (player.getLastQuestNpcObject() != object.getObjectId()))
|
||||
{
|
||||
final WorldObject lastQuestNpc = World.getInstance().findObject(player.getLastQuestNpcObject());
|
||||
if ((lastQuestNpc == null) || !player.isInsideRadius(lastQuestNpc, NpcInstance.INTERACTION_DISTANCE, false, false))
|
||||
{
|
||||
player.setLastQuestNpcObject(object.getObjectId());
|
||||
}
|
||||
}
|
||||
player.processQuestEvent(p.substring(0, idx), p.substring(idx).trim());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user