protected override void OnTarget( Mobile from, object targeted ) { if ( m_Potion.Deleted || m_Potion.Map == Map.Internal ) return; IPoint3D p = targeted as IPoint3D; if ( p == null ) return; Map map = from.Map; if ( map == null ) return; SpellHelper.GetSurfaceTop( ref p ); from.RevealingAction(); IEntity to = new DummyEntity( Serial.Zero, new Point3D( p ), map ); Effects.SendMovingEffect( from, to, m_Potion.ItemID, 7, 0, false, false, m_Potion.Hue, 0 ); Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( ExplodingTarPotionEffect_Callback ), new object[] { p, from, map } ); m_Potion.SetNextDrinkTime( from ); }
protected override void OnTarget( Mobile from, object targeted ) { if ( m_Potion.Deleted || m_Potion.Map == Map.Internal ) return; IPoint3D p = targeted as IPoint3D; if ( p == null ) return; Map map = from.Map; if ( map == null ) return; SpellHelper.GetSurfaceTop( ref p ); from.RevealingAction(); IEntity to; if ( p is Mobile ) { to = (Mobile) p; p = to.Location; } else to = new DummyEntity( Serial.Zero, new Point3D( p ), map ); Effects.SendMovingEffect( from, to, m_Potion.ItemID, 7, 0, false, false, m_Potion.Hue, 0 ); m_Potion.Consume(); Effects.PlaySound( p, map, 0x20C ); int damageMin, damageMax; m_Potion.ComputeDamage( from, out damageMin, out damageMax ); Timer.DelayCall( TimeSpan.FromSeconds( 1.5 ), () => { for ( int i = -2; i <= 2; i++ ) { for ( int j = -2; j <= 2; j++ ) { Point3D point = new Point3D( p.X + i, p.Y + j, p.Z ); if ( map.CanFit( point, 12, true, false ) && from.InLOS( point ) ) new InternalItem( from, point, map, damageMin, damageMax ); } } } ); m_Potion.SetNextDrinkTime( from ); }
public static void RemoveCurses( Mobile m ) { // play the sound m.PlaySound( 0xF6 ); m.PlaySound( 0x1F7 ); // do the effects m.FixedParticles( 0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head ); IEntity from = new DummyEntity( Serial.Zero, new Point3D( m.X, m.Y, m.Z - 10 ), m.Map ); IEntity to = new DummyEntity( Serial.Zero, new Point3D( m.X, m.Y, m.Z + 50 ), m.Map ); Effects.SendMovingParticles( from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100 ); // remove stat mods StatMod mod; foreach ( string statModName in StatModNames ) { mod = m.GetStatMod( statModName ); if ( mod != null && mod.Offset < 0 ) m.RemoveStatMod( statModName ); } m.Paralyzed = false; EvilOmenSpell.CheckEffect( m ); StrangleSpell.RemoveCurse( m ); CorpseSkinSpell.RemoveCurse( m ); CurseSpell.RemoveEffect( m ); MortalStrike.EndWound( m ); BloodOathSpell.EndEffect( m ); SpellPlagueSpell.RemoveEffect( m ); SleepSpell.RemoveEffect( m ); MindRotSpell.ClearMindRotScalar( m ); BuffInfo.RemoveBuff( m, BuffIcon.Clumsy ); BuffInfo.RemoveBuff( m, BuffIcon.FeebleMind ); BuffInfo.RemoveBuff( m, BuffIcon.Weaken ); BuffInfo.RemoveBuff( m, BuffIcon.MassCurse ); BuffInfo.RemoveBuff( m, BuffIcon.Curse ); BuffInfo.RemoveBuff( m, BuffIcon.EvilOmen ); BuffInfo.RemoveBuff( m, BuffIcon.MortalStrike ); BuffInfo.RemoveBuff( m, BuffIcon.Sleep ); BuffInfo.RemoveBuff( m, BuffIcon.MassSleep ); BuffInfo.RemoveBuff( m, BuffIcon.Mindrot ); }
protected override void OnTarget( Mobile from, object targeted ) { if ( m_Bomb.Deleted || m_Bomb.Map == Map.Internal ) { return; } IPoint3D p = targeted as IPoint3D; if ( p == null ) { return; } Map map = from.Map; if ( map == null ) { return; } SpellHelper.GetSurfaceTop( ref p ); from.RevealingAction(); IEntity to; if ( p is Mobile ) { to = (Mobile) p; } else { to = new DummyEntity( Serial.Zero, new Point3D( p ), map ); } Effects.SendMovingEffect( from, to, m_Bomb.ItemID, 7, 0, false, false, m_Bomb.Hue, 0 ); m_Bomb.Internalize(); Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( m_Bomb.Reposition_OnTick ), new object[] { from, p, map } ); }
protected override void OnTarget( Mobile from, object targeted ) { if ( m_Potion.Deleted || m_Potion.Map == Map.Internal ) return; IPoint3D p = targeted as IPoint3D; if ( p == null ) return; Map map = from.Map; if ( map == null ) return; SpellHelper.GetSurfaceTop( ref p ); from.RevealingAction(); if ( p is Mobile ) p = new Point3D( ( (Mobile) p ).X, ( (Mobile) p ).Y, ( (Mobile) p ).Z ); IEntity to; to = new DummyEntity( Serial.Zero, new Point3D( p ), map ); Effects.SendMovingEffect( from, to, m_Potion.ItemID, 7, 0, false, false, m_Potion.Hue, 0 ); if ( m_Potion.Amount > 1 ) Mobile.LiftItemDupe( m_Potion, 1 ); m_Potion.Stackable = false; m_Potion.Internalize(); Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( m_Potion.Reposition_OnTick ), new object[] { from, p, map } ); }
public void Target( Mobile targeted ) { if ( !Caster.CanSee( targeted ) ) { Caster.SendLocalizedMessage( 500237 ); // Target can not be seen. } else if ( CheckBSequence( targeted ) ) { SpellHelper.Turn( Caster, targeted ); /* Soothing winds attempt to neutralize poisons, lift curses, and heal a valid * Target. The Caster's Mysticism and either Focus or Imbuing (whichever is * greater) skills determine the effectiveness of the Cleansing Winds. */ targeted.PlaySound( 0x64C ); List<Mobile> targets = new List<Mobile>(); targets.Add( targeted ); Map map = targeted.Map; if ( map != null ) { var eable = map.GetMobilesInRange( targeted.Location, 2 ); foreach ( Mobile m in eable ) { if ( targets.Count >= 3 ) break; if ( targeted != m && IsValidTarget( m ) ) targets.Add( m ); } } int baseToHeal = (int) ( ( GetBaseSkill( Caster ) + GetBoostSkill( Caster ) ) / 4.0 ) + Utility.RandomMinMax( -3, 3 ); baseToHeal /= targets.Count; for ( int i = 0; i < targets.Count; ++i ) { Mobile m = targets[i]; Caster.DoBeneficial( m ); m.FixedParticles( 0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head ); IEntity from = new DummyEntity( Serial.Zero, new Point3D( m.X, m.Y, m.Z - 10 ), Caster.Map ); IEntity to = new DummyEntity( Serial.Zero, new Point3D( m.X, m.Y, m.Z + 50 ), Caster.Map ); Effects.SendMovingParticles( from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100 ); Poison poison = m.Poison; int toHeal = baseToHeal; bool canHeal = true; if ( MortalStrike.IsWounded( m ) ) { // Cleansing Winds will not heal the target after removing mortal wound. canHeal = false; } // Each Curse reduces healing by 3 points + 1% per curse level. int cursePower = EnchantedApple.GetCursePower( m ); toHeal -= cursePower * 3; toHeal -= (int) ( toHeal * cursePower * 0.01 ); // Curse removal no longer based on chance. RemoveCurses( m ); if ( poison != null ) { int chanceBonus = (int) ( ( GetBaseSkill( Caster ) + GetBoostSkill( Caster ) ) * 37.5 ); int cureChance = 10000 + chanceBonus - ( ( poison.Level + 1 ) * 3500 ); if ( cureChance > Utility.Random( 10000 ) ) { m.CurePoison( Caster ); // Poison reduces healing factor by 15% per level of poison. toHeal -= (int) ( toHeal * ( poison.Level + 1 ) * 0.15 ); } else { // If the cure fails, the target will not be healed. canHeal = false; } } if ( canHeal ) m.Heal( toHeal, Caster ); } } FinishSequence(); }
protected override void OnTarget( Mobile from, object targeted ) { if ( m_Potion.Deleted || m_Potion.Map == Map.Internal ) return; IPoint3D p = targeted as IPoint3D; if ( p == null ) return; Map map = from.Map; if ( map == null ) return; SpellHelper.GetSurfaceTop( ref p ); from.RevealingAction(); IEntity to; if ( p is Mobile ) to = (Mobile) p; else to = new DummyEntity( Serial.Zero, new Point3D( p ), map ); Effects.SendMovingEffect( from, to, m_Potion.ItemID, 7, 0, false, false, m_Potion.Hue, 0 ); Effects.SendLocationParticles( EffectItem.Create( new Point3D( p.X, p.Y, p.Z ), from.Map, EffectItem.DefaultDuration ), 0x376A, 9, 4, 0, 0, 0x13AE, 0 ); int length = 0; switch ( m_Potion.AreaSize ) { case 1: length = 3; break; case 2: length = 15; break; case 3: length = 31; break; case 4: length = 55; break; case 5: length = 83; break; case 6: length = 123; break; case 7: length = 163; break; } for ( int i = 0; i <= length; ++i ) { OffsetEntry oe = Offsets[i] as OffsetEntry; Effects.SendLocationParticles( EffectItem.Create( new Point3D( p.X + oe.X, p.Y + oe.Y, p.Z ), from.Map, EffectItem.DefaultDuration ), 0x376A, 9, 4, 0, 0, 0x13AE, 0 ); } var eable = from.Map.GetMobilesInRange( new Point3D( p.X, p.Y, p.Z ), m_Potion.AreaSize ); foreach ( object obj in eable ) { if ( obj is BaseCreature ) { BaseCreature m = obj as BaseCreature; if ( m != null && !m.Controlled ) { m.Frozen = true; InternalTimer timer = new InternalTimer( new Point3D( p.X, p.Y, p.Z ), m_Potion.AreaSize, from ); timer.Start(); } } } m_Potion.SetNextDrinkTime( from ); m_Potion.Consume(); }