本文整理汇总了C#中Server.Mobile.AddToBackpack方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.AddToBackpack方法的具体用法?C# Mobile.AddToBackpack怎么用?C# Mobile.AddToBackpack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobile
的用法示例。
在下文中一共展示了Mobile.AddToBackpack方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
Container pack = from.Backpack;
if( from.InRange( this.GetWorldLocation(), 1 ) )
{
if (pack != null && pack.ConsumeTotal( typeof( HoneyComb ), 1 ) )
{
from.SendMessage( "*You centrifuge the honeycomb and separate honey and wax*" );
{
from.AddToBackpack( new RawBeeswax() );
from.AddToBackpack( new JarHoney() );
}
}
else
{
from.SendMessage( "You need a honeycomb to use in this kettle" );
return;
}
}
else
{
from.SendMessage( "You are too far away from this" );
return;
}
}
示例2: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
MerlinsStaff Staff = from.FindItemOnLayer(Layer.TwoHanded) as MerlinsStaff;
if (Parent != from)
{
from.SendMessage("You remember that you must equip the staff to summon a portal to Merlin");
}
else
{
Item marker1 = from.Backpack.FindItemByType(typeof(Marker1));
if (marker1 != null)
{
marker1.Delete();
from.AddToBackpack(new Marker2());
from.AddToBackpack(new Tablet());
from.FixedParticles(0x3709, 1, 30, 9904, 1108, 6, EffectLayer.RightFoot);
from.SendGump(new MerlinsQuestGump6(from));
from.SendMessage("Muahahahaha!!!! You fool!");
Talon2 tl = new Talon2();
tl.Map = from.Map;
tl.Location = from.Location;
Delete();
}
else
{
from.SendMessage("You have no right to have this staff!!!!");
}
}
}
示例3: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if( from.InRange( this.GetWorldLocation(), 1 ) )
{
if ( m_UsesRemaining == 1 )
{
from.AddToBackpack( new HoneyComb() );
InvalidateProperties();
from.SendMessage( "As you pull out the last honeycomb the beehive collapses" );
this.Delete();
}
else
{
from.AddToBackpack( new HoneyComb() );
m_UsesRemaining -= 1;
InvalidateProperties();
from.SendMessage( "You take a honeycomb out of the beehive." );
}
}
else
{
from.SendMessage( "You are too far away from the beehive." );
return;
}
}
示例4: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( !IsChildOf (from.Backpack))
{
from.SendMessage( "In order to make a wish and crush the coal with your hands, it must be in your backpack." );
}
else
{
Effects.PlaySound( from, from.Map, 0x2E3 );
if( Utility.Random( 100 ) < 100 )
switch ( Utility.Random( 3 ) )
{
case 0: from.AddToBackpack( new Diamond(Utility.RandomList( 6 , 7 , 8 , 8 , 9 , 10 ) ) );
{
from.SendMessage( "You use all your brute strength - and turn the Magical Coal into Diamonds." );
}
break;
case 1: from.AddToBackpack( new SantasGiftBag2009() );
{
from.SendMessage( "You promise to be good next year - and the Magical Coal hears your words and gives you a gift." );
}
break;
case 2: from.AddToBackpack( new ShazzysBest() );
{
from.SendMessage( "You promise to be EXTRA good next year - and the Magical Coal hears your words and gives you a gift." );
}
break;
}
this.Delete();
}
}
示例5: GivePowerScrollTo
public static void GivePowerScrollTo( Mobile m, PowerScroll ps )
{
if( ps == null || m == null ) //sanity
return;
m.SendLocalizedMessage( 1049524 ); // You have received a scroll of power!
if( !Core.SE || m.Alive )
m.AddToBackpack( ps );
else
{
if( m.Corpse != null && !m.Corpse.Deleted )
m.Corpse.DropItem( ps );
else
m.AddToBackpack( ps );
}
if( m is PlayerMobile )
{
PlayerMobile pm = (PlayerMobile)m;
for( int j = 0; j < pm.JusticeProtectors.Count; ++j )
{
Mobile prot = pm.JusticeProtectors[j];
if( prot.Map != m.Map || prot.Kills >= 5 || prot.Criminal || !JusticeVirtue.CheckMapRegion( m, prot ) )
continue;
int chance = 0;
switch( VirtueHelper.GetLevel( prot, VirtueName.Justice ) )
{
case VirtueLevel.Seeker: chance = 60; break;
case VirtueLevel.Follower: chance = 80; break;
case VirtueLevel.Knight: chance = 100; break;
}
if( chance > Utility.Random( 100 ) )
{
PowerScroll powerScroll = new PowerScroll( ps.Skill, ps.Value );
prot.SendLocalizedMessage( 1049368 ); // You have been rewarded for your dedication to Justice!
if( !Core.SE || prot.Alive )
prot.AddToBackpack( powerScroll );
else
{
if( prot.Corpse != null && !prot.Corpse.Deleted )
prot.Corpse.DropItem( powerScroll );
else
prot.AddToBackpack( powerScroll );
}
}
}
}
}
示例6: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
from.SendMessage( 53, "ERROR: Addon no longer in use. A new addon deed has been added to your backpack" );
if ( this.ItemID == 0x14E7 )
from.AddToBackpack( new NewHitchingPostEastDeed() );
else if ( this.ItemID == 0x14E8 )
from.AddToBackpack( new NewHitchingPostSouthDeed() );
this.Delete();
}
示例7: Dismiss
public virtual void Dismiss( Mobile owner )
{
RemoveAttendant( owner );
if ( m_BindedToPlayer )
owner.AddToBackpack( new PersonalAttendantDeed( owner ) );
else
owner.AddToBackpack( new PersonalAttendantDeed() );
Delete();
}
示例8: OnMoveOver
public override bool OnMoveOver( Mobile m )
{
PlayerMobile pm = m as PlayerMobile;
if ( pm == null )
return false;
QuestSystem qs = pm.Quest;
if ( qs != null && qs is HaochisTrialsQuest )
{
if ( qs.IsObjectiveInProgress( typeof( RetrieveKatanaObjective ) ) )
{
QuestObjective obj = qs.FindObjective( typeof( RetrieveKatanaObjective ) );
if ( obj != null )
obj.Complete();
qs.AddConversation( new SpotSwordConversation() );
m.AddToBackpack( new DaimyoHaochisKatana() );
qs.AddObjective( new GiveSwordDaimyoObjective() );
}
if ( qs.IsObjectiveInProgress( typeof( GiveSwordDaimyoObjective ) ) )
{
List<Item> list = m.Backpack.Items;
DaimyoHaochisKatana katana = null;
for ( int i = 0; i < list.Count; i++ )
{
if ( list[i] is DaimyoHaochisKatana )
{
katana = list[i] as DaimyoHaochisKatana;
break;
}
}
if ( katana == null )
{
qs.AddConversation( new SpotSwordConversation() );
m.AddToBackpack( new DaimyoHaochisKatana() );
}
}
}
return true;
}
示例9: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if ( RootParent == from || ( from.InRange( GetWorldLocation(), 3 ) && from.InLOS( GetWorldLocation() ) ) )
{
if ( !Unrolled )
{
Unroll();
MoveToWorld( from.Location, from.Map );
}
else if ( ItemID == 0x0A55 )
{
if ( Parent == null )
{
IPooledEnumerable eable = from.GetItemsInRange( 7 );
Campfire fire = null;
foreach ( Item item in eable )
{
if ( item is Campfire )
{
fire = (Campfire)item;
break;
}
}
eable.Free();
if ( fire != null )
{
if ( fire.CanLogout( from ) )
new BedRollLogoutMenu().SendTo( from.NetState );
else
from.SendAsciiMessage( "Your camp is not yet secure." );
}
else
{
Roll();
from.AddToBackpack( this );
}
}
else
{
// is in a container (not on ground)
Roll();
from.AddToBackpack( this );
}
}
}
else
{
from.SendAsciiMessage( "You must be closer to use that." );
}
}
示例10: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage(1042001);
}
else
{
/////////////////Prize Cincture Deed
switch (Utility.Random(8))
{
case 0: from.AddToBackpack(new AmberCincture()); break;
case 1: from.AddToBackpack(new AzureCincture()); break;
case 2: from.AddToBackpack(new GoldCincture()); break;
case 3: from.AddToBackpack(new IndigoCincture()); break;
case 4: from.AddToBackpack(new IvoryCincture()); break;
case 5: from.AddToBackpack(new JadeCincture()); break;
case 6: from.AddToBackpack(new SilverCincture()); break;
case 7: from.AddToBackpack(new CrimsonCincture()); break;
}
this.Delete();
}
}
示例11: Carve
public void Carve( Mobile from, Item item )
{
from.SendMessage( "You slice several of the leaves off the nightshade plant." );
from.AddToBackpack( new Nightshade( Utility.RandomMinMax( 8, 15 ) ) );
Delete();
}
示例12: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
else
{
this.Delete();
Item i = null;
switch ( Utility.Random( (from.BAC >= 5) ? 6 : 5) )
{
case 0: i = new OrigamiButterfly(); break;
case 1: i = new OrigamiSwan(); break;
case 2: i = new OrigamiFrog(); break;
case 3: i = new OrigamiShape(); break;
case 4: i = new OrigamiSongbird(); break;
case 5: i = new OrigamiFish(); break;
}
if( i != null )
from.AddToBackpack( i );
from.SendLocalizedMessage( 1070822 ); // You fold the paper into an interesting shape.
}
}
示例13: GiveArtifactTo
public static void GiveArtifactTo(Mobile m)
{
var item = Activator.CreateInstance(m_Artifacts[Utility.Random(m_Artifacts.Length)]) as Item;
if (item == null)
{
return;
}
if (m.AddToBackpack(item))
{
m.SendLocalizedMessage(1072223); // An item has been placed in your backpack.
m.SendLocalizedMessage(1062317);
// For your valor in combating the fallen beast, a special artifact has been bestowed on you.
}
else if (m.BankBox.TryDropItem(m, item, false))
{
m.SendLocalizedMessage(1072224); // An item has been placed in your bank box.
m.SendLocalizedMessage(1062317);
// For your valor in combating the fallen beast, a special artifact has been bestowed on you.
}
else
{
// Item was placed at feet by m.AddToBackpack
m.SendLocalizedMessage(1072523);
// You find an artifact, but your backpack and bank are too full to hold it.
}
}
示例14: OnDoubleClick
public override void OnDoubleClick( Mobile m )
{
Item a = m.Backpack.FindItemByType( typeof(EnchantedRope) );
if ( a != null )
{
Item b = m.Backpack.FindItemByType( typeof(GlowingShipModel) );
if ( b != null )
{
Item c = m.Backpack.FindItemByType( typeof(SacredAnchor) );
if ( c != null )
{
Item d = m.Backpack.FindItemByType( typeof(SpecialSeaMap) );
if ( d != null )
{
m.AddToBackpack( new MasterOfTheSeaChest() );
a.Delete();
b.Delete();
c.Delete();
d.Delete();
m.SendMessage( "You place the artifacts into the Sea Chest for a Full Master of the Sea Chest!" );
this.Delete();
}
}
}
}
else
{
m.SendMessage( "You are missing some artifacts." );
}
}
示例15: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if (from.AccessLevel > AccessLevel.Player)
{
from.SendAsciiMessage("Drop items in here for players to receive.");
DisplayTo(from);
return;
}
if (!IsChildOf(from.Backpack))
{
from.SendAsciiMessage("The scroll must be in your backpack when used.");
return;
}
Internalize(); //So you don't get overweight
Item[] items = FindItemsByType(typeof (Item), true);
bool inBank = false;
foreach (Item item in items)
{
if (!from.AddToBackpack(item))
{
from.BankBox.DropItem(item);
inBank = true;
}
}
from.SendAsciiMessage("The scroll summons treasures into your pack as you unravel it!");
if (inBank)
from.SendAsciiMessage("You are overweight, the treasures were added to your bank");
Delete();
}