Go Back   RunUO - Ultima Online Emulation > RunUO > Custom Script Releases

Custom Script Releases This forum is where you can release your custom scripts for other users to use.

Please note: By releasing your scripts here you are submitting them to the public and as such agree to make them public domain. The RunUO Team has made its software GPL for you to use and enjoy you should do the same for anything based off of RunUO.

Reply
 
Thread Tools Display Modes
Old 01-06-2007, 08:24 AM   #51 (permalink)
Master of the Internet
 
Join Date: Aug 2003
Posts: 5,688
Default

Quote:
Originally Posted by Hazey View Post
I followed Installation steps, step-by-step. Including the XMLSpawner2 script and came out with some compile errors:
Code:
Errors:
 + Customized/Customs/Systems/XML/1 of 3/XmlSpawner2.cs:
    CS0029: Line 9451: Cannot implicitly convert type 'System.Collections.ArrayL
ist' to 'System.Collections.Generic.List<Server.Tile>'
 + Customized/Defaults/Misc/Notoriety.cs:
    CS0117: Line 84: 'Server.Mobiles.BaseCreature' does not contain a definition
 for 'Controled'
What should I do?

Look at the Latest News at the beginning of the main post in the XmlSpawner2 thread for the first error.

For the second error, go to line 84 in Notoriety.cs and change 'Controled' to 'Controlled'.

(edit)

I fixed the 'Controlled' typo in the installation instructions shown in the main post. Thanks.
__________________
The first line of the first rule in the forum rules and guidelines "Be respectful of others. "

For questions, information, and support for XmlSpawner and its addons, visit the
XmlSpawner Support Forum

Last edited by ArteGordon; 01-06-2007 at 08:28 AM.
ArteGordon is offline   Reply With Quote
Old 01-06-2007, 11:56 AM   #52 (permalink)
Forum Expert
 
Hazey's Avatar
 
Join Date: Dec 2006
Location: Just floatin along 'Cloud 9'
Age: 20
Posts: 373
Send a message via AIM to Hazey
Default

Alright. That fixed the compile errors, now I went to test the [challenge system and used a player on player and it tells me this:
"No XMLPoints Support"

Unless its saying this because im using 2 players from the same IP address.

I know I installed everything correctly:
XMLSpawner 1 of 3 - [Installed]
XMLSpawner 2 of 3 - [Installed]
XMLSpawner 3 of 3 - [Installed]
XML Support - [Installed]
XMLPoints 1 of 2 - [Installed]
XMLPoints 2 of 2 - [Installed]
and every script that I was shown to edit, was edited.

I wana guess its just the IP address conflict and I need to test it on my public server which I cant ATM because my host is not around right now.
Hazey is offline   Reply With Quote
Old 01-06-2007, 12:24 PM   #53 (permalink)
Master of the Internet
 
Join Date: Aug 2003
Posts: 5,688
Default

Quote:
Originally Posted by Hazey View Post
Alright. That fixed the compile errors, now I went to test the [challenge system and used a player on player and it tells me this:
"No XMLPoints Support"

Unless its saying this because im using 2 players from the same IP address.

I know I installed everything correctly:
XMLSpawner 1 of 3 - [Installed]
XMLSpawner 2 of 3 - [Installed]
XMLSpawner 3 of 3 - [Installed]
XML Support - [Installed]
XMLPoints 1 of 2 - [Installed]
XMLPoints 2 of 2 - [Installed]
and every script that I was shown to edit, was edited.

I wana guess its just the IP address conflict and I need to test it on my public server which I cant ATM because my host is not around right now.
it isnt an address conflict, you just need to add the points attachments to the existing players.
You can do this with the

[addallpoints

command.
This is completely reversible and you only need to do this once when you are initially setting up the system. To remove the attachments use the

[removeallpoints

To have the points attachment automatically added to all new players, follow installation step #4
__________________
The first line of the first rule in the forum rules and guidelines "Be respectful of others. "

For questions, information, and support for XmlSpawner and its addons, visit the
XmlSpawner Support Forum

Last edited by ArteGordon; 01-06-2007 at 12:27 PM.
ArteGordon is offline   Reply With Quote
Old 01-06-2007, 12:38 PM   #54 (permalink)
Forum Expert
 
Hazey's Avatar
 
Join Date: Dec 2006
Location: Just floatin along 'Cloud 9'
Age: 20
Posts: 373
Send a message via AIM to Hazey
Default

Alright thank you, that works.
Sorry to give you so much BS, but now I have 1 last problem that I see.

[add ChallengeRegionStone

I get target to add this stone and when I click a spot to add it I get this in the game:

"Usage: ChallengeRegionStone"
Am I forgeting something again, or is there an error somewhere?
Hazey is offline   Reply With Quote
Old 01-06-2007, 12:50 PM   #55 (permalink)
Master of the Internet
 
Join Date: Aug 2003
Posts: 5,688
Default

hmm, that command

[add ChallengeRegionStone

should work. What version of the server are you using? RC1? The latest SVN?
__________________
The first line of the first rule in the forum rules and guidelines "Be respectful of others. "

For questions, information, and support for XmlSpawner and its addons, visit the
XmlSpawner Support Forum
ArteGordon is offline   Reply With Quote
Old 01-06-2007, 12:58 PM   #56 (permalink)
Forum Expert
 
Hazey's Avatar
 
Join Date: Dec 2006
Location: Just floatin along 'Cloud 9'
Age: 20
Posts: 373
Send a message via AIM to Hazey
Default

Im using RunUO 2.0 RC1 yes. The latest release.
I also found that the LBSStone when double clicked always says off when double clicked. it doesn't switch from off to on.
Hazey is offline   Reply With Quote
Old 01-06-2007, 01:14 PM   #57 (permalink)
Master of the Internet
 
Join Date: Aug 2003
Posts: 5,688
Default

Quote:
Originally Posted by Hazey View Post
Im using RunUO 2.0 RC1 yes. The latest release.
I also found that the LBSStone when double clicked always says off when double clicked. it doesn't switch from off to on.
double clicking does not toggle the save state, it just reports the current settings.
To turn on leaderboard saves, use the "[leaderboardsave filename" command. To turn them off use "[leaderboardsave off"

Quote:
- added the "[LeaderboardSave [filename [minutes [nentries]]][off]" command that can be run by administrators to enable/disable the periodic saving of xml leaderboard information to the specified file (thanks to stormwolff for the idea). Once turned on, it will continue to save the updated leaderboard at regular intervals. The number of ranked players to be saved can optionally be specified (default is 20). Setting this to zero saves all players. Leaderboard saving is off by default.
__________________
The first line of the first rule in the forum rules and guidelines "Be respectful of others. "

For questions, information, and support for XmlSpawner and its addons, visit the
XmlSpawner Support Forum
ArteGordon is offline   Reply With Quote
Old 01-06-2007, 03:22 PM   #58 (permalink)
Forum Expert
 
Hazey's Avatar
 
Join Date: Dec 2006
Location: Just floatin along 'Cloud 9'
Age: 20
Posts: 373
Send a message via AIM to Hazey
Default

Lol, alright sorry bout that. I dont read anything from books to newspapers.. I hate it and when I read I naturally just scan it I cannot read line by line, i think it has alot to do with A.D.D., but thank you. Anyhow what do you suggest about the ChallengeRegionStone problem?
Hazey is offline   Reply With Quote
Old 01-06-2007, 03:55 PM   #59 (permalink)
Master of the Internet
 
Join Date: Aug 2003
Posts: 5,688
Default

Quote:
Originally Posted by Hazey View Post
Lol, alright sorry bout that. I dont read anything from books to newspapers.. I hate it and when I read I naturally just scan it I cannot read line by line, i think it has alot to do with A.D.D., but thank you. Anyhow what do you suggest about the ChallengeRegionStone problem?
I'm stumped on the problem adding a challengeregionstone. That error would indicate that it is trying to construct the object but it is encountering an error.
Maybe try adding it to a different location.
I would also make sure that you have the right version of challengeregionstone.cs. The one in the package is dated 6/30/06.
__________________
The first line of the first rule in the forum rules and guidelines "Be respectful of others. "

For questions, information, and support for XmlSpawner and its addons, visit the
XmlSpawner Support Forum
ArteGordon is offline   Reply With Quote
Old 01-06-2007, 04:00 PM   #60 (permalink)
Forum Expert
 
Hazey's Avatar
 
Join Date: Dec 2006
Location: Just floatin along 'Cloud 9'
Age: 20
Posts: 373
Send a message via AIM to Hazey
Default

Would it help to show you the one im using?
Hazey is offline   Reply With Quote
Old 01-06-2007, 04:33 PM   #61 (permalink)
Forum Expert
 
Hazey's Avatar
 
Join Date: Dec 2006
Location: Just floatin along 'Cloud 9'
Age: 20
Posts: 373
Send a message via AIM to Hazey
Default

Alright actually im gonna go through everything again, because I finally had the chance to test this script out on my server publicly and I must of forgot some things because its not working properly, such as Me sending duel to girlfriend and we get sent to jhelom pits. I kill her and she stays dead and after resurrected we are still hostile/Orange to eachother and able to fight anywhere and it doesnt count the duel as win and send us back to our previous location. So like I said I have something I must of missed, ill let you know if the shits working properly after I look it over
Hazey is offline   Reply With Quote
Old 01-06-2007, 06:29 PM   #62 (permalink)
Master of the Internet
 
Join Date: Aug 2003
Posts: 5,688
Default

Quote:
Originally Posted by Hazey View Post
Alright actually im gonna go through everything again, because I finally had the chance to test this script out on my server publicly and I must of forgot some things because its not working properly, such as Me sending duel to girlfriend and we get sent to jhelom pits. I kill her and she stays dead and after resurrected we are still hostile/Orange to eachother and able to fight anywhere and it doesnt count the duel as win and send us back to our previous location. So like I said I have something I must of missed, ill let you know if the shits working properly after I look it over
yeah, you missed an installation step.

Quote:
STEP 1:
Install the latest XmlSpawner2 package. You can find it here (http://www.runuo.com/forum/showthread.php?t=69750). You must perform installation step 6 from the XmlSpawner2 thread otherwise the system wont recognize kills.
which is

Quote:
STEP 6: (recommended but not required)
To allow the XmlQuest killtask keywords KILL and KILLNAMED to be applied to players providing a contract kill system, one line must be added to ReportMurderer.cs (Scripts/Gumps/ReportMurderer.cs) as described below (note, you dont have to make this mod if you dont want to, the spawner and other items will work just fine without it, the KILL and KILLNAMED features simply wont work when specifying players as the targets).
This is also required to allow the attachment system to register kills (through the OnKill or OnKilled methods). Some addons such as XmlPoints require this.

around line 64 of ReportMurderer.cs change

Titles.AwardKarma( g, karmaAward, true );

to

Titles.AwardKarma( g, karmaAward, true );
// modification to support XmlQuest Killtasks of players
Server.Items.XmlQuest.RegisterKill( m, g);
__________________
The first line of the first rule in the forum rules and guidelines "Be respectful of others. "

For questions, information, and support for XmlSpawner and its addons, visit the
XmlSpawner Support Forum
ArteGordon is offline   Reply With Quote
Old 01-07-2007, 03:04 PM   #63 (permalink)
Forum Expert
 
Hazey's Avatar
 
Join Date: Dec 2006
Location: Just floatin along 'Cloud 9'
Age: 20
Posts: 373
Send a message via AIM to Hazey
Default

I removed your system completely and replaced the default distro scripts.
I then redownloaded EVERYTHING, and followed all of what I was told to do all over again and came out with a clean bug free system. Works as good as a brand new bong. TYVM for the script, nice work. ++Karma
__________________
∙∙∙∙ A demon spawn, child of a bastard son
Seven born at seven and the seventh child fathered one..∙∙∙∙
∙∙∙∙A soul black full of pain.
Bodies in the field, blood pourin like rain∙∙∙∙
Hazey is offline   Reply With Quote
Old 01-16-2007, 05:04 PM   #64 (permalink)
Forum Novice
 
Join Date: Jul 2005
Posts: 163
Send a message via AIM to mkiplm Send a message via MSN to mkiplm Send a message via Yahoo to mkiplm
Default

i am getting one error but its big can some help me?

Quote:
Errors:
+ Misc/Notoriety.cs:
CS1519: Line 130: Invalid token 'if' in class, struct, or interface member d
eclaration
CS1519: Line 130: Invalid token '!=' in class, struct, or interface member d
eclaration
CS1519: Line 130: Invalid token '!=' in class, struct, or interface member d
eclaration
CS1519: Line 130: Invalid token '==' in class, struct, or interface member d
eclaration
CS1519: Line 130: Invalid token '||' in class, struct, or interface member d
eclaration
CS1519: Line 130: Invalid token '(' in class, struct, or interface member de
claration
CS1519: Line 130: Invalid token ')' in class, struct, or interface member de
claration
CS1519: Line 130: Invalid token '(' in class, struct, or interface member de
claration
CS1519: Line 130: Invalid token ')' in class, struct, or interface member de
claration
CS1519: Line 133: Invalid token 'is' in class, struct, or interface member d
eclaration
CS1519: Line 133: Invalid token '&&' in class, struct, or interface member d
eclaration
CS1519: Line 133: Invalid token ')' in class, struct, or interface member de
claration
CS1519: Line 133: Invalid token ')' in class, struct, or interface member de
claration
CS1519: Line 133: Invalid token '||' in class, struct, or interface member d
eclaration
CS1519: Line 133: Invalid token ')' in class, struct, or interface member de
claration
CS1519: Line 133: Invalid token ')' in class, struct, or interface member de
claration
CS1519: Line 133: Invalid token '&&' in class, struct, or interface member d
eclaration
CS1519: Line 133: Invalid token '!=' in class, struct, or interface member d
eclaration
CS1519: Line 133: Invalid token ')' in class, struct, or interface member de
claration
CS1519: Line 133: Invalid token ')' in class, struct, or interface member de
claration
CS1519: Line 133: Invalid token ')' in class, struct, or interface member de
claration
CS1519: Line 136: Invalid token ')' in class, struct, or interface member de
claration
CS1519: Line 139: Invalid token 'is' in class, struct, or interface member d
eclaration
CS1519: Line 139: Invalid token '&&' in class, struct, or interface member d
eclaration
CS1519: Line 139: Invalid token ')' in class, struct, or interface member de
claration
CS1519: Line 139: Invalid token ')' in class, struct, or interface member de
claration
CS1519: Line 139: Invalid token ')' in class, struct, or interface member de
claration
CS1519: Line 141: Invalid token '(' in class, struct, or interface member de
claration
CS1519: Line 141: Invalid token ',' in class, struct, or interface member de
claration
CS1519: Line 141: Invalid token ')' in class, struct, or interface member de
claration
CS1519: Line 141: Invalid token ')' in class, struct, or interface member de
claration
CS0116: Line 145: A namespace does not directly contain members such as fiel
ds or methods
CS1518: Line 148: Expected class, delegate, enum, interface, or struct
CS1518: Line 167: Expected class, delegate, enum, interface, or struct
CS1518: Line 212: Expected class, delegate, enum, interface, or struct
CS1518: Line 212: Expected class, delegate, enum, interface, or struct
CS1022: Line 214: Type or namespace definition, or end-of-file expected
CS0101: Line 212: The namespace '<global namespace>' already contains a defi
nition for '?'
any one?
heres my script.
Quote:
using System;
using System.Collections;
using System.Collections.Generic;
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 || from.AccessLevel > AccessLevel.Player || target.AccessLevel > AccessLevel.Player )
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).Controlled )
return false; // Players cannot heal uncontroled mobiles

// XmlPoints challenge mod
if(XmlPoints.AreInAnyGame(target))
return XmlPoints.AreTeamMembers(from,target);

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 || from.AccessLevel > AccessLevel.Player || target.AccessLevel > AccessLevel.Player )
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).Controlled || ((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).Controlled || (((BaseCreature)target).Summoned && from != ((BaseCreature)target).SummonMaster)) )
return false; // Cannot harm other controlled 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.Controlled && c.ControlMaster != null )
{
c.DisplayGuildTitle = false;

if( c.Map != Map.Internal && (Core.AOS || Guild.NewGuildSystem || 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 );

List<Mobile> list = target.Aggressors;

for( int i = 0; i < list.Count; ++i )
{
if( list[i] == source || (sourceParty != null && Party.Get( 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 )
{
List<Mobile> 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;

List<Mobile> 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.Controlled && ((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.Unde rTransformation( 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.Controlled && 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.Controlled && c.ControlMaster != null )
return !house.IsFriend( c.ControlMaster );

return true;
}

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

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

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

return false;
}

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

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

return false;
}
}
}

Last edited by mkiplm; 01-16-2007 at 05:07 PM.
mkiplm is offline   Reply With Quote
Old 01-16-2007, 05:34 PM   #65 (permalink)
Master of the Internet
 
Join Date: Aug 2003
Posts: 5,688
Default

around line 125 you have an extra bracket. Just delete it.

Code:
public static bool Mobile_AllowHarmful( Mobile from, Mobile target )
{
if( from == null || target == null || from.AccessLevel > AccessLevel.Player || target.AccessLevel > AccessLevel.Player )
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).Controlled || ((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;

}  <---------- delete this
__________________
The first line of the first rule in the forum rules and guidelines "Be respectful of others. "

For questions, information, and support for XmlSpawner and its addons, visit the
XmlSpawner Support Forum
ArteGordon is offline   Reply With Quote
Old 01-16-2007, 08:32 PM   #66 (permalink)
Forum Novice
 
Join Date: Jul 2005
Posts: 163
Send a message via AIM to mkiplm Send a message via MSN to mkiplm Send a message via Yahoo to mkiplm
Default

i got more errors 2 of them arg take a peek.

Quote:
Errors:
+ custom/XmlSpawner2_20_v318_1of3/XmlSpawner2.cs:
CS0029: Line 9451: Cannot implicitly convert type 'System.Collections.ArrayL
ist' to 'System.Collections.Generic.List<Server.Tile>'
+ Misc/Notoriety.cs:
CS1502: Line 226: The best overloaded method match for 'Server.Engines.XmlSp
awner2.XmlPoints.AreTeamMembers(Server.Mobile, Server.Mobile)' has some invalid
arguments
CS1503: Line 226: Argument '2': cannot convert from 'Server.Items.Corpse' to
'Server.Mobile'
CS1502: Line 229: The best overloaded method match for 'Server.Engines.XmlSp
awner2.XmlPoints.AreChallengers(Server.Mobile, Server.Mobile)' has some invalid
arguments
CS1503: Line 229: Argument '2': cannot convert from 'Server.Items.Corpse' to
'Server.Mobile'
mkiplm is offline   Reply With Quote
Old 01-16-2007, 10:09 PM   #67 (permalink)
Master of the Internet
 
Join Date: Aug 2003
Posts: 5,688
Default

Quote:
Originally Posted by mkiplm View Post
i got more errors 2 of them arg take a peek.
for the first error see the Latest News section at the top of the main xmlspawner thread.

The second errors are because you made this mod from installation Step 5

Code:
and in the MobileNotoriety method around line 279 change

	if ( target.Criminal )
		return Notoriety.Criminal;

to

	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;
in the CorpseNotoriety method instead of the MobileNotoriety method. They look very similar so you have to make sure you make it in the right place.
__________________
The first line of the first rule in the forum rules and guidelines "Be respectful of others. "

For questions, information, and support for XmlSpawner and its addons, visit the
XmlSpawner Support Forum
ArteGordon is offline   Reply With Quote
Old 02-01-2007, 09:39 PM   #68 (permalink)
Forum Newbie
 
Join Date: Jan 2007
Posts: 22
Default

I don't remember finding installation information, or editing information within XmlSpawner2, or This addition. I may be wrong...

But, I followed all recomended instalation steps. As well as edited various within playermobile, and notoriety. I tried to compile, and I got a warning dealing with severlist.cs. I can't remember exactly what I changed in it... But I replaced it with the original.

Both of which claim multiple times that XmlPoints cannot be found... Also one claiming attachments cannot be found.

Code:
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Items;
using Server.Guilds;
using Server.Multis;
using Server.Mobiles;
using Server.Engines.PartySystem;
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 || from.AccessLevel > AccessLevel.Player || target.AccessLevel > AccessLevel.Player )
				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).Controlled )
				return false; // Players cannot heal uncontrolled mobiles

				// XmlPoints challenge mod
				if(XmlPoints.AreInAnyGame(target))
                	return XmlPoints.AreTeamMembers(from,target);
			
			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 || from.AccessLevel > AccessLevel.Player || target.AccessLevel > AccessLevel.Player )
				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).Controlled || ((BaseCreature)from).Summoned)) )
			{
				if( !CheckAggressor( from.Aggressors, target ) && !CheckAggressed( from.Aggressed, target ) && target is PlayerMobile && ((PlayerMobile)target).CheckYoungProtection( from ) )
					return false;

				return true; // Uncontrolled 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).Controlled || (((BaseCreature)target).Summoned && from != ((BaseCreature)target).SummonMaster)) )
				return false; // Cannot harm other controlled 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.Controlled && c.ControlMaster != null )
			{
				c.DisplayGuildTitle = false;

				if( c.Map != Map.Internal && (Core.AOS || Guild.NewGuildSystem || 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.Own