Beispiel #1
0
        static void checkForCorruptedFireEvent()
        {
            var location = Game1.getLocationFromName("Custom_Ridgeside_RSVSpiritRealm");
            var modData  = location.modData;
            int counter  = 0;

            foreach (var key in modData.Keys)
            {
                if (key.StartsWith("cleansed"))
                {
                    counter++;
                }
            }

            if (Game1.player.team.SpecialOrderActive("RSV.UntimedSpecialOrder.SpiritRealmFlames"))
            {
                SpecialOrder corruptedFireQuest = Game1.player.team.specialOrders.Where(so => so.questKey.Equals("RSV.UntimedSpecialOrder.SpiritRealmFlames")).FirstOrDefault();
                if (corruptedFireQuest != null)
                {
                    corruptedFireQuest.objectives[0].currentCount.Value = counter;
                    corruptedFireQuest.CheckCompletion();
                }
            }

            if (counter >= 5)
            {
                var    events      = location.GetLocationEvents();
                string eventScript = null;
                foreach (var key in events.Keys)
                {
                    if (key.StartsWith("75160263"))
                    {
                        eventScript = events[key];
                    }
                }
                if (!String.IsNullOrEmpty(eventScript))
                {
                    if (Game1.player.eventsSeen.Contains(75160263))
                    {
                        return;
                    }
                    UtilFunctions.StartEvent(new Event(eventScript, 75160263), "Custom_Ridgeside_RSVSpiritRealm", 10, 10);
                }
                else
                {
                    Log.Error("Event not found");
                }
            }
        }