Fixes code according to modern code style. Fixes a few expression bugs.
This commit is contained in:
parent
89eea25e5f
commit
970fd563b2
3324 changed files with 441118 additions and 433755 deletions
|
|
@ -1,77 +1,79 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
using Server.Spells;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Ethics.Hero
|
||||
{
|
||||
public sealed class Bless : Power
|
||||
{
|
||||
public Bless()
|
||||
{
|
||||
m_Definition = new PowerDefinition(
|
||||
15,
|
||||
"Bless",
|
||||
"Erstok Ontawl",
|
||||
""
|
||||
);
|
||||
}
|
||||
public sealed class Bless : Power
|
||||
{
|
||||
public Bless()
|
||||
{
|
||||
m_Definition = new PowerDefinition(
|
||||
15,
|
||||
"Bless",
|
||||
"Erstok Ontawl",
|
||||
""
|
||||
);
|
||||
}
|
||||
|
||||
public override void BeginInvoke( Player from )
|
||||
{
|
||||
from.Mobile.BeginTarget( 12, true, Targeting.TargetFlags.None, new TargetStateCallback( Power_OnTarget ), from );
|
||||
from.Mobile.SendMessage( "Where do you wish to bless?" );
|
||||
}
|
||||
public override void BeginInvoke(Player from)
|
||||
{
|
||||
from.Mobile.BeginTarget(12, true, TargetFlags.None, new TargetStateCallback(Power_OnTarget), from);
|
||||
from.Mobile.SendMessage("Where do you wish to bless?");
|
||||
}
|
||||
|
||||
private void Power_OnTarget( Mobile fromMobile, object obj, object state )
|
||||
{
|
||||
if (!(state is Player from))
|
||||
return;
|
||||
private void Power_OnTarget(Mobile fromMobile, object obj, object state)
|
||||
{
|
||||
if (!(state is Player from))
|
||||
return;
|
||||
|
||||
if ( !(obj is IPoint3D p) )
|
||||
return;
|
||||
if (!(obj is IPoint3D p))
|
||||
return;
|
||||
|
||||
if ( !CheckInvoke( from ) )
|
||||
return;
|
||||
if (!CheckInvoke(from))
|
||||
return;
|
||||
|
||||
bool powerFunctioned = false;
|
||||
bool powerFunctioned = false;
|
||||
|
||||
SpellHelper.GetSurfaceTop( ref p );
|
||||
SpellHelper.GetSurfaceTop(ref p);
|
||||
|
||||
foreach ( Mobile mob in from.Mobile.GetMobilesInRange( 6 ) )
|
||||
{
|
||||
if ( mob != from.Mobile && SpellHelper.ValidIndirectTarget( from.Mobile, mob ) )
|
||||
continue;
|
||||
foreach (Mobile mob in from.Mobile.GetMobilesInRange(6))
|
||||
{
|
||||
if (mob != from.Mobile && SpellHelper.ValidIndirectTarget(from.Mobile, mob))
|
||||
continue;
|
||||
|
||||
if ( mob.GetStatMod( "Holy Bless" ) != null )
|
||||
continue;
|
||||
if (mob.GetStatMod("Holy Bless") != null)
|
||||
continue;
|
||||
|
||||
if ( !from.Mobile.CanBeBeneficial( mob, false ) )
|
||||
continue;
|
||||
if (!from.Mobile.CanBeBeneficial(mob, false))
|
||||
continue;
|
||||
|
||||
from.Mobile.DoBeneficial( mob );
|
||||
from.Mobile.DoBeneficial(mob);
|
||||
|
||||
mob.AddStatMod( new StatMod( StatType.All, "Holy Bless", 10, TimeSpan.FromMinutes( 30.0 ) ) );
|
||||
mob.AddStatMod(new StatMod(StatType.All, "Holy Bless", 10, TimeSpan.FromMinutes(30.0)));
|
||||
|
||||
mob.FixedParticles( 0x373A, 10, 15, 5018, EffectLayer.Waist );
|
||||
mob.PlaySound( 0x1EA );
|
||||
mob.FixedParticles(0x373A, 10, 15, 5018, EffectLayer.Waist);
|
||||
mob.PlaySound(0x1EA);
|
||||
|
||||
powerFunctioned = true;
|
||||
}
|
||||
powerFunctioned = true;
|
||||
}
|
||||
|
||||
if ( powerFunctioned )
|
||||
{
|
||||
SpellHelper.Turn( from.Mobile, p );
|
||||
if (powerFunctioned)
|
||||
{
|
||||
SpellHelper.Turn(from.Mobile, p);
|
||||
|
||||
Effects.PlaySound( p, from.Mobile.Map, 0x299 );
|
||||
Effects.PlaySound(p, from.Mobile.Map, 0x299);
|
||||
|
||||
from.Mobile.LocalOverheadMessage( Network.MessageType.Regular, 0x3B2, false, "You consecrate the area." );
|
||||
from.Mobile.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "You consecrate the area.");
|
||||
|
||||
FinishInvoke( from );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.Mobile.FixedEffect( 0x3735, 6, 30 );
|
||||
from.Mobile.PlaySound( 0x5C );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
FinishInvoke(from);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.Mobile.FixedEffect(0x3735, 6, 30);
|
||||
from.Mobile.PlaySound(0x5C);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue