本文整理汇总了C#中Server.Mobiles.BaseCreature.PackItem方法的典型用法代码示例。如果您正苦于以下问题:C# BaseCreature.PackItem方法的具体用法?C# BaseCreature.PackItem怎么用?C# BaseCreature.PackItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobiles.BaseCreature
的用法示例。
在下文中一共展示了BaseCreature.PackItem方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GiveArtifact
public static void GiveArtifact(BaseCreature bc)
{
//**Begin Artifact Randomness**\\
if ( percent > Utility.RandomDouble() ) // 0.7 = 70% = chance to drop
bc.PackItem(ArtifactList.RandomArtifact());
}
示例2: PackPicnicBasket
public static void PackPicnicBasket(BaseCreature solen)
{
if (1 > Utility.Random(100))
{
PicnicBasket basket = new PicnicBasket();
basket.DropItem(new BeverageBottle(BeverageType.Wine));
basket.DropItem(new CheeseWedge());
solen.PackItem(basket);
}
}
示例3: XmlAddChest
// modify these custom conversion methods to create unique paragons for spawners with this attachment
#region custom conversion methods
public virtual void XmlAddChest(BaseCreature bc, int treasureLevel)
{
if (bc == null) return;
bc.PackItem(new ParagonChest(bc.Name, treasureLevel));
}
示例4: AddChest
public static void AddChest(BaseCreature bc, int treasureLevel)
{
XmlParagon xa = GetXmlParagon(bc);
if (xa != null)
{
xa.XmlAddChest(bc, treasureLevel);
}
else
{
bc.PackItem(new ParagonChest(bc.Name, treasureLevel));
}
}
示例5: Spawn
protected void Spawn( Point3D p, Map map, BaseCreature spawn )
{
if ( map == null )
{
spawn.Delete();
return;
}
int x = p.X, y = p.Y;
for ( int j = 0; j < 20; ++j )
{
int tx = p.X - 2 + Utility.Random( 5 );
int ty = p.Y - 2 + Utility.Random( 5 );
LandTile t = map.Tiles.GetLandTile( tx, ty );
if ( t.Z == p.Z && ( (t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137) ) && !Spells.SpellHelper.CheckMulti( new Point3D( tx, ty, p.Z ), map ) )
{
x = tx;
y = ty;
break;
}
}
spawn.MoveToWorld( new Point3D( x, y, p.Z ), map );
if ( spawn is Kraken && 0.2 > Utility.RandomDouble() )
spawn.PackItem( new MessageInABottle( map == Map.Felucca ? Map.Felucca : Map.Trammel ) );
}
示例6: Spawn
//25JUL2008 Lord_Greywolf fix for bad X *** START ***
// protected void Spawn( Point2D p, Map map, BaseCreature spawn )
// {
// if ( map == null )
// {
// spawn.Delete();
// return;
// }
// int x = p.X, y = p.Y;
//// for ( int j = 0; j < 5; ++j )
//// {
//// int tx = p.X - 2 + Utility.Random( 5 );
//// int ty = p.Y - 2 + Utility.Random( 5 );
//// }
// spawn.MoveToWorld( new Point3D( x, y, 0 ), map );
// spawn.PackItem( new TreasureMessageChest() );
//}
protected void Spawn(Point2D p, Map map, BaseCreature spawn)
{
if (map == null) { spawn.Delete(); return; }
int x = p.X, y = p.Y;
if (map.CanSpawnMobile(x, y, 0))
{
spawn.MoveToWorld(new Point3D(x, y, 0), map);
}
else
{
int z = map.GetAverageZ(x, y);
if (map.CanSpawnMobile(x, y, z))
{
spawn.MoveToWorld(new Point3D(x, y, z), map);
}
else if (map.CanSpawnMobile(x, y, z + 10))
{
spawn.MoveToWorld(new Point3D(x, y, z + 10), map);
}
else if (map.CanSpawnMobile(x + 1, y + 1, z))
{
spawn.MoveToWorld(new Point3D(x + 1, y + 1, z), map);
}
else if (map.CanSpawnMobile(x + 1, y + 1, z + 10))
{
spawn.MoveToWorld(new Point3D(x + 1, y + 1, z + 10), map);
}
else
{
spawn.MoveToWorld(new Point3D(x - 1, y - 1, 100), map);
}
}
spawn.PackItem(new TreasureMessageChest(Utility.RandomMinMax((((m_Level - 1) * 400) + 100), (((m_Level - 1) * 400) + 500))));
}
示例7: TryPossessCreature
public static void TryPossessCreature(Mobile from, BaseCreature Subject)
{
if (from == null || Subject == null) return;
if (HasPermissionsToPossess(from, Subject))
{
if (Subject.NetState != null)
{
from.SendMessage("Target creature is already under player control!");
return;
}
if (from.AccessLevel < FullAccessStaffLevel)
{
if (IsInHouseOrBoat(Subject.Location, Map.Felucca))
{
from.SendMessage("You cannot possess a creature in a house or boat.");
return;
}
if (Subject.Blessed == true)
{
from.SendMessage("You cannot possess invulnerable mobs.");
return;
}
}
if (Subject.Controlled && !IsAuthorizedStaff(from))
{
from.SendMessage("You cannot possess tamed or summoned creatures!");
return;
}
//Subject.HasBeenPseudoseerControlled = true;
if (Subject.Backpack == null)
{
// create a backpack for things like animals that have no backpack
// ... this prevents client crash in case somebody has their pack auto-opening on login
Subject.PackItem(new Gold(1));
}
LoggingCustom.LogPseudoseer(DateTime.Now + "\t" + from.Account + "\t" + from.Name + "\tpossessing\t" + Subject + "\tRegion: " + Subject.Region + "\tLocation: " + Subject.Location);
ConnectClientToNPC(from.NetState, Subject);
}
else
{
from.SendMessage("You are not permitted to possess that creature type, only staff can grant this permission.");
}
}
示例8: CheckBarding
public static BaseInstrument CheckBarding(BaseCreature from)
{
BaseInstrument inst = BaseInstrument.GetInstrument(from);
if (inst == null)
{
if (from.Backpack == null)
return null;
inst = (BaseInstrument)from.Backpack.FindItemByType(typeof(BaseInstrument));
if (inst == null)
{
inst = new Harp();
inst.SuccessSound = 0x58B;
inst.FailureSound = 0x58C;
inst.Movable = false;
from.PackItem(inst);
}
}
BaseInstrument.SetInstrument(from, inst);
return inst;
}
示例9: Spawn
protected static void Spawn( Point3D p, Map map, BaseCreature spawn )
{
if ( map == null )
{
spawn.Delete();
return;
}
int x = p.X, y = p.Y;
for ( int j = 0; j < 20; ++j )
{
int tx = p.X - 2 + Utility.Random( 5 );
int ty = p.Y - 2 + Utility.Random( 5 );
LandTile t = map.Tiles.GetLandTile( tx, ty );
if ( t.Z == p.Z && ( (t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137) ) && !SpellHelper.CheckMulti( new Point3D( tx, ty, p.Z ), map ) )
{
x = tx;
y = ty;
break;
}
}
spawn.MoveToWorld( new Point3D( x, y, p.Z ), map );
if ( spawn is AncientLich && 0.1 > Utility.RandomDouble() )
spawn.PackItem( new MysticFishingNet() );
}
示例10: HandleInvaderDeath
public void HandleInvaderDeath(BaseCreature invader)
{
if (CurrentLevel.RewardItems != null && CurrentLevel.RewardItems.Count > 0)
{
Type selected = CurrentLevel.RewardItems.GetRandom();
if (selected.IsEqualOrChildOf<Item>())
{
var item = selected.CreateInstanceSafe<Item>();
if (item != null && Utility.RandomDouble() <= (CurrentLevel.DropChance/100))
{
invader.PackItem(item);
}
}
}
CurrentLevelKills++;
RemoveInvader(invader);
}