Jump to content
  • 0

How to make Raidboss Status in NPC (Alive-Dead)


Question

Posted (edited)

btw i using l2jserver6670

---------------------------

pls anyone how to make a code Raidboss status show in NPC  Alive and Dead

and how to make Show announce raidboss to spawn to all player online to know

 

i should start from where? please.

and Examp the code please?

if announce to all player how to do if this code for show in NPC?

-------------------------------

 

 

SpawnTable.getInstance().addNewSpawn(spawnDat, false);
        
        if ((respawnTime == 0L) || (time > respawnTime))
        {
            L2RaidBossInstance raidboss = null;
            
            if (bossId == 11111,22222,33333,44444,55555)
            {
                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);
            }
        }

Edited by aonniemnoi

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...