Go Back   RunUO - Ultima Online Emulation > RunUO > FAQ Forum

FAQ Forum A place to find answers to the most frequently asked questions, and a place to post said answers. Do NOT use this forum to ask questions.

Reply
 
Thread Tools Display Modes
Old 02-23-2006, 09:12 PM   #1 (permalink)
 
Join Date: May 2003
Posts: 303
Default Auto Defend When Attacked

Mortis Originally posted this, but thought it might be useful to bring back to the FAQ forum for others to find easily. This mod goes in playermobile.cs.

What this does it auto defends and attacks anything that attacks you first. If you are in a group, and you get attacked, but bring the first attacker down enough that it flees, then you will auto-attack the next attacker in range.

Code:
		public override void OnDamage( int amount, Mobile from, bool willKill )
		{

			if ( amount > (Core.AOS ? 25 : 0) )
			{
				BandageContext c = BandageContext.GetContext( this );

				if ( c != null )
					c.Slip();
			}
///////////////////////ADDED////////////////////
	                            if (this.Combatant == null || !this.Combatant.Alive || !this.Combatant.InRange( this, 3 ))

		                             this.Combatant = from;
////////////////////////////////ADDED////////////////////
			WeightOverloading.FatigueOnDamage( this, amount );

			base.OnDamage( amount, from, willKill );
		}
Anvil is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5