public void Target(IPoint3D p) { if (!Caster.CanSee(p)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (!CheckLineOfSight(p)) { this.DoFizzle(); Caster.SendAsciiMessage("Target is not in line of sight"); } else if (CheckSequence()) { TimeSpan duration = TimeSpan.FromSeconds((2 * Caster.Skills.Magery.Fixed) / 5); if (Core.AOS) { SummonedAirElemental airElemental = new SummonedAirElemental(); airElemental.MoveToWorld(new Point3D(p), Caster.Map); SpellHelper.Summon(airElemental, Caster, 0x217, duration, false, false); } else { AirElemental airElemental = new AirElemental(); airElemental.MoveToWorld(new Point3D(p), Caster.Map); SpellHelper.Summon(airElemental, Caster, 0x217, duration, false, false); } } FinishSequence(); }
public override void OnCast() { if (CheckSequence()) { bool enhancedSpellcast = SpellHelper.IsEnhancedSpell(Caster, null, EnhancedSpellbookType.Summoner, false, true); BaseCreature summon = new SummonedAirElemental(); summon.StoreBaseSummonValues(); double duration = 4.0 * Caster.Skills[SkillName.Magery].Value; if (enhancedSpellcast) { duration *= SpellHelper.EnhancedSummonDurationMultiplier; summon.DamageMin = (int)((double)summon.DamageMin * SpellHelper.EnhancedSummonDamageMultiplier); summon.DamageMax = (int)((double)summon.DamageMax * SpellHelper.EnhancedSummonDamageMultiplier); summon.SetHitsMax((int)((double)summon.HitsMax * SpellHelper.EnhancedSummonHitPointsMultiplier)); summon.Hits = summon.HitsMax; } summon.SetDispelResistance(Caster, enhancedSpellcast, 0); int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.AirElemental); summon.Hue = spellHue; SpellHelper.Summon(summon, Caster, 0x217, TimeSpan.FromSeconds(duration), false, false); } FinishSequence(); }