Sync with L2JServer Feb 3rd 2015.

This commit is contained in:
mobius
2015-02-03 21:11:57 +00:00
parent 9cf1a6d6e5
commit fe25f74122
169 changed files with 3379 additions and 5414 deletions

View File

@ -18,38 +18,37 @@
*/
package instances.HideoutOfTheDawn;
import instances.AbstractInstance;
import com.l2jserver.gameserver.instancemanager.InstanceManager;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.L2Summon;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.instancezone.InstanceWorld;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.network.SystemMessageId;
/**
* Hideout of the Dawn instance zone.
* @author Adry_85
*/
public final class HideoutOfTheDawn extends Quest
public final class HideoutOfTheDawn extends AbstractInstance
{
protected class HotDWorld extends InstanceWorld
{
long storeTime = 0;
}
private static final int TEMPLATE_ID = 113;
// NPCs
private static final int WOOD = 32593;
private static final int JAINA = 32617;
// Location
private static final Location WOOD_LOC = new Location(-23758, -8959, -5384, 0, 0);
private static final Location JAINA_LOC = new Location(147072, 23743, -1984, 0);
// Misc
private static final int TEMPLATE_ID = 113;
private HideoutOfTheDawn()
public HideoutOfTheDawn()
{
super(-1, HideoutOfTheDawn.class.getSimpleName(), "instances");
super(HideoutOfTheDawn.class.getSimpleName());
addStartNpc(WOOD);
addTalkId(WOOD, JAINA);
}
@ -61,7 +60,7 @@ public final class HideoutOfTheDawn extends Quest
{
case WOOD:
{
enterInstance(talker, "HideoutOfTheDawn.xml", WOOD_LOC);
enterInstance(talker, new HotDWorld(), "HideoutOfTheDawn.xml", TEMPLATE_ID);
return "32593-01.htm";
}
case JAINA:
@ -76,49 +75,13 @@ public final class HideoutOfTheDawn extends Quest
return super.onTalk(npc, talker);
}
protected int enterInstance(L2PcInstance player, String template, Location loc)
@Override
public void onEnterInstance(L2PcInstance player, InstanceWorld world, boolean firstEntrance)
{
// check for existing instances for this player
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
// existing instance
if (world != null)
if (firstEntrance)
{
if (!(world instanceof HotDWorld))
{
player.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANT_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON);
return 0;
}
teleportPlayer(player, loc, world.getInstanceId(), false);
removeBuffs(player);
return 0;
world.addAllowed(player.getObjectId());
}
// New instance
world = new HotDWorld();
world.setInstanceId(InstanceManager.getInstance().createDynamicInstance(template));
world.setTemplateId(TEMPLATE_ID);
world.setStatus(0);
((HotDWorld) world).storeTime = System.currentTimeMillis();
InstanceManager.getInstance().addWorld(world);
_log.info("Hideout of the Dawn started " + template + " Instance: " + world.getInstanceId() + " created by player: " + player.getName());
// teleport players
teleportPlayer(player, loc, world.getInstanceId(), false);
removeBuffs(player);
world.addAllowed(player.getObjectId());
return world.getInstanceId();
teleportPlayer(player, WOOD_LOC, world.getInstanceId(), false);
}
private static final void removeBuffs(L2Character ch)
{
ch.stopAllEffectsExceptThoseThatLastThroughDeath();
if (ch.hasSummon())
{
ch.getServitors().values().forEach(L2Summon::stopAllEffectsExceptThoseThatLastThroughDeath);
}
}
public static void main(String[] args)
{
new HideoutOfTheDawn();
}
}
}