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!

BaseUndead Type

Thagoras

Sorceror
BaseUndead Type

Ok. I was trying to get it so the Undead seemed more like undead should. I also wanted them singled out so when scripting other things, I could just do a general check like "if (mobile is BaseUndead)" instead of having to list off everything.

Just drop into your customs folder...somewhere.
Then go through your undead mobiles and switch BaseCreature with BaseUndead.

There are five boolean variables. The Undead mobiles may be [props and their values changed in game.

LeaveCorpse = Leaves a corpse - default on

Nocturnal = Only active at night (hours may be modified) - default off

SemiVisible = Visible only when they've acquired a target, otherwise they're hidden and immobile - default off

LifeDrain = Almost exactly like the DrainLife of the Succubus, except weaker - default off

Spirit = Immune to Melee Attacks - default off

Now, I do use serializing/deserializing so you will have to go through the Delete mobile issue on server start...for each one. (is there a better way?)

Any Issues, I will try to help where I can.

====

Fixed issue with controlled mobiles.
 

Attachments

  • BaseUndead.cs
    7.9 KB · Views: 107

Mad Clown

Wanderer
AWESOME MAN this is really kool ill give this a try so im gonna have to delete every undead mobile on reboot tell ya what this is NOT my post but it changes the base creature to basespecial creature and it has never asked me to delete a mob maybe you can see what it does that yours does not
 

Attachments

  • BaseSpecialCreature.cs
    18.9 KB · Views: 29

Thagoras

Sorceror
Well, I mean, you won't have to manually have to go in and delete the mobiles. It will just come up with that server crash thing...to delete all the ones in the save files. I did check it out when I read your post (I think it was yours) about the basespecial creature. I wasn't exactly clear about how it worked, but I also felt that with Ser/Deser, you'd have the option to tweak specific creatures easier. Just wish that it didn't have to delete the mobiles for each mobile you convert to baseundead.
 

Mad Clown

Wanderer
well here is my ? thx for the reply first off if it asks to delete the mobile does it delete them off the spawners or just in game i dont have to re add them to every spawner do i
 

Thagoras

Sorceror
nope. Spawners can keep their spawns. It's just the compiled script from the server saves that have to be deleted...or something like that. The old code itself. It's just the basic crash you get if you've messed with the serializing/deserializing of an item/mobile. You say yes to delete all occurences. But upon respawn, the new ones are there instead of the old ones.

I used to be afraid of this sort of crash, because I didn't understand it. Then it occurred to me exactly what was taking place. Nothing big. It's only a big thing if you get this crash with something big...like say you modify the baseitem type...and screw up the serialization somehow. Then the server will go through each item, asking to delete it, so the new changes can be applied. That's the reason why there's the Switch in the deserializing method. I wonder if that could make a difference in this script...hmmm.
 

LordHogFred

Knight
Awesome :)
Just thought of a possible other ability, how about havign a mob that when killed will resurrect itself unless it's corpse is cut up or destroyed somehow?
 

Thagoras

Sorceror
I was toying with that too, at one point...during a brainstorm session. Couldn't figure out exactly how to do it, so I let it pass. Think I'll put some more thought into it though.

Back when I used to roleplay with some friends, one of them had these skeletons that would resurrect 2 times or so. It was great fun!

K, it would have to have leave corpse option enabled. May have to have a modified corpse? Hmmm... Modify OnDeath to give modified corpse with a timer. Do-able
 

Darklady73

Sorceror
An idea for the unused Spirit...If you could do it have an ethereal version pop up randomly to follow and taunt the killer or "give advice". Only way to get rid of it would be to use the exorcism spell on it. Just an idea.
 

Thagoras

Sorceror
K, that I like. That's very do able. I liked the corpse thing, but it involves modifying the corpse.cs (I think I'd have to). But this...I can see it. Have it ethereal when visible. Random chance to hide when not moving. Random chance to speak.
 

LordHogFred

Knight
Perhaps have the spirit follow a player as a "curse" so while it's following they recieve minus stats or skills or maybe the ghost could shout to reveal them if they're hidden.
 

Thagoras

Sorceror
Yeah, I was trying to figure that one out...physical damage immune. I was going to make it like the resistances. Problem is that when the mobile script is called, doesn't it override the base type? Like, baseundead has resistance to physical damage 100% and the ghoul has resistance to physical 50%. The end product will be 50% and not 150%...mobile, basecreature, baseundead, ghoul. If ghoul left physical resistance alone, it would be 100% as per baseundead. To do that, I just need to find a way around how the server reads the mobiles.
I've done this in my BaseAnimal tests...had it change the AI in OnThink. Not sure if I can do that with
Code:
 			SetResistance( ResistanceType.Physical, 35, 40 );
unless I can just skip the SetResistance. Worth a shot, I guess.
 

David

Moderate
Try using int MeleeDamageAbsorb( get; set; ).

Possibly set the amount equal to HitsMax? I have not tried anything like that so I don't know if it will do the trick or not.
 

Mad Clown

Wanderer
hey bro i dont know if this will help but this is a script that i download from the forums basicly causes melee attacks and spell attacks to miss 50% of the time im sure you can adjust that to 100% you can reference this if ya want

here ya go hope it helps again this is not mine in any way at all
 

Attachments

  • PhaseCreatureBase - non advanced archery.cs
    3.3 KB · Views: 22

Thagoras

Sorceror
Good catch MadClown! These scripts have so many modules it's impossible to keep up with them all. I didn't even know AlterMeleeDamageFrom was an option. There's also one for AlterSpellDamageFrom...usefull in other things, I'd wager.

==

Updated! That was it exactly. Also included another thing which was bothering me a little. Reduced spell/melee damage to 0 when the mob attacks GM or higher. Good for testing. Ya wanna get hurt, become a player (or counselor).
 

Spookyrobert

Sorceror
I found a little problem with this script. If a necro animates dead, the undead they summon will act the same as the spawned ones( Hidden and cant walk if set to nocturnal ). I think I found a fix to this, just add

Code:
if (this.Controlled == true )// how a summoned undead should act
			{
				Spirit = false;
				Nocturnal = false;
				SemiVisible = false;
				LifeDrain = false;
				LeaveCorpse = true;
			}
			else // how the spawned undead should act.
			{
				Spirit = true;
				Nocturnal = true;
				SemiVisible = false;
				LifeDrain = false;
				LeaveCorpse = true;
			}

After

Code:
VirtualArmor = 40;

to the mobiles you change to BaseUndead


There might be an easier way to do this in BaseUndead but I'm not sure.

Edit: Also the way it is now, On start up I have to delete all animated dead mobs. If you change all the BaseCreature to BaseUndead in the animate dead spell it should prevent that,But you have to change all the necro summon mobs to BaseUndead as well.

BTW love the script and I'm looking forward to your other releases.
 

Thagoras

Sorceror
Thank you for pointing that out. I don't use necros enough to know. I fixed that issue in the BaseUndead. Should be working.

Also introduced another nice feature...if you're GM or higher, you can doubleclick on a hidden/blessed undead to turn the affect off. Doubleclick again and it resumes. I REALIZE this detracts from seeing what the mobile is carrying in its pack... but this shouldn't be an issue when it's acting normal though.
 

Spookyrobert

Sorceror
I found other spot that needs a Controlled check

Code:
public override void OnMovement( Mobile m, Point3D oldLocation )
		{
			if ( InRange( m, 10) && !InRange( oldLocation, 1 ) && InLOS( m ) [COLOR="Red"] && this.Controlled == false[/COLOR] )
			{
				if ( (this.Combatant == null) && IsEnemy(m) )
				{
					this.Combatant = (m);
				}
			}
			base.OnMovement(m, oldLocation);
		}

Otherwise the undead pet attacks it's master.
 
Top