protected override void BuildCraftedItem(GamePlayer player, DBCraftedItem recipe, ItemTemplate itemToCraft) { GameSiegeWeapon siegeweapon = null; switch ((eObjectType)itemToCraft.Object_Type) { case eObjectType.SiegeBalista: { siegeweapon = new GameSiegeBallista(); } break; case eObjectType.SiegeCatapult: { siegeweapon = new GameSiegeCatapult(); } break; case eObjectType.SiegeCauldron: { siegeweapon = new GameSiegeCauldron(); } break; case eObjectType.SiegeRam: { siegeweapon = new GameSiegeRam(); } break; case eObjectType.SiegeTrebuchet: { siegeweapon = new GameSiegeTrebuchet(); } break; default: { base.BuildCraftedItem(player, recipe, itemToCraft); return; } } //actually stores the Id_nb of the siegeweapon siegeweapon.ItemId = itemToCraft.Id_nb; siegeweapon.LoadFromDatabase(itemToCraft); siegeweapon.CurrentRegion = player.CurrentRegion; siegeweapon.Heading = player.Heading; siegeweapon.X = player.X; siegeweapon.Y = player.Y; siegeweapon.Z = player.Z; siegeweapon.Realm = player.Realm; siegeweapon.AddToWorld(); }
protected override void BuildCraftedItem(GamePlayer player, Recipe recipe) { var product = recipe.Product; GameSiegeWeapon siegeweapon; switch ((eObjectType)product.Object_Type) { case eObjectType.SiegeBalista: { siegeweapon = new GameSiegeBallista(); } break; case eObjectType.SiegeCatapult: { siegeweapon = new GameSiegeCatapult(); } break; case eObjectType.SiegeCauldron: { siegeweapon = new GameSiegeCauldron(); } break; case eObjectType.SiegeRam: { siegeweapon = new GameSiegeRam(); } break; case eObjectType.SiegeTrebuchet: { siegeweapon = new GameSiegeTrebuchet(); } break; default: { base.BuildCraftedItem(player, recipe); return; } } //actually stores the Id_nb of the siegeweapon siegeweapon.ItemId = product.Id_nb; siegeweapon.LoadFromDatabase(product); siegeweapon.CurrentRegion = player.CurrentRegion; siegeweapon.Heading = player.Heading; siegeweapon.Position = player.Position; siegeweapon.Realm = player.Realm; siegeweapon.AddToWorld(); }