public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); m_SSum = reader.ReadMobile() as SSum; m_Fake = reader.ReadMobile() as BaseFakeMob; m_Type = (BellType)reader.ReadInt(); if ( m_SSum != null ) m_SSum.Delete(); }
public virtual void EndSummonFake() { if ( Deleted || m_AngryAt == null ) return; Map map = m_AngryAt.Map; if ( map == null ) return; if ( m_AngryAt.Region != this.Region ) return; this.Say("Now you shall suffer at the hands of my pet!" ); this.Say( "MUHAHAHAHA, DIE NOW MORTAL!!!" ); switch ( m_Type ) { case BellType.DarkIron: m_Mob = new FakeManaWisp(); break; case BellType.Wooden: m_Mob = new FakeWindcaller(); break; case BellType.Blood: m_Mob = new FakeFallenHero(); break; case BellType.Beast: m_Mob = new FakeSkeletalDragon(); break; case BellType.Noxious: m_Mob = new FakeWarlord(); break; } int offset = Utility.Random( 8 ) * 2; bool foundLoc = false; for ( int i = 0; i < m_Offsets.Length; i += 2 ) { int x = m_AngryAt.X + m_Offsets[(offset + i) % m_Offsets.Length]; int y = m_AngryAt.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length]; if ( map.CanSpawnMobile( x, y, m_AngryAt.Z ) ) { m_Mob.MoveToWorld( new Point3D( x, y, m_AngryAt.Z ), map ); foundLoc = true; break; } else { int z = map.GetAverageZ( x, y ); if ( map.CanSpawnMobile( x, y, z ) ) { m_Mob.MoveToWorld( new Point3D( x, y, z ), map ); foundLoc = true; break; } } } if ( !foundLoc ) m_Mob.MoveToWorld( m_AngryAt.Location, map ); m_Mob.Combatant = m_AngryAt; if ( m_Bell != null ) m_Bell.Fake = m_Mob; }