Example #1
0
        public void OnBodTurnIn(PlayerMobile pm, FestivalElf elf, double points)
        {
            if (PointTable.ContainsKey(pm))
            {
                PointTable[pm] += points;
            }
            else
            {
                PointTable[pm] = points;
            }

            var toNext = PointsToNext;

            if (toNext == -1)
            {
                return;
            }

            double perc = PointsThisStage / PointsToNext;

            if (perc >= 1.0)
            {
                elf.Say(1157164, string.Format("{0}\t#{1}", pm.Name, CityLoyaltySystem.GetCityLocalization(CurrentCity)), 1150); // ~1_PLAYER~ has advanced the Artisan Festival in the City of ~2_CITY~!

                TownTree.Stage++;
                FireworkShow(elf);
            }
            else
            {
                int loc;

                if (perc < .25)
                {
                    loc = 1159273; // There is quite a ways to go before the tree will grow!
                }
                else if (perc < .50)
                {
                    loc = 1159277; // The tree is about a quarter of the way before it will grow!
                }
                else if (perc < .75)
                {
                    loc = 1159276; // The tree is about half way before it will grow!
                }
                else if (perc < .90)
                {
                    loc = 1159275; // The tree is about a three-quarters of the way before it will grow!
                }
                else
                {
                    loc = 1159274; // The tree is very close to being ready to grow!
                }

                Timer.DelayCall(() => elf.Say(loc, 1150));
            }
        }
Example #2
0
        private void GenerateStageDecoration()
        {
            if (Winners != null)
            {
                Winners.Clear();
            }

            if (PointTable != null)
            {
                PointTable.Clear();
            }

            if (RewardBag != null)
            {
                RewardBag.Delete();
                RewardBag = null;
            }

            var map      = Siege.SiegeShard ? Map.Felucca : Map.Trammel;
            int treeType = 1;

            switch (CurrentCity)
            {
            case City.Trinsic: treeType = 2; break;

            case City.Britain:
            case City.NewMagincia: treeType = 3; break;

            case City.Minoc: treeType = 4; break;
            }

            if (TownTree != null)
            {
                TownTree.Delete();
            }

            TownTree = new TownTree(treeType);
            TownTree.MoveToWorld(_CityLocations[Stage], map);

            if (Elf == null)
            {
                Elf = new FestivalElf();
            }

            var p = new Point3D(TownTree.X + Utility.RandomMinMax(-1, 1), TownTree.Y + Utility.RandomMinMax(-1, 1), TownTree.Z);

            Elf.MoveToWorld(p, map);
            Elf.Home      = p;
            Elf.RangeHome = 5;
        }