private static void SummonDelay_Callback(object state) { object[] states = (object[])state; Mobile caster = (Mobile)states[0]; Corpse corpse = (Corpse)states[1]; Point3D loc = (Point3D)states[2]; Map map = (Map)states[3]; CreatureGroup group = (CreatureGroup)states[4]; if (corpse.Animated) { return; } Mobile owner = corpse.Owner; if (owner == null) { return; } double necromancy = caster.Skills[SkillName.Necromancy].Value; double spiritSpeak = caster.Skills[SkillName.SpiritSpeak].Value; int casterAbility = 0; casterAbility += (int)(necromancy * 30); casterAbility += (int)(spiritSpeak * 70); casterAbility /= 10; casterAbility *= 18; if (casterAbility > owner.Fame) { casterAbility = owner.Fame; } if (casterAbility < 0) { casterAbility = 0; } Type toSummon = null; SummonEntry[] entries = group.m_Entries; #region Mondain's Legacy BaseCreature creature = caster as BaseCreature; if (creature != null) { if (creature.AIObject is NecroMageAI) { toSummon = typeof(FleshGolem); } } #endregion for (int i = 0; toSummon == null && i < entries.Length; ++i) { SummonEntry entry = entries[i]; if (casterAbility < entry.m_Requirement) { continue; } Type[] animates = entry.m_ToSummon; if (animates.Length >= 0) { toSummon = animates[Utility.Random(animates.Length)]; } } if (toSummon == null) { return; } Mobile summoned = null; try { summoned = Activator.CreateInstance(toSummon) as Mobile; } catch { } if (summoned == null) { return; } if (summoned is BaseCreature) { BaseCreature bc = (BaseCreature)summoned; // to be sure bc.Tamable = false; if (bc is BaseMount) { bc.ControlSlots = 1; } else { bc.ControlSlots = 0; } Effects.PlaySound(loc, map, bc.GetAngerSound()); BaseCreature.Summon((BaseCreature)summoned, false, caster, loc, 0x28, TimeSpan.FromDays(1.0)); } if (summoned is SkeletalDragon) { Scale((SkeletalDragon)summoned, 50); // lose 50% hp and strength } summoned.Fame = 0; summoned.Karma = -1500; summoned.MoveToWorld(loc, map); corpse.Hue = 1109; corpse.Animated = true; Register(caster, summoned); #region Mondain's Legacy if (creature != null) { if (creature.AIObject is NecroMageAI) { ((NecroMageAI)creature.AIObject).Animated = summoned; } } #endregion }
private static void SummonDelay_Callback(object state) { object[] states = (object[])state; Mobile caster = (Mobile)states[0]; Corpse corpse = (Corpse)states[1]; Point3D loc = (Point3D)states[2]; Map map = (Map)states[3]; CreatureGroup group = (CreatureGroup)states[4]; if (corpse.ItemID != 0x2006) { return; } Mobile owner = corpse.Owner; if (owner == null) { return; } double necromancy = caster.Skills[SkillName.Necromancy].Value; double spiritSpeak = caster.Skills[SkillName.SpiritSpeak].Value; int casterAbility = 0; casterAbility += (int)(necromancy * 30); casterAbility += (int)(spiritSpeak * 70); casterAbility /= 10; casterAbility *= 18; if (casterAbility > owner.Fame) { casterAbility = owner.Fame; } if (casterAbility < 0) { casterAbility = 0; } Type toSummon = null; SummonEntry[] entries = group.m_Entries; for (int i = 0; toSummon == null && i < entries.Length; ++i) { SummonEntry entry = entries[i]; if (casterAbility < entry.m_Requirement) { continue; } Type[] animates = entry.m_ToSummon; if (animates.Length >= 0) { toSummon = animates[Utility.Random(animates.Length)]; } } if (toSummon == null) { return; } Mobile summoned = null; try { summoned = Activator.CreateInstance(toSummon) as Mobile; } catch { } if (summoned == null) { return; } if (summoned is BaseCreature) { BaseCreature bc = (BaseCreature)summoned; // to be sure bc.Tamable = false; if (bc is BaseMount) { bc.ControlSlots = 1; } else { bc.ControlSlots = 0; } Effects.PlaySound(loc, map, bc.GetAngerSound()); BaseCreature.Summon((BaseCreature)summoned, false, caster, loc, 0x28, TimeSpan.FromDays(1.0)); } if (summoned is SkeletalDragon) { Scale((SkeletalDragon)summoned, 50); // lose 50% hp and strength } summoned.Fame = 0; summoned.Karma = -1500; summoned.MoveToWorld(loc, map); corpse.ProcessDelta(); corpse.SendRemovePacket(); corpse.ItemID = Utility.Random(0xECA, 9); // bone graphic corpse.Hue = 0; corpse.Direction = Direction.North; corpse.ProcessDelta(); Register(caster, summoned); }