Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 98
» Latest member: shigwegi
» Forum threads: 15
» Forum posts: 39

Full Statistics

Online Users
There are currently 8 online users.
» 0 Member(s) | 8 Guest(s)

Latest Threads
Safe Zones
Forum: Reign of Kings
Last Post: shigwegi
06-30-2015, 03:01 PM
» Replies: 10
» Views: 1,238
PS4 ESO anyone playing?
Forum: The Common Area
Last Post: Kangsta
06-22-2015, 09:01 AM
» Replies: 0
» Views: 650
Ultima Online Server
Forum: Announcements
Last Post: Kangsta
06-22-2015, 08:53 AM
» Replies: 3
» Views: 398
Kang chks in. TR#1
Forum: The Common Area
Last Post: Hawthorne
06-21-2015, 10:50 PM
» Replies: 2
» Views: 709
Blasphemy
Forum: The Common Area
Last Post: Hawthorne
06-21-2015, 10:49 PM
» Replies: 2
» Views: 627
Auto whitelist
Forum: Game Programming and Modding
Last Post: Hawthorne
05-31-2015, 01:39 AM
» Replies: 1
» Views: 641
Attack Schedule (Game tim...
Forum: Reign of Kings
Last Post: Hawthorne
05-30-2015, 06:10 PM
» Replies: 4
» Views: 867
Updated ROK Server
Forum: Reign of Kings
Last Post: Hawthorne
05-30-2015, 01:45 PM
» Replies: 0
» Views: 655
TR #1!
Forum: The Common Area
Last Post: Hawthorne
05-24-2015, 05:19 PM
» Replies: 1
» Views: 4,723
New system going up.
Forum: Announcements
Last Post: Erdrick{TR}
05-23-2015, 04:17 PM
» Replies: 1
» Views: 1,670

 
  Ultima Online Server
Posted by: Hawthorne - 06-17-2015, 05:23 AM - Forum: Announcements - Replies (3)

I have placed an Ultima Online server on Theregulators.org port 2593
You can download the client from : http://uoredemption.com/upload/UOClassicSetup_7_0_15_1.exe
You can use a connection tool like Razor to connect: http://www.uogamers.com/razor/ or UOSteam: http://uoredemption.com/upload/UOSteam104.exe

It's a fully populated server as far as encounters and items and rules are pretty much like the dread lord days minus stat loss. If you are looking for that old school fix have at it!

Hawthorne

Print this item

  Updated ROK Server
Posted by: Hawthorne - 05-30-2015, 01:45 PM - Forum: Reign of Kings - No Replies

The Regulators ROK server has been updated to Alpha 14. All mods have been ported to 14. You can connect on 174.136.95.117 or theregulators.org

All scripts are running, if you need something scripted for your server please send Hawthorne a PM.

Print this item

  Safe Zones
Posted by: Hawthorne - 05-23-2015, 09:35 PM - Forum: Reign of Kings - Replies (10)

Here is a Safe Zones script that will allow you to mark a location and assign a radius to it. No PVP or CUBE damange can take place in that area. You can have multiple marks using the following commands:

mark add
mark list
mark remove

Code:
using System;
using System.Collections.Generic;
using CodeHatch.Build;
using CodeHatch.Engine.Networking;
using CodeHatch.Networking.Events.Entities;
using CodeHatch.Networking.Events.Players;
using CodeHatch.Engine.Core.Cache;
using UnityEngine;
using CodeHatch.Blocks.Networking.Events;
using LitJson;
using CodeHatch.Networking.Events;

namespace Oxide.Plugins
{
    //Need a Script?
    //Patrick Shearon aka Hawthorne
    //www.theregulators.org
    //pat.shearon@gmail.com
    //05-21-2015
    [Info("SafeZones", "Hawthorne", "1.2")]
    public class SafeZones : ReignOfKingsPlugin
    {
        public class MarkClass
        {
            public int x { get; set; }
            public int z { get; set; }
            public float radius { get; set; }
            public bool noAttack { get; set; }
            public MarkClass(int x, int z, float radius, bool noAttack)
            {
                this.x = x;
                this.z = z;
                this.radius = radius;
                this.noAttack = noAttack;
            }

        }        
        static List<MarkClass> marks = new List<MarkClass>();
        #region Helpers
        
        void Log(string msg) => Puts($"{Title} : {msg}");
        void Warning(string msg) => PrintWarning($"{Title} : {msg}");

        void Loaded()
        {           
            EventManager.Subscribe<PlayerCaptureEvent>(new EventSubscriber<PlayerCaptureEvent>(OnPlayerCapture));            
            EventManager.Subscribe<PlayerCaptureConfirmEvent>(new EventSubscriber<PlayerCaptureConfirmEvent>(OnPlayerCaptureConfirm));            
            List<object> data =  GetConfigValue("MarkSettings", "Marks", marks) as List<object>;     
            marks = new List<MarkClass>();
            foreach(object o in data)
            {
                Dictionary<string, object> d = (Dictionary<string, object>)o;               

                foreach(var pair in d)
                {
                    var key = pair.Key;
                    var value = pair.Value;
                    Warning(key + " " + value);
                }
                marks.Add(new MarkClass(Convert.ToInt32(d["x"]),Convert.ToInt32(d["z"]),Convert.ToSingle(d["radius"]),Convert.ToBoolean(d["noAttack"])));
            }
            Warning( marks.Count + " safe zone markers loaded.");          
        }


        protected override void LoadDefaultConfig()
        {            
            Warning("New mark configuration file created.");
        }
    
        private void SaveMarkData()
        {
            SaveConfigValue("MarkSettings", "Marks", marks);
            Warning("Saving marks.");
            SaveConfig();
        }
        void SaveConfigValue(string category, string setting, object value)
        {
            var data = Config[category] as Dictionary<string, object>;                
            data[setting] = value;
        }

        object GetConfigValue(string category, string setting, object defaultValue)
        {
            var data = Config[category] as Dictionary<string, object>;
            object value;
            if (data == null)
            {
                data = new Dictionary<string, object>();
                Config[category] = data;
            }
            if (!data.TryGetValue(setting, out value))
            {
                value = defaultValue;
                data[setting] = value;
            }
            
            return value;
        }

        private void ShowUsage(Player player)
        {
            PrintToChat(player, "[FF9900]Safe Zones by Hawthorne (www.theregulators.org).");
            PrintToChat(player, "This script will allow you to mark an area where players and objects can't be attacked.");
            PrintToChat(player, "USAGE:");
            PrintToChat(player, "mark add radius - [CCCCCC]adds a mark at your loaction for the radius you define.");
            PrintToChat(player, "mark list - [CCCCCC]shows all marks.");
            PrintToChat(player, "mark remove markid - [CCCCCC]removes a mark by id as shown in the mark list.");
        }
        bool HasPermission(Player player, string perm = null)
        {
            var user =  Server.Permissions.GetUser(player.Name);
            return user != null && user.HasGroup(perm);
        }
        #endregion
 
        [ChatCommand("mark")]
        private void MarkCommand(Player player, string cmd, string[] args)
        {
            if(!Server.Permissions.GetUser(player.Name).HasGroup("admin"))            
                return;
            if (args.Length < 1)
            {
                ShowUsage(player);
                return;
            }
            switch (args[0].ToLower())
            {
                case "remove":
                    {
                        if (args.Length < 2)
                        {
                            ShowUsage(player);
                            return;
                        }
                        marks.RemoveAt(Convert.ToInt32(args[1]));
                        SaveMarkData();
                    }
                    break;
                case "add":
                    {
                        marks.Add(new MarkClass((int)player.Entity.Position.x,(int)player.Entity.Position.z,Convert.ToSingle(args[1]),true));
                        SaveMarkData();
                        PrintToChat(player, "[00FF00]Mark Added.");
                    }
                    break;
                case "list":
                    {
                        int x=0;
                        foreach (MarkClass mc in marks)
                        {
                            PrintToChat(player, string.Format("{3}) X: {0} Z: {1} RADIUS: {2}", mc.x,mc.z,mc.radius,x));
                            x++;
                        }
                    }
                    break;
            }

           
        }
        

        [ChatCommand("loc")]
        private void LocationCommand(Player player, string cmd, string[] args)
        {
            PrintToChat(player, string.Format("Current Location: x:{0} y:{1} z:{2}", player.Entity.Position.x.ToString(), player.Entity.Position.y.ToString(), player.Entity.Position.z.ToString()));
        }
        private void OnCubeTakeDamage(CubeDamageEvent cubeDamageEvent)
        {
            if (cubeDamageEvent.Entity.IsPlayer & (cubeDamageEvent.Entity != cubeDamageEvent.Damage.DamageSource) & cubeDamageEvent.Damage.DamageSource.IsPlayer)
            {
                foreach (MarkClass mc in marks)
                {
                    float distance = Math.Abs(Vector2.Distance(new Vector2(mc.x,mc.z), new Vector2(cubeDamageEvent.Entity.Position.x, cubeDamageEvent.Entity.Position.z)));
                    if (distance <= mc.radius & mc.noAttack)
                    {
                        cubeDamageEvent.Cancel("No attack area");
                        cubeDamageEvent.Damage.Amount = 0f;
                        PrintToChat(cubeDamageEvent.Damage.DamageSource.Owner, "[FF0000]You can't attack an object in this area.");
                    }
                }
            }
        }
        private void OnEntityHealthChange(EntityDamageEvent damageEvent)
        {
            if (damageEvent.Entity.IsPlayer & (damageEvent.Entity != damageEvent.Damage.DamageSource) & damageEvent.Damage.DamageSource.IsPlayer)
            {
                foreach (MarkClass mc in marks)
                {                    
                    float distance = Math.Abs(Vector2.Distance(new Vector2(mc.x,mc.z), new Vector2(damageEvent.Entity.Position.x, damageEvent.Entity.Position.z)));                    
                    if (distance <= mc.radius & mc.noAttack)
                    {
                        damageEvent.Cancel("No attack area");
                        damageEvent.Damage.Amount = 0f;                        
                        PrintToChat(damageEvent.Damage.DamageSource.Owner, "[FF0000]You can't attack a person in this area.");
                    }
                }
            }
        }
        private void OnPlayerCaptureConfirm(PlayerCaptureConfirmEvent theEvent)
        {
            foreach (MarkClass mc in marks)
            {                    
                float distance = Math.Abs(Vector2.Distance(new Vector2(mc.x,mc.z), new Vector2(theEvent.TargetEntity.Position.x, theEvent.TargetEntity.Position.z)));                    
                if (distance <= mc.radius & mc.noAttack)
                {
                    theEvent.Cancel("No attack area");        
                    theEvent.TargetEntity = null;
                    theEvent.Target = null;

                }
            }
        }

        private void OnPlayerCapture(PlayerCaptureEvent theEvent)
        {
            if (theEvent.Sender.IsClient)
            {
                foreach (MarkClass mc in marks)
                {                    
                    float distance = Math.Abs(Vector2.Distance(new Vector2(mc.x,mc.z), new Vector2(theEvent.Sender.Entity.Position.x, theEvent.Sender.Entity.Position.z)));                    
                    if (distance <= mc.radius & mc.noAttack)
                    {
                        theEvent.Cancel("No attack area");        
                        theEvent.TargetEntity = null;
                        theEvent.Target = null;
                        PrintToChat(theEvent.Sender, "[FF0000]You can't capture a person in this area.");
                    }
                }
            }
       
        }   

        

    }
}



Attached Files
.cs   SafeZones.cs (Size: 9.55 KB / Downloads: 21)
Print this item

  Attack Schedule (Game time or World time)
Posted by: Hawthorne - 05-22-2015, 04:44 PM - Forum: Reign of Kings - Replies (4)

Here is a script I made for Reign of Kings that will allow you to restrict attacking to in game or real world time.
You can have the script warn, kick or ban after so many kicks.

Update:
Added application rules so that rule will apply to either players or structures or both.

Update 1.2: Fixed Game time issues.
Update 1.3: fixed midnight conversion issue.
Update 1.4: fixed null evaluation error on startup.
Have Fun!

Code:
using System;

using System.Collections.Generic;
using CodeHatch.Build;
using CodeHatch.Engine.Networking;
using CodeHatch.Networking.Events.Entities;
using CodeHatch.Networking.Events.Players;
using CodeHatch.Engine.Core.Cache;
using UnityEngine;
using CodeHatch.Engine.Core.Networking;
using CodeHatch.Blocks.Networking.Events;
using System.Linq;

namespace Oxide.Plugins
{
    //Need a Script?
    //Patrick Shearon aka Hawthorne
    //www.theregulators.org
    //pat.shearon@gmail.com
    //05-22-2015
    [Info("AttackSchedule", "Hawthorne", "1.4")]
    public class AttackSchedule : ReignOfKingsPlugin
    {
        public class KickData
        {
            public int count = 0;
            public Player player;
        }
        public static List<KickData> kickCounter = new List<KickData>();

        public enum Time
        {
            Game,
            World
        }
        public enum Applications
        {
            Structures,
            Players,
            Both
        }
        public enum Action
        {
            Warn,
            Kick,
            BanAfterWarn
        }
 
        //Set to use game time or world time
        Time timeToUse = Time.Game;
        //Set action to take when rule is broken.
        Action actionToTake = Action.Warn;
        //Set which objects this applis to
        Applications applications = Applications.Both;
        //Set warning message
        string warningMessage = "[FF0000]No attacking allowed at this time.";
        //If a player gets kicked this many times they will be banned.
        int KickTimesBeforeBan = 5;
        //Set start and end time
        TimeSpan startTime = new TimeSpan(7, 0, 0); //6PM START
        TimeSpan endTime = new TimeSpan(9, 0, 0); //2AM STOP
        //Announcement settings
        float CheckInterval = 120; //Seconds
        string lastMessage = "";

        #region Helpers                
        
        void Warning(string msg) => PrintWarning($"{Title} : {msg}");
      
 
        #endregion
        
  
        void Loaded()
        {
            //Setup announcements for countdowns.
            timer.Repeat(CheckInterval, 0, () => BroadcastCountdown());
        }

        public void BroadcastCountdown()
        {
        }

        bool TimeBetween(TimeSpan start, TimeSpan end)
        {
            
            TimeSpan now = DateTime.Now.TimeOfDay;
            if (timeToUse == Time.Game)
            {
                
                int hour = Convert.ToInt32(GameClock.Instance.TimeOfDayAsClockString().Split(':')[0]);                
                int min = Convert.ToInt32(GameClock.Instance.TimeOfDayAsClockString().Split(':')[1].Split(' ')[0]);
                string AMPM = GameClock.Instance.TimeOfDayAsClockString().Split(' ')[1];                
                DateTime temp = Convert.ToDateTime(DateTime.Now.ToShortDateString()+ " " + hour +":"+min+":00 " + AMPM);
                now = temp.TimeOfDay;

            }
            if (start < end)
                return start <= now && now <= end;
            return !(end < now && now < start);
        }
        void ApplyRules(Entity entity)
        {
            if (actionToTake == Action.Warn & entity.IsPlayer)
            {
                PrintToChat(entity.Owner, warningMessage);
            }
            if (actionToTake == Action.Kick & entity.IsPlayer)
            {
                Server.Kick(entity.Owner, warningMessage);
            }
            if (actionToTake == Action.BanAfterWarn & entity.IsPlayer)
            {
                PrintToChat(entity.Owner, warningMessage);
                KickData kickData = kickCounter.FirstOrDefault(k => k.player == entity.Owner);
                if (kickData == null)
                {
                    kickData = new KickData();
                    kickData.player = entity.Owner;
                    kickCounter.Add(kickData);
                }

                kickData.count++;
                PrintToChat(entity.Owner, "WARNING YOU WILL BE BANNED.");
                if (kickData.count >= 5)
                    Server.Ban(entity.Owner, warningMessage);
            }
        }
        private void OnEntityHealthChange(EntityDamageEvent damageEvent)
        {            
            if(damageEvent.Entity != null & damageEvent.Damage.DamageSource !=null)
            {
                if (damageEvent.Entity.IsPlayer & !TimeBetween(startTime, endTime))
                {
                    if (!damageEvent.Damage.DamageSource.IsPlayer | damageEvent.Damage.DamageSource.Owner == damageEvent.Entity.Owner)
                        return;
                    damageEvent.Cancel("No damage area");
                    damageEvent.Damage.Amount = 0f;
                    if(applications == Applications.Both | applications == Applications.Players)
                        ApplyRules(damageEvent.Damage.DamageSource);
                    return;
                }
            }
        }
        private void OnCubeTakeDamage(CubeDamageEvent cubeDamageEvent)
        {            
            if (!TimeBetween(startTime, endTime))
            {
                if (!cubeDamageEvent.Damage.DamageSource.IsPlayer)
                    return;
                cubeDamageEvent.Damage.Amount = 0;
                cubeDamageEvent.Cancel("No damage area");
                if (applications == Applications.Both | applications == Applications.Structures)
                    ApplyRules(cubeDamageEvent.Damage.DamageSource);
                return;
            }
        }
    }
}



Attached Files
.cs   AttackSchedule.cs (Size: 5.57 KB / Downloads: 4)
Print this item

  ROK C# Template
Posted by: Hawthorne - 05-22-2015, 04:27 AM - Forum: Reign of Kings - No Replies

Code:
using System;
using System.Collections.Generic;
using CodeHatch.Build;
using CodeHatch.Engine.Networking;
using CodeHatch.Networking.Events.Entities;
using CodeHatch.Networking.Events.Players;
using CodeHatch.Engine.Core.Cache;
using UnityEngine;
using CodeHatch.Engine.Core.Networking;
using CodeHatch.Blocks.Networking.Events;

namespace Oxide.Plugins
{
   //Need a Script?
   //Patrick Shearon aka Hawthorne
   //www.theregulators.org
   //pat.shearon@gmail.com
   //05-21-2015
   [Info("Template", "Hawthorne", "1.0.")]
   public class Template : ReignOfKingsPlugin
   {
       private void init()
       {
       }

       private void Unload()
       {
       }

       private void LoadDefaultConfig()
       {
       }

       private void OnServerInitialized()
       {
       }

       private void OnTerrainInitialized()
       {
       }

       private void OnServerSave()
       {
       }

       private void OnServerShutdown()
       {
       }

       private void OnUserApprove(ConnectionLoginData connectionLoginData)
       {
       }

       private void OnPlayerConnected(Player player)
       {
       }

       private void OnPlayerDisconnected(Player player)
       {
       }

       private void OnPlayerChat(PlayerEvent playerEvent)
       {
       }

       private void OnPlayerSpawn(PlayerFirstSpawnEvent playerFirstSpawnEvent)
       {
       }

       private void OnEntityDeath(EntityDeathEvent entityDeathEvent)
       {
       }

       private void OnEntityHealthChange(EntityDamageEvent entityDamageEvent)
       {
       }

       private void OnCubeDestroyed(CubeDestroyEvent cubeDestroyEvent)
       {
       }

       private void OnCubePlacement(CubePlaceEvent cubePlaceEvent)
       {
       }

       private void OnCubeTakeDamage(CubeDamageEvent cubeDamageEvent)
       {
       }
   }
}



Attached Files
.cs   Template.cs (Size: 1.96 KB / Downloads: 0)
Print this item

  Reign of Kings Killed by Script
Posted by: Hawthorne - 05-22-2015, 12:41 AM - Forum: Reign of Kings - No Replies

Update: 1.2 version of killed by, this produces random killed by messages for Reign of Kings

Code:
using System;
using System.Collections.Generic;
using CodeHatch.Build;
using CodeHatch.Engine.Networking;
using CodeHatch.Networking.Events.Entities;
using CodeHatch.Networking.Events.Players;
using CodeHatch.Engine.Core.Cache;
using UnityEngine;

namespace Oxide.Plugins
{
   //Need a Script?
   //Patrick Shearon aka Hawthorne
   //www.theregulators.org
   //pat.shearon@gmail.com
   //05-21-2015
   [Info("Killed By", "Hawthorne", "1.1")]
   public class KilledBy : ReignOfKingsPlugin
   {
       List<string> KillMessages = new List<string>();
       string normalColor = "[FFFFFF]";
       string killerColor = "[FF0000]";
       string killedColor = "[FFFF99]";
       System.Random rnd = new System.Random();
       private void Loaded()
       {
           //Add messages here
           KillMessages.Add("{0}{1} {2}was totaly owned by {3}{4}!");
           KillMessages.Add("{0}{1} {2}just got wrecked by {3}{4}!");
           KillMessages.Add("{0}{1} {2}was just brutalized by {3}{4}!");
           KillMessages.Add("{0}{1} {2}was handed there proverbial shorts by {3}{4}!");
           KillMessages.Add("{3}{4} {2}just made red paste out of {0}{1}!");
           KillMessages.Add("{3}{4} {2}ended the life of {0}{1}!");
           KillMessages.Add("{3}{4} {2}has ruined the day of {0}{1}!");
           KillMessages.Add("{3}{4} {2}has beaten {0}{1} {2}to a bloody pulp!");            
       }

       private string GetKillMessage(Player killer, Player killed)
       {
           int Message = rnd.Next(KillMessages.Count);
           return string.Format(KillMessages[Message],killedColor,killed.DisplayName,normalColor,killerColor,killer.DisplayName);
       }

       private void OnEntityDeath(EntityDeathEvent deathEvent)
       {
           if (deathEvent.Entity.IsPlayer)
           {                
               PrintToChat(GetKillMessage(deathEvent.KillingDamage.DamageSource.Owner, deathEvent.Entity.Owner));
           }
       }
   }
}



Attached Files
.cs   KilledBy.cs (Size: 2.01 KB / Downloads: 9)
Print this item

  Down the road.. we will be here.
Posted by: Hawthorne - 05-22-2015, 12:25 AM - Forum: Announcements - No Replies



Print this item

  New system going up.
Posted by: Hawthorne - 05-21-2015, 11:36 PM - Forum: Announcements - Replies (1)

Gearing up for a new gaming adventure, dusting the cob-webs off old tech and making it new again. Stay tuned!

Print this item