So I've been slowly putting together an updated version of Tru's Voodoo Doll package, and I've run into an issue.
You can "animate" a voodoo doll now. However, I can't assign any additional properties, besides list.Add (summoned) for (GetProperties, AddNameProperties), I'm getting this:
Code:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Server.Mobiles.AnimatedVoodooDoll.GetProperties(ObjectPropertyList list)
   at Server.Mobile.get_PropertyList()
   at Server.Mobile.get_OPLPacket()
   at Server.Mobile.SendIncomingPacket()
   at Server.Mobile.MoveToWorld(Point3D newLocation, Map map)
   at Server.Mobiles.BaseCreature.Summon(BaseCreature creature, Boolean controlled, Mobile caster, Point3D p, Int32 sound, TimeSpan duration)
   at Server.Spells.SpellHelper.Summon(BaseCreature creature, Mobile caster, Int32 sound, TimeSpan duration, Boolean scaleDuration, Boolean scaleStats)
   at Server.Items.VoodooDoll.OnDoubleClick(Mobile from)
   at Server.Mobile.Use(Item item)
   at Server.Engines.XmlSpawner2.XmlAttach.UseReq(NetState state, PacketReader pvSrc)
   at Server.Network.MessagePump.HandleReceive(NetState ns)
   at Server.Network.MessagePump.Slice()
   at Server.Core.Main(String[] args)

Of course, removing GetProperties works just fine, but why isn't this working?
Code:
public override void GetProperties( ObjectPropertyList list )
		{
			base.GetProperties( list );
			list.Add( 1049646 ); // (summoned)
			if ( Controlled || Summoned )
			{
				list.Add("a voodoo doll of {0}", m_CursedPerson.Name);
				list.Add(String.Format("<BASEFONT COLOR=#cc33ff>Created by {0}", this.SummonMaster.Name));
			}
			else
				list.Add(this.Name);
		}
The Animated Doll, before animating, is basically a BaseImprisonedMobile. It lasts for 60 seconds, and deletes itself.
If it's been released, it's not summoned anymore...so the values that were passed to the Animated Doll, should be wiped out upon release. I don't see that happening here...and I am certain I'm overthinking this now :|
 
The BaseImprisonedMobile inherits from Item(???) and therefor doesnt have the Controlled, Summoned and SummonMaster.

I guess you can use Summon.Controlled, Summon.Summoned and Summon.SummonMaster
 
The BaseImprisonedMobile inherits from Item(???) and therefor doesnt have the Controlled, Summoned and SummonMaster.

I guess you can use Summon.Controlled, Summon.Summoned and Summon.SummonMaster
Well it's not the BaseImprisonedMobile that isn't working. If I leave just the:
Code:
		public override void AddNameProperties( ObjectPropertyList list )
		{
			base.AddNameProperties(list);
			if ( this.Controlled || this.Summoned )
			{
				list.Add( 1049646 ); // (summoned)
				//list.Add("a voodoo doll of {0}", this.m_CursedPerson.Name);
				//list.Add(String.Format("<BASEFONT COLOR=#cc33ff>Created by {0}", this.SummonMaster.Name));
			}
			else
				list.Add("a ghoul");
		}
The mob spawns in the world, with the word summoned, and it's passing these values, but the mob itself isn't getting m_CursedPerson. :|
Code:
TimeSpan duration = TimeSpan.FromSeconds(30);
						SpellHelper.Summon( new AnimatedVoodooDoll(m_CursedPerson, true), from, 0x217, duration, false, false);

The mob script has the variable declared:
Code:
		public Mobile m_CursedPerson;

		[CommandProperty( AccessLevel.GameMaster )]
		public Mobile CursedPerson
		{
			get   { return m_CursedPerson; }
			set { m_CursedPerson = value; }
		}
 
if you know it happens because of m_CursedPerson change your line to
Code:
if (CursedPerson != null) list.Add("a voodoo doll of {0}", CursedPerson.Name);

I still dont see how it would get the summoned and controlled property unless its a modified version? Anyway that should probably make it not crash
 
if you know it happens because of m_CursedPerson change your line to
Code:
if (CursedPerson != null) list.Add("a voodoo doll of {0}", CursedPerson.Name);

I still dont see how it would get the summoned and controlled property unless its a modified version? Anyway that should probably make it not crash
I plan on uploading the system when it's finished. It takes a few distro edits, but it uses BountyHead, and can be changed to use distro Head. I have made several changes to Tru's version (pins randomly being reusable with 10 uses, the amount of times a voodoo doll can be poked, the player's whose head was used to create the voodoo doll gets messages so they know who controls the doll, etc). Getting the CursedPerson to carry over from an Item to a Mobile, and being able to "display that info", has been the trick. Thanks for your help, man, I think everything is good! Now for some testing Lol

EDIT:
Well, here we go Lol
https://www.servuo.com/threads/voodoo-dolls.6507/
 
Last edited:
Back