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!

Zippy's CTF Script Re-Re-Release

Status
Not open for further replies.

sh1ny

Wanderer
Zippy's CTF Script Re-Re-Release

Click here to download

Summary:
A Capture The Flag Game

Description:
In theory you can have any number of teams, but i've only tested it with 2 teams.

Original Zippy's CTF Can be found here :
http://www.runuo.com/discussion/viewtopic.php?t=5852&highlight=ctf

The Re-Release by al- can be found here :
http://www.runuo.com/forum/viewtopic.php?t=10678&highlight=ctf

It is tested with beta35 and it should work without crashes and stuff. Since i have AOS on my shard i've added stuff to autosupply stone for the necromancy and chivalry skills. I take no credit for this script, i just put it here since i see there are ppl that want it working for beta35 :)

Installation:
Here is the description from al-. Hasn't changed since.

Setup:
1) Unzip to Scirpts\Misc. and overwrite Notoriety.cs
2) [add CTFGame 2 ( for 2 teams )
3) [add CTFJoin
4) [add CTFFlag ( 1 for each team )
5) [add CTFExit
6) [add Autosupply

7) Use [props to link CTFJoin, CTFExit, CTFFlag's and Autosupply stones to CTFGame stone
8) Use [props on the first flag and set TeamID = 0, second flag to 1, etc.
9) Double click the flags and set Flag homes, names, hues etc.
10) All other options can be set by CTFGame Stone & Autosupply.
 

jman12345

Wanderer
hey i had a problem with your script today for some reason i added it like 2 weeks ago but never gave it a go. For some reason when the peeps die they dont auto res
 

sh1ny

Wanderer
It's not my script. Try this version :>
The original one is for older betas, this one is for beta 35.
 

Philantrop

Sorceror
jman12345 said:
hey i had a problem with your script today for some reason i added it like 2 weeks ago but never gave it a go. For some reason when the peeps die they dont auto res

That's not a problem but a feature. Place healers, ressurection gates, whatever at strategic positions on the playground.
 

sh1ny

Wanderer
Hmmm autores works fine on this script. jman12345 you have downloaded an older version ( probably al-'s ), so redownload mine , overwrite all files and everything should work.
 

Hiero

Wanderer
Im getting this error, anyone know how i can fix it?

Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
- Error: Scripts\CUSTOM\CTF\Notoriety.cs: CS0101: (line 11, column 15) The name
space 'Server.Misc' already contains a definition for 'NotorietyHandlers'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
 

DeadlyNoob

Wanderer
If you havent seen it yet (i also havent checked this download) but my version of it had a region file. and you have to change the region to where ur game is. Its really nice becuase it puts what team andif they have the flag it says it over their name. i belive thats also got something to do with the auto ressing

i also have never been able to get differnt games setup it always interfers with the other one. that could be your problem. should only have 1 ctfgame stone.

what i did with my region was disabled hiding and invs becuase people would just run and kepe hiding. some of my players dont like refelect.
its a really great script.
 

mebane2

Wanderer
Ok, dumb question time :)

I got it installed and tried it out, and its all cool.

But how do you define a region. I would like it if people can't run out to the bank and get better equipment. :) And I can't really do any custom maps as the peeps I will be playing this with also play standard UO and I don't wanna goof there clients up with custom files.

Thanks
 

Jarrod

Sorceror
I had the same problem. All monsters and criminals went blue. i removed the notoriety.cs (put the original back in) and it was fine again.

see the fix
 

Jarrod

Sorceror
yes, this was the fix:

[code:1]using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Guilds;
using Server.Multis;
using Server.Mobiles;

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.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 ( 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;

Map map = from.Map;

for (int i=0;i<CTFGame.Registry.Count;i++)
{
CTFGame game = (CTFGame)CTFGame.Registry;

CTFTeam ft = game.FindTeam( from );
CTFTeam tt = game.FindTeam( target );

if ( ft != null && tt != null && ft == tt )
return false;
}

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

Guild fromGuild = from.Guild;
Guild targetGuild = target.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;

for (int i=0;i<CTFGame.Registry.Count;i++)
{
CTFGame game = (CTFGame)CTFGame.Registry;
if ( game.FindTeam( from ) != game.FindTeam( target ) )
return false;
}

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)) )
return true; // Uncontroled NPCs have no restrictions

Guild fromGuild = GetGuildFor( from.Guild, from );
Guild targetGuild = GetGuildFor( target.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 )
return false; // Cannot harm other controled mobiles

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

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 = c.Guild = c.ControlMaster.Guild;
else if ( c.Map == Map.Internal || c.ControlMaster.Guild == null )
g = 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;

for (int i=0;i<CTFGame.Registry.Count;i++)
{
CTFGame game = (CTFGame)CTFGame.Registry;

CTFTeam ft = game.FindTeam( source );
CTFTeam tt = game.FindTeam( target.Owner );

if ( ft != null && tt != null )
{
if ( ft == tt )
return Notoriety.Ally;
else
return Notoriety.Enemy;
}
else
{
if ( target.Kills >= 5 || (body.IsMonster && IsSummoned( target.Owner as BaseCreature )) || (target.Owner is BaseCreature && ((BaseCreature)target.Owner).AlwaysMurderer) )
return Notoriety.Murderer;

if ( target.Criminal )
return Notoriety.Criminal;

Guild sourceGuild = GetGuildFor( source.Guild, source );
Guild targetGuild = GetGuildFor( target.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;
}
}
}

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 ( !body.IsHuman && !body.IsGhost && !IsPet( target.Owner as BaseCreature ) )
return Notoriety.CanBeAttacked;

ArrayList list = target.Aggressors;

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

return Notoriety.Innocent;
}

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

for (int i=0;i<CTFGame.Registry.Count;i++)
{
CTFGame game = (CTFGame)CTFGame.Registry;

CTFTeam ft = game.FindTeam( source );
CTFTeam tt = game.FindTeam( target );

if ( ft != null && tt != null )
{
if ( ft == tt )
return Notoriety.Ally;
else
return Notoriety.Enemy;
}
else
{
if ( target.Kills >= 5 || (target.Body.IsMonster && IsSummoned( target as BaseCreature )) || (target is BaseCreature && ((BaseCreature)target).AlwaysMurderer) )
return Notoriety.Murderer;

if ( target.Criminal )
return Notoriety.Criminal;

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

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

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

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

if ( !target.Body.IsHuman && !target.Body.IsGhost && !IsPet( target as BaseCreature ) )
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;
}

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).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;

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

return false;
}
}
}
[/code:1]
 
Status
Not open for further replies.
Top