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!

Resource icon

[2.x] PVP / PVM or PK / NONPK Role Play system 2.3x 2.1

No permission to download

Mortis

Knight
Mortis submitted a new resource:

PVP / PVM or PK / NONPK Role Play system 2.3x (version 1.0) - PVP / PVM or PK / NONPK Role Play system 2.3x

I have not seen one in a long time. So, decided to revamp and post an old one I made.

What is it?

A role play system that if you join as NONPK also known as PVM ( Player versus Monster ) other player characters can not harm you and you can not harm them. It restricts combat between other player characters.

You can also join as PK also known as PVP ( Player versus Player ) though it is not necessary. But, nice for using/making restrictions or allowed systems.
I have not seen one in a long...

Read more about this resource...
 

Attachments

  • NONPK6.png
    1.5 MB · Views: 37
  • NONPK7.jpg
    355.2 KB · Views: 28
  • NONPK8.jpg
    267.5 KB · Views: 29

Mortis

Knight
Yes it does if you are [NONPK] or the other player is [NONPK] ( Not a problem with [PK] ). You can not fight opposing Factions. (though did not test war mode ) On a thought I would wonder why it would matter. Just use another character slot to join a Faction as it is made to go by character not by account. So for each character slot open has a choice. You or I could add a gump button for remaining nu-trial.

I will and have been looking into fixing it so opposing Factions can fight. Let me know how Guild wars work if you can check before I can.
 

Mortis

Knight
Faction Fix. So opposing Factions can fight even being NONPK.

In Notoriety.cs
Go to about line 214 and change
Code:
//#############ADDED FOR  NONPK##########################
 
 
            if ( from is PlayerMobile &&  target.Player && ((PlayerMobile)target).NONPK == NONPK.NONPK && map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0 )//&& map != null
                                              from.SendMessage( 33, "You cannot attack [*NONPK*] players. Unless you are in opposing Factions or the same Guild/Faction or waring the NONPK players Guild" );
                else
 
 
            if ( from is PlayerMobile && target.Player && ((PlayerMobile)from).NONPK == NONPK.NONPK && map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0  )
                                              from.SendMessage( 33, "You are [*NONPK*] and cannot attack players. Unless you are in opposing Factions or the same Guild/Faction or waring the NONPK players Guild" );
 
                else
 
//#############ADDED FOR  NONPK##########################

To
Code:
//#############ADDED FOR Factions AND NONPK##########################
                Faction srcFaction = Faction.Find( from, true, true );
                Faction trgFaction = Faction.Find( target, true, true );
            if (srcFaction != null && trgFaction != null && srcFaction != trgFaction && from.Map == Faction.Facet && from is PlayerMobile &&  target.Player && ((PlayerMobile)target).NONPK == NONPK.NONPK && map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0 )
                return true;
 
 
            if ( from is PlayerMobile &&  target.Player && ((PlayerMobile)target).NONPK == NONPK.NONPK && map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0 )//&& map != null
                                              from.SendMessage( 33, "You cannot attack [*NONPK*] players. Unless you are in opposing Factions or the same Guild/Faction or waring the NONPK players Guild" );
                return false;
 
 
            if ( from is PlayerMobile && target.Player && ((PlayerMobile)from).NONPK == NONPK.NONPK && map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0  )
                                              from.SendMessage( 33, "You are [*NONPK*] and cannot attack players. Unless you are in opposing Factions or the same Guild/Faction or waring the NONPK players Guild" );
                return false;
 
//#############ADDED FOR Factions AND NONPK##########################

Will update with new version with this fix/addition.
 

Sythen

Sorceror
I agree, but I wouldn't know where to look for that... what I do know is that its awesome to find a script writer that is so dedicated to their own project as to add code on the fly on just an inquiry of how their system affects another part of the RunUO svn... :) I really do appreciate that dedication and will definitely install this system :) Thanks so much Mortis.

On a side note if its not too much trouble to add the guild mods on the script, I would appreciate that as well. Thanks for all the work you've put into this :)
 

Mortis

Knight
For Factions and Guilds. Did not test ConPVP yet.

Code:
//#############ADDED FOR Factions, Guilds And NONPK##########################
 
            Guild fromGuildNONPK = GetGuildFor( from.Guild as Guild, from );
            Guild targetGuildNONPK = GetGuildFor( target.Guild as Guild, target );
 
            if( fromGuildNONPK != null && targetGuildNONPK != null && (fromGuildNONPK == targetGuildNONPK || fromGuildNONPK.IsAlly( targetGuildNONPK ) || fromGuildNONPK.IsEnemy( targetGuildNONPK )) && ((PlayerMobile)target).NONPK == NONPK.NONPK )
                return true; // Guild allies or enemies can be harmful
 
                Faction srcFaction = Faction.Find( from, true, true );
                Faction trgFaction = Faction.Find( target, true, true );
            if (srcFaction != null && trgFaction != null && srcFaction != trgFaction && from.Map == Faction.Facet && from is PlayerMobile &&  target.Player && ((PlayerMobile)target).NONPK == NONPK.NONPK && map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0 )
                return true;
 
            if ( from is PlayerMobile &&  target.Player && ((PlayerMobile)target).NONPK == NONPK.NONPK && map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0  )//&& map != null
                                              from.SendMessage( 33, "You cannot attack [*NONPK*] players. Unless you are in the same Guild or waring the NONPK players Guild" );
                                          else
 
            if ( from is PlayerMobile && target.Player && ((PlayerMobile)from).NONPK == NONPK.NONPK && map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0  )
                                              from.SendMessage( 33, "You are [*NONPK*] and cannot attack players. Unless you are in the same Guild or waring the NONPK players Guild" );
                                          else
//#############ADDED FOR Factions, Guilds And NONPK##########################
 

Mortis

Knight
Mortis updated PVP / PVM or PK / NONPK Role Play system 2.3x with a new update entry:

V.2.1 Changes: Added Event Moongate for all players that only changes NONPK for the event.

V.2.1 Changes:
Added Event Moongate for all players that only changes NONPK for the event.
Allowing NONPK to fight other players in events.
Place one gate where players will go to join the event and one at the event to change them back for normal play.
You will need to use [props on them to set map and location.
Fixed Readme.txt as forgot to add one edit the one on line 35 in the document.

Read the rest of this update entry...
 

Zoul

Wanderer
Hi there, I am running version 2.5 and I installed the files you made here, I put the PlayerMobile.CS in the mobiles folder and I put all the rest in the Misc folder. I am not a coder by any means, I just mess about with it to try to learn it, so any help would be appreciated.

I have lots of errors when it tries to compile.

Here is one of them

Errors:
+ Mobiles/PlayerMobile.CS:
CS0508: Line 3630 'Server.Mobiles.PlayerMobile.ComputeMovementSpeed(Server.Direction, bool):
return type must be 'int' to match overridden member ' Server.Mobiles.PlayerMobile.ComputeMovementSpeed(Server.Direction, bool)'

Think all the errors have to do with these, a lot a red squiggly lines in VS saying:

can't implicitly convert type int to System.TimeSpan

also:
can't convert type 'long' to System.DateTime


I don't know how to convert the int to ticks, so if you could adjust the file and re-upload that would be awesome.
Thanks a lot, can't wait to use the system!
 

Zoul

Wanderer
Anyone else with coding abilities have a fix for converting int to TimeSpan? to fix this system in RunUo 2.5? it won't compile.
 

Dian

Sorceror
You really should not have replaced your PlayerMobile.cs and Noriety.cs files, but rather followed the ReadMe.txt and added the code provided to your own files.

I would suggest trying that first, and see if it works correctly.
 

Zoul

Wanderer
Hi, I made sure to save my original files, those are copies I edited, i could have sworn I read only edit if you already had the system he made and are free to replace files but wouldn't be the first time I was wrong... lol thanks I'll try that now.
 

Zoul

Wanderer
Thank to you I got it working and setup the Goddess and two gates, although I still am not sure of the systems full potential?

I understand that as PVM after Goddess other players can't attack you in an event? what event? How do I start the event?

Can two player or more players talk to the Goddess and mark them as PVP so they can battle? if so how is it done? is there some way I can start an event where they can PVP in this system or have a free for all for everyone? or is it just so people can't attack you? just a little confused thanks
 

Dian

Sorceror
Well, unless Mortis comes around to explain in detail, its a matter of reading the code in the files to see how it works.

But I imagine by the description, its all about the settings. The event gate will set the player to a PvP setting temporarily during the event or while they are in that area.. and back to NonPVP when they leave the area or go back through the gate.. Id have to read the code too, to be certain.
 

Zoul

Wanderer
Well, unless Mortis comes around to explain in detail, its a matter of reading the code in the files to see how it works.

But I imagine by the description, its all about the settings. The event gate will set the player to a PvP setting temporarily during the event or while they are in that area.. and back to NonPVP when they leave the area or go back through the gate.. Id have to read the code too, to be certain.

well after you go through the event gates Mortis made players are still blue, can't attack, the goddess stands on the other side, you talk to her with the keywords Mortis has written in the explanation.

She asks you you want, pvm or pvp. Two players picked pvp, she then flagged the two players as pvp, you can tell by clicking on them and it says pvp by there names, but they are still blue. To test one player attacked the other and killed and the other. The dead guy got the gump for murder count to the player that killed him, so I don't see this working for RunUo version 2.5 unless we are off base here, , thanks for at least leading me how to fix it Dian, but with little explanation of how to run it we are going to abandon it for now since it appears not to work in RunUO 2.5
 

Optik

Page
Zoul, from what you describe it sounds like it's working just as it should. The PvP gate allows PvP actions to be taken against that character. It's not going to make them red as it does nothing with their murder count. The system simply allows a player to be attacked and/or attack other PvP flagged players.

Also, mortis is referring to events in general. Mainly, events that require PvP (arenas, deathmatches, etc.). The purpose of those gates is so non PvP flagged characters can participate in those events (where PvP is going to take place) and then get set back to nonPvP after the event to return to the normal game.
 

Zoul

Wanderer
Zoul, from what you describe it sounds like it's working just as it should. The PvP gate allows PvP actions to be taken against that character. It's not going to make them red as it does nothing with their murder count. The system simply allows a player to be attacked and/or attack other PvP flagged players.

Also, mortis is referring to events in general. Mainly, events that require PvP (arenas, deathmatches, etc.). The purpose of those gates is so non PvP flagged characters can participate in those events (where PvP is going to take place) and then get set back to nonPvP after the event to return to the normal game.

Hi, thanks for the response, both players were flagged by the goddess as pvp, both had PVP by their names and one attacked the other and killed and could have got a murder count, so I don't see how that is working?
 

Zoul

Wanderer
Zoul, from what you describe it sounds like it's working just as it should. The PvP gate allows PvP actions to be taken against that character. It's not going to make them red as it does nothing with their murder count. The system simply allows a player to be attacked and/or attack other PvP flagged players.

Also, mortis is referring to events in general. Mainly, events that require PvP (arenas, deathmatches, etc.). The purpose of those gates is so non PvP flagged characters can participate in those events (where PvP is going to take place) and then get set back to nonPvP after the event to return to the normal game.

Ill test it again with them, maybe something to do with the gate not being setup the right way with props or something, Ive no clue...
 
Top