本文整理汇总了C#中Mobile.SendSound方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.SendSound方法的具体用法?C# Mobile.SendSound怎么用?C# Mobile.SendSound使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mobile
的用法示例。
在下文中一共展示了Mobile.SendSound方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if (!from.InRange(GetWorldLocation(), 2))
from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
else
{
from.CloseGump(typeof(InternalGump));
from.SendGump(new InternalGump(this));
from.SendSound(0x55);
}
}
示例2: OnDragDropInto
public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
{
if (!this.CheckHold(from, item, true, true))
return false;
BaseHouse house = BaseHouse.FindHouseAt(this);
if (house != null && house.IsLockedDown(this))
{
if (item is VendorRentalContract || (item is Container && ((Container)item).FindItemByType(typeof(VendorRentalContract)) != null))
{
from.SendLocalizedMessage(1062492); // You cannot place a rental contract in a locked down container.
return false;
}
if (!house.LockDown(from, item, false))
return false;
}
item.Location = new Point3D(p.X, p.Y, 0);
this.AddItem(item);
from.SendSound(this.GetDroppedSound(item), this.GetWorldLocation());
ItemFlags.SetTaken(item, true);
if (item.HonestyItem && item.HonestyPickup == DateTime.MinValue)
{
item.HonestyPickup = DateTime.UtcNow;
item.StartHonestyTimer();
from.SendLocalizedMessage(1151536); // You have three hours to turn this item in for Honesty credit, otherwise it will cease to be a quest item.
}
return true;
}
示例3: OnDragDropInto
public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
{
if ( !CheckHold( from, item, true, true ) )
return false;
item.Location = new Point3D( p.X, p.Y, 0 );
AddItem( item );
from.SendSound( GetDroppedSound( item ), GetWorldLocation() );
return true;
}
示例4: OnDragDrop
public override bool OnDragDrop( Mobile from, Item dropped )
{
/* TODO: Thou art giving me? and fame/karma for gold gifts */
if ( dropped is SmallBOD || dropped is LargeBOD )
{
if( Core.ML )
{
if( ((PlayerMobile)from).NextBODTurnInTime > DateTime.Now )
{
SayTo( from, 1079976 ); //
return false;
}
}
SmallBOD sbod = dropped as SmallBOD;
LargeBOD lbod = dropped as LargeBOD;
if ( !IsValidBulkOrder( dropped ) || !SupportsBulkOrders( from ) )
SayTo( from, 1045130 ); // That order is for some other shopkeeper.
else if ( ( sbod != null && !sbod.Complete ) || ( lbod != null && !lbod.Complete ) )
SayTo( from, 1045131 ); // You have not completed the order yet.
else
{
Item reward;
int gold, fame;
if ( sbod != null )
sbod.GetRewards( out reward, out gold, out fame );
else
lbod.GetRewards( out reward, out gold, out fame );
if ( reward != null || gold > 0 )
{
Item rewardgold = null;
if ( gold > 1000 )
rewardgold = new BankCheck( gold );
else if ( gold > 0 )
rewardgold = new Gold( gold );
/*if ( ( reward != null && !from.Backpack.CheckHold( from, reward, false ) ) || ( rewardgold != null && !from.Backpack.CheckHold( from, rewardgold, false ) ) )*/
if ( reward != null && rewardgold != null && from.Backpack.TryDropItems( from, false, reward, rewardgold ) )
{
from.SendSound( 0x3D );
SayTo( from, 1045132 ); // Thank you so much! Here is a reward for your effort.
Titles.AwardFame( from, fame, true );
OnSuccessfulBulkOrderReceive( from, dropped );
dropped.Delete();
return true;
}
else
{
SayTo( from, 1045129 ); // You do not have enough room in your backpack for the bulk request's reward.
if ( reward != null )
reward.Delete();
if ( rewardgold != null )
rewardgold.Delete();
}
}
}
return false;
}
return base.OnDragDrop( from, dropped );
}
示例5: OnDragDropInto
public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
{
if ( !CheckHold( from, item, true, true ) )
return false;
BaseHouse house = BaseHouse.FindHouseAt( this );
if ( house != null && house.IsLockedDown( this ) )
{
if ( item is VendorRentalContract || ( item is Container && ((Container)item).FindItemByType( typeof( VendorRentalContract ) ) != null ) )
{
from.SendLocalizedMessage( 1062492 ); // You cannot place a rental contract in a locked down container.
return false;
}
if ( !house.LockDown( from, item, false ) )
return false;
}
item.Location = new Point3D( p.X, p.Y, 0 );
AddItem( item );
from.SendSound( GetDroppedSound( item ), GetWorldLocation() );
// ARTEGORDONMOD
// Begin mod for spawner release of items
// set flag to have item taken off spawner list at next defrag
ItemFlags.SetTaken(item,true);
// End mod for spawner release of items
return true;
}
示例6: OnDragDropInto
public override bool OnDragDropInto( Mobile from, Item dropped, Point3D point3d )
{
BaseHouse housefoundation = BaseHouse.FindHouseAt(this);
Item item = dropped as Item;
if (dropped.Weight + dropped.TotalWeight + this.TotalWeight >= this.MaxWeight)
{
if (IsLockedDown)
from.SendMessage(38,"Seems to be just a Decoration Mailbox.");
if (IsSecure)
from.SendMessage(38,"This will be to much weight for the Mailbox to hold.");
return false;
}
if ((housefoundation == null) & (this.PublicCanDrop == true))
{
from.SendMessage(68,"You put that into the Mailbox.");
DropItem( dropped );
from.SendSound( GetDroppedSound( item ), GetWorldLocation() );
AdjustMailboxFlagUp(this);
return true;//false for the moment cause of losing bag
}
else if((housefoundation != null) & (this.IsSecure))
{
from.SendMessage(68,"You put that into the Mailbox.");
DropItem( dropped );
from.SendSound( GetDroppedSound( item ), GetWorldLocation() );
AdjustMailboxFlagUp(this);
return true;//false for the moment cause of losing bag
}
else
{
from.SendMessage(38,"You can not do that.");
return false;
}
}
示例7: StackWith
public virtual bool StackWith(Mobile from, DonatorDeed dropped, bool playSound)
{
if (dropped.GetType() == this.GetType() && dropped.ItemID == this.ItemID && dropped.Hue == this.Hue && this.Amount + dropped.Amount <= 65535)
{
if (this.LootType != dropped.LootType)
{
this.LootType = dropped.LootType;
}
this.Amount += dropped.Amount;
dropped.Delete();
if (playSound && from != null)
{
int soundID = this.GetDropSound();
if (soundID == -1)
{
soundID = 0x42;
}
from.SendSound(soundID, this.GetWorldLocation());
}
return true;
}
return false;
}
示例8: OnDragDropInto
public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
{
if (!this.CheckHold(from, item, true, true))
return false;
BaseHouse house = BaseHouse.FindHouseAt(this);
if (house != null && house.IsLockedDown(this))
{
if (item is VendorRentalContract || (item is Container && ((Container)item).FindItemByType(typeof(VendorRentalContract)) != null))
{
from.SendLocalizedMessage(1062492); // You cannot place a rental contract in a locked down container.
return false;
}
if (!house.LockDown(from, item, false))
return false;
}
item.Location = new Point3D(p.X, p.Y, 0);
this.AddItem(item);
from.SendSound(this.GetDroppedSound(item), this.GetWorldLocation());
ItemFlags.SetTaken(item, true);
return true;
}
示例9: OnDragDrop
public override bool OnDragDrop(Mobile m, Item dropped)
{
// trigger returns true if returnoverride
if (XmlScript.HasTrigger(this, TriggerName.onDragDrop) &&
UberScriptTriggers.Trigger(this, m, TriggerName.onDragDrop, dropped))
{
return true;
}
/* TODO: Thou art giving me? and fame/karma for gold gifts */
if (dropped is SmallBOD || dropped is LargeBOD)
{
var pm = m as PlayerMobile;
if (EraML && pm != null && pm.NextBODTurnInTime > DateTime.UtcNow)
{
SayTo(m, 1079976); // You'll have to wait a few seconds while I inspect the last order.
}
else
{
var sbod = dropped as SmallBOD;
var lbod = dropped as LargeBOD;
if (!IsValidBulkOrder(dropped) || !SupportsBulkOrders(m))
{
SayTo(m, 1045130); // That order is for some other shopkeeper.
}
else if ((sbod != null && !sbod.Complete) || (lbod != null && !lbod.Complete))
{
SayTo(m, 1045131); // You have not completed the order yet.
}
else
{
Item reward;
int currency, fame;
if (sbod != null)
{
sbod.GetRewards(out reward, out currency, out fame);
}
else
{
lbod.GetRewards(out reward, out currency, out fame);
}
if (reward != null || currency > 0)
{
Item rewardCurrency = null;
if (currency > PseudoSeerStone.MaxBODGoldRewardAllowed)
{
currency = PseudoSeerStone.MaxBODGoldRewardAllowed;
}
if (currency > 1000)
{
rewardCurrency = new BankCheck(currency);
}
else if (currency > 0)
{
rewardCurrency = new Gold(currency);
}
/*if ( ( reward != null && !from.Backpack.CheckHold( from, reward, false ) ) || ( rewardgold != null && !from.Backpack.CheckHold( from, rewardgold, false ) ) )*/
var items = new List<Item>();
if (reward != null)
{
m.SendMessage(String.Format("Attempting to drop a reward {0} ({1})", reward.GetType(), reward.PileWeight));
items.Add(reward);
}
if (rewardCurrency != null)
{
m.SendMessage(
String.Format("Attempting to drop a reward {0} ({1})", rewardCurrency.GetType(), rewardCurrency.PileWeight));
items.Add(rewardCurrency);
}
if (items.Count > 0 && m.Backpack.TryDropItems(m, false, items.ToArray()))
{
m.SendSound(0x3D);
SayTo(m, 1045132); // Thank you so much! Here is a reward for your effort.
Titles.AwardFame(m, fame, true);
OnSuccessfulBulkOrderReceive(m, dropped);
if (EraML && pm != null)
{
pm.NextBODTurnInTime = DateTime.UtcNow + TimeSpan.FromSeconds(10.0);
}
dropped.Delete();
return true;
}
SayTo(m, 1045129); // You do not have enough room in your backpack for the bulk request's reward.
//.........这里部分代码省略.........
示例10: OnDragDropInto
//Automatically stack if possible
public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
{
if ( Items.Count < DefaultMaxItems )
return base.OnDragDropInto( from, item, p );
else if ( TryDropItem( from, item, false ) )
{
int soundID = GetDropSound();
if ( soundID == -1 )
soundID = 0x42;
from.SendSound( soundID, GetWorldLocation() );
return true;
}
return false;
}
示例11: StackWith
public override bool StackWith( Mobile from, Item dropped, bool playSound )
{
if ( Stackable && dropped.Stackable && dropped.GetType() == GetType() && dropped.ItemID == ItemID && dropped.Hue == Hue )
{
if( (dropped.Amount + Amount) > 5 )
{
from.SendMessage( "You cannot stack more than five of these pieces together." );
return false;
}
if( ((ItemPiece)dropped).Resource != this.Resource || ((ItemPiece)dropped).Type != this.Type )
{
from.SendMessage( "You cannot stack pieces of different types or resources." );
return false;
}
if( ((ItemPiece)dropped).Assembled || this.Assembled )
{
from.SendMessage( "You cannot stack pieces that are already assembled." );
return false;
}
if( ((ItemPiece)dropped).Masterwork != this.Masterwork )
{
from.SendMessage( "You cannot stack pieces of different quality." );
return false;
}
if ( LootType != dropped.LootType )
LootType = LootType.Regular;
Amount += dropped.Amount;
dropped.Delete();
if ( playSound && from != null )
{
int soundID = GetDropSound();
if ( soundID == -1 )
soundID = 0x42;
from.SendSound( soundID, GetWorldLocation() );
}
return true;
}
return false;
}
示例12: StackWith
public override bool StackWith(Mobile from, Item dropped)
{
if (dropped is ResourceBit)
{
ResourceBit newBit = dropped as ResourceBit;
if (newBit.Resource == Resource)
{
this.Amount += newBit.Amount;
newBit.Delete();
if (from != null)
{
from.SendSound(0x42, GetWorldLocation());
}
}
else
return false;
}
return false;
}
示例13: OnDragDropInto
public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
{
if ( !CheckHold( from, item, true, true ) )
return false;
BaseHouse house = BaseHouse.FindHouseAt( this );
if ( house != null && house.IsLockedDown( this ) )
{
if ( !house.LockDown( from, item, false ) )
return false;
}
item.Location = new Point3D( p.X, p.Y, 0 );
AddItem( item );
from.SendSound( GetDroppedSound( item ), GetWorldLocation() );
return true;
}
示例14: OnDragDrop
public override bool OnDragDrop( Mobile from, Item dropped )
{
if ( dropped is SmallBOD || dropped is LargeBOD )
{
if( Core.ML )
{
if( ((PlayerMobile)from).NextBODTurnInTime > DateTime.Now )
{
SayTo( from, 1079976 ); //
return false;
}
}
if ( !IsValidBulkOrder( dropped ) || !SupportsBulkOrders( from ) )
{
SayTo( from, 1045130 ); // That order is for some other shopkeeper.
return false;
}
else if ( ( dropped is SmallBOD && !( (SmallBOD)dropped ).Complete ) || ( dropped is LargeBOD && !( (LargeBOD)dropped ).Complete ) )
{
SayTo( from, 1045131 ); // You have not completed the order yet.
return false;
}
Item reward;
int gold, fame;
if ( dropped is SmallBOD )
( (SmallBOD)dropped ).GetRewards( out reward, out gold, out fame );
else
( (LargeBOD)dropped ).GetRewards( out reward, out gold, out fame );
from.SendSound( 0x3D );
SayTo( from, 1045132 ); // Thank you so much! Here is a reward for your effort.
if ( reward != null )
from.AddToBackpack( reward );
if ( gold > 1000 )
from.AddToBackpack( new BankCheck( gold ) );
else if ( gold > 0 )
from.AddToBackpack( new Gold( gold ) );
Titles.AwardFame( from, fame, true );
OnSuccessfulBulkOrderReceive( from );
if( Core.ML )
{
((PlayerMobile)from).NextBODTurnInTime = DateTime.Now + TimeSpan.FromSeconds( 10.0 );
}
dropped.Delete();
return true;
}
return base.OnDragDrop( from, dropped );
}
示例15: OnDragDropInto
//This is called when an item is placed into an open container
public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
{
// Adam: Disallow dropping on an open Deco container
if ( base.Deco )
return false;
// adam: Don't invoke Use() on this FakeContainer when it's dropped into a container
if (item is FakeContainer)
(item as FakeContainer).ClearReadyState();
if ( !CheckHold( from, item, true, true ) )
return false;
// BaseHouse house = BaseHouse.FindHouseAt( this );
// if ( house != null && house.IsLockedDown( this ) && !house.LockDown( from, item, false ) )
// return false;
item.Location = new Point3D( p.X, p.Y, 0 );
AddItem( item );
from.SendSound( GetDroppedSound( item ), GetWorldLocation() );
return true;
}