A Project for Chronicle 4 based on L2JServer.


    announce castle lord

    Share
    avatar
    jamaica

    Posts : 135
    Join date : 2013-02-24
    Age : 28
    Location : Romania

    announce castle lord

    Post  jamaica on 11th October 2013, 13:14

    some adaptation for this code?


    Code:
    dex: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
    ===================================================================
    --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
    +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
    @@ -36,6 +36,7 @@
     
     import net.sf.l2j.Config;
     import net.sf.l2j.L2DatabaseFactory;
    +import net.sf.l2j.gameserver.Announcements;
     import net.sf.l2j.gameserver.GameTimeController;
     import net.sf.l2j.gameserver.GeoData;
     import net.sf.l2j.gameserver.GmListTable;
    @@ -9985,6 +9986,35 @@
           return _duelState;
        }
        
       public void CastleLordsAnnouncements()
       {
          if (Config.Announcements_CastleLord)
              {
          if (isCastleLord(3))
          {      
          Announcements.getInstance().announceToAll("Castle Lord of Giran"+getName()+"is currently online");
          sendMessage("Welcome Lord "+getName()); 
          sendMessage("My lord There are "+L2World.getInstance().getAllPlayers().size()+" players online now");         
          }
          
          if (isCastleLord(1))
          {      
          Announcements.getInstance().announceToAll("Castle Lord of Gludio"+getName()+"is currently online");
          sendMessage("Welcome Lord "+getName()); 
          sendMessage("My lord There are "+L2World.getInstance().getAllPlayers().size()+" players online now");         
          }
       
          if (isCastleLord(2))
          {      
          Announcements.getInstance().announceToAll("Castle Lord of Dion"+getName()+"is currently online");
          sendMessage("Welcome Lord "+getName()); 
          sendMessage("My lord There are "+L2World.getInstance().getAllPlayers().size()+" players online now");         
          }
          
          if (isCastleLord(4))
          {      
          Announcements.getInstance().announceToAll("Castle Lord of Oren"+getName()+"is currently online");
          sendMessage("Welcome Lord "+getName()); 
          sendMessage("My lord There are "+L2World.getInstance().getAllPlayers().size()+" players online now");         
          }
          
          if (isCastleLord(5))
          {      
          Announcements.getInstance().announceToAll("Castle Lord of Aden"+getName()+"is currently online");
          sendMessage("Welcome Lord "+getName()); 
          sendMessage("My lord There are "+L2World.getInstance().getAllPlayers().size()+" players online now");         
          }

          if (isCastleLord(6))
          {      
          Announcements.getInstance().announceToAll("Castle Lord of Innadril"+getName()+"is currently online");
          sendMessage("Welcome Lord "+getName()); 
          sendMessage("My lord There are "+L2World.getInstance().getAllPlayers().size()+" players online now");         
          }
          
          if (isCastleLord(7))
          {      
          Announcements.getInstance().announceToAll("Castle Lord of Goddard"+getName()+"is currently online");
          sendMessage("Welcome Lord "+getName()); 
          sendMessage("My lord There are "+L2World.getInstance().getAllPlayers().size()+" players online now");         
          }
       
          if (isCastleLord(8))
          {      
          Announcements.getInstance().announceToAll("Castle Lord of Rune"+getName()+"is currently online");
          sendMessage("Welcome Lord "+getName()); 
          sendMessage("My lord There are "+L2World.getInstance().getAllPlayers().size()+" players online now");         
          }
          
          if (isCastleLord(9))
          {      
          Announcements.getInstance().announceToAll("Castle Lord of Schuttgart"+getName()+"is currently online");
          sendMessage("Welcome Lord "+getName()); 
          sendMessage("My lord There are "+L2World.getInstance().getAllPlayers().size()+" players online now");         
          }
              }
          }

        /**
         * Sets up the duel state using a non 0 duelId.
         * @param duelId 0=not in a duel
    Index: java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java
    ===================================================================
    --- java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java   
    +++ java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java   
    @@ -286,6 +287,7 @@
                    Hero.getInstance().getHeroes().containsKey(activeChar.getObjectId()))
                activeChar.setHero(true);
     
    +        activeChar.CastleLordsAnnouncements();
            setPledgeClass(activeChar);
    ===================================================================
    --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   
    +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
    @@ -1185,5 +1185,46 @@

    /** Alt Settings for devs */
        public static boolean ALT_DEV_NO_QUESTS;
        public static boolean ALT_DEV_NO_SPAWNS;

    +
    +  public static boolean Announcements_CastleLord;
    +
    /**
        * This class initializes all global variables for configuration.<br>
        * If key doesn't appear in properties file, a default value is setting on by this class.
        * @see #CONFIGURATION_FILE for configuring your server.
        */
        public static void load()

    @@ 1904,17 1904,138 @@

                    L2JMOD_WEDDING_SAMESEX                  = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingAllowSameSex", "False"));
                    L2JMOD_WEDDING_FORMALWEAR              = Boolean.parseBoolean(L2JModSettings.getProperty("WeddingFormalWear", "True"));
                    L2JMOD_WEDDING_DIVORCE_COSTS            = Integer.parseInt(L2JModSettings.getProperty("WeddingDivorceCosts", "20"));
    +
    +              Announcements_CastleLord                = Boolean.parseBoolean(L2JModSettings.getProperty("AnnouncementsCastleLords", "False"));
    +
                        if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
                    {
                        TVT_EVENT_ENABLED = false;
                        System.out.println("TvTEventEngine[Config.load()]: invalid config property -> TvTEventParticipationNpcId");
                    }

    Index: java/Config/L2jmods.Properties
    ===================================================================
    --- java/Config/L2jmods.Properties   
    +++ java/Config/L2jmods.Properties
    @@ -140,1 +140,1 @@

    +#==================================================
    +#          Castle Lords Announcements            =
    +#==================================================
    +#Set this options to true to enable Announcements.
    +AnnouncementsCastleLords = False
    avatar
    mystogan64

    Posts : 51
    Join date : 2013-10-04

    Re: announce castle lord

    Post  mystogan64 on 11th October 2013, 14:02

    Lets make it a little smaller code :)should we ?

    net.sf.l2j.Config.java
    Code:

    public static boolean ANNOUNCE_CASTLE_LORDS;

    ANNOUNCE_CASTLE_LORDS = Boolean.parseBoolean(customSettings.getProperty("AnnounceCastleLords", "False"));
    net.sf.l2j.gameserver.clientpackets.EnterWorld.java
    Code:

    import net.sf.l2j.gameserver.handler.AdminCommandHandler;
    +import net.sf.l2j.gameserver.instancemanager.CastleManager;

    import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
    +import net.sf.l2j.gameserver.model.entity.Castle;

    loadTutorial(activeChar);
    +if (Config.ANNOUNCE_CASTLE_LORDS)
    + {
    + notifyCastleOwner(activeChar);
    +}

    if (Config.GAMEGUARD_ENFORCE)
     {
     activeChar.sendPacket(new GameGuardQuery());
     }
     }
    +private void notifyCastleOwner(L2PcInstance activeChar)
    +{
    + L2Clan clan = activeChar.getClan();
    + if (clan != null)
    + {
    + if (clan.getHasCastle() > 0)
    + {
    + Castle castle = CastleManager.getInstance().getCastleById(clan.getHasCastle());
    + if ((castle != null) && (activeChar.getObjectId() == clan.getLeaderId()))
    + Announcements.getInstance().announceToAll("Lord " + activeChar.getName() + " Ruler Of " + castle.getName() + " Castle is now Online!");
    + }
    + }
    +}
    gameserver/configs/custom.properties
    Code:

    +# Announce castle lords on enter game. default = false
    +AnnounceCastleLords = True
    Have FUN!
    avatar
    jamaica

    Posts : 135
    Join date : 2013-02-24
    Age : 28
    Location : Romania

    Re: announce castle lord

    Post  jamaica on 11th October 2013, 14:36

    you are the man ! hope ppl will use my codes too which are reedited and adapted by u...thanks

    xbacox2010

    Posts : 41
    Join date : 2013-10-20

    Re: announce castle lord

    Post  xbacox2010 on 29th October 2013, 08:52

    how make it the clan name that take castle in siege?
    avatar
    jamaica

    Posts : 135
    Join date : 2013-02-24
    Age : 28
    Location : Romania

    Re: announce castle lord

    Post  jamaica on 29th October 2013, 09:24

    xbacox2010 wrote:how make it the clan name that take castle in siege?

    ?????

    xbacox2010

    Posts : 41
    Join date : 2013-10-20

    Re: announce castle lord

    Post  xbacox2010 on 30th October 2013, 01:50

    sorry i use incorrect words that i am try saying...with this code can i see that clan take castle in siege or not?
    for example "Announcement Clan L2jlisvus take Giran Castle"
    avatar
    jamaica

    Posts : 135
    Join date : 2013-02-24
    Age : 28
    Location : Romania

    Re: announce castle lord

    Post  jamaica on 30th October 2013, 07:52

    nop this code announce only when a clan leader is logging on that one with clan X captured castle Y is already implemented in server

    Sponsored content

    Re: announce castle lord

    Post  Sponsored content


      Current date/time is 24th September 2017, 09:48