本文整理汇总了C#中Server.Mobile.CurePoison方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.CurePoison方法的具体用法?C# Mobile.CurePoison怎么用?C# Mobile.CurePoison使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobile
的用法示例。
在下文中一共展示了Mobile.CurePoison方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoCure
public void DoCure( Mobile from )
{
bool cure = false;
CureLevelInfo[] info = LevelInfo;
for ( int i = 0; i < info.Length; ++i )
{
CureLevelInfo li = info[i];
if ( li.Poison == from.Poison && Scale( from, li.Chance ) > Utility.RandomDouble() )
{
cure = true;
break;
}
}
if ( cure && from.CurePoison( from ) )
{
from.SendAsciiMessage( "You feel cured of poison!" ); // You feel cured of poison!
from.FixedEffect( 0x373A, 10, 15 );
from.PlaySound( 0x1E0 );
}
else if ( !cure )
{
from.SendAsciiMessage( "That potion was not strong enough to cure your ailment!" ); // That potion was not strong enough to cure your ailment!
}
}
示例2: DoCure
public void DoCure( Mobile from )
{
bool cure = false;
CureLevelInfo[] info = LevelInfo;
for ( int i = 0; i < info.Length; ++i )
{
CureLevelInfo li = info[i];
#region Mondain's Legacy mod
if ( li.Poison.RealLevel == from.Poison.RealLevel && Scale( from, li.Chance ) > Utility.RandomDouble() )
{
cure = true;
break;
}
#endregion
}
if ( cure && from.CurePoison( from ) )
{
from.SendLocalizedMessage( 500231 ); // You feel cured of poison!
from.FixedEffect( 0x373A, 10, 15 );
from.PlaySound( 0x1E0 );
}
else if ( !cure )
{
from.SendLocalizedMessage( 500232 ); // That potion was not strong enough to cure your ailment!
}
}
示例3: DoCure
public void DoCure(Mobile from, double scalar)
{
bool cure = false;
CureLevelInfo[] info = LevelInfo;
for (int i = 0; i < info.Length; ++i)
{
CureLevelInfo li = info[i];
if (li.Poison == from.Poison && Scale(from, li.Chance - (int)Math.Floor(li.Chance * scalar) + (IntensifiedStrength ? 0.1 : 0)) > Utility.RandomDouble())
{
cure = true;
break;
}
}
if (cure && from.CurePoison(from))
{
from.SendLocalizedMessage(500231); // You feel cured of poison!
from.FixedEffect(0x373A, 10, 15);
from.PlaySound(0x1E0);
}
else if (!cure)
{
from.SendLocalizedMessage(500232); // That potion was not strong enough to cure your ailment!
}
}
示例4: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if ( from.Player && from.InRange( this, 1 ) && from.InLOS( this ) )
{
object o = m_Table[from];
if ( o == null || ( o is DateTime && ((DateTime)o)+TimeSpan.FromHours( 6 ) < DateTime.Now ) )
{
from.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
from.PlaySound( 0x202 );
from.SendAsciiMessage( "You feel a magical energy surround you." );
from.Hits = from.HitsMax;
from.Mana = from.ManaMax;
from.Stam = from.StamMax;
from.CurePoison( from );
m_Table[from] = DateTime.Now;
}
}
}
示例5: Heal
public virtual void Heal(Mobile patient)
{
if (!Alive || !patient.Alive || !InRange(patient, 2))
{
}
else if (patient.Poisoned)
{
double healing = Skills.Healing.Value;
double anatomy = Skills.Anatomy.Value;
double chance = (healing - 30.0) / 50.0 - patient.Poison.Level * 0.1;
if ((healing >= 60.0 && anatomy >= 60.0) && chance > Utility.RandomDouble())
{
if (patient.CurePoison(this))
{
patient.SendLocalizedMessage(1010059); // You have been cured of all poisons.
patient.PlaySound(0x57);
CheckSkill(SkillName.Healing, 0.0, 100.0);
CheckSkill(SkillName.Anatomy, 0.0, 100.0);
}
}
}
else if (BleedAttack.IsBleeding(patient))
{
patient.SendLocalizedMessage(1060167); // The bleeding wounds have healed, you are no longer bleeding!
BleedAttack.EndBleed(patient, true);
patient.PlaySound(0x57);
}
else
{
double healing = Skills.Healing.Value;
double anatomy = Skills.Anatomy.Value;
double chance = (healing + 10.0) / 100.0;
if (chance > Utility.RandomDouble())
{
double min, max;
min = (anatomy / 10.0) + (healing / 6.0) + 4.0;
max = (anatomy / 8.0) + (healing / 3.0) + 4.0;
if (patient == this)
max += 10;
double toHeal = min + (Utility.RandomDouble() * (max - min));
toHeal *= HealScalar;
patient.Heal((int)toHeal);
patient.PlaySound(0x57);
CheckSkill(SkillName.Healing, 0.0, 100.0);
CheckSkill(SkillName.Anatomy, 0.0, 100.0);
}
}
if (m_HealTimer != null)
m_HealTimer.Stop();
m_HealTimer = null;
m_NextHealTime = DateTime.Now + TimeSpan.FromSeconds(MinHealDelay + (Utility.RandomDouble() * MaxHealDelay));
}
示例6: OnMovement
public override void OnMovement( Mobile m, Point3D oldLocation )
{
if ( this.InRange( m, 2 ) && !this.InRange( oldLocation, 2 ) && !m_Table.ContainsKey( m ) )
{
if ( !m.Alive )
{
m.CloseGump( typeof( ResurrectGump ) );
m.SendGump( new FoFResurrectGump( m ) );
}
else if ( m.Poisoned || IsCursed( m ) )
{
RemoveCurseSpell.DoGraphicalEffect( m );
RemoveCurseSpell.DoRemoveCurses( m );
if ( m.Poisoned && m.CurePoison( m ) )
m.SendLocalizedMessage( 1010059 ); // You have been cured of all poisons.
AddCooldown( m );
}
else if ( m.Hits < ( m.HitsMax / 2.0 ) )
{
m.Hits = m.HitsMax;
m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
m.PlaySound( 0x202 );
m.SendLocalizedMessage( 1113365 ); // Your wounds have been mended.
AddCooldown( m );
}
}
}
示例7: Target
public void Target( BaseTalisman talis, Mobile owner, Mobile m )
{
if ( this.Parent == owner )
{
//Curse Removal
if ( talis.m_TalismanType == TalismanType.CurseRemoval )
{
m.PlaySound( 0xF6 );
m.PlaySound( 0x1F7 );
m.FixedParticles( 0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head );
StatMod mod;
mod = m.GetStatMod( "[Magic] Str Malus" );
if ( mod != null && mod.Offset < 0 )
m.RemoveStatMod( "[Magic] Str Malus" );
mod = m.GetStatMod( "[Magic] Dex Malus" );
if ( mod != null && mod.Offset < 0 )
m.RemoveStatMod( "[Magic] Dex Malus" );
mod = m.GetStatMod( "[Magic] Int Malus" );
if ( mod != null && mod.Offset < 0 )
m.RemoveStatMod( "[Magic] Int Malus" );
m.Paralyzed = false;
EvilOmenSpell.CheckEffect( m );
StrangleSpell.RemoveCurse( m );
CorpseSkinSpell.RemoveCurse( m );
CurseSpell.RemoveEffect( 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 );
StrangleSpell.RemoveCurse( m );
CorpseSkinSpell.RemoveCurse( m );
if ( owner != m )
owner.SendLocalizedMessage( 1072409 ); // Your targets curses have been lifted
m.SendLocalizedMessage( 1072408 ); // Any curses on you have been lifted
}
//Damage Removal
if ( talis.m_TalismanType == TalismanType.DamageRemoval )
{
Effects.SendLocationEffect( m.Location, m.Map, 0x3728, 8 );
Effects.PlaySound( m, m.Map, 0x201 );
BleedAttack.EndBleed( m, false );
MortalStrike.EndWound( m );
m.CurePoison( m );
BuffInfo.RemoveBuff( m, BuffIcon.Bleed );
BuffInfo.RemoveBuff( m, BuffIcon.MortalStrike );
if ( owner != m )
owner.SendLocalizedMessage( 1072406 ); // Your Targets lasting damage effects have been removed!
m.SendLocalizedMessage( 1072405 ); // Your lasting damage effects have been removed!
}
//Ward Removal
if ( talis.m_TalismanType == TalismanType.WardRemoval )
{
Effects.SendLocationEffect( m.Location, m.Map, 0x3728, 8 );
Effects.PlaySound( m, m.Map, 0x201 );
ProtectionSpell.RemoveWard( m );
ReactiveArmorSpell.RemoveWard( m );
MagicReflectSpell.RemoveWard( m );
TransformationSpell.RemoveContext( m, true );
ReaperFormSpell.RemoveEffects( m );
if ( StoneFormSpell.UnderEffect( m ) )
StoneFormSpell.RemoveEffects( m );
if ( owner != m )
owner.SendLocalizedMessage( 1072403 ); // Your target's wards have been removed!
m.SendLocalizedMessage( 1072402 ); // Your wards have been removed!
}
//Wildfire Removal
if ( talis.m_TalismanType == TalismanType.WildfireRemoval )
owner.SendLocalizedMessage( 1042753, "Wildfire Removal" ); // ~1_SOMETHING~ has been temporarily disabled.
//CARGE TIMER
ChargeTimeLeft = 1200;
m_ChargeTimer = new ChargeTimeLeftTimer( this );
m_ChargeTimer.Start();
m_ChargeTimeLeft3 = DateTime.Now;
}
else if ( m_TalismanType != 0 )
m.SendLocalizedMessage( 502641 ); // You must equip this item to use it.
}
示例8: CleanPlayer
/// <summary>
/// Remove all ill effects from a player.
/// </summary>
/// <param name="pm"></param>
public void CleanPlayer(Mobile pm)
{
//Cure Poison
pm.CurePoison(pm);
//Reset Hit Points
pm.Hits = pm.HitsMax;
//Rest Mana
pm.Mana = pm.ManaMax;
//Reset Stam
pm.Stam = pm.StamMax;
//Cancel any targeting
Targeting.Target.Cancel(pm);
//remove abosorption for magic
pm.MagicDamageAbsorb = 0;
//remove absorption for melee
pm.MeleeDamageAbsorb = 0;
//clear protection spell
Spells.Second.ProtectionSpell.Registry.Remove(pm);
//clear curse effect
Spells.Fourth.CurseSpell.RemoveEffect(pm);
//clear corpseskin
Server.Spells.Necromancy.CorpseSkinSpell.RemoveCurse(pm);
//clear blodd oath
Server.Spells.Necromancy.BloodOathSpell.RemoveCurse(pm);
//clear evil omen
//Server.Spells.Necromancy.EvilOmenSpell.RemoveCurse(pm);
//remove strangle
Server.Spells.Necromancy.StrangleSpell.RemoveCurse(pm);
//clear Paralyzed
pm.Paralyzed = false;
//clear defensive spell
DefensiveSpell.Nullify(pm);
//remove any combatant
pm.Combatant = null;
//remove war mode
pm.Warmode = false;
//remove criminal
pm.Criminal = false;
//clear agressed list
pm.Aggressed.Clear();
//clear agressor list
pm.Aggressors.Clear();
//clear delta notoriety
pm.Delta(MobileDelta.Noto);
//invalidate any properties due to the previous changes
pm.InvalidateProperties();
}
示例9: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( !from.InRange( this.GetWorldLocation(), 1 ) )
{
from.SendLocalizedMessage( 502138 ); // That is too far away for you to use
return;
}
else if ( from != m_Caster )
{
}
else if (!BasePotion.HasFreeHand(from))
{
from.SendLocalizedMessage(1080116); // You must have a free hand to use a Healing Stone.
}
else if (from.Hits >= from.HitsMax && !from.Poisoned)
{
from.SendLocalizedMessage(1049547); //You are already at full health.
}
else if (from.BeginAction(typeof(HealingStone)))
{
if (m_MaxHeal > m_LifeForce)
m_MaxHeal = m_LifeForce;
if (from.Poisoned)
{
int toUse = Math.Min(120, from.Poison.RealLevel * 25);
if (m_MaxLifeForce < toUse)
from.SendLocalizedMessage(1115265); //Your Mysticism, Focus, or Imbuing Skills are not enough to use the heal stone to cure yourself.
else if (m_LifeForce < toUse)
{
from.SendLocalizedMessage(1115264); //Your healing stone does not have enough energy to remove the poison.
m_LifeForce -= toUse / 3;
}
else
{
from.CurePoison(from);
from.SendLocalizedMessage(500231); // You feel cured of poison!
from.FixedEffect(0x373A, 10, 15);
from.PlaySound(0x1E0);
m_LifeForce -= toUse;
}
if (m_LifeForce <= 0)
this.Consume();
Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(ReleaseHealLock), from);
return;
}
else
{
int toHeal = Math.Min(m_MaxHeal, from.HitsMax - from.Hits);
from.Heal(toHeal);
Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(ReleaseHealLock), from);
from.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
from.PlaySound(0x202);
m_LifeForce -= toHeal;
m_MaxHeal = 1;
}
if (m_LifeForce <= 0)
{
from.SendLocalizedMessage(1115266); //The healing stone has used up all its energy and has been destroyed.
this.Consume();
}
else
{
if (m_Timer != null)
m_Timer.Stop();
m_Timer = new InternalTimer(this);
}
}
else
from.SendLocalizedMessage(1095172); // You must wait a few seconds before using another Healing Stone.
}
示例10: Heal
public virtual void Heal(Mobile patient)
{
if ( !Alive || this.Map == Map.Internal || !CanBeBeneficial( patient, true, true ) || patient.Map != this.Map || !InRange( patient, HealEndRange ) )
{
StopHeal();
return;
}
bool onSelf = ( patient == this );
if ( !patient.Alive )
{
}
else if (patient.Poisoned)
{
int poisonLevel = patient.Poison.Level;
double healing = Skills.Healing.Value;
double anatomy = Skills.Anatomy.Value;
double chance = ( healing - 30.0 ) / 50.0 - poisonLevel * 0.1;
if ((healing >= 60.0 && anatomy >= 60.0) && chance > Utility.RandomDouble())
{
if (patient.CurePoison(this))
{
patient.SendLocalizedMessage(1010059); // You have been cured of all poisons.
CheckSkill( SkillName.Healing, 0.0, 60.0 + poisonLevel * 10.0 ); // TODO: Verify formula
CheckSkill(SkillName.Anatomy, 0.0, 100.0);
}
}
}
else if (BleedAttack.IsBleeding(patient))
{
patient.SendLocalizedMessage(1060167); // The bleeding wounds have healed, you are no longer bleeding!
BleedAttack.EndBleed( patient, false );
}
else
{
double healing = Skills.Healing.Value;
double anatomy = Skills.Anatomy.Value;
double chance = (healing + 10.0) / 100.0;
if (chance > Utility.RandomDouble())
{
double min, max;
min = (anatomy / 10.0) + (healing / 6.0) + 4.0;
max = (anatomy / 8.0) + (healing / 3.0) + 4.0;
if ( onSelf )
max += 10;
double toHeal = min + (Utility.RandomDouble() * (max - min));
toHeal *= HealScalar;
patient.Heal((int)toHeal);
CheckSkill( SkillName.Healing, 0.0, 90.0 );
CheckSkill(SkillName.Anatomy, 0.0, 100.0);
}
}
HealEffect( patient );
StopHeal();
if ( ( onSelf && HealFully && Hits >= HealTrigger * HitsMax && Hits < HitsMax ) || ( !onSelf && HealOwnerFully && patient.Hits >= HealOwnerTrigger * patient.HitsMax && patient.Hits < patient.HitsMax ) )
HealStart( patient );
}
示例11: CleanPlayer
private void CleanPlayer(Mobile pm)
{
pm.CurePoison(pm);
pm.Hits = pm.HitsMax;
pm.Mana = pm.ManaMax;
pm.Stam = pm.StamMax;
Targeting.Target.Cancel(pm);
pm.MagicDamageAbsorb = 0;
pm.MeleeDamageAbsorb = 0;
Spells.Second.ProtectionSpell.Registry.Remove(pm);
Spells.Fourth.CurseSpell.RemoveEffect(pm);
Server.Spells.Necromancy.CorpseSkinSpell.RemoveCurse(pm);
Server.Spells.Necromancy.BloodOathSpell.RemoveCurse(pm);
Server.Spells.Necromancy.StrangleSpell.RemoveCurse(pm);
pm.Blessed = false;
pm.Paralyzed = false;
pm.Hidden = false;
DefensiveSpell.Nullify(pm);
pm.Combatant = null;
pm.Warmode = false;
pm.Criminal = false;
pm.Blessed = false;
pm.Aggressed.Clear();
pm.Aggressors.Clear();
pm.Delta(MobileDelta.Noto);
pm.InvalidateProperties();
}
示例12: OnDoubleClick
public static void OnDoubleClick(Mobile from, bool chaos)
{
bool good = (from.Karma >= 0 && from.Kills < 5);
bool heal = false;
if (chaos)
{
if (!good)
{
from.SendMessage("Thy efforts for the resistance are rewarded.");
heal = true;
}
}
else
{
if (good)
{
from.SendMessage("Strive to continue on the path of benevolence.");
heal = true;
}
}
if (heal)
{
//from.Hits = from.HitsMax;
//from.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
//from.PlaySound(0x202);
if (from.Poison != null)
{
if (from.CurePoison(from))
{
from.SendLocalizedMessage(1010059); // You have been cured of all poisons.
from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
from.PlaySound(0x1E0);
}
}
}
else
{
if (chaos)
from.SendMessage("The weak deserve their fate.");
else
from.SendMessage("Do more to help others.");
if (from.Hits > 1)
{
from.Hits /= 2;
from.FixedParticles(0x374A, 10, 15, 5013, EffectLayer.Waist);
from.PlaySound(0x1F1);
}
}
}
示例13: HandleMatchEnd
private void HandleMatchEnd(Mobile from, bool kick)
{
if(!from.Alive)
{
from.Resurrect();
if(from.Corpse != null && from.Corpse is Corpse)
{
Corpse c = (Corpse)from.Corpse;
for ( int i = 0; i < c.Items.Count; ++i )
{
Item item = c.Items[i];
c.SetRestoreInfo( item, item.Location );
}
c.Open(from, true);
c.Delete();
}
}
from.Criminal = false;
from.Blessed = false;
from.Frozen = false;
from.CurePoison(from);
from.StatMods.Clear();
from.Hits = from.HitsMax;
from.Mana = from.ManaMax;
from.Stam = from.StamMax;
Targeting.Target.Cancel( from );
from.MagicDamageAbsorb = 0;
from.MeleeDamageAbsorb = 0;
ProtectionSpell.Registry.Remove( from );
DefensiveSpell.Nullify( from );
from.Combatant = null;
from.Delta( MobileDelta.Noto ); //Update notoriety
from.Location = m_SpectatorDest;
if(kick && from.NetState == null)
{
Match m = FindMatch(from);
if(m.Attackers.Contains(from))
m.Attackers.Remove(from);
else if(m.Defenders.Contains(from))
m.Defenders.Remove(from);
}
}
示例14: PrepFighter
private void PrepFighter(Mobile from)
{
if(!from.Alive)
from.Resurrect();
if(from.Mount != null)
from.Mount.Rider = null;
from.CurePoison(from);
from.Blessed = true;
from.Frozen = true;
from.StatMods.Clear();
from.Hits = from.HitsMax;
from.Mana = from.ManaMax;
from.Stam = from.StamMax;
Targeting.Target.Cancel( from );
from.MagicDamageAbsorb = 0;
from.MeleeDamageAbsorb = 0;
ProtectionSpell.Registry.Remove( from );
DefensiveSpell.Nullify( from );
from.Combatant = null;
from.Delta( MobileDelta.Noto ); //Update notoriety
from.SendMessage("The fight will begin in ten seconds.");
}
示例15: FinalPrep
public void FinalPrep(Mobile from)
{
if(!from.Alive)
from.Resurrect();
from.CurePoison(from);
from.Blessed = false;
from.Frozen = false;
from.StatMods.Clear();
from.Hits = from.HitsMax;
from.Mana = from.ManaMax;
from.Stam = from.StamMax;
Targeting.Target.Cancel( from );
from.MagicDamageAbsorb = 0;
from.MeleeDamageAbsorb = 0;
ProtectionSpell.Registry.Remove( from );
DefensiveSpell.Nullify( from );
from.Combatant = null;
from.Delta( MobileDelta.Noto ); //Update notoriety
}