Control events in the boss that ends the instance?

walker975

Vassal
Customer
Following the tutorial here on the forum, I managed to control the events of the mobs in the instance with this code, how can I control the events of the boss that ends the instance? which has the ReflectionBoss tag, to globally announce that it was killed by the player, I would also like it to be 2 minutes to close the instance, not 5 as it is original

package l2.gameserver.model.instances;

import l2.gameserver.Announcements;
import l2.gameserver.model.Creature;
import l2.gameserver.templates.npc.NpcTemplate;

public class EventReflectionMobInstance extends MonsterInstance {

public EventReflectionMobInstance(int i, NpcTemplate npcTemplate) {
super(i, npcTemplate);
}

protected void messageDeath(Creature killer, String name) {
String clanName = killer.getClan().getName();
String message;
if (clanName != null) {
message = "Dimensional Boss: " + name + " was killed by " + killer.getName() + " clan " + clanName;
} else {
message = "Dimensional Boss: " + name + " was killed by " + killer.getName();
}
Announcements.getInstance().announceToAll(message);
}

@Override
protected void onDeath(Creature killer) {
super.onDeath(killer);
switch (getNpcId()) {
case 25657, 25658:
messageDeath(killer, getName());
break;
}
}
}
 
1
Java:
    @Override
    protected void onEvtDead(Creature killer)
    {
        NpcInstance actor = getActor();
        Reflection r = actor.getReflection();
        List<Player> players = r.getPlayers();
        for(Player p : players)
            p.sendPacket(new ExShowScreenMessage("Finish, instance collapse.", 3000, ScreenMessageAlign.TOP_CENTER, true));
        r.startCollapseTimer(5 * 1000L); // 5 sec to collapse the instance
        super.onEvtDead(killer);
    }
2
Java:
  @Override
  protected void onDeath(Creature killer)
  {
    Reflection r = getReflection();
    List<Player> players = r.getPlayers();
    for(Player p : players)
      p.sendPacket(new ExShowScreenMessage("Finish, instance collapse.", 3000, ExShowScreenMessage.ScreenMessageAlign.TOP_CENTER, true));
    r.startCollapseTimer(5 * 1000L); // 5 sec to collapse the instance
    super.onDeath(killer);
  }
 
1
Java:
    @Override
    protected void onEvtDead(Creature killer)
    {
        NpcInstance actor = getActor();
        Reflection r = actor.getReflection();
        List<Player> players = r.getPlayers();
        for(Player p : players)
            p.sendPacket(new ExShowScreenMessage("Finish, instance collapse.", 3000, ScreenMessageAlign.TOP_CENTER, true));
        r.startCollapseTimer(5 * 1000L); // 5 sec to collapse the instance
        super.onEvtDead(killer);
    }
2
Java:
  @Override
  protected void onDeath(Creature killer)
  {
    Reflection r = getReflection();
    List<Player> players = r.getPlayers();
    for(Player p : players)
      p.sendPacket(new ExShowScreenMessage("Finish, instance collapse.", 3000, ExShowScreenMessage.ScreenMessageAlign.TOP_CENTER, true));
    r.startCollapseTimer(5 * 1000L); // 5 sec to collapse the instance
    super.onDeath(killer);
  }
Thanks, it worked!

is there any way for the EventReflectionMob monsters to drop the items from the ground? not directly to the character, because my instance that I'm creating is made in part, its dynamics depends on the items falling to the ground
 
Back
Top