public void Target(IPoint3D p) { Map map = Caster.Map; SpellHelper.GetSurfaceTop(ref p); if (map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z) || BaseShip.FindShipAt(p, map) != null) { Caster.SendLocalizedMessage(501942); // That location is blocked. } else if (SpellHelper.CheckTown(p, Caster) && CheckSequence()) { bool enhancedSpellcast = SpellHelper.IsEnhancedSpell(Caster, null, EnhancedSpellbookType.Summoner, false, true); BaseCreature summon = new EnergyVortex(); summon.StoreBaseSummonValues(); double duration = 2.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.EnergyVortex); summon.Hue = spellHue; BaseCreature.Summon(summon, false, Caster, new Point3D(p), 0x212, TimeSpan.FromSeconds(duration)); } FinishSequence(); }
public override void OnEnter(Mobile m) { if (!Controller.InUse) { return; } if (m is EnergyVortex) { EnergyVortex ev = (EnergyVortex)m; Controller.EVsAndBSsAdd(ev); } else if (m is BladeSpirits) { BladeSpirits bs = (BladeSpirits)m; Controller.EVsAndBSsAdd(bs); } m.Delta(MobileDelta.Noto); m.InvalidateProperties(); }
// // carry out the special attacks // // If you add a new attack, you must add the code here to define what it actually does when it hits // public void DoSpecialAttack(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven, SpecialAttack special) { if (attacker == null || defender == null || weapon == null || special == null) { return; } attacker.SendMessage("you strike with {0}!", special.Name); // apply the special attack switch (special.AttackID) { case SpecialAttacks.TripleSlash: { defender.Damage(weapon.MaxDamage * 3, attacker); break; } case SpecialAttacks.MindDrain: { defender.Mana -= weapon.MaxDamage; attacker.Mana += weapon.MaxDamage; break; } case SpecialAttacks.VortexStrike: { attacker.PlaySound(0x217); BaseCreature m = new EnergyVortex(); m.Summoned = true; m.SummonMaster = attacker; m.Combatant = defender; m.MoveToWorld(defender.Location, defender.Map); break; } case SpecialAttacks.StamDrain: { defender.Stam -= weapon.MaxDamage; attacker.Stam += weapon.MaxDamage; break; } case SpecialAttacks.PuffOfSmoke: { attacker.Hidden = true; break; } case SpecialAttacks.GiftOfHealth: { attacker.FixedEffect(0x376A, 9, 32); attacker.PlaySound(0x202); attacker.Hits = attacker.HitsMax; break; } case SpecialAttacks.ParalyzingFear: { // lose target focus defender.Combatant = null; // flee if (defender is BaseCreature) { ((BaseCreature)defender).BeginFlee(TimeSpan.FromSeconds(6)); } // and become paralyzed defender.Freeze(TimeSpan.FromSeconds(3)); defender.FixedEffect(0x376A, 9, 32); defender.PlaySound(0x204); break; } default: attacker.SendMessage("no effect"); break; } }
public void Target(IPoint3D p) { Map map = Caster.Map; SpellHelper.GetSurfaceTop(ref p); if (map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z) || BaseBoat.FindBoatAt(p, map) != null) { Caster.SendLocalizedMessage(501942); // That location is blocked. } else if (SpellHelper.CheckTown(p, Caster) && CheckSequence()) { // Here's a little Napoleon Dynamite easter egg for IPY! if (Utility.RandomDouble() < 0.005) //if ( true ) { EnergyVortex tina = new EnergyVortex(); Slime ham = new Slime(); tina.Name = "Tina"; tina.Body = 0xDC; tina.Hue = 0; tina.Frozen = true; ham.Name = "Ham"; ham.Hue = 0x76; ham.Frozen = true; bool validLocation = false; Point3D tinaLocation = new Point3D(p.X, p.Y, p.Z); Point3D hamLocation = new Point3D(); // Find a suitable location for Ham to spawn. for (int j = 0; !validLocation && j < 10; ++j) { int x = tinaLocation.X + 1; int y = tinaLocation.Y + 1; int z = map.GetAverageZ(x, y); if (validLocation = map.CanFit(x, y, tinaLocation.Z, 16, false, false)) { hamLocation = new Point3D(x, y, tinaLocation.Z); } else if (validLocation = map.CanFit(x, y, z, 16, false, false)) { hamLocation = new Point3D(x, y, z); } } BaseCreature.Summon(tina, false, Caster, tinaLocation, 0x212, TimeSpan.FromSeconds(10.0)); BaseCreature.Summon(ham, false, Caster, hamLocation, 0, TimeSpan.FromSeconds(10.0)); List <Mobile> mobs = new List <Mobile>(); mobs.Add(tina); mobs.Add(ham); // Wait 5 seconds, then make Tina talk. Timer.DelayCall(TimeSpan.FromSeconds(5.0), new TimerStateCallback(BeginAction), mobs); // Wait 8 seconds, then make Tina and Ham recall. Timer.DelayCall(TimeSpan.FromSeconds(8.0), new TimerStateCallback(EndAction), mobs); } else { bool enhancedSpellcast = SpellHelper.IsEnhancedSpell(Caster, null, EnhancedSpellbookType.Summoner, false, true); BaseCreature summon = new EnergyVortex(); summon.StoreBaseSummonValues(); double duration = 2.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 = PlayerEnhancementPersistance.GetSpellHueFor(Caster, HueableSpell.EnergyVortex); summon.Hue = spellHue; BaseCreature.Summon(summon, false, Caster, new Point3D(p), 0x212, TimeSpan.FromSeconds(duration)); } } FinishSequence(); }