本文整理汇总了C#中Server.Mobile.DoBeneficial方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.DoBeneficial方法的具体用法?C# Mobile.DoBeneficial怎么用?C# Mobile.DoBeneficial使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobile
的用法示例。
在下文中一共展示了Mobile.DoBeneficial方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoEffect
public override bool DoEffect( Mobile from, Mobile target )
{
if ( !SpellHelper.HasStatEffect( from, m_Stat ) && from.InLOS( target ) && target.Alive && from.CanBeBeneficial( target ) )
{
from.DoBeneficial( target );
SpellHelper.Turn( from, target );
if ( m_Stat != StatType.All )
{
SpellHelper.AddStatBonus( null, target, m_Stat );
}
else
{
SpellHelper.AddStatBonus( null, target, StatType.Str ); SpellHelper.DisableSkillCheck = true;
SpellHelper.AddStatBonus( null, target, StatType.Dex );
SpellHelper.AddStatBonus( null, target, StatType.Int ); SpellHelper.DisableSkillCheck = false;
}
target.FixedParticles( m_EffIID, m_EffSpd, m_Dur, m_Eff, m_ELayer );
target.PlaySound( m_Snd );
return true;
}
else
{
return false;
}
}
示例2: BeginHeal
public static BandageContext BeginHeal( Mobile healer, Mobile patient )
{
bool isDeadPet = ( patient is BaseCreature && ((BaseCreature)patient).IsDeadPet );
if ( patient is Golem )
{
healer.SendLocalizedMessage( 500970 ); // Bandages cannot be used on that.
}
else if ( patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead )
{
healer.SendLocalizedMessage( 500951 ); // You cannot heal that.
}
else if ( !patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding( patient ) && !isDeadPet )
{
healer.SendLocalizedMessage( 500955 ); // That being is not damaged!
}
else if ( !patient.Alive && (patient.Map == null || !patient.Map.CanFit( patient.Location, 16, false, false )) )
{
healer.SendLocalizedMessage( 501042 ); // Target cannot be resurrected at that location.
}
else if ( healer.CanBeBeneficial( patient, true, true ) )
{
healer.DoBeneficial( patient );
bool onSelf = ( healer == patient );
int dex = healer.Dex;
double seconds;
double resDelay = ( patient.Alive ? 0.0 : 5.0 );
if ( onSelf )
{
if ( Core.AOS )
seconds = 5.0 + (0.5 * ((double)(120 - dex) / 10)); // TODO: Verify algorithm
else
seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10));
}
else
{
if ( Core.AOS && GetPrimarySkill( patient ) == SkillName.Veterinary )
{
seconds = 2.0;
}
else if ( Core.AOS )
{
if (dex < 204)
{
seconds = 3.2-(Math.Sin((double)dex/130)*2.5) + resDelay;
}
else
{
seconds = 0.7 + resDelay;
}
}
else
{
if ( dex >= 100 )
seconds = 3.0 + resDelay;
else if ( dex >= 40 )
seconds = 4.0 + resDelay;
else
seconds = 5.0 + resDelay;
}
}
BandageContext context = GetContext( healer );
if ( context != null )
context.StopHeal();
seconds *= 1000;
context = new BandageContext( healer, patient, TimeSpan.FromMilliseconds( seconds ) );
m_Table[healer] = context;
if ( !onSelf )
patient.SendLocalizedMessage( 1008078, false, healer.Name ); // : Attempting to heal you.
healer.SendLocalizedMessage( 500956 ); // You begin applying the bandages.
return context;
}
return null;
}
示例3: BeginHeal
public static BandageContext BeginHeal( Mobile healer, Mobile patient )
{
bool isDeadPet = ( patient is BaseCreature && ((BaseCreature)patient).IsDeadPet );
if ( patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead )
{
healer.SendLocalizedMessage( 500951 ); // You cannot heal that.
}
else if ( !patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding( patient ) && !isDeadPet )
{
healer.SendLocalizedMessage( 500955 ); // That being is not damaged!
}
else if ( !patient.Alive && (patient.Map == null || !patient.Map.CanFit( patient.Location, 16, false, false )) )
{
healer.SendLocalizedMessage( 501042 ); // Target cannot be resurrected at that location.
}
else if ( healer.CanBeBeneficial( patient, true, true ) )
{
healer.DoBeneficial( patient );
bool onSelf = ( healer == patient );
int dex = healer.Dex;
double seconds;
double resDelay = ( patient.Alive ? 0.0 : 5.0 );
if ( onSelf )
{
if ( Core.AOS )
seconds = 4.55 + (0.1 * ((double)(0 - dex) / 10)); // TODO: Verify algorithm
else
seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10));
}
else
{
if ( Core.AOS && GetPrimarySkill( patient ) == SkillName.Veterinary )
{
//if ( dex >= 40 )
seconds = 2.0;
//else
// seconds = 3.0;
}
else
{
if ( dex >= 100 )
seconds = 2.0 + resDelay;
else if ( dex >= 40 )
seconds = 3.0 + resDelay;
else
seconds = 4.0 + resDelay;
}
}
if( seconds < 2.0 )
seconds = 2.0;
BandageContext context = GetContext( healer );
if ( context != null )
context.StopHeal();
CombatSystemAttachment csa = CombatSystemAttachment.GetCSA(healer);
csa.Interrupted(true);
if (healer is PlayerMobile)
((PlayerMobile)healer).ClearHands(true);
else
healer.ClearHands();
context = new BandageContext( healer, patient, TimeSpan.FromSeconds( seconds ) );
m_Table[healer] = context;
if ( !onSelf )
patient.SendLocalizedMessage( 1008078, false, healer.Name ); // : Attempting to heal you.
healer.SendLocalizedMessage( 500956 ); // You begin applying the bandages.
return context;
}
return null;
}
示例4: BeginHeal
public static BandageContext BeginHeal( Mobile healer, Mobile patient )
{
bool isDeadPet = ( patient is BaseCreature && ((BaseCreature)patient).IsDeadPet );
if ( patient is Golem )
{
healer.SendLocalizedMessage( 500970 ); // Bandages cannot be used on that.
}
else if ( patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead )
{
healer.SendLocalizedMessage( 500951 ); // You cannot heal that.
}
else if ( !patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding( patient ) && !isDeadPet )
{
healer.SendAsciiMessage("That being is not damaged!");
//healer.SendLocalizedMessage( 500955 ); // That being is not damaged!
}
else if ( !patient.Alive && (patient.Map == null || !patient.Map.CanFit( patient.Location, 16, false, false )) )
{
healer.SendAsciiMessage("Target cannot be resurrected at that location.");
//healer.SendLocalizedMessage( 501042 ); // Target cannot be resurrected at that location.
}
else if ( healer.CanBeBeneficial( patient, true, true ) )
{
healer.DoBeneficial( patient );
bool onSelf = ( healer == patient );
int dex = healer.Dex;
double seconds;
double resDelay = ( patient.Alive ? 0.0 : 5.0 );
if ( onSelf )
{
if ( Core.AOS )
seconds = 5.0 + (0.5 * ((double)(120 - dex) / 10)); // TODO: Verify algorithm
else
seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10));
}
else
{
if ( Core.AOS && GetPrimarySkill( patient ) == SkillName.Veterinary )
{
//if ( dex >= 40 )
seconds = 2.0;
//else
// seconds = 3.0;
}
else
{
if ( dex >= 100 )
seconds = 3.0 + resDelay;
else if ( dex >= 40 )
seconds = 4.0 + resDelay;
else
seconds = 5.0 + resDelay;
}
}
BandageContext context = GetContext( healer );
if ( context != null )
context.StopHeal();
if ((patient.LastHealTime + TimeSpan.FromMinutes(3.0)) < DateTime.Now)
{
patient.LastHealTime = DateTime.Now;
context = new BandageContext(healer, patient, TimeSpan.FromSeconds( /*seconds*/ 0.0));
}
else
healer.SendAsciiMessage("This being cannot be newly bandaged yet.");
m_Table[healer] = context;
/*if ( !onSelf )
patient.SendAsciiMessage(String.Format("{0} : Attempting to heal you.", healer.Name));*/
//patient.SendLocalizedMessage( 1008078, false, healer.Name ); // : Attempting to heal you.
//healer.SendAsciiMessage("You begin applying the bandages.");
//healer.SendLocalizedMessage( 500956 ); // You begin applying the bandages.
return context;
}
return null;
}
示例5: BeginHeal
public static BandageContext BeginHeal( Mobile healer, Mobile patient, Bandage bandage )
{
bool isDeadPet = ( patient is BaseCreature && ( (BaseCreature) patient ).IsDeadPet );
if ( patient is BaseCreature && ( (BaseCreature) patient ).IsGolem )
{
// Bandages cannot be used on that.
healer.SendLocalizedMessage( 500970 );
}
else if ( patient is BaseCreature && ( (BaseCreature) patient ).IsAnimatedDead )
{
// You cannot heal that.
healer.SendLocalizedMessage( 500951 );
}
else if ( !patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding( patient ) && !isDeadPet )
{
// That being is not damaged!
healer.SendLocalizedMessage( 500955 );
}
else if ( !patient.Alive && ( patient.Map == null || !patient.Map.CanFit( patient.Location, 16, false, false ) ) )
{
// Target cannot be resurrected at that location.
healer.SendLocalizedMessage( 501042 );
}
else if ( healer.CanBeBeneficial( patient, true, true ) )
{
healer.DoBeneficial( patient );
bool onSelf = ( healer == patient );
int dex = healer.Dex;
double seconds;
double resDelay = ( patient.Alive ? 0.0 : 5.0 );
if ( onSelf )
{
seconds = 5 + ( 0.5 * ( (double) ( 120 - dex ) / 10 ) ); // TODO: Verify algorithm
}
else
{
if ( GetPrimarySkill( patient, healer ) == SkillName.Veterinary )
seconds = 2;
else
seconds = 4 - ( (double) ( dex / 60 ) ) + resDelay;
}
if ( seconds < 1 )
seconds = 1;
if ( seconds > 8 )
seconds = 8;
BandageContext context = GetContext( healer );
if ( context != null )
context.RefreshTimer( TimeSpan.FromSeconds( seconds ) );
else
m_Table[healer] = context = new BandageContext( healer, patient, TimeSpan.FromSeconds( seconds ), bandage );
if ( !onSelf )
patient.SendLocalizedMessage( 1008078, false, healer.Name ); // : Attempting to heal you.
if ( healer.Client != null )
healer.Client.Send( new CooldownInfo( bandage, (int) seconds ) );
BuffInfo.AddBuff( healer, new BuffInfo( BuffIcon.Healing, 1151311, 1151400, TimeSpan.FromSeconds( seconds ), healer, patient.Name ) );
healer.SendLocalizedMessage( 500956 ); // You begin applying the bandages.
return context;
}
return null;
}
示例6: BeginHeal
public static BandageContext BeginHeal( Mobile healer, Mobile patient )
{
bool isDeadPet = ( patient is BaseCreature && ((BaseCreature)patient).IsDeadPet );
if ( patient is Golem )
{
healer.SendLocalizedMessage( 500970 ); // Bandages cannot be used on that.
}
else if ( patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead )
{
healer.SendLocalizedMessage( 500951 ); // You cannot heal that.
}
else if ( !patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding( patient ) && !isDeadPet )
{
healer.SendLocalizedMessage( 500955 ); // That being is not damaged!
}
else if ( !patient.Alive && (patient.Map == null || !patient.Map.CanFit( patient.Location, 16, false, false )) )
{
healer.SendLocalizedMessage( 501042 ); // Target cannot be resurrected at that location.
}
else if ( healer.CanBeBeneficial( patient, true, true ) )
{
healer.DoBeneficial( patient );
bool onSelf = ( healer == patient );
int dex = healer.Dex;
//double seconds;
double seconds = patient.Alive ? (patient.Poisoned ? 6.0 : 5.0) : 10.0;
double resDelay = ( patient.Alive ? 0.0 : 5.0 );
if ( onSelf )
{
if (Core.AOS)
seconds = 5.0 + (0.5 * ((double)(120 - dex) / 10)); // TODO: Verify algorithm
else//was: seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10));
{
seconds *= 3;
if (healer.Skills[SkillName.Healing].Value > 90)
seconds -= 3.0 * ((healer.Skills[SkillName.Healing].Value - 90.0) / 10.0);
}
}
/*else
{
if ( Core.AOS && GetPrimarySkill( patient ) == SkillName.Veterinary )
{
//if ( dex >= 40 )
seconds = 2.0;
//else
// seconds = 3.0;
}
else
{
if ( dex >= 100 )
seconds = 3.0 + resDelay;
else if ( dex >= 40 )
seconds = 4.0 + resDelay;
else
seconds = 5.0 + resDelay;
}
}*/
// according to stratics:
// dex | heal self | heal other | cure self | cure other
// 100 | 11s | 3s | 13 | 4
seconds *= 0.74 + ((double)(100 - dex) / 75) * 0.26;
BandageContext context = GetContext( healer );
if ( context != null )
context.StopHeal();
context = new BandageContext( healer, patient, TimeSpan.FromSeconds( seconds ) );
m_Table[healer] = context;
if ( !onSelf )
patient.SendLocalizedMessage( 1008078, false, healer.Name ); // : Attempting to heal you.
healer.SendLocalizedMessage( 500956 ); // You begin applying the bandages.
return context;
}
return null;
}
示例7: OnTarget
public void OnTarget( Mobile from, object targeted )
{
if ( this.Deleted || this.Amount <= 0 )
return;
Mobile targ = targeted as Mobile;
if ( from.NextSkillTime > DateTime.Now )
{
from.SendSkillMessage(); // You must wait...
}
else if ( targ == null || targ.Deleted || !targ.Alive || !( targ.Body.IsHuman || targ.Body.IsAnimal || targ.Body.IsSea || (targ is BaseCreature && ((BaseCreature)targ).Controled && !((BaseCreature)targ).Summoned) ) )
{
// you can heal anything tamable... I guess.
from.SendLocalizedMessage( 500951 ); // You cannot heal that.
}
else if ( !from.InRange( targ, 3 ) )
{
from.SendLocalizedMessage( 500295 ); // You are too far away to do that.
}
else if ( Notoriety.Compute( from, targ ) == Notoriety.Enemy ) // || Server.Misc.NotorietyHandlers.CheckAggressor( from.Aggressors, targ ) || Server.Misc.NotorietyHandlers.CheckAggressed( from.Aggressed, targ ) )
{
from.SendAsciiMessage( "You cannot heal them right now." );
}
else if ( !from.CanSee( targ ) || !from.InLOS( targ ) )
{
from.SendAsciiMessage( "You can't see that." );
}
else if ( targ.Hits >= targ.HitsMax )
{
from.SendLocalizedMessage( 500955 ); // That being is not damaged!
}
else if ( !targ.CanBeginAction( typeof( Bandage ) ) || !from.CanBeBeneficial( targ, true, true ) )
{
from.SendAsciiMessage( "This being cannot be newly bandaged yet." );
}
else
{
from.DoBeneficial( targ );
from.RevealingAction();
this.Consume();
int damage = targ.HitsMax - targ.Hits;
int sk = damage * 100 / targ.HitsMax;
int healed = 1;
SkillName skill = GetSkillFor( targ );
if ( from.CheckSkill( skill, sk - 25.0, sk + 25.0 ) )
{
targ.PlaySound( 0x57 );
double scale = ( 75.0 + from.Skills[skill].Value - sk ) / 100.0;
if ( scale > 1.0 )
scale = 1.0;
else if ( scale < 0.5 )
scale = 0.5;
healed = (int)( damage * scale );
if ( healed < 1 )
healed = 1;
else if ( healed > 100 )
healed = 100;
}
targ.Hits += healed;
if ( healed > 1 )
from.SendAsciiMessage( "You apply the bandages." );
else
from.SendAsciiMessage( "You apply the bandages, but they barely help." );
targ.BeginAction( typeof( Bandage ) );
new BandageExpire( targ ).Start();
}
}
示例8: BeginHeal
public static BandageContext BeginHeal( Mobile healer, Mobile patient )
{
//vira para quem vai curar
SpellHelper.Turn(healer, patient);
bool isDeadPet = ( patient is BaseCreature && ((BaseCreature)patient).IsDeadPet );
if ( patient is Golem )
{
healer.SendLocalizedMessage( 500970 ); // Bandages cannot be used on that.
}
else if ( patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead )
{
healer.SendLocalizedMessage( 500951 ); // You cannot heal that.
}
else if ( !patient.Poisoned && patient.Hits == patient.HitsMax && !BleedAttack.IsBleeding( patient ) && !isDeadPet )
{
healer.SendLocalizedMessage( 500955 ); // That being is not damaged!
}
else if ( !patient.Alive && (patient.Map == null || !patient.Map.CanFit( patient.Location, 16, false, false )) )
{
healer.SendLocalizedMessage( 501042 ); // Target cannot be resurrected at that location.
}
else if ( healer.CanBeBeneficial( patient, true, true ) )
{
healer.DoBeneficial( patient );
bool onSelf = ( healer == patient );
int dex = healer.Dex;
double seconds;
double resDelay = ( patient.Alive ? 0.0 : 5.0 );
if ( onSelf )
{
if ( Core.AOS )
seconds = 5.0 + (0.5 * ((double)(120 - dex) / 10)); // TODO: Verify algorithm
else
seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10));
}
else
{
if ( Core.AOS && GetPrimarySkill( patient ) == SkillName.Veterinary )
{
//if ( dex >= 40 )
seconds = 2.0;
//else
// seconds = 3.0;
}
else
{
if ( dex >= 100 )
seconds = 3.0 + resDelay;
else if ( dex >= 40 )
seconds = 4.0 + resDelay;
else
seconds = 5.0 + resDelay;
}
}
BandageContext context = GetContext( healer );
if ( context != null )
context.StopHeal();
context = new BandageContext( healer, patient, TimeSpan.FromSeconds( seconds ) );
m_Table[healer] = context;
if ( !onSelf )
patient.SendLocalizedMessage( 1008078, false, healer.Name ); // : Attempting to heal you.
//mensagens
if (patient.Alive)
{
healer.Emote("*{0} esta tratando os ferimentos de {1}*", healer.Name, patient.Name);
if ( healer.Body.Type == BodyType.Human && !healer.Mounted ) {
healer.Animate(10, 5, 1, true, false, 0 );
healer.PlaySound(72);
}
}
else
{
healer.Emote("*{0} esta estancando os ferimentos de {1}*", healer.Name, patient.Name);
if (healer.Body.Type == BodyType.Human && !healer.Mounted) {
healer.Animate(10, 5, 4, true, false, 0);
healer.PlaySound(72);
}
}
healer.SendLocalizedMessage( 500956 ); // You begin applying the bandages.
return context;
}
return null;
}
示例9: BeginHeal
public static MedKitContext BeginHeal( Mobile healer, Mobile patient )
{
bool isDeadPet = ( patient is BaseCreature && ((BaseCreature)patient).IsDeadPet );
if ( patient is Golem )
{
healer.SendLocalizedMessage( 500970 ); // MedKits cannot be used on that.
}
else if ( patient is BaseCreature && ((BaseCreature)patient).IsAnimatedDead )
{
healer.SendLocalizedMessage( 500951 ); // You cannot heal that.
}
else if ( patient.Poisoned || BleedAttack.IsBleeding( patient ) )
{
healer.SendMessage("You cannot do that right now.");
}
else if (!patient.Alive)
{
healer.SendMessage("It's too late for them.");
}
else if (healer.CanBeBeneficial(patient, true, true))
{
healer.DoBeneficial( patient );
bool onSelf = ( healer == patient );
int dex = healer.Dex;
double seconds = 10;
double resDelay = ( patient.Alive ? 0.0 : 5.0 );
MedKitContext context = GetContext( healer );
if ( context != null )
context.StopHeal();
seconds *= 1000;
context = new MedKitContext( healer, patient, TimeSpan.FromMilliseconds( seconds ) );
m_Table[healer] = context;
if ( !onSelf )
patient.SendLocalizedMessage( 1008078, false, healer.Name ); // : Attempting to heal you.
healer.SendMessage("You begin working on the patient...");
return context;
}
return null;
}