L2JLisvus

Would you like to react to this message? Create an account in a few clicks or log in to continue.

2 posters

    mod annnounce Raid boss and Grand Boss

    SCRASH0
    SCRASH0


    Posts : 203
    Join date : 2019-03-07

    mod annnounce Raid boss and Grand Boss Empty mod annnounce Raid boss and Grand Boss

    Post  SCRASH0 2nd June 2019, 02:41

    Any good souls could adapt this mod?

    L2RaidBossInstance.java

    Code:
    Index: java/net/sf/l2j/gameserver/model/actor/instance/L2RaidBossInstance.java
    ===================================================================
    --- java/net/sf/l2j/gameserver/model/actor/instance/L2RaidBossInstance.java (revision 62)
    +++ java/net/sf/l2j/gameserver/model/actor/instance/L2RaidBossInstance.java (working copy)
    @@ -28,6 +28,7 @@
     import net.sf.l2j.gameserver.network.SystemMessageId;
     import net.sf.l2j.gameserver.network.serverpackets.PlaySound;
     import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
    +import net.sf.l2j.gameserver.util.Broadcast;
     import net.sf.l2j.util.Rnd;
     
     /**
    @@ -78,6 +79,11 @@
      final L2PcInstance player = killer.getActingPlayer();
      if (player != null)
      {
    + if (player.getClan() == null)
    + Broadcast.announceToOnlinePlayers("[Raid Boss]: "+getName() +" Foi morto por " + player.getName());
    + else
    + Broadcast.announceToOnlinePlayers("[Raid Boss]: "+getName() +" Foi morto por " + player.getName()+ " do clan: " + player.getClan().getName());
    + 
      broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.RAID_WAS_SUCCESSFUL));
      broadcastPacket(new PlaySound("systemmsg_e.1209"));


    GrandBossInstance.java

    Code:
    Index: java/net/sf/l2j/gameserver/model/actor/instance/L2GrandBossInstance.java
    ===================================================================
    --- java/net/sf/l2j/gameserver/model/actor/instance/L2GrandBossInstance.java (revision 62)
    +++ java/net/sf/l2j/gameserver/model/actor/instance/L2GrandBossInstance.java (working copy)
    @@ -21,6 +21,7 @@
     import net.sf.l2j.gameserver.network.SystemMessageId;
     import net.sf.l2j.gameserver.network.serverpackets.PlaySound;
     import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
    +import net.sf.l2j.gameserver.util.Broadcast;
     import net.sf.l2j.util.Rnd;
     
     /**
    @@ -55,6 +56,12 @@
      final L2PcInstance player = killer.getActingPlayer();
      if (player != null)
      {
    + if (player.getClan() == null)
    + Broadcast.announceToOnlinePlayers("[Grand Boss]: "+getName() +" Foi morto por " + player.getName());
    + else
    + Broadcast.announceToOnlinePlayers("[Grand Boss]: "+getName() +" Foi morto por " + player.getName()+ " do clan: " + player.getClan().getName());
    +
    +
      broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.RAID_WAS_SUCCESSFUL));
      broadcastPacket(new PlaySound("systemmsg_e.1209"));


    Raidboss Spawn


    Code:
    Index: java/net/sf/l2j/gameserver/instancemanager/RaidBossSpawnManager.java
    ===================================================================
    --- java/net/sf/l2j/gameserver/instancemanager/RaidBossSpawnManager.java (revision 62)
    +++ java/net/sf/l2j/gameserver/instancemanager/RaidBossSpawnManager.java (working copy)
    @@ -33,6 +33,7 @@
     import net.sf.l2j.gameserver.model.actor.instance.L2RaidBossInstance;
     import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
     import net.sf.l2j.gameserver.templates.StatsSet;
    +import net.sf.l2j.gameserver.util.Broadcast;
     import net.sf.l2j.gameserver.util.Util;
     import net.sf.l2j.util.Rnd;
     
    @@ -141,6 +142,8 @@
      
      _log.info("RaidBoss: " + raidboss.getName() + " has spawned.");
      
    +  Broadcast.announceToOnlinePlayers("[Raid Boss]: " + raidboss.getName() + " esta vivo!");
    +
      _bosses.put(bossId, raidboss);
      }
    improvise
    improvise


    Posts : 144
    Join date : 2017-07-21

    mod annnounce Raid boss and Grand Boss Empty Re: mod annnounce Raid boss and Grand Boss

    Post  improvise 26th June 2019, 15:27

    If you want to announce Raid Boss death and respawn much easier to do this:

    In gameserver\instancemanager\RaidBossSpawnManager.java

    find
    Code:
    import net.sf.l2j.L2DatabaseFactory;
    add after
    Code:
    import net.sf.l2j.gameserver.Announcements;
    find
    Code:
    GmListTable.broadcastMessageToGMs("Spawning Raid Boss " + raidboss.getName());
    add before
    Code:
    String nearestTown = MapRegionTable.getInstance().getClosestTownName(raidboss);
    add after
    Code:
    Announcements.getInstance().announceToAll("RaidBoss: " + raidboss.getName() + " " + raidboss.getLevel() + "lvl has spawned near " + nearestTown + "!");
    find
    Code:
    _log.info("RaidBossSpawnManager: Updated " + boss.getName() + " respawn time to " + respawnTime);
    add after
    Code:
    Announcements.getInstance().announceToAll("RaidBoss " + boss.getName() + " " + boss.getLevel() + "lvl was killed!");

    If you want to show respawn date do this:

    In gameserver\util\Util.java

    find
    Code:
    import java.util.Collection;
    add after
    Code:
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    add before file ending
    Code:
    public static String formatDate(Date date, String format)
     {
     final DateFormat dateFormat = new SimpleDateFormat(format);
     if (date != null)
     return dateFormat.format(date);
     
     return null;
     }
     
     public static String formatDate(long date, String format)
     {
     final DateFormat dateFormat = new SimpleDateFormat(format);
     if (date > 0)
     return dateFormat.format(date);
     
     return null;
     }

    In RaidBossSpawnManager.java
    find
    Code:
    import net.sf.l2j.util.Rnd;
    add after
    Code:
    import net.sf.l2j.gameserver.util.Util;
    find (this custom string was adder earlier)
    Code:
    Announcements.getInstance().announceToAll("RaidBoss " + boss.getName() + " " + boss.getLevel() + "lvl was killed!");
    add after
    Code:
    Announcements.getInstance().announceToAll("Respawn " + Util.formatDate(respawnTime, "d/MM/yyyy HH:mm"));

    So you will get this:
    mod annnounce Raid boss and Grand Boss Rb1010

    PS: Compiled and tested using build 617.
    SCRASH0
    SCRASH0


    Posts : 203
    Join date : 2019-03-07

    mod annnounce Raid boss and Grand Boss Empty Re: mod annnounce Raid boss and Grand Boss

    Post  SCRASH0 8th August 2019, 01:53

    improvise wrote:If you want to announce Raid Boss death and respawn much easier to do this:

    In gameserver\instancemanager\RaidBossSpawnManager.java

    find
    Code:
    import net.sf.l2j.L2DatabaseFactory;
    add after
    Code:
    import net.sf.l2j.gameserver.Announcements;
    find
    Code:
    GmListTable.broadcastMessageToGMs("Spawning Raid Boss " + raidboss.getName());
    add before
    Code:
    String nearestTown = MapRegionTable.getInstance().getClosestTownName(raidboss);
    add after
    Code:
    Announcements.getInstance().announceToAll("RaidBoss: " + raidboss.getName() + " " + raidboss.getLevel() + "lvl has spawned near " + nearestTown + "!");
    find
    Code:
    _log.info("RaidBossSpawnManager: Updated " + boss.getName() + " respawn time to " + respawnTime);
    add after
    Code:
    Announcements.getInstance().announceToAll("RaidBoss " + boss.getName() + " " + boss.getLevel() + "lvl was killed!");

    If you want to show respawn date do this:

    In gameserver\util\Util.java

    find
    Code:
    import java.util.Collection;
    add after
    Code:
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    add before file ending
    Code:
    public static String formatDate(Date date, String format)
     {
     final DateFormat dateFormat = new SimpleDateFormat(format);
     if (date != null)
     return dateFormat.format(date);
     
     return null;
     }
     
     public static String formatDate(long date, String format)
     {
     final DateFormat dateFormat = new SimpleDateFormat(format);
     if (date > 0)
     return dateFormat.format(date);
     
     return null;
     }

    In RaidBossSpawnManager.java
    find
    Code:
    import net.sf.l2j.util.Rnd;
    add after
    Code:
    import net.sf.l2j.gameserver.util.Util;
    find (this custom string was adder earlier)
    Code:
    Announcements.getInstance().announceToAll("RaidBoss " + boss.getName() + " " + boss.getLevel() + "lvl was killed!");
    add after
    Code:
    Announcements.getInstance().announceToAll("Respawn " + Util.formatDate(respawnTime, "d/MM/yyyy HH:mm"));

    So you will get this:
    mod annnounce Raid boss and Grand Boss Rb1010

    PS: Compiled and tested using build 617.


    OK.
    I had already fixed the raid boss.
    I want the grand boss's.
    I haven't adapted that part yet. of the big bosses


    I need to announce the grand boss

    Sponsored content


    mod annnounce Raid boss and Grand Boss Empty Re: mod annnounce Raid boss and Grand Boss

    Post  Sponsored content


      Current date/time is 16th October 2024, 21:58