public void Target(Mobile mobile) { if (!Caster.CanSee(mobile) || mobile.Hidden) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (CheckHSequence(mobile)) { SpellHelper.Turn(Caster, mobile); SpellHelper.CheckReflect((int)this.Circle, Caster, ref mobile); if (mobile.Spell != null) { mobile.Spell.OnCasterHurt(); } mobile.Paralyzed = false; bool success = false; if (CheckMagicResist(mobile) && mobile is PlayerMobile) { mobile.SendLocalizedMessage(501783); // You feel yourself resisting magical energy. } else { ApplyEffect(Caster, mobile); success = true; } //Player Enhancement Customization: Venomous bool venomous = false; //PlayerEnhancementPersistance.IsCustomizationEntryActive(Caster, CustomizationType.Venomous); if (venomous) { if (success) { CustomizationAbilities.Venomous(mobile); } else { mobile.FixedParticles(0x374A, 10, 15, 5021, 0, 0, EffectLayer.Waist); mobile.PlaySound(0x474); } } else { mobile.FixedParticles(0x374A, 10, 15, 5021, 0, 0, EffectLayer.Waist); mobile.PlaySound(0x474); } } ArenaFight.SpellCompletion(Caster, typeof(PoisonSpell)); FinishSequence(); }
public void Target(IPoint3D p) { if (!Caster.CanSee(p)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (BaseShip.FindShipAt(p, Caster.Map) != null) { Caster.SendMessage("That location is blocked."); } else if (SpellHelper.CheckTown(p, Caster) && CheckSequence()) { SpellHelper.Turn(Caster, p); SpellHelper.GetSurfaceTop(ref p); int dx = Caster.Location.X - p.X; int dy = Caster.Location.Y - p.Y; int rx = (dx - dy) * 44; int ry = (dx + dy) * 44; bool eastToWest; if (rx >= 0 && ry >= 0) { eastToWest = false; } else if (rx >= 0) { eastToWest = true; } else if (ry >= 0) { eastToWest = true; } else { eastToWest = false; } Effects.PlaySound(p, Caster.Map, 0x20B); int itemID = eastToWest ? 0x3915 : 0x3922; TimeSpan duration = TimeSpan.FromSeconds(3.0 + (Caster.Skills[SkillName.Magery].Value * 0.4)); bool chargeUsed = false; bool enhancedSpellcast = SpellHelper.IsEnhancedSpell(Caster, null, EnhancedSpellbookType.Warlock, true, true); for (int i = -2; i <= 2; ++i) { Point3D loc = new Point3D(eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z); PoisonFieldItem item = new PoisonFieldItem(itemID, loc, Caster, Caster.Map, duration, i); if (enhancedSpellcast) { item.m_Enhanced = true; } } } ArenaFight.SpellCompletion(Caster, typeof(PoisonFieldSpell)); FinishSequence(); }
public void Target(Mobile mobile) { if (!Caster.CanSee(mobile) || mobile.Hidden) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (CheckHSequence(mobile)) { SpellHelper.Turn(Caster, mobile); SpellHelper.CheckReflect((int)this.Circle, Caster, ref mobile); double duration; if (mobile.Player) { duration = 5 + (Caster.Skills[SkillName.Magery].Value * 0.05); if (CheckMagicResist(mobile)) { duration *= 0.5; } } else { duration = 10.0 + (Caster.Skills[SkillName.Magery].Value * 0.2); if (CheckMagicResist(mobile)) { duration *= 0.75; } } bool enhancedSpellcast = SpellHelper.IsEnhancedSpell(Caster, mobile, EnhancedSpellbookType.Warlock, true, true); int spellHue = 0; AspectArmorProfile defenderAspectArmorProfile = AspectGear.GetAspectArmorProfile(mobile); double airAvoidanceChance = 0; if (defenderAspectArmorProfile != null) { if (defenderAspectArmorProfile.m_Aspect == AspectEnum.Air) { airAvoidanceChance = AspectGear.AirMeleeAvoidMovementEffectAvoidance * (AspectGear.AirMeleeAvoidMovementEffectAvoidancePerTier * (double)defenderAspectArmorProfile.m_TierLevel); } } if (Utility.RandomDouble() <= airAvoidanceChance) { //TEST: Add Aspect Visuals } else if (enhancedSpellcast) { if (mobile.Paralyze(Caster, duration * 5)) { mobile.FixedEffect(0x376A, 10, 30, spellHue, 0); mobile.PlaySound(0x204); } else if (mobile is PlayerMobile) { mobile.FixedEffect(0x376A, 10, 30, spellHue, 0); mobile.PlaySound(0x204); } } else { if (mobile.Paralyze(Caster, duration)) { mobile.FixedEffect(0x376A, 10, 15, spellHue, 0); mobile.PlaySound(0x204); } else if (mobile is PlayerMobile) { mobile.FixedEffect(0x376A, 10, 15, spellHue, 0); mobile.PlaySound(0x204); } } HarmfulSpell(mobile); } ArenaFight.SpellCompletion(Caster, typeof(ParalyzeSpell)); FinishSequence(); }
public void Target(IPoint3D p) { if (!Caster.CanSee(p)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (SpellHelper.CheckTown(p, Caster) && CheckSequence()) { bool enhancedSpellcast = false; Boolean chargedSpellcast = false; int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.MeteorSwarm); int radius = 3; if (Caster is BaseCreature) { radius += (int)(Math.Floor((Caster.Skills[SkillName.Magery].Value - 75) / 25)); } SpellHelper.Turn(Caster, p); if (p is Item) { p = ((Item)p).GetWorldLocation(); } Map map = Caster.Map; IPooledEnumerable nearbyMobiles = map.GetMobilesInRange(new Point3D(p), radius); Queue m_Queue = new Queue(); int targetCount = 0; bool playerVsCreatureOccurred = false; if (targetCount > 0) { Effects.PlaySound(p, Caster.Map, 0x160); } foreach (Mobile mobile in nearbyMobiles) { if (mobile == Caster) { continue; } if (Caster is BaseCreature) { if (!SpecialAbilities.MonsterCanDamage(Caster, mobile)) { continue; } } if (!Caster.CanBeHarmful(mobile, false)) { continue; } if (Caster is PlayerMobile && mobile is BaseCreature) { playerVsCreatureOccurred = true; } targetCount++; m_Queue.Enqueue(mobile); } nearbyMobiles.Free(); if (playerVsCreatureOccurred) { enhancedSpellcast = SpellHelper.IsEnhancedSpell(Caster, null, EnhancedSpellbookType.Fire, false, true); chargedSpellcast = SpellHelper.IsChargedSpell(Caster, null, false, Scroll != null); } while (m_Queue.Count > 0) { Mobile mobile = (Mobile)m_Queue.Dequeue(); double damage = (double)Utility.RandomMinMax(DamageMin, DamageMax); double damageBonus = 0; CheckMagicResist(mobile); Boolean isTamedTarget = SpellHelper.IsTamedTarget(Caster, mobile); if (Caster is PlayerMobile && mobile is BaseCreature) { damageBonus += SpellSpecificCreatureDamageBonus; } if (enhancedSpellcast && mobile is BaseCreature) { if (isTamedTarget) { damageBonus += SpellHelper.EnhancedSpellTamedCreatureBonus; } else { damageBonus += SpellHelper.EnhancedSpellBonus; } } if (chargedSpellcast && mobile is BaseCreature) { if (isTamedTarget) { damageBonus += SpellHelper.ChargedSpellTamedCreatureBonus; } else { damageBonus += SpellHelper.ChargedSpellBonus; } Caster.MovingParticles(mobile, 0x36D4, 5, 0, false, true, spellHue, 0, 9501, 1, 0, 0x100); Caster.MovingParticles(mobile, 0x36D4, 9, 0, false, true, spellHue, 0, 9501, 1, 0, 0x100); } else { Caster.MovingParticles(mobile, 0x36D4, 7, 0, false, true, spellHue, 0, 9501, 1, 0, 0x100); } BaseCreature bc_Target = mobile as BaseCreature; PlayerMobile pm_Target = mobile as PlayerMobile; if (bc_Target != null) { if (bc_Target.ShipOccupied != null) { damage *= BaseShip.shipBasedAoESpellDamageToCreatureScalar; } } if (pm_Target != null) { if (pm_Target.ShipOccupied != null) { damage *= BaseShip.shipBasedAoESpellDamageToPlayerScalar; } } damage *= GetDamageScalar(mobile, damageBonus); SpellHelper.Damage(this, Caster, mobile, damage); } } ArenaFight.SpellCompletion(Caster, typeof(MeteorSwarmSpell)); FinishSequence(); }
public override void OnCast() { if (SpellHelper.CheckTown(Caster, Caster) && CheckSequence()) { List <Mobile> targets = new List <Mobile>(); Map map = Caster.Map; //Player Enhancement Customization: Tremor bool tremor = false; //PlayerEnhancementPersistance.IsCustomizationEntryActive(Caster, CustomizationType.Tremors); bool enhancedSpellcast = SpellHelper.IsEnhancedSpell(Caster, null, EnhancedSpellbookType.Wizard, false, true); Boolean chargedSpellcast = SpellHelper.IsChargedSpell(Caster, null, false, Scroll != null); int range = 1 + (int)(Caster.Skills[SkillName.Magery].Value / 15.0); bool useHeightCheck = true; int maxDifferenceZ = 20; if (map != null) { foreach (Mobile m in Caster.GetMobilesInRange(range)) { int differenceZ = Math.Abs(Caster.Location.Z - m.Location.Z); if (useHeightCheck && (differenceZ >= maxDifferenceZ)) { continue; } if (Caster != m && SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false) && (!Core.AOS || Caster.InLOS(m))) { targets.Add(m); } } } Caster.PlaySound(0x2f3); int baseDamage = Utility.RandomMinMax(20, 25); for (int i = 0; i < targets.Count; ++i) { Mobile mobile = targets[i]; double damage = (double)Utility.RandomMinMax(5, 10); double damageBonus = 0; CheckMagicResist(mobile); if (mobile is PlayerMobile) { damage = (double)mobile.Hits * .6; } else { Boolean isTamedTarget = SpellHelper.IsTamedTarget(Caster, mobile); if (enhancedSpellcast) { if (isTamedTarget) { damageBonus += SpellHelper.EnhancedSpellTamedCreatureBonus; } else { damageBonus += SpellHelper.EnhancedSpellBonus; } } if (chargedSpellcast) { if (isTamedTarget) { damageBonus += SpellHelper.ChargedSpellTamedCreatureBonus; } else { damageBonus += SpellHelper.ChargedSpellBonus; } } mobile.FixedEffect(0x3779, 10, 20); BaseCreature bc_Target = mobile as BaseCreature; PlayerMobile pm_Target = mobile as PlayerMobile; if (bc_Target != null) { if (bc_Target.ShipOccupied != null) { damage *= BaseShip.shipBasedAoESpellDamageToCreatureScalar; } } if (pm_Target != null) { if (pm_Target.ShipOccupied != null) { damage *= BaseShip.shipBasedAoESpellDamageToPlayerScalar; } } damage *= GetDamageScalar(mobile, damageBonus); } Caster.DoHarmful(mobile); SpellHelper.Damage(this, Caster, mobile, damage); } if (tremor) { CustomizationAbilities.Tremor(Caster, range); } } ArenaFight.SpellCompletion(Caster, typeof(EarthquakeSpell)); FinishSequence(); }