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!

XmlPoints

ArteGordon

Wanderer
XmlPoints v1.23

XmlPoints
v1.23
updated 4/15/05
ArteGordon

Summary:
A system that supports player-vs-player kill tracking, 1-on-1 challenge dueling, multi-player challenge games, shardwide pvp ranking, and pvp rewards.


Recent Updates:

New to version 1.23
updated 4/15/05

- another slight modification to the points-decay-with-pvp-inactivity system. Points decay is now capped so that it wont drop below the default starting level (e.g. 100 points).

- disabled the ClearArena call in StartGame() in BaseChallegeGame.cs that moved all mobs that were not participating in challenge games out of the challenge arena at the start of a challenge game. It was causing problems by moving mobs that really shouldnt be moved.

New to version 1.22a
updated 3/28/05

- added the option to gain Honor virtue points from duels. (thanks to LordHogFred for the idea) Just set the static bool GainHonorFromDuel (false by default) to true at the beginning of xmlpoints.cs (around line 121)

- fixed a bug that could lead to people being teleported back to former locations after duels carried out in place ("Duel here" location).

New to version 1.22
updated 3/22/05

- disallow challenges to players that do not have XmlPoints support instead of just saying that they would result in no points.

- added the ability to specify multiple locations for the TeleportOnDuel feature. The duel location can be selected by the challenger when a challenge is issued. Locations that are currently occupied (any player found within the DuelRange of the location) are indicated in red. Occupied locations cannot be teleported to.
Entries can be added to the DuelLocations list that is found in the beginning of XmlPoints.cs. The DuelRange is the range used to determine if the location is occupied.

- Players that have recently been in combat will not be allowed to duel or to teleport on duel to prevent the use of challenges to escape battle.

- after a duel, a players' nearby pets/mounts (16 tiles by default) will be teleported back along with player if TeleportOnDuel is enabled. (thanks to sh1ny for the suggestion)

New to version 1.21
updated 3/10/05

- fixed a possible crash bug when trying to use the [topplayers when no players have points attachments (thanks to asmoug for pointing this out).

- missing language or language text entries will now appear as error strings instead of simply returning null values that could produce server crashes (thanks to Kai for pointing this out).

- modified the points-decay-with-pvp-inactivity system to stop deducting when the points drop below the default starting level (e.g. 100 points).

- added the option for automatically teleporting to a specified location upon accepting a duel, and then automatically returning when the duel is over. This feature can be enabled by setting the static bool TeleportOnDuel to true (it is false by default). You should also set the DuelLocation and DuelMap static variables to the spot where you want people teleported if you use this feature. These can be found at the beginning of XmlPoints.cs


New to version 1.20
updated 2/10/05

- slight modification to the leaderboard ranking system. Previously, players with the same points totals were assigned tied rankings. Now ties are resolved by comparing kills, deaths, and previous ranking (in that order). So if two players have the same points total, the player with more kills will be ranked higher. Players with the same points and kills, will be ordered by deaths (fewer deaths means higher rank). So in the modified system, there are no tied ranks.

- added an optional player faction listing to the leaderboard. This can be enabled by uncommenting the #define FACTIONS statement at the top of XmlPoints.cs. If enabled, faction affiliation will be displayed in the leaderboard gump as well as saved to the .xml and .html leaderboard files. (thanks to sage707a for the suggestion)

New to version 1.19a
updated 2/5/05

- added Spanish translation text thanks to Darkness_PR. This adds the file SpanishText.cs and adds the SPANISH language option to XmlPoints.cs.
To change to this language in-game, just issue the command "[pointslanguage spanish".
I'll be looking at some of the gump text issues to see about improving spacing and appearance with variable length text in the game gumps.

New to version 1.19
updated 2/5/05

- added a language translation system that allows individual players to see points-related text in their selected language. The default language for a shard can be specified in XmlPoints in the SystemLanguage static variable (ENGLISH by default).
Individual players can change their language by issuing the "[pointslanguage language" command. Presently only english is available.
Anyone who is willing to provide additional language translations, simply make a copy of the EnglishText.cs file, translate the text that it contains into the target language, and send it to me. I will include it with full acknowledgements. (thanks to sUpplier1 for the suggestion).

- the game and gump scripts have been streamlined with a number of common methods moved to BaseChallengeGame.

- added checks for newbie and young status to the challenge system. Experienced players will be prohibited from challenging either players with Young status, or players with insufficient experience (skills and stats). This can be customized by modifying the tests in the YoungProtection() method in XmlPoints.cs. (thanks to sUpplier1 for the suggestion).

- changed the default value for AllowPoints for challenge games to false. This means that by default, there will be no points gained or lost by participating in challenge games. This can be turned back on again if you like.

New to version 1.18
updated 1/24/05

- leaderboard stats are now saved in both XML and HTML formats. The html file can be used directly to display leaderboard stats on a website.

- added total Kills and Deaths to the leaderboard stats and in-game leaderboard display.

New to version 1.17
updated 1/22/05

- For games created within a ChallengeGameRegion when a participant is no longer within a ChallengeGameRegion they will be flagged as out-of-bounds. This is true even if no arena size has been specified or an arena size has been specified that might extend out of any ChallengeGameRegion so the ChallengeGameRegion bounds also serve as the maximum arena size. (thanks to Trying for the suggestion).

- updated the installation instructions for 1.0.0


Description:

This system makes use of the XmlSpawner2 attachment system and the XmlSpawner2 package must be installed to support it. You dont need to use the xmlspawners themselves, and it doesnt matter whether you use the standard distribution spawners or any other spawning system but you do need the XmlSpawner2 package installed.

Because the attachment system neither requires nor makes any changes to serialization/deserializations of any item or mobile (including the playermobile), it can be safely added and removed at any time now or in the future without interfering with any other systems that you might have installed and that includes any existing points system.

Note, only kills by players are recognized by the system. Make sure your accesslevel is player when testing features.

Game Rules:

Capture the Flag rules
The game organizer is responsible for assigning teams and for placing the home bases for each team.

Home bases are placed by clicking the button next to each team entry in the Team Status gump, and then targeting a location. Bases can be placed/repositioned at any time prior to starting a match.

Players capture opponents flags by moving to within 1 tile of the opponents home base when the flag is present. The flag will then be placed in the players backpack and the player will be surrounded with a particle effect in the color of the flag they are carrying.

Flags cannot be placed in containers, given to other players, or placed on the ground.

A player can only carry one flag at a time.

Players score a point by returning to their home base while carrying an opponents flag.

If a player is killed, any flag that they are carrying is returned to its home base. Players will then be autores'd after the specified RespawnTime (default 6 seconds).

If a player remains out of bounds (defined by the arena size) for longer than the allowed time , remains hidden past the allowed hiding time, is offline for longer than the allowed time, or changes maps, any flag they are carrying will be returned to its base.

The game ends when either the target score is reached or when the match timer counts down to zero. The team with the highest score at that point wins and the total purse is divided equally among winning team players.

DeathBall Rules

- The general rules are similar to a Deathmatch with the following differences.

- A target score can be specified, which is the total number of seconds a player must spend carrying the deathball to win.

- When a player picks up the deathball their score will be increased by 1 per second for as long as they carry it. The score will be displayed over the players head and updated in the game gump.

- The first player to reach the target score wins the match.

- If a player is killed, they drop the ball at the location of their death, and are automatically resurrected and returned to the game after the respawn delay (6 sec default),

- Non-participants cannot pick up the Deathball.

- scores do not increase while a player is hidden or out of bounds.

- if a player is disqualified the ball is returned to the gauntlet location and the player is dropped from the match.

King of the Hill Rules

- The general rules are the same as a Last Man Standing match with the following differences.

- A target score can be specified, which is the number of seconds a player must spend as king of the hill to win.

- When a single player occupies the tile on which the KotH challenge gauntlet is placed, their score will be increased by 1 per second. The score will be displayed overhead and updated in the game gump. If more than one player occupies the tile, no scores are incremented.

- The first player to reach the target score wins the match.

- Once a participant is killed, they are out of the game. If only one participant remains, they are declared the winner.

- Any non-participant that tries to occupy the KotH tile will be automatically moved off to a random nearby location to prevent attempts to block the tile.

Deathmatch Rules

- The player that initiates the game is responsible for adding/removing players, setting game conditions, and is responsible for starting the game.

- Individual participants must accept the challenge by selecting the accept button in the Deathmatch gump.

- An optional entry fee in gold that each player must pay in order to participate can be specified. The entry fee will be taken from the players bank account when the game starts.

- The match completion conditions can be specified as a target score or a match length, or both. If a target score > 0 is specified, then the first player to reach that score is the winner. If a match length > 0 is specified, then the player with the highest score at the end of the match is the winner. In the case of a tie, the purse is split between them. If both target score and match length are specified, then the game continues until one of those conditions is met.

- When a participant is killed, their score is reduced by one and they are resurrected with full health/mana/stam. The killer has their score increased by one.

- An optional arena size that defines the valid playing area can be specified.

- Players that leave the arena area, defined by the distance from the challenge gauntlet, will have a specified amount of time to return in bounds before they will be penalized and respawned at the gauntlet location. This time is 15 seconds by default but can be adjusted with the DeathmatchGauntlet static variable MaximumOutOfBoundsDuration.

- Players that become hidden will have a certain amount of time to become visible before they are penalized and made visible. This time is set to 10 seconds by default but can be adjusted with the DeathmatchGauntlet static variable MaximumHiddenDuration.

- Players that are offline will have a certain amount of time to return before they are penalized. This time is set to 60 seconds by default but can be adjusted with the DeathmatchGauntlet static variable MaximumOfflineDuration.

- Players that change maps are immediately penalized and respawned at the gauntlet location.

- While a game is being set up, players can accept or withdraw at any time prior to the game starting.

- Once a game has been started, individual players can drop out of the game by pressing the forfeit button (X) next to their name in the Deathmatch challenge gump.

- Completed challenge gauntlets will remain for a short period before they decay so that players or observers can see the results. The default decay time is 5 minutes but can be adjusted with the DeathmatchGauntlet DecayTime property.

- Players are automatically resurrected with full stats after being killed in the match by default. This can be changed by setting the DeathmatchGauntlet AutoRes property.

- The default interval between killing the same player for points is enforced by default during the match. This can be overridden by changing the DeathmatchGauntlet UseKillDelay property. While you can change this, I would not recommend it due to potential for exploits unless you are running a small non-pvp oriented shard where you dont really care about rankings.

- Note that the organizer of a Challenge game does not have to actually participate in it. This makes it easy for staff to organize matches.

- Players can only participate in one Challenge game or 1 on 1 challenge duel at a time.

- Players can only organize 1 challenge game at a time. Attempting to organize a second challenge game while one is still being set up will result in the first being cancelled.

- Note that changing game conditions after players have already accepted, such as adding/removing players, changing the entry fee, or arena size, will require that players must reaccept the new conditions.

- There is no limit to the number of players that can participate in a Deathmatch game by default. This can be changed with the DeathmatchGump constant MaxTeamSize.

Last Man Standing Rules

- The player that initiates the game is responsible for adding/removing players, setting game conditions, and is responsible for starting the game.

- Individual participants must accept the challenge by selecting the accept button in the LMS gump.

- An optional entry fee in gold that each player must pay in order to participate can be specified. The entry fee will be taken from the players bank account when the game starts.

- Once a participant is killed, they are out of the game. The last remaining participant is the winner. That player takes the purse which is the total of all entry fees.

- An optional arena size that defines the valid playing area can be specified.

- Players that leave the arena area, defined by the distance from the challenge gauntlet, will have a specified amount of time to return in bounds before they will be disqualified. This time is 15 seconds by default but can be adjusted with the LastManStandingGauntlet static variable MaximumOutOfBoundsDuration.

- Players that become hidden will have a certain amount of time to become visible before they will be disqualified. This time is set to 10 seconds by default but can be adjusted with the LastManStandingGauntlet static variable MaximumHiddenDuration.

- Players that are offline will have a certain amount of time to return before they will be disqualified. This time is set to 60 seconds by default but can be adjusted with the LastManStandingGauntlet static variable MaximumOfflineDuration.

- Players that change maps will be immediately disqualified.

- While a game is being set up, players can accept or withdraw at any time prior to the game starting.

- Once a game has been started, individual players can drop out of the game by pressing the forfeit button (X) next to their name in the LMS challenge gump.

- Completed challenge gauntlets will remain for a short period before they decay so that players or observers can see the results. The default decay time is 5 minutes but can be adjusted with the LastManStandingGauntlet DecayTime property.

- Players are automatically resurrected after being killed in the match by default. This can be changed by setting the LastManStandingGauntlet AutoRes property.

- The default interval between killing the same player for points is enforced by default during the match. This can be overridden by changing the LastManStandingGauntlet UseKillDelay property. While you can change this, I would not recommend it due to potential for exploits unless you are running a small non-pvp oriented shard where you dont really care about rankings.

- Note that the organizer of a Challenge game does not have to actually participate in it. This makes it easy for staff to organize matches.

- Players can only participate in one Challenge game or 1 on 1 challenge duel at a time.

- Players can only organize 1 challenge game at a time. Attempting to organize a second challenge game while one is still being set up will result in the first being cancelled.

- Note that changing game conditions after players have already accepted, such as adding/removing players, changing the entry fee, or arena size, will require that players must reaccept the new conditions.

- There is no limit to the number of players that can participate in an LMS match by default. This can be changed with the LastManStandingGump constant MaxTeamSize.

- The challenge gump lists the total number of participants in the Players: field, and the number of remaining participants in the Active: field.


Features:

Points - accumulated or lost based upon PvP kills or deaths, these are used to rank players. Individual and shard-wide standings can be displayed. Amount of Point loss or gain can be made dependent upon the relative Point difference between the players, providing additional incentives for taking on players with higher ranking, and penalties for losing to players of lower ranking. The system can also be configured for automatic point loss if the player does not engage in pvp activity over the specified time window.

Rankings - relative Points standing of players on a shard is maintained and can be displayed for individuals as well as for the entire shard (the top 20). If the Item Identification feature of the XmlSpawner2 installation is enabled (XmlSpawner2 installation step 8), the skill can be used to examine the points and standing of other players as well. Using the [leaderboardsave command, shardwide ranking information can also be periodically saved to a specified xml file.

Duels - The challenge system allows 1-on-1 consensual pvp between players for points.

Challenge Games - The challenge game system supports multi-player consensual pvp games. Current Games: Last Man Standing, Deathmatch, King of the Hill, DeathBall, Team Last Man Standing, Team Deathmatch, Team Deathball, Team King of the Hill, Capture the Flag.

Credits - accumulated through PvP kills, these are used to purchase PvP rewards.

Rewards - the PointsRewardStone allows players to exchange kill credits that are accumulated through PvP activity for rewards including items, mobiles, or attachments. These can be defined in XmlPointReward.cs. Minimum points requirements can also be specified in addition to credit requirements for each reward. To place this just do an "[add pointsrewardstone"


Commands Supported:

[getatt - this is the general command from the XmlSpawner2 package for displaying/modifying/deleting attachments on a target. Just execute the command and target a player to open the attachment list. From there you can open the xmlpoints properties by finding the xmlpoints attachment on the list, and selecting the button on the left, or display the points gump by pressing the question mark button on the right. This command is available to GMs or higher only.

[addallpoints - this command will add the xmlpoints attachment to all current players that dont have it yet and can only be run by an administrator.

[removeallpoints - this command will remove the xmlpoints attachment from all current players and can only be run by an administrator.

[checkpoints - this command can be run by players to report their current points standing including rank, available credits, number of kills, number of deaths, and recent kill list (this is the same as using the item identification skill on themselves if that feature has been enabled through XmlSpawner2 installation step 8)

[pointslanguage language - this command can be run by players to change the language in which points-related text appears to them. English and Spanish are currently supported.

showpoints - when players type this it publicly displays their points overhead.

[topplayers - this command can be run by players to list the current top 20 players ranked by points. This can also be invoked through the points gump.

[challenge - this command can be run by players to allow challenge duels for points. Just issue the command and target another player. The targeted player can then accept or decline the challenge. This can also be invoked through the points gump.

[lmschallenge - this command can be run by players to create a last man standing challenge game.

[deathmatch - this command can be run by players to create a deathmatch challenge game.

[kingofthehill - this command can be run by players to create a king of the hill challenge game.

[deathball - this command can be run by players to create a death ball challenge game.

[teamlmschallenge - this command can be run by players to create a team last man standing challenge game.

[teamdeathmatch - this command can be run by players to create a teamdeathmatch challenge game.

[teamkoth - this command can be run by players to create a new Team king of the hill challenge game.

[teamdeathball - this command can be run by players to create a new Team Deathball challenge game.

[ctfchallenge - this command can be run by players to create a new Capture the Flag challenge game.


[seekills - this command can be run by players to allow them to control whether or not they see the broadcast results of pvp kills. This can also be set through the points gump.

[broadcastkill - this command can be run by players to toggle system-wide broadcasts of their pvp-kills. Broadcast is determined by the winners setting. This can also be set through the points gump.

[systembroadcastkill - this command can be run by GMs to allow system-wide GM override of player BroadcastKill settings. When set to false, no results will be broadcast. When set to true, results will again be broadcast based on players BroadcastKill settings.

[leaderboardsave - this command can be run by administrators to enable/disable the periodic saving of xml and html leaderboard information to a specified file.


Default settings that can be modified:

- There is a 6 hour minimum time between kills of the same player for point gain. This is set by the static variable m_KillDelay.

- There is a 60 second minimum time between deaths of a player for point loss. This is set by the static variable m_DeathDelay.

- Points gained/lost can depend upon the point difference between the players. Default setting is 5% of the point difference. The percentage gain/loss is set by the m_WinScale and m_LoseScale static variables and this can be changed to whatever you like. If it is set to zero then gain/loss will be fixed at 1 point per kill.

For example, if player1 with 500 points killed player2 with 100 points, player1 would only gain the minimum of 1 point and player2 would lose the minimum of 1 point. But if player2 killed player1, player2 would gain 20 points (5% of 400) and player1 would lose 20 points.

- Credits gained can depend upon the point difference between the players. Default setting is 5% of the point difference. Set by the m_CreditScale

- Players start off with a default of 100 points, set on m_Points.

- broadcasting of kills is on by default. This is set by the m_Broadcast (for players) and m_SystemBroadcast (for GM override) variables.

- rewards can be specified by adding/removing entries to the PointsRewardList in the Initialize method in XmlPointsReward.cs.

- leaderboard save settings can be specified on the command line to the [leaderboardsave command, with default values set in the m_LeaderboardSaveInterval (default 15 mins), m_LeaderboardSaveDirectory (default "Leaderboard"), and m_LeaderboardSaveRanks (default 20) static variables.

- for automatic point loss if the player does not engage in pvp activity the amount of loss and time period can be configured by setting the m_PointsDecay (10 points default) and m_PointsDecayTime ( 15 days default) static variables.

- receiving kill broadcasts is on by default set by the m_ReceiveBroadcasts variable.

- challenges can be cancelled by issuing another challenge and targeting another player (self-target is allowed for this purpose). There is a 15 minute timeout from the time the cancellation request is made. This default time can be changed in the static variable CancelTimeout.


Installation:
for 1.0.0.

STEP 1:
Install the latest XmlSpawner2 package (must be at least version 2.70. You can find it here XmlSpawner2). You must perform installation step 6 from the XmlSpawner2 thread otherwise the system wont recognize kills and nothing will seem to work. I would also recommend going through installation step 8 to enable the use of the ItemIdentification skill for checking point status on players, but this is optional.
Note, if you do not install any of the optional support files (in particular XmlSpawner2-support1of2.zip) then some of the sample attachment rewards in XmlPointsRewards will not be available. You can either install that support package or just comment out lines 54 and 55 in XmlPointsRewards.cs that refer to the XmlEnemyMastery and XmlStr attachments.

STEP 2:
Place the scripts from this package into your custom scripts directory, or into the XmlAttachments area of your XmlSpawner2 installation. (anywhere in your Scripts folder is fine, these locations are suggested for organizational purposes only).

STEP 3:
Add points support to all existing players while ingame using the command "[addallpoints". If you change your mind and decide to remove it, you can use the "[removeallpoints" command. If you would just like to add it to specific players you can use the "[addatt xmlpoints" command and target a player.

STEP 4:
To automatically add xmlpoints support to newly created characters, add the following line to the end of the EventSink_CharacterCreated method in CharacterCreation.cs

around line 664 of Scripts/Misc/CharacterCreation.cs change
Code:
	new WelcomeTimer( newChar ).Start();
to
Code:
	new WelcomeTimer( newChar ).Start();

	// mod to attach the XmlPoints attachment automatically to new chars
	XmlAttach.AttachTo(newChar, new XmlPoints());
also at the top of the file add the line
Code:
using Server.Engines.XmlSpawner2;

STEP 5:
To support consensual pvp between players for points through the use of Challenges, make the following two changes in Scripts/Misc/Notoriety.cs

in the Mobile_AllowHarmful method around line 112 change
Code:
		return true; // Uncontroled NPCs are only restricted by the young system
	}
to
Code:
		return true; // Uncontroled NPCs are only restricted by the young system
	}
				
	// XmlPoints challenge mod
	if(XmlPoints.AreChallengers(from,target))
                return true;
and in the MobileNotoriety method around line 279 make the following change. Look carefully when making this change, it is easy to accidentally put this in the CorpseNotoriety method which looks very similar to MobileNotoriety.
Code:
	if ( target.Criminal )
		return Notoriety.Criminal;
to
Code:
	if ( target.Criminal )
		return Notoriety.Criminal;

	// XmlPoints challenge mod
	if(XmlPoints.AreTeamMembers(source,target))
                	return Notoriety.Ally;
	else
	if(XmlPoints.AreChallengers(source,target))
                	return Notoriety.Enemy;
also at the top of the file add the line
Code:
using Server.Engines.XmlSpawner2;

STEP 6:
To support overriding insurance fees/award during challenge games, make the following change in Scripts/Mobiles/PlayerMobile.cs

in the CheckInsuranceOnDeath method around line 1447 change
Code:
private bool CheckInsuranceOnDeath( Item item )
{
	if ( InsuranceEnabled && item.Insured )
	{
to
Code:
private bool CheckInsuranceOnDeath( Item item )
{
	if ( InsuranceEnabled && item.Insured )
	{
                // XmlPoints mod to support overriding insurance fees/awards during challenge games
                if(XmlPoints.InsuranceIsFree(this, m_InsuranceAward))
                {
                    item.PayedInsurance = true;
                    return true;
                }

also at the top of the file add the line
Code:
using Server.Engines.XmlSpawner2;

STEP 7:
to allow beneficial acts between team members make the following change in Scripts/Misc/Notoriety.cs

in the Mobile_AllowBeneficial method around line 82 change
Code:
	if ( target is BaseCreature && !((BaseCreature)target).Controled )
		return false; // Players cannot heal uncontroled mobiles
to
Code:
	if ( target is BaseCreature && !((BaseCreature)target).Controled )
		return false; // Players cannot heal uncontroled mobiles
				
	// XmlPoints challenge mod
	if(XmlPoints.AreInAnyGame(target))
                	return XmlPoints.AreTeamMembers(from,target);
 

Attachments

  • XmlPoints-v123-2of2.zip
    85.9 KB · Views: 726
  • XmlPoints-v123-1of2.zip
    52.6 KB · Views: 711

ArteGordon

Wanderer
updated to version 1.17

from the changelog

New to version 1.17
updated 1/22/05

- For games created within a ChallengeGameRegion when a participant is no longer within a ChallengeGameRegion they will be flagged as out-of-bounds. This is true even if no arena size has been specified or an arena size has been specified that might extend out of any ChallengeGameRegion so the ChallengeGameRegion bounds also serve as the maximum arena size. (thanks to Trying for the suggestion).

- updated the installation instructions for 1.0.0
 

Seven

Sorceror
I forgot to ask you arte does the xmlpoints allow you to post the points on the web? I mean does it create a ladder.html or somthing in /web/ ?
 

ArteGordon

Wanderer
Seven said:
I forgot to ask you arte does the xmlpoints allow you to post the points on the web? I mean does it create a ladder.html or somthing in /web/ ?

well, it creates a .xml file with the leaderboard stats in it and places it in a folder called Leaderboard in your RunUO installation directory. That file gets updated at regular intervals that you specify.
You would still have to format that data for your web page display.
 

Seven

Sorceror
hmm... ok... have you tried making it create a .html ? I think that would be a nice feature to add :) I still have the ladder.cs script that was for the NoX Point system if you wanted to mess with it to make it work for xmlpoints?
BTW: I have it running smoothly on my shard except for the norierty steps... caused errors with it.
 

ArteGordon

Wanderer
I could have it make an html file as well with the leaderboard info in it. Fancy html is not my thing, but I can do a table easily enough.

What problems are you having with notoriety.cs?
 

Seven

Sorceror
I'll have to add the code in again and copy/past it...

But no, it would be nice for you to do somthing simple like the default webstatus ;)

I think alot of people would enjoy that :}

oh btw do you think you can add the option for people to cancle the match?
Somepeople on my server use it then didn't know how to get rid of it. I just don't want to be going around and [delete all the time ^^
 

ArteGordon

Wanderer
I just added in the html leaderboard save. It looks fine. It puts it all into an html table. It will be in the next update.

As for canceling matches, there is a little X button next to each participants name in their game gump. This lets them drop out of any match.
 

ArteGordon

Wanderer
updated to version 1.18

from the changelog

New to version 1.18
updated 1/24/05
- leaderboard stats are now saved in both XMl and HTML formats. The html file can be used directly to display leaderboard stats on a website.

- added total Kills and Deaths to the leaderboard stats and in-game leaderboard display.
 

nitewender

Wanderer
heres just the errors I can see for Notoriety
Line 220 and 223 Connot convert from 'Server.Items.Corpse' to 'Server.Mobile'
Line 223 The best overload match for 'Server.Engines.XmlSpawner2.XmlPoints.AreChallengers(Server.Mobile, Server.Mobile)' has some invalid arguments


Heres my Notoriety.cs
Code:
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Guilds;
using Server.Multis;
using Server.Mobiles;
using Server.Engines.PartySystem;
using Server.Engines.XmlSpawner2;
using Server.Factions;

namespace Server.Misc
{
	public class NotorietyHandlers
	{
		public static void Initialize()
		{
			Notoriety.Hues[Notoriety.Innocent]		= 0x59;
			Notoriety.Hues[Notoriety.Ally]			= 0x3F;
			Notoriety.Hues[Notoriety.CanBeAttacked]	= 0x3B2;
			Notoriety.Hues[Notoriety.Criminal]		= 0x3B2;
			Notoriety.Hues[Notoriety.Enemy]			= 0x90;
			Notoriety.Hues[Notoriety.Murderer]		= 0x22;
			Notoriety.Hues[Notoriety.Invulnerable]	= 0x35;

			Notoriety.Handler = new NotorietyHandler( MobileNotoriety );

			Mobile.AllowBeneficialHandler = new AllowBeneficialHandler( Mobile_AllowBeneficial );
			Mobile.AllowHarmfulHandler = new AllowHarmfulHandler( Mobile_AllowHarmful );
		}

		private enum GuildStatus{ None, Peaceful, Waring }

		private static GuildStatus GetGuildStatus( Mobile m )
		{
			if ( m.Guild == null )
				return GuildStatus.None;
			else if ( ((Guild)m.Guild).Enemies.Count == 0 && m.Guild.Type == GuildType.Regular )
				return GuildStatus.Peaceful;

			return GuildStatus.Waring;
		}

		private static bool CheckBeneficialStatus( GuildStatus from, GuildStatus target )
		{
			if ( from == GuildStatus.Waring || target == GuildStatus.Waring )
				return false;

			return true;
		}

		/*private static bool CheckHarmfulStatus( GuildStatus from, GuildStatus target )
		{
			if ( from == GuildStatus.Waring && target == GuildStatus.Waring )
				return true;

			return false;
		}*/

		public static bool Mobile_AllowBeneficial( Mobile from, Mobile target )
		{
			if ( from == null || target == null )
				return true;

			#region Factions
			Faction targetFaction = Faction.Find( target, true );

			if ( targetFaction != null )
			{
				if ( Faction.Find( from, true ) != targetFaction )
					return false;
			}
			#endregion

			Map map = from.Map;

			if ( map != null && (map.Rules & MapRules.BeneficialRestrictions) == 0 )
				return true; // In felucca, anything goes

			if ( !from.Player )
				return true; // NPCs have no restrictions

			if ( target is BaseCreature && !((BaseCreature)target).Controled )
				return false; // Players cannot heal uncontroled mobiles

			if ( from is PlayerMobile && ((PlayerMobile)from).Young && ( !(target is PlayerMobile) || !((PlayerMobile)target).Young ) )
				return false; // Young players cannot perform beneficial actions towards older players

			Guild fromGuild = from.Guild as Guild;
			Guild targetGuild = target.Guild as Guild;

			if ( fromGuild != null && targetGuild != null && (targetGuild == fromGuild || fromGuild.IsAlly( targetGuild )) )
				return true; // Guild members can be beneficial

			return CheckBeneficialStatus( GetGuildStatus( from ), GetGuildStatus( target ) );
		}

		public static bool Mobile_AllowHarmful( Mobile from, Mobile target )
		{
			if ( from == null || target == null )
				return true;

			Map map = from.Map;

			if ( map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0 )
				return true; // In felucca, anything goes

			if ( !from.Player && !(from is BaseCreature && (((BaseCreature)from).Controled || ((BaseCreature)from).Summoned)) )
			{
				if ( !CheckAggressor( from.Aggressors, target ) && !CheckAggressed( from.Aggressed, target ) && target is PlayerMobile && ((PlayerMobile)target).CheckYoungProtection( from ) )
					return false;

			return true; // Uncontroled NPCs are only restricted by the young system
	}
				
	// XmlPoints challenge mod
	if(XmlPoints.AreChallengers(from,target))
                return true;
			Guild fromGuild = GetGuildFor( from.Guild as Guild, from );
			Guild targetGuild = GetGuildFor( target.Guild as Guild, target );

			if ( fromGuild != null && targetGuild != null && (fromGuild == targetGuild || fromGuild.IsAlly( targetGuild ) || fromGuild.IsEnemy( targetGuild )) )
				return true; // Guild allies or enemies can be harmful

			if ( target is BaseCreature && (((BaseCreature)target).Controled || (((BaseCreature)target).Summoned && from != ((BaseCreature)target).SummonMaster)) )
				return false; // Cannot harm other controled mobiles

			if ( target.Player )
				return false; // Cannot harm other players

			if ( !(target is BaseCreature && ((BaseCreature)target).InitialInnocent) )
			{
				if ( Notoriety.Compute( from, target ) == Notoriety.Innocent )
					return false; // Cannot harm innocent mobiles
			}

			return true;
		}

		public static Guild GetGuildFor( Guild def, Mobile m )
		{
			Guild g = def;

			BaseCreature c = m as BaseCreature;

			if ( c != null && c.Controled && c.ControlMaster != null )
			{
				c.DisplayGuildTitle = false;

				if ( c.Map != Map.Internal && (c.ControlOrder == OrderType.Attack || c.ControlOrder == OrderType.Guard) )
					g = (Guild)(c.Guild = c.ControlMaster.Guild);
				else if ( c.Map == Map.Internal || c.ControlMaster.Guild == null )
					g = (Guild)(c.Guild = null);
			}

			return g;
		}

		public static int CorpseNotoriety( Mobile source, Corpse target )
		{
			if ( target.AccessLevel > AccessLevel.Player )
				return Notoriety.CanBeAttacked;

			Body body = (Body) target.Amount;

			BaseCreature cretOwner = target.Owner as BaseCreature;

			if ( cretOwner != null )
			{
				Guild sourceGuild = GetGuildFor( source.Guild as Guild, source );
				Guild targetGuild = GetGuildFor( target.Guild as Guild, target.Owner );

				if ( sourceGuild != null && targetGuild != null )
				{
					if ( sourceGuild == targetGuild || sourceGuild.IsAlly( targetGuild ) )
						return Notoriety.Ally;
					else if ( sourceGuild.IsEnemy( targetGuild ) )
						return Notoriety.Enemy;
				}

				Faction srcFaction = Faction.Find( source, true, true );
				Faction trgFaction = Faction.Find( target.Owner, true, true );

				if ( srcFaction != null && trgFaction != null && srcFaction != trgFaction && source.Map == Faction.Facet )
					return Notoriety.Enemy;

				if ( CheckHouseFlag( source, target.Owner, target.Location, target.Map ) )
					return Notoriety.CanBeAttacked;

				int actual = Notoriety.CanBeAttacked;

				if ( target.Kills >= 5 || (body.IsMonster && IsSummoned( target.Owner as BaseCreature )) || (target.Owner is BaseCreature && (((BaseCreature)target.Owner).AlwaysMurderer || ((BaseCreature)target.Owner).IsAnimatedDead)) )
					actual = Notoriety.Murderer;

				if ( DateTime.Now >= (target.TimeOfDeath + Corpse.MonsterLootRightSacrifice) )
					return actual;

				Party sourceParty = Party.Get( source );

				ArrayList list = target.Aggressors;

				for ( int i = 0; i < list.Count; ++i )
				{
					if ( list[i] == source || (sourceParty != null && Party.Get( (Mobile)list[i] ) == sourceParty) )
						return actual;
				}

				return Notoriety.Innocent;
			}
			else
			{
				if ( target.Kills >= 5 || (body.IsMonster && IsSummoned( target.Owner as BaseCreature )) || (target.Owner is BaseCreature && (((BaseCreature)target.Owner).AlwaysMurderer || ((BaseCreature)target.Owner).IsAnimatedDead)) )
					return Notoriety.Murderer;


	if ( target.Criminal )
		return Notoriety.Criminal;

	// XmlPoints challenge mod
	if(XmlPoints.AreTeamMembers(source,target))
                	return Notoriety.Ally;
	else
	if(XmlPoints.AreChallengers(source,target))
                	return Notoriety.Enemy;

				Guild sourceGuild = GetGuildFor( source.Guild as Guild, source );
				Guild targetGuild = GetGuildFor( target.Guild as Guild, target.Owner );

				if ( sourceGuild != null && targetGuild != null )
				{
					if ( sourceGuild == targetGuild || sourceGuild.IsAlly( targetGuild ) )
						return Notoriety.Ally;
					else if ( sourceGuild.IsEnemy( targetGuild ) )
						return Notoriety.Enemy;
				}

				Faction srcFaction = Faction.Find( source, true, true );
				Faction trgFaction = Faction.Find( target.Owner, true, true );

				if ( srcFaction != null && trgFaction != null && srcFaction != trgFaction && source.Map == Faction.Facet )
				{
					ArrayList secondList = target.Aggressors;

					for ( int i = 0; i < secondList.Count; ++i )
					{
						if ( secondList[i] == source || secondList[i] is BaseFactionGuard )
							return Notoriety.Enemy;
					}
				}

				if ( target.Owner != null && target.Owner is BaseCreature && ((BaseCreature)target.Owner).AlwaysAttackable )
					return Notoriety.CanBeAttacked;

				if ( CheckHouseFlag( source, target.Owner, target.Location, target.Map ) )
					return Notoriety.CanBeAttacked;

				if ( !(target.Owner is PlayerMobile) && !IsPet( target.Owner as BaseCreature ) )
					return Notoriety.CanBeAttacked;

				ArrayList list = target.Aggressors;

				for ( int i = 0; i < list.Count; ++i )
				{
					if ( list[i] == source )
						return Notoriety.CanBeAttacked;
				}

				return Notoriety.Innocent;
			}
		}

		public static int MobileNotoriety( Mobile source, Mobile target )
		{
			if ( Core.AOS && (target.Blessed || (target is BaseVendor && ((BaseVendor)target).IsInvulnerable) || target is PlayerVendor || target is TownCrier) )
				return Notoriety.Invulnerable;

			if ( target.AccessLevel > AccessLevel.Player )
				return Notoriety.CanBeAttacked;

			if ( source.Player && !target.Player && source is PlayerMobile && target is BaseCreature )
			{
				BaseCreature bc = (BaseCreature)target;

				if ( !bc.Summoned && !bc.Controled && ((PlayerMobile)source).EnemyOfOneType == target.GetType() )
					return Notoriety.Enemy;
			}

			if ( target.Kills >= 5 || (target.Body.IsMonster && IsSummoned( target as BaseCreature ) && !(target is BaseFamiliar) && !(target is Golem)) || (target is BaseCreature && (((BaseCreature)target).AlwaysMurderer || ((BaseCreature)target).IsAnimatedDead)) )
				return Notoriety.Murderer;

			if ( target.Criminal )
				return Notoriety.Criminal;

			Guild sourceGuild = GetGuildFor( source.Guild as Guild, source );
			Guild targetGuild = GetGuildFor( target.Guild as Guild, target );

			if ( sourceGuild != null && targetGuild != null )
			{
				if ( sourceGuild == targetGuild || sourceGuild.IsAlly( targetGuild ) )
					return Notoriety.Ally;
				else if ( sourceGuild.IsEnemy( targetGuild ) )
					return Notoriety.Enemy;
			}

			Faction srcFaction = Faction.Find( source, true, true );
			Faction trgFaction = Faction.Find( target, true, true );

			if ( srcFaction != null && trgFaction != null && srcFaction != trgFaction && source.Map == Faction.Facet )
				return Notoriety.Enemy;

			if ( SkillHandlers.Stealing.ClassicMode && target is PlayerMobile && ((PlayerMobile)target).PermaFlags.Contains( source ) )
				return Notoriety.CanBeAttacked;

			if ( target is BaseCreature && ((BaseCreature)target).AlwaysAttackable )
				return Notoriety.CanBeAttacked;

			if ( CheckHouseFlag( source, target, target.Location, target.Map ) )
				return Notoriety.CanBeAttacked;

			if ( !(target is BaseCreature && ((BaseCreature)target).InitialInnocent) )
			{
				if ( !target.Body.IsHuman && !target.Body.IsGhost && !IsPet( target as BaseCreature ) && !Server.Spells.Necromancy.TransformationSpell.UnderTransformation( target ) )
					return Notoriety.CanBeAttacked;
			}

			if ( CheckAggressor( source.Aggressors, target ) )
				return Notoriety.CanBeAttacked;

			if ( CheckAggressed( source.Aggressed, target ) )
				return Notoriety.CanBeAttacked;

			if ( target is BaseCreature )
			{
				BaseCreature bc = (BaseCreature)target;

				if ( bc.Controled && bc.ControlOrder == OrderType.Guard && bc.ControlTarget == source )
					return Notoriety.CanBeAttacked;
			}

			if ( source is BaseCreature )
			{
				BaseCreature bc = (BaseCreature)source;

				Mobile master = bc.GetMaster();
				if( master != null && CheckAggressor( master.Aggressors, target ))
					return Notoriety.CanBeAttacked;
			}

			return Notoriety.Innocent;
		}

		public static bool CheckHouseFlag( Mobile from, Mobile m, Point3D p, Map map )
		{
			BaseHouse house = BaseHouse.FindHouseAt( p, map, 16 );

			if ( house == null || house.Public || !house.IsFriend( from ) )
				return false;

			if ( m != null && house.IsFriend( m ) )
				return false;

			BaseCreature c = m as BaseCreature;

			if ( c != null && !c.Deleted && c.Controled && c.ControlMaster != null )
				return !house.IsFriend( c.ControlMaster );

			return true;
		}

		public static bool IsPet( BaseCreature c )
		{
			return ( c != null && c.Controled );
		}

		public static bool IsSummoned( BaseCreature c )
		{
			return ( c != null && /*c.Controled &&*/ c.Summoned );
		}

		public static bool CheckAggressor( ArrayList list, Mobile target )
		{
			for ( int i = 0; i < list.Count; ++i )
				if ( ((AggressorInfo)list[i]).Attacker == target )
					return true;

			return false;
		}

		public static bool CheckAggressed( ArrayList list, Mobile target )
		{
			for ( int i = 0; i < list.Count; ++i )
			{
				AggressorInfo info = (AggressorInfo)list[i];

				if ( !info.CriminalAggression && info.Defender == target )
					return true;
			}

			return false;
		}
	}
}

any idea? Only get these errors when I add your edits.
 

Seven

Sorceror
Arte I mean the creator of the match.
Some players use it and when they did it didn't know what it does...
And when I was testing it out I created a CTF game but didn't know how to cancle it. The only thing, that i knew of to get rid of it was delete the gloves.
 

ArteGordon

Wanderer
nitewender said:
heres just the errors I can see for Notoriety
Line 220 and 223 Connot convert from 'Server.Items.Corpse' to 'Server.Mobile'
Line 223 The best overload match for 'Server.Engines.XmlSpawner2.XmlPoints.AreChallengers(Server.Mobile, Server.Mobile)' has some invalid arguments


Heres my Notoriety.cs
Code:
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Guilds;
using Server.Multis;
using Server.Mobiles;
using Server.Engines.PartySystem;
using Server.Engines.XmlSpawner2;
using Server.Factions;

namespace Server.Misc
{
	public class NotorietyHandlers
	{
		public static void Initialize()
		{
			Notoriety.Hues[Notoriety.Innocent]		= 0x59;
			Notoriety.Hues[Notoriety.Ally]			= 0x3F;
			Notoriety.Hues[Notoriety.CanBeAttacked]	= 0x3B2;
			Notoriety.Hues[Notoriety.Criminal]		= 0x3B2;
			Notoriety.Hues[Notoriety.Enemy]			= 0x90;
			Notoriety.Hues[Notoriety.Murderer]		= 0x22;
			Notoriety.Hues[Notoriety.Invulnerable]	= 0x35;

			Notoriety.Handler = new NotorietyHandler( MobileNotoriety );

			Mobile.AllowBeneficialHandler = new AllowBeneficialHandler( Mobile_AllowBeneficial );
			Mobile.AllowHarmfulHandler = new AllowHarmfulHandler( Mobile_AllowHarmful );
		}

		private enum GuildStatus{ None, Peaceful, Waring }

		private static GuildStatus GetGuildStatus( Mobile m )
		{
			if ( m.Guild == null )
				return GuildStatus.None;
			else if ( ((Guild)m.Guild).Enemies.Count == 0 && m.Guild.Type == GuildType.Regular )
				return GuildStatus.Peaceful;

			return GuildStatus.Waring;
		}

		private static bool CheckBeneficialStatus( GuildStatus from, GuildStatus target )
		{
			if ( from == GuildStatus.Waring || target == GuildStatus.Waring )
				return false;

			return true;
		}

		/*private static bool CheckHarmfulStatus( GuildStatus from, GuildStatus target )
		{
			if ( from == GuildStatus.Waring && target == GuildStatus.Waring )
				return true;

			return false;
		}*/

		public static bool Mobile_AllowBeneficial( Mobile from, Mobile target )
		{
			if ( from == null || target == null )
				return true;

			#region Factions
			Faction targetFaction = Faction.Find( target, true );

			if ( targetFaction != null )
			{
				if ( Faction.Find( from, true ) != targetFaction )
					return false;
			}
			#endregion

			Map map = from.Map;

			if ( map != null && (map.Rules & MapRules.BeneficialRestrictions) == 0 )
				return true; // In felucca, anything goes

			if ( !from.Player )
				return true; // NPCs have no restrictions

			if ( target is BaseCreature && !((BaseCreature)target).Controled )
				return false; // Players cannot heal uncontroled mobiles

			if ( from is PlayerMobile && ((PlayerMobile)from).Young && ( !(target is PlayerMobile) || !((PlayerMobile)target).Young ) )
				return false; // Young players cannot perform beneficial actions towards older players

			Guild fromGuild = from.Guild as Guild;
			Guild targetGuild = target.Guild as Guild;

			if ( fromGuild != null && targetGuild != null && (targetGuild == fromGuild || fromGuild.IsAlly( targetGuild )) )
				return true; // Guild members can be beneficial

			return CheckBeneficialStatus( GetGuildStatus( from ), GetGuildStatus( target ) );
		}

		public static bool Mobile_AllowHarmful( Mobile from, Mobile target )
		{
			if ( from == null || target == null )
				return true;

			Map map = from.Map;

			if ( map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0 )
				return true; // In felucca, anything goes

			if ( !from.Player && !(from is BaseCreature && (((BaseCreature)from).Controled || ((BaseCreature)from).Summoned)) )
			{
				if ( !CheckAggressor( from.Aggressors, target ) && !CheckAggressed( from.Aggressed, target ) && target is PlayerMobile && ((PlayerMobile)target).CheckYoungProtection( from ) )
					return false;

			return true; // Uncontroled NPCs are only restricted by the young system
	}
				
	// XmlPoints challenge mod
	if(XmlPoints.AreChallengers(from,target))
                return true;
			Guild fromGuild = GetGuildFor( from.Guild as Guild, from );
			Guild targetGuild = GetGuildFor( target.Guild as Guild, target );

			if ( fromGuild != null && targetGuild != null && (fromGuild == targetGuild || fromGuild.IsAlly( targetGuild ) || fromGuild.IsEnemy( targetGuild )) )
				return true; // Guild allies or enemies can be harmful

			if ( target is BaseCreature && (((BaseCreature)target).Controled || (((BaseCreature)target).Summoned && from != ((BaseCreature)target).SummonMaster)) )
				return false; // Cannot harm other controled mobiles

			if ( target.Player )
				return false; // Cannot harm other players

			if ( !(target is BaseCreature && ((BaseCreature)target).InitialInnocent) )
			{
				if ( Notoriety.Compute( from, target ) == Notoriety.Innocent )
					return false; // Cannot harm innocent mobiles
			}

			return true;
		}

		public static Guild GetGuildFor( Guild def, Mobile m )
		{
			Guild g = def;

			BaseCreature c = m as BaseCreature;

			if ( c != null && c.Controled && c.ControlMaster != null )
			{
				c.DisplayGuildTitle = false;

				if ( c.Map != Map.Internal && (c.ControlOrder == OrderType.Attack || c.ControlOrder == OrderType.Guard) )
					g = (Guild)(c.Guild = c.ControlMaster.Guild);
				else if ( c.Map == Map.Internal || c.ControlMaster.Guild == null )
					g = (Guild)(c.Guild = null);
			}

			return g;
		}

		public static int CorpseNotoriety( Mobile source, Corpse target )
		{
			if ( target.AccessLevel > AccessLevel.Player )
				return Notoriety.CanBeAttacked;

			Body body = (Body) target.Amount;

			BaseCreature cretOwner = target.Owner as BaseCreature;

			if ( cretOwner != null )
			{
				Guild sourceGuild = GetGuildFor( source.Guild as Guild, source );
				Guild targetGuild = GetGuildFor( target.Guild as Guild, target.Owner );

				if ( sourceGuild != null && targetGuild != null )
				{
					if ( sourceGuild == targetGuild || sourceGuild.IsAlly( targetGuild ) )
						return Notoriety.Ally;
					else if ( sourceGuild.IsEnemy( targetGuild ) )
						return Notoriety.Enemy;
				}

				Faction srcFaction = Faction.Find( source, true, true );
				Faction trgFaction = Faction.Find( target.Owner, true, true );

				if ( srcFaction != null && trgFaction != null && srcFaction != trgFaction && source.Map == Faction.Facet )
					return Notoriety.Enemy;

				if ( CheckHouseFlag( source, target.Owner, target.Location, target.Map ) )
					return Notoriety.CanBeAttacked;

				int actual = Notoriety.CanBeAttacked;

				if ( target.Kills >= 5 || (body.IsMonster && IsSummoned( target.Owner as BaseCreature )) || (target.Owner is BaseCreature && (((BaseCreature)target.Owner).AlwaysMurderer || ((BaseCreature)target.Owner).IsAnimatedDead)) )
					actual = Notoriety.Murderer;

				if ( DateTime.Now >= (target.TimeOfDeath + Corpse.MonsterLootRightSacrifice) )
					return actual;

				Party sourceParty = Party.Get( source );

				ArrayList list = target.Aggressors;

				for ( int i = 0; i < list.Count; ++i )
				{
					if ( list[i] == source || (sourceParty != null && Party.Get( (Mobile)list[i] ) == sourceParty) )
						return actual;
				}

				return Notoriety.Innocent;
			}
			else
			{
				if ( target.Kills >= 5 || (body.IsMonster && IsSummoned( target.Owner as BaseCreature )) || (target.Owner is BaseCreature && (((BaseCreature)target.Owner).AlwaysMurderer || ((BaseCreature)target.Owner).IsAnimatedDead)) )
					return Notoriety.Murderer;


	if ( target.Criminal )
		return Notoriety.Criminal;

	// XmlPoints challenge mod
	if(XmlPoints.AreTeamMembers(source,target))
                	return Notoriety.Ally;
	else
	if(XmlPoints.AreChallengers(source,target))
                	return Notoriety.Enemy;

				Guild sourceGuild = GetGuildFor( source.Guild as Guild, source );
				Guild targetGuild = GetGuildFor( target.Guild as Guild, target.Owner );

				if ( sourceGuild != null && targetGuild != null )
				{
					if ( sourceGuild == targetGuild || sourceGuild.IsAlly( targetGuild ) )
						return Notoriety.Ally;
					else if ( sourceGuild.IsEnemy( targetGuild ) )
						return Notoriety.Enemy;
				}

				Faction srcFaction = Faction.Find( source, true, true );
				Faction trgFaction = Faction.Find( target.Owner, true, true );

				if ( srcFaction != null && trgFaction != null && srcFaction != trgFaction && source.Map == Faction.Facet )
				{
					ArrayList secondList = target.Aggressors;

					for ( int i = 0; i < secondList.Count; ++i )
					{
						if ( secondList[i] == source || secondList[i] is BaseFactionGuard )
							return Notoriety.Enemy;
					}
				}

				if ( target.Owner != null && target.Owner is BaseCreature && ((BaseCreature)target.Owner).AlwaysAttackable )
					return Notoriety.CanBeAttacked;

				if ( CheckHouseFlag( source, target.Owner, target.Location, target.Map ) )
					return Notoriety.CanBeAttacked;

				if ( !(target.Owner is PlayerMobile) && !IsPet( target.Owner as BaseCreature ) )
					return Notoriety.CanBeAttacked;

				ArrayList list = target.Aggressors;

				for ( int i = 0; i < list.Count; ++i )
				{
					if ( list[i] == source )
						return Notoriety.CanBeAttacked;
				}

				return Notoriety.Innocent;
			}
		}

		public static int MobileNotoriety( Mobile source, Mobile target )
		{
			if ( Core.AOS && (target.Blessed || (target is BaseVendor && ((BaseVendor)target).IsInvulnerable) || target is PlayerVendor || target is TownCrier) )
				return Notoriety.Invulnerable;

			if ( target.AccessLevel > AccessLevel.Player )
				return Notoriety.CanBeAttacked;

			if ( source.Player && !target.Player && source is PlayerMobile && target is BaseCreature )
			{
				BaseCreature bc = (BaseCreature)target;

				if ( !bc.Summoned && !bc.Controled && ((PlayerMobile)source).EnemyOfOneType == target.GetType() )
					return Notoriety.Enemy;
			}

			if ( target.Kills >= 5 || (target.Body.IsMonster && IsSummoned( target as BaseCreature ) && !(target is BaseFamiliar) && !(target is Golem)) || (target is BaseCreature && (((BaseCreature)target).AlwaysMurderer || ((BaseCreature)target).IsAnimatedDead)) )
				return Notoriety.Murderer;

			if ( target.Criminal )
				return Notoriety.Criminal;

			Guild sourceGuild = GetGuildFor( source.Guild as Guild, source );
			Guild targetGuild = GetGuildFor( target.Guild as Guild, target );

			if ( sourceGuild != null && targetGuild != null )
			{
				if ( sourceGuild == targetGuild || sourceGuild.IsAlly( targetGuild ) )
					return Notoriety.Ally;
				else if ( sourceGuild.IsEnemy( targetGuild ) )
					return Notoriety.Enemy;
			}

			Faction srcFaction = Faction.Find( source, true, true );
			Faction trgFaction = Faction.Find( target, true, true );

			if ( srcFaction != null && trgFaction != null && srcFaction != trgFaction && source.Map == Faction.Facet )
				return Notoriety.Enemy;

			if ( SkillHandlers.Stealing.ClassicMode && target is PlayerMobile && ((PlayerMobile)target).PermaFlags.Contains( source ) )
				return Notoriety.CanBeAttacked;

			if ( target is BaseCreature && ((BaseCreature)target).AlwaysAttackable )
				return Notoriety.CanBeAttacked;

			if ( CheckHouseFlag( source, target, target.Location, target.Map ) )
				return Notoriety.CanBeAttacked;

			if ( !(target is BaseCreature && ((BaseCreature)target).InitialInnocent) )
			{
				if ( !target.Body.IsHuman && !target.Body.IsGhost && !IsPet( target as BaseCreature ) && !Server.Spells.Necromancy.TransformationSpell.UnderTransformation( target ) )
					return Notoriety.CanBeAttacked;
			}

			if ( CheckAggressor( source.Aggressors, target ) )
				return Notoriety.CanBeAttacked;

			if ( CheckAggressed( source.Aggressed, target ) )
				return Notoriety.CanBeAttacked;

			if ( target is BaseCreature )
			{
				BaseCreature bc = (BaseCreature)target;

				if ( bc.Controled && bc.ControlOrder == OrderType.Guard && bc.ControlTarget == source )
					return Notoriety.CanBeAttacked;
			}

			if ( source is BaseCreature )
			{
				BaseCreature bc = (BaseCreature)source;

				Mobile master = bc.GetMaster();
				if( master != null && CheckAggressor( master.Aggressors, target ))
					return Notoriety.CanBeAttacked;
			}

			return Notoriety.Innocent;
		}

		public static bool CheckHouseFlag( Mobile from, Mobile m, Point3D p, Map map )
		{
			BaseHouse house = BaseHouse.FindHouseAt( p, map, 16 );

			if ( house == null || house.Public || !house.IsFriend( from ) )
				return false;

			if ( m != null && house.IsFriend( m ) )
				return false;

			BaseCreature c = m as BaseCreature;

			if ( c != null && !c.Deleted && c.Controled && c.ControlMaster != null )
				return !house.IsFriend( c.ControlMaster );

			return true;
		}

		public static bool IsPet( BaseCreature c )
		{
			return ( c != null && c.Controled );
		}

		public static bool IsSummoned( BaseCreature c )
		{
			return ( c != null && /*c.Controled &&*/ c.Summoned );
		}

		public static bool CheckAggressor( ArrayList list, Mobile target )
		{
			for ( int i = 0; i < list.Count; ++i )
				if ( ((AggressorInfo)list[i]).Attacker == target )
					return true;

			return false;
		}

		public static bool CheckAggressed( ArrayList list, Mobile target )
		{
			for ( int i = 0; i < list.Count; ++i )
			{
				AggressorInfo info = (AggressorInfo)list[i];

				if ( !info.CriminalAggression && info.Defender == target )
					return true;
			}

			return false;
		}
	}
}

any idea? Only get these errors when I add your edits.

yes, you made one of the mods in CorpseNotoriety instead of MobileNotoriety. It is an easy mistake to make because the code looks very similar in both.

Code:
	// XmlPoints challenge mod
	if(XmlPoints.AreTeamMembers(source,target))
                	return Notoriety.Ally;
	else
	if(XmlPoints.AreChallengers(source,target))
                	return Notoriety.Enemy;

this mod is in the wrong place. MobileNotoriety is a little further down.
 

ArteGordon

Wanderer
Seven said:
Arte I mean the creator of the match.
Some players use it and when they did it didn't know what it does...
And when I was testing it out I created a CTF game but didn't know how to cancle it. The only thing, that i knew of to get rid of it was delete the gloves.

Organizers cannot cancel games.
I had that feature in for a while, but it gave the ability of an organizer that was also participating in a game to bail out if they were losing, or bail out if a buddy was losing, etc. I didnt like the potential for abuse that it introduced.
I might reintroduce it on a timer the same way I handle cancelling duels.
 

ArteGordon

Wanderer
Seven said:
hmm why not make it so that when the game starts he can't cancle it.. that sounds better

yes, cancelling/deleting the gauntlet before a game is started is reasonable.
Currently that will happen automatically. A game that is left without starting will have its gauntlet decay. The default DecayTime is 2 hrs. This can be changed for all games by setting the DecayTime override in BaseChallengeGame.cs or it can be changed for individual games overriding it in the individual game gauntlet scripts.

Also, if a game is being setup and the organizer decides to abandon that and set up another game, the first game will be deleted.

I could add in a button available to organizers to explicitly cancel/delete a game instead of waiting for decay. It is largely a just a matter of button space.
 

Seven

Sorceror
I guess the thing about it is that I just don't want to have tons of these 'gloves' laying around ;)

I was unaware of the decay
 

stormwolff

Knight
Arte I seem to have a problem with the points and 1.0.0

The challenges never seem to end on death for me. I have tested on my main shard and on a fresh install of 1.0.0. no other custom scripts.

I am using the latest xml spawner and xml points I made all changes listed in this topic except the insurance change and none of the optional changes from the xmlspawner install. Not sure whats up.

It also seems auto res is not working for me after one of the people dies.

Here is how I tested on the fresh isntall with blank saves and no other custom scripts other than the xml spawner 274 and xml points 118

Player a and Player b are both player accounts
Created player a as warrior set young to false
Created player b as ninja set young to false
move both players to bucs den

Player a issued [callenge commadn to player b
Player b accepted and it gave me the usual so and so has challenged and accepted
Both players appeared orange towards each other.
Player a kills player b with a sword
player b is not auto ressurected
I add a healer
Player b is ressurected by healer
Player a and player b are still orange to each other

When using [checkpoints it says player b is in a challenge with player a
I have to cancel the challenge for them to go back to being blue

No points were issued nor taken away from the players
Both players still have 100 points after the challenge with [checkpoints


notoriety.cs

Code:
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Guilds;
using Server.Multis;
using Server.Mobiles;
using Server.Engines.PartySystem;
using Server.Factions;
using Server.Engines.XmlSpawner2;

namespace Server.Misc
{
	public class NotorietyHandlers
	{
		public static void Initialize()
		{
			Notoriety.Hues[Notoriety.Innocent]		= 0x59;
			Notoriety.Hues[Notoriety.Ally]			= 0x3F;
			Notoriety.Hues[Notoriety.CanBeAttacked]	= 0x3B2;
			Notoriety.Hues[Notoriety.Criminal]		= 0x3B2;
			Notoriety.Hues[Notoriety.Enemy]			= 0x90;
			Notoriety.Hues[Notoriety.Murderer]		= 0x22;
			Notoriety.Hues[Notoriety.Invulnerable]	= 0x35;

			Notoriety.Handler = new NotorietyHandler( MobileNotoriety );

			Mobile.AllowBeneficialHandler = new AllowBeneficialHandler( Mobile_AllowBeneficial );
			Mobile.AllowHarmfulHandler = new AllowHarmfulHandler( Mobile_AllowHarmful );
		}

		private enum GuildStatus{ None, Peaceful, Waring }

		private static GuildStatus GetGuildStatus( Mobile m )
		{
			if ( m.Guild == null )
				return GuildStatus.None;
			else if ( ((Guild)m.Guild).Enemies.Count == 0 && m.Guild.Type == GuildType.Regular )
				return GuildStatus.Peaceful;

			return GuildStatus.Waring;
		}

		private static bool CheckBeneficialStatus( GuildStatus from, GuildStatus target )
		{
			if ( from == GuildStatus.Waring || target == GuildStatus.Waring )
				return false;

			return true;
		}

		/*private static bool CheckHarmfulStatus( GuildStatus from, GuildStatus target )
		{
			if ( from == GuildStatus.Waring && target == GuildStatus.Waring )
				return true;

			return false;
		}*/

		public static bool Mobile_AllowBeneficial( Mobile from, Mobile target )
		{
			if ( from == null || target == null )
				return true;

			#region Factions
			Faction targetFaction = Faction.Find( target, true );

			if ( targetFaction != null )
			{
				if ( Faction.Find( from, true ) != targetFaction )
					return false;
			}
			#endregion

			Map map = from.Map;

			if ( map != null && (map.Rules & MapRules.BeneficialRestrictions) == 0 )
				return true; // In felucca, anything goes

			if ( !from.Player )
				return true; // NPCs have no restrictions

			if ( target is BaseCreature && !((BaseCreature)target).Controled )
				return false; // Players cannot heal uncontroled mobiles

			if ( from is PlayerMobile && ((PlayerMobile)from).Young && ( !(target is PlayerMobile) || !((PlayerMobile)target).Young ) )
				return false; // Young players cannot perform beneficial actions towards older players

			Guild fromGuild = from.Guild as Guild;
			Guild targetGuild = target.Guild as Guild;

			if ( fromGuild != null && targetGuild != null && (targetGuild == fromGuild || fromGuild.IsAlly( targetGuild )) )
				return true; // Guild members can be beneficial

			return CheckBeneficialStatus( GetGuildStatus( from ), GetGuildStatus( target ) );
		}

		public static bool Mobile_AllowHarmful( Mobile from, Mobile target )
		{
			if ( from == null || target == null )
				return true;

			Map map = from.Map;

			if ( map != null && (map.Rules & MapRules.HarmfulRestrictions) == 0 )
				return true; // In felucca, anything goes

			if ( !from.Player && !(from is BaseCreature && (((BaseCreature)from).Controled || ((BaseCreature)from).Summoned)) )
			{
				if ( !CheckAggressor( from.Aggressors, target ) && !CheckAggressed( from.Aggressed, target ) && target is PlayerMobile && ((PlayerMobile)target).CheckYoungProtection( from ) )
					return false;

		return true; // Uncontroled NPCs are only restricted by the young system
	}
				
	// XmlPoints challenge mod
	if(XmlPoints.AreChallengers(from,target))
                return true;

			Guild fromGuild = GetGuildFor( from.Guild as Guild, from );
			Guild targetGuild = GetGuildFor( target.Guild as Guild, target );

			if ( fromGuild != null && targetGuild != null && (fromGuild == targetGuild || fromGuild.IsAlly( targetGuild ) || fromGuild.IsEnemy( targetGuild )) )
				return true; // Guild allies or enemies can be harmful

			if ( target is BaseCreature && (((BaseCreature)target).Controled || (((BaseCreature)target).Summoned && from != ((BaseCreature)target).SummonMaster)) )
				return false; // Cannot harm other controled mobiles

			if ( target.Player )
				return false; // Cannot harm other players

			if ( !(target is BaseCreature && ((BaseCreature)target).InitialInnocent) )
			{
				if ( Notoriety.Compute( from, target ) == Notoriety.Innocent )
					return false; // Cannot harm innocent mobiles
			}

			return true;
		}

		public static Guild GetGuildFor( Guild def, Mobile m )
		{
			Guild g = def;

			BaseCreature c = m as BaseCreature;

			if ( c != null && c.Controled && c.ControlMaster != null )
			{
				c.DisplayGuildTitle = false;

				if ( c.Map != Map.Internal && (c.ControlOrder == OrderType.Attack || c.ControlOrder == OrderType.Guard) )
					g = (Guild)(c.Guild = c.ControlMaster.Guild);
				else if ( c.Map == Map.Internal || c.ControlMaster.Guild == null )
					g = (Guild)(c.Guild = null);
			}

			return g;
		}

		public static int CorpseNotoriety( Mobile source, Corpse target )
		{
			if ( target.AccessLevel > AccessLevel.Player )
				return Notoriety.CanBeAttacked;

			Body body = (Body) target.Amount;

			BaseCreature cretOwner = target.Owner as BaseCreature;

			if ( cretOwner != null )
			{
				Guild sourceGuild = GetGuildFor( source.Guild as Guild, source );
				Guild targetGuild = GetGuildFor( target.Guild as Guild, target.Owner );

				if ( sourceGuild != null && targetGuild != null )
				{
					if ( sourceGuild == targetGuild || sourceGuild.IsAlly( targetGuild ) )
						return Notoriety.Ally;
					else if ( sourceGuild.IsEnemy( targetGuild ) )
						return Notoriety.Enemy;
				}

				Faction srcFaction = Faction.Find( source, true, true );
				Faction trgFaction = Faction.Find( target.Owner, true, true );

				if ( srcFaction != null && trgFaction != null && srcFaction != trgFaction && source.Map == Faction.Facet )
					return Notoriety.Enemy;

				if ( CheckHouseFlag( source, target.Owner, target.Location, target.Map ) )
					return Notoriety.CanBeAttacked;

				int actual = Notoriety.CanBeAttacked;

				if ( target.Kills >= 5 || (body.IsMonster && IsSummoned( target.Owner as BaseCreature )) || (target.Owner is BaseCreature && (((BaseCreature)target.Owner).AlwaysMurderer || ((BaseCreature)target.Owner).IsAnimatedDead)) )
					actual = Notoriety.Murderer;

				if ( DateTime.Now >= (target.TimeOfDeath + Corpse.MonsterLootRightSacrifice) )
					return actual;

				Party sourceParty = Party.Get( source );

				ArrayList list = target.Aggressors;

				for ( int i = 0; i < list.Count; ++i )
				{
					if ( list[i] == source || (sourceParty != null && Party.Get( (Mobile)list[i] ) == sourceParty) )
						return actual;
				}

				return Notoriety.Innocent;
			}
			else
			{
				if ( target.Kills >= 5 || (body.IsMonster && IsSummoned( target.Owner as BaseCreature )) || (target.Owner is BaseCreature && (((BaseCreature)target.Owner).AlwaysMurderer || ((BaseCreature)target.Owner).IsAnimatedDead)) )
					return Notoriety.Murderer;

				if ( target.Criminal )
					return Notoriety.Criminal;

				Guild sourceGuild = GetGuildFor( source.Guild as Guild, source );
				Guild targetGuild = GetGuildFor( target.Guild as Guild, target.Owner );

				if ( sourceGuild != null && targetGuild != null )
				{
					if ( sourceGuild == targetGuild || sourceGuild.IsAlly( targetGuild ) )
						return Notoriety.Ally;
					else if ( sourceGuild.IsEnemy( targetGuild ) )
						return Notoriety.Enemy;
				}

				Faction srcFaction = Faction.Find( source, true, true );
				Faction trgFaction = Faction.Find( target.Owner, true, true );

				if ( srcFaction != null && trgFaction != null && srcFaction != trgFaction && source.Map == Faction.Facet )
				{
					ArrayList secondList = target.Aggressors;

					for ( int i = 0; i < secondList.Count; ++i )
					{
						if ( secondList[i] == source || secondList[i] is BaseFactionGuard )
							return Notoriety.Enemy;
					}
				}

				if ( target.Owner != null && target.Owner is BaseCreature && ((BaseCreature)target.Owner).AlwaysAttackable )
					return Notoriety.CanBeAttacked;

				if ( CheckHouseFlag( source, target.Owner, target.Location, target.Map ) )
					return Notoriety.CanBeAttacked;

				if ( !(target.Owner is PlayerMobile) && !IsPet( target.Owner as BaseCreature ) )
					return Notoriety.CanBeAttacked;

				ArrayList list = target.Aggressors;

				for ( int i = 0; i < list.Count; ++i )
				{
					if ( list[i] == source )
						return Notoriety.CanBeAttacked;
				}

				return Notoriety.Innocent;
			}
		}

		public static int MobileNotoriety( Mobile source, Mobile target )
		{
			if ( Core.AOS && (target.Blessed || (target is BaseVendor && ((BaseVendor)target).IsInvulnerable) || target is PlayerVendor || target is TownCrier) )
				return Notoriety.Invulnerable;

			if ( target.AccessLevel > AccessLevel.Player )
				return Notoriety.CanBeAttacked;

			if ( source.Player && !target.Player && source is PlayerMobile && target is BaseCreature )
			{
				BaseCreature bc = (BaseCreature)target;

				if ( !bc.Summoned && !bc.Controled && ((PlayerMobile)source).EnemyOfOneType == target.GetType() )
					return Notoriety.Enemy;
			}

			if ( target.Kills >= 5 || (target.Body.IsMonster && IsSummoned( target as BaseCreature ) && !(target is BaseFamiliar) && !(target is Golem)) || (target is BaseCreature && (((BaseCreature)target).AlwaysMurderer || ((BaseCreature)target).IsAnimatedDead)) )
				return Notoriety.Murderer;

	if ( target.Criminal )
		return Notoriety.Criminal;

	// XmlPoints challenge mod
	if(XmlPoints.AreTeamMembers(source,target))
                	return Notoriety.Ally;
	else
	if(XmlPoints.AreChallengers(source,target))
                	return Notoriety.Enemy;

			Guild sourceGuild = GetGuildFor( source.Guild as Guild, source );
			Guild targetGuild = GetGuildFor( target.Guild as Guild, target );

			if ( sourceGuild != null && targetGuild != null )
			{
				if ( sourceGuild == targetGuild || sourceGuild.IsAlly( targetGuild ) )
					return Notoriety.Ally;
				else if ( sourceGuild.IsEnemy( targetGuild ) )
					return Notoriety.Enemy;
			}

			Faction srcFaction = Faction.Find( source, true, true );
			Faction trgFaction = Faction.Find( target, true, true );

			if ( srcFaction != null && trgFaction != null && srcFaction != trgFaction && source.Map == Faction.Facet )
				return Notoriety.Enemy;

			if ( SkillHandlers.Stealing.ClassicMode && target is PlayerMobile && ((PlayerMobile)target).PermaFlags.Contains( source ) )
				return Notoriety.CanBeAttacked;

			if ( target is BaseCreature && ((BaseCreature)target).AlwaysAttackable )
				return Notoriety.CanBeAttacked;

			if ( CheckHouseFlag( source, target, target.Location, target.Map ) )
				return Notoriety.CanBeAttacked;

			if ( !(target is BaseCreature && ((BaseCreature)target).InitialInnocent) )
			{
				if ( !target.Body.IsHuman && !target.Body.IsGhost && !IsPet( target as BaseCreature ) && !Server.Spells.Necromancy.TransformationSpell.UnderTransformation( target ) )
					return Notoriety.CanBeAttacked;
			}

			if ( CheckAggressor( source.Aggressors, target ) )
				return Notoriety.CanBeAttacked;

			if ( CheckAggressed( source.Aggressed, target ) )
				return Notoriety.CanBeAttacked;

			if ( target is BaseCreature )
			{
				BaseCreature bc = (BaseCreature)target;

				if ( bc.Controled && bc.ControlOrder == OrderType.Guard && bc.ControlTarget == source )
					return Notoriety.CanBeAttacked;
			}

			if ( source is BaseCreature )
			{
				BaseCreature bc = (BaseCreature)source;

				Mobile master = bc.GetMaster();
				if( master != null && CheckAggressor( master.Aggressors, target ))
					return Notoriety.CanBeAttacked;
			}

			return Notoriety.Innocent;
		}

		public static bool CheckHouseFlag( Mobile from, Mobile m, Point3D p, Map map )
		{
			BaseHouse house = BaseHouse.FindHouseAt( p, map, 16 );

			if ( house == null || house.Public || !house.IsFriend( from ) )
				return false;

			if ( m != null && house.IsFriend( m ) )
				return false;

			BaseCreature c = m as BaseCreature;

			if ( c != null && !c.Deleted && c.Controled && c.ControlMaster != null )
				return !house.IsFriend( c.ControlMaster );

			return true;
		}

		public static bool IsPet( BaseCreature c )
		{
			return ( c != null && c.Controled );
		}

		public static bool IsSummoned( BaseCreature c )
		{
			return ( c != null && /*c.Controled &&*/ c.Summoned );
		}

		public static bool CheckAggressor( ArrayList list, Mobile target )
		{
			for ( int i = 0; i < list.Count; ++i )
				if ( ((AggressorInfo)list[i]).Attacker == target )
					return true;

			return false;
		}

		public static bool CheckAggressed( ArrayList list, Mobile target )
		{
			for ( int i = 0; i < list.Count; ++i )
			{
				AggressorInfo info = (AggressorInfo)list[i];

				if ( !info.CriminalAggression && info.Defender == target )
					return true;
			}

			return false;
		}
	}
}

from charactercreation.cs

I have

Code:
				new WelcomeTimer( newChar ).Start();

	// mod to attach the XmlPoints attachment automatically to new chars
	XmlAttach.AttachTo(newChar, new XmlPoints());

It appears to have added the points correctly because I can see 100 points on the characters with [checkpoints

The only changes I made to the xmlpoints.cs are as follows

Code:
 public static TimeSpan CancelTimeout = TimeSpan.FromMinutes(1);
        
        public static bool AllowWithinGuildPoints = true;              // allow within-guild challenge duels for points.

        public static bool UnrestrictedChallenges = true;              // allow the normal waiting time between kills for points to be overridden for challenges
        
        // allows players to be autores'd following 1-on-1 duels
        // Team Challenge type matches handle their own autores behavior
        public static bool AutoResAfterDuel = true;
 

ArteGordon

Wanderer
it sounds like this is the issue

I am using the latest xml spawner and xml points I made all changes listed in this topic and none of the option changes from the xmlspawner install.

You need to perform installation step 6 from the xmlspawner2 package in order for player kills to be registered with the system. That is why the challenges dont end and why autores doesnt work, XmlPoints never gets informed of the kill.
 
Top