Lineage 2

Siege Renewal aCis
  • Автор темы mikado
  • Дата начала

  • Уважаемые разработчики, у нас доступны дополнительные привелегии для пользователей в группе Разработчики. В случае, если Вы выкладываете свой проект - пожалуйста сообщите об этом Администратору и после проверки он с радостью выдаст Вам эти привелегии.
-50% На доступ к закрытому контенту, теперь и с PayPal
Получите доступ к закрытым ссылкам всего за 250 рублей на 14 дней! Этим вы поможете форуму и получите много полезной информации!
Обновление Осады
Reward Clan Winner, для лидеров клана / членов клана.

Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java (revision 84)
+++ java/net/sf/l2j/Config.java (working copy)


+   public static IntIntHolder[] REWARD_WINNER_SIEGE_CLAN;
+   public static IntIntHolder[] LEADER_REWARD_WINNER_SIEGE_CLAN;
 
 
 
+   REWARD_WINNER_SIEGE_CLAN = sieges.parseIntIntList("MembersRewardsID", "57-100");
+   LEADER_REWARD_WINNER_SIEGE_CLAN = sieges.parseIntIntList("LeaderRewardsID", "57-400");
     
     
        ===================================================================
--- java/net/sf/l2j/gameserver/configserver/model/entity/Siege.java (revision 0)
+++ java/net/sf/l2j/gameserver/configserver/model/entity/Siege.java (working copy)
@@ -0,0 +1,84 @@


    @Override
    public void endSiege()
    {
        if (!isInProgress())
            return;
     
        World.toAllOnlinePlayers(SystemMessage.getSystemMessage(SystemMessageId.SIEGE_OF_S1_HAS_ENDED).addString(_castle.getName()));
        World.toAllOnlinePlayers(new PlaySound("systemmsg_e.18"));
     
+       if (_castle.getOwnerId() > 0)
+       {
+           Clan clan = ClanTable.getInstance().getClan(_castle.getOwnerId());
+           World.toAllOnlinePlayers(SystemMessage.getSystemMessage(SystemMessageId.CLAN_S1_VICTORIOUS_OVER_S2_S_SIEGE).addString(clan.getName()).addString(_castle.getName()));
+           final List<String> playerIps = new ArrayList<>();
+           for (Player player : World.getInstance().getPlayers())
+           {
+               final String pIp = player.getClient().getConnection().getInetAddress().getHostAddress();
+            
+               if (!playerIps.contains(pIp))
+               {
+                   playerIps.add(pIp);
+                
+                   if (player.isClanLeader())
+                   {
+                       for (IntIntHolder reward : Config.LEADER_REWARD_WINNER_SIEGE_CLAN)
+                       {
+                           if (reward.getId() > 0)
+                               player.addItem("", reward.getId(), reward.getValue(), player, true);
+                       }
+                   }
+                   else
+                   {
+                       for (IntIntHolder reward : Config.REWARD_WINNER_SIEGE_CLAN)
+                       {
+                           if (reward.getId() > 0)
+                               player.addItem("", reward.getId(), reward.getValue(), player, true);  
+                       }
+                   }
+               }
+           }
            // An initial clan was holding the castle and is different of current owner.
            if (_formerOwner != null && clan != _formerOwner)
            {
                // Delete circlets and crown's leader for initial castle's owner (if one was existing)
                _castle.checkItemsForClan(_formerOwner);
             
                // Refresh hero diaries.
                for (ClanMember member : clan.getMembers())
                {
                    final Player player = member.getPlayerInstance();
                    if (player != null && player.isNoble())
                        HeroManager.getInstance().setCastleTaken(player.getObjectId(), _castle.getCastleId());
                }
            }
        }
        else
            World.toAllOnlinePlayers(SystemMessage.getSystemMessage(SystemMessageId.SIEGE_S1_DRAW).addString(_castle.getName()));
     
        // Cleanup clans kills/deaths counters, cleanup flag.
        for (Clan clan : _registeredClans.keySet())
        {
            clan.setSiegeKills(0);
            clan.setSiegeDeaths(0);
            clan.setFlag(null);
        }
     
        // Refresh reputation points towards siege end.
        updateClansReputation();
     
        // Teleport all non-owning castle players on second closest town.
        _castle.getSiegeZone().banishForeigners(_castle.getOwnerId());
     
        // Clear all flags.
        updatePlayerSiegeStateFlags(true);
     
        // Save castle specific data.
        saveCastleSiege(true);
     
        // Clear registered clans.
        clearAllClans();
     
        // Remove all towers from this castle.
        removeTowers();
     
        // Despawn guards or mercenaries.
        _castle.despawnSiegeGuardsOrMercenaries();
     
        // Respawn/repair castle doors.
        _castle.spawnDoors(false);
     
        _castle.getSiegeZone().setActive(false);
    }
#=============================================================
#                   Renewal Sieges
#=============================================================
# Reward Clan Winner, For Leaders clan/ members clan. Example : itemId-ItemCount;itemId-ItemCount;
LeaderRewardsID = 0-0;
MembersRewardsID = 0-0;