本文整理汇总了C#中Server.Items.LockableContainer类的典型用法代码示例。如果您正苦于以下问题:C# LockableContainer类的具体用法?C# LockableContainer怎么用?C# LockableContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LockableContainer类属于Server.Items命名空间,在下文中一共展示了LockableContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Target
public void Target( LockableContainer targ )
{
if ( Multis.BaseHouse.CheckLockedDownOrSecured( targ ) )
{
// You cannot cast this on a locked down item.
Caster.LocalOverheadMessage( MessageType.Regular, 0x22, 501761 );
}
else if ( targ.Locked || targ.LockLevel == 0 || targ is ParagonChest )
{
// Target must be an unlocked chest.
Caster.SendLocalizedMessage( 501762 );
}
else if ( CheckSequence() )
{
SpellHelper.Turn( Caster, targ );
Point3D loc = targ.GetWorldLocation();
Effects.SendLocationParticles(
EffectItem.Create( loc, targ.Map, EffectItem.DefaultDuration ),
0x376A, 9, 32, 5020 );
Effects.PlaySound( loc, targ.Map, 0x1FA );
// The chest is now locked!
Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501763 );
targ.LockLevel = -255; // signal magic lock
targ.Locked = true;
}
FinishSequence();
}
示例2: Target
public void Target( LockableContainer targ )
{
if ( targ.Locked || targ.LockLevel == 0 || targ.MaxLockLevel == 0 )
{
Caster.SendLocalizedMessage( 501762 ); // Target must be an unlocked chest.
}
else if ( targ.MaxLockLevel > 65 )
{
Caster.SendAsciiMessage( "This chest cannot be magically locked." );
}
else if ( CheckSequence() )
{
SpellHelper.Turn( Caster, targ );
Point3D loc = targ.GetWorldLocation();
Effects.SendLocationParticles(
EffectItem.Create( loc, targ.Map, EffectItem.DefaultDuration ),
0x376A, 9, 32, 5020 );
Effects.PlaySound( loc, targ.Map, 0x1FA );
// The chest is now locked!
Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501763 );
targ.LockLevel = -255; // signal magic lock
targ.Locked = true;
}
FinishSequence();
}
示例3: Target
public void Target( LockableContainer targ )
{
if ( Multis.BaseHouse.CheckSecured( targ ) )
{
// You cannot cast this on a secure item.
Caster.SendLocalizedMessage( 503098 );
}
else if ( CheckSequence() )
{
SpellHelper.Turn( Caster, targ );
Point3D loc = targ.GetWorldLocation();
Effects.SendLocationParticles(
EffectItem.Create( loc, targ.Map, EffectItem.DefaultDuration ),
0x376A, 9, 32, 5024 );
Effects.PlaySound( loc, targ.Map, 0x1FF );
if ( targ.Locked && targ.LockLevel != 0 )
{
double magery = Caster.Skills[SkillName.Magery].Value;
int level = (int)(magery * 0.8) - 4;
if ( targ.LockLevel == -255 )
{
targ.Locked = false;
FinishSequence();
return;
}
if ( level >= targ.RequiredSkill && !(targ is TreasureMapChest && ((TreasureMapChest)targ).Level > 2) )
{
targ.Locked = false;
if ( targ.LockLevel == 0 )
targ.LockLevel = -1;
}
else
{
// My spell does not seem to have an effect on that lock.
Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503099 );
}
}
else
{
// That did not need to be unlocked.
Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503101 );
}
}
FinishSequence();
}
示例4: Target
public void Target( LockableContainer targ )
{
if ( CheckSequence() )
{
SpellHelper.Turn( Caster, targ );
Point3D loc = targ.GetWorldLocation();
Effects.SendLocationParticles(
EffectItem.Create( loc, targ.Map, EffectItem.DefaultDuration ),
0x376A, 9, 32, 5024 );
Effects.PlaySound( loc, targ.Map, 0x1FF );
if ( targ.Locked )
{
if ( targ.LockLevel != 0 && ( targ.LockLevel == -255 || ( targ.MaxLockLevel <= 50 && Caster.Skills[SkillName.Magery].Value > targ.RequiredSkill ) ) )
{
targ.Locked = false;
if ( targ.LockLevel == -255 )
{
targ.LockLevel = targ.MaxLockLevel - 30;
if ( targ.RequiredSkill < targ.LockLevel )
targ.LockLevel = targ.RequiredSkill;
if ( targ.LockLevel < 1 )
targ.LockLevel = 1;
}
}
else
{
// My spell does not seem to have an effect on that lock.
Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503099 );
}
}
else
{
// That did not need to be unlocked.
Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503101 );
}
}
FinishSequence();
}
示例5: Fill
public static void Fill(LockableContainer cont, int level, Expansion e)
{
cont.Movable = false;
cont.Locked = true;
int numberItems;
if (level == 0)
{
cont.LockLevel = 0; // Can't be unlocked
cont.DropItem(new Gold(Utility.RandomMinMax(25, 50))); // reduced from 50 100
if (Utility.RandomDouble() < 0.75)
{
cont.DropItem(new TreasureMap(0, Map.Felucca));
}
}
else
{
cont.TrapType = TrapType.ExplosionTrap;
cont.TrapPower = level * 25;
cont.TrapLevel = level;
switch (level)
{
case 1:
cont.RequiredSkill = 36;
break;
case 2:
cont.RequiredSkill = 76;
break;
case 3:
cont.RequiredSkill = 84;
break;
case 4:
cont.RequiredSkill = 92;
break;
case 5:
cont.RequiredSkill = 95;
break;
case 6:
cont.RequiredSkill = 95;
break;
}
cont.LockLevel = cont.RequiredSkill - 10;
cont.MaxLockLevel = cont.RequiredSkill + 40;
cont.DropItem(new Gold(level * 1000, level * 2000));
for (int i = 0; i < level * 5; ++i)
{
cont.DropItem(Loot.RandomScroll(0, 63, SpellbookType.Regular));
}
if (e >= Expansion.SE)
{
switch (level)
{
case 1:
numberItems = 2;
break;
case 2:
numberItems = 4;
break;
case 3:
numberItems = 7;
break;
case 4:
numberItems = 10;
break;
case 5:
numberItems = 20;
break;
case 6:
numberItems = 30;
break;
default:
numberItems = 0;
break;
}
}
else
{
numberItems = level * 6;
}
for (int i = 0; i < numberItems; ++i)
{
Item item = Loot.RandomArmorOrShieldOrWeapon();
if (item is BaseWeapon)
{
var weapon = (BaseWeapon)item;
int damageLevel = PseudoSeerStone.GetDamageLevel(level);
if (PseudoSeerStone.HighestDamageLevelSpawn < damageLevel)
{
if (damageLevel == 5 && PseudoSeerStone.ReplaceVanqWithSkillScrolls)
//.........这里部分代码省略.........
示例6: Verify
private int Verify( LockableContainer container )
{
if (container == null || container.KeyValue == 0)
{
From.SendAsciiMessage("You can only trap lockable chests.");
return 1005638; // You can only trap lockable chests.
}
if (From.Map != container.Map || !From.InRange(container.GetWorldLocation(), 2))
{
int OldHue = From.SpeechHue;
From.SpeechHue = 0;
From.SayTo(From, true, "I can't reach that.");
From.SpeechHue = OldHue;
return 500446; // That is too far away.
}
if (!container.Movable)
{
return 502944; // You cannot trap this item because it is locked down.
}
if (!container.IsAccessibleTo(From))
{
From.SendAsciiMessage("That belongs to someone else.");
return 502946; // That belongs to someone else.
}
if (container.Locked)
{
From.SendAsciiMessage("You can only trap an unlocked object.");
return 502943; // You can only trap an unlocked object.
}
if (container.TrapType != TrapType.None)
{
From.SendAsciiMessage("You can only place one trap on an object at a time.");
return 502945; // You can only place one trap on an object at a time.
}
return 0;
}
示例7: Fill
public static void Fill( LockableContainer cont, int level )
{
}
示例8: Fill
public static void Fill( LockableContainer cont, int level )
{
cont.Movable = false;
cont.TrapType = Utility.RandomBool() ? TrapType.PoisonTrap : TrapType.ExplosionTrap;
cont.TrapPower = level * 25;
cont.Locked = true;
switch ( level )
{
// Adam: add level 0 (trainer chests)
case 0: cont.RequiredSkill = Utility.RandomMinMax (30, 37) ; break;
case 1: cont.RequiredSkill = 36; break;
case 2: cont.RequiredSkill = 76; break;
case 3: cont.RequiredSkill = 84; break;
case 4: cont.RequiredSkill = 92; break;
case 5: cont.RequiredSkill = 100; break;
}
cont.LockLevel = cont.RequiredSkill - 10;
cont.MaxLockLevel = cont.RequiredSkill + 40;
// adam: change treasure map chest loot MIN-MAX so as to decrease daily take home
if (level != 0)
cont.DropItem(
new Gold( Utility.RandomMinMax(
(int)(((double)((level * 1000) / 3)) * .75), // min is 75% of MAX
(level * 1000) / 3 ) ) );
// skin tone creme for level 4 & 5 chests
if (Utility.RandomDouble() < 0.05 && level > 3)
{
cont.DropItem(new SkinHueCreme());
}
// adam: scrolls * 3 and not 5
for ( int i = 0; i < level * 3; ++i )
{
int minCircle = level;
int maxCircle = (level + 3);
PackScroll( cont, minCircle, maxCircle );
}
// plus "level chances" for magic jewelry & clothing
switch (level)
{
case 0: // Adam: trainer chest
case 1: // none
break;
case 2:
PackMagicItem( cont, 1, 1, 0.05 );
break;
case 3:
PackMagicItem( cont, 1, 2, 0.10 );
PackMagicItem( cont, 1, 2, 0.05 );
break;
case 4:
PackMagicItem( cont, 2, 3, 0.10 );
PackMagicItem( cont, 2, 3, 0.05 );
PackMagicItem( cont, 2, 3, 0.02 );
break;
case 5:
PackMagicItem(cont, 3, 3, 0.10);
PackMagicItem(cont, 3, 3, 0.05);
PackMagicItem(cont, 3, 3, 0.02);
break;
}
// TreasureMap( int level, Map map
// 5% chance to get a treasure map
// Changed chance for tmap to 1%
if (level != 0)
if (Utility.RandomDouble() < 0.01)
{
int mlevel = level;
// 20% chance to get a treasure map one level better than the level of this chest
if (Utility.RandomDouble() < 0.20)
mlevel += (level < 5) ? 1 : 0; // bump up the map level by one
TreasureMap map = new TreasureMap (mlevel, Map.Felucca);
cont.DropItem( map ); // drop it baby!
}
// if You're doing a level 3, 4, or 5 chest you have a 1.5%, 2%, or 2.5% chance to get a monster statue
double chance = 0.00 + (((double)level) * 0.005);
if ( (level > 3) && (Utility.RandomDouble() < chance) )
{
int ndx = level - 3;
MonsterStatuette mx =
new MonsterStatuette(m_monsters[ndx][Utility.Random(m_monsters[ndx].Length)]);
mx.LootType = LootType.Regular; // not blessed
cont.DropItem( mx ); // drop it baby!
}
TreasureMapChest.PackRegs(cont, level * 10);
TreasureMapChest.PackGems(cont, level * 5);
}
示例9: Fill
public static void Fill( LockableContainer cont, int level )
{
cont.Movable = false;
cont.Locked = true;
if( level == 0 )
{
cont.LockLevel = 0; // Can't be unlocked
if( Utility.RandomDouble() < 0.75 )
cont.DropItem( new TreasureMap( 0, Map.Backtrol ) );
}
else
{
cont.TrapType = TrapType.ExplosionTrap;
cont.TrapPower = level * 25;
cont.TrapLevel = level;
switch( level )
{
case 1: cont.RequiredSkill = 36; break;
case 2: cont.RequiredSkill = 76; break;
case 3: cont.RequiredSkill = 84; break;
case 4: cont.RequiredSkill = 92; break;
case 5: cont.RequiredSkill = 100; break;
case 6: cont.RequiredSkill = 100; break;
}
cont.LockLevel = cont.RequiredSkill - 10;
cont.MaxLockLevel = cont.RequiredSkill + 40;
for( int i = 0; i < level * 5; ++i )
cont.DropItem( Loot.RandomScroll( 0, 63, SpellbookType.Regular ) );
for( int i = 0; i < level * 6; ++i )
{
Item item;
if( Core.AOS )
item = Loot.RandomArmorOrShieldOrWeaponOrJewelry();
else
item = Loot.RandomArmorOrShieldOrWeapon();
if( item is BaseWeapon )
{
BaseWeapon weapon = (BaseWeapon)item;
if( Core.SE )
{
int attributeCount;
int min, max;
GetRandomAOSStats( out attributeCount, out min, out max );
BaseRunicTool.ApplyAttributesTo( weapon, attributeCount, min, max );
}
else
{
weapon.DamageLevel = (WeaponDamageLevel)Utility.Random( 6 );
weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random( 6 );
weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random( 6 );
}
cont.DropItem( item );
}
else if( item is BaseArmor )
{
BaseArmor armor = (BaseArmor)item;
if( Core.SE )
{
int attributeCount;
int min, max;
GetRandomAOSStats( out attributeCount, out min, out max );
BaseRunicTool.ApplyAttributesTo( armor, attributeCount, min, max );
}
else
{
armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random( 6 );
armor.Durability = (ArmorDurabilityLevel)Utility.Random( 6 );
}
cont.DropItem( item );
}
else if( item is BaseHat )
{
BaseHat hat = (BaseHat)item;
if( Core.SE )
{
int attributeCount;
int min, max;
GetRandomAOSStats( out attributeCount, out min, out max );
BaseRunicTool.ApplyAttributesTo( hat, attributeCount, min, max );
}
//.........这里部分代码省略.........
示例10: PackMagicItem
public static void PackMagicItem( LockableContainer cont, int minLevel, int maxLevel, double chance )
{
if (chance <= Utility.RandomDouble())
return;
Item item = Loot.RandomClothingOrJewelry();
if ( item == null )
return;
if ( item is BaseClothing )
((BaseClothing)item).SetRandomMagicEffect( minLevel, maxLevel );
else if ( item is BaseJewel )
((BaseJewel)item).SetRandomMagicEffect( minLevel, maxLevel );
cont.DropItem( item );
}
示例11: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 2:
{
m_Chest = reader.ReadItem<LockableContainer>();
m_Crate = reader.ReadItem<LockableContainer>();
m_Filled = reader.ReadBool();
}
goto case 1;
case 1:
m_Prisoner = reader.ReadMobile<BaseCreature>();
goto case 0;
case 0:
break;
}
}
示例12: Fill
public static void Fill(LockableContainer cont, int level)
{
cont.Movable = false;
cont.Locked = true;
cont.TrapType = TrapType.ExplosionTrap;
cont.TrapPower = level * 25;
switch ( level )
{
case 0: cont.RequiredSkill = 1; break;
case 1: cont.RequiredSkill = 36; break;
case 2: cont.RequiredSkill = 76; break;
case 3: cont.RequiredSkill = 84; break;
case 4: cont.RequiredSkill = 92; break;
case 5: cont.RequiredSkill = 100; break;
}
cont.LockLevel = cont.RequiredSkill - 10;
cont.MaxLockLevel = cont.RequiredSkill + 40;
double maskChance = 0.1 * level;
if ( Utility.RandomDouble() < maskChance )
{
Item mask = null;
switch ( Utility.Random( 4 ) )
{
case 0: mask = new OrcishKinMask(); break;
case 1: mask = new TribalMask(); break;
case 2: mask = new DeerMask(); break;
case 3:
default:mask = new BearMask(); break;
}
cont.DropItem( mask );
}
//int gold = 1000 * level;
//cont.DropItem( new Gold( gold ) );
for ( int i = 0; i < level * 5; ++i )
cont.DropItem( Loot.RandomScroll( 0, 63, SpellbookType.Regular ) );
/*for (int i = 0; i < level * 2; i++)
{
cont.DropItem(new Gold(Utility.RandomMinMax(100, 600)));
// this give magic weapons over 25% of the time with a 15% chance for a vanq even at level 1. That is insane.
Item item = Loot.RandomArmorOrShieldOrWeapon();
if (item is BaseWeapon)
{
BaseWeapon weapon = (BaseWeapon)item;
weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(6);
weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(6);
weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6);
cont.DropItem(item);
}
else if (item is BaseArmor)
{
BaseArmor armor = (BaseArmor)item;
armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6);
armor.Durability = (ArmorDurabilityLevel)Utility.Random(6);
cont.DropItem(item);
}
}*/
for ( int i = 0; i < level; ++i )
{
// This is much more sane.
LootPack.OldSuperBoss.Generate( cont );
}
int reagents;
if ( level == 0 )
reagents = 12;
else
reagents = level * 3;
for ( int i = 0; i < reagents; i++ )
{
Item item = Loot.RandomPossibleReagent();
item.Amount = Utility.RandomMinMax( 20, 60 );
cont.DropItem( item );
}
int gems;
if ( level == 0 )
gems = 2;
else
gems = level * 3;
for ( int i = 0; i < gems; i++ )
{
Item item = Loot.RandomGem();
//.........这里部分代码省略.........
示例13: Acquire
private bool Acquire( object target, out int message )
{
LockableContainer container = target as LockableContainer;
message = Verify( container );
if ( message > 0 )
{
return false;
}
else
{
m_Container = container;
return true;
}
}
示例14: PackScroll
private static void PackScroll( LockableContainer cont, int circle )
{
int min = (circle - 1) * 8;
cont.DropItem( Loot.RandomScroll( min, min + 7, SpellbookType.Regular ) );
}
示例15: Fill
public static void Fill( LockableContainer cont, int level )
{
cont.Movable = false;
cont.TrapEnabled = false;
cont.Locked = false;
int bandies = CoreAI.SpiritDepotBandies;
int ghpots = CoreAI.SpiritDepotGHPots;
int regs = CoreAI.SpiritDepotReagents;
int trpots = CoreAI.SpiritDepotTRPots;
Item item = null;
// add a couple lesser explosion potions
// these are for batteling hiders in the cave and not for damage
for( int ix=0; ix < 2; ix++ )
{
item = new LesserExplosionPotion();
cont.DropItem(item);
}
// add bandages
item = new Bandage(bandies);
cont.DropItem(item);
// add greater heal potions
for( int ix=0; ix < ghpots; ix++ )
{
item = new GreaterHealPotion();
cont.DropItem(item);
}
// add total refresh potions
for( int ix=0; ix < trpots; ix++ )
{
item = new TotalRefreshPotion();
cont.DropItem(item);
}
// drop reagents
cont.DropItem( new BagOfReagents( regs ) );
// drop res scroll
cont.DropItem( new ResurrectionScroll() );
return;
}