Всем Доброе утро))))
Сборка Lindvior 9767
Пожалуйста подскажите с инстансом "Родильная комната".
Меня телепортирует в зону инстанса, но при разговоре с Тай не выдаёт, тот html, который необходим для запуска инстанса, пробовал вставить старт инстанс в нпц "[npc_%objectId%_start|Start Tuy]" но при нажатии ничего не происходит.
Я так понимаю проблема в инстансе который в script,а также в tuyinstace, подскажите пожалуйста куда копать?
Или данные об инстансах ещё где-то хранятся?
Коды инстанс:
Заранее спасибо.
Сборка Lindvior 9767
Пожалуйста подскажите с инстансом "Родильная комната".
Меня телепортирует в зону инстанса, но при разговоре с Тай не выдаёт, тот html, который необходим для запуска инстанса, пробовал вставить старт инстанс в нпц "[npc_%objectId%_start|Start Tuy]" но при нажатии ничего не происходит.
Я так понимаю проблема в инстансе который в script,а также в tuyinstace, подскажите пожалуйста куда копать?
Или данные об инстансах ещё где-то хранятся?
Коды инстанс:
Instance xml
Код:
<?xml version="1.0"?>
<!DOCTYPE list SYSTEM "instances.dtd">
<list>
<instance id="171" name="Nursery" maxChannels="25" collapseIfEmpty="1" timelimit="60" dispelBuffs="true">
<collapse on-party-dismiss="true" timer="60"/>
<level min="85" max="90"/>
<party min="1" max="14"/>
<return loc="-178440, 153864, 2525"/>
<teleport loc="-185839, 147909, -15312"/>
<remove itemId="0" count="0" necessary="false"/>
<give itemId="0" count="0"/>
<quest id="0"/>
<reuse resetReuse="1 15 * * *" setUponEntry="false" sharedReuseGroup="0"/>
<spawns>
<spawn mobId="33152" type="point">
<coords loc="-185848 147608 -15325 16383"/>
</spawn>
</spawns>
</instance>
</list>
Сам инстанс
Код:
package instances;
import lineage2.commons.util.Rnd;
import lineage2.gameserver.listener.actor.OnDeathListener;
import lineage2.gameserver.model.Creature;
import lineage2.gameserver.model.Player;
import lineage2.gameserver.model.entity.Reflection;
import lineage2.gameserver.model.instances.NpcInstance;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Nursery extends Reflection
{
private static final Logger _log = LoggerFactory.getLogger(Nursery.class);
private int Creature1 = 23033;
private int Creature2 = 23034;
private int Creature3 = 23035;
private int Creature4 = 23036;
private int Creature5 = 23037;
private static long BeforeDelay = 1 * 1000L;
private long BeforeEnd = 30 * 60 * 1000L;
private int reward;
NpcInstance tuy;
private static Player player;
private DeathListener _deathListener = new DeathListener();
@Override
public void onPlayerEnter(Player player)
{
super.onPlayerEnter(player);
}
private class DeathListener implements OnDeathListener
{
private NpcInstance exchange;
@Override
public void onDeath(Creature self, Creature killer)
{
if(self.isNpc())
{
if ((self.isNpc() && self.getId() == Creature1) || (self.isNpc() && self.getId() == Creature2) || (self.isNpc() && self.getId() == Creature3) || (self.isNpc() && self.getId() == Creature4) || (self.isNpc() && self.getId() == Creature5))
{
int count = reward + Rnd.get(15);
}
}
}
}
}
TuyInstance
Код:
/*
* Copyright (c) 24.04.14 1:56 by WoWan-SM from L2Dev.su
*/
package npc.model;
import lineage2.commons.threading.RunnableImpl;
import lineage2.commons.util.Rnd;
import lineage2.gameserver.ThreadPoolManager;
import lineage2.gameserver.listener.actor.OnDeathListener;
import lineage2.gameserver.model.Creature;
import lineage2.gameserver.model.Player;
import lineage2.gameserver.model.instances.NpcInstance;
import lineage2.gameserver.network.serverpackets.ExSendUIEvent;
import lineage2.gameserver.network.serverpackets.ExShowScreenMessage;
import lineage2.gameserver.network.serverpackets.NpcHtmlMessage;
import lineage2.gameserver.network.serverpackets.SystemMessage2;
import lineage2.gameserver.network.serverpackets.components.SystemMsg;
import lineage2.gameserver.templates.npc.NpcTemplate;
import lineage2.gameserver.utils.ItemFunctions;
import lineage2.gameserver.utils.Location;
/**
* @author Awakeninger
*/
public final class TuyInstance extends NpcInstance
{
private static final int Creature1 = 23033;
private static final int Creature2 = 23034;
private static final int Creature3 = 23035;
private static final int Creature4 = 23036;
private static final int Creature5 = 23037;
private static final int BeforeEnd = 30 * 60 * 1000;
private int count;
private DeathListener _deathListener = new DeathListener();
private int reward;
public TuyInstance(int objectId, NpcTemplate template)
{
super(objectId, template);
}
@Override
public void onBypassFeedback(Player player, String command)
{
if(!canBypassCheck(player, this))
{
return;
}
if(command.startsWith("start"))
{
for(Player p : getReflection().getPlayers())
{
p.sendPacket(new ExSendUIEvent(p, 0, 0, 30 * 60, 0, ""));
p.setVar("Nurs", "true", -1);
p.sendPacket(new ExShowScreenMessage("Собранные Останки: " + count, 120000, ExShowScreenMessage.ScreenMessageAlign.TOP_CENTER, true, 1, -1, true));
}
NpcInstance C1 = getReflection().addSpawnWithRespawn(Creature5, new Location(-187080, 148600, -15337, 26634), 1, 30);
C1.addListener(_deathListener);
NpcInstance C2 = getReflection().addSpawnWithRespawn(Creature3, new Location(-187432, 148456, -15336, 36818), 1, 30);
C2.addListener(_deathListener);
NpcInstance C3 = getReflection().addSpawnWithRespawn(Creature5, new Location(-187176, 148056, -15337, 55191), 1, 30);
C3.addListener(_deathListener);
NpcInstance C4 = getReflection().addSpawnWithRespawn(Creature3, new Location(-187384, 147560, -15337, 41319), 1, 30);
C4.addListener(_deathListener);
NpcInstance C5 = getReflection().addSpawnWithRespawn(Creature1, new Location(-187032, 146968, -15337, 54933), 1, 30);
C5.addListener(_deathListener);
NpcInstance C6 = getReflection().addSpawnWithRespawn(Creature2, new Location(-186824, 147176, -15337, 8191), 1, 30);
C6.addListener(_deathListener);
NpcInstance C7 = getReflection().addSpawnWithRespawn(Creature3, new Location(-186856, 146456, -15336, 47722), 1, 30);
C7.addListener(_deathListener);
NpcInstance C8 = getReflection().addSpawnWithRespawn(Creature3, new Location(-186392, 146568, -15337, 2470), 1, 30);
C8.addListener(_deathListener);
NpcInstance C9 = getReflection().addSpawnWithRespawn(Creature1, new Location(-186104, 146888, -15337, 8740), 1, 30);
C9.addListener(_deathListener);
NpcInstance A1 = getReflection().addSpawnWithRespawn(Creature4, new Location(-185720, 146120, -15336, 49803), 1, 30);
A1.addListener(_deathListener);
NpcInstance A2 = getReflection().addSpawnWithRespawn(Creature4, new Location(-185560, 146376, -15330, 10557), 1, 30);
A2.addListener(_deathListener);
NpcInstance A3 = getReflection().addSpawnWithRespawn(Creature3, new Location(-185576, 146712, -15337, 13828), 1, 30);
A3.addListener(_deathListener);
NpcInstance A4 = getReflection().addSpawnWithRespawn(Creature4, new Location(-185096, 146664, -15332, 64381), 1, 30);
A4.addListener(_deathListener);
NpcInstance A5 = getReflection().addSpawnWithRespawn(Creature3, new Location(-184856, 146520, -15336, 57956), 1, 30);
A5.addListener(_deathListener);
NpcInstance A6 = getReflection().addSpawnWithRespawn(Creature2, new Location(-184840, 147032, -15335, 15640), 1, 30);
A6.addListener(_deathListener);
NpcInstance A7 = getReflection().addSpawnWithRespawn(Creature1, new Location(-184872, 147400, -15325, 17288), 1, 30);
A7.addListener(_deathListener);
NpcInstance A8 = getReflection().addSpawnWithRespawn(Creature2, new Location(-184328, 147048, -15336, 60384), 1, 30);
A8.addListener(_deathListener);
NpcInstance A9 = getReflection().addSpawnWithRespawn(Creature1, new Location(-184248, 147448, -15335, 14325), 1, 30);
A9.addListener(_deathListener);
NpcInstance B1 = getReflection().addSpawnWithRespawn(Creature4, new Location(-184584, 147656, -15337, 26986), 1, 30);
B1.addListener(_deathListener);
NpcInstance B2 = getReflection().addSpawnWithRespawn(Creature4, new Location(-184408, 147784, -15337, 24575), 1, 30);
B2.addListener(_deathListener);
NpcInstance B3 = getReflection().addSpawnWithRespawn(Creature1, new Location(-184120, 148040, -15336, 13028), 1, 30);
B3.addListener(_deathListener);
NpcInstance B4 = getReflection().addSpawnWithRespawn(Creature2, new Location(-184536, 148184, -15337, 29292), 1, 30);
B4.addListener(_deathListener);
NpcInstance B5 = getReflection().addSpawnWithRespawn(Creature2, new Location(-184264, 148456, -15336, 9137), 1, 30);
B5.addListener(_deathListener);
NpcInstance B6 = getReflection().addSpawnWithRespawn(Creature1, new Location(-184872, 148600, -15337, 27714), 1, 30);
B6.addListener(_deathListener);
NpcInstance B7 = getReflection().addSpawnWithRespawn(Creature4, new Location(-184584, 148744, -15337, 4836), 1, 30);
B7.addListener(_deathListener);
NpcInstance B8 = getReflection().addSpawnWithRespawn(Creature5, new Location(-184488, 149080, -15335, 13481), 1, 30);
B8.addListener(_deathListener);
NpcInstance B9 = getReflection().addSpawnWithRespawn(Creature4, new Location(-184696, 149128, -15336, 30402), 1, 30);
B9.addListener(_deathListener);
NpcInstance D1 = getReflection().addSpawnWithRespawn(Creature3, new Location(-184984, 148904, -15337, 39662), 1, 30);
D1.addListener(_deathListener);
NpcInstance D2 = getReflection().addSpawnWithRespawn(Creature1, new Location(-185080, 149272, -15337, 19045), 1, 30);
D2.addListener(_deathListener);
NpcInstance D3 = getReflection().addSpawnWithRespawn(Creature2, new Location(-185048, 149576, -15335, 15290), 1, 30);
D3.addListener(_deathListener);
NpcInstance D4 = getReflection().addSpawnWithRespawn(Creature5, new Location(-185368, 149560, -15336, 33289), 1, 30);
D4.addListener(_deathListener);
NpcInstance D5 = getReflection().addSpawnWithRespawn(Creature4, new Location(-185608, 149288, -15337, 41611), 1, 30);
D5.addListener(_deathListener);
NpcInstance D6 = getReflection().addSpawnWithRespawn(Creature3, new Location(-185448, 149160, -15337, 58498), 1, 30);
D6.addListener(_deathListener);
NpcInstance D7 = getReflection().addSpawnWithRespawn(Creature2, new Location(-185816, 149080, -15337, 35000), 1, 30);
D7.addListener(_deathListener);
NpcInstance D8 = getReflection().addSpawnWithRespawn(Creature1, new Location(-185928, 149480, -15336, 14325), 1, 30);
D8.addListener(_deathListener);
NpcInstance D9 = getReflection().addSpawnWithRespawn(Creature2, new Location(-186232, 149656, -15335, 27294), 1, 30);
D9.addListener(_deathListener);
NpcInstance E1 = getReflection().addSpawnWithRespawn(Creature5, new Location(-186536, 149400, -15336, 40068), 1, 30);
E1.addListener(_deathListener);
NpcInstance E2 = getReflection().addSpawnWithRespawn(Creature3, new Location(-186440, 149032, -15337, 51813), 1, 30);
E2.addListener(_deathListener);
NpcInstance E3 = getReflection().addSpawnWithRespawn(Creature3, new Location(-186792, 149160, -15337, 29130), 1, 30);
E3.addListener(_deathListener);
NpcInstance E4 = getReflection().addSpawnWithRespawn(Creature5, new Location(-187000, 149320, -15335, 25928), 1, 30);
E4.addListener(_deathListener);
NpcInstance E5 = getReflection().addSpawnWithRespawn(Creature4, new Location(-187128, 148904, -15336, 46038), 1, 30);
E5.addListener(_deathListener);
NpcInstance E6 = getReflection().addSpawnWithRespawn(Creature2, new Location(-186872, 148792, -15337, 61312), 1, 30);
E6.addListener(_deathListener);
NpcInstance E7 = getReflection().addSpawnWithRespawn(Creature1, new Location(-186536, 148808, -15337, 3355), 1, 30);
E7.addListener(_deathListener);
NpcInstance E8 = getReflection().addSpawnWithRespawn(Creature1, new Location(-187016, 148328, -15337, 39714), 1, 30);
E8.addListener(_deathListener);
NpcInstance E9 = getReflection().addSpawnWithRespawn(Creature3, new Location(-187096, 147384, -15335, 50306), 1, 30);
E9.addListener(_deathListener);
NpcInstance F1 = getReflection().addSpawnWithRespawn(Creature3, new Location(-186664, 146856, -15337, 6469), 1, 30);
F1.addListener(_deathListener);
NpcInstance F2 = getReflection().addSpawnWithRespawn(Creature2, new Location(-186520, 146328, -15336, 52054), 1, 30);
F2.addListener(_deathListener);
NpcInstance F3 = getReflection().addSpawnWithRespawn(Creature1, new Location(-185992, 146264, -15336, 64277), 1, 30);
F3.addListener(_deathListener);
NpcInstance F4 = getReflection().addSpawnWithRespawn(Creature3, new Location(-185864, 146696, -15335, 13379), 1, 30);
F4.addListener(_deathListener);
NpcInstance F5 = getReflection().addSpawnWithRespawn(Creature5, new Location(-184312, 146792, -15335, 65119), 1, 30);
F5.addListener(_deathListener);
ThreadPoolManager.getInstance().schedule(new Stop(), BeforeEnd);
}
else if(command.startsWith("reward"))
{
if(reward >= 1 && reward <= 800)
{
ItemFunctions.addItem(player, 17602, 10, true);
}
if(reward >= 801 && reward <= 1600)
{
ItemFunctions.addItem(player, 17602, 60, true);
}
if(reward >= 1601 && reward <= 2000)
{
ItemFunctions.addItem(player, 17602, 160, true);
}
for(Player p : getReflection().getPlayers())
{
p.sendPacket(new ExSendUIEvent(p, 1, 1, 0, 0));
p.sendPacket(new ExShowScreenMessage("Вы получили всего: " + count + " Конденсатов Жизненный Энергии", 2000, ExShowScreenMessage.ScreenMessageAlign.TOP_CENTER, true, 1, -1, true));
}
getReflection().startCollapseTimer(1 * 1000L);
getReflection().setReenterTime(System.currentTimeMillis());
}
else
{
super.onBypassFeedback(player, command);
}
}
public void showChatWindow(Player player, int val, Object... arg)
{
NpcHtmlMessage msg = new NpcHtmlMessage(player, this);
if(player.getVar("Nurs") != null)
{
msg.setFile("html/default/tuyexit.htm");
player.unsetVar("Nurs");
}
else
{
msg.setFile("html/default/tuyenter.htm");
}
player.sendPacket(msg);
}
private class DeathListener implements OnDeathListener
{
@Override
public void onDeath(Creature self, Creature killer)
{
if(self.isNpc())
{
if(self.isNpc() && self.getId() == Creature1 || self.isNpc() && self.getId() == Creature2 || self.isNpc() && self.getId() == Creature3 || self.isNpc() && self.getId() == Creature4 || self.isNpc() && self.getId() == Creature5)
{
count = reward + Rnd.get(15);
reward = count++;
for(Player p : getReflection().getPlayers())
{
p.sendPacket(new ExShowScreenMessage("Собранные Останки: " + count, 120000, ExShowScreenMessage.ScreenMessageAlign.TOP_CENTER, true, 1, -1, true));
}
}
}
}
}
public class Stop extends RunnableImpl
{
public void runImpl()
{
for(Player p : getReflection().getPlayers())
{
p.sendPacket(new ExSendUIEvent(p, 1, 1, 0, 0));
p.sendPacket(new SystemMessage2(SystemMsg.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTES).addInteger(5));
}
getReflection().startCollapseTimer(5 * 60 * 1000L);
}
}
}
Заранее спасибо.