You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Lineage II Classic Einhovant new project is looking for a skilled Java Developer to join our team!
If you're passionate about game development and eager to contribute to this project, we'd love to hear from you.
For more details, feel free to send us a message. Let’s create something amazing together!
Question
aonniemnoi
in RaidBossSpawnManager
this code. when the raidboss spawn got show announce to all player but.
**The problem is raidboss got spawn 2 raisboss in same location. (spawn double raidboss)**
how to fix it? Thank you some 1 can help me please.
-----------------------------------------------------------
if ((respawnTime == 0L) || (time > respawnTime))
Edited by aonniemnoi{
L2RaidBossInstance raidboss = null;
// custom
if (bossId == 40019)
{
raidboss = (L2RaidBossInstance) _spawns.get(bossId).doSpawn();
Announcements _an = Announcements.getInstance();
_an.announceToAll("RaidBoss : " + raidboss.getName() + " เกิดแล้ว!!!");
}
raidboss = (L2RaidBossInstance) spawnDat.doSpawn();
if (raidboss != null)
{
raidboss.setCurrentHp(currentHP);
raidboss.setCurrentMp(currentMP);
raidboss.setRaidStatus(StatusEnum.ALIVE);
_bosses.put(bossId, raidboss);
final StatsSet info = new StatsSet();
info.set("currentHP", currentHP);
info.set("currentMP", currentMP);
info.set("respawnTime", 0L);
_storedInfo.put(bossId, info);
}
}
else
{
final long spawnTime = respawnTime - Calendar.getInstance().getTimeInMillis();
_schedules.put(bossId, ThreadPoolManager.getInstance().scheduleGeneral(new SpawnSchedule(bossId), spawnTime));
}
_spawns.put(bossId, spawnDat);
if (storeInDb)
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
PreparedStatement statement = con.prepareStatement("INSERT INTO raidboss_spawnlist (boss_id,amount,loc_x,loc_y,loc_z,heading,respawn_time,currentHp,currentMp) VALUES(?,?,?,?,?,?,?,?,?)"))
{
statement.setInt(1, spawnDat.getId());
statement.setInt(2, spawnDat.getAmount());
statement.setInt(3, spawnDat.getX());
statement.setInt(4, spawnDat.getY());
statement.setInt(5, spawnDat.getZ());
statement.setInt(6, spawnDat.getHeading());
statement.setLong(7, respawnTime);
statement.setDouble(8, currentHP);
statement.setDouble(9, currentMP);
statement.execute();
}
catch (Exception e)
{
// problem with storing spawn
_log.log(Level.WARNING, getClass().getSimpleName() + ": Could not store raidboss #" + bossId + " in the DB:" + e.getMessage(), e);
}
}
// end custom
12 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.