Go Back   RunUO - Ultima Online Emulation > RunUO > Custom Script Release Archive

Custom Script Release Archive This is a pre-script database archive of what our users had released.

 
 
Thread Tools Display Modes
Old 02-17-2006, 03:59 AM   #1 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
Default Killable Guards (GS Version)

Killable Guards (GS Version)
Version 1.1.1 final?

Exerpt from Readme.txt

Quote:
(DESCRIPTION)
These are all the scripts I modified to make killable guards work the
way original guards do, but they no longer instakill and you can kill
them, even though guards can be killed it will still be tough. You
can call guards when a normally aggressive creature enters a guarded
region. Now includes protection for pets and summoned creatures as well.
Also added a New Guard type the MageGuard and PaladinGuard.

All these scripts are located in their parent directories.
IE) Scripts\Regions\ (etc)

To install these scripts:

1) Backup your existing scripts of
BaseGuard.cs to BaseGuard._cs or .org or something
BaseCreature.cs to BaseCreature._cs or .org or something
WarriorGuard.cs to WarriorGuard._cs or .org or something
ArcherGuard.cs to ArcherGuard._cs or .org or something
GuardedRegion.cs to GuardedRegion._cs or .org or something
BaseAI.cs to BaseAI._cs or .org or something
BaseMount.cs to BaseMount._cs or .org or something

2) Place these scripts in this package either in your custom directory or
or in the directory where you backed up the other files add the
mageguard and paladinguard where you have the rest of the guards
(although it doesn't matter where it is).

3) Enjoy (I hope)
Feel free to post Suggestions/Ideas/Comments/Errors in the thread where you downloaded the original zip file.
Also the Paladin AI is exactly the same as the one that can be found on RunUO forums so if you already have it you don't have to overwrite or edit your existing one in anyway. No longer included my Guard AI it was buggy and incomplete so has been removed.

Files included in this package are as follows.

\Scripts\Regions\GuardedRegion.cs
\Scripts\Mobiles\Guards\WarriorGuard.cs
\Scripts\Mobiles\Guards\ArcherGuard.cs
\Scripts\Mobiles\Guards\PaladinGuard.cs
\Scripts\Engines\AI\Creatures\BaseCreature.cs
\Scripts\Engines\AI\AI\BaseAI.cs
\Scripts\Engines\AI\AI\PaladinAI.cs
\Scripts\Mobiles\Animals\Mounts\BaseMount.cs

Plus several txt files.

Update 1.0.4a: Fixes compatibility issues with Faction Guards... Oops sorry about that

Update 1.0.4b: Fixes typos from above compatibility issues with Faction Guards... Oops sorry again

Update 1.0.5: Fixes infinitly called guard loop also added Dismount guardcall prevention others may not have experienced this but I have on my shard.

Main changes occured in BaseMount.cs GuardedRegion.cs and BaseGuard.cs no other files affected by this mod.

Update 1.0.6 Fixes the last unexplained crash when guards are called, at this point I think its bugless, although I could be wrong. Only files affected in this change are, BaseCreature.cs and GuardedRegion.cs.

Update 1.0.7 Fixes a couple of minor bugs that most people would probably never expereince and removes more legacy (old code) from the InstaKill guards that was autokilling the guards IF they where disarmed or spawned UNarmed which was instakilling the MageGuards since they spawn weaponless. Also removed my AI_Guard untill its finished so those of you who have it already feel free to change your scripts to match. It has been removed from all files that would be affected in this pack. A couple minor crash prevention pieces of code where added and something I changed in basecreature has been changed back, cause it allowed things like Bears and Cats and other miscellaneous animals in guardedregions to call for the guards on Red (Murdering) players if you didnt allow reds in town.

Update 1.0.8:
Discovered a bug when a red entered town when Reds where not allowed in town which caused a null reference error, it is now fixxed. (I THINK) Pointed out by Evil Jason (my first bug in link 6 months).

1.1.0 Updated
Guards will only come 1 at a time even if multiple vendors see you. (Not fully tested but works in a test environment)
Random Guards now possible.
All guards types have been updated to support the new random guards

1.1.1 Updated
Only change includes some removing old code I was no longer using and removed some debug code no longer needed. Also includes the spot that XxSP1DERxX brought to my attention, only file affected by this is BaseGuard.cs.

(Features/Bugs)
Guard backup comes in 3s this wont be removed. If you dont like it find the Revenge stuff and remove it (or change the Iteration from 3 to 1 or from 3 to 5 if you really want).
Extra Details not involving Installation:

This version contains some mods for prevention of guards attacking guards. Although you can still make them start. If you choose not to use my BaseAI.cs then you atleast need to add changes marked with Greystar -- <more text follows> since thats how I decided to label everything. Also if guards are right next to each other when you force them to fight they will fight untill their timers run out. Other changes are just error correcting.

As I mentioned before this PaladinAI.cs is exactly the same as the one already provided on the RunUO forums. I just included it with this package incase people who download my guardpackage do not already have that file. I will add credits to the file once I find who wrote it so I can properly give them the credit they deserve for writing them. You may still be able to call multiple guards even if guards are present Added a toggle allowing you to turn on and off AllowReds From in game, similair to the enable/disable guardedregions toggle.

PS: anyone who downloaded this previously may want to download this again.
EDIT: There has been some drastic changes to these Killable Guards to make them work EXACTLY as intended. I am almost positive All bugs are gone, but
hey no one is perfect. So if I missed anything please feel free to post suggestions or ideas in the main thread. Thanks for the support. Using mods from this will also fix a potential crashbug in regular InstaKill guards in dealing with their built in spawner.

SIDENOTE: This basemount does include the option to make it so every mount in game will start with a pack if you want that included just remove the /**/ or // from the areas inside the #region #endregion tag if you get an already defined error after doing that its cause you uncommented the extra OnBeforeDeath in the Pack Animal Methods.

This should be the final installation of this version of the guards, there will still be additional guard types added to the package, but there should be no more need for any major changes to any scripts.

Although If you have an Evo type of creature or I think one of Ronin's BioCreatures then they can still be guard targets OR Evo style pets they may still be guardtargets if summoned inside of a guarded region. I am not precisely sure why this happens, although have been able to fix it on one shard that used a Custom EvoDragon they made

***NOTICE*** If I start getting problems like I did before and people give me any kind of hard time about this script I will remove it again and I will not provide support for it on RunUO. ***NOTICE***

***ERRORS***If you are going to post errors make sure tha you can duplicated them and provide you crashlog in debugmode so I can get the details I need. Plus describe in as much detail what was going on around the area where the guards where involved. Also the method you used to install my guards (did you use my code straight from the zip or did you use winmerge)***ERRORS***

***SPECIAL NOTE*** Unless a mod someone does is added to my code by me it is not supported by me, the person supplying the mod should offer support for it. I do not care if it's posted here or not, as long as they offer support for their changes

Decided to Upload this, it is no longer supported because I simply don't have the desire to do so anymore.
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."

Last edited by Greystar; 11-17-2006 at 06:52 PM.
Greystar is offline  
Old 02-17-2006, 04:44 AM   #2 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
Default

Future Ideas: (not currently in development)
  • Replace Guarded Regions with Guard Posts
  • Make Player Purchasable Guardposts where the can purchase Types of guards along with the guarded range (these will have to be placed in/near houses)
  • Make GuardPosts have a limited number of guards afterwhich the town is no longer guarded (untill a "timer" resets (probably won't be a timer) )
Using guardposts would make it so you could place one of these as a staff member in some of the buildings way out in the middle of no where making them safe for a player to run to and recover.

It's just an Idea I have and I started working on it but when I got fed up with some things that where going on I scrapped the project and deleted the code I was working on.
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."
Greystar is offline  
Old 02-17-2006, 08:35 AM   #3 (permalink)
 
Join Date: Sep 2005
Location: Roxboro, NC, USA
Age: 32
Posts: 139
Default

Excellent work. a few of my players were asking if this could be done. I guess it can and will. They will be pleased.
dashiznit_76 is offline  
Old 02-18-2006, 04:45 AM   #4 (permalink)
 
Join Date: Feb 2006
Posts: 3
Default

Pimp'n scripts homey. You got mad skills.
Alileo is offline  
Old 02-18-2006, 09:15 PM   #5 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
Default

Quote:
Originally Posted by dashiznit_76
Excellent work. a few of my players were asking if this could be done. I guess it can and will. They will be pleased.
Btw ALMOST anything CAN be done if you put your mind to it.
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."
Greystar is offline  
Old 02-18-2006, 11:08 PM   #6 (permalink)
Forum Master
 
Joeku's Avatar
 
Join Date: Feb 2005
Location: ShatteredSosaria.com
Posts: 9,261
Default

I've been using this script for about 3 months, and it's been great. To my knowledge, if one guard that is called gets killed, then three more come. If each of them get killed, no more come. This has posed a bit of an issue for me... I modified the system a bit so that a random guard type would be selected, instead of there being a certain type for each region. I'd post them but they use my custom resources. Anyways, with the modification that I did, all four of the guards (the first one that gets killed and the three that follow) are the same type. It would be cool if you added a randomize type option, and if it would actually randomize each one instead of just the type of each call. Here's my modification to GuardedRegion.cs:
Code:
		public override void MakeGuard( Mobile focus )
		{
			BaseGuard useGuard = null;

			foreach ( Mobile m in focus.GetMobilesInRange( 14 ) )
			{
				if ( m is BaseGuard )
				{
					BaseGuard g = (BaseGuard)m;

					if ( g.Focus == null ) // idling
					{
						useGuard = g;
						break;
					}
				}
			}

			if ( useGuard != null )
			{
				useGuard.Focus = focus;
			}
			else
			{ 
				Type guardType = m_GuardType;
           			switch (Utility.Random(4))  
				{  
					case 0: guardType = typeof( WarriorGuard ); break;  
					case 1: guardType = typeof( ArcherGuard ); break;  
					case 2: guardType = typeof( MageGuard ); ; break;  
					default: guardType = typeof( PaladinGuard ); break;  
				}

				m_GuardParams[0] = focus;
				// Greystar -- This is the only change made in this part of the file
				BaseGuard m_Guard = (BaseGuard)Activator.CreateInstance( guardType, m_GuardParams );
				m_Guard.BackUP = false;
			}
		}
But, as I explained just before, it doesn't function fully.
Joeku is offline  
Old 02-19-2006, 10:07 PM   #7 (permalink)
Forum Novice
 
Evil Jason's Avatar
 
Join Date: Jan 2005
Location: The People's Republic of Massachusetts
Age: 34
Posts: 158
Unhappy Crash Problem

Hey Greystar. I just want to say this is a killer script but whenever a red player attacks a guard i get this error and the shard crashes. This isn't an isolated issue, it happens every time a red attacks a guard.


Quote:
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Mobiles.BaseCreature.OnMovement(Mobile m, Point3D oldLocation)
at Server.Mobile.Move(Direction d)
at Server.Mobiles.PlayerMobile.Move(Direction d)
at Server.Network.PacketHandlers.MovementReq(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
Any ideas on what can cause this?


~Jason
__________________
So long and thanks for all the fish. :D

時々私poop
Quote:
Welcome to Thunderdome, Bitch.
Evil Jason is offline  
Old 02-19-2006, 11:58 PM   #8 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
Default

Quote:
Originally Posted by Evil Jason
Hey Greystar. I just want to say this is a killer script but whenever a red player attacks a guard i get this error and the shard crashes. This isn't an isolated issue, it happens every time a red attacks a guard.




Any ideas on what can cause this?


~Jason
get me a copy in debug mode and I can probably fix it, but i suspect its something that I fixxed but maybe forgot to include in the pack I distribute since all my files that are part of this are really modified.

Quote:
Originally Posted by me
Server Crash Report
===================

Operating System: Microsoft Windows NT 5.1.2600.0
.NET Framework: 1.1.4322.573
Time: 02/20/2006 9:04:03 PM
Mobiles: 27440
Items: 146757
Clients:
- Count: 1
+ 127.0.0.1: (account = The Grey One) (mobile = 0x1 'Greystar')

Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Mobiles.BaseCreature.OnMovement(Mobile m, Point3D oldLocation) in d:\UOLocal\RunUO\Scripts\Engines\AI\Creature\BaseC reature.cs:line 4182
at Server.Mobile.Move(Direction d)
at Server.Mobiles.PlayerMobile.Move(Direction d) in d:\UOLocal\RunUO\Scripts\Mobiles\PlayerMobile.cs:l ine 963
at Server.Network.PacketHandlers.MovementReq(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
I think I found your crash issue This is my crashlog when I changed myself to a murderer and made it so that Reds where not allowed in town. I think its the same, but line numbers will invariably be different since my code is different. I am testing fixes.
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."

Last edited by Greystar; 02-20-2006 at 11:11 PM.
Greystar is offline  
Old 02-20-2006, 08:21 AM   #9 (permalink)
Forum Newbie
 
Join Date: Dec 2005
Posts: 19
Default

if i try to put GuardedRegionStone.cs in my custom directory i got this problem:


Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Items.GuardedRegionStone.OnLoad(ServerListE ventArgs e)
at Server.ServerListEventHandler.Invoke(ServerListEve ntArgs e)
at Server.Network.PacketHandlers.AccountLogin_ReplyAc k(NetState state)
at Server.Network.PacketHandlers.AccountLogin(NetStat e state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)

in other words when someone try to log in the server crash and gives this error

thank's
kaiovas is offline  
Old 02-20-2006, 11:54 PM   #10 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
Default

Unless I discover Evil Jason's Problem is different then the one I just found (don't know why it never occured before) I think I fixxed it. I will be posting the fix in one of the top threads and the BaseCreature I had to change will be fixxed in the Zip... Heh guess version 1.0.7 wasn't final.
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."
Greystar is offline  
Old 02-21-2006, 02:56 AM   #11 (permalink)
Forum Novice
 
Aeolus's Avatar
 
Join Date: Dec 2005
Location: Indianapolis
Posts: 732
Send a message via AIM to Aeolus Send a message via MSN to Aeolus Send a message via Yahoo to Aeolus
Default

I've been using your guard since I launched my shard. I've been very pleased with them. You did solicit suggestions though, so I thought about it and decided to give you one... I think a [Global SetAllowReds command would really be a nice feature. If I was a better scripter, I would do it... unfortunately, I am not. Anyway, your killable guards are a great addition to my shard- my players love them. Actually, now that I think about it, I have a question for you... I created a mount based off of the distro Beetle.cs. It uses the same AI. I added them to the SBAnimalTrainer.cs. When a player would buy it, the guards would appear, and begin attacking it, even though it was blue... any ideas on what might've caused that? I have coincidently removed them from the Animal Trainers inventory, so it's no big deal, I'm just curious. Thanks for the great scripts!
Aeolus is offline  
Old 02-21-2006, 03:58 AM   #12 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
Default

Quote:
Originally Posted by Aeolus
I've been using your guard since I launched my shard. I've been very pleased with them. You did solicit suggestions though, so I thought about it and decided to give you one... I think a [Global SetAllowReds command would really be a nice feature. If I was a better scripter, I would do it... unfortunately, I am not. Anyway, your killable guards are a great addition to my shard- my players love them. Actually, now that I think about it, I have a question for you... I created a mount based off of the distro Beetle.cs. It uses the same AI. I added them to the SBAnimalTrainer.cs. When a player would buy it, the guards would appear, and begin attacking it, even though it was blue... any ideas on what might've caused that? I have coincidently removed them from the Animal Trainers inventory, so it's no big deal, I'm just curious. Thanks for the great scripts!
Very likely it was the FightMode.Closest cause the guards assume its hostile, that was similair to the evodragon issue one of my friends had on his shard. There is a couple of ways around it... One is the more obvious one, change the the FightMode to something other than Closest (Aggressor for instance) that way it would attack anything that attacked it like most animals. It really has nothing to do with the AI. I think the Distro Beetle also used FightMode.Closest so it is still vulnerable to this unless its already under the control of a player I made sure that controlled mobiles no matter what type of FightMode they had would be exempt from the guards unless the Owner was criminal OR a murderer who wasn't allow in town.

I'll look into the Global settings for changing some settings I'm not exactly sure how to allow the Global (or Multi or any of those others) work so I have to figure that out before I can get it to work with the command. It's probably something simple, but I really had no use for it so never looked into it, usually when someone sets one of those its for whatever town they want as apposed to all of them). However I will look into that, in the mean time if you want all your Towns to not allow reds up near the top is the redifinition of the m_AllowReds variable and you can see that says Core.AOS to change that you can either put false or !Core.AOS that means that if you turn AOS off then Reds Will be allowed into town as opposed to when AOS is on reds are allowed in town.

Code:
		private bool m_AllowReds = Core.AOS;
to
Code:
		private bool m_AllowReds = !Core.AOS; //this one just remember when you disable AOS then this becomes true.
or
Code:
		private bool m_AllowReds = false; //this one will turn off the AllowReds setting making it so reds are not allowed in anytown (except BucksDen which isnt guarded) by default
However Something just occured to me... have you tried

[Global set Allowed false
or maybe
[Global set Allowed false where GuardedRegion

not sure if either of those would work but its a thought. I think im going to create a distribution system for my GuardedRegionStone as soon as I get that crashlog from the person having problems so I know if it was the stone itself or it was misplaced.

Just keep in mind though that even if either one works and you restart your shard it will reset back to whatever m_AllowReds equal to by default.
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."
Greystar is offline  
Old 02-21-2006, 04:21 AM   #13 (permalink)
Forum Novice
 
Aeolus's Avatar
 
Join Date: Dec 2005
Location: Indianapolis
Posts: 732
Send a message via AIM to Aeolus Send a message via MSN to Aeolus Send a message via Yahoo to Aeolus
Default

I'm a little confused... I want to allow reds in ALL cities, is that how it is by default? If it is, I don't need to change anything.
Aeolus is offline  
Old 02-21-2006, 04:27 AM   #14 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
Default

Quote:
Originally Posted by Aeolus
I'm a little confused... I want to allow reds in ALL cities, is that how it is by default? If it is, I don't need to change anything.
if AOS is enabled then Reds are Allowed by default. I left it just like it was in the distro guardedregions so people wouldn't loose their normal functionality. if it isn't like that in yours you MAY be using an older copy. I have no idea though. But your reds should be able to walk in and out of town and use vendors just like everyone else. Its just if they are criminal is when they have a problem... I think when they attack an innocent player in town (ie in Felluca or any facet with Fel RuleSet) they become criminal making it so the Vendors Might call guards.
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."
Greystar is offline  
Old 02-21-2006, 04:43 AM   #15 (permalink)
Forum Novice
 
Aeolus's Avatar
 
Join Date: Dec 2005
Location: Indianapolis
Posts: 732
Send a message via AIM to Aeolus Send a message via MSN to Aeolus Send a message via Yahoo to Aeolus
Default

Ok, I'm clear now, thanks for the info... I haven't played on OSI's servers since T2A, so I didn't realize it was already like that by default. I guess I'd better tell you that I don't need a [Global SetAllowReds command anymore, lol!
Aeolus is offline  
Old 02-21-2006, 04:45 AM   #16 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
Default

Quote:
Originally Posted by Aeolus
Ok, I'm clear now, thanks for the info... I haven't played on OSI's servers since T2A, so I didn't realize it was already like that by default. I guess I'd better tell you that I don't need a [Global SetAllowReds command anymore, lol!
If its doable I'll do it anyway cause someone else might want it.
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."
Greystar is offline  
Old 02-21-2006, 01:42 PM   #17 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

I haven't had time to take a look at your script, however I would say that something good to add is the ability to limit the amount of guards called on a person within a certain interval, lets say three times in 10 minutes. This way a guard doesn't poof as soon as they are killed.

I was interested in not instakill for my shard, but limiting the guards to how many are actually spawned in the region. That means that if you killed the guards, or they are all taking care of crimes, then you could potentially get away with something. The guards would poof, or run from a spawn within the region, as apposed to being summoned from nowhere.
XxSP1DERxX is offline  
Old 02-21-2006, 04:30 PM   #18 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
Default

Quote:
Originally Posted by XxSP1DERxX
I haven't had time to take a look at your script, however I would say that something good to add is the ability to limit the amount of guards called on a person within a certain interval, lets say three times in 10 minutes. This way a guard doesn't poof as soon as they are killed.

I was interested in not instakill for my shard, but limiting the guards to how many are actually spawned in the region. That means that if you killed the guards, or they are all taking care of crimes, then you could potentially get away with something. The guards would poof, or run from a spawn within the region, as apposed to being summoned from nowhere.
Heh, there is a limit, unfortunatly I can't find a way to stop multiple vendors from calling guards.

Example: 3 vendors see a player then they are going to get 3 guards and those 3 guards will each get 3 backups if the player manages to kill those guards. However after that there is a delay (that the instalkill guards used to have) that will prevent any more guards from being called. Which is about 15 seconds.

That was never one I edited, because of how it works in BaseCreature I haven't been able to get it to stop calling guards if multiple vendors see the player. If I could figure out a way to stop the vendors from calling multiple guards I would. Right now I decided to work in Joeku's idea, I think I have it working more or less that this point, just need to do some more testing.
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."
Greystar is offline  
Old 02-21-2006, 05:38 PM   #19 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

Quote:
Originally Posted by Greystar
Heh, there is a limit, unfortunatly I can't find a way to stop multiple vendors from calling guards.

Example: 3 vendors see a player then they are going to get 3 guards and those 3 guards will each get 3 backups if the player manages to kill those guards. However after that there is a delay (that the instalkill guards used to have) that will prevent any more guards from being called. Which is about 15 seconds.

That was never one I edited, because of how it works in BaseCreature I haven't been able to get it to stop calling guards if multiple vendors see the player. If I could figure out a way to stop the vendors from calling multiple guards I would. Right now I decided to work in Joeku's idea, I think I have it working more or less that this point, just need to do some more testing.
Since each mobile calls guards seperately and that goes through the guard system via the GuardedRegion, etc, you should make a hashtable/generic where the key is the Mobile that is being called guards on, and the value is the person who called guards on him OR the amount of times guards has been called. That way you can do
if ( m_Table[m] > 3 ) return false;
inside of a function called CanCallGuards( Mobile m ) or something similar. Run that through the function that calls the speech and the guard system for vendors, and you will have it limited how you want it.
XxSP1DERxX is offline  
Old 02-22-2006, 09:41 AM   #20 (permalink)
Forum Novice
 
Join Date: Jan 2006
Location: Illinios
Age: 25
Posts: 162
Send a message via ICQ to viront
Default Hmmm

Quote:
Originally Posted by Greystar
Future Ideas: (not currently in development)
  • Replace Guarded Regions with Guard Posts
  • Make Player Purchasable Guardposts where the can purchase Types of guards along with the guarded range (these will have to be placed in/near houses)
  • Make GuardPosts have a limited number of guards afterwhich the town is no longer guarded (untill a "timer" resets (probably won't be a timer) )
Using guardposts would make it so you could place one of these as a staff member in some of the buildings way out in the middle of no where making them safe for a player to run to and recover.

It's just an Idea I have and I started working on it but when I got fed up with some things that where going on I scrapped the project and deleted the code I was working on.
I like the guard posts you were talking about before but I'm not sure exactly how you picture them working. Would the guard post be sort of a spawner? Maybe the admin/GMs could set the guarded range and something like maxGuards and guardRegenSpeed. That would help for building custom towns or trade outposts, maybe something in a dungeon The other thing you talked about was the ability to hire guards, could the be achieved by simply adding hireling scripts for guards, or editing the guards to act like hirelings when not whacking away?
Anyway I'm going to give your guard system a try, it may be a pain since I think I had to edit some of those scripts for XMLSpawner add-ons.


-Viront

--- My first post please don't flame... too much.
viront is offline  
Old 02-22-2006, 02:48 PM   #21 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
Default

Quote:
Originally Posted by viront
I like the guard posts you were talking about before but I'm not sure exactly how you picture them working. Would the guard post be sort of a spawner? Maybe the admin/GMs could set the guarded range and something like maxGuards and guardRegenSpeed. That would help for building custom towns or trade outposts, maybe something in a dungeon The other thing you talked about was the ability to hire guards, could the be achieved by simply adding hireling scripts for guards, or editing the guards to act like hirelings when not whacking away?
Anyway I'm going to give your guard system a try, it may be a pain since I think I had to edit some of those scripts for XMLSpawner add-ons.


-Viront

--- My first post please don't flame... too much.

how I intend them to work is simply this.
1) I created an Item to use as the spawner (basically a guard only spawner)
2) Settings on spawner
  • GuardType (May allow for multiple types)
  • HearRange (how far away guards can hear a cry for help) (Guards always spawn at spawner)
  • Set Waypoint option (so guards can walk in a guard pattern)
  • Disables Guarded Region if placed inside one (no need for two types of guarded regions)
  • Amount of Guards to Spawn (Maybe for each type)
  • Amount of Time for Guardpost to "refill"
  • Amount of Guards to fill during "refill time tick" (untill full)
  • SetByStaff (this will be set automatically)
  • Owner (the person who placed the spawner) (also set automatically)
3) costs if not set by staff
  • Cost of each initial guard
  • Cost by guard type
  • Cost of Maintenance
  • Cost of Guardable range (the area in which they hear Guards called)
  • Maybe More not sure
4) requires being in a house unless set up by staff (probably make setting these up manually only available for staff and players have to buy a deed for the spawner)
5) don't know if I intended anything else.

The guards themselves aren't actually hirable the stone (item) will be purchasable via deed just like the old guild deeds. If the player doesnt have enough money in their bankbox then the stone shuts down (actually just doesnt spawn any guards or despawns them if waypoints where set)

Can't really think of anything else I was (or am) going to do with this at this time. (maybe charge a little more of the guard is mounted).

EDIT: I don't flame my sig was in reference to other people. The only reason I'd flame anyone is if I needed combustible material for my fireplace.
__________________
Quote:
<