RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[RunUO 2.0 RC1] Shivan Spawneable Guards

shivan

Sorceror
You miss the return on there...

Code:
		public virtual OppositionGroup OppositionGroup
		{
            get { OppositionGroup.newguards; }
		}

it should be

Code:
        public virtual OppositionGroup OppositionGroup
        {
            get { return OppositionGroup.newguards; }
        }
 

Jasonntn

Wanderer
For some reason the NoCriminalWarrior/Mage/Archer guards aren't responding when guards are called. (Are these the right guards to allow Reds in the city but attack criminals/monsters?) Today I was followed from the graveyard in Britain by a Skeleton and a Spectre (they both aggro-ed me, I didn't attack them) and passed right by an archer guard who did nothing as I ran back into Britain. Later my beta tester for my shard was macroing in town with a warrior guard right outside the building and I attacked him and the guards did nothing even though he was saying guards every couple of seconds in his macro. Am I doing something wrong here? I've disabled the instant kill guards on my server if that has anything to do with it maybe - was hoping to just use these spawnable guards in all the towns.

Oh yeah, I even increased their range to 20 in the BaseAntiCriminal.cs as such:

if (e.Mobile.InRange(this, 20))

to make sure they covered the whole city.
 

shivan

Sorceror
Ouch you right, i forgot to update the opposition groups in the tropic, you need to add them with the other guards in the opposition grouplist, take a look again in the first post in a few moments.

BTW, yelling guards only works with players not monsters.
 

Jasonntn

Wanderer
Thanks for another incredibly quick response Shivan. And thanks for the tip on the monsters. I didn't know that......
 

Jasonntn

Wanderer
How difficult would it be to have these NoCriminalGuards to attack monsters as well as players? Would that make it impossible to allow reds in town?
 

Greystar

Wanderer
C h a o s;743063 said:
just curious, any way to make these guards attack based on race instead of karma, or even by the players title?

The Karma is for Good/Evil guards... the only way I could see doing what you are looking for is to add IsEnemy to the guards and add what you want in there.
 

Naret

Wanderer
Hello

I try to use this script, I think is a great guard really, but... I dont like very much guard teleport to the target. I prefer the atletic guards that run to catch the enemy.

Anyway, i try to avoid that but i only crash server every time... How could i do this?

Thanks

PS: My english is horrible
 

greyrebel

Wanderer
custom ranks?

i hate to reopen an old post, but is there any way that i can give the guards custom ranks? i have tried and it only says (name) the guard, when i spawn them. i want to give them ranks like captain.
 

KnitePrince

Sorceror
heh, I knew this one looked too easy,,

My Console;

Code:
  RunUO - [www.runuo.com] Version 2.0, Build 2357.32527
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 2 processors
Scripts: Compiling C# scripts...failed (4 errors, 1 warnings)
Warnings:
 + Custom/OmniPorter/WorldOmniporter.cs:
    CS0168: Line 879: The variable 'e' is declared but never used
Errors:
 + Engines/AI/Creature/BaseCreature.cs:
    CS0117: Line 1042: 'Server.OppositionGroup' does not contain a definition fo
r 'newguards'
 + Custom/SpawnableGuards/Spawneableguards/Criminal/BaseAntiCriminal.cs:
    CS0117: Line 121: 'Server.OppositionGroup' does not contain a definition for
 'newguards'
 + Custom/SpawnableGuards/Spawneableguards/Evil/BaseEvilGuard.cs:
    CS0117: Line 135: 'Server.OppositionGroup' does not contain a definition for
 'newguards'
 + Custom/SpawnableGuards/Spawneableguards/Good/BaseGoodGuard.cs:
    CS0117: Line 121: 'Server.OppositionGroup' does not contain a definition for
 'newguards'
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.


and the offending piece of code in Red...

Code:
public BaseAI AIObject{ get{ return m_AI; } }

		public const int MaxOwners = 5;

		public virtual OppositionGroup OppositionGroup
		{
			//get{ return null; }
           [COLOR="Red"] get { return OppositionGroup.newguards; }[/COLOR] // added for new spawnable Guards
		}

		#region Friends
		public List<Mobile> Friends { get { return m_Friends; } }

		public virtual bool AllowNewPetFriend
		{
			get{ return ( m_Friends == null || m_Friends.Count < 5 ); }
		}

		public virtual bool IsPetFriend( Mobile m )
		{
			return ( m_Friends != null && m_Friends.Contains( m ) );
		}

Would Appriciate a Hint, or an example! Thx!
 

KnitePrince

Sorceror
well Ive fought this for a couple days and finally gave up on it, Thanks for all the replys and input! ++ karma to everyone that helped out! :rolleyes: lol
 

Alex21

Sorceror
KnitePrince;796595 said:
heh, I knew this one looked too easy,,

My Console;

Code:
  RunUO - [www.runuo.com] Version 2.0, Build 2357.32527
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 2 processors
Scripts: Compiling C# scripts...failed (4 errors, 1 warnings)
Warnings:
 + Custom/OmniPorter/WorldOmniporter.cs:
    CS0168: Line 879: The variable 'e' is declared but never used
Errors:
 + Engines/AI/Creature/BaseCreature.cs:
    CS0117: Line 1042: 'Server.OppositionGroup' does not contain a definition fo
r 'newguards'
 + Custom/SpawnableGuards/Spawneableguards/Criminal/BaseAntiCriminal.cs:
    CS0117: Line 121: 'Server.OppositionGroup' does not contain a definition for
 'newguards'
 + Custom/SpawnableGuards/Spawneableguards/Evil/BaseEvilGuard.cs:
    CS0117: Line 135: 'Server.OppositionGroup' does not contain a definition for
 'newguards'
 + Custom/SpawnableGuards/Spawneableguards/Good/BaseGoodGuard.cs:
    CS0117: Line 121: 'Server.OppositionGroup' does not contain a definition for
 'newguards'
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.


and the offending piece of code in Red...

Code:
public BaseAI AIObject{ get{ return m_AI; } }

		public const int MaxOwners = 5;

		public virtual OppositionGroup OppositionGroup
		{
			//get{ return null; }
           [COLOR="Red"] get { return OppositionGroup.newguards; }[/COLOR] // added for new spawnable Guards
		}

		#region Friends
		public List<Mobile> Friends { get { return m_Friends; } }

		public virtual bool AllowNewPetFriend
		{
			get{ return ( m_Friends == null || m_Friends.Count < 5 ); }
		}

		public virtual bool IsPetFriend( Mobile m )
		{
			return ( m_Friends != null && m_Friends.Contains( m ) );
		}

Would Appriciate a Hint, or an example! Thx!

maybe

Code:
newguards

should be something like?

Code:
NewGuards

Capitalization matters.

So if my hunch is correct.....

Code:
get { return OppositionGroup.NewGuards; }

should work?
 

KnitePrince

Sorceror
Alex!!! I love you! Capitilization was the problem, but it was in the opposition group folder, not the base creature,,, but, your the one that made me go back and look at it again!!! You the man!
 

Toog55

Wanderer
Error

Getting this:
Errors:
+ Engines/AI/Creature/OppositionGroup.cs:
CS1513: Line 442: } expected
CS1513: Line 442: } expected



Any idea what I screwed up? Thanks for any help.
I was going to Revert to an old save,but wasn't sure if that would restore those files.
 

chadlee

Wanderer
Good script.. I just need helping on 1 little thing:

I have guards set up to look like a war vs undead... guards attack the undead no problem, but the undead don't really "fight back" or "attack/target" the guards.

Please help?
 

chadlee

Wanderer
Toog:

Remember to copy/paste the end of his script too, i had that same problem for a second. (look at original post if this don't help)

end of OppositionGroup.cs

PHP:
		}
			});

        public static OppositionGroup newguards
        {
            get { return m_newguards; }
        }
	}
}
 
Top