Ejemplo n.º 1
0
        public MobileParty spawnPatrol(Settlement settlement, Clan clan, int amount)
        {
            PartyTemplateObject partyTemplate = clan.Culture.DefaultPartyTemplate;
            int numberOfCreated = partyTemplate.NumberOfCreated;

            partyTemplate.IncrementNumberOfCreated();
            MobileParty mobileParty = MBObjectManager.Instance.CreateObject <MobileParty>(clan.StringId + "_" + numberOfCreated);

            TextObject textObject;

            textObject = new TextObject("{BASILPATROL_SETTLEMENT_NAME} Patrol", null);
            textObject.SetTextVariable("BASILPATROL_SETTLEMENT_NAME", settlement.Name);
            mobileParty.InitializeMobileParty(textObject, partyTemplate, settlement.GatePosition, 0, 0, 0, rand.Next((int)(amount * 0.9), (int)Math.Ceiling((amount + 1) * 1.1)));
            InitPatrolParty(mobileParty, textObject, clan, settlement);
            mobileParty.Aggressiveness = 1f;
            mobileParty.SetMovePatrolAroundSettlement(settlement);
            return(mobileParty);
        }
Ejemplo n.º 2
0
        public MobileParty spawnRecruiter(Settlement settlement, int cash, RecruiterProperties props)
        {
            PartyTemplateObject defaultPartyTemplate = settlement.Culture.DefaultPartyTemplate;
            int numberOfCreated = defaultPartyTemplate.NumberOfCreated;

            defaultPartyTemplate.IncrementNumberOfCreated();
            MobileParty mobileParty = MBObjectManager.Instance.CreateObject <MobileParty>(settlement.OwnerClan.StringId + "_" + numberOfCreated);
            TextObject  textObject  = new TextObject("{RECRUITER_SETTLEMENT_NAME} Recruiter", null);

            textObject.SetTextVariable("RECRUITER_SETTLEMENT_NAME", settlement.Name);
            mobileParty.InitializeMobileParty(textObject, defaultPartyTemplate, settlement.GatePosition, 0f, 0f, MobileParty.PartyTypeEnum.Default, 1);
            mobileParty.PartyTradeGold = cash;
            this.InitRecruiterParty(mobileParty, textObject, settlement.OwnerClan, settlement);
            mobileParty.Aggressiveness = 0f;
            props.party = mobileParty;
            recruiterProperties.Add(props);
            mobileParty.SetMoveGoToSettlement(findNearestSettlementWithRecruitableRecruits(mobileParty));
            return(mobileParty);
        }