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; }
protected override void Remove() { Utility.WriteConsoleColor(ConsoleColor.Green, string.Format("{0} Disabled!", Name)); EndTimer(); Stage = -1; NextStage = DateTime.MinValue; if (Elf != null) { Elf.Delete(); Elf = null; } if (Winners != null) { Winners.Clear(); Winners = null; } if (TownTree != null) { TownTree.Delete(); TownTree = null; } if (RewardBag != null) { RewardBag.Delete(); RewardBag = null; } ColUtility.Free(_CityOrder); _CityOrder = null; Running = false; }