Beispiel #1
0
        private void SetHPS(CommandArgs args)
        {
            if (args.Parameters.Count < 2)
            {
                args.Player.SendMessage("Invalid usage: /regheal[/rh] [region name] [heal]", Color.Red);
            }
            else
            {
                string region = args.Parameters[0];
                int    health = 0;
                if (!int.TryParse(args.Parameters[1], out health))
                {
                    args.Player.SendMessage("You must specify health as a number of seconds between heart drops.", Color.Red);
                    return;
                }

                FlaggedRegion reg = regions.getRegion(region);
                if (reg == null)
                {
                    args.Player.SendMessage("Invalid region", Color.Red);
                    return;
                }

                args.Player.SendMessage(String.Format("HPS for {0} is now {1}", region, health), Color.Green);
                reg.setHPS(health);
                regions.UpdateRegion(reg.getRegion().Name);
            }
        }
Beispiel #2
0
        private void SetHPS(CommandArgs args)
        {
            if (args.Parameters.Count < 2)
            {
                args.Player.SendMessage("Invalid usage: /reghps(/rh) [region name] <hps>", Color.Red);
            }
            else
            {
                string region = args.Parameters[0];
                int    health = 0;
                if (!int.TryParse(args.Parameters[1], out health))
                {
                    args.Player.SendMessage("You must specify heart-drop period as a number.", Color.Red);
                    return;
                }

                FlaggedRegion reg = regions.getRegion(region);
                if (reg == null)
                {
                    args.Player.SendMessage("Invalid region", Color.Red);
                    return;
                }

                args.Player.SendMessage(String.Format("HPS for Region '{0}' is now {1}.", region, health), Color.Green);
                reg.setHPS(health);
                regions.UpdateRegion(reg.getRegion().Name);
            }
        }
 public void ImportRegion( string name, int flags, int d, int h, List<string> items )
 {
     var reg = TShock.Regions.GetRegionByName(name);
     if( reg == null )
     {
         Console.WriteLine( "{0} was not found in tshocks region list.", name);
         return;
     }
     FlaggedRegion f = new FlaggedRegion(reg, flags);
     f.setDPS( d );
     f.setHPS(h);
     f.setBannedItems(items);
     regions.Add( name, f );
 }
Beispiel #4
0
        public void ImportRegion(string name, int flags, int d, int h, List <string> items, Group tempGroup)
        {
            var reg = TShock.Regions.GetRegionByName(name);

            if (reg == null)
            {
                Console.WriteLine("{0} was not found in tshocks region list.", name);
                return;
            }
            FlaggedRegion f = new FlaggedRegion(reg, flags);

            f.setDPS(d);
            f.setHPS(h);
            f.setBannedItems(items);
            f.setTempGroup(tempGroup);
            regions.Add(name, f);
        }
Beispiel #5
0
        public void ImportRegion(string name, int flags, int d, int h, List <string> items)  // add string wid after name
        {
            //public List<Region> ListAllRegions(string worldid);
            //var rid = TShock.Regions.ListAllRegions(wid);
            var reg = TShock.Regions.GetRegionByName(name);

            //var regwid = TShock.Regions.GetRegionByWorldID(wid);
            if (reg == null) // && regwid == Main.worldID.ToString // add rid.Equals(Main.worldID)
            {
                //Console.ForegroundColor = ConsoleColor.Magenta;
                //Log.Error("Some regions were not found in this world.");

                //Console.WriteLine( "{0} was not found in region list.", name);
                return;
            }
            FlaggedRegion f = new FlaggedRegion(reg, flags);

            f.setDPS(d);
            f.setHPS(h);
            f.setBannedItems(items);
            regions.Add(name, f);
        }