Finaltwist submitted a new resource:

Zombiex, Unleash the Zombie Apocalypse - zombies runuo mobiles

This is a script i unearthed from an old server i used to run.. spawn a zombiex and it will attack anything that isn't already dead. On death, the mobile becomes infected, and itself turns into a zombiex. This package contains baseundead, and zombie nest - a pile of bones that spawns zombiex's until it is destroyed, and an undead slayer deed which can add the undead slayer to any weapon (as a reward for killing zombies).

Note that the chance of receiving this as a reward is set to 99% for...

Read more about this resource...
 
OK but I'm using RunUO and that was the error I got. I got it running by removing the IEntity object for AOS so I just use the mobile one.

Great fun though this. Well done!

I also got a server crash on my test player's death on my test server:

RunUO Version 2.4, Build 7340.28027
Operating System: Microsoft Windows NT 6.2.9200.0
.NET Framework: 4.0.30319.42000
Time: 25/04/2020 17:32:35
Mobiles: 31812
Items: 579563
Exception:
System.InvalidCastException: Unable to cast object of type 'Server.Mobiles.PlayerMobile' to type 'Server.Mobiles.BaseCreature'.
at Server.Mobiles.Zombiex.NewZombie(Mobile from, Zombiex zomb)
at Server.Mobiles.PlayerMobile.OnBeforeDeath()
at Server.Mobile.Kill()
at Server.Mobile.Damage(Int32 amount, Mobile from, Boolean informMount)
at Server.Mobiles.PlayerMobile.Damage(Int32 amount, Mobile from)
at Server.AOS.Damage(Mobile m, Mobile from, Int32 damage, Boolean ignoreArmor, Int32 phys, Int32 fire, Int32 cold, Int32 pois, Int32 nrgy, Int32 chaos, Int32 direct, Boolean keepAlive, Boolean archer, Boolean deathStrike)
at Server.Items.BaseWeapon.OnHit(Mobile attacker, Mobile defender, Double damageBonus)
at Server.Items.BaseWeapon.OnSwing(Mobile attacker, Mobile defender, Double damageBonus)
at Server.Items.Fists.OnSwing(Mobile attacker, Mobile defender)
at Server.Mobile.CombatTimer.OnTick()
at Server.Timer.Slice()
at Server.Core.Main(String[] args)
 
OK but I'm using RunUO and that was the error I got. I got it running by removing the IEntity object for AOS so I just use the mobile one.

Great fun though this. Well done!

I also got a server crash on my test player's death on my test server:

RunUO Version 2.4, Build 7340.28027
Operating System: Microsoft Windows NT 6.2.9200.0
.NET Framework: 4.0.30319.42000
Time: 25/04/2020 17:32:35
Mobiles: 31812
Items: 579563
Exception:
System.InvalidCastException: Unable to cast object of type 'Server.Mobiles.PlayerMobile' to type 'Server.Mobiles.BaseCreature'.
at Server.Mobiles.Zombiex.NewZombie(Mobile from, Zombiex zomb)
at Server.Mobiles.PlayerMobile.OnBeforeDeath()
at Server.Mobile.Kill()
at Server.Mobile.Damage(Int32 amount, Mobile from, Boolean informMount)
at Server.Mobiles.PlayerMobile.Damage(Int32 amount, Mobile from)
at Server.AOS.Damage(Mobile m, Mobile from, Int32 damage, Boolean ignoreArmor, Int32 phys, Int32 fire, Int32 cold, Int32 pois, Int32 nrgy, Int32 chaos, Int32 direct, Boolean keepAlive, Boolean archer, Boolean deathStrike)
at Server.Items.BaseWeapon.OnHit(Mobile attacker, Mobile defender, Double damageBonus)
at Server.Items.BaseWeapon.OnSwing(Mobile attacker, Mobile defender, Double damageBonus)
at Server.Items.Fists.OnSwing(Mobile attacker, Mobile defender)
at Server.Mobile.CombatTimer.OnTick()
at Server.Timer.Slice()
at Server.Core.Main(String[] args)

yeah its great fun. note that i did some further edits after posting the script - there were some instances where a zombiex killed by a basecreature would loose the inventory on the corpse, and I was able to erradicate all the crashes. BEcause i'm not sure what i changed, and because i'm not in the mood to re-edit everything, see my basecreature and zombiez files here, you can search for zombiex in basecreature and see if its different than what you have.

the system is crash-less for me now.

have you used it with a zombienest? that makes it much more fun.
 

Attachments

  • BaseCreature.cs
    272.4 KB · Views: 7
  • ZombieX.cs
    8.6 KB · Views: 11
  • BaseUndead.cs
    8.9 KB · Views: 6
The problem seems to be that PlayerMobile is not a BaseCreature so whenever a player dies to an infected creature it's going to crash the server.
I'm not sure if it would work as Mobile - probably not - but if not it should be easy enough to clone the player in the same way it is done in that Ninjutsu spell... Mirror Image is it? Or the other fun script someone wrote that clones your character on logoff. May be a Felladrin script I think. Yeah he appears to be cloning the Mobile into a new BaseCreature

Is PlayerMobile a BaseCreature in your version of RunUO then? I'm trying to think why it is working for you.

I've not tried the nest yet. The damage a single ZombieX did was pretty amazing. I think I will put the decay back in though or we'll be wall-to-wall zombie in a few hours!

I did try the potion. that works well
Post automatically merged:

OK so that does work as Mobile, however now when a player dies to a zombie their character actually gets deleted and they get kicked. Try to log back in, no character! Oops. :) I guess if a player's pet dies that will be gone too even if it is bonded but I haven't tested that yet. So I guess we need to add a check for a controlled pet or a player mobile before we delete the mob. Also I noticed that the player's backpack contents were not copied into the zombie's backpack and he wasn't wearing the clothes or riding his mount. So there's a bit of work to do on it still.
 
Last edited:
I see... let me have a looksy. This script was VERY incomplete when it was distributed originally. I mean the idea was nice and it might have worked in the runuo2.0 or whatnot, but there were many bugs. I've fixed the bugs for basecreatures, let me look at playermobiles.
Post automatically merged:

The problem seems to be that PlayerMobile is not a BaseCreature so whenever a player dies to an infected creature it's going to crash the server.
I'm not sure if it would work as Mobile - probably not - but if not it should be easy enough to clone the player in the same way it is done in that Ninjutsu spell... Mirror Image is it? Or the other fun script someone wrote that clones your character on logoff. May be a Felladrin script I think. Yeah he appears to be cloning the Mobile into a new BaseCreature

Is PlayerMobile a BaseCreature in your version of RunUO then? I'm trying to think why it is working for you.

I've not tried the nest yet. The damage a single ZombieX did was pretty amazing. I think I will put the decay back in though or we'll be wall-to-wall zombie in a few hours!

I did try the potion. that works well
Post automatically merged:

OK so that does work as Mobile, however now when a player dies to a zombie their character actually gets deleted and they get kicked. Try to log back in, no character! Oops. :) I guess if a player's pet dies that will be gone too even if it is bonded but I haven't tested that yet. So I guess we need to add a check for a controlled pet or a player mobile before we delete the mob. Also I noticed that the player's backpack contents were not copied into the zombie's backpack and he wasn't wearing the clothes or riding his mount. So there's a bit of work to do on it still.
what kind of damage did one zombie do??? just curious :)
Post automatically merged:

wait.. so your player got killed by a zombiex, and they got kicked out? they didn't reappear as ghost???
Post automatically merged:

AAAAh... i see what the issue is. I think.
When i merged the zombie creation routine i forgot to check whether the mobile that was killed is a player or a basemobile.

C#:
        public virtual void NewZombie( Mobile from, Zombiex zomb )
        {
[COLOR=rgb(184, 49, 47)][B]            if (from is PlayerMobile)
                PlayerMobile mob = (PlayerMobile) from;
            else[/B][/COLOR]
                BaseCreature mob = (BaseCreature) from;

add the code in red in zombiex.. and have a plyermobile get killed, see if that fixed it
Post automatically merged:

hold tight on that fix... tried it and it doesn't compile. we just need to add a check to see if the person that dies is a basecreature or a playermobile.. but i'm getting errors i don't quite understand. i posted in script help section
 
Last edited:
from is a Mobile so you can just use zomb.Name = from.Name; for example. You only need to cast as a BasCreature for the checks for Summoned, CanInfect and BaseUndead.

But there needs to also be a check at the bottom of NewZombie() to check for PlayerMobile or ControlledPet before the delete() is called. For them you would want to delete the Corpse not the Player.

However, I am having some concerns over moving the player's items into his zombie's backpack because of looting rights etc. Anyone killing his zombie will be able to get all his loot so it may be better just to leave the player Corpse where the dead player can go loot once resurrected but other players will not be allowed to, at least not for a while.
Post automatically merged:

This is where I am at. Code for Method NewZombie is below.

A player now comes back as a ghost but the corpse is still deleted and their items are gone. The items are not transferring to the player's zombie. The ethereal mount my player was riding was sitting on the ground where he died. The client crashed when I clicked on it but seemed to be OK when I logged back in again. My GM was online at the time nearby and that didn't crash. Might have just been a one off but that will show in further testing. I have not tested the bonded pet thing yet.

I've preceded my comments with //David: because that's my name :)

I'm starting to think this needs to be done a whole different way! :)

Code:
  public virtual void NewZombie( Mobile from, Zombiex zomb )
{
// David: casting from as a BaseCreature crashes server if a player is killed by a zombiex or infected
if (from is BaseCreature )
{
BaseCreature mob = (BaseCreature) from;
//What Should the Zombie virus not affect
if ( mob.Summoned || mob.CanInfect || mob is BaseUndead )
{
return;
}
   }

// David: Don't need the else{}
double dhits, dstr;

zomb.Female = from.Female;
zomb.Body = from.Body;
zomb.Hue = 768;
zomb.Name = from.Name;
zomb.Title = "*Infected*";
   zomb.CanInfect = true;

   zomb.HairItemID = from.HairItemID;
zomb.HairHue = from.HairHue;
zomb.FacialHairItemID = from.FacialHairItemID;
   zomb.FacialHairHue = from.FacialHairHue;

   SetResistance( ResistanceType.Physical, 40, 70 );
SetResistance( ResistanceType.Fire, 20, 30 );
SetResistance( ResistanceType.Cold, 99, 100 );
SetResistance( ResistanceType.Poison, 99, 100 );
   SetResistance( ResistanceType.Energy, 30, 60 );

   dhits = from.HitsMax * 1.2;
   dstr = from.Str * 0.80;

   for ( int i = 0; i < from.Skills.Length; ++i )
{
zomb.Skills[i].Base = from.Skills[i].Base * 0.80;
zomb.Skills[i].Cap = from.Skills[i].Cap;
}

zomb.HitsMaxSeed = from.HitsMax + (int) dhits;
zomb.Hits = from.HitsMax + (int) dhits;
zomb.Str = from.Str + (int) dstr;

//region moveitems
if ( from.Items != null && from.Backpack != null )
   {

    Container pack = zomb.Backpack;
ArrayList mobitems = new ArrayList(from.Items);
foreach (Item item in mobitems)
{
if ( (item.Insured == false) && (item.LootType != LootType.Blessed) && (item.Layer != Layer.Bank) && (item.Layer != Layer.Backpack) && (item.Layer != Layer.Invalid) && (item.Layer != Layer.Hair) && (item.Layer != Layer.FacialHair))
{
zomb.EquipItem( item );
}
else if ( (item.Insured == false) && (item.LootType != LootType.Blessed) )
{
//pack.DropItem ( item );
//zomb.PackItem ( item );
//zomb.DropItem ( item );
zomb.AddItem ( item );
}
}
   }

   if ( from.Mounted )
{
if ( from.Mount is EtherealMount )
{
EtherealMount pet = from.Mount as EtherealMount;
pet.Internalize();
pet.Rider = null;
}
else if ( from.Mount is BaseMount )
{
BaseMount petm = from.Mount as BaseMount;
petm.Rider = null;
BaseCreature pet = petm as BaseCreature;
pet.Internalize();
pet.ControlTarget = null;
pet.SetControlMaster( null );
pet.SummonMaster = null;
pet.MoveToWorld(zomb.Location, zomb.Map);
}
}

//endregion


Point3D loc = new Point3D(from.X, from.Y, from.Z);
   zomb.MoveToWorld(loc, from.Map);

// David: don't delete players or their pets
if ( from is PlayerMobile )
    return;

   if (from is BaseCreature)
{
BaseCreature mobx = (BaseCreature) from;
if ( !(mobx.IsBonded) )
from.Delete();
}
  }
Post automatically merged:

Update: A player's pack is transferred to the zombie of him OK but the player when resurrected no longer has a pack. Also if you kill the player's zombie then the contents are all deleted so you can't get your gear back. The items don't drop to the player's zombie corpse. Also it ignores all blessed and newbied items' rules. These are all transferred to the zombie version of the player which I think players are not going to like much. Especially as it is, because they can never get them back again. We need to dupe the bag then, not move it to the zombie or find out why the items don't drop to the zombie corpse. Also clothing is still not transferred to, and equipped by, the player's zombie. But that might be because my test toon's equipment is all blessed or newbied. However, the zombie should have a copy of the equipment I think. Then it can just be deleted and not drop to the corpse. I'm not sure I made that clear. hehehe. But I feel that when creating the zombie of a player, their gear should be copied to the zombie rather than moved and the zombie wears those items, not the original items which should remain on the player's corpse as usual and any blessed/newbied items should remain on the player's ghost as per a normal death.

With pets, I have now set it so that when bonded the will now not be deleted so when the bonded pet dies, a zombie is created but your pet's ghost follows you around as normal. If the pet is not bonded then it will still be deleted of course.
Post automatically merged:

I'm also getting the client crashing almost every time I run into a screen full of zombies so something is upsetting it.
 
Last edited:
from is a Mobile so you can just use zomb.Name = from.Name; for example. You only need to cast as a BasCreature for the checks for Summoned, CanInfect and BaseUndead.

But there needs to also be a check at the bottom of NewZombie() to check for PlayerMobile or ControlledPet before the delete() is called. For them you would want to delete the Corpse not the Player.

However, I am having some concerns over moving the player's items into his zombie's backpack because of looting rights etc. Anyone killing his zombie will be able to get all his loot so it may be better just to leave the player Corpse where the dead player can go loot once resurrected but other players will not be allowed to, at least not for a while.
Post automatically merged:

This is where I am at. Code for Method NewZombie is below.

A player now comes back as a ghost but the corpse is still deleted and their items are gone. The items are not transferring to the player's zombie. The ethereal mount my player was riding was sitting on the ground where he died. The client crashed when I clicked on it but seemed to be OK when I logged back in again. My GM was online at the time nearby and that didn't crash. Might have just been a one off but that will show in further testing. I have not tested the bonded pet thing yet.

I've preceded my comments with //David: because that's my name :)

I'm starting to think this needs to be done a whole different way! :)

Code:
  public virtual void NewZombie( Mobile from, Zombiex zomb )
{
// David: casting from as a BaseCreature crashes server if a player is killed by a zombiex or infected
if (from is BaseCreature )
{
BaseCreature mob = (BaseCreature) from;
//What Should the Zombie virus not affect
if ( mob.Summoned || mob.CanInfect || mob is BaseUndead )
{
return;
}
   }

// David: Don't need the else{}
double dhits, dstr;

zomb.Female = from.Female;
zomb.Body = from.Body;
zomb.Hue = 768;
zomb.Name = from.Name;
zomb.Title = "*Infected*";
   zomb.CanInfect = true;

   zomb.HairItemID = from.HairItemID;
zomb.HairHue = from.HairHue;
zomb.FacialHairItemID = from.FacialHairItemID;
   zomb.FacialHairHue = from.FacialHairHue;

   SetResistance( ResistanceType.Physical, 40, 70 );
SetResistance( ResistanceType.Fire, 20, 30 );
SetResistance( ResistanceType.Cold, 99, 100 );
SetResistance( ResistanceType.Poison, 99, 100 );
   SetResistance( ResistanceType.Energy, 30, 60 );

   dhits = from.HitsMax * 1.2;
   dstr = from.Str * 0.80;

   for ( int i = 0; i < from.Skills.Length; ++i )
{
zomb.Skills[i].Base = from.Skills[i].Base * 0.80;
zomb.Skills[i].Cap = from.Skills[i].Cap;
}

zomb.HitsMaxSeed = from.HitsMax + (int) dhits;
zomb.Hits = from.HitsMax + (int) dhits;
zomb.Str = from.Str + (int) dstr;

//region moveitems
if ( from.Items != null && from.Backpack != null )
   {

    Container pack = zomb.Backpack;
ArrayList mobitems = new ArrayList(from.Items);
foreach (Item item in mobitems)
{
if ( (item.Insured == false) && (item.LootType != LootType.Blessed) && (item.Layer != Layer.Bank) && (item.Layer != Layer.Backpack) && (item.Layer != Layer.Invalid) && (item.Layer != Layer.Hair) && (item.Layer != Layer.FacialHair))
{
zomb.EquipItem( item );
}
else if ( (item.Insured == false) && (item.LootType != LootType.Blessed) )
{
//pack.DropItem ( item );
//zomb.PackItem ( item );
//zomb.DropItem ( item );
zomb.AddItem ( item );
}
}
   }

   if ( from.Mounted )
{
if ( from.Mount is EtherealMount )
{
EtherealMount pet = from.Mount as EtherealMount;
pet.Internalize();
pet.Rider = null;
}
else if ( from.Mount is BaseMount )
{
BaseMount petm = from.Mount as BaseMount;
petm.Rider = null;
BaseCreature pet = petm as BaseCreature;
pet.Internalize();
pet.ControlTarget = null;
pet.SetControlMaster( null );
pet.SummonMaster = null;
pet.MoveToWorld(zomb.Location, zomb.Map);
}
}

//endregion


Point3D loc = new Point3D(from.X, from.Y, from.Z);
   zomb.MoveToWorld(loc, from.Map);

// David: don't delete players or their pets
if ( from is PlayerMobile )
    return;

   if (from is BaseCreature)
{
BaseCreature mobx = (BaseCreature) from;
if ( !(mobx.IsBonded) )
from.Delete();
}
  }
Post automatically merged:

Update: A player's pack is transferred to the zombie of him OK but the player when resurrected no longer has a pack. Also if you kill the player's zombie then the contents are all deleted so you can't get your gear back. The items don't drop to the player's zombie corpse. Also it ignores all blessed and newbied items' rules. These are all transferred to the zombie version of the player which I think players are not going to like much. Especially as it is, because they can never get them back again. We need to dupe the bag then, not move it to the zombie or find out why the items don't drop to the zombie corpse. Also clothing is still not transferred to, and equipped by, the player's zombie. But that might be because my test toon's equipment is all blessed or newbied. However, the zombie should have a copy of the equipment I think. Then it can just be deleted and not drop to the corpse. I'm not sure I made that clear. hehehe. But I feel that when creating the zombie of a player, their gear should be copied to the zombie rather than moved and the zombie wears those items, not the original items which should remain on the player's corpse as usual and any blessed/newbied items should remain on the player's ghost as per a normal death.

With pets, I have now set it so that when bonded the will now not be deleted so when the bonded pet dies, a zombie is created but your pet's ghost follows you around as normal. If the pet is not bonded then it will still be deleted of course.
Post automatically merged:

I'm also getting the client crashing almost every time I run into a screen full of zombies so something is upsetting it.




Looting rights: Remember that a new (more powerful) version of the player will now be a zombie. so whoever it is will need to kill this zombie (plus the other zombies that killed the player) in order to be able to loot. also, it doesn't move items that are insured or blessed. I think that's fair (but you might not).

As far as pets... yeah the script doesn't even take that into account at all....

You do know that there is an edit in corpse.cs right?

C#:
//Zombiex
            if (m_Killer is Zombiex)
            {
                if (m_Owner is BaseCreature)
                {
                    BaseCreature bc = (BaseCreature) m_Owner;
                    if (bc.CanInfect)
                    {
                        this.Delete();
                    }
                }
                else if (m_Owner is PlayerMobile)
                {
                    this.Delete();
                }
            }
//Zombiex end

HAve a look at the last this.Delete instruction - it deletes the corpse of a player. This is meant to make it so a duplicated zombie player doesn't have player corpse on the ground (the corpse is supposed to be the zombie). This might be the issue as far as deleting the player?

I don't understand the issue you're having around items though... since it's working find if a basecreature kills a zombiex. You're saying that if the player kills a zombiex things get deleted?

Also, blessed items moving to corpse... this is not supposed to happen because of
C#:
                //region moveitems
                if ( mob.Items != null && mob.Backpack != null )
                {

                    Container pack = zomb.Backpack;
                    ArrayList mobitems = new ArrayList(mob.Items);
                    foreach (Item item in mobitems)
                    {
                        if ( (item.Insured == false) && (item.LootType != LootType.Blessed) && (item.Layer != Layer.Bank) && (item.Layer != Layer.Backpack) && (item.Layer != Layer.Invalid) && (item.Layer != Layer.Hair) && (item.Layer != Layer.FacialHair))
                        {
                            zomb.EquipItem( item );
                        }
                        else if ( (item.Insured == false) && (item.LootType != LootType.Blessed) )
                        {
\
                            zomb.AddItem ( item );
                        }
                    }
                }

IS that the moveitem routine you have in your script? I updated it a while back. Make sure that's what is present in the newzombie routine... works for me when zombiex is killed by a basecreature, or when its killed by a GM.


OOOh... I also added this to the Ondeath in basecreature, before i added this stuff got deleted on the death of a zombiex. Since i added this to basecreature i haven't had the issue. I don't think this needs to be added to playermobile since the first IF won't apply to a playermobile.

C#:
//zombiex
            if (killer is BaseCreature && this is Zombiex && this.Items != null)
            {
                ArrayList zombitems = new ArrayList(this.Items);
                foreach (Item item in zombitems)
                {
                    if ( (item.Insured == false) && (item.LootType != LootType.Blessed) && (item.Layer != Layer.Bank) && (item.Layer != Layer.Backpack) && (item.Layer != Layer.Invalid) && (item.Layer != Layer.Hair) && (item.Layer != Layer.FacialHair))
                    {
                    }
                    else if ( (item.Insured == false) && (item.LootType != LootType.Blessed) )
                    {
                    c.AddItem ( item );
                    }
                   
                }
            }
Post automatically merged:

Just tried getting killed by a zombiex (player), and it crashed, using the modded bits you added (don't delete playermobile).

the crash log is interesting though....

C#:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Server.Misc.SeeIfJewelInBag.IHaveAJewel(Mobile m)
   at Server.Mobiles.PlayerMobile.OnBeforeDeath()
   at Server.Mobile.Kill()
   at Server.Mobile.Damage(Int32 amount, Mobile from, Boolean informMount)
   at Server.Mobiles.PlayerMobile.Damage(Int32 amount, Mobile from)
   at Server.AOS.Damage(Mobile m, Mobile from, Int32 damage, Boolean ignoreArmor, Int32 phys, Int32 fire, Int32 cold, Int32 pois, Int32 nrgy, Int32 chaos, Int32 direct, Boolean keepAlive, Boolean archer, Boolean deathStrike)
   at Server.Items.BaseWeapon.OnHit(Mobile attacker, Mobile defender, Double damageBonus)
   at Server.Items.BaseWeapon.OnSwing(Mobile attacker, Mobile defender, Double damageBonus)
   at Server.Items.Fists.OnSwing(Mobile attacker, Mobile defender)
   at Server.Mobile.CombatTimer.OnTick()
   at Server.Timer.Slice()
   at Server.Core.Main(String[] args)

its a null reference in playermobile onbefore death. (jewelinbag). that's an easy fix... see, if the (zombiex) call is right at the top of the onbeforedeath method, then when it returns and there's no corpse it just crashes.... so i'm gonna move it to the end of onbeforedeath to see if that corrects it.
Post automatically merged:

nope wasn't able to fix it... working on it ...
Post automatically merged:

update: I've taken care of the backpack of the player being deleted. turns out the moveitem routine was moving the player's backpack into the new zombie.

this is what i'm looking at now... problem is NO items from the player move to the zombies backpack (equipped items appear move fine)

C#:
                if ( from.Items != null && from.Backpack != null )
                {

                    Container frompack = from.Backpack;
                    Container zombpack = zomb.Backpack;

                    ArrayList fromitems = new ArrayList(from.Items);
                    foreach (Item item in fromitems)
                    {
                        if ( (item.Insured == false) && (item != frompack) && (item.LootType != LootType.Blessed) && (item.Layer != Layer.Bank) && (item.Layer != Layer.Backpack) && (item.Layer != Layer.Invalid) && (item.Layer != Layer.Hair) && (item.Layer != Layer.FacialHair))
                        {
                            zomb.EquipItem( item );
                        }
                        else if ( (item.Layer != Layer.Bank) && (item.Insured == false) && (item.LootType != LootType.Blessed) )
                        {
                            //pack.DropItem ( item );
                            //zomb.PackItem ( item );
                            //zomb.DropItem ( item );
                            if (item == frompack)
                                zomb.PackItem( zomb.CloneItem( item ) );
                            else
                                zomb.PackItem ( item );
                        }
                    }
                }
 
Last edited:
Here is a revision of the files.
I tested it, player and basecreatures all work fine. But I did not test it on runuo 2.2
So if you can do that, that would be great :) I dont think I used any C# syntax that would cause issues


What changed?
- CanInfect was removed, didnt see much sense there, as it was only true for ZombieX's anyway, wich is BaseUndead
- Items now drop into the ZombieX backpack
- fixed crash bugs
- cleaned up the code base a little (all files)
 

Attachments

  • ZombieX.zip
    13.6 KB · Views: 16
Here is a revision of the files.
I tested it, player and basecreatures all work fine. But I did not test it on runuo 2.2
So if you can do that, that would be great :) I dont think I used any C# syntax that would cause issues


What changed?
- CanInfect was removed, didnt see much sense there, as it was only true for ZombieX's anyway, wich is BaseUndead
- Items now drop into the ZombieX backpack
- fixed crash bugs
- cleaned up the code base a little (all files)
thanks pyro... just making edits now to see if you could sort all this out for us... i spent OVER 3 days working on this damn script... :D

just a question, the distro edit for playermobile

C#:
//////
//   This was not touched, but can probably shortend to
//Zombiex
            if (m_Killer is Zombiex)
            {
                Delete();
            }   
//Zombiex end
/////
goes in the ondeath method, or onbeforedeath?
 
Ok here is one thing, NEVER delete the playermobile, or you are deleting the player itself, I dont think thats what you want :D

that edit there? Is the code for corpse.cs (BeginDecay) as you had below.
 
Ok here is one thing, NEVER delete the playermobile, or you are deleting the player itself, I dont think thats what you want :D

that edit there? Is the code for corpse.cs (BeginDecay) as you had below.
ok so the circled replaces the corpse.cs edit?
1587929353325.png

Also getting error on baseundead (runuo 2.2)
1587929393207.png
 
you would add that instead of the part further below :p

I didnt test the code, just shortened it in the description. so I put it there.
Should have put it below the corpse.cs area my bad
 
you would add that instead of the part further below :p

I didnt test the code, just shortened it in the description. so I put it there.
Should have put it below the corpse.cs area my bad
looks like you shortened the code in baseundead... getting the error above - im not familiar with that syntax, but its not liking it
 
Ah dang it, auto properties with default values came later on lol
My bad, so it should be fine with that swapped to the constructor
change
C#:
        [CommandProperty(AccessLevel.GameMaster)]
        public bool LeaveCorpse { get; set; } = true;

...

        public BaseUndead(AIType ai, FightMode mode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed) : base(ai, mode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed)
        { }

to
C#:
        [CommandProperty(AccessLevel.GameMaster)]
        public bool LeaveCorpse { get; set; }

...

        public BaseUndead(AIType ai, FightMode mode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed) : base(ai, mode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed)
        {
            LeaveCorpse = true;
        }
 
Ah dang it, auto properties with default values came later on lol
My bad, so it should be fine with that swapped to the constructor
change
C#:
        [CommandProperty(AccessLevel.GameMaster)]
        public bool LeaveCorpse { get; set; } = true;

...

        public BaseUndead(AIType ai, FightMode mode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed) : base(ai, mode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed)
        { }

to
C#:
        [CommandProperty(AccessLevel.GameMaster)]
        public bool LeaveCorpse { get; set; }

...

        public BaseUndead(AIType ai, FightMode mode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed) : base(ai, mode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed)
        {
            LeaveCorpse = true;
        }

another compile error
1587930204597.png


LOL, i'm so eager toget this compile to see if it works as intended!!!
getting these compile errors !
 
Hmm I really hate lower c# versions by now :D

soo
C#:
public BaseZombieKillerPotion Potion { get; }
probably has to be this in the older versions
C#:
public BaseZombieKillerPotion Potion { get; private set; }
 
Hmm I really hate lower c# versions by now :D

soo
C#:
public BaseZombieKillerPotion Potion { get; }
probably has to be this in the older versions
C#:
public BaseZombieKillerPotion Potion { get; private set; }

I don't remember seeing this anywhere in 2.2... Icombatequipment...

1587930632378.png

that's why we had that long convoluted if statement when checking on the items.
 
Hmm well I liked the interface .. :/
I guess we dont even need it since the Items only tell you what you wear anyway

but ok just replace the loop with
C#:
                    foreach (Item item in mobitems)
                    {
                        if (item.Layer == Layer.Backpack || item.Layer == Layer.Bank || item.Insured || item.LootType == LootType.Blessed || item.LootType == LootType.Newbied) continue;
                        EquipItem(item);
                    }
 
It compiles!!

How did you check if the mobile being killed is tamed && bonded? is the body still deleted?

okay i'm going to be doing my checks of the system to make sure it works... i will owe you a drink if this works. you don't know how many hours ive dumped in this zombiex script. i'm just not very knowledgeable in c# (or any other language) so i've a long labor for me to get anywhere.
Post automatically merged:

wait... since i removed the seralize/deserialize for the caninfect, now it wants to delete all the mobiles one at a time on world launch... i don't like that solution...... i might put the caninfect back
 
in your case you can either readd it (since it has no use I removed it) or you can remove it from the serialize, set the deserialize that it only reads the bool if it is that specific version, and later on you can even remove that too, once it was saved.

How you approach that? Thats up to you regarding the bonded part? Well I didnt alter anything in that regard, but that can be added (and should I guess :) )

At the bottom of the NewZombie function
change
C#:
                if (from is BaseCreature)
                    from.Delete();
to this
C#:
                if (from is BaseCreature && !((BaseCreature)from).IsBonded)
                    from.Delete();

now bonded pets wont be deleted
 
in your case you can either readd it (since it has no use I removed it) or you can remove it from the serialize, set the deserialize that it only reads the bool if it is that specific version, and later on you can even remove that too, once it was saved.

How you approach that? Thats up to you regarding the bonded part? Well I didnt alter anything in that regard, but that can be added (and should I guess :) )

At the bottom of the NewZombie function
change
C#:
                if (from is BaseCreature)
                    from.Delete();
to this
C#:
                if (from is BaseCreature && !((BaseCreature)from).IsBonded)
                    from.Delete();

now bonded pets wont be deleted

YOU ARE A SAINT!

It compiles, and it works! items from a player moves to the zombie, and the items move to the zombie corpse when killed! I'll keep on testing, but i think you did it. I'll update the main download and give you credit.

I owe you a beer, let me know how i can do that :D
 
If you find anything else you can tell me, but it should be fine now. Still some things that I think arent optimal but its doing its job

You can also write to me on discord if you like, makes it easier to figure things out :)
 
Thank you PyrO. That all works a treat now. Blessed items now stay on the player's ghost.

I have also not had a client crash.

The only thing I feel that is needed is to stop bonded pets being deleted so in ZombieX.cs I've changed the Delete() code to:

Code:
  if (from is BaseCreature)
  {
   BaseCreature mobx = (BaseCreature) from;
   if ( !(mobx.IsBonded) )
    from.Delete();
  }
 
Last edited:
Guess it wasnt in the package?
But here is the direct link to Post #20

:)
 
I just realised I didn't post that in my original post either. Duh! :)

What was the issue with the ethereal dropping to the ground? I didn't get to look at that but it works now so I'm guessing you fixed it, or did it fix itself with the blessed items fix?
 
Well I didnt touch the mount area, the whole moving items to the zombies backpack was not working as intended.

The Zombie didnt have an backpack so the code tried to equip it to the creature.
Also it only looked at the equipped items, therefor it tried to give your backpack to the creature.

So I assume, since you would not have any backpack left, it would drop to the ground at that point
 
Nice to see this script is still floating around. I can't remember when I first released it but it must have been 10-15 years ago. I was using a copy/paste/debug method to learn how to write code at that time so I was really proud I got it working as well as it did(on an early runuo 2.0 rev). I'm happy people still like the idea and are improving/updating it.
There was a more standalone version another runuo member made that did use something like the mirror image spell to copy players and didn't use the baseUndead custom script but I can't find it in my files.
Thanks for keeping this zombie walking.
 
haha i love the script and its one of the first things i added on my server. that happened ot me too - i found my "baseblue" scripts here after programming them back in 2005. that's how UO works.

the scripts here have been changed quite a bit since your version, less crashes and they work as intended now - there were a few issues before. try it!
 
Nice to see this script is still floating around. I can't remember when I first released it but it must have been 10-15 years ago.
.........
Thanks for keeping this zombie walking.

Thank you for writing it! It was a brilliant idea. I am sure we will bring them out each Halloween now and probably use the base code with other creatures in future.
 
so i got everything put in but i'm still getting the following issue:
ripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
+ custom/ZombieX/BaseUndead.cs:
CS1519: Line 19: Invalid token '=' in class, struct, or interface member declaration
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
 
 
ty tho i think i may have messed up some where else as now i'm getting :

Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
Scripts: Compiling C# scripts...failed (3 errors, 0 warnings)
Errors:
+ custom/ZombieX/Monsternest/MonsterNest.cs:
CS0501: Line 13: 'Server.Items.MonsterNest.NestSpawnType.get' must declare a body because it is not marked abstract or extern
CS0501: Line 13: 'Server.Items.MonsterNest.NestSpawnType.set' must declare a body because it is not marked abstract or extern
CS0501: Line 16: 'Server.Items.MonsterNest.MaxCount.get' must declare a body because it is not marked abstract or extern
CS0501: Line 16: 'Server.Items.MonsterNest.MaxCount.set' must declare a body because it is not marked abstract or extern
CS0501: Line 19: 'Server.Items.MonsterNest.RespawnTime.get' must declare a body because it is not marked abstract or extern
CS0501: Line 19: 'Server.Items.MonsterNest.RespawnTime.set' must declare a body because it is not marked abstract or extern
CS0501: Line 22: 'Server.Items.MonsterNest.HitsMax.get' must declare a body because it is not marked abstract or extern
CS0501: Line 22: 'Server.Items.MonsterNest.HitsMax.set' must declare a body because it is not marked abstract or extern
CS0501: Line 25: 'Server.Items.MonsterNest.Hits.get' must declare a body because it is not marked abstract or extern
CS0501: Line 25: 'Server.Items.MonsterNest.Hits.set' must declare a body because it is not marked abstract or extern
CS0501: Line 28: 'Server.Items.MonsterNest.RangeHome.get' must declare a body because it is not marked abstract or extern
CS0501: Line 28: 'Server.Items.MonsterNest.RangeHome.set' must declare a body because it is not marked abstract or extern
CS0501: Line 31: 'Server.Items.MonsterNest.LootLevel.get' must declare a body because it is not marked abstract or extern
CS0501: Line 31: 'Server.Items.MonsterNest.LootLevel.set' must declare a body because it is not marked abstract or extern
+ custom/ZombieX/BaseUndead.cs:
CS0501: Line 16: 'Server.Mobiles.BaseUndead.Spirit.get' must declare a body because it is not marked abstract or extern
CS0501: Line 16: 'Server.Mobiles.BaseUndead.Spirit.set' must declare a body because it is not marked abstract or extern
CS0501: Line 19: 'Server.Mobiles.BaseUndead.LeaveCorpse.get' must declare a body because it is not marked abstract or extern
CS0501: Line 19: 'Server.Mobiles.BaseUndead.LeaveCorpse.set' must declare a body because it is not marked abstract or extern
CS0501: Line 22: 'Server.Mobiles.BaseUndead.Nocturnal.get' must declare a body because it is not marked abstract or extern
CS0501: Line 22: 'Server.Mobiles.BaseUndead.Nocturnal.set' must declare a body because it is not marked abstract or extern
CS0501: Line 25: 'Server.Mobiles.BaseUndead.SemiVisible.get' must declare a body because it is not marked abstract or extern
CS0501: Line 25: 'Server.Mobiles.BaseUndead.SemiVisible.set' must declare a body because it is not marked abstract or extern
CS0501: Line 28: 'Server.Mobiles.BaseUndead.LifeDrain.get' must declare a body because it is not marked abstract or extern
CS0501: Line 28: 'Server.Mobiles.BaseUndead.LifeDrain.set' must declare a body because it is not marked abstract or extern
+ custom/ZombieX/BaseZombieKillerPotion.cs:
CS0501: Line 162: 'Server.Items.BaseZombieKillerPotion.ThrowTarget.Potion.get' must declare a body because it is not marked abstract or extern
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
 
spent a few hours playing with this trying to figure out where i went wrong, has any one been able to get this to compile? (or by chance does any one have a newer version of runuo that this will run on? i'm on Runuo2.3r987. i'd love to find a zip with a fresh build with this running to start from.
thanks all
(sorry for being a pain in the ass)
 
the system works flawlessly (after hours and hours and hours of coding) in adventures buddy. we even have a fully automated invasion system where an evil ophid runs around the lands and infects cities and dungeons. i integrated the code in premiumspawners to prevent a full on server overload. the system works really well. adventures code is freely downloadable.
 
i've attempted the use of the Adventures server, but it is already far to modded. for what i am working on unfortunately.
 
I have copies of what are called RunUO 2.6 and 2.7 and2.6. at least, was I think put together by Voxpire who is one of the Gods here at ServUO. Even the Head God :)

I do think, though, that if you are starting out on a project, you would be much better off starting with ServUO. If you don't want the latest version, the Legacy version is still available which allows you to select older eras.

I started back in 2013/2014 with RunUO 2.4 and heavily modified it, bringing in bits from 2.6, 2.7, JustUO, PlayUO and then ServUO and also wrote a lot of mods and additions myself. But if I was starting NOW, I would start with either the latest or the legacy version of ServUO.

David.
 
Back