01-21-2011, 01:16 PM
(Сообщение последний раз редактировалось: 01-21-2011, 11:00 PM lineage-zone.)
Здравствуйте уважаемые коллеги. Вашему вниманию предлагается исходный код сервера Freya игрового комплекса TheAbyss от 13 ноября 2010 г. Очень качественная реализация и высокая стабильность проверенная временем.
Цена исходного кода: 30 000 RUB
Цена сборки: 20 000 RUB
При покупке предоставлю доступ по ТВ.
Предоставлю любые затребуемые доказательства.
Папка config
http://narod.ru/disk/4055527001/config.rar.html
Цена исходного кода: 30 000 RUB
Цена сборки: 20 000 RUB
При покупке предоставлю доступ по ТВ.
Предоставлю любые затребуемые доказательства.
Freya.java
ДЕМО-ВЕРСИЯ! ЧАСТЬ КОДА УДАЛЕНА!
package com.l2emu.scripts.instances;
import com.l2emu.gameserver.ThreadPoolManager;
import com.l2emu.gameserver.ai.CtrlIntention;
import com.l2emu.gameserver.datatables.NpcTable;
import com.l2emu.gameserver.datatables.SkillTable;
import com.l2emu.gameserver.instancemanager.GrandBossManager;
import com.l2emu.gameserver.instancemanager.InstanceManager;
import com.l2emu.gameserver.model.L2CharPosition;
import com.l2emu.gameserver.model.L2Effect;
import com.l2emu.gameserver.model.L2Party;
import com.l2emu.gameserver.model.L2Skill;
import com.l2emu.gameserver.model.L2Spawn;
import com.l2emu.gameserver.model.L2World;
import com.l2emu.gameserver.model.Location;
import com.l2emu.gameserver.model.actor.L2Character;
import com.l2emu.gameserver.model.actor.L2Npc;
import com.l2emu.gameserver.model.actor.instance.L2PcInstance;
import com.l2emu.gameserver.model.entity.Instance;
import com.l2emu.gameserver.model.entity.InstanceWorld;
import com.l2emu.gameserver.model.quest.Quest;
import com.l2emu.gameserver.model.zone.L2ZoneType;
import com.l2emu.gameserver.model.zone.type.L2BossZone;
import com.l2emu.gameserver.network.SystemMessageId;
import com.l2emu.gameserver.network.serverpackets.ExShowScreenMessage;
import com.l2emu.gameserver.network.serverpackets.SystemMessage;
import com.l2emu.gameserver.taskmanager.DecayTaskManager;
import com.l2emu.gameserver.templates.chars.L2NpcTemplate;
import com.l2emu.util.Rnd;
import com.l2emu.gameserver.util.Util;
import gnu.trove.TIntObjectHashMap;
import java.util.ArrayList;
import java.util.concurrent.ScheduledFuture;
/**
* @author Threat
*/
public class Freya extends Quest
{
private class FreyaWorld extends InstanceWorld
{
private L2Npc Freya, Kegor, Jinia;
private L2BossZone BossZone = GrandBossManager.getInstance().getZone(114722, -114797, -11203);
private ArrayList<L2Npc> activeMobs = new ArrayList<L2Npc>();
private ArrayList<L2Npc> activeKnights = new ArrayList<L2Npc>();
private ArrayList<L2Npc> Glaciers = new ArrayList<L2Npc>();
private ScheduledFuture<?> GlacierTimer = null;
private ScheduledFuture<?> ArchersTimer = null;
}
private static final boolean debug = true;
private static final int FreyaOnThrone = 29177; // 29178 - hard mode
private static final int FreyaStand = 29179; // 29180 - hard mode
private static final int Glacier = 18853; // cannot see oO why???
private static final int Glakias = 25699; // 25700 - hard mode
private static final int ArcheryKnight = 18855; // 18856 - hard mode
private static final int ArchersBreath = 18854;
// private static final int Sirra = 18852;
// This npc must attack Freya
private static final int Kegor = 18846; // and 18851
private static final int Jinia = 18850;
private static final int JiniaStart = 32781;
private static final int[][] KnightSpawns = {
{113828, -113498, -11172},
{113366, -113968, -11172},
{115606, -116099, -11172},
{116073, -115631, -11172},
}; // TODO: нужно дописать все места спавна
private static final int[][] GlacierSpawns = {
{115176, -114614},
{114918, -114361},
{114539, -114349},
{114270, -114613},
{114271, -114981},
{114526, -115249},
{114905, -115252},
{115167, -114996}
};
private static int checkworld(L2PcInstance player)
{
InstanceWorld checkworld = InstanceManager.getInstance().getPlayerWorld(player);
if (checkworld != null)
{
if (!(checkworld instanceof FreyaWorld))
return 0;
return 1;
}
return 2;
}
private static boolean checkConditions(L2PcInstance player)
{
if (debug)
return true;
L2Party party = player.getParty();
if (party == null || !party.isInCommandChannel())
{
if (party != null)
party.broadcastToPartyMembers(new SystemMessage(SystemMessageId.NOT_IN_COMMAND_CHANNEL_CANT_ENTER));
else
player.sendPacket(SystemMessageId.NOT_IN_COMMAND_CHANNEL_CANT_ENTER);
return false;
}
if (party.getCommandChannel().getChannelLeader() != player)
{
party.getCommandChannel().broadcastToChannelMembers(new SystemMessage(2765));
return false;
}
int count = 0;
for (int id : InstanceManager.getInstance().getInstances().keys())
{
InstanceWorld inst = InstanceManager.getInstance().getWorld(id);
if (inst != null && inst instanceof FreyaWorld)
count++;
if (count >= 3)
{
party.getCommandChannel().broadcastToChannelMembers(new SystemMessage(2104));
return false;
}
}
if (party.getCommandChannel().getMembers().size() < 10)
{
party.getCommandChannel().broadcastToChannelMembers(new SystemMessage(2793).addNumber(10));
return false;
}
if (party.getCommandChannel().getMembers().size() > 27)
{
party.getCommandChannel().broadcastToChannelMembers(new SystemMessage(2764));
return false;
}
TIntObjectHashMap<Long> instanceTimes;
for (L2PcInstance plr : party.getCommandChannel().getMembers())
{
if (checkworld(plr) == 0)
{
party.getCommandChannel().broadcastToChannelMembers(new SystemMessage(SystemMessageId.ALREADY_ENTERED_ANOTHER_INSTANCE_CANT_ENTER));
return false;
}
if (plr.getLevel() < 75)
{
party.getCommandChannel().broadcastToChannelMembers(new SystemMessage(SystemMessageId.C1_LEVEL_REQUIREMENT_NOT_SUFFICIENT).addPcName(plr));
return false;
}
if (!plr.isInsideRadius(player, 1000, true, true))
{
party.getCommandChannel().broadcastToChannelMembers(new SystemMessage(SystemMessageId.C1_IS_IN_LOCATION_THAT_CANNOT_BE_ENTERED).addPcName(plr));
return false;
}
instanceTimes = InstanceManager.getInstance().getAllInstanceTimes(plr.getObjectId());
if (instanceTimes != null && instanceTimes.contains(139))
{
if (System.currentTimeMillis() < instanceTimes.get(139))
{
party.getCommandChannel().broadcastToChannelMembers(new SystemMessage(SystemMessageId.C1_MAY_NOT_REENTER_YET).addPcName(plr));
return false;
}
}
}
return true;
}
private synchronized void enterInstance(L2PcInstance player)
{
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
if (checkworld(player) == 1)
{
teleportplayer(player, new Location(113871, -112435, -11200), (FreyaWorld)world);
return;
}
if (checkConditions(player))
{
L2Party party = player.getParty();
world = new FreyaWorld();
world.instanceId = InstanceManager.getInstance().createDynamicInstance(null);
world.templateId = 139;
final Instance instance = InstanceManager.getInstance().getInstance(world.instanceId);
instance.addDoor(23140101, true);
// final int time = ?;
// instance.setDuration(time); TODO: unknown time
// instance.setEmptyDestroyTime(time);
final int[] returnLoc = {player.getX(), player.getY(), player.getZ()};
instance.setSpawnLoc(returnLoc);
InstanceManager.getInstance().addWorld(world);
instance.setName("Ice Queen's Castle");
world.status = 0;
_log.info("Instance Ice Queen's Castle created with id "+world.instanceId+" and created by player "+player.getName());
if (debug)
{
if (party == null)
teleportplayer(player, new Location(113871, -112435, -11200), (FreyaWorld)world);
else
if (party.isInCommandChannel())
for (L2PcInstance partyMember : party.getCommandChannel().getMembers())
teleportplayer(partyMember, new Location(113871, -112435, -11200), (FreyaWorld)world);
else
for (L2PcInstance partyMember : party.getPartyMembers())
teleportplayer(partyMember, new Location(113871, -112435, -11200), (FreyaWorld)world);
}
else
for (L2PcInstance partyMember : party.getCommandChannel().getMembers())
teleportplayer(partyMember, new Location(113871, -112435, -11200), (FreyaWorld)world);
}
}
private void teleportplayer(L2PcInstance player, Location loc, FreyaWorld world)
{
player.setInstanceId(world.instanceId);
player.teleToLocationWithPet(loc.x, loc.y, loc.z);
if (!world.allowed.contains(player.getObjectId()))
world.allowed.add(player.getObjectId());
}
private static L2Npc spawn(int npcId, int X, int Y, int Z, int head, FreyaWorld world)
{
try
{
L2NpcTemplate template = NpcTable.getInstance().getTemplate(npcId);
if (template != null)
{
L2Spawn spawn = new L2Spawn(template);
spawn.setHeading(head);
spawn.setLocx(X);
spawn.setLocy(Y);
spawn.setLocz(Z + 20);
spawn.setInstanceId(world.instanceId);
spawn.setAmount(spawn.getAmount()+1);
spawn.setOnKillDelay(1500);
return spawn.doSpawn();
}
}
catch (Exception e1)
{
_log.info("Freya: Could not spawn Npc " + npcId);
}
return null;
}
public static void startWave(int stage, FreyaWorld world)
{
final FreyaWorld Wworld = world;
if (stage == 1)
{
world.BossZone.broadcastMovie(15, world.instanceId);
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
{
public void run()
{
Wworld.Freya = spawn(FreyaOnThrone, 114720, -117068, -11078, 16384, Wworld);
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
{
public void run()
{
Wworld.BossZone.broadcastPacket(new ExShowScreenMessage(1801086, 6000, ExShowScreenMessage.ScreenMessageAlign.TOP_CENTER, true, false, -1, true));
Freya.spawnGlaciers(Wworld);
}
}, 1000);
}
}, 53500);
}
if (stage == 2)
{
world.BossZone.broadcastMovie(16, world.instanceId);
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
{
public void run()
{
Wworld.Freya = spawn(FreyaOnThrone, 114719, -117450, -10673, 16384, Wworld);
Wworld.Freya.setIsOverloaded(true);
Wworld.Freya.setIsInvul(true);
ThreadPoolManager.getInstance().scheduleGeneral(new Freya.Timer(60, Wworld), 100);
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
{
public void run()
{
Wworld.BossZone.broadcastPacket(new ExShowScreenMessage(1801087, 6000, ExShowScreenMessage.ScreenMessageAlign.TOP_CENTER, true, false, -1, true));
Freya.spawnKnights(Wworld);
Freya.spawnGlaciers(Wworld);
}
}, 60100);
}
}, 21100);
}
package com.l2emu.scripts.instances;
import com.l2emu.gameserver.ThreadPoolManager;
import com.l2emu.gameserver.ai.CtrlIntention;
import com.l2emu.gameserver.datatables.NpcTable;
import com.l2emu.gameserver.datatables.SkillTable;
import com.l2emu.gameserver.instancemanager.GrandBossManager;
import com.l2emu.gameserver.instancemanager.InstanceManager;
import com.l2emu.gameserver.model.L2CharPosition;
import com.l2emu.gameserver.model.L2Effect;
import com.l2emu.gameserver.model.L2Party;
import com.l2emu.gameserver.model.L2Skill;
import com.l2emu.gameserver.model.L2Spawn;
import com.l2emu.gameserver.model.L2World;
import com.l2emu.gameserver.model.Location;
import com.l2emu.gameserver.model.actor.L2Character;
import com.l2emu.gameserver.model.actor.L2Npc;
import com.l2emu.gameserver.model.actor.instance.L2PcInstance;
import com.l2emu.gameserver.model.entity.Instance;
import com.l2emu.gameserver.model.entity.InstanceWorld;
import com.l2emu.gameserver.model.quest.Quest;
import com.l2emu.gameserver.model.zone.L2ZoneType;
import com.l2emu.gameserver.model.zone.type.L2BossZone;
import com.l2emu.gameserver.network.SystemMessageId;
import com.l2emu.gameserver.network.serverpackets.ExShowScreenMessage;
import com.l2emu.gameserver.network.serverpackets.SystemMessage;
import com.l2emu.gameserver.taskmanager.DecayTaskManager;
import com.l2emu.gameserver.templates.chars.L2NpcTemplate;
import com.l2emu.util.Rnd;
import com.l2emu.gameserver.util.Util;
import gnu.trove.TIntObjectHashMap;
import java.util.ArrayList;
import java.util.concurrent.ScheduledFuture;
/**
* @author Threat
*/
public class Freya extends Quest
{
private class FreyaWorld extends InstanceWorld
{
private L2Npc Freya, Kegor, Jinia;
private L2BossZone BossZone = GrandBossManager.getInstance().getZone(114722, -114797, -11203);
private ArrayList<L2Npc> activeMobs = new ArrayList<L2Npc>();
private ArrayList<L2Npc> activeKnights = new ArrayList<L2Npc>();
private ArrayList<L2Npc> Glaciers = new ArrayList<L2Npc>();
private ScheduledFuture<?> GlacierTimer = null;
private ScheduledFuture<?> ArchersTimer = null;
}
private static final boolean debug = true;
private static final int FreyaOnThrone = 29177; // 29178 - hard mode
private static final int FreyaStand = 29179; // 29180 - hard mode
private static final int Glacier = 18853; // cannot see oO why???
private static final int Glakias = 25699; // 25700 - hard mode
private static final int ArcheryKnight = 18855; // 18856 - hard mode
private static final int ArchersBreath = 18854;
// private static final int Sirra = 18852;
// This npc must attack Freya
private static final int Kegor = 18846; // and 18851
private static final int Jinia = 18850;
private static final int JiniaStart = 32781;
private static final int[][] KnightSpawns = {
{113828, -113498, -11172},
{113366, -113968, -11172},
{115606, -116099, -11172},
{116073, -115631, -11172},
}; // TODO: нужно дописать все места спавна
private static final int[][] GlacierSpawns = {
{115176, -114614},
{114918, -114361},
{114539, -114349},
{114270, -114613},
{114271, -114981},
{114526, -115249},
{114905, -115252},
{115167, -114996}
};
private static int checkworld(L2PcInstance player)
{
InstanceWorld checkworld = InstanceManager.getInstance().getPlayerWorld(player);
if (checkworld != null)
{
if (!(checkworld instanceof FreyaWorld))
return 0;
return 1;
}
return 2;
}
private static boolean checkConditions(L2PcInstance player)
{
if (debug)
return true;
L2Party party = player.getParty();
if (party == null || !party.isInCommandChannel())
{
if (party != null)
party.broadcastToPartyMembers(new SystemMessage(SystemMessageId.NOT_IN_COMMAND_CHANNEL_CANT_ENTER));
else
player.sendPacket(SystemMessageId.NOT_IN_COMMAND_CHANNEL_CANT_ENTER);
return false;
}
if (party.getCommandChannel().getChannelLeader() != player)
{
party.getCommandChannel().broadcastToChannelMembers(new SystemMessage(2765));
return false;
}
int count = 0;
for (int id : InstanceManager.getInstance().getInstances().keys())
{
InstanceWorld inst = InstanceManager.getInstance().getWorld(id);
if (inst != null && inst instanceof FreyaWorld)
count++;
if (count >= 3)
{
party.getCommandChannel().broadcastToChannelMembers(new SystemMessage(2104));
return false;
}
}
if (party.getCommandChannel().getMembers().size() < 10)
{
party.getCommandChannel().broadcastToChannelMembers(new SystemMessage(2793).addNumber(10));
return false;
}
if (party.getCommandChannel().getMembers().size() > 27)
{
party.getCommandChannel().broadcastToChannelMembers(new SystemMessage(2764));
return false;
}
TIntObjectHashMap<Long> instanceTimes;
for (L2PcInstance plr : party.getCommandChannel().getMembers())
{
if (checkworld(plr) == 0)
{
party.getCommandChannel().broadcastToChannelMembers(new SystemMessage(SystemMessageId.ALREADY_ENTERED_ANOTHER_INSTANCE_CANT_ENTER));
return false;
}
if (plr.getLevel() < 75)
{
party.getCommandChannel().broadcastToChannelMembers(new SystemMessage(SystemMessageId.C1_LEVEL_REQUIREMENT_NOT_SUFFICIENT).addPcName(plr));
return false;
}
if (!plr.isInsideRadius(player, 1000, true, true))
{
party.getCommandChannel().broadcastToChannelMembers(new SystemMessage(SystemMessageId.C1_IS_IN_LOCATION_THAT_CANNOT_BE_ENTERED).addPcName(plr));
return false;
}
instanceTimes = InstanceManager.getInstance().getAllInstanceTimes(plr.getObjectId());
if (instanceTimes != null && instanceTimes.contains(139))
{
if (System.currentTimeMillis() < instanceTimes.get(139))
{
party.getCommandChannel().broadcastToChannelMembers(new SystemMessage(SystemMessageId.C1_MAY_NOT_REENTER_YET).addPcName(plr));
return false;
}
}
}
return true;
}
private synchronized void enterInstance(L2PcInstance player)
{
InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player);
if (checkworld(player) == 1)
{
teleportplayer(player, new Location(113871, -112435, -11200), (FreyaWorld)world);
return;
}
if (checkConditions(player))
{
L2Party party = player.getParty();
world = new FreyaWorld();
world.instanceId = InstanceManager.getInstance().createDynamicInstance(null);
world.templateId = 139;
final Instance instance = InstanceManager.getInstance().getInstance(world.instanceId);
instance.addDoor(23140101, true);
// final int time = ?;
// instance.setDuration(time); TODO: unknown time
// instance.setEmptyDestroyTime(time);
final int[] returnLoc = {player.getX(), player.getY(), player.getZ()};
instance.setSpawnLoc(returnLoc);
InstanceManager.getInstance().addWorld(world);
instance.setName("Ice Queen's Castle");
world.status = 0;
_log.info("Instance Ice Queen's Castle created with id "+world.instanceId+" and created by player "+player.getName());
if (debug)
{
if (party == null)
teleportplayer(player, new Location(113871, -112435, -11200), (FreyaWorld)world);
else
if (party.isInCommandChannel())
for (L2PcInstance partyMember : party.getCommandChannel().getMembers())
teleportplayer(partyMember, new Location(113871, -112435, -11200), (FreyaWorld)world);
else
for (L2PcInstance partyMember : party.getPartyMembers())
teleportplayer(partyMember, new Location(113871, -112435, -11200), (FreyaWorld)world);
}
else
for (L2PcInstance partyMember : party.getCommandChannel().getMembers())
teleportplayer(partyMember, new Location(113871, -112435, -11200), (FreyaWorld)world);
}
}
private void teleportplayer(L2PcInstance player, Location loc, FreyaWorld world)
{
player.setInstanceId(world.instanceId);
player.teleToLocationWithPet(loc.x, loc.y, loc.z);
if (!world.allowed.contains(player.getObjectId()))
world.allowed.add(player.getObjectId());
}
private static L2Npc spawn(int npcId, int X, int Y, int Z, int head, FreyaWorld world)
{
try
{
L2NpcTemplate template = NpcTable.getInstance().getTemplate(npcId);
if (template != null)
{
L2Spawn spawn = new L2Spawn(template);
spawn.setHeading(head);
spawn.setLocx(X);
spawn.setLocy(Y);
spawn.setLocz(Z + 20);
spawn.setInstanceId(world.instanceId);
spawn.setAmount(spawn.getAmount()+1);
spawn.setOnKillDelay(1500);
return spawn.doSpawn();
}
}
catch (Exception e1)
{
_log.info("Freya: Could not spawn Npc " + npcId);
}
return null;
}
public static void startWave(int stage, FreyaWorld world)
{
final FreyaWorld Wworld = world;
if (stage == 1)
{
world.BossZone.broadcastMovie(15, world.instanceId);
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
{
public void run()
{
Wworld.Freya = spawn(FreyaOnThrone, 114720, -117068, -11078, 16384, Wworld);
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
{
public void run()
{
Wworld.BossZone.broadcastPacket(new ExShowScreenMessage(1801086, 6000, ExShowScreenMessage.ScreenMessageAlign.TOP_CENTER, true, false, -1, true));
Freya.spawnGlaciers(Wworld);
}
}, 1000);
}
}, 53500);
}
if (stage == 2)
{
world.BossZone.broadcastMovie(16, world.instanceId);
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
{
public void run()
{
Wworld.Freya = spawn(FreyaOnThrone, 114719, -117450, -10673, 16384, Wworld);
Wworld.Freya.setIsOverloaded(true);
Wworld.Freya.setIsInvul(true);
ThreadPoolManager.getInstance().scheduleGeneral(new Freya.Timer(60, Wworld), 100);
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
{
public void run()
{
Wworld.BossZone.broadcastPacket(new ExShowScreenMessage(1801087, 6000, ExShowScreenMessage.ScreenMessageAlign.TOP_CENTER, true, false, -1, true));
Freya.spawnKnights(Wworld);
Freya.spawnGlaciers(Wworld);
}
}, 60100);
}
}, 21100);
}
http://narod.ru/disk/4055527001/config.rar.html