Sync with L2JServer Jan 26th 2015.
This commit is contained in:
@@ -170,6 +170,8 @@ public abstract class Chamber extends Quest
|
||||
private final String INSTANCE_TEMPLATE;
|
||||
|
||||
protected Location[] ROOM_ENTER_POINTS;
|
||||
// Misc
|
||||
private static final String RETURN = Chamber.class.getSimpleName() + "_return";
|
||||
|
||||
protected Chamber(int questId, String name, String descr, int instanceId, String instanceTemplateName, int entranceGKId, int roomGKFirstId, int roomGKLastId, int aenkinelId, int boxId)
|
||||
{
|
||||
@@ -362,20 +364,18 @@ public abstract class Chamber extends Quest
|
||||
|
||||
for (L2PcInstance partyMember : party.getMembers())
|
||||
{
|
||||
final QuestState st = getQuestState(partyMember, true);
|
||||
|
||||
if (st.hasQuestItems(DELUSION_MARK))
|
||||
if (hasQuestItems(partyMember, DELUSION_MARK))
|
||||
{
|
||||
st.takeItems(DELUSION_MARK, -1);
|
||||
takeItems(partyMember, DELUSION_MARK, -1);
|
||||
}
|
||||
|
||||
if (party.isLeader(partyMember))
|
||||
{
|
||||
st.giveItems(DELUSION_MARK, 1);
|
||||
giveItems(partyMember, DELUSION_MARK, 1);
|
||||
}
|
||||
|
||||
// Save location for teleport back into main hall
|
||||
st.set("return_point", Integer.toString(partyMember.getX()) + ";" + Integer.toString(partyMember.getY()) + ";" + Integer.toString(partyMember.getZ()));
|
||||
partyMember.getVariables().set(RETURN, Integer.toString(partyMember.getX()) + ";" + Integer.toString(partyMember.getY()) + ";" + Integer.toString(partyMember.getZ()));
|
||||
|
||||
partyMember.setInstanceId(world.getInstanceId());
|
||||
world.addAllowed(partyMember.getObjectId());
|
||||
@@ -445,26 +445,21 @@ public abstract class Chamber extends Quest
|
||||
}
|
||||
final Instance inst = InstanceManager.getInstance().getInstance(player.getInstanceId());
|
||||
Location ret = inst.getSpawnLoc();
|
||||
final QuestState st = getQuestState(player, false);
|
||||
|
||||
if (st != null)
|
||||
final String return_point = player.getVariables().getString(RETURN, null);
|
||||
if (return_point != null)
|
||||
{
|
||||
String return_point = st.get("return_point");
|
||||
if (return_point != null)
|
||||
String[] coords = return_point.split(";");
|
||||
if (coords.length == 3)
|
||||
{
|
||||
String[] coords = return_point.split(";");
|
||||
if (coords.length == 3)
|
||||
try
|
||||
{
|
||||
int x = Integer.parseInt(coords[0]);
|
||||
int y = Integer.parseInt(coords[1]);
|
||||
int z = Integer.parseInt(coords[2]);
|
||||
ret.setLocation(new Location(x, y, z));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
try
|
||||
{
|
||||
int x = Integer.parseInt(coords[0]);
|
||||
int y = Integer.parseInt(coords[1]);
|
||||
int z = Integer.parseInt(coords[2]);
|
||||
ret.setLocation(new Location(x, y, z));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -487,15 +482,8 @@ public abstract class Chamber extends Quest
|
||||
{
|
||||
final CDWorld world = (CDWorld) tmpworld;
|
||||
|
||||
QuestState st = getQuestState(player, false);
|
||||
|
||||
if (st == null)
|
||||
{
|
||||
st = newQuestState(player);
|
||||
}
|
||||
|
||||
// Change room from dialog
|
||||
else if (event.equals("next_room"))
|
||||
if (event.equals("next_room"))
|
||||
{
|
||||
if (player.getParty() == null)
|
||||
{
|
||||
@@ -509,7 +497,7 @@ public abstract class Chamber extends Quest
|
||||
|
||||
else if (hasQuestItems(player, DELUSION_MARK))
|
||||
{
|
||||
st.takeItems(DELUSION_MARK, 1);
|
||||
takeItems(player, DELUSION_MARK, 1);
|
||||
world.stopRoomChangeTask();
|
||||
changeRoom(world);
|
||||
}
|
||||
@@ -519,7 +507,6 @@ public abstract class Chamber extends Quest
|
||||
htmltext = getHtm(player.getHtmlPrefix(), "data/scripts/instances/ChambersOfDelusion/no_item.html");
|
||||
}
|
||||
}
|
||||
|
||||
else if (event.equals("go_out"))
|
||||
{
|
||||
if (player.getParty() == null)
|
||||
@@ -545,7 +532,6 @@ public abstract class Chamber extends Quest
|
||||
inst.setEmptyDestroyTime(0);
|
||||
}
|
||||
}
|
||||
|
||||
else if (event.equals("look_party"))
|
||||
{
|
||||
if ((player.getParty() != null) && (player.getParty() == world.getPartyInside()))
|
||||
|
@@ -1872,8 +1872,7 @@ public final class CrystalCaverns extends Quest
|
||||
CCWorld world = (CCWorld) tmpworld;
|
||||
if ((world.getStatus() == 0) && world.oracle.contains(npc))
|
||||
{
|
||||
String htmltext = "32281.htm";
|
||||
return htmltext;
|
||||
return "32281.htm";// TODO: Missing HTML.
|
||||
}
|
||||
}
|
||||
npc.showChatWindow(player);
|
||||
@@ -1887,8 +1886,7 @@ public final class CrystalCaverns extends Quest
|
||||
CCWorld world = (CCWorld) tmpworld;
|
||||
if (!world.OracleTriggered[npc.getId() - 32275])
|
||||
{
|
||||
String htmltext = "no.htm";
|
||||
return htmltext;
|
||||
return "no.htm"; // TODO: Missing HTML.
|
||||
}
|
||||
npc.showChatWindow(player);
|
||||
return null;
|
||||
@@ -1899,19 +1897,12 @@ public final class CrystalCaverns extends Quest
|
||||
InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
|
||||
if (tmpworld instanceof CCWorld)
|
||||
{
|
||||
String htmltext = "no.htm";
|
||||
return htmltext;
|
||||
return "no.htm"; // TODO: Missing HTML.
|
||||
}
|
||||
}
|
||||
else if (npc.getId() == 32279)
|
||||
{
|
||||
QuestState st = player.getQuestState("131_BirdInACage");
|
||||
String htmltext = "32279.htm";
|
||||
if ((st != null) && !st.isCompleted())
|
||||
{
|
||||
htmltext = "32279-01.htm";
|
||||
}
|
||||
return htmltext;
|
||||
return "32279.htm";
|
||||
}
|
||||
else if (npc.getId() == CRYSTAL_GOLEM)
|
||||
{
|
||||
@@ -2485,42 +2476,36 @@ public final class CrystalCaverns extends Quest
|
||||
{
|
||||
if (partyMember.getInstanceId() == instanceId)
|
||||
{
|
||||
final QuestState st = getQuestState(partyMember, true);
|
||||
if (!isBaylor && st.hasQuestItems(CONT_CRYSTAL))
|
||||
if (!isBaylor && hasQuestItems(partyMember, CONT_CRYSTAL))
|
||||
{
|
||||
st.takeItems(CONT_CRYSTAL, 1);
|
||||
st.giveItems(bossCry, 1);
|
||||
takeItems(partyMember, CONT_CRYSTAL, 1);
|
||||
giveItems(partyMember, bossCry, 1);
|
||||
}
|
||||
if (getRandom(10) < 5)
|
||||
{
|
||||
st.giveItems(WHITE_SEED, num);
|
||||
giveItems(partyMember, WHITE_SEED, num);
|
||||
}
|
||||
else
|
||||
{
|
||||
st.giveItems(BLACK_SEED, num);
|
||||
giveItems(partyMember, BLACK_SEED, num);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (player.getInstanceId() == instanceId)
|
||||
{
|
||||
QuestState st = getQuestState(player, false);
|
||||
if (st == null)
|
||||
if (!isBaylor && hasQuestItems(player, CONT_CRYSTAL))
|
||||
{
|
||||
st = newQuestState(player);
|
||||
}
|
||||
if (!isBaylor && st.hasQuestItems(CONT_CRYSTAL))
|
||||
{
|
||||
st.takeItems(CONT_CRYSTAL, 1);
|
||||
st.giveItems(bossCry, 1);
|
||||
takeItems(player, CONT_CRYSTAL, 1);
|
||||
giveItems(player, bossCry, 1);
|
||||
}
|
||||
if (getRandom(10) < 5)
|
||||
{
|
||||
st.giveItems(WHITE_SEED, num);
|
||||
giveItems(player, WHITE_SEED, num);
|
||||
}
|
||||
else
|
||||
{
|
||||
st.giveItems(BLACK_SEED, num);
|
||||
giveItems(player, BLACK_SEED, num);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3017,12 +3002,8 @@ public final class CrystalCaverns extends Quest
|
||||
{
|
||||
return "";
|
||||
}
|
||||
QuestState st = ((L2PcInstance) character).getQuestState(getName());
|
||||
if (st == null)
|
||||
{
|
||||
st = newQuestState((L2PcInstance) character);
|
||||
}
|
||||
if (!st.hasQuestItems(RACE_KEY))
|
||||
|
||||
if (!hasQuestItems((L2PcInstance) character, RACE_KEY))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
@@ -3031,7 +3012,7 @@ public final class CrystalCaverns extends Quest
|
||||
runEmeraldRooms(world, spawns, room);
|
||||
}
|
||||
door.openMe();
|
||||
st.takeItems(RACE_KEY, 1);
|
||||
takeItems((L2PcInstance) character, RACE_KEY, 1);
|
||||
world.openedDoors.put(door, (L2PcInstance) character);
|
||||
break;
|
||||
}
|
||||
|
@@ -29,7 +29,6 @@ import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.model.entity.Instance;
|
||||
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
|
||||
import com.l2jserver.gameserver.model.quest.Quest;
|
||||
import com.l2jserver.gameserver.model.quest.QuestState;
|
||||
import com.l2jserver.gameserver.model.skills.Skill;
|
||||
import com.l2jserver.gameserver.network.NpcStringId;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
@@ -1405,11 +1404,10 @@ public final class DarkCloudMansion extends Quest
|
||||
if ((npc.getId() == SOTruth) && (world.getStatus() == 10))
|
||||
{
|
||||
npc.showChatWindow(player);
|
||||
QuestState st = getQuestState(player, true);
|
||||
|
||||
if (!st.hasQuestItems(CC))
|
||||
if (!hasQuestItems(player, CC))
|
||||
{
|
||||
st.giveItems(CC, 1);
|
||||
giveItems(player, CC, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
package instances.FaeronTrainingGrounds1;
|
||||
|
||||
import quests.Q10736_ASpecialPower.Q10736_ASpecialPower;
|
||||
import quests.Q10735_ASpecialPower.Q10735_ASpecialPower;
|
||||
import ai.npc.AbstractNpcAI;
|
||||
|
||||
import com.l2jserver.gameserver.instancemanager.InstanceManager;
|
||||
@@ -52,7 +52,7 @@ public class FaeronTrainingGrounds1 extends AbstractNpcAI
|
||||
@Override
|
||||
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
||||
{
|
||||
final QuestState qs = player.getQuestState(Q10736_ASpecialPower.class.getSimpleName());
|
||||
final QuestState qs = player.getQuestState(Q10735_ASpecialPower.class.getSimpleName());
|
||||
if (qs == null)
|
||||
{
|
||||
return null;
|
||||
|
@@ -147,8 +147,8 @@ public final class MithrilMine extends AbstractNpcAI
|
||||
world.removeAllowed(player.getObjectId());
|
||||
player.setInstanceId(0);
|
||||
player.teleToLocation(EXIT_LOC, 0);
|
||||
qs.giveAdena(296425, true);
|
||||
qs.addExpAndSp(921805, 82230);
|
||||
giveAdena(player, 296425, true);
|
||||
addExpAndSp(player, 921805, 82230);
|
||||
qs.exitQuest(false, true);
|
||||
return "18846-03.html";
|
||||
}
|
||||
@@ -200,9 +200,9 @@ public final class MithrilMine extends AbstractNpcAI
|
||||
final QuestState qs = talker.getQuestState(Q10284_AcquisitionOfDivineSword.class.getSimpleName());
|
||||
if ((qs != null) && qs.isMemoState(2))
|
||||
{
|
||||
if (!qs.hasQuestItems(COLD_RESISTANCE_POTION))
|
||||
if (!hasQuestItems(talker, COLD_RESISTANCE_POTION))
|
||||
{
|
||||
qs.giveItems(COLD_RESISTANCE_POTION, 1);
|
||||
giveItems(talker, COLD_RESISTANCE_POTION, 1);
|
||||
}
|
||||
qs.setCond(4, true);
|
||||
enterInstance(talker, "MithrilMine.xml", START_LOC);
|
||||
@@ -212,9 +212,9 @@ public final class MithrilMine extends AbstractNpcAI
|
||||
case KEGOR:
|
||||
{
|
||||
final QuestState qs = talker.getQuestState(Q10284_AcquisitionOfDivineSword.class.getSimpleName());
|
||||
if ((qs != null) && qs.isMemoState(2) && qs.hasQuestItems(COLD_RESISTANCE_POTION) && npc.isScriptValue(0))
|
||||
if ((qs != null) && qs.isMemoState(2) && hasQuestItems(talker, COLD_RESISTANCE_POTION) && npc.isScriptValue(0))
|
||||
{
|
||||
qs.takeItems(COLD_RESISTANCE_POTION, -1);
|
||||
takeItems(talker, COLD_RESISTANCE_POTION, -1);
|
||||
qs.setCond(5, true);
|
||||
npc.setScriptValue(1);
|
||||
startQuestTimer("TIMER", 3000, npc, talker);
|
||||
|
Reference in New Issue
Block a user