private void SpawnGold(Hero hero, Vector3D position) { ItemTypeGenerator itemGenerator = new ItemTypeGenerator(hero.InGameClient); Item item = itemGenerator.CreateItem("Gold1", 0x00000178, ItemType.Gold); item.Count = RandomHelper.Next(1, 3); DropItem(hero, item, position); }
private void SpawnRandomDrop(Hero hero, Vector3D postition) { ItemTypeGenerator itemGenerator = new ItemTypeGenerator(hero.InGameClient); // randomize ItemType ItemType[] allValues = (ItemType[])Enum.GetValues(typeof(ItemType)); ItemType type = allValues[RandomHelper.Next(allValues.Length)]; Item item = itemGenerator.GenerateRandomElement(type); DropItem(hero, item, postition); }
public void PickUpGold(int itemId) { Item collectedItem = _owner.InGameClient.items[itemId]; Item goldItem; if (_goldObjectId == 0) { Logger.Debug("creating gold item"); ItemTypeGenerator itemGenerator = new ItemTypeGenerator(_owner.InGameClient); goldItem = itemGenerator.CreateItem("Gold1", 0x00000178, ItemType.Gold); _goldObjectId = goldItem.ItemId; goldItem.Count = collectedItem.Count; goldItem.RevealInInventory(_owner, 0, 0, 18); // Equipment slot 18 ==> Gold } else { goldItem = _owner.InGameClient.items[_goldObjectId]; goldItem.Count += collectedItem.Count; } GameAttributeMap attributes = new GameAttributeMap(); attributes[GameAttribute.ItemStackQuantityLo] = goldItem.Count; attributes.SendMessage(_owner.InGameClient, _goldObjectId); }
public void SpawnGold(Mooege.Core.GS.Player.Player player, Vector3D position) { ItemTypeGenerator itemGenerator = new ItemTypeGenerator(player.InGameClient); Item item = itemGenerator.CreateItem("Gold1", 0x00000178, ItemType.Gold); item.Count = RandomHelper.Next(1, 3); item.Drop(null, position); player.GroundItems[item.DynamicID] = item; }
public void SpawnRandomDrop(Mooege.Core.GS.Player.Player player, Vector3D position) { ItemTypeGenerator itemGenerator = new ItemTypeGenerator(player.InGameClient); // randomize ItemType ItemType[] allValues = (ItemType[])Enum.GetValues(typeof(ItemType)); ItemType type = allValues[RandomHelper.Next(allValues.Length)]; Item item = itemGenerator.GenerateRandomElement(type); item.Drop(null, position); // NOTE: The owner field for an item is only set when it is in the owner's inventory. /komiga player.GroundItems[item.DynamicID] = item; // FIXME: Hacky. /komiga }
// TODO: The inventory's gold item should not be created here. /komiga public void PickUpGold(uint itemID) { Item collectedItem = _owner.GroundItems[itemID]; if (_goldItem == null) { ItemTypeGenerator itemGenerator = new ItemTypeGenerator(_owner.InGameClient); _goldItem = itemGenerator.CreateItem("Gold1", 0x00000178, ItemType.Gold); _goldItem.Count = collectedItem.Count; _goldItem.Owner = _owner; _goldItem.SetInventoryLocation(18, 0, 0); // Equipment slot 18 ==> Gold _goldItem.Reveal(_owner); } else { _goldItem.Count += collectedItem.Count; } GameAttributeMap attributes = new GameAttributeMap(); attributes[GameAttribute.ItemStackQuantityLo] = _goldItem.Count; attributes.SendMessage(_owner.InGameClient, _goldItem.DynamicID); }