thank you for share, a couple of things
the first file i've open didnt tell me much about the pack and the developer
public static void unspawn()
{
NpcData table = NpcData.getInstance();
try (Connection con = ConnectionPool.getConnection();
PreparedStatement ps = con.prepareStatement(LOAD_HIGH_RATE);
ResultSet rs = ps.executeQuery())
{
while (rs.next())
{
int pointer = 1;
int npcId = rs.getInt(pointer++);
int locX = rs.getInt(pointer++);
int locY = rs.getInt(pointer++);
int locZ = rs.getInt(pointer++);
int heading = rs.getInt("heading");
respawnTime = rs.getInt("respawn_delay");
NpcTemplate tp = table.getTemplate(npcId);
if (tp != null)
{
_npcSpawn1 = new Spawn(tp);
_npcSpawn1.setLoc(locX, locY, locZ, heading);
_npcSpawn1.setRespawnState(true);
_npcSpawn1.setRespawnRandom(Config.DUNGEON_NPC_DOSPAWN);
Npc npc = _npcSpawn1.doSpawn(false);
if (npc instanceof Monster)
npc.setInstanceId(InstanceMap.HighRateInstanceId, true);
else
{
// err
}
}
}
ps.execute();
}
catch (Exception e)
{
e.printStackTrace();
}
}
else { error }
random static access
public static void Finish_Event()
{
desSpawn();
unspawnNpc2();
_started = false;
_finish = true;
if (!AdminDungeon._bestfarm_manual)
InicialDungeon.getInstance().StartCalculationOfNextEventTime();
else
AdminDungeon._bestfarm_manual = false;
for (Player player : World.getInstance().getPlayers())
{
if (player != null && player.isOnline())
{
CreatureSay cs = new CreatureSay(player.getObjectId(), SayType.HERO_VOICE, "", ("Next Dungeon: " + InicialDungeon.getInstance().getNextTime()) + " (GMT-3)."); // 8D
player.sendPacket(cs);
}
}
}
con.close, wheird stuff when using try/catch with resources
protected static void desSpawn()
{
NpcData table = NpcData.getInstance();
try (Connection con = ConnectionPool.getConnection();
PreparedStatement ps = con.prepareStatement(LOAD_HIGH_RATE);
ResultSet rs = ps.executeQuery())
{
while (rs.next())
{
int pointer = 1;
int npcId = rs.getInt(pointer++);
NpcTemplate tp = table.getTemplate(npcId);
if (tp != null)
{
if (_npcSpawn1 == null)
return;
_npcSpawn1.getNpc().deleteMe();
_npcSpawn1.setRespawnState(false);
SpawnTable.getInstance().deleteSpawn(_npcSpawn1, false);
}
}
con.close();
ps.executeUpdate();
}
catch (Exception e)
{
e.printStackTrace();
}
// teleport players back, cleanup everything else
world.destroy();
world = null;
}
overall bad coded customs, also i am not sure if this is a version of acis that can be shared but if not thank you