Adjustments for Nornil's Garden.

Thanks to emptyslash.
This commit is contained in:
MobiusDevelopment
2024-09-06 08:21:55 +03:00
parent 0b8567e662
commit 1086d053e3
8 changed files with 18 additions and 48 deletions

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<instance id="231" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd"> <instance id="11" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd">
<activityTime val="60" /> <activityTime val="60" />
<allowSummon val="false" /> <allowSummon val="false" />
<emptyDestroyTime val="3000" /> <emptyDestroyTime val="3000" />

View File

@@ -74,8 +74,8 @@ public class NornilsGarden extends AbstractInstance
private static final int TEMPLATE_ID = 11; private static final int TEMPLATE_ID = 11;
private static final int DURATION_TIME = 70; private static final int DURATION_TIME = 70;
private static final int EMPTY_DESTROY_TIME = 5; private static final int EMPTY_DESTROY_TIME = 5;
private static final int INSTANCE_LEVEL_MIN = 18; private static final int INSTANCE_LEVEL_MIN = 17;
private static final int INSTANCE_LEVEL_MAX = 22; private static final int INSTANCE_LEVEL_MAX = 21;
private static final int[][] AUTO_GATES = private static final int[][] AUTO_GATES =
{ {
// Warriors gate // Warriors gate
@@ -227,17 +227,6 @@ public class NornilsGarden extends AbstractInstance
super.teleportPlayer(player, loc, instanceId); super.teleportPlayer(player, loc, instanceId);
} }
private void exitInstance(Player player)
{
final InstanceWorld inst = InstanceManager.getInstance().getWorld(player);
if (inst instanceof NornilsWorld)
{
final NornilsWorld world = ((NornilsWorld) inst);
world.removeAllowed(player);
teleportPlayer(player, EXIT_PPL, 0);
}
}
private final synchronized String enterInstance(Npc npc, Player player) private final synchronized String enterInstance(Npc npc, Player player)
{ {
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player); final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
@@ -274,7 +263,7 @@ public class NornilsGarden extends AbstractInstance
final NornilsWorld newWorld = new NornilsWorld(); final NornilsWorld newWorld = new NornilsWorld();
final Instance instance = InstanceManager.getInstance().createDynamicInstance(TEMPLATE_ID); final Instance instance = InstanceManager.getInstance().createDynamicInstance(TEMPLATE_ID);
newWorld.setInstance(instance); newWorld.setInstance(instance);
InstanceManager.getInstance().addWorld(world); InstanceManager.getInstance().addWorld(newWorld);
instance.setExitLoc(new Location(player)); instance.setExitLoc(new Location(player));
instance.setAllowSummon(false); instance.setAllowSummon(false);
instance.setDuration(DURATION_TIME * 60000); instance.setDuration(DURATION_TIME * 60000);
@@ -503,13 +492,9 @@ public class NornilsGarden extends AbstractInstance
} }
else if ((npc.getId() == 32258) && event.equalsIgnoreCase("exit")) else if ((npc.getId() == 32258) && event.equalsIgnoreCase("exit"))
{ {
try if (player.getInstanceId() > 0)
{ {
exitInstance(player); super.teleportPlayer(player, EXIT_PPL, 0);
}
catch (Exception e)
{
// Not Important.
} }
} }
else if (CommonUtil.contains(FINAL_GATES, npc.getId())) else if (CommonUtil.contains(FINAL_GATES, npc.getId()))
@@ -523,7 +508,7 @@ public class NornilsGarden extends AbstractInstance
int correct = st.getInt("correct"); int correct = st.getInt("correct");
correct++; correct++;
st.set("correct", String.valueOf(correct)); st.set("correct", String.valueOf(correct));
htmltext = npc.getId() + "-0" + correct + 2 + ".html"; htmltext = npc.getId() + "-0" + Integer.sum(correct, 2) + ".html";
} }
else if (event.equalsIgnoreCase("check")) else if (event.equalsIgnoreCase("check"))
{ {

View File

@@ -1,4 +1,4 @@
<html><body>Hierarch Kekropus:<br> <html><body>Hierarch Kekropus:<br>
We are looking for foreigners that can help the youth of our race. Do you know anyone who would be suitable?<br> We are looking for foreigners that can help the youth of our race. Do you know anyone who would be suitable?<br>
(Only non-Kamael characters between level 18 and 20 who have not completed their first class transfer may embark on this quest.) (Only non-Kamael characters between level 17 and 21 who have not completed their first class transfer may embark on this quest.)
</body></html> </body></html>

View File

@@ -92,7 +92,7 @@ public class Q00182_NewRecruits extends Quest
{ {
htmltext = "32138-00.html"; htmltext = "32138-00.html";
} }
else if ((level >= 17) && (level <= 21) && (player.getClassId().getId() == 0)) else if ((level >= 17) && (level <= 21) && (player.getClassId().level() == 0))
{ {
htmltext = "32138-01.htm"; htmltext = "32138-01.htm";
} }

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<instance id="231" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd"> <instance id="11" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd">
<activityTime val="60" /> <activityTime val="60" />
<allowSummon val="false" /> <allowSummon val="false" />
<emptyDestroyTime val="3000" /> <emptyDestroyTime val="3000" />

View File

@@ -74,8 +74,8 @@ public class NornilsGarden extends AbstractInstance
private static final int TEMPLATE_ID = 11; private static final int TEMPLATE_ID = 11;
private static final int DURATION_TIME = 70; private static final int DURATION_TIME = 70;
private static final int EMPTY_DESTROY_TIME = 5; private static final int EMPTY_DESTROY_TIME = 5;
private static final int INSTANCE_LEVEL_MIN = 18; private static final int INSTANCE_LEVEL_MIN = 17;
private static final int INSTANCE_LEVEL_MAX = 22; private static final int INSTANCE_LEVEL_MAX = 21;
private static final int[][] AUTO_GATES = private static final int[][] AUTO_GATES =
{ {
// Warriors gate // Warriors gate
@@ -227,17 +227,6 @@ public class NornilsGarden extends AbstractInstance
super.teleportPlayer(player, loc, instanceId); super.teleportPlayer(player, loc, instanceId);
} }
private void exitInstance(Player player)
{
final InstanceWorld inst = InstanceManager.getInstance().getWorld(player);
if (inst instanceof NornilsWorld)
{
final NornilsWorld world = ((NornilsWorld) inst);
world.removeAllowed(player);
teleportPlayer(player, EXIT_PPL, 0);
}
}
private final synchronized String enterInstance(Npc npc, Player player) private final synchronized String enterInstance(Npc npc, Player player)
{ {
final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player); final InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
@@ -274,7 +263,7 @@ public class NornilsGarden extends AbstractInstance
final NornilsWorld newWorld = new NornilsWorld(); final NornilsWorld newWorld = new NornilsWorld();
final Instance instance = InstanceManager.getInstance().createDynamicInstance(TEMPLATE_ID); final Instance instance = InstanceManager.getInstance().createDynamicInstance(TEMPLATE_ID);
newWorld.setInstance(instance); newWorld.setInstance(instance);
InstanceManager.getInstance().addWorld(world); InstanceManager.getInstance().addWorld(newWorld);
instance.setExitLoc(new Location(player)); instance.setExitLoc(new Location(player));
instance.setAllowSummon(false); instance.setAllowSummon(false);
instance.setDuration(DURATION_TIME * 60000); instance.setDuration(DURATION_TIME * 60000);
@@ -503,13 +492,9 @@ public class NornilsGarden extends AbstractInstance
} }
else if ((npc.getId() == 32258) && event.equalsIgnoreCase("exit")) else if ((npc.getId() == 32258) && event.equalsIgnoreCase("exit"))
{ {
try if (player.getInstanceId() > 0)
{ {
exitInstance(player); super.teleportPlayer(player, EXIT_PPL, 0);
}
catch (Exception e)
{
// Not Important.
} }
} }
else if (CommonUtil.contains(FINAL_GATES, npc.getId())) else if (CommonUtil.contains(FINAL_GATES, npc.getId()))
@@ -523,7 +508,7 @@ public class NornilsGarden extends AbstractInstance
int correct = st.getInt("correct"); int correct = st.getInt("correct");
correct++; correct++;
st.set("correct", String.valueOf(correct)); st.set("correct", String.valueOf(correct));
htmltext = npc.getId() + "-0" + correct + 2 + ".html"; htmltext = npc.getId() + "-0" + Integer.sum(correct, 2) + ".html";
} }
else if (event.equalsIgnoreCase("check")) else if (event.equalsIgnoreCase("check"))
{ {

View File

@@ -1,4 +1,4 @@
<html><body>Hierarch Kekropus:<br> <html><body>Hierarch Kekropus:<br>
We are looking for foreigners that can help the youth of our race. Do you know anyone who would be suitable?<br> We are looking for foreigners that can help the youth of our race. Do you know anyone who would be suitable?<br>
(Only non-Kamael characters between level 18 and 20 who have not completed their first class transfer may embark on this quest.) (Only non-Kamael characters between level 17 and 21 who have not completed their first class transfer may embark on this quest.)
</body></html> </body></html>

View File

@@ -92,7 +92,7 @@ public class Q00182_NewRecruits extends Quest
{ {
htmltext = "32138-00.html"; htmltext = "32138-00.html";
} }
else if ((level >= 17) && (level <= 21) && (player.getClassId().getId() == 0)) else if ((level >= 17) && (level <= 21) && (player.getClassId().level() == 0))
{ {
htmltext = "32138-01.htm"; htmltext = "32138-01.htm";
} }