public virtual bool OnUse(Mobile from) { GameObjectDescription god = (GameObjectDescription)GameObjectDescription.all[id]; if (god.Loots != null) { if (!(from is Character)) { return(false); } int lootMoney = 0; (from as Character).LootOwner = Guid; ArrayList loot = new ArrayList(); foreach (BaseTreasure l in god.Loots) { if (l.IsDrop()) { loot.AddRange(l.RandomDrop(ref lootMoney)); } } Treasure = (Item[])loot.ToArray(typeof(Item)); (from as Character).SendLootDetails(Guid, this, lootMoney); } return(true); }
public FishZone( float _x, float _y, float _z, float _radius, GameObjectDescription _desc ) { x = _x; y = _y; z = _z; radius = _radius * _radius; desc = _desc; }
public FishZone(float _x, float _y, float _z, float _radius, GameObjectDescription _desc) { x = _x; y = _y; z = _z; radius = _radius * _radius; desc = _desc; }
public bool CheckLoot(Character c, float reussite) { GameObjectDescription god = (GameObjectDescription)GameObjectDescription.all[id]; if (god == null) { return(false); } ArrayList loot = new ArrayList(); c.LootOwner = Guid; if (god.Loots != null) { /* * foreach( Loot l in god.Loots ) * { * if ( Utility.RandomDouble() * 100 < l.Probability ) * { * int n = (int)( reussite * l.Probability ); * if ( n < 1 ) * n = 1; * if ( n > 10 ) * n = 6; * loot.Add( l.Create( n ) ); * } * }*/ int lootMoney = 0; foreach (BaseTreasure l in god.Loots) { if (l.IsDrop()) { ArrayList ret = l.RandomDrop(ref lootMoney); if (ret != null) { loot.AddRange(ret); } } } Treasure = (Item[])loot.ToArray(typeof(Item)); c.SendLootDetails(Guid, this, lootMoney); } else { return(false); } return(true); }
public void Add( float x, float y, float z, float radius, GameObjectDescription d ) { zones.Add( new FishZone( x, y, z, radius, d ) ); }
public void Add(float x, float y, float z, float radius, GameObjectDescription d) { zones.Add(new FishZone(x, y, z, radius, d)); }