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!

Kenko's Duel Pit System ("Working" & Translated)

skills3200

Sorceror
Kenko's Duel Pit System ("Working" & Translated)

Ok Firstly I can take no credit for this at all. I simply updated it a lil and had it translated into English.

Plz note i haven't had enough time to fully test this either so it could be a bit buggy but i will do everything i can to try and fix any problems you might come across. Also my Spanish is somewhat poor so some of the translations might be wrong but its 90% there.

DESCRIPTION:
A system to run tournaments called "Duel Pits", you can choose between "FFA" (expanded below) or "XVX" (also expanded below). The thing which makes this a good system, in my opinion, is that it is incredibly fair (also expanded below). Of course, these tournaments are totally automated.

SETUP:
Easy to setup. At this point we will do a walk-through all the items available for this system. Once you had installed the system and got on your staff character, you will want to add the needed items. [Add DuelP will bring up a gump with all the package items.

PlayerMobile.cs ln360~:
Desc: Optional. Disallows players to drop items in the Duel Pit Arena.
Inside:

Code:
OnDroppedItemToWorld( Item item, Point3D location )
Below:

Code:
if ( !base.OnDroppedItemToWorld( item, location ) )
				return false;
Place:

Code:
if ( ( Region is DuelPRegion || Region is DuelPWaitRoomRegion ) && AccessLevel < AccessLevel.GameMaster )
			{
				SendMessage( "You can't drop items to the Duel Pit Arena, drop them to a trash barrel instead!" );
				return false;
			}
PlayerMobile.cs ln900~:
Desc: Strongly Recommended. Allows players to stealth in spectator areas.
Inside:

Code:
public override void RevealingAction()
Below:

Code:
if ( m_DesignContext != null )
				return;
Place:

Code:
if( Region is DuelPWaitRoomRegion )
                return;
PlayerMobile.cs ln1750~:
Desc: Recommended. Allows players to shove around in spectator areas.
Inside:

Code:
public override bool OnMoveOver( Mobile m )
Place:

Code:
if( Region is DuelPWaitRoomRegion )
                return true;
Inside:

Code:
public override bool CheckShove( Mobile shoved )
Modify:


Code:
		public override bool CheckShove( Mobile shoved )
		{
			if( TransformationSpell.UnderTransformation( this, typeof( WraithFormSpell ) ) )
				return true;
			else
				return base.CheckShove( shoved );
		}
With:

Code:
if( TransformationSpell.UnderTransformation( this, typeof( WraithFormSpell ) ) )
                return true;
            else if( Region is DuelPWaitRoomRegion )
                return true;
            else
                return base.CheckShove( shoved );
PlayerMobile.cs ln1850~:
Desc: Recommended. Players don't receive resurrection robes in spectator areas.
Inside:

Code:
public override void Resurrect()
Modify:

Code:
if ( this.Alive && !wasAlive )
With:

Code:
if ( this.Alive && !wasAlive && !( Region is DuelPRegion || Region is DuelPWaitRoomRegion ) )

Here I introduce you to my custom handlers, distro mod once, easy to change forever.

Engines\Factions\Core\Faction.cs ln1000~:

Desc: Strongly Recommended. Applies skill loss not if death during tournament.
Remember to add

Code:
using Server.CustomHandlers;
to the list of the start script.
Inside:
Code:
public static void HandleDeath( Mobile victim, Mobile killer )

Place:
Code:
            if( !CustomHandlers.Fact.HandleDeath( victim, killer ) )
                return;
Notoriety.cs ln60~
Desc: Strongly Recommended. Notoriety Handlers.
Inside:

Code:
public static bool Mobile_AllowBeneficial( Mobile from, Mobile target )
Place:
Code:
            CustomReturn r = CustomHandlers.Noto.Mobile_AllowBeneficial( from, target );

            if( r == CustomReturn.True )
                return true;
            else if( r == CustomReturn.False )
return false;Notoriety.cs ln100~
Desc: Strongly Recommended. Notoriety Handlers.
Inside:

Code:
public static bool Mobile_AllowHarmful( Mobile from, Mobile target )
Place:

Code:
   CustomReturn r = CustomHandlers.Noto.Mobile_AllowHarmful( from, target );

            if( r == CustomReturn.True )
                return true;
            else if( r == CustomReturn.False )
return false;Notoriety.cs ln150~
Desc: Strongly Recommended. Notoriety Handlers.
Inside:
Code:
public static int CorpseNotoriety( Mobile source, Corpse target )
Place:

Code:
int r = CustomHandlers.Noto.CorpseNotoriety( source, target );

            if( r > -1 )
return r;Notoriety.cs ln260~
Desc: Strongly Recommended. Notoriety Handlers.
Inside:

Code:
public static int MobileNotoriety( Mobile source, Mobile target )
Place:

Code:
int r = CustomHandlers.Noto.MobileNotoriety( source, target );

            if( r > -1 )
                return r;Items:

DuelPBook: This item allows people to sign-up for tournaments, it is the join book, it can be easily customized to display different information, currently, it displays a lot of information about the tournament you can sign-up for, if it the one linked to is running one, else it displays the [Inactive] property.
DuelPBracketBuilder: If you link one of this items to your system, it will generate (if the tournament is flagged as “Official”) all the brackets of the tournament in a html page, also it will generate information about when the tournament was ran, how many players took part of it, etc. Allows configuring colors for text and background, as well as whether to use bold on titles or not.
DuelPFireworks: Each of these, linked to a given DuelPStone, will launch (if allowed by the DuelPStone) fireworks at the end of a tournament. Link to a DuelPStone and run [DuelPLaunchDemo to see what it can do. Note that fireworks will launch from the location of the item, so you may want to place more than one of them for your tournaments.
DuelPGate: You don’t need to spawn these by yourself! But you can add one to have a peek at it’s creation effect.
DuelPRStone: This stone controls stealthing in the spectator regions, as well as it creates them, you don’t need to modify anything in the scripts to set up your regions or to change where to run your tournaments.
DuelPStatue: This statues come in three designs ([Add DuelPStatue 0, [Add DuelPStatue 1, or [Add DuelPStatue 2, if you [Add DuelPStatue it will make a “2”, which is the biggest, and default statue]. These also have to be linked to a DuelPStone in order to speak information out. You can place these in banks and at your tournament place.
DuelPStone: This stone means one instance of the system, you can place as many as you like, and hold tournaments simultaneously in different arenas, obviously not recommended unless you have a lot of players in your shard.

How do I run my first tournament?
First of all, you will want to add a DuelPStone and a DuelPRStone. You will want to link the DuelPRStone to the DuelPStone, just double click the DuelPRStone and target the DuelPStone. You will need to have the stones in your tournament place at this stage, possibly you will want to hide the stones (click them and select Toggle Visibility) and leave them there, recommended.

Your arena should have three clearly defined portions: The spectator area, the players area, and the duel pit itself. You will want a public moongate in your spectator area, so people in this area (SPECTATOR AREA) can leave at any time they please. You will also want sign-up books in the spectator area, so they can opt to play. Using DuelPBooks and accepting to participate will move them to the player area, which they SHOULD NOT be allowed to leave. In both the spectator and player areas you could place trash barrels, in order to keep your arena clean. The duel pit is recommended to be placed in middle, between spectator and player areas.

Once you have your three rooms, you may proceed. [Props the DuelPStone and set up AreaPlayers to your player room and AreaSpectators to your spectator room. Next, double click the DuelPStone and choose the second button from the left (“Determinar Region”), which will allow you to mark up the duel pit region. Next step will be to double click the DuelPRStone and select the third button (“Tomar”), that will take the bounds for AreaSpectators and AreaPlayers from the DuelPStone and make regions for said bounds. Last step here is to single click the DuelPStone and select the last option (“Show Grid”), this will display your duel pit region boundaries in a red glow, and your spectator and player regions boundaries in blue glows, if displayed boundaries aren’t right, then edit at your please until you have what you need.

You don’t want to forget adding DuelPBooks in the spectator area, linking them to your DuelPStone, and also adding a public moongate

May you want to edit the moongate spawn locations, these moongates will not allow mounts, will not transport pets, and will take people to the middle of your spectator area. To edit the spawn facets, you have to [Props the DuelPStone, access the “Gates” property, and edit the facets at your please. Invariably, DuelPGates will spawn next to each bank of the selected facets, except you edit this in DuelPGateInfo.cs

Last but not least, you will want to set iMinTeams on the DuelPStone, this variable will allow the tournament to start automatically after ~iMinTeams~ signed-up, still, if players recently signed-up when this is checked, the system will wait a few more minutes and check again later. If you don’t want this feature then you will have to set a high iMinTeams number, and obviously will have to start the tournament manually, which can be done with [DuelPStart (expanded below).

To open up sign-ups you need to double click the DuelPStone, a gump will show up. You will want to select the second button from the right (“Comandos del Sistema”), another gump will show up, in this case we will select the first command (“Abrir las inscripciones”). Now moongates will spawn in the desired maps, allowing players to travel to your duel pit arena, and books will take sign-ups, allowing them to sign-up for the tournament.

Notice that, once you opened the tournament, you will not be able to open the gump again, don’t worry, there are lots of commands to cancel the tournament and various other stuff, also, many properties will become locked (meaning you will not be able to edit them), depending on the SecurityLevel the developer (or above) has set. Being the reason of this that if someone does not know VERY well what each property does, he will be likely to be able to put up a significant disaster.

DUELPSTONE PROPERTIES

Algorithm: This PropertyObject is my real baby, unfortunately, you won’t be able to modify but a thing here, the Debug boolean, which defaults to false, and having it set to true will make the console flood debug information every tournament you run, my recommendation is: off except you are attempting to debug something. Expanded below.
AreaSpectators: Already discussed, the area where spectators go, don’t forget to update on your DuelPRStone.
AreaPlayers: Already discussed, the area where players go, don’t forget to update on your DuelPRStone.
bAllowFireworks: If true, when a tournament ends, each DuelPFireworks linked to this DuelPStone will launch it’s units.
AllowStealth: In an attempt to reduce lag, if this is set to true, it will allow DuelPRStones to tell regions to hide all spectators in both spectator and player areas during the tournament (after sign-ups are closed, and until duel pit ends).
DisplayForfeitGump: If true, at the moment of playing a duel, if teams have already lost one duel (meaning next loss is out), instead of placing the duelers straight away in the arena, this will show a gump allowing players to decline, if any of the team-leaders (the gump is only shown to one player per team, or to the only player if it’s 1V1) decline, his team will automatically lose, and the other team automatically wins the duel, without playing it. If both teams agree to play, or if a given TimeSpan elapses, the duel is played as normal. How does this serve you? This system (DuelPForfeitSystem) is intended for looting-allowed tournaments, so players don’t piss you because someone has looted their reagents and they can’t duel, there they have, they can decline the duel, they still lose, but they don’t lose insurance money and the other reagents or potions they could possibly have.
FastTest: Testing purposes only, some messages don’t show up, tournament starts faster, things take a fixed TimeSpan (they don’t consider TimeSpans you selected) which is considerably shorter than any reasonable TimeSpan you could use. If true, everything runs faster.
LootableCorpses: Determines whether or not the tournament will be looting-allowed or not. If not, corpses are automatically looted, if yes, it takes a given TimeSpan before players get their items. TimeSpan during which other players will have rights on looting their items.
ManualClean: I had to include this. If set to false, the tournament will automatically move winners to spectator area after a couple of minutes (TimeSpan which you can edit). Problem is that you can’t always calculate how much you will take in giving prizes, and if you will give any, personally I have set manual clean to true, with a TimeSpan of one minute twenty seconds, but in the 4V4 tournament I mentioned above, I had to use this. If set to true, you will have to manually move winners to spectator area after a tournament concludes.
Silent: May you want to run a tournament without people noticing, maybe to test something on your production shard, while people plays? This is your boolean.
DuelDT: DateTime last tournament started on. Read Only.
Gates: A PropertyObject like DuelPAlgorithms, but much more simplier, displays information about DuelPGates, and allows to edit where to spawn these (in which facets).
iArenaZ: Height of the duel pit arena (all the spectator, player and duel pit areas must be at the same height).
iDuelNo: Tournament count, customizable. Find out why below.
iMinTeams: Minimum teams for the DuelPStone to automatically close sign-up stage.
iStartListing: Do not edit this, nor iDuelNo, unless you already kept a count of your tournaments. If you had just finished the 48th tournament when you installed this system, then you will want to iDuelNo = 48 and iStartListing = 49. Both are intended to work with DuelPBracketBuilders (one DuelPBracketBuilder is more than enough).
MapDest: Unless you have custom map rules I strongly suggest not modifying this.
Official: Whether this tournament counts towards the iDuelNo and if the DuelPBracketBuilder has to build a report on this tournament or not.
SecurityLevel: AccessLevel Developer, None will let staff modify anything at anytime, Secure will allow to modify properties only if there is no tournament running (it will allow modifications during sign-ups, though), Locked will only allow modifications during Ready Status, while Stuck will not allow any modifications at all.
TimerClean: TimeSpan which has to elapse before winners are moved out to spectator area after a tournament concludes.
TimerForfeitGump: LifeSpan for forfeit system, after this TimeSpan, forfeit gumps for both players close and duel begins (if it hadn’t began already, or if it hadn’t been forfeited).
TimerLoot: TimeSpan during which a corpse may be looted after a dueler’s death, after that the remaining items are given to the corpse’s owner (looting-able tournaments).
TimerPrepare: TimeSpan for players to cast spells like bless, cunning, drinking potions, etc. before a duel starts.

More properties can be accessed through the gump menus of the DuelPStone, such as allowing or disallowing: potions, healing, AoS majors (Doom artifacts), AoS minors (Paragon Artifacts), SE minors (Lesser ToTs), SE majors (Greater ToTs), and support for ML minors and majors (None yet).

In the gump menus you can also determine for each spell and each skill if you allow it or not in a tournament. I suggest editing these, you will want to look at this and remove some things, probably Hiding and Invisibility, Fire and Poison Fields, etc.

In that same gump you will be able to determine the amount of players for each team, or if it will be a FFA. Also you can determine if you are going to allow any template, or just mages, just dexxers or just tank mages (interface needs to be improved on these).

COMMANDS

Notice that most of these commands, not to say all of them, will not even ask you to select your DuelPStone, that will be because you have only just one, if you hadn’t one, it would tell you that there are no DuelPStones to use that command, if there were more than one, it would ask you to target the DuelPStone where you want to run the command on. So the support for multiple DuelPStones and simultaneous tournaments is full, but still, if you only have one DuelPStone, things will be a lot easier for you.

DuelPAbort: Allows you to abort a tournament in any of its stages, moving all participants to spectator room.
DuelPBan: Allows you to ban a player from a given DuelPStone (DuelPBooks won’t allow him to sign-up, and won’t allow other people to choose him as a team member), if the player was already sign-upped in a tournament for that DuelPStone, his team will be kicked out.
DuelPBanClear: Clears the banned people list in a single DuelPStone.
DuelPBanClearAll: Clears the ban lists for every single DuelPStone.
DuelPBanList: Displays the list of banned people of a single DuelPStone.
DuelPCancel: Similar to DuelPAbort, only works during sign-up stage (lesser AccessLevel required).
DuelPKick: Kicks a player from a tournament, useful for you to take out people who don’t want to participate, but signed-up, whole team retires from the tournament.
DuelPLaunchDemo: Launchs fireworks on all DuelPFireworks linked to the first DuelPStone registered.
DuelPSMSelf: Runs the stat modifying function from the duel algorithm on yourself. It removes all stat mods off you and then reequips all your armor to give you back stats from items (removes bless, curse, etc), for example Dexterity 15 on Jackal’s Collar. Testing purposes only.
DuelPStart: Closes sign-up stage and moves onto. Only works if three or more teams are signed-up, no override to this.
DuelPTeamList: Displays the magic of the DuelPAlgorithm in action.
DuelPUnban: Unbans a player from a DuelPStone.

FAQ

What is a FFA?
A FFA or "Free For All", is one of the two ways this system can run under. FFA's are not exactly the strong edge of the system. Upon starting, players will be randomly placed in the Duel Pit Arena, and basically, last three men standing become the winners. Obviously, while last man standing becomes the winner, the runner up comes in second place, and the third place is for the other player. FFA's end when only one player is left standing.

What is a XVX?
A XVX can be anything from 1V1, 2V2, 3V3, ..., XVX, ..., 16V16, becoming 16V16 the cap set in the script, easy-to-change, but I doubt anyone has enough players to even run a 6V6 tournament, the biggest one I ran was 4V4, I assure it works with any number. In XVX, players confront in series of highly-customizable duels. XVX's end when there are only three players left and they battled enough to decide who of them deserves what position.

Why do you call it Fair?
This is certainly, the sweetest thing about this script. After sign-up stage is over, teams list is sorted and the fun begins. Each team has to lose twice in order to lose the tournament. And honestly I think the algorithm is perfect. It’s all about double elimination bracketed tournaments.

Basically, brackets divide in two, the winner brackets and the loser brackets. A team losing in the winner bracket drops to the loser bracket. A team losing in the loser bracket becomes removed. In the end, the winners of both the winner and the loser brackets face each other in a “best of three” match, where the team coming from the winner bracket starts “1-0”, because they never lost a single match, therefore, if the team “A” coming from the winner bracket wins a game, they win the tournament, but team “B”, who already lost once, will need to beat team “A” twice to obtain the victory.


If you find any flaws in this script please let me know, understand it’s very long and I can’t keep all together in my mind. Also, consider the big effort I made by sharing this with the RunUO community. I hope it servers you well.

Oh, and if you can't find anything you added from this package (except for DuelPGates, but they delete on deserialization), don't hesitate to [Global Interface Where DuelSystemItem.
 

Attachments

  • Duel Pits.rar
    77.1 KB · Views: 301

Asmir3

Sorceror
The faction editing part doesnt work

here is the error

Code:
Errors:
 + Engines/Factions/Core/Faction.cs:
    CS0234: Line 13: The type or namespace name 'CustomHandlers' do
in the namespace 'Server' (are you missing an assembly reference?)
 

Kenko

Page
this should be it, remove the ctf and quest related parts, also there is a little change I made in the regions, (I think you are not using the latest version, because I never finished that one so it will never work), try to change
Code:
if( victim.Region is EventRegion )
to
Code:
if( victim.Region is DuelPRegion )
or something alike.. (Check the name of the arena region in the script files)

gl !
 

Attachments

  • CustomHandlers.cs
    3.9 KB · Views: 84

Asmir3

Sorceror
yea this old version way too old but if u could send me those two scripts I ask, I can make the latest one work!
 

Kenko

Page
let me see... as far as I can remember, I was editting the whole system when I stopped scripting kinda suddenly, that's why I don't have a complete decent running version, last running version wasn't backed up =(

I hope this helps ^^

artifactlists.cs needs a lil mod from what I just read, no big deal, just delete references to some custom vars (like artifact lists for artifacts only present in my former server)..

eventgates is what you asked for, though I added my latest (at least latest I have) events base, which contains eventgates and probably some stuff event gates reference to

GL!
 

Attachments

  • EventGates.rar
    4.6 KB · Views: 78
  • Base.rar
    14.8 KB · Views: 78
  • ArtifactLists.cs
    6 KB · Views: 73

Asmir3

Sorceror
U seem to have ctf that works along with this if u dont mind me asking do u think u can give us ur ctf system as well and I can make it work with this event system?

btw

can u upload the right DuelPUtility.cs that does contain a definition for 'SendMessage', 'Packet', 'AsciiMessage'?

thanks for all the help dude!
 

Aaronski

Wanderer
how do i fix this error i got after trying to make the stones


World: Loading...Error:
System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
at System.IO.__Error.EndOfFile()
at System.IO.BinaryReader.FillBuffer(Int32 numBytes)
at System.IO.BinaryReader.ReadInt32()
at Server.World.Load() in c:\Documents and Settings\rob\Desktop\svn\Server\Wo
rld.cs:line 386
at Server.ScriptCompiler.Compile(Boolean debug, Boolean cache) in c:\Document
s and Settings\rob\Desktop\svn\Server\ScriptCompiler.cs:line 584
at Server.Core.Main(String[] args) in c:\Documents and Settings\rob\Desktop\s
vn\Server\Main.cs:line 435
This exception is fatal, press return to exit
 

domiglio

Wanderer
Have changed the script to run on RunUO 2.0 Final?

If anyone can help or tell me if you know another script like this, but above all have a hidden area for spectators.

Thank you.
 
Top