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!

holy water script

Packer898

Knight
Well then you will need to identify the NPC some other way. Maybe by bodytype/Bodymod or something to that effect... I dont know if you could do it by name or not.

I was assuming that you had custom races set up that allowed players to be vampires. Honestly that I know how to do but with just an npc Im not sure. I will think on this a while. WOuld be helpful if you would post your vampire script though so I could look at it and see if there's anything we could use to idnetify them seperatly from other mobs.
 

devil6

Wanderer
here is the LesserVampire.cs



PHP:
using System;
using Server;
using Server.Misc;
using Server.Items;
using Server.Gumps;
using Server.Mobiles;
using Server.Network;
using Server.Targeting;
using System.Collections;
using Server.ContextMenus;
using Server.SkillHandlers;

	namespace Server.Mobiles
	{
	[CorpseName( "the corpse of a vampire" )]
	public class LesserVampire : BaseCreature
	{
	public override bool AlwaysMurderer{ get{ return true; } }

		[Constructable]
	public LesserVampire () : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.1, 0.1 )
		{

		Title = "A Lesser Vampire";
		Hue = 0;
  	if ( this.Female = Utility.RandomBool() )
  		{
   		Body = 0x191;
  		 Name = NameList.RandomName( "female" );
  		}
  	else
  		{
   		Body = 0x190;
   		Name = NameList.RandomName( "male" );
  		}


			Item hair = new Item( Utility.RandomList( 0x203B, 0x2049, 0x2048, 0x204A ) ); 
			hair.Hue = 1175; 
			hair.Layer = Layer.Hair; 
			hair.Movable = false; 
			AddItem( hair ); 

			LeatherGloves gloves = new LeatherGloves();
			gloves.Hue = 2106;
			gloves,movable = false;
			AddItem( gloves );
			Cloak cloak = new Cloak();
			cloak.Hue = 2106;
			AddItem( cloak );
			ShortPants pants = new ShortPants();
			pants.Hue = 2106;
			AddItem( pants );
			ThighBoots boots = new ThighBoots();
			boots.Hue = 2106;
			AddItem( boots );
			FancyShirt shirt = new FancyShirt();
			shirt.Hue = 1150;
			AddItem( shirt );

			SetStr( 120, 150 );
			SetDex( 100,250 );
			SetInt( 100, 250 );

			SetHits( 100, 125 );

			SetDamage( 15, 20 );

			SetDamageType( ResistanceType.Physical, 50 );

			SetResistance( ResistanceType.Physical, 55, 70 );
			SetResistance( ResistanceType.Fire, -15, 0 );
			SetResistance( ResistanceType.Cold, 80, 90 );
			SetResistance( ResistanceType.Poison, 40, 50 );
			SetResistance( ResistanceType.Energy, 40, 50 );

			SetSkill( SkillName.EvalInt, 50.1, 90.0 );
			SetSkill( SkillName.Magery, 50.1, 100.0 );
			SetSkill( SkillName.MagicResist, 99.1, 100.0 );
			SetSkill( SkillName.Tactics, 97.6, 100.0 );
			SetSkill( SkillName.Wrestling, 90.1, 100.0 );

			Fame = 500;
			Karma = -500;

			VirtualArmor = 25;
		}
	public override void GenerateLoot()
			{
			AddLoot( LootPack.FilthyRich, 1 );
			AddLoot( LootPack.Gems, Utility.Random( 1, 5 ) );
			}

	public LesserVampire( Serial serial ) : base( serial )
		{
		}

	public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}

	public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}
}
 

Rabban

Sorceror
Code:
                if ( o is Mobile ) 
                { 
                    Mobile m = (Mobile)o; 
                     
                    if ( m.RaceType == RaceType.LesserVampire ) 
                    { 
                        int damage = Utility.RandomMinMax( 3, 8 ); 
                         
                        damage += vampireBonus; 
                         
                        if ( !Core.AOS && damage > 40 ) 
                            damage = 40; 
                        else if ( Core.AOS && toDamage > 2 ) 
                            damage /= toDamage - 1; 
                         
                        AOS.Damage( m, from, damage, 0, 100, 0, 0, 0 ); 
                    } 
                 
             
                    if ( from == null || (SpellHelper.ValidIndirectTarget( from, m ) && from.CanBeHarmful( m, false )) ) 
                    { 
                        if ( from != null ) 
                            from.DoHarmful( m ); 
                         
                        int damage = Utility.RandomMinMax( min, max ); 
                         
                        damage += alchemyBonus; 
                } 
                else if ( o is BaseHolyWater ) 
                { 
                    BaseHolyWater pot = (BaseHolyWater)o; 

                    pot.Explode( from, false, pot.GetWorldLocation(), pot.Map ); 
                     

                }

Earlier you said you had a missing bracket. Adding one to the end may not be the proper solution. I believe in the code snippet I put above you should see where you're missing one. It appears you need one after damage +=AlchemyBonus instead of at the end (putting one at the end will alter how your elseifs work).


Also in the way of identifying if it's a vampire, there should be some sort of "instanceOf" test that you could test if the Mobile is an instance of Server.Mobile.LesserVampire (Note: So far my strong point is java, so I'm not sure what the exact syntax or keyword is for C#).
 

devil6

Wanderer
ok here it is and the error, note: my Lesser Vampire script is in the script file


PHP:
		public void Explode( Mobile from, bool direct, Point3D loc, Map map )
		{
			if ( Deleted )
				return;
			
			Delete();
			
			for ( int i = 0; m_Users != null && i < m_Users.Count; ++i )
			{
				Mobile m = (Mobile)m_Users[i];
				ThrowTarget targ = m.Target as ThrowTarget;
				
				if ( targ != null && targ.Potion == this )
					Target.Cancel( m );
			}
			
			if ( map == null )
				return;
			
			Effects.PlaySound( loc, map, 0x207 );
			Effects.SendLocationEffect( loc, map, 0x36BD, 20 );
			
			int alchemyBonus = 0;
			int vampireBonus = 10;
			
			if ( direct )
				alchemyBonus = (int)(from.Skills.Alchemy.Value / (Core.AOS ? 5 : 10));
			
			IPooledEnumerable eable = LeveledExplosion ? map.GetObjectsInRange( loc, ExplosionRange ) : map.GetMobilesInRange( loc, ExplosionRange );
			ArrayList toExplode = new ArrayList();
			
			int toDamage = 0;
			
			foreach ( object o in eable )
			{
				if ( o is Mobile )
				{
					toExplode.Add( o );
					++toDamage;
				}
			}
			
			eable.Free();
			
			int min = Scale( from, MinDamage );
			int max = Scale( from, MaxDamage );
			
			for ( int i = 0; i < toExplode.Count; ++i )
			{
				object o = toExplode[i];
				
				if ( o is Mobile )
				{
					Mobile m = (Mobile)o;
					
					[COLOR="Red"]if ( m is LesserVampire )
					{
						int damage = Utility.RandomMinMax( 3, 8 );[/COLOR]
						
						damage += vampireBonus;
						
						if ( !Core.AOS && damage > 40 )
							damage = 40;
						else if ( Core.AOS && toDamage > 2 )
							damage /= toDamage - 1;
						
						AOS.Damage( m, from, damage, 0, 100, 0, 0, 0 );
					}
		
			
		
					if ( from == null || (SpellHelper.ValidIndirectTarget( from, m ) && from.CanBeHarmful( m, false )) )
					{
						if ( from != null )
							from.DoHarmful( m );
						
						int damage = Utility.RandomMinMax( min, max );
						
						damage += alchemyBonus;
				}
				else if ( o is BaseHolyWater )
				{
					BaseHolyWater pot = (BaseHolyWater)o;

					pot.Explode( from, false, pot.GetWorldLocation(), pot.Map );
					

					}



- Error: Scripts\Custom\BaseHolyWater.cs: CS0246: (line 263, column 16) The typ
e or namespace name 'LesserVampire' could not be found (are you missing a using
directive or an assembly reference?)
 

devil6

Wanderer
Sorry :)

PHP:
using System;
using System.Collections;
using Server;
using Server.Network;
using Server.Targeting;
using Server.Spells;

namespace Server.Items
{
	public abstract class BaseHolyWater : BasePotion
	{
		public abstract int MinDamage { get; }
		public abstract int MaxDamage { get; }

		public override bool RequireFreeHand{ get{ return false; } }

		private static bool LeveledExplosion = false; // Should explosion potions explode other nearby potions?
		private static bool InstantExplosion = false; // Should explosion potions explode on impact?
		private const int   ExplosionRange   = 2;     // How long is the blast radius?

		public BaseHolyWater( PotionEffect effect ) : base( 0xF0D, effect )
		{
		}

		public BaseHolyWater( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}

		public virtual object FindParent( Mobile from )
		{
			Mobile m = this.HeldBy;

			if ( m != null && m.Holding == this )
				return m;

			object obj = this.RootParent;

			if ( obj != null )
				return obj;

			if ( Map == Map.Internal )
				return from;

			return this;
		}

		private Timer m_Timer;

		private ArrayList m_Users;

		public override void Drink( Mobile from )
		{
			if ( Core.AOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)) )
			{
				from.SendLocalizedMessage( 1062725 ); // You can not use a purple potion while paralyzed.
				return;
			}

			ThrowTarget targ = from.Target as ThrowTarget;

			if ( targ != null && targ.Potion == this )
				return;

			from.RevealingAction();

			if ( m_Users == null )
				m_Users = new ArrayList();

			if ( !m_Users.Contains( from ) )
				m_Users.Add( from );

			from.Target = new ThrowTarget( this );

			if ( m_Timer == null )
			{
				from.SendLocalizedMessage( 500236 ); // You should throw it now!
				m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 0.75 ), TimeSpan.FromSeconds( 1.0 ), 4, new TimerStateCallback( Detonate_OnTick ), new object[]{ from, 3 } );
			}
		}

		private void Detonate_OnTick( object state )
		{
			if ( Deleted )
				return;

			object[] states = (object[])state;
			Mobile from = (Mobile)states[0];
			int timer = (int)states[1];

			object parent = FindParent( from );

			if ( timer == 0 )
			{
				Point3D loc;
				Map map;

				if ( parent is Item )
				{
					Item item = (Item)parent;

					loc = item.GetWorldLocation();
					map = item.Map;
				}
				else if ( parent is Mobile )
				{
					Mobile m = (Mobile)parent;

					loc = m.Location;
					map = m.Map;
				}
				else
				{
					return;
				}

				Explode( from, true, loc, map );
			}
			else
			{
				if ( parent is Item )
					((Item)parent).PublicOverheadMessage( MessageType.Regular, 0x22, false, timer.ToString() );
				else if ( parent is Mobile )
					((Mobile)parent).PublicOverheadMessage( MessageType.Regular, 0x22, false, timer.ToString() );

				states[1] = timer - 1;
			}
		}

		private void Reposition_OnTick( object state )
		{
			if ( Deleted )
				return;

			object[] states = (object[])state;
			Mobile from = (Mobile)states[0];
			IPoint3D p = (IPoint3D)states[1];
			Map map = (Map)states[2];

			Point3D loc = new Point3D( p );

			if ( InstantExplosion )
				Explode( from, true, loc, map );
			else
				MoveToWorld( loc, map );
		}

		private class ThrowTarget : Target
		{
			private BaseHolyWater m_Potion;

			public BaseHolyWater Potion
			{
				get{ return m_Potion; }
			}

			public ThrowTarget( BaseHolyWater potion ) : base( 12, true, TargetFlags.None )
			{
				m_Potion = potion;
			}

			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( m_Potion.Deleted || m_Potion.Map == Map.Internal )
					return;

				IPoint3D p = targeted as IPoint3D;

				if ( p == null )
					return;

				Map map = from.Map;

				if ( map == null )
					return;

				SpellHelper.GetSurfaceTop( ref p );

				from.RevealingAction();

				IEntity to;

				if ( p is Mobile )
					to = (Mobile)p;
				else
					to = new Entity( Serial.Zero, new Point3D( p ), map );

				Effects.SendMovingEffect( from, to, m_Potion.ItemID & 0x3FFF, 7, 0, false, false, m_Potion.Hue, 0 );

				m_Potion.Internalize();
				Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( m_Potion.Reposition_OnTick ), new object[]{ from, p, map } );
			}
		}

		public void Explode( Mobile from, bool direct, Point3D loc, Map map )
		{
			if ( Deleted )
				return;
			
			Delete();
			
			for ( int i = 0; m_Users != null && i < m_Users.Count; ++i )
			{
				Mobile m = (Mobile)m_Users[i];
				ThrowTarget targ = m.Target as ThrowTarget;
				
				if ( targ != null && targ.Potion == this )
					Target.Cancel( m );
			}
			
			if ( map == null )
				return;
			
			Effects.PlaySound( loc, map, 0x207 );
			Effects.SendLocationEffect( loc, map, 0x36BD, 20 );
			
			int alchemyBonus = 0;
			int vampireBonus = 10;
			
			if ( direct )
				alchemyBonus = (int)(from.Skills.Alchemy.Value / (Core.AOS ? 5 : 10));
			
			IPooledEnumerable eable = LeveledExplosion ? map.GetObjectsInRange( loc, ExplosionRange ) : map.GetMobilesInRange( loc, ExplosionRange );
			ArrayList toExplode = new ArrayList();
			
			int toDamage = 0;
			
			foreach ( object o in eable )
			{
				if ( o is Mobile )
				{
					toExplode.Add( o );
					++toDamage;
				}
			}
			
			eable.Free();
			
			int min = Scale( from, MinDamage );
			int max = Scale( from, MaxDamage );
			
			for ( int i = 0; i < toExplode.Count; ++i )
			{
				object o = toExplode[i];
				
				if ( o is Mobile )
				{
					Mobile m = (Mobile)o;
					
					if ( m is LesserVampire )
					{
						int damage = Utility.RandomMinMax( 3, 8 );
						
						damage += vampireBonus;
						
						if ( !Core.AOS && damage > 40 )
							damage = 40;
						else if ( Core.AOS && toDamage > 2 )
							damage /= toDamage - 1;
						
						AOS.Damage( m, from, damage, 0, 100, 0, 0, 0 );
					}
		
			
		
					if ( from == null || (SpellHelper.ValidIndirectTarget( from, m ) && from.CanBeHarmful( m, false )) )
					{
						if ( from != null )
							from.DoHarmful( m );
						
						int damage = Utility.RandomMinMax( min, max );
						
						damage += alchemyBonus;
				}
				else if ( o is BaseHolyWater )
				{
					BaseHolyWater pot = (BaseHolyWater)o;

					pot.Explode( from, false, pot.GetWorldLocation(), pot.Map );
					

					}
				}
			}
		}
	}
}
 

daat99

Moderator
Staff member
- Error: Scripts\Custom\BaseHolyWater.cs: CS0246: (line 263, column 16) The typ
e or namespace name 'LesserVampire' could not be found (are you missing a using
directive
or an assembly reference?)
Can you tell what namespace the LesserVampire is located in?
 

devil6

Wanderer
well, the Lesser VAmpire script is a script i made so its just in my custom file. i have a Holywater script made also, just like the BaseExplotionPostion and the ExplostionPostion scripts.
 

daat99

Moderator
Staff member
devil6 said:
well, the Lesser VAmpire script is a script i made so its just in my custom file. i have a Holywater script made also, just like the BaseExplotionPostion and the ExplostionPostion scripts.
I asked if you can tell me what namespace the vampire is in.
The script you posted is located in namespace Server.Items.
 

daat99

Moderator
Staff member
devil6 said:
sorry again man, i have a habbit of ready way to fast...lol its in
namespace Server. Mobiles
Now read post #48 by me and try to figure out what you're missing.
 

daat99

Moderator
Staff member
devil6 said:
THX......... i've learned a ton of stuff talking to you guys thanks alot........... EVERYONE
It'll be nice if you post how you fixed this so if someone will search this thread he'll learn what you did as well.
Anyway I'm always glad to help ;)
 

devil6

Wanderer
yea good call i will do that, i will also release this to everyone as well, seeing how all over you help me with this, however there is one last thing i notice. EVerything works..... it Explodes, and it only works on LesserVampire types. How ever the idea of this is to coast alot of gold for 1 bottle, which indeed kill a vampire in one shot. I can't seam to set it right to kill the vampire in one go. you will see that i set MAx damage up alot and i check the vampire it's self to see how high its HP where, any anyways here it is. Which one do i need to kick up?

BaseHolyWater.cs

PHP:
using System;
using System.Collections;
using Server;
using Server.Network;
using Server.Targeting;
using Server.Spells;
using Server.Mobiles;

namespace Server.Items
{
	public abstract class BaseHolyWater : BasePotion
	{
		public abstract int MinDamage { get; }
		public abstract int MaxDamage { get; }

		public override bool RequireFreeHand{ get{ return false; } }

		private static bool LeveledExplosion = false; // Should explosion potions explode other nearby potions?
		private static bool InstantExplosion = false; // Should explosion potions explode on impact?
		private const int   ExplosionRange   = 2;     // How long is the blast radius?

		public BaseHolyWater( PotionEffect effect ) : base( 0xF0D, effect )
		{
		}

		public BaseHolyWater( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}

		public virtual object FindParent( Mobile from )
		{
			Mobile m = this.HeldBy;

			if ( m != null && m.Holding == this )
				return m;

			object obj = this.RootParent;

			if ( obj != null )
				return obj;

			if ( Map == Map.Internal )
				return from;

			return this;
		}

		private Timer m_Timer;

		private ArrayList m_Users;

		public override void Drink( Mobile from )
		{
			if ( Core.AOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)) )
			{
				from.SendLocalizedMessage( 1062725 ); // You can not use a purple potion while paralyzed.
				return;
			}

			ThrowTarget targ = from.Target as ThrowTarget;

			if ( targ != null && targ.Potion == this )
				return;

			from.RevealingAction();

			if ( m_Users == null )
				m_Users = new ArrayList();

			if ( !m_Users.Contains( from ) )
				m_Users.Add( from );

			from.Target = new ThrowTarget( this );

			if ( m_Timer == null )
			{
				from.SendLocalizedMessage( 500236 ); // You should throw it now!
				m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 0.75 ), TimeSpan.FromSeconds( 1.0 ), 4, new TimerStateCallback( Detonate_OnTick ), new object[]{ from, 3 } );
			}
		}

		private void Detonate_OnTick( object state )
		{
			if ( Deleted )
				return;

			object[] states = (object[])state;
			Mobile from = (Mobile)states[0];
			int timer = (int)states[1];

			object parent = FindParent( from );

			if ( timer == 0 )
			{
				Point3D loc;
				Map map;

				if ( parent is Item )
				{
					Item item = (Item)parent;

					loc = item.GetWorldLocation();
					map = item.Map;
				}
				else if ( parent is Mobile )
				{
					Mobile m = (Mobile)parent;

					loc = m.Location;
					map = m.Map;
				}
				else
				{
					return;
				}

				Explode( from, true, loc, map );
			}
			else
			{
				if ( parent is Item )
					((Item)parent).PublicOverheadMessage( MessageType.Regular, 0x22, false, timer.ToString() );
				else if ( parent is Mobile )
					((Mobile)parent).PublicOverheadMessage( MessageType.Regular, 0x22, false, timer.ToString() );

				states[1] = timer - 1;
			}
		}

		private void Reposition_OnTick( object state )
		{
			if ( Deleted )
				return;

			object[] states = (object[])state;
			Mobile from = (Mobile)states[0];
			IPoint3D p = (IPoint3D)states[1];
			Map map = (Map)states[2];

			Point3D loc = new Point3D( p );

			if ( InstantExplosion )
				Explode( from, true, loc, map );
			else
				MoveToWorld( loc, map );
		}

		private class ThrowTarget : Target
		{
			private BaseHolyWater m_Potion;

			public BaseHolyWater Potion
			{
				get{ return m_Potion; }
			}

			public ThrowTarget( BaseHolyWater potion ) : base( 12, true, TargetFlags.None )
			{
				m_Potion = potion;
			}

			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( m_Potion.Deleted || m_Potion.Map == Map.Internal )
					return;

				IPoint3D p = targeted as IPoint3D;

				if ( p == null )
					return;

				Map map = from.Map;

				if ( map == null )
					return;

				SpellHelper.GetSurfaceTop( ref p );

				from.RevealingAction();

				IEntity to;

				if ( p is Mobile )
					to = (Mobile)p;
				else
					to = new Entity( Serial.Zero, new Point3D( p ), map );

				Effects.SendMovingEffect( from, to, m_Potion.ItemID & 0x3FFF, 7, 0, false, false, m_Potion.Hue, 0 );

				m_Potion.Internalize();
				Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( m_Potion.Reposition_OnTick ), new object[]{ from, p, map } );
			}
		}

		public void Explode( Mobile from, bool direct, Point3D loc, Map map )
		{
			if ( Deleted )
				return;
			
			Delete();
			
			for ( int i = 0; m_Users != null && i < m_Users.Count; ++i )
			{
				Mobile m = (Mobile)m_Users[i];
				ThrowTarget targ = m.Target as ThrowTarget;
				
				if ( targ != null && targ.Potion == this )
					Target.Cancel( m );
			}
			
			if ( map == null )
				return;
			
			Effects.PlaySound( loc, map, 0x207 );
			Effects.SendLocationEffect( loc, map, 0x36BD, 20 );
			
			int alchemyBonus = 0;
			int vampireBonus = 10;
			
			if ( direct )
				alchemyBonus = (int)(from.Skills.Alchemy.Value / (Core.AOS ? 5 : 10));
			
			IPooledEnumerable eable = LeveledExplosion ? map.GetObjectsInRange( loc, ExplosionRange ) : map.GetMobilesInRange( loc, ExplosionRange );
			ArrayList toExplode = new ArrayList();
			
			int toDamage = 0;
			
			foreach ( object o in eable )
			{
				if ( o is Mobile )
				{
					toExplode.Add( o );
					++toDamage;
				}
			}
			
			eable.Free();
			
			int min = Scale( from, MinDamage );
			int max = Scale( from, MaxDamage );
			
			for ( int i = 0; i < toExplode.Count; ++i )
			{
				object o = toExplode[i];
				
				if ( o is Mobile )
				{
					Mobile m = (Mobile)o;
					
					if ( m is LesserVampire )
					{
						int damage = Utility.RandomMinMax( 500, 600 );
						
						damage += vampireBonus;
						
						if ( !Core.AOS && damage > 40 )
							damage = 40;
						else if ( Core.AOS && toDamage > 2 )
							damage /= toDamage - 1;
						
						AOS.Damage( m, from, damage, 0, 100, 0, 0, 0 );
					}
		
			
		
					if ( from == null || (SpellHelper.ValidIndirectTarget( from, m ) && from.CanBeHarmful( m, false )) )
					{
						if ( from != null )
							from.DoHarmful( m );
						
						int damage = Utility.RandomMinMax( min, max );
						
						damage += alchemyBonus;
				}
				else if ( o is BaseHolyWater )
				{
					BaseHolyWater pot = (BaseHolyWater)o;

					pot.Explode( from, false, pot.GetWorldLocation(), pot.Map );
					

					}
				}
			}
		}
	}
}

HolyWater.cs
PHP:
using System;
using Server;
using Server.Targeting;
using Server.Items;




namespace Server.Items
{
	public class HolyWater : BaseHolyWater
	{
		public override int MinDamage { get { return 100; } }

		public override int MaxDamage { get { return 125; } }

		[Constructable]
		public HolyWater() : base( PotionEffect.ExplosionGreater )
		{
		Name = " Holy Water ";
		Hue = 1264;
		}
		
		public HolyWater( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}
	}
}
 

Packer898

Knight
Well youve got the LesserVampire hits set to 100, 125. Which is minimum of 100 max of 125. Now then youve got the HolyWater damage set to 100, 125. Which is 100 minimum and 125 max. Now lets say the Vampires hits are maxed(125). And you throw some holy water on it. The damage could be anywhere from 100-125. If you want to kill them everytime then I would suggest setting the min damage to 126 and max to 127. Guaranteed kill that way.
 

devil6

Wanderer
hrmmm , ok just for testing i turned the min and max to 500 and 1000 just to see what it would do, and its still just taking off not even a quarter of his HP
 

daat99

Moderator
Staff member
devil6 said:
hrmmm , ok just for testing i turned the min and max to 500 and 1000 just to see what it would do, and its still just taking off not even a quarter of his HP
Instead of setting the hits of the vampire to 100 and the damage of the holy water to 100000 or whatever number that will kill them in 1 hit why not just call the Kill() method on the vampire instead of applying damage to it?

P.S.
You should read a bit about objects (the vampire) and methods (Kill()) in order to do that so I suggest a quick tutorial in c# that cover both those subjects.
 

Packer898

Knight
Ahh very nice idea. Wish I had thought of it =)- Just use the kill command on the creature and 'viola, problem solved. =)-
 

daat99

Moderator
Staff member
Packer898 said:
Ahh very nice idea. Wish I had thought of it =)- Just use the kill command on the creature and 'viola, problem solved. =)-
Always glad to help ;)
 
Top