RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Res Kill Protection [RUO: 2.2]

Trip3033

Sorceror
This is a simple anti res kill script that should help prevent pvpers from res killing. It also comes with an off command if the player wishes to not be protected anymore also helps if a GM forgets to mortal the player back so they wont be stuck with invul.
------------------------------------
It's really simple to install just:
  • Copy res kill protection folder to your custom scripts
  • Edit Playermobile.cs
in Playermobile.cs search for:
Code:
if ( this.Alive && !wasAlive )
And underneith the brace { add:
Code:
                if ( this.AccessLevel < AccessLevel.GameMaster )
                    new RKProtect( this, 60.0).Start();
it should look something like this all together:
Code:
        public override void Resurrect()
        {
            bool wasAlive = this.Alive;
 
            base.Resurrect();
 
            if ( this.Alive && !wasAlive )
            {
                if ( this.AccessLevel < AccessLevel.GameMaster )
                    new RKProtect( this, 60.0).Start();
 
                Item deathRobe = new DeathRobe();
 
                if ( !EquipItem( deathRobe ) )
                    deathRobe.Delete();
            }
And that's it all done.
------------------------------------
If you would like to change the timer/count down for how long they have to recover, change this line in playermobile:
new PKProtect( this, 60.0).Start();

Change the 60.00 to what ever you would like to give players to recover.

You're welcome to edit, change, mod, or improve anything you like in these scripts, Enjoy.

*Edit* forgot to change sendmessage code. reload the RKProtect.cs
 

Attachments

  • Res Kill Protection.rar
    1.8 KB · Views: 46

Murzin

Knight
arent counselors still staff and it should be less than them? or whatever the lowest staff level is at least.
 

Trip3033

Sorceror
yeah but counselors are basicly players with minimal privilages. Counselors cant res or invul themselves or others.
 

ArisBB

Sorceror
Very good! you can add YellowHealthbar to this, and all players will understand that blessed player are realy blessed. =D
 

ArisBB

Sorceror
First problem, if the server go down in timer count the player will stay blessed, you need make the serialization =/
 

Trip3033

Sorceror
First problem, if the server go down in timer count the player will stay blessed, you need make the serialization =/

yeah, i couldn't make a fix for that sorry. I figured since its not really client sided and it only happens if u restart your server then it shouldn't be a big deal. If you ever find yourself troubled by this just use this command in game: [Global Set Blessed False Where Playermobile That should help you. It will set every player (and only players) even staff back to mortal where ever they are players dont need to be logged in to set.


If someone wants to script a fix for that they're more than welcome to post it on here i'll add it main post after tested.
 

ArisBB

Sorceror
I try make the serialization, but im not good with this. The biggest problem about use [Global is if i have anothers scripts that make the player blessed, like Sleepable Beds, and i have another created by me for a like movie effect on character creation. I belive that you have fluence in English language... im not =/
Have any serializations tutorial in this forum, try it and i will always gratefull for your script! :D
 
Top