本文整理汇总了C#中Server.Mobiles.PlayerMobile.PlaySound方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerMobile.PlaySound方法的具体用法?C# PlayerMobile.PlaySound怎么用?C# PlayerMobile.PlaySound使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobiles.PlayerMobile
的用法示例。
在下文中一共展示了PlayerMobile.PlaySound方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OfferHeal
public virtual void OfferHeal( PlayerMobile m )
{
Direction = GetDirectionTo( m );
// if ( m.CheckYoungHealTime() )
if ( DateTime.Now >= m_NextResurrect )
{
Say("Here's some help"); // You look like you need some healing my child.
Say("In Vas Mani");
m.PlaySound( 0x1F2 );
m.FixedEffect( 0x376A, 9, 32 );
m.Hits = (m.Hits + 50);
m_NextResurrect = DateTime.Now + ResurrectDelay;
}
else
{
Say("You should be good"); // I can do no more for you at this time.
}
}
示例2: DoExplode
public void DoExplode(PlayerMobile pm)
{
pm.Emote("*The gaze of the asylum guardian melts the flesh from your bones and causes your organs to explode.*");
int range = Utility.RandomMinMax(5, 7);
int zOffset = pm.Mounted ? 20 : 10;
Point3D src = pm.Location.Clone3D(0, 0, zOffset);
Point3D[] points = src.GetAllPointsInRange(pm.Map, 0, range);
Effects.PlaySound(pm.Location, pm.Map, 0x19C);
pm.FixedParticles(0x36BD, 20, 10, 5044, 137, 0, EffectLayer.Head);
pm.PlaySound(0x307);
Timer.DelayCall(
TimeSpan.FromMilliseconds(100),
() =>
{
int i = 0;
int place = 0;
int[] BodyPartArray = {7584, 7583, 7586, 7585, 7588, 7587};
foreach (Point3D trg in points)
{
i++;
int bodypartID = Utility.RandomMinMax(4650, 4655);
if (Utility.RandomDouble() <= 0.1 && place < BodyPartArray.Count())
{
bodypartID = BodyPartArray[place];
place++;
}
new MovingEffectInfo(src, trg.Clone3D(0, 0, 2), pm.Map, bodypartID).MovingImpact(
info =>
{
Item bodypart;
if (bodypartID <= 4655 && bodypartID >= 4650)
{
bodypart = new Blood
{
ItemID = bodypartID
};
bodypart.MoveToWorld(info.Target.Location, info.Map);
}
switch (bodypartID)
{
case 7584:
bodypart = new Head();
bodypart.MoveToWorld(info.Target.Location, info.Map);
break;
case 7583:
bodypart = new Torso();
bodypart.MoveToWorld(info.Target.Location, info.Map);
break;
case 7586:
bodypart = new RightArm();
bodypart.MoveToWorld(info.Target.Location, info.Map);
break;
case 7585:
bodypart = new LeftArm();
bodypart.MoveToWorld(info.Target.Location, info.Map);
break;
case 7588:
bodypart = new RightLeg();
bodypart.MoveToWorld(info.Target.Location, info.Map);
break;
case 7587:
bodypart = new LeftLeg();
bodypart.MoveToWorld(info.Target.Location, info.Map);
break;
}
Effects.PlaySound(info.Target, info.Map, 0x028);
});
}
});
pm.Damage(pm.Hits + 5);
Timer.DelayCall(
TimeSpan.FromMilliseconds(100),
() =>
{
var corpse = pm.Corpse as Corpse;
if (corpse != null && !corpse.Deleted)
{
corpse.TurnToBones();
}
});
}
示例3: Reward
public virtual void Reward( PlayerMobile player, CollectionItem reward, int hue )
{
Item item = QuestHelper.Construct( reward.Type ) as Item;
if ( item != null && player.AddToBackpack( item ) )
{
if ( hue > 0 )
item.Hue = hue;
player.AddCollectionPoints( CollectionID, (int) reward.Points * -1 );
player.SendLocalizedMessage( 1073621 ); // Your reward has been placed in your backpack.
player.PlaySound( 0x5A7 );
}
else if ( item != null )
{
player.SendLocalizedMessage( 1074361 ); // The reward could not be given. Make sure you have room in your pack.
item.Delete();
}
reward.OnGiveReward( player, this, hue );
player.SendGump( new ComunityCollectionGump( player, this, Location ) );
}
示例4: EndChew
public static void EndChew(PlayerMobile m)
{
Timer t = (Timer)m_Table[m];
if (t != null)
t.Stop();
m_Table.Remove(m);
m.SendMessage("You spit the chew out.");
m.Emote("*spits!*");
if (m.Female)
{
m.PlaySound(820);
}
else
{
m.PlaySound(1094);
}
}
示例5: CanPlayerLoot
public static bool CanPlayerLoot(PlayerMobile player)
{
if ( player.AccessLevel > AccessLevel.Player )
return true;
if ( !player.Alive )
{
player.PlaySound( 1069 ); //hey
player.SendMessage( "You are dead!" );
return false;
}
if ( player.Blessed )
{
player.PlaySound( 1069 ); //hey
player.SendMessage( "You can't loot while you are invulnerable!");
return false;
}
foreach ( Mobile other in player.GetMobilesInRange( 5 ) )
{
if ( ! ( other is PlayerMobile ) )
continue;
if ( player != other && !other.Hidden && other.AccessLevel == AccessLevel.Player )
{
player.PlaySound(1069); //hey
player.SendMessage("You are too close to another player to do that!");
return false; //ignore self, staff and hidden
}
}
return true;
}
示例6: CheckItem
public static bool CheckItem(PlayerMobile player, Item item)
{
for (int i = player.Quests.Count - 1; i >= 0; i --)
{
BaseQuest quest = player.Quests[i];
for (int j = quest.Objectives.Count - 1; j >= 0; j --)
{
BaseObjective objective = quest.Objectives[j];
if (objective is ObtainObjective)
{
ObtainObjective obtain = (ObtainObjective)objective;
if (obtain.Update(item))
{
if (quest.Completed)
quest.OnCompleted();
else if (obtain.Completed)
player.PlaySound(quest.UpdateSound);
return true;
}
}
}
}
return false;
}
示例7: BerserkTimer
public BerserkTimer( PlayerMobile owner )
: base(TimeSpan.FromSeconds( 2.0 ), TimeSpan.FromSeconds( 2.0 ))
{
m_Owner = owner;
m_Owner.PlaySound( 0x20F );
m_Owner.PlaySound( m_Owner.Body.IsFemale ? 0x338 : 0x44A );
m_Owner.FixedParticles( 0x376A, 1, 31, 9961, 1160, 0, EffectLayer.Waist );
m_Owner.FixedParticles( 0x37C4, 1, 31, 9502, 43, 2, EffectLayer.Waist );
BuffInfo.AddBuff( m_Owner, new BuffInfo( BuffIcon.Berserk, 1080449, 1115021, "15\t3", false ) );
m_Owner.Berserk = true;
}
示例8: TryToAssemble
public void TryToAssemble( PlayerMobile m )
{
if( !(m.Backpack != null && !m.Backpack.Deleted && m.Alive && !m.Paralyzed) )
return;
Type type = CraftResources.GetResourceType( this.Resource );
if( m.Backpack.ConsumeTotal( type, 100 ) )
{
m.SendMessage( "You assemble the item." );
this.Amount = 1;
this.Assembled = true;
this.Name = "Assembled Item Pieces";
this.ItemID = 6584;
this.InvalidateProperties();
m.PlaySound( 79 );
}
else
m.SendMessage( "You need 100 " + Commands.LevelSystemCommands.AddSpacesToString( type.ToString().Replace("Server.Items.", "") ) + " in order to assemble this item." );
}
示例9: OfferHeal
public virtual void OfferHeal( PlayerMobile m )
{
Direction = GetDirectionTo( m );
Say( 501229 ); //You look like you need some healing my child.
m.PlaySound( 0x1F2 );
m.FixedEffect( 0x376A, 9, 32 );
m.Hits = m.HitsMax;
m.Poison = null;
}
示例10: PlayNote
public static void PlayNote( PlayerMobile from, string note, BaseInstrument instrument )
{
try
{
//Pix: added sanity checks
if (from == null || instrument == null) return;
int it = (int)GetInstrumentType(instrument);
int nv;
// If Musicianship is not GM, there is a chance of playing a random note.
if (!BaseInstrument.CheckMusicianship(from))
{
instrument.ConsumeUse(from);
nv = Utility.Random(25);
//Console.WriteLine("Random note value chosen: {0}", nv );
}
else
{
nv = (int)GetNoteValue(note);
}
//Pix: added bounds checking
if (nv >= 0 && it >=0 &&
nv < NoteSounds.Length && it < NoteSounds[nv].Length)
{
int sound = NoteSounds[nv][it];
from.PlaySound(sound, true);
}
}
catch (Exception ex)
{
Scripts.Commands.LogHelper.LogException(ex);
}
}
示例11: HandleUse
public void HandleUse( PlayerMobile m )
{
if( this.Type == ItemType.Weapon && !m.Masterwork.HasWeaponPieces )
{
m.Masterwork.HasWeaponPieces = true;
m.Masterwork.MasterworkWeapon = this.Masterwork;
m.Masterwork.WeaponResource = this.Resource;
}
else if( this.Type == ItemType.Armour && !m.Masterwork.HasArmourPieces )
{
m.Masterwork.HasArmourPieces = true;
m.Masterwork.MasterworkArmour = this.Masterwork;
m.Masterwork.ArmourResource = this.Resource;
}
else if( this.Type == ItemType.Clothing && !m.Masterwork.HasClothingPieces )
{
m.Masterwork.HasClothingPieces = true;
m.Masterwork.MasterworkClothing = this.Masterwork;
m.Masterwork.ClothingResource = this.Resource;
}
else
{
m.SendMessage( "You already have an assembled item of this type waiting to be crafted." );
return;
}
m.PlaySound( 87 );
m.SendMessage( "You ready the item to be fixed. The next time you craft an exceptional item of the same type and resource, it will be converted into the refurbished piece you just used." );
this.Delete();
}
示例12: OfferHeal
public virtual void OfferHeal( PlayerMobile m )
{
Direction = GetDirectionTo( m );
if ( m.CheckYoungHealTime() )
{
Say( "Vous semblez avoir besoin de soin" ); // You look like you need some healing my child.
m.PlaySound( 0x1F2 );
m.FixedEffect( 0x376A, 9, 32 );
m.Hits = m.HitsMax;
}
else
{
Say( "Je ne peux rien faire de plus pour vous" ); // I can do no more for you at this time.
}
}
示例13: IncogMode
public void IncogMode(PlayerMobile pm)
{
string originalName = pm.Name;
pm.HueMod = pm.Race.RandomSkinHue();
pm.NameMod = pm.Female ? NameList.RandomName("female") : NameList.RandomName("male");
LoggingCustom.LogDisguise(DateTime.Now + "\t" + originalName + "\t" + pm.NameMod);
if (pm.Race != null)
{
pm.SetHairMods(pm.Race.RandomHair(pm.Female), pm.Race.RandomFacialHair(pm.Female));
pm.HairHue = pm.Race.RandomHairHue();
pm.FacialHairHue = pm.Race.RandomHairHue();
}
pm.FixedParticles(0x373A, 10, 15, 5036, EffectLayer.Head);
pm.PlaySound(0x3BD);
BaseArmor.ValidateMobile(pm);
BaseClothing.ValidateMobile(pm);
//BuffInfo.AddBuff( Caster, new BuffInfo( BuffIcon.Incognito, 1075819, length, Caster ) );
}
示例14: DoStep
public static void DoStep( PlayerMobile pm )
{
switch ( pm.KRStartingQuestStep )
{
case 0:
{
pm.MoveToWorld( new Point3D( 3503, 2574, 14 ), Map.Trammel );
break;
}
case 1:
{
pm.MoveToWorld( new Point3D( 3648, 2678, -2 ), Map.Trammel );
/*
* Introduction
*
* Greetings, Traveler! Welcome to
* the world of Ultima Online.
*
* I am Gwen. I am here to help
* you learn the basic skills
* needed to thrive in your travels
* to come.
*
* Left click on the Next button
* to continue.
*/
pm.SendGump( new KRStartingQuestGump( 1078606, 1077642, true ) );
pm.PlaySound( 0x505 );
break;
}
case 2:
{
/*
* Movement
*
* Movement is controlled with the mouse.
*
* Do you see the glowing light?
*
* Right click and hold over it
* to walk in that direction.
*/
pm.SendGump( new KRStartingQuestGump( 1078235, 1077643, false ) );
pm.PlaySound( 0x505 );
pm.Send( new DisplayWaypoint( Serial.MinusOne, new Point3D( 3648, 2674, 0 ), Map.Trammel, WaypointType.QuestDestination, true, 1078266 ) ); // Walk Toward Here
break;
}
case 3:
{
pm.Send( new RemoveWaypoint( Serial.MinusOne ) );
pm.Send( new DisplayWaypoint( Serial.MinusOne, new Point3D( 3648, 2666, 0 ), Map.Trammel, WaypointType.QuestDestination, true, 1078267 ) ); // Run Toward Here
/*
* Movement
*
* Very good!
*
* Right click and hold, further
* away, to run to the glowing light.
*/
pm.SendGump( new KRStartingQuestGump( 1078235, 1077644, false ) );
pm.PlaySound( 0x505 );
break;
}
case 4:
{
pm.Send( new RemoveWaypoint( Serial.MinusOne ) );
pm.Send( new DisplayWaypoint( Serial.MinusOne, new Point3D( 3648, 2655, 0 ), Map.Trammel, WaypointType.QuestDestination, true, 1078268 ) ); // Pathfind Toward Here
/*
* Movement
*
* Very good!
*
* Good!
*
* Do you see the glowing light?
*
* Right click and hold over it to
* run in that direction.
*/
pm.SendGump( new KRStartingQuestGump( 1078235, 1077645, false ) );
pm.PlaySound( 0x505 );
break;
}
case 5:
{
//.........这里部分代码省略.........
示例15: CompleteQuest
public static void CompleteQuest(PlayerMobile from, BaseQuest quest)
{
if (quest == null)
return;
for (int i = 0; i < quest.Objectives.Count; i ++)
{
BaseObjective obj = quest.Objectives[i];
obj.Complete();
}
from.SendLocalizedMessage(1046258, null, 0x23); // Your quest is complete.
from.SendGump(new MondainQuestGump(quest, MondainQuestGump.Section.Complete, false, true));
from.PlaySound(quest.CompleteSound);
quest.OnCompleted();
}