Пример #1
0
        public DynamicObject(Unit creator, SpellId spellId, float radius, Map map, Vector3 pos)
        {
            if (creator == null)
                throw new ArgumentNullException("creator", "creator must not be null");

            Master = creator;
            EntityId = EntityId.GetDynamicObjectId(++lastId);
            Type |= ObjectTypes.DynamicObject;
            SetEntityId(DynamicObjectFields.CASTER, creator.EntityId);
            SpellId = spellId;
            Radius = radius;
            Bytes = 0x01EEEEEE;
            ScaleX = 1;

            m_position = pos;
            map.AddObjectLater(this);
        }
Пример #2
0
		/// <summary>
		/// Spawns and returns a new Corpse at the given location
		/// </summary>
		/// <param name="bones"></param>
		/// <param name="lootable"></param>
		/// <returns></returns>
		public Corpse SpawnCorpse(bool bones, bool lootable, Map map, Vector3 pos, float o)
		{
			var corpse = new Corpse(this, pos, o, DisplayId, Facial, Skin,
				HairStyle, HairColor, FacialHair, GuildId, Gender, Race,
				bones ? CorpseFlags.Bones : CorpseFlags.None, lootable ? CorpseDynamicFlags.PlayerLootable : CorpseDynamicFlags.None);

			for (var i = EquipmentSlot.Head; i <= EquipmentSlot.Tabard; i++)
			{
				var item = m_inventory[(int)i];
				if (item != null)
				{
					corpse.SetItem(i, item.Template);
				}
			}

			corpse.Position = pos;
			map.AddObjectLater(corpse);
			return corpse;
		}