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!

[RunUO 2.0 RC1] XmlPoints - pvp dueling and challenge game system

Draegen

Sorceror
nevermind it has nothing to do with your system it was a nother system causing combat to not work it was the hunting system
 
Players used Razor can open corpse without doubleclicking, and can avoid region looting restrictions. You can fix this by using CheckAccessibility func instead of OnDoubleClick func.
 

ArteGordon

Wanderer
Prohor Meletevich said:
Players used Razor can open corpse without doubleclicking, and can avoid region looting restrictions. You can fix this by using CheckAccessibility func instead of OnDoubleClick func.
good point.

Adding this to the ChallengeGameRegion.cs should take care of it

Code:
		public override bool CheckAccessibility(Item item, Mobile from)
		{
			if (item is Corpse)
			{
				// dont allow other players to loot corpses while a challenge game is present
				if ((ChallengeGame != null) && !ChallengeGame.Deleted && (from != null) && !(((Corpse)item).Owner is BaseCreature) &&
				(((Corpse)item).Owner != from) && (from.AccessLevel == AccessLevel.Player))
				{
					XmlPoints.SendText(from, 100105); // "You are not allowed to open that here."
					return false;
				}
			}

			return base.CheckAccessibility(item, from);
		}
 

ArteGordon

Wanderer
Prohor Meletevich said:
I have a question. What about duels on the champs? Can people left the champ area with power scrolls by using duels?

I havent tested it, but they probably could since it isnt explicitly restricted.

An easy way to take care of all of those sorts of issues is to only allow challenges to be made in town regions.
Make this change in xmlpoints.cs around line 1360

Code:
		public static bool AllowChallengeGump(Mobile from, Mobile target)
		{
			if (from == null || target == null) return false;
[color=red]
			if (!from.Region.IsPartOf(typeof(Regions.TownRegion)) || !target.Region.IsPartOf(typeof(Regions.TownRegion)))
			{
				from.SendMessage("You must be in a town to issue a challenge"); 
				return false;
			}
[/color]
			if (from.Region.IsPartOf(typeof(Regions.Jail)) || target.Region.IsPartOf(typeof(Regions.Jail)))
			{
				from.SendLocalizedMessage(1042632); // You'll need a better jailbreak plan then that!
				return false;
			}

			return true;
		}

Or you could just add your specific restrictions in there if you preferred.
 

ArteGordon

Wanderer
Prohor Meletevich said:
Maybe Im not understand, but I can't to add CTFBase item to the world because it isn't constructable? I mean that how can I setup CTF game?

when you use the [ctf command or press the CTF button in the points gump, it will place a CTFGauntlet.
The person to place the gauntlet is the organizer. They are responsible for placing the bases from the teams gump that opens up after you have assigned players to their teams.

All the various challenge games work in the same way. The gauntlet is the game controller.
 

ArteGordon

Wanderer
Prohor Meletevich said:
Maybe a bag. In the top players gump player deaths always have zero value.

I have found the problem and updated xmlpoints.cs in v1.24b

If you want to make the change in your current version, this is the fix

around line 2300 in the OnKilled method in xmlpoints.cs

Code:
  	// take points from the killed, either a fixed amount or scaled by the difference with the points of the killer
  	// if the killer has fewer points than the killed then lose more
  	XmlPoints xp = XmlAttach.FindAttachment(killer, typeof(XmlPoints)) as XmlPoints;

  	if(xp != null)
  	{
    killerpoints = xp.Points;

[color=red]
                // add to the recently killed list
                xp.KillList.Add(new KillEntry(killed, DateTime.Now));[/color]
  	}

and comment out this line in the OnKill method around line 1975

Code:
  	// add to the recently killed list
  	//KillList.Add(new KillEntry(killed, DateTime.Now));
 

iamjedi

Wanderer
ArteGordon said:
I have found the problem and updated xmlpoints.cs in v1.24b

If you want to make the change in your current version, this is the fix

around line 2300 in the OnKilled method in xmlpoints.cs

Code:
  	// take points from the killed, either a fixed amount or scaled by the difference with the points of the killer
  	// if the killer has fewer points than the killed then lose more
  	XmlPoints xp = XmlAttach.FindAttachment(killer, typeof(XmlPoints)) as XmlPoints;

  	if(xp != null)
  	{
    killerpoints = xp.Points;

[color=red]
                // add to the recently killed list
                xp.KillList.Add(new KillEntry(killed, DateTime.Now));[/color]
  	}

and comment out this line in the OnKill method around line 1975

Code:
  	// add to the recently killed list
  	//KillList.Add(new KillEntry(killed, DateTime.Now));
Ah, what a great error. Glad it got fixed. :) [bowtoarte
 

koluch

Sorceror
What can I say....

Excellent as always ;)

Our players love the system.
I love the system AND it is a great way to learn more on coding and scripting things the right way.

Quick Question:
Is there a time period that players are grey after a duel?
Just want to be sure that is as intended and we did not miss something.

Many Thanks, Arte !

Koluch
 

ArteGordon

Wanderer
koluch said:
Excellent as always ;)

Our players love the system.
I love the system AND it is a great way to learn more on coding and scripting things the right way.

Quick Question:
Is there a time period that players are grey after a duel?
Just want to be sure that is as intended and we did not miss something.

Many Thanks, Arte !

Koluch

notoriety should go back to what it was before the duel, so if they were not grey before, they shouldnt be afterward.

Are the players orange to each other during the duel? If not, then check the notoriety.cs mods.
 

Xenovia

Wanderer
Help!

I got this error:
Code:
RunUO - [www.runuo.com] Version 2.0, Build 2357.32527
Core: Running on .NET Framework Version 2.0.50727
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
 + Customs/XML/XML Spawner 1/XmlSpawner2.cs:
    CS0029: Line 9376: Cannot implicitly convert type 'System.Collections.ArrayL
ist' to 'System.Collections.Generic.List<Server.Tile>'
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
 

ArteGordon

Wanderer
it means that you are running RunUO 2.0 RC1 instead of the most recent SVN and you just need to uncomment this line at the beginning of xmlspawner2.cs

//#define RUNUO2RC1

so that it looks like

#define RUNUO2RC1
 
I found a bug. After duel on game region after some player is died its opponent can loot his corpse during a few seconds. This is the func from your game region:

Code:
        public override bool CheckAccessibility(Item item, Mobile from)
        {
            if (item is Corpse)
            {
                // dont allow other players to loot corpses while a challenge game is present
                if ((ChallengeGame != null) && !ChallengeGame.Deleted && (from != null) && !(((Corpse)item).Owner is BaseCreature) &&
                (((Corpse)item).Owner != from) && (from.AccessLevel == AccessLevel.Player))
                {
                    XmlPoints.SendText(from, 100105); // "You are not allowed to open that here."
                    return false;
                }
            }
            return base.CheckAccessibility(item, from);
        }

I think the problem because of you make check if game is present, but after player death game already ended and not present.
 

llessur1

Wanderer
xml why u show

why do they keep showning xml scripts for 2.0 wen they wont work with out a xml spawnber i did it 100 times and its the same thing GET RID OF ALL THE XML SCRIPTS CUS THEY DONT WORK
 
Top