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] BaseSpecialCreature

Kenko

Page
BaseSpecialCreature

Description:
A derived class from BaseCreature allowing you to give special abilities to your monsters by just inheriting from BaseSpecialCreature instead BaseCreature.

Features:
-Nox Strike (pretty much like Yamandon's do)
-Life Drain (pretty much like succubus do)
-Minion Summoning (very configureable)
-Earthquaking (like rikktor's)
-Teleporting (like harrower's)
-Multiple Firebreathing: My special baby. I made this one for Hydras. you can make it throw 5 firebreaths at once, instead the regular one, for example.
-BaseSpecialCreature does NOT serialize, so you won't have to delete any mobiles in order to attach it to them.
-Every and each property and method are virtual, so you can easily add messages for each special creature, for example. I used earthquaking from this class in Dreadhorn, and scavenged through localization files, finding an appropiate message, and then a few mods in Dreadhorn.cs and I was ready to go:

Code:
//Example with Dreadhorn.

        public override bool DoesTeleporting  { get { return true; } }
        public override bool DoesEarthquaking { get { return true; } }

        public override void Earthquake()
            {
            PublicOverheadMessage( MessageType.Emote, 0x723, 1075081 ); //*Dreadhorn’s eyes light up, his mouth almost a grin, as he slams one hoof to the ground!*
            base.Earthquake();
            }

This, will give that mobile the special ability to earthquake, and the special ability to teleport people near him.

Enjoy!

Feedback is thanks.
 

Attachments

  • BaseSpecialCreature.cs
    18.9 KB · Views: 561
I would take it this is drop and play but for the record you may want to add install instructions for the less familiar people out there.
 

Kenko

Page
Ok, examples...

So... you want dragons in your shard to do five firebreaths at once ocasionally.

Code:
using System;
using Server;
using Server.Items;

namespace Server.Mobiles
{
	[CorpseName( "a dragon corpse" )]
	public class Dragon : BaseCreature
	{
		[Constructable]
		public Dragon () : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			Name = "a dragon";
			Body = Utility.RandomList( 12, 59 );
			BaseSoundID = 362;

			SetStr( 796, 825 );
			SetDex( 86, 105 );
			SetInt( 436, 475 );

			SetHits( 478, 495 );

			SetDamage( 16, 22 );

			SetDamageType( ResistanceType.Physical, 100 );

			SetResistance( ResistanceType.Physical, 55, 65 );
			SetResistance( ResistanceType.Fire, 60, 70 );
			SetResistance( ResistanceType.Cold, 30, 40 );
			SetResistance( ResistanceType.Poison, 25, 35 );
			SetResistance( ResistanceType.Energy, 35, 45 );

			SetSkill( SkillName.EvalInt, 30.1, 40.0 );
			SetSkill( SkillName.Magery, 30.1, 40.0 );
			SetSkill( SkillName.MagicResist, 99.1, 100.0 );
			SetSkill( SkillName.Tactics, 97.6, 100.0 );
			SetSkill( SkillName.Wrestling, 90.1, 92.5 );

			Fame = 15000;
			Karma = -15000;

			VirtualArmor = 60;

			Tamable = true;
			ControlSlots = 3;
			MinTameSkill = 93.9;
		}

		public override void GenerateLoot()
		{
			AddLoot( LootPack.FilthyRich, 2 );
			AddLoot( LootPack.Gems, 8 );
		}

		public override bool ReacquireOnMovement{ get{ return !Controlled; } }
		public override bool HasBreath{ get{ return true; } } // fire breath enabled
		public override bool AutoDispel{ get{ return !Controlled; } }
		public override int TreasureMapLevel{ get{ return 4; } }
		public override int Meat{ get{ return 19; } }
		public override int Hides{ get{ return 20; } }
		public override HideType HideType{ get{ return HideType.Barbed; } }
		public override int Scales{ get{ return 7; } }
		public override ScaleType ScaleType{ get{ return ( Body == 12 ? ScaleType.Yellow : ScaleType.Red ); } }
		public override FoodType FavoriteFood{ get{ return FoodType.Meat; } }
		public override bool CanAngerOnTame { get { return true; } }

		public Dragon( 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();
		}
	}
}

That is the distro code for a Dragon.

Code:
using System;
using Server;
using Server.Items;

namespace Server.Mobiles
{
	[CorpseName( "a dragon corpse" )]
	public class Dragon : [color=green]BaseSpecialCreature[/color]
	{[color=green]
            public override bool DoesMultiFirebreathing { get { return true; } }
            public override double MultiFirebreathingChance { get { return 0.4; } }
            public override int BreathDamagePercent { get { return 80; } }
            public override int BreathMaxTargets { get { return 5; } }
            public override int BreathMaxRange { get { return 5; } }
[/color]
		[Constructable]
		public Dragon () : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			Name = "a dragon";
			Body = Utility.RandomList( 12, 59 );
			BaseSoundID = 362;

			SetStr( 796, 825 );
			SetDex( 86, 105 );
			SetInt( 436, 475 );

			SetHits( 478, 495 );

			SetDamage( 16, 22 );

			SetDamageType( ResistanceType.Physical, 100 );

			SetResistance( ResistanceType.Physical, 55, 65 );
			SetResistance( ResistanceType.Fire, 60, 70 );
			SetResistance( ResistanceType.Cold, 30, 40 );
			SetResistance( ResistanceType.Poison, 25, 35 );
			SetResistance( ResistanceType.Energy, 35, 45 );

			SetSkill( SkillName.EvalInt, 30.1, 40.0 );
			SetSkill( SkillName.Magery, 30.1, 40.0 );
			SetSkill( SkillName.MagicResist, 99.1, 100.0 );
			SetSkill( SkillName.Tactics, 97.6, 100.0 );
			SetSkill( SkillName.Wrestling, 90.1, 92.5 );

			Fame = 15000;
			Karma = -15000;

			VirtualArmor = 60;

			Tamable = true;
			ControlSlots = 3;
			MinTameSkill = 93.9;
		}

		public override void GenerateLoot()
		{
			AddLoot( LootPack.FilthyRich, 2 );
			AddLoot( LootPack.Gems, 8 );
		}

		public override bool ReacquireOnMovement{ get{ return !Controlled; } }
		[color=green]//[/color]public override bool HasBreath{ get{ return true; } } // fire breath enabled
		public override bool AutoDispel{ get{ return !Controlled; } }
		public override int TreasureMapLevel{ get{ return 4; } }
		public override int Meat{ get{ return 19; } }
		public override int Hides{ get{ return 20; } }
		public override HideType HideType{ get{ return HideType.Barbed; } }
		public override int Scales{ get{ return 7; } }
		public override ScaleType ScaleType{ get{ return ( Body == 12 ? ScaleType.Yellow : ScaleType.Red ); } }
		public override FoodType FavoriteFood{ get{ return FoodType.Meat; } }
		public override bool CanAngerOnTame { get { return true; } }

		public Dragon( 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();
		}
	}
}

This is after configuring it for multiple firebreathing.
What does each thing mean?
Code:
public class Dragon : [color=green]BaseSpecialCreature[/color]
This will allow you to use the special abilities I've developed, and packed them into a single class, you will still be able to use BaseCreature (90% of NPC Mobiles inherit from this class) as normal, because BaseSpecialCreature inherits from it.

Code:
[color=green]public override bool DoesMultiFirebreathing { get { return true; } }[/color]
This will enable the multiple firebreathing ability.
Code:
[color=green]public override double MultiFirebreathingChance { get { return 0.4; } }[/color]
This will set a chance of 40% to use multiple firebreaths (if the chance is not hit, then the normal firebreathing style will be used).
Code:
[color=green]public override int BreathDamagePercent { get { return 80; } }[/color]
This basically works as a scalar. The more you reduce it, the less damage a firebreath does, I added this considering that multiple firebreaths will be thougher
Code:
[color=green]public override int BreathMaxTargets { get { return 5; } }[/color]
This will determine how many targets we will hit with our multiple firebreath
Code:
[color=green]public override int BreathMaxRange { get { return 5; } }[/color]
This will determine the max tile range to check for hitting with firebreaths.
Code:
[color=green]//[/color]public override bool HasBreath{ get{ return true; } } // fire breath enabled
Actually you could just leave this on, but I wanted to add that if you don't have it, it will work anyways, because baseclass defaults HasBreath to 'DoesMultiFirebreathing'.

Note that firebreaths won't hit a single target twice.
 

LordHogFred

Knight
Very nice,
Might I suggest adding a customisable aura effect to it?
Such as the cold effect or burning effect that would allow min/max damage and damage type to be configured.
Also perhaps adding a HealSelf property that would toggle the creature to use bandages, maybe thats a little more complex but just an idea :).
Anyway, very cool script :D
 

Joeku

Lord
Great job, man.

May I suggest adding special attack abilities using Courageous's Searches (you can do "stomp" effects that radiate out from the monster in a circle, or shoot a bolt of energy and damage everything in a line, etc.)
 

koluch

Sorceror
Question:

Very nice, by the by.

Wanted to know if the statements need to be at the top of the script, as in:
Code:
[B][SIZE=2][COLOR=#008000]namespace [/B][/COLOR][/SIZE][SIZE=2]Server[/SIZE][SIZE=2][COLOR=#006400].[/COLOR][/SIZE][SIZE=2]Mobiles
[/SIZE][SIZE=2][COLOR=#006400]{
[[/COLOR][/SIZE][B][SIZE=2][COLOR=#191970]CorpseName[/B][/COLOR][/SIZE][SIZE=2][COLOR=#006400]( [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]"a corpse of a nasty elf" [/COLOR][/SIZE][SIZE=2][COLOR=#006400])]
[/COLOR][/SIZE][B][SIZE=2][COLOR=#0000ff]public [/B][/COLOR][/SIZE][SIZE=2][COLOR=#ff0000]class [/COLOR][/SIZE][SIZE=2]ElvenSorcerer : BaseSpecialCreature
[/SIZE][SIZE=2][COLOR=#006400]{
[/COLOR][/SIZE][B][SIZE=2][COLOR=#0000ff]public [/B][/COLOR][/SIZE][SIZE=2][COLOR=#a52a2a]override [/COLOR][/SIZE][B][SIZE=2][COLOR=#ff0000]bool [/B][/COLOR][/SIZE][SIZE=2]DoesTeleporting [/SIZE][SIZE=2][COLOR=#006400]{ [/COLOR][/SIZE][SIZE=2][COLOR=#8b4513]get [/COLOR][/SIZE][SIZE=2][COLOR=#006400]{ [/COLOR][/SIZE][SIZE=2][COLOR=#000080]return [/COLOR][/SIZE][B][SIZE=2][COLOR=#008b8b]true[/B][/COLOR][/SIZE][SIZE=2][COLOR=#006400]; } }
[/COLOR][/SIZE][B][SIZE=2][COLOR=#0000ff]public [/B][/COLOR][/SIZE][SIZE=2][COLOR=#a52a2a]override [/COLOR][/SIZE][B][SIZE=2][COLOR=#ff0000]double [/B][/COLOR][/SIZE][SIZE=2]TeleportingChance [/SIZE][SIZE=2][COLOR=#006400]{ [/COLOR][/SIZE][SIZE=2][COLOR=#8b4513]get [/COLOR][/SIZE][SIZE=2][COLOR=#006400]{ [/COLOR][/SIZE][SIZE=2][COLOR=#000080]return [/COLOR][/SIZE][SIZE=2][COLOR=#00008b]0.625[/COLOR][/SIZE][SIZE=2][COLOR=#006400]; } }
[/COLOR][/SIZE][B][SIZE=2][COLOR=#0000ff]public [/B][/COLOR][/SIZE][SIZE=2][COLOR=#a52a2a]override [/COLOR][/SIZE][B][SIZE=2][COLOR=#ff0000]bool [/B][/COLOR][/SIZE][SIZE=2]DoesTripleBolting [/SIZE][SIZE=2][COLOR=#006400]{ [/COLOR][/SIZE][SIZE=2][COLOR=#8b4513]get [/COLOR][/SIZE][SIZE=2][COLOR=#006400]{ [/COLOR][/SIZE][SIZE=2][COLOR=#000080]return [/COLOR][/SIZE][B][SIZE=2][COLOR=#008b8b]true[/B][/COLOR][/SIZE][SIZE=2][COLOR=#006400]; } }
[/COLOR][/SIZE][B][SIZE=2][COLOR=#0000ff]public [/B][/COLOR][/SIZE][SIZE=2][COLOR=#a52a2a]override [/COLOR][/SIZE][B][SIZE=2][COLOR=#ff0000]double [/B][/COLOR][/SIZE][SIZE=2]TripleBoltingChance [/SIZE][SIZE=2][COLOR=#006400]{ [/COLOR][/SIZE][SIZE=2][COLOR=#8b4513]get [/COLOR][/SIZE][SIZE=2][COLOR=#006400]{ [/COLOR][/SIZE][SIZE=2][COLOR=#000080]return [/COLOR][/SIZE][SIZE=2][COLOR=#00008b]0.25[/COLOR][/SIZE][SIZE=2][COLOR=#006400]; } }[/COLOR][/SIZE]
[SIZE=2][COLOR=#006400]
[/COLOR][/SIZE]
or should it go down under loot with stuff like:
Code:
[/COLOR]
[B][SIZE=2][COLOR=#0000ff]public [/B][/COLOR][/SIZE][SIZE=2][COLOR=#a52a2a]override [/COLOR][/SIZE][B][SIZE=2][COLOR=#ff0000]bool [/B][/COLOR][/SIZE][SIZE=2]CanRummageCorpses[/SIZE][SIZE=2][COLOR=#006400]{ [/COLOR][/SIZE][SIZE=2][COLOR=#8b4513]get[/COLOR][/SIZE][SIZE=2][COLOR=#006400]{ [/COLOR][/SIZE][SIZE=2][COLOR=#000080]return [/COLOR][/SIZE][B][SIZE=2][COLOR=#008b8b]true[/B][/COLOR][/SIZE][SIZE=2][COLOR=#006400]; } } 
[/COLOR][/SIZE][SIZE=2][COLOR=#006400]
[/SIZE]
And also, using the teleport and the triple bolt together seems to only use the bolt.
Are these to just use one on an npc - either he can bolt or earthquake, or teleport, etc?

Thanks!

Koluch


 

Kenko

Page
it can do any of the abilities, if you enable them all, it will use them all. have you tried it on a player-accesslevel character? many of the abilities are capped only for players.

And no, the override statements will work regardless their position in the script.
Of course, they have to be inside the class.
 

koluch

Sorceror
Kenko said:
it can do any of the abilities, if you enable them all, it will use them all. have you tried it on a player-accesslevel character? many of the abilities are capped only for players.

And no, the override statements will work regardless their position in the script.
Of course, they have to be inside the class.

For some reason my idiot sorcerer will not do the teleport along with the bolt, hehe.
He is probably just a moron or something, :rolleyes:
 

lillibeth

Wanderer
i get this error in runuo 1.0

Code:
RunUO - Running with nothing!
RunUO - [www.runuo.com] Version 1.0.0, Build 28438
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
 - Error: Scripts\Andaria\Lillibeth\Prove Tecniche\BaseSpecialCreature.cs: CS023
4: (line 6, column 26) The type or namespace name 'Generic' does not exist in th
e class or namespace 'System.Collections' (are you missing an assembly reference
?)
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
 

Kenko

Page
remove the line
Code:
using System.Collections.Generic;
and then replace all
Code:
List<T>
with
Code:
ArrayList
Lastly, add a few type casts and you're done.
 

lillibeth

Wanderer
i did....now i get this errors :(

Code:
RunUO - Running with nothing!
RunUO - [www.runuo.com] Version 1.0.0, Build 28438
Scripts: Compiling C# scripts...failed (20 errors, 7 warnings)
 - Warning: Scripts\Andaria\Items\PSBook.cs: CS0162: (line 288, column 20) Unrea
chable code detected
 - Warning: Scripts\Andaria\Lillibeth\Craft\LostAlchemy\RepairTarget.cs: CS0168:
 (line 32, column 9) The variable 'number' is declared but never used
 - Warning: Scripts\Andaria\Lillibeth\Mobiles\Eater\Eater.cs: CS0183: (line 76,
column 9) The given expression is always of the provided ('Server.Mobiles.BaseCr
eature') type
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS011
7: (line 58, column 43) 'Server.Mobiles.BaseCreature' does not contain a definit
ion for 'Controlled'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS011
7: (line 94, column 43) 'Server.Mobiles.BaseCreature' does not contain a definit
ion for 'controlled'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
6: (line 199, column 54) A new expression requires () or [] after type
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
5: (line 199, column 63) Invalid expression term ')'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS102
6: (line 199, column 64) ) expected
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
6: (line 245, column 58) A new expression requires () or [] after type
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
5: (line 245, column 67) Invalid expression term ')'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS102
6: (line 245, column 68) ) expected
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS150
2: (line 316, column 13) The best overloaded method match for 'Server.AOS.Damage
(Server.Mobile, Server.Mobile, int, int, int, int, int, int, bool)' has some inv
alid arguments
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS150
3: (line 316, column 43) Argument '4': cannot convert from 'bool' to 'int'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS150
3: (line 316, column 62) Argument '9': cannot convert from 'int' to 'bool'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
6: (line 452, column 54) A new expression requires () or [] after type
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
5: (line 452, column 63) Invalid expression term ')'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS102
6: (line 452, column 64) ) expected
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
6: (line 484, column 56) A new expression requires () or [] after type
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
5: (line 484, column 65) Invalid expression term ')'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS102
6: (line 484, column 66) ) expected
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
6: (line 366, column 61) A new expression requires () or [] after type
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
5: (line 366, column 70) Invalid expression term ')'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS102
6: (line 366, column 71) ) expected
 - Warning: Scripts\Andaria\Lillibeth\PvP System\Evil Reward System\CloakOfTheDa
mned.cs: CS0162: (line 57, column 4) Unreachable code detected
 - Warning: Scripts\Andaria\Lillibeth\PvP System\Evil Reward System\ShroudOfSoul
s.cs: CS0162: (line 48, column 4) Unreachable code detected
 - Warning: Scripts\Mobiles\PlayerMobile.custom.cs: CS0162: (line 3160, column 4
) Unreachable code detected
 - Warning: Scripts\Mobiles\Special\BaseChampion.custom.cs: CS0184: (line 195, c
olumn 10) The given expression is never of the provided ('Server.Mobiles.Serado'
) type
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

don't looks at worning it's usual to have if you get errors ^^
 

lillibeth

Wanderer
here it is :)

Code:
RunUO - Running with nothing!
RunUO - [www.runuo.com] Version 1.0.0, Build 28438
Scripts: Compiling C# scripts...failed (18 errors, 7 warnings)
 - Warning: Scripts\Andaria\Items\PSBook.cs: CS0162: (line 288, column 20) Unrea
chable code detected
 - Warning: Scripts\Andaria\Lillibeth\Craft\LostAlchemy\RepairTarget.cs: CS0168:
 (line 32, column 9) The variable 'number' is declared but never used
 - Warning: Scripts\Andaria\Lillibeth\Mobiles\Eater\Eater.cs: CS0183: (line 76,
column 9) The given expression is always of the provided ('Server.Mobiles.BaseCr
eature') type
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
6: (line 199, column 54) A new expression requires () or [] after type
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
5: (line 199, column 63) Invalid expression term ')'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS102
6: (line 199, column 64) ) expected
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
6: (line 245, column 58) A new expression requires () or [] after type
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
5: (line 245, column 67) Invalid expression term ')'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS102
6: (line 245, column 68) ) expected
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS150
2: (line 316, column 13) The best overloaded method match for 'Server.AOS.Damage
(Server.Mobile, Server.Mobile, int, int, int, int, int, int, bool)' has some inv
alid arguments
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS150
3: (line 316, column 43) Argument '4': cannot convert from 'bool' to 'int'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS150
3: (line 316, column 62) Argument '9': cannot convert from 'int' to 'bool'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
6: (line 452, column 54) A new expression requires () or [] after type
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
5: (line 452, column 63) Invalid expression term ')'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS102
6: (line 452, column 64) ) expected
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
6: (line 484, column 56) A new expression requires () or [] after type
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
5: (line 484, column 65) Invalid expression term ')'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS102
6: (line 484, column 66) ) expected
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
6: (line 366, column 61) A new expression requires () or [] after type
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
5: (line 366, column 70) Invalid expression term ')'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS102
6: (line 366, column 71) ) expected
 - Warning: Scripts\Andaria\Lillibeth\PvP System\Evil Reward System\CloakOfTheDa
mned.cs: CS0162: (line 57, column 4) Unreachable code detected
 - Warning: Scripts\Andaria\Lillibeth\PvP System\Evil Reward System\ShroudOfSoul
s.cs: CS0162: (line 48, column 4) Unreachable code detected
 - Warning: Scripts\Mobiles\PlayerMobile.custom.cs: CS0162: (line 3160, column 4
) Unreachable code detected
 - Warning: Scripts\Mobiles\Special\BaseChampion.custom.cs: CS0184: (line 195, c
olumn 10) The given expression is never of the provided ('Server.Mobiles.Serado'
) type
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
 

lillibeth

Wanderer
sorry alot :p

Code:
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Spells;

namespace Server.Mobiles
    {
    public abstract class BaseSpecialCreature : BaseCreature
        {
        public virtual bool DoesTeleporting { get { return false; } }
        public virtual double TeleportingChance { get { return 0.625; } }

        public virtual bool DoesNoxStriking { get { return false; } }
        public virtual double NoxStrikingChance { get { return 0.250; } }

        public virtual bool DoesLifeDraining { get { return false; } }
        public virtual double LifeDrainingChance
            {
            get
                {
                if( Hits < ( HitsMax / Utility.RandomMinMax( 1, 3 ) ) )
                    return 0.125;

                return 0.0;
                }
            }

        public virtual bool DoesTripleBolting { get { return false; } }
        public virtual double TripleBoltingChance { get { return 0.250; } }

        public virtual bool DoesMultiFirebreathing { get { return false; } }
        public virtual double MultiFirebreathingChance { get { return 1.000; } }
        public virtual int BreathDamagePercent { get { return 100; } }
        public virtual int BreathMaxTargets { get { return 5; } }
        public virtual int BreathMaxRange { get { return 5; } }
        public override bool HasBreath { get { return DoesMultiFirebreathing; } }

        public virtual bool DoesEarthquaking { get { return false; } }
        public virtual double EarthquakingChance { get { return 0.250; } }

        public virtual bool DoesSummoning { get { return false; } }
        public virtual double SummoningChance { get { return 0.150; } }
        public virtual double SummoningLowChance { get { return 0.050; } }
        public virtual Type SummoningType { get { return null; } }
        public virtual TimeSpan SummoningDuration { get { return TimeSpan.FromMinutes( 2.0 ); } }
        public virtual TimeSpan SummoningDelay { get { return TimeSpan.FromMinutes( 2.0 ); } }
        public virtual int SummoningSound { get { return -1; } }
        public virtual int SummoningMin { get { return 1; } }
        public virtual int SummoningMax { get { return 1; } }

        public override void OnGotMeleeAttack( Mobile attacker )
            {
            base.OnGotMeleeAttack( attacker );

            Mobile target = attacker;

            if( target is BaseCreature && ((BaseCreature)target).Controled )
                target = ((BaseCreature)target).ControlMaster;

            if( target == null )
                target = attacker;

            if( DoesNoxStriking && NoxStrikingChance >= Utility.RandomDouble() )
                NoxStrike( target );

            if( DoesLifeDraining && LifeDrainingChance >= Utility.RandomDouble() )
                DrainLife();

            if( DoesTripleBolting && TripleBoltingChance >= Utility.RandomDouble() )
                TripleBolt( target );

            if( DoesSummoning && SummoningChance >= Utility.RandomDouble() )
                SummonMinions( target );
            }

        public override void OnGaveMeleeAttack( Mobile defender )
            {
            base.OnGaveMeleeAttack( defender );

            if( DoesLifeDraining && LifeDrainingChance >= Utility.RandomDouble() )
                DrainLife();

            if( DoesEarthquaking && EarthquakingChance >= Utility.RandomDouble() )
                Earthquake();
            }

        public override void OnDamagedBySpell( Mobile attacker )
            {
            base.OnDamagedBySpell( attacker );

            Mobile target = attacker;

            if( target is BaseCreature && ((BaseCreature)target).Controled )
                target = ((BaseCreature)target).ControlMaster;

            if( target == null )
                target = attacker;

            if( DoesTripleBolting && TripleBoltingChance >= Utility.RandomDouble() )
                TripleBolt( target );

            if( DoesSummoning && SummoningChance >= Utility.RandomDouble() )
                SummonMinions( target );
            }

        #region Summoning

        private DateTime m_NextSummonTime = DateTime.Now;

        public virtual int SummonMinions( Mobile victim )
            {
            int minions = 0;

            if( Map == null || Map == Map.Internal || Map != victim.Map || SummoningType == null )
                return minions;

            if( m_NextSummonTime >= DateTime.Now && Utility.RandomDouble() > SummoningLowChance )
                return minions;

            #region Cantidad de Summons
            int min = SummoningMin;
            int max = SummoningMax;
            
            if( min > max )
                {
                int aux = min;
                max = min;
                min = max;
                }

            int amount = min;

            if( min != max )
                amount = Utility.RandomMinMax( min, max );

            if( amount < 1 )
                amount = 1;
            #endregion

            for( int m = 0; m < amount; m++ )
                {
                BaseCreature minion;

                try { minion = (BaseCreature)Activator.CreateInstance( SummoningType ); }
                catch { continue; }

                int offset = Utility.Random( 8 ) * 2;
                Point3D selectedOffset = victim.Location;

                for( int i = 0; i < m_Offsets.Length; i += 2 )
                    {
                    int x = X + m_Offsets[( offset + i     ) % m_Offsets.Length];
                    int y = Y + m_Offsets[( offset + i + 1 ) % m_Offsets.Length];

                    if( Map.CanSpawnMobile( x, y, Z ) )
                        {
                        selectedOffset = new Point3D( x, y, Z );
                        break;
                        }
                    else
                        {
                        int z = Map.GetAverageZ( x, y );

                        if( Map.CanSpawnMobile( x, y, z ) )
                            {
                            selectedOffset = new Point3D( x, y, z );
                            break;
                            }
                        }
                    }

                BaseCreature.Summon( minion, false, this, selectedOffset, SummoningSound, SummoningDuration );
                minion.Combatant = victim;
                minions++;
                }

            /* NOTA: 
             * 
             * Cada 6 minions esperamos el doble de tiempo que el pautado,
             * esto logra que no se sumonee 28 summons y se tarde lo mismo 
             * que cuando se summonean 3 de ellos. Eh lo.
             */

            m_NextSummonTime = DateTime.Now + TimeSpan.FromSeconds( SummoningDelay.TotalSeconds * ( 0.8 + ( minions * 0.2 ) ) ); 

            return minions;
            }

        #endregion

        #region Earthquake

        public virtual void Earthquake()
            {
            if( Map == null )
                return;

            ArrayList<Mobile> targets = new ArrayList<Mobile>();

            foreach( Mobile m in this.GetMobilesInRange( 6 ) )
                {
                if( m == this || !CanBeHarmful( m ) || m.AccessLevel >= AccessLevel.Counselor )
                    continue;

                if( m is BaseCreature && ( ( (BaseCreature)m ).Controlled || ( (BaseCreature)m ).Summoned || ( (BaseCreature)m ).Team != this.Team ) )
                    targets.Add( m );
                else if( m.Player )
                    targets.Add( m );
                }

            PlaySound( 0x2F3 );

            for( int i = 0; i < targets.Count; ++i )
                {
                Mobile m = targets[i];

                double damage = m.Hits * 0.6;

                if( damage < 10.0 )
                    damage = 10.0;
                else if( damage > 75.0 )
                    damage = 75.0;

                DoHarmful( m );

                AOS.Damage( m, this, (int)damage, 100, 0, 0, 0, 0 );

                if( m.Alive && m.Body.IsHuman && !m.Mounted )
                    m.Animate( 20, 7, 1, true, false, 0 ); // take hit
                }
            }

        #endregion

        #region Multi Breath

        public override void BreathStart( Mobile target )
            {
            base.BreathStart( target ); //tiramos un firebreath al objetivo original.

            if( !DoesMultiFirebreathing || Utility.RandomDouble() > MultiFirebreathingChance )
                return;

            ArrayList<Mobile> posibleTgts = new ArrayList<Mobile>();

            foreach( Mobile m in target.Map.GetMobilesInRange( target.Location, BreathMaxRange ) )
                if( m != null && !m.Deleted && m != target && m.Alive && !m.IsDeadBondedPet &&
                    ( m.AccessLevel < AccessLevel.Counselor || CanSee( m ) ) && CanBeHarmful( m ) &&
                    ( m.Player || ( m is BaseCreature && ( (BaseCreature)m ).Controlled ) ) )
                    posibleTgts.Add( m );

            int maxTgts = BreathMaxTargets - 1; //BreathMaxTargets - 1 + el primer firebreath que va al target original.
            int mt = 0;
            int maxAtt = 3;
            int at = 0;

            for( int i = 0; i < posibleTgts.Count && mt++ < maxTgts && at++ < maxAtt; i++ )
                {
                int x = Utility.Random( posibleTgts.Count );
                Mobile t = posibleTgts[x];

                if( t == null || !CanBeHarmful( t ) )
                    return;

                BreathStallMovement();
                BreathPlayAngerSound();
                BreathPlayAngerAnimation();

                Direction = GetDirectionTo( t );

                Timer.DelayCall( TimeSpan.FromSeconds( BreathEffectDelay ), new TimerStateCallback( BreathEffect_Callback ), t );

                posibleTgts.RemoveAt( x );
                at = 0;
                }
            }

        public override int BreathComputeDamage()       //Que haga un toke menos de daño, 
            {                                           //si va a meter 5 firebreaths....
            int fromBase = base.BreathComputeDamage();  //Además, lo usa la Hydra que tiene 1.5Ks de hits, y el Abscess con sus 7Ks.

            if( DoesMultiFirebreathing )
                return (int)( fromBase * ( BreathDamagePercent / 10 ) );

            return fromBase;
            }

        #endregion

        #region Triple Energy Bolts

        private int Bolts = 0;

        public virtual void TripleBolt( Mobile to )
            {
            Bolts = 0;
            Timer.DelayCall( TimeSpan.FromSeconds( Utility.Random( 3 ) ), new TimerStateCallback( Bolt_Callback ), to );
            Timer.DelayCall( TimeSpan.FromSeconds( Utility.Random( 3 ) ), new TimerStateCallback( Bolt_Callback ), to );
            Timer.DelayCall( TimeSpan.FromSeconds( Utility.Random( 3 ) ), new TimerStateCallback( Bolt_Callback ), to );
            }

        public virtual void Bolt_Callback( object state )
            {
            Mobile to = state as Mobile;

            if( to == null )
                return;

            DoHarmful( to );

            to.BoltEffect( 0 );

            int damage = Utility.RandomMinMax( 23, 29 );

            AOS.Damage( to, this, damage, false, 0, 0, 0, 0, 100 );

            if( ++Bolts == 3 && damage > 0 )
                to.SendMessage( "You get shocked and dazed!" );
            }

        #endregion

        #region Teleport

        private Timer m_Timer;

        public static int[] m_Offsets = new int[]
			    {
				-1, -1,
				-1,  0,
				-1,  1,
				0, -1,
				0,  1,
				1, -1,
				1,  0,
				1,  1
			    };

        private class TeleportTimer : Timer
            {
            private BaseSpecialCreature m_Owner;

            public TeleportTimer( BaseSpecialCreature owner )
                : base( TimeSpan.FromSeconds( 5.0 ), TimeSpan.FromSeconds( 5.0 ) )
                {
                m_Owner = owner;
                }

            protected override void OnTick()
                {
                if( m_Owner.Deleted )
                    {
                    Stop();
                    return;
                    }

                if( Utility.RandomDouble() > m_Owner.TeleportingChance )
                    return;

                Map map = m_Owner.Map;

                if( map == null )
                    return;

                ArrayList<Mobile> toTeleport = new ArrayList<Mobile>();

                foreach( Mobile m in m_Owner.Region.GetMobiles() )
                    if( m != m_Owner && m.Player && m_Owner.CanBeHarmful( m ) && m_Owner.CanSee( m ) && m.AccessLevel < AccessLevel.Counselor )
                        toTeleport.Add( m );

                if( toTeleport.Count > 0 )
                    {
                    int offset = Utility.Random( 8 ) * 2;

                    Point3D to = m_Owner.Location;

                    for( int i = 0; i < m_Offsets.Length; i += 2 )
                        {
                        int x = m_Owner.X + BaseSpecialCreature.m_Offsets[( offset + i     ) % BaseSpecialCreature.m_Offsets.Length];
                        int y = m_Owner.Y + BaseSpecialCreature.m_Offsets[( offset + i + 1 ) % BaseSpecialCreature.m_Offsets.Length];

                        if( map.CanSpawnMobile( x, y, m_Owner.Z ) )
                            {
                            to = new Point3D( x, y, m_Owner.Z );
                            break;
                            }
                        else
                            {
                            int z = map.GetAverageZ( x, y );

                            if( map.CanSpawnMobile( x, y, z ) )
                                {
                                to = new Point3D( x, y, z );
                                break;
                                }
                            }
                        }

                    Mobile m = toTeleport[Utility.Random( toTeleport.Count )];

                    Point3D from = m.Location;

                    m.Location = to;

                    SpellHelper.Turn( m_Owner, m );
                    SpellHelper.Turn( m, m_Owner );

                    m.ProcessDelta();

                    Effects.SendLocationParticles( EffectItem.Create( from, m.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 2023 );
                    Effects.SendLocationParticles( EffectItem.Create( to, m.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 5023 );

                    m.PlaySound( 0x1FE );

                    m_Owner.Combatant = m;
                    }
                }
            }

        #endregion

        #region NoxStrike

        public virtual void NoxStrike( Mobile attacker )
            {
            /* Counterattack with Hit Poison Area
             * 20-25 damage, unresistable
             * Lethal poison, 100% of the time
             * Particle effect: Type: "2" From: "0x4061A107" To: "0x0" ItemId: "0x36BD" ItemIdName: "explosion" FromLocation: "(296 615, 17)" ToLocation: "(296 615, 17)" Speed: "1" Duration: "10" FixedDirection: "True" Explode: "False" Hue: "0xA6" RenderMode: "0x0" Effect: "0x1F78" ExplodeEffect: "0x1" ExplodeSound: "0x0" Serial: "0x4061A107" Layer: "255" Unknown: "0x0"
             * Doesn't work on provoked monsters
             */

            if( attacker is BaseCreature && ( (BaseCreature)attacker ).BardProvoked )
                return;

            Mobile target = null;

            if( attacker is BaseCreature )
                {
                Mobile m = ( (BaseCreature)attacker ).GetMaster();

                if( m != null )
                    target = m;
                }

            if( target == null || !target.InRange( this, 18 ) )
                target = attacker;

            this.Animate( 10, 4, 1, true, false, 0 );

            ArrayList<Mobile> targets = new ArrayList<Mobile>();

            foreach( Mobile m in target.GetMobilesInRange( 8 ) )
                {
                if( m == this || !CanBeHarmful( m ) || m.AccessLevel >= AccessLevel.Counselor )
                    continue;

                if( m is BaseCreature && ( ( (BaseCreature)m ).Controlled || ( (BaseCreature)m ).Summoned || ( (BaseCreature)m ).Team != this.Team ) )
                    targets.Add( m );
                else if( m.Player && m.Alive )
                    targets.Add( m );
                }

            for( int i = 0; i < targets.Count; ++i )
                {
                Mobile m = targets[i];

                DoHarmful( m );

                AOS.Damage( m, this, Utility.RandomMinMax( 20, 25 ), true, 0, 0, 0, 100, 0 );

                m.FixedParticles( 0x36BD, 1, 10, 0x1F78, 0xA6, 0, (EffectLayer)255 );
                m.ApplyPoison( this, Poison.Lethal );
                }
            }

        #endregion

        #region DrainLife

        public virtual void DrainLife()
            {
            ArrayList<Mobile> ArrayList = new ArrayList<Mobile>();

            foreach( Mobile m in Region.GetMobiles() )
                {
                if( m == this || !CanBeHarmful( m ) || !CanSee( m ) || m.AccessLevel >= AccessLevel.Counselor )
                    continue;

                if( m is BaseCreature && ( ( (BaseCreature)m ).Controlled || ( (BaseCreature)m ).Summoned || ( (BaseCreature)m ).Team != Team ) )
                    ArrayList.Add( m );
                else if( m.Player )
                    ArrayList.Add( m );
                }

            foreach( Mobile m in ArrayList )
                {
                DoHarmful( m );

                m.FixedParticles( 0x374A, 10, 15, 5013, 0x496, 0, EffectLayer.Waist );
                m.PlaySound( 0x231 );

                m.SendMessage( "You feel the life drain out of you!" );

                int toDrain = Utility.RandomMinMax( 10, 40 );

                Hits += toDrain;
                m.Damage( toDrain, this );
                }
            }

        #endregion

        public BaseSpecialCreature( AIType ai, FightMode mode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed ) : base( ai, mode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed )
            {
            if( DoesTeleporting )
                {
                m_Timer = new TeleportTimer( this );
                m_Timer.Start();
                }
            }

        public BaseSpecialCreature( Serial serial ) : base( serial )
            {
            if( DoesTeleporting )
                {
                m_Timer = new TeleportTimer( this );
                m_Timer.Start();
                }
            }

        public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); }
        public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); }
        }
    }

here it is ^^
 

Kenko

Page
this should work.

Code:
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Spells;

namespace Server.Mobiles
    {
    public abstract class BaseSpecialCreature : BaseCreature
        {
        public virtual bool DoesTeleporting { get { return false; } }
        public virtual double TeleportingChance { get { return 0.625; } }

        public virtual bool DoesNoxStriking { get { return false; } }
        public virtual double NoxStrikingChance { get { return 0.250; } }

        public virtual bool DoesLifeDraining { get { return false; } }
        public virtual double LifeDrainingChance
            {
            get
                {
                if( Hits < ( HitsMax / Utility.RandomMinMax( 1, 3 ) ) )
                    return 0.125;

                return 0.0;
                }
            }

        public virtual bool DoesTripleBolting { get { return false; } }
        public virtual double TripleBoltingChance { get { return 0.250; } }

        public virtual bool DoesMultiFirebreathing { get { return false; } }
        public virtual double MultiFirebreathingChance { get { return 1.000; } }
        public virtual int BreathDamagePercent { get { return 100; } }
        public virtual int BreathMaxTargets { get { return 5; } }
        public virtual int BreathMaxRange { get { return 5; } }
        public override bool HasBreath { get { return DoesMultiFirebreathing; } }

        public virtual bool DoesEarthquaking { get { return false; } }
        public virtual double EarthquakingChance { get { return 0.250; } }

        public virtual bool DoesSummoning { get { return false; } }
        public virtual double SummoningChance { get { return 0.150; } }
        public virtual double SummoningLowChance { get { return 0.050; } }
        public virtual Type SummoningType { get { return null; } }
        public virtual TimeSpan SummoningDuration { get { return TimeSpan.FromMinutes( 2.0 ); } }
        public virtual TimeSpan SummoningDelay { get { return TimeSpan.FromMinutes( 2.0 ); } }
        public virtual int SummoningSound { get { return -1; } }
        public virtual int SummoningMin { get { return 1; } }
        public virtual int SummoningMax { get { return 1; } }

        public override void OnGotMeleeAttack( Mobile attacker )
            {
            base.OnGotMeleeAttack( attacker );

            Mobile target = attacker;

            if( target is BaseCreature && ( (BaseCreature)target ).Controled )
                target = ( (BaseCreature)target ).ControlMaster;

            if( target == null )
                target = attacker;

            if( DoesNoxStriking && NoxStrikingChance >= Utility.RandomDouble() )
                NoxStrike( target );

            if( DoesLifeDraining && LifeDrainingChance >= Utility.RandomDouble() )
                DrainLife();

            if( DoesTripleBolting && TripleBoltingChance >= Utility.RandomDouble() )
                TripleBolt( target );

            if( DoesSummoning && SummoningChance >= Utility.RandomDouble() )
                SummonMinions( target );
            }

        public override void OnGaveMeleeAttack( Mobile defender )
            {
            base.OnGaveMeleeAttack( defender );

            if( DoesLifeDraining && LifeDrainingChance >= Utility.RandomDouble() )
                DrainLife();

            if( DoesEarthquaking && EarthquakingChance >= Utility.RandomDouble() )
                Earthquake();
            }

        public override void OnDamagedBySpell( Mobile attacker )
            {
            base.OnDamagedBySpell( attacker );

            Mobile target = attacker;

            if( target is BaseCreature && ( (BaseCreature)target ).Controled )
                target = ( (BaseCreature)target ).ControlMaster;

            if( target == null )
                target = attacker;

            if( DoesTripleBolting && TripleBoltingChance >= Utility.RandomDouble() )
                TripleBolt( target );

            if( DoesSummoning && SummoningChance >= Utility.RandomDouble() )
                SummonMinions( target );
            }

        #region Summoning

        private DateTime m_NextSummonTime = DateTime.Now;

        public virtual int SummonMinions( Mobile victim )
            {
            int minions = 0;

            if( Map == null || Map == Map.Internal || Map != victim.Map || SummoningType == null )
                return minions;

            if( m_NextSummonTime >= DateTime.Now && Utility.RandomDouble() > SummoningLowChance )
                return minions;

            #region Cantidad de Summons
            int min = SummoningMin;
            int max = SummoningMax;

            if( min > max )
                {
                int aux = min;
                max = min;
                min = max;
                }

            int amount = min;

            if( min != max )
                amount = Utility.RandomMinMax( min, max );

            if( amount < 1 )
                amount = 1;
            #endregion

            for( int m = 0; m < amount; m++ )
                {
                BaseCreature minion;

                try { minion = (BaseCreature)Activator.CreateInstance( SummoningType ); }
                catch { continue; }

                int offset = Utility.Random( 8 ) * 2;
                Point3D selectedOffset = victim.Location;

                for( int i = 0; i < m_Offsets.Length; i += 2 )
                    {
                    int x = X + m_Offsets[( offset + i ) % m_Offsets.Length];
                    int y = Y + m_Offsets[( offset + i + 1 ) % m_Offsets.Length];

                    if( Map.CanSpawnMobile( x, y, Z ) )
                        {
                        selectedOffset = new Point3D( x, y, Z );
                        break;
                        }
                    else
                        {
                        int z = Map.GetAverageZ( x, y );

                        if( Map.CanSpawnMobile( x, y, z ) )
                            {
                            selectedOffset = new Point3D( x, y, z );
                            break;
                            }
                        }
                    }

                BaseCreature.Summon( minion, false, this, selectedOffset, SummoningSound, SummoningDuration );
                minion.Combatant = victim;
                minions++;
                }

            /* NOTA: 
             * 
             * Cada 6 minions esperamos el doble de tiempo que el pautado,
             * esto logra que no se sumonee 28 summons y se tarde lo mismo 
             * que cuando se summonean 3 de ellos. Eh lo.
             */

            m_NextSummonTime = DateTime.Now + TimeSpan.FromSeconds( SummoningDelay.TotalSeconds * ( 0.8 + ( minions * 0.2 ) ) );

            return minions;
            }

        #endregion

        #region Earthquake

        public virtual void Earthquake()
            {
            if( Map == null )
                return;

            ArrayList targets = new ArrayList();

            foreach( Mobile m in this.GetMobilesInRange( 6 ) )
                {
                if( m == this || !CanBeHarmful( m ) || m.AccessLevel >= AccessLevel.Counselor )
                    continue;

                if( m is BaseCreature && ( ( (BaseCreature)m ).Controlled || ( (BaseCreature)m ).Summoned || ( (BaseCreature)m ).Team != this.Team ) )
                    targets.Add( m );
                else if( m.Player )
                    targets.Add( m );
                }

            PlaySound( 0x2F3 );

            for( int i = 0; i < targets.Count; ++i )
                {
                Mobile m = targets[i];

                double damage = m.Hits * 0.6;

                if( damage < 10.0 )
                    damage = 10.0;
                else if( damage > 75.0 )
                    damage = 75.0;

                DoHarmful( m );

                AOS.Damage( m, this, (int)damage, 100, 0, 0, 0, 0 );

                if( m.Alive && m.Body.IsHuman && !m.Mounted )
                    m.Animate( 20, 7, 1, true, false, 0 ); // take hit
                }
            }

        #endregion

        #region Multi Breath

        public override void BreathStart( Mobile target )
            {
            base.BreathStart( target ); //tiramos un firebreath al objetivo original.

            if( !DoesMultiFirebreathing || Utility.RandomDouble() > MultiFirebreathingChance )
                return;

            ArrayList posibleTgts = new ArrayList();

            foreach( Mobile m in target.Map.GetMobilesInRange( target.Location, BreathMaxRange ) )
                if( m != null && !m.Deleted && m != target && m.Alive && !m.IsDeadBondedPet &&
                    ( m.AccessLevel < AccessLevel.Counselor || CanSee( m ) ) && CanBeHarmful( m ) &&
                    ( m.Player || ( m is BaseCreature && ( (BaseCreature)m ).Controlled ) ) )
                    posibleTgts.Add( m );

            int maxTgts = BreathMaxTargets - 1; //BreathMaxTargets - 1 + el primer firebreath que va al target original.
            int mt = 0;
            int maxAtt = 3;
            int at = 0;

            for( int i = 0; i < posibleTgts.Count && mt++ < maxTgts && at++ < maxAtt; i++ )
                {
                int x = Utility.Random( posibleTgts.Count );
                Mobile t = posibleTgts[x];

                if( t == null || !CanBeHarmful( t ) )
                    return;

                BreathStallMovement();
                BreathPlayAngerSound();
                BreathPlayAngerAnimation();

                Direction = GetDirectionTo( t );

                Timer.DelayCall( TimeSpan.FromSeconds( BreathEffectDelay ), new TimerStateCallback( BreathEffect_Callback ), t );

                posibleTgts.RemoveAt( x );
                at = 0;
                }
            }

        public override int BreathComputeDamage()       //Que haga un toke menos de daño, 
            {                                           //si va a meter 5 firebreaths....
            int fromBase = base.BreathComputeDamage();  //Además, lo usa la Hydra que tiene 1.5Ks de hits, y el Abscess con sus 7Ks.

            if( DoesMultiFirebreathing )
                return (int)( fromBase * ( BreathDamagePercent / 10 ) );

            return fromBase;
            }

        #endregion

        #region Triple Energy Bolts

        private int Bolts = 0;

        public virtual void TripleBolt( Mobile to )
            {
            Bolts = 0;
            Timer.DelayCall( TimeSpan.FromSeconds( Utility.Random( 3 ) ), new TimerStateCallback( Bolt_Callback ), to );
            Timer.DelayCall( TimeSpan.FromSeconds( Utility.Random( 3 ) ), new TimerStateCallback( Bolt_Callback ), to );
            Timer.DelayCall( TimeSpan.FromSeconds( Utility.Random( 3 ) ), new TimerStateCallback( Bolt_Callback ), to );
            }

        public virtual void Bolt_Callback( object state )
            {
            Mobile to = state as Mobile;

            if( to == null )
                return;

            DoHarmful( to );

            to.BoltEffect( 0 );

            int damage = Utility.RandomMinMax( 23, 29 );

            AOS.Damage( to, this, damage, 0, 0, 0, 0, 100, false );

            if( ++Bolts == 3 && damage > 0 )
                to.SendMessage( "You get shocked and dazed!" );
            }

        #endregion

        #region Teleport

        private Timer m_Timer;

        public static int[] m_Offsets = new int[]
			    {
				-1, -1,
				-1,  0,
				-1,  1,
				0, -1,
				0,  1,
				1, -1,
				1,  0,
				1,  1
			    };

        private class TeleportTimer : Timer
            {
            private BaseSpecialCreature m_Owner;

            public TeleportTimer( BaseSpecialCreature owner )
                : base( TimeSpan.FromSeconds( 5.0 ), TimeSpan.FromSeconds( 5.0 ) )
                {
                m_Owner = owner;
                }

            protected override void OnTick()
                {
                if( m_Owner.Deleted )
                    {
                    Stop();
                    return;
                    }

                if( Utility.RandomDouble() > m_Owner.TeleportingChance )
                    return;

                Map map = m_Owner.Map;

                if( map == null )
                    return;

                ArrayList<Mobile> toTeleport = new ArrayList<Mobile>();

                foreach( Mobile m in m_Owner.Region.GetMobiles() )
                    if( m != m_Owner && m.Player && m_Owner.CanBeHarmful( m ) && m_Owner.CanSee( m ) && m.AccessLevel < AccessLevel.Counselor )
                        toTeleport.Add( m );

                if( toTeleport.Count > 0 )
                    {
                    int offset = Utility.Random( 8 ) * 2;

                    Point3D to = m_Owner.Location;

                    for( int i = 0; i < m_Offsets.Length; i += 2 )
                        {
                        int x = m_Owner.X + BaseSpecialCreature.m_Offsets[( offset + i ) % BaseSpecialCreature.m_Offsets.Length];
                        int y = m_Owner.Y + BaseSpecialCreature.m_Offsets[( offset + i + 1 ) % BaseSpecialCreature.m_Offsets.Length];

                        if( map.CanSpawnMobile( x, y, m_Owner.Z ) )
                            {
                            to = new Point3D( x, y, m_Owner.Z );
                            break;
                            }
                        else
                            {
                            int z = map.GetAverageZ( x, y );

                            if( map.CanSpawnMobile( x, y, z ) )
                                {
                                to = new Point3D( x, y, z );
                                break;
                                }
                            }
                        }

                    Mobile m = toTeleport[Utility.Random( toTeleport.Count )];

                    Point3D from = m.Location;

                    m.Location = to;

                    SpellHelper.Turn( m_Owner, m );
                    SpellHelper.Turn( m, m_Owner );

                    m.ProcessDelta();

                    Effects.SendLocationParticles( EffectItem.Create( from, m.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 2023 );
                    Effects.SendLocationParticles( EffectItem.Create( to, m.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 5023 );

                    m.PlaySound( 0x1FE );

                    m_Owner.Combatant = m;
                    }
                }
            }

        #endregion

        #region NoxStrike

        public virtual void NoxStrike( Mobile attacker )
            {
            /* Counterattack with Hit Poison Area
             * 20-25 damage, unresistable
             * Lethal poison, 100% of the time
             * Particle effect: Type: "2" From: "0x4061A107" To: "0x0" ItemId: "0x36BD" ItemIdName: "explosion" FromLocation: "(296 615, 17)" ToLocation: "(296 615, 17)" Speed: "1" Duration: "10" FixedDirection: "True" Explode: "False" Hue: "0xA6" RenderMode: "0x0" Effect: "0x1F78" ExplodeEffect: "0x1" ExplodeSound: "0x0" Serial: "0x4061A107" Layer: "255" Unknown: "0x0"
             * Doesn't work on provoked monsters
             */

            if( attacker is BaseCreature && ( (BaseCreature)attacker ).BardProvoked )
                return;

            Mobile target = null;

            if( attacker is BaseCreature )
                {
                Mobile m = ( (BaseCreature)attacker ).GetMaster();

                if( m != null )
                    target = m;
                }

            if( target == null || !target.InRange( this, 18 ) )
                target = attacker;

            this.Animate( 10, 4, 1, true, false, 0 );

            ArrayList targets = new ArrayList();

            foreach( Mobile m in target.GetMobilesInRange( 8 ) )
                {
                if( m == this || !CanBeHarmful( m ) || m.AccessLevel >= AccessLevel.Counselor )
                    continue;

                if( m is BaseCreature && ( ( (BaseCreature)m ).Controlled || ( (BaseCreature)m ).Summoned || ( (BaseCreature)m ).Team != this.Team ) )
                    targets.Add( m );
                else if( m.Player && m.Alive )
                    targets.Add( m );
                }

            for( int i = 0; i < targets.Count; ++i )
                {
                Mobile m = targets[i];

                DoHarmful( m );

                AOS.Damage( m, this, Utility.RandomMinMax( 20, 25 ), true, 0, 0, 0, 100, 0 );

                m.FixedParticles( 0x36BD, 1, 10, 0x1F78, 0xA6, 0, (EffectLayer)255 );
                m.ApplyPoison( this, Poison.Lethal );
                }
            }

        #endregion

        #region DrainLife

        public virtual void DrainLife()
            {
            ArrayList ArrayList = new ArrayList();

            foreach( Mobile m in Region.GetMobiles() )
                {
                if( m == this || !CanBeHarmful( m ) || !CanSee( m ) || m.AccessLevel >= AccessLevel.Counselor )
                    continue;

                if( m is BaseCreature && ( ( (BaseCreature)m ).Controlled || ( (BaseCreature)m ).Summoned || ( (BaseCreature)m ).Team != Team ) )
                    ArrayList.Add( m );
                else if( m.Player )
                    ArrayList.Add( m );
                }

            foreach( Mobile m in ArrayList )
                {
                DoHarmful( m );

                m.FixedParticles( 0x374A, 10, 15, 5013, 0x496, 0, EffectLayer.Waist );
                m.PlaySound( 0x231 );

                m.SendMessage( "You feel the life drain out of you!" );

                int toDrain = Utility.RandomMinMax( 10, 40 );

                Hits += toDrain;
                m.Damage( toDrain, this );
                }
            }

        #endregion

        public BaseSpecialCreature( AIType ai, FightMode mode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed )
            : base( ai, mode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed )
            {
            if( DoesTeleporting )
                {
                m_Timer = new TeleportTimer( this );
                m_Timer.Start();
                }
            }

        public BaseSpecialCreature( Serial serial )
            : base( serial )
            {
            if( DoesTeleporting )
                {
                m_Timer = new TeleportTimer( this );
                m_Timer.Start();
                }
            }

        public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); }
        public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); }
        }
    }
 

lillibeth

Wanderer
i still get some errors...

Code:
RunUO - Running with nothing!
RunUO - [www.runuo.com] Version 1.0.0, Build 28438
Scripts: Compiling C# scripts...failed (10 errors, 7 warnings)
 - Warning: Scripts\Andaria\Items\PSBook.cs: CS0162: (line 288, column 20) Unrea
chable code detected
 - Warning: Scripts\Andaria\Lillibeth\Craft\LostAlchemy\RepairTarget.cs: CS0168:
 (line 32, column 9) The variable 'number' is declared but never used
 - Warning: Scripts\Andaria\Lillibeth\Mobiles\Eater\Eater.cs: CS0183: (line 76,
column 9) The given expression is always of the provided ('Server.Mobiles.BaseCr
eature') type
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS002
9: (line 216, column 28) Cannot implicitly convert type 'object' to 'Server.Mobi
le'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS002
9: (line 261, column 28) Cannot implicitly convert type 'object' to 'Server.Mobi
le'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS002
9: (line 467, column 28) Cannot implicitly convert type 'object' to 'Server.Mobi
le'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS150
2: (line 471, column 17) The best overloaded method match for 'Server.AOS.Damage
(Server.Mobile, Server.Mobile, int, int, int, int, int, int, bool)' has some inv
alid arguments
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS150
3: (line 471, column 70) Argument '4': cannot convert from 'bool' to 'int'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS150
3: (line 471, column 90) Argument '9': cannot convert from 'int' to 'bool'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS011
7: (line 486, column 34) 'Server.Region' does not contain a definition for 'GetM
obiles'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
6: (line 366, column 61) A new expression requires () or [] after type
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS152
5: (line 366, column 70) Invalid expression term ')'
 - Error: Scripts\Andaria\Lillibeth\Prove TEcniche\BaseSpecialCreature.cs: CS102
6: (line 366, column 71) ) expected
 - Warning: Scripts\Andaria\Lillibeth\PvP System\Evil Reward System\CloakOfTheDa
mned.cs: CS0162: (line 57, column 4) Unreachable code detected
 - Warning: Scripts\Andaria\Lillibeth\PvP System\Evil Reward System\ShroudOfSoul
s.cs: CS0162: (line 48, column 4) Unreachable code detected
 - Warning: Scripts\Mobiles\PlayerMobile.custom.cs: CS0162: (line 3160, column 4
) Unreachable code detected
 - Warning: Scripts\Mobiles\Special\BaseChampion.custom.cs: CS0184: (line 195, c
olumn 10) The given expression is never of the provided ('Server.Mobiles.Serado'
) type
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

but lesser :p
 
Top