public void Summonicate(TeiravonMobile necromancer, Type necrosummon, string name, int stat, int level, int damage, int res) { necromancer.BeginAction(typeof(NecroSummonGump)); BaseCreature summon = (BaseCreature)Activator.CreateInstance(necrosummon); summon.Name = name; summon.Level = 0; summon.NoKillAwards = true; m_Player.BeginAction(typeof(NecroSummonGump)); double variation = (level / 2); int bonus = (int)(1.0 + (double)(level / 3.0)) * (necromancer.PlayerLevel); int necrobonus = (int)(necromancer.Skills[SkillName.Necromancy].Value / 4); double damageboost = 1.0 + ((bonus) / 100) + (necrobonus / 200); if (damageboost < 1.0) { damageboost = 1.0; } summon.SetStr(Utility.RandomMinMax(stat - (int)(20 * variation), stat + (int)(20 * variation)) + bonus); summon.SetDex(Utility.RandomMinMax(stat - (int)(20 * variation), stat + (int)(20 * variation)) + bonus); summon.SetInt(Utility.RandomMinMax(stat - (int)(20 * variation), stat + (int)(20 * variation)) + bonus); summon.SetHits(Utility.RandomMinMax(stat - (int)(20 * variation), stat + (int)(20 * variation)) + (int)(bonus / 2) + necrobonus); summon.SetStam(Utility.RandomMinMax(stat - (int)(20 * variation), stat + (int)(20 * variation)) + (int)(bonus / 2) + necrobonus); summon.SetMana(0); summon.SetDamage((int)(damageboost * (Utility.RandomMinMax(damage - (int)(damage / 2), damage))), (int)(damageboost * (Utility.RandomMinMax(damage, damage + (int)(damage / 4))))); summon.SetDamageType(ResistanceType.Physical, 100 - ((level - 1) * 10)); summon.SetDamageType(ResistanceType.Fire, (level - 1) * 2); summon.SetDamageType(ResistanceType.Poison, ((level - 1) * 2) + ((level - 1) * 2)); summon.SetDamageType(ResistanceType.Cold, (level - 1) * 2); summon.SetDamageType(ResistanceType.Energy, (level - 1) * 2); summon.Karma = necromancer.Karma; summon.Skills.MagicResist = necromancer.Skills.MagicResist; summon.SetSkill(SkillName.Wrestling, 55 + (level * 5), 75 + (level * 5)); summon.SetSkill(SkillName.Tactics, 65 + (level * 5), 75 + (level * 5)); summon.SetResistance(ResistanceType.Physical, (int)(res * 0.75), res); summon.SetResistance(ResistanceType.Fire, (int)(res * 0.75), res); summon.SetResistance(ResistanceType.Cold, (int)(res * 0.75), res); summon.SetResistance(ResistanceType.Poison, (int)(res * 0.75), res); summon.SetResistance(ResistanceType.Energy, (int)(res * 0.75), res); if (summon.Backpack != null) { summon.Backpack.Delete(); } summon.ControlSlots = 4; summon.Controled = true; summon.ControlMaster = m_Player; Item pentagram = new BloodPentagram(); Point3D p = new Point3D(m_Player.X - 2, m_Player.Y - 3, m_Player.Z); pentagram.MoveToWorld(p, m_Player.Map); m_Player.SendMessage("You begin summoning a {0} from the netherworld!", name); m_Player.Emote("*You see {0} begin summoning*", m_Player.Name); m_Player.RevealingAction(); m_Player.FixedParticles(0x3779, 10, 100, 9502, 67, 7, EffectLayer.Head); m_Player.Freeze(TimeSpan.FromSeconds(4.0 * level)); m_Player.PlaySound(0x24A); if (!(m_Player.Mounted) && (m_Player.Body.IsHuman)) { m_Player.Animate(266, 7, 1, true, false, 0); } Timer m_EffectTimer = new EffectTimer(m_Player, 1, level - 1, DateTime.Now + TimeSpan.FromSeconds(3.0)); m_EffectTimer.Start(); DateTime SummonTime = DateTime.Now + TimeSpan.FromSeconds(4.0 * level); Timer m_Timer = new NecromancerSummonTimer(m_Player, summon, pentagram, SummonTime, m_EffectTimer); m_Timer.Start(); }
protected override void OnTarget(Mobile from, object targeted) { if (!(targeted is TeiravonMobile)) { from.SendMessage("You must target another player."); } else if (!(( TeiravonMobile )targeted).Alive || !from.Alive) { from.SendMessage("You must target a living player."); } else if (( TeiravonMobile )targeted == ( TeiravonMobile )from) { from.SendMessage("You must target another player."); } else if (from.Mounted) { from.SendMessage("You must be on foot to initially grab a player."); } else if ((( TeiravonMobile )targeted).Mounted) { from.SendMessage("Your target must be on foot to be grabbed."); } //else if ( ( ( TeiravonMobile )targeted ).FindItemOnLayer( Layer.OneHanded ) != null || ( ( TeiravonMobile )targeted ).FindItemOnLayer( Layer.TwoHanded ) != null ) // from.SendMessage( "You must first disarm your target." ); else if (Grabbers.Contains(from)) // Sanity check { from.SendMessage("You can only grab one person at a time."); } else if (Grabbers.Contains((( TeiravonMobile )targeted))) { from.SendMessage("You can't get a hold on {0} right now.", (( TeiravonMobile )targeted).Female ? "her" : "him"); } else { TeiravonMobile grabbed = ( TeiravonMobile )targeted; foreach (GrabTimer timer in Grabbers.Values) { if (timer.Grabbed == grabbed) { from.SendMessage("{0} is already being held.", grabbed.Name); return; } } int grabvalue = 0; int defendvalue = 0; GetValues(( TeiravonMobile )from, grabbed, out grabvalue, out defendvalue); // We grabbed them. if (grabvalue > defendvalue || (grabvalue == defendvalue && Utility.RandomBool())) { GrabTimer timer = new GrabTimer(( TeiravonMobile )from, grabbed); Grabbers.Add(( TeiravonMobile )from, timer); timer.Start(); from.Emote("*successfully grabs {0}!*", grabbed.Name); BaseWeapon.BlockEquip(from, TimeSpan.FromMinutes(10.0)); BasePotion.BlockEquip(from, TimeSpan.FromMinutes(10.0)); grabbed.ClearHands(); BaseWeapon.BlockEquip(grabbed, TimeSpan.FromMinutes(10.0)); BasePotion.BlockEquip(grabbed, TimeSpan.FromMinutes(10.0)); grabbed.BeginAction(typeof(BaseMount)); grabbed.Freeze(TimeSpan.FromMinutes(10.0)); BaseMount.Dismount(grabbed); } else { from.Emote("*fails to grab {0}!*", grabbed.Name); } } }