本文整理汇总了C#中Server.Mobile.BoltEffect方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.BoltEffect方法的具体用法?C# Mobile.BoltEffect怎么用?C# Mobile.BoltEffect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobile
的用法示例。
在下文中一共展示了Mobile.BoltEffect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnWeaponHit
public override void OnWeaponHit( Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven )
{
if( Damage < 1 || Chance < 1 )
return;
if( Chance >= Utility.RandomMinMax( 0, 100 ) )
{
if( Damage > 0 )
{
SpellHelper.Damage( TimeSpan.Zero, defender, attacker, Damage, 0, 0, 0, 0, 100 );
defender.BoltEffect( 0 );
}
}
}
示例2: OnMoveOver
public override bool OnMoveOver(Mobile m)
{
if (!m_AllowCreatures && !m.Player)
return true;
if (m.Backpack.ConsumeTotal(typeof(SphereOfProtection), 1))
{
return false;
}
m.BoltEffect(0);
m.Hits -= 25;
return true;
}
示例3: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( !from.InRange( this.GetWorldLocation(), 2 ) )
return;
int firstOne = Utility.Random( 1, 6 );
int secondOne = Utility.Random( 1, 6 );
if ((firstOne + secondOne) <= 5) {
this.PublicOverheadMessage( MessageType.Regular, 0, false, string.Format( "{0} is dead!", from.Name, firstOne, secondOne) );
from.BoltEffect( 0 );
from.Kill();
} else {
this.PublicOverheadMessage( MessageType.Regular, 0, false, string.Format( "{0} survives!", from.Name, firstOne, secondOne) );
}
}
示例4: OnWeaponHit
// note that this method will be called when attached to either a mobile or a weapon
// when attached to a weapon, only that weapon will do additional damage
// when attached to a mobile, any weapon the mobile wields will do additional damage
public override void OnWeaponHit(Mobile attacker, Mobile defender, BaseWeapon weapon, int damageGiven)
{
// if it is still refractory then return
if(DateTime.UtcNow < m_EndTime) return;
int damage = 0;
if(m_Damage > 0)
damage = Utility.Random(m_Damage);
if(defender != null && attacker != null && damage > 0)
{
defender.BoltEffect( 0 );
SpellHelper.Damage( TimeSpan.Zero, defender, attacker, damage, 0, 0, 0, 0, 100 );
m_EndTime = DateTime.UtcNow + Refractory;
}
}
示例5: ApplyShock
public void ApplyShock(Mobile m, int tick)
{
if (m == null || !m.Alive || this.Deleted)
{
if (m_DamageTimer != null)
m_DamageTimer.Stop();
}
else
{
int damage = (int)(75 / Math.Max(1, tick - 1)) + Utility.RandomMinMax(1, 9);
AOS.Damage(m, damage, 0, 0, 0, 0, 100);
m.BoltEffect(0);
m.FixedParticles(0x3818, 1, 11, 0x13A8, 0, 0, EffectLayer.CenterFeet);
m.FixedParticles(0x3818, 1, 11, 0x13A8, 0, 0, EffectLayer.Waist);
m.FixedParticles(0x3818, 1, 11, 0x13A8, 0, 0, EffectLayer.Head);
m.PlaySound(0x1DC);
m.LocalOverheadMessage(Server.Network.MessageType.Regular, 0x21, 1114443); // * Your body convulses from electric shock *
m.NonlocalOverheadMessage(Server.Network.MessageType.Regular, 0x21, 1114443, m.Name); // * ~1_NAME~ spasms from electric shock *
}
}
示例6: OnTrigger
public override void OnTrigger(object activator, Mobile m)
{
if(m == null ) return;
// if it is still refractory then return
if(DateTime.UtcNow < m_EndTime) return;
int damage = 0;
if(m_Damage > 0)
damage = Utility.Random(m_Damage);
if(damage > 0)
{
m.BoltEffect( 0 );
SpellHelper.Damage( TimeSpan.Zero, m, damage, 0, 0, 0, 0, 100 );
}
m_EndTime = DateTime.UtcNow + Refractory;
}
示例7: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
base.OnDoubleClick(from);
if (from != m_Owner && m_Owner != null)
{
from.SendMessage("You do not own this stone!");
return;
}
if (m_Owner == null)
{
if (from.AccessLevel == AccessLevel.Player)
{
if (HideEffects)
from.SendMessage("You are not authorized to have me! Goodbye!");
else
this.Say(String.Format("You are not authorized to have me! Goodbye!"));
deleting = true;
DoDelete(this);
return;
}
else
{
if (HideEffects)
from.SendMessage("How May I serve you master!");
else
this.Say(String.Format("How May I serve you master!"));
m_Owner = from;
Name = m_Owner.Name + "'s Staff Stone";
this.StaffLevel = m_Owner.AccessLevel;
Movable = false;
this.HomeLocation = from.Location;
this.HomeMap = from.Map;
if (from.Title != null)
this.Title = from.Title;
}
return;
}
if (from is PlayerMobile)
{
PlayerMobile player = (PlayerMobile)from;
if (player != null)
{
if (this.Title == null)
this.Title = from.Title;
if (DateTime.UtcNow < LastClicked + TimeSpan.FromSeconds(1.0))
{
if (!HideEffects)
this.Say(String.Format("Try clicking again a little later."));
else
from.SendMessage("Try clicking again a little later.");
return;
}
else
{
LastClicked = DateTime.UtcNow;
switch (player.AccessLevel)
{
case AccessLevel.Owner:
m_StaffLevel = from.AccessLevel;
player.AccessLevel = AccessLevel.Player;
break;
case AccessLevel.Administrator:
m_StaffLevel = from.AccessLevel;
player.AccessLevel = AccessLevel.Player;
break;
case AccessLevel.GameMaster:
m_StaffLevel = from.AccessLevel;
player.AccessLevel = AccessLevel.Player;
break;
case AccessLevel.Seer:
m_StaffLevel = from.AccessLevel;
player.AccessLevel = AccessLevel.Player;
break;
case AccessLevel.Counselor:
m_StaffLevel = from.AccessLevel;
player.AccessLevel = AccessLevel.Player;
break;
case AccessLevel.Player:
player.AccessLevel = m_StaffLevel;
break;
default:
deleting = true;
DoDelete(this);
break;
}
}
if (!HideEffects)
from.BoltEffect(0);
}
}
}
示例8: OnDragLift
public override bool OnDragLift(Mobile from)
{
if (m_Owner != from && m_Owner != null)
{
from.SendMessage("You cannot pick that up.");
if (!HideEffects)
from.BoltEffect(0);
return false;
}
return base.OnDragLift(from);
}
示例9: SpringTrap
public void SpringTrap(Mobile from)
{
if (from == null || !from.Alive)
return;
int cliloc;
int damage = Utility.RandomMinMax(75, 150);
switch (Utility.Random(4))
{
default:
case 0:
Effects.SendLocationEffect( from, from.Map, 0x3709, 30 );
from.PlaySound( 0x54 );
cliloc = 1010524; // Searing heat scorches thy skin.
AOS.Damage(from, damage, 0, 100, 0, 0, 0);
break;
case 1:
from.PlaySound(0x223);
cliloc = 1010525; // Pain lances through thee from a sharp metal blade.
AOS.Damage(from, damage, 100, 0, 0, 0, 0);
break;
case 2:
from.BoltEffect(0);
cliloc = 1010526; // Lightning arcs through thy body.
AOS.Damage(from, damage, 0, 0, 0, 0, 100);
break;
case 3:
Effects.SendLocationEffect( from, from.Map, 0x113A, 20, 10 );
from.PlaySound( 0x231 );
from.ApplyPoison(from, Poison.Deadly);
cliloc = 1010523; // A toxic vapor envelops thee.
AOS.Damage(from, damage, 0, 0, 0, 100, 0);
break;
}
from.LocalOverheadMessage(Server.Network.MessageType.Regular, 0xEE, cliloc);
}
示例10: OnDamagedBySpell
public override void OnDamagedBySpell( Mobile from )
{
if (Combatant == null)
return;
if (Body == 58)
Say( "I will steal your Body and now your Soul..." );
if (Body != from.Body)
{
BoltEffect( 0 );
Body = from.Body;
Hue = from.Hue;
Name = from.Name;
Fame = from.Fame;
Karma = (0 -from.Karma);
Title = from.Title;
Str = from.Str;
Int = from.Int;
Dex = from.Dex;
Hits = from.Hits;
Dex = from.Dex;
Mana = from.Mana;
Stam = from.Stam;
Female = from.Female;
VirtualArmor = (from.VirtualArmor);
Item hair = new Item( Utility.RandomList( 8265 ) );
hair.Hue = 1153;
hair.Layer = Layer.Hair;
hair.Movable = false;
AddItem( hair );
JesterHat hat = new JesterHat();
hat.Hue = 1175;
hat.Movable = false;
AddItem( hat );
DeathRobe robe = new DeathRobe();
robe.Hue = 1175;
robe.Movable = false;
AddItem( robe );
Sandals sandals = new Sandals();
sandals.Hue = 1;
sandals.Movable = false;
AddItem( sandals );
Spellbook book = new Spellbook( UInt64.MaxValue );
book.Hue = 1175;
book.Movable = false;
AddItem( book );
BoltEffect( 0 );
}
switch ( Utility.Random( 6 ) )
{
case 0: Say( "You can not win with magic..." ); break;
case 1: Say( "Your image is weak as is your mind..." ); break;
case 2: Say( "It feels good to wear your skin..." ); break;
case 3: Say( "I'll take over your life as soon as I end it..." ); break;
case 4: Say( "Don't you like having a twin..." ); break;
case 5: Say( "You lack the skills to defeat me..." ); break;
}
from.BoltEffect( 0 );
from.Damage( Utility.Random( 20, 40 ) );
Hits += ( Utility.Random( 20, 40 ) );
}
示例11: AggressiveAction
public override void AggressiveAction(Mobile aggressor, bool criminal)
{
base.AggressiveAction(aggressor, criminal);
if (m_Game != null && m_Game.Running && aggressor != null)
{
Item item = aggressor.FindItemOnLayer(Layer.OuterTorso);
if (item is CTFRobe)
{
CTFTeam team = m_Game.GetTeam(aggressor);
if (team != null && team.Name == m_Team.Name)
{
AOS.Damage(aggressor, 200, 0, 100, 0, 0, 0);
this.Game.PlayerMessage("{0} ({1}) was killed for betraying his orc!", aggressor.Name, team.Name);
aggressor.BoltEffect(0);
aggressor.PlaySound(0x307);
}
}
}
}
示例12: OnDamagedBySpell
public override void OnDamagedBySpell( Mobile from )
{
if (from.Combatant == null)
return;
Mobile m = from.Combatant;
if (m.Body == 58)
m.Say( "I now own your soul!!!" );
if (m.Body != from.Body)
{
m.BoltEffect( 0 );
m.Body = from.Body;
m.Hue = from.Hue;
m.Name = from.Name;
m.Fame = from.Fame;
m.Karma = (0-from.Karma);
m.Title = from.Title;
m.Str = from.Str;
m.Int = from.Int;
m.Dex = from.Dex;
m.Hits =from.Hits + 2000;
m.Dex = from.Dex;
m.Mana = from.Mana;
m.Stam = from.Stam;
m.Female = from.Female;
m.VirtualArmor = (from.VirtualArmor +95);
Item hair = new Item( Utility.RandomList( 8265 ) );
hair.Hue = 1167;
hair.Layer = Layer.Hair;
hair.Movable = false;
m.AddItem( hair );
Kasa hat = new Kasa();
hat.Hue = 1167;
hat.Movable = false;
m.AddItem( hat );
DeathRobe robe = new DeathRobe();
robe.Name = "Death Robe";
robe.Hue = 1167;
robe.Movable = false;
m.AddItem( robe );
Sandals sandals = new Sandals();
sandals.Hue = 1167;
sandals.Movable = false;
m.AddItem( sandals );
BagOfAllReagents bag = new BagOfAllReagents();
m.AddToBackpack( bag );
m.BoltEffect( 0 );
}
switch ( Utility.Random( 5 ) )
{
case 0: m.Say( "We are now one with each other!!" ); break;
case 1: m.Say( "Your weak spells have no effect on me, muahahaha!!" ); break;
case 2: m.Say( "Your end is near young adventurer!!" ); break;
case 3: m.Say( "Thou shalt not pass my post!!" ); break;
case 4: m.Say( "I now own your soul!!!" ); break;
}
from.BoltEffect( 0 );
from.Damage( Utility.Random( 1, 50 ) );
m.Hits += ( Utility.Random( 1, 50 ) );
}
示例13: OnHit
public override void OnHit( Mobile attacker, Mobile defender, int damage )
{
if ( !Validate( attacker ) )
return;
ClearCurrentAbility( attacker );
Map map = attacker.Map;
if ( map == null )
return;
BaseWeapon weapon = attacker.Weapon as BaseWeapon;
if ( weapon == null )
return;
if ( !CheckMana( attacker, true ) )
return;
ArrayList list = new ArrayList();
defender.PlaySound(1471);
defender.BoltEffect(0);
attacker.SendMessage( "The Lighting Arrow strikes a target" );
foreach ( Mobile m in defender.GetMobilesInRange( 1 ) )
list.Add( m );
ArrayList targets = new ArrayList();
for ( int i = 0; i < list.Count; ++i )
{
Mobile m = (Mobile)list[i];
if ( m != defender && m != attacker && SpellHelper.ValidIndirectTarget( attacker, m ) )
{
if ( m == null || m.Deleted || m.Map != attacker.Map || !m.Alive || !attacker.CanSee( m ) || !attacker.CanBeHarmful( m ) )
continue;
if ( !attacker.InRange( m, weapon.MaxRange ) )
continue;
if ( attacker.InLOS( m ) )
targets.Add( m );
}
}
if ( targets.Count > 0 )
{
double damageBonus = 1.0 + Math.Pow( 1, 2 ) / 100;
for ( int i = 0; i < targets.Count; ++i )
{
Mobile m = (Mobile)targets[i];
attacker.SendMessage( "The Lighting Arrow strikes around a target" );
m.PlaySound(1471);
m.BoltEffect(0);
weapon.OnHit( attacker, m, damageBonus );
}
}
}
示例14: DoEffect
public override bool DoEffect(Mobile from, Mobile target)
{
if ( from.CanSee( target ) && from.CanBeHarmful( target ) && from.InLOS( target ) && target.Alive )
{
from.DoHarmful( target );
Mobile source = from;
SpellHelper.Turn( source, target );
SpellHelper.CheckReflect( 2, ref source, ref target );
double damage = Utility.RandomMinMax( m_Min, m_Max );
double scalar = 1;
if ( !target.Player && !target.Body.IsHuman && !Core.AOS )
scalar *= 2.0; // Double magery damage to monsters/animals if not AOS
if ( target is BaseCreature )
((BaseCreature)target).AlterDamageScalarFrom( from, ref scalar );
if ( from is BaseCreature )
((BaseCreature)from).AlterDamageScalarTo( target, ref scalar );
target.Region.SpellDamageScalar( from, target, ref scalar );
damage *= scalar;
if ( damage < 1 )
damage = 1;
if ( Spell.CheckResisted( target, damage ) )
{
damage *= 0.5;
target.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
}
if ( m_ExpSnd >= 0 )
{
source.MovingParticles( target, m_EffIID, m_Spd, 0, false, true, m_Eff, m_Exp, m_ExpSnd );
}
else
{
if ( m_EffIID == 0 && m_Spd == 0 )
target.BoltEffect( m_Eff );
else
target.FixedParticles( m_EffIID, m_Spd, m_Exp, m_Eff, (EffectLayer)(-(m_ExpSnd - 1)) );
}
if ( m_Snd > 0 )
source.PlaySound( m_Snd );
SpellHelper.Damage( TimeSpan.Zero, target, from, damage, 0, 100, 0, 0, 0 );
return true;
}
else
{
return false;
}
}
示例15: TjnarsScythe_OnTarget
public virtual void TjnarsScythe_OnTarget( Mobile from, object target )
{
if( !from.CanSee( target ) )
{
from.SendLocalizedMessage( 500237 ); //Target cannot be seen.
}
else if( target is Mobile )
{
Mobile targetMobile = (Mobile)target;
if( targetMobile.Body.IsHuman )
{
if( targetMobile.Hits < (targetMobile.HitsMax / 10) )
{
targetMobile.PlaySound( 565 ); //Consecrate Weapon sound
from.PlaySound( 565 );
from.MovingEffect( targetMobile, 0x26C4, 9, 1, false, false ); //Launches a solid scythe
Effects.SendMovingParticles( from, targetMobile, 0x26C4, 1, 0, false, false, 1109, 3, 9501, 1, 0, EffectLayer.Waist, 0x100 ); //Launches a rendered scythe
targetMobile.FixedParticles( 0x3779, 1, 30, 9964, 1109, 3, EffectLayer.Waist ); //Small sparklies on the target
targetMobile.Kill();
Head head = new Head( String.Format( "the head of {0}", targetMobile.Name ) );
from.AddToBackpack( head );
from.BoltEffect( 1 );
this.Delete();
}
else
{
from.PublicOverheadMessage( MessageType.Emote, from.EmoteHue, false, "*the voice of Tjnar rings out across the region:*", false );
from.PublicOverheadMessage( MessageType.Yell, from.SpeechHue, false, "\"You fool! That mere mortal is not prepared to die! Crush the body, and the mind shall be yours!\"", false );
from.SendMessage( "Your target must have less than 10% of his health in order for this spell to work." );
}
}
else
{
from.SendMessage( "This spell will only work on humans." );
}
}
from.Frozen = false;
}