Пример #1
0
        public void SiegeEnd(bool trigger)
        {
            isActive = false;
            Message("Siege of " + name + " is over.");
            if (trigger)
            {
                Message("Nobody won! " + name + " belong to NPC until next siege.");
            }
            else
            {
                double dmg      = 0;
                int    tmClanId = 0;
                foreach (int clanId in clanDamage.Keys)
                {
                    if (clanDamage[clanId] > dmg)
                    {
                        dmg      = clanDamage[clanId];
                        tmClanId = clanId;
                    }
                }

                if (tmClanId > 0)
                {
                    L2Clan cl = ClanTable.getInstance().getClan(tmClanId);
                    Message("Now its belong to: '" + cl.Name + "' until next siege.");
                    bool captured = false; //todo

                    if (captured)
                    {
                        cl.UpdatePledgeNameValue(ReputationCapture);
                        //Your clan has added $1s points to its clan reputation score.
                        cl.broadcastToMembers(new SystemMessage(1781).addNumber(ReputationCapture));
                    }
                    else
                    {
                        cl.UpdatePledgeNameValue(ReputationNothing);
                        //Your clan's newly acquired contested clan hall has added $s1 points to your clan's reputation score.
                        cl.broadcastToMembers(new SystemMessage(1774).addNumber(ReputationNothing));
                    }
                }
                else
                {
                    Message("Nobody won! " + name + " belong to NPC until next siege.");
                    trigger = true;
                }
            }

            foreach (L2Character o in mobActive)
            {
                ((L2Character)o).DeleteByForce();
            }
        }
Пример #2
0
        public void SiegeEnd(bool trigger)
        {
            IsActive = false;
            Message($"Siege of {Name} is over.");
            if (trigger)
            {
                Message($"Nobody won! {Name} belong to NPC until next siege.");
            }
            else
            {
                double dmg      = 0;
                int    tmClanId = 0;
                foreach (int clanId in ClanDamage.Keys.Where(clanId => ClanDamage[clanId] > dmg))
                {
                    dmg      = ClanDamage[clanId];
                    tmClanId = clanId;
                }

                if (tmClanId > 0)
                {
                    L2Clan cl = ClanTable.Instance.GetClan(tmClanId);
                    Message($"Now its belong to: '{cl.Name}' until next siege.");
                    bool captured = false; //todo

                    if (captured)
                    {
                        cl.UpdatePledgeNameValue(ReputationCapture);
                        cl.BroadcastToMembers(new SystemMessage(SystemMessage.SystemMessageId.ClanAddedS1SPointsToReputationScore).AddNumber(ReputationCapture));
                    }
                    else
                    {
                        cl.UpdatePledgeNameValue(ReputationNothing);
                        cl.BroadcastToMembers(new SystemMessage(SystemMessage.SystemMessageId.ClanAcquiredContestedClanHallAndS1ReputationPoints).AddNumber(ReputationNothing));
                    }
                }
                else
                {
                    Message($"Nobody won! {Name} belong to NPC until next siege.");
                    //trigger = true;
                }
            }

            _mobActive.ForEach(o => o.DeleteByForce());
        }