Пример #1
0
        public Mission(GarrisonMission mission, bool completed=false)
        {
            refGarrisonMission = mission;
            Id = mission.Id;
            Name = mission.Name;
            Followers = mission.MaxFollowers;
            if (completed) return;


            foreach (var reward in mission.RewardRecords)
            {
                if (reward.CurrencyQuantity > 0)
                {
                    if ((int) reward.CurrencyType == 0)
                        RewardTypes |= RewardTypes.Gold;
                    else if (reward.CurrencyType == WoWCurrencyType.GarrisonResources)
                        RewardTypes |= RewardTypes.Garrison;
                    else if (reward.CurrencyType == WoWCurrencyType.ApexisCrystal)
                        RewardTypes |= RewardTypes.ApexisCrystal;
                    else if (reward.CurrencyType == WoWCurrencyType.HonorPoints)
                        RewardTypes |= RewardTypes.HonorPoints;
                    else if (reward.CurrencyType == WoWCurrencyType.SealOfTemperedFate)
                        RewardTypes |= RewardTypes.SealOfTemperedFate;
                }
                
                if (reward.FollowerXP>0)
                    RewardTypes |= RewardTypes.XP;

                if (reward.ItemId <= 0) continue;

                if (ItemIdReward == 0)
                    ItemIdReward = reward.ItemId;
                else
                    ItemIdReward2 = reward.ItemId;

                if (DictItemRewards_CharacterTokens.ContainsKey(reward.ItemId))
                    RewardTypes |= RewardTypes.CharacterToken;
                else if (ItemRewards_FollowerTokens.Contains(reward.ItemId))
                    RewardTypes |= RewardTypes.FollowerToken;
                else if (ItemRewards_FollowerRetraining.Contains(reward.ItemId))
                    RewardTypes |= RewardTypes.RetrainingCertificate;
                else if (ItemRewards_Contracts.Contains(reward.ItemId))
                    RewardTypes |= RewardTypes.FollowerContract;
                else if (ItemRewards_FollowerTraits.Contains(reward.ItemId))
                    RewardTypes |= RewardTypes.FollowerTrait;
                else if (ItemRewards_RushOrders.Contains(reward.ItemId))
                    RewardTypes |= RewardTypes.RushOrder;
                else if (ItemReward_AbrogatorStone==reward.ItemId)
                    RewardTypes |= RewardTypes.AbrogatorStone;
                else if (ItemReward_ElementalRune == reward.ItemId)
                    RewardTypes |= RewardTypes.ElementalRune;
                else if (ItemReward_SavageBlood == reward.ItemId)
                    RewardTypes |= RewardTypes.SavageBlood;
                else if (ItemReward_PrimalSpirit == reward.ItemId)
                    RewardTypes |= RewardTypes.PrimalSpirit;
                else
                    RewardTypes |= RewardTypes.Items;
            }

            var newMission = LuaCommands.GetMissionInfo(Id);
            Cost = newMission.Cost;
            Description = newMission.Description;
            Duration = newMission.Duration;
            ItemLevel = newMission.ItemLevel;
            Rare = newMission.Rare;
            Level = newMission.Level;
            Location = newMission.Location;
            Rewards = newMission.Rewards;
            State = newMission.State;
            Type = newMission.Type;
            Xp = newMission.Xp;
            Material = newMission.Material;
        }
Пример #2
0
        public Mission(int cost, string description, int durationSeconds, int level, int iLevel,
            bool isRare, string location, int missionId, string name, int numFollowers, int numRewards, int state,
            string type, string xp, string material, int garrisonReward, int xpReward, int goldReward, int apexisReward, int itemIdReward, int itemIdReward2, int currencyId, int currencyAmount)
        {
            Cost = cost;
            Description = description;
            Duration = durationSeconds;
            ItemLevel = iLevel;
            Rare = isRare;
            Level = level;
            Location = location;
            Id = missionId;
            Name = name;
            Followers = numFollowers;
            Rewards = numRewards;
            State = state;
            Type = type;
            Xp = xp.ToString();
            Material = material;
            //Abilities = abilities;
            GarrisonReward = garrisonReward;
            XpReward = xpReward;
            GoldReward = goldReward;
            ApexisReward = apexisReward;
            ItemIdReward = itemIdReward;
            ItemIdReward2 = itemIdReward2;

            if (GarrisonReward > 0) RewardTypes |= RewardTypes.Garrison;
            if (XpReward > 0) RewardTypes |= RewardTypes.XP;
            if (GoldReward > 0) RewardTypes |= RewardTypes.Gold;
            if (ApexisReward > 0) RewardTypes |= RewardTypes.ApexisCrystal;
            if (ItemIdReward > 0)
            {
                if (DictItemRewards_CharacterTokens.ContainsKey(ItemIdReward))
                    RewardTypes |= RewardTypes.CharacterToken;
                else if (ItemRewards_FollowerTokens.Contains(ItemIdReward))
                    RewardTypes |= RewardTypes.FollowerToken;
                else if (ItemRewards_FollowerRetraining.Contains(ItemIdReward))
                    RewardTypes |= RewardTypes.RetrainingCertificate;
                else if (ItemRewards_Contracts.Contains(ItemIdReward))
                    RewardTypes |= RewardTypes.FollowerContract;
                else if (ItemRewards_FollowerTraits.Contains(ItemIdReward))
                    RewardTypes |= RewardTypes.FollowerTrait;
                else if (ItemRewards_RushOrders.Contains(ItemIdReward))
                    RewardTypes |= RewardTypes.RushOrder;
            }
            if (ItemIdReward2 > 0)
            {
                if (DictItemRewards_CharacterTokens.ContainsKey(ItemIdReward2))
                    RewardTypes |= RewardTypes.CharacterToken;
                else if (ItemRewards_FollowerTokens.Contains(ItemIdReward2))
                    RewardTypes |= RewardTypes.FollowerToken;
                else if (ItemRewards_FollowerRetraining.Contains(ItemIdReward2))
                    RewardTypes |= RewardTypes.RetrainingCertificate;
                else if (ItemRewards_Contracts.Contains(ItemIdReward2))
                    RewardTypes |= RewardTypes.FollowerContract;
                else if (ItemRewards_FollowerTraits.Contains(ItemIdReward2))
                    RewardTypes |= RewardTypes.FollowerTrait;
                else if (ItemRewards_RushOrders.Contains(ItemIdReward2))
                    RewardTypes |= RewardTypes.RushOrder;
            }
            if (currencyId > 0)
            {
                if (currencyId == 994) RewardTypes |= RewardTypes.SealOfTemperedFate;
                if (currencyId == 392) RewardTypes |= RewardTypes.HonorPoints;
                //
            }
        }